stepzen 0.9.36-beta.5 → 0.9.38-beta.0

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.9.36-beta.5 darwin-x64 node-v14.18.0
32
+ stepzen/0.9.38-beta.0 darwin-x64 node-v14.18.3
33
33
  $ stepzen --help [COMMAND]
34
34
  USAGE
35
35
  $ stepzen COMMAND
@@ -136,7 +136,7 @@ OPTIONS
136
136
 
137
137
  ## `stepzen start`
138
138
 
139
- start stepzen dashboard
139
+ upload and deploy your schema
140
140
 
141
141
  ```
142
142
  USAGE
@@ -24,7 +24,12 @@ class Import extends command_1.Command {
24
24
  workspace = await init_1.default.run([directory]);
25
25
  }
26
26
  // Make sure the user has latest Generator Schema
27
- await deploy_1.default.run([constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA, '--schema', 'stepzen/engines', '--silent']);
27
+ await deploy_1.default.run([
28
+ constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
29
+ '--schema',
30
+ constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
31
+ '--silent',
32
+ ]);
28
33
  // Let's go!
29
34
  const result = await generate_1.default(schemas, workspace.schema);
30
35
  // Validate
@@ -29,8 +29,14 @@ class Init extends command_1.Command {
29
29
  // See if we think there's a StepZen schema already
30
30
  let root;
31
31
  const existing = [
32
- ...glob.sync('*/**/config.yaml', { cwd: directory, ignore: '**/node_modules/**' }),
33
- ...glob.sync('*/**/index.graphql', { cwd: directory, ignore: '**/node_modules/**' }),
32
+ ...glob.sync('*/**/config.yaml', {
33
+ cwd: directory,
34
+ ignore: '**/node_modules/**',
35
+ }),
36
+ ...glob.sync('*/**/index.graphql', {
37
+ cwd: directory,
38
+ ignore: '**/node_modules/**',
39
+ }),
34
40
  ];
35
41
  if (existing.length > 0) {
36
42
  root = existing[0]
@@ -65,7 +65,7 @@ class Start extends command_1.Command {
65
65
  await start_1.deploy(null, workspace, flags);
66
66
  }
67
67
  // Create the dashboard
68
- if (!flags['no-dashboard']) {
68
+ if (flags['local-proxy']) {
69
69
  const ui = await dashboard({
70
70
  account: configuration.account,
71
71
  adminkey: configuration.adminkey,
@@ -91,13 +91,13 @@ class Start extends command_1.Command {
91
91
  }
92
92
  }
93
93
  exports.default = Start;
94
- Start.description = 'start stepzen dashboard';
94
+ Start.description = 'upload and deploy your schema';
95
95
  Start.flags = {
96
96
  dir: command_1.flags.string({ description: 'working directory' }),
97
97
  endpoint: command_1.flags.string({ description: 'Override workspace endpoint' }),
98
98
  help: command_1.flags.help({ char: 'h' }),
99
99
  'no-console': command_1.flags.boolean({ hidden: true }),
100
- 'no-dashboard': command_1.flags.boolean({ hidden: true }),
100
+ 'local-proxy': command_1.flags.boolean({ hidden: true }),
101
101
  'no-init': command_1.flags.boolean({ hidden: true }),
102
102
  'no-server': command_1.flags.boolean({ hidden: true }),
103
103
  'no-validate': command_1.flags.boolean({ hidden: true }),
@@ -9,9 +9,14 @@ const deploy_1 = require("../commands/deploy");
9
9
  const constants_1 = require("../shared/constants");
10
10
  const { merge } = require('@stepzen/transpiler');
11
11
  exports.createDashboardInterface = (workspace) => ({
12
- endpoint: constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
12
+ endpoint: constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
13
13
  onStart: async () => {
14
- await deploy_1.default.run([constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA, '--schema', 'stepzen/engines', '--silent']);
14
+ await deploy_1.default.run([
15
+ constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT,
16
+ '--schema',
17
+ constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA,
18
+ '--silent',
19
+ ]);
15
20
  },
16
21
  onImport: async (id, files) => {
17
22
  const tmp = path.join(os.tmpdir(), `stepzen-generated-schema-${Date.now()}`);
@@ -15,7 +15,7 @@ const { version } = require('../../package.json');
15
15
  exports.createGeneratorFiles = async (id, details) => {
16
16
  const config = configuration_1.readConfiguration();
17
17
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
18
- const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA}/__graphql`;
18
+ const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT}/__graphql`;
19
19
  const response = await node_fetch_1.default(url, {
20
20
  body: JSON.stringify({
21
21
  query: `
@@ -35,7 +35,7 @@ exports.createGeneratorFiles = async (id, details) => {
35
35
  },
36
36
  method: 'POST',
37
37
  });
38
- const { data: { create } } = await response.json();
38
+ const { data: { create }, } = await response.json();
39
39
  const tmp = path.join(os.tmpdir(), `stepzen-generated-schema-${Date.now()}`);
40
40
  fs.ensureDirSync(tmp);
41
41
  for (const file of create) {
@@ -47,7 +47,7 @@ exports.createGeneratorFiles = async (id, details) => {
47
47
  exports.getConfiguration = async (id, details = {}) => {
48
48
  const config = configuration_1.readConfiguration();
49
49
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
50
- const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_SCHEMA}/__graphql`;
50
+ const url = `https://${config.account}.${domain}/${constants_1.STEPZEN_GENERATOR_ENGINES_ENDPOINT}/__graphql`;
51
51
  const response = await node_fetch_1.default(url, {
52
52
  body: JSON.stringify({
53
53
  query: `
@@ -70,11 +70,13 @@ exports.default = async (schemas, source) => {
70
70
  cli_ux_1.default.action.stop();
71
71
  console.log();
72
72
  // If you've tried to import non-existent templates, complain and exit
73
- const notFound = Object.entries(generators).map(([id, settings]) => {
73
+ const notFound = Object.entries(generators)
74
+ .map(([id, settings]) => {
74
75
  if (!settings)
75
76
  return id;
76
77
  return null;
77
- }).filter(i => i);
78
+ })
79
+ .filter(i => i);
78
80
  if (notFound.length > 0) {
79
81
  fs.removeSync(templates);
80
82
  throw new Error(`Cannot find the schema ${notFound[0]}`);
@@ -0,0 +1,3 @@
1
+ import { Hook } from '@oclif/config';
2
+ declare const hook: Hook<'prerun'>;
3
+ export default hook;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const constants_1 = require("../../shared/constants");
7
+ const constants_2 = require("../../shared/constants");
8
+ const hook = async function () {
9
+ // checking file existence and permissions (https://betterprogramming.pub/dbce0f2b373c)
10
+ const file = path.join(constants_2.STEPZEN_CONFIG_DIRECTORY, constants_1.STEPZEN_CONFIG_FILE);
11
+ try {
12
+ fs.accessSync(file, fs.constants.F_OK | fs.constants.R_OK | fs.constants.W_OK);
13
+ const mode = fs.statSync(file).mode;
14
+ // https://stackoverflow.com/questions/50839744/how-to-interpret-the-number-returned-from-statsync
15
+ if (mode & (fs.constants.S_IRWXG | fs.constants.S_IRWXG))
16
+ fs.chmodSync(file, fs.constants.S_IRWXU);
17
+ }
18
+ catch (error) { }
19
+ };
20
+ exports.default = hook;
@@ -85,6 +85,6 @@ exports.writeConfigurationToLoginFile = (configuration) => {
85
85
  }
86
86
  // Write the configuration file. Overwrites if it already exists.
87
87
  const file = path.join(constants_1.STEPZEN_CONFIG_DIRECTORY, constants_1.STEPZEN_CONFIG_FILE);
88
- fs.writeFileSync(file, content);
88
+ fs.writeFileSync(file, content, { mode: '600' });
89
89
  return configuration;
90
90
  };
@@ -3,7 +3,8 @@ export declare const STEPZEN_CONFIG_DIRECTORY: string;
3
3
  export declare const STEPZEN_CONFIG_FILE: string;
4
4
  export declare const STEPZEN_DOMAIN: string;
5
5
  export declare const STEPZEN_SERVER_URL: string;
6
- export declare const STEPZEN_GENERATOR_ENGINES_SCHEMA = "stepzen-generator/engines";
6
+ export declare const STEPZEN_GENERATOR_ENGINES_SCHEMA: string;
7
+ export declare const STEPZEN_GENERATOR_ENGINES_ENDPOINT = "stepzen-generator/engines";
7
8
  export declare const STEPZEN_API_TEMPLATES_REPOSITORY = "https://github.com/steprz/stepzen-schemas";
8
9
  export declare const ADMIN_ACCOUNT_URL = "/cli/admin/account";
9
10
  export declare const ADMIN_DEPLOY_URL = "/cli/admin/deploy";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Copyright (c) 2020,2021,2022, StepZen, Inc.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ADMIN_VERIFY_URL = exports.ADMIN_UPLOAD_URL = exports.ADMIN_LIST_URL = exports.ADMIN_DEPLOY_URL = exports.ADMIN_ACCOUNT_URL = exports.STEPZEN_API_TEMPLATES_REPOSITORY = exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = exports.STEPZEN_SERVER_URL = exports.STEPZEN_DOMAIN = exports.STEPZEN_CONFIG_FILE = exports.STEPZEN_CONFIG_DIRECTORY = exports.STEPZEN_CONFIG_CONTENT = void 0;
4
+ exports.ADMIN_VERIFY_URL = exports.ADMIN_UPLOAD_URL = exports.ADMIN_LIST_URL = exports.ADMIN_DEPLOY_URL = exports.ADMIN_ACCOUNT_URL = exports.STEPZEN_API_TEMPLATES_REPOSITORY = exports.STEPZEN_GENERATOR_ENGINES_ENDPOINT = exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = exports.STEPZEN_SERVER_URL = exports.STEPZEN_DOMAIN = exports.STEPZEN_CONFIG_FILE = exports.STEPZEN_CONFIG_DIRECTORY = exports.STEPZEN_CONFIG_CONTENT = void 0;
5
5
  // This file contains constants and all magic strings
6
6
  const dotenv = require("dotenv");
7
7
  const os = require("os");
@@ -9,7 +9,7 @@ const path = require("path");
9
9
  // This allows you to set environment variables in a `.env` file.
10
10
  // This file needs to be in your working directory.
11
11
  dotenv.config();
12
- const { STEPZEN_CONFIG_CONTENT: ENV_VAR_STEPZEN_CONFIG_CONTENT, STEPZEN_CONFIG_FILE: ENV_VAR_STEPZEN_CONFIG_FILE, STEPZEN_DOMAIN: ENV_VAR_STEPZEN_DOMAIN, STEPZEN_SERVER_URL: ENV_VAR_STEPZEN_SERVER_URL, } = process.env;
12
+ const { STEPZEN_CONFIG_CONTENT: ENV_VAR_STEPZEN_CONFIG_CONTENT, STEPZEN_CONFIG_FILE: ENV_VAR_STEPZEN_CONFIG_FILE, STEPZEN_DOMAIN: ENV_VAR_STEPZEN_DOMAIN, STEPZEN_GENERATOR_ENGINES_SCHEMA: ENV_VAR_STEPZEN_GENERATOR_ENGINES_SCHEMA, STEPZEN_SERVER_URL: ENV_VAR_STEPZEN_SERVER_URL, } = process.env;
13
13
  // Where your authentication details are stored locally
14
14
  exports.STEPZEN_CONFIG_CONTENT = ENV_VAR_STEPZEN_CONFIG_CONTENT;
15
15
  exports.STEPZEN_CONFIG_DIRECTORY = path.join(os.homedir(), '.stepzen');
@@ -18,8 +18,11 @@ exports.STEPZEN_CONFIG_FILE = ENV_VAR_STEPZEN_CONFIG_FILE || 'stepzen-config.yam
18
18
  exports.STEPZEN_DOMAIN = ENV_VAR_STEPZEN_DOMAIN || 'stepzen.io';
19
19
  // The zenctl URL. Override with the env var `STEPZEN_SERVER_URL`
20
20
  exports.STEPZEN_SERVER_URL = ENV_VAR_STEPZEN_SERVER_URL || 'https://{account}.stepzen.io';
21
- // Generator Engines schema folder/name
22
- exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = 'stepzen-generator/engines';
21
+ // Generator Engines schema: folder/name
22
+ // Use 'stepzen/engines-dev' to test the dev instance of https://github.com/steprz/generator-engines
23
+ exports.STEPZEN_GENERATOR_ENGINES_SCHEMA = ENV_VAR_STEPZEN_GENERATOR_ENGINES_SCHEMA || 'stepzen/engines';
24
+ // Generator Engines schema: target API endpoint
25
+ exports.STEPZEN_GENERATOR_ENGINES_ENDPOINT = 'stepzen-generator/engines';
23
26
  // API Templates repository
24
27
  exports.STEPZEN_API_TEMPLATES_REPOSITORY = 'https://github.com/steprz/stepzen-schemas';
25
28
  // Paths to the endpoints used
@@ -16,7 +16,7 @@ exports.default = async (workspace, flags) => {
16
16
  console.log(`Watching ${chalk.blue(config)} for configuration changes`);
17
17
  }
18
18
  console.log(`Watching ${chalk.blue(cwd)} for GraphQL changes`);
19
- if (!flags['no-dashboard']) {
19
+ if (flags['local-proxy']) {
20
20
  console.log();
21
21
  cli_ux_1.default.url(`Running StepZen at http://localhost:${flags.port}/${workspace.endpoint}`, `http://localhost:${flags.port}/${workspace.endpoint}`);
22
22
  }
@@ -39,14 +39,26 @@ exports.default = async (file, workspace, flags) => {
39
39
  const configPath = path.join(workspace.schema, 'config.yaml');
40
40
  if (fs.existsSync(configPath)) {
41
41
  deployArgs.push('--configurationsets', `${workspace.endpoint},stepzen/default`);
42
- uploadCmds.push(['configurationset', workspace.endpoint, '--file', configPath, '--silent']);
42
+ uploadCmds.push([
43
+ 'configurationset',
44
+ workspace.endpoint,
45
+ '--file',
46
+ configPath,
47
+ '--silent',
48
+ ]);
43
49
  }
44
50
  else {
45
51
  deployArgs.push('--configurationsets', 'stepzen/default');
46
52
  }
47
53
  if (fs.existsSync(workspace.schema)) {
48
54
  deployArgs.push('--schema', workspace.endpoint);
49
- uploadCmds.push(['schema', workspace.endpoint, '--dir', workspace.schema, '--silent']);
55
+ uploadCmds.push([
56
+ 'schema',
57
+ workspace.endpoint,
58
+ '--dir',
59
+ workspace.schema,
60
+ '--silent',
61
+ ]);
50
62
  }
51
63
  const logError = (error) => {
52
64
  try {
@@ -93,6 +105,33 @@ exports.default = async (file, workspace, flags) => {
93
105
  console.log(chalk.green(`Successfully deployed ${what} at ${when}`));
94
106
  const domain = constants_1.STEPZEN_DOMAIN.replace('.io', '.net');
95
107
  const endpoint = `https://${configuration.account}.${domain}/${workspace.endpoint}/__graphql`;
96
- console.log();
97
- console.log(chalk.grey(`Your endpoint is available at ${endpoint}`));
108
+ let firstProxyLine = '';
109
+ let secondProxyLine = '';
110
+ if (flags['local-proxy']) {
111
+ firstProxyLine = `Explore your deployed GraphQL endpoint at a local proxy with GraphiQL:`;
112
+ secondProxyLine = ` http://localhost:${flags.port}/${workspace.endpoint}`;
113
+ }
114
+ else {
115
+ firstProxyLine = '';
116
+ secondProxyLine = '';
117
+ }
118
+ if (configuration.apikey) {
119
+ const parts = configuration.apikey.split('::');
120
+ const key = parts[2];
121
+ const firstTwoChars = key.substring(0, 2);
122
+ const lastTwoChars = key.slice(-2);
123
+ const masked = `${firstTwoChars}***${lastTwoChars}`;
124
+ const masked_apikey = `${parts[0]}::${parts[1]}::${masked}`;
125
+ console.log();
126
+ console.log(chalk.grey(`Your GraphQL schema is deployed to`, chalk.green(` ${endpoint}`)));
127
+ console.log();
128
+ console.log(chalk.grey(`You can test your endpoint with cURL:`));
129
+ console.log();
130
+ console.log(`curl ${endpoint} \\`);
131
+ console.log(` --header "Authorization: Apikey ${masked_apikey}" \\`);
132
+ console.log(` --header "Content-Type: application/json" \\`);
133
+ console.log(` --data '{"query": "your graphql query"}' \\`);
134
+ console.log();
135
+ console.log(chalk.grey(firstProxyLine), chalk.green(secondProxyLine));
136
+ }
98
137
  };
@@ -1,3 +1,3 @@
1
1
  import console from './console';
2
2
  import deploy from './deploy';
3
- export { console, deploy, };
3
+ export { console, deploy };
@@ -1 +1 @@
1
- {"version":"0.9.36-beta.5","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"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 schemas from stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"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}},"args":[{"name":"schemas","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"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":{"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":{"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":{"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":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start":{"id":"start","description":"start stepzen dashboard","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"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":{"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":{"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":{"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":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","type":"boolean","allowNo":false}},"args":[]}}}
1
+ {"version":"0.9.38-beta.0","commands":{"deploy":{"id":"deploy","description":"deploy to stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"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 schemas from stepzen","pluginName":"stepzen","pluginType":"core","aliases":[],"flags":{"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}},"args":[{"name":"schemas","required":true}]},"init":{"id":"init","description":"stepzen init","pluginName":"stepzen","pluginType":"core","hidden":true,"aliases":[],"flags":{"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":{"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":{"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":{"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":{"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":{"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},"local-proxy":{"name":"local-proxy","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":{"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":{"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":{"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":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"showkeys":{"name":"showkeys","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.9.36-beta.5",
4
+ "version": "0.9.38-beta.0",
5
5
  "license": "MIT",
6
6
  "author": "Darren Waddell <darren@stepzen.com>",
7
7
  "contributors": [
@@ -29,37 +29,25 @@
29
29
  "@oclif/command": "^1.8.0",
30
30
  "@oclif/config": "^1.17.1",
31
31
  "@oclif/plugin-help": "^5.1.10",
32
- "@stepzen/dashboard": "0.1.35",
32
+ "@stepzen/dashboard": "0.1.36",
33
33
  "@stepzen/sdk": "0.9.42",
34
34
  "@stepzen/transpiler": "0.0.34",
35
- "@types/archiver": "^3.1.1",
36
- "@types/debug": "^4.1.6",
37
- "@types/node-fetch": "^2.5.7",
38
- "archiver": "^5.0.2",
39
35
  "chalk": "^4.1.1",
40
36
  "chokidar": "^3.5.2",
41
37
  "cli-ux": "^6.0.8",
42
38
  "compare-versions": "^3.6.0",
43
- "cors": "^2.8.5",
44
- "cross-spawn": "^7.0.3",
45
39
  "date-fns": "^2.26.0",
46
40
  "debug": "^4.3.0",
47
41
  "detect-port": "^1.3.0",
48
42
  "dotenv": "^8.6.0",
49
- "express": "^4.17.1",
50
- "form-data": "^3.0.0",
51
43
  "fs-extra": "^9.1.0",
52
44
  "glob": "^7.1.7",
53
- "graphql": "^15.7.2",
54
45
  "inquirer": "^7.3.3",
55
46
  "lodash": "^4.17.21",
56
47
  "node-fetch": "^2.6.6",
57
- "open": "^7.3.0",
58
48
  "prettier": "^2.4.1",
59
49
  "shelljs": "^0.8.5",
60
50
  "throttle-debounce": "^3.0.1",
61
- "tslib": "^1.14.1",
62
- "unzipper": "^0.10.11",
63
51
  "yaml": "^1.10.0"
64
52
  },
65
53
  "devDependencies": {
@@ -68,6 +56,7 @@
68
56
  "@types/chai": "^4.2.12",
69
57
  "@types/cors": "^2.8.10",
70
58
  "@types/cross-spawn": "^6.0.2",
59
+ "@types/debug": "^4.1.6",
71
60
  "@types/detect-port": "^1.3.0",
72
61
  "@types/express": "^4.17.9",
73
62
  "@types/fs-extra": "^9.0.7",
@@ -79,6 +68,7 @@
79
68
  "@types/mocha": "^5.2.7",
80
69
  "@types/mock-fs": "^4.13.0",
81
70
  "@types/node": "^12.20.7",
71
+ "@types/node-fetch": "^2.5.7",
82
72
  "@types/prettier": "^2.1.6",
83
73
  "@types/rimraf": "^3.0.0",
84
74
  "@types/shelljs": "^0.8.8",
@@ -87,10 +77,13 @@
87
77
  "chai": "^4.2.0",
88
78
  "copyfiles": "^2.4.1",
89
79
  "eslint": "7.11.0",
90
- "eslint-config-oclif": "^3.1.0",
91
- "eslint-config-oclif-typescript": "^0.1.0",
92
- "eslint-plugin-react": "^7.21.5",
80
+ "eslint-config-oclif": "3.1.0",
81
+ "eslint-config-oclif-typescript": "0.1.0",
82
+ "eslint-config-prettier": "8.3.0",
83
+ "eslint-plugin-prettier": "3.3.1",
84
+ "husky": "^7.0.4",
93
85
  "license-checker": "^25.0.1",
86
+ "lint-staged": "^12.3.2",
94
87
  "mocha": "^5.2.0",
95
88
  "mock-fs": "^4.13.0",
96
89
  "nock": "^13.0.4",
@@ -109,17 +102,23 @@
109
102
  "prerun": [
110
103
  "./lib/hooks/prerun/check-account",
111
104
  "./lib/hooks/prerun/check-upgrade",
112
- "./lib/hooks/prerun/ensure-api-key"
105
+ "./lib/hooks/prerun/ensure-api-key",
106
+ "./lib/hooks/prerun/ensure-permissions"
113
107
  ]
114
108
  }
115
109
  },
116
110
  "scripts": {
117
- "dev": "nodemon ./bin/run start --dir ~/Desktop/tuesday/debugging -e ts",
111
+ "dev:login": "nodemon -e ts bin/run login",
112
+ "dev:start": "nodemon -e ts bin/run start --dir ~/Downloads/hello-stepzen",
118
113
  "postpack": "rm -f oclif.manifest.json",
119
- "posttest": "eslint . --ext .ts --config .eslintrc",
114
+ "posttest": "eslint . --ignore-path .prettierignore",
120
115
  "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
121
116
  "test": "tsc -b && STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
122
- "version": "oclif-dev readme && git add README.md"
117
+ "version": "oclif-dev readme && git add README.md",
118
+ "prepare": "husky install"
123
119
  },
124
- "types": "lib/index.d.ts"
120
+ "types": "lib/index.d.ts",
121
+ "lint-staged": {
122
+ "*.{ts,js,css,md,yaml,json}": "prettier --write"
123
+ }
125
124
  }