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