@sw-tsdk/plugin-connector 2.11.2-next.8 → 2.13.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 +25 -25
- 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/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 +117 -60
- 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 +10 -10
- package/lib/commands/connector/create.js +24 -11
- package/lib/commands/connector/create.js.map +1 -1
- package/lib/commands/connector/logo.d.ts +2 -2
- package/lib/commands/connector/logo.js +10 -5
- 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.js +4 -0
- package/lib/common.js.map +1 -1
- package/lib/templates/assets/http_bearer.yaml +1 -2
- package/lib/types/connector-types.d.ts +2 -2
- package/oclif.manifest.json +1007 -1
- package/package.json +13 -13
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.
|
|
19
|
+
@sw-tsdk/plugin-connector/2.13.0 linux-x64 node-v16.20.1
|
|
20
20
|
$ sw-tsdk-connector --help [COMMAND]
|
|
21
21
|
USAGE
|
|
22
22
|
$ sw-tsdk-connector COMMAND
|
|
@@ -46,19 +46,19 @@ Update a connector action.
|
|
|
46
46
|
|
|
47
47
|
```
|
|
48
48
|
USAGE
|
|
49
|
-
$ sw-tsdk-connector action:add [-d <value>] [-t
|
|
49
|
+
$ sw-tsdk-connector action:add [-d <value>] [-t node|python_definition|python] [-h]
|
|
50
50
|
|
|
51
51
|
FLAGS
|
|
52
52
|
-d, --directory=<value> [default: ./] Root directory of the repository.
|
|
53
53
|
-h, --help Show CLI help.
|
|
54
54
|
-t, --template=<option> [default: python_definition] action template to scaffold
|
|
55
|
-
<options:
|
|
55
|
+
<options: node|python_definition|python>
|
|
56
56
|
|
|
57
57
|
DESCRIPTION
|
|
58
58
|
Update a connector action.
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
_See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
61
|
+
_See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/action/add.js)_
|
|
62
62
|
|
|
63
63
|
## `sw-tsdk-connector action:generate:data`
|
|
64
64
|
|
|
@@ -83,7 +83,7 @@ DESCRIPTION
|
|
|
83
83
|
Use to test a task in an integration
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
_See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
86
|
+
_See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/action/generate/data.js)_
|
|
87
87
|
|
|
88
88
|
## `sw-tsdk-connector action:generate:input`
|
|
89
89
|
|
|
@@ -108,7 +108,7 @@ DESCRIPTION
|
|
|
108
108
|
Update action input schema.
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
_See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
111
|
+
_See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/action/generate/input.js)_
|
|
112
112
|
|
|
113
113
|
## `sw-tsdk-connector action:generate:output`
|
|
114
114
|
|
|
@@ -132,7 +132,7 @@ DESCRIPTION
|
|
|
132
132
|
Update a connector action.
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
_See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
135
|
+
_See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/action/generate/output.js)_
|
|
136
136
|
|
|
137
137
|
## `sw-tsdk-connector action:run:local`
|
|
138
138
|
|
|
@@ -142,7 +142,7 @@ Runs a connector action. (Defaults to current image version in local repository)
|
|
|
142
142
|
USAGE
|
|
143
143
|
$ sw-tsdk-connector action:run:local [-a <value>] [-d <value>] [--input-path <value>] [--output-path <value>]
|
|
144
144
|
[--error-path <value>] [--asset-path <value>] [--template
|
|
145
|
-
python_37_swimlane|node_18|python_39_definition|python_310_definition|python_311_definition] [-f] [-h]
|
|
145
|
+
python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|python_311_definition] [-f] [-h]
|
|
146
146
|
|
|
147
147
|
FLAGS
|
|
148
148
|
-a, --action=<value> Action name to run
|
|
@@ -154,14 +154,14 @@ FLAGS
|
|
|
154
154
|
--input-path=<value> File to input data JSON file, defaults to /data/<action>.json
|
|
155
155
|
--output-path=<value> File to write the outputs to, defaults to /data/<action>_output.json
|
|
156
156
|
--template=<option> connector template
|
|
157
|
-
<options:
|
|
158
|
-
|
|
157
|
+
<options: python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|pytho
|
|
158
|
+
n_311_definition>
|
|
159
159
|
|
|
160
160
|
DESCRIPTION
|
|
161
161
|
Runs a connector action. (Defaults to current image version in local repository).
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
_See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
164
|
+
_See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/action/run/local.js)_
|
|
165
165
|
|
|
166
166
|
## `sw-tsdk-connector asset:add`
|
|
167
167
|
|
|
@@ -182,7 +182,7 @@ DESCRIPTION
|
|
|
182
182
|
Update a connector action.
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
_See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
185
|
+
_See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/asset/add.js)_
|
|
186
186
|
|
|
187
187
|
## `sw-tsdk-connector connector:build`
|
|
188
188
|
|
|
@@ -191,8 +191,8 @@ Builds a local docker image of the connector.
|
|
|
191
191
|
```
|
|
192
192
|
USAGE
|
|
193
193
|
$ sw-tsdk-connector connector:build [--template
|
|
194
|
-
python_37_swimlane|node_18|python_39_definition|python_310_definition|python_311_definition] [-d <value>]
|
|
195
|
-
[-f] [--signing-password <value>] [--key-name <value>] [--registry <value>] [-o <value>] [-h]
|
|
194
|
+
python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|python_311_definition] [-d <value>]
|
|
195
|
+
[--save] [-f] [--signing-password <value>] [--key-name <value>] [--registry <value>] [-o <value>] [-h]
|
|
196
196
|
|
|
197
197
|
FLAGS
|
|
198
198
|
-d, --directory=<value> [default: ./] root directory of the repository.
|
|
@@ -204,14 +204,14 @@ FLAGS
|
|
|
204
204
|
--save saves a signed docker image as tar in local directory.
|
|
205
205
|
--signing-password=<value> password used for the private key (ENV: TURBINE_SIGNING_PASSWORD)
|
|
206
206
|
--template=<option> connector language
|
|
207
|
-
<options: python_37_swimlane|node_18|python_39_definition|python_310_definition|
|
|
208
|
-
|
|
207
|
+
<options: python_37_swimlane|node_18|node_20|python_39_definition|python_310_definition|py
|
|
208
|
+
thon_311_definition>
|
|
209
209
|
|
|
210
210
|
DESCRIPTION
|
|
211
211
|
Builds a local docker image of the connector.
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
_See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
214
|
+
_See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/build.js)_
|
|
215
215
|
|
|
216
216
|
## `sw-tsdk-connector connector:create`
|
|
217
217
|
|
|
@@ -242,7 +242,7 @@ DESCRIPTION
|
|
|
242
242
|
Scaffold a new connector
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
_See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
245
|
+
_See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/create.js)_
|
|
246
246
|
|
|
247
247
|
## `sw-tsdk-connector connector:create:openapi`
|
|
248
248
|
|
|
@@ -258,7 +258,7 @@ FLAGS
|
|
|
258
258
|
generated.
|
|
259
259
|
-h, --help Show CLI help.
|
|
260
260
|
-k, --keywords=<value> Please enter keyword (Comma-Separated)
|
|
261
|
-
-o, --specs=<value>
|
|
261
|
+
-o, --specs=<value> path to the spec file
|
|
262
262
|
--author=<value> Connector Author
|
|
263
263
|
--authorEmail=<value> Connector Author Email
|
|
264
264
|
--description=<value> Description (e.g. CrowdStrike Host Query API)
|
|
@@ -271,7 +271,7 @@ DESCRIPTION
|
|
|
271
271
|
Scaffold a new connector
|
|
272
272
|
```
|
|
273
273
|
|
|
274
|
-
_See code: [lib/commands/connector/create/openapi.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
274
|
+
_See code: [lib/commands/connector/create/openapi.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/create/openapi.js)_
|
|
275
275
|
|
|
276
276
|
## `sw-tsdk-connector connector:create:source`
|
|
277
277
|
|
|
@@ -289,7 +289,7 @@ DESCRIPTION
|
|
|
289
289
|
Generates 11x source from 10x
|
|
290
290
|
```
|
|
291
291
|
|
|
292
|
-
_See code: [lib/commands/connector/create/source.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
292
|
+
_See code: [lib/commands/connector/create/source.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/create/source.js)_
|
|
293
293
|
|
|
294
294
|
## `sw-tsdk-connector connector:logo`
|
|
295
295
|
|
|
@@ -308,7 +308,7 @@ DESCRIPTION
|
|
|
308
308
|
Update a connector.
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
_See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
311
|
+
_See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/logo.js)_
|
|
312
312
|
|
|
313
313
|
## `sw-tsdk-connector connector:sign`
|
|
314
314
|
|
|
@@ -333,7 +333,7 @@ DESCRIPTION
|
|
|
333
333
|
Builds a local docker image of the connector.
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
-
_See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
336
|
+
_See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/sign.js)_
|
|
337
337
|
|
|
338
338
|
## `sw-tsdk-connector connector:update`
|
|
339
339
|
|
|
@@ -353,7 +353,7 @@ DESCRIPTION
|
|
|
353
353
|
Update a connector.
|
|
354
354
|
```
|
|
355
355
|
|
|
356
|
-
_See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
356
|
+
_See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/update.js)_
|
|
357
357
|
|
|
358
358
|
## `sw-tsdk-connector connector:validate`
|
|
359
359
|
|
|
@@ -376,5 +376,5 @@ DESCRIPTION
|
|
|
376
376
|
Use to validate an integration
|
|
377
377
|
```
|
|
378
378
|
|
|
379
|
-
_See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.
|
|
379
|
+
_See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.13.0/lib/commands/connector/validate.js)_
|
|
380
380
|
<!-- 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,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;gBAChF,OAAO,EAAE,KAAK;aACf,CAAC,CAAA;QAEF,MAAM,OAAO,GAAoB,MAAM,kBAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QAEvE,MAAM,MAAM,GAA4B;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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,
|
|
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,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,yCAAuC;AACvC,uCAAgE;AAChE,wEAAkC;AAClC,8DAA0B;AAK1B,kDAAiE;AACjE,4CAA4C;AAE5C,qCAAqC;AACrC,MAAa,KAAM,SAAQ,WAAI;IA4B7B,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,GACN,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAE3B,IAAI,EACF,SA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MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;SACvD;aAAM;YACL,YAAY,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;SACzC;QAED,MAAM,IAAA,oBAAS,EAAC,gBAAgB,EAAE,iBAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC,CAAA;QAC1E,SAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IAClB,CAAC;;AA7EH,sBA8EC;AA7EQ,iBAAW,GAAG,6BAA6B,CAAA;AAE3C,WAAK,GAAG;IACb,GAAG,WAAI,CAAC,KAAK;IACb,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,oBAAoB;KAClC,CAAC;IACF,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,IAAI;KACd,CAAC;IACF,KAAK,EAAE,YAAK,CAAC,OAAO,CAAC;QACnB,WAAW,EAAE,6BAA6B;KAC3C,CAAC;IACF,oBAAoB,EAAE,YAAK,CAAC,MAAM,CAAC;QACjC,WAAW,EAAE,iGAAiG;KAC/G,CAAC;IACF,YAAY,EAAE,YAAK,CAAC,MAAM,CAAC;QACzB,WAAW,EAAE,+HAA+H;KAC7I,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAA"}
|
|
@@ -2,11 +2,11 @@ import { Base } from '@sw-tsdk/core';
|
|
|
2
2
|
export declare class Output 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>;
|
|
7
|
-
'action-config-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
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
|
+
'action-config-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
amend: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'output-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
9
|
+
'output-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 Output 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 Output 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
|
outputPath = outputPath || (0, node_path_1.join)(directory, 'data', `${action}_output.json`);
|
|
35
35
|
const outputData = await (0, fs_extra_1.readJson)(outputPath);
|
|
36
36
|
const outputSchema = await (0, connector_1.generateSchema)('output', outputData, connector_1.schemaDefaults);
|
|
@@ -43,25 +43,33 @@ class Output extends core_2.Base {
|
|
|
43
43
|
actionConfig.output = outputSchema.output;
|
|
44
44
|
}
|
|
45
45
|
await (0, fs_extra_1.writeFile)(actionConfigPath, js_yaml_1.default.dump(actionConfig, { noRefs: true }));
|
|
46
|
-
core_1.
|
|
46
|
+
core_1.ux.action.stop();
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.Output = Output;
|
|
50
50
|
Output.description = 'Update a connector action.';
|
|
51
|
-
Output.flags =
|
|
51
|
+
Output.flags = {
|
|
52
|
+
...core_2.Base.flags,
|
|
53
|
+
action: core_1.Flags.string({
|
|
52
54
|
char: 'a',
|
|
53
55
|
description: 'Action name to run',
|
|
54
|
-
}),
|
|
56
|
+
}),
|
|
57
|
+
directory: core_1.Flags.string({
|
|
55
58
|
char: 'd',
|
|
56
59
|
description: 'Root directory of the repository.',
|
|
57
60
|
default: './',
|
|
58
|
-
}),
|
|
61
|
+
}),
|
|
62
|
+
'action-config-path': core_1.Flags.string({
|
|
59
63
|
description: 'Override path to action configuration file. Defaults to /connector/config/<action>.yaml',
|
|
60
|
-
}),
|
|
64
|
+
}),
|
|
65
|
+
amend: core_1.Flags.boolean({
|
|
61
66
|
description: 'Merge with existing schema.',
|
|
62
|
-
}),
|
|
67
|
+
}),
|
|
68
|
+
'output-path': core_1.Flags.string({
|
|
63
69
|
description: 'Relative path to the output data JSON file, defaults to the task name under the data folder. ie: /data/<taskName>_output.json',
|
|
64
|
-
}),
|
|
70
|
+
}),
|
|
71
|
+
help: core_1.Flags.help({
|
|
65
72
|
char: 'h',
|
|
66
|
-
})
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
67
75
|
//# sourceMappingURL=output.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/output.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/commands/action/generate/output.ts"],"names":[],"mappings":";;;;AAAA,sCAAqC;AACrC,wCAAkC;AAClC,yCAAuC;AACvC,uCAAgE;AAChE,wEAAkC;AAClC,8DAA0B;AAK1B,kDAAiE;AACjE,4CAA4C;AAE5C,qCAAqC;AACrC,MAAa,MAAO,SAAQ,WAAI;IA4B9B,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,GACN,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAE5B,IAAI,EACF,SAAS,EACT,aAAa,EAAE,UAAU,EACzB,oBAAoB,EAAE,gBAAgB,EACtC,MAAM,GACP,GAAG,KAAK,CAAA;QAET,MAAM,EACJ,KAAK,GACN,GAAG,KAAK,CAAA;QAET,SAAS,GAAG,IAAA,mBAAO,EAAC,SAAS,IAAI,sBAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAE/C,wBAAwB;QACxB,IAAI;YACF,MAAM,mBAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;SACjC;QAAC,MAAM;YACN,IAAI,CAAC,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAA;SAC5C;QAED,iCAAiC;QACjC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,SAAS,CAAC,CAAA;SACvC;QAED,gBAAgB,GAAG,gBAAgB,IAAI,IAAA,gBAAI,EAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,CAAC,CAAA;QAE1G,MAAM,YAAY,GAAG,MAAM,iBAAI,CAAC,IAAI,CAAC,MAAM,IAAA,mBAAQ,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAA4B,CAAA;QAEzG,SAAE,CAAC,MAAM,CAAC,KAAK,CAAC,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,YAAK,CAAC,MAAM,CAAC;QAC1B,WAAW,EAAE,+HAA+H;KAC7I,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC;CACH,CAAA"}
|
|
@@ -3,16 +3,16 @@ export declare class Image extends Base {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static hidden: boolean;
|
|
5
5
|
static flags: {
|
|
6
|
-
action: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
7
|
-
directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
8
|
-
'input-path': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
9
|
-
'output-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
-
'error-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
|
-
'asset-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
12
|
-
repository: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
13
|
-
version: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
|
+
action: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
directory: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
'input-path': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
'output-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
'error-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
'asset-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
repository: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
14
|
stdin: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
15
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
16
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
17
17
|
};
|
|
18
18
|
private docker;
|