stepzen 0.25.0 → 0.26.0-experimental.910b3ea

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
@@ -30,7 +30,7 @@ $ npm install -g stepzen
30
30
  $ stepzen COMMAND
31
31
  running command...
32
32
  $ stepzen (-v|--version|version)
33
- stepzen/0.25.0 linux-x64 node-v14.21.1
33
+ stepzen/0.26.0-experimental.910b3ea linux-x64 node-v14.21.1
34
34
  $ stepzen --help [COMMAND]
35
35
  USAGE
36
36
  $ stepzen COMMAND
@@ -282,9 +282,33 @@ ARGUMENTS
282
282
  QUERY GraphQL query (could include a query, a mutation or a subscription)
283
283
 
284
284
  OPTIONS
285
- -h, --help Show CLI help
286
- --dir=dir StepZen workspace directory (defaults to the current directory)
287
- --endpoint=endpoint StepZen endpoint to call (defaults to the endpoint in current StepZen workspace)
285
+ -h, --help
286
+ Show CLI help
287
+
288
+ --dir=dir
289
+ StepZen workspace directory (defaults to the current directory)
290
+
291
+ --endpoint=endpoint
292
+ StepZen endpoint to call (defaults to the endpoint in current StepZen workspace)
293
+
294
+ --var=var
295
+ Add a request variable, in the name=value format.
296
+
297
+ Example:
298
+ stepzen request 'query OrdersQuery($search: String!, $limit: Int) {
299
+ orders(search: $search, limit: $limit) { id createdAt }
300
+ }' \
301
+ --var 'search=space ninja' \
302
+ --var limit=5
303
+
304
+ --var-file=var-file
305
+ Read request variables from a JSON file
306
+
307
+ Example:
308
+ stepzen request 'query OrdersQuery($search: String!, $limit: Int) {
309
+ orders(search: $search, limit: $limit) { id createdAt }
310
+ }' \
311
+ --var-file ./vars.json
288
312
  ```
289
313
 
290
314
  ## `stepzen service [ACTION]`
@@ -1,10 +1,13 @@
1
1
  import { flags } from '@oclif/command';
2
2
  import ZenCommand from '../shared/zen-command';
3
+ import type { DocumentNode } from 'graphql';
3
4
  export default class Request extends ZenCommand {
4
5
  static description: string;
5
6
  static flags: {
6
7
  dir: flags.IOptionFlag<string | undefined>;
7
8
  endpoint: flags.IOptionFlag<string | undefined>;
9
+ var: flags.IOptionFlag<string[]>;
10
+ 'var-file': flags.IOptionFlag<string | undefined>;
8
11
  help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
9
12
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
13
  };
@@ -14,5 +17,6 @@ export default class Request extends ZenCommand {
14
17
  required: boolean;
15
18
  }[];
16
19
  run(): Promise<void>;
20
+ getRequestVariables(query: DocumentNode, variableFlags?: string[], varFileFlag?: string): Record<string, any>;
17
21
  }
18
22
  //# sourceMappingURL=request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/commands/request.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AASpC,OAAO,UAAU,MAAM,uBAAuB,CAAA;AA6B9C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,UAAU;IAC7C,MAAM,CAAC,WAAW,SAGH;IAEf,MAAM,CAAC,KAAK;;;;;MAYX;IAED,MAAM,CAAC,IAAI;;;;QAOV;IAEK,GAAG;CAkJV"}
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/commands/request.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAA;AASpC,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAI9C,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,SAAS,CAAA;AA0BhB,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,UAAU;IAC7C,MAAM,CAAC,WAAW,SAGH;IAEf,MAAM,CAAC,KAAK;;;;;;;MAoCX;IAED,MAAM,CAAC,IAAI;;;;QAOV;IAEK,GAAG;IA2JT,mBAAmB,CACjB,KAAK,EAAE,YAAY,EACnB,aAAa,CAAC,EAAE,MAAM,EAAE,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAkCvB"}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // in the current / given StepZen workspace.
7
7
  // The endpoint needs to be deployed first for this command to work.
8
8
  const chalk = require("chalk");
9
+ const fs = require("fs");
9
10
  const command_1 = require("@oclif/command");
10
11
  const errors_1 = require("@oclif/errors");
11
12
  const graphql_ws_1 = require("graphql-ws");
@@ -17,6 +18,7 @@ const stepzen_sdk_1 = require("../shared/stepzen-sdk");
17
18
  const zen_command_1 = require("../shared/zen-command");
18
19
  const constants_1 = require("../shared/constants");
19
20
  const utils_1 = require("../shared/utils");
21
+ const request_variables_parser_1 = require("../shared/request-variables-parser");
20
22
  const formatErrorMessage = (errors) => {
21
23
  if (/Syntax Error GraphQL request/i.test(errors?.[0]?.message)) {
22
24
  // Special case: in this case the error message also contains the
@@ -43,6 +45,7 @@ class Request extends zen_command_1.default {
43
45
  catch (error) {
44
46
  throw new errors_1.CLIError(`Failed to parse the GraphQL query\n${error}`);
45
47
  }
48
+ const variables = this.getRequestVariables(parsedQuery, flags.var, flags['var-file']);
46
49
  // Make sure the user is logged in
47
50
  const { configuration } = await this.ensureStepZenAccount();
48
51
  const zenserv = (0, constants_1.getZenServUrl)(configuration);
@@ -80,6 +83,7 @@ class Request extends zen_command_1.default {
80
83
  let lastResult;
81
84
  client.subscribe({
82
85
  query: args.query,
86
+ variables,
83
87
  }, {
84
88
  next: result => {
85
89
  if (count === 0) {
@@ -119,6 +123,7 @@ class Request extends zen_command_1.default {
119
123
  const result = await (0, sdk_1.fetchGraphQLQuery)({
120
124
  url: `${zenserv}/${endpoint}/__graphql`,
121
125
  query: args.query,
126
+ variables,
122
127
  headers: {
123
128
  Authorization: `APIKey ${configuration.apikey}`,
124
129
  'User-Agent': userAgent,
@@ -144,6 +149,25 @@ class Request extends zen_command_1.default {
144
149
  throw new errors_1.CLIError(message);
145
150
  }
146
151
  }
152
+ getRequestVariables(query, variableFlags, varFileFlag) {
153
+ const opdef = query.definitions.find(node => node.kind === 'OperationDefinition');
154
+ if (!opdef) {
155
+ throw new errors_1.CLIError(`Please provide a GraphQL request: query, mutation or subscription.`);
156
+ }
157
+ if (varFileFlag) {
158
+ try {
159
+ return JSON.parse(fs.readFileSync(varFileFlag, 'utf8'));
160
+ }
161
+ catch (error) {
162
+ throw new errors_1.CLIError(`Cannot read request variables from ${varFileFlag}.\n${error}`);
163
+ }
164
+ }
165
+ const { variables, errors } = (0, request_variables_parser_1.parseRequestVariables)(variableFlags || [], opdef);
166
+ if (errors.length > 0) {
167
+ throw new errors_1.CLIError(chalk `Could not parse the --var flag:\n - ` + errors.join('\n - '));
168
+ }
169
+ return variables;
170
+ }
147
171
  }
148
172
  exports.default = Request;
149
173
  Request.description = `Send a GraphQL request to a StepZen endpoint and print the response,` +
@@ -159,6 +183,28 @@ Request.flags = {
159
183
  description: 'StepZen endpoint to call (defaults to the endpoint in current StepZen workspace)',
160
184
  exclusive: ['dir'],
161
185
  }),
186
+ var: command_1.flags.string({
187
+ description: chalk `Add a request variable, in the {bold name}={underline value} format.` +
188
+ `\n` +
189
+ `\nExample:` +
190
+ `\nstepzen request 'query OrdersQuery($search: String!, $limit: Int) {` +
191
+ `\n\t\torders(search: $search, limit: $limit) { id createdAt }` +
192
+ `\n\t}' \\` +
193
+ `\n\t--var 'search=space ninja' \\` +
194
+ `\n\t--var limit=5`,
195
+ multiple: true,
196
+ exclusive: ['var-file'],
197
+ }),
198
+ 'var-file': command_1.flags.string({
199
+ description: chalk `Read request variables from a JSON file` +
200
+ `\n` +
201
+ `\nExample:` +
202
+ `\nstepzen request 'query OrdersQuery($search: String!, $limit: Int) {` +
203
+ `\n\t\torders(search: $search, limit: $limit) { id createdAt }` +
204
+ `\n\t}' \\` +
205
+ `\n\t--var-file ./vars.json`,
206
+ exclusive: ['var'],
207
+ }),
162
208
  };
163
209
  Request.args = [
164
210
  {
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"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,kFAAkF;QACpF,SAAS,EAAE,CAAC,KAAK,CAAC;KACnB,CAAC;IACF,GAAG,EAAE,eAAK,CAAC,MAAM,CAAC;QAChB,WAAW,EACT,KAAK,CAAA,sEAAsE;YAC3E,IAAI;YACJ,YAAY;YACZ,uEAAuE;YACvE,+DAA+D;YAC/D,WAAW;YACX,mCAAmC;YACnC,mBAAmB;QACrB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,CAAC,UAAU,CAAC;KACxB,CAAC;IACF,UAAU,EAAE,eAAK,CAAC,MAAM,CAAC;QACvB,WAAW,EACT,KAAK,CAAA,yCAAyC;YAC9C,IAAI;YACJ,YAAY;YACZ,uEAAuE;YACvE,+DAA+D;YAC/D,WAAW;YACX,4BAA4B;QAC9B,SAAS,EAAE,CAAC,KAAK,CAAC;KACnB,CAAC;CACH,CAAA;AAEM,YAAI,GAAG;IACZ;QACE,IAAI,EAAE,OAAO;QACb,WAAW,EACT,qEAAqE;QACvE,QAAQ,EAAE,IAAI;KACf;CACF,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { OperationDefinitionNode } from 'graphql';
2
+ export declare const parseVariableValue: (value: string, typename: string) => {
3
+ value: any;
4
+ error?: undefined;
5
+ } | {
6
+ error: {
7
+ message: string;
8
+ };
9
+ value?: undefined;
10
+ };
11
+ export declare const parseRequestVariables: (variableFlags: string[], operation: OperationDefinitionNode) => {
12
+ variables: Record<string, any>;
13
+ errors: string[];
14
+ };
15
+ //# sourceMappingURL=request-variables-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-variables-parser.d.ts","sourceRoot":"","sources":["../../src/shared/request-variables-parser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,uBAAuB,EAAW,MAAM,SAAS,CAAA;AAK9D,eAAO,MAAM,kBAAkB,UAAW,MAAM,YAAY,MAAM;;;;;;;;CA+CjE,CAAA;AAED,eAAO,MAAM,qBAAqB,kBACjB,MAAM,EAAE,aACZ,uBAAuB;;;CAsEnC,CAAA"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.parseRequestVariables = exports.parseVariableValue = void 0;
5
+ const chalk = require("chalk");
6
+ const debug = require("debug");
7
+ const unNonNull = (type) => type.kind === 'NonNullType' ? type.type : type;
8
+ const parseVariableValue = (value, typename) => {
9
+ switch (typename) {
10
+ case 'Int': {
11
+ const parsed = parseInt(value, 10);
12
+ if (!Number.isNaN(parsed)) {
13
+ return { value: parsed };
14
+ }
15
+ break;
16
+ }
17
+ case 'Float': {
18
+ const parsed = parseFloat(value);
19
+ if (!Number.isNaN(parsed) && Number.isFinite(parsed)) {
20
+ return { value: parsed };
21
+ }
22
+ break;
23
+ }
24
+ case 'Boolean':
25
+ if (value === 'true') {
26
+ return { value: true };
27
+ }
28
+ if (value === 'false') {
29
+ return { value: false };
30
+ }
31
+ break;
32
+ case 'String':
33
+ case 'ID':
34
+ case 'Date':
35
+ case 'DateTime':
36
+ case 'Secret':
37
+ return { value };
38
+ case 'JSON':
39
+ default:
40
+ try {
41
+ const parsed = JSON.parse(value);
42
+ return { value: parsed };
43
+ }
44
+ catch (error) {
45
+ debug('stepzen:request')(`JSON parsing error while parsing the value ${value}: `, error);
46
+ }
47
+ }
48
+ return {
49
+ error: {
50
+ message: chalk `{italic ${value}} is not a valid {bold ${typename}}.`,
51
+ },
52
+ };
53
+ };
54
+ exports.parseVariableValue = parseVariableValue;
55
+ const parseRequestVariables = (variableFlags, operation) => {
56
+ // errors for duplicate vars
57
+ const errors = [];
58
+ const varValues = new Map();
59
+ for (const variable of variableFlags || []) {
60
+ const idx = variable.indexOf('=');
61
+ if (idx < 0) {
62
+ errors.push(chalk `Invalid format for the variable {bold ${variable}}.` +
63
+ chalk ` Please provide a value with {bold --var ${variable}={underline value}}`);
64
+ continue;
65
+ }
66
+ const name = variable.substring(0, idx);
67
+ const value = variable.substring(idx + 1);
68
+ if (varValues.has(name)) {
69
+ errors.push(chalk `Duplicate value for the variable {bold ${name}}.` +
70
+ chalk ` Please keep only one {bold --var} flag for the {bold ${name}} variable.`);
71
+ continue;
72
+ }
73
+ varValues.set(name, value);
74
+ }
75
+ const variables = {};
76
+ for (const varDef of operation.variableDefinitions ?? []) {
77
+ const name = varDef.variable.name.value;
78
+ const value = varValues.get(name);
79
+ varValues.delete(name);
80
+ if (value === undefined) {
81
+ // errors for missing required vars
82
+ if (varDef.type.kind === 'NonNullType') {
83
+ errors.push(chalk `Missing value for a required variable {bold ${name}}.` +
84
+ chalk ` Please use the {bold --var ${name}={underline value}} format.`);
85
+ }
86
+ continue;
87
+ }
88
+ const unNonNullType = unNonNull(varDef.type);
89
+ const isList = unNonNullType.kind === 'ListType';
90
+ const { value: parsed, error } = (0, exports.parseVariableValue)(value, isList
91
+ ? 'JSON' // parse any list as a JSON value
92
+ : unNonNullType.name.value);
93
+ // errors for invalid values
94
+ if (error) {
95
+ errors.push(chalk `Invalid value for the variable {bold ${name}}: ` + error.message);
96
+ continue;
97
+ }
98
+ variables[name] = parsed;
99
+ }
100
+ // errors for extra vars
101
+ for (const name of varValues.keys()) {
102
+ errors.push(chalk `Unused variable {bold ${name}}. Please remove it.`);
103
+ }
104
+ return { variables, errors };
105
+ };
106
+ exports.parseRequestVariables = parseRequestVariables;
107
+ //# sourceMappingURL=request-variables-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-variables-parser.js","sourceRoot":"","sources":["../../src/shared/request-variables-parser.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,+BAA8B;AAC9B,+BAA8B;AAI9B,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,EAAE,CACnC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;AAEzC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAE,EAAE;I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AEtB,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,mCAAmC;YACnC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;gBACtC,MAAM,CAAC,IAAI,CACT,KAAK,CAAA,+CAA+C,IAAI,IAAI;oBAC1D,KAAK,CAAA,+BAA+B,IAAI,6BAA6B,CACxE,CAAA;aACF;YACD,SAAQ;SACT;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC5C,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,KAAK,UAAU,CAAA;QAChD,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,GAAG,IAAA,0BAAkB,EAC/C,KAAK,EACL,MAAM;YACJ,CAAC,CAAC,MAAM,CAAC,iCAAiC;YAC1C,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAC7B,CAAA;QAED,4BAA4B;QAC5B,IAAI,KAAK,EAAE;YACT,MAAM,CAAC,IAAI,CACT,KAAK,CAAA,wCAAwC,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CACvE,CAAA;YACD,SAAQ;SACT;QAED,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;KACzB;IAED,wBAAwB;IACxB,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAA,yBAAyB,IAAI,sBAAsB,CAAC,CAAA;KACtE;IAED,OAAO,EAAC,SAAS,EAAE,MAAM,EAAC,CAAA;AAC5B,CAAC,CAAA;AAxEY,QAAA,qBAAqB,yBAwEjC"}
@@ -1 +1 @@
1
- {"version":"0.25.0","commands":{"deploy":{"id":"deploy","description":"Deploy to StepZen.","usage":"deploy [ENDPOINT] [--config=path/to/config.yaml] [--dir=path/to/workspace]\n\n-- OR (deprecated) --\n\n$ stepzen deploy ENDPOINT --schema=schema [--configurationsets=cs1[,cs2[,..]]]","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"Working directory"},"silent":{"name":"silent","type":"boolean","allowNo":false},"configurationsets":{"name":"configurationsets","type":"option","description":"\n Name(s) of configuration sets uploaded earlier with stepzen upload\n [DEPRECATED: this flag will be removed in future versions]\n \n Instead, please use one of these options:\n - stepzen deploy (without the --configurationsets flag)\n \tto use the configuration from the config.yaml file in the current directory (if exists)\n - stepzen deploy --config path/to/config.yaml\n \tto explicitly specify the configuration file"},"config":{"name":"config","type":"option","description":"[default: config.yaml] Configuration file to use (relative to the current directory)","helpValue":"path/to/config.yaml"},"schema":{"name":"schema","type":"option","description":"\n Name of a schema uploaded earlier with stepzen upload\n [DEPRECATED: this flag will be removed in future versions]\n \n Instead, please use one of these options:\n - stepzen deploy (without the --schema flag)\n \tto deploy the schema from a StepZen workspace in your current directory\n - stepzen deploy --dir path/to/workspace\n \tto deploy from a StepZen workspace in another folder"}},"args":[{"name":"endpoint","description":"name of the endpoint (e.g. api/customers)\n [default: use the endpoint property from stepzen.config.json]","required":false}]},"import":{"id":"import","description":"Import a schema for an external data source or an API endpoint to your GraphQL API.","usage":["import curl [[CURLOPTS] URL] [--prefix=PREFIX] [--header=HEADER] [--header-param=HEADER-PARAM] [--query-name=QUERY-NAME] [--query-type=QUERY-TYPE] [--path-params=PATH-PARAMS]","import graphql [URL] [--prefix=PREFIX] [--header=HEADER] [--header-param=HEADER-PARAM]","import mysql [--db-host=DB-HOST] [--db-user=DB-USER] [--db-password=DB-PASSWORD] [--db-database=DB-DATABASE] [--db-link-types] [--db-include=DB-INCLUDE]","import mysql://[USER:PASSWORD@]HOST[:PORT][/DATABASE] [--db-link-types] [--db-include=DB-INCLUDE]","import postgresql [--db-host=DB-HOST] [--db-user=DB-USER] [--db-password=DB-PASSWORD] [--db-database=DB-DATABASE] [--db-link-types] [--db-include=DB-INCLUDE] [--db-schema=DB-SCHEMA]","import postgresql://[USER:PASSWORD@]HOST[:PORT][/DATABASE] [--db-link-types] [--db-include=DB-INCLUDE] [--db-schema=DB-SCHEMA]"],"pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"Working directory"},"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 to 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 endpoint"},"query-type":{"name":"query-type","type":"option","description":"[curl] Name for the type returned by the curl request 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 and optional port (as HOST[:PORT])"},"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] PostgreSQL schema to import tables from (default: public)"}},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true}},"args":[]},"list":{"id":"list","description":"List endpoints, schemas and configuration sets in your StepZen account.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[{"name":"type","description":"\n \n The type of entities to list:\n \tendpoints - GraphQL API endpoints deployed with stepzen deploy (or stepzen start)\n \tschemas [DEPRECATED] - StepZen schemas uploaded with stepzen upload (or stepzen start)\n \tconfigurationsets [DEPRECATED] - StepZen configuration sets uploaded with stepzen upload (or stepzen start)","options":["endpoints","configurationsets","schemas"],"default":"endpoints"}]},"login":{"id":"login","description":"Log in to StepZen.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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}},"args":[]},"logout":{"id":"logout","description":"Log out of StepZen.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[]},"request":{"id":"request","description":"Send a GraphQL request to a StepZen endpoint and print the response, using the API key and the target endopint from the current StepZen workspace.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"StepZen workspace directory (defaults to the current directory)"},"endpoint":{"name":"endpoint","type":"option","description":"StepZen endpoint to call (defaults to the endpoint in current StepZen workspace)"}},"args":[{"name":"query","description":"GraphQL query (could include a query, a mutation or a subscription)","required":true}]},"service":{"id":"service","description":"Manage the local StepZen service instance (requires Docker).\nYou can use a local StepZen service instance instead of the StepZen cloud to develop and test GraphQL endpoints locally. This way you can try StepZen out without giving the StepZen cloud access to your data sources and API endpoints.\n\nLocal StepZen service instances are not suitable for production use. Please refer to the documentation at https://stepzen.com/docs/deployment/local-docker for more information and examples.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dsn":{"name":"dsn","type":"option","description":"DSN of a StepZen metadata database, e.g. postgres://user:password@172.17.0.1:5432/zenctl"},"reset-auto":{"name":"reset-auto","type":"boolean","description":"Create fresh empty metadata database. Note: all existing endpoints will be deleted and you will be logged out.","allowNo":false},"prompt":{"name":"prompt","type":"boolean","description":"Opens an interactive prompt to ask for database details (or fails, if running in a non-interactive mode).","allowNo":false},"port":{"name":"port","type":"option","description":"Override the TCP port on which the local StepZen service instance will listen for connections (port 9000 by default)."}},"args":[{"name":"action","description":"\n \tstart\tstart a local StepZen service instance in a Docker container\n \t\tThis command pulls the latest StepZen service instance Docker image so that the\n \t\tversion of StepZen you run locally is the same as the one running on\n \t\tstepzen.net.\n \n \tstop\tstop the local StepZen service instance (if running)\n \t\tThis command deletes the Docker container with the StepZen service instance,\n \t\tbut all your endpoints are persistently stored in the metadata database. They\n \t\tremain available when running stepzen service start next time.\n \n \tupgrade\tupgrade the local StepZen service instance if it is running\n \t\tThis command checks if a newer version of the StepZen service instance Docker\n \t\timage is available, and if it is then stops and deletes the currently running\n \t\tcontainer, pulls the latest image, and starts it. All endpoints are preserved.\n\n If no action is provided, print the service status and exit.","required":false,"options":["start","stop","upgrade"]}]},"start":{"id":"start","description":"Deploy your schema to StepZen, and then redeploy on every change.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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"},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"config":{"name":"config","type":"option","hidden":true},"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":"[DEPRECATED] Upload a schema or a configuration set to StepZen.\nstepzen upload is deprecated in favor of stepzen deploy\nStepZen CLI is moving away from a two-step \"upload\" + \"deploy\" flow to a single-step \"deploy\" flow.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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"},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"Display your credentials.","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"account":{"name":"account","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false},"apikey":{"name":"apikey","type":"boolean","allowNo":false}},"args":[]}}}
1
+ {"version":"0.26.0-experimental.910b3ea","commands":{"deploy":{"id":"deploy","description":"Deploy to StepZen.","usage":"deploy [ENDPOINT] [--config=path/to/config.yaml] [--dir=path/to/workspace]\n\n-- OR (deprecated) --\n\n$ stepzen deploy ENDPOINT --schema=schema [--configurationsets=cs1[,cs2[,..]]]","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"Working directory"},"silent":{"name":"silent","type":"boolean","allowNo":false},"configurationsets":{"name":"configurationsets","type":"option","description":"\n Name(s) of configuration sets uploaded earlier with stepzen upload\n [DEPRECATED: this flag will be removed in future versions]\n \n Instead, please use one of these options:\n - stepzen deploy (without the --configurationsets flag)\n \tto use the configuration from the config.yaml file in the current directory (if exists)\n - stepzen deploy --config path/to/config.yaml\n \tto explicitly specify the configuration file"},"config":{"name":"config","type":"option","description":"[default: config.yaml] Configuration file to use (relative to the current directory)","helpValue":"path/to/config.yaml"},"schema":{"name":"schema","type":"option","description":"\n Name of a schema uploaded earlier with stepzen upload\n [DEPRECATED: this flag will be removed in future versions]\n \n Instead, please use one of these options:\n - stepzen deploy (without the --schema flag)\n \tto deploy the schema from a StepZen workspace in your current directory\n - stepzen deploy --dir path/to/workspace\n \tto deploy from a StepZen workspace in another folder"}},"args":[{"name":"endpoint","description":"name of the endpoint (e.g. api/customers)\n [default: use the endpoint property from stepzen.config.json]","required":false}]},"import":{"id":"import","description":"Import a schema for an external data source or an API endpoint to your GraphQL API.","usage":["import curl [[CURLOPTS] URL] [--prefix=PREFIX] [--header=HEADER] [--header-param=HEADER-PARAM] [--query-name=QUERY-NAME] [--query-type=QUERY-TYPE] [--path-params=PATH-PARAMS]","import graphql [URL] [--prefix=PREFIX] [--header=HEADER] [--header-param=HEADER-PARAM]","import mysql [--db-host=DB-HOST] [--db-user=DB-USER] [--db-password=DB-PASSWORD] [--db-database=DB-DATABASE] [--db-link-types] [--db-include=DB-INCLUDE]","import mysql://[USER:PASSWORD@]HOST[:PORT][/DATABASE] [--db-link-types] [--db-include=DB-INCLUDE]","import postgresql [--db-host=DB-HOST] [--db-user=DB-USER] [--db-password=DB-PASSWORD] [--db-database=DB-DATABASE] [--db-link-types] [--db-include=DB-INCLUDE] [--db-schema=DB-SCHEMA]","import postgresql://[USER:PASSWORD@]HOST[:PORT][/DATABASE] [--db-link-types] [--db-include=DB-INCLUDE] [--db-schema=DB-SCHEMA]"],"pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"Working directory"},"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 to 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 endpoint"},"query-type":{"name":"query-type","type":"option","description":"[curl] Name for the type returned by the curl request 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 and optional port (as HOST[:PORT])"},"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] PostgreSQL schema to import tables from (default: public)"}},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true}},"args":[]},"list":{"id":"list","description":"List endpoints, schemas and configuration sets in your StepZen account.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[{"name":"type","description":"\n \n The type of entities to list:\n \tendpoints - GraphQL API endpoints deployed with stepzen deploy (or stepzen start)\n \tschemas [DEPRECATED] - StepZen schemas uploaded with stepzen upload (or stepzen start)\n \tconfigurationsets [DEPRECATED] - StepZen configuration sets uploaded with stepzen upload (or stepzen start)","options":["endpoints","configurationsets","schemas"],"default":"endpoints"}]},"login":{"id":"login","description":"Log in to StepZen.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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}},"args":[]},"logout":{"id":"logout","description":"Log out of StepZen.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[]},"request":{"id":"request","description":"Send a GraphQL request to a StepZen endpoint and print the response, using the API key and the target endopint from the current StepZen workspace.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"StepZen workspace directory (defaults to the current directory)"},"endpoint":{"name":"endpoint","type":"option","description":"StepZen endpoint to call (defaults to the endpoint in current StepZen workspace)"},"var":{"name":"var","type":"option","description":"Add a request variable, in the name=value format.\n\nExample:\nstepzen request 'query OrdersQuery($search: String!, $limit: Int) {\n\t\torders(search: $search, limit: $limit) { id createdAt }\n\t}' \\\n\t--var 'search=space ninja' \\\n\t--var limit=5"},"var-file":{"name":"var-file","type":"option","description":"Read request variables from a JSON file\n\nExample:\nstepzen request 'query OrdersQuery($search: String!, $limit: Int) {\n\t\torders(search: $search, limit: $limit) { id createdAt }\n\t}' \\\n\t--var-file ./vars.json"}},"args":[{"name":"query","description":"GraphQL query (could include a query, a mutation or a subscription)","required":true}]},"service":{"id":"service","description":"Manage the local StepZen service instance (requires Docker).\nYou can use a local StepZen service instance instead of the StepZen cloud to develop and test GraphQL endpoints locally. This way you can try StepZen out without giving the StepZen cloud access to your data sources and API endpoints.\n\nLocal StepZen service instances are not suitable for production use. Please refer to the documentation at https://stepzen.com/docs/deployment/local-docker for more information and examples.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"dsn":{"name":"dsn","type":"option","description":"DSN of a StepZen metadata database, e.g. postgres://user:password@172.17.0.1:5432/zenctl"},"reset-auto":{"name":"reset-auto","type":"boolean","description":"Create fresh empty metadata database. Note: all existing endpoints will be deleted and you will be logged out.","allowNo":false},"prompt":{"name":"prompt","type":"boolean","description":"Opens an interactive prompt to ask for database details (or fails, if running in a non-interactive mode).","allowNo":false},"port":{"name":"port","type":"option","description":"Override the TCP port on which the local StepZen service instance will listen for connections (port 9000 by default)."}},"args":[{"name":"action","description":"\n \tstart\tstart a local StepZen service instance in a Docker container\n \t\tThis command pulls the latest StepZen service instance Docker image so that the\n \t\tversion of StepZen you run locally is the same as the one running on\n \t\tstepzen.net.\n \n \tstop\tstop the local StepZen service instance (if running)\n \t\tThis command deletes the Docker container with the StepZen service instance,\n \t\tbut all your endpoints are persistently stored in the metadata database. They\n \t\tremain available when running stepzen service start next time.\n \n \tupgrade\tupgrade the local StepZen service instance if it is running\n \t\tThis command checks if a newer version of the StepZen service instance Docker\n \t\timage is available, and if it is then stops and deletes the currently running\n \t\tcontainer, pulls the latest image, and starts it. All endpoints are preserved.\n\n If no action is provided, print the service status and exit.","required":false,"options":["start","stop","upgrade"]}]},"start":{"id":"start","description":"Deploy your schema to StepZen, and then redeploy on every change.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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"},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"config":{"name":"config","type":"option","hidden":true},"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":"[DEPRECATED] Upload a schema or a configuration set to StepZen.\nstepzen upload is deprecated in favor of stepzen deploy\nStepZen CLI is moving away from a two-step \"upload\" + \"deploy\" flow to a single-step \"deploy\" flow.","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"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"},"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":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"Display your credentials.","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help","allowNo":false},"non-interactive":{"name":"non-interactive","type":"boolean","description":"Disable all interactive prompts","hidden":true,"allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"account":{"name":"account","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false},"apikey":{"name":"apikey","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.25.0",
4
+ "version": "0.26.0-experimental.910b3ea",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -32,10 +32,10 @@
32
32
  "@oclif/errors": "^1.3.5",
33
33
  "@oclif/plugin-help": "^5.1.12",
34
34
  "@soluble/dsn-parser": "^1.6.0",
35
- "@stepzen/fetch": "^0.25.0",
36
- "@stepzen/graphiql-proxy": "^0.25.0",
37
- "@stepzen/sdk": "^0.25.0",
38
- "@stepzen/transpiler": "^0.25.0",
35
+ "@stepzen/fetch": "^0.26.0-experimental.910b3ea",
36
+ "@stepzen/graphiql-proxy": "^0.26.0-experimental.910b3ea",
37
+ "@stepzen/sdk": "^0.26.0-experimental.910b3ea",
38
+ "@stepzen/transpiler": "^0.26.0-experimental.910b3ea",
39
39
  "chalk": "^4.1.1",
40
40
  "chokidar": "^3.5.2",
41
41
  "compare-versions": "^3.6.0",
@@ -137,5 +137,5 @@
137
137
  "version": "oclif-dev readme && git add README.md"
138
138
  },
139
139
  "types": "lib/index.d.ts",
140
- "gitHead": "f2cdf04fc3fdbdaeeddb38002198bfda2b153064"
140
+ "gitHead": "910b3eaf3ed29c493250219621b17921d28efeda"
141
141
  }