smartling-api-sdk-nodejs 2.2.0 → 2.4.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.
Files changed (46) hide show
  1. package/.scannerwork/report-task.txt +2 -2
  2. package/api/files/dto/file-status-for-project-dto.ts +11 -0
  3. package/api/files/index.ts +24 -0
  4. package/api/files/params/download-file-all-translations-parameters.ts +3 -0
  5. package/api/job-batches/dto/batch-list-item-dto.ts +14 -0
  6. package/api/job-batches/index.ts +13 -0
  7. package/api/job-batches/params/list-batches-parameters.ts +41 -0
  8. package/api/jobs/index.ts +10 -0
  9. package/api/jobs/params/authorize-job-parameters.ts +21 -0
  10. package/api/jobs/params/create-job-parameters.ts +12 -0
  11. package/built/api/files/dto/file-status-for-project-dto.d.ts +9 -0
  12. package/built/api/files/dto/file-status-for-project-dto.js +3 -0
  13. package/built/api/files/dto/file-status-for-project-dto.js.map +1 -0
  14. package/built/api/files/index.d.ts +4 -0
  15. package/built/api/files/index.js +10 -0
  16. package/built/api/files/index.js.map +1 -1
  17. package/built/api/files/params/download-file-all-translations-parameters.d.ts +3 -0
  18. package/built/api/files/params/download-file-all-translations-parameters.js +8 -0
  19. package/built/api/files/params/download-file-all-translations-parameters.js.map +1 -0
  20. package/built/api/job-batches/dto/batch-list-item-dto.d.ts +11 -0
  21. package/built/api/job-batches/dto/batch-list-item-dto.js +3 -0
  22. package/built/api/job-batches/dto/batch-list-item-dto.js.map +1 -0
  23. package/built/api/job-batches/index.d.ts +4 -0
  24. package/built/api/job-batches/index.js +5 -0
  25. package/built/api/job-batches/index.js.map +1 -1
  26. package/built/api/job-batches/params/list-batches-parameters.d.ts +10 -0
  27. package/built/api/job-batches/params/list-batches-parameters.js +33 -0
  28. package/built/api/job-batches/params/list-batches-parameters.js.map +1 -0
  29. package/built/api/jobs/index.d.ts +2 -0
  30. package/built/api/jobs/index.js +5 -0
  31. package/built/api/jobs/index.js.map +1 -1
  32. package/built/api/jobs/params/authorize-job-parameters.d.ts +5 -0
  33. package/built/api/jobs/params/authorize-job-parameters.js +17 -0
  34. package/built/api/jobs/params/authorize-job-parameters.js.map +1 -0
  35. package/built/api/jobs/params/create-job-parameters.d.ts +2 -0
  36. package/built/api/jobs/params/create-job-parameters.js +8 -0
  37. package/built/api/jobs/params/create-job-parameters.js.map +1 -1
  38. package/built/index.d.ts +5 -0
  39. package/built/index.js +5 -0
  40. package/built/index.js.map +1 -1
  41. package/built/package.json +1 -1
  42. package/index.ts +5 -0
  43. package/package.json +1 -1
  44. package/test/files.spec.ts +50 -0
  45. package/test/job-batches.spec.ts +30 -0
  46. package/test/jobs.spec.ts +42 -2
@@ -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=AYuUxbyYRe7rJHsZ61mH
6
- ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AYuUxbyYRe7rJHsZ61mH
5
+ ceTaskId=AYwW7p9HRe7rJHsZ61nW
6
+ ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AYwW7p9HRe7rJHsZ61nW
@@ -0,0 +1,11 @@
1
+ import { FileType } from "../params/file-type";
2
+
3
+ interface FileStatusForProjectDto {
4
+ created: Date;
5
+ fileType: FileType;
6
+ fileUri: string;
7
+ hasInstructions: boolean;
8
+ lastUploaded: string;
9
+ }
10
+
11
+ export { FileStatusForProjectDto };
@@ -8,6 +8,8 @@ import { FileStatusForAllLocalesDto } from "./dto/file-status-for-all-locales-dt
8
8
  import { SmartlingListResponse } from "../http/smartling-list-response";
9
9
  import { LastModifiedForLocale } from "./dto/last-modified-for-locale-dto";
10
10
  import { UploadedFileDto } from "./dto/uploaded-file-dto";
11
+ import { FileStatusForProjectDto } from "./dto/file-status-for-project-dto";
12
+ import { DownloadFileAllTranslationsParameters } from "./params/download-file-all-translations-parameters";
11
13
 
12
14
  export class SmartlingFilesApi extends SmartlingBaseApi {
13
15
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger) {
@@ -47,6 +49,19 @@ export class SmartlingFilesApi extends SmartlingBaseApi {
47
49
  );
48
50
  }
49
51
 
52
+ async downloadFileAllTranslations(
53
+ projectId: string,
54
+ fileUri: string,
55
+ params: DownloadFileAllTranslationsParameters
56
+ ): Promise<string> {
57
+ return await this.makeRequest(
58
+ "get",
59
+ `${this.entrypoint}/${projectId}/locales/all/file/zip`,
60
+ Object.assign(params.export(), { fileUri }),
61
+ true
62
+ );
63
+ }
64
+
50
65
  async deleteFile(projectId: string, fileUri: string): Promise<boolean> {
51
66
  const form = new FormData();
52
67
 
@@ -79,6 +94,15 @@ export class SmartlingFilesApi extends SmartlingBaseApi {
79
94
  );
80
95
  }
81
96
 
97
+ async getRecentlyUploadedFiles(
98
+ projectId: string
99
+ ): Promise<SmartlingListResponse<FileStatusForProjectDto>> {
100
+ return await this.makeRequest(
101
+ "get",
102
+ `${this.entrypoint}/${projectId}/files/list`
103
+ );
104
+ }
105
+
82
106
  static fixContentTypeHeaderCase(form: FormData): Record<string, unknown> {
83
107
  const headers = form.getHeaders();
84
108
 
@@ -0,0 +1,3 @@
1
+ import { DownloadFileParameters } from "./download-file-parameters";
2
+
3
+ export class DownloadFileAllTranslationsParameters extends DownloadFileParameters {}
@@ -0,0 +1,14 @@
1
+ import { BatchStatus } from "../params/batch-status";
2
+ import { BatchDto } from "./batch-dto";
3
+
4
+ interface BatchListItemDto extends BatchDto {
5
+ status: BatchStatus;
6
+ authorized: boolean;
7
+ translationJobUid: string;
8
+ projectId: string;
9
+ createdDate: Date
10
+ modifiedDate: Date
11
+
12
+ }
13
+
14
+ export { BatchListItemDto };
@@ -8,6 +8,9 @@ import { BatchStatusDto } from "./dto/batch-status-dto";
8
8
  import { BatchDto } from "./dto/batch-dto";
9
9
  import { CancelBatchFileParameters } from "./params/cancel-batch-file-parameters";
10
10
  import { RegisterBatchFileParameters } from "./params/register-batch-file-parameters";
11
+ import { BatchListItemDto } from "./dto/batch-list-item-dto";
12
+ import { SmartlingListResponse } from "../http/smartling-list-response";
13
+ import { ListBatchesParameters } from "./params/list-batches-parameters";
11
14
 
12
15
  export class SmartlingJobBatchesApi extends SmartlingBaseApi {
13
16
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger) {
@@ -82,4 +85,14 @@ export class SmartlingJobBatchesApi extends SmartlingBaseApi {
82
85
  `${this.entrypoint}/${projectId}/batches/${batchUid}`
83
86
  );
84
87
  }
88
+
89
+ async listBatches(projectId: string, params: ListBatchesParameters
90
+ ): Promise<SmartlingListResponse<BatchListItemDto>> {
91
+ return await this.makeRequest(
92
+ "get",
93
+ `${this.entrypoint}/${projectId}/batches`,
94
+ params.export()
95
+
96
+ );
97
+ }
85
98
  }
@@ -0,0 +1,41 @@
1
+ import { BaseParameters } from "../../parameters/index";
2
+ import { Order } from "../../parameters/order";
3
+ import { BatchStatus } from "./batch-status";
4
+
5
+ export class ListBatchesParameters extends BaseParameters {
6
+ setTranslationJobUid(uid: string): ListBatchesParameters {
7
+ this.set("translationJobUid", uid);
8
+
9
+ return this;
10
+ }
11
+
12
+ setLimit(limit: number): ListBatchesParameters {
13
+ if (limit > 0) {
14
+ this.set("limit", limit);
15
+ }
16
+
17
+ return this;
18
+ }
19
+
20
+ setOffset(offset: number): ListBatchesParameters {
21
+ if (offset >= 0) {
22
+ this.set("offset", offset);
23
+ }
24
+
25
+ return this;
26
+ }
27
+
28
+ setStatus(status: BatchStatus): ListBatchesParameters {
29
+ this.set("status", status);
30
+
31
+ return this;
32
+ }
33
+
34
+ setSort(field: "createdDate" | "status", order: Order): ListBatchesParameters {
35
+ this.set("sortBy", field);
36
+ this.set("sortDirection", order.toLowerCase());
37
+
38
+ return this;
39
+ }
40
+ }
41
+
package/api/jobs/index.ts CHANGED
@@ -20,6 +20,7 @@ import { CloseJobParameters } from "./params/close-job-parameters";
20
20
  import { SearchJobsParameters } from "./params/search-jobs-parameters";
21
21
  import { FullSourceFileDto } from "./dto/full-source-file-dto";
22
22
  import { AddedFileDto } from "./dto/added-file-dto";
23
+ import { AuthorizeJobParameters } from "./params/authorize-job-parameters";
23
24
 
24
25
  export class SmartlingJobsApi extends SmartlingBaseApi {
25
26
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger) {
@@ -43,6 +44,15 @@ export class SmartlingJobsApi extends SmartlingBaseApi {
43
44
  );
44
45
  }
45
46
 
47
+ async authorizeJob(projectId: string, translationJobUid: string, params: AuthorizeJobParameters
48
+ ): Promise<Record<string, unknown>> {
49
+ return await this.makeRequest(
50
+ "post",
51
+ `${this.entrypoint}/${projectId}/jobs/${translationJobUid}/authorize`,
52
+ JSON.stringify(params.export())
53
+ );
54
+ }
55
+
46
56
  async getJobFiles(
47
57
  projectId: string, translationJobUid: string, params: ListJobFilesParameters
48
58
  ): Promise<SmartlingListResponse<FullSourceFileDto>> {
@@ -0,0 +1,21 @@
1
+ import { BaseParameters } from "../../parameters/index";
2
+
3
+ export class AuthorizeJobParameters extends BaseParameters {
4
+ constructor(parameters: Record<string, unknown> = {}) {
5
+ super(parameters);
6
+
7
+ // if no localeWorkflows are set, the request's body should be empty
8
+ // https://api-reference.smartling.com/#tag/Jobs/operation/authorizeJob
9
+ }
10
+
11
+ addLocaleWorkflows(targetLocaleId: string, workflowUid: string): AuthorizeJobParameters {
12
+ const { localeWorkflows } = this.parameters;
13
+ const newLocaleWorkflow = { targetLocaleId, workflowUid };
14
+
15
+ this.set("localeWorkflows",
16
+ localeWorkflows?.concat(newLocaleWorkflow) || [newLocaleWorkflow]
17
+ );
18
+
19
+ return this;
20
+ }
21
+ }
@@ -31,4 +31,16 @@ export class CreateJobParameters extends BaseParameters {
31
31
 
32
32
  return this;
33
33
  }
34
+
35
+ setTargetLocaleIds(targetLocaleIds: string[]): CreateJobParameters {
36
+ this.set("targetLocaleIds", targetLocaleIds);
37
+
38
+ return this;
39
+ }
40
+
41
+ setCallbackUrl(callbackUrl: string): CreateJobParameters {
42
+ this.set("callbackUrl", callbackUrl);
43
+
44
+ return this;
45
+ }
34
46
  }
@@ -0,0 +1,9 @@
1
+ import { FileType } from "../params/file-type";
2
+ interface FileStatusForProjectDto {
3
+ created: Date;
4
+ fileType: FileType;
5
+ fileUri: string;
6
+ hasInstructions: boolean;
7
+ lastUploaded: string;
8
+ }
9
+ export { FileStatusForProjectDto };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=file-status-for-project-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-status-for-project-dto.js","sourceRoot":"","sources":["../../../../api/files/dto/file-status-for-project-dto.ts"],"names":[],"mappings":""}
@@ -8,12 +8,16 @@ import { FileStatusForAllLocalesDto } from "./dto/file-status-for-all-locales-dt
8
8
  import { SmartlingListResponse } from "../http/smartling-list-response";
9
9
  import { LastModifiedForLocale } from "./dto/last-modified-for-locale-dto";
10
10
  import { UploadedFileDto } from "./dto/uploaded-file-dto";
11
+ import { FileStatusForProjectDto } from "./dto/file-status-for-project-dto";
12
+ import { DownloadFileAllTranslationsParameters } from "./params/download-file-all-translations-parameters";
11
13
  export declare class SmartlingFilesApi extends SmartlingBaseApi {
12
14
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger);
13
15
  getStatusForAllLocales(projectId: string, fileUri: string): Promise<FileStatusForAllLocalesDto>;
14
16
  getLastModified(projectId: string, fileUri: string): Promise<SmartlingListResponse<LastModifiedForLocale>>;
15
17
  downloadFile(projectId: string, fileUri: string, locale: string, params: DownloadFileParameters): Promise<string>;
18
+ downloadFileAllTranslations(projectId: string, fileUri: string, params: DownloadFileAllTranslationsParameters): Promise<string>;
16
19
  deleteFile(projectId: string, fileUri: string): Promise<boolean>;
17
20
  uploadFile(projectId: string, parameters: UploadFileParameters): Promise<UploadedFileDto>;
21
+ getRecentlyUploadedFiles(projectId: string): Promise<SmartlingListResponse<FileStatusForProjectDto>>;
18
22
  static fixContentTypeHeaderCase(form: FormData): Record<string, unknown>;
19
23
  }
@@ -36,6 +36,11 @@ class SmartlingFilesApi extends index_1.SmartlingBaseApi {
36
36
  return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/locales/${locale}/file`, Object.assign(params.export(), { fileUri }), true);
37
37
  });
38
38
  }
39
+ downloadFileAllTranslations(projectId, fileUri, params) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/locales/all/file/zip`, Object.assign(params.export(), { fileUri }), true);
42
+ });
43
+ }
39
44
  deleteFile(projectId, fileUri) {
40
45
  return __awaiter(this, void 0, void 0, function* () {
41
46
  const form = new form_data_1.default();
@@ -53,6 +58,11 @@ class SmartlingFilesApi extends index_1.SmartlingBaseApi {
53
58
  return yield this.makeRequest("post", `${this.entrypoint}/${projectId}/file`, formData, false, SmartlingFilesApi.fixContentTypeHeaderCase(formData));
54
59
  });
55
60
  }
61
+ getRecentlyUploadedFiles(projectId) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/files/list`);
64
+ });
65
+ }
56
66
  static fixContentTypeHeaderCase(form) {
57
67
  const headers = form.getHeaders();
58
68
  headers["Content-Type"] = headers["content-type"];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AACjC,yCAAiD;AAUjD,MAAa,iBAAkB,SAAQ,wBAAgB;IACnD,YAAY,mBAA2B,EAAE,OAAyB,EAAE,MAAc;QAC9E,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG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CAAC,CAAC,GAAG,EAAE,EAAE;gBAClC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;YAEH,OAAO,MAAM,IAAI,CAAC,WAAW,CACzB,MAAM,EACN,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,OAAO,EACtC,QAAQ,EACR,KAAK,EACL,iBAAiB,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CACvD,CAAC;QACN,CAAC;KAAA;IAEK,wBAAwB,CAC1B,SAAiB;;YAEjB,OAAO,MAAM,IAAI,CAAC,WAAW,CACzB,KAAK,EACL,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,aAAa,CAC/C,CAAC;QACN,CAAC;KAAA;IAED,MAAM,CAAC,wBAAwB,CAAC,IAAc;QAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAElC,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QAElD,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;QAC/B,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AApGD,8CAoGC"}
@@ -0,0 +1,3 @@
1
+ import { DownloadFileParameters } from "./download-file-parameters";
2
+ export declare class DownloadFileAllTranslationsParameters extends DownloadFileParameters {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DownloadFileAllTranslationsParameters = void 0;
4
+ const download_file_parameters_1 = require("./download-file-parameters");
5
+ class DownloadFileAllTranslationsParameters extends download_file_parameters_1.DownloadFileParameters {
6
+ }
7
+ exports.DownloadFileAllTranslationsParameters = DownloadFileAllTranslationsParameters;
8
+ //# sourceMappingURL=download-file-all-translations-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-file-all-translations-parameters.js","sourceRoot":"","sources":["../../../../api/files/params/download-file-all-translations-parameters.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,qCAAsC,SAAQ,iDAAsB;CAAG;AAApF,sFAAoF"}
@@ -0,0 +1,11 @@
1
+ import { BatchStatus } from "../params/batch-status";
2
+ import { BatchDto } from "./batch-dto";
3
+ interface BatchListItemDto extends BatchDto {
4
+ status: BatchStatus;
5
+ authorized: boolean;
6
+ translationJobUid: string;
7
+ projectId: string;
8
+ createdDate: Date;
9
+ modifiedDate: Date;
10
+ }
11
+ export { BatchListItemDto };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=batch-list-item-dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-list-item-dto.js","sourceRoot":"","sources":["../../../../api/job-batches/dto/batch-list-item-dto.ts"],"names":[],"mappings":""}
@@ -7,6 +7,9 @@ import { BatchStatusDto } from "./dto/batch-status-dto";
7
7
  import { BatchDto } from "./dto/batch-dto";
8
8
  import { CancelBatchFileParameters } from "./params/cancel-batch-file-parameters";
9
9
  import { RegisterBatchFileParameters } from "./params/register-batch-file-parameters";
10
+ import { BatchListItemDto } from "./dto/batch-list-item-dto";
11
+ import { SmartlingListResponse } from "../http/smartling-list-response";
12
+ import { ListBatchesParameters } from "./params/list-batches-parameters";
10
13
  export declare class SmartlingJobBatchesApi extends SmartlingBaseApi {
11
14
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger);
12
15
  alterRequestData(uri: string, opts: Record<string, unknown>): Record<string, unknown>;
@@ -15,4 +18,5 @@ export declare class SmartlingJobBatchesApi extends SmartlingBaseApi {
15
18
  cancelBatchFile(projectId: string, batchUid: string, params: CancelBatchFileParameters): Promise<BatchDto>;
16
19
  uploadBatchFile(projectId: string, batchUid: string, params: UploadBatchFileParameters): Promise<boolean>;
17
20
  getBatchStatus(projectId: string, batchUid: string): Promise<BatchStatusDto>;
21
+ listBatches(projectId: string, params: ListBatchesParameters): Promise<SmartlingListResponse<BatchListItemDto>>;
18
22
  }
@@ -64,6 +64,11 @@ class SmartlingJobBatchesApi extends index_1.SmartlingBaseApi {
64
64
  return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/batches/${batchUid}`);
65
65
  });
66
66
  }
67
+ listBatches(projectId, params) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/batches`, params.export());
70
+ });
71
+ }
67
72
  }
68
73
  exports.SmartlingJobBatchesApi = SmartlingJobBatchesApi;
69
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/job-batches/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AACjC,yCAAiD;AAUjD,MAAa,sBAAuB,SAAQ,wBAAgB;IACxD,YAAY,mBAA2B,EAAE,OAAyB,EAAE,MAAc;QAC9E,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,mBAAmB,8BAA8B,CAAC;IAC3E,CAAC;IAGD,gBAAgB,CAAC,GAAW,EAAE,IAA6B;QACvD,IAAI,GAAG,CAAC,KAAK,CAAC,wDAAwD,CAAC,EAAE;YACrE,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAEhC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;oBAC/B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;wBAC7B,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;oBACvC,CAAC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,KAAK,EACL,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,YAAY,QAAQ,EAAE,CACxD,CAAC;QACN,CAAC;KAAA;IAEK,WAAW,CAAC,SAAiB,EAAE,MAA6B;;YAE9D,OAAO,MAAM,IAAI,CAAC,WAAW,CACzB,KAAK,EACL,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,UAAU,EACzC,MAAM,CAAC,MAAM,EAAE,CAElB,CAAC;QACN,CAAC;KAAA;CACJ;AAnFD,wDAmFC"}
@@ -0,0 +1,10 @@
1
+ import { BaseParameters } from "../../parameters/index";
2
+ import { Order } from "../../parameters/order";
3
+ import { BatchStatus } from "./batch-status";
4
+ export declare class ListBatchesParameters extends BaseParameters {
5
+ setTranslationJobUid(uid: string): ListBatchesParameters;
6
+ setLimit(limit: number): ListBatchesParameters;
7
+ setOffset(offset: number): ListBatchesParameters;
8
+ setStatus(status: BatchStatus): ListBatchesParameters;
9
+ setSort(field: "createdDate" | "status", order: Order): ListBatchesParameters;
10
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListBatchesParameters = void 0;
4
+ const index_1 = require("../../parameters/index");
5
+ class ListBatchesParameters extends index_1.BaseParameters {
6
+ setTranslationJobUid(uid) {
7
+ this.set("translationJobUid", uid);
8
+ return this;
9
+ }
10
+ setLimit(limit) {
11
+ if (limit > 0) {
12
+ this.set("limit", limit);
13
+ }
14
+ return this;
15
+ }
16
+ setOffset(offset) {
17
+ if (offset >= 0) {
18
+ this.set("offset", offset);
19
+ }
20
+ return this;
21
+ }
22
+ setStatus(status) {
23
+ this.set("status", status);
24
+ return this;
25
+ }
26
+ setSort(field, order) {
27
+ this.set("sortBy", field);
28
+ this.set("sortDirection", order.toLowerCase());
29
+ return this;
30
+ }
31
+ }
32
+ exports.ListBatchesParameters = ListBatchesParameters;
33
+ //# sourceMappingURL=list-batches-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-batches-parameters.js","sourceRoot":"","sources":["../../../../api/job-batches/params/list-batches-parameters.ts"],"names":[],"mappings":";;;AAAA,kDAAwD;AAIxD,MAAa,qBAAsB,SAAQ,sBAAc;IACrD,oBAAoB,CAAC,GAAW;QAC5B,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,QAAQ,CAAC,KAAa;QAClB,IAAI,KAAK,GAAG,CAAC,EAAE;YACX,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SAC5B;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,IAAI,MAAM,IAAI,CAAC,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SAC9B;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,MAAmB;QACzB,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,KAA+B,EAAE,KAAY;QACjD,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAnCD,sDAmCC"}
@@ -20,10 +20,12 @@ import { CloseJobParameters } from "./params/close-job-parameters";
20
20
  import { SearchJobsParameters } from "./params/search-jobs-parameters";
21
21
  import { FullSourceFileDto } from "./dto/full-source-file-dto";
22
22
  import { AddedFileDto } from "./dto/added-file-dto";
23
+ import { AuthorizeJobParameters } from "./params/authorize-job-parameters";
23
24
  export declare class SmartlingJobsApi extends SmartlingBaseApi {
24
25
  constructor(smartlingApiBaseUrl: string, authApi: SmartlingAuthApi, logger: Logger);
25
26
  createJob(projectId: string, params: CreateJobParameters): Promise<JobDto>;
26
27
  getJob(projectId: string, translationJobUid: string): Promise<JobDetailsDto>;
28
+ authorizeJob(projectId: string, translationJobUid: string, params: AuthorizeJobParameters): Promise<Record<string, unknown>>;
27
29
  getJobFiles(projectId: string, translationJobUid: string, params: ListJobFilesParameters): Promise<SmartlingListResponse<FullSourceFileDto>>;
28
30
  listJobs(projectId: string, params: ListJobsParameters): Promise<SmartlingListResponse<BaseJobDto>>;
29
31
  searchJobs(projectId: string, params: SearchJobsParameters): Promise<SmartlingListResponse<BaseJobDto>>;
@@ -27,6 +27,11 @@ class SmartlingJobsApi extends index_1.SmartlingBaseApi {
27
27
  return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/jobs/${translationJobUid}`);
28
28
  });
29
29
  }
30
+ authorizeJob(projectId, translationJobUid, params) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return yield this.makeRequest("post", `${this.entrypoint}/${projectId}/jobs/${translationJobUid}/authorize`, JSON.stringify(params.export()));
33
+ });
34
+ }
30
35
  getJobFiles(projectId, translationJobUid, params) {
31
36
  return __awaiter(this, void 0, void 0, function* () {
32
37
  return yield this.makeRequest("get", `${this.entrypoint}/${projectId}/jobs/${translationJobUid}/files`, params.export());
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAiD;AAuBjD,MAAa,gBAAiB,SAAQ,wBAAgB;IAClD,YAAY,mBAA2B,EAAE,OAAyB,EAAE,MAAc;QAC9E,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,mBAAmB,uBAAuB,CAAC;IACpE,CAAC;IAEK,SAAS,CAAC,SAAiB,EAAE,MAA2B;;YAC1D,OAAO,MAAM,IAAI,CAAC,WAAW,CACzB,MAAM,EACN,GA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,CAAC,MAAM,EAAE,CAClB,CAAC;QACN,CAAC;KAAA;IAEK,kBAAkB,CACpB,SAAiB,EAAE,iBAAyB,EAAE,MAA8B;;YAE5E,OAAO,MAAM,IAAI,CAAC,WAAW,CACzB,KAAK,EACL,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,SAAS,iBAAiB,gBAAgB,EACzE,MAAM,CAAC,MAAM,EAAE,CAClB,CAAC;QACN,CAAC;KAAA;IAEK,SAAS,CACX,SAAiB,EAAE,iBAAyB,EAAE,MAA2B;;YAEzE,MAAM,IAAI,CAAC,WAAW,CAClB,MAAM,EACN,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,SAAS,iBAAiB,SAAS,EAClE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAClC,CAAC;QACN,CAAC;KAAA;IAEK,QAAQ,CACV,SAAiB,EAAE,iBAAyB,EAAE,MAA0B;;YAExE,MAAM,IAAI,CAAC,WAAW,CAClB,MAAM,EACN,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,SAAS,iBAAiB,QAAQ,EACjE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAClC,CAAC;QACN,CAAC;KAAA;IAEK,SAAS,CACX,SAAiB,EAAE,iBAAyB;;YAE5C,MAAM,IAAI,CAAC,WAAW,CAClB,QAAQ,EACR,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,SAAS,iBAAiB,EAAE,CAC9D,CAAC;QACN,CAAC;KAAA;CACJ;AAlID,4CAkIC"}
@@ -0,0 +1,5 @@
1
+ import { BaseParameters } from "../../parameters/index";
2
+ export declare class AuthorizeJobParameters extends BaseParameters {
3
+ constructor(parameters?: Record<string, unknown>);
4
+ addLocaleWorkflows(targetLocaleId: string, workflowUid: string): AuthorizeJobParameters;
5
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthorizeJobParameters = void 0;
4
+ const index_1 = require("../../parameters/index");
5
+ class AuthorizeJobParameters extends index_1.BaseParameters {
6
+ constructor(parameters = {}) {
7
+ super(parameters);
8
+ }
9
+ addLocaleWorkflows(targetLocaleId, workflowUid) {
10
+ const { localeWorkflows } = this.parameters;
11
+ const newLocaleWorkflow = { targetLocaleId, workflowUid };
12
+ this.set("localeWorkflows", (localeWorkflows === null || localeWorkflows === void 0 ? void 0 : localeWorkflows.concat(newLocaleWorkflow)) || [newLocaleWorkflow]);
13
+ return this;
14
+ }
15
+ }
16
+ exports.AuthorizeJobParameters = AuthorizeJobParameters;
17
+ //# sourceMappingURL=authorize-job-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorize-job-parameters.js","sourceRoot":"","sources":["../../../../api/jobs/params/authorize-job-parameters.ts"],"names":[],"mappings":";;;AAAA,kDAAwD;AAExD,MAAa,sBAAuB,SAAQ,sBAAc;IACtD,YAAY,aAAsC,EAAE;QAChD,KAAK,CAAC,UAAU,CAAC,CAAC;IAItB,CAAC;IAED,kBAAkB,CAAC,cAAsB,EAAE,WAAmB;QAC1D,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAC5C,MAAM,iBAAiB,GAAG,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC;QAE1D,IAAI,CAAC,GAAG,CAAC,iBAAiB,EACtB,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAC,iBAAiB,CAAC,KAAI,CAAC,iBAAiB,CAAC,CACpE,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAlBD,wDAkBC"}
@@ -3,4 +3,6 @@ export declare class CreateJobParameters extends BaseParameters {
3
3
  setName(jobName: string): CreateJobParameters;
4
4
  setDescription(description: string): CreateJobParameters;
5
5
  setDueDate(dueDate: Date): CreateJobParameters;
6
+ setTargetLocaleIds(targetLocaleIds: string[]): CreateJobParameters;
7
+ setCallbackUrl(callbackUrl: string): CreateJobParameters;
6
8
  }
@@ -25,6 +25,14 @@ class CreateJobParameters extends index_1.BaseParameters {
25
25
  this.set("dueDate", dueDate.toISOString());
26
26
  return this;
27
27
  }
28
+ setTargetLocaleIds(targetLocaleIds) {
29
+ this.set("targetLocaleIds", targetLocaleIds);
30
+ return this;
31
+ }
32
+ setCallbackUrl(callbackUrl) {
33
+ this.set("callbackUrl", callbackUrl);
34
+ return this;
35
+ }
28
36
  }
29
37
  exports.CreateJobParameters = CreateJobParameters;
30
38
  //# sourceMappingURL=create-job-parameters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-job-parameters.js","sourceRoot":"","sources":["../../../../api/jobs/params/create-job-parameters.ts"],"names":[],"mappings":";;;AAAA,kDAAwD;AACxD,iDAA2D;AAE3D,MAAa,mBAAoB,SAAQ,sBAAc;IACnD,OAAO,CAAC,OAAe;QACnB,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,EAAE;YACvB,MAAM,IAAI,0BAAkB,CAAC,8CAA8C,CAAC,CAAC;SAChF;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,WAAW,CAAC,MAAM,IAAI,IAAI,EAAE;YAC5B,MAAM,IAAI,0BAAkB,CAAC,sDAAsD,CAAC,CAAC;SACxF;QAED,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAErC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,OAAa;QACpB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5C,MAAM,IAAI,0BAAkB,CAAC,qCAAqC,CAAC,CAAC;SACvE;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AA9BD,kDA8BC"}
1
+ {"version":3,"file":"create-job-parameters.js","sourceRoot":"","sources":["../../../../api/jobs/params/create-job-parameters.ts"],"names":[],"mappings":";;;AAAA,kDAAwD;AACxD,iDAA2D;AAE3D,MAAa,mBAAoB,SAAQ,sBAAc;IACnD,OAAO,CAAC,OAAe;QACnB,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,EAAE;YACvB,MAAM,IAAI,0BAAkB,CAAC,8CAA8C,CAAC,CAAC;SAChF;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE7B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,WAAW,CAAC,MAAM,IAAI,IAAI,EAAE;YAC5B,MAAM,IAAI,0BAAkB,CAAC,sDAAsD,CAAC,CAAC;SACxF;QAED,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAErC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,OAAa;QACpB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5C,MAAM,IAAI,0BAAkB,CAAC,qCAAqC,CAAC,CAAC;SACvE;QAED,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB,CAAC,eAAyB;QACxC,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAErC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AA1CD,kDA0CC"}
package/built/index.d.ts CHANGED
@@ -30,6 +30,7 @@ export * from "./api/job-batches/dto/batch-dto";
30
30
  export * from "./api/job-batches/dto/batch-item-dto";
31
31
  export * from "./api/job-batches/dto/batch-locale-dto";
32
32
  export * from "./api/job-batches/dto/batch-status-dto";
33
+ export * from "./api/job-batches/dto/batch-list-item-dto";
33
34
  export * from "./api/job-batches/params/create-batch-parameters";
34
35
  export * from "./api/job-batches/params/upload-batch-file-parameters";
35
36
  export * from "./api/job-batches/params/process-batch-action-parameters";
@@ -37,6 +38,7 @@ export * from "./api/job-batches/params/cancel-batch-file-parameters";
37
38
  export * from "./api/job-batches/params/register-batch-file-parameters";
38
39
  export * from "./api/job-batches/params/batch-action";
39
40
  export * from "./api/job-batches/params/batch-status";
41
+ export * from "./api/job-batches/params/list-batches-parameters";
40
42
  export * from "./api/job-batches/params/batch-item-status";
41
43
  export * from "./api/jobs/index";
42
44
  export * from "./api/jobs/dto/base-job-dto";
@@ -73,3 +75,6 @@ export * from "./api/strings/dto/source-string-dto";
73
75
  export * from "./api/strings/dto/source-string-key-dto";
74
76
  export * from "./api/strings/params/fetch-source-strings-parameters";
75
77
  export * from "./api/logger";
78
+ export * from "./api/jobs/params/add-file-parameters";
79
+ export * from "./api/files/params/download-file-all-translations-parameters";
80
+ export * from "./api/jobs/params/authorize-job-parameters";
package/built/index.js CHANGED
@@ -46,6 +46,7 @@ __exportStar(require("./api/job-batches/dto/batch-dto"), exports);
46
46
  __exportStar(require("./api/job-batches/dto/batch-item-dto"), exports);
47
47
  __exportStar(require("./api/job-batches/dto/batch-locale-dto"), exports);
48
48
  __exportStar(require("./api/job-batches/dto/batch-status-dto"), exports);
49
+ __exportStar(require("./api/job-batches/dto/batch-list-item-dto"), exports);
49
50
  __exportStar(require("./api/job-batches/params/create-batch-parameters"), exports);
50
51
  __exportStar(require("./api/job-batches/params/upload-batch-file-parameters"), exports);
51
52
  __exportStar(require("./api/job-batches/params/process-batch-action-parameters"), exports);
@@ -53,6 +54,7 @@ __exportStar(require("./api/job-batches/params/cancel-batch-file-parameters"), e
53
54
  __exportStar(require("./api/job-batches/params/register-batch-file-parameters"), exports);
54
55
  __exportStar(require("./api/job-batches/params/batch-action"), exports);
55
56
  __exportStar(require("./api/job-batches/params/batch-status"), exports);
57
+ __exportStar(require("./api/job-batches/params/list-batches-parameters"), exports);
56
58
  __exportStar(require("./api/job-batches/params/batch-item-status"), exports);
57
59
  __exportStar(require("./api/jobs/index"), exports);
58
60
  __exportStar(require("./api/jobs/dto/base-job-dto"), exports);
@@ -89,4 +91,7 @@ __exportStar(require("./api/strings/dto/source-string-dto"), exports);
89
91
  __exportStar(require("./api/strings/dto/source-string-key-dto"), exports);
90
92
  __exportStar(require("./api/strings/params/fetch-source-strings-parameters"), exports);
91
93
  __exportStar(require("./api/logger"), exports);
94
+ __exportStar(require("./api/jobs/params/add-file-parameters"), exports);
95
+ __exportStar(require("./api/files/params/download-file-all-translations-parameters"), exports);
96
+ __exportStar(require("./api/jobs/params/authorize-job-parameters"), exports);
92
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,kEAAgD;AAChD,mDAAiC;AACjC,sDAAoC;AACpC,sDAAoC;AACpC,wEAAsD;AACtD,6EAA2D;AAC3D,gEAA8C;AAC9C,4EAA0D;AAC1D,uEAAqD;AACrD,0FAAwE;AACxE,oEAAkD;AAClD,iFAA+D;AAC/D,kFAAgE;AAChE,uEAAqD;AACrD,sEAAoD;AACpD,wDAAsC;AACtC,oDAAkC;AAClC,8EAA4D;AAC5D,oEAAkD;AAClD,+DAA6C;AAC7C,4EAA0D;AAC1D,kFAAgE;AAChE,kFAAgE;AAChE,+EAA6D;AAC7D,oEAAkD;AAClD,qEAAmD;AACnD,0DAAwC;AACxC,kEAAgD;AAChD,uEAAqD;AACrD,yEAAuD;AACvD,yEAAuD;AACvD,mFAAiE;AACjE,wFAAsE;AACtE,2FAAyE;AACzE,wFAAsE;AACtE,0FAAwE;AACxE,wEAAsD;AACtD,wEAAsD;AACtD,6EAA2D;AAC3D,mDAAiC;AACjC,8DAA4C;AAC5C,kFAAgE;AAChE,kEAAgD;AAChD,mEAAiD;AACjD,sEAAoD;AACpD,iEAA+C;AAC/C,yDAAuC;AACvC,iEAA+C;AAC/C,mFAAiE;AACjE,uFAAqE;AACrE,kEAAgD;AAChD,mEAAiD;AACjD,yEAAuD;AACvD,kEAAgD;AAChD,0EAAwD;AACxD,6EAA2D;AAC3D,4EAA0D;AAC1D,+DAA6C;AAC7C,8EAA4D;AAC5D,yEAAuD;AACvD,2EAAyD;AACzD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,yDAAuC;AACvC,yDAAuC;AACvC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,sDAAoC;AACpC,sEAAoD;AACpD,0EAAwD;AACxD,uFAAqE;AACrE,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,kEAAgD;AAChD,mDAAiC;AACjC,sDAAoC;AACpC,sDAAoC;AACpC,wEAAsD;AACtD,6EAA2D;AAC3D,gEAA8C;AAC9C,4EAA0D;AAC1D,uEAAqD;AACrD,0FAAwE;AACxE,oEAAkD;AAClD,iFAA+D;AAC/D,kFAAgE;AAChE,uEAAqD;AACrD,sEAAoD;AACpD,wDAAsC;AACtC,oDAAkC;AAClC,8EAA4D;AAC5D,oEAAkD;AAClD,+DAA6C;AAC7C,4EAA0D;AAC1D,kFAAgE;AAChE,kFAAgE;AAChE,+EAA6D;AAC7D,oEAAkD;AAClD,qEAAmD;AACnD,0DAAwC;AACxC,kEAAgD;AAChD,uEAAqD;AACrD,yEAAuD;AACvD,yEAAuD;AACvD,4EAA0D;AAC1D,mFAAiE;AACjE,wFAAsE;AACtE,2FAAyE;AACzE,wFAAsE;AACtE,0FAAwE;AACxE,wEAAsD;AACtD,wEAAsD;AACtD,mFAAiE;AACjE,6EAA2D;AAC3D,mDAAiC;AACjC,8DAA4C;AAC5C,kFAAgE;AAChE,kEAAgD;AAChD,mEAAiD;AACjD,sEAAoD;AACpD,iEAA+C;AAC/C,yDAAuC;AACvC,iEAA+C;AAC/C,mFAAiE;AACjE,uFAAqE;AACrE,kEAAgD;AAChD,mEAAiD;AACjD,yEAAuD;AACvD,kEAAgD;AAChD,0EAAwD;AACxD,6EAA2D;AAC3D,4EAA0D;AAC1D,+DAA6C;AAC7C,8EAA4D;AAC5D,yEAAuD;AACvD,2EAAyD;AACzD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,yDAAuC;AACvC,yDAAuC;AACvC,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,sDAAoC;AACpC,sEAAoD;AACpD,0EAAwD;AACxD,uFAAqE;AACrE,+CAA6B;AAC7B,wEAAsD;AACtD,+FAA6E;AAC7E,6EAA2D"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartling-api-sdk-nodejs",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Package for Smartling API",
5
5
  "main": "built/index.js",
6
6
  "engines": {
package/index.ts CHANGED
@@ -30,6 +30,7 @@ export * from "./api/job-batches/dto/batch-dto";
30
30
  export * from "./api/job-batches/dto/batch-item-dto";
31
31
  export * from "./api/job-batches/dto/batch-locale-dto";
32
32
  export * from "./api/job-batches/dto/batch-status-dto";
33
+ export * from "./api/job-batches/dto/batch-list-item-dto";
33
34
  export * from "./api/job-batches/params/create-batch-parameters";
34
35
  export * from "./api/job-batches/params/upload-batch-file-parameters";
35
36
  export * from "./api/job-batches/params/process-batch-action-parameters";
@@ -37,6 +38,7 @@ export * from "./api/job-batches/params/cancel-batch-file-parameters";
37
38
  export * from "./api/job-batches/params/register-batch-file-parameters";
38
39
  export * from "./api/job-batches/params/batch-action";
39
40
  export * from "./api/job-batches/params/batch-status";
41
+ export * from "./api/job-batches/params/list-batches-parameters";
40
42
  export * from "./api/job-batches/params/batch-item-status";
41
43
  export * from "./api/jobs/index";
42
44
  export * from "./api/jobs/dto/base-job-dto";
@@ -73,3 +75,6 @@ export * from "./api/strings/dto/source-string-dto";
73
75
  export * from "./api/strings/dto/source-string-key-dto";
74
76
  export * from "./api/strings/params/fetch-source-strings-parameters";
75
77
  export * from "./api/logger";
78
+ export * from "./api/jobs/params/add-file-parameters";
79
+ export * from "./api/files/params/download-file-all-translations-parameters";
80
+ export * from "./api/jobs/params/authorize-job-parameters";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartling-api-sdk-nodejs",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Package for Smartling API",
5
5
  "main": "built/index.js",
6
6
  "engines": {
@@ -9,6 +9,7 @@ import { UploadFileParameters } from "../api/files/params/upload-file-parameters
9
9
  import { SmartlingAuthApi } from "../api/auth/index";
10
10
  import { FileType } from "../api/files/params/file-type";
11
11
  import { streamToString } from "./stream-to-string";
12
+ import { DownloadFileAllTranslationsParameters } from "../api/files/params/download-file-all-translations-parameters";
12
13
 
13
14
  describe("SmartlingFilesApi class tests.", () => {
14
15
  const projectId = "testProjectId";
@@ -56,6 +57,24 @@ describe("SmartlingFilesApi class tests.", () => {
56
57
  );
57
58
  });
58
59
 
60
+ it("Get recently uploaded files for project", async () => {
61
+ await filesApi.getRecentlyUploadedFiles(projectId);
62
+
63
+ sinon.assert.calledOnce(filesApiFetchStub);
64
+ sinon.assert.calledWithExactly(
65
+ filesApiFetchStub,
66
+ `https://test.com/files-api/v2/projects/${projectId}/files/list`,
67
+ {
68
+ headers: {
69
+ Authorization: "test_token_type test_access_token",
70
+ "Content-Type": "application/json",
71
+ "User-Agent": "test_user_agent"
72
+ },
73
+ method: "get"
74
+ }
75
+ );
76
+ });
77
+
59
78
  it("Get last modified", async () => {
60
79
  await filesApi.getLastModified(projectId, fileUri);
61
80
 
@@ -165,6 +184,37 @@ describe("SmartlingFilesApi class tests.", () => {
165
184
  });
166
185
  });
167
186
 
187
+ describe("Download file - all translations", () => {
188
+ let params: DownloadFileAllTranslationsParameters;
189
+
190
+ beforeEach(() => {
191
+ params = new DownloadFileAllTranslationsParameters();
192
+ });
193
+
194
+
195
+ it("Supports all parameters of single file download", async () => {
196
+ params
197
+ .setRetrievalType(RetrievalType.PUBLISHED)
198
+ .enableDebugMode();
199
+
200
+ await filesApi.downloadFileAllTranslations(projectId, fileUri, params);
201
+
202
+ sinon.assert.calledOnce(filesApiFetchStub);
203
+ sinon.assert.calledWithExactly(
204
+ filesApiFetchStub,
205
+ `https://test.com/files-api/v2/projects/${projectId}/locales/all/file/zip?retrievalType=published&debugMode=1&fileUri=testFileUri`,
206
+ {
207
+ headers: {
208
+ Authorization: "test_token_type test_access_token",
209
+ "Content-Type": "application/json",
210
+ "User-Agent": "test_user_agent"
211
+ },
212
+ method: "get"
213
+ }
214
+ );
215
+ });
216
+ });
217
+
168
218
  it("Delete file", async () => {
169
219
  await filesApi.deleteFile(projectId, fileUri);
170
220
 
@@ -10,6 +10,9 @@ import { FileType } from "../api/files/params/file-type";
10
10
  import { CancelBatchFileParameters } from "../api/job-batches/params/cancel-batch-file-parameters";
11
11
  import { RegisterBatchFileParameters } from "../api/job-batches/params/register-batch-file-parameters";
12
12
  import { streamToString } from "./stream-to-string";
13
+ import { ListBatchesParameters } from "../api/job-batches/params/list-batches-parameters";
14
+ import { Order } from "../api/parameters/order";
15
+ import { BatchStatus } from "../api/job-batches/params/batch-status";
13
16
 
14
17
  describe("SmartlingJobBatchesAPI class tests.", () => {
15
18
  const projectId = "testProjectId";
@@ -229,5 +232,32 @@ describe("SmartlingJobBatchesAPI class tests.", () => {
229
232
  }
230
233
  );
231
234
  });
235
+
236
+ it("List batches", async () => {
237
+ const params = new ListBatchesParameters();
238
+ const sortByParam = "status";
239
+ params
240
+ .setTranslationJobUid(jobUid)
241
+ .setLimit(100)
242
+ .setOffset(10)
243
+ .setStatus(BatchStatus.COMPLETED)
244
+ .setSort(sortByParam, Order.ASC);
245
+
246
+ await jobBatchesApi.listBatches(projectId, params);
247
+
248
+ sinon.assert.calledOnce(jobBatchesApiFetchStub);
249
+ sinon.assert.calledWithExactly(
250
+ jobBatchesApiFetchStub,
251
+ `https://test.com/job-batches-api/v2/projects/${projectId}/batches?translationJobUid=${jobUid}&limit=100&offset=10&status=${BatchStatus.COMPLETED}&sortBy=${sortByParam}&sortDirection=${(Order.ASC).toLowerCase()}`,
252
+ {
253
+ method: "get",
254
+ headers: {
255
+ Authorization: "test_token_type test_access_token",
256
+ "Content-Type": "application/json",
257
+ "User-Agent": "test_user_agent"
258
+ }
259
+ }
260
+ );
261
+ });
232
262
  });
233
263
  });
package/test/jobs.spec.ts CHANGED
@@ -13,6 +13,7 @@ import { JobProgressParameters } from "../api/jobs/params/job-progress-parameter
13
13
  import { CancelJobParameters } from "../api/jobs/params/cancel-job-parameters";
14
14
  import { CloseJobParameters } from "../api/jobs/params/close-job-parameters";
15
15
  import { AddFileParameters } from "../api/jobs/params/add-file-parameters";
16
+ import { AuthorizeJobParameters } from "../api/jobs/params/authorize-job-parameters";
16
17
 
17
18
  describe("SmartlingJobsAPI class tests.", () => {
18
19
  const projectId = "testProjectId";
@@ -50,7 +51,9 @@ describe("SmartlingJobsAPI class tests.", () => {
50
51
  params
51
52
  .setName("Test job")
52
53
  .setDescription("Test job description")
53
- .setDueDate(new Date("2100-12-31T22:00:00.000Z"));
54
+ .setDueDate(new Date("2100-12-31T22:00:00.000Z"))
55
+ .setTargetLocaleIds(["pt-PT"])
56
+ .setCallbackUrl("testCallbackUrl");
54
57
 
55
58
 
56
59
  await jobApi.createJob(projectId, params);
@@ -60,7 +63,7 @@ describe("SmartlingJobsAPI class tests.", () => {
60
63
  jobServiceApiFetchStub,
61
64
  `https://test.com/jobs-api/v3/projects/${projectId}/jobs`,
62
65
  {
63
- body: "{\"jobName\":\"Test job\",\"description\":\"Test job description\",\"dueDate\":\"2100-12-31T22:00:00.000Z\"}",
66
+ body: "{\"jobName\":\"Test job\",\"description\":\"Test job description\",\"dueDate\":\"2100-12-31T22:00:00.000Z\",\"targetLocaleIds\":[\"pt-PT\"],\"callbackUrl\":\"testCallbackUrl\"}",
64
67
  headers: {
65
68
  Authorization: "test_token_type test_access_token",
66
69
  "Content-Type": "application/json",
@@ -205,6 +208,43 @@ describe("SmartlingJobsAPI class tests.", () => {
205
208
  );
206
209
  });
207
210
 
211
+ it("Authorizes a job", async () => {
212
+ const params = new AuthorizeJobParameters();
213
+ await jobApi.authorizeJob(projectId, jobUid, params);
214
+ sinon.assert.calledOnce(jobServiceApiFetchStub);
215
+ sinon.assert.calledWithExactly(
216
+ jobServiceApiFetchStub,
217
+ `https://test.com/jobs-api/v3/projects/${projectId}/jobs/${jobUid}/authorize`,
218
+ {
219
+ body: "{}",
220
+ headers: {
221
+ Authorization: "test_token_type test_access_token",
222
+ "Content-Type": "application/json",
223
+ "User-Agent": "test_user_agent"
224
+ },
225
+ method: "post"
226
+ }
227
+ );
228
+
229
+ params.addLocaleWorkflows("fr", "wf1");
230
+ params.addLocaleWorkflows("de", "wf2");
231
+ await jobApi.authorizeJob(projectId, jobUid, params);
232
+ sinon.assert.calledTwice(jobServiceApiFetchStub);
233
+ sinon.assert.calledWithExactly(
234
+ jobServiceApiFetchStub,
235
+ `https://test.com/jobs-api/v3/projects/${projectId}/jobs/${jobUid}/authorize`,
236
+ {
237
+ body: "{\"localeWorkflows\":[{\"targetLocaleId\":\"fr\",\"workflowUid\":\"wf1\"},{\"targetLocaleId\":\"de\",\"workflowUid\":\"wf2\"}]}",
238
+ headers: {
239
+ Authorization: "test_token_type test_access_token",
240
+ "Content-Type": "application/json",
241
+ "User-Agent": "test_user_agent"
242
+ },
243
+ method: "post"
244
+ }
245
+ );
246
+ });
247
+
208
248
  it("Remove file from job", async () => {
209
249
  const params = new RemoveFileParameters();
210
250