stepzen 0.44.0 → 0.45.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 +76 -71
- package/bin/dev.cmd +1 -1
- package/bin/dev.js +6 -0
- package/bin/{run → run.js} +6 -20
- package/lib/commands/delete.d.ts +3 -3
- package/lib/commands/delete.d.ts.map +1 -1
- package/lib/commands/delete.js +32 -33
- package/lib/commands/delete.js.map +1 -1
- package/lib/commands/deploy.d.ts +10 -12
- package/lib/commands/deploy.d.ts.map +1 -1
- package/lib/commands/deploy.js +98 -98
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/import/curl.d.ts +17 -24
- package/lib/commands/import/curl.d.ts.map +1 -1
- package/lib/commands/import/curl.js +85 -85
- package/lib/commands/import/curl.js.map +1 -1
- package/lib/commands/import/db2.d.ts +20 -28
- package/lib/commands/import/db2.d.ts.map +1 -1
- package/lib/commands/import/db2.js +59 -62
- package/lib/commands/import/db2.js.map +1 -1
- package/lib/commands/import/flow.d.ts +10 -71
- package/lib/commands/import/flow.d.ts.map +1 -1
- package/lib/commands/import/flow.js +39 -43
- package/lib/commands/import/flow.js.map +1 -1
- package/lib/commands/import/graphql.d.ts +10 -18
- package/lib/commands/import/graphql.d.ts.map +1 -1
- package/lib/commands/import/graphql.js +38 -42
- package/lib/commands/import/graphql.js.map +1 -1
- package/lib/commands/import/index.d.ts +7 -10
- package/lib/commands/import/index.d.ts.map +1 -1
- package/lib/commands/import/index.js +52 -53
- package/lib/commands/import/index.js.map +1 -1
- package/lib/commands/import/mysql.d.ts +14 -22
- package/lib/commands/import/mysql.d.ts.map +1 -1
- package/lib/commands/import/mysql.js +53 -56
- package/lib/commands/import/mysql.js.map +1 -1
- package/lib/commands/import/openapi.d.ts +9 -16
- package/lib/commands/import/openapi.d.ts.map +1 -1
- package/lib/commands/import/openapi.js +38 -41
- package/lib/commands/import/openapi.js.map +1 -1
- package/lib/commands/import/oracle.d.ts +19 -26
- package/lib/commands/import/oracle.d.ts.map +1 -1
- package/lib/commands/import/oracle.js +56 -59
- package/lib/commands/import/oracle.js.map +1 -1
- package/lib/commands/import/postgresql.d.ts +15 -23
- package/lib/commands/import/postgresql.d.ts.map +1 -1
- package/lib/commands/import/postgresql.js +54 -57
- package/lib/commands/import/postgresql.js.map +1 -1
- package/lib/commands/import/presto.d.ts +14 -22
- package/lib/commands/import/presto.d.ts.map +1 -1
- package/lib/commands/import/presto.js +57 -60
- package/lib/commands/import/presto.js.map +1 -1
- package/lib/commands/import/snowflake.d.ts +16 -24
- package/lib/commands/import/snowflake.d.ts.map +1 -1
- package/lib/commands/import/snowflake.js +61 -64
- package/lib/commands/import/snowflake.js.map +1 -1
- package/lib/commands/init.d.ts +5 -7
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +22 -22
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/lint.d.ts +2 -4
- package/lib/commands/lint.d.ts.map +1 -1
- package/lib/commands/lint.js +15 -18
- package/lib/commands/lint.js.map +1 -1
- package/lib/commands/list.d.ts +4 -6
- package/lib/commands/list.d.ts.map +1 -1
- package/lib/commands/list.js +66 -63
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/login.d.ts +8 -10
- package/lib/commands/login.d.ts.map +1 -1
- package/lib/commands/login.js +94 -92
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/logout.d.ts +2 -3
- package/lib/commands/logout.d.ts.map +1 -1
- package/lib/commands/logout.js +8 -11
- package/lib/commands/logout.js.map +1 -1
- package/lib/commands/request.d.ts +10 -12
- package/lib/commands/request.d.ts.map +1 -1
- package/lib/commands/request.js +127 -129
- package/lib/commands/request.js.map +1 -1
- package/lib/commands/service.d.ts +9 -11
- package/lib/commands/service.d.ts.map +1 -1
- package/lib/commands/service.js +203 -203
- package/lib/commands/service.js.map +1 -1
- package/lib/commands/start.d.ts +13 -15
- package/lib/commands/start.d.ts.map +1 -1
- package/lib/commands/start.js +61 -60
- package/lib/commands/start.js.map +1 -1
- package/lib/commands/transpile.d.ts +8 -10
- package/lib/commands/transpile.d.ts.map +1 -1
- package/lib/commands/transpile.js +31 -34
- package/lib/commands/transpile.js.map +1 -1
- package/lib/commands/upload.d.ts +6 -8
- package/lib/commands/upload.d.ts.map +1 -1
- package/lib/commands/upload.js +41 -44
- package/lib/commands/upload.js.map +1 -1
- package/lib/commands/validate.d.ts +3 -4
- package/lib/commands/validate.d.ts.map +1 -1
- package/lib/commands/validate.js +23 -26
- package/lib/commands/validate.js.map +1 -1
- package/lib/commands/whoami.d.ts +6 -8
- package/lib/commands/whoami.d.ts.map +1 -1
- package/lib/commands/whoami.js +39 -48
- package/lib/commands/whoami.js.map +1 -1
- package/lib/generate/curl2sdl.d.ts +8 -8
- package/lib/generate/curl2sdl.d.ts.map +1 -1
- package/lib/generate/curl2sdl.js +16 -20
- package/lib/generate/curl2sdl.js.map +1 -1
- package/lib/generate/flags.d.ts +11 -11
- package/lib/generate/flags.d.ts.map +1 -1
- package/lib/generate/flags.js +16 -17
- package/lib/generate/flags.js.map +1 -1
- package/lib/generate/flow2sdl.d.ts +5 -5
- package/lib/generate/flow2sdl.d.ts.map +1 -1
- package/lib/generate/flow2sdl.js +13 -19
- package/lib/generate/flow2sdl.js.map +1 -1
- package/lib/generate/graphql2sdl.d.ts +5 -5
- package/lib/generate/graphql2sdl.d.ts.map +1 -1
- package/lib/generate/graphql2sdl.js +22 -28
- package/lib/generate/graphql2sdl.js.map +1 -1
- package/lib/generate/helpers.d.ts +5 -5
- package/lib/generate/helpers.d.ts.map +1 -1
- package/lib/generate/helpers.js +39 -44
- package/lib/generate/helpers.js.map +1 -1
- package/lib/generate/import-command.d.ts +7 -13
- package/lib/generate/import-command.d.ts.map +1 -1
- package/lib/generate/import-command.js +51 -52
- package/lib/generate/import-command.js.map +1 -1
- package/lib/generate/openapi2sdl.d.ts +4 -4
- package/lib/generate/openapi2sdl.d.ts.map +1 -1
- package/lib/generate/openapi2sdl.js +10 -16
- package/lib/generate/openapi2sdl.js.map +1 -1
- package/lib/generate/questions.d.ts.map +1 -1
- package/lib/generate/questions.js +4 -7
- package/lib/generate/questions.js.map +1 -1
- package/lib/generate/sql2sdl.d.ts +13 -13
- package/lib/generate/sql2sdl.d.ts.map +1 -1
- package/lib/generate/sql2sdl.js +13 -16
- package/lib/generate/sql2sdl.js.map +1 -1
- package/lib/hooks/init/version.d.ts +1 -1
- package/lib/hooks/init/version.d.ts.map +1 -1
- package/lib/hooks/init/version.js +11 -9
- package/lib/hooks/init/version.js.map +1 -1
- package/lib/hooks/prerun/check-upgrade.d.ts +1 -1
- package/lib/hooks/prerun/check-upgrade.d.ts.map +1 -1
- package/lib/hooks/prerun/check-upgrade.js +42 -46
- package/lib/hooks/prerun/check-upgrade.js.map +1 -1
- package/lib/hooks/prerun/ensure-config-file.d.ts +1 -1
- package/lib/hooks/prerun/ensure-config-file.d.ts.map +1 -1
- package/lib/hooks/prerun/ensure-config-file.js +9 -11
- package/lib/hooks/prerun/ensure-config-file.js.map +1 -1
- package/lib/hooks/prerun/ensure-permissions.d.ts +1 -1
- package/lib/hooks/prerun/ensure-permissions.d.ts.map +1 -1
- package/lib/hooks/prerun/ensure-permissions.js +15 -11
- package/lib/hooks/prerun/ensure-permissions.js.map +1 -1
- package/lib/index.js +1 -5
- package/lib/index.js.map +1 -1
- package/lib/shared/actions.d.ts +2 -2
- package/lib/shared/actions.d.ts.map +1 -1
- package/lib/shared/actions.js +15 -21
- package/lib/shared/actions.js.map +1 -1
- package/lib/shared/configuration.d.ts +5 -3
- package/lib/shared/configuration.d.ts.map +1 -1
- package/lib/shared/configuration.js +39 -52
- package/lib/shared/configuration.js.map +1 -1
- package/lib/shared/constants.d.ts +7 -4
- package/lib/shared/constants.d.ts.map +1 -1
- package/lib/shared/constants.js +70 -86
- package/lib/shared/constants.js.map +1 -1
- package/lib/shared/curl-parser.d.ts +2 -2
- package/lib/shared/curl-parser.d.ts.map +1 -1
- package/lib/shared/curl-parser.js +9 -13
- package/lib/shared/curl-parser.js.map +1 -1
- package/lib/shared/docker.d.ts +2 -4
- package/lib/shared/docker.d.ts.map +1 -1
- package/lib/shared/docker.js +40 -48
- package/lib/shared/docker.js.map +1 -1
- package/lib/shared/errors.js +7 -11
- package/lib/shared/errors.js.map +1 -1
- package/lib/shared/header-params-parser.d.ts +2 -4
- package/lib/shared/header-params-parser.d.ts.map +1 -1
- package/lib/shared/header-params-parser.js +23 -29
- package/lib/shared/header-params-parser.js.map +1 -1
- package/lib/shared/header.d.ts +7 -7
- package/lib/shared/header.d.ts.map +1 -1
- package/lib/shared/header.js +5 -10
- package/lib/shared/header.js.map +1 -1
- package/lib/shared/inquirer.d.ts +7 -6
- package/lib/shared/inquirer.d.ts.map +1 -1
- package/lib/shared/inquirer.js +29 -37
- package/lib/shared/inquirer.js.map +1 -1
- package/lib/shared/moniker.js +4 -9
- package/lib/shared/moniker.js.map +1 -1
- package/lib/shared/path-params-parser.d.ts +2 -2
- package/lib/shared/path-params-parser.d.ts.map +1 -1
- package/lib/shared/path-params-parser.js +6 -12
- package/lib/shared/path-params-parser.js.map +1 -1
- package/lib/shared/request-variables-parser.d.ts +4 -4
- package/lib/shared/request-variables-parser.d.ts.map +1 -1
- package/lib/shared/request-variables-parser.js +10 -14
- package/lib/shared/request-variables-parser.js.map +1 -1
- package/lib/shared/rmtemp.d.ts +1 -0
- package/lib/shared/rmtemp.d.ts.map +1 -1
- package/lib/shared/rmtemp.js +7 -10
- package/lib/shared/rmtemp.js.map +1 -1
- package/lib/shared/segment.d.ts +10 -0
- package/lib/shared/segment.d.ts.map +1 -0
- package/lib/shared/segment.js +162 -0
- package/lib/shared/segment.js.map +1 -0
- package/lib/shared/stepzen-sdk.d.ts +8 -8
- package/lib/shared/stepzen-sdk.d.ts.map +1 -1
- package/lib/shared/stepzen-sdk.js +27 -36
- package/lib/shared/stepzen-sdk.js.map +1 -1
- package/lib/shared/types.d.ts +13 -11
- package/lib/shared/types.d.ts.map +1 -1
- package/lib/shared/types.js +1 -2
- package/lib/shared/url-helpers.d.ts.map +1 -1
- package/lib/shared/url-helpers.js +7 -14
- package/lib/shared/url-helpers.js.map +1 -1
- package/lib/shared/utils.d.ts +2 -2
- package/lib/shared/utils.d.ts.map +1 -1
- package/lib/shared/utils.js +55 -71
- package/lib/shared/utils.js.map +1 -1
- package/lib/shared/validation.js +12 -17
- package/lib/shared/validation.js.map +1 -1
- package/lib/shared/workspace.d.ts +1 -1
- package/lib/shared/workspace.d.ts.map +1 -1
- package/lib/shared/workspace.js +34 -45
- package/lib/shared/workspace.js.map +1 -1
- package/lib/shared/zen-command.d.ts +5 -10
- package/lib/shared/zen-command.d.ts.map +1 -1
- package/lib/shared/zen-command.js +132 -113
- package/lib/shared/zen-command.js.map +1 -1
- package/oclif.manifest.json +1281 -945
- package/package.json +35 -33
- package/bin/dev +0 -23
|
@@ -1,22 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright IBM Corp. 2020, 2024
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { CLIError } from '@oclif/core/errors';
|
|
4
|
+
import { parseDsn } from '@soluble/dsn-parser';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { pickBy } from 'lodash-es';
|
|
7
|
+
import { ImportFlags } from '../../generate/flags.js';
|
|
8
|
+
import { ImportCommandBase } from '../../generate/import-command.js';
|
|
9
|
+
import { ImportQuestions } from '../../generate/questions.js';
|
|
10
|
+
import { sql2sdl } from '../../generate/sql2sdl.js';
|
|
11
|
+
import { readConfiguration } from '../../shared/configuration.js';
|
|
12
|
+
import * as inquirer from '../../shared/inquirer.js';
|
|
13
|
+
import { parseSnowflakeAccountId } from '../../shared/utils.js';
|
|
14
|
+
export default class ImportSnowflake extends ImportCommandBase {
|
|
15
|
+
static description = `Import a schema for a Snowflake data source into your GraphQL API.` +
|
|
16
|
+
`\n` +
|
|
17
|
+
chalk `\n{bold stepzen import snowflake} automatically introspects a` +
|
|
18
|
+
` Snowflake database, generates a GraphQL schema for accessing this` +
|
|
19
|
+
` database through a StepZen API, and merges the generated types,` +
|
|
20
|
+
` queries and mutations into your GraphQL schema.`;
|
|
17
21
|
get source() {
|
|
18
22
|
return 'snowflake';
|
|
19
23
|
}
|
|
24
|
+
static flags = {
|
|
25
|
+
...ImportCommandBase.flags,
|
|
26
|
+
// 'db-host': ImportFlags.dbHost(), -- intentionally omitted (Snowflake uses an "account ID" instead)
|
|
27
|
+
'db-user': ImportFlags.dbUser(),
|
|
28
|
+
'db-password': ImportFlags.dbPassword(),
|
|
29
|
+
'db-database': ImportFlags.dbDatabase(),
|
|
30
|
+
'db-schema': ImportFlags.dbSchema({ default: 'PUBLIC' }),
|
|
31
|
+
'db-link-types': ImportFlags.dbLinkTypes(),
|
|
32
|
+
'db-include': ImportFlags.dbInclude(),
|
|
33
|
+
'db-use-deprecated-2022-naming': ImportFlags.dbUseDeprecatedNaming(),
|
|
34
|
+
'snowflake-account-id': Flags.string({
|
|
35
|
+
description: chalk `Snowflake account identifier in the {bold orgname-accountname}` +
|
|
36
|
+
chalk ` format. For more information, see the Snowflake documentation at` +
|
|
37
|
+
chalk ` https://docs.snowflake.com/en/user-guide/admin-account-identifier.html.`,
|
|
38
|
+
}),
|
|
39
|
+
'snowflake-warehouse': Flags.string({
|
|
40
|
+
description: 'Snowflake warehouse',
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
static args = {
|
|
44
|
+
dsn: Args.string({
|
|
45
|
+
description: chalk `{italic (optional)} Data Source Name (DSN) of a Snowflake database.` +
|
|
46
|
+
chalk `\nExample: {bold snowflake://user:password@orgname-accountname/database?warehouse=warehouse&schema=schema}` +
|
|
47
|
+
chalk `\n` +
|
|
48
|
+
chalk `\nFlags, such as {bold --db-host}, override the corresponding` +
|
|
49
|
+
chalk ` parts of the DSN (if both are provided).`,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
20
52
|
async import(commonOptions) {
|
|
21
53
|
const { args, flags } = await this.parse(ImportSnowflake);
|
|
22
54
|
const nonInteractiveOptions = {
|
|
@@ -44,7 +76,7 @@ class ImportSnowflake extends import_command_1.ImportCommandBase {
|
|
|
44
76
|
}
|
|
45
77
|
else {
|
|
46
78
|
if (flags['non-interactive']) {
|
|
47
|
-
throw new
|
|
79
|
+
throw new CLIError('Please provide a Data Source Name (DSN) string for a Snowflake database.' +
|
|
48
80
|
chalk `\nSee more help with {bold stepzen import snowflake --help}`);
|
|
49
81
|
}
|
|
50
82
|
// no parameters given: start an interactive prompt
|
|
@@ -73,8 +105,8 @@ class ImportSnowflake extends import_command_1.ImportCommandBase {
|
|
|
73
105
|
sql2sdlOptions.schema = sql2sdlOptions.schema
|
|
74
106
|
? sql2sdlOptions.schema.toUpperCase()
|
|
75
107
|
: 'PUBLIC';
|
|
76
|
-
const configuration = await
|
|
77
|
-
return this.wrapInProgressAndTimeout(
|
|
108
|
+
const configuration = await readConfiguration();
|
|
109
|
+
return this.wrapInProgressAndTimeout(sql2sdl(sql2sdlOptions, configuration));
|
|
78
110
|
}
|
|
79
111
|
getImportOptionsFromFlags(flags) {
|
|
80
112
|
const options = {
|
|
@@ -93,10 +125,10 @@ class ImportSnowflake extends import_command_1.ImportCommandBase {
|
|
|
93
125
|
},
|
|
94
126
|
};
|
|
95
127
|
// Remove `undefined`-valued properties
|
|
96
|
-
return
|
|
128
|
+
return pickBy(options, value => value !== undefined);
|
|
97
129
|
}
|
|
98
130
|
getImportOptionsFromDsn(possibleDsn) {
|
|
99
|
-
const parsed =
|
|
131
|
+
const parsed = parseDsn(possibleDsn);
|
|
100
132
|
if (parsed.success) {
|
|
101
133
|
const value = parsed.value;
|
|
102
134
|
const options = {
|
|
@@ -112,25 +144,25 @@ class ImportSnowflake extends import_command_1.ImportCommandBase {
|
|
|
112
144
|
: `${value.params?.warehouse}`,
|
|
113
145
|
};
|
|
114
146
|
// Remove `undefined`-valued properties
|
|
115
|
-
return
|
|
147
|
+
return pickBy(options, value => value !== undefined);
|
|
116
148
|
}
|
|
117
|
-
throw new
|
|
149
|
+
throw new CLIError(parsed.message);
|
|
118
150
|
}
|
|
119
151
|
async getImportOptionsInteractively(defaults = {}) {
|
|
120
152
|
const questions = inquirer.overrideDefaults([
|
|
121
153
|
{
|
|
122
154
|
name: 'accountId',
|
|
123
155
|
message: 'What is your Snowflake account identifier?',
|
|
124
|
-
validate
|
|
125
|
-
const { error } =
|
|
156
|
+
validate(input) {
|
|
157
|
+
const { error } = parseSnowflakeAccountId(input);
|
|
126
158
|
return error ? error.message : true;
|
|
127
159
|
},
|
|
128
160
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
161
|
+
ImportQuestions.dbUser(),
|
|
162
|
+
ImportQuestions.dbPassword(),
|
|
163
|
+
ImportQuestions.dbDatabase(),
|
|
132
164
|
{
|
|
133
|
-
...
|
|
165
|
+
...ImportQuestions.dbSchema(),
|
|
134
166
|
filter: input => input.toUpperCase(),
|
|
135
167
|
},
|
|
136
168
|
{
|
|
@@ -138,44 +170,9 @@ class ImportSnowflake extends import_command_1.ImportCommandBase {
|
|
|
138
170
|
message: 'What is your Snowflake warehouse?',
|
|
139
171
|
validate: input => input.trim() !== '' || 'Snowflake warehouse must not be empty',
|
|
140
172
|
},
|
|
141
|
-
|
|
173
|
+
ImportQuestions.dbLinkTypes(),
|
|
142
174
|
], defaults);
|
|
143
175
|
return inquirer.prompt(`import-${this.source}`, questions);
|
|
144
176
|
}
|
|
145
177
|
}
|
|
146
|
-
exports.default = ImportSnowflake;
|
|
147
|
-
ImportSnowflake.description = `Import a schema for a Snowflake data source into your GraphQL API.` +
|
|
148
|
-
`\n` +
|
|
149
|
-
chalk `\n{bold stepzen import snowflake} automatically introspects a` +
|
|
150
|
-
` Snowflake database, generates a GraphQL schema for accessing this` +
|
|
151
|
-
` database through a StepZen API, and merges the generated types,` +
|
|
152
|
-
` queries and mutations into your GraphQL schema.`;
|
|
153
|
-
ImportSnowflake.flags = {
|
|
154
|
-
...import_command_1.ImportCommandBase.flags,
|
|
155
|
-
// 'db-host': ImportFlags.dbHost(), -- intentionally omitted (Snowflake uses an "account ID" instead)
|
|
156
|
-
'db-user': flags_1.ImportFlags.dbUser(),
|
|
157
|
-
'db-password': flags_1.ImportFlags.dbPassword(),
|
|
158
|
-
'db-database': flags_1.ImportFlags.dbDatabase(),
|
|
159
|
-
'db-schema': flags_1.ImportFlags.dbSchema({ default: 'PUBLIC' }),
|
|
160
|
-
'db-link-types': flags_1.ImportFlags.dbLinkTypes(),
|
|
161
|
-
'db-include': flags_1.ImportFlags.dbInclude(),
|
|
162
|
-
'db-use-deprecated-2022-naming': flags_1.ImportFlags.dbUseDeprecatedNaming(),
|
|
163
|
-
'snowflake-account-id': core_1.Flags.string({
|
|
164
|
-
description: chalk `Snowflake account identifier in the {bold orgname-accountname}` +
|
|
165
|
-
chalk ` format. For more information, see the Snowflake documentation at` +
|
|
166
|
-
chalk ` https://docs.snowflake.com/en/user-guide/admin-account-identifier.html.`,
|
|
167
|
-
}),
|
|
168
|
-
'snowflake-warehouse': core_1.Flags.string({
|
|
169
|
-
description: 'Snowflake warehouse',
|
|
170
|
-
}),
|
|
171
|
-
};
|
|
172
|
-
ImportSnowflake.args = {
|
|
173
|
-
dsn: core_1.Args.string({
|
|
174
|
-
description: chalk `{italic (optional)} Data Source Name (DSN) of a Snowflake database.` +
|
|
175
|
-
chalk `\nExample: {bold snowflake://user:password@orgname-accountname/database?warehouse=warehouse&schema=schema}` +
|
|
176
|
-
chalk `\n` +
|
|
177
|
-
chalk `\nFlags, such as {bold --db-host}, override the corresponding` +
|
|
178
|
-
chalk ` parts of the DSN (if both are provided).`,
|
|
179
|
-
}),
|
|
180
|
-
};
|
|
181
178
|
//# sourceMappingURL=snowflake.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../src/commands/import/snowflake.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../src/commands/import/snowflake.ts"],"names":[],"mappings":"AAAA,iCAAiC;AASjC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAA;AAa7D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,iBAAiB;IAC5D,MAAM,CAAC,WAAW,GAChB,oEAAoE;QACpE,IAAI;QACJ,KAAK,CAAA,+DAA+D;QACpE,oEAAoE;QACpE,kEAAkE;QAClE,kDAAkD,CAAA;IAEpD,IAAI,MAAM;QACR,OAAO,WAAoB,CAAA;IAC7B,CAAC;IAED,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,iBAAiB,CAAC,KAAK;QAC1B,qGAAqG;QACrG,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE;QAC/B,aAAa,EAAE,WAAW,CAAC,UAAU,EAAE;QACvC,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,EAAE,KAAK,EAAE,IAAI,uCAAuC;aACjE;YACD,eAAe,CAAC,WAAW,EAAE;SAC9B,EACD,QAAQ,CACT,CAAA;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAA;IAC5D,CAAC"}
|
package/lib/commands/init.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import ZenCommand from '../shared/zen-command';
|
|
1
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
2
2
|
export default class Init extends ZenCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
endpoint: import("@oclif/core/
|
|
6
|
-
yes: import("@oclif/core/
|
|
7
|
-
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
|
-
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
|
+
endpoint: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
7
|
};
|
|
10
8
|
static args: {
|
|
11
|
-
directory: import("@oclif/core/
|
|
9
|
+
directory: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
12
10
|
};
|
|
13
|
-
run(): Promise<import("../shared/types").Workspace>;
|
|
11
|
+
run(): Promise<import("../shared/types.js").Workspace>;
|
|
14
12
|
}
|
|
15
13
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAMA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,UAAU;IAC1C,MAAM,CAAC,WAAW,SAC0C;IAE5D,MAAM,CAAC,KAAK;;;MASX;IAED,MAAM,CAAC,IAAI;;MAEV;IAEK,GAAG;CAeV"}
|
package/lib/commands/init.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright IBM Corp. 2020, 2024
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Init extends
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { trackInitCommand } from '../shared/segment.js';
|
|
4
|
+
import { initWorkspace } from '../shared/workspace.js';
|
|
5
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
6
|
+
export default class Init extends ZenCommand {
|
|
7
|
+
static description = 'Initialize a StepZen workspace in the current directory.';
|
|
8
|
+
static flags = {
|
|
9
|
+
...ZenCommand.flags,
|
|
10
|
+
endpoint: Flags.string({
|
|
11
|
+
description: 'Endpoint name (e.g. api/myapp)',
|
|
12
|
+
}),
|
|
13
|
+
yes: Flags.boolean({
|
|
14
|
+
description: 'Accept default answers to interactive prompts',
|
|
15
|
+
default: false,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
static args = {
|
|
19
|
+
directory: Args.string({ hidden: true }),
|
|
20
|
+
};
|
|
8
21
|
async run() {
|
|
9
22
|
const { args, flags } = await this.parse(Init);
|
|
10
|
-
const created = await
|
|
23
|
+
const created = await initWorkspace({
|
|
11
24
|
directory: args.directory,
|
|
12
25
|
endpoint: flags.endpoint,
|
|
13
26
|
yes: flags.yes,
|
|
14
27
|
nonInteractive: flags['non-interactive'],
|
|
15
28
|
});
|
|
16
29
|
this.log(`Created a StepZen workspace in ${created.directory}`);
|
|
30
|
+
// track stepzen init command
|
|
31
|
+
trackInitCommand(created.directory);
|
|
17
32
|
return created;
|
|
18
33
|
}
|
|
19
34
|
}
|
|
20
|
-
exports.default = Init;
|
|
21
|
-
Init.description = 'Initialize a StepZen workspace in the current directory.';
|
|
22
|
-
Init.flags = {
|
|
23
|
-
...zen_command_1.default.flags,
|
|
24
|
-
endpoint: core_1.Flags.string({
|
|
25
|
-
description: 'Endpoint name (e.g. api/myapp)',
|
|
26
|
-
}),
|
|
27
|
-
yes: core_1.Flags.boolean({
|
|
28
|
-
description: 'Accept default answers to interactive prompts',
|
|
29
|
-
default: false,
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
Init.args = {
|
|
33
|
-
directory: core_1.Args.string({ hidden: true }),
|
|
34
|
-
};
|
|
35
35
|
//# sourceMappingURL=init.js.map
|
package/lib/commands/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AACpD,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,UAAU;IAC1C,MAAM,CAAC,WAAW,GAChB,0DAA0D,CAAA;IAE5D,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,UAAU,CAAC,KAAK;QACnB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,gCAAgC;SAC9C,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;YACjB,WAAW,EAAE,+CAA+C;YAC5D,OAAO,EAAE,KAAK;SACf,CAAC;KACH,CAAA;IAED,MAAM,CAAC,IAAI,GAAG;QACZ,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;KACvC,CAAA;IAED,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE5C,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC;YAClC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,cAAc,EAAE,KAAK,CAAC,iBAAiB,CAAC;SACzC,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,kCAAkC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;QAC/D,8BAA8B;QAC9B,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACnC,OAAO,OAAO,CAAA;IAChB,CAAC"}
|
package/lib/commands/lint.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import ZenCommand from '../shared/zen-command';
|
|
1
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
2
2
|
export default class Init extends ZenCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static hidden: boolean;
|
|
5
5
|
static flags: {
|
|
6
|
-
dir: import("@oclif/core/
|
|
7
|
-
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
|
-
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
dir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
7
|
};
|
|
10
8
|
run(): Promise<void>;
|
|
11
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAMA,OAAO,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAMA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,UAAU;IAC1C,MAAM,CAAC,WAAW,SAAkB;IAEpC,MAAM,CAAC,MAAM,UAAO;IAEpB,MAAM,CAAC,KAAK;;MAGX;IAEK,GAAG;CAmBV"}
|
package/lib/commands/lint.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright IBM Corp. 2020, 2024
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { Flags } from '@oclif/core';
|
|
3
|
+
import { lint } from '@stepzen/transpiler';
|
|
4
|
+
import { getDirectory, getStepZenExtensions } from '../shared/utils.js';
|
|
5
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
6
|
+
export default class Init extends ZenCommand {
|
|
7
|
+
static description = 'StepZen lint.';
|
|
8
|
+
static hidden = true;
|
|
9
|
+
static flags = {
|
|
10
|
+
...ZenCommand.flags,
|
|
11
|
+
dir: Flags.string({ hidden: true }),
|
|
12
|
+
};
|
|
9
13
|
async run() {
|
|
10
14
|
const { flags } = await this.parse(Init);
|
|
11
15
|
// Get the correct directory
|
|
12
|
-
const directory =
|
|
16
|
+
const directory = getDirectory(flags.dir);
|
|
13
17
|
this.log(directory);
|
|
14
18
|
// Take over console.log
|
|
15
19
|
console.log = (msg) => {
|
|
16
20
|
let formatted = msg;
|
|
17
|
-
formatted = formatted.
|
|
21
|
+
formatted = formatted.replaceAll(/ +/g, ' ');
|
|
18
22
|
this.log(formatted);
|
|
19
23
|
};
|
|
20
24
|
// Lint
|
|
21
|
-
await
|
|
22
|
-
extensions: await
|
|
25
|
+
await lint(directory, {
|
|
26
|
+
extensions: await getStepZenExtensions(),
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
|
-
exports.default = Init;
|
|
27
|
-
Init.description = 'StepZen lint.';
|
|
28
|
-
Init.hidden = true;
|
|
29
|
-
Init.flags = {
|
|
30
|
-
...zen_command_1.default.flags,
|
|
31
|
-
dir: core_1.Flags.string({ hidden: true }),
|
|
32
|
-
};
|
|
33
30
|
//# sourceMappingURL=lint.js.map
|
package/lib/commands/lint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA,iCAAiC;AAEjC,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAA;AAExC,OAAO,EAAC,YAAY,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAA;AACrE,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,UAAU;IAC1C,MAAM,CAAC,WAAW,GAAG,eAAe,CAAA;IAEpC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAA;IAEpB,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,UAAU,CAAC,KAAK;QACnB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;KAClC,CAAA;IAED,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEtC,4BAA4B;QAC5B,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QAEnB,wBAAwB;QACxB,OAAO,CAAC,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE;YAC5B,IAAI,SAAS,GAAG,GAAG,CAAA;YACnB,SAAS,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;YAC7C,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACrB,CAAC,CAAA;QAED,OAAO;QACP,MAAM,IAAI,CAAC,SAAS,EAAE;YACpB,UAAU,EAAE,MAAM,oBAAoB,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC"}
|
package/lib/commands/list.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import ZenCommand from '../shared/zen-command';
|
|
1
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
2
2
|
export default class List extends ZenCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
folder: import("@oclif/core/
|
|
6
|
-
name: import("@oclif/core/
|
|
7
|
-
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
|
-
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
|
+
folder: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
7
|
};
|
|
10
8
|
static args: {
|
|
11
|
-
type: import("@oclif/core/
|
|
9
|
+
type: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
12
10
|
};
|
|
13
11
|
run(): Promise<void>;
|
|
14
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAiBA,OAAO,UAAU,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,UAAU;IAC1C,MAAM,CAAC,WAAW,SAGyB;IAE3C,MAAM,CAAC,KAAK;;;MAQX;IAED,MAAM,CAAC,IAAI;;MAWV;IAEK,GAAG;CAqIV"}
|
package/lib/commands/list.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright IBM Corp. 2020, 2024
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class List extends
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { CLIError } from '@oclif/core/errors';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import debug from 'debug';
|
|
6
|
+
import Table from 'tty-table';
|
|
7
|
+
import { list } from '../shared/actions.js';
|
|
8
|
+
import { writeCredentialsAndServiceToConfigFile } from '../shared/configuration.js';
|
|
9
|
+
import { getDeploymentType } from '../shared/constants.js';
|
|
10
|
+
import { PERMANENT_STEPZEN_ERROR } from '../shared/errors.js';
|
|
11
|
+
import { tryZenCtl2ThenZenCtl1 } from '../shared/stepzen-sdk.js';
|
|
12
|
+
import ZenCommand from '../shared/zen-command.js';
|
|
13
|
+
export default class List extends ZenCommand {
|
|
14
|
+
static description = `List endpoints, schemas and configuration sets in your StepZen account.` +
|
|
15
|
+
chalk `\nAll timestamps displayed by {bold stepzen list endpoints} are in` +
|
|
16
|
+
chalk ` your {underline local time zone}.`;
|
|
17
|
+
static flags = {
|
|
18
|
+
...ZenCommand.flags,
|
|
19
|
+
folder: Flags.string({
|
|
20
|
+
description: chalk `Filter the list to only show endpoints within a specific folder. example usage --folder folder_name or --folder !folder_name`,
|
|
21
|
+
}),
|
|
22
|
+
name: Flags.string({
|
|
23
|
+
description: chalk `Filter the list to only show endpoints with a specific name. example usage --name endpoint_name or --name '!endpoint_name'`,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
static args = {
|
|
27
|
+
type: Args.string({
|
|
28
|
+
default: 'endpoints',
|
|
29
|
+
description: chalk `
|
|
30
|
+
|
|
31
|
+
The type of entities to list:
|
|
32
|
+
\t{bold endpoints} - GraphQL API endpoints deployed with {underline stepzen deploy} (or {underline stepzen start})
|
|
33
|
+
\t{bold schemas} {yellow [DEPRECATED]} - StepZen schemas uploaded with {underline stepzen upload} (or {underline stepzen start})
|
|
34
|
+
\t{bold configurationsets} {yellow [DEPRECATED]} - StepZen configuration sets uploaded with {underline stepzen upload} (or {underline stepzen start})`,
|
|
35
|
+
options: ['endpoints', 'configurationsets', 'schemas'],
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
15
38
|
async run() {
|
|
16
39
|
const { args, flags } = await this.parse(List);
|
|
17
40
|
const type = args.type;
|
|
@@ -22,18 +45,18 @@ class List extends zen_command_1.default {
|
|
|
22
45
|
const { configuration } = await this.ensureStepZenAccount({
|
|
23
46
|
nonInteractive: flags['non-interactive'],
|
|
24
47
|
});
|
|
25
|
-
const { result, configuration: effectiveConfig, configMigrated, } = await
|
|
48
|
+
const { result, configuration: effectiveConfig, configMigrated, } = await tryZenCtl2ThenZenCtl1(configuration, async (stepzen) => {
|
|
26
49
|
if (stepzen.version === 'v2') {
|
|
27
50
|
if (type !== 'endpoints') {
|
|
28
51
|
// zenctl2 does not support listing schemas and configuration sets
|
|
29
|
-
throw new
|
|
52
|
+
throw new CLIError(chalk `{bold stepzen list ${type}} is no longer supported.` +
|
|
30
53
|
chalk ` Please use {bold stepzen list endpoints} instead.`);
|
|
31
54
|
}
|
|
32
55
|
// listing a non-deprecated type and the v2 API is available
|
|
33
56
|
const client = await stepzen.client({
|
|
34
57
|
account: configuration.account,
|
|
35
58
|
adminKey: configuration.adminkey,
|
|
36
|
-
deploymentType:
|
|
59
|
+
deploymentType: getDeploymentType(configuration),
|
|
37
60
|
});
|
|
38
61
|
const params = {};
|
|
39
62
|
if (flags.folder) {
|
|
@@ -43,12 +66,14 @@ class List extends zen_command_1.default {
|
|
|
43
66
|
params.name = flags.name;
|
|
44
67
|
}
|
|
45
68
|
const response = await client.list.endpoints(params);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
69
|
+
if (response.data) {
|
|
70
|
+
// filter out the internal properties so that they are not printed out
|
|
71
|
+
for (const endpoint of response.data) {
|
|
72
|
+
delete endpoint.public;
|
|
73
|
+
delete endpoint.deploymentType;
|
|
74
|
+
delete endpoint.endpointType;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
52
77
|
return response;
|
|
53
78
|
}
|
|
54
79
|
if (flags.folder || flags.name) {
|
|
@@ -56,7 +81,7 @@ class List extends zen_command_1.default {
|
|
|
56
81
|
this.warn(chalk `{yellow the {bold --folder} and {bold --name} flags are not supported for accounts in the {bold stepzen.net} domain.}`);
|
|
57
82
|
}
|
|
58
83
|
// the zenctl2 API is not available => using zenctl1
|
|
59
|
-
const response = await
|
|
84
|
+
const response = await list(type);
|
|
60
85
|
return response.success
|
|
61
86
|
? {
|
|
62
87
|
data: response.results || [],
|
|
@@ -68,7 +93,7 @@ class List extends zen_command_1.default {
|
|
|
68
93
|
};
|
|
69
94
|
});
|
|
70
95
|
if (configMigrated) {
|
|
71
|
-
await
|
|
96
|
+
await writeCredentialsAndServiceToConfigFile(effectiveConfig, effectiveConfig.serviceInstance);
|
|
72
97
|
}
|
|
73
98
|
const { data, error } = result;
|
|
74
99
|
if (data) {
|
|
@@ -84,55 +109,33 @@ class List extends zen_command_1.default {
|
|
|
84
109
|
else {
|
|
85
110
|
// zenctl v2
|
|
86
111
|
const endpoints = data;
|
|
87
|
-
// eslint-disable-next-line new-cap
|
|
88
112
|
const dtf = new Intl.DateTimeFormat(undefined, {
|
|
89
113
|
dateStyle: 'medium',
|
|
90
114
|
timeStyle: 'short',
|
|
91
115
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
header: 'Updated at',
|
|
102
|
-
get: row => dtf.format(new Date(row.updatedAt)),
|
|
116
|
+
this.log(
|
|
117
|
+
// eslint-disable-next-line new-cap
|
|
118
|
+
Table([
|
|
119
|
+
{
|
|
120
|
+
alias: 'Endpoint',
|
|
121
|
+
value: 'endpoint',
|
|
122
|
+
align: 'left',
|
|
123
|
+
headerAlign: 'left',
|
|
124
|
+
headerColor: 'bold',
|
|
103
125
|
},
|
|
104
|
-
|
|
126
|
+
{ alias: 'Created at', value: 'createdAt', headerColor: 'bold' },
|
|
127
|
+
{ alias: 'Updated at', value: 'updatedAt', headerColor: 'bold' },
|
|
128
|
+
], endpoints.map(item => ({
|
|
129
|
+
endpoint: `${item.folderName}/${item.endpointName}`,
|
|
130
|
+
createdAt: dtf.format(item.createdAt),
|
|
131
|
+
updatedAt: dtf.format(item.updatedAt),
|
|
132
|
+
})), { compact: true }).render());
|
|
105
133
|
}
|
|
106
134
|
}
|
|
107
135
|
else {
|
|
108
136
|
debug('stepzen:list')('failed to execute stepzen.list: ' + error.message);
|
|
109
|
-
throw new
|
|
137
|
+
throw new CLIError(PERMANENT_STEPZEN_ERROR);
|
|
110
138
|
}
|
|
111
139
|
}
|
|
112
140
|
}
|
|
113
|
-
exports.default = List;
|
|
114
|
-
List.description = `List endpoints, schemas and configuration sets in your StepZen account.` +
|
|
115
|
-
chalk `\nAll timestamps displayed by {bold stepzen list endpoints} are in` +
|
|
116
|
-
chalk ` your {underline local time zone}.`;
|
|
117
|
-
List.flags = {
|
|
118
|
-
...zen_command_1.default.flags,
|
|
119
|
-
folder: core_1.Flags.string({
|
|
120
|
-
description: chalk `Filter the list to only show endpoints within a specific folder. example usage --folder folder_name or --folder !folder_name`,
|
|
121
|
-
}),
|
|
122
|
-
name: core_1.Flags.string({
|
|
123
|
-
description: chalk `Filter the list to only show endpoints with a specific name. example usage --name endpoint_name or --name '!endpoint_name'`,
|
|
124
|
-
}),
|
|
125
|
-
};
|
|
126
|
-
List.args = {
|
|
127
|
-
type: core_1.Args.string({
|
|
128
|
-
default: 'endpoints',
|
|
129
|
-
description: chalk `
|
|
130
|
-
|
|
131
|
-
The type of entities to list:
|
|
132
|
-
\t{bold endpoints} - GraphQL API endpoints deployed with {underline stepzen deploy} (or {underline stepzen start})
|
|
133
|
-
\t{bold schemas} {yellow [DEPRECATED]} - StepZen schemas uploaded with {underline stepzen upload} (or {underline stepzen start})
|
|
134
|
-
\t{bold configurationsets} {yellow [DEPRECATED]} - StepZen configuration sets uploaded with {underline stepzen upload} (or {underline stepzen start})`,
|
|
135
|
-
options: ['endpoints', 'configurationsets', 'schemas'],
|
|
136
|
-
}),
|
|
137
|
-
};
|
|
138
141
|
//# sourceMappingURL=list.js.map
|