smartling-api-sdk-nodejs 2.27.0 → 2.29.0
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/base/base-api.ts +205 -0
- package/api/base/base-file-api.ts +23 -0
- package/api/base/index.ts +2 -205
- package/api/file-translations/index.ts +5 -24
- package/api/files/index.ts +39 -2
- package/api/files/params/download-file-base-parameters.ts +22 -0
- package/api/files/params/download-file-parameters.ts +2 -21
- package/api/files/params/download-file-with-metadata-parameters.ts +12 -0
- package/api/files/params/download-multiple-files-translations-parameters.ts +50 -0
- package/api/files/params/file-filter.ts +4 -0
- package/api/files/params/file-locale-mode.ts +19 -0
- package/api/files/params/file-locales.ts +6 -0
- package/api/files/params/filename-mode.ts +4 -0
- package/api/files/params/translation-file-name-mode.ts +18 -0
- package/built/api/base/base-api.d.ts +26 -0
- package/built/api/base/base-api.js +163 -0
- package/built/api/base/base-api.js.map +1 -0
- package/built/api/base/base-file-api.d.ts +5 -0
- package/built/api/base/base-file-api.js +36 -0
- package/built/api/base/base-file-api.js.map +1 -0
- package/built/api/base/index.d.ts +2 -26
- package/built/api/base/index.js +5 -160
- package/built/api/base/index.js.map +1 -1
- package/built/api/dto/translated-file-dto.js.map +1 -0
- package/built/api/file-translations/index.d.ts +3 -4
- package/built/api/file-translations/index.js +3 -22
- package/built/api/file-translations/index.js.map +1 -1
- package/built/api/files/index.d.ts +7 -2
- package/built/api/files/index.js +12 -2
- package/built/api/files/index.js.map +1 -1
- package/built/api/files/params/download-file-base-parameters.d.ts +7 -0
- package/built/api/files/params/download-file-base-parameters.js +20 -0
- package/built/api/files/params/download-file-base-parameters.js.map +1 -0
- package/built/api/files/params/download-file-parameters.d.ts +2 -6
- package/built/api/files/params/download-file-parameters.js +2 -14
- package/built/api/files/params/download-file-parameters.js.map +1 -1
- package/built/api/files/params/download-file-with-metadata-parameters.d.ts +5 -0
- package/built/api/files/params/download-file-with-metadata-parameters.js +15 -0
- package/built/api/files/params/download-file-with-metadata-parameters.js.map +1 -0
- package/built/api/files/params/download-multiple-files-translations-parameters.d.ts +12 -0
- package/built/api/files/params/download-multiple-files-translations-parameters.js +37 -0
- package/built/api/files/params/download-multiple-files-translations-parameters.js.map +1 -0
- package/built/api/files/params/file-filter.d.ts +4 -0
- package/built/api/files/params/file-filter.js +9 -0
- package/built/api/files/params/file-filter.js.map +1 -0
- package/built/api/files/params/file-locale-mode.d.ts +5 -0
- package/built/api/files/params/file-locale-mode.js +10 -0
- package/built/api/files/params/file-locale-mode.js.map +1 -0
- package/built/api/files/params/file-locales.d.ts +5 -0
- package/built/api/files/params/file-locales.js +3 -0
- package/built/api/files/params/file-locales.js.map +1 -0
- package/built/api/files/params/filename-mode.d.ts +4 -0
- package/built/api/files/params/filename-mode.js +9 -0
- package/built/api/files/params/filename-mode.js.map +1 -0
- package/built/api/files/params/translation-file-name-mode.d.ts +5 -0
- package/built/api/files/params/translation-file-name-mode.js +10 -0
- package/built/api/files/params/translation-file-name-mode.js.map +1 -0
- package/built/index.d.ts +9 -1
- package/built/index.js +9 -1
- package/built/index.js.map +1 -1
- package/built/package.json +1 -1
- package/index.ts +9 -1
- package/package.json +1 -1
- package/test/base-file.spec.ts +57 -0
- package/test/files.spec.ts +379 -0
- package/built/api/file-translations/dto/translated-file-dto.js.map +0 -1
- /package/api/{file-translations/dto → dto}/translated-file-dto.ts +0 -0
- /package/built/api/{file-translations/dto → dto}/translated-file-dto.d.ts +0 -0
- /package/built/api/{file-translations/dto → dto}/translated-file-dto.js +0 -0
package/test/files.spec.ts
CHANGED
|
@@ -5,12 +5,20 @@ import { SmartlingFilesApi } from "../api/files/index";
|
|
|
5
5
|
import { authMock, loggerMock, responseMock } from "./mock";
|
|
6
6
|
import { RetrievalType } from "../api/files/params/retrieval-type";
|
|
7
7
|
import { DownloadFileParameters } from "../api/files/params/download-file-parameters";
|
|
8
|
+
import { DownloadFileWithMetadataParameters } from "../api/files/params/download-file-with-metadata-parameters";
|
|
8
9
|
import { UploadFileParameters } from "../api/files/params/upload-file-parameters";
|
|
9
10
|
import { SmartlingAuthApi } from "../api/auth/index";
|
|
10
11
|
import { FileType } from "../api/files/params/file-type";
|
|
11
12
|
import { streamToString } from "./stream-to-string";
|
|
12
13
|
import { DownloadFileAllTranslationsParameters } from "../api/files/params/download-file-all-translations-parameters";
|
|
13
14
|
import { RecentlyUploadedFilesParameters } from "../api/files/params/recently-uploaded-files";
|
|
15
|
+
import { FileNameMode } from "../api/files/params/filename-mode";
|
|
16
|
+
import { DownloadMultipleFilesTranslationsParameters } from "../api/files/params/download-multiple-files-translations-parameters";
|
|
17
|
+
import { FileLocales } from "../api/files/params/file-locales";
|
|
18
|
+
import { SmartlingException } from "../api/exception";
|
|
19
|
+
import { TranslationFileNameMode } from "../api/files/params/translation-file-name-mode";
|
|
20
|
+
import { FileLocaleMode } from "../api/files/params/file-locale-mode";
|
|
21
|
+
import { FileFilter } from "../api/files/params/file-filter";
|
|
14
22
|
|
|
15
23
|
describe("SmartlingFilesApi class tests.", () => {
|
|
16
24
|
const projectId = "testProjectId";
|
|
@@ -210,6 +218,276 @@ describe("SmartlingFilesApi class tests.", () => {
|
|
|
210
218
|
});
|
|
211
219
|
});
|
|
212
220
|
|
|
221
|
+
describe("Download file with metadata", () => {
|
|
222
|
+
let getHeaderStub;
|
|
223
|
+
const localeId = "fr-FR";
|
|
224
|
+
let params: DownloadFileWithMetadataParameters;
|
|
225
|
+
|
|
226
|
+
beforeEach(() => {
|
|
227
|
+
params = new DownloadFileWithMetadataParameters();
|
|
228
|
+
getHeaderStub = sinon.stub(responseMock.headers, "get");
|
|
229
|
+
getHeaderStub.returns(null);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
afterEach(() => {
|
|
233
|
+
getHeaderStub.restore();
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("Download file when no headers in response", async () => {
|
|
237
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
238
|
+
projectId,
|
|
239
|
+
fileUri,
|
|
240
|
+
localeId,
|
|
241
|
+
params
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
245
|
+
sinon.assert.calledWithExactly(
|
|
246
|
+
filesApiFetchStub,
|
|
247
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?fileUri=testFileUri`,
|
|
248
|
+
{
|
|
249
|
+
headers: {
|
|
250
|
+
Authorization: "test_token_type test_access_token",
|
|
251
|
+
"Content-Type": "application/json",
|
|
252
|
+
"User-Agent": "test_user_agent"
|
|
253
|
+
},
|
|
254
|
+
method: "get"
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
assert.ok(fileWithMetadata.contentType === undefined);
|
|
259
|
+
assert.ok(fileWithMetadata.fileName === undefined);
|
|
260
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it("Download file with metadata", async () => {
|
|
264
|
+
getHeaderStub.onCall(0).returns("application/xml");
|
|
265
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.xml\"");
|
|
266
|
+
getHeaderStub.returns(null);
|
|
267
|
+
|
|
268
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
269
|
+
projectId,
|
|
270
|
+
fileUri,
|
|
271
|
+
localeId,
|
|
272
|
+
params
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
276
|
+
sinon.assert.calledWithExactly(
|
|
277
|
+
filesApiFetchStub,
|
|
278
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?fileUri=testFileUri`,
|
|
279
|
+
{
|
|
280
|
+
headers: {
|
|
281
|
+
Authorization: "test_token_type test_access_token",
|
|
282
|
+
"Content-Type": "application/json",
|
|
283
|
+
"User-Agent": "test_user_agent"
|
|
284
|
+
},
|
|
285
|
+
method: "get"
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
assert.ok(fileWithMetadata.contentType === "application/xml");
|
|
290
|
+
assert.ok(fileWithMetadata.fileName === "test.xml");
|
|
291
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it("Download file with fileNameMode original", async () => {
|
|
295
|
+
params.setFileNameMode(FileNameMode.ORIGINAL);
|
|
296
|
+
|
|
297
|
+
getHeaderStub.onCall(0).returns("application/xml");
|
|
298
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.xml\"");
|
|
299
|
+
getHeaderStub.returns(null);
|
|
300
|
+
|
|
301
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
302
|
+
projectId,
|
|
303
|
+
fileUri,
|
|
304
|
+
localeId,
|
|
305
|
+
params
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
309
|
+
sinon.assert.calledWithExactly(
|
|
310
|
+
filesApiFetchStub,
|
|
311
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?fileUri=testFileUri`,
|
|
312
|
+
{
|
|
313
|
+
headers: {
|
|
314
|
+
Authorization: "test_token_type test_access_token",
|
|
315
|
+
"Content-Type": "application/json",
|
|
316
|
+
"User-Agent": "test_user_agent"
|
|
317
|
+
},
|
|
318
|
+
method: "get"
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
assert.ok(fileWithMetadata.contentType === "application/xml");
|
|
323
|
+
assert.ok(fileWithMetadata.fileName === "test.xml");
|
|
324
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it("Download file with fileNameMode transformed", async () => {
|
|
328
|
+
params.setFileNameMode(FileNameMode.TRANSFORMED);
|
|
329
|
+
|
|
330
|
+
getHeaderStub.onCall(0).returns("application/xml");
|
|
331
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.xml\"");
|
|
332
|
+
getHeaderStub.returns(null);
|
|
333
|
+
|
|
334
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
335
|
+
projectId,
|
|
336
|
+
fileUri,
|
|
337
|
+
localeId,
|
|
338
|
+
params
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
342
|
+
sinon.assert.calledWithExactly(
|
|
343
|
+
filesApiFetchStub,
|
|
344
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?changeFileName=true&fileUri=testFileUri`,
|
|
345
|
+
{
|
|
346
|
+
headers: {
|
|
347
|
+
Authorization: "test_token_type test_access_token",
|
|
348
|
+
"Content-Type": "application/json",
|
|
349
|
+
"User-Agent": "test_user_agent"
|
|
350
|
+
},
|
|
351
|
+
method: "get"
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
assert.ok(fileWithMetadata.contentType === "application/xml");
|
|
356
|
+
assert.ok(fileWithMetadata.fileName === "test.xml");
|
|
357
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it("Download file with debugMode enabled and retrievalType published", async () => {
|
|
361
|
+
params
|
|
362
|
+
.setRetrievalType(RetrievalType.PUBLISHED)
|
|
363
|
+
.enableDebugMode();
|
|
364
|
+
|
|
365
|
+
getHeaderStub.onCall(0).returns("application/json");
|
|
366
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.json\"");
|
|
367
|
+
getHeaderStub.returns(null);
|
|
368
|
+
|
|
369
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
370
|
+
projectId,
|
|
371
|
+
fileUri,
|
|
372
|
+
localeId,
|
|
373
|
+
params
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
377
|
+
sinon.assert.calledWithExactly(
|
|
378
|
+
filesApiFetchStub,
|
|
379
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?retrievalType=published&debugMode=1&fileUri=testFileUri`,
|
|
380
|
+
{
|
|
381
|
+
headers: {
|
|
382
|
+
Authorization: "test_token_type test_access_token",
|
|
383
|
+
"Content-Type": "application/json",
|
|
384
|
+
"User-Agent": "test_user_agent"
|
|
385
|
+
},
|
|
386
|
+
method: "get"
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
assert.ok(fileWithMetadata.contentType === "application/json");
|
|
390
|
+
assert.ok(fileWithMetadata.fileName === "test.json");
|
|
391
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
it("Download file with debugMode disabled and retrievalType published", async () => {
|
|
395
|
+
params.setRetrievalType(RetrievalType.PUBLISHED);
|
|
396
|
+
|
|
397
|
+
getHeaderStub.onCall(0).returns("application/json");
|
|
398
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.json\"");
|
|
399
|
+
getHeaderStub.returns(null);
|
|
400
|
+
|
|
401
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
402
|
+
projectId,
|
|
403
|
+
fileUri,
|
|
404
|
+
localeId,
|
|
405
|
+
params
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
409
|
+
sinon.assert.calledWithExactly(
|
|
410
|
+
filesApiFetchStub,
|
|
411
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?retrievalType=published&fileUri=testFileUri`,
|
|
412
|
+
{
|
|
413
|
+
headers: {
|
|
414
|
+
Authorization: "test_token_type test_access_token",
|
|
415
|
+
"Content-Type": "application/json",
|
|
416
|
+
"User-Agent": "test_user_agent"
|
|
417
|
+
},
|
|
418
|
+
method: "get"
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
assert.ok(fileWithMetadata.contentType === "application/json");
|
|
422
|
+
assert.ok(fileWithMetadata.fileName === "test.json");
|
|
423
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it("Download file with includeOriginalStrings enabled", async() => {
|
|
427
|
+
params.setRetrievalType(RetrievalType.PUBLISHED).includeOriginalStrings();
|
|
428
|
+
|
|
429
|
+
getHeaderStub.onCall(0).returns("application/json");
|
|
430
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.json\"");
|
|
431
|
+
getHeaderStub.returns(null);
|
|
432
|
+
|
|
433
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
434
|
+
projectId,
|
|
435
|
+
fileUri,
|
|
436
|
+
localeId,
|
|
437
|
+
params
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
441
|
+
sinon.assert.calledWithExactly(
|
|
442
|
+
filesApiFetchStub,
|
|
443
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?retrievalType=published&includeOriginalStrings=true&fileUri=testFileUri`,
|
|
444
|
+
{
|
|
445
|
+
headers: {
|
|
446
|
+
Authorization: "test_token_type test_access_token",
|
|
447
|
+
"Content-Type": "application/json",
|
|
448
|
+
"User-Agent": "test_user_agent"
|
|
449
|
+
},
|
|
450
|
+
method: "get"
|
|
451
|
+
}
|
|
452
|
+
);
|
|
453
|
+
assert.ok(fileWithMetadata.contentType === "application/json");
|
|
454
|
+
assert.ok(fileWithMetadata.fileName === "test.json");
|
|
455
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
it("Download file with includeOriginalStrings disabled", async() => {
|
|
459
|
+
params.setRetrievalType(RetrievalType.PUBLISHED).excludeOriginalStrings();
|
|
460
|
+
|
|
461
|
+
getHeaderStub.onCall(0).returns("application/json");
|
|
462
|
+
getHeaderStub.onCall(1).returns("attachment; filename=\"test.json\"");
|
|
463
|
+
getHeaderStub.returns(null);
|
|
464
|
+
|
|
465
|
+
const fileWithMetadata = await filesApi.downloadFileWithMetadata(
|
|
466
|
+
projectId,
|
|
467
|
+
fileUri,
|
|
468
|
+
localeId,
|
|
469
|
+
params
|
|
470
|
+
);
|
|
471
|
+
|
|
472
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
473
|
+
sinon.assert.calledWithExactly(
|
|
474
|
+
filesApiFetchStub,
|
|
475
|
+
`https://test.com/files-api/v2/projects/${projectId}/locales/${localeId}/file?retrievalType=published&includeOriginalStrings=false&fileUri=testFileUri`,
|
|
476
|
+
{
|
|
477
|
+
headers: {
|
|
478
|
+
Authorization: "test_token_type test_access_token",
|
|
479
|
+
"Content-Type": "application/json",
|
|
480
|
+
"User-Agent": "test_user_agent"
|
|
481
|
+
},
|
|
482
|
+
method: "get"
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
assert.ok(fileWithMetadata.contentType === "application/json");
|
|
486
|
+
assert.ok(fileWithMetadata.fileName === "test.json");
|
|
487
|
+
assert.ok(fileWithMetadata.fileContent.byteLength === 1);
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
|
|
213
491
|
describe("Download file - all translations", () => {
|
|
214
492
|
let params: DownloadFileAllTranslationsParameters;
|
|
215
493
|
|
|
@@ -374,5 +652,106 @@ describe("SmartlingFilesApi class tests.", () => {
|
|
|
374
652
|
)
|
|
375
653
|
);
|
|
376
654
|
});
|
|
655
|
+
|
|
656
|
+
describe("Download multiple files translations", () => {
|
|
657
|
+
const localeId = "fr-FR";
|
|
658
|
+
const anotherLocaleId = "de-DE";
|
|
659
|
+
const files: FileLocales[] = [
|
|
660
|
+
{
|
|
661
|
+
fileUri,
|
|
662
|
+
localeIds: [localeId, anotherLocaleId]
|
|
663
|
+
}
|
|
664
|
+
];
|
|
665
|
+
let params: DownloadMultipleFilesTranslationsParameters;
|
|
666
|
+
|
|
667
|
+
beforeEach(() => {
|
|
668
|
+
params = new DownloadMultipleFilesTranslationsParameters(files);
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
it("throws error if file is missing", () => {
|
|
672
|
+
assert.throws(() => {
|
|
673
|
+
// eslint-disable-next-line no-new
|
|
674
|
+
new DownloadMultipleFilesTranslationsParameters([]);
|
|
675
|
+
}, SmartlingException);
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
it("throws error if localeId is missing", () => {
|
|
679
|
+
assert.throws(() => {
|
|
680
|
+
// eslint-disable-next-line no-new
|
|
681
|
+
new DownloadMultipleFilesTranslationsParameters([{
|
|
682
|
+
fileUri,
|
|
683
|
+
localeIds: []
|
|
684
|
+
}]);
|
|
685
|
+
}, SmartlingException);
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
it("Download mutliple files translations", async () => {
|
|
689
|
+
await filesApi.downloadMultipleFilesTranslations(
|
|
690
|
+
projectId,
|
|
691
|
+
params
|
|
692
|
+
);
|
|
693
|
+
|
|
694
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
695
|
+
sinon.assert.calledWithExactly(
|
|
696
|
+
filesApiFetchStub,
|
|
697
|
+
`https://test.com/files-api/v2/projects/${projectId}/files/zip`,
|
|
698
|
+
{
|
|
699
|
+
headers: {
|
|
700
|
+
Authorization: "test_token_type test_access_token",
|
|
701
|
+
"Content-Type": "application/json",
|
|
702
|
+
"User-Agent": "test_user_agent"
|
|
703
|
+
},
|
|
704
|
+
method: "post",
|
|
705
|
+
body: JSON.stringify({
|
|
706
|
+
files: [{
|
|
707
|
+
fileUri,
|
|
708
|
+
localeIds: [localeId, anotherLocaleId]
|
|
709
|
+
}]
|
|
710
|
+
})
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
it("Download mutliple files translations with parameters", async () => {
|
|
716
|
+
params
|
|
717
|
+
.setRetrievalType(RetrievalType.PUBLISHED)
|
|
718
|
+
.includeOriginalStrings()
|
|
719
|
+
.setFileNameMode(TranslationFileNameMode.UNCHANGED)
|
|
720
|
+
.setFileLocaleMode(FileLocaleMode.LOCALE_IN_PATH)
|
|
721
|
+
.setZipFileName("translations.zip")
|
|
722
|
+
.setFileFilter(FileFilter.ALL_FILES);
|
|
723
|
+
|
|
724
|
+
await filesApi.downloadMultipleFilesTranslations(
|
|
725
|
+
projectId,
|
|
726
|
+
params
|
|
727
|
+
);
|
|
728
|
+
|
|
729
|
+
sinon.assert.calledOnce(filesApiFetchStub);
|
|
730
|
+
sinon.assert.calledWithExactly(
|
|
731
|
+
filesApiFetchStub,
|
|
732
|
+
`https://test.com/files-api/v2/projects/${projectId}/files/zip`,
|
|
733
|
+
{
|
|
734
|
+
headers: {
|
|
735
|
+
Authorization: "test_token_type test_access_token",
|
|
736
|
+
"Content-Type": "application/json",
|
|
737
|
+
"User-Agent": "test_user_agent"
|
|
738
|
+
},
|
|
739
|
+
method: "post",
|
|
740
|
+
body: JSON.stringify({
|
|
741
|
+
files: [{
|
|
742
|
+
fileUri,
|
|
743
|
+
localeIds: [localeId, anotherLocaleId]
|
|
744
|
+
}],
|
|
745
|
+
retrievalType: "published",
|
|
746
|
+
includeOriginalStrings: true,
|
|
747
|
+
fileNameMode: "unchanged",
|
|
748
|
+
localeMode: "locale_in_path",
|
|
749
|
+
zipFileName: "translations.zip",
|
|
750
|
+
fileFilter: "all_files"
|
|
751
|
+
})
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
});
|
|
755
|
+
});
|
|
377
756
|
});
|
|
378
757
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translated-file-dto.js","sourceRoot":"","sources":["../../../../api/file-translations/dto/translated-file-dto.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|