update libs
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Api.Models
|
||||
{
|
||||
internal class Category
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
|
||||
public class AssetStoreCategoryResolver : DefaultContractResolver
|
||||
{
|
||||
private Dictionary<string, string> _propertyConversions;
|
||||
|
||||
public AssetStoreCategoryResolver()
|
||||
{
|
||||
_propertyConversions = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(Category.Name), "assetstore_name" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversions.ContainsKey(propertyName))
|
||||
return _propertyConversions[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedCategoryResolver : DefaultContractResolver
|
||||
{
|
||||
private static CachedCategoryResolver _instance;
|
||||
public static CachedCategoryResolver Instance => _instance ?? (_instance = new CachedCategoryResolver());
|
||||
|
||||
private Dictionary<string, string> _propertyConversion;
|
||||
|
||||
private CachedCategoryResolver()
|
||||
{
|
||||
this.NamingStrategy = new SnakeCaseNamingStrategy();
|
||||
_propertyConversion = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(Category.Name), "name" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversion.ContainsKey(propertyName))
|
||||
return _propertyConversion[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5897866bc65f5834dab1f17371daada7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Api/Models/Category.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,80 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Api.Models
|
||||
{
|
||||
internal class Package
|
||||
{
|
||||
public string PackageId { get; set; }
|
||||
public string VersionId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string Category { get; set; }
|
||||
public bool IsCompleteProject { get; set; }
|
||||
public string RootGuid { get; set; }
|
||||
public string RootPath { get; set; }
|
||||
public string ProjectPath { get; set; }
|
||||
public string Modified { get; set; }
|
||||
public string Size { get; set; }
|
||||
public string IconUrl { get; set; }
|
||||
|
||||
public class AssetStorePackageResolver : DefaultContractResolver
|
||||
{
|
||||
private static AssetStorePackageResolver _instance;
|
||||
public static AssetStorePackageResolver Instance => _instance ?? (_instance = new AssetStorePackageResolver());
|
||||
|
||||
private Dictionary<string, string> _propertyConversions;
|
||||
|
||||
private AssetStorePackageResolver()
|
||||
{
|
||||
_propertyConversions = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(Package.VersionId), "id" },
|
||||
{ nameof(Package.IsCompleteProject), "is_complete_project" },
|
||||
{ nameof(Package.RootGuid), "root_guid" },
|
||||
{ nameof(Package.RootPath), "root_path" },
|
||||
{ nameof(Package.ProjectPath), "project_path" },
|
||||
{ nameof(Package.IconUrl), "icon_url" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversions.ContainsKey(propertyName))
|
||||
return _propertyConversions[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedPackageResolver : DefaultContractResolver
|
||||
{
|
||||
private static CachedPackageResolver _instance;
|
||||
public static CachedPackageResolver Instance => _instance ?? (_instance = new CachedPackageResolver());
|
||||
|
||||
private Dictionary<string, string> _propertyConversion;
|
||||
|
||||
private CachedPackageResolver()
|
||||
{
|
||||
this.NamingStrategy = new SnakeCaseNamingStrategy();
|
||||
_propertyConversion = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(Package.PackageId), "package_id" },
|
||||
{ nameof(Package.VersionId), "version_id" },
|
||||
{ nameof(Package.IsCompleteProject), "is_complete_project" },
|
||||
{ nameof(Package.RootGuid), "root_guid" },
|
||||
{ nameof(Package.RootPath), "root_path" },
|
||||
{ nameof(Package.IconUrl), "icon_url" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversion.ContainsKey(propertyName))
|
||||
return _propertyConversion[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e9f0b99820061b49abf6e8cf544a727
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Api/Models/Package.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,41 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Api.Models
|
||||
{
|
||||
internal class PackageAdditionalData
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
public string PackageId { get; set; }
|
||||
public string VersionId { get; set; }
|
||||
public string CategoryId { get; set; }
|
||||
public string Modified { get; set; }
|
||||
public string Size { get; set; }
|
||||
|
||||
public class AssetStorePackageResolver : DefaultContractResolver
|
||||
{
|
||||
private static AssetStorePackageResolver _instance;
|
||||
public static AssetStorePackageResolver Instance => _instance ?? (_instance = new AssetStorePackageResolver());
|
||||
|
||||
private Dictionary<string, string> _propertyConversions;
|
||||
|
||||
private AssetStorePackageResolver()
|
||||
{
|
||||
_propertyConversions = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(PackageAdditionalData.PackageId), "id" },
|
||||
{ nameof(PackageAdditionalData.CategoryId), "category_id" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversions.ContainsKey(propertyName))
|
||||
return _propertyConversions[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0663f29f3fcd0e34ab77338d1bdbb528
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Api/Models/PackageAdditionalData.cs
|
||||
uploadId: 724584
|
||||
@@ -0,0 +1,51 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AssetStoreTools.Api.Models
|
||||
{
|
||||
internal class User
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string SessionId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string PublisherId { get; set; }
|
||||
public bool IsPublisher => !string.IsNullOrEmpty(PublisherId);
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return
|
||||
$"{nameof(Id)}: {Id}\n" +
|
||||
$"{nameof(Name)}: {Name}\n" +
|
||||
$"{nameof(Username)}: {Username}\n" +
|
||||
$"{nameof(PublisherId)}: {PublisherId}\n" +
|
||||
$"{nameof(IsPublisher)}: {IsPublisher}\n" +
|
||||
$"{nameof(SessionId)}: [HIDDEN]";
|
||||
}
|
||||
|
||||
public class AssetStoreUserResolver : DefaultContractResolver
|
||||
{
|
||||
private static AssetStoreUserResolver _instance;
|
||||
public static AssetStoreUserResolver Instance => _instance ?? (_instance = new AssetStoreUserResolver());
|
||||
|
||||
private Dictionary<string, string> _propertyConversions;
|
||||
|
||||
private AssetStoreUserResolver()
|
||||
{
|
||||
_propertyConversions = new Dictionary<string, string>()
|
||||
{
|
||||
{ nameof(User.SessionId), "xunitysession" },
|
||||
{ nameof(User.PublisherId), "publisher" }
|
||||
};
|
||||
}
|
||||
|
||||
protected override string ResolvePropertyName(string propertyName)
|
||||
{
|
||||
if (_propertyConversions.ContainsKey(propertyName))
|
||||
return _propertyConversions[propertyName];
|
||||
|
||||
return base.ResolvePropertyName(propertyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: caf38df5cd685a345a1ebec8f7651c93
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 115
|
||||
packageName: Asset Store Publishing Tools
|
||||
packageVersion: 12.0.1
|
||||
assetPath: Packages/com.unity.asset-store-tools/Editor/Api/Models/User.cs
|
||||
uploadId: 724584
|
||||
Reference in New Issue
Block a user