@apimatic/cli 1.0.1-alpha.3 → 1.0.1-alpha.4
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/CHANGELOG.md +7 -0
- package/README.md +60 -48
- package/lib/commands/api/index.js +4 -5
- package/lib/commands/api/transform.js +10 -4
- package/lib/commands/api/validate.js +10 -4
- package/lib/commands/auth/index.js +5 -5
- package/lib/commands/auth/login.js +4 -2
- package/lib/commands/auth/logout.js +1 -1
- package/lib/commands/auth/status.js +1 -1
- package/lib/commands/portal/generate.js +4 -4
- package/lib/commands/portal/index.js +3 -3
- package/lib/commands/sdk/generate.js +15 -6
- package/lib/commands/sdk/index.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.0.1-alpha.4](https://github.com/apimatic/apimatic-cli/compare/v1.0.1-alpha.3...v1.0.1-alpha.4) (2021-12-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **documentation:** improve messages for each command ([a2c0bfb](https://github.com/apimatic/apimatic-cli/commit/a2c0bfbd5c1867302cf27170dc3b2d3ca5bd64ca))
|
|
7
|
+
|
|
1
8
|
## [1.0.1-alpha.3](https://github.com/apimatic/apimatic-cli/compare/v1.0.1-alpha.2...v1.0.1-alpha.3) (2021-12-01)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
@apimatic/cli
|
|
2
2
|
=============
|
|
3
|
-
|
|
4
3
|
The official CLI for APIMatic.
|
|
5
|
-
|
|
6
4
|
[](https://oclif.io)
|
|
7
5
|
[](https://npmjs.org/package/@apimatic/cli)
|
|
8
6
|
[](https://npmjs.org/package/@apimatic/cli)
|
|
9
7
|
[](https://github.com/apimatic/apimatic-cli/blob/master/package.json)
|
|
10
|
-
|
|
11
8
|
<!-- toc -->
|
|
12
9
|
* [Usage](#usage)
|
|
13
10
|
* [Commands](#commands)
|
|
@@ -19,14 +16,13 @@ $ npm install -g @apimatic/cli
|
|
|
19
16
|
$ apimatic COMMAND
|
|
20
17
|
running command...
|
|
21
18
|
$ apimatic (-v|--version|version)
|
|
22
|
-
@apimatic/cli/1.0.1-alpha.
|
|
19
|
+
@apimatic/cli/1.0.1-alpha.4 linux-x64 node-v14.18.1
|
|
23
20
|
$ apimatic --help [COMMAND]
|
|
24
21
|
USAGE
|
|
25
22
|
$ apimatic COMMAND
|
|
26
23
|
...
|
|
27
24
|
```
|
|
28
25
|
<!-- usagestop -->
|
|
29
|
-
|
|
30
26
|
# Commands
|
|
31
27
|
<!-- commands -->
|
|
32
28
|
* [`apimatic api`](#apimatic-api)
|
|
@@ -45,7 +41,7 @@ USAGE
|
|
|
45
41
|
|
|
46
42
|
## `apimatic api`
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
Manage APIs
|
|
49
45
|
|
|
50
46
|
```
|
|
51
47
|
USAGE
|
|
@@ -55,60 +51,66 @@ EXAMPLE
|
|
|
55
51
|
$ apimatic api --help
|
|
56
52
|
```
|
|
57
53
|
|
|
58
|
-
_See code: [src/commands/api/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
54
|
+
_See code: [src/commands/api/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/api/index.ts)_
|
|
59
55
|
|
|
60
56
|
## `apimatic api:transform`
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
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.
|
|
63
59
|
|
|
64
60
|
```
|
|
65
61
|
USAGE
|
|
66
62
|
$ apimatic api:transform
|
|
67
63
|
|
|
68
64
|
OPTIONS
|
|
69
|
-
--auth-key=auth-key override current
|
|
70
|
-
|
|
71
|
-
--destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli/src/commands/api] path to
|
|
72
|
-
transformed file
|
|
73
|
-
|
|
65
|
+
--auth-key=auth-key override current authentication state with an authentication key
|
|
66
|
+
--destination=destination [default: ./] directory to download transformed file to
|
|
74
67
|
--file=file path to the API specification file to transform
|
|
75
68
|
|
|
76
69
|
--format=format (required) specification format to transform API specification into
|
|
77
70
|
(OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|
|
|
78
71
|
Swagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)
|
|
79
72
|
|
|
80
|
-
--url=url URL to the API specification file to transform
|
|
73
|
+
--url=url URL to the API specification file to transform. Can be used in place of the --file option
|
|
74
|
+
if the API specification is publicly available.
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
EXAMPLES
|
|
83
77
|
$ apimatic api:transform --format="OpenApi3Json" --file="./specs/sample.json" --destination="D:/"
|
|
84
78
|
Success! Your transformed file is located at D:/Transformed_OpenApi3Json.json
|
|
79
|
+
|
|
80
|
+
$ apimatic api:transform --format=RAML --url="https://petstore.swagger.io/v2/swagger.json" --destination="D:/"
|
|
81
|
+
Success! Your transformed file is located at D:/swagger_raml.yaml
|
|
85
82
|
```
|
|
86
83
|
|
|
87
|
-
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
84
|
+
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/api/transform.ts)_
|
|
88
85
|
|
|
89
86
|
## `apimatic api:validate`
|
|
90
87
|
|
|
91
|
-
|
|
88
|
+
Validate the syntactic and semantic correctness of an API specification
|
|
92
89
|
|
|
93
90
|
```
|
|
94
91
|
USAGE
|
|
95
92
|
$ apimatic api:validate
|
|
96
93
|
|
|
97
94
|
OPTIONS
|
|
98
|
-
--auth-key=auth-key override current
|
|
99
|
-
--file=file
|
|
100
|
-
--url=url URL to the specification file to validate
|
|
95
|
+
--auth-key=auth-key override current authentication state with an authentication key
|
|
96
|
+
--file=file Path to the API specification file to validate
|
|
101
97
|
|
|
102
|
-
|
|
98
|
+
--url=url URL to the specification file to validate. Can be used in place of the --file option if the API
|
|
99
|
+
specification is publicly available.
|
|
100
|
+
|
|
101
|
+
EXAMPLES
|
|
103
102
|
$ apimatic api:validate --file="./specs/sample.json"
|
|
104
103
|
Specification file provided is valid
|
|
104
|
+
|
|
105
|
+
$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json
|
|
106
|
+
Specification file provided is valid
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
109
|
+
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/api/validate.ts)_
|
|
108
110
|
|
|
109
111
|
## `apimatic auth`
|
|
110
112
|
|
|
111
|
-
|
|
113
|
+
Manage this CLI's authentication state.
|
|
112
114
|
|
|
113
115
|
```
|
|
114
116
|
USAGE
|
|
@@ -118,11 +120,11 @@ EXAMPLE
|
|
|
118
120
|
$ apimatic auth --help
|
|
119
121
|
```
|
|
120
122
|
|
|
121
|
-
_See code: [src/commands/auth/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
123
|
+
_See code: [src/commands/auth/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/auth/index.ts)_
|
|
122
124
|
|
|
123
125
|
## `apimatic auth:login`
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
Login using your APIMatic credentials or an API Key
|
|
126
128
|
|
|
127
129
|
```
|
|
128
130
|
USAGE
|
|
@@ -131,19 +133,22 @@ USAGE
|
|
|
131
133
|
OPTIONS
|
|
132
134
|
--auth-key=auth-key Set authentication key for all commands
|
|
133
135
|
|
|
134
|
-
|
|
136
|
+
EXAMPLES
|
|
135
137
|
$ apimatic auth:login
|
|
136
138
|
Please enter your registered email: apimatic-user@gmail.com
|
|
137
139
|
Please enter your password: *********
|
|
138
140
|
|
|
139
141
|
You have successfully logged into APIMatic
|
|
142
|
+
|
|
143
|
+
$ apimatic auth:login --auth-key=xxxxxx
|
|
144
|
+
Authentication key successfully set
|
|
140
145
|
```
|
|
141
146
|
|
|
142
|
-
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
147
|
+
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/auth/login.ts)_
|
|
143
148
|
|
|
144
149
|
## `apimatic auth:logout`
|
|
145
150
|
|
|
146
|
-
|
|
151
|
+
Clear local login credentials
|
|
147
152
|
|
|
148
153
|
```
|
|
149
154
|
USAGE
|
|
@@ -154,11 +159,11 @@ EXAMPLE
|
|
|
154
159
|
Logged out
|
|
155
160
|
```
|
|
156
161
|
|
|
157
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
162
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/auth/logout.ts)_
|
|
158
163
|
|
|
159
164
|
## `apimatic auth:status`
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
View current authentication state
|
|
162
167
|
|
|
163
168
|
```
|
|
164
169
|
USAGE
|
|
@@ -169,7 +174,7 @@ EXAMPLE
|
|
|
169
174
|
Currently logged in as apimatic-client@gmail.com
|
|
170
175
|
```
|
|
171
176
|
|
|
172
|
-
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
177
|
+
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/auth/status.ts)_
|
|
173
178
|
|
|
174
179
|
## `apimatic autocomplete [SHELL]`
|
|
175
180
|
|
|
@@ -213,7 +218,7 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.9
|
|
|
213
218
|
|
|
214
219
|
## `apimatic portal`
|
|
215
220
|
|
|
216
|
-
|
|
221
|
+
Manage API documentation portals
|
|
217
222
|
|
|
218
223
|
```
|
|
219
224
|
USAGE
|
|
@@ -223,32 +228,32 @@ EXAMPLE
|
|
|
223
228
|
$apimatic portal --help
|
|
224
229
|
```
|
|
225
230
|
|
|
226
|
-
_See code: [src/commands/portal/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
231
|
+
_See code: [src/commands/portal/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/portal/index.ts)_
|
|
227
232
|
|
|
228
233
|
## `apimatic portal:generate`
|
|
229
234
|
|
|
230
|
-
Generate static
|
|
235
|
+
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)
|
|
231
236
|
|
|
232
237
|
```
|
|
233
238
|
USAGE
|
|
234
239
|
$ apimatic portal:generate
|
|
235
240
|
|
|
236
241
|
OPTIONS
|
|
237
|
-
--auth-key=auth-key override current
|
|
242
|
+
--auth-key=auth-key override current authentication state with an authentication key
|
|
238
243
|
--destination=destination [default: ./] path to the downloaded portal
|
|
239
|
-
--folder=folder
|
|
240
|
-
--zip
|
|
244
|
+
--folder=folder path to the input directory containing API specifications and config files
|
|
245
|
+
--zip download the generated portal as a .zip archive
|
|
241
246
|
|
|
242
247
|
EXAMPLE
|
|
243
248
|
$ apimatic portal:generate --folder="./portal/" --destination="D:/"
|
|
244
249
|
Your portal has been generated at D:/
|
|
245
250
|
```
|
|
246
251
|
|
|
247
|
-
_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
252
|
+
_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/portal/generate.ts)_
|
|
248
253
|
|
|
249
254
|
## `apimatic sdk`
|
|
250
255
|
|
|
251
|
-
|
|
256
|
+
Generate and manage SDKs for APIs
|
|
252
257
|
|
|
253
258
|
```
|
|
254
259
|
USAGE
|
|
@@ -258,7 +263,7 @@ EXAMPLE
|
|
|
258
263
|
$apimatic sdk --help
|
|
259
264
|
```
|
|
260
265
|
|
|
261
|
-
_See code: [src/commands/sdk/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
266
|
+
_See code: [src/commands/sdk/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/sdk/index.ts)_
|
|
262
267
|
|
|
263
268
|
## `apimatic sdk:generate`
|
|
264
269
|
|
|
@@ -269,9 +274,9 @@ USAGE
|
|
|
269
274
|
$ apimatic sdk:generate
|
|
270
275
|
|
|
271
276
|
OPTIONS
|
|
272
|
-
--auth-key=auth-key override current
|
|
273
|
-
--destination=destination [default: ./]
|
|
274
|
-
--file=file path to the API specification to generate
|
|
277
|
+
--auth-key=auth-key override current authentication state with an authentication key
|
|
278
|
+
--destination=destination [default: ./] directory to download the generated SDK to
|
|
279
|
+
--file=file path to the API specification to generate SDKs for
|
|
275
280
|
|
|
276
281
|
--platform=platform (required) language platform for sdk
|
|
277
282
|
Simple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT
|
|
@@ -279,14 +284,21 @@ OPTIONS
|
|
|
279
284
|
JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|
|
|
280
285
|
TS_GENERIC_LIB
|
|
281
286
|
|
|
282
|
-
--url=url URL to the API specification to generate
|
|
287
|
+
--url=url URL to the API specification to generate SDKs for. Can be used in place of the --file
|
|
288
|
+
option if the API specification is publicly available.
|
|
283
289
|
|
|
284
|
-
--zip
|
|
290
|
+
--zip download the generated SDK as a .zip archive
|
|
285
291
|
|
|
286
|
-
|
|
292
|
+
EXAMPLES
|
|
287
293
|
$ apimatic sdk:generate --platform="CSHARP" --file="./specs/sample.json"
|
|
288
|
-
SDK
|
|
294
|
+
Generating SDK... done
|
|
295
|
+
Downloading SDK... done
|
|
296
|
+
Success! Your SDK is located at swagger_sdk_csharp
|
|
297
|
+
$ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
|
|
298
|
+
Generating SDK... done
|
|
299
|
+
Downloading SDK... done
|
|
300
|
+
Success! Your SDK is located at swagger_sdk_csharp
|
|
289
301
|
```
|
|
290
302
|
|
|
291
|
-
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.
|
|
303
|
+
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.4/src/commands/sdk/generate.ts)_
|
|
292
304
|
<!-- commandsstop -->
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@oclif/command");
|
|
4
4
|
class Api extends command_1.Command {
|
|
5
5
|
async run() {
|
|
6
|
-
this.log(`
|
|
6
|
+
this.log(`Manage APIs
|
|
7
7
|
|
|
8
8
|
USAGE
|
|
9
9
|
$ apimatic api
|
|
@@ -12,11 +12,10 @@ EXAMPLE
|
|
|
12
12
|
$ apimatic api --help
|
|
13
13
|
|
|
14
14
|
COMMANDS
|
|
15
|
-
api:transform
|
|
16
|
-
|
|
17
|
-
api:validate Validates the provided API specification file for any syntactical and semantic errors`);
|
|
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`);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
exports.default = Api;
|
|
21
|
-
Api.description = "
|
|
20
|
+
Api.description = "Manage APIs";
|
|
22
21
|
Api.examples = ["$ apimatic api --help"];
|
|
@@ -69,10 +69,13 @@ class Transform extends command_1.Command {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.default = Transform;
|
|
72
|
-
Transform.description = `
|
|
72
|
+
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.`;
|
|
73
73
|
Transform.examples = [
|
|
74
74
|
`$ apimatic api:transform --format="OpenApi3Json" --file="./specs/sample.json" --destination="D:/"
|
|
75
75
|
Success! Your transformed file is located at D:/Transformed_OpenApi3Json.json
|
|
76
|
+
`,
|
|
77
|
+
`$ apimatic api:transform --format=RAML --url="https://petstore.swagger.io/v2/swagger.json" --destination="D:/"
|
|
78
|
+
Success! Your transformed file is located at D:/swagger_raml.yaml
|
|
76
79
|
`
|
|
77
80
|
];
|
|
78
81
|
Transform.flags = {
|
|
@@ -84,7 +87,10 @@ Transform.flags = {
|
|
|
84
87
|
Swagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)`
|
|
85
88
|
}),
|
|
86
89
|
file: command_1.flags.string({ default: "", description: "path to the API specification file to transform" }),
|
|
87
|
-
url: command_1.flags.string({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
url: command_1.flags.string({
|
|
91
|
+
default: "",
|
|
92
|
+
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."
|
|
93
|
+
}),
|
|
94
|
+
destination: command_1.flags.string({ default: "./", description: "directory to download transformed file to" }),
|
|
95
|
+
"auth-key": command_1.flags.string({ description: "override current authentication state with an authentication key" })
|
|
90
96
|
};
|
|
@@ -44,15 +44,21 @@ class Validate extends command_1.Command {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.default = Validate;
|
|
47
|
-
Validate.description = "
|
|
47
|
+
Validate.description = "Validate the syntactic and semantic correctness of an API specification";
|
|
48
48
|
Validate.examples = [
|
|
49
49
|
`$ apimatic api:validate --file="./specs/sample.json"
|
|
50
50
|
Specification file provided is valid
|
|
51
|
+
`,
|
|
52
|
+
`$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json
|
|
53
|
+
Specification file provided is valid
|
|
51
54
|
`
|
|
52
55
|
];
|
|
53
56
|
Validate.flags = {
|
|
54
|
-
file: command_1.flags.string({ default: "", description: "
|
|
55
|
-
url: command_1.flags.string({
|
|
57
|
+
file: command_1.flags.string({ default: "", description: "Path to the API specification file to validate" }),
|
|
58
|
+
url: command_1.flags.string({
|
|
59
|
+
default: "",
|
|
60
|
+
description: "URL to the specification file to validate. Can be used in place of the --file option if the API specification is publicly available."
|
|
61
|
+
}),
|
|
56
62
|
// docs: flags.boolean({ default: false, description: "Validate specification for docs generation" }), // Next tier, not included in API spec
|
|
57
|
-
"auth-key": command_1.flags.string({ description: "override current
|
|
63
|
+
"auth-key": command_1.flags.string({ description: "override current authentication state with an authentication key" })
|
|
58
64
|
};
|
|
@@ -5,7 +5,7 @@ class Auth extends command_1.Command {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.run = async () => {
|
|
8
|
-
this.log(`
|
|
8
|
+
this.log(`Manage this CLI's authentication state.
|
|
9
9
|
|
|
10
10
|
USAGE
|
|
11
11
|
$ apimatic auth
|
|
@@ -14,12 +14,12 @@ EXAMPLE
|
|
|
14
14
|
$ apimatic auth --help
|
|
15
15
|
|
|
16
16
|
COMMANDS
|
|
17
|
-
auth:login
|
|
18
|
-
auth:logout
|
|
19
|
-
auth:status
|
|
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
20
|
};
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.default = Auth;
|
|
24
|
-
Auth.description = "
|
|
24
|
+
Auth.description = "Manage this CLI's authentication state.";
|
|
25
25
|
Auth.examples = ["$ apimatic auth --help"];
|
|
@@ -44,14 +44,16 @@ class Login extends command_1.Command {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.default = Login;
|
|
47
|
-
Login.description = "
|
|
47
|
+
Login.description = "Login using your APIMatic credentials or an API Key";
|
|
48
48
|
Login.examples = [
|
|
49
49
|
`$ apimatic auth:login
|
|
50
50
|
Please enter your registered email: apimatic-user@gmail.com
|
|
51
51
|
Please enter your password: *********
|
|
52
52
|
|
|
53
53
|
You have successfully logged into APIMatic
|
|
54
|
-
|
|
54
|
+
`,
|
|
55
|
+
`$ apimatic auth:login --auth-key=xxxxxx
|
|
56
|
+
Authentication key successfully set`
|
|
55
57
|
];
|
|
56
58
|
Login.flags = {
|
|
57
59
|
"auth-key": command_1.flags.string({ default: "", description: "Set authentication key for all commands" })
|
|
@@ -15,7 +15,7 @@ class Status extends command_1.Command {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.default = Status;
|
|
18
|
-
Status.description = "
|
|
18
|
+
Status.description = "View current authentication state";
|
|
19
19
|
Status.examples = [
|
|
20
20
|
`$ apimatic auth:status
|
|
21
21
|
Currently logged in as apimatic-client@gmail.com
|
|
@@ -69,22 +69,22 @@ class PortalGenerate extends command_1.Command {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
exports.default = PortalGenerate;
|
|
72
|
-
PortalGenerate.description = "Generate static
|
|
72
|
+
PortalGenerate.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)";
|
|
73
73
|
PortalGenerate.flags = {
|
|
74
74
|
folder: command_1.flags.string({
|
|
75
75
|
parse: (input) => path.resolve(input),
|
|
76
76
|
default: "",
|
|
77
|
-
description: "
|
|
77
|
+
description: "path to the input directory containing API specifications and config files"
|
|
78
78
|
}),
|
|
79
79
|
destination: command_1.flags.string({
|
|
80
80
|
parse: (input) => path.resolve(input),
|
|
81
81
|
default: "./",
|
|
82
82
|
description: "path to the downloaded portal"
|
|
83
83
|
}),
|
|
84
|
-
zip: command_1.flags.boolean({ default: false, description: "
|
|
84
|
+
zip: command_1.flags.boolean({ default: false, description: "download the generated portal as a .zip archive" }),
|
|
85
85
|
"auth-key": command_1.flags.string({
|
|
86
86
|
default: "",
|
|
87
|
-
description: "override current
|
|
87
|
+
description: "override current authentication state with an authentication key"
|
|
88
88
|
})
|
|
89
89
|
};
|
|
90
90
|
PortalGenerate.examples = [
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@oclif/command");
|
|
4
4
|
class SDK extends command_1.Command {
|
|
5
5
|
async run() {
|
|
6
|
-
this.log(`
|
|
6
|
+
this.log(`Manage API documentation portals
|
|
7
7
|
|
|
8
8
|
USAGE
|
|
9
9
|
$ apimatic portal
|
|
@@ -12,9 +12,9 @@ EXAMPLE
|
|
|
12
12
|
$apimatic portal --help
|
|
13
13
|
|
|
14
14
|
COMMANDS
|
|
15
|
-
portal:generate Generate static
|
|
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
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.default = SDK;
|
|
19
|
-
SDK.description = "
|
|
19
|
+
SDK.description = "Manage API documentation portals";
|
|
20
20
|
SDK.examples = ["$apimatic portal --help"];
|
|
@@ -94,22 +94,31 @@ Legacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LI
|
|
|
94
94
|
file: command_1.flags.string({
|
|
95
95
|
parse: (input) => path.resolve(input),
|
|
96
96
|
default: "",
|
|
97
|
-
description: "path to the API specification to generate
|
|
97
|
+
description: "path to the API specification to generate SDKs for"
|
|
98
|
+
}),
|
|
99
|
+
url: command_1.flags.string({
|
|
100
|
+
default: "",
|
|
101
|
+
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."
|
|
98
102
|
}),
|
|
99
|
-
url: command_1.flags.string({ default: "", description: "URL to the API specification to generate SDK" }),
|
|
100
103
|
destination: command_1.flags.string({
|
|
101
104
|
parse: (input) => path.resolve(input),
|
|
102
105
|
default: "./",
|
|
103
|
-
description: "
|
|
106
|
+
description: "directory to download the generated SDK to"
|
|
104
107
|
}),
|
|
105
|
-
zip: command_1.flags.boolean({ default: false, description: "
|
|
108
|
+
zip: command_1.flags.boolean({ default: false, description: "download the generated SDK as a .zip archive" }),
|
|
106
109
|
"auth-key": command_1.flags.string({
|
|
107
110
|
default: "",
|
|
108
|
-
description: "override current
|
|
111
|
+
description: "override current authentication state with an authentication key"
|
|
109
112
|
})
|
|
110
113
|
};
|
|
111
114
|
SdkGenerate.examples = [
|
|
112
115
|
`$ apimatic sdk:generate --platform="CSHARP" --file="./specs/sample.json"
|
|
113
|
-
SDK
|
|
116
|
+
Generating SDK... done
|
|
117
|
+
Downloading SDK... done
|
|
118
|
+
Success! Your SDK is located at swagger_sdk_csharp`,
|
|
119
|
+
`$ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
|
|
120
|
+
Generating SDK... done
|
|
121
|
+
Downloading SDK... done
|
|
122
|
+
Success! Your SDK is located at swagger_sdk_csharp
|
|
114
123
|
`
|
|
115
124
|
];
|
|
@@ -4,7 +4,7 @@ const command_1 = require("@oclif/command");
|
|
|
4
4
|
class SDK extends command_1.Command {
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
6
6
|
async run() {
|
|
7
|
-
this.log(`
|
|
7
|
+
this.log(`Generate and manage SDKs for APIs
|
|
8
8
|
|
|
9
9
|
USAGE
|
|
10
10
|
$ apimatic sdk
|
|
@@ -17,5 +17,5 @@ COMMANDS
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
exports.default = SDK;
|
|
20
|
-
SDK.description = "
|
|
20
|
+
SDK.description = "Generate and manage SDKs for APIs";
|
|
21
21
|
SDK.examples = ["$apimatic sdk --help"];
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.1-alpha.
|
|
1
|
+
{"version":"1.0.1-alpha.4","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":"./"},"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":"./"},"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":"./"},"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":[]}}}
|