@sw-tsdk/plugin-connector 2.0.0 → 2.0.1-next.102

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.
Files changed (37) hide show
  1. package/README.md +64 -32
  2. package/lib/commands/connector/build.d.ts +2 -1
  3. package/lib/commands/connector/build.js +17 -6
  4. package/lib/commands/connector/build.js.map +1 -1
  5. package/lib/commands/connector/create/openapi.d.ts +46 -0
  6. package/lib/commands/connector/create/openapi.js +455 -0
  7. package/lib/commands/connector/create/openapi.js.map +1 -0
  8. package/lib/commands/connector/{create-source.d.ts → create/source.d.ts} +0 -0
  9. package/lib/commands/connector/{create-source.js → create/source.js} +1 -1
  10. package/lib/commands/connector/create/source.js.map +1 -0
  11. package/lib/commands/connector/create.d.ts +0 -3
  12. package/lib/commands/connector/create.js +5 -15
  13. package/lib/commands/connector/create.js.map +1 -1
  14. package/lib/commands/connector/sign.d.ts +1 -0
  15. package/lib/commands/connector/sign.js +7 -4
  16. package/lib/commands/connector/sign.js.map +1 -1
  17. package/lib/commands/connector/validate.js +1 -1
  18. package/lib/commands/connector/validate.js.map +1 -1
  19. package/lib/common.js +1 -0
  20. package/lib/common.js.map +1 -1
  21. package/lib/templates/python_3/template/connector/config/actions/example.yaml +14 -0
  22. package/lib/templates/python_3/template/connector/config/assets/example.yaml +22 -0
  23. package/lib/templates/python_3/template/connector/src/example.py +6 -0
  24. package/lib/templates/python_3/template/data/asset.json +1 -0
  25. package/lib/templates/python_3/template/docs/CHANGELOG.md.t +7 -0
  26. package/lib/templates/python_3/template/docs/README.md +38 -0
  27. package/lib/templates/python_3/template/requirements.txt +0 -0
  28. package/lib/templates/python_311_definition/template/connector/config/actions/example.yaml +40 -0
  29. package/lib/templates/python_311_definition/template/connector/config/assets/example.yaml +27 -0
  30. package/lib/templates/python_311_definition/template/data/asset.json +1 -0
  31. package/lib/templates/python_311_definition/template/docs/CHANGELOG.md.t +7 -0
  32. package/lib/templates/python_311_definition/template/docs/README.md +38 -0
  33. package/lib/templates/python_311_definition/template/requirements.txt +0 -0
  34. package/lib/types/connector-types.d.ts +1 -1
  35. package/oclif.manifest.json +1 -1
  36. package/package.json +7 -6
  37. package/lib/commands/connector/create-source.js.map +0 -1
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.0.0 darwin-x64 node-v16.17.1
19
+ @sw-tsdk/plugin-connector/2.0.1-next.102+1852615 linux-x64 node-v16.18.1
20
20
  $ sw-tsdk-connector --help [COMMAND]
21
21
  USAGE
22
22
  $ sw-tsdk-connector COMMAND
@@ -33,7 +33,8 @@ USAGE
33
33
  * [`sw-tsdk-connector asset:add`](#sw-tsdk-connector-assetadd)
34
34
  * [`sw-tsdk-connector connector:build`](#sw-tsdk-connector-connectorbuild)
35
35
  * [`sw-tsdk-connector connector:create`](#sw-tsdk-connector-connectorcreate)
36
- * [`sw-tsdk-connector connector:create-source`](#sw-tsdk-connector-connectorcreate-source)
36
+ * [`sw-tsdk-connector connector:create:openapi`](#sw-tsdk-connector-connectorcreateopenapi)
37
+ * [`sw-tsdk-connector connector:create:source`](#sw-tsdk-connector-connectorcreatesource)
37
38
  * [`sw-tsdk-connector connector:logo`](#sw-tsdk-connector-connectorlogo)
38
39
  * [`sw-tsdk-connector connector:save`](#sw-tsdk-connector-connectorsave)
39
40
  * [`sw-tsdk-connector connector:sign`](#sw-tsdk-connector-connectorsign)
@@ -58,7 +59,7 @@ DESCRIPTION
58
59
  Update a connector action.
59
60
  ```
60
61
 
61
- _See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/action/add.js)_
62
+ _See code: [lib/commands/action/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/action/add.js)_
62
63
 
63
64
  ## `sw-tsdk-connector action:generate:data`
64
65
 
@@ -83,7 +84,7 @@ DESCRIPTION
83
84
  Use to test a task in an integration
84
85
  ```
85
86
 
86
- _See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/action/generate/data.js)_
87
+ _See code: [lib/commands/action/generate/data.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/action/generate/data.js)_
87
88
 
88
89
  ## `sw-tsdk-connector action:generate:input`
89
90
 
@@ -108,7 +109,7 @@ DESCRIPTION
108
109
  Update action input schema.
109
110
  ```
110
111
 
111
- _See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/action/generate/input.js)_
112
+ _See code: [lib/commands/action/generate/input.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/action/generate/input.js)_
112
113
 
113
114
  ## `sw-tsdk-connector action:generate:output`
114
115
 
@@ -132,7 +133,7 @@ DESCRIPTION
132
133
  Update a connector action.
133
134
  ```
134
135
 
135
- _See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/action/generate/output.js)_
136
+ _See code: [lib/commands/action/generate/output.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/action/generate/output.js)_
136
137
 
137
138
  ## `sw-tsdk-connector action:run:local`
138
139
 
@@ -160,7 +161,7 @@ DESCRIPTION
160
161
  Runs a connector action. (Defaults to current image version in local repository).
161
162
  ```
162
163
 
163
- _See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/action/run/local.js)_
164
+ _See code: [lib/commands/action/run/local.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/action/run/local.js)_
164
165
 
165
166
  ## `sw-tsdk-connector asset:add`
166
167
 
@@ -181,7 +182,7 @@ DESCRIPTION
181
182
  Update a connector action.
182
183
  ```
183
184
 
184
- _See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/asset/add.js)_
185
+ _See code: [lib/commands/asset/add.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/asset/add.js)_
185
186
 
186
187
  ## `sw-tsdk-connector connector:build`
187
188
 
@@ -189,25 +190,27 @@ Builds a local docker image of the connector.
189
190
 
190
191
  ```
191
192
  USAGE
192
- $ sw-tsdk-connector connector:build --template python_3.7_swimlane|node_18|python_310_definition [-d <value>]
193
- [--save] [-f] [--signing-password <value>] [--key-name <value>] [--registry <value>] [-h]
193
+ $ sw-tsdk-connector connector:build [--template
194
+ python_37_swimlane|node_18|python_310_definition|python_311_definition] [-d <value>] [--save] [-f]
195
+ [--signing-password <value>] [--key-name <value>] [--registry <value>] [-o <value>] [-h]
194
196
 
195
197
  FLAGS
196
198
  -d, --directory=<value> [default: ./] root directory of the repository.
197
199
  -f, --force-rebuild forces nocache on the image build
198
200
  -h, --help Show CLI help.
201
+ -o, --output=<value> output path to where to store the image.
199
202
  --key-name=<value> name used for the key (default: username)
200
203
  --registry=<value> [default: localhost:5000] registry to use for signing
201
204
  --save saves a signed docker image as tar in local directory.
202
- --signing-password=<value> password used for the private key
203
- --template=<option> (required) [default: python_310_definition] connector language
204
- <options: python_3.7_swimlane|node_18|python_310_definition>
205
+ --signing-password=<value> password used for the private key (ENV: TURBINE_SIGNING_PASSWORD)
206
+ --template=<option> connector language
207
+ <options: python_37_swimlane|node_18|python_310_definition|python_311_definition>
205
208
 
206
209
  DESCRIPTION
207
210
  Builds a local docker image of the connector.
208
211
  ```
209
212
 
210
- _See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/build.js)_
213
+ _See code: [lib/commands/connector/build.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/build.js)_
211
214
 
212
215
  ## `sw-tsdk-connector connector:create`
213
216
 
@@ -215,39 +218,67 @@ Scaffold a new connector
215
218
 
216
219
  ```
217
220
  USAGE
218
- $ sw-tsdk-connector connector:create [-d <value>] [-t node_18|python_310_definition|python_3.7_swimlane]
219
- [--skip-repo] [--vendor <value>] [--product <value>] [--keywords <value>] [--description <value>] [--logoPath
220
- <value>] [--author <value>] [--authorEmail <value>] [--homepage <value>] [-h]
221
+ $ sw-tsdk-connector connector:create [-d <value>] [-t python_310_definition|python_311_definition|python_3]
222
+ [--vendor <value>] [--product <value>] [--keywords <value>] [--description <value>] [--logoPath <value>] [--author
223
+ <value>] [--authorEmail <value>] [--homepage <value>] [-h]
221
224
 
222
225
  FLAGS
223
226
  -d, --directory=<value> [default: ./] root directory for where to store connectors, the connector directory will be
224
227
  generated.
225
228
  -h, --help Show CLI help.
226
- -t, --template=<option> [default: python_310_definition] connector template to scaffold
227
- <options: node_18|python_310_definition|python_3.7_swimlane>
229
+ -t, --template=<option> [default: python_311_definition] connector template to scaffold
230
+ <options: python_310_definition|python_311_definition|python_3>
231
+ --author=<value> Connector Author
232
+ --authorEmail=<value> Connector Author Email
233
+ --description=<value> Description (e.g. CrowdStrike Host Query API)
234
+ --homepage=<value> Connector Author Support URL
235
+ --keywords=<value> Enter keywords (Comma-Separated)
236
+ --logoPath=<value> URL or absolute path to logo file
237
+ --product=<value> Product (e.g. Falcon)
238
+ --vendor=<value> Vendor (e.g. CrowdStrike)
239
+
240
+ DESCRIPTION
241
+ Scaffold a new connector
242
+ ```
243
+
244
+ _See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/create.js)_
245
+
246
+ ## `sw-tsdk-connector connector:create:openapi`
247
+
248
+ Scaffold a new connector
249
+
250
+ ```
251
+ USAGE
252
+ $ sw-tsdk-connector connector:create:openapi [-d <value>] [--vendor <value>] [--product <value>] [-k <value>] [--description
253
+ <value>] [--logoPath <value>] [--author <value>] [--authorEmail <value>] [--homepage <value>] [-o <value>] [-h]
254
+
255
+ FLAGS
256
+ -d, --directory=<value> [default: ./] root directory for where to store connectors, the connector directory will be
257
+ generated.
258
+ -h, --help Show CLI help.
259
+ -k, --keywords=<value> Please enter keyword (Comma-Separated)
260
+ -o, --specs=<value> root directory for where to store connectors, the connector directory will be generated.
228
261
  --author=<value> Connector Author
229
262
  --authorEmail=<value> Connector Author Email
230
263
  --description=<value> Description (e.g. CrowdStrike Host Query API)
231
264
  --homepage=<value> Connector Author Support URL
232
- --keywords=<value> Enter keyword (Comma-Separated)
233
265
  --logoPath=<value> URL or absolute path to logo file
234
266
  --product=<value> Product (e.g. Falcon)
235
- --skip-repo skips the repository creation process
236
267
  --vendor=<value> Vendor (e.g. CrowdStrike)
237
268
 
238
269
  DESCRIPTION
239
270
  Scaffold a new connector
240
271
  ```
241
272
 
242
- _See code: [lib/commands/connector/create.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/create.js)_
273
+ _See code: [lib/commands/connector/create/openapi.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/create/openapi.js)_
243
274
 
244
- ## `sw-tsdk-connector connector:create-source`
275
+ ## `sw-tsdk-connector connector:create:source`
245
276
 
246
277
  Generates 11x source from 10x
247
278
 
248
279
  ```
249
280
  USAGE
250
- $ sw-tsdk-connector connector:create-source [-d <value>] [-h]
281
+ $ sw-tsdk-connector connector:create:source [-d <value>] [-h]
251
282
 
252
283
  FLAGS
253
284
  -d, --directory=<value> [default: ./] root directory of the repository.
@@ -257,7 +288,7 @@ DESCRIPTION
257
288
  Generates 11x source from 10x
258
289
  ```
259
290
 
260
- _See code: [lib/commands/connector/create-source.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/create-source.js)_
291
+ _See code: [lib/commands/connector/create/source.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/create/source.js)_
261
292
 
262
293
  ## `sw-tsdk-connector connector:logo`
263
294
 
@@ -276,7 +307,7 @@ DESCRIPTION
276
307
  Update a connector.
277
308
  ```
278
309
 
279
- _See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/logo.js)_
310
+ _See code: [lib/commands/connector/logo.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/logo.js)_
280
311
 
281
312
  ## `sw-tsdk-connector connector:save`
282
313
 
@@ -297,7 +328,7 @@ DESCRIPTION
297
328
  Save a docker image locally as .tar.gz
298
329
  ```
299
330
 
300
- _See code: [lib/commands/connector/save.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/save.js)_
331
+ _See code: [lib/commands/connector/save.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/save.js)_
301
332
 
302
333
  ## `sw-tsdk-connector connector:sign`
303
334
 
@@ -306,11 +337,12 @@ Builds a local docker image of the connector.
306
337
  ```
307
338
  USAGE
308
339
  $ sw-tsdk-connector connector:sign --image <value> --key-name <value> [-d <value>] [--signing-password <value>]
309
- [--save] [--registry <value>] [-h]
340
+ [--save] [--registry <value>] [-o <value>] [-h]
310
341
 
311
342
  FLAGS
312
343
  -d, --directory=<value> [default: ./] root directory of the repository.
313
344
  -h, --help Show CLI help.
345
+ -o, --output=<value> output path to where to store the image.
314
346
  --image=<value> (required) image name to sign
315
347
  --key-name=<value> (required) name used for the key (default: username)
316
348
  --registry=<value> [default: localhost:5000] registry to use for signing
@@ -321,7 +353,7 @@ DESCRIPTION
321
353
  Builds a local docker image of the connector.
322
354
  ```
323
355
 
324
- _See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/sign.js)_
356
+ _See code: [lib/commands/connector/sign.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/sign.js)_
325
357
 
326
358
  ## `sw-tsdk-connector connector:update`
327
359
 
@@ -341,7 +373,7 @@ DESCRIPTION
341
373
  Update a connector.
342
374
  ```
343
375
 
344
- _See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/update.js)_
376
+ _See code: [lib/commands/connector/update.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/update.js)_
345
377
 
346
378
  ## `sw-tsdk-connector connector:validate`
347
379
 
@@ -357,12 +389,12 @@ FLAGS
357
389
  -h, --help Show CLI help.
358
390
  -i, --image=<value> image to use
359
391
  -s, --skip-pull skips pulling the image
360
- --key=<value> public key for verfication
392
+ --key=<value> public key for verification
361
393
  --signed validates a signed connector
362
394
 
363
395
  DESCRIPTION
364
396
  Use to validate an integration
365
397
  ```
366
398
 
367
- _See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.0/lib/commands/connector/validate.js)_
399
+ _See code: [lib/commands/connector/validate.js](https://github.com/swimlane/turbine-sdk/blob/v2.0.1-next.102+1852615/lib/commands/connector/validate.js)_
368
400
  <!-- commandsstop -->
@@ -2,7 +2,7 @@ import { Base } from '@sw-tsdk/core';
2
2
  export declare class Build extends Base {
3
3
  static description: string;
4
4
  static flags: {
5
- template: import("@oclif/core/lib/interfaces").OptionFlag<string>;
5
+ template: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
6
  'compile-override': import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
7
  'runner-override': import("@oclif/core/lib/interfaces").OptionFlag<string>;
8
8
  'runtime-override': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -15,6 +15,7 @@ export declare class Build extends Base {
15
15
  'key-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
16
  'skip-upload': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
17
  registry: import("@oclif/core/lib/interfaces").OptionFlag<string>;
18
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
19
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
19
20
  };
20
21
  run(): Promise<void>;
@@ -7,12 +7,13 @@ const node_path_1 = require("node:path");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const connector_1 = require("@sw-tsdk/connector");
9
9
  const sign_1 = require("./sign");
10
+ const docker_1 = require("@sw-tsdk/docker");
10
11
  // noinspection JSUnusedGlobalSymbols
11
12
  class Build extends core_2.Base {
12
13
  async run() {
13
14
  const { flags } = await this.parse(Build);
14
15
  let { directory } = flags;
15
- const { save, template, 'compile-override': compileOverride, 'runner-override': runnerOverride, 'runtime-override': runtimeOverride, 'force-rebuild': nocache, platform, squash, } = flags;
16
+ const { save, template, 'compile-override': compileOverride, 'runner-override': runnerOverride, 'runtime-override': runtimeOverride, 'force-rebuild': nocache, platform, squash, registry, output, } = flags;
16
17
  directory = (0, node_path_1.resolve)(directory || process.cwd());
17
18
  try {
18
19
  await node_fs_1.promises.access(directory);
@@ -20,8 +21,13 @@ class Build extends core_2.Base {
20
21
  catch (_a) {
21
22
  this.error(`Could not access ${directory}`);
22
23
  }
24
+ const docker = new docker_1.Docker();
25
+ core_1.CliUx.ux.action.start('Checking for docker...');
26
+ await docker.ping();
27
+ core_1.CliUx.ux.action.stop();
28
+ await node_fs_1.promises.rm(`${directory}/Dockerfile`);
23
29
  const connector = new connector_1.BuildConnector();
24
- const result = await connector.build({ directory, template, compileOverride, runnerOverride, runtimeOverride, nocache, platform, squash });
30
+ const result = await connector.build({ directory, template, compileOverride, runnerOverride, runtimeOverride, nocache, platform, squash, registry });
25
31
  if (save) {
26
32
  const { registry } = flags;
27
33
  await sign_1.Sign.run([
@@ -33,6 +39,8 @@ class Build extends core_2.Base {
33
39
  flags['key-name'] || '',
34
40
  '--signing-password',
35
41
  flags['signing-password'],
42
+ '-o',
43
+ output || directory,
36
44
  '--save',
37
45
  '--registry',
38
46
  registry,
@@ -44,9 +52,8 @@ exports.Build = Build;
44
52
  Build.description = 'Builds a local docker image of the connector.';
45
53
  Build.flags = Object.assign(Object.assign({}, core_2.Base.flags), { template: core_1.Flags.string({
46
54
  description: 'connector language',
47
- options: ['python_3.7_swimlane', 'node_18', 'python_310_definition'],
48
- default: 'python_310_definition',
49
- required: true,
55
+ options: ['python_37_swimlane', 'node_18', 'python_310_definition', 'python_311_definition'],
56
+ required: false,
50
57
  }), 'compile-override': core_1.Flags.string({
51
58
  hidden: true,
52
59
  default: 'Compile.Dockerfile',
@@ -78,8 +85,9 @@ Build.flags = Object.assign(Object.assign({}, core_2.Base.flags), { template: co
78
85
  hidden: true,
79
86
  default: 'linux/amd64',
80
87
  }), 'signing-password': core_1.Flags.string({
81
- description: 'password used for the private key',
88
+ description: 'password used for the private key (ENV: TURBINE_SIGNING_PASSWORD)',
82
89
  default: '',
90
+ env: 'TURBINE_SIGNING_PASSWORD',
83
91
  }), 'key-name': core_1.Flags.string({
84
92
  description: 'name used for the key (default: username)',
85
93
  }), 'skip-upload': core_1.Flags.boolean({
@@ -87,6 +95,9 @@ Build.flags = Object.assign(Object.assign({}, core_2.Base.flags), { template: co
87
95
  }), registry: core_1.Flags.string({
88
96
  description: 'registry to use for signing',
89
97
  default: 'localhost:5000',
98
+ }), output: core_1.Flags.string({
99
+ char: 'o',
100
+ description: 'output path to where to store the image.',
90
101
  }), help: core_1.Flags.help({
91
102
  char: 'h',
92
103
  }) });
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/commands/connector/build.ts"],"names":[],"mappings":";;;AAAA,sCAAiC;AACjC,wCAAkC;AAClC,yCAAiC;AACjC,qCAAgC;AAChC,kDAAiD;AACjD,iCAA2B;AAE3B,qCAAqC;AACrC,MAAa,KAAM,SAAQ,WAAI;IAoE7B,KAAK,CAAC,GAAG;QACP,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAEvC,IAAI,EAAC,SAAS,EAAC,GAAG,KAAK,CAAA;QACvB,MAAM,EACJ,IAAI,EACJ,QAAQ,EACR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GAAG;QACT,WAAW,EAAE,0CAA0C;KACxD,CAAC,EACF,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC;QACf,IAAI,EAAE,GAAG;KACV,CAAC,IACH"}
@@ -0,0 +1,46 @@
1
+ import { Base } from '@sw-tsdk/core';
2
+ import { Action, Input, InnerProperty, Output, Property } from '@sw-tsdk/connector';
3
+ export declare class OpenAPI extends Base {
4
+ static description: string;
5
+ defaultTemplate: string;
6
+ codeRegex: RegExp;
7
+ specData: any;
8
+ currentContext: any;
9
+ referenceMapped: string[];
10
+ static flags: {
11
+ directory: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
+ vendor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ product: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ keywords: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
15
+ description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
+ logoPath: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
+ author: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
+ authorEmail: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
+ homepage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
20
+ specs: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
21
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
22
+ };
23
+ run(): Promise<void>;
24
+ createActionsFromPaths(paths: any, actionFolder: string, basePath: string, index?: number): Promise<void>;
25
+ buildActions(actions: any, actionFolder: string, endpoint: string, basePath: string, index?: number): Promise<void>;
26
+ createActionData(action: any, endpoint: string, method: string): Promise<Action>;
27
+ createInputs(action: any): Promise<Input>;
28
+ createOutput(action: any): Promise<Output>;
29
+ formatData(data: any): any[];
30
+ getInnerData(object: any, path: string | string[], type: string, exclude?: boolean): Promise<any>;
31
+ exclude(filter: string[], list: string[], index?: number): string[];
32
+ filterByList(list: string[], object: any): any[] | null;
33
+ buildObject(object: any, key: string): Promise<Property>;
34
+ buildItems(items: any): Promise<Property | InnerProperty>;
35
+ getStatusCodeObject(response: any): {
36
+ data: any;
37
+ code: string;
38
+ };
39
+ getReference(path: string[], currentContext: any, index?: number): any;
40
+ buildInnerObject(object: any, currentObject: InnerProperty, index?: number): Promise<InnerProperty>;
41
+ existReferences(object: any, found?: string[], index?: number): string[];
42
+ createAssets(securitySchemes: any, assetFolder: string, index?: number): Promise<void>;
43
+ generateJsonSchema(data: any, io: Output | Input): Promise<Output | Input>;
44
+ generateAttachmentSchema(data: any, io: Input | Output): Promise<Input | Output>;
45
+ getDataBody(data: any): Promise<any>;
46
+ }