smartling-api-sdk-nodejs 2.11.0 → 2.12.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/file-translations/params/fts-upload-file-parameters.ts +13 -0
- package/built/api/file-translations/params/fts-upload-file-parameters.d.ts +1 -0
- package/built/api/file-translations/params/fts-upload-file-parameters.js +10 -0
- package/built/api/file-translations/params/fts-upload-file-parameters.js.map +1 -1
- package/built/package.json +1 -1
- package/package.json +1 -1
- package/test/file-translations.spec.ts +4 -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=
|
|
6
|
-
ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=
|
|
5
|
+
ceTaskId=AZHGsopjeTFUeF_dKNj1
|
|
6
|
+
ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AZHGsopjeTFUeF_dKNj1
|
|
@@ -26,4 +26,17 @@ export class FtsUploadFileParameters extends BaseParameters {
|
|
|
26
26
|
this.parameters.request.fileType = fileType.toUpperCase();
|
|
27
27
|
return this;
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
addDirective(instruction: string, value: string): FtsUploadFileParameters {
|
|
31
|
+
if (!this.parameters.request.parseConfigItems) {
|
|
32
|
+
this.parameters.request.parseConfigItems = [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
this.parameters.request.parseConfigItems = this.parameters.request.parseConfigItems.concat({
|
|
36
|
+
instruction,
|
|
37
|
+
value
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
29
42
|
}
|
|
@@ -5,4 +5,5 @@ export declare class FtsUploadFileParameters extends BaseParameters {
|
|
|
5
5
|
setFileFromLocalFilePath(filePath: string): FtsUploadFileParameters;
|
|
6
6
|
setFileContent(fileContent: string): FtsUploadFileParameters;
|
|
7
7
|
setFileType(fileType: FileType): FtsUploadFileParameters;
|
|
8
|
+
addDirective(instruction: string, value: string): FtsUploadFileParameters;
|
|
8
9
|
}
|
|
@@ -47,6 +47,16 @@ class FtsUploadFileParameters extends parameters_1.BaseParameters {
|
|
|
47
47
|
this.parameters.request.fileType = fileType.toUpperCase();
|
|
48
48
|
return this;
|
|
49
49
|
}
|
|
50
|
+
addDirective(instruction, value) {
|
|
51
|
+
if (!this.parameters.request.parseConfigItems) {
|
|
52
|
+
this.parameters.request.parseConfigItems = [];
|
|
53
|
+
}
|
|
54
|
+
this.parameters.request.parseConfigItems = this.parameters.request.parseConfigItems.concat({
|
|
55
|
+
instruction,
|
|
56
|
+
value
|
|
57
|
+
});
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
50
60
|
}
|
|
51
61
|
exports.FtsUploadFileParameters = FtsUploadFileParameters;
|
|
52
62
|
//# sourceMappingURL=fts-upload-file-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fts-upload-file-parameters.js","sourceRoot":"","sources":["../../../../api/file-translations/params/fts-upload-file-parameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,kFAAsD;AACtD,iDAAkD;AAGlD,MAAa,uBAAwB,SAAQ,2BAAc;IACvD,YAAY,aAAsC,EAAE;QAChD,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,wBAAwB,CAAC,QAAgB;QACrC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAChC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAC5B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAA,+BAAiB,EAAC,WAAW,CAAC,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,QAAkB;QAC1B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;
|
|
1
|
+
{"version":3,"file":"fts-upload-file-parameters.js","sourceRoot":"","sources":["../../../../api/file-translations/params/fts-upload-file-parameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,kFAAsD;AACtD,iDAAkD;AAGlD,MAAa,uBAAwB,SAAQ,2BAAc;IACvD,YAAY,aAAsC,EAAE;QAChD,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,wBAAwB,CAAC,QAAgB;QACrC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAChC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAC5B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAA,+BAAiB,EAAC,WAAW,CAAC,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,QAAkB;QAC1B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,YAAY,CAAC,WAAmB,EAAE,KAAa;QAC3C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC3C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,GAAG,EAAE,CAAC;SACjD;QAED,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC;YACvF,WAAW;YACX,KAAK;SACR,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AApCD,0DAoCC"}
|
package/built/package.json
CHANGED
package/package.json
CHANGED
|
@@ -105,7 +105,9 @@ describe("SmartlingFileTranslationsApi class tests.", () => {
|
|
|
105
105
|
|
|
106
106
|
params
|
|
107
107
|
.setFileType(FileType.XML)
|
|
108
|
-
.setFileContent(testFileContent)
|
|
108
|
+
.setFileContent(testFileContent)
|
|
109
|
+
.addDirective("entity_escaping_strategy", "propagade")
|
|
110
|
+
.addDirective("placeholder_format_custom", "test");
|
|
109
111
|
|
|
110
112
|
await fileTranslationsApi.uploadFile(accountUid, params);
|
|
111
113
|
|
|
@@ -141,7 +143,7 @@ describe("SmartlingFileTranslationsApi class tests.", () => {
|
|
|
141
143
|
assert.equal(content, testFileContent);
|
|
142
144
|
|
|
143
145
|
// eslint-disable-next-line no-underscore-dangle
|
|
144
|
-
assert.equal(fileTranslationsApiFetchCall.args[1].body._streams[4], "{\"fileType\":\"XML\"}");
|
|
146
|
+
assert.equal(fileTranslationsApiFetchCall.args[1].body._streams[4], "{\"fileType\":\"XML\",\"parseConfigItems\":[{\"instruction\":\"entity_escaping_strategy\",\"value\":\"propagade\"},{\"instruction\":\"placeholder_format_custom\",\"value\":\"test\"}]}");
|
|
145
147
|
});
|
|
146
148
|
|
|
147
149
|
it("Translate file", async () => {
|