@apimatic/cli 0.0.0-alpha.3 → 1.0.0-beta.1
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 +308 -130
- package/bin/run.js +5 -0
- package/lib/actions/action-result.d.ts +13 -0
- package/lib/actions/action-result.js +44 -0
- package/lib/actions/action-result.js.map +1 -0
- package/lib/actions/api/transform.d.ts +15 -0
- package/lib/actions/api/transform.js +48 -0
- package/lib/actions/api/transform.js.map +1 -0
- package/lib/actions/api/validate.d.ts +12 -0
- package/lib/actions/api/validate.js +41 -0
- package/lib/actions/api/validate.js.map +1 -0
- package/lib/actions/auth/login.d.ts +13 -0
- package/lib/actions/auth/login.js +55 -0
- package/lib/actions/auth/login.js.map +1 -0
- package/lib/actions/auth/logout.d.ts +8 -0
- package/lib/actions/auth/logout.js +15 -0
- package/lib/actions/auth/logout.js.map +1 -0
- package/lib/actions/auth/status.d.ts +11 -0
- package/lib/actions/auth/status.js +26 -0
- package/lib/actions/auth/status.js.map +1 -0
- package/lib/actions/portal/copilot.d.ts +16 -0
- package/lib/actions/portal/copilot.js +89 -0
- package/lib/actions/portal/copilot.js.map +1 -0
- package/lib/actions/portal/generate.d.ts +13 -0
- package/lib/actions/portal/generate.js +59 -0
- package/lib/actions/portal/generate.js.map +1 -0
- package/lib/actions/portal/quickstart.d.ts +16 -0
- package/lib/actions/portal/quickstart.js +145 -0
- package/lib/actions/portal/quickstart.js.map +1 -0
- package/lib/actions/portal/recipe/new-recipe.d.ts +15 -0
- package/lib/actions/portal/recipe/new-recipe.js +176 -0
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +16 -0
- package/lib/actions/portal/serve.js +119 -0
- package/lib/actions/portal/serve.js.map +1 -0
- package/lib/actions/portal/toc/new-toc.d.ts +21 -0
- package/lib/actions/portal/toc/new-toc.js +97 -0
- package/lib/actions/portal/toc/new-toc.js.map +1 -0
- package/lib/actions/sdk/generate.d.ts +13 -0
- package/lib/actions/sdk/generate.js +47 -0
- package/lib/actions/sdk/generate.js.map +1 -0
- package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
- package/lib/application/portal/recipe/portal-recipe.js +33 -0
- package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
- package/lib/application/portal/recipe/recipe-generator.d.ts +21 -0
- package/lib/application/portal/recipe/recipe-generator.js +146 -0
- package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
- package/lib/application/portal/toc/toc-content-parser.d.ts +5 -0
- package/lib/application/portal/toc/toc-content-parser.js +44 -0
- package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
- package/lib/application/portal/toc/toc-structure-generator.d.ts +6 -0
- package/lib/application/portal/toc/toc-structure-generator.js +84 -0
- package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
- package/lib/client-utils/auth-manager.d.ts +8 -3
- package/lib/client-utils/auth-manager.js +26 -14
- package/lib/client-utils/auth-manager.js.map +1 -0
- package/lib/commands/api/transform.d.ts +11 -8
- package/lib/commands/api/transform.js +52 -105
- package/lib/commands/api/transform.js.map +1 -0
- package/lib/commands/api/validate.d.ts +8 -5
- package/lib/commands/api/validate.js +31 -63
- package/lib/commands/api/validate.js.map +1 -0
- package/lib/commands/auth/login.d.ts +4 -2
- package/lib/commands/auth/login.js +26 -51
- package/lib/commands/auth/login.js.map +1 -0
- package/lib/commands/auth/logout.d.ts +4 -2
- package/lib/commands/auth/logout.js +14 -20
- package/lib/commands/auth/logout.js.map +1 -0
- package/lib/commands/auth/status.d.ts +2 -1
- package/lib/commands/auth/status.js +18 -20
- package/lib/commands/auth/status.js.map +1 -0
- package/lib/commands/portal/copilot.d.ts +13 -0
- package/lib/commands/portal/copilot.js +34 -0
- package/lib/commands/portal/copilot.js.map +1 -0
- package/lib/commands/portal/generate.d.ts +9 -8
- package/lib/commands/portal/generate.js +31 -97
- package/lib/commands/portal/generate.js.map +1 -0
- package/lib/commands/portal/quickstart.d.ts +9 -0
- package/lib/commands/portal/quickstart.js +37 -0
- package/lib/commands/portal/quickstart.js.map +1 -0
- package/lib/commands/portal/recipe/new.d.ts +12 -0
- package/lib/commands/portal/recipe/new.js +46 -0
- package/lib/commands/portal/recipe/new.js.map +1 -0
- package/lib/commands/portal/serve.d.ts +16 -0
- package/lib/commands/portal/serve.js +54 -0
- package/lib/commands/portal/serve.js.map +1 -0
- package/lib/commands/portal/toc/new.d.ts +14 -0
- package/lib/commands/portal/toc/new.js +61 -0
- package/lib/commands/portal/toc/new.js.map +1 -0
- package/lib/commands/sdk/generate.d.ts +11 -9
- package/lib/commands/sdk/generate.js +48 -122
- package/lib/commands/sdk/generate.js.map +1 -0
- package/lib/config/axios-config.d.ts +2 -0
- package/lib/config/axios-config.js +10 -0
- package/lib/config/axios-config.js.map +1 -0
- package/lib/hooks/not-found.d.ts +3 -0
- package/lib/hooks/not-found.js +52 -0
- package/lib/hooks/not-found.js.map +1 -0
- package/lib/hooks/utils.d.ts +5 -0
- package/lib/hooks/utils.js +51 -0
- package/lib/hooks/utils.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -4
- package/lib/index.js.map +1 -0
- package/lib/infrastructure/api-utils.d.ts +9 -0
- package/lib/infrastructure/api-utils.js +34 -0
- package/lib/infrastructure/api-utils.js.map +1 -0
- package/lib/infrastructure/debounce-service.d.ts +10 -0
- package/lib/infrastructure/debounce-service.js +52 -0
- package/lib/infrastructure/debounce-service.js.map +1 -0
- package/lib/infrastructure/env-info.d.ts +12 -0
- package/lib/infrastructure/env-info.js +58 -0
- package/lib/infrastructure/env-info.js.map +1 -0
- package/lib/infrastructure/file-service.d.ts +23 -0
- package/lib/infrastructure/file-service.js +117 -0
- package/lib/infrastructure/file-service.js.map +1 -0
- package/lib/infrastructure/launcher-service.d.ts +7 -0
- package/lib/infrastructure/launcher-service.js +51 -0
- package/lib/infrastructure/launcher-service.js.map +1 -0
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +7 -0
- package/lib/infrastructure/network-service.js.map +1 -0
- package/lib/infrastructure/services/api-client-factory.d.ts +6 -0
- package/lib/infrastructure/services/api-client-factory.js +20 -0
- package/lib/infrastructure/services/api-client-factory.js.map +1 -0
- package/lib/infrastructure/services/api-service.d.ts +10 -0
- package/lib/infrastructure/services/api-service.js +55 -0
- package/lib/infrastructure/services/api-service.js.map +1 -0
- package/lib/infrastructure/services/auth-service.d.ts +11 -0
- package/lib/infrastructure/services/auth-service.js +37 -0
- package/lib/infrastructure/services/auth-service.js.map +1 -0
- package/lib/infrastructure/services/file-download-service.d.ts +15 -0
- package/lib/infrastructure/services/file-download-service.js +104 -0
- package/lib/infrastructure/services/file-download-service.js.map +1 -0
- package/lib/infrastructure/services/portal-service.d.ts +21 -0
- package/lib/infrastructure/services/portal-service.js +157 -0
- package/lib/infrastructure/services/portal-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.d.ts +9 -0
- package/lib/infrastructure/services/telemetry-service.js +38 -0
- package/lib/infrastructure/services/telemetry-service.js.map +1 -0
- package/lib/infrastructure/services/transformation-service.d.ts +23 -0
- package/lib/infrastructure/services/transformation-service.js +56 -0
- package/lib/infrastructure/services/transformation-service.js.map +1 -0
- package/lib/infrastructure/services/validation-service.d.ts +17 -0
- package/lib/infrastructure/services/validation-service.js +49 -0
- package/lib/infrastructure/services/validation-service.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +2 -0
- package/lib/infrastructure/tmp-extensions.js +6 -0
- package/lib/infrastructure/tmp-extensions.js.map +1 -0
- package/lib/infrastructure/zip-service.d.ts +6 -0
- package/lib/infrastructure/zip-service.js +39 -0
- package/lib/infrastructure/zip-service.js.map +1 -0
- package/lib/prompts/api/transform.d.ts +11 -0
- package/lib/prompts/api/transform.js +30 -0
- package/lib/prompts/api/transform.js.map +1 -0
- package/lib/prompts/api/validate.d.ts +12 -0
- package/lib/prompts/api/validate.js +41 -0
- package/lib/prompts/api/validate.js.map +1 -0
- package/lib/prompts/auth/login.d.ts +10 -0
- package/lib/prompts/auth/login.js +22 -0
- package/lib/prompts/auth/login.js.map +1 -0
- package/lib/prompts/auth/logout.d.ts +3 -0
- package/lib/prompts/auth/logout.js +7 -0
- package/lib/prompts/auth/logout.js.map +1 -0
- package/lib/prompts/auth/status.d.ts +8 -0
- package/lib/prompts/auth/status.js +21 -0
- package/lib/prompts/auth/status.js.map +1 -0
- package/lib/prompts/format.d.ts +33 -0
- package/lib/prompts/format.js +99 -0
- package/lib/prompts/format.js.map +1 -0
- package/lib/prompts/portal/copilot.d.ts +18 -0
- package/lib/prompts/portal/copilot.js +82 -0
- package/lib/prompts/portal/copilot.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +13 -0
- package/lib/prompts/portal/generate.js +41 -0
- package/lib/prompts/portal/generate.js.map +1 -0
- package/lib/prompts/portal/quickstart.d.ts +31 -0
- package/lib/prompts/portal/quickstart.js +146 -0
- package/lib/prompts/portal/quickstart.js.map +1 -0
- package/lib/prompts/portal/recipe/new-recipe.d.ts +29 -0
- package/lib/prompts/portal/recipe/new-recipe.js +165 -0
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +11 -0
- package/lib/prompts/portal/serve.js +33 -0
- package/lib/prompts/portal/serve.js.map +1 -0
- package/lib/prompts/portal/toc/new-toc.d.ts +15 -0
- package/lib/prompts/portal/toc/new-toc.js +37 -0
- package/lib/prompts/portal/toc/new-toc.js.map +1 -0
- package/lib/prompts/sdk/generate.d.ts +11 -0
- package/lib/prompts/sdk/generate.js +36 -0
- package/lib/prompts/sdk/generate.js.map +1 -0
- package/lib/types/api/account.d.ts +10 -0
- package/lib/types/api/account.js +2 -0
- package/lib/types/api/account.js.map +1 -0
- package/lib/types/api/transform.d.ts +17 -17
- package/lib/types/api/transform.js +21 -6
- package/lib/types/api/transform.js.map +1 -0
- package/lib/types/build/build.d.ts +22 -0
- package/lib/types/build/build.js +7 -0
- package/lib/types/build/build.js.map +1 -0
- package/lib/types/build-context.d.ts +17 -0
- package/lib/types/build-context.js +47 -0
- package/lib/types/build-context.js.map +1 -0
- package/lib/types/common/command-metadata.d.ts +4 -0
- package/lib/types/common/command-metadata.js +2 -0
- package/lib/types/common/command-metadata.js.map +1 -0
- package/lib/types/events/domain-event.d.ts +8 -0
- package/lib/types/events/domain-event.js +11 -0
- package/lib/types/events/domain-event.js.map +1 -0
- package/lib/types/events/quickstart-completed.d.ts +7 -0
- package/lib/types/events/quickstart-completed.js +10 -0
- package/lib/types/events/quickstart-completed.js.map +1 -0
- package/lib/types/events/quickstart-initiated.d.ts +7 -0
- package/lib/types/events/quickstart-initiated.js +10 -0
- package/lib/types/events/quickstart-initiated.js.map +1 -0
- package/lib/types/events/recipe-creation-failed.d.ts +5 -0
- package/lib/types/events/recipe-creation-failed.js +8 -0
- package/lib/types/events/recipe-creation-failed.js.map +1 -0
- package/lib/types/events/toc-creation-failed.d.ts +5 -0
- package/lib/types/events/toc-creation-failed.js +8 -0
- package/lib/types/events/toc-creation-failed.js.map +1 -0
- package/lib/types/file/directory.d.ts +17 -0
- package/lib/types/file/directory.js +86 -0
- package/lib/types/file/directory.js.map +1 -0
- package/lib/types/file/directoryPath.d.ts +9 -0
- package/lib/types/file/directoryPath.js +22 -0
- package/lib/types/file/directoryPath.js.map +1 -0
- package/lib/types/file/fileName.d.ts +7 -0
- package/lib/types/file/fileName.js +21 -0
- package/lib/types/file/fileName.js.map +1 -0
- package/lib/types/file/filePath.d.ts +10 -0
- package/lib/types/file/filePath.js +32 -0
- package/lib/types/file/filePath.js.map +1 -0
- package/lib/types/file/resource-input.d.ts +5 -0
- package/lib/types/file/resource-input.js +42 -0
- package/lib/types/file/resource-input.js.map +1 -0
- package/lib/types/file/urlPath.d.ts +6 -0
- package/lib/types/file/urlPath.js +22 -0
- package/lib/types/file/urlPath.js.map +1 -0
- package/lib/types/flags-provider.d.ts +15 -0
- package/lib/types/flags-provider.js +34 -0
- package/lib/types/flags-provider.js.map +1 -0
- package/lib/types/portal-context.d.ts +13 -0
- package/lib/types/portal-context.js +38 -0
- package/lib/types/portal-context.js.map +1 -0
- package/lib/types/recipe/recipe.d.ts +22 -0
- package/lib/types/recipe/recipe.js +6 -0
- package/lib/types/recipe/recipe.js.map +1 -0
- package/lib/types/recipe-context.d.ts +8 -0
- package/lib/types/recipe-context.js +21 -0
- package/lib/types/recipe-context.js.map +1 -0
- package/lib/types/resource-context.d.ts +12 -0
- package/lib/types/resource-context.js +30 -0
- package/lib/types/resource-context.js.map +1 -0
- package/lib/types/sdk/generate.d.ts +9 -21
- package/lib/types/sdk/generate.js +25 -12
- package/lib/types/sdk/generate.js.map +1 -0
- package/lib/types/sdk-context.d.ts +14 -0
- package/lib/types/sdk-context.js +32 -0
- package/lib/types/sdk-context.js.map +1 -0
- package/lib/types/sdl/sdl.d.ts +21 -0
- package/lib/types/sdl/sdl.js +47 -0
- package/lib/types/sdl/sdl.js.map +1 -0
- package/lib/types/spec-context.d.ts +10 -0
- package/lib/types/spec-context.js +17 -0
- package/lib/types/spec-context.js.map +1 -0
- package/lib/types/temp-context.d.ts +11 -0
- package/lib/types/temp-context.js +27 -0
- package/lib/types/temp-context.js.map +1 -0
- package/lib/types/toc/toc.d.ts +31 -0
- package/lib/types/toc/toc.js +9 -0
- package/lib/types/toc/toc.js.map +1 -0
- package/lib/types/toc-context.d.ts +12 -0
- package/lib/types/toc-context.js +26 -0
- package/lib/types/toc-context.js.map +1 -0
- package/lib/types/transform-context.d.ts +13 -0
- package/lib/types/transform-context.js +30 -0
- package/lib/types/transform-context.js.map +1 -0
- package/lib/types/utils.d.ts +1 -6
- package/lib/types/utils.js +2 -2
- package/lib/types/utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +1 -0
- package/lib/utils/string-utils.js +10 -0
- package/lib/utils/string-utils.js.map +1 -0
- package/lib/utils/utils.d.ts +2 -18
- package/lib/utils/utils.js +33 -116
- package/lib/utils/utils.js.map +1 -0
- package/package.json +101 -46
- package/bin/run +0 -5
- package/lib/client-utils/sdk-client.d.ts +0 -23
- package/lib/client-utils/sdk-client.js +0 -119
- package/lib/config/env.d.ts +0 -1
- package/lib/config/env.js +0 -4
- package/lib/controllers/api/transform.d.ts +0 -5
- package/lib/controllers/api/transform.js +0 -49
- package/lib/controllers/api/validate.d.ts +0 -3
- package/lib/controllers/api/validate.js +0 -22
- package/lib/controllers/portal/generate.d.ts +0 -2
- package/lib/controllers/portal/generate.js +0 -49
- package/lib/controllers/sdk/generate.d.ts +0 -4
- package/lib/controllers/sdk/generate.js +0 -64
- package/lib/types/api/validate.d.ts +0 -12
- package/lib/types/api/validate.js +0 -2
- package/lib/types/portal/generate.d.ts +0 -9
- package/lib/types/portal/generate.js +0 -2
- package/oclif.manifest.json +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@apimatic/cli
|
|
2
2
|
=============
|
|
3
|
+
apimatic is in Alpha.
|
|
3
4
|
|
|
4
5
|
The official CLI for APIMatic.
|
|
5
6
|
|
|
@@ -8,18 +9,22 @@ The official CLI for APIMatic.
|
|
|
8
9
|
[](https://npmjs.org/package/@apimatic/cli)
|
|
9
10
|
[](https://github.com/apimatic/apimatic-cli/blob/master/package.json)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
# Getting Started
|
|
13
|
+
|
|
14
|
+
To get started with APIMatic's CLI using a step by step wizard, run the following command:
|
|
15
|
+
|
|
16
|
+
```sh-session
|
|
17
|
+
$ apimatic portal quickstart
|
|
18
|
+
```
|
|
19
|
+
|
|
15
20
|
# Usage
|
|
16
21
|
<!-- usage -->
|
|
17
22
|
```sh-session
|
|
18
23
|
$ npm install -g @apimatic/cli
|
|
19
24
|
$ apimatic COMMAND
|
|
20
25
|
running command...
|
|
21
|
-
$ apimatic (
|
|
22
|
-
@apimatic/cli/
|
|
26
|
+
$ apimatic (--version)
|
|
27
|
+
@apimatic/cli/1.1.0-alpha.22 win32-x64 node-v23.4.0
|
|
23
28
|
$ apimatic --help [COMMAND]
|
|
24
29
|
USAGE
|
|
25
30
|
$ apimatic COMMAND
|
|
@@ -29,230 +34,403 @@ USAGE
|
|
|
29
34
|
|
|
30
35
|
# Commands
|
|
31
36
|
<!-- commands -->
|
|
32
|
-
* [`apimatic api
|
|
33
|
-
* [`apimatic api
|
|
34
|
-
* [`apimatic auth
|
|
35
|
-
* [`apimatic auth
|
|
36
|
-
* [`apimatic auth
|
|
37
|
+
* [`apimatic api transform`](#apimatic-api-transform)
|
|
38
|
+
* [`apimatic api validate`](#apimatic-api-validate)
|
|
39
|
+
* [`apimatic auth login`](#apimatic-auth-login)
|
|
40
|
+
* [`apimatic auth logout`](#apimatic-auth-logout)
|
|
41
|
+
* [`apimatic auth status`](#apimatic-auth-status)
|
|
37
42
|
* [`apimatic autocomplete [SHELL]`](#apimatic-autocomplete-shell)
|
|
38
43
|
* [`apimatic help [COMMAND]`](#apimatic-help-command)
|
|
39
|
-
* [`apimatic portal
|
|
40
|
-
* [`apimatic
|
|
44
|
+
* [`apimatic portal copilot`](#apimatic-portal-copilot)
|
|
45
|
+
* [`apimatic portal generate`](#apimatic-portal-generate)
|
|
46
|
+
* [`apimatic portal quickstart`](#apimatic-portal-quickstart)
|
|
47
|
+
* [`apimatic portal recipe new`](#apimatic-portal-recipe-new)
|
|
48
|
+
* [`apimatic portal serve`](#apimatic-portal-serve)
|
|
49
|
+
* [`apimatic portal toc new`](#apimatic-portal-toc-new)
|
|
50
|
+
* [`apimatic sdk generate`](#apimatic-sdk-generate)
|
|
41
51
|
|
|
42
|
-
## `apimatic api
|
|
52
|
+
## `apimatic api transform`
|
|
43
53
|
|
|
44
|
-
Transform API specifications
|
|
54
|
+
Transform API specifications between different formats.
|
|
45
55
|
|
|
46
56
|
```
|
|
47
57
|
USAGE
|
|
48
|
-
$ apimatic api
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
--
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
$ apimatic api transform --format
|
|
59
|
+
apimatic|wadl2009|wsdl|swagger10|swagger20|swaggeryaml|oas3|openapi3yaml|apiblueprint|raml|raml10|postman10|postman2
|
|
60
|
+
0|graphqlschema [--file <value>] [--url <value>] [-d <value>] [-f] [-k <value>]
|
|
61
|
+
|
|
62
|
+
FLAGS
|
|
63
|
+
-d, --destination=<value> [default: ./] directory to save the transformed file to
|
|
64
|
+
-f, --force overwrite changes without asking for user consent.
|
|
65
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
66
|
+
--file=<value> path to the API specification file to transform
|
|
67
|
+
--format=<option> (required) specification format to transform API specification into
|
|
68
|
+
<options: apimatic|wadl2009|wsdl|swagger10|swagger20|swaggeryaml|oas3|openapi3yaml|apibluep
|
|
69
|
+
rint|raml|raml10|postman10|postman20|graphqlschema>
|
|
70
|
+
--url=<value> URL to the API specification file to transform (publicly accessible)
|
|
71
|
+
|
|
72
|
+
DESCRIPTION
|
|
73
|
+
Transform API specifications between different formats.
|
|
74
|
+
|
|
75
|
+
Transform API specifications from one format to another.
|
|
76
|
+
Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.
|
|
65
77
|
|
|
66
78
|
EXAMPLES
|
|
67
|
-
|
|
68
|
-
Success! Your transformed file is located at D:/Transformed_OpenApi3Json.json
|
|
79
|
+
apimatic api transform --format=OPENAPI3YAML --file=./specs/sample.json --destination=./
|
|
69
80
|
|
|
70
|
-
|
|
71
|
-
Success! Your transformed file is located at D:/swagger_raml.yaml
|
|
81
|
+
apimatic api transform --format=RAML --url="https://petstore.swagger.io/v2/swagger.json" --destination=./
|
|
72
82
|
```
|
|
73
83
|
|
|
74
|
-
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
84
|
+
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/api/transform.ts)_
|
|
75
85
|
|
|
76
|
-
## `apimatic api
|
|
86
|
+
## `apimatic api validate`
|
|
77
87
|
|
|
78
|
-
Validate
|
|
88
|
+
Validate API specification for syntactic and semantic correctness.
|
|
79
89
|
|
|
80
90
|
```
|
|
81
91
|
USAGE
|
|
82
|
-
$ apimatic api
|
|
92
|
+
$ apimatic api validate [--file <value>] [--url <value>] [-k <value>]
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
--auth-key
|
|
86
|
-
|
|
94
|
+
FLAGS
|
|
95
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
96
|
+
--file=<value> Path to the API specification file to validate
|
|
97
|
+
--url=<value> URL to the API specification file to validate (publicly accessible)
|
|
87
98
|
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
DESCRIPTION
|
|
100
|
+
Validate API specification for syntactic and semantic correctness.
|
|
101
|
+
|
|
102
|
+
Validate your API specification to ensure it adheres to syntactic and semantic standards.
|
|
90
103
|
|
|
91
104
|
EXAMPLES
|
|
92
|
-
|
|
93
|
-
Specification file provided is valid
|
|
105
|
+
apimatic api validate --file=./specs/sample.json
|
|
94
106
|
|
|
95
|
-
|
|
96
|
-
Specification file provided is valid
|
|
107
|
+
apimatic api validate --url="https://petstore.swagger.io/v2/swagger.json"
|
|
97
108
|
```
|
|
98
109
|
|
|
99
|
-
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
110
|
+
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/api/validate.ts)_
|
|
100
111
|
|
|
101
|
-
## `apimatic auth
|
|
112
|
+
## `apimatic auth login`
|
|
102
113
|
|
|
103
|
-
Login
|
|
114
|
+
Login to your APIMatic account.
|
|
104
115
|
|
|
105
116
|
```
|
|
106
117
|
USAGE
|
|
107
|
-
$ apimatic auth
|
|
118
|
+
$ apimatic auth login [-k <value>]
|
|
108
119
|
|
|
109
|
-
|
|
110
|
-
--auth-key
|
|
120
|
+
FLAGS
|
|
121
|
+
-k, --auth-key=<value> Sets authentication key for all commands.
|
|
111
122
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Please enter your registered email: apimatic-user@gmail.com
|
|
115
|
-
Please enter your password: *********
|
|
123
|
+
DESCRIPTION
|
|
124
|
+
Login to your APIMatic account.
|
|
116
125
|
|
|
117
|
-
|
|
126
|
+
Login using your APIMatic credentials or an API Key
|
|
118
127
|
|
|
119
|
-
|
|
120
|
-
|
|
128
|
+
EXAMPLES
|
|
129
|
+
apimatic auth login
|
|
130
|
+
|
|
131
|
+
apimatic auth login --auth-key={api-key}
|
|
121
132
|
```
|
|
122
133
|
|
|
123
|
-
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
134
|
+
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/login.ts)_
|
|
124
135
|
|
|
125
|
-
## `apimatic auth
|
|
136
|
+
## `apimatic auth logout`
|
|
126
137
|
|
|
127
|
-
|
|
138
|
+
Clears the local login credentials.
|
|
128
139
|
|
|
129
140
|
```
|
|
130
141
|
USAGE
|
|
131
|
-
$ apimatic auth
|
|
142
|
+
$ apimatic auth logout
|
|
143
|
+
|
|
144
|
+
DESCRIPTION
|
|
145
|
+
Clears the local login credentials.
|
|
146
|
+
|
|
147
|
+
Clears the local login credentials. This will also clear any cached credentials from the CLI.
|
|
132
148
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Logged out
|
|
149
|
+
EXAMPLES
|
|
150
|
+
apimatic auth logout
|
|
136
151
|
```
|
|
137
152
|
|
|
138
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
153
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/logout.ts)_
|
|
139
154
|
|
|
140
|
-
## `apimatic auth
|
|
155
|
+
## `apimatic auth status`
|
|
141
156
|
|
|
142
|
-
View
|
|
157
|
+
View the currently logged in user.
|
|
143
158
|
|
|
144
159
|
```
|
|
145
160
|
USAGE
|
|
146
|
-
$ apimatic auth
|
|
161
|
+
$ apimatic auth status
|
|
162
|
+
|
|
163
|
+
DESCRIPTION
|
|
164
|
+
View the currently logged in user.
|
|
147
165
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Currently logged in as apimatic-client@gmail.com
|
|
166
|
+
EXAMPLES
|
|
167
|
+
apimatic auth status
|
|
151
168
|
```
|
|
152
169
|
|
|
153
|
-
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
170
|
+
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/status.ts)_
|
|
154
171
|
|
|
155
172
|
## `apimatic autocomplete [SHELL]`
|
|
156
173
|
|
|
157
|
-
|
|
174
|
+
Display autocomplete installation instructions.
|
|
158
175
|
|
|
159
176
|
```
|
|
160
177
|
USAGE
|
|
161
|
-
$ apimatic autocomplete [SHELL]
|
|
178
|
+
$ apimatic autocomplete [SHELL] [-r]
|
|
162
179
|
|
|
163
180
|
ARGUMENTS
|
|
164
|
-
SHELL
|
|
181
|
+
SHELL (zsh|bash|powershell) Shell type
|
|
165
182
|
|
|
166
|
-
|
|
183
|
+
FLAGS
|
|
167
184
|
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
168
185
|
|
|
186
|
+
DESCRIPTION
|
|
187
|
+
Display autocomplete installation instructions.
|
|
188
|
+
|
|
169
189
|
EXAMPLES
|
|
170
190
|
$ apimatic autocomplete
|
|
191
|
+
|
|
171
192
|
$ apimatic autocomplete bash
|
|
193
|
+
|
|
172
194
|
$ apimatic autocomplete zsh
|
|
195
|
+
|
|
196
|
+
$ apimatic autocomplete powershell
|
|
197
|
+
|
|
173
198
|
$ apimatic autocomplete --refresh-cache
|
|
174
199
|
```
|
|
175
200
|
|
|
176
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/
|
|
201
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/main/src/commands/autocomplete/index.ts)_
|
|
177
202
|
|
|
178
203
|
## `apimatic help [COMMAND]`
|
|
179
204
|
|
|
180
|
-
|
|
205
|
+
Display help for apimatic.
|
|
181
206
|
|
|
182
207
|
```
|
|
183
208
|
USAGE
|
|
184
|
-
$ apimatic help [COMMAND]
|
|
209
|
+
$ apimatic help [COMMAND...] [-n]
|
|
185
210
|
|
|
186
211
|
ARGUMENTS
|
|
187
|
-
COMMAND
|
|
212
|
+
COMMAND... Command to show help for.
|
|
213
|
+
|
|
214
|
+
FLAGS
|
|
215
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
188
216
|
|
|
189
|
-
|
|
190
|
-
|
|
217
|
+
DESCRIPTION
|
|
218
|
+
Display help for apimatic.
|
|
191
219
|
```
|
|
192
220
|
|
|
193
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/
|
|
221
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/main/src/commands/help.ts)_
|
|
194
222
|
|
|
195
|
-
## `apimatic portal
|
|
223
|
+
## `apimatic portal copilot`
|
|
196
224
|
|
|
197
|
-
|
|
225
|
+
Configure API Copilot for your API Documentation portal
|
|
198
226
|
|
|
199
227
|
```
|
|
200
228
|
USAGE
|
|
201
|
-
$ apimatic portal
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-f, --force
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
--
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
229
|
+
$ apimatic portal copilot [-i <value>] [--disable] [-f] [-k <value>]
|
|
230
|
+
|
|
231
|
+
FLAGS
|
|
232
|
+
-f, --force overwrite changes without asking for user consent.
|
|
233
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes API
|
|
234
|
+
specifications and configuration files.
|
|
235
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
236
|
+
--disable marks the API Copilot as disabled in the configuration
|
|
237
|
+
|
|
238
|
+
DESCRIPTION
|
|
239
|
+
Configure API Copilot for your API Documentation portal
|
|
240
|
+
|
|
241
|
+
Displays available API Copilots associated with your account and allows you to select which one to integrate with your
|
|
242
|
+
portal. Each APIMatic account includes one Copilot by default. The selected Copilot will be added to your
|
|
243
|
+
'APIMATIC-BUILD.json' file
|
|
244
|
+
|
|
245
|
+
EXAMPLES
|
|
246
|
+
apimatic portal copilot --input=./
|
|
247
|
+
|
|
248
|
+
apimatic portal copilot --input=./ --disable
|
|
213
249
|
```
|
|
214
250
|
|
|
215
|
-
_See code: [src/commands/portal/
|
|
251
|
+
_See code: [src/commands/portal/copilot.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/copilot.ts)_
|
|
216
252
|
|
|
217
|
-
## `apimatic
|
|
253
|
+
## `apimatic portal generate`
|
|
218
254
|
|
|
219
|
-
Generate
|
|
255
|
+
Generate an API Documentation portal.
|
|
220
256
|
|
|
221
257
|
```
|
|
222
258
|
USAGE
|
|
223
|
-
$ apimatic
|
|
259
|
+
$ apimatic portal generate [-i <value>] [-d <value>] [-f] [--zip] [-k <value>]
|
|
260
|
+
|
|
261
|
+
FLAGS
|
|
262
|
+
-d, --destination=<value> [default: <input>/portal] path where the portal will be generated.
|
|
263
|
+
-f, --force overwrite changes without asking for user consent.
|
|
264
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
265
|
+
API specifications and configuration files.
|
|
266
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
267
|
+
--zip download the generated portal as a .zip archive
|
|
268
|
+
|
|
269
|
+
DESCRIPTION
|
|
270
|
+
Generate an API Documentation portal.
|
|
271
|
+
|
|
272
|
+
Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and
|
|
273
|
+
optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/gu
|
|
274
|
+
ides/generating-on-prem-api-portal/build-file-reference)
|
|
275
|
+
|
|
276
|
+
EXAMPLES
|
|
277
|
+
apimatic portal generate
|
|
278
|
+
|
|
279
|
+
apimatic portal generate --input="./" --destination="./portal"
|
|
280
|
+
```
|
|
224
281
|
|
|
225
|
-
|
|
226
|
-
-f, --force overwrite if an SDK already exists in the destination
|
|
227
|
-
--auth-key=auth-key override current authentication state with an authentication key
|
|
282
|
+
_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/generate.ts)_
|
|
228
283
|
|
|
229
|
-
|
|
230
|
-
generated SDK to
|
|
284
|
+
## `apimatic portal quickstart`
|
|
231
285
|
|
|
232
|
-
|
|
286
|
+
Get started with your first API Portal in four easy steps.
|
|
233
287
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|
|
|
238
|
-
TS_GENERIC_LIB
|
|
288
|
+
```
|
|
289
|
+
USAGE
|
|
290
|
+
$ apimatic portal quickstart
|
|
239
291
|
|
|
240
|
-
|
|
241
|
-
|
|
292
|
+
DESCRIPTION
|
|
293
|
+
Get started with your first API Portal in four easy steps.
|
|
242
294
|
|
|
243
|
-
|
|
295
|
+
Create your first API Portal using APIMatic's Docs as Code offering.
|
|
244
296
|
|
|
245
297
|
EXAMPLES
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
298
|
+
apimatic portal quickstart
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
_See code: [src/commands/portal/quickstart.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/quickstart.ts)_
|
|
302
|
+
|
|
303
|
+
## `apimatic portal recipe new`
|
|
304
|
+
|
|
305
|
+
Add an API Recipe to your API documentation portal.
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
USAGE
|
|
309
|
+
$ apimatic portal recipe new [--name <value>] [-i <value>] [-f]
|
|
310
|
+
|
|
311
|
+
FLAGS
|
|
312
|
+
-f, --force overwrite changes without asking for user consent.
|
|
313
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes API
|
|
314
|
+
specifications and configuration files.
|
|
315
|
+
--name=<value> name for the recipe
|
|
316
|
+
|
|
317
|
+
DESCRIPTION
|
|
318
|
+
Add an API Recipe to your API documentation portal.
|
|
319
|
+
|
|
320
|
+
This command adds a new API Recipe file to your documentation portal.
|
|
321
|
+
|
|
322
|
+
To learn more about API Recipes, visit:
|
|
323
|
+
https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/api-recipes
|
|
324
|
+
|
|
325
|
+
EXAMPLES
|
|
326
|
+
apimatic portal recipe new
|
|
327
|
+
|
|
328
|
+
apimatic portal recipe new --name="My API Recipe" --input="./"
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
_See code: [src/commands/portal/recipe/new.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/recipe/new.ts)_
|
|
332
|
+
|
|
333
|
+
## `apimatic portal serve`
|
|
334
|
+
|
|
335
|
+
Generate and serve an API Documentation Portal with hot reload.
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
USAGE
|
|
339
|
+
$ apimatic portal serve [-p 3000] [-i <value>] [-d <value>] [-o] [--no-reload] [-k <value>]
|
|
340
|
+
|
|
341
|
+
FLAGS
|
|
342
|
+
-d, --destination=<value> [default: <input>/portal] path where the portal will be generated.
|
|
343
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
344
|
+
API specifications and configuration files.
|
|
345
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
346
|
+
-o, --open open the portal in the default browser.
|
|
347
|
+
-p, --port=3000 [default: 3000] port to serve the portal.
|
|
348
|
+
--no-reload disable hot reload.
|
|
349
|
+
|
|
350
|
+
DESCRIPTION
|
|
351
|
+
Generate and serve an API Documentation Portal with hot reload.
|
|
352
|
+
|
|
353
|
+
Requires an input directory with API specifications, a config file, and optionally markdown guides. Supports disabling
|
|
354
|
+
hot reload and opening the portal in the default browser.
|
|
355
|
+
|
|
356
|
+
EXAMPLES
|
|
357
|
+
apimatic portal serve
|
|
358
|
+
|
|
359
|
+
apimatic portal serve --input=./ --destination=./portal --port=3000 --open --no-reload
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
_See code: [src/commands/portal/serve.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/serve.ts)_
|
|
363
|
+
|
|
364
|
+
## `apimatic portal toc new`
|
|
365
|
+
|
|
366
|
+
Generate a Table of Contents (TOC) file for your API documentation portal
|
|
367
|
+
|
|
368
|
+
```
|
|
369
|
+
USAGE
|
|
370
|
+
$ apimatic portal toc new [-d <value>] [-i <value>] [-f] [--expand-endpoints] [--expand-models]
|
|
371
|
+
|
|
372
|
+
FLAGS
|
|
373
|
+
-d, --destination=<value> [default: <input>/src/content] path where the toc.yml will be generated.
|
|
374
|
+
-f, --force overwrite changes without asking for user consent.
|
|
375
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
376
|
+
API specifications and configuration files.
|
|
377
|
+
--expand-endpoints include individual entries for each endpoint in the generated 'toc.yml'. Requires a valid
|
|
378
|
+
API specification in the working directory.
|
|
379
|
+
--expand-models include individual entries for each model in the generated 'toc.yml'. Requires a valid API
|
|
380
|
+
specification in the working directory.
|
|
381
|
+
|
|
382
|
+
DESCRIPTION
|
|
383
|
+
Generate a Table of Contents (TOC) file for your API documentation portal
|
|
384
|
+
|
|
385
|
+
This command generates a new Table of Contents (TOC) file used in the
|
|
386
|
+
generation of your API documentation portal.
|
|
387
|
+
|
|
388
|
+
The output is a YAML file with the .yml extension.
|
|
389
|
+
|
|
390
|
+
To learn more about the TOC file and APIMatic build directory structure, visit:
|
|
391
|
+
https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/overview-generating-api-portal
|
|
392
|
+
|
|
393
|
+
EXAMPLES
|
|
394
|
+
apimatic portal toc new --destination=./src/content/
|
|
395
|
+
|
|
396
|
+
apimatic portal toc new --input=./
|
|
397
|
+
|
|
398
|
+
apimatic portal toc new --input=./ --destination=./src/content/
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
_See code: [src/commands/portal/toc/new.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/toc/new.ts)_
|
|
402
|
+
|
|
403
|
+
## `apimatic sdk generate`
|
|
404
|
+
|
|
405
|
+
Generate an SDK for your API
|
|
406
|
+
|
|
407
|
+
```
|
|
408
|
+
USAGE
|
|
409
|
+
$ apimatic sdk generate -l csharp|java|php|python|ruby|typescript|go [--spec <value>] [-d <value>] [-f] [--zip]
|
|
410
|
+
[-k <value>]
|
|
411
|
+
|
|
412
|
+
FLAGS
|
|
413
|
+
-d, --destination=<value> directory where the SDK will be generated
|
|
414
|
+
-f, --force overwrite changes without asking for user consent.
|
|
415
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
416
|
+
-l, --language=<option> (required) programming language for SDK generation
|
|
417
|
+
<options: csharp|java|php|python|ruby|typescript|go>
|
|
418
|
+
--spec=<value> [default: ./src/spec] path to the folder containing the API specification file
|
|
419
|
+
--zip download the generated SDK as a .zip archive
|
|
420
|
+
|
|
421
|
+
DESCRIPTION
|
|
422
|
+
Generate an SDK for your API
|
|
423
|
+
|
|
424
|
+
Generate Software Development Kits (SDKs) from API specifications.
|
|
425
|
+
Supports multiple programming languages including Java, C#, Python, JavaScript, and more.
|
|
426
|
+
|
|
427
|
+
EXAMPLES
|
|
428
|
+
apimatic sdk generate --language=java
|
|
429
|
+
|
|
430
|
+
apimatic sdk generate --language=csharp --spec=./src/spec
|
|
431
|
+
|
|
432
|
+
apimatic sdk generate --language=python --destination=./sdk --zip
|
|
255
433
|
```
|
|
256
434
|
|
|
257
|
-
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
435
|
+
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.1.0-alpha.21/src/commands/sdk/generate.ts)_
|
|
258
436
|
<!-- commandsstop -->
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class ActionResult {
|
|
2
|
+
private readonly message;
|
|
3
|
+
private readonly resultType;
|
|
4
|
+
private constructor();
|
|
5
|
+
static success(): ActionResult;
|
|
6
|
+
static failed(): ActionResult;
|
|
7
|
+
static cancelled(): ActionResult;
|
|
8
|
+
static stopped(): ActionResult;
|
|
9
|
+
getMessage(): string;
|
|
10
|
+
getExitCode(): number;
|
|
11
|
+
isFailed(): boolean;
|
|
12
|
+
mapAll<T>(onSuccess: () => T, onFailure: () => T, onCancel: () => T): T;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var ResultType;
|
|
2
|
+
(function (ResultType) {
|
|
3
|
+
ResultType[ResultType["Success"] = 0] = "Success";
|
|
4
|
+
ResultType[ResultType["Cancel"] = 130] = "Cancel";
|
|
5
|
+
ResultType[ResultType["Failure"] = 1] = "Failure";
|
|
6
|
+
})(ResultType || (ResultType = {}));
|
|
7
|
+
export class ActionResult {
|
|
8
|
+
constructor(resultType, message) {
|
|
9
|
+
this.resultType = resultType;
|
|
10
|
+
this.message = message;
|
|
11
|
+
}
|
|
12
|
+
static success() {
|
|
13
|
+
return new ActionResult(ResultType.Success, " Succeeded ");
|
|
14
|
+
}
|
|
15
|
+
static failed() {
|
|
16
|
+
return new ActionResult(ResultType.Failure, " Failed ");
|
|
17
|
+
}
|
|
18
|
+
static cancelled() {
|
|
19
|
+
return new ActionResult(ResultType.Cancel, " Cancelled ");
|
|
20
|
+
}
|
|
21
|
+
static stopped() {
|
|
22
|
+
return new ActionResult(ResultType.Cancel, " Stopped ");
|
|
23
|
+
}
|
|
24
|
+
getMessage() {
|
|
25
|
+
return this.message;
|
|
26
|
+
}
|
|
27
|
+
getExitCode() {
|
|
28
|
+
return this.resultType.valueOf();
|
|
29
|
+
}
|
|
30
|
+
isFailed() {
|
|
31
|
+
return this.resultType === ResultType.Failure;
|
|
32
|
+
}
|
|
33
|
+
mapAll(onSuccess, onFailure, onCancel) {
|
|
34
|
+
switch (this.resultType) {
|
|
35
|
+
case ResultType.Success:
|
|
36
|
+
return onSuccess();
|
|
37
|
+
case ResultType.Failure:
|
|
38
|
+
return onFailure();
|
|
39
|
+
case ResultType.Cancel:
|
|
40
|
+
return onCancel();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=action-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-result.js","sourceRoot":"","sources":["../../src/actions/action-result.ts"],"names":[],"mappings":"AAAA,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,iDAAU,CAAA;IACV,iDAAY,CAAA;IACZ,iDAAU,CAAA;AACZ,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAED,MAAM,OAAO,YAAY;IAIvB,YAAoB,UAAsB,EAAE,OAAe;QACzD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IACnC,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,CAAC,OAAO,CAAC;IAChD,CAAC;IAEM,MAAM,CAAI,SAAkB,EAAE,SAAkB,EAAE,QAAiB;QACxE,QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;YACxB,KAAK,UAAU,CAAC,OAAO;gBACrB,OAAO,SAAS,EAAE,CAAC;YACrB,KAAK,UAAU,CAAC,OAAO;gBACrB,OAAO,SAAS,EAAE,CAAC;YACrB,KAAK,UAAU,CAAC,MAAM;gBACpB,OAAO,QAAQ,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
import { ActionResult } from "../action-result.js";
|
|
3
|
+
import { ExportFormats } from "@apimatic/sdk";
|
|
4
|
+
import { CommandMetadata } from "../../types/common/command-metadata.js";
|
|
5
|
+
import { ResourceInput } from "../../types/file/resource-input.js";
|
|
6
|
+
export declare class TransformAction {
|
|
7
|
+
private readonly prompts;
|
|
8
|
+
private readonly validatePrompts;
|
|
9
|
+
private readonly transformationService;
|
|
10
|
+
private readonly configDir;
|
|
11
|
+
private readonly commandMetadata;
|
|
12
|
+
private readonly authKey;
|
|
13
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
14
|
+
readonly execute: (resourcePath: ResourceInput, format: ExportFormats, destination: DirectoryPath, force: boolean) => Promise<ActionResult>;
|
|
15
|
+
}
|