@apimatic/cli 1.0.1-alpha.5 → 1.0.1-alpha.9

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 CHANGED
@@ -1,10 +1,13 @@
1
1
  @apimatic/cli
2
2
  =============
3
+
3
4
  The official CLI for APIMatic.
5
+
4
6
  [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
5
7
  [![Version](https://img.shields.io/npm/v/@apimatic/cli.svg)](https://npmjs.org/package/@apimatic/cli)
6
8
  [![Downloads/week](https://img.shields.io/npm/dw/@apimatic/cli.svg)](https://npmjs.org/package/@apimatic/cli)
7
9
  [![License](https://img.shields.io/npm/l/@apimatic/cli.svg)](https://github.com/apimatic/apimatic-cli/blob/master/package.json)
10
+
8
11
  <!-- toc -->
9
12
  * [Usage](#usage)
10
13
  * [Commands](#commands)
@@ -16,43 +19,26 @@ $ npm install -g @apimatic/cli
16
19
  $ apimatic COMMAND
17
20
  running command...
18
21
  $ apimatic (-v|--version|version)
19
- @apimatic/cli/1.0.1-alpha.5 linux-x64 node-v16.13.0
22
+ @apimatic/cli/1.0.1-alpha.9 linux-x64 node-v16.13.0
20
23
  $ apimatic --help [COMMAND]
21
24
  USAGE
22
25
  $ apimatic COMMAND
23
26
  ...
24
27
  ```
25
28
  <!-- usagestop -->
29
+
26
30
  # Commands
27
31
  <!-- commands -->
28
- * [`apimatic api`](#apimatic-api)
29
32
  * [`apimatic api:transform`](#apimatic-apitransform)
30
33
  * [`apimatic api:validate`](#apimatic-apivalidate)
31
- * [`apimatic auth`](#apimatic-auth)
32
34
  * [`apimatic auth:login`](#apimatic-authlogin)
33
35
  * [`apimatic auth:logout`](#apimatic-authlogout)
34
36
  * [`apimatic auth:status`](#apimatic-authstatus)
35
37
  * [`apimatic autocomplete [SHELL]`](#apimatic-autocomplete-shell)
36
38
  * [`apimatic help [COMMAND]`](#apimatic-help-command)
37
- * [`apimatic portal`](#apimatic-portal)
38
39
  * [`apimatic portal:generate`](#apimatic-portalgenerate)
39
- * [`apimatic sdk`](#apimatic-sdk)
40
40
  * [`apimatic sdk:generate`](#apimatic-sdkgenerate)
41
41
 
42
- ## `apimatic api`
43
-
44
- Manage APIs
45
-
46
- ```
47
- USAGE
48
- $ apimatic api
49
-
50
- EXAMPLE
51
- $ apimatic api --help
52
- ```
53
-
54
- _See code: [src/commands/api/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/api/index.ts)_
55
-
56
42
  ## `apimatic api:transform`
57
43
 
58
44
  Transform API specifications from one format to another. Supports [10+ different formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.
@@ -64,12 +50,15 @@ USAGE
64
50
  OPTIONS
65
51
  -f, --force overwrite if same file exist in the destination
66
52
  --auth-key=auth-key override current authentication state with an authentication key
67
- --destination=destination [default: ./] directory to download transformed file to
53
+
54
+ --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download
55
+ transformed file to
56
+
68
57
  --file=file path to the API specification file to transform
69
58
 
70
59
  --format=format (required) specification format to transform API specification into
71
- (OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|
72
- Swagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)
60
+ APIMATIC|WADL2009|WSDL|SWAGGER10|SWAGGER20|SWAGGERYAML|OAS3|OPENAPI3YAML|APIBLUEPRINT|RAML|
61
+ RAML10|POSTMAN10|POSTMAN20|GRAPHQLSCHEMA
73
62
 
74
63
  --url=url URL to the API specification file to transform. Can be used in place of the --file option
75
64
  if the API specification is publicly available.
@@ -82,7 +71,7 @@ EXAMPLES
82
71
  Success! Your transformed file is located at D:/swagger_raml.yaml
83
72
  ```
84
73
 
85
- _See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/api/transform.ts)_
74
+ _See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/api/transform.ts)_
86
75
 
87
76
  ## `apimatic api:validate`
88
77
 
@@ -107,21 +96,7 @@ EXAMPLES
107
96
  Specification file provided is valid
108
97
  ```
109
98
 
110
- _See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/api/validate.ts)_
111
-
112
- ## `apimatic auth`
113
-
114
- Manage this CLI's authentication state.
115
-
116
- ```
117
- USAGE
118
- $ apimatic auth
119
-
120
- EXAMPLE
121
- $ apimatic auth --help
122
- ```
123
-
124
- _See code: [src/commands/auth/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/auth/index.ts)_
99
+ _See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/api/validate.ts)_
125
100
 
126
101
  ## `apimatic auth:login`
127
102
 
@@ -145,7 +120,7 @@ EXAMPLES
145
120
  Authentication key successfully set
146
121
  ```
147
122
 
148
- _See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/auth/login.ts)_
123
+ _See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/auth/login.ts)_
149
124
 
150
125
  ## `apimatic auth:logout`
151
126
 
@@ -160,7 +135,7 @@ EXAMPLE
160
135
  Logged out
161
136
  ```
162
137
 
163
- _See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/auth/logout.ts)_
138
+ _See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/auth/logout.ts)_
164
139
 
165
140
  ## `apimatic auth:status`
166
141
 
@@ -175,7 +150,7 @@ EXAMPLE
175
150
  Currently logged in as apimatic-client@gmail.com
176
151
  ```
177
152
 
178
- _See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/auth/status.ts)_
153
+ _See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/auth/status.ts)_
179
154
 
180
155
  ## `apimatic autocomplete [SHELL]`
181
156
 
@@ -215,21 +190,7 @@ OPTIONS
215
190
  --all see all commands in CLI
216
191
  ```
217
192
 
218
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.10/src/commands/help.ts)_
219
-
220
- ## `apimatic portal`
221
-
222
- Manage API documentation portals
223
-
224
- ```
225
- USAGE
226
- $ apimatic portal
227
-
228
- EXAMPLE
229
- $apimatic portal --help
230
- ```
231
-
232
- _See code: [src/commands/portal/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/portal/index.ts)_
193
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.12/src/commands/help.ts)_
233
194
 
234
195
  ## `apimatic portal:generate`
235
196
 
@@ -242,8 +203,8 @@ USAGE
242
203
  OPTIONS
243
204
  -f, --force overwrite if a portal exists in the destination
244
205
  --auth-key=auth-key override current authentication state with an authentication key
245
- --destination=destination [default: ./] path to the downloaded portal
246
- --folder=folder path to the input directory containing API specifications and config files
206
+ --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] path to the downloaded portal
207
+ --folder=folder [default: ./] path to the input directory containing API specifications and config files
247
208
  --zip download the generated portal as a .zip archive
248
209
 
249
210
  EXAMPLE
@@ -251,21 +212,7 @@ EXAMPLE
251
212
  Your portal has been generated at D:/
252
213
  ```
253
214
 
254
- _See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/portal/generate.ts)_
255
-
256
- ## `apimatic sdk`
257
-
258
- Generate and manage SDKs for APIs
259
-
260
- ```
261
- USAGE
262
- $ apimatic sdk
263
-
264
- EXAMPLE
265
- $apimatic sdk --help
266
- ```
267
-
268
- _See code: [src/commands/sdk/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/sdk/index.ts)_
215
+ _See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/portal/generate.ts)_
269
216
 
270
217
  ## `apimatic sdk:generate`
271
218
 
@@ -278,7 +225,10 @@ USAGE
278
225
  OPTIONS
279
226
  -f, --force overwrite if an SDK already exists in the destination
280
227
  --auth-key=auth-key override current authentication state with an authentication key
281
- --destination=destination [default: ./] directory to download the generated SDK to
228
+
229
+ --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download the
230
+ generated SDK to
231
+
282
232
  --file=file path to the API specification to generate SDKs for
283
233
 
284
234
  --platform=platform (required) language platform for sdk
@@ -297,11 +247,12 @@ EXAMPLES
297
247
  Generating SDK... done
298
248
  Downloading SDK... done
299
249
  Success! Your SDK is located at swagger_sdk_csharp
250
+
300
251
  $ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
301
252
  Generating SDK... done
302
253
  Downloading SDK... done
303
254
  Success! Your SDK is located at swagger_sdk_csharp
304
255
  ```
305
256
 
306
- _See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.5/src/commands/sdk/generate.ts)_
257
+ _See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.9/src/commands/sdk/generate.ts)_
307
258
  <!-- commandsstop -->
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs-extra");
4
4
  const path = require("path");
5
- const cli_ux_1 = require("cli-ux");
6
5
  const sdk_1 = require("@apimatic/sdk");
7
6
  const command_1 = require("@oclif/command");
8
7
  const sdk_client_1 = require("../../client-utils/sdk-client");
9
8
  const utils_1 = require("../../utils/utils");
10
9
  const transform_1 = require("../../types/api/transform");
11
10
  const transform_2 = require("../../controllers/api/transform");
11
+ const formats = Object.keys(sdk_1.ExportFormats).join("|");
12
12
  class Transform extends command_1.Command {
13
13
  async run() {
14
14
  const { flags } = this.parse(Transform);
@@ -40,7 +40,6 @@ class Transform extends command_1.Command {
40
40
  this.log(`Success! Your transformed file is located at ${savedTransformationFile}`);
41
41
  }
42
42
  catch (error) {
43
- cli_ux_1.default.action.stop();
44
43
  if (error.result) {
45
44
  const apiError = error;
46
45
  // TODO: Hopefully, this type-cast won't be necessary when the SDK is
@@ -85,15 +84,22 @@ Transform.flags = {
85
84
  parse: (format) => transform_2.getValidFormat(format.toUpperCase()),
86
85
  required: true,
87
86
  description: `specification format to transform API specification into
88
- (OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|
89
- Swagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)`
87
+ ${formats}`
88
+ }),
89
+ file: command_1.flags.string({
90
+ parse: (input) => path.resolve(input),
91
+ default: "",
92
+ description: "path to the API specification file to transform"
90
93
  }),
91
- file: command_1.flags.string({ default: "", description: "path to the API specification file to transform" }),
92
94
  url: command_1.flags.string({
93
95
  default: "",
94
96
  description: "URL to the API specification file to transform. Can be used in place of the --file option if the API specification is publicly available."
95
97
  }),
96
- destination: command_1.flags.string({ default: "./", description: "directory to download transformed file to" }),
98
+ destination: command_1.flags.string({
99
+ parse: (input) => path.resolve(input),
100
+ default: path.resolve("./"),
101
+ description: "directory to download transformed file to"
102
+ }),
97
103
  force: command_1.flags.boolean({ char: "f", default: false, description: "overwrite if same file exist in the destination" }),
98
104
  "auth-key": command_1.flags.string({ description: "override current authentication state with an authentication key" })
99
105
  };
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs-extra");
4
4
  const path = require("path");
5
- const cli_ux_1 = require("cli-ux");
6
5
  const command_1 = require("@oclif/command");
7
6
  const sdk_1 = require("@apimatic/sdk");
8
7
  const sdk_client_1 = require("../../client-utils/sdk-client");
@@ -45,7 +44,6 @@ class PortalGenerate extends command_1.Command {
45
44
  this.log(`Your portal has been generated at ${generatedPortalPath}`);
46
45
  }
47
46
  catch (error) {
48
- cli_ux_1.default.action.stop();
49
47
  if (error && error.response) {
50
48
  const apiError = error;
51
49
  const apiResponse = apiError.response;
@@ -60,7 +58,7 @@ class PortalGenerate extends command_1.Command {
60
58
  return this.error(utils_1.replaceHTML(nestedErrors.message));
61
59
  }
62
60
  }
63
- else if (apiResponse.status === 401 && responseData.length > 0 && utils_1.isJSONParsable(responseData)) {
61
+ else if (apiResponse.status === 401 && responseData.length > 0) {
64
62
  this.error(utils_1.replaceHTML(responseData));
65
63
  }
66
64
  else if (apiResponse.status === 403 && apiResponse.statusText) {
@@ -82,12 +80,12 @@ PortalGenerate.description = "Generate and download a static API Documentation p
82
80
  PortalGenerate.flags = {
83
81
  folder: command_1.flags.string({
84
82
  parse: (input) => path.resolve(input),
85
- default: "",
83
+ default: "./",
86
84
  description: "path to the input directory containing API specifications and config files"
87
85
  }),
88
86
  destination: command_1.flags.string({
89
87
  parse: (input) => path.resolve(input),
90
- default: "./",
88
+ default: path.resolve("./"),
91
89
  description: "path to the downloaded portal"
92
90
  }),
93
91
  force: command_1.flags.boolean({ char: "f", default: false, description: "overwrite if a portal exists in the destination" }),
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const fs = require("fs-extra");
4
4
  const path = require("path");
5
- const cli_ux_1 = require("cli-ux");
6
5
  const sdk_1 = require("@apimatic/sdk");
7
6
  const command_1 = require("@oclif/command");
8
7
  const sdk_client_1 = require("../../client-utils/sdk-client");
@@ -45,7 +44,6 @@ class SdkGenerate extends command_1.Command {
45
44
  this.log(`Success! Your SDK is located at ${sdkPath}`);
46
45
  }
47
46
  catch (error) {
48
- cli_ux_1.default.action.stop();
49
47
  if (error.result) {
50
48
  const apiError = error;
51
49
  const result = apiError.result;
@@ -103,7 +101,7 @@ Legacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LI
103
101
  }),
104
102
  destination: command_1.flags.string({
105
103
  parse: (input) => path.resolve(input),
106
- default: "./",
104
+ default: path.resolve("./"),
107
105
  description: "directory to download the generated SDK to"
108
106
  }),
109
107
  force: command_1.flags.boolean({
@@ -122,7 +120,8 @@ SdkGenerate.examples = [
122
120
  Generating SDK... done
123
121
  Downloading SDK... done
124
122
  Success! Your SDK is located at swagger_sdk_csharp`,
125
- `$ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
123
+ `
124
+ $ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
126
125
  Generating SDK... done
127
126
  Downloading SDK... done
128
127
  Success! Your SDK is located at swagger_sdk_csharp
@@ -1 +1 @@
1
- {"version":"1.0.1-alpha.5","commands":{"api":{"id":"api","description":"Manage APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api --help"],"flags":{},"args":[]},"api:transform":{"id":"api:transform","description":"Transform API specifications from one format to another. Supports [10+ different formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:transform --format=\"OpenApi3Json\" --file=\"./specs/sample.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/Transformed_OpenApi3Json.json\n","$ apimatic api:transform --format=RAML --url=\"https://petstore.swagger.io/v2/swagger.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/swagger_raml.yaml\n"],"flags":{"format":{"name":"format","type":"option","description":"specification format to transform API specification into\n(OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|\nSwagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)","required":true},"file":{"name":"file","type":"option","description":"path to the API specification file to transform","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification file to transform. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download transformed file to","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if same file exist in the destination","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"api:validate":{"id":"api:validate","description":"Validate the syntactic and semantic correctness of an API specification","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:validate --file=\"./specs/sample.json\"\nSpecification file provided is valid\n","$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json\nSpecification file provided is valid\n"],"flags":{"file":{"name":"file","type":"option","description":"Path to the API specification file to validate","default":""},"url":{"name":"url","type":"option","description":"URL to the specification file to validate. Can be used in place of the --file option if the API specification is publicly available.","default":""},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"auth":{"id":"auth","description":"Manage this CLI's authentication state.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth --help"],"flags":{},"args":[]},"auth:login":{"id":"auth:login","description":"Login using your APIMatic credentials or an API Key","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:login\nPlease enter your registered email: apimatic-user@gmail.com\nPlease enter your password: *********\n\nYou have successfully logged into APIMatic\n","$ apimatic auth:login --auth-key=xxxxxx\nAuthentication key successfully set"],"flags":{"auth-key":{"name":"auth-key","type":"option","description":"Set authentication key for all commands","default":""}},"args":[]},"auth:logout":{"id":"auth:logout","description":"Clear local login credentials","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:logout\nLogged out\n"],"flags":{},"args":[]},"auth:status":{"id":"auth:status","description":"View current authentication state","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:status\nCurrently logged in as apimatic-client@gmail.com\n"],"flags":{},"args":[]},"portal:generate":{"id":"portal:generate","description":"Generate and download a static API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://portal-api-docs.apimatic.io/#/http/generating-api-portal/build-file)","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic portal:generate --folder=\"./portal/\" --destination=\"D:/\"\nYour portal has been generated at D:/\n"],"flags":{"folder":{"name":"folder","type":"option","description":"path to the input directory containing API specifications and config files","default":""},"destination":{"name":"destination","type":"option","description":"path to the downloaded portal","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if a portal exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated portal as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]},"portal":{"id":"portal","description":"Manage API documentation portals","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic portal --help"],"flags":{},"args":[]},"sdk:generate":{"id":"sdk:generate","description":"Generate SDK for your APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic sdk:generate --platform=\"CSHARP\" --file=\"./specs/sample.json\"\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp","$ apimatic sdk:generate --platform=\"CSHARP\" --url=https://petstore.swagger.io/v2/swagger.json\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp\n"],"flags":{"platform":{"name":"platform","type":"option","description":"language platform for sdk\nSimple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT\nLegacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|\n JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|\n TS_GENERIC_LIB","required":true},"file":{"name":"file","type":"option","description":"path to the API specification to generate SDKs for","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification to generate SDKs for. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download the generated SDK to","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if an SDK already exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated SDK as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]},"sdk":{"id":"sdk","description":"Generate and manage SDKs for APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic sdk --help"],"flags":{},"args":[]}}}
1
+ {"version":"1.0.1-alpha.9","commands":{"api:transform":{"id":"api:transform","description":"Transform API specifications from one format to another. Supports [10+ different formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:transform --format=\"OpenApi3Json\" --file=\"./specs/sample.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/Transformed_OpenApi3Json.json\n","$ apimatic api:transform --format=RAML --url=\"https://petstore.swagger.io/v2/swagger.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/swagger_raml.yaml\n"],"flags":{"format":{"name":"format","type":"option","description":"specification format to transform API specification into\nAPIMATIC|WADL2009|WSDL|SWAGGER10|SWAGGER20|SWAGGERYAML|OAS3|OPENAPI3YAML|APIBLUEPRINT|RAML|RAML10|POSTMAN10|POSTMAN20|GRAPHQLSCHEMA","required":true},"file":{"name":"file","type":"option","description":"path to the API specification file to transform","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification file to transform. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download transformed file to","default":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if same file exist in the destination","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"api:validate":{"id":"api:validate","description":"Validate the syntactic and semantic correctness of an API specification","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:validate --file=\"./specs/sample.json\"\nSpecification file provided is valid\n","$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json\nSpecification file provided is valid\n"],"flags":{"file":{"name":"file","type":"option","description":"Path to the API specification file to validate","default":""},"url":{"name":"url","type":"option","description":"URL to the specification file to validate. Can be used in place of the --file option if the API specification is publicly available.","default":""},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"auth:login":{"id":"auth:login","description":"Login using your APIMatic credentials or an API Key","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:login\nPlease enter your registered email: apimatic-user@gmail.com\nPlease enter your password: *********\n\nYou have successfully logged into APIMatic\n","$ apimatic auth:login --auth-key=xxxxxx\nAuthentication key successfully set"],"flags":{"auth-key":{"name":"auth-key","type":"option","description":"Set authentication key for all commands","default":""}},"args":[]},"auth:logout":{"id":"auth:logout","description":"Clear local login credentials","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:logout\nLogged out\n"],"flags":{},"args":[]},"auth:status":{"id":"auth:status","description":"View current authentication state","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:status\nCurrently logged in as apimatic-client@gmail.com\n"],"flags":{},"args":[]},"portal:generate":{"id":"portal:generate","description":"Generate and download a static API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://portal-api-docs.apimatic.io/#/http/generating-api-portal/build-file)","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic portal:generate --folder=\"./portal/\" --destination=\"D:/\"\nYour portal has been generated at D:/\n"],"flags":{"folder":{"name":"folder","type":"option","description":"path to the input directory containing API specifications and config files","default":"./"},"destination":{"name":"destination","type":"option","description":"path to the downloaded portal","default":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if a portal exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated portal as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]},"sdk:generate":{"id":"sdk:generate","description":"Generate SDK for your APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic sdk:generate --platform=\"CSHARP\" --file=\"./specs/sample.json\"\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp","\n$ apimatic sdk:generate --platform=\"CSHARP\" --url=https://petstore.swagger.io/v2/swagger.json\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp\n"],"flags":{"platform":{"name":"platform","type":"option","description":"language platform for sdk\nSimple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT\nLegacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|\n JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|\n TS_GENERIC_LIB","required":true},"file":{"name":"file","type":"option","description":"path to the API specification to generate SDKs for","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification to generate SDKs for. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download the generated SDK to","default":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if an SDK already exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated SDK as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apimatic/cli",
3
3
  "description": "The official CLI for APIMatic.",
4
- "version": "1.0.1-alpha.5",
4
+ "version": "1.0.1-alpha.9",
5
5
  "author": "APIMatic",
6
6
  "bin": {
7
7
  "apimatic": "./bin/run"
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class Api extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class Api extends command_1.Command {
5
- async run() {
6
- this.log(`Manage APIs
7
-
8
- USAGE
9
- $ apimatic api
10
-
11
- EXAMPLE
12
- $ apimatic api --help
13
-
14
- COMMANDS
15
- api:transform Transform API specifications from one format to another. Supports [10+ different formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.
16
- api:validate Validate the syntactic and semantic correctness of an API specification`);
17
- }
18
- }
19
- exports.default = Api;
20
- Api.description = "Manage APIs";
21
- Api.examples = ["$ apimatic api --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class Auth extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run: () => Promise<void>;
6
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class Auth extends command_1.Command {
5
- constructor() {
6
- super(...arguments);
7
- this.run = async () => {
8
- this.log(`Manage this CLI's authentication state.
9
-
10
- USAGE
11
- $ apimatic auth
12
-
13
- EXAMPLE
14
- $ apimatic auth --help
15
-
16
- COMMANDS
17
- auth:login Login using your APIMatic credentials or an API Key
18
- auth:logout Clear local login credentials
19
- auth:status View current authentication state`);
20
- };
21
- }
22
- }
23
- exports.default = Auth;
24
- Auth.description = "Manage this CLI's authentication state.";
25
- Auth.examples = ["$ apimatic auth --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class SDK extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class SDK extends command_1.Command {
5
- async run() {
6
- this.log(`Manage API documentation portals
7
-
8
- USAGE
9
- $ apimatic portal
10
-
11
- EXAMPLE
12
- $apimatic portal --help
13
-
14
- COMMANDS
15
- portal:generate Generate and download a static API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://portal-api-docs.apimatic.io/#/http/generating-api-portal/build-file)`);
16
- }
17
- }
18
- exports.default = SDK;
19
- SDK.description = "Manage API documentation portals";
20
- SDK.examples = ["$apimatic portal --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class SDK extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class SDK extends command_1.Command {
5
- // eslint-disable-next-line @typescript-eslint/no-empty-function
6
- async run() {
7
- this.log(`Generate and manage SDKs for APIs
8
-
9
- USAGE
10
- $ apimatic sdk
11
-
12
- EXAMPLE
13
- $apimatic sdk --help
14
-
15
- COMMANDS
16
- sdk:generate Generate SDK for your APIs`);
17
- }
18
- }
19
- exports.default = SDK;
20
- SDK.description = "Generate and manage SDKs for APIs";
21
- SDK.examples = ["$apimatic sdk --help"];