stepzen 0.14.0 → 0.15.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.
package/README.md CHANGED
@@ -29,7 +29,7 @@ $ npm install -g stepzen
29
29
  $ stepzen COMMAND
30
30
  running command...
31
31
  $ stepzen (-v|--version|version)
32
- stepzen/0.14.0 darwin-x64 node-v14.19.1
32
+ stepzen/0.15.0-beta.2 darwin-x64 node-v14.19.1
33
33
  $ stepzen --help [COMMAND]
34
34
  USAGE
35
35
  $ stepzen COMMAND
@@ -135,7 +135,7 @@ OPTIONS
135
135
 
136
136
  ## `stepzen login`
137
137
 
138
- log in to stepzen
138
+ Log in to StepZen
139
139
 
140
140
  ```
141
141
  USAGE
@@ -143,6 +143,9 @@ USAGE
143
143
 
144
144
  OPTIONS
145
145
  -h, --help show CLI help
146
+
147
+ --public Create a public anonymous StepZen account and use it. This is handy for trying StepZen out, but it not
148
+ suitable for handling private data as all endpoints created with a public account will be public.
146
149
  ```
147
150
 
148
151
  ## `stepzen logout`
@@ -8,7 +8,6 @@ export default class Deploy extends ZenCommand {
8
8
  schema: flags.IOptionFlag<string>;
9
9
  silent: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
10
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
12
11
  };
13
12
  static args: {
14
13
  name: string;
@@ -16,10 +16,17 @@ class Deploy extends zen_command_1.default {
16
16
  if (args.destination.includes('/') === false) {
17
17
  throw new errors_1.CLIError('You must specify the folder/name you want to use');
18
18
  }
19
- await this.ensureStepZenAccount();
19
+ const { configuration } = await this.ensureStepZenAccount();
20
20
  if (!flags.silent) {
21
21
  this.log('Deploying...');
22
22
  }
23
+ // If this is a public account, add a special configuration set to make the
24
+ // endpoint public (https://github.com/steprz/zen/pull/5701)
25
+ if (configuration.account.startsWith('public')) {
26
+ flags.configurationsets = flags.configurationsets
27
+ ? `${flags.configurationsets},stepzen/public`
28
+ : 'stepzen/public';
29
+ }
23
30
  const response = await actions_1.deploy(args.destination, flags.configurationsets, flags.schema);
24
31
  if (response.success) {
25
32
  if (!flags.silent) {
@@ -12,7 +12,6 @@ export default class Import extends ZenCommand {
12
12
  'query-type': flags.IOptionFlag<string | undefined>;
13
13
  'path-params': flags.IOptionFlag<string | undefined>;
14
14
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
16
15
  };
17
16
  static args: {
18
17
  name: string;
@@ -11,7 +11,6 @@ export default class Init extends ZenCommand {
11
11
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
12
12
  yes: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
13
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
15
14
  };
16
15
  static args: {
17
16
  hidden: boolean;
@@ -7,7 +7,6 @@ export default class Init extends ZenCommand {
7
7
  dir: flags.IOptionFlag<string | undefined>;
8
8
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
9
9
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
11
10
  };
12
11
  run(): Promise<void>;
13
12
  }
@@ -1,11 +1,9 @@
1
- import { flags } from '@oclif/command';
2
1
  import ZenCommand from '../shared/zen-command';
3
2
  export default class List extends ZenCommand {
4
3
  static description: string;
5
4
  static flags: {
6
5
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
7
6
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
9
7
  };
10
8
  static args: {
11
9
  name: string;
@@ -5,10 +5,10 @@ export default class Login extends ZenCommand {
5
5
  static flags: {
6
6
  account: flags.IOptionFlag<string | undefined>;
7
7
  adminkey: flags.IOptionFlag<string | undefined>;
8
+ public: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
9
  config: flags.IOptionFlag<string | undefined>;
9
10
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
10
11
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
12
12
  };
13
13
  run(): Promise<void>;
14
14
  }
@@ -6,45 +6,69 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // subsequently changes the identity of the logged in account.
7
7
  const command_1 = require("@oclif/command");
8
8
  const core_1 = require("@oclif/core");
9
+ const chalk = require("chalk");
9
10
  const configuration_1 = require("../shared/configuration");
10
11
  const stepzen_sdk_1 = require("../shared/stepzen-sdk");
11
12
  const zen_command_1 = require("../shared/zen-command");
12
13
  class Login extends zen_command_1.default {
13
14
  async run() {
14
15
  const { flags } = this.parse(Login);
15
- let account;
16
- let adminkey;
17
- // If the --config flag is provided, try and log in using the details in the file
18
- if (flags.config) {
19
- const config = await configuration_1.importConfiguration(flags.config);
20
- account = config.account;
21
- adminkey = config.adminkey;
16
+ let configuration;
17
+ if (flags.public) {
18
+ const { uuid } = await configuration_1.readConfiguration();
19
+ configuration = await stepzen_sdk_1.default.createAnonymousAccount(uuid);
22
20
  }
23
21
  else {
24
- // Check if the --account flag is provided, and if not prompt the user for an account name
25
- if (flags.account) {
26
- account = flags.account;
22
+ let account;
23
+ let adminkey;
24
+ // If the --config flag is provided, try and log in using the details in the file
25
+ if (flags.config) {
26
+ const config = await configuration_1.importConfiguration(flags.config);
27
+ account = config.account;
28
+ adminkey = config.adminkey;
27
29
  }
28
30
  else {
29
- account = await core_1.CliUx.ux.prompt('What is your account name?');
30
- }
31
- // Check if the --adminkey flag is provided, and if not prompt the user for an admin key.
32
- if (flags.adminkey === undefined) {
33
- adminkey = await core_1.CliUx.ux.prompt('What is your admin key?', {
34
- required: false,
35
- type: 'hide',
36
- });
37
- }
38
- else {
39
- adminkey = flags.adminkey;
31
+ // Check if the --account flag is provided, and if not prompt the user for an account name
32
+ if (flags.account) {
33
+ account = flags.account;
34
+ }
35
+ else {
36
+ account = await core_1.CliUx.ux.prompt('What is your account name?');
37
+ }
38
+ // Check if the --adminkey flag is provided, and if not prompt the user for an admin key.
39
+ if (flags.adminkey === undefined) {
40
+ adminkey = await core_1.CliUx.ux.prompt('What is your admin key?', {
41
+ required: false,
42
+ type: 'hide',
43
+ });
44
+ }
45
+ else {
46
+ adminkey = flags.adminkey;
47
+ }
40
48
  }
49
+ configuration = await stepzen_sdk_1.default.login(adminkey, account);
41
50
  }
42
- const configuration = await stepzen_sdk_1.default.login(adminkey, account);
43
51
  // Change the default account.
44
52
  configuration_1.writeCredentialsToConfigFile(configuration);
45
- this.log('You have successfully logged in.');
53
+ this.log(`You have successfully logged in as ${chalk.bold(configuration.account)}.`);
46
54
  }
47
55
  }
48
56
  exports.default = Login;
49
- Login.description = 'log in to stepzen';
50
- Login.flags = Object.assign(Object.assign({}, zen_command_1.default.flags), { account: command_1.flags.string({ char: 'a', exclusive: ['config'], hidden: true }), adminkey: command_1.flags.string({ char: 'k', exclusive: ['config'], hidden: true }), config: command_1.flags.string({ exclusive: ['account', 'adminkey'], hidden: true }), help: command_1.flags.help({ char: 'h' }) });
57
+ Login.description = 'Log in to StepZen';
58
+ Login.flags = Object.assign(Object.assign({}, zen_command_1.default.flags), { account: command_1.flags.string({
59
+ char: 'a',
60
+ exclusive: ['config', 'public'],
61
+ hidden: true,
62
+ }), adminkey: command_1.flags.string({
63
+ char: 'k',
64
+ exclusive: ['config', 'public'],
65
+ hidden: true,
66
+ }), public: command_1.flags.boolean({
67
+ description: 'Create a public anonymous StepZen account and use it. This is handy' +
68
+ ' for trying StepZen out, but it not suitable for handling private' +
69
+ ' data as all endpoints created with a public account will be public.',
70
+ exclusive: ['config', 'account', 'adminkey'],
71
+ }), config: command_1.flags.string({
72
+ exclusive: ['account', 'adminkey', 'public'],
73
+ hidden: true,
74
+ }), help: command_1.flags.help({ char: 'h' }) });
@@ -1,11 +1,9 @@
1
- import { flags } from '@oclif/command';
2
1
  import ZenCommand from '../shared/zen-command';
3
2
  export default class Logout extends ZenCommand {
4
3
  static description: string;
5
4
  static flags: {
6
5
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
7
6
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
9
7
  };
10
8
  run(): Promise<void>;
11
9
  }
@@ -14,7 +14,6 @@ export default class Start extends ZenCommand {
14
14
  'no-watcher': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
15
  port: import("@oclif/parser/lib/flags").IOptionFlag<number>;
16
16
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
17
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
18
17
  };
19
18
  static args: never[];
20
19
  run(): Promise<void>;
@@ -12,7 +12,6 @@ export default class Transpile extends ZenCommand {
12
12
  'output-configuration': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
13
  silent: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
14
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
16
15
  };
17
16
  static args: {
18
17
  name: string;
@@ -8,7 +8,6 @@ export default class Upload extends ZenCommand {
8
8
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
9
9
  silent: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
10
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
12
11
  };
13
12
  static args: ({
14
13
  name: string;
@@ -1,4 +1,3 @@
1
- import { flags } from '@oclif/command';
2
1
  import ZenCommand from '../shared/zen-command';
3
2
  export default class Validate extends ZenCommand {
4
3
  static description: string;
@@ -6,7 +5,6 @@ export default class Validate extends ZenCommand {
6
5
  static flags: {
7
6
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
8
7
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
10
8
  };
11
9
  static args: {
12
10
  name: string;
@@ -1,4 +1,3 @@
1
- import { flags } from '@oclif/command';
2
1
  import ZenCommand from '../shared/zen-command';
3
2
  export default class WhoAmI extends ZenCommand {
4
3
  static description: string;
@@ -9,7 +8,6 @@ export default class WhoAmI extends ZenCommand {
9
8
  apikey: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
9
  adminkey: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
10
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
13
11
  };
14
12
  static args: never[];
15
13
  run(): Promise<void>;
@@ -6,10 +6,10 @@ const chalk = require("chalk");
6
6
  const compareVersions = require("compare-versions");
7
7
  const fs = require("fs-extra");
8
8
  const debug_1 = require("debug");
9
+ const parser_1 = require("@oclif/parser");
9
10
  const node_fetch_1 = require("node-fetch");
10
11
  const constants_1 = require("../../shared/constants");
11
12
  const errors_1 = require("../../shared/errors");
12
- const { version } = require('../../../package.json');
13
13
  const majorRegexp = /\d+\./;
14
14
  const timeoutBeta = 1000 * 60 * 60 * 24; // one day
15
15
  const timeoutStable = 7 * timeoutBeta; // one week
@@ -89,15 +89,24 @@ ${chalk.green('npm install -g stepzen')}
89
89
  }
90
90
  return result;
91
91
  };
92
- const hook = async function () {
93
- const { message, isBlocking } = await exports.checkUpgrade(version);
94
- if (message) {
92
+ const hook = async function (options) {
93
+ const { message, isBlocking } = await exports.checkUpgrade(this.config.version);
94
+ // parse the command line to get `flags['non-interactive']`
95
+ const TheCommand = options.Command;
96
+ const { flags } = parser_1.parse(options.argv, Object.assign({ context: this }, TheCommand));
97
+ // In a non-interactive shell only print the upgrade nudge if the upgrade
98
+ // is blocking.
99
+ // For non-blocking upgrades we don't want to print the upgrade nudge when
100
+ // the CLI is executed as a part of a non-interactive shell script. This
101
+ // additional output might by unexpected by the rest of script and could
102
+ // break the pipeline.
103
+ if (message && (isBlocking || !flags['non-interactive'])) {
95
104
  this.log('');
96
105
  this.log(message.trim());
97
106
  this.log('');
98
- if (isBlocking) {
99
- this.exit(1);
100
- }
107
+ }
108
+ if (isBlocking) {
109
+ this.exit(1);
101
110
  }
102
111
  };
103
112
  exports.default = hook;
@@ -6,7 +6,7 @@ exports.removeCredentialsFromConfigFile = exports.writeCredentialsToConfigFile =
6
6
  const errors_1 = require("@oclif/errors");
7
7
  const debug = require("debug");
8
8
  const fs = require("fs");
9
- const crypto = require("crypto");
9
+ const uuid_1 = require("uuid");
10
10
  const path = require("path");
11
11
  const yaml = require("yaml");
12
12
  const stepzen_sdk_1 = require("./stepzen-sdk");
@@ -35,7 +35,7 @@ exports.ensureValidConfiguration = async (maybeConfiguration) => {
35
35
  }
36
36
  // ensure configuration has a UUID
37
37
  if (!configuration.uuid) {
38
- configuration.uuid = crypto.randomUUID();
38
+ configuration.uuid = uuid_1.v4();
39
39
  debug('stepzen:configuration')(`Generated a new machine UUID: ${configuration.uuid}`);
40
40
  modified = true;
41
41
  }
@@ -1,9 +1,8 @@
1
- import { Command, flags } from '@oclif/command';
1
+ import { Command } from '@oclif/command';
2
2
  import { MachineConfiguration, StepZenCredentials } from './types';
3
3
  export declare abstract class ZenCommand extends Command {
4
4
  static flags: {
5
5
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
- 'enable-login-prompt': flags.IOptionFlag<boolean | undefined>;
7
6
  };
8
7
  ensureStepZenAccount(): Promise<{
9
8
  configuration: import("./types").LoggedInMachineConfiguration;
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ZenCommand = void 0;
5
5
  const command_1 = require("@oclif/command");
6
- const errors_1 = require("@oclif/errors");
7
6
  const inquirer = require("inquirer");
8
7
  const chalk = require("chalk");
9
8
  const configuration_1 = require("./configuration");
@@ -16,19 +15,15 @@ class ZenCommand extends command_1.Command {
16
15
  configuration,
17
16
  };
18
17
  }
19
- const TheCommand = this.constructor;
20
- const { flags } = this.parse(TheCommand);
21
- if (flags['enable-login-prompt']) {
22
- return this.promptUserToLogIn(configuration.uuid);
23
- }
24
- throw new errors_1.CLIError('Could not find StepZen account credentials.' +
25
- ' Please run `stepzen login` first.');
18
+ return this.promptUserToLogIn(configuration.uuid);
26
19
  }
27
20
  async promptUserToLogIn(uuid) {
28
- this.log(chalk.bold(chalk.cyan('Welcome to StepZen CLI!')));
21
+ this.log(chalk.bold(chalk.cyan('Welcome to the StepZen CLI!')));
29
22
  this.log('');
30
- this.log(`Please log in with your StepZen account to make your GraphQL API private.` +
31
- ` All APIs created without logging in will be public.`);
23
+ this.log(`You are about to deploy your GraphQL API to the cloud on a public` +
24
+ ` endpoint. Log in or create a StepZen account to get a` +
25
+ ` production-ready GraphQL API deployed on a secure and private` +
26
+ ` endpoint.`);
32
27
  this.log('');
33
28
  const answers = await inquirer.prompt([
34
29
  {
@@ -82,19 +77,12 @@ ZenCommand.flags = {
82
77
  'non-interactive': command_1.flags.boolean({
83
78
  description: 'disable all interactive prompts',
84
79
  hidden: true,
85
- }),
86
- // The flag type has to be `option` (not `boolean`) for `env` to take effect
87
- 'enable-login-prompt': command_1.flags.option({
88
- description: 'An (internal) feature flag to enable the "prompt user to log in"' +
89
- ' feature for the users who run the CLI without being logged in. It' +
90
- ' is intentially hidden and not documented because in the future' +
91
- ' this feature will be enabled for all users and the flag will be' +
92
- ' removed.',
93
- hidden: true,
94
- options: ['true', 'false'],
95
- parse: value => Boolean(value),
96
- default: false,
97
- env: 'STEPZEN_ENABLE_LOGIN_PROMPT',
80
+ default: () => {
81
+ if (process.env.STEPZEN_INTERACTIVE !== undefined) {
82
+ return process.env.STEPZEN_INTERACTIVE.toLowerCase() === 'false';
83
+ }
84
+ return !process.stdin.isTTY || !process.stdout.isTTY;
85
+ },
98
86
  }),
99
87
  };
100
88
  exports.default = ZenCommand;
@@ -1 +1 @@
1
- {"version":"0.14.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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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, defaults to the imported schema name"},"prefix":{"name":"prefix","type":"option","description":"[curl] prefix to add every type in the generated schema."},"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'"}},"args":[{"name":"schemas","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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":false},"account":{"name":"account","type":"option","char":"a","hidden":true},"adminkey":{"name":"adminkey","type":"option","char":"k","hidden":true},"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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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-server":{"name":"no-server","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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"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},"enable-login-prompt":{"name":"enable-login-prompt","type":"option","description":"An (internal) feature flag to enable the \"prompt user to log in\" feature for the users who run the CLI without being logged in. It is intentially hidden and not documented because in the future this feature will be enabled for all users and the flag will be removed.","hidden":true,"options":["true","false"],"default":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.15.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 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, defaults to the imported schema name"},"prefix":{"name":"prefix","type":"option","description":"[curl] prefix to add every type in the generated schema."},"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'"}},"args":[{"name":"schemas","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","hidden":true},"adminkey":{"name":"adminkey","type":"option","char":"k","hidden":true},"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-server":{"name":"no-server","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":"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.14.0",
4
+ "version": "0.15.0-beta.2",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "main": "lib/index.js",
15
15
  "engines": {
16
- "node": ">=14.17.0",
16
+ "node": ">=14.0",
17
17
  "npm": ">=6.14"
18
18
  },
19
19
  "files": [
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@oclif/command": "^1.8.0",
30
30
  "@oclif/config": "^1.18.3",
31
- "@oclif/core": "1.6.3",
31
+ "@oclif/core": "1.7.0",
32
32
  "@oclif/errors": "1.3.5",
33
33
  "@oclif/plugin-help": "^5.1.12",
34
34
  "@stepzen/dashboard": "0.1.37",
@@ -38,7 +38,7 @@
38
38
  "chokidar": "^3.5.2",
39
39
  "compare-versions": "^3.6.0",
40
40
  "date-fns": "^2.26.0",
41
- "debug": "^4.3.0",
41
+ "debug": "^4.3.4",
42
42
  "detect-port": "^1.3.0",
43
43
  "dotenv": "^8.6.0",
44
44
  "fs-extra": "^9.1.0",
@@ -46,10 +46,11 @@
46
46
  "inquirer": "^7.3.3",
47
47
  "lodash": "^4.17.21",
48
48
  "node-fetch": "^2.6.6",
49
- "prettier": "^2.4.1",
49
+ "prettier": "^2.6.2",
50
50
  "pretty-ms": "^7.0.1",
51
51
  "shelljs": "^0.8.5",
52
52
  "throttle-debounce": "^3.0.1",
53
+ "uuid": "^8.3.2",
53
54
  "yaml": "^1.10.0"
54
55
  },
55
56
  "devDependencies": {
@@ -69,14 +70,16 @@
69
70
  "@types/minimist": "^1.2.1",
70
71
  "@types/mocha": "^5.2.7",
71
72
  "@types/mock-fs": "^4.13.0",
72
- "@types/node": "^14.18.13",
73
+ "@types/node": "^14.0.27",
73
74
  "@types/node-fetch": "^2.5.7",
74
75
  "@types/prettier": "^2.1.6",
75
76
  "@types/rimraf": "^3.0.0",
77
+ "@types/semver": "^7.3.9",
76
78
  "@types/shelljs": "^0.8.8",
77
79
  "@types/sinon-chai": "3.2.8",
78
80
  "@types/throttle-debounce": "^2.1.0",
79
81
  "@types/unzipper": "^0.10.4",
82
+ "@types/uuid": "^8.3.4",
80
83
  "chai": "^4.2.0",
81
84
  "copyfiles": "^2.4.1",
82
85
  "cross-env": "^7.0.3",
@@ -93,6 +96,7 @@
93
96
  "nock": "^13.0.4",
94
97
  "nodemon": "^2.0.7",
95
98
  "nyc": "^14.1.1",
99
+ "semver": "^7.3.7",
96
100
  "sinon": "13.0.1",
97
101
  "sinon-chai": "3.7.0",
98
102
  "ts-node": "^8.10.2",
@@ -118,9 +122,9 @@
118
122
  "postpack": "rm -f oclif.manifest.json",
119
123
  "posttest": "eslint . --ignore-path .prettierignore",
120
124
  "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
121
- "test": "tsc -b && cross-env STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
125
+ "test": "tsc -b && cross-env STEPZEN_INTERACTIVE=true STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
122
126
  "test:single:example": "npm run test:single -- test/src/shared/curl-parser.test.ts",
123
- "test:single": "tsc -b && cross-env STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost mocha --forbid-only test/_global.test.ts",
127
+ "test:single": "tsc -b && cross-env STEPZEN_INTERACTIVE=true STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost mocha --forbid-only test/_global.test.ts",
124
128
  "version": "oclif-dev readme && git add README.md",
125
129
  "prepare": "husky install"
126
130
  },