stepzen 0.18.0 → 0.19.0-beta.2

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 (50) hide show
  1. package/README.md +13 -3
  2. package/lib/commands/deploy.js +1 -1
  3. package/lib/commands/import.d.ts +21 -0
  4. package/lib/commands/import.js +208 -120
  5. package/lib/commands/init.js +2 -2
  6. package/lib/commands/lint.js +2 -2
  7. package/lib/commands/list.js +1 -1
  8. package/lib/commands/login.js +3 -3
  9. package/lib/commands/logout.js +1 -1
  10. package/lib/commands/start.js +14 -12
  11. package/lib/commands/transpile.js +5 -5
  12. package/lib/commands/upload.js +1 -1
  13. package/lib/commands/validate.js +6 -4
  14. package/lib/commands/whoami.js +3 -3
  15. package/lib/generate/curl2sdl.d.ts +4 -6
  16. package/lib/generate/curl2sdl.js +26 -17
  17. package/lib/generate/graphql2sdl.d.ts +5 -7
  18. package/lib/generate/graphql2sdl.js +21 -8
  19. package/lib/generate/helpers.d.ts +10 -2
  20. package/lib/generate/helpers.js +45 -22
  21. package/lib/generate/index.d.ts +5 -3
  22. package/lib/generate/index.js +6 -6
  23. package/lib/generate/sql2sdl.d.ts +23 -0
  24. package/lib/generate/sql2sdl.js +155 -0
  25. package/lib/hooks/prerun/check-upgrade.js +13 -10
  26. package/lib/hooks/prerun/ensure-config-file.js +3 -3
  27. package/lib/index.js +1 -0
  28. package/lib/shared/actions.js +9 -6
  29. package/lib/shared/configuration.js +20 -14
  30. package/lib/shared/constants.d.ts +4 -0
  31. package/lib/shared/constants.js +18 -4
  32. package/lib/shared/curl-parser.js +3 -2
  33. package/lib/shared/errors.js +2 -1
  34. package/lib/shared/header-params-parser.js +6 -4
  35. package/lib/shared/header.js +2 -1
  36. package/lib/shared/moniker.js +5 -3
  37. package/lib/shared/path-params-parser.d.ts +1 -1
  38. package/lib/shared/path-params-parser.js +5 -3
  39. package/lib/shared/stepzen-sdk.d.ts +1 -1
  40. package/lib/shared/stepzen-sdk.js +1 -1
  41. package/lib/shared/utils.d.ts +1 -0
  42. package/lib/shared/utils.js +22 -8
  43. package/lib/shared/validation.js +4 -2
  44. package/lib/shared/workspace.js +21 -16
  45. package/lib/shared/zen-command.js +7 -7
  46. package/lib/start/console.d.ts +1 -1
  47. package/lib/start/console.js +16 -9
  48. package/lib/start/index.js +1 -0
  49. package/oclif.manifest.json +1 -1
  50. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.maskStepZenKey = exports.validateEndpoint = exports.getStepZenExtensions = exports.workspaceRelative = exports.homeRelative = exports.getDirectory = void 0;
4
+ exports.getFeatureFlag = exports.maskStepZenKey = exports.validateEndpoint = exports.getStepZenExtensions = exports.workspaceRelative = exports.homeRelative = exports.getDirectory = void 0;
5
5
  const errors_1 = require("@oclif/errors");
6
6
  const debug = require("debug");
7
7
  const node_fetch_1 = require("node-fetch");
@@ -10,7 +10,7 @@ const os = require("os");
10
10
  const path = require("path");
11
11
  const prettier = require("prettier");
12
12
  const constants_1 = require("./constants");
13
- exports.getDirectory = (d = process.cwd()) => {
13
+ const getDirectory = (d = process.cwd()) => {
14
14
  let directory = d;
15
15
  // If it starts with `~`, expand this
16
16
  if (directory.startsWith('~')) {
@@ -25,19 +25,21 @@ exports.getDirectory = (d = process.cwd()) => {
25
25
  }
26
26
  return directory;
27
27
  };
28
+ exports.getDirectory = getDirectory;
28
29
  /**
29
30
  * Replace the path prefix with `~` if it is inside the user's home directory.
30
31
  *
31
32
  * @param {*} absPath an absolute file or directory path
32
33
  * @returns {*} the same path that possibly looks more friendly to users
33
34
  */
34
- exports.homeRelative = (absPath) => {
35
+ const homeRelative = (absPath) => {
35
36
  let pretty = absPath;
36
37
  if (absPath.startsWith(os.homedir())) {
37
38
  pretty = '~' + absPath.substring(os.homedir().length);
38
39
  }
39
40
  return pretty;
40
41
  };
42
+ exports.homeRelative = homeRelative;
41
43
  /**
42
44
  * Replace the path prefix with `~` if it is inside the user's home directory.
43
45
  *
@@ -45,24 +47,26 @@ exports.homeRelative = (absPath) => {
45
47
  * @param {*} workspace an absolute file or the workspace root
46
48
  * @returns {*} the same path that possibly looks more friendly to users
47
49
  */
48
- exports.workspaceRelative = (absPath, workspace) => {
50
+ const workspaceRelative = (absPath, workspace) => {
49
51
  let pretty = absPath;
50
52
  if (absPath.startsWith(workspace)) {
51
53
  pretty = '.' + absPath.substring(workspace.length);
52
54
  }
53
55
  return pretty;
54
56
  };
55
- exports.getStepZenExtensions = async () => {
57
+ exports.workspaceRelative = workspaceRelative;
58
+ const getStepZenExtensions = async () => {
56
59
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
57
60
  const url = `https://www.${domain}/directives.graphql`;
58
- const response = await node_fetch_1.default(url);
61
+ const response = await (0, node_fetch_1.default)(url);
59
62
  const schema = await response.text();
60
63
  const formatted = prettier.format(schema, { parser: 'graphql' });
61
64
  debug('stepzen:extensions')(`Fetching StepZen extensions from ${url}`);
62
65
  debug('stepzen:extensions')(`Extensions: ${formatted}`);
63
66
  return formatted;
64
67
  };
65
- exports.validateEndpoint = (endpoint) => {
68
+ exports.getStepZenExtensions = getStepZenExtensions;
69
+ const validateEndpoint = (endpoint) => {
66
70
  const error = 'The endpoint must be of the format [folder]/[name], matching the pattern ^[\\w-]+$';
67
71
  if (endpoint.includes('/') === false)
68
72
  return error;
@@ -75,7 +79,8 @@ exports.validateEndpoint = (endpoint) => {
75
79
  return error;
76
80
  return true;
77
81
  };
78
- exports.maskStepZenKey = (key) => {
82
+ exports.validateEndpoint = validateEndpoint;
83
+ const maskStepZenKey = (key) => {
79
84
  const parts = key.split('::');
80
85
  const thirdPart = parts[2];
81
86
  const firstTwoChars = thirdPart.substring(0, 2);
@@ -85,3 +90,12 @@ exports.maskStepZenKey = (key) => {
85
90
  const masked = `${parts[0]}::${parts[1]}::${maskedThirdPart} `;
86
91
  return masked;
87
92
  };
93
+ exports.maskStepZenKey = maskStepZenKey;
94
+ const getFeatureFlag = (flag) => {
95
+ const value = process.env[flag];
96
+ if (value === undefined) {
97
+ return false;
98
+ }
99
+ return value.toLowerCase() !== 'false';
100
+ };
101
+ exports.getFeatureFlag = getFeatureFlag;
@@ -7,7 +7,7 @@ const fs = require("fs");
7
7
  const glob = require("glob");
8
8
  const yaml = require("yaml");
9
9
  // Validate the Configurationset file
10
- exports.validateConfigurationset = async (file) => {
10
+ const validateConfigurationset = async (file) => {
11
11
  if (!file) {
12
12
  throw new errors_1.CLIError('You must provide a file path');
13
13
  }
@@ -23,8 +23,9 @@ exports.validateConfigurationset = async (file) => {
23
23
  throw new errors_1.CLIError('The file is not valid YAML');
24
24
  }
25
25
  };
26
+ exports.validateConfigurationset = validateConfigurationset;
26
27
  // Validate the Schema directory
27
- exports.validateSchema = async (directory) => {
28
+ const validateSchema = async (directory) => {
28
29
  if (!directory) {
29
30
  throw new errors_1.CLIError('You must provide a directory path');
30
31
  }
@@ -37,3 +38,4 @@ exports.validateSchema = async (directory) => {
37
38
  throw new errors_1.CLIError('Schemas must include an `index.graphql` file');
38
39
  }
39
40
  };
41
+ exports.validateSchema = validateSchema;
@@ -10,17 +10,19 @@ const os = require("os");
10
10
  const path = require("path");
11
11
  const moniker_1 = require("../shared/moniker");
12
12
  const utils_1 = require("./utils");
13
- exports.validateWorkspaceName = (directory, name) => {
13
+ const validateWorkspaceName = (directory, name) => {
14
14
  return !fs.existsSync(path.join(directory, name));
15
15
  };
16
- exports.generateWorkspaceName = (directory) => {
16
+ exports.validateWorkspaceName = validateWorkspaceName;
17
+ const generateWorkspaceName = (directory) => {
17
18
  let name = 'hello-stepzen';
18
- while (!exports.validateWorkspaceName(directory, name)) {
19
- name = `hello-${moniker_1.getRandomDescriptor()}-stepzen`;
19
+ while (!(0, exports.validateWorkspaceName)(directory, name)) {
20
+ name = `hello-${(0, moniker_1.getRandomDescriptor)()}-stepzen`;
20
21
  }
21
22
  return name;
22
23
  };
23
- exports.guessSchemaRoot = (directory) => {
24
+ exports.generateWorkspaceName = generateWorkspaceName;
25
+ const guessSchemaRoot = (directory) => {
24
26
  const existing = [
25
27
  ...glob.sync('*/**/config.yaml', {
26
28
  cwd: directory,
@@ -33,7 +35,8 @@ exports.guessSchemaRoot = (directory) => {
33
35
  ];
34
36
  return existing.length > 0 ? path.dirname(existing[0]) : '';
35
37
  };
36
- exports.getWorkspace = (directory) => {
38
+ exports.guessSchemaRoot = guessSchemaRoot;
39
+ const getWorkspace = (directory) => {
37
40
  let workspaceRoot;
38
41
  const parts = path
39
42
  // Remove trailing slashes and any `..` and `.` segments
@@ -65,7 +68,7 @@ exports.getWorkspace = (directory) => {
65
68
  throw new errors_1.CLIError(`Cannot parse configuration from ${filepath}`);
66
69
  }
67
70
  // Validate the workspace
68
- const error = utils_1.validateEndpoint(config.endpoint);
71
+ const error = (0, utils_1.validateEndpoint)(config.endpoint);
69
72
  if (typeof error === 'string') {
70
73
  throw new errors_1.CLIError(error);
71
74
  }
@@ -80,11 +83,12 @@ exports.getWorkspace = (directory) => {
80
83
  schema: schema,
81
84
  };
82
85
  };
83
- exports.initWorkspace = async (args) => {
86
+ exports.getWorkspace = getWorkspace;
87
+ const initWorkspace = async (args) => {
84
88
  // Get the correct directory
85
- let directory = utils_1.getDirectory(args.directory);
89
+ let directory = (0, utils_1.getDirectory)(args.directory);
86
90
  // Make sure it is not already a workspace
87
- if (exports.getWorkspace(directory)) {
91
+ if ((0, exports.getWorkspace)(directory)) {
88
92
  throw new errors_1.CLIError(`This directory is already a StepZen workspace: ${directory}.` +
89
93
  ' Please select a different directory.');
90
94
  }
@@ -100,27 +104,27 @@ exports.initWorkspace = async (args) => {
100
104
  // Make a suggestion for the workspace name (if running in the HOME
101
105
  // directory)
102
106
  const name = isHomeDir
103
- ? exports.generateWorkspaceName(directory)
107
+ ? (0, exports.generateWorkspaceName)(directory)
104
108
  : path.basename(directory);
105
109
  // See if we think there's a StepZen schema already
106
- const root = isHomeDir ? '' : exports.guessSchemaRoot(directory);
110
+ const root = isHomeDir ? '' : (0, exports.guessSchemaRoot)(directory);
107
111
  // If you've passed an endpoint, validate it, and throw an error
108
112
  // straight away if needed
109
113
  if (args.endpoint) {
110
- const error = utils_1.validateEndpoint(args.endpoint);
114
+ const error = (0, utils_1.validateEndpoint)(args.endpoint);
111
115
  if (typeof error === 'string') {
112
116
  throw new errors_1.CLIError(error);
113
117
  }
114
118
  }
115
119
  // Make a suggestion for the endpoint
116
- const endpoint = args.endpoint || `api/${moniker_1.default()}`;
120
+ const endpoint = args.endpoint || `api/${(0, moniker_1.default)()}`;
117
121
  // What questions will we ask?
118
122
  const questions = [
119
123
  {
120
124
  default: name,
121
125
  message: 'What would you like to call your workspace?',
122
126
  name: 'name',
123
- validate: (name) => exports.validateWorkspaceName(directory, name),
127
+ validate: (name) => (0, exports.validateWorkspaceName)(directory, name),
124
128
  when: isHomeDir && !args.yes,
125
129
  },
126
130
  {
@@ -155,6 +159,7 @@ exports.initWorkspace = async (args) => {
155
159
  const file = path.join(directory, 'stepzen.config.json');
156
160
  fs.writeFileSync(file, JSON.stringify(workspace, null, ' '));
157
161
  // Fetch the newly created workspace
158
- const created = exports.getWorkspace(directory);
162
+ const created = (0, exports.getWorkspace)(directory);
159
163
  return created;
160
164
  };
165
+ exports.initWorkspace = initWorkspace;
@@ -13,7 +13,7 @@ const utils_1 = require("./utils");
13
13
  const workspace_1 = require("./workspace");
14
14
  class ZenCommand extends command_1.Command {
15
15
  async ensureStepZenAccount() {
16
- const configuration = await configuration_1.readConfiguration();
16
+ const configuration = await (0, configuration_1.readConfiguration)();
17
17
  if ('account' in configuration) {
18
18
  return {
19
19
  configuration,
@@ -23,14 +23,14 @@ class ZenCommand extends command_1.Command {
23
23
  }
24
24
  async ensureStepZenWorkspace(options = {}) {
25
25
  let workspace;
26
- const directory = utils_1.getDirectory(options.directory);
27
- const maybeWorkspace = workspace_1.getWorkspace(directory);
26
+ const directory = (0, utils_1.getDirectory)(options.directory);
27
+ const maybeWorkspace = (0, workspace_1.getWorkspace)(directory);
28
28
  if (maybeWorkspace) {
29
29
  workspace = maybeWorkspace;
30
30
  }
31
31
  else {
32
32
  try {
33
- workspace = await workspace_1.initWorkspace({ directory, endpoint: options.endpoint });
33
+ workspace = await (0, workspace_1.initWorkspace)({ directory, endpoint: options.endpoint });
34
34
  }
35
35
  catch (error) {
36
36
  throw new errors_1.CLIError(`Could not create a StepZen workspace in the ${options.directory ? directory : 'current'} directory.\n` + error.message);
@@ -39,7 +39,7 @@ class ZenCommand extends command_1.Command {
39
39
  // Emphasize that the workspace is not the _current_ directory.
40
40
  if (workspace.directory !== process.cwd()) {
41
41
  this.log();
42
- this.log(` ⤴️ Using the StepZen workspace in ${chalk.blue(utils_1.homeRelative(workspace.directory))}`);
42
+ this.log(` ⤴️ Using the StepZen workspace in ${chalk.blue((0, utils_1.homeRelative)(workspace.directory))}`);
43
43
  this.log();
44
44
  }
45
45
  return workspace;
@@ -83,13 +83,13 @@ class ZenCommand extends command_1.Command {
83
83
  },
84
84
  ]);
85
85
  const credentials = await stepzen_sdk_1.default.login(answers.adminkey);
86
- configuration = await configuration_1.writeCredentialsToConfigFile(credentials);
86
+ configuration = await (0, configuration_1.writeCredentialsToConfigFile)(credentials);
87
87
  this.log('You have successfully logged in.');
88
88
  this.log('');
89
89
  }
90
90
  else {
91
91
  const credentials = await stepzen_sdk_1.default.createAnonymousAccount(uuid);
92
- configuration = await configuration_1.writeCredentialsToConfigFile(credentials);
92
+ configuration = await (0, configuration_1.writeCredentialsToConfigFile)(credentials);
93
93
  this.log(`We've created a temporary public account for you.\nAll endpoints` +
94
94
  ` deployed to this account will be automatically deleted after 24` +
95
95
  ` hours. You can log in with your regular StepZen account at any` +
@@ -7,5 +7,5 @@ export declare const changed: ({ file, workspace, }: {
7
7
  export declare const success: ({ workspace, account, port, }: {
8
8
  workspace: Workspace;
9
9
  account: string;
10
- port: number;
10
+ port?: number | undefined;
11
11
  }) => void;
@@ -5,13 +5,15 @@ exports.success = exports.changed = exports.watching = void 0;
5
5
  const chalk = require("chalk");
6
6
  const utils_1 = require("../shared/utils");
7
7
  const constants_1 = require("../shared/constants");
8
- exports.watching = (workspace) => {
9
- console.log(`Watching ${chalk.blue(utils_1.homeRelative(workspace.schema))} for changes...`);
8
+ const watching = (workspace) => {
9
+ console.log(`Watching ${chalk.blue((0, utils_1.homeRelative)(workspace.schema))} for changes...`);
10
10
  };
11
- exports.changed = ({ file, workspace, }) => {
12
- console.log(`File changed: ${chalk.blue(utils_1.workspaceRelative(file, workspace.directory))}`);
11
+ exports.watching = watching;
12
+ const changed = ({ file, workspace, }) => {
13
+ console.log(`File changed: ${chalk.blue((0, utils_1.workspaceRelative)(file, workspace.directory))}`);
13
14
  };
14
- exports.success = ({ workspace, account, port, }) => {
15
+ exports.changed = changed;
16
+ const success = ({ workspace, account, port, }) => {
15
17
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
16
18
  const url = `https://${account}.${domain}/${workspace.endpoint}/__graphql`;
17
19
  console.log();
@@ -28,7 +30,7 @@ exports.success = ({ workspace, account, port, }) => {
28
30
  }
29
31
  console.log(` } \``);
30
32
  console.log(` -Body (@{`);
31
- console.log(` "query" = '${chalk.bgYellow.black('your graphql query')}'`);
33
+ console.log(` "query" = 'query SampleQuery { __schema { queryType { name description } } }'`);
32
34
  console.log(` } | ConvertTo-Json)`);
33
35
  }
34
36
  else {
@@ -39,10 +41,15 @@ exports.success = ({ workspace, account, port, }) => {
39
41
  console.log(` --header "Authorization: Apikey $(stepzen whoami --apikey)" \\`);
40
42
  }
41
43
  console.log(` --header "Content-Type: application/json" \\`);
42
- console.log(` --data '{"query": "${chalk.bgYellow.black('your graphql query')}"}'`);
44
+ console.log(` --data-raw '{`);
45
+ console.log(` "query": "query SampleQuery { __schema { queryType { name description } } }"`);
46
+ console.log(` }'`);
47
+ }
48
+ if (port) {
49
+ console.log();
50
+ console.log(chalk.grey(`or explore it with GraphiQL at http://localhost:${port}/${workspace.endpoint}`));
43
51
  }
44
- console.log();
45
- console.log(chalk.grey(`or explore it with GraphiQL at http://localhost:${port}/${workspace.endpoint}`));
46
52
  console.log();
47
53
  console.log(chalk.grey(`Your API url is ${chalk.green(url)}`));
48
54
  };
55
+ exports.success = success;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.watching = exports.success = exports.changed = exports.deploy = void 0;
4
5
  var deploy_1 = require("./deploy");
5
6
  Object.defineProperty(exports, "deploy", { enumerable: true, get: function () { return deploy_1.default; } });
6
7
  var console_1 = require("./console");
@@ -1 +1 @@
1
- {"version":"0.18.0","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"configurationsets":{"name":"configurationsets","type":"option","description":"Configurationsets to use","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"schema":{"name":"schema","type":"option","description":"Schema to use","required":true},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"destination","description":"destination","required":true}]},"import":{"id":"import","description":"import a schema for an external data source or a API endpoint to your GraphQL API","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"working directory"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","hidden":true,"allowNo":false},"name":{"name":"name","type":"option","description":"Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported schema."},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite any existing schema with the same name. Cannot be used without also providing a --name flag.","hidden":true,"allowNo":false},"prefix":{"name":"prefix","type":"option","description":"[curl, graphql] prefix to add every type in the generated schema."},"header":{"name":"header","type":"option","char":"H","description":"[curl, graphql] specifies a request header to pass\n\nExample:\nstepzen import curl https://example.com/api/customers \\\n\t-H \u001b[1m\"Authorization: apikey SecretAPIKeyValue\"\u001b[22m"},"header-param":{"name":"header-param","type":"option","description":"[curl, graphql] specifies a parameter in a header value. Can be formed by taking a \u001b[1m-H, --header\u001b[22m flag and replacing the variable part of the header value with a \u001b[1m$paramName\u001b[22m placeholder. Repeat this flag once for each header with a parameter.\n\nExample:\nstepzen import curl https://example.com/api/customers \\\n\t-H \"Authorization: apikey SecretAPIKeyValue\" \\\n\t--header-param 'Authorization: apikey \u001b[1m$apikey\u001b[22m'"},"query-name":{"name":"query-name","type":"option","description":"[curl] property name to add to the Query type as a way to access the imported cURL endpoint."},"query-type":{"name":"query-type","type":"option","description":"[curl] name for the type returned by the cURL endpoint in the generated schema. The name specified by \u001b[1m--query-type\u001b[22m is not prefixed by \u001b[1m--prefix\u001b[22m if both flags are present."},"path-params":{"name":"path-params","type":"option","description":"[curl] specifies path parameters in the URL path. Can be formed by taking the original path and replacing the variable segments with \u001b[1m$paramName\u001b[22m placeholders.\n\nExample:\nstepzen import curl https://example.com/users/jane/posts/12 --path-params '/users/\u001b[1m$userId\u001b[22m/posts/\u001b[1m$postId\u001b[22m'"},"db-host":{"name":"db-host","type":"option","description":"[mysql, postgresql] database host"},"db-user":{"name":"db-user","type":"option","description":"[mysql, postgresql] database user name"},"db-password":{"name":"db-password","type":"option","description":"[mysql, postgresql] database password"},"db-database":{"name":"db-database","type":"option","description":"[mysql, postgresql] name of database to import"},"db-link-types":{"name":"db-link-types","type":"boolean","description":"[mysql, postgresql] Automatically link types with @materializer whenever there is database support \u001b[2m(https://stepzen.com/docs/features/linking-types)\u001b[22m","allowNo":false},"db-schema":{"name":"db-schema","type":"option","description":"[postgresql] database schema"}},"args":[{"name":"schema","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"yes":{"name":"yes","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"directory","hidden":true}]},"lint":{"id":"lint","description":"StepZen lint","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"list":{"id":"list","description":"list your items","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationsets","schemas"]}]},"login":{"id":"login","description":"log in to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"account":{"name":"account","type":"option","char":"a","description":"StepZen account name (copy from https://stepzen.com/account). If not provided, the CLI prompts the users to enter one."},"adminkey":{"name":"adminkey","type":"option","char":"k","description":"Admin key (copy from https://stepzen.com/account) If not provided, the CLI prompts the users to enter one."},"public":{"name":"public","type":"boolean","description":"Create a public anonymous StepZen account and use it. This is handy for trying StepZen out, but it not suitable for handling private data as all endpoints created with a public account will be public.","allowNo":false},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"logout":{"id":"logout","description":"log out of StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start":{"id":"start","description":"upload and deploy your schema","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"working directory"},"endpoint":{"name":"endpoint","type":"option","description":"Override workspace endpoint"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"no-console":{"name":"no-console","type":"boolean","hidden":true,"allowNo":false},"no-dashboard":{"name":"no-dashboard","type":"boolean","hidden":true,"allowNo":false},"no-init":{"name":"no-init","type":"boolean","hidden":true,"allowNo":false},"no-validate":{"name":"no-validate","type":"boolean","hidden":true,"allowNo":false},"no-watcher":{"name":"no-watcher","type":"boolean","hidden":true,"allowNo":false},"port":{"name":"port","type":"option","default":5001}},"args":[]},"transpile":{"id":"transpile","description":"transpile a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"hide-output":{"name":"hide-output","type":"boolean","hidden":true,"allowNo":false},"inspect":{"name":"inspect","type":"boolean","char":"i","hidden":true,"allowNo":false},"inspect-after":{"name":"inspect-after","type":"boolean","hidden":true,"allowNo":false},"output-configuration":{"name":"output-configuration","type":"boolean","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"folder","required":true}]},"upload":{"id":"upload","description":"upload to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"A directory to upload"},"file":{"name":"file","type":"option","description":"A file to upload"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationset","schema"]},{"name":"destination","description":"destination","required":true}]},"validate":{"id":"validate","description":"validate a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"display your credentials with StepZen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"apikey":{"name":"apikey","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false}},"args":[]}}}
1
+ {"version":"0.19.0-beta.2","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"configurationsets":{"name":"configurationsets","type":"option","description":"Configurationsets to use","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"schema":{"name":"schema","type":"option","description":"Schema to use","required":true},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"destination","description":"destination","required":true}]},"import":{"id":"import","description":"import a schema for an external data source or an API endpoint to your GraphQL API","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"working directory"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","hidden":true,"allowNo":false},"name":{"name":"name","type":"option","description":"Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported schema."},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite any existing schema with the same name. Cannot be used without also providing a --name flag.","hidden":true,"allowNo":false},"prefix":{"name":"prefix","type":"option","description":"[curl, graphql] prefix to add every type in the generated schema."},"header":{"name":"header","type":"option","char":"H","description":"[curl, graphql] specifies a request header to pass\n\nExample:\nstepzen import curl https://example.com/api/customers \\\n\t-H \"Authorization: apikey SecretAPIKeyValue\""},"header-param":{"name":"header-param","type":"option","description":"[curl, graphql] specifies a parameter in a header value. Can be formed by taking a -H, --header flag and replacing the variable part of the header value with a $paramName placeholder. Repeat this flag once for each header with a parameter.\n\nExample:\nstepzen import curl https://example.com/api/customers \\\n\t-H \"Authorization: apikey SecretAPIKeyValue\" \\\n\t--header-param 'Authorization: apikey $apikey'"},"query-name":{"name":"query-name","type":"option","description":"[curl] property name to add to the Query type as a way to access the imported cURL endpoint."},"query-type":{"name":"query-type","type":"option","description":"[curl] name for the type returned by the cURL endpoint in the generated schema. The name specified by --query-type is not prefixed by --prefix if both flags are present."},"path-params":{"name":"path-params","type":"option","description":"[curl] specifies path parameters in the URL path. Can be formed by taking the original path and replacing the variable segments with $paramName placeholders.\n\nExample:\nstepzen import curl https://example.com/users/jane/posts/12 --path-params '/users/$userId/posts/$postId'"},"db-host":{"name":"db-host","type":"option","description":"[mysql, postgresql] database host"},"db-user":{"name":"db-user","type":"option","description":"[mysql, postgresql] database user name"},"db-password":{"name":"db-password","type":"option","description":"[mysql, postgresql] database password"},"db-database":{"name":"db-database","type":"option","description":"[mysql, postgresql] name of database to import"},"db-link-types":{"name":"db-link-types","type":"boolean","description":"[mysql, postgresql] Automatically link types based on foreign key relationships using @materializer (https://stepzen.com/docs/features/linking-types)","allowNo":false},"db-include":{"name":"db-include","type":"option","description":"[mysql, postgresql] Should the generated GraphQL schema be based only on database views, only on tables or on both.","hidden":false,"helpValue":"(tables-only|views-only|tables-and-views)","options":["tables-only","views-only","tables-and-views"]},"db-schema":{"name":"db-schema","type":"option","description":"[postgresql] database schema"}},"args":[{"name":"schema","required":true}]},"init":{"id":"init","description":"Initialize a StepZen workspace in the current directory","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"yes":{"name":"yes","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"directory","hidden":true}]},"lint":{"id":"lint","description":"StepZen lint","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"list":{"id":"list","description":"list your items","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationsets","schemas"]}]},"login":{"id":"login","description":"log in to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"account":{"name":"account","type":"option","char":"a","description":"StepZen account name (copy from https://stepzen.com/account). If not provided, the CLI prompts the users to enter one."},"adminkey":{"name":"adminkey","type":"option","char":"k","description":"Admin key (copy from https://stepzen.com/account) If not provided, the CLI prompts the users to enter one."},"public":{"name":"public","type":"boolean","description":"Create a public anonymous StepZen account and use it. This is handy for trying StepZen out, but it not suitable for handling private data as all endpoints created with a public account will be public.","allowNo":false},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"logout":{"id":"logout","description":"log out of StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start":{"id":"start","description":"upload and deploy your schema","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"working directory"},"endpoint":{"name":"endpoint","type":"option","description":"Override workspace endpoint"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"no-console":{"name":"no-console","type":"boolean","hidden":true,"allowNo":false},"no-dashboard":{"name":"no-dashboard","type":"boolean","hidden":true,"allowNo":false},"no-init":{"name":"no-init","type":"boolean","hidden":true,"allowNo":false},"no-validate":{"name":"no-validate","type":"boolean","hidden":true,"allowNo":false},"no-watcher":{"name":"no-watcher","type":"boolean","hidden":true,"allowNo":false},"port":{"name":"port","type":"option","default":5001}},"args":[]},"transpile":{"id":"transpile","description":"transpile a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"hide-output":{"name":"hide-output","type":"boolean","hidden":true,"allowNo":false},"inspect":{"name":"inspect","type":"boolean","char":"i","hidden":true,"allowNo":false},"inspect-after":{"name":"inspect-after","type":"boolean","hidden":true,"allowNo":false},"output-configuration":{"name":"output-configuration","type":"boolean","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"folder","required":true}]},"upload":{"id":"upload","description":"upload to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"A directory to upload"},"file":{"name":"file","type":"option","description":"A file to upload"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationset","schema"]},{"name":"destination","description":"destination","required":true}]},"validate":{"id":"validate","description":"validate a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"display your credentials with StepZen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"apikey":{"name":"apikey","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stepzen",
3
3
  "description": "The StepZen CLI",
4
- "version": "0.18.0",
4
+ "version": "0.19.0-beta.2",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -100,8 +100,8 @@
100
100
  "sinon": "13.0.1",
101
101
  "sinon-chai": "3.7.0",
102
102
  "strip-ansi": "^6.0.1",
103
- "ts-node": "^8.10.2",
104
- "typescript": "^3.9.7"
103
+ "ts-node": "^10.8.1",
104
+ "typescript": "^4.7.4"
105
105
  },
106
106
  "oclif": {
107
107
  "commands": "./lib/commands",