@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020,2021, StepZen, Inc.
3
+ Copyright (c) 2020,2021,2022, StepZen, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -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 debug = require("debug");
5
5
  const node_fetch_1 = require("node-fetch");
@@ -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 debug = require("debug");
5
5
  const node_fetch_1 = require("node-fetch");
@@ -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 debug = require("debug");
5
5
  const node_fetch_1 = require("node-fetch");
@@ -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 debug = require("debug");
5
5
  const node_fetch_1 = require("node-fetch");
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");
@@ -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";
@@ -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 = `${os.tmpdir()}/stepzen-payload-${Date.now()}.zip`;
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(`${directory}/${file}`, { name: file });
68
+ archive.file(path.join(directory, file), { name: file });
68
69
  }
69
70
  });
70
71
  }
@@ -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.getRequestHeaders = void 0;
5
5
  const os = require("os");
@@ -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 = `${os.tmpdir()}/stepzen-transpiler-${Date.now()}`;
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, `${tmp}/config.yaml`);
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(`${tmp}/config.yaml`, result.config);
23
- return `${tmp}/config.yaml`;
23
+ fs.writeFileSync(configPath, result.config);
24
+ return configPath;
24
25
  }
25
26
  fs.removeSync(tmp);
26
27
  return;
@@ -1,3 +1,3 @@
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 });
@@ -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.validateSchema = exports.validateConfigurationset = void 0;
5
5
  const fs = require("fs");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stepzen/sdk",
3
- "version": "0.9.38",
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.24",
21
+ "@stepzen/transpiler": "0.0.33",
22
22
  "archiver": "^5.3.0",
23
- "debug": "^4.3.1",
23
+ "debug": "^4.3.3",
24
24
  "form-data": "^4.0.0",
25
25
  "fs-extra": "^10.0.0",
26
- "glob": "^7.1.6",
27
- "node-fetch": "^2.6.1",
28
- "tslib": "^2.2.0",
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": {