smartling-api-sdk-nodejs 2.24.3 → 2.24.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.scannerwork/report-task.txt +2 -2
  2. package/api/glossaries/dto/date-filter-dto.ts +10 -0
  3. package/api/glossaries/dto/entry-sorting-dto.ts +8 -0
  4. package/api/glossaries/dto/export-entries-filter-dto.ts +25 -0
  5. package/api/glossaries/dto/label-type-dto.ts +6 -0
  6. package/api/glossaries/dto/user-filter-dto.ts +6 -0
  7. package/api/glossaries/enums/date-filter-type.ts +6 -0
  8. package/api/glossaries/enums/entry-state.ts +5 -0
  9. package/api/glossaries/enums/export-format.ts +5 -0
  10. package/api/glossaries/enums/filter-level.ts +5 -0
  11. package/api/glossaries/enums/index.ts +8 -0
  12. package/api/glossaries/enums/label-type.ts +5 -0
  13. package/api/glossaries/enums/sort-direction.ts +4 -0
  14. package/api/glossaries/enums/sort-field.ts +5 -0
  15. package/api/glossaries/enums/tbx-version.ts +4 -0
  16. package/api/glossaries/index.ts +13 -0
  17. package/api/glossaries/params/export-entries-parameters.ts +160 -0
  18. package/api/strings/dto/create-strings-response-dto.ts +10 -0
  19. package/api/strings/dto/created-string-item-dto.ts +9 -0
  20. package/api/strings/dto/process-state-enum.ts +7 -0
  21. package/api/strings/dto/process-statistics-dto.ts +8 -0
  22. package/api/strings/dto/process-status-dto.ts +12 -0
  23. package/api/strings/index.ts +24 -0
  24. package/api/strings/params/create-strings-parameters.ts +36 -0
  25. package/api/strings/params/string-item-parameters.ts +43 -0
  26. package/built/api/glossaries/dto/date-filter-dto.d.ts +9 -0
  27. package/built/api/glossaries/dto/date-filter-dto.js +3 -0
  28. package/built/api/glossaries/dto/date-filter-dto.js.map +1 -0
  29. package/built/api/glossaries/dto/entry-sorting-dto.d.ts +7 -0
  30. package/built/api/glossaries/dto/entry-sorting-dto.js +3 -0
  31. package/built/api/glossaries/dto/entry-sorting-dto.js.map +1 -0
  32. package/built/api/glossaries/dto/export-entries-filter-dto.d.ts +24 -0
  33. package/built/api/glossaries/dto/export-entries-filter-dto.js +3 -0
  34. package/built/api/glossaries/dto/export-entries-filter-dto.js.map +1 -0
  35. package/built/api/glossaries/dto/label-type-dto.d.ts +5 -0
  36. package/built/api/glossaries/dto/label-type-dto.js +3 -0
  37. package/built/api/glossaries/dto/label-type-dto.js.map +1 -0
  38. package/built/api/glossaries/dto/user-filter-dto.d.ts +5 -0
  39. package/built/api/glossaries/dto/user-filter-dto.js +3 -0
  40. package/built/api/glossaries/dto/user-filter-dto.js.map +1 -0
  41. package/built/api/glossaries/enums/date-filter-type.d.ts +6 -0
  42. package/built/api/glossaries/enums/date-filter-type.js +11 -0
  43. package/built/api/glossaries/enums/date-filter-type.js.map +1 -0
  44. package/built/api/glossaries/enums/entry-state.d.ts +5 -0
  45. package/built/api/glossaries/enums/entry-state.js +10 -0
  46. package/built/api/glossaries/enums/entry-state.js.map +1 -0
  47. package/built/api/glossaries/enums/export-format.d.ts +5 -0
  48. package/built/api/glossaries/enums/export-format.js +10 -0
  49. package/built/api/glossaries/enums/export-format.js.map +1 -0
  50. package/built/api/glossaries/enums/filter-level.d.ts +5 -0
  51. package/built/api/glossaries/enums/filter-level.js +10 -0
  52. package/built/api/glossaries/enums/filter-level.js.map +1 -0
  53. package/built/api/glossaries/enums/index.d.ts +8 -0
  54. package/built/api/glossaries/enums/index.js +20 -0
  55. package/built/api/glossaries/enums/index.js.map +1 -0
  56. package/built/api/glossaries/enums/label-type.d.ts +5 -0
  57. package/built/api/glossaries/enums/label-type.js +10 -0
  58. package/built/api/glossaries/enums/label-type.js.map +1 -0
  59. package/built/api/glossaries/enums/sort-direction.d.ts +4 -0
  60. package/built/api/glossaries/enums/sort-direction.js +9 -0
  61. package/built/api/glossaries/enums/sort-direction.js.map +1 -0
  62. package/built/api/glossaries/enums/sort-field.d.ts +5 -0
  63. package/built/api/glossaries/enums/sort-field.js +10 -0
  64. package/built/api/glossaries/enums/sort-field.js.map +1 -0
  65. package/built/api/glossaries/enums/tbx-version.d.ts +4 -0
  66. package/built/api/glossaries/enums/tbx-version.js +9 -0
  67. package/built/api/glossaries/enums/tbx-version.js.map +1 -0
  68. package/built/api/glossaries/index.d.ts +2 -0
  69. package/built/api/glossaries/index.js +5 -0
  70. package/built/api/glossaries/index.js.map +1 -1
  71. package/built/api/glossaries/params/export-entries-parameters.d.ts +35 -0
  72. package/built/api/glossaries/params/export-entries-parameters.js +133 -0
  73. package/built/api/glossaries/params/export-entries-parameters.js.map +1 -0
  74. package/built/api/strings/dto/create-strings-response-dto.d.ts +8 -0
  75. package/built/api/strings/dto/create-strings-response-dto.js +3 -0
  76. package/built/api/strings/dto/create-strings-response-dto.js.map +1 -0
  77. package/built/api/strings/dto/created-string-item-dto.d.ts +8 -0
  78. package/built/api/strings/dto/created-string-item-dto.js +3 -0
  79. package/built/api/strings/dto/created-string-item-dto.js.map +1 -0
  80. package/built/api/strings/dto/process-state-enum.d.ts +6 -0
  81. package/built/api/strings/dto/process-state-enum.js +11 -0
  82. package/built/api/strings/dto/process-state-enum.js.map +1 -0
  83. package/built/api/strings/dto/process-statistics-dto.d.ts +7 -0
  84. package/built/api/strings/dto/process-statistics-dto.js +3 -0
  85. package/built/api/strings/dto/process-statistics-dto.js.map +1 -0
  86. package/built/api/strings/dto/process-status-dto.d.ts +10 -0
  87. package/built/api/strings/dto/process-status-dto.js +6 -0
  88. package/built/api/strings/dto/process-status-dto.js.map +1 -0
  89. package/built/api/strings/index.d.ts +5 -0
  90. package/built/api/strings/index.js +10 -0
  91. package/built/api/strings/index.js.map +1 -1
  92. package/built/api/strings/params/create-strings-parameters.d.ts +9 -0
  93. package/built/api/strings/params/create-strings-parameters.js +35 -0
  94. package/built/api/strings/params/create-strings-parameters.js.map +1 -0
  95. package/built/api/strings/params/string-item-parameters.d.ts +16 -0
  96. package/built/api/strings/params/string-item-parameters.js +34 -0
  97. package/built/api/strings/params/string-item-parameters.js.map +1 -0
  98. package/built/index.d.ts +7 -0
  99. package/built/index.js +7 -0
  100. package/built/index.js.map +1 -1
  101. package/built/package.json +1 -1
  102. package/index.ts +7 -0
  103. package/package.json +1 -1
  104. package/test/glossaries.spec.ts +107 -0
  105. package/test/strings.spec.ts +180 -0
@@ -2,5 +2,5 @@ projectKey=smartling-api-sdk-nodejs
2
2
  serverUrl=https://sonar-next.connectors.stg.smartling.net
3
3
  serverVersion=8.6.1.40680
4
4
  dashboardUrl=https://sonar-next.connectors.stg.smartling.net/dashboard?id=smartling-api-sdk-nodejs
5
- ceTaskId=AZitJlMtBVSmsPhymERt
6
- ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AZitJlMtBVSmsPhymERt
5
+ ceTaskId=AZk98cLrJYLo-yRQ8Fjl
6
+ ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AZk98cLrJYLo-yRQ8Fjl
@@ -0,0 +1,10 @@
1
+ import { FilterLevel } from "../enums/filter-level";
2
+ import { DateFilterType } from "../enums/date-filter-type";
3
+
4
+ export interface DateFilterDto {
5
+ level: FilterLevel;
6
+ type: DateFilterType;
7
+ date?: string;
8
+ from?: string;
9
+ to?: string;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { SortField } from "../enums/sort-field";
2
+ import { SortDirection } from "../enums/sort-direction";
3
+
4
+ export interface EntrySortingDto {
5
+ field: SortField;
6
+ direction: SortDirection;
7
+ localeId?: string;
8
+ }
@@ -0,0 +1,25 @@
1
+ import { EntryState } from "../enums/entry-state";
2
+ import { LabelTypeDto } from "./label-type-dto";
3
+ import { DateFilterDto } from "./date-filter-dto";
4
+ import { UserFilterDto } from "./user-filter-dto";
5
+ import { PaginationDto } from "./pagination-dto";
6
+ import { EntrySortingDto } from "./entry-sorting-dto";
7
+
8
+ export interface ExportEntriesFilterDto {
9
+ query?: string;
10
+ localeIds?: Array<string>;
11
+ entryUids?: Array<string>;
12
+ entryState?: EntryState;
13
+ missingTranslationLocaleId?: string;
14
+ presentTranslationLocaleId?: string;
15
+ dntLocaleId?: string;
16
+ returnFallbackTranslations?: boolean;
17
+ labels?: LabelTypeDto;
18
+ dntTermSet?: boolean;
19
+ created?: DateFilterDto;
20
+ lastModified?: DateFilterDto;
21
+ createdBy?: UserFilterDto;
22
+ lastModifiedBy?: UserFilterDto;
23
+ paging?: PaginationDto;
24
+ sorting?: EntrySortingDto;
25
+ }
@@ -0,0 +1,6 @@
1
+ import { LabelType } from "../enums/label-type";
2
+
3
+ export interface LabelTypeDto {
4
+ type: LabelType;
5
+ labelUids?: Array<string>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { FilterLevel } from "../enums/filter-level";
2
+
3
+ export interface UserFilterDto {
4
+ level: FilterLevel;
5
+ userIds: Array<string>;
6
+ }
@@ -0,0 +1,6 @@
1
+ export enum DateFilterType {
2
+ AFTER = "after",
3
+ BEFORE = "before",
4
+ DATE_RANGE = "date_range",
5
+ EXACT = "exact"
6
+ }
@@ -0,0 +1,5 @@
1
+ export enum EntryState {
2
+ ACTIVE = "ACTIVE",
3
+ ARCHIVED = "ARCHIVED",
4
+ BOTH = "BOTH"
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum ExportFormat {
2
+ CSV = "CSV",
3
+ XLSX = "XLSX",
4
+ TBX = "TBX"
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum FilterLevel {
2
+ ENTRY = "ENTRY",
3
+ LOCALE = "LOCALE",
4
+ ANY = "ANY"
5
+ }
@@ -0,0 +1,8 @@
1
+ export { ExportFormat } from "./export-format";
2
+ export { TbxVersion } from "./tbx-version";
3
+ export { EntryState } from "./entry-state";
4
+ export { FilterLevel } from "./filter-level";
5
+ export { DateFilterType } from "./date-filter-type";
6
+ export { LabelType } from "./label-type";
7
+ export { SortDirection } from "./sort-direction";
8
+ export { SortField } from "./sort-field";
@@ -0,0 +1,5 @@
1
+ export enum LabelType {
2
+ EMPTY = "empty",
3
+ ANY = "any",
4
+ ASSOCIATED = "associated"
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum SortDirection {
2
+ ASC = "ASC",
3
+ DESC = "DESC"
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum SortField {
2
+ TERM = "term",
3
+ CREATED_DATE = "createdDate",
4
+ LAST_MODIFIED_DATE = "lastModifiedDate"
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum TbxVersion {
2
+ TBXcoreStructV02 = "TBXcoreStructV02",
3
+ TBXcoreStructV03 = "TBXcoreStructV03"
4
+ }
@@ -4,6 +4,7 @@ import { Logger } from "../logger";
4
4
  import { GlossaryDto } from "./dto/glossary-dto";
5
5
  import { SearchGlossariesParameters } from "./params/search-glossaries-parameters";
6
6
  import { SmartlingListResponse } from "../http/smartling-list-response";
7
+ import { ExportEntriesParameters } from "./params/export-entries-parameters";
7
8
 
8
9
  export class SmartlingGlossariesApi extends SmartlingBaseApi {
9
10
  constructor(smartlingApiBaseUrl: string, authApi: AccessTokenProvider, logger: Logger) {
@@ -29,4 +30,16 @@ export class SmartlingGlossariesApi extends SmartlingBaseApi {
29
30
  `${this.entrypoint}/accounts/${accountUid}/glossaries/${glossaryUid}`
30
31
  );
31
32
  }
33
+
34
+ async exportGlossaryEntries(
35
+ accountUid: string,
36
+ glossaryUid: string,
37
+ parameters: ExportEntriesParameters
38
+ ): Promise<void> {
39
+ await this.makeRequest(
40
+ "post",
41
+ `${this.entrypoint}/accounts/${accountUid}/glossaries/${glossaryUid}/entries/download`,
42
+ JSON.stringify(parameters.export())
43
+ );
44
+ }
32
45
  }
@@ -0,0 +1,160 @@
1
+ import { BaseParameters } from "../../parameters";
2
+ import { ExportEntriesFilterDto } from "../dto/export-entries-filter-dto";
3
+ import { ExportFormat } from "../enums/export-format";
4
+ import { TbxVersion } from "../enums/tbx-version";
5
+ import { EntryState } from "../enums/entry-state";
6
+ import { LabelTypeDto } from "../dto/label-type-dto";
7
+ import { DateFilterDto } from "../dto/date-filter-dto";
8
+ import { UserFilterDto } from "../dto/user-filter-dto";
9
+ import { PaginationDto } from "../dto/pagination-dto";
10
+ import { EntrySortingDto } from "../dto/entry-sorting-dto";
11
+
12
+ export class ExportEntriesParameters extends BaseParameters {
13
+ constructor() {
14
+ super();
15
+ this.set("filter", {});
16
+ this.set("localeIds", []);
17
+ }
18
+
19
+ setFormat(format: ExportFormat): ExportEntriesParameters {
20
+ this.set("format", format);
21
+ return this;
22
+ }
23
+
24
+ setTbxVersion(tbxVersion: TbxVersion): ExportEntriesParameters {
25
+ this.set("tbxVersion", tbxVersion);
26
+ return this;
27
+ }
28
+
29
+ setFocusLocaleId(focusLocaleId: string): ExportEntriesParameters {
30
+ this.set("focusLocaleId", focusLocaleId);
31
+ return this;
32
+ }
33
+
34
+ setLocaleIds(localeIds: Array<string>): ExportEntriesParameters {
35
+ this.set("localeIds", localeIds);
36
+ return this;
37
+ }
38
+
39
+ setSkipEntries(skipEntries: boolean): ExportEntriesParameters {
40
+ this.set("skipEntries", skipEntries);
41
+ return this;
42
+ }
43
+
44
+ setFilter(filter: ExportEntriesFilterDto): ExportEntriesParameters {
45
+ this.set("filter", filter);
46
+ return this;
47
+ }
48
+
49
+ setFilterQuery(query: string): ExportEntriesParameters {
50
+ const filter = this.parameters.filter || {};
51
+ filter.query = query;
52
+ this.set("filter", filter);
53
+ return this;
54
+ }
55
+
56
+ setFilterLocaleIds(localeIds: Array<string>): ExportEntriesParameters {
57
+ const filter = this.parameters.filter || {};
58
+ filter.localeIds = localeIds;
59
+ this.set("filter", filter);
60
+ return this;
61
+ }
62
+
63
+ setFilterEntryUids(entryUids: Array<string>): ExportEntriesParameters {
64
+ const filter = this.parameters.filter || {};
65
+ filter.entryUids = entryUids;
66
+ this.set("filter", filter);
67
+ return this;
68
+ }
69
+
70
+ setFilterEntryState(entryState: EntryState): ExportEntriesParameters {
71
+ const filter = this.parameters.filter || {};
72
+ filter.entryState = entryState;
73
+ this.set("filter", filter);
74
+ return this;
75
+ }
76
+
77
+ setFilterMissingTranslationLocaleId(localeId: string): ExportEntriesParameters {
78
+ const filter = this.parameters.filter || {};
79
+ filter.missingTranslationLocaleId = localeId;
80
+ this.set("filter", filter);
81
+ return this;
82
+ }
83
+
84
+ setFilterPresentTranslationLocaleId(localeId: string): ExportEntriesParameters {
85
+ const filter = this.parameters.filter || {};
86
+ filter.presentTranslationLocaleId = localeId;
87
+ this.set("filter", filter);
88
+ return this;
89
+ }
90
+
91
+ setFilterDntLocaleId(localeId: string): ExportEntriesParameters {
92
+ const filter = this.parameters.filter || {};
93
+ filter.dntLocaleId = localeId;
94
+ this.set("filter", filter);
95
+ return this;
96
+ }
97
+
98
+ setFilterReturnFallbackTranslations(returnFallback: boolean): ExportEntriesParameters {
99
+ const filter = this.parameters.filter || {};
100
+ filter.returnFallbackTranslations = returnFallback;
101
+ this.set("filter", filter);
102
+ return this;
103
+ }
104
+
105
+ setFilterLabels(labels: LabelTypeDto): ExportEntriesParameters {
106
+ const filter = this.parameters.filter || {};
107
+ filter.labels = labels;
108
+ this.set("filter", filter);
109
+ return this;
110
+ }
111
+
112
+ setFilterDntTermSet(dntTermSet: boolean): ExportEntriesParameters {
113
+ const filter = this.parameters.filter || {};
114
+ filter.dntTermSet = dntTermSet;
115
+ this.set("filter", filter);
116
+ return this;
117
+ }
118
+
119
+ setFilterCreated(created: DateFilterDto): ExportEntriesParameters {
120
+ const filter = this.parameters.filter || {};
121
+ filter.created = created;
122
+ this.set("filter", filter);
123
+ return this;
124
+ }
125
+
126
+ setFilterLastModified(lastModified: DateFilterDto): ExportEntriesParameters {
127
+ const filter = this.parameters.filter || {};
128
+ filter.lastModified = lastModified;
129
+ this.set("filter", filter);
130
+ return this;
131
+ }
132
+
133
+ setFilterCreatedBy(createdBy: UserFilterDto): ExportEntriesParameters {
134
+ const filter = this.parameters.filter || {};
135
+ filter.createdBy = createdBy;
136
+ this.set("filter", filter);
137
+ return this;
138
+ }
139
+
140
+ setFilterLastModifiedBy(lastModifiedBy: UserFilterDto): ExportEntriesParameters {
141
+ const filter = this.parameters.filter || {};
142
+ filter.lastModifiedBy = lastModifiedBy;
143
+ this.set("filter", filter);
144
+ return this;
145
+ }
146
+
147
+ setFilterPaging(paging: PaginationDto): ExportEntriesParameters {
148
+ const filter = this.parameters.filter || {};
149
+ filter.paging = paging;
150
+ this.set("filter", filter);
151
+ return this;
152
+ }
153
+
154
+ setFilterSorting(sorting: EntrySortingDto): ExportEntriesParameters {
155
+ const filter = this.parameters.filter || {};
156
+ filter.sorting = sorting;
157
+ this.set("filter", filter);
158
+ return this;
159
+ }
160
+ }
@@ -0,0 +1,10 @@
1
+ import { CreatedStringItemDto } from "./created-string-item-dto";
2
+
3
+ interface CreateStringsResponseDto {
4
+ wordCount: number;
5
+ stringCount: number;
6
+ processUid?: string;
7
+ items: CreatedStringItemDto[];
8
+ }
9
+
10
+ export { CreateStringsResponseDto };
@@ -0,0 +1,9 @@
1
+ interface CreatedStringItemDto {
2
+ variant: string;
3
+ stringText: string;
4
+ parsedStringText: string;
5
+ hashcode: string;
6
+ overWritten: boolean;
7
+ }
8
+
9
+ export { CreatedStringItemDto };
@@ -0,0 +1,7 @@
1
+ enum ProcessState {
2
+ OPEN = "OPEN",
3
+ CLOSED = "CLOSED",
4
+ FAILED = "FAILED"
5
+ }
6
+
7
+ export { ProcessState };
@@ -0,0 +1,8 @@
1
+ interface ProcessStatisticsDto {
2
+ requested: number;
3
+ processed: number;
4
+ errored: number;
5
+ skipped: number;
6
+ }
7
+
8
+ export { ProcessStatisticsDto };
@@ -0,0 +1,12 @@
1
+ import { ProcessStatisticsDto } from "./process-statistics-dto";
2
+ import { ProcessState } from "./process-state-enum";
3
+
4
+ interface ProcessStatusDto {
5
+ processUid: string;
6
+ processState: ProcessState;
7
+ createdDate: string;
8
+ modifiedDate: string;
9
+ processStatistics: ProcessStatisticsDto;
10
+ }
11
+
12
+ export { ProcessStatusDto, ProcessState };
@@ -1,8 +1,11 @@
1
1
  import { SmartlingBaseApi } from "../base/index";
2
2
  import { AccessTokenProvider } from "../auth/access-token-provider";
3
3
  import { FetchSourceStringsParameters } from "./params/fetch-source-strings-parameters";
4
+ import { CreateStringsParameters } from "./params/create-strings-parameters";
4
5
  import { SmartlingListResponse } from "../http/smartling-list-response";
5
6
  import { SourceStringDto } from "./dto/source-string-dto";
7
+ import { CreateStringsResponseDto } from "./dto/create-strings-response-dto";
8
+ import { ProcessStatusDto } from "./dto/process-status-dto";
6
9
  import { Logger } from "../logger";
7
10
 
8
11
  export class SmartlingStringsApi extends SmartlingBaseApi {
@@ -21,4 +24,25 @@ export class SmartlingStringsApi extends SmartlingBaseApi {
21
24
  params.export()
22
25
  );
23
26
  }
27
+
28
+ async createStrings(
29
+ projectUid: string,
30
+ params: CreateStringsParameters
31
+ ): Promise<CreateStringsResponseDto> {
32
+ return await this.makeRequest(
33
+ "post",
34
+ `${this.entrypoint}/${projectUid}`,
35
+ JSON.stringify(params.export())
36
+ );
37
+ }
38
+
39
+ async getCreateStringStatus(
40
+ projectUid: string,
41
+ processUid: string
42
+ ): Promise<SmartlingListResponse<ProcessStatusDto>> {
43
+ return await this.makeRequest(
44
+ "get",
45
+ `${this.entrypoint}/${projectUid}/processes/${processUid}`
46
+ );
47
+ }
24
48
  }
@@ -0,0 +1,36 @@
1
+ import { BaseParameters } from "../../parameters/index";
2
+ import { StringItemParameters } from "./string-item-parameters";
3
+
4
+ export class CreateStringsParameters extends BaseParameters {
5
+ public setNamespace(namespace: string): CreateStringsParameters {
6
+ this.set("namespace", namespace);
7
+ return this;
8
+ }
9
+
10
+ public setPlaceholderFormat(placeholderFormat: string): CreateStringsParameters {
11
+ this.set("placeholderFormat", placeholderFormat);
12
+ return this;
13
+ }
14
+
15
+ public setPlaceholderFormatCustom(placeholderFormatCustom: string): CreateStringsParameters {
16
+ this.set("placeholderFormatCustom", placeholderFormatCustom);
17
+ return this;
18
+ }
19
+
20
+ public setStrings(strings: StringItemParameters[]): CreateStringsParameters {
21
+ if (strings.length > 100) {
22
+ throw new Error("Maximum 100 strings can be posted in any given request");
23
+ }
24
+ this.set("strings", strings);
25
+ return this;
26
+ }
27
+
28
+ public addString(stringItem: StringItemParameters): CreateStringsParameters {
29
+ const currentStrings: StringItemParameters[] = this.parameters.strings || [];
30
+ if (currentStrings.length >= 100) {
31
+ throw new Error("Maximum 100 strings can be posted in any given request");
32
+ }
33
+ this.set("strings", [...currentStrings, stringItem]);
34
+ return this;
35
+ }
36
+ }
@@ -0,0 +1,43 @@
1
+ export class StringItemParameters {
2
+ private stringText: string;
3
+ private variant?: string;
4
+ private callbackUrl?: string;
5
+ private callbackMethod?: string;
6
+ private instruction?: string;
7
+ private format?: string;
8
+ private maxLength?: number;
9
+
10
+ constructor(stringText: string) {
11
+ this.stringText = stringText;
12
+ }
13
+
14
+ public setVariant(variant: string): StringItemParameters {
15
+ this.variant = variant;
16
+ return this;
17
+ }
18
+
19
+ public setCallbackUrl(callbackUrl: string): StringItemParameters {
20
+ this.callbackUrl = callbackUrl;
21
+ return this;
22
+ }
23
+
24
+ public setCallbackMethod(callbackMethod: string): StringItemParameters {
25
+ this.callbackMethod = callbackMethod;
26
+ return this;
27
+ }
28
+
29
+ public setInstruction(instruction: string): StringItemParameters {
30
+ this.instruction = instruction;
31
+ return this;
32
+ }
33
+
34
+ public setFormat(format: string): StringItemParameters {
35
+ this.format = format;
36
+ return this;
37
+ }
38
+
39
+ public setMaxLength(maxLength: number): StringItemParameters {
40
+ this.maxLength = maxLength;
41
+ return this;
42
+ }
43
+ }
@@ -0,0 +1,9 @@
1
+ import { FilterLevel } from "../enums/filter-level";
2
+ import { DateFilterType } from "../enums/date-filter-type";
3
+ export interface DateFilterDto {
4
+ level: FilterLevel;
5
+ type: DateFilterType;
6
+ date?: string;
7
+ from?: string;
8
+ to?: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=date-filter-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/date-filter-dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { SortField } from "../enums/sort-field";
2
+ import { SortDirection } from "../enums/sort-direction";
3
+ export interface EntrySortingDto {
4
+ field: SortField;
5
+ direction: SortDirection;
6
+ localeId?: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=entry-sorting-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-sorting-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/entry-sorting-dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { EntryState } from "../enums/entry-state";
2
+ import { LabelTypeDto } from "./label-type-dto";
3
+ import { DateFilterDto } from "./date-filter-dto";
4
+ import { UserFilterDto } from "./user-filter-dto";
5
+ import { PaginationDto } from "./pagination-dto";
6
+ import { EntrySortingDto } from "./entry-sorting-dto";
7
+ export interface ExportEntriesFilterDto {
8
+ query?: string;
9
+ localeIds?: Array<string>;
10
+ entryUids?: Array<string>;
11
+ entryState?: EntryState;
12
+ missingTranslationLocaleId?: string;
13
+ presentTranslationLocaleId?: string;
14
+ dntLocaleId?: string;
15
+ returnFallbackTranslations?: boolean;
16
+ labels?: LabelTypeDto;
17
+ dntTermSet?: boolean;
18
+ created?: DateFilterDto;
19
+ lastModified?: DateFilterDto;
20
+ createdBy?: UserFilterDto;
21
+ lastModifiedBy?: UserFilterDto;
22
+ paging?: PaginationDto;
23
+ sorting?: EntrySortingDto;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=export-entries-filter-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-entries-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/export-entries-filter-dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { LabelType } from "../enums/label-type";
2
+ export interface LabelTypeDto {
3
+ type: LabelType;
4
+ labelUids?: Array<string>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=label-type-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label-type-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/label-type-dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { FilterLevel } from "../enums/filter-level";
2
+ export interface UserFilterDto {
3
+ level: FilterLevel;
4
+ userIds: Array<string>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=user-filter-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/user-filter-dto.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export declare enum DateFilterType {
2
+ AFTER = "after",
3
+ BEFORE = "before",
4
+ DATE_RANGE = "date_range",
5
+ EXACT = "exact"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateFilterType = void 0;
4
+ var DateFilterType;
5
+ (function (DateFilterType) {
6
+ DateFilterType["AFTER"] = "after";
7
+ DateFilterType["BEFORE"] = "before";
8
+ DateFilterType["DATE_RANGE"] = "date_range";
9
+ DateFilterType["EXACT"] = "exact";
10
+ })(DateFilterType = exports.DateFilterType || (exports.DateFilterType = {}));
11
+ //# sourceMappingURL=date-filter-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-filter-type.js","sourceRoot":"","sources":["../../../../api/glossaries/enums/date-filter-type.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAKX;AALD,WAAY,cAAc;IACtB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,2CAAyB,CAAA;IACzB,iCAAe,CAAA;AACnB,CAAC,EALW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAKzB"}
@@ -0,0 +1,5 @@
1
+ export declare enum EntryState {
2
+ ACTIVE = "ACTIVE",
3
+ ARCHIVED = "ARCHIVED",
4
+ BOTH = "BOTH"
5
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntryState = void 0;
4
+ var EntryState;
5
+ (function (EntryState) {
6
+ EntryState["ACTIVE"] = "ACTIVE";
7
+ EntryState["ARCHIVED"] = "ARCHIVED";
8
+ EntryState["BOTH"] = "BOTH";
9
+ })(EntryState = exports.EntryState || (exports.EntryState = {}));
10
+ //# sourceMappingURL=entry-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-state.js","sourceRoot":"","sources":["../../../../api/glossaries/enums/entry-state.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB"}
@@ -0,0 +1,5 @@
1
+ export declare enum ExportFormat {
2
+ CSV = "CSV",
3
+ XLSX = "XLSX",
4
+ TBX = "TBX"
5
+ }