stepzen 0.35.1 → 0.36.0-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 +32 -1
- package/lib/commands/import/flow.d.ts +84 -0
- package/lib/commands/import/flow.d.ts.map +1 -0
- package/lib/commands/import/flow.js +122 -0
- package/lib/commands/import/flow.js.map +1 -0
- package/lib/commands/import/index.d.ts.map +1 -1
- package/lib/commands/import/index.js +7 -0
- package/lib/commands/import/index.js.map +1 -1
- package/lib/generate/flow2sdl.d.ts +11 -0
- package/lib/generate/flow2sdl.d.ts.map +1 -0
- package/lib/generate/flow2sdl.js +23 -0
- package/lib/generate/flow2sdl.js.map +1 -0
- package/oclif.manifest.json +75 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ $ npm install -g stepzen
|
|
|
30
30
|
$ stepzen COMMAND
|
|
31
31
|
running command...
|
|
32
32
|
$ stepzen (--version|-v)
|
|
33
|
-
stepzen/0.
|
|
33
|
+
stepzen/0.36.0-beta.0 linux-x64 node-v18.19.1
|
|
34
34
|
$ stepzen --help [COMMAND]
|
|
35
35
|
USAGE
|
|
36
36
|
$ stepzen COMMAND
|
|
@@ -54,6 +54,7 @@ $ stepzen deploy ENDPOINT --schema=schema [--configurationsets=cs1[,cs2[,..]]]`]
|
|
|
54
54
|
* [`stepzen help [COMMANDS]`](#stepzen-help-commands)
|
|
55
55
|
* [`stepzen import [SOURCE]`](#stepzen-import-source)
|
|
56
56
|
* [`stepzen import curl`](#stepzen-import-curl)
|
|
57
|
+
* [`stepzen import flow [FLOW]`](#stepzen-import-flow-flow)
|
|
57
58
|
* [`stepzen import graphql [URL]`](#stepzen-import-graphql-url)
|
|
58
59
|
* [`stepzen import mysql [DSN]`](#stepzen-import-mysql-dsn)
|
|
59
60
|
* [`stepzen import postgres [DSN]`](#stepzen-import-postgres-dsn)
|
|
@@ -254,6 +255,36 @@ DESCRIPTION
|
|
|
254
255
|
through a StepZen API, and adds the generated types and a query field into your GraphQL schema.
|
|
255
256
|
```
|
|
256
257
|
|
|
258
|
+
## `stepzen import flow [FLOW]`
|
|
259
|
+
|
|
260
|
+
Import StepZen flow expression as a query field into your GraphQL API.
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
USAGE
|
|
264
|
+
$ stepzen import flow [FLOW] [-h] [--non-interactive] [--dir <value>] [--name <value>] [-H <value> --endpoint
|
|
265
|
+
<value>]
|
|
266
|
+
|
|
267
|
+
FLAGS
|
|
268
|
+
-H, --header=<value>... Specifies a request header to pass
|
|
269
|
+
|
|
270
|
+
Example:
|
|
271
|
+
stepzen import curl https://example.com/api/customers \
|
|
272
|
+
-H "Authorization: apikey SecretAPIKeyValue"
|
|
273
|
+
-h, --help Show CLI help
|
|
274
|
+
--dir=<value> Working directory
|
|
275
|
+
--endpoint=<value> Use a custom GraphQL schema instead of the project's schema as the schema providing the steps
|
|
276
|
+
in the flow.
|
|
277
|
+
--name=<value> Subfolder inside the workspace folder to save the imported schema files to. Defaults to the
|
|
278
|
+
name of the imported schema.
|
|
279
|
+
--non-interactive Disable all interactive prompts
|
|
280
|
+
|
|
281
|
+
DESCRIPTION
|
|
282
|
+
Import StepZen flow expression as a query field into your GraphQL API.
|
|
283
|
+
|
|
284
|
+
stepzen import flow automatically introspects a GraphQL endpoint and adds a @sequence implementing the given flow
|
|
285
|
+
expression into your GraphQL schema.
|
|
286
|
+
```
|
|
287
|
+
|
|
257
288
|
## `stepzen import graphql [URL]`
|
|
258
289
|
|
|
259
290
|
Import a GraphQL API as a subgraph into your GraphQL API.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type Flow2SdlOptions } from '../../generate/flow2sdl';
|
|
2
|
+
import { ImportCommandBase, type CommonImportOptions } from '../../generate/import-command';
|
|
3
|
+
import { type Workspace } from '../../shared/types';
|
|
4
|
+
declare type InteractiveFlow2SdlOptions = Pick<Flow2SdlOptions, 'flow' | 'endpoint' | 'headers'>;
|
|
5
|
+
declare type FlowAnswers = {
|
|
6
|
+
flow: string;
|
|
7
|
+
endpoint: string;
|
|
8
|
+
header: string;
|
|
9
|
+
};
|
|
10
|
+
export default class ImportFlow extends ImportCommandBase {
|
|
11
|
+
static description: string;
|
|
12
|
+
get source(): "flow";
|
|
13
|
+
static flags: {
|
|
14
|
+
header: {
|
|
15
|
+
dependsOn: string[];
|
|
16
|
+
name: string;
|
|
17
|
+
char?: import("@oclif/core/lib/interfaces").AlphabetUppercase | import("@oclif/core/lib/interfaces").AlphabetLowercase | undefined;
|
|
18
|
+
summary?: string | undefined;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
helpLabel?: string | undefined;
|
|
21
|
+
helpGroup?: string | undefined;
|
|
22
|
+
env?: string | undefined;
|
|
23
|
+
hidden?: boolean | undefined;
|
|
24
|
+
required?: boolean | undefined;
|
|
25
|
+
exclusive?: string[] | undefined;
|
|
26
|
+
exactlyOne?: string[] | undefined;
|
|
27
|
+
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
28
|
+
deprecated?: true | import("@oclif/core/lib/interfaces").Deprecation | undefined;
|
|
29
|
+
aliases?: string[] | undefined;
|
|
30
|
+
deprecateAliases?: boolean | undefined;
|
|
31
|
+
delimiter?: "," | undefined;
|
|
32
|
+
type: "option";
|
|
33
|
+
helpValue?: string | undefined;
|
|
34
|
+
options?: string[] | undefined;
|
|
35
|
+
multiple: false;
|
|
36
|
+
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string[] | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
37
|
+
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
38
|
+
input: string[];
|
|
39
|
+
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
40
|
+
} | {
|
|
41
|
+
dependsOn: string[];
|
|
42
|
+
name: string;
|
|
43
|
+
char?: import("@oclif/core/lib/interfaces").AlphabetUppercase | import("@oclif/core/lib/interfaces").AlphabetLowercase | undefined;
|
|
44
|
+
summary?: string | undefined;
|
|
45
|
+
description?: string | undefined;
|
|
46
|
+
helpLabel?: string | undefined;
|
|
47
|
+
helpGroup?: string | undefined;
|
|
48
|
+
env?: string | undefined;
|
|
49
|
+
hidden?: boolean | undefined;
|
|
50
|
+
required?: boolean | undefined;
|
|
51
|
+
exclusive?: string[] | undefined;
|
|
52
|
+
exactlyOne?: string[] | undefined;
|
|
53
|
+
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
54
|
+
deprecated?: true | import("@oclif/core/lib/interfaces").Deprecation | undefined;
|
|
55
|
+
aliases?: string[] | undefined;
|
|
56
|
+
deprecateAliases?: boolean | undefined;
|
|
57
|
+
delimiter?: "," | undefined;
|
|
58
|
+
type: "option";
|
|
59
|
+
helpValue?: string | undefined;
|
|
60
|
+
options?: string[] | undefined;
|
|
61
|
+
multiple: true;
|
|
62
|
+
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string[] | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
63
|
+
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
64
|
+
input: string[];
|
|
65
|
+
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<(string[] | undefined)[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
66
|
+
};
|
|
67
|
+
endpoint: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
68
|
+
dir: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
69
|
+
silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
70
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
71
|
+
overwrite: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
72
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
73
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
74
|
+
};
|
|
75
|
+
static args: {
|
|
76
|
+
flow: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
77
|
+
};
|
|
78
|
+
protected import(commonOptions: CommonImportOptions, workspace: Workspace): Promise<import("../../shared/types").ErrorOr<import("../../generate/helpers").IntrospectionServiceResponse, {
|
|
79
|
+
message: string;
|
|
80
|
+
}>>;
|
|
81
|
+
getImportOptionsInteractively(defaults?: Partial<FlowAnswers>): Promise<InteractiveFlow2SdlOptions>;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/commands/import/flow.ts"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAEtE,OAAO,EACL,iBAAiB,EACjB,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAA;AAItC,OAAO,EAAe,KAAK,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAG/D,aAAK,0BAA0B,GAAG,IAAI,CACpC,eAAe,EACf,MAAM,GAAG,UAAU,GAAG,SAAS,CAChC,CAAA;AAED,aAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,iBAAiB;IACvD,MAAM,CAAC,WAAW,SAK2B;IAE7C,IAAI,MAAM,WAET;IAED,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQX;IAED,MAAM,CAAC,IAAI;;MAIV;cAEe,MAAM,CACpB,aAAa,EAAE,mBAAmB,EAClC,SAAS,EAAE,SAAS;;;IAuFhB,6BAA6B,CACjC,QAAQ,GAAE,OAAO,CAAC,WAAW,CAAM,GAClC,OAAO,CAAC,0BAA0B,CAAC;CAmCvC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright IBM Corp. 2020, 2024
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const errors_1 = require("@oclif/core/lib/errors");
|
|
6
|
+
const chalk = require("chalk");
|
|
7
|
+
const flags_1 = require("../../generate/flags");
|
|
8
|
+
const flow2sdl_1 = require("../../generate/flow2sdl");
|
|
9
|
+
const helpers_1 = require("../../generate/helpers");
|
|
10
|
+
const import_command_1 = require("../../generate/import-command");
|
|
11
|
+
const constants_1 = require("../../shared/constants");
|
|
12
|
+
const header_1 = require("../../shared/header");
|
|
13
|
+
const inquirer = require("../../shared/inquirer");
|
|
14
|
+
const utils_1 = require("../../shared/utils");
|
|
15
|
+
class ImportFlow extends import_command_1.ImportCommandBase {
|
|
16
|
+
get source() {
|
|
17
|
+
return 'flow';
|
|
18
|
+
}
|
|
19
|
+
async import(commonOptions, workspace) {
|
|
20
|
+
const { args, flags } = await this.parse(ImportFlow);
|
|
21
|
+
const { configuration } = await this.ensureStepZenAccount({
|
|
22
|
+
nonInteractive: flags['non-interactive'],
|
|
23
|
+
});
|
|
24
|
+
let endpoint = flags.endpoint;
|
|
25
|
+
let headers = (0, helpers_1.parseHeaderFlags)(flags.header, flags['header-param']);
|
|
26
|
+
if (!endpoint) {
|
|
27
|
+
endpoint = `${(0, constants_1.getZenServUrl)(configuration)}/${workspace.endpoint}/__graphql`;
|
|
28
|
+
headers = [
|
|
29
|
+
{ name: 'Authorization', value: `APIKey ${configuration.apikey}` },
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
const nonInteractiveOptions = {
|
|
33
|
+
flow: args.flow,
|
|
34
|
+
endpoint: endpoint,
|
|
35
|
+
headers: headers,
|
|
36
|
+
};
|
|
37
|
+
let flow2sdlOptions;
|
|
38
|
+
if (nonInteractiveOptions.flow) {
|
|
39
|
+
// an ugly hint for the TS compiler because it is not smart enough to figure this :(
|
|
40
|
+
const typedNonInteractiveOptions = nonInteractiveOptions;
|
|
41
|
+
// run non-interactively
|
|
42
|
+
flow2sdlOptions = {
|
|
43
|
+
...commonOptions,
|
|
44
|
+
...typedNonInteractiveOptions,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
if (flags['non-interactive']) {
|
|
49
|
+
throw new errors_1.CLIError('Please provide a StepZen flow expression.' +
|
|
50
|
+
chalk `\nSee more help with {bold stepzen import flow --help}`);
|
|
51
|
+
}
|
|
52
|
+
// no parameters given: start an interactive prompt
|
|
53
|
+
if (!flags.silent) {
|
|
54
|
+
this.log();
|
|
55
|
+
this.log(chalk `{bold stepzen import flow} - ` +
|
|
56
|
+
chalk.dim(`Import StepZen flow expression as a query field into your` +
|
|
57
|
+
` GraphQL API.`));
|
|
58
|
+
this.log();
|
|
59
|
+
}
|
|
60
|
+
// no parameters given: start an interactive prompt
|
|
61
|
+
const interactiveOptions = await this.getImportOptionsInteractively(nonInteractiveOptions);
|
|
62
|
+
flow2sdlOptions = {
|
|
63
|
+
...commonOptions,
|
|
64
|
+
...interactiveOptions,
|
|
65
|
+
// include boths headers passed via flags and headers entered interactively
|
|
66
|
+
headers: [
|
|
67
|
+
...nonInteractiveOptions.headers,
|
|
68
|
+
...interactiveOptions.headers,
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
flow2sdlOptions.endpoint = (0, utils_1.rewriteLocalhostToHostGatewayInURL)(configuration, flow2sdlOptions.endpoint);
|
|
73
|
+
return this.wrapInProgressAndTimeout((0, flow2sdl_1.flow2sdl)(flow2sdlOptions, configuration));
|
|
74
|
+
}
|
|
75
|
+
async getImportOptionsInteractively(defaults = {}) {
|
|
76
|
+
const questions = inquirer.overrideDefaults([
|
|
77
|
+
{
|
|
78
|
+
name: 'flow',
|
|
79
|
+
message: 'Flow expression, where each step is a field in the GraphQL schema',
|
|
80
|
+
validate: input => input.trim() !== '',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'endpoint',
|
|
84
|
+
message: 'What is the GraphQL endpoint URL?',
|
|
85
|
+
validate: input => input.trim() !== '',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'header',
|
|
89
|
+
type: 'input',
|
|
90
|
+
message: 'Add an HTTP header, e.g. Header-Name: header value (leave blank for none)',
|
|
91
|
+
validate: input => input === '' || header_1.HEADER_REGEX.test(input.trim()) || 'invalid header',
|
|
92
|
+
},
|
|
93
|
+
], defaults);
|
|
94
|
+
const answers = await inquirer.prompt('import-graphql', questions);
|
|
95
|
+
const { result: header } = (0, header_1.parseHeader)(answers.header);
|
|
96
|
+
return {
|
|
97
|
+
flow: answers.flow,
|
|
98
|
+
endpoint: answers.endpoint,
|
|
99
|
+
headers: header ? [header] : [],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.default = ImportFlow;
|
|
104
|
+
ImportFlow.description = `Import StepZen flow expression as a query field into your GraphQL API.` +
|
|
105
|
+
`\n` +
|
|
106
|
+
chalk `\n{bold stepzen import flow} automatically introspects a GraphQL` +
|
|
107
|
+
chalk ` endpoint and adds a {bold @sequence} implementing the given ` +
|
|
108
|
+
`flow expression into your GraphQL schema.`;
|
|
109
|
+
ImportFlow.flags = {
|
|
110
|
+
...import_command_1.ImportCommandBase.flags,
|
|
111
|
+
header: { ...flags_1.ImportFlags.header(), dependsOn: ['endpoint'] },
|
|
112
|
+
endpoint: core_1.Flags.string({
|
|
113
|
+
description: `Use a custom GraphQL schema instead of the project's schema as the` +
|
|
114
|
+
` schema providing the steps in the flow.`,
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
ImportFlow.args = {
|
|
118
|
+
flow: core_1.Args.string({
|
|
119
|
+
name: chalk `StepZen flow expression, e.g. {bold reply = prompt | llm}`,
|
|
120
|
+
}),
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../../src/commands/import/flow.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,sCAAuC;AACvC,mDAA+C;AAC/C,+BAA8B;AAE9B,gDAAgD;AAChD,sDAAsE;AACtE,oDAAuD;AACvD,kEAGsC;AACtC,sDAAoD;AACpD,gDAA+E;AAC/E,kDAAiD;AAEjD,8CAAqE;AAarE,MAAqB,UAAW,SAAQ,kCAAiB;IAQvD,IAAI,MAAM;QACR,OAAO,MAAe,CAAA;IACxB,CAAC;IAkBS,KAAK,CAAC,MAAM,CACpB,aAAkC,EAClC,SAAoB;QAEpB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QAElD,MAAM,EAAC,aAAa,EAAC,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC;YACtD,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC;SACzC,CAAC,CAAA;QAEF,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;QAC7B,IAAI,OAAO,GAAkB,IAAA,0BAAgB,EAC3C,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,cAAc,CAAC,CACtB,CAAA;QAED,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,GAAG,IAAA,yBAAa,EAAC,aAAa,CAAC,IACxC,SAAS,CAAC,QACZ,YAAY,C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C,CAAA;AAMtC,gBAAK,GAAG;IACb,GAAG,kCAAiB,CAAC,KAAK;IAC1B,MAAM,EAAE,EAAC,GAAG,mBAAW,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,UAAU,CAAC,EAAC;IAC1D,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,WAAW,EACT,oEAAoE;YACpE,0CAA0C;KAC7C,CAAC;CACH,CAAA;AAEM,eAAI,GAAG;IACZ,IAAI,EAAE,WAAI,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,KAAK,CAAA,2DAA2D;KACvE,CAAC;CACH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/import/index.ts"],"names":[],"mappings":"AAUA,OAAO,UAAU,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/import/index.ts"],"names":[],"mappings":"AAUA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAUjD,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,KAAK,EACL,YAAY,EACb,MAAM,mCAAmC,CAAA;AAK1C,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAC5C,MAAM,CAAC,WAAW,SAEoD;IAEtE,MAAM,CAAC,KAAK;;;;MAGX;IAED,MAAM,CAAC,IAAI;;MAMV;IAEK,GAAG;cAqHO,KAAK,CACnB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,UAAU,EACpB,CAAC,SAAS,SAAS,EAEnB,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACxB,IAAI,GAAE,MAAM,EAAc,GACzB,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAAC;IAkBpD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC;CAiCvE"}
|
|
@@ -10,6 +10,7 @@ const inquirer = require("../../shared/inquirer");
|
|
|
10
10
|
const utils_1 = require("../../shared/utils");
|
|
11
11
|
const zen_command_1 = require("../../shared/zen-command");
|
|
12
12
|
const curl_1 = require("./curl");
|
|
13
|
+
const flow_1 = require("./flow");
|
|
13
14
|
const graphql_1 = require("./graphql");
|
|
14
15
|
const mysql_1 = require("./mysql");
|
|
15
16
|
const postgresql_1 = require("./postgresql");
|
|
@@ -70,6 +71,12 @@ class Import extends zen_command_1.default {
|
|
|
70
71
|
}
|
|
71
72
|
ImportCommand = curl_1.default;
|
|
72
73
|
break;
|
|
74
|
+
case 'flow':
|
|
75
|
+
if (dsn) {
|
|
76
|
+
throw new errors_1.CLIError(`Please use ${chalk.bold('stepzen import flow [flow]')}`);
|
|
77
|
+
}
|
|
78
|
+
ImportCommand = flow_1.default;
|
|
79
|
+
break;
|
|
73
80
|
case 'graphql':
|
|
74
81
|
if (dsn) {
|
|
75
82
|
throw new errors_1.CLIError(`Please use ${chalk.bold('stepzen import graphql [url]')}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/import/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAEjC,sCAAuC;AACvC,mDAA+C;AAC/C,0DAA2D;AAC3D,+BAA8B;AAE9B,sDAA2D;AAC3D,kDAAiD;AACjD,8CAAiD;AACjD,0DAAiD;AAEjD,iCAA+B;AAC/B,uCAAqC;AACrC,mCAAiC;AACjC,6CAA2C;AAC3C,qCAAmC;AACnC,2CAAyC;AAUzC,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAC,CAAA;AAEvE,MAAqB,MAAO,SAAQ,qBAAU;IAkB5C,KAA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AAG,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAClD,MAAM,IAAI,iBAAQ,CAChB,sGAAsG,CACvG,CAAA;aACF;YACD,MAAM,GAAG,OAAO,CAAA;SACjB;QAED,iDAAiD;QACjD,mDAAmD;QACnD,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE;YACvC,MAAM,GAAG,YAAY,CAAA;SACtB;QAED,6CAA6C;QAC7C,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,aAAa,EAAE;YAC1C,MAAM,GAAG,OAAO,CAAA;SACjB;QAED,OAAO,EAAC,MAAM,EAAE,GAAG,EAAC,CAAA;IACtB,CAAC;;AAhMH,yBAiMC;AAhMQ,kBAAW,GAChB,KAAK,CAAA,uFAAuF;IAC5F,KAAK,CAAA,+DAA+D,CAAA;AAE/D,YAAK,GAAG;IACb,GAAG,qBAAU,CAAC,KAAK;IACnB,GAAG,EAAE,YAAK,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,mBAAmB,EAAC,CAAC;CACtD,CAAA;AAEM,WAAI,GAAG;IACZ,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC;QAClB,WAAW,EAAE,KAAK,CAAA,4BAA4B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAC5D,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACd,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB;KACtC,CAAC;CACH,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HeaderInput } from '../shared/header';
|
|
2
|
+
import type { ErrorOr, MachineConfiguration } from '../shared/types';
|
|
3
|
+
import type { IntrospectionServiceResponse } from './helpers';
|
|
4
|
+
import { CommonImportOptions } from './import-command';
|
|
5
|
+
export declare type Flow2SdlOptions = CommonImportOptions & {
|
|
6
|
+
flow: string;
|
|
7
|
+
endpoint: string;
|
|
8
|
+
headers: readonly HeaderInput[];
|
|
9
|
+
};
|
|
10
|
+
export declare const flow2sdl: ({ flow, endpoint, headers }: Flow2SdlOptions, configuration: MachineConfiguration) => Promise<ErrorOr<IntrospectionServiceResponse>>;
|
|
11
|
+
//# sourceMappingURL=flow2sdl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow2sdl.d.ts","sourceRoot":"","sources":["../../src/generate/flow2sdl.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,iBAAiB,CAAA;AAClE,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AAEpD,oBAAY,eAAe,GAAG,mBAAmB,GAAG;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,QAAQ,gCACQ,eAAe,iBAC3B,oBAAoB,KAClC,QAAQ,QAAQ,4BAA4B,CAAC,CAc/C,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright IBM Corp. 2020, 2024
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.flow2sdl = void 0;
|
|
5
|
+
const constants_1 = require("../shared/constants");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
7
|
+
const flow2sdl = async ({ flow, endpoint, headers }, configuration) => {
|
|
8
|
+
return (0, helpers_1.queryIntrospectionService)((0, constants_1.getIntrospectionUrl)(configuration), {
|
|
9
|
+
operation: 'sdlForFlow',
|
|
10
|
+
variables: {
|
|
11
|
+
source: {
|
|
12
|
+
type: 'FlowDataSourceInput!',
|
|
13
|
+
value: {
|
|
14
|
+
flow,
|
|
15
|
+
endpoint,
|
|
16
|
+
headers: headers && headers.length > 0 ? headers : null,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.flow2sdl = flow2sdl;
|
|
23
|
+
//# sourceMappingURL=flow2sdl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow2sdl.js","sourceRoot":"","sources":["../../src/generate/flow2sdl.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;AAEjC,mDAAuD;AACvD,uCAAmD;AAa5C,MAAM,QAAQ,GAAG,KAAK,EAC3B,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAkB,EAC1C,aAAmC,EACa,EAAE;IAClD,OAAO,IAAA,mCAAyB,EAAC,IAAA,+BAAmB,EAAC,aAAa,CAAC,EAAE;QACnE,SAAS,EAAE,YAAY;QACvB,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE;oBACL,IAAI;oBACJ,QAAQ;oBACR,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;iBACxD;aACF;SACF;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAjBY,QAAA,QAAQ,YAiBpB"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.36.0-beta.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"delete": {
|
|
5
5
|
"id": "delete",
|
|
@@ -911,6 +911,80 @@
|
|
|
911
911
|
},
|
|
912
912
|
"args": {}
|
|
913
913
|
},
|
|
914
|
+
"import:flow": {
|
|
915
|
+
"id": "import:flow",
|
|
916
|
+
"description": "Import StepZen flow expression as a query field into your GraphQL API.\n\nstepzen import flow automatically introspects a GraphQL endpoint and adds a @sequence implementing the given flow expression into your GraphQL schema.",
|
|
917
|
+
"strict": true,
|
|
918
|
+
"pluginName": "stepzen",
|
|
919
|
+
"pluginAlias": "stepzen",
|
|
920
|
+
"pluginType": "core",
|
|
921
|
+
"aliases": [],
|
|
922
|
+
"flags": {
|
|
923
|
+
"help": {
|
|
924
|
+
"name": "help",
|
|
925
|
+
"type": "boolean",
|
|
926
|
+
"char": "h",
|
|
927
|
+
"description": "Show CLI help",
|
|
928
|
+
"allowNo": false
|
|
929
|
+
},
|
|
930
|
+
"non-interactive": {
|
|
931
|
+
"name": "non-interactive",
|
|
932
|
+
"type": "boolean",
|
|
933
|
+
"description": "Disable all interactive prompts",
|
|
934
|
+
"allowNo": false
|
|
935
|
+
},
|
|
936
|
+
"dir": {
|
|
937
|
+
"name": "dir",
|
|
938
|
+
"type": "option",
|
|
939
|
+
"description": "Working directory",
|
|
940
|
+
"multiple": false
|
|
941
|
+
},
|
|
942
|
+
"silent": {
|
|
943
|
+
"name": "silent",
|
|
944
|
+
"type": "boolean",
|
|
945
|
+
"description": "This is an internal flag passed by the (no-arg) Import command when it launches a data-source specific import command. The intent is to avoid showing a welcome message twice (if its already been shown by the (no-arg) Import command).",
|
|
946
|
+
"hidden": true,
|
|
947
|
+
"allowNo": false
|
|
948
|
+
},
|
|
949
|
+
"name": {
|
|
950
|
+
"name": "name",
|
|
951
|
+
"type": "option",
|
|
952
|
+
"description": "Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported schema.",
|
|
953
|
+
"multiple": false
|
|
954
|
+
},
|
|
955
|
+
"overwrite": {
|
|
956
|
+
"name": "overwrite",
|
|
957
|
+
"type": "boolean",
|
|
958
|
+
"description": "Overwrite any existing schema with the same name. Cannot be used without also providing a --name flag.",
|
|
959
|
+
"hidden": true,
|
|
960
|
+
"allowNo": false,
|
|
961
|
+
"dependsOn": [
|
|
962
|
+
"name"
|
|
963
|
+
]
|
|
964
|
+
},
|
|
965
|
+
"header": {
|
|
966
|
+
"name": "header",
|
|
967
|
+
"type": "option",
|
|
968
|
+
"char": "H",
|
|
969
|
+
"description": "Specifies a request header to pass\n\nExample:\nstepzen import curl https://example.com/api/customers \\\n\t-H \"Authorization: apikey SecretAPIKeyValue\"",
|
|
970
|
+
"multiple": true,
|
|
971
|
+
"dependsOn": [
|
|
972
|
+
"endpoint"
|
|
973
|
+
]
|
|
974
|
+
},
|
|
975
|
+
"endpoint": {
|
|
976
|
+
"name": "endpoint",
|
|
977
|
+
"type": "option",
|
|
978
|
+
"description": "Use a custom GraphQL schema instead of the project's schema as the schema providing the steps in the flow.",
|
|
979
|
+
"multiple": false
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
"args": {
|
|
983
|
+
"flow": {
|
|
984
|
+
"name": "flow"
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
},
|
|
914
988
|
"import:graphql": {
|
|
915
989
|
"id": "import:graphql",
|
|
916
990
|
"description": "Import a GraphQL API as a subgraph into your GraphQL API.\n\nstepzen import graphql automatically introspects a GraphQL endpoint and merges the types, queries, mutations and subscriptions for accessing this endpoint through a StepZen API into your GraphQL schema.",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stepzen",
|
|
3
3
|
"description": "The StepZen CLI",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.0-beta.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@oclif/plugin-help": "5.2.4",
|
|
31
31
|
"@oclif/plugin-version": "1.2.1",
|
|
32
32
|
"@soluble/dsn-parser": "^1.7.5",
|
|
33
|
-
"@stepzen/fetch": "0.
|
|
34
|
-
"@stepzen/graphiql-proxy": "0.
|
|
35
|
-
"@stepzen/sdk": "0.
|
|
36
|
-
"@stepzen/transpiler": "0.
|
|
33
|
+
"@stepzen/fetch": "0.36.0-beta.0",
|
|
34
|
+
"@stepzen/graphiql-proxy": "0.36.0-beta.0",
|
|
35
|
+
"@stepzen/sdk": "0.36.0-beta.0",
|
|
36
|
+
"@stepzen/transpiler": "0.36.0-beta.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"chokidar": "^3.5.3",
|
|
39
39
|
"compare-versions": "^5.0.3",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "105d85990c01c81e5a3421f47548d1e64641f78d"
|
|
147
147
|
}
|