stepzen 0.11.0-beta.0 → 0.11.0-beta.1
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 +1 -1
- package/lib/commands/import.js +26 -10
- package/lib/generate/curl2sdl.d.ts +10 -5
- package/lib/generate/curl2sdl.js +46 -5
- package/lib/shared/curl-parser.d.ts +2 -0
- package/lib/shared/curl-parser.js +81 -21
- package/oclif.manifest.json +1 -1
- package/package.json +3 -1
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.11.0-beta.
|
|
32
|
+
stepzen/0.11.0-beta.1 darwin-x64 node-v14.18.3
|
|
33
33
|
$ stepzen --help [COMMAND]
|
|
34
34
|
USAGE
|
|
35
35
|
$ stepzen COMMAND
|
package/lib/commands/import.js
CHANGED
|
@@ -12,6 +12,7 @@ const generate_1 = require("../generate");
|
|
|
12
12
|
const utils_1 = require("../shared/utils");
|
|
13
13
|
const helpers_1 = require("../generate/helpers");
|
|
14
14
|
const curl2sdl_1 = require("../generate/curl2sdl");
|
|
15
|
+
const curl_parser_1 = require("../shared/curl-parser");
|
|
15
16
|
const workspace_1 = require("../shared/workspace");
|
|
16
17
|
const init_1 = require("./init");
|
|
17
18
|
const constants_1 = require("../shared/constants");
|
|
@@ -40,25 +41,40 @@ class Import extends command_1.Command {
|
|
|
40
41
|
if (schemas.length > 1) {
|
|
41
42
|
throw new errors_1.CLIError('Please run cURL import separately from importing other schemas');
|
|
42
43
|
}
|
|
43
|
-
if (argv.length < 2) {
|
|
44
|
-
throw new errors_1.CLIError('Please append the full cURL command, e.g. ' +
|
|
45
|
-
chalk.bold(`${this.config.name} import curl https://test.stepzen.net/version`));
|
|
46
|
-
}
|
|
47
44
|
this.log(chalk.yellow(`NOTE: ${chalk.bold('stepzen import curl')} is a ${chalk.bold('new')} feature.`));
|
|
48
45
|
this.log(chalk.yellow('If you have any issues, please check if they have been addressed ' +
|
|
49
46
|
'in the latest version, or reach out to StepZen on Discord: ' +
|
|
50
47
|
'https://discord.gg/9k2VdPn2FR'));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
cli_ux_1.cli.action.start('Starting');
|
|
54
|
-
const resultOrError = await curl2sdl_1.curl2sdl({
|
|
55
|
-
argv,
|
|
48
|
+
let curl2sdlOptions;
|
|
49
|
+
const fixedOptions = {
|
|
56
50
|
name: flags.name,
|
|
57
51
|
source: workspace.schema,
|
|
52
|
+
};
|
|
53
|
+
const editableOptions = {
|
|
58
54
|
queryName: flags['query-name'],
|
|
59
55
|
rootType: flags['query-type'],
|
|
60
56
|
typePrefix: flags.prefix,
|
|
61
|
-
}
|
|
57
|
+
};
|
|
58
|
+
if (argv.length === 1) {
|
|
59
|
+
// no parameters given: start an interactive prompt
|
|
60
|
+
console.log();
|
|
61
|
+
console.log('This command introspects the response of a REST endpoint and generates' +
|
|
62
|
+
' a GraphQL schema allowing you to access this endpoint through your ' +
|
|
63
|
+
'StepZen API. curl syntax is supported so that you copy and paste a ' +
|
|
64
|
+
'curl command instead of the URL.');
|
|
65
|
+
console.log();
|
|
66
|
+
curl2sdlOptions = Object.assign(Object.assign({}, fixedOptions), (await curl2sdl_1.askCurlQuestions(editableOptions)));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
// run non-interative
|
|
70
|
+
const argsOrError = curl_parser_1.parseCurlArgv(argv);
|
|
71
|
+
if ('error' in argsOrError) {
|
|
72
|
+
throw new errors_1.CLIError(argsOrError.error);
|
|
73
|
+
}
|
|
74
|
+
curl2sdlOptions = Object.assign(Object.assign(Object.assign({}, fixedOptions), editableOptions), { curlArgs: argsOrError });
|
|
75
|
+
}
|
|
76
|
+
cli_ux_1.cli.action.start('Starting');
|
|
77
|
+
const resultOrError = await curl2sdl_1.curl2sdl(curl2sdlOptions);
|
|
62
78
|
cli_ux_1.cli.action.stop();
|
|
63
79
|
if ('error' in resultOrError) {
|
|
64
80
|
this.log('A problem occured while processing your import. ' +
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import { CurlArguments } from '../shared/curl-parser';
|
|
1
2
|
export declare type Curl2SdlOptions = {
|
|
2
|
-
|
|
3
|
+
curlArgs: CurlArguments;
|
|
3
4
|
name: string;
|
|
4
5
|
source: string;
|
|
5
6
|
queryName?: string;
|
|
6
7
|
rootType?: string;
|
|
7
8
|
typePrefix?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare type
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
export declare type EditableCurl2SdlOptions = Pick<Curl2SdlOptions, 'curlArgs' | 'queryName' | 'rootType' | 'typePrefix'>;
|
|
11
|
+
export declare type CurlAnswers = {
|
|
12
|
+
url: string;
|
|
13
|
+
queryName: string;
|
|
14
|
+
rootType: string;
|
|
15
|
+
typePrefix: string;
|
|
12
16
|
};
|
|
13
|
-
export declare const
|
|
17
|
+
export declare const askCurlQuestions: (defaultAnswers?: Partial<CurlAnswers>) => Promise<EditableCurl2SdlOptions>;
|
|
18
|
+
export declare const curl2sdl: ({ curlArgs, name, source, queryName, rootType, typePrefix, }: Curl2SdlOptions) => Promise<{
|
|
14
19
|
error: string;
|
|
15
20
|
} | {
|
|
16
21
|
outPath: string;
|
package/lib/generate/curl2sdl.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright (c) 2020,2021,2022, StepZen, Inc.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.curl2sdl = void 0;
|
|
4
|
+
exports.curl2sdl = exports.askCurlQuestions = void 0;
|
|
5
5
|
const errors_1 = require("@oclif/errors");
|
|
6
|
+
const chalk = require("chalk");
|
|
6
7
|
const fs = require("fs-extra");
|
|
8
|
+
const inquirer = require("inquirer");
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
7
10
|
const os = require("os");
|
|
8
11
|
const path = require("path");
|
|
12
|
+
const string_argv_1 = require("string-argv");
|
|
9
13
|
const node_fetch_1 = require("node-fetch");
|
|
10
14
|
const debug = require("debug");
|
|
11
15
|
const prettier = require("prettier");
|
|
@@ -13,12 +17,43 @@ const transpiler_1 = require("@stepzen/transpiler");
|
|
|
13
17
|
const curl_parser_1 = require("../shared/curl-parser");
|
|
14
18
|
const constants_1 = require("../shared/constants");
|
|
15
19
|
const errors_2 = require("../shared/errors");
|
|
16
|
-
exports.
|
|
17
|
-
let
|
|
18
|
-
|
|
20
|
+
exports.askCurlQuestions = async (defaultAnswers = {}) => {
|
|
21
|
+
let questions = [
|
|
22
|
+
{
|
|
23
|
+
name: 'url',
|
|
24
|
+
message: 'Endpoint URL or a full curl command',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'queryName',
|
|
28
|
+
message: 'Query name to use when generating schema (leave blank to use defaults)',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'rootType',
|
|
32
|
+
message: 'Query type name to use when generating schema (leave blank to use defaults)',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'typePrefix',
|
|
36
|
+
message: 'Prefix to add to all generated type name (leave blank to use defaults)',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
questions = questions.map(question => (Object.assign(Object.assign({}, question), { default: lodash_1.get(defaultAnswers, question.name) })));
|
|
40
|
+
const answers = await inquirer.prompt(questions);
|
|
41
|
+
const curlArgs = curl_parser_1.parseCurlArgv(string_argv_1.default(answers.url));
|
|
19
42
|
if ('error' in curlArgs) {
|
|
20
|
-
|
|
43
|
+
console.log();
|
|
44
|
+
console.log(chalk.red('A problem occurred while parsing the curl command:\n', curlArgs.error), '\nPlease check enter a URL or a supported curl command.');
|
|
45
|
+
console.log();
|
|
46
|
+
return exports.askCurlQuestions(answers);
|
|
21
47
|
}
|
|
48
|
+
return {
|
|
49
|
+
curlArgs,
|
|
50
|
+
queryName: answers.queryName,
|
|
51
|
+
rootType: answers.rootType,
|
|
52
|
+
typePrefix: answers.typePrefix,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
exports.curl2sdl = async ({ curlArgs, name, source, queryName, rootType, typePrefix, }) => {
|
|
56
|
+
let json;
|
|
22
57
|
try {
|
|
23
58
|
const url = `${constants_1.STEPZEN_JSON2SDL_SERVER_URL}/api/graphql`;
|
|
24
59
|
const query = `query (
|
|
@@ -27,6 +62,8 @@ exports.curl2sdl = async ({ argv, name, source, queryName, rootType, typePrefix,
|
|
|
27
62
|
$rootType: String
|
|
28
63
|
$typePrefix: String
|
|
29
64
|
$headers: [HeaderInput!]
|
|
65
|
+
$data: String
|
|
66
|
+
$method: HTTPMethod
|
|
30
67
|
) {
|
|
31
68
|
getSDLFromCurl(
|
|
32
69
|
command: $command
|
|
@@ -34,6 +71,8 @@ exports.curl2sdl = async ({ argv, name, source, queryName, rootType, typePrefix,
|
|
|
34
71
|
rootType: $rootType
|
|
35
72
|
typePrefix: $typePrefix
|
|
36
73
|
headers: $headers
|
|
74
|
+
data: $data
|
|
75
|
+
method: $method
|
|
37
76
|
) {
|
|
38
77
|
sdl
|
|
39
78
|
config
|
|
@@ -45,6 +84,8 @@ exports.curl2sdl = async ({ argv, name, source, queryName, rootType, typePrefix,
|
|
|
45
84
|
rootType: rootType || null,
|
|
46
85
|
typePrefix: typePrefix || null,
|
|
47
86
|
headers: curlArgs.headers.length > 0 ? curlArgs.headers : null,
|
|
87
|
+
data: curlArgs.data || null,
|
|
88
|
+
method: curlArgs.method,
|
|
48
89
|
};
|
|
49
90
|
debug('stepzen:curl2sdl')(url);
|
|
50
91
|
debug('stepzen:curl2sdl')(query);
|
|
@@ -15,10 +15,12 @@ export declare const parseCurlHeaderString: (header: string) => {
|
|
|
15
15
|
};
|
|
16
16
|
export interface CurlArguments {
|
|
17
17
|
url: string;
|
|
18
|
+
method: 'Get' | 'Post';
|
|
18
19
|
headers: Array<{
|
|
19
20
|
name: string;
|
|
20
21
|
value: string;
|
|
21
22
|
}>;
|
|
23
|
+
data?: string;
|
|
22
24
|
}
|
|
23
25
|
export interface ParseError {
|
|
24
26
|
error: string;
|
|
@@ -7,6 +7,7 @@ const curlFlagRegex = /^(-[a-zA-Z0-9.:#])|(--[a-zA-Z0-9.-]+)$/;
|
|
|
7
7
|
// Based on the definition of a `token` at
|
|
8
8
|
// https://datatracker.ietf.org/doc/html/rfc2616#page-17
|
|
9
9
|
const httpHeaderRegex = /^(?<name>[a-zA-Z0-9!#$%&'*+,-.^_`|~]+)\s*:(?<value>.*)$/;
|
|
10
|
+
const httpURLRegex = /^https?:\/\//i;
|
|
10
11
|
/**
|
|
11
12
|
* Parse a header string according to https://curl.se/docs/manpage.html#-H
|
|
12
13
|
* and https://datatracker.ietf.org/doc/html/rfc2616#section-4.2
|
|
@@ -43,7 +44,57 @@ exports.parseCurlHeaderString = (header) => {
|
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
46
|
const isAFlagArg = (arg) => curlFlagRegex.test(arg);
|
|
46
|
-
const
|
|
47
|
+
const isAURL = (arg) => httpURLRegex.test(arg);
|
|
48
|
+
const parseHeaderFlag = (argv, i, partialCurlArgs) => {
|
|
49
|
+
if (i + 1 === argv.length) {
|
|
50
|
+
return {
|
|
51
|
+
error: `The '${argv[i]}' curl flag requires a value`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const headerOrError = exports.parseCurlHeaderString(argv[i + 1]);
|
|
55
|
+
if (headerOrError && 'error' in headerOrError) {
|
|
56
|
+
return headerOrError; // error
|
|
57
|
+
}
|
|
58
|
+
const headers = partialCurlArgs.headers || [];
|
|
59
|
+
// A `null` from parseCurlHeaderString() means a header should NOT be
|
|
60
|
+
// sent. This is not supported by zenserv / the introspection service
|
|
61
|
+
// so the CLI simply omits such headers
|
|
62
|
+
if (headerOrError) {
|
|
63
|
+
headers.push(headerOrError); // header
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
result: Object.assign(Object.assign({}, partialCurlArgs), { headers }),
|
|
67
|
+
skip: 1,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const parseDataFlag = (argv, i, partialCurlArgs) => {
|
|
71
|
+
if (i + 1 === argv.length) {
|
|
72
|
+
return {
|
|
73
|
+
error: `The '${argv[i]}' curl flag requires a value`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (argv[i] !== '--data-raw' && argv[i + 1].charAt(0) === '@') {
|
|
77
|
+
return {
|
|
78
|
+
error: `Reading request data from local files in not currently supported ` +
|
|
79
|
+
`by StepZen CLI (${argv[i]} ${argv[i + 1]})`,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const data = (partialCurlArgs.data ? partialCurlArgs.data + '&' : '') + argv[i + 1];
|
|
83
|
+
return {
|
|
84
|
+
result: Object.assign(Object.assign({}, partialCurlArgs), { data }),
|
|
85
|
+
skip: 1,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
const flags = [
|
|
89
|
+
{
|
|
90
|
+
matches: ['-H', '--header'],
|
|
91
|
+
parse: parseHeaderFlag,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
matches: ['-d', '--data', '--data-ascii', '--data-raw', '--data-binary'],
|
|
95
|
+
parse: parseDataFlag,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
47
98
|
/**
|
|
48
99
|
* Parse a curl command line arguments array to a JSON structure consumable by
|
|
49
100
|
* the StepZen introspection service backend.
|
|
@@ -60,29 +111,21 @@ const isAHeaderFlag = (flag) => ['-H', '--header'].includes(flag);
|
|
|
60
111
|
* @returns {*} a structured object with the curl arguments
|
|
61
112
|
*/
|
|
62
113
|
exports.parseCurlArgv = (argv) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
114
|
+
var _a;
|
|
115
|
+
if (((_a = argv[0]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'curl') {
|
|
116
|
+
argv = argv.slice(1);
|
|
117
|
+
}
|
|
118
|
+
let result = {};
|
|
67
119
|
for (let i = 0; i < argv.length; i++) {
|
|
68
120
|
if (isAFlagArg(argv[i])) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
121
|
+
const knownFlag = flags.find(flag => flag.matches.includes(argv[i]));
|
|
122
|
+
if (knownFlag) {
|
|
123
|
+
const resultOrError = knownFlag.parse(argv, i, result);
|
|
124
|
+
if ('error' in resultOrError) {
|
|
125
|
+
return resultOrError; // error
|
|
74
126
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return headerOrError; // error
|
|
78
|
-
}
|
|
79
|
-
// A `null` from parseCurlHeaderString() means a header should NOT be
|
|
80
|
-
// sent. This is not supported by zenserv / the introspection service
|
|
81
|
-
// so the CLI simply omits such headers
|
|
82
|
-
if (headerOrError) {
|
|
83
|
-
result.headers.push(headerOrError); // header
|
|
84
|
-
}
|
|
85
|
-
i += 1; // skip over the flag value
|
|
127
|
+
result = resultOrError.result; // result
|
|
128
|
+
i += resultOrError.skip || 0;
|
|
86
129
|
}
|
|
87
130
|
else {
|
|
88
131
|
return {
|
|
@@ -104,5 +147,22 @@ exports.parseCurlArgv = (argv) => {
|
|
|
104
147
|
error: 'curl: a URL is required',
|
|
105
148
|
};
|
|
106
149
|
}
|
|
150
|
+
if (!isAURL(result.url)) {
|
|
151
|
+
return {
|
|
152
|
+
error: `Unsupported URL schema in '${result.url}'. ` +
|
|
153
|
+
`StepZen CLI currently supports 'https' and 'http'.`,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
result.headers = result.headers || [];
|
|
157
|
+
result.method = result.method || result.data ? 'Post' : 'Get';
|
|
158
|
+
// Add the default content-type header if the request has any data
|
|
159
|
+
// in it, and no content-type header is explicitly provided.
|
|
160
|
+
if (result.headers.findIndex(header => header.name.toLowerCase() === 'content-type') === -1 &&
|
|
161
|
+
result.data) {
|
|
162
|
+
result.headers.push({
|
|
163
|
+
name: 'content-type',
|
|
164
|
+
value: 'application/x-www-form-urlencoded',
|
|
165
|
+
});
|
|
166
|
+
}
|
|
107
167
|
return result;
|
|
108
168
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.11.0-beta.
|
|
1
|
+
{"version":"0.11.0-beta.1","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},"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."}},"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},"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},"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.11.0-beta.
|
|
4
|
+
"version": "0.11.0-beta.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -119,6 +119,8 @@
|
|
|
119
119
|
"posttest": "eslint . --ignore-path .prettierignore",
|
|
120
120
|
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
|
|
121
121
|
"test": "tsc -b && STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
|
|
122
|
+
"test:single:example": "npm run test:single -- test/src/shared/curl-parser.test.ts",
|
|
123
|
+
"test:single": "tsc -b && STEPZEN_DOMAIN=steprz.io STEPZEN_SERVER_URL=http://localhost mocha --forbid-only test/_global.test.ts",
|
|
122
124
|
"version": "oclif-dev readme && git add README.md",
|
|
123
125
|
"prepare": "husky install"
|
|
124
126
|
},
|