stepzen 0.29.0 → 0.30.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 +417 -54
- package/lib/commands/import/curl.d.ts +48 -0
- package/lib/commands/import/curl.d.ts.map +1 -0
- package/lib/commands/import/curl.js +246 -0
- package/lib/commands/import/curl.js.map +1 -0
- package/lib/commands/import/graphql.d.ts +34 -0
- package/lib/commands/import/graphql.d.ts.map +1 -0
- package/lib/commands/import/graphql.js +118 -0
- package/lib/commands/import/graphql.js.map +1 -0
- package/lib/commands/import/index.d.ts +22 -0
- package/lib/commands/import/index.d.ts.map +1 -0
- package/lib/commands/import/index.js +165 -0
- package/lib/commands/import/index.js.map +1 -0
- package/lib/commands/import/mysql.d.ts +48 -0
- package/lib/commands/import/mysql.d.ts.map +1 -0
- package/lib/commands/import/mysql.js +145 -0
- package/lib/commands/import/mysql.js.map +1 -0
- package/lib/commands/import/postgresql.d.ts +51 -0
- package/lib/commands/import/postgresql.d.ts.map +1 -0
- package/lib/commands/import/postgresql.js +150 -0
- package/lib/commands/import/postgresql.js.map +1 -0
- package/lib/commands/import/presto.d.ts +49 -0
- package/lib/commands/import/presto.d.ts.map +1 -0
- package/lib/commands/import/presto.js +152 -0
- package/lib/commands/import/presto.js.map +1 -0
- package/lib/commands/import/snowflake.d.ts +53 -0
- package/lib/commands/import/snowflake.d.ts.map +1 -0
- package/lib/commands/import/snowflake.js +181 -0
- package/lib/commands/import/snowflake.js.map +1 -0
- package/lib/commands/list.d.ts.map +1 -1
- package/lib/commands/list.js +0 -2
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/request.js +6 -6
- package/lib/commands/request.js.map +1 -1
- package/lib/commands/service.d.ts +1 -1
- package/lib/commands/service.d.ts.map +1 -1
- package/lib/commands/service.js +12 -12
- package/lib/commands/service.js.map +1 -1
- package/lib/generate/curl2sdl.d.ts +13 -25
- package/lib/generate/curl2sdl.d.ts.map +1 -1
- package/lib/generate/curl2sdl.js +52 -114
- package/lib/generate/curl2sdl.js.map +1 -1
- package/lib/generate/flags.d.ts +19 -0
- package/lib/generate/flags.d.ts.map +1 -0
- package/lib/generate/flags.js +74 -0
- package/lib/generate/flags.js.map +1 -0
- package/lib/generate/graphql2sdl.d.ts +5 -16
- package/lib/generate/graphql2sdl.d.ts.map +1 -1
- package/lib/generate/graphql2sdl.js +4 -49
- package/lib/generate/graphql2sdl.js.map +1 -1
- package/lib/generate/helpers.d.ts +5 -9
- package/lib/generate/helpers.d.ts.map +1 -1
- package/lib/generate/helpers.js +30 -37
- package/lib/generate/helpers.js.map +1 -1
- package/lib/generate/import-command.d.ts +25 -0
- package/lib/generate/import-command.d.ts.map +1 -0
- package/lib/generate/import-command.js +176 -0
- package/lib/generate/import-command.js.map +1 -0
- package/lib/generate/questions.d.ts +30 -0
- package/lib/generate/questions.d.ts.map +1 -0
- package/lib/generate/questions.js +50 -0
- package/lib/generate/questions.js.map +1 -0
- package/lib/generate/sql2sdl.d.ts +14 -18
- package/lib/generate/sql2sdl.d.ts.map +1 -1
- package/lib/generate/sql2sdl.js +29 -92
- package/lib/generate/sql2sdl.js.map +1 -1
- package/lib/hooks/prerun/check-upgrade.js +4 -4
- package/lib/hooks/prerun/check-upgrade.js.map +1 -1
- package/lib/shared/constants.d.ts +1 -0
- package/lib/shared/constants.d.ts.map +1 -1
- package/lib/shared/constants.js +2 -1
- package/lib/shared/constants.js.map +1 -1
- package/lib/shared/curl-parser.d.ts +3 -3
- package/lib/shared/curl-parser.d.ts.map +1 -1
- package/lib/shared/curl-parser.js +52 -39
- package/lib/shared/curl-parser.js.map +1 -1
- package/lib/shared/docker.d.ts +8 -36
- package/lib/shared/docker.d.ts.map +1 -1
- package/lib/shared/docker.js +44 -42
- package/lib/shared/docker.js.map +1 -1
- package/lib/shared/dsn-parser.d.ts +3 -0
- package/lib/shared/dsn-parser.d.ts.map +1 -0
- package/lib/shared/dsn-parser.js +28 -0
- package/lib/shared/dsn-parser.js.map +1 -0
- package/lib/shared/header-params-parser.d.ts +7 -5
- package/lib/shared/header-params-parser.d.ts.map +1 -1
- package/lib/shared/header-params-parser.js +55 -43
- package/lib/shared/header-params-parser.js.map +1 -1
- package/lib/shared/header.d.ts +2 -2
- package/lib/shared/header.d.ts.map +1 -1
- package/lib/shared/header.js +13 -7
- package/lib/shared/header.js.map +1 -1
- package/lib/shared/inquirer.d.ts +2 -0
- package/lib/shared/inquirer.d.ts.map +1 -1
- package/lib/shared/inquirer.js +12 -4
- package/lib/shared/inquirer.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 +11 -7
- package/lib/shared/path-params-parser.js.map +1 -1
- package/lib/shared/request-variables-parser.d.ts +2 -9
- package/lib/shared/request-variables-parser.d.ts.map +1 -1
- package/lib/shared/request-variables-parser.js +8 -8
- package/lib/shared/request-variables-parser.js.map +1 -1
- package/lib/shared/types.d.ts +33 -6
- package/lib/shared/types.d.ts.map +1 -1
- package/lib/shared/utils.d.ts +5 -13
- package/lib/shared/utils.d.ts.map +1 -1
- package/lib/shared/utils.js.map +1 -1
- package/oclif.manifest.json +684 -197
- package/package.json +6 -6
- package/lib/commands/import.d.ts +0 -85
- package/lib/commands/import.d.ts.map +0 -1
- package/lib/commands/import.js +0 -645
- package/lib/commands/import.js.map +0 -1
- package/lib/generate/index.d.ts +0 -6
- package/lib/generate/index.d.ts.map +0 -1
- package/lib/generate/index.js +0 -4
- package/lib/generate/index.js.map +0 -1
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.30.0-beta.0 linux-x64 node-v18.14.2
|
|
34
34
|
$ stepzen --help [COMMAND]
|
|
35
35
|
USAGE
|
|
36
36
|
$ stepzen COMMAND
|
|
@@ -51,7 +51,14 @@ To run from code: `path-to-repo/bin/run start` (start or whatever command you're
|
|
|
51
51
|
|
|
52
52
|
$ stepzen deploy ENDPOINT --schema=schema [--configurationsets=cs1[,cs2[,..]]]`](#stepzen-deploy-endpoint---configpathtoconfigyaml---dirpathtoworkspace---or-deprecated----stepzen-deploy-endpoint---schemaschema---configurationsetscs1cs2)
|
|
53
53
|
* [`stepzen help [COMMANDS]`](#stepzen-help-commands)
|
|
54
|
-
* [`stepzen import
|
|
54
|
+
* [`stepzen import [SOURCE]`](#stepzen-import-source)
|
|
55
|
+
* [`stepzen import curl`](#stepzen-import-curl)
|
|
56
|
+
* [`stepzen import graphql [URL]`](#stepzen-import-graphql-url)
|
|
57
|
+
* [`stepzen import mysql [DSN]`](#stepzen-import-mysql-dsn)
|
|
58
|
+
* [`stepzen import postgres [DSN]`](#stepzen-import-postgres-dsn)
|
|
59
|
+
* [`stepzen import postgresql [DSN]`](#stepzen-import-postgresql-dsn)
|
|
60
|
+
* [`stepzen import singlestore [DSN]`](#stepzen-import-singlestore-dsn)
|
|
61
|
+
* [`stepzen import snowflake [DSN]`](#stepzen-import-snowflake-dsn)
|
|
55
62
|
* [`stepzen init`](#stepzen-init)
|
|
56
63
|
* [`stepzen list [TYPE]`](#stepzen-list-type)
|
|
57
64
|
* [`stepzen login`](#stepzen-login)
|
|
@@ -140,33 +147,98 @@ DESCRIPTION
|
|
|
140
147
|
|
|
141
148
|
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.4/src/commands/help.ts)_
|
|
142
149
|
|
|
143
|
-
## `stepzen import
|
|
150
|
+
## `stepzen import [SOURCE]`
|
|
144
151
|
|
|
145
|
-
Import a schema for an external data source or an API endpoint
|
|
152
|
+
Import a schema for an external data source or an API endpoint into your GraphQL API.
|
|
146
153
|
|
|
147
154
|
```
|
|
148
155
|
USAGE
|
|
149
|
-
$ stepzen import
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
156
|
+
$ stepzen import [SOURCE] [-h] [--dir <value>]
|
|
157
|
+
|
|
158
|
+
ARGUMENTS
|
|
159
|
+
SOURCE kind of the data source: curl, graphql, mysql, postgresql, snowflake (or a full DSN string)
|
|
160
|
+
|
|
161
|
+
FLAGS
|
|
162
|
+
-h, --help Show CLI help
|
|
163
|
+
--dir=<value> Working directory
|
|
164
|
+
|
|
165
|
+
DESCRIPTION
|
|
166
|
+
Import a schema for an external data source or an API endpoint into your GraphQL API.
|
|
167
|
+
See more details with stepzen import [SOURCE] --help
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## `stepzen import curl`
|
|
171
|
+
|
|
172
|
+
Import a schema for a REST endpoint into your GraphQL API (uses the curl syntax).
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
USAGE
|
|
176
|
+
$ stepzen import curl [-h] [--dir <value>] [--name <value>] [--prefix <value>] [-H <value>] [--header-param
|
|
177
|
+
<value>] [--query-name <value>] [--query-type <value>] [--path-params <value>]
|
|
178
|
+
|
|
179
|
+
FLAGS
|
|
180
|
+
-H, --header=<value>...
|
|
181
|
+
Specifies a request header to pass
|
|
182
|
+
|
|
183
|
+
Example:
|
|
184
|
+
stepzen import curl https://example.com/api/customers \
|
|
185
|
+
-H "Authorization: apikey SecretAPIKeyValue"
|
|
186
|
+
|
|
187
|
+
-h, --help
|
|
188
|
+
Show CLI help
|
|
189
|
+
|
|
190
|
+
--dir=<value>
|
|
191
|
+
Working directory
|
|
192
|
+
|
|
193
|
+
--header-param=<value>...
|
|
194
|
+
Specifies a parameter in a header value. Can be formed by taking a -H, --header flag and replacing the variable part
|
|
195
|
+
of the header value with a $paramName placeholder. Repeat this flag once for each header with a parameter.
|
|
196
|
+
|
|
197
|
+
Example:
|
|
198
|
+
stepzen import curl https://example.com/api/customers \
|
|
199
|
+
-H "Authorization: apikey SecretAPIKeyValue" \
|
|
200
|
+
--header-param 'Authorization: apikey $apikey'
|
|
201
|
+
|
|
202
|
+
--name=<value>
|
|
203
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
204
|
+
schema.
|
|
205
|
+
|
|
206
|
+
--path-params=<value>
|
|
207
|
+
Specifies path parameters in the URL path. Can be formed by taking the original path and replacing the variable
|
|
208
|
+
segments with $paramName placeholders.
|
|
209
|
+
|
|
210
|
+
Example:
|
|
211
|
+
stepzen import curl https://example.com/users/jane/posts/12 --path-params '/users/$userId/posts/$postId'
|
|
212
|
+
|
|
213
|
+
--prefix=<value>
|
|
214
|
+
Prefix to add to every type in the generated schema
|
|
215
|
+
|
|
216
|
+
--query-name=<value>
|
|
217
|
+
Property name to add to the Query type as a way to access the imported endpoint
|
|
218
|
+
|
|
219
|
+
--query-type=<value>
|
|
220
|
+
Name for the type returned by the curl request in the generated schema. The name specified by --query-type is not
|
|
221
|
+
prefixed by --prefix if both flags are present.
|
|
222
|
+
|
|
223
|
+
DESCRIPTION
|
|
224
|
+
Import a schema for a REST endpoint into your GraphQL API (uses the curl syntax).
|
|
225
|
+
|
|
226
|
+
stepzen import curl automatically introspects a REST endpoint, generates a GraphQL schema for accessing this endpoint
|
|
227
|
+
through a StepZen API, and adds the generated types and a query field into your GraphQL schema.
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## `stepzen import graphql [URL]`
|
|
231
|
+
|
|
232
|
+
Import a GraphQL API as a subgraph into your GraphQL API.
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
USAGE
|
|
236
|
+
$ stepzen import graphql [URL] [-h] [--dir <value>] [--name <value>] [--prefix <value>] [-H <value>]
|
|
237
|
+
[--header-param <value>]
|
|
166
238
|
|
|
167
239
|
FLAGS
|
|
168
240
|
-H, --header=<value>...
|
|
169
|
-
|
|
241
|
+
Specifies a request header to pass
|
|
170
242
|
|
|
171
243
|
Example:
|
|
172
244
|
stepzen import curl https://example.com/api/customers \
|
|
@@ -175,29 +247,141 @@ FLAGS
|
|
|
175
247
|
-h, --help
|
|
176
248
|
Show CLI help
|
|
177
249
|
|
|
250
|
+
--dir=<value>
|
|
251
|
+
Working directory
|
|
252
|
+
|
|
253
|
+
--header-param=<value>...
|
|
254
|
+
Specifies a parameter in a header value. Can be formed by taking a -H, --header flag and replacing the variable part
|
|
255
|
+
of the header value with a $paramName placeholder. Repeat this flag once for each header with a parameter.
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
stepzen import curl https://example.com/api/customers \
|
|
259
|
+
-H "Authorization: apikey SecretAPIKeyValue" \
|
|
260
|
+
--header-param 'Authorization: apikey $apikey'
|
|
261
|
+
|
|
262
|
+
--name=<value>
|
|
263
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
264
|
+
schema.
|
|
265
|
+
|
|
266
|
+
--prefix=<value>
|
|
267
|
+
Prefix to add to every type in the generated schema
|
|
268
|
+
|
|
269
|
+
DESCRIPTION
|
|
270
|
+
Import a GraphQL API as a subgraph into your GraphQL API.
|
|
271
|
+
|
|
272
|
+
stepzen import graphql automatically introspects a GraphQL endpoint and merges the types, queries, mutations and
|
|
273
|
+
subscriptions for accessing this endpoint through a StepZen API into your GraphQL schema.
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## `stepzen import mysql [DSN]`
|
|
277
|
+
|
|
278
|
+
Import a schema for a MySQL data source into your GraphQL API.
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
USAGE
|
|
282
|
+
$ stepzen import mysql [DSN] [-h] [--dir <value>] [--name <value>] [--db-host <value>] [--db-user <value>]
|
|
283
|
+
[--db-password <value>] [--db-database <value>] [--db-link-types] [--db-include
|
|
284
|
+
tables-only|views-only|tables-and-views] [--db-use-deprecated-2022-naming]
|
|
285
|
+
|
|
286
|
+
ARGUMENTS
|
|
287
|
+
DSN (optional) Data Source Name (DSN) of a MySQL database.
|
|
288
|
+
Example: mysql://user:password@host:port/database
|
|
289
|
+
|
|
290
|
+
Flags, such as --db-host, override the corresponding parts of the DSN (if both are provided).
|
|
291
|
+
|
|
292
|
+
FLAGS
|
|
293
|
+
-h, --help
|
|
294
|
+
Show CLI help
|
|
295
|
+
|
|
296
|
+
--db-database=<value>
|
|
297
|
+
Name of database to import
|
|
298
|
+
|
|
299
|
+
--db-host=<value>
|
|
300
|
+
Database host and optional port (as HOST[:PORT])
|
|
301
|
+
|
|
302
|
+
--db-include=<option>
|
|
303
|
+
Should the generated GraphQL schema be based only on database views, only on tables or on both
|
|
304
|
+
<options: tables-only|views-only|tables-and-views>
|
|
305
|
+
|
|
306
|
+
--db-link-types
|
|
307
|
+
Automatically link types based on foreign key relationships using @materializer
|
|
308
|
+
(https://stepzen.com/docs/features/linking-types)
|
|
309
|
+
|
|
310
|
+
--db-password=<value>
|
|
311
|
+
Database password
|
|
312
|
+
|
|
313
|
+
--db-use-deprecated-2022-naming
|
|
314
|
+
Use the deprecated pre-2023 naming convention in the generated GraphQL schema:
|
|
315
|
+
- the generated type and property names are auto-capitalized into PascalCase
|
|
316
|
+
- the generated field names use the getCustomer and getCustomerList style.
|
|
317
|
+
|
|
318
|
+
On the other hand, when using the default naming convention:
|
|
319
|
+
- the generated type and property names match exactly the DB table and column names
|
|
320
|
+
- the generated field names use the customer and customerList style.
|
|
321
|
+
|
|
322
|
+
--db-user=<value>
|
|
323
|
+
Database user name
|
|
324
|
+
|
|
325
|
+
--dir=<value>
|
|
326
|
+
Working directory
|
|
327
|
+
|
|
328
|
+
--name=<value>
|
|
329
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
330
|
+
schema.
|
|
331
|
+
|
|
332
|
+
DESCRIPTION
|
|
333
|
+
Import a schema for a MySQL data source into your GraphQL API.
|
|
334
|
+
|
|
335
|
+
stepzen import mysql automatically introspects a MySQL database, generates a GraphQL schema for accessing this
|
|
336
|
+
database through a StepZen API, and merges the generated types, queries and mutations into your into your GraphQL
|
|
337
|
+
schema.
|
|
338
|
+
|
|
339
|
+
ALIASES
|
|
340
|
+
$ stepzen import singlestore
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## `stepzen import postgres [DSN]`
|
|
344
|
+
|
|
345
|
+
Import a schema for a PostgreSQL data source into your GraphQL API.
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
USAGE
|
|
349
|
+
$ stepzen import postgres [DSN] [-h] [--dir <value>] [--name <value>] [--db-host <value>] [--db-user <value>]
|
|
350
|
+
[--db-password <value>] [--db-database <value>] [--db-schema <value>] [--db-link-types] [--db-include
|
|
351
|
+
tables-only|views-only|tables-and-views] [--db-use-deprecated-2022-naming]
|
|
352
|
+
|
|
353
|
+
ARGUMENTS
|
|
354
|
+
DSN (optional) Data Source Name (DSN) of a PostgreSQL database.
|
|
355
|
+
Example: postgresql://user:password@host:port/database?schema=schema
|
|
356
|
+
|
|
357
|
+
Flags, such as --db-host, override the corresponding parts of the DSN (if both are provided).
|
|
358
|
+
|
|
359
|
+
FLAGS
|
|
360
|
+
-h, --help
|
|
361
|
+
Show CLI help
|
|
362
|
+
|
|
178
363
|
--db-database=<value>
|
|
179
|
-
|
|
364
|
+
Name of database to import
|
|
180
365
|
|
|
181
366
|
--db-host=<value>
|
|
182
|
-
|
|
367
|
+
Database host and optional port (as HOST[:PORT])
|
|
183
368
|
|
|
184
369
|
--db-include=<option>
|
|
185
|
-
|
|
186
|
-
or on both
|
|
370
|
+
Should the generated GraphQL schema be based only on database views, only on tables or on both
|
|
187
371
|
<options: tables-only|views-only|tables-and-views>
|
|
188
372
|
|
|
189
373
|
--db-link-types
|
|
190
|
-
|
|
374
|
+
Automatically link types based on foreign key relationships using @materializer
|
|
191
375
|
(https://stepzen.com/docs/features/linking-types)
|
|
192
376
|
|
|
193
377
|
--db-password=<value>
|
|
194
|
-
|
|
378
|
+
Database password
|
|
195
379
|
|
|
196
380
|
--db-schema=<value>
|
|
197
|
-
|
|
381
|
+
Database schema to import tables from (default: public)
|
|
198
382
|
|
|
199
383
|
--db-use-deprecated-2022-naming
|
|
200
|
-
|
|
384
|
+
Use the deprecated pre-2023 naming convention in the generated GraphQL schema:
|
|
201
385
|
- the generated type and property names are auto-capitalized into PascalCase
|
|
202
386
|
- the generated field names use the getCustomer and getCustomerList style.
|
|
203
387
|
|
|
@@ -206,51 +390,230 @@ FLAGS
|
|
|
206
390
|
- the generated field names use the customer and customerList style.
|
|
207
391
|
|
|
208
392
|
--db-user=<value>
|
|
209
|
-
|
|
393
|
+
Database user name
|
|
210
394
|
|
|
211
395
|
--dir=<value>
|
|
212
396
|
Working directory
|
|
213
397
|
|
|
214
|
-
--
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
parameter.
|
|
398
|
+
--name=<value>
|
|
399
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
400
|
+
schema.
|
|
218
401
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
402
|
+
DESCRIPTION
|
|
403
|
+
Import a schema for a PostgreSQL data source into your GraphQL API.
|
|
404
|
+
|
|
405
|
+
stepzen import postgresql automatically introspects a PostgreSQL database, generates a GraphQL schema for accessing
|
|
406
|
+
this database through a StepZen API, and merges the generated types, queries and mutations into your GraphQL schema.
|
|
407
|
+
|
|
408
|
+
ALIASES
|
|
409
|
+
$ stepzen import postgres
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## `stepzen import postgresql [DSN]`
|
|
413
|
+
|
|
414
|
+
Import a schema for a PostgreSQL data source into your GraphQL API.
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
USAGE
|
|
418
|
+
$ stepzen import postgresql [DSN] [-h] [--dir <value>] [--name <value>] [--db-host <value>] [--db-user <value>]
|
|
419
|
+
[--db-password <value>] [--db-database <value>] [--db-schema <value>] [--db-link-types] [--db-include
|
|
420
|
+
tables-only|views-only|tables-and-views] [--db-use-deprecated-2022-naming]
|
|
421
|
+
|
|
422
|
+
ARGUMENTS
|
|
423
|
+
DSN (optional) Data Source Name (DSN) of a PostgreSQL database.
|
|
424
|
+
Example: postgresql://user:password@host:port/database?schema=schema
|
|
425
|
+
|
|
426
|
+
Flags, such as --db-host, override the corresponding parts of the DSN (if both are provided).
|
|
427
|
+
|
|
428
|
+
FLAGS
|
|
429
|
+
-h, --help
|
|
430
|
+
Show CLI help
|
|
431
|
+
|
|
432
|
+
--db-database=<value>
|
|
433
|
+
Name of database to import
|
|
434
|
+
|
|
435
|
+
--db-host=<value>
|
|
436
|
+
Database host and optional port (as HOST[:PORT])
|
|
437
|
+
|
|
438
|
+
--db-include=<option>
|
|
439
|
+
Should the generated GraphQL schema be based only on database views, only on tables or on both
|
|
440
|
+
<options: tables-only|views-only|tables-and-views>
|
|
441
|
+
|
|
442
|
+
--db-link-types
|
|
443
|
+
Automatically link types based on foreign key relationships using @materializer
|
|
444
|
+
(https://stepzen.com/docs/features/linking-types)
|
|
445
|
+
|
|
446
|
+
--db-password=<value>
|
|
447
|
+
Database password
|
|
448
|
+
|
|
449
|
+
--db-schema=<value>
|
|
450
|
+
Database schema to import tables from (default: public)
|
|
451
|
+
|
|
452
|
+
--db-use-deprecated-2022-naming
|
|
453
|
+
Use the deprecated pre-2023 naming convention in the generated GraphQL schema:
|
|
454
|
+
- the generated type and property names are auto-capitalized into PascalCase
|
|
455
|
+
- the generated field names use the getCustomer and getCustomerList style.
|
|
456
|
+
|
|
457
|
+
On the other hand, when using the default naming convention:
|
|
458
|
+
- the generated type and property names match exactly the DB table and column names
|
|
459
|
+
- the generated field names use the customer and customerList style.
|
|
460
|
+
|
|
461
|
+
--db-user=<value>
|
|
462
|
+
Database user name
|
|
463
|
+
|
|
464
|
+
--dir=<value>
|
|
465
|
+
Working directory
|
|
223
466
|
|
|
224
467
|
--name=<value>
|
|
225
468
|
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
226
469
|
schema.
|
|
227
470
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
variable segments with $paramName placeholders.
|
|
471
|
+
DESCRIPTION
|
|
472
|
+
Import a schema for a PostgreSQL data source into your GraphQL API.
|
|
231
473
|
|
|
232
|
-
|
|
233
|
-
|
|
474
|
+
stepzen import postgresql automatically introspects a PostgreSQL database, generates a GraphQL schema for accessing
|
|
475
|
+
this database through a StepZen API, and merges the generated types, queries and mutations into your GraphQL schema.
|
|
234
476
|
|
|
235
|
-
|
|
236
|
-
|
|
477
|
+
ALIASES
|
|
478
|
+
$ stepzen import postgres
|
|
479
|
+
```
|
|
237
480
|
|
|
238
|
-
|
|
239
|
-
[curl] [curl] Property name to add to the Query type as a way to access the imported endpoint
|
|
481
|
+
## `stepzen import singlestore [DSN]`
|
|
240
482
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
483
|
+
Import a schema for a MySQL data source into your GraphQL API.
|
|
484
|
+
|
|
485
|
+
```
|
|
486
|
+
USAGE
|
|
487
|
+
$ stepzen import singlestore [DSN] [-h] [--dir <value>] [--name <value>] [--db-host <value>] [--db-user <value>]
|
|
488
|
+
[--db-password <value>] [--db-database <value>] [--db-link-types] [--db-include
|
|
489
|
+
tables-only|views-only|tables-and-views] [--db-use-deprecated-2022-naming]
|
|
490
|
+
|
|
491
|
+
ARGUMENTS
|
|
492
|
+
DSN (optional) Data Source Name (DSN) of a MySQL database.
|
|
493
|
+
Example: mysql://user:password@host:port/database
|
|
494
|
+
|
|
495
|
+
Flags, such as --db-host, override the corresponding parts of the DSN (if both are provided).
|
|
496
|
+
|
|
497
|
+
FLAGS
|
|
498
|
+
-h, --help
|
|
499
|
+
Show CLI help
|
|
500
|
+
|
|
501
|
+
--db-database=<value>
|
|
502
|
+
Name of database to import
|
|
503
|
+
|
|
504
|
+
--db-host=<value>
|
|
505
|
+
Database host and optional port (as HOST[:PORT])
|
|
506
|
+
|
|
507
|
+
--db-include=<option>
|
|
508
|
+
Should the generated GraphQL schema be based only on database views, only on tables or on both
|
|
509
|
+
<options: tables-only|views-only|tables-and-views>
|
|
510
|
+
|
|
511
|
+
--db-link-types
|
|
512
|
+
Automatically link types based on foreign key relationships using @materializer
|
|
513
|
+
(https://stepzen.com/docs/features/linking-types)
|
|
514
|
+
|
|
515
|
+
--db-password=<value>
|
|
516
|
+
Database password
|
|
517
|
+
|
|
518
|
+
--db-use-deprecated-2022-naming
|
|
519
|
+
Use the deprecated pre-2023 naming convention in the generated GraphQL schema:
|
|
520
|
+
- the generated type and property names are auto-capitalized into PascalCase
|
|
521
|
+
- the generated field names use the getCustomer and getCustomerList style.
|
|
522
|
+
|
|
523
|
+
On the other hand, when using the default naming convention:
|
|
524
|
+
- the generated type and property names match exactly the DB table and column names
|
|
525
|
+
- the generated field names use the customer and customerList style.
|
|
526
|
+
|
|
527
|
+
--db-user=<value>
|
|
528
|
+
Database user name
|
|
529
|
+
|
|
530
|
+
--dir=<value>
|
|
531
|
+
Working directory
|
|
532
|
+
|
|
533
|
+
--name=<value>
|
|
534
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
535
|
+
schema.
|
|
536
|
+
|
|
537
|
+
DESCRIPTION
|
|
538
|
+
Import a schema for a MySQL data source into your GraphQL API.
|
|
539
|
+
|
|
540
|
+
stepzen import mysql automatically introspects a MySQL database, generates a GraphQL schema for accessing this
|
|
541
|
+
database through a StepZen API, and merges the generated types, queries and mutations into your into your GraphQL
|
|
542
|
+
schema.
|
|
543
|
+
|
|
544
|
+
ALIASES
|
|
545
|
+
$ stepzen import singlestore
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
## `stepzen import snowflake [DSN]`
|
|
549
|
+
|
|
550
|
+
Import a schema for a Snowflake data source into your GraphQL API.
|
|
551
|
+
|
|
552
|
+
```
|
|
553
|
+
USAGE
|
|
554
|
+
$ stepzen import snowflake [DSN] [-h] [--dir <value>] [--name <value>] [--db-user <value>] [--db-password <value>]
|
|
555
|
+
[--db-database <value>] [--db-schema <value>] [--db-link-types] [--db-include
|
|
556
|
+
tables-only|views-only|tables-and-views] [--db-use-deprecated-2022-naming] [--snowflake-account-id <value>]
|
|
557
|
+
[--snowflake-warehouse <value>]
|
|
558
|
+
|
|
559
|
+
ARGUMENTS
|
|
560
|
+
DSN (optional) Data Source Name (DSN) of a Snowflake database.
|
|
561
|
+
Example: snowflake://user:password@orgname-accountname/database?warehouse=warehouse&schema=schema
|
|
562
|
+
|
|
563
|
+
Flags, such as --db-host, override the corresponding parts of the DSN (if both are provided).
|
|
564
|
+
|
|
565
|
+
FLAGS
|
|
566
|
+
-h, --help
|
|
567
|
+
Show CLI help
|
|
568
|
+
|
|
569
|
+
--db-database=<value>
|
|
570
|
+
Name of database to import
|
|
571
|
+
|
|
572
|
+
--db-include=<option>
|
|
573
|
+
Should the generated GraphQL schema be based only on database views, only on tables or on both
|
|
574
|
+
<options: tables-only|views-only|tables-and-views>
|
|
575
|
+
|
|
576
|
+
--db-link-types
|
|
577
|
+
Automatically link types based on foreign key relationships using @materializer
|
|
578
|
+
(https://stepzen.com/docs/features/linking-types)
|
|
579
|
+
|
|
580
|
+
--db-password=<value>
|
|
581
|
+
Database password
|
|
582
|
+
|
|
583
|
+
--db-schema=<value>
|
|
584
|
+
Database schema to import tables from (default: PUBLIC)
|
|
585
|
+
|
|
586
|
+
--db-use-deprecated-2022-naming
|
|
587
|
+
Use the deprecated pre-2023 naming convention in the generated GraphQL schema:
|
|
588
|
+
- the generated type and property names are auto-capitalized into PascalCase
|
|
589
|
+
- the generated field names use the getCustomer and getCustomerList style.
|
|
590
|
+
|
|
591
|
+
On the other hand, when using the default naming convention:
|
|
592
|
+
- the generated type and property names match exactly the DB table and column names
|
|
593
|
+
- the generated field names use the customer and customerList style.
|
|
594
|
+
|
|
595
|
+
--db-user=<value>
|
|
596
|
+
Database user name
|
|
597
|
+
|
|
598
|
+
--dir=<value>
|
|
599
|
+
Working directory
|
|
600
|
+
|
|
601
|
+
--name=<value>
|
|
602
|
+
Subfolder inside the workspace folder to save the imported schema files to. Defaults to the name of the imported
|
|
603
|
+
schema.
|
|
244
604
|
|
|
245
605
|
--snowflake-account-id=<value>
|
|
246
|
-
|
|
606
|
+
Snowflake account identifier in the orgname-accountname format. For more information, see the Snowflake
|
|
247
607
|
documentation at https://docs.snowflake.com/en/user-guide/admin-account-identifier.html.
|
|
248
608
|
|
|
249
609
|
--snowflake-warehouse=<value>
|
|
250
|
-
|
|
610
|
+
Snowflake warehouse
|
|
251
611
|
|
|
252
612
|
DESCRIPTION
|
|
253
|
-
Import a schema for
|
|
613
|
+
Import a schema for a Snowflake data source into your GraphQL API.
|
|
614
|
+
|
|
615
|
+
stepzen import snowflake automatically introspects a Snowflake database, generates a GraphQL schema for accessing this
|
|
616
|
+
database through a StepZen API, and merges the generated types, queries and mutations into your GraphQL schema.
|
|
254
617
|
```
|
|
255
618
|
|
|
256
619
|
## `stepzen init`
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ArgOutput, FlagOutput, Input, ParserOutput } from '@oclif/core/lib/interfaces/parser';
|
|
2
|
+
import type { CurlImportOptions } from '../../generate/curl2sdl';
|
|
3
|
+
import { CommonImportOptions, ImportCommandBase } from '../../generate/import-command';
|
|
4
|
+
declare type InteractiveCurl2SdlOptions = Pick<CurlImportOptions, 'curlArgs' | 'queryName' | 'rootType' | 'typePrefix' | 'pathParams'>;
|
|
5
|
+
declare type CurlAnswers = {
|
|
6
|
+
url: string;
|
|
7
|
+
queryName: string;
|
|
8
|
+
rootType: string;
|
|
9
|
+
typePrefix: string;
|
|
10
|
+
pathParams: string;
|
|
11
|
+
};
|
|
12
|
+
export default class ImportCurl extends ImportCommandBase {
|
|
13
|
+
static description: string;
|
|
14
|
+
get source(): "curl";
|
|
15
|
+
static flags: {
|
|
16
|
+
prefix: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
+
data: import("@oclif/core/lib/interfaces/parser").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
18
|
+
request: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
+
url: import("@oclif/core/lib/interfaces/parser").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
+
header: import("@oclif/core/lib/interfaces/parser").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
+
'header-param': import("@oclif/core/lib/interfaces/parser").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
+
'query-name': import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
+
'query-type': import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
+
'path-params': import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
+
dir: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
26
|
+
silent: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
27
|
+
name: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
28
|
+
overwrite: import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
29
|
+
help: import("@oclif/core/lib/interfaces/parser").BooleanFlag<void>;
|
|
30
|
+
'non-interactive': import("@oclif/core/lib/interfaces/parser").BooleanFlag<boolean>;
|
|
31
|
+
};
|
|
32
|
+
static strict: boolean;
|
|
33
|
+
protected import(commonOptions: CommonImportOptions): Promise<{
|
|
34
|
+
error: {
|
|
35
|
+
message: string;
|
|
36
|
+
};
|
|
37
|
+
result?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
result: import("../../generate/helpers").IntrospectionServiceResponse;
|
|
40
|
+
error?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
protected parse<F extends FlagOutput, B extends FlagOutput, A extends ArgOutput>(options?: Input<F, B, A>, argv?: string[]): Promise<ParserOutput<F, B, A> & {
|
|
43
|
+
argv: string[];
|
|
44
|
+
}>;
|
|
45
|
+
getImportOptionsInteractively(defaults?: Partial<CurlAnswers>): Promise<InteractiveCurl2SdlOptions>;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=curl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curl.d.ts","sourceRoot":"","sources":["../../../src/commands/import/curl.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,KAAK,EACL,YAAY,EACb,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,+BAA+B,CAAA;AAGtC,aAAK,0BAA0B,GAAG,IAAI,CACpC,iBAAiB,EACjB,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,CACpE,CAAA;AAED,aAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,iBAAiB;IACvD,MAAM,CAAC,WAAW,SAOkB;IAEpC,IAAI,MAAM,WAET;IAED,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;MA4CX;IAGD,MAAM,CAAC,MAAM,UAAQ;cAEL,MAAM,CAAC,aAAa,EAAE,mBAAmB;;;;;;;;;cAuGzC,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;IA2D9C,6BAA6B,CACjC,QAAQ,GAAE,OAAO,CAAC,WAAW,CAAM,GAClC,OAAO,CAAC,0BAA0B,CAAC;CAqFvC"}
|