@sw-tsdk/plugin-connector 2.11.2-next.8 → 2.11.2-next.93
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 +139 -39
- package/lib/commands/action/add.d.ts +2 -2
- package/lib/commands/action/add.js +14 -8
- package/lib/commands/action/add.js.map +1 -1
- package/lib/commands/action/generate/data.d.ts +4 -4
- package/lib/commands/action/generate/data.js +23 -13
- package/lib/commands/action/generate/data.js.map +1 -1
- package/lib/commands/action/generate/input.d.ts +4 -4
- package/lib/commands/action/generate/input.js +19 -11
- package/lib/commands/action/generate/input.js.map +1 -1
- package/lib/commands/action/generate/output.d.ts +4 -4
- package/lib/commands/action/generate/output.js +19 -11
- package/lib/commands/action/generate/output.js.map +1 -1
- package/lib/commands/action/run/image.d.ts +9 -9
- package/lib/commands/action/run/image.js +39 -27
- package/lib/commands/action/run/image.js.map +1 -1
- package/lib/commands/action/run/local.d.ts +11 -11
- package/lib/commands/action/run/local.js +50 -34
- package/lib/commands/action/run/local.js.map +1 -1
- package/lib/commands/asset/add.d.ts +2 -2
- package/lib/commands/asset/add.js +12 -7
- package/lib/commands/asset/add.js.map +1 -1
- package/lib/commands/component/create.d.ts +34 -0
- package/lib/commands/component/create.js +168 -0
- package/lib/commands/component/create.js.map +1 -0
- package/lib/commands/component/logo.d.ts +12 -0
- package/lib/commands/component/logo.js +63 -0
- package/lib/commands/component/logo.js.map +1 -0
- package/lib/commands/component/ssp.d.ts +12 -0
- package/lib/commands/component/ssp.js +64 -0
- package/lib/commands/component/ssp.js.map +1 -0
- package/lib/commands/component/update.d.ts +13 -0
- package/lib/commands/component/update.js +68 -0
- package/lib/commands/component/update.js.map +1 -0
- package/lib/commands/connector/build.d.ts +10 -10
- package/lib/commands/connector/build.js +37 -20
- package/lib/commands/connector/build.js.map +1 -1
- package/lib/commands/connector/create/openapi.d.ts +12 -11
- package/lib/commands/connector/create/openapi.js +128 -63
- package/lib/commands/connector/create/openapi.js.map +1 -1
- package/lib/commands/connector/create/source.d.ts +2 -2
- package/lib/commands/connector/create/source.js +12 -6
- package/lib/commands/connector/create/source.js.map +1 -1
- package/lib/commands/connector/create.d.ts +11 -10
- package/lib/commands/connector/create.js +59 -16
- package/lib/commands/connector/create.js.map +1 -1
- package/lib/commands/connector/logo.d.ts +2 -2
- package/lib/commands/connector/logo.js +20 -6
- package/lib/commands/connector/logo.js.map +1 -1
- package/lib/commands/connector/sign.d.ts +6 -6
- package/lib/commands/connector/sign.js +24 -13
- package/lib/commands/connector/sign.js.map +1 -1
- package/lib/commands/connector/update.d.ts +3 -3
- package/lib/commands/connector/update.js +14 -8
- package/lib/commands/connector/update.js.map +1 -1
- package/lib/commands/connector/validate.d.ts +4 -4
- package/lib/commands/connector/validate.js +22 -14
- package/lib/commands/connector/validate.js.map +1 -1
- package/lib/common.d.ts +3 -0
- package/lib/common.js +76 -10
- package/lib/common.js.map +1 -1
- package/lib/templates/assets/http_bearer.yaml +1 -2
- package/lib/types/connector-types.d.ts +23 -2
- package/oclif.manifest.json +1253 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ $ npm install -g @sw-tsdk/plugin-connector
|
|
|
16
16
|
$ sw-tsdk-connector COMMAND
|
|
17
17
|
running command...
|
|
18
18
|
$ sw-tsdk-connector (--version)
|
|
19
|
-
@sw-tsdk/plugin-connector/2.11.2-next.
|
|
19
|
+
@sw-tsdk/plugin-connector/2.11.2-next.93+d82aa70 linux-x64 node-v16.20.2
|
|
20
20
|
$ sw-tsdk-connector --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ sw-tsdk-connector COMMAND
|
|
@@ -31,6 +31,10 @@ USAGE
|
|
|
31
31
|
* [`sw-tsdk-connector action:generate:output`](#sw-tsdk-connector-actiongenerateoutput)
|
|
32
32
|
* [`sw-tsdk-connector action:run:local`](#sw-tsdk-connector-actionrunlocal)
|
|
33
33
|
* [`sw-tsdk-connector asset:add`](#sw-tsdk-connector-assetadd)
|
|
34
|
+
* [`sw-tsdk-connector component:create`](#sw-tsdk-connector-componentcreate)
|
|
35
|
+
* [`sw-tsdk-connector component:logo`](#sw-tsdk-connector-componentlogo)
|
|
36
|
+
* [`sw-tsdk-connector component:ssp`](#sw-tsdk-connector-componentssp)
|
|
37
|
+
* [`sw-tsdk-connector component:update`](#sw-tsdk-connector-componentupdate)
|
|
34
38
|
* [`sw-tsdk-connector connector:build`](#sw-tsdk-connector-connectorbuild)
|
|
35
39
|
* [`sw-tsdk-connector connector:create`](#sw-tsdk-connector-connectorcreate)
|
|
36
40
|
* [`sw-tsdk-connector connector:create:openapi`](#sw-tsdk-connector-connectorcreateopenapi)
|
|
@@ -46,19 +50,19 @@ Update a connector action.
|
|
|
46
50
|
|
|
47
51
|
```
|
|
48
52
|
USAGE
|
|
49
|
-
$ sw-tsdk-connector action:add [-d <value>] [-t
|
|
53
|
+
$ sw-tsdk-connector action:add [-d <value>] [-t node|python_definition|python] [-h]
|
|
50
54
|
|
|
51
55
|
FLAGS
|
|
52
56
|
-d, --directory=<value> [default: ./] Root directory of the repository.
|
|
53
57
|
-h, --help Show CLI help.
|
|
54
58
|
-t, --template=<option> [default: python_definition] action template to scaffold
|
|
55
|
-
<options:
|
|
59
|
+
<options: node|python_definition|python>
|
|
56
60
|
|
|
57
61
|
DESCRIPTION
|
|
58
62
|
Update a connector action.
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
_See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
65
|
+
_See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/action/add.js)_
|
|
62
66
|
|
|
63
67
|
## `sw-tsdk-connector action:generate:data`
|
|
64
68
|
|
|
@@ -83,7 +87,7 @@ DESCRIPTION
|
|
|
83
87
|
Use to test a task in an integration
|
|
84
88
|
```
|
|
85
89
|
|
|
86
|
-
_See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
90
|
+
_See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/action/generate/data.js)_
|
|
87
91
|
|
|
88
92
|
## `sw-tsdk-connector action:generate:input`
|
|
89
93
|
|
|
@@ -108,7 +112,7 @@ DESCRIPTION
|
|
|
108
112
|
Update action input schema.
|
|
109
113
|
```
|
|
110
114
|
|
|
111
|
-
_See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
115
|
+
_See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/action/generate/input.js)_
|
|
112
116
|
|
|
113
117
|
## `sw-tsdk-connector action:generate:output`
|
|
114
118
|
|
|
@@ -132,7 +136,7 @@ DESCRIPTION
|
|
|
132
136
|
Update a connector action.
|
|
133
137
|
```
|
|
134
138
|
|
|
135
|
-
_See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
139
|
+
_See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/action/generate/output.js)_
|
|
136
140
|
|
|
137
141
|
## `sw-tsdk-connector action:run:local`
|
|
138
142
|
|
|
@@ -142,7 +146,7 @@ Runs a connector action. (Defaults to current image version in local repository)
|
|
|
142
146
|
USAGE
|
|
143
147
|
$ sw-tsdk-connector action:run:local [-a <value>] [-d <value>] [--input-path <value>] [--output-path <value>]
|
|
144
148
|
[--error-path <value>] [--asset-path <value>] [--template
|
|
145
|
-
python_37_swimlane|node_18|python_39_definition|python_310_definition|python_311_definition] [-f] [-h]
|
|
149
|
+
python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|python_311_definition] [-f] [-h]
|
|
146
150
|
|
|
147
151
|
FLAGS
|
|
148
152
|
-a, --action=<value> Action name to run
|
|
@@ -154,14 +158,14 @@ FLAGS
|
|
|
154
158
|
--input-path=<value> File to input data JSON file, defaults to /data/<action>.json
|
|
155
159
|
--output-path=<value> File to write the outputs to, defaults to /data/<action>_output.json
|
|
156
160
|
--template=<option> connector template
|
|
157
|
-
<options:
|
|
158
|
-
|
|
161
|
+
<options: python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|pytho
|
|
162
|
+
n_311_definition>
|
|
159
163
|
|
|
160
164
|
DESCRIPTION
|
|
161
165
|
Runs a connector action. (Defaults to current image version in local repository).
|
|
162
166
|
```
|
|
163
167
|
|
|
164
|
-
_See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
168
|
+
_See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/action/run/local.js)_
|
|
165
169
|
|
|
166
170
|
## `sw-tsdk-connector asset:add`
|
|
167
171
|
|
|
@@ -182,7 +186,101 @@ DESCRIPTION
|
|
|
182
186
|
Update a connector action.
|
|
183
187
|
```
|
|
184
188
|
|
|
185
|
-
_See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
189
|
+
_See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/asset/add.js)_
|
|
190
|
+
|
|
191
|
+
## `sw-tsdk-connector component:create`
|
|
192
|
+
|
|
193
|
+
Scaffold a new Component
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
USAGE
|
|
197
|
+
$ sw-tsdk-connector component:create [-d <value>] [--componentType <value>] [--vendor <value>] [--componentName
|
|
198
|
+
<value>] [--keywords <value>] [--description <value>] [--logoPath <value>] [--sspPath <value>] [--author <value>]
|
|
199
|
+
[--authorEmail <value>] [--homepage <value>] [-h]
|
|
200
|
+
|
|
201
|
+
FLAGS
|
|
202
|
+
-d, --directory=<value> [default: ./] root directory for where to store Component.
|
|
203
|
+
-h, --help Show CLI help.
|
|
204
|
+
--author=<value> Component Author
|
|
205
|
+
--authorEmail=<value> Component Author Email
|
|
206
|
+
--componentName=<value> Component Name (e.g. Alert Ingestion)
|
|
207
|
+
--componentType=<value> Component Type (e.g. classic)
|
|
208
|
+
--description=<value> Description (e.g. CrowdStrike Alert Ingestion Component)
|
|
209
|
+
--homepage=<value> Component Author Support URL
|
|
210
|
+
--keywords=<value> Enter keywords
|
|
211
|
+
--logoPath=<value> URL or absolute path to logo file
|
|
212
|
+
--sspPath=<value> absolute path to .ssp file
|
|
213
|
+
--vendor=<value> Vendor (e.g. CrowdStrike)
|
|
214
|
+
|
|
215
|
+
DESCRIPTION
|
|
216
|
+
Scaffold a new Component
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
_See code: [lib/commands/component/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/component/create.js)_
|
|
220
|
+
|
|
221
|
+
## `sw-tsdk-connector component:logo`
|
|
222
|
+
|
|
223
|
+
Update a Component logo.
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
USAGE
|
|
227
|
+
$ sw-tsdk-connector component:logo [-d <value>] [-t <value>] [-n <value>] [-p <value>] [-h]
|
|
228
|
+
|
|
229
|
+
FLAGS
|
|
230
|
+
-d, --directory=<value> [default: ./] root directory of the component folder.
|
|
231
|
+
-h, --help Show CLI help.
|
|
232
|
+
-n, --componentName=<value> Component Name (e.g. google_alert_ingestion)
|
|
233
|
+
-p, --logoPath=<value> path or URL to product logo in PNG format.
|
|
234
|
+
-t, --componentType=<value> Component Type (e.g. classic)
|
|
235
|
+
|
|
236
|
+
DESCRIPTION
|
|
237
|
+
Update a Component logo.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
_See code: [lib/commands/component/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/component/logo.js)_
|
|
241
|
+
|
|
242
|
+
## `sw-tsdk-connector component:ssp`
|
|
243
|
+
|
|
244
|
+
Update an SSP.
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
USAGE
|
|
248
|
+
$ sw-tsdk-connector component:ssp [-d <value>] [-t <value>] [-n <value>] [-p <value>] [-h]
|
|
249
|
+
|
|
250
|
+
FLAGS
|
|
251
|
+
-d, --directory=<value> [default: ./] root directory of the component folder.
|
|
252
|
+
-h, --help Show CLI help.
|
|
253
|
+
-n, --componentName=<value> Component Name (e.g. google_alert_ingestion)
|
|
254
|
+
-p, --sspPath=<value> Absolute path to .SSP file
|
|
255
|
+
-t, --componentType=<value> Component Type (e.g. classic)
|
|
256
|
+
|
|
257
|
+
DESCRIPTION
|
|
258
|
+
Update an SSP.
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
_See code: [lib/commands/component/ssp.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/component/ssp.js)_
|
|
262
|
+
|
|
263
|
+
## `sw-tsdk-connector component:update`
|
|
264
|
+
|
|
265
|
+
Update Component Version.
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
USAGE
|
|
269
|
+
$ sw-tsdk-connector component:update [-d <value>] [-v <value>] [-t <value>] [-n <value>] [-f <value>] [-h]
|
|
270
|
+
|
|
271
|
+
FLAGS
|
|
272
|
+
-d, --directory=<value> [default: .] root directory of the all Components
|
|
273
|
+
-f, --manifestPath=<value> [default: manifest.yml] Component manifest path relative to directory.
|
|
274
|
+
-h, --help Show CLI help.
|
|
275
|
+
-n, --componentName=<value> Component Name (e.g. google_alert_ingestion)
|
|
276
|
+
-t, --componentType=<value> Component Type (e.g. classic)
|
|
277
|
+
-v, --version=<value> new version of the component.
|
|
278
|
+
|
|
279
|
+
DESCRIPTION
|
|
280
|
+
Update Component Version.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
_See code: [lib/commands/component/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/component/update.js)_
|
|
186
284
|
|
|
187
285
|
## `sw-tsdk-connector connector:build`
|
|
188
286
|
|
|
@@ -191,8 +289,9 @@ Builds a local docker image of the connector.
|
|
|
191
289
|
```
|
|
192
290
|
USAGE
|
|
193
291
|
$ sw-tsdk-connector connector:build [--template
|
|
194
|
-
python_37_swimlane|node_18|python_39_definition|python_310_definition|
|
|
195
|
-
[-f] [--signing-password <value>] [--key-name <value>] [--registry <value>] [-o <value>]
|
|
292
|
+
python_37_swimlane|node_18|node_20|python_39_definition|python_39_turbine|python_310_definition|python_311_definitio
|
|
293
|
+
n] [-d <value>] [--save] [-f] [--signing-password <value>] [--key-name <value>] [--registry <value>] [-o <value>]
|
|
294
|
+
[-h]
|
|
196
295
|
|
|
197
296
|
FLAGS
|
|
198
297
|
-d, --directory=<value> [default: ./] root directory of the repository.
|
|
@@ -204,14 +303,14 @@ FLAGS
|
|
|
204
303
|
--save saves a signed docker image as tar in local directory.
|
|
205
304
|
--signing-password=<value> password used for the private key (ENV: TURBINE_SIGNING_PASSWORD)
|
|
206
305
|
--template=<option> connector language
|
|
207
|
-
<options: python_37_swimlane|node_18|python_39_definition|
|
|
208
|
-
|
|
306
|
+
<options: python_37_swimlane|node_18|node_20|python_39_definition|python_39_turbine|python
|
|
307
|
+
_310_definition|python_311_definition>
|
|
209
308
|
|
|
210
309
|
DESCRIPTION
|
|
211
310
|
Builds a local docker image of the connector.
|
|
212
311
|
```
|
|
213
312
|
|
|
214
|
-
_See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
313
|
+
_See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/build.js)_
|
|
215
314
|
|
|
216
315
|
## `sw-tsdk-connector connector:create`
|
|
217
316
|
|
|
@@ -221,28 +320,29 @@ Scaffold a new connector
|
|
|
221
320
|
USAGE
|
|
222
321
|
$ sw-tsdk-connector connector:create [-d <value>] [-t python_310_definition|python_311_definition|python_3]
|
|
223
322
|
[--vendor <value>] [--product <value>] [--keywords <value>] [--description <value>] [--logoPath <value>] [--author
|
|
224
|
-
<value>] [--authorEmail <value>] [--homepage <value>] [-h]
|
|
323
|
+
<value>] [--authorEmail <value>] [--homepage <value>] [-h] [--aspirationalConnector <value>]
|
|
225
324
|
|
|
226
325
|
FLAGS
|
|
227
|
-
-d, --directory=<value>
|
|
228
|
-
|
|
229
|
-
-h, --help
|
|
230
|
-
-t, --template=<option>
|
|
231
|
-
|
|
232
|
-
--
|
|
233
|
-
--
|
|
234
|
-
--
|
|
235
|
-
--
|
|
236
|
-
--
|
|
237
|
-
--
|
|
238
|
-
--
|
|
239
|
-
--
|
|
326
|
+
-d, --directory=<value> [default: ./] root directory for where to store connectors, the connector directory
|
|
327
|
+
will be generated.
|
|
328
|
+
-h, --help Show CLI help.
|
|
329
|
+
-t, --template=<option> [default: python_311_definition] connector template to scaffold
|
|
330
|
+
<options: python_310_definition|python_311_definition|python_3>
|
|
331
|
+
--aspirationalConnector=<value> Is it an aspirational connector? (e.g. false)
|
|
332
|
+
--author=<value> Connector Author
|
|
333
|
+
--authorEmail=<value> Connector Author Email
|
|
334
|
+
--description=<value> Description (e.g. CrowdStrike Host Query API)
|
|
335
|
+
--homepage=<value> Connector Author Support URL
|
|
336
|
+
--keywords=<value> Enter keywords (Comma-Separated)
|
|
337
|
+
--logoPath=<value> URL or absolute path to logo file
|
|
338
|
+
--product=<value> Product (e.g. Falcon)
|
|
339
|
+
--vendor=<value> Vendor (e.g. CrowdStrike)
|
|
240
340
|
|
|
241
341
|
DESCRIPTION
|
|
242
342
|
Scaffold a new connector
|
|
243
343
|
```
|
|
244
344
|
|
|
245
|
-
_See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
345
|
+
_See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/create.js)_
|
|
246
346
|
|
|
247
347
|
## `sw-tsdk-connector connector:create:openapi`
|
|
248
348
|
|
|
@@ -258,7 +358,7 @@ FLAGS
|
|
|
258
358
|
generated.
|
|
259
359
|
-h, --help Show CLI help.
|
|
260
360
|
-k, --keywords=<value> Please enter keyword (Comma-Separated)
|
|
261
|
-
-o, --specs=<value>
|
|
361
|
+
-o, --specs=<value> path to the spec file
|
|
262
362
|
--author=<value> Connector Author
|
|
263
363
|
--authorEmail=<value> Connector Author Email
|
|
264
364
|
--description=<value> Description (e.g. CrowdStrike Host Query API)
|
|
@@ -271,7 +371,7 @@ DESCRIPTION
|
|
|
271
371
|
Scaffold a new connector
|
|
272
372
|
```
|
|
273
373
|
|
|
274
|
-
_See code: [lib/commands/connector/create/openapi.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
374
|
+
_See code: [lib/commands/connector/create/openapi.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/create/openapi.js)_
|
|
275
375
|
|
|
276
376
|
## `sw-tsdk-connector connector:create:source`
|
|
277
377
|
|
|
@@ -289,7 +389,7 @@ DESCRIPTION
|
|
|
289
389
|
Generates 11x source from 10x
|
|
290
390
|
```
|
|
291
391
|
|
|
292
|
-
_See code: [lib/commands/connector/create/source.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
392
|
+
_See code: [lib/commands/connector/create/source.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/create/source.js)_
|
|
293
393
|
|
|
294
394
|
## `sw-tsdk-connector connector:logo`
|
|
295
395
|
|
|
@@ -308,7 +408,7 @@ DESCRIPTION
|
|
|
308
408
|
Update a connector.
|
|
309
409
|
```
|
|
310
410
|
|
|
311
|
-
_See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
411
|
+
_See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/logo.js)_
|
|
312
412
|
|
|
313
413
|
## `sw-tsdk-connector connector:sign`
|
|
314
414
|
|
|
@@ -333,7 +433,7 @@ DESCRIPTION
|
|
|
333
433
|
Builds a local docker image of the connector.
|
|
334
434
|
```
|
|
335
435
|
|
|
336
|
-
_See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
436
|
+
_See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/sign.js)_
|
|
337
437
|
|
|
338
438
|
## `sw-tsdk-connector connector:update`
|
|
339
439
|
|
|
@@ -353,7 +453,7 @@ DESCRIPTION
|
|
|
353
453
|
Update a connector.
|
|
354
454
|
```
|
|
355
455
|
|
|
356
|
-
_See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
456
|
+
_See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/update.js)_
|
|
357
457
|
|
|
358
458
|
## `sw-tsdk-connector connector:validate`
|
|
359
459
|
|
|
@@ -376,5 +476,5 @@ DESCRIPTION
|
|
|
376
476
|
Use to validate an integration
|
|
377
477
|
```
|
|
378
478
|
|
|
379
|
-
_See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.
|
|
479
|
+
_See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.11.2-next.93+d82aa70/lib/commands/connector/validate.js)_
|
|
380
480
|
<!-- commandsstop -->
|
|
@@ -2,8 +2,8 @@ import { Base } from '@sw-tsdk/core';
|
|
|
2
2
|
export declare class Add extends Base {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
-
template: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
5
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
+
template: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
7
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
@@ -54,9 +54,9 @@ class Add extends core_2.Base {
|
|
|
54
54
|
output: {},
|
|
55
55
|
meta: {},
|
|
56
56
|
};
|
|
57
|
-
core_1.
|
|
57
|
+
core_1.ux.action.start('Scaffolding new action');
|
|
58
58
|
switch (template) {
|
|
59
|
-
case 'python_definition':
|
|
59
|
+
case 'python_definition': {
|
|
60
60
|
// Update input defaults.
|
|
61
61
|
action.inputs = connector_1.pythonDefinitionInputDefaults;
|
|
62
62
|
action.meta = {
|
|
@@ -64,24 +64,30 @@ class Add extends core_2.Base {
|
|
|
64
64
|
method: answers.method,
|
|
65
65
|
};
|
|
66
66
|
break;
|
|
67
|
+
}
|
|
67
68
|
}
|
|
68
69
|
const actionPath = (0, node_path_1.join)(directory, 'connector', 'config', 'actions', `${action.name}.yaml`);
|
|
69
70
|
await (0, fs_extra_1.writeFile)(actionPath, js_yaml_1.default.dump(action));
|
|
70
|
-
core_1.
|
|
71
|
+
core_1.ux.action.stop();
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
exports.Add = Add;
|
|
74
75
|
Add.description = 'Update a connector action.';
|
|
75
|
-
Add.flags =
|
|
76
|
+
Add.flags = {
|
|
77
|
+
...core_2.Base.flags,
|
|
78
|
+
directory: core_1.Flags.string({
|
|
76
79
|
char: 'd',
|
|
77
80
|
description: 'Root directory of the repository.',
|
|
78
81
|
default: './',
|
|
79
|
-
}),
|
|
82
|
+
}),
|
|
83
|
+
template: core_1.Flags.string({
|
|
80
84
|
char: 't',
|
|
81
85
|
description: 'action template to scaffold',
|
|
82
86
|
default: 'python_definition',
|
|
83
|
-
options: ['
|
|
84
|
-
}),
|
|
87
|
+
options: ['node', 'python_definition', 'python'],
|
|
88
|
+
}),
|
|
89
|
+
help: core_1.Flags.help({
|
|
85
90
|
char: 'h',
|
|
86
|
-
})
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
87
93
|
//# sourceMappingURL=add.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/action/add.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/commands/action/add.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAAkC;AAClC,yCAAuC;AACvC,uCAAkC;AAClC,wEAAkC;AAClC,8DAA0B;AAC1B,2CAAoC;AAEpC,kDAAgE;AAEhE,gEAA+B;AAE/B,qCAAqC;AACrC,MAAa,GAAI,SAAQ,WAAI;IAqB3B,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,GACN,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEzB,IAAI,EACF,SAAS,GACV,GAAG,KAAK,CAAA;QAET,MAAM,EACJ,QAAQ,GACT,GAAG,KAAK,CAAA;QAET,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC/C,MAAM,eAAe,GAAQ,CAAC;gBAC5B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,gCAAgC;aAC1C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,+CAA+C;aACzD;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,wDAAwD;aAClE;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,kCAAkC;gBAC3C,OAA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,eAAW,GAAG,4BAA4B,CAAA;AAE1C,SAAK,GAAG;IACb,GAAG,WAAI,CAAC,KAAK;IACb,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,IAAI;KACd,CAAC;IACF,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,mBAAmB;QAC5B,OAAO,EAAE,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,CAAC;KACjD,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAA"}
|
|
@@ -3,10 +3,10 @@ export declare class Data extends Base {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
6
|
-
action: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
7
|
-
asset: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
-
inputs: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
-
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
action: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
asset: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
inputs: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
'include-optional': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
};
|
|
@@ -31,7 +31,7 @@ class Data extends core_2.Base {
|
|
|
31
31
|
if (!inputs) {
|
|
32
32
|
inputs = `data/${action}.json`;
|
|
33
33
|
}
|
|
34
|
-
core_1.
|
|
34
|
+
core_1.ux.log(`Starting run: ${action}...`);
|
|
35
35
|
const manifests = await (0, connector_1.allManifests)(directory);
|
|
36
36
|
const assetManifests = manifests.assetManifests;
|
|
37
37
|
let assetName = assetManifests.length === 1 ? assetManifests[0].name : '';
|
|
@@ -52,7 +52,7 @@ class Data extends core_2.Base {
|
|
|
52
52
|
try {
|
|
53
53
|
await node_fs_1.promises.access(directory);
|
|
54
54
|
}
|
|
55
|
-
catch
|
|
55
|
+
catch {
|
|
56
56
|
this.error(`Could not access ${directory}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -73,10 +73,10 @@ class Data extends core_2.Base {
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
core_1.
|
|
76
|
+
core_1.ux.action.start(`Generating ${name}.json...`);
|
|
77
77
|
const contentPath = manifests.findPath(name);
|
|
78
78
|
if (!contentPath) {
|
|
79
|
-
|
|
79
|
+
throw new Error(`Could not find ${name}.`);
|
|
80
80
|
}
|
|
81
81
|
const content = await (0, fs_extra_1.readFile)(contentPath, 'utf8');
|
|
82
82
|
const json = js_yaml_1.default.load(content);
|
|
@@ -84,7 +84,7 @@ class Data extends core_2.Base {
|
|
|
84
84
|
const values = this.createJsonFromSchema(inputs, options);
|
|
85
85
|
await node_fs_1.promises.mkdir((0, node_path_1.dirname)(generatedFile), { recursive: true });
|
|
86
86
|
await (0, fs_extra_1.writeJson)(filePath, values, { spaces: 2, EOL: '\n' });
|
|
87
|
-
core_1.
|
|
87
|
+
core_1.ux.action.stop();
|
|
88
88
|
}
|
|
89
89
|
static createJsonFromSchema(data, options) {
|
|
90
90
|
json_schema_faker_1.JSONSchemaFaker.format('password', value => {
|
|
@@ -93,13 +93,14 @@ class Data extends core_2.Base {
|
|
|
93
93
|
return newValue;
|
|
94
94
|
}
|
|
95
95
|
switch (value.format) {
|
|
96
|
-
case 'password':
|
|
96
|
+
case 'password': {
|
|
97
97
|
return (0, node_crypto_1.randomUUID)();
|
|
98
|
+
}
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
json_schema_faker_1.JSONSchemaFaker.option('useExamplesValue', true);
|
|
101
102
|
json_schema_faker_1.JSONSchemaFaker.option('useDefaultValue', true);
|
|
102
|
-
if (!
|
|
103
|
+
if (!options?.includeOptional) {
|
|
103
104
|
json_schema_faker_1.JSONSchemaFaker.option('requiredOnly', true);
|
|
104
105
|
}
|
|
105
106
|
json_schema_faker_1.JSONSchemaFaker.option('pruneProperties', ['meta']);
|
|
@@ -109,17 +110,26 @@ class Data extends core_2.Base {
|
|
|
109
110
|
}
|
|
110
111
|
exports.Data = Data;
|
|
111
112
|
Data.description = 'Use to test a task in an integration';
|
|
112
|
-
Data.flags =
|
|
113
|
+
Data.flags = {
|
|
114
|
+
...core_2.Base.flags,
|
|
115
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
116
|
+
action: core_1.Flags.string({ char: 'a', description: 'action to generate data' }),
|
|
117
|
+
asset: core_1.Flags.string({
|
|
113
118
|
description: 'Filename for asset, defaults to the task name under the data folder. ie: data/asset_name.json',
|
|
114
|
-
}),
|
|
119
|
+
}),
|
|
120
|
+
inputs: core_1.Flags.string({
|
|
115
121
|
description: 'Filename for JSON inputs, defaults to the task name under the data folder. ie: data/my_task.json',
|
|
116
|
-
}),
|
|
122
|
+
}),
|
|
123
|
+
directory: core_1.Flags.string({
|
|
117
124
|
char: 'd',
|
|
118
125
|
description: 'current directory to mount',
|
|
119
126
|
default: './',
|
|
120
|
-
}),
|
|
127
|
+
}),
|
|
128
|
+
'include-optional': core_1.Flags.boolean({
|
|
121
129
|
description: 'used to only generate required properties',
|
|
122
|
-
}),
|
|
130
|
+
}),
|
|
131
|
+
force: core_1.Flags.boolean({
|
|
123
132
|
description: 'overwrites current files',
|
|
124
|
-
})
|
|
133
|
+
}),
|
|
134
|
+
};
|
|
125
135
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/data.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/data.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAGsB;AACtB,uCAA4C;AAC5C,gEAA+B;AAC/B,qCAAgC;AAChC,yCAAgD;AAChD,8DAA0B;AAC1B,kDAA0D;AAE1D,4CAAyD;AACzD,yDAAiD;AACjD,6CAAsC;AAEtC,qCAAqC;AACrC,MAAa,IAAK,SAAQ,WAAI;IA2B5B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEtC,MAAM,EACJ,KAAK,EACL,kBAAkB,EAAE,eAAe,EACnC,KAAK,GACN,GAAG,KAAK,CAAA;QAET,IAAI,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAC,GAAG,KAAK,CAAA;QACvC,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC/C,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;QAE1C,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,SAAS,CAAC,CAAA;YACtC,MAAM,GAAG,QAAQ,MAAM,OAAO,CAAA;SAC/B;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC5B,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,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CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC7C,OAAO,MAAM,CAAA;IACf,CAAC;;AAtJH,oBAuJC;AAtJQ,gBAAW,GAAG,sCAAsC,CAAC;AAErD,UAAK,GAAG;IACb,GAAG,WAAI,CAAC,KAAK;IACb,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;IAC7B,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,yBAAyB,EAAC,CAAC;IACzE,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC;QAClB,WAAW,EAAE,+FAA+F;KAC7G,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,WAAW,EACT,kGAAkG;KACrG,CAAC;IACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,IAAI;KACd,CAAC;IACF,kBAAkB,EAAE,YAAK,CAAC,OAAO,CAAC;QAChC,WAAW,EAAE,2CAA2C;KACzD,CAAC;IACF,KAAK,EAAE,YAAK,CAAC,OAAO,CAAC;QACnB,WAAW,EAAE,0BAA0B;KACxC,CAAC;CACH,CAAC"}
|
|
@@ -2,11 +2,11 @@ import { Base } from '@sw-tsdk/core';
|
|
|
2
2
|
export declare class Input extends Base {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
-
action: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
|
-
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
5
|
+
action: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
7
|
amend: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
'action-config-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
-
'input-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
8
|
+
'action-config-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
'input-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
@@ -21,7 +21,7 @@ class Input extends core_2.Base {
|
|
|
21
21
|
try {
|
|
22
22
|
await fs_extra_1.promises.access(directory);
|
|
23
23
|
}
|
|
24
|
-
catch
|
|
24
|
+
catch {
|
|
25
25
|
this.error(`Could not access ${directory}`);
|
|
26
26
|
}
|
|
27
27
|
// select action if not provided.
|
|
@@ -29,8 +29,8 @@ class Input extends core_2.Base {
|
|
|
29
29
|
action = await (0, common_1.chooseAction)(directory);
|
|
30
30
|
}
|
|
31
31
|
actionConfigPath = actionConfigPath || (0, node_path_1.join)(directory, 'connector', 'config', 'actions', `${action}.yaml`);
|
|
32
|
-
const actionConfig = await js_yaml_1.default.load(await (0, fs_extra_1.readFile)(actionConfigPath, '
|
|
33
|
-
core_1.
|
|
32
|
+
const actionConfig = await js_yaml_1.default.load(await (0, fs_extra_1.readFile)(actionConfigPath, 'utf8'));
|
|
33
|
+
core_1.ux.action.start('Updating output schema');
|
|
34
34
|
inputPath = inputPath || (0, node_path_1.join)(directory, 'data', `${action}.json`);
|
|
35
35
|
const inputData = await (0, fs_extra_1.readJson)(inputPath);
|
|
36
36
|
const inputSchema = await (0, connector_1.generateSchema)('inputs', inputData, connector_1.schemaDefaults);
|
|
@@ -44,25 +44,33 @@ class Input extends core_2.Base {
|
|
|
44
44
|
actionConfig.inputs = inputSchema.inputs;
|
|
45
45
|
}
|
|
46
46
|
await (0, fs_extra_1.writeFile)(actionConfigPath, js_yaml_1.default.dump(actionConfig, { noRefs: true }));
|
|
47
|
-
core_1.
|
|
47
|
+
core_1.ux.action.stop();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.Input = Input;
|
|
51
51
|
Input.description = 'Update action input schema.';
|
|
52
|
-
Input.flags =
|
|
52
|
+
Input.flags = {
|
|
53
|
+
...core_2.Base.flags,
|
|
54
|
+
action: core_1.Flags.string({
|
|
53
55
|
char: 'a',
|
|
54
56
|
description: 'Action name to run',
|
|
55
|
-
}),
|
|
57
|
+
}),
|
|
58
|
+
directory: core_1.Flags.string({
|
|
56
59
|
char: 'd',
|
|
57
60
|
description: 'Root directory of the repository.',
|
|
58
61
|
default: './',
|
|
59
|
-
}),
|
|
62
|
+
}),
|
|
63
|
+
amend: core_1.Flags.boolean({
|
|
60
64
|
description: 'Merge with existing schema.',
|
|
61
|
-
}),
|
|
65
|
+
}),
|
|
66
|
+
'action-config-path': core_1.Flags.string({
|
|
62
67
|
description: 'Override path to action configuration file. Defaults to /connector/config/actions/<action>.yaml',
|
|
63
|
-
}),
|
|
68
|
+
}),
|
|
69
|
+
'input-path': core_1.Flags.string({
|
|
64
70
|
description: 'Relative path to the output data JSON file, defaults to the task name under the data folder. ie: /data/<taskName>_output.json',
|
|
65
|
-
}),
|
|
71
|
+
}),
|
|
72
|
+
help: core_1.Flags.help({
|
|
66
73
|
char: 'h',
|
|
67
|
-
})
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
68
76
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/input.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/input.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAAkC;AAClC,y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