stepzen 0.16.0 → 0.17.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.
@@ -1,12 +1,38 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getWorkspace = void 0;
4
+ exports.initWorkspace = exports.getWorkspace = exports.guessSchemaRoot = exports.generateWorkspaceName = exports.validateWorkspaceName = void 0;
5
5
  const errors_1 = require("@oclif/errors");
6
6
  const fs = require("fs");
7
+ const glob = require("glob");
8
+ const inquirer = require("inquirer");
7
9
  const os = require("os");
8
10
  const path = require("path");
11
+ const moniker_1 = require("../shared/moniker");
9
12
  const utils_1 = require("./utils");
13
+ exports.validateWorkspaceName = (directory, name) => {
14
+ return !fs.existsSync(path.join(directory, name));
15
+ };
16
+ exports.generateWorkspaceName = (directory) => {
17
+ let name = 'hello-stepzen';
18
+ while (!exports.validateWorkspaceName(directory, name)) {
19
+ name = `hello-${moniker_1.getRandomDescriptor()}-stepzen`;
20
+ }
21
+ return name;
22
+ };
23
+ exports.guessSchemaRoot = (directory) => {
24
+ const existing = [
25
+ ...glob.sync('*/**/config.yaml', {
26
+ cwd: directory,
27
+ ignore: '**/node_modules/**',
28
+ }),
29
+ ...glob.sync('*/**/index.graphql', {
30
+ cwd: directory,
31
+ ignore: '**/node_modules/**',
32
+ }),
33
+ ];
34
+ return existing.length > 0 ? path.dirname(existing[0]) : '';
35
+ };
10
36
  exports.getWorkspace = (directory) => {
11
37
  let workspaceRoot;
12
38
  const parts = path
@@ -54,3 +80,81 @@ exports.getWorkspace = (directory) => {
54
80
  schema: schema,
55
81
  };
56
82
  };
83
+ exports.initWorkspace = async (args) => {
84
+ // Get the correct directory
85
+ let directory = utils_1.getDirectory(args.directory);
86
+ // Make sure it is not already a workspace
87
+ if (exports.getWorkspace(directory)) {
88
+ throw new errors_1.CLIError(`This directory is already a StepZen workspace: ${directory}.` +
89
+ ' Please select a different directory.');
90
+ }
91
+ const isHomeDir = directory === os.homedir();
92
+ // Prevent init from running in the home directory if the directory was
93
+ // explicitly provided as an aargument to `stepzen init`.
94
+ // StepZen CLI sometimes would enumerate all files in the workspace folder
95
+ // doing so in the home directory is likely to fail.
96
+ if (args.directory && isHomeDir) {
97
+ throw new errors_1.CLIError('Using the home directory as a StepZen workspace is not supported.' +
98
+ ' Please select a different directory.');
99
+ }
100
+ // Make a suggestion for the workspace name (if running in the HOME
101
+ // directory)
102
+ const name = isHomeDir
103
+ ? exports.generateWorkspaceName(directory)
104
+ : path.basename(directory);
105
+ // See if we think there's a StepZen schema already
106
+ const root = isHomeDir ? '' : exports.guessSchemaRoot(directory);
107
+ // If you've passed an endpoint, validate it, and throw an error
108
+ // straight away if needed
109
+ if (args.endpoint) {
110
+ const error = utils_1.validateEndpoint(args.endpoint);
111
+ if (typeof error === 'string') {
112
+ throw new errors_1.CLIError(error);
113
+ }
114
+ }
115
+ // Make a suggestion for the endpoint
116
+ const endpoint = args.endpoint || `api/${moniker_1.default()}`;
117
+ // What questions will we ask?
118
+ const questions = [
119
+ {
120
+ default: name,
121
+ message: 'What would you like to call your workspace?',
122
+ name: 'name',
123
+ validate: (name) => exports.validateWorkspaceName(directory, name),
124
+ when: isHomeDir && !args.yes,
125
+ },
126
+ {
127
+ default: endpoint,
128
+ message: 'What would you like your endpoint to be called?',
129
+ name: 'endpoint',
130
+ validate: utils_1.validateEndpoint,
131
+ when: !args.endpoint && !args.yes,
132
+ },
133
+ {
134
+ message: `We have detected a schema in this directory. Set the schema root to "${root}"?`,
135
+ name: 'use-root',
136
+ type: 'confirm',
137
+ when: Boolean(root) && !args.yes,
138
+ },
139
+ ];
140
+ // Get the answers
141
+ const answers = Object.assign({ name,
142
+ endpoint, 'use-root': true }, (await inquirer.prompt(questions)));
143
+ // Append the suggested workspace name to the directory (if running
144
+ // in the HOME directory)
145
+ if (isHomeDir) {
146
+ // eslint-disable-next-line require-atomic-updates
147
+ directory = path.join(directory, answers.name);
148
+ fs.mkdirSync(directory);
149
+ }
150
+ // Create the workspace
151
+ const workspace = { endpoint: answers.endpoint };
152
+ if (root && answers['use-root'])
153
+ workspace.root = root;
154
+ // Write the file
155
+ const file = path.join(directory, 'stepzen.config.json');
156
+ fs.writeFileSync(file, JSON.stringify(workspace, null, ' '));
157
+ // Fetch the newly created workspace
158
+ const created = exports.getWorkspace(directory);
159
+ return created;
160
+ };
@@ -1,5 +1,5 @@
1
1
  import { Command } from '@oclif/command';
2
- import { MachineConfiguration, StepZenCredentials } from './types';
2
+ import { MachineConfiguration, StepZenCredentials, Workspace } 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>;
@@ -7,6 +7,10 @@ export declare abstract class ZenCommand extends Command {
7
7
  ensureStepZenAccount(): Promise<{
8
8
  configuration: import("./types").LoggedInMachineConfiguration;
9
9
  }>;
10
+ ensureStepZenWorkspace(options?: {
11
+ directory?: string;
12
+ endpoint?: string;
13
+ }): Promise<Workspace>;
10
14
  promptUserToLogIn(uuid: string): Promise<{
11
15
  configuration: MachineConfiguration & StepZenCredentials;
12
16
  }>;
@@ -3,10 +3,14 @@
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");
6
7
  const inquirer = require("inquirer");
7
8
  const chalk = require("chalk");
9
+ const process = require("process");
8
10
  const configuration_1 = require("./configuration");
9
11
  const stepzen_sdk_1 = require("./stepzen-sdk");
12
+ const utils_1 = require("./utils");
13
+ const workspace_1 = require("./workspace");
10
14
  class ZenCommand extends command_1.Command {
11
15
  async ensureStepZenAccount() {
12
16
  const configuration = await configuration_1.readConfiguration();
@@ -17,6 +21,29 @@ class ZenCommand extends command_1.Command {
17
21
  }
18
22
  return this.promptUserToLogIn(configuration.uuid);
19
23
  }
24
+ async ensureStepZenWorkspace(options = {}) {
25
+ let workspace;
26
+ const directory = utils_1.getDirectory(options.directory);
27
+ const maybeWorkspace = workspace_1.getWorkspace(directory);
28
+ if (maybeWorkspace) {
29
+ workspace = maybeWorkspace;
30
+ }
31
+ else {
32
+ try {
33
+ workspace = await workspace_1.initWorkspace({ directory, endpoint: options.endpoint });
34
+ }
35
+ catch (error) {
36
+ throw new errors_1.CLIError(`Could not create a StepZen workspace in the ${options.directory ? directory : 'current'} directory.\n` + error.message);
37
+ }
38
+ }
39
+ // Emphasize that the workspace is not the _current_ directory.
40
+ if (workspace.directory !== process.cwd()) {
41
+ this.log();
42
+ this.log(` ⤴️ Using the StepZen workspace in ${chalk.blue(utils_1.homeRelative(workspace.directory))}`);
43
+ this.log();
44
+ }
45
+ return workspace;
46
+ }
20
47
  async promptUserToLogIn(uuid) {
21
48
  this.log(chalk.bold(chalk.cyan('Welcome to the StepZen CLI!')));
22
49
  this.log('');
@@ -1,2 +1,11 @@
1
- declare const _default: (workspace: any) => Promise<void>;
2
- export default _default;
1
+ import { Workspace } from '../shared/types';
2
+ export declare const watching: (workspace: Workspace) => void;
3
+ export declare const changed: ({ file, workspace, }: {
4
+ file: string;
5
+ workspace: Workspace;
6
+ }) => void;
7
+ export declare const success: ({ workspace, account, port, }: {
8
+ workspace: Workspace;
9
+ account: string;
10
+ port: number;
11
+ }) => void;
@@ -1,16 +1,44 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.success = exports.changed = exports.watching = void 0;
4
5
  const chalk = require("chalk");
5
- const fs = require("fs");
6
- const os = require("os");
7
- const path = require("path");
8
- exports.default = async (workspace) => {
9
- const cwd = workspace.schema.replace(os.homedir(), '~');
10
- const config = path.join(cwd, 'config.yaml');
6
+ const utils_1 = require("../shared/utils");
7
+ const constants_1 = require("../shared/constants");
8
+ exports.watching = (workspace) => {
9
+ console.log(`Watching ${chalk.blue(utils_1.homeRelative(workspace.schema))} for changes...`);
10
+ };
11
+ exports.changed = ({ file, workspace, }) => {
12
+ console.log(`File changed: ${chalk.blue(utils_1.workspaceRelative(file, workspace.directory))}`);
13
+ };
14
+ exports.success = ({ workspace, account, port, }) => {
15
+ const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
16
+ const url = `https://${account}.${domain}/${workspace.endpoint}/__graphql`;
11
17
  console.log();
12
- if (fs.existsSync(config)) {
13
- console.log(`Watching ${chalk.blue(config)} for configuration changes...`);
18
+ if (process.platform === 'win32') {
19
+ console.log(chalk.grey(`In PowerShell you can test your hosted API with Invoke-WebRequest:`));
20
+ console.log();
21
+ console.log(`Invoke-WebRequest \``);
22
+ console.log(` -Uri ${url} \``);
23
+ console.log(` -Method "POST" \``);
24
+ console.log(` -Headers @{`);
25
+ console.log(` "Content-Type" = "application/json"`);
26
+ console.log(` "Authorization" = "APIKey $(stepzen whoami --apikey)"`);
27
+ console.log(` } \``);
28
+ console.log(` -Body (@{`);
29
+ console.log(` "query" = '${chalk.bgYellow.black('your graphql query')}'`);
30
+ console.log(` } | ConvertTo-Json)`);
31
+ }
32
+ else {
33
+ console.log(chalk.grey(`You can test your hosted API with cURL:`));
34
+ console.log();
35
+ console.log(`curl ${url} \\`);
36
+ console.log(` --header "Authorization: Apikey $(stepzen whoami --apikey)" \\`);
37
+ console.log(` --header "Content-Type: application/json" \\`);
38
+ console.log(` --data '{"query": "${chalk.bgYellow.black('your graphql query')}"}'`);
14
39
  }
15
- console.log(`Watching ${chalk.blue(cwd)} for GraphQL changes...`);
40
+ console.log();
41
+ console.log(chalk.grey(`or explore it with GraphiQL at http://localhost:${port}/${workspace.endpoint}`));
42
+ console.log();
43
+ console.log(chalk.grey(`Your API url is ${chalk.green(url)}`));
16
44
  };
@@ -1,2 +1,6 @@
1
- declare const _default: (file: string | null, workspace: any, flags: any) => Promise<void>;
1
+ import { Workspace } from '../shared/types';
2
+ declare const _default: ({ workspace, flags, }: {
3
+ workspace: Workspace;
4
+ flags: Record<string, any>;
5
+ }) => Promise<void>;
2
6
  export default _default;
@@ -4,22 +4,16 @@ const tslib_1 = require("tslib");
4
4
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
5
5
  const chalk = require("chalk");
6
6
  const core_1 = require("@oclif/core");
7
+ const dotenv = require("dotenv");
7
8
  const fs = require("fs-extra");
8
9
  const path = require("path");
9
10
  const prettyMilliseconds = require("pretty-ms");
10
11
  const deploy_1 = require("../commands/deploy");
11
- const configuration_1 = require("../shared/configuration");
12
- const constants_1 = require("../shared/constants");
13
12
  const upload_1 = require("../commands/upload");
14
13
  const validate_1 = require("../commands/validate");
15
- const dotenv = require('dotenv');
16
- exports.default = async (file, workspace, flags) => {
14
+ exports.default = async ({ workspace, flags, }) => {
17
15
  var e_1, _a;
18
16
  dotenv.config({ path: path.join(workspace.directory, '.env') });
19
- if (file) {
20
- console.log(`File changed: ${chalk.blue(file)}`);
21
- }
22
- const configuration = (await configuration_1.readConfiguration());
23
17
  if (!flags['no-validate']) {
24
18
  try {
25
19
  await validate_1.default.run([workspace.schema]);
@@ -101,22 +95,4 @@ exports.default = async (file, workspace, flags) => {
101
95
  const deployEnd = new Date().getTime();
102
96
  const deployTime = deployEnd - deployStart;
103
97
  core_1.CliUx.ux.action.stop(`${chalk.grey('done in')} ${prettyMilliseconds(deployTime)} 🚀`);
104
- const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
105
- const endpoint = `https://${configuration.account}.${domain}/${workspace.endpoint}/__graphql`;
106
- console.log();
107
- console.log(chalk.grey(`Your API url is`, chalk.green(` ${endpoint}`)));
108
- console.log();
109
- if (process.platform === 'win32') {
110
- console.log(chalk.grey(`You can explore your hosted API with GraphiQL at `), chalk.green(` http://localhost:${flags.port}/${workspace.endpoint}`));
111
- }
112
- else {
113
- console.log(chalk.grey(`You can test your hosted API with cURL:`));
114
- console.log();
115
- console.log(`curl ${endpoint} \\`);
116
- console.log(` --header "Authorization: Apikey $(stepzen whoami --apikey)" \\`);
117
- console.log(` --header "Content-Type: application/json" \\`);
118
- console.log(` --data '{"query": "your graphql query"}'`);
119
- console.log();
120
- console.log(chalk.grey(`or explore it with GraphiQL at`), chalk.green(` http://localhost:${flags.port}/${workspace.endpoint}`));
121
- }
122
98
  };
@@ -1,3 +1,2 @@
1
- import console from './console';
2
- import deploy from './deploy';
3
- export { console, deploy };
1
+ export { default as deploy } from './deploy';
2
+ export { changed, success, watching } from './console';
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.deploy = exports.console = void 0;
5
- const console_1 = require("./console");
6
- exports.console = console_1.default;
7
- const deploy_1 = require("./deploy");
8
- exports.deploy = deploy_1.default;
4
+ var deploy_1 = require("./deploy");
5
+ Object.defineProperty(exports, "deploy", { enumerable: true, get: function () { return deploy_1.default; } });
6
+ var console_1 = require("./console");
7
+ Object.defineProperty(exports, "changed", { enumerable: true, get: function () { return console_1.changed; } });
8
+ Object.defineProperty(exports, "success", { enumerable: true, get: function () { return console_1.success; } });
9
+ Object.defineProperty(exports, "watching", { enumerable: true, get: function () { return console_1.watching; } });
@@ -1 +1 @@
1
- {"version":"0.16.0","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"configurationsets":{"name":"configurationsets","type":"option","description":"Configurationsets to use","default":""},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"schema":{"name":"schema","type":"option","description":"Schema to use","required":true},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"destination","description":"destination","required":true}]},"import":{"id":"import","description":"import a schema for an external data source or a API endpoint to your GraphQL API","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"working directory"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","hidden":true,"allowNo":false},"name":{"name":"name","type":"option","description":"subfolder inside the workspace folder to save the imported schema files, 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'"},"header-param":{"name":"header-param","type":"option","description":"[curl] 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'"},"db-host":{"name":"db-host","type":"option","description":"[mysql, postgresql] database host"},"db-user":{"name":"db-user","type":"option","description":"[mysql, postgresql] database user name"},"db-password":{"name":"db-password","type":"option","description":"[mysql, postgresql] database password"},"db-database":{"name":"db-database","type":"option","description":"[mysql, postgresql] name of database to import"},"db-schema":{"name":"db-schema","type":"option","description":"[postgresql] database schema"}},"args":[{"name":"schema","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"yes":{"name":"yes","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"directory","hidden":true}]},"lint":{"id":"lint","description":"StepZen lint","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"list":{"id":"list","description":"list your items","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationsets","schemas"]}]},"login":{"id":"login","description":"log in to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"account":{"name":"account","type":"option","char":"a","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":"display your credentials with StepZen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"apikey":{"name":"apikey","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false}},"args":[]}}}
1
+ {"version":"0.17.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 to. Defaults to the name of the imported schema."},"overwrite":{"name":"overwrite","type":"boolean","description":"Overwrite any existing schema with the same name. Cannot be used without also providing a --name flag.","hidden":true,"allowNo":false},"prefix":{"name":"prefix","type":"option","description":"[curl, graphql] prefix to add every type in the generated schema."},"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'"},"header-param":{"name":"header-param","type":"option","description":"[curl] 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'"},"db-host":{"name":"db-host","type":"option","description":"[mysql, postgresql] database host"},"db-user":{"name":"db-user","type":"option","description":"[mysql, postgresql] database user name"},"db-password":{"name":"db-password","type":"option","description":"[mysql, postgresql] database password"},"db-database":{"name":"db-database","type":"option","description":"[mysql, postgresql] name of database to import"},"db-schema":{"name":"db-schema","type":"option","description":"[postgresql] database schema"}},"args":[{"name":"schema","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"endpoint":{"name":"endpoint","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"yes":{"name":"yes","type":"boolean","hidden":true,"allowNo":false}},"args":[{"name":"directory","hidden":true}]},"lint":{"id":"lint","description":"StepZen lint","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"list":{"id":"list","description":"list your items","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationsets","schemas"]}]},"login":{"id":"login","description":"log in to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"account":{"name":"account","type":"option","char":"a","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-validate":{"name":"no-validate","type":"boolean","hidden":true,"allowNo":false},"no-watcher":{"name":"no-watcher","type":"boolean","hidden":true,"allowNo":false},"port":{"name":"port","type":"option","default":5001}},"args":[]},"transpile":{"id":"transpile","description":"transpile a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"config":{"name":"config","type":"option","hidden":true},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"hide-output":{"name":"hide-output","type":"boolean","hidden":true,"allowNo":false},"inspect":{"name":"inspect","type":"boolean","char":"i","hidden":true,"allowNo":false},"inspect-after":{"name":"inspect-after","type":"boolean","hidden":true,"allowNo":false},"output-configuration":{"name":"output-configuration","type":"boolean","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"folder","required":true}]},"upload":{"id":"upload","description":"upload to StepZen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"dir":{"name":"dir","type":"option","description":"A directory to upload"},"file":{"name":"file","type":"option","description":"A file to upload"},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"silent":{"name":"silent","type":"boolean","allowNo":false}},"args":[{"name":"type","description":"type","required":true,"options":["configurationset","schema"]},{"name":"destination","description":"destination","required":true}]},"validate":{"id":"validate","description":"validate a graphql schema","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"folder","required":true}]},"whoami":{"id":"whoami","description":"display your credentials with StepZen whoami","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"non-interactive":{"name":"non-interactive","type":"boolean","description":"disable all interactive prompts","hidden":true,"allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false},"apikey":{"name":"apikey","type":"boolean","allowNo":false},"adminkey":{"name":"adminkey","type":"boolean","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stepzen",
3
3
  "description": "The StepZen CLI",
4
- "version": "0.16.0",
4
+ "version": "0.17.0-beta.2",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -32,8 +32,8 @@
32
32
  "@oclif/errors": "1.3.5",
33
33
  "@oclif/plugin-help": "^5.1.12",
34
34
  "@stepzen/dashboard": "0.2.0",
35
- "@stepzen/sdk": "0.11.2",
36
- "@stepzen/transpiler": "0.0.39",
35
+ "@stepzen/sdk": "0.11.3",
36
+ "@stepzen/transpiler": "0.2.0",
37
37
  "chalk": "^4.1.1",
38
38
  "chokidar": "^3.5.2",
39
39
  "compare-versions": "^3.6.0",