@emilgroup/translation-sdk 1.10.1-beta.3 → 1.10.1-beta.30
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/.openapi-generator/FILES +2 -0
- package/README.md +2 -2
- package/api/translation-api.ts +103 -0
- package/base.ts +36 -15
- package/configuration.ts +11 -0
- package/dist/api/translation-api.d.ts +56 -0
- package/dist/api/translation-api.js +92 -0
- package/dist/base.d.ts +1 -0
- package/dist/base.js +36 -16
- package/dist/configuration.d.ts +9 -0
- package/dist/configuration.js +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/refresh-product-languages-response-class.d.ts +31 -0
- package/dist/models/refresh-product-languages-response-class.js +15 -0
- package/dist/models/skipped-translation-class.d.ts +36 -0
- package/dist/models/skipped-translation-class.js +15 -0
- package/dist/models/translatable-field-class.d.ts +12 -0
- package/dist/models/upload-product-translations-response-class.d.ts +13 -0
- package/models/index.ts +2 -0
- package/models/refresh-product-languages-response-class.ts +37 -0
- package/models/skipped-translation-class.ts +42 -0
- package/models/translatable-field-class.ts +12 -0
- package/models/upload-product-translations-response-class.ts +13 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -21,7 +21,9 @@ models/list-product-languages-response-class.ts
|
|
|
21
21
|
models/list-translations-response-class.ts
|
|
22
22
|
models/new-translation-class.ts
|
|
23
23
|
models/product-language-class.ts
|
|
24
|
+
models/refresh-product-languages-response-class.ts
|
|
24
25
|
models/save-product-translations-request-dto.ts
|
|
26
|
+
models/skipped-translation-class.ts
|
|
25
27
|
models/translatable-field-class.ts
|
|
26
28
|
models/translation-class.ts
|
|
27
29
|
models/update-product-language-request-dto.ts
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/translation-sdk@1.10.1-beta.
|
|
20
|
+
npm install @emilgroup/translation-sdk@1.10.1-beta.30 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/translation-sdk@1.10.1-beta.
|
|
24
|
+
yarn add @emilgroup/translation-sdk@1.10.1-beta.30
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `TranslationApi`.
|
package/api/translation-api.ts
CHANGED
|
@@ -33,6 +33,8 @@ import { ListProductLanguagesResponseClass } from '../models';
|
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
import { ListTranslationsResponseClass } from '../models';
|
|
35
35
|
// @ts-ignore
|
|
36
|
+
import { RefreshProductLanguagesResponseClass } from '../models';
|
|
37
|
+
// @ts-ignore
|
|
36
38
|
import { SaveProductTranslationsRequestDto } from '../models';
|
|
37
39
|
// @ts-ignore
|
|
38
40
|
import { UpdateProductLanguageRequestDto } from '../models';
|
|
@@ -430,6 +432,51 @@ export const TranslationApiAxiosParamCreator = function (configuration?: Configu
|
|
|
430
432
|
|
|
431
433
|
|
|
432
434
|
|
|
435
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
436
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
437
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
438
|
+
|
|
439
|
+
return {
|
|
440
|
+
url: toPathString(localVarUrlObj),
|
|
441
|
+
options: localVarRequestOptions,
|
|
442
|
+
};
|
|
443
|
+
},
|
|
444
|
+
/**
|
|
445
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
446
|
+
* @summary Retrieve the refreshed product languages
|
|
447
|
+
* @param {string} productSlug Slug of the product.
|
|
448
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
449
|
+
* @param {*} [options] Override http request option.
|
|
450
|
+
* @throws {RequiredError}
|
|
451
|
+
*/
|
|
452
|
+
refreshProductLanguages: async (productSlug: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
453
|
+
// verify required parameter 'productSlug' is not null or undefined
|
|
454
|
+
assertParamExists('refreshProductLanguages', 'productSlug', productSlug)
|
|
455
|
+
const localVarPath = `/translationservice/v1/product/{productSlug}/languages`
|
|
456
|
+
.replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
|
|
457
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
458
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
459
|
+
let baseOptions;
|
|
460
|
+
let baseAccessToken;
|
|
461
|
+
if (configuration) {
|
|
462
|
+
baseOptions = configuration.baseOptions;
|
|
463
|
+
baseAccessToken = configuration.accessToken;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
467
|
+
const localVarHeaderParameter = {} as any;
|
|
468
|
+
const localVarQueryParameter = {} as any;
|
|
469
|
+
|
|
470
|
+
// authentication bearer required
|
|
471
|
+
// http bearer authentication required
|
|
472
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
473
|
+
|
|
474
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
475
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
433
480
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
434
481
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
435
482
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -706,6 +753,18 @@ export const TranslationApiFp = function(configuration?: Configuration) {
|
|
|
706
753
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listTranslations(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
707
754
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
708
755
|
},
|
|
756
|
+
/**
|
|
757
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
758
|
+
* @summary Retrieve the refreshed product languages
|
|
759
|
+
* @param {string} productSlug Slug of the product.
|
|
760
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
761
|
+
* @param {*} [options] Override http request option.
|
|
762
|
+
* @throws {RequiredError}
|
|
763
|
+
*/
|
|
764
|
+
async refreshProductLanguages(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshProductLanguagesResponseClass>> {
|
|
765
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.refreshProductLanguages(productSlug, authorization, options);
|
|
766
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
767
|
+
},
|
|
709
768
|
/**
|
|
710
769
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
711
770
|
* @summary Create the product translations
|
|
@@ -846,6 +905,17 @@ export const TranslationApiFactory = function (configuration?: Configuration, ba
|
|
|
846
905
|
listTranslations(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListTranslationsResponseClass> {
|
|
847
906
|
return localVarFp.listTranslations(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
848
907
|
},
|
|
908
|
+
/**
|
|
909
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
910
|
+
* @summary Retrieve the refreshed product languages
|
|
911
|
+
* @param {string} productSlug Slug of the product.
|
|
912
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
913
|
+
* @param {*} [options] Override http request option.
|
|
914
|
+
* @throws {RequiredError}
|
|
915
|
+
*/
|
|
916
|
+
refreshProductLanguages(productSlug: string, authorization?: string, options?: any): AxiosPromise<RefreshProductLanguagesResponseClass> {
|
|
917
|
+
return localVarFp.refreshProductLanguages(productSlug, authorization, options).then((request) => request(axios, basePath));
|
|
918
|
+
},
|
|
849
919
|
/**
|
|
850
920
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
851
921
|
* @summary Create the product translations
|
|
@@ -1130,6 +1200,27 @@ export interface TranslationApiListTranslationsRequest {
|
|
|
1130
1200
|
readonly filters?: string
|
|
1131
1201
|
}
|
|
1132
1202
|
|
|
1203
|
+
/**
|
|
1204
|
+
* Request parameters for refreshProductLanguages operation in TranslationApi.
|
|
1205
|
+
* @export
|
|
1206
|
+
* @interface TranslationApiRefreshProductLanguagesRequest
|
|
1207
|
+
*/
|
|
1208
|
+
export interface TranslationApiRefreshProductLanguagesRequest {
|
|
1209
|
+
/**
|
|
1210
|
+
* Slug of the product.
|
|
1211
|
+
* @type {string}
|
|
1212
|
+
* @memberof TranslationApiRefreshProductLanguages
|
|
1213
|
+
*/
|
|
1214
|
+
readonly productSlug: string
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1218
|
+
* @type {string}
|
|
1219
|
+
* @memberof TranslationApiRefreshProductLanguages
|
|
1220
|
+
*/
|
|
1221
|
+
readonly authorization?: string
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1133
1224
|
/**
|
|
1134
1225
|
* Request parameters for saveProductTranslations operation in TranslationApi.
|
|
1135
1226
|
* @export
|
|
@@ -1305,6 +1396,18 @@ export class TranslationApi extends BaseAPI {
|
|
|
1305
1396
|
return TranslationApiFp(this.configuration).listTranslations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
1306
1397
|
}
|
|
1307
1398
|
|
|
1399
|
+
/**
|
|
1400
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
1401
|
+
* @summary Retrieve the refreshed product languages
|
|
1402
|
+
* @param {TranslationApiRefreshProductLanguagesRequest} requestParameters Request parameters.
|
|
1403
|
+
* @param {*} [options] Override http request option.
|
|
1404
|
+
* @throws {RequiredError}
|
|
1405
|
+
* @memberof TranslationApi
|
|
1406
|
+
*/
|
|
1407
|
+
public refreshProductLanguages(requestParameters: TranslationApiRefreshProductLanguagesRequest, options?: AxiosRequestConfig) {
|
|
1408
|
+
return TranslationApiFp(this.configuration).refreshProductLanguages(requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1308
1411
|
/**
|
|
1309
1412
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
1310
1413
|
* @summary Create the product translations
|
package/base.ts
CHANGED
|
@@ -102,10 +102,14 @@ export class BaseAPI {
|
|
|
102
102
|
this.configuration = configuration;
|
|
103
103
|
this.basePath = configuration.basePath || this.basePath;
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
if (configuration.cookieAuth) {
|
|
106
|
+
this.useCookieAuth();
|
|
107
|
+
} else {
|
|
108
|
+
// Use config token if provided, otherwise use tokenData token
|
|
109
|
+
const configToken = this.configuration.accessToken;
|
|
110
|
+
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
111
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
112
|
+
}
|
|
109
113
|
} else {
|
|
110
114
|
const { accessToken, username } = this.tokenData;
|
|
111
115
|
|
|
@@ -119,6 +123,12 @@ export class BaseAPI {
|
|
|
119
123
|
this.attachInterceptor(axios);
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
// Cookie mode: the browser sends the HttpOnly access cookie, so no token is read from storage.
|
|
127
|
+
private useCookieAuth() {
|
|
128
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
129
|
+
this.configuration.baseOptions = { ...this.configuration.baseOptions, withCredentials: true };
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
selectEnvironment(env: Environment) {
|
|
123
133
|
this.selectBasePath(env);
|
|
124
134
|
}
|
|
@@ -152,10 +162,12 @@ export class BaseAPI {
|
|
|
152
162
|
const { data: { accessToken, permissions } } = response;
|
|
153
163
|
|
|
154
164
|
this.configuration.username = username;
|
|
155
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
156
165
|
this.tokenData.username = username;
|
|
157
|
-
this.tokenData.accessToken = accessToken;
|
|
158
166
|
this.tokenData.permissions = permissions;
|
|
167
|
+
if (!this.configuration.cookieAuth) {
|
|
168
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
169
|
+
this.tokenData.accessToken = accessToken;
|
|
170
|
+
}
|
|
159
171
|
|
|
160
172
|
// Switch workspace if provided
|
|
161
173
|
if (targetWorkspace) {
|
|
@@ -178,7 +190,7 @@ export class BaseAPI {
|
|
|
178
190
|
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
179
191
|
headers: {
|
|
180
192
|
'Content-Type': 'application/json',
|
|
181
|
-
'Authorization': `Bearer ${this.configuration.accessToken}
|
|
193
|
+
...(this.configuration.cookieAuth ? {} : { 'Authorization': `Bearer ${this.configuration.accessToken}` }),
|
|
182
194
|
},
|
|
183
195
|
data: {
|
|
184
196
|
username: this.configuration.username,
|
|
@@ -190,10 +202,12 @@ export class BaseAPI {
|
|
|
190
202
|
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
191
203
|
|
|
192
204
|
const { data: { accessToken, permissions } } = response;
|
|
193
|
-
|
|
194
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
195
|
-
this.tokenData.accessToken = accessToken;
|
|
205
|
+
|
|
196
206
|
this.tokenData.permissions = permissions;
|
|
207
|
+
if (!this.configuration.cookieAuth) {
|
|
208
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
209
|
+
this.tokenData.accessToken = accessToken;
|
|
210
|
+
}
|
|
197
211
|
|
|
198
212
|
this.storeTokenData({
|
|
199
213
|
...this.tokenData
|
|
@@ -233,6 +247,11 @@ export class BaseAPI {
|
|
|
233
247
|
|
|
234
248
|
private storeTokenData(tokenData?: TokenData) {
|
|
235
249
|
if (typeof window !== 'undefined') {
|
|
250
|
+
if (tokenData && this.configuration?.cookieAuth) {
|
|
251
|
+
// Cookie mode saves who is logged in, never the token; a token saved by apps not yet migrated stays.
|
|
252
|
+
const { username, permissions } = tokenData;
|
|
253
|
+
tokenData = { ...(defaultStorage().get<TokenData>(TOKEN_DATA) || {}), username, permissions };
|
|
254
|
+
}
|
|
236
255
|
defaultStorage().set<TokenData>(TOKEN_DATA, tokenData);
|
|
237
256
|
}
|
|
238
257
|
}
|
|
@@ -263,15 +282,17 @@ export class BaseAPI {
|
|
|
263
282
|
originalConfig._retry = true;
|
|
264
283
|
try {
|
|
265
284
|
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
266
|
-
const accessToken = `Bearer ${tokenString}`;
|
|
267
285
|
this.tokenData.permissions = permissions;
|
|
268
286
|
|
|
269
287
|
delete originalConfig.headers['Authorization']
|
|
270
288
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
289
|
+
// In cookie mode the refresh reply renewed the access cookie, so retry without a header.
|
|
290
|
+
if (!this.configuration.cookieAuth) {
|
|
291
|
+
const accessToken = `Bearer ${tokenString}`;
|
|
292
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
293
|
+
this.configuration.accessToken = accessToken;
|
|
294
|
+
this.tokenData.accessToken = tokenString;
|
|
295
|
+
}
|
|
275
296
|
|
|
276
297
|
this.storeTokenData(this.tokenData);
|
|
277
298
|
|
package/configuration.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface ConfigurationParameters {
|
|
|
21
21
|
basePath?: string;
|
|
22
22
|
baseOptions?: any;
|
|
23
23
|
formDataCtor?: new () => any;
|
|
24
|
+
cookieAuth?: boolean;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export class Configuration {
|
|
@@ -74,6 +75,15 @@ export class Configuration {
|
|
|
74
75
|
*/
|
|
75
76
|
formDataCtor?: new () => any;
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Authenticate with the HttpOnly access cookie instead of a stored token: every call sends credentials.
|
|
80
|
+
* The browser holds one cookie, so use it with one logged-in account; log out through the auth service.
|
|
81
|
+
*
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @memberof Configuration
|
|
84
|
+
*/
|
|
85
|
+
cookieAuth?: boolean;
|
|
86
|
+
|
|
77
87
|
constructor(param: ConfigurationParameters = {}) {
|
|
78
88
|
this.apiKey = param.apiKey;
|
|
79
89
|
this.username = param.username;
|
|
@@ -82,6 +92,7 @@ export class Configuration {
|
|
|
82
92
|
this.basePath = param.basePath;
|
|
83
93
|
this.baseOptions = param.baseOptions;
|
|
84
94
|
this.formDataCtor = param.formDataCtor;
|
|
95
|
+
this.cookieAuth = param.cookieAuth;
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
/**
|
|
@@ -18,6 +18,7 @@ import { GetProductLanguageResponseClass } from '../models';
|
|
|
18
18
|
import { GetProductTranslationsResponseClass } from '../models';
|
|
19
19
|
import { ListProductLanguagesResponseClass } from '../models';
|
|
20
20
|
import { ListTranslationsResponseClass } from '../models';
|
|
21
|
+
import { RefreshProductLanguagesResponseClass } from '../models';
|
|
21
22
|
import { SaveProductTranslationsRequestDto } from '../models';
|
|
22
23
|
import { UpdateProductLanguageRequestDto } from '../models';
|
|
23
24
|
import { UpdateProductLanguageResponseClass } from '../models';
|
|
@@ -104,6 +105,15 @@ export declare const TranslationApiAxiosParamCreator: (configuration?: Configura
|
|
|
104
105
|
* @throws {RequiredError}
|
|
105
106
|
*/
|
|
106
107
|
listTranslations: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
108
|
+
/**
|
|
109
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
110
|
+
* @summary Retrieve the refreshed product languages
|
|
111
|
+
* @param {string} productSlug Slug of the product.
|
|
112
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
113
|
+
* @param {*} [options] Override http request option.
|
|
114
|
+
* @throws {RequiredError}
|
|
115
|
+
*/
|
|
116
|
+
refreshProductLanguages: (productSlug: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
107
117
|
/**
|
|
108
118
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
109
119
|
* @summary Create the product translations
|
|
@@ -217,6 +227,15 @@ export declare const TranslationApiFp: (configuration?: Configuration) => {
|
|
|
217
227
|
* @throws {RequiredError}
|
|
218
228
|
*/
|
|
219
229
|
listTranslations(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListTranslationsResponseClass>>;
|
|
230
|
+
/**
|
|
231
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
232
|
+
* @summary Retrieve the refreshed product languages
|
|
233
|
+
* @param {string} productSlug Slug of the product.
|
|
234
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
235
|
+
* @param {*} [options] Override http request option.
|
|
236
|
+
* @throws {RequiredError}
|
|
237
|
+
*/
|
|
238
|
+
refreshProductLanguages(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshProductLanguagesResponseClass>>;
|
|
220
239
|
/**
|
|
221
240
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
222
241
|
* @summary Create the product translations
|
|
@@ -330,6 +349,15 @@ export declare const TranslationApiFactory: (configuration?: Configuration, base
|
|
|
330
349
|
* @throws {RequiredError}
|
|
331
350
|
*/
|
|
332
351
|
listTranslations(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListTranslationsResponseClass>;
|
|
352
|
+
/**
|
|
353
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
354
|
+
* @summary Retrieve the refreshed product languages
|
|
355
|
+
* @param {string} productSlug Slug of the product.
|
|
356
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
357
|
+
* @param {*} [options] Override http request option.
|
|
358
|
+
* @throws {RequiredError}
|
|
359
|
+
*/
|
|
360
|
+
refreshProductLanguages(productSlug: string, authorization?: string, options?: any): AxiosPromise<RefreshProductLanguagesResponseClass>;
|
|
333
361
|
/**
|
|
334
362
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
335
363
|
* @summary Create the product translations
|
|
@@ -578,6 +606,25 @@ export interface TranslationApiListTranslationsRequest {
|
|
|
578
606
|
*/
|
|
579
607
|
readonly filters?: string;
|
|
580
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* Request parameters for refreshProductLanguages operation in TranslationApi.
|
|
611
|
+
* @export
|
|
612
|
+
* @interface TranslationApiRefreshProductLanguagesRequest
|
|
613
|
+
*/
|
|
614
|
+
export interface TranslationApiRefreshProductLanguagesRequest {
|
|
615
|
+
/**
|
|
616
|
+
* Slug of the product.
|
|
617
|
+
* @type {string}
|
|
618
|
+
* @memberof TranslationApiRefreshProductLanguages
|
|
619
|
+
*/
|
|
620
|
+
readonly productSlug: string;
|
|
621
|
+
/**
|
|
622
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
623
|
+
* @type {string}
|
|
624
|
+
* @memberof TranslationApiRefreshProductLanguages
|
|
625
|
+
*/
|
|
626
|
+
readonly authorization?: string;
|
|
627
|
+
}
|
|
581
628
|
/**
|
|
582
629
|
* Request parameters for saveProductTranslations operation in TranslationApi.
|
|
583
630
|
* @export
|
|
@@ -723,6 +770,15 @@ export declare class TranslationApi extends BaseAPI {
|
|
|
723
770
|
* @memberof TranslationApi
|
|
724
771
|
*/
|
|
725
772
|
listTranslations(requestParameters?: TranslationApiListTranslationsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListTranslationsResponseClass, any, {}>>;
|
|
773
|
+
/**
|
|
774
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
775
|
+
* @summary Retrieve the refreshed product languages
|
|
776
|
+
* @param {TranslationApiRefreshProductLanguagesRequest} requestParameters Request parameters.
|
|
777
|
+
* @param {*} [options] Override http request option.
|
|
778
|
+
* @throws {RequiredError}
|
|
779
|
+
* @memberof TranslationApi
|
|
780
|
+
*/
|
|
781
|
+
refreshProductLanguages(requestParameters: TranslationApiRefreshProductLanguagesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RefreshProductLanguagesResponseClass, any, {}>>;
|
|
726
782
|
/**
|
|
727
783
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
728
784
|
* @summary Create the product translations
|
|
@@ -489,6 +489,54 @@ var TranslationApiAxiosParamCreator = function (configuration) {
|
|
|
489
489
|
});
|
|
490
490
|
});
|
|
491
491
|
},
|
|
492
|
+
/**
|
|
493
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
494
|
+
* @summary Retrieve the refreshed product languages
|
|
495
|
+
* @param {string} productSlug Slug of the product.
|
|
496
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
497
|
+
* @param {*} [options] Override http request option.
|
|
498
|
+
* @throws {RequiredError}
|
|
499
|
+
*/
|
|
500
|
+
refreshProductLanguages: function (productSlug, authorization, options) {
|
|
501
|
+
if (options === void 0) { options = {}; }
|
|
502
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
503
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
504
|
+
return __generator(this, function (_a) {
|
|
505
|
+
switch (_a.label) {
|
|
506
|
+
case 0:
|
|
507
|
+
// verify required parameter 'productSlug' is not null or undefined
|
|
508
|
+
(0, common_1.assertParamExists)('refreshProductLanguages', 'productSlug', productSlug);
|
|
509
|
+
localVarPath = "/translationservice/v1/product/{productSlug}/languages"
|
|
510
|
+
.replace("{".concat("productSlug", "}"), encodeURIComponent(String(productSlug)));
|
|
511
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
512
|
+
if (configuration) {
|
|
513
|
+
baseOptions = configuration.baseOptions;
|
|
514
|
+
baseAccessToken = configuration.accessToken;
|
|
515
|
+
}
|
|
516
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
517
|
+
localVarHeaderParameter = {};
|
|
518
|
+
localVarQueryParameter = {};
|
|
519
|
+
// authentication bearer required
|
|
520
|
+
// http bearer authentication required
|
|
521
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
522
|
+
case 1:
|
|
523
|
+
// authentication bearer required
|
|
524
|
+
// http bearer authentication required
|
|
525
|
+
_a.sent();
|
|
526
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
527
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
528
|
+
}
|
|
529
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
530
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
531
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
532
|
+
return [2 /*return*/, {
|
|
533
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
534
|
+
options: localVarRequestOptions,
|
|
535
|
+
}];
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
},
|
|
492
540
|
/**
|
|
493
541
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
494
542
|
* @summary Create the product translations
|
|
@@ -822,6 +870,27 @@ var TranslationApiFp = function (configuration) {
|
|
|
822
870
|
});
|
|
823
871
|
});
|
|
824
872
|
},
|
|
873
|
+
/**
|
|
874
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
875
|
+
* @summary Retrieve the refreshed product languages
|
|
876
|
+
* @param {string} productSlug Slug of the product.
|
|
877
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
878
|
+
* @param {*} [options] Override http request option.
|
|
879
|
+
* @throws {RequiredError}
|
|
880
|
+
*/
|
|
881
|
+
refreshProductLanguages: function (productSlug, authorization, options) {
|
|
882
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
883
|
+
var localVarAxiosArgs;
|
|
884
|
+
return __generator(this, function (_a) {
|
|
885
|
+
switch (_a.label) {
|
|
886
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.refreshProductLanguages(productSlug, authorization, options)];
|
|
887
|
+
case 1:
|
|
888
|
+
localVarAxiosArgs = _a.sent();
|
|
889
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
},
|
|
825
894
|
/**
|
|
826
895
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
827
896
|
* @summary Create the product translations
|
|
@@ -989,6 +1058,17 @@ var TranslationApiFactory = function (configuration, basePath, axios) {
|
|
|
989
1058
|
listTranslations: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
990
1059
|
return localVarFp.listTranslations(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
|
|
991
1060
|
},
|
|
1061
|
+
/**
|
|
1062
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
1063
|
+
* @summary Retrieve the refreshed product languages
|
|
1064
|
+
* @param {string} productSlug Slug of the product.
|
|
1065
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
1066
|
+
* @param {*} [options] Override http request option.
|
|
1067
|
+
* @throws {RequiredError}
|
|
1068
|
+
*/
|
|
1069
|
+
refreshProductLanguages: function (productSlug, authorization, options) {
|
|
1070
|
+
return localVarFp.refreshProductLanguages(productSlug, authorization, options).then(function (request) { return request(axios, basePath); });
|
|
1071
|
+
},
|
|
992
1072
|
/**
|
|
993
1073
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
994
1074
|
* @summary Create the product translations
|
|
@@ -1125,6 +1205,18 @@ var TranslationApi = /** @class */ (function (_super) {
|
|
|
1125
1205
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
1126
1206
|
return (0, exports.TranslationApiFp)(this.configuration).listTranslations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1127
1207
|
};
|
|
1208
|
+
/**
|
|
1209
|
+
* This returns a product\'s languages with every translation count recomputed first. The plain list answers from the stored counts, which are only rewritten when somebody saves or downloads translations. **Required Permissions** \"translation-management.translations.view\"
|
|
1210
|
+
* @summary Retrieve the refreshed product languages
|
|
1211
|
+
* @param {TranslationApiRefreshProductLanguagesRequest} requestParameters Request parameters.
|
|
1212
|
+
* @param {*} [options] Override http request option.
|
|
1213
|
+
* @throws {RequiredError}
|
|
1214
|
+
* @memberof TranslationApi
|
|
1215
|
+
*/
|
|
1216
|
+
TranslationApi.prototype.refreshProductLanguages = function (requestParameters, options) {
|
|
1217
|
+
var _this = this;
|
|
1218
|
+
return (0, exports.TranslationApiFp)(this.configuration).refreshProductLanguages(requestParameters.productSlug, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1219
|
+
};
|
|
1128
1220
|
/**
|
|
1129
1221
|
* This creates or updates translations for a product from JSON. Same store as the XLSX upload. An empty value removes an existing translation. **Required Permissions** \"translation-management.translations.create\"
|
|
1130
1222
|
* @summary Create the product translations
|
package/dist/base.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare class BaseAPI {
|
|
|
63
63
|
protected configuration: Configuration | undefined;
|
|
64
64
|
private tokenData?;
|
|
65
65
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
66
|
+
private useCookieAuth;
|
|
66
67
|
selectEnvironment(env: Environment): void;
|
|
67
68
|
selectBasePath(path: string): void;
|
|
68
69
|
getPermissions(): Array<string>;
|
package/dist/base.js
CHANGED
|
@@ -128,10 +128,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
128
128
|
var accessToken = this.tokenData.accessToken;
|
|
129
129
|
this.configuration = configuration;
|
|
130
130
|
this.basePath = configuration.basePath || this.basePath;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
if (configuration.cookieAuth) {
|
|
132
|
+
this.useCookieAuth();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
// Use config token if provided, otherwise use tokenData token
|
|
136
|
+
var configToken = this.configuration.accessToken;
|
|
137
|
+
var storedToken = accessToken ? "Bearer ".concat(accessToken) : '';
|
|
138
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
139
|
+
}
|
|
135
140
|
}
|
|
136
141
|
else {
|
|
137
142
|
var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
|
|
@@ -143,6 +148,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
143
148
|
}
|
|
144
149
|
this.attachInterceptor(axios);
|
|
145
150
|
}
|
|
151
|
+
// Cookie mode: the browser sends the HttpOnly access cookie, so no token is read from storage.
|
|
152
|
+
BaseAPI.prototype.useCookieAuth = function () {
|
|
153
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
154
|
+
this.configuration.baseOptions = __assign(__assign({}, this.configuration.baseOptions), { withCredentials: true });
|
|
155
|
+
};
|
|
146
156
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
147
157
|
this.selectBasePath(env);
|
|
148
158
|
};
|
|
@@ -177,10 +187,12 @@ var BaseAPI = /** @class */ (function () {
|
|
|
177
187
|
response = _b.sent();
|
|
178
188
|
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
179
189
|
this.configuration.username = username;
|
|
180
|
-
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
181
190
|
this.tokenData.username = username;
|
|
182
|
-
this.tokenData.accessToken = accessToken;
|
|
183
191
|
this.tokenData.permissions = permissions;
|
|
192
|
+
if (!this.configuration.cookieAuth) {
|
|
193
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
194
|
+
this.tokenData.accessToken = accessToken;
|
|
195
|
+
}
|
|
184
196
|
if (!targetWorkspace) return [3 /*break*/, 3];
|
|
185
197
|
return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
|
|
186
198
|
case 2:
|
|
@@ -206,10 +218,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
206
218
|
options = {
|
|
207
219
|
method: 'POST',
|
|
208
220
|
url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
|
|
209
|
-
headers: {
|
|
210
|
-
'Content-Type': 'application/json',
|
|
211
|
-
'Authorization': "Bearer ".concat(this.configuration.accessToken),
|
|
212
|
-
},
|
|
221
|
+
headers: __assign({ 'Content-Type': 'application/json' }, (this.configuration.cookieAuth ? {} : { 'Authorization': "Bearer ".concat(this.configuration.accessToken) })),
|
|
213
222
|
data: {
|
|
214
223
|
username: this.configuration.username,
|
|
215
224
|
targetWorkspace: targetWorkspace,
|
|
@@ -220,9 +229,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
220
229
|
case 1:
|
|
221
230
|
response = _b.sent();
|
|
222
231
|
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
223
|
-
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
224
|
-
this.tokenData.accessToken = accessToken;
|
|
225
232
|
this.tokenData.permissions = permissions;
|
|
233
|
+
if (!this.configuration.cookieAuth) {
|
|
234
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
235
|
+
this.tokenData.accessToken = accessToken;
|
|
236
|
+
}
|
|
226
237
|
this.storeTokenData(__assign({}, this.tokenData));
|
|
227
238
|
return [2 /*return*/];
|
|
228
239
|
}
|
|
@@ -265,7 +276,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
265
276
|
});
|
|
266
277
|
};
|
|
267
278
|
BaseAPI.prototype.storeTokenData = function (tokenData) {
|
|
279
|
+
var _a;
|
|
268
280
|
if (typeof window !== 'undefined') {
|
|
281
|
+
if (tokenData && ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.cookieAuth)) {
|
|
282
|
+
// Cookie mode saves who is logged in, never the token; a token saved by apps not yet migrated stays.
|
|
283
|
+
var username = tokenData.username, permissions = tokenData.permissions;
|
|
284
|
+
tokenData = __assign(__assign({}, ((0, common_1.defaultStorage)().get(TOKEN_DATA) || {})), { username: username, permissions: permissions });
|
|
285
|
+
}
|
|
269
286
|
(0, common_1.defaultStorage)().set(TOKEN_DATA, tokenData);
|
|
270
287
|
}
|
|
271
288
|
};
|
|
@@ -300,12 +317,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
300
317
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
301
318
|
case 2:
|
|
302
319
|
_a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
|
|
303
|
-
accessToken = "Bearer ".concat(tokenString);
|
|
304
320
|
this.tokenData.permissions = permissions;
|
|
305
321
|
delete originalConfig.headers['Authorization'];
|
|
306
|
-
|
|
307
|
-
this.configuration.
|
|
308
|
-
|
|
322
|
+
// In cookie mode the refresh reply renewed the access cookie, so retry without a header.
|
|
323
|
+
if (!this.configuration.cookieAuth) {
|
|
324
|
+
accessToken = "Bearer ".concat(tokenString);
|
|
325
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
326
|
+
this.configuration.accessToken = accessToken;
|
|
327
|
+
this.tokenData.accessToken = tokenString;
|
|
328
|
+
}
|
|
309
329
|
this.storeTokenData(this.tokenData);
|
|
310
330
|
return [2 /*return*/, axios(originalConfig)];
|
|
311
331
|
case 3:
|
package/dist/configuration.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface ConfigurationParameters {
|
|
|
17
17
|
basePath?: string;
|
|
18
18
|
baseOptions?: any;
|
|
19
19
|
formDataCtor?: new () => any;
|
|
20
|
+
cookieAuth?: boolean;
|
|
20
21
|
}
|
|
21
22
|
export declare class Configuration {
|
|
22
23
|
/**
|
|
@@ -68,6 +69,14 @@ export declare class Configuration {
|
|
|
68
69
|
* @type {new () => FormData}
|
|
69
70
|
*/
|
|
70
71
|
formDataCtor?: new () => any;
|
|
72
|
+
/**
|
|
73
|
+
* Authenticate with the HttpOnly access cookie instead of a stored token: every call sends credentials.
|
|
74
|
+
* The browser holds one cookie, so use it with one logged-in account; log out through the auth service.
|
|
75
|
+
*
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
* @memberof Configuration
|
|
78
|
+
*/
|
|
79
|
+
cookieAuth?: boolean;
|
|
71
80
|
constructor(param?: ConfigurationParameters);
|
|
72
81
|
/**
|
|
73
82
|
* Check if the given MIME is a JSON MIME.
|
package/dist/configuration.js
CHANGED
|
@@ -24,6 +24,7 @@ var Configuration = /** @class */ (function () {
|
|
|
24
24
|
this.basePath = param.basePath;
|
|
25
25
|
this.baseOptions = param.baseOptions;
|
|
26
26
|
this.formDataCtor = param.formDataCtor;
|
|
27
|
+
this.cookieAuth = param.cookieAuth;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Check if the given MIME is a JSON MIME.
|
package/dist/models/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export * from './list-product-languages-response-class';
|
|
|
8
8
|
export * from './list-translations-response-class';
|
|
9
9
|
export * from './new-translation-class';
|
|
10
10
|
export * from './product-language-class';
|
|
11
|
+
export * from './refresh-product-languages-response-class';
|
|
11
12
|
export * from './save-product-translations-request-dto';
|
|
13
|
+
export * from './skipped-translation-class';
|
|
12
14
|
export * from './translatable-field-class';
|
|
13
15
|
export * from './translation-class';
|
|
14
16
|
export * from './update-product-language-request-dto';
|
package/dist/models/index.js
CHANGED
|
@@ -24,7 +24,9 @@ __exportStar(require("./list-product-languages-response-class"), exports);
|
|
|
24
24
|
__exportStar(require("./list-translations-response-class"), exports);
|
|
25
25
|
__exportStar(require("./new-translation-class"), exports);
|
|
26
26
|
__exportStar(require("./product-language-class"), exports);
|
|
27
|
+
__exportStar(require("./refresh-product-languages-response-class"), exports);
|
|
27
28
|
__exportStar(require("./save-product-translations-request-dto"), exports);
|
|
29
|
+
__exportStar(require("./skipped-translation-class"), exports);
|
|
28
30
|
__exportStar(require("./translatable-field-class"), exports);
|
|
29
31
|
__exportStar(require("./translation-class"), exports);
|
|
30
32
|
__exportStar(require("./update-product-language-request-dto"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL TranslationService
|
|
3
|
+
* The EMIL TranslationService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import { ProductLanguageClass } from './product-language-class';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface RefreshProductLanguagesResponseClass
|
|
17
|
+
*/
|
|
18
|
+
export interface RefreshProductLanguagesResponseClass {
|
|
19
|
+
/**
|
|
20
|
+
* The list of product languages.
|
|
21
|
+
* @type {Array<ProductLanguageClass>}
|
|
22
|
+
* @memberof RefreshProductLanguagesResponseClass
|
|
23
|
+
*/
|
|
24
|
+
'items': Array<ProductLanguageClass>;
|
|
25
|
+
/**
|
|
26
|
+
* How many of the items were actually recomputed. Fewer than the number of items means the rest are answered from their stored status, and are therefore possibly out of date. Absent means unknown - an older deployment that did not report it - and a caller should say nothing rather than assume the worst.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof RefreshProductLanguagesResponseClass
|
|
29
|
+
*/
|
|
30
|
+
'refreshedCount'?: number;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL TranslationService
|
|
6
|
+
* The EMIL TranslationService API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL TranslationService
|
|
3
|
+
* The EMIL TranslationService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface SkippedTranslationClass
|
|
16
|
+
*/
|
|
17
|
+
export interface SkippedTranslationClass {
|
|
18
|
+
/**
|
|
19
|
+
* The translation key from the uploaded sheet.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof SkippedTranslationClass
|
|
22
|
+
*/
|
|
23
|
+
'key': string;
|
|
24
|
+
/**
|
|
25
|
+
* Why the row was not saved: unknown-key, unsupported-key, unexpected-closing-tag, mismatched-closing-tag, unclosed-tag, malformed-attribute or missing-placeholder.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof SkippedTranslationClass
|
|
28
|
+
*/
|
|
29
|
+
'reason': string;
|
|
30
|
+
/**
|
|
31
|
+
* The same cause with specifics, for showing to a person. May be empty.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof SkippedTranslationClass
|
|
34
|
+
*/
|
|
35
|
+
'detail': string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL TranslationService
|
|
6
|
+
* The EMIL TranslationService API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -39,4 +39,16 @@ export interface TranslatableFieldClass {
|
|
|
39
39
|
* @memberof TranslatableFieldClass
|
|
40
40
|
*/
|
|
41
41
|
'translatedValue': string;
|
|
42
|
+
/**
|
|
43
|
+
* True when the translation was made from source text that has since changed. Absent means untranslated, unchanged, or recorded before this existed.
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @memberof TranslatableFieldClass
|
|
46
|
+
*/
|
|
47
|
+
'stale'?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The source text the translation was made from, sent only when it differs from the current one
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof TranslatableFieldClass
|
|
52
|
+
*/
|
|
53
|
+
'translatedFrom'?: string;
|
|
42
54
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import { SkippedTranslationClass } from './skipped-translation-class';
|
|
12
13
|
import { TranslationClass } from './translation-class';
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
@@ -22,4 +23,16 @@ export interface UploadProductTranslationsResponseClass {
|
|
|
22
23
|
* @memberof UploadProductTranslationsResponseClass
|
|
23
24
|
*/
|
|
24
25
|
'translations': Array<TranslationClass>;
|
|
26
|
+
/**
|
|
27
|
+
* Rows that were not saved. Empty on a clean upload. Whatever was already stored for a skipped key is left untouched.
|
|
28
|
+
* @type {Array<SkippedTranslationClass>}
|
|
29
|
+
* @memberof UploadProductTranslationsResponseClass
|
|
30
|
+
*/
|
|
31
|
+
'skipped': Array<SkippedTranslationClass>;
|
|
32
|
+
/**
|
|
33
|
+
* Rows left blank in the sheet and ignored on purpose, which is what keeps an upload additive. Not a failure.
|
|
34
|
+
* @type {number}
|
|
35
|
+
* @memberof UploadProductTranslationsResponseClass
|
|
36
|
+
*/
|
|
37
|
+
'blankCount': number;
|
|
25
38
|
}
|
package/models/index.ts
CHANGED
|
@@ -8,7 +8,9 @@ export * from './list-product-languages-response-class';
|
|
|
8
8
|
export * from './list-translations-response-class';
|
|
9
9
|
export * from './new-translation-class';
|
|
10
10
|
export * from './product-language-class';
|
|
11
|
+
export * from './refresh-product-languages-response-class';
|
|
11
12
|
export * from './save-product-translations-request-dto';
|
|
13
|
+
export * from './skipped-translation-class';
|
|
12
14
|
export * from './translatable-field-class';
|
|
13
15
|
export * from './translation-class';
|
|
14
16
|
export * from './update-product-language-request-dto';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL TranslationService
|
|
5
|
+
* The EMIL TranslationService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import { ProductLanguageClass } from './product-language-class';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface RefreshProductLanguagesResponseClass
|
|
22
|
+
*/
|
|
23
|
+
export interface RefreshProductLanguagesResponseClass {
|
|
24
|
+
/**
|
|
25
|
+
* The list of product languages.
|
|
26
|
+
* @type {Array<ProductLanguageClass>}
|
|
27
|
+
* @memberof RefreshProductLanguagesResponseClass
|
|
28
|
+
*/
|
|
29
|
+
'items': Array<ProductLanguageClass>;
|
|
30
|
+
/**
|
|
31
|
+
* How many of the items were actually recomputed. Fewer than the number of items means the rest are answered from their stored status, and are therefore possibly out of date. Absent means unknown - an older deployment that did not report it - and a caller should say nothing rather than assume the worst.
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof RefreshProductLanguagesResponseClass
|
|
34
|
+
*/
|
|
35
|
+
'refreshedCount'?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL TranslationService
|
|
5
|
+
* The EMIL TranslationService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface SkippedTranslationClass
|
|
21
|
+
*/
|
|
22
|
+
export interface SkippedTranslationClass {
|
|
23
|
+
/**
|
|
24
|
+
* The translation key from the uploaded sheet.
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof SkippedTranslationClass
|
|
27
|
+
*/
|
|
28
|
+
'key': string;
|
|
29
|
+
/**
|
|
30
|
+
* Why the row was not saved: unknown-key, unsupported-key, unexpected-closing-tag, mismatched-closing-tag, unclosed-tag, malformed-attribute or missing-placeholder.
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof SkippedTranslationClass
|
|
33
|
+
*/
|
|
34
|
+
'reason': string;
|
|
35
|
+
/**
|
|
36
|
+
* The same cause with specifics, for showing to a person. May be empty.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof SkippedTranslationClass
|
|
39
|
+
*/
|
|
40
|
+
'detail': string;
|
|
41
|
+
}
|
|
42
|
+
|
|
@@ -44,5 +44,17 @@ export interface TranslatableFieldClass {
|
|
|
44
44
|
* @memberof TranslatableFieldClass
|
|
45
45
|
*/
|
|
46
46
|
'translatedValue': string;
|
|
47
|
+
/**
|
|
48
|
+
* True when the translation was made from source text that has since changed. Absent means untranslated, unchanged, or recorded before this existed.
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
* @memberof TranslatableFieldClass
|
|
51
|
+
*/
|
|
52
|
+
'stale'?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The source text the translation was made from, sent only when it differs from the current one
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @memberof TranslatableFieldClass
|
|
57
|
+
*/
|
|
58
|
+
'translatedFrom'?: string;
|
|
47
59
|
}
|
|
48
60
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
import { SkippedTranslationClass } from './skipped-translation-class';
|
|
16
17
|
import { TranslationClass } from './translation-class';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -27,5 +28,17 @@ export interface UploadProductTranslationsResponseClass {
|
|
|
27
28
|
* @memberof UploadProductTranslationsResponseClass
|
|
28
29
|
*/
|
|
29
30
|
'translations': Array<TranslationClass>;
|
|
31
|
+
/**
|
|
32
|
+
* Rows that were not saved. Empty on a clean upload. Whatever was already stored for a skipped key is left untouched.
|
|
33
|
+
* @type {Array<SkippedTranslationClass>}
|
|
34
|
+
* @memberof UploadProductTranslationsResponseClass
|
|
35
|
+
*/
|
|
36
|
+
'skipped': Array<SkippedTranslationClass>;
|
|
37
|
+
/**
|
|
38
|
+
* Rows left blank in the sheet and ignored on purpose, which is what keeps an upload additive. Not a failure.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof UploadProductTranslationsResponseClass
|
|
41
|
+
*/
|
|
42
|
+
'blankCount': number;
|
|
30
43
|
}
|
|
31
44
|
|