2020-01-16 05:32:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
2020-01-18 22:09:32 +00:00
|
|
|
|
using System.Linq;
|
2020-01-16 05:32:30 +00:00
|
|
|
|
using System.Net.Http;
|
2020-01-18 22:09:32 +00:00
|
|
|
|
using System.Net.Http.Headers;
|
2020-01-16 05:32:30 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using GraphQL.Client;
|
|
|
|
|
using GraphQL.Client.Http;
|
|
|
|
|
using GraphQL.Common.Request;
|
|
|
|
|
using Wabbajack.Common;
|
2020-01-18 22:09:32 +00:00
|
|
|
|
using Wabbajack.Lib.FileUploader;
|
2020-01-16 05:32:30 +00:00
|
|
|
|
using Wabbajack.Lib.GraphQL.DTOs;
|
|
|
|
|
using Path = Alphaleonis.Win32.Filesystem.Path;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Lib.GraphQL
|
|
|
|
|
{
|
|
|
|
|
public class GraphQLService
|
|
|
|
|
{
|
|
|
|
|
public static readonly Uri BaseURL = new Uri("https://build.wabbajack.org/graphql");
|
|
|
|
|
|
2020-01-18 22:09:32 +00:00
|
|
|
|
public static async Task<List<UploadedFile>> GetUploadedFiles()
|
2020-01-16 05:32:30 +00:00
|
|
|
|
{
|
|
|
|
|
var client = new GraphQLHttpClient(BaseURL);
|
|
|
|
|
var query = new GraphQLRequest
|
|
|
|
|
{
|
|
|
|
|
Query = @"
|
|
|
|
|
query uploadedFilesQuery {
|
|
|
|
|
uploadedFiles {
|
|
|
|
|
id
|
|
|
|
|
name
|
|
|
|
|
hash
|
|
|
|
|
uri
|
|
|
|
|
uploader
|
|
|
|
|
uploadDate
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
};
|
|
|
|
|
var result = await client.SendQueryAsync(query);
|
|
|
|
|
return result.GetDataFieldAs<List<UploadedFile>>("uploadedFiles");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|