diff --git a/Apps.Crowdin/Actions/FileActions.cs b/Apps.Crowdin/Actions/FileActions.cs index bc38d7f..093ba0b 100644 --- a/Apps.Crowdin/Actions/FileActions.cs +++ b/Apps.Crowdin/Actions/FileActions.cs @@ -1,6 +1,4 @@ -using System.Reflection; -using Apps.Crowdin.Api; -using Apps.Crowdin.Models.Dtos; +using Apps.Crowdin.Api; using Apps.Crowdin.Models.Entities; using Apps.Crowdin.Models.Request.File; using Apps.Crowdin.Models.Request.Project; @@ -12,9 +10,7 @@ using Blackbird.Applications.Sdk.Common.Invocation; using Blackbird.Applications.SDK.Extensions.FileManagement.Interfaces; using Blackbird.Applications.Sdk.Utils.Parsers; -using Crowdin.Api; using Crowdin.Api.SourceFiles; -using Crowdin.Api.Storage; using RestSharp; namespace Apps.Crowdin.Actions; diff --git a/Apps.Crowdin/Api/CrowdinClient.cs b/Apps.Crowdin/Api/CrowdinClient.cs index edec4af..6840a43 100644 --- a/Apps.Crowdin/Api/CrowdinClient.cs +++ b/Apps.Crowdin/Api/CrowdinClient.cs @@ -1,11 +1,6 @@ using Apps.Crowdin.Constants; -using Apps.Crowdin.Models.Dtos; using Blackbird.Applications.Sdk.Common.Authentication; -using Blackbird.Applications.Sdk.Utils.Extensions.Files; -using Blackbird.Applications.Sdk.Utils.Extensions.Http; using Crowdin.Api; -using Newtonsoft.Json; -using RestSharp; namespace Apps.Crowdin.Api; diff --git a/Apps.Crowdin/DataSourceHandlers/EnumHandlers/TypeDataSource.cs b/Apps.Crowdin/DataSourceHandlers/EnumHandlers/TypeDataSource.cs deleted file mode 100644 index f8a4823..0000000 --- a/Apps.Crowdin/DataSourceHandlers/EnumHandlers/TypeDataSource.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Blackbird.Applications.Sdk.Common.Dictionaries; - -namespace Apps.Crowdin.DataSourceHandlers.EnumHandlers; - -public class TypeDataSource : IStaticDataSourceHandler -{ - public Dictionary GetData() - { - return new() - { - {"auto", "auto"}, - {"android", "android"}, - {"macosx", "macosx"}, - {"resx", "resx"}, - {"properties", "properties"}, - {"gettext", "gettext"}, - {"yaml", "yaml"}, - {"php", "php"}, - {"json", "json"}, - {"xml", "xml"}, - {"ini", "ini"}, - {"rc", "rc"}, - {"resw", "resw"}, - {"resjson", "resjson"}, - {"qtts", "qtts"}, - {"joomla", "joomla"}, - {"chrome", "chrome"}, - {"dtd", "dtd"}, - {"dklang", "dklang"}, - {"flex", "flex"}, - {"nsh", "nsh"}, - {"wxl", "wxl"}, - {"xliff", "xliff"}, - {"xliff_two", "xliff_two"}, - {"html", "html"}, - {"haml", "haml"}, - {"txt", "txt"}, - {"csv", "csv"}, - {"md", "md"}, - {"mdx_v1", "mdx_v1"}, - {"mdx_v2", "mdx_v2"}, - {"flsnp", "flsnp"}, - {"fm_html", "fm_html"}, - {"fm_md", "fm_md"}, - {"mediawiki", "mediawiki"}, - {"docx", "docx"}, - {"xlsx", "xlsx"}, - {"sbv", "sbv"}, - {"properties_play", "properties_play"}, - {"properties_xml", "properties_xml"}, - {"maxthon", "maxthon"}, - {"go_json", "go_json"}, - {"dita", "dita"}, - {"idml", "idml"}, - {"mif", "mif"}, - {"stringsdict", "stringsdict"}, - {"plist", "plist"}, - {"vtt", "vtt"}, - {"vdf", "vdf"}, - {"srt", "srt"}, - {"stf", "stf"}, - {"toml", "toml"}, - {"contentful_rt", "contentful_rt"}, - {"svg", "svg"}, - {"js", "js"}, - {"coffee", "coffee"}, - {"ts", "ts"}, - {"i18next_json ", "i18next_json"}, - {"xaml", "xaml"}, - {"arb", "arb"}, - {"adoc", "adoc"}, - {"fbt", "fbt"}, - {"webxml", "webxml"}, - {"nestjs_i18n", "nestjs_i18n"} - }; - } -} \ No newline at end of file diff --git a/Apps.Crowdin/Models/Dtos/AddFileRequestDto.cs b/Apps.Crowdin/Models/Dtos/AddFileRequestDto.cs deleted file mode 100644 index bfe749f..0000000 --- a/Apps.Crowdin/Models/Dtos/AddFileRequestDto.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Crowdin.Api.SourceFiles; -using Newtonsoft.Json; - -namespace Apps.Crowdin.Models.Dtos; - -public class AddFileRequestDto -{ - [JsonProperty("storageId")] - public long StorageId { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("branchId")] - public int? BranchId { get; set; } - - [JsonProperty("directoryId")] - public int? DirectoryId { get; set; } - - [JsonProperty("title")] - public string? Title { get; set; } - - [JsonProperty("context")] - public string? Context { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("importOptions")] - public FileImportOptions? ImportOptions { get; set; } - - [JsonProperty("exportOptions")] - public FileExportOptions? ExportOptions { get; set; } - - [JsonProperty("excludedTargetLanguages")] - public List? ExcludedTargetLanguages { get; set; } - - [JsonProperty("attachLabelIds")] - public ICollection? AttachLabelIds { get; set; } -} \ No newline at end of file diff --git a/Apps.Crowdin/Models/Dtos/DataWrapper.cs b/Apps.Crowdin/Models/Dtos/DataWrapper.cs deleted file mode 100644 index ad5578c..0000000 --- a/Apps.Crowdin/Models/Dtos/DataWrapper.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Newtonsoft.Json; - -namespace Apps.Crowdin.Models.Dtos; - -public class DataWrapper -{ - [JsonProperty("data")] - public T Data { get; set; } -} \ No newline at end of file diff --git a/Apps.Crowdin/Models/Dtos/FileDto.cs b/Apps.Crowdin/Models/Dtos/FileDto.cs deleted file mode 100644 index 047384b..0000000 --- a/Apps.Crowdin/Models/Dtos/FileDto.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Crowdin.Api; -using Crowdin.Api.SourceFiles; -using Newtonsoft.Json; - -namespace Apps.Crowdin.Models.Dtos; - -public class FileDto -{ - [JsonProperty("id")] - public long Id { get; set; } - - [JsonProperty("projectId")] - public int ProjectId { get; set; } - - [JsonProperty("branchId")] - public int? BranchId { get; set; } - - [JsonProperty("directoryId")] - public int? DirectoryId { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - - [JsonProperty("title")] - public string? Title { get; set; } - - [JsonProperty("context")] - public string? Context { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("path")] - public string Path { get; set; } - - [JsonProperty("status")] - public FileStatus Status { get; set; } - - [JsonProperty("revisionId")] - public int RevisionId { get; set; } - - [JsonProperty("priority")] - public Priority Priority { get; set; } - - [JsonProperty("importOptions")] - public FileImportOptions? ImportOptions { get; set; } - - [JsonProperty("exportOptions")] - public FileExportOptions? ExportOptions { get; set; } - - [JsonProperty("excludedTargetLanguages")] - public string[]? ExcludedTargetLanguages { get; set; } - - [JsonProperty("createdAt")] - public DateTimeOffset CreatedAt { get; set; } - - [JsonProperty("updatedAt")] - public DateTimeOffset? UpdatedAt { get; set; } -} \ No newline at end of file diff --git a/Apps.Crowdin/Models/Dtos/StorageResourceDto.cs b/Apps.Crowdin/Models/Dtos/StorageResourceDto.cs deleted file mode 100644 index 2cb09ad..0000000 --- a/Apps.Crowdin/Models/Dtos/StorageResourceDto.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Newtonsoft.Json; - -namespace Apps.Crowdin.Models.Dtos; - -public class StorageResourceDto -{ - [JsonProperty("id")] - public long Id { get; set; } - - [JsonProperty("fileName")] - public string FileName { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/Apps.Crowdin/Models/Entities/FileEntity.cs b/Apps.Crowdin/Models/Entities/FileEntity.cs index 59557d7..74cf40f 100644 --- a/Apps.Crowdin/Models/Entities/FileEntity.cs +++ b/Apps.Crowdin/Models/Entities/FileEntity.cs @@ -1,5 +1,4 @@ -using Apps.Crowdin.Models.Dtos; -using Apps.Crowdin.Webhooks.Models.Payload.File; +using Apps.Crowdin.Webhooks.Models.Payload.File; using Blackbird.Applications.Sdk.Common; using Crowdin.Api.SourceFiles; using File = Crowdin.Api.SourceFiles.File; @@ -68,21 +67,6 @@ public FileEntity(FileResource file) IsModified = false; } - public FileEntity(FileDto file) - { - Id = file.Id.ToString(); - ProjectId = file.ProjectId.ToString(); - BranchId = file.BranchId.ToString(); - DirectoryId = file.DirectoryId.ToString(); - Name = file.Name; - Title = file.Title; - Type = file.Type; - Path = file.Path; - Status = file.Status.ToString(); - CreatedAt = file.CreatedAt.DateTime; - IsModified = false; - } - public FileEntity(FilePayloadWithProject file) { Id = file.Id.ToString(); diff --git a/Apps.Crowdin/Models/Request/File/AddNewFileRequest.cs b/Apps.Crowdin/Models/Request/File/AddNewFileRequest.cs index 9581785..f496503 100644 --- a/Apps.Crowdin/Models/Request/File/AddNewFileRequest.cs +++ b/Apps.Crowdin/Models/Request/File/AddNewFileRequest.cs @@ -22,7 +22,4 @@ public class AddNewFileRequest [Display("Attach label IDs")] public IEnumerable? AttachLabelIds { get; set; } - - [Display("Type", Description = "File type, by default: auto"), StaticDataSource(typeof(TypeDataSource))] - public string? Type { get; set; } } \ No newline at end of file