smartling-api-sdk-nodejs 1.2.0 → 1.2.1
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/files/params/upload-file-parameters.ts +3 -3
- package/api/job-batches/params/upload-batch-file-parameters.ts +3 -3
- package/built/api/files/params/upload-file-parameters.d.ts +1 -3
- package/built/api/files/params/upload-file-parameters.js +5 -1
- package/built/api/files/params/upload-file-parameters.js.map +1 -1
- package/built/api/job-batches/params/upload-batch-file-parameters.d.ts +1 -3
- package/built/api/job-batches/params/upload-batch-file-parameters.js +5 -1
- package/built/api/job-batches/params/upload-batch-file-parameters.js.map +1 -1
- package/built/package.json +1 -1
- package/package.json +1 -1
- package/test/files.spec.ts +2 -2
- package/test/job-batches.spec.ts +2 -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=AX4lffP6EoKIQwCSYHIu
|
|
6
|
+
ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AX4lffP6EoKIQwCSYHIu
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
|
-
import
|
|
2
|
+
import string2fileStream from "string-to-file-stream";
|
|
3
3
|
import { BaseParameters } from "../../parameters/index";
|
|
4
4
|
import { FileType } from "./file-type";
|
|
5
5
|
|
|
@@ -29,8 +29,8 @@ export class UploadFileParameters extends BaseParameters {
|
|
|
29
29
|
return this;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
setFileContent(fileContent:
|
|
33
|
-
this.set("file", fileContent);
|
|
32
|
+
setFileContent(fileContent: string): UploadFileParameters {
|
|
33
|
+
this.set("file", string2fileStream(fileContent));
|
|
34
34
|
|
|
35
35
|
return this;
|
|
36
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
|
-
import
|
|
2
|
+
import string2fileStream from "string-to-file-stream";
|
|
3
3
|
import { BaseParameters } from "../../parameters/index";
|
|
4
4
|
import { FileType } from "../../files/params/file-type";
|
|
5
5
|
|
|
@@ -46,8 +46,8 @@ export class UploadBatchFileParameters extends BaseParameters {
|
|
|
46
46
|
return this;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
setFileContent(fileContent:
|
|
50
|
-
this.set("file", fileContent);
|
|
49
|
+
setFileContent(fileContent: string): UploadBatchFileParameters {
|
|
50
|
+
this.set("file", string2fileStream(fileContent));
|
|
51
51
|
|
|
52
52
|
return this;
|
|
53
53
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable } from "stream";
|
|
3
1
|
import { BaseParameters } from "../../parameters/index";
|
|
4
2
|
import { FileType } from "./file-type";
|
|
5
3
|
export declare class UploadFileParameters extends BaseParameters {
|
|
6
4
|
setDirective(key: string, value: string): UploadFileParameters;
|
|
7
5
|
setFile(filePath: string): UploadFileParameters;
|
|
8
6
|
setFileFromLocalFilePath(filePath: string): UploadFileParameters;
|
|
9
|
-
setFileContent(fileContent:
|
|
7
|
+
setFileContent(fileContent: string): UploadFileParameters;
|
|
10
8
|
setFileType(fileType: FileType): UploadFileParameters;
|
|
11
9
|
setFileUri(fileUri: string): UploadFileParameters;
|
|
12
10
|
}
|
|
@@ -18,9 +18,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
21
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
25
|
exports.UploadFileParameters = void 0;
|
|
23
26
|
const fs = __importStar(require("fs"));
|
|
27
|
+
const string_to_file_stream_1 = __importDefault(require("string-to-file-stream"));
|
|
24
28
|
const index_1 = require("../../parameters/index");
|
|
25
29
|
class UploadFileParameters extends index_1.BaseParameters {
|
|
26
30
|
setDirective(key, value) {
|
|
@@ -36,7 +40,7 @@ class UploadFileParameters extends index_1.BaseParameters {
|
|
|
36
40
|
return this;
|
|
37
41
|
}
|
|
38
42
|
setFileContent(fileContent) {
|
|
39
|
-
this.set("file", fileContent);
|
|
43
|
+
this.set("file", (0, string_to_file_stream_1.default)(fileContent));
|
|
40
44
|
return this;
|
|
41
45
|
}
|
|
42
46
|
setFileType(fileType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file-parameters.js","sourceRoot":"","sources":["../../../../api/files/params/upload-file-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload-file-parameters.js","sourceRoot":"","sources":["../../../../api/files/params/upload-file-parameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,kFAAsD;AACtD,kDAAwD;AAGxD,MAAa,oBAAqB,SAAQ,sBAAc;IACpD,YAAY,CAAC,GAAW,EAAE,KAAa;QACnC,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;QAEpC,OAAO,IAAI,CAAC;IAChB,CAAC;IAOD,OAAO,CAAC,QAAgB;QACpB,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,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;QAEjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,QAAkB;QAC1B,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU,CAAC,OAAe;QACtB,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAzCD,oDAyCC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable } from "stream";
|
|
3
1
|
import { BaseParameters } from "../../parameters/index";
|
|
4
2
|
import { FileType } from "../../files/params/file-type";
|
|
5
3
|
export declare class UploadBatchFileParameters extends BaseParameters {
|
|
@@ -8,7 +6,7 @@ export declare class UploadBatchFileParameters extends BaseParameters {
|
|
|
8
6
|
setLocalesToApprove(localesToApprove: Array<string>): UploadBatchFileParameters;
|
|
9
7
|
setFile(filePath: string): UploadBatchFileParameters;
|
|
10
8
|
setFileFromLocalFilePath(filePath: string): UploadBatchFileParameters;
|
|
11
|
-
setFileContent(fileContent:
|
|
9
|
+
setFileContent(fileContent: string): UploadBatchFileParameters;
|
|
12
10
|
setFileUri(fileUri: string): UploadBatchFileParameters;
|
|
13
11
|
setFileType(fileType: FileType): UploadBatchFileParameters;
|
|
14
12
|
setDirective(key: string, value: string): UploadBatchFileParameters;
|
|
@@ -18,9 +18,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
21
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
25
|
exports.UploadBatchFileParameters = void 0;
|
|
23
26
|
const fs = __importStar(require("fs"));
|
|
27
|
+
const string_to_file_stream_1 = __importDefault(require("string-to-file-stream"));
|
|
24
28
|
const index_1 = require("../../parameters/index");
|
|
25
29
|
class UploadBatchFileParameters extends index_1.BaseParameters {
|
|
26
30
|
setClientLibId(clientLibId, version) {
|
|
@@ -47,7 +51,7 @@ class UploadBatchFileParameters extends index_1.BaseParameters {
|
|
|
47
51
|
return this;
|
|
48
52
|
}
|
|
49
53
|
setFileContent(fileContent) {
|
|
50
|
-
this.set("file", fileContent);
|
|
54
|
+
this.set("file", (0, string_to_file_stream_1.default)(fileContent));
|
|
51
55
|
return this;
|
|
52
56
|
}
|
|
53
57
|
setFileUri(fileUri) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-batch-file-parameters.js","sourceRoot":"","sources":["../../../../api/job-batches/params/upload-batch-file-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload-batch-file-parameters.js","sourceRoot":"","sources":["../../../../api/job-batches/params/upload-batch-file-parameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,kFAAsD;AACtD,kDAAwD;AAGxD,MAAa,yBAA0B,SAAQ,sBAAc;IACzD,cAAc,CAAC,WAAmB,EAAE,OAAe;QAC/C,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC;YAC/C,MAAM,EAAE,WAAW;YACnB,OAAO;SACV,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,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 describe("SmartlingFilesApi class tests.", () => {
|
|
|
178
178
|
);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
it("Upload file: as
|
|
181
|
+
it("Upload file: as string", async () => {
|
|
182
182
|
const params = new UploadFileParameters();
|
|
183
183
|
|
|
184
184
|
params
|
|
185
|
-
.setFileContent(fs.
|
|
185
|
+
.setFileContent(fs.readFileSync(
|
|
186
186
|
fs.realpathSync("./test/data/file.xml"),
|
|
187
187
|
"utf8"
|
|
188
188
|
))
|
package/test/job-batches.spec.ts
CHANGED
|
@@ -163,11 +163,11 @@ describe("SmartlingJobBatchesAPI class tests.", () => {
|
|
|
163
163
|
);
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
it("Upload batch file: as
|
|
166
|
+
it("Upload batch file: as string", async () => {
|
|
167
167
|
const params = new UploadBatchFileParameters();
|
|
168
168
|
|
|
169
169
|
params
|
|
170
|
-
.setFileContent(fs.
|
|
170
|
+
.setFileContent(fs.readFileSync(
|
|
171
171
|
fs.realpathSync("./test/data/file.xml"),
|
|
172
172
|
"utf8"
|
|
173
173
|
))
|