@stepzen/sdk 0.9.38 → 0.9.42
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/LICENSE +1 -1
- package/lib/commands/authenticate.js +1 -1
- package/lib/commands/deploy.js +1 -1
- package/lib/commands/list.js +1 -1
- package/lib/commands/upload.js +1 -1
- package/lib/index.js +1 -1
- package/lib/shared/constants.js +1 -1
- package/lib/shared/payloads.js +4 -3
- package/lib/shared/request.js +1 -1
- package/lib/shared/transpiling.js +6 -5
- package/lib/shared/types.js +1 -1
- package/lib/shared/validation.js +1 -1
- package/package.json +6 -6
package/LICENSE
CHANGED
package/lib/commands/deploy.js
CHANGED
package/lib/commands/list.js
CHANGED
package/lib/commands/upload.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright (c) 2020,2021, StepZen, Inc.
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const authenticate_1 = require("./commands/authenticate");
|
|
5
5
|
const deploy_1 = require("./commands/deploy");
|
package/lib/shared/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright (c) 2020,2021, StepZen, Inc.
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ADMIN_VERIFY_URL = exports.ADMIN_UPLOAD_URL = exports.ADMIN_LIST_URL = exports.ADMIN_DEPLOY_URL = void 0;
|
|
5
5
|
exports.ADMIN_DEPLOY_URL = "/cli/admin/deploy";
|
package/lib/shared/payloads.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright (c) 2020,2021, StepZen, Inc.
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.generateZipPayload = exports.generateYamlPayload = void 0;
|
|
5
5
|
// This file contains helpers that zip a file or directory
|
|
@@ -9,6 +9,7 @@ const FormData = require("form-data");
|
|
|
9
9
|
const fs = require("fs");
|
|
10
10
|
const glob = require("glob");
|
|
11
11
|
const os = require("os");
|
|
12
|
+
const path = require("path");
|
|
12
13
|
// This function takes a (yaml) file path
|
|
13
14
|
// and creates a FormData payload, containing the yaml content as 'yaml'
|
|
14
15
|
const generateYamlPayload = async (file) => {
|
|
@@ -41,7 +42,7 @@ const generateZipPayload = async (directory, data, filters) => {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
// Store it in /tmp. Create a WriteStream
|
|
44
|
-
const filepath =
|
|
45
|
+
const filepath = path.join(os.tmpdir(), `stepzen-payload-${Date.now()}.zip`);
|
|
45
46
|
const output = fs.createWriteStream(filepath);
|
|
46
47
|
// We're making a zip file
|
|
47
48
|
const archive = archiver("zip", {
|
|
@@ -64,7 +65,7 @@ const generateZipPayload = async (directory, data, filters) => {
|
|
|
64
65
|
const include = filters.some((filter) => file.match(filter));
|
|
65
66
|
if (include) {
|
|
66
67
|
debug("stepzen:archive")(file);
|
|
67
|
-
archive.file(
|
|
68
|
+
archive.file(path.join(directory, file), { name: file });
|
|
68
69
|
}
|
|
69
70
|
});
|
|
70
71
|
}
|
package/lib/shared/request.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright (c) 2020,2021, StepZen, Inc.
|
|
2
|
+
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.transpileConfigurationset = void 0;
|
|
5
5
|
const dotenv = require("dotenv");
|
|
@@ -13,14 +13,15 @@ const transpileConfigurationset = async (file) => {
|
|
|
13
13
|
}
|
|
14
14
|
const source = file.substring(0, file.lastIndexOf("/"));
|
|
15
15
|
dotenv.config({ path: path.resolve(source, ".env") });
|
|
16
|
-
const tmp =
|
|
16
|
+
const tmp = path.join(os.tmpdir(), `stepzen-transpiler-${Date.now()}`);
|
|
17
|
+
const configPath = path.join(tmp, 'config.yaml');
|
|
17
18
|
fs.ensureDirSync(tmp);
|
|
18
|
-
fs.copyFileSync(file,
|
|
19
|
+
fs.copyFileSync(file, configPath);
|
|
19
20
|
const result = await transpile(tmp);
|
|
20
21
|
if (result.transpiled) {
|
|
21
22
|
fs.emptyDirSync(tmp);
|
|
22
|
-
fs.writeFileSync(
|
|
23
|
-
return
|
|
23
|
+
fs.writeFileSync(configPath, result.config);
|
|
24
|
+
return configPath;
|
|
24
25
|
}
|
|
25
26
|
fs.removeSync(tmp);
|
|
26
27
|
return;
|
package/lib/shared/types.js
CHANGED
package/lib/shared/validation.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stepzen/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.42",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
6
6
|
"homepage": "https://stepzen.com",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"test": "tsc -b && nyc --extension .ts mocha --config test/mocha.opts.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@stepzen/transpiler": "0.0.
|
|
21
|
+
"@stepzen/transpiler": "0.0.33",
|
|
22
22
|
"archiver": "^5.3.0",
|
|
23
|
-
"debug": "^4.3.
|
|
23
|
+
"debug": "^4.3.3",
|
|
24
24
|
"form-data": "^4.0.0",
|
|
25
25
|
"fs-extra": "^10.0.0",
|
|
26
|
-
"glob": "^7.
|
|
27
|
-
"node-fetch": "^2.6.
|
|
28
|
-
"tslib": "^2.
|
|
26
|
+
"glob": "^7.2.0",
|
|
27
|
+
"node-fetch": "^2.6.6",
|
|
28
|
+
"tslib": "^2.3.1",
|
|
29
29
|
"yaml": "^1.10.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|