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.
- package/.scannerwork/report-task.txt +2 -2
- package/api/glossaries/dto/date-filter-dto.ts +10 -0
- package/api/glossaries/dto/entry-sorting-dto.ts +8 -0
- package/api/glossaries/dto/export-entries-filter-dto.ts +25 -0
- package/api/glossaries/dto/label-type-dto.ts +6 -0
- package/api/glossaries/dto/user-filter-dto.ts +6 -0
- package/api/glossaries/enums/date-filter-type.ts +6 -0
- package/api/glossaries/enums/entry-state.ts +5 -0
- package/api/glossaries/enums/export-format.ts +5 -0
- package/api/glossaries/enums/filter-level.ts +5 -0
- package/api/glossaries/enums/index.ts +8 -0
- package/api/glossaries/enums/label-type.ts +5 -0
- package/api/glossaries/enums/sort-direction.ts +4 -0
- package/api/glossaries/enums/sort-field.ts +5 -0
- package/api/glossaries/enums/tbx-version.ts +4 -0
- package/api/glossaries/index.ts +13 -0
- package/api/glossaries/params/export-entries-parameters.ts +160 -0
- package/api/strings/dto/create-strings-response-dto.ts +10 -0
- package/api/strings/dto/created-string-item-dto.ts +9 -0
- package/api/strings/dto/process-state-enum.ts +7 -0
- package/api/strings/dto/process-statistics-dto.ts +8 -0
- package/api/strings/dto/process-status-dto.ts +12 -0
- package/api/strings/index.ts +24 -0
- package/api/strings/params/create-strings-parameters.ts +36 -0
- package/api/strings/params/string-item-parameters.ts +43 -0
- package/built/api/glossaries/dto/date-filter-dto.d.ts +9 -0
- package/built/api/glossaries/dto/date-filter-dto.js +3 -0
- package/built/api/glossaries/dto/date-filter-dto.js.map +1 -0
- package/built/api/glossaries/dto/entry-sorting-dto.d.ts +7 -0
- package/built/api/glossaries/dto/entry-sorting-dto.js +3 -0
- package/built/api/glossaries/dto/entry-sorting-dto.js.map +1 -0
- package/built/api/glossaries/dto/export-entries-filter-dto.d.ts +24 -0
- package/built/api/glossaries/dto/export-entries-filter-dto.js +3 -0
- package/built/api/glossaries/dto/export-entries-filter-dto.js.map +1 -0
- package/built/api/glossaries/dto/label-type-dto.d.ts +5 -0
- package/built/api/glossaries/dto/label-type-dto.js +3 -0
- package/built/api/glossaries/dto/label-type-dto.js.map +1 -0
- package/built/api/glossaries/dto/user-filter-dto.d.ts +5 -0
- package/built/api/glossaries/dto/user-filter-dto.js +3 -0
- package/built/api/glossaries/dto/user-filter-dto.js.map +1 -0
- package/built/api/glossaries/enums/date-filter-type.d.ts +6 -0
- package/built/api/glossaries/enums/date-filter-type.js +11 -0
- package/built/api/glossaries/enums/date-filter-type.js.map +1 -0
- package/built/api/glossaries/enums/entry-state.d.ts +5 -0
- package/built/api/glossaries/enums/entry-state.js +10 -0
- package/built/api/glossaries/enums/entry-state.js.map +1 -0
- package/built/api/glossaries/enums/export-format.d.ts +5 -0
- package/built/api/glossaries/enums/export-format.js +10 -0
- package/built/api/glossaries/enums/export-format.js.map +1 -0
- package/built/api/glossaries/enums/filter-level.d.ts +5 -0
- package/built/api/glossaries/enums/filter-level.js +10 -0
- package/built/api/glossaries/enums/filter-level.js.map +1 -0
- package/built/api/glossaries/enums/index.d.ts +8 -0
- package/built/api/glossaries/enums/index.js +20 -0
- package/built/api/glossaries/enums/index.js.map +1 -0
- package/built/api/glossaries/enums/label-type.d.ts +5 -0
- package/built/api/glossaries/enums/label-type.js +10 -0
- package/built/api/glossaries/enums/label-type.js.map +1 -0
- package/built/api/glossaries/enums/sort-direction.d.ts +4 -0
- package/built/api/glossaries/enums/sort-direction.js +9 -0
- package/built/api/glossaries/enums/sort-direction.js.map +1 -0
- package/built/api/glossaries/enums/sort-field.d.ts +5 -0
- package/built/api/glossaries/enums/sort-field.js +10 -0
- package/built/api/glossaries/enums/sort-field.js.map +1 -0
- package/built/api/glossaries/enums/tbx-version.d.ts +4 -0
- package/built/api/glossaries/enums/tbx-version.js +9 -0
- package/built/api/glossaries/enums/tbx-version.js.map +1 -0
- package/built/api/glossaries/index.d.ts +2 -0
- package/built/api/glossaries/index.js +5 -0
- package/built/api/glossaries/index.js.map +1 -1
- package/built/api/glossaries/params/export-entries-parameters.d.ts +35 -0
- package/built/api/glossaries/params/export-entries-parameters.js +133 -0
- package/built/api/glossaries/params/export-entries-parameters.js.map +1 -0
- package/built/api/strings/dto/create-strings-response-dto.d.ts +8 -0
- package/built/api/strings/dto/create-strings-response-dto.js +3 -0
- package/built/api/strings/dto/create-strings-response-dto.js.map +1 -0
- package/built/api/strings/dto/created-string-item-dto.d.ts +8 -0
- package/built/api/strings/dto/created-string-item-dto.js +3 -0
- package/built/api/strings/dto/created-string-item-dto.js.map +1 -0
- package/built/api/strings/dto/process-state-enum.d.ts +6 -0
- package/built/api/strings/dto/process-state-enum.js +11 -0
- package/built/api/strings/dto/process-state-enum.js.map +1 -0
- package/built/api/strings/dto/process-statistics-dto.d.ts +7 -0
- package/built/api/strings/dto/process-statistics-dto.js +3 -0
- package/built/api/strings/dto/process-statistics-dto.js.map +1 -0
- package/built/api/strings/dto/process-status-dto.d.ts +10 -0
- package/built/api/strings/dto/process-status-dto.js +6 -0
- package/built/api/strings/dto/process-status-dto.js.map +1 -0
- package/built/api/strings/index.d.ts +5 -0
- package/built/api/strings/index.js +10 -0
- package/built/api/strings/index.js.map +1 -1
- package/built/api/strings/params/create-strings-parameters.d.ts +9 -0
- package/built/api/strings/params/create-strings-parameters.js +35 -0
- package/built/api/strings/params/create-strings-parameters.js.map +1 -0
- package/built/api/strings/params/string-item-parameters.d.ts +16 -0
- package/built/api/strings/params/string-item-parameters.js +34 -0
- package/built/api/strings/params/string-item-parameters.js.map +1 -0
- package/built/index.d.ts +7 -0
- package/built/index.js +7 -0
- package/built/index.js.map +1 -1
- package/built/package.json +1 -1
- package/index.ts +7 -0
- package/package.json +1 -1
- package/test/glossaries.spec.ts +107 -0
- 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=
|
|
6
|
-
ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=
|
|
5
|
+
ceTaskId=AZk98cLrJYLo-yRQ8Fjl
|
|
6
|
+
ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AZk98cLrJYLo-yRQ8Fjl
|
|
@@ -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,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";
|
package/api/glossaries/index.ts
CHANGED
|
@@ -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,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 };
|
package/api/strings/index.ts
CHANGED
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"date-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/date-filter-dto.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"export-entries-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/export-entries-filter-dto.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"user-filter-dto.js","sourceRoot":"","sources":["../../../../api/glossaries/dto/user-filter-dto.ts"],"names":[],"mappings":""}
|
|
@@ -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,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"}
|