@apimatic/cli 1.1.0-alpha.2 → 1.1.0-alpha.20
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 +249 -99
- package/bin/run.js +5 -0
- package/lib/actions/action-result.d.ts +8 -0
- package/lib/actions/action-result.js +25 -0
- package/lib/actions/action-result.js.map +1 -0
- package/lib/actions/auth/login.d.ts +12 -0
- package/lib/actions/auth/login.js +63 -0
- package/lib/actions/auth/login.js.map +1 -0
- package/lib/actions/portal/copilot.d.ts +11 -0
- package/lib/actions/portal/copilot.js +49 -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 +61 -0
- package/lib/actions/portal/generate.js.map +1 -0
- package/lib/actions/portal/recipe/new-recipe.d.ts +24 -0
- package/lib/actions/portal/recipe/new-recipe.js +250 -0
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +14 -0
- package/lib/actions/portal/serve.js +24 -0
- package/lib/actions/portal/serve.js.map +1 -0
- package/lib/actions/portal/toc/new-toc.d.ts +20 -0
- package/lib/actions/portal/toc/new-toc.js +133 -0
- package/lib/actions/portal/toc/new-toc.js.map +1 -0
- package/lib/actions/sdk/generate.d.ts +14 -0
- package/lib/actions/sdk/generate.js +72 -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 +16 -0
- package/lib/application/portal/recipe/recipe-generator.js +147 -0
- package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
- package/lib/application/portal/serve/portal-watcher.d.ts +11 -0
- package/lib/application/portal/serve/portal-watcher.js +64 -0
- package/lib/application/portal/serve/portal-watcher.js.map +1 -0
- package/lib/application/portal/serve/serve-handler.d.ts +16 -0
- package/lib/application/portal/serve/serve-handler.js +91 -0
- package/lib/application/portal/serve/serve-handler.js.map +1 -0
- package/lib/application/portal/serve/watcher-handler.d.ts +10 -0
- package/lib/application/portal/serve/watcher-handler.js +51 -0
- package/lib/application/portal/serve/watcher-handler.js.map +1 -0
- package/lib/application/portal/toc/sdl-parser.d.ts +19 -0
- package/lib/application/portal/toc/sdl-parser.js +90 -0
- package/lib/application/portal/toc/sdl-parser.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 +23 -10
- package/lib/client-utils/auth-manager.js.map +1 -0
- package/lib/client-utils/sdk-client.d.ts +0 -1
- package/lib/client-utils/sdk-client.js +25 -55
- package/lib/client-utils/sdk-client.js.map +1 -0
- package/lib/commands/api/transform.d.ts +7 -7
- package/lib/commands/api/transform.js +43 -51
- package/lib/commands/api/transform.js.map +1 -0
- package/lib/commands/api/validate.d.ts +4 -4
- package/lib/commands/api/validate.js +26 -33
- package/lib/commands/api/validate.js.map +1 -0
- package/lib/commands/auth/login.d.ts +3 -2
- package/lib/commands/auth/login.js +22 -53
- package/lib/commands/auth/login.js.map +1 -0
- package/lib/commands/auth/logout.d.ts +1 -1
- package/lib/commands/auth/logout.js +8 -13
- package/lib/commands/auth/logout.js.map +1 -0
- package/lib/commands/auth/status.d.ts +1 -1
- package/lib/commands/auth/status.js +9 -13
- package/lib/commands/auth/status.js.map +1 -0
- package/lib/commands/portal/copilot.d.ts +12 -0
- package/lib/commands/portal/copilot.js +32 -0
- package/lib/commands/portal/copilot.js.map +1 -0
- package/lib/commands/portal/generate.d.ts +10 -8
- package/lib/commands/portal/generate.js +28 -107
- package/lib/commands/portal/generate.js.map +1 -0
- package/lib/commands/portal/quickstart.d.ts +10 -0
- package/lib/commands/portal/quickstart.js +105 -0
- package/lib/commands/portal/quickstart.js.map +1 -0
- package/lib/commands/portal/recipe/new.d.ts +10 -0
- package/lib/commands/portal/recipe/new.js +38 -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 +80 -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 +52 -0
- package/lib/commands/portal/toc/new.js.map +1 -0
- package/lib/commands/sdk/generate.d.ts +9 -8
- package/lib/commands/sdk/generate.js +39 -128
- 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/config/env.d.ts +26 -1
- package/lib/config/env.js +27 -4
- package/lib/config/env.js.map +1 -0
- package/lib/controllers/api/transform.d.ts +1 -1
- package/lib/controllers/api/transform.js +23 -22
- package/lib/controllers/api/transform.js.map +1 -0
- package/lib/controllers/api/validate.d.ts +3 -3
- package/lib/controllers/api/validate.js +19 -12
- package/lib/controllers/api/validate.js.map +1 -0
- package/lib/controllers/portal/quickstart.d.ts +15 -0
- package/lib/controllers/portal/quickstart.js +217 -0
- package/lib/controllers/portal/quickstart.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 +33 -0
- package/lib/infrastructure/api-utils.js.map +1 -0
- package/lib/infrastructure/env-info.d.ts +8 -0
- package/lib/infrastructure/env-info.js +37 -0
- package/lib/infrastructure/env-info.js.map +1 -0
- package/lib/infrastructure/file-service.d.ts +18 -0
- package/lib/infrastructure/file-service.js +76 -0
- package/lib/infrastructure/file-service.js.map +1 -0
- package/lib/infrastructure/services/api-service.d.ts +10 -0
- package/lib/infrastructure/services/api-service.js +54 -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 +33 -0
- package/lib/infrastructure/services/auth-service.js.map +1 -0
- package/lib/infrastructure/services/portal-service.d.ts +20 -0
- package/lib/infrastructure/services/portal-service.js +163 -0
- package/lib/infrastructure/services/portal-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.d.ts +8 -0
- package/lib/infrastructure/services/telemetry-service.js +40 -0
- package/lib/infrastructure/services/telemetry-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/auth/login.d.ts +5 -0
- package/lib/prompts/auth/login.js +13 -0
- package/lib/prompts/auth/login.js.map +1 -0
- package/lib/prompts/portal/common/base-prompts.d.ts +7 -0
- package/lib/prompts/portal/common/base-prompts.js +19 -0
- package/lib/prompts/portal/common/base-prompts.js.map +1 -0
- package/lib/prompts/portal/copilot.d.ts +8 -0
- package/lib/prompts/portal/copilot.js +54 -0
- package/lib/prompts/portal/copilot.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +11 -0
- package/lib/prompts/portal/generate.js +42 -0
- package/lib/prompts/portal/generate.js.map +1 -0
- package/lib/prompts/portal/quickstart.d.ts +30 -0
- package/lib/prompts/portal/quickstart.js +240 -0
- package/lib/prompts/portal/quickstart.js.map +1 -0
- package/lib/prompts/portal/recipe/new-recipe.d.ts +24 -0
- package/lib/prompts/portal/recipe/new-recipe.js +203 -0
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +4 -0
- package/lib/prompts/portal/serve.js +14 -0
- package/lib/prompts/portal/serve.js.map +1 -0
- package/lib/prompts/portal/toc/new-toc.d.ts +11 -0
- package/lib/prompts/portal/toc/new-toc.js +39 -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 +42 -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 +19 -4
- package/lib/types/api/transform.js +19 -4
- package/lib/types/api/transform.js.map +1 -0
- package/lib/types/api/validate.d.ts +3 -3
- package/lib/types/api/validate.js +2 -2
- package/lib/types/api/validate.js.map +1 -0
- package/lib/types/build/build.d.ts +14 -0
- package/lib/types/build/build.js +4 -0
- package/lib/types/build/build.js.map +1 -0
- package/lib/types/build-context.d.ts +13 -0
- package/lib/types/build-context.js +30 -0
- package/lib/types/build-context.js.map +1 -0
- package/lib/types/common/result.d.ts +17 -0
- package/lib/types/common/result.js +32 -0
- package/lib/types/common/result.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/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/directoryPath.d.ts +7 -0
- package/lib/types/file/directoryPath.js +16 -0
- package/lib/types/file/directoryPath.js.map +1 -0
- package/lib/types/file/fileName.d.ts +5 -0
- package/lib/types/file/fileName.js +9 -0
- package/lib/types/file/fileName.js.map +1 -0
- package/lib/types/file/filePath.d.ts +8 -0
- package/lib/types/file/filePath.js +11 -0
- package/lib/types/file/filePath.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/generate.d.ts +13 -9
- package/lib/types/portal/generate.js +3 -2
- package/lib/types/portal/generate.js.map +1 -0
- package/lib/types/portal/quickstart.d.ts +17 -0
- package/lib/types/portal/quickstart.js +2 -0
- package/lib/types/portal/quickstart.js.map +1 -0
- package/lib/types/portal/serve.d.ts +12 -0
- package/lib/types/portal/serve.js +2 -0
- package/lib/types/portal/serve.js.map +1 -0
- package/lib/types/portal-context.d.ts +11 -0
- package/lib/types/portal-context.js +28 -0
- package/lib/types/portal-context.js.map +1 -0
- package/lib/types/recipe/recipe.d.ts +37 -0
- package/lib/types/recipe/recipe.js +6 -0
- package/lib/types/recipe/recipe.js.map +1 -0
- package/lib/types/sdk/generate.d.ts +11 -10
- package/lib/types/sdk/generate.js +11 -12
- package/lib/types/sdk/generate.js.map +1 -0
- package/lib/types/sdk-context.d.ts +13 -0
- package/lib/types/sdk-context.js +28 -0
- package/lib/types/sdk-context.js.map +1 -0
- package/lib/types/sdl/sdl.d.ts +12 -0
- package/lib/types/sdl/sdl.js +2 -0
- package/lib/types/sdl/sdl.js.map +1 -0
- package/lib/types/spec-context.d.ts +7 -0
- package/lib/types/spec-context.js +12 -0
- package/lib/types/spec-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/utils.d.ts +3 -3
- package/lib/types/utils.js +2 -2
- package/lib/types/utils.js.map +1 -0
- package/lib/utils/utils.d.ts +16 -7
- package/lib/utils/utils.js +142 -86
- package/lib/utils/utils.js.map +1 -0
- package/lib/validators/common/directoryValidator.d.ts +5 -0
- package/lib/validators/common/directoryValidator.js +22 -0
- package/lib/validators/common/directoryValidator.js.map +1 -0
- package/lib/validators/portal/serve-validator.d.ts +6 -0
- package/lib/validators/portal/serve-validator.js +15 -0
- package/lib/validators/portal/serve-validator.js.map +1 -0
- package/package.json +96 -40
- package/bin/run +0 -5
- 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/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
|
-
$ npm install -g @apimatic/cli
|
|
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.19 win32-x64 node-v20.18.3
|
|
23
28
|
$ apimatic --help [COMMAND]
|
|
24
29
|
USAGE
|
|
25
30
|
$ apimatic COMMAND
|
|
@@ -36,7 +41,12 @@ USAGE
|
|
|
36
41
|
* [`apimatic auth:status`](#apimatic-authstatus)
|
|
37
42
|
* [`apimatic autocomplete [SHELL]`](#apimatic-autocomplete-shell)
|
|
38
43
|
* [`apimatic help [COMMAND]`](#apimatic-help-command)
|
|
44
|
+
* [`apimatic portal:copilot`](#apimatic-portalcopilot)
|
|
39
45
|
* [`apimatic portal:generate`](#apimatic-portalgenerate)
|
|
46
|
+
* [`apimatic portal:quickstart`](#apimatic-portalquickstart)
|
|
47
|
+
* [`apimatic portal:recipe:new`](#apimatic-portalrecipenew)
|
|
48
|
+
* [`apimatic portal:serve`](#apimatic-portalserve)
|
|
49
|
+
* [`apimatic portal:toc:new`](#apimatic-portaltocnew)
|
|
40
50
|
* [`apimatic sdk:generate`](#apimatic-sdkgenerate)
|
|
41
51
|
|
|
42
52
|
## `apimatic api:transform`
|
|
@@ -45,33 +55,31 @@ Transform API specifications from one format to another. Supports [10+ different
|
|
|
45
55
|
|
|
46
56
|
```
|
|
47
57
|
USAGE
|
|
48
|
-
$ apimatic api:transform
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
--file=file path to the API specification file to transform
|
|
58
|
-
|
|
59
|
-
--format=format (required) specification format to transform API specification into
|
|
58
|
+
$ apimatic api:transform --format <value> [--file <value>] [--url <value>] [-d <value>] [-f] [-k <value>]
|
|
59
|
+
|
|
60
|
+
FLAGS
|
|
61
|
+
-d, --destination=<value> [default: ./] directory to download transformed file to
|
|
62
|
+
-f, --force overwrite changes without asking for user consent.
|
|
63
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
64
|
+
--file=<value> path to the API specification file to transform
|
|
65
|
+
--format=<value> (required) specification format to transform API specification into
|
|
60
66
|
APIMATIC|WADL2009|WSDL|SWAGGER10|SWAGGER20|SWAGGERYAML|OAS3|OPENAPI3YAML|APIBLUEPRINT|RAML|
|
|
61
67
|
RAML10|POSTMAN10|POSTMAN20|GRAPHQLSCHEMA
|
|
62
|
-
|
|
63
|
-
--url=url URL to the API specification file to transform. Can be used in place of the --file option
|
|
68
|
+
--url=<value> URL to the API specification file to transform. Can be used in place of the --file option
|
|
64
69
|
if the API specification is publicly available.
|
|
65
70
|
|
|
71
|
+
DESCRIPTION
|
|
72
|
+
Transform API specifications from one format to another. Supports [10+ different
|
|
73
|
+
formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman
|
|
74
|
+
Collections.
|
|
75
|
+
|
|
66
76
|
EXAMPLES
|
|
67
77
|
$ apimatic api:transform --format="OpenApi3Json" --file="./specs/sample.json" --destination="D:/"
|
|
68
|
-
Success! Your transformed file is located at D:/Transformed_OpenApi3Json.json
|
|
69
78
|
|
|
70
79
|
$ apimatic api:transform --format=RAML --url="https://petstore.swagger.io/v2/swagger.json" --destination="D:/"
|
|
71
|
-
Success! Your transformed file is located at D:/swagger_raml.yaml
|
|
72
80
|
```
|
|
73
81
|
|
|
74
|
-
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
82
|
+
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/api/transform.ts)_
|
|
75
83
|
|
|
76
84
|
## `apimatic api:validate`
|
|
77
85
|
|
|
@@ -79,24 +87,24 @@ Validate the syntactic and semantic correctness of an API specification
|
|
|
79
87
|
|
|
80
88
|
```
|
|
81
89
|
USAGE
|
|
82
|
-
$ apimatic api:validate
|
|
90
|
+
$ apimatic api:validate [--file <value>] [--url <value>] [-k <value>]
|
|
83
91
|
|
|
84
|
-
|
|
85
|
-
--auth-key
|
|
86
|
-
|
|
92
|
+
FLAGS
|
|
93
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
94
|
+
--file=<value> Path to the API specification file to validate
|
|
95
|
+
--url=<value> URL to the specification file to validate. Can be used in place of the --file option if the
|
|
96
|
+
API specification is publicly available.
|
|
87
97
|
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
DESCRIPTION
|
|
99
|
+
Validate the syntactic and semantic correctness of an API specification
|
|
90
100
|
|
|
91
101
|
EXAMPLES
|
|
92
102
|
$ apimatic api:validate --file="./specs/sample.json"
|
|
93
|
-
Specification file provided is valid
|
|
94
103
|
|
|
95
104
|
$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.json
|
|
96
|
-
Specification file provided is valid
|
|
97
105
|
```
|
|
98
106
|
|
|
99
|
-
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
107
|
+
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/api/validate.ts)_
|
|
100
108
|
|
|
101
109
|
## `apimatic auth:login`
|
|
102
110
|
|
|
@@ -104,68 +112,73 @@ Login using your APIMatic credentials or an API Key
|
|
|
104
112
|
|
|
105
113
|
```
|
|
106
114
|
USAGE
|
|
107
|
-
$ apimatic auth:login
|
|
115
|
+
$ apimatic auth:login [-k <value>]
|
|
116
|
+
|
|
117
|
+
FLAGS
|
|
118
|
+
-k, --auth-key=<value> Sets authentication key for all commands.
|
|
108
119
|
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
DESCRIPTION
|
|
121
|
+
Login using your APIMatic credentials or an API Key
|
|
111
122
|
|
|
112
123
|
EXAMPLES
|
|
113
124
|
$ apimatic auth:login
|
|
114
|
-
Please enter your registered email: apimatic-user@gmail.com
|
|
115
|
-
Please enter your password: *********
|
|
116
|
-
|
|
117
|
-
You have successfully logged into APIMatic
|
|
118
125
|
|
|
119
|
-
$ apimatic auth:login --auth-key=
|
|
120
|
-
Authentication key successfully set
|
|
126
|
+
$ apimatic auth:login --auth-key={api-key}
|
|
121
127
|
```
|
|
122
128
|
|
|
123
|
-
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
129
|
+
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/login.ts)_
|
|
124
130
|
|
|
125
131
|
## `apimatic auth:logout`
|
|
126
132
|
|
|
127
|
-
|
|
133
|
+
Clears the local login credentials.
|
|
128
134
|
|
|
129
135
|
```
|
|
130
136
|
USAGE
|
|
131
137
|
$ apimatic auth:logout
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
DESCRIPTION
|
|
140
|
+
Clears the local login credentials.
|
|
141
|
+
|
|
142
|
+
EXAMPLES
|
|
134
143
|
$ apimatic auth:logout
|
|
135
|
-
Logged out
|
|
136
144
|
```
|
|
137
145
|
|
|
138
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
146
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/logout.ts)_
|
|
139
147
|
|
|
140
148
|
## `apimatic auth:status`
|
|
141
149
|
|
|
142
|
-
View
|
|
150
|
+
View the currently logged in user.
|
|
143
151
|
|
|
144
152
|
```
|
|
145
153
|
USAGE
|
|
146
154
|
$ apimatic auth:status
|
|
147
155
|
|
|
148
|
-
|
|
156
|
+
DESCRIPTION
|
|
157
|
+
View the currently logged in user.
|
|
158
|
+
|
|
159
|
+
EXAMPLES
|
|
149
160
|
$ apimatic auth:status
|
|
150
|
-
Currently logged in as apimatic-client@gmail.com
|
|
151
161
|
```
|
|
152
162
|
|
|
153
|
-
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
163
|
+
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/auth/status.ts)_
|
|
154
164
|
|
|
155
165
|
## `apimatic autocomplete [SHELL]`
|
|
156
166
|
|
|
157
|
-
|
|
167
|
+
Display autocomplete installation instructions.
|
|
158
168
|
|
|
159
169
|
```
|
|
160
170
|
USAGE
|
|
161
|
-
$ apimatic autocomplete [SHELL]
|
|
171
|
+
$ apimatic autocomplete [SHELL] [-r]
|
|
162
172
|
|
|
163
173
|
ARGUMENTS
|
|
164
174
|
SHELL shell type
|
|
165
175
|
|
|
166
|
-
|
|
176
|
+
FLAGS
|
|
167
177
|
-r, --refresh-cache Refresh cache (ignores displaying instructions)
|
|
168
178
|
|
|
179
|
+
DESCRIPTION
|
|
180
|
+
Display autocomplete installation instructions.
|
|
181
|
+
|
|
169
182
|
EXAMPLES
|
|
170
183
|
$ apimatic autocomplete
|
|
171
184
|
$ apimatic autocomplete bash
|
|
@@ -173,86 +186,223 @@ EXAMPLES
|
|
|
173
186
|
$ apimatic autocomplete --refresh-cache
|
|
174
187
|
```
|
|
175
188
|
|
|
176
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/
|
|
189
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/main/src/commands/autocomplete/index.ts)_
|
|
177
190
|
|
|
178
191
|
## `apimatic help [COMMAND]`
|
|
179
192
|
|
|
180
|
-
|
|
193
|
+
Display help for apimatic.
|
|
181
194
|
|
|
182
195
|
```
|
|
183
196
|
USAGE
|
|
184
|
-
$ apimatic help [COMMAND]
|
|
197
|
+
$ apimatic help [COMMAND...] [-n]
|
|
185
198
|
|
|
186
199
|
ARGUMENTS
|
|
187
|
-
COMMAND
|
|
200
|
+
COMMAND... Command to show help for.
|
|
201
|
+
|
|
202
|
+
FLAGS
|
|
203
|
+
-n, --nested-commands Include all nested commands in the output.
|
|
188
204
|
|
|
189
|
-
|
|
190
|
-
|
|
205
|
+
DESCRIPTION
|
|
206
|
+
Display help for apimatic.
|
|
191
207
|
```
|
|
192
208
|
|
|
193
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/
|
|
209
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/main/src/commands/help.ts)_
|
|
210
|
+
|
|
211
|
+
## `apimatic portal:copilot`
|
|
212
|
+
|
|
213
|
+
Configure API Copilot for your API Documentation portal
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
USAGE
|
|
217
|
+
$ apimatic portal:copilot [-i <value>] [--disable] [-k <value>]
|
|
218
|
+
|
|
219
|
+
FLAGS
|
|
220
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes API
|
|
221
|
+
specifications and configuration files.
|
|
222
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
223
|
+
--disable marks the API Copilot as disabled in the configuration
|
|
224
|
+
|
|
225
|
+
DESCRIPTION
|
|
226
|
+
Configure API Copilot for your API Documentation portal
|
|
227
|
+
|
|
228
|
+
Displays available API Copilots associated with your account and allows you to select which one to integrate with your
|
|
229
|
+
portal. Each APIMatic account includes one Copilot by default. The selected Copilot will be added to your
|
|
230
|
+
APIMATIC-BUILD.json file
|
|
231
|
+
|
|
232
|
+
EXAMPLES
|
|
233
|
+
$ apimatic portal:copilot --input="./"
|
|
234
|
+
|
|
235
|
+
$ apimatic portal:copilot --input="./" --disable
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
_See code: [src/commands/portal/copilot.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/copilot.ts)_
|
|
194
239
|
|
|
195
240
|
## `apimatic portal:generate`
|
|
196
241
|
|
|
197
|
-
Generate
|
|
242
|
+
Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/build-file-reference)
|
|
198
243
|
|
|
199
244
|
```
|
|
200
245
|
USAGE
|
|
246
|
+
$ apimatic portal:generate [-i <value>] [-d <value>] [-f] [--zip] [-k <value>]
|
|
247
|
+
|
|
248
|
+
FLAGS
|
|
249
|
+
-d, --destination=<value> [default: <input>/portal] path where the portal will be generated.
|
|
250
|
+
-f, --force overwrite changes without asking for user consent.
|
|
251
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
252
|
+
API specifications and configuration files.
|
|
253
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
254
|
+
--zip download the generated portal as a .zip archive
|
|
255
|
+
|
|
256
|
+
DESCRIPTION
|
|
257
|
+
Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and
|
|
258
|
+
optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/gu
|
|
259
|
+
ides/generating-on-prem-api-portal/build-file-reference)
|
|
260
|
+
|
|
261
|
+
EXAMPLES
|
|
201
262
|
$ apimatic portal:generate
|
|
202
263
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
264
|
+
$ apimatic portal:generate --input="./" --destination="./portal"
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/generate.ts)_
|
|
268
|
+
|
|
269
|
+
## `apimatic portal:quickstart`
|
|
270
|
+
|
|
271
|
+
Create your first API Portal using APIMatic's Docs as Code offering.
|
|
209
272
|
|
|
210
|
-
EXAMPLE
|
|
211
|
-
$ apimatic portal:generate --folder="./portal/" --destination="D:/"
|
|
212
|
-
Your portal has been generated at D:/
|
|
213
273
|
```
|
|
274
|
+
USAGE
|
|
275
|
+
$ apimatic portal:quickstart
|
|
214
276
|
|
|
215
|
-
|
|
277
|
+
DESCRIPTION
|
|
278
|
+
Create your first API Portal using APIMatic's Docs as Code offering.
|
|
216
279
|
|
|
217
|
-
|
|
280
|
+
EXAMPLES
|
|
281
|
+
$ apimatic portal:quickstart
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
_See code: [src/commands/portal/quickstart.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/quickstart.ts)_
|
|
218
285
|
|
|
219
|
-
|
|
286
|
+
## `apimatic portal:recipe:new`
|
|
287
|
+
|
|
288
|
+
Add an API Recipe to your API Documentation portal.
|
|
220
289
|
|
|
221
290
|
```
|
|
222
291
|
USAGE
|
|
223
|
-
$ apimatic
|
|
292
|
+
$ apimatic portal:recipe:new [--name <value>] [-i <value>]
|
|
293
|
+
|
|
294
|
+
FLAGS
|
|
295
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes API
|
|
296
|
+
specifications and configuration files.
|
|
297
|
+
--name=<value> name for the recipe
|
|
298
|
+
|
|
299
|
+
DESCRIPTION
|
|
300
|
+
Add an API Recipe to your API Documentation portal.
|
|
301
|
+
|
|
302
|
+
To learn more about API Recipes, visit:
|
|
303
|
+
https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/api-recipes
|
|
304
|
+
|
|
305
|
+
EXAMPLES
|
|
306
|
+
$ apimatic portal:recipe:new
|
|
307
|
+
|
|
308
|
+
$ apimatic portal:recipe:new --name="My API Recipe" --input="./"
|
|
309
|
+
```
|
|
224
310
|
|
|
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
|
|
311
|
+
_See code: [src/commands/portal/recipe/new.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/recipe/new.ts)_
|
|
228
312
|
|
|
229
|
-
|
|
230
|
-
generated SDK to
|
|
313
|
+
## `apimatic portal:serve`
|
|
231
314
|
|
|
232
|
-
|
|
315
|
+
Generate and deploy a Docs as Code portal with hot reload.
|
|
233
316
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|
|
|
238
|
-
TS_GENERIC_LIB
|
|
317
|
+
```
|
|
318
|
+
USAGE
|
|
319
|
+
$ apimatic portal:serve [-p <value>] [-i <value>] [-d <value>] [-o] [--no-reload] [-k <value>]
|
|
239
320
|
|
|
240
|
-
|
|
241
|
-
|
|
321
|
+
FLAGS
|
|
322
|
+
-d, --destination=<value> [default: <input>/portal] path where the portal will be generated.
|
|
323
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
324
|
+
API specifications and configuration files.
|
|
325
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
326
|
+
-o, --open Open the portal in the default browser.
|
|
327
|
+
-p, --port=<value> [default: 3000] port to serve the portal.
|
|
328
|
+
--no-reload Disable hot reload.
|
|
242
329
|
|
|
243
|
-
|
|
330
|
+
DESCRIPTION
|
|
331
|
+
Generate and deploy a Docs as Code portal with hot reload.
|
|
244
332
|
|
|
245
333
|
EXAMPLES
|
|
246
|
-
$ apimatic
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
334
|
+
$ apimatic portal:serve
|
|
335
|
+
|
|
336
|
+
$ apimatic portal:serve --input="./" --destination="./portal" --port=3000 --open --no-reload
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
_See code: [src/commands/portal/serve.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/serve.ts)_
|
|
340
|
+
|
|
341
|
+
## `apimatic portal:toc:new`
|
|
342
|
+
|
|
343
|
+
Generate a Table of Contents (TOC) file for your API documentation portal
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
USAGE
|
|
347
|
+
$ apimatic portal:toc:new [-d <value>] [-i <value>] [-f] [--expand-endpoints] [--expand-models]
|
|
348
|
+
|
|
349
|
+
FLAGS
|
|
350
|
+
-d, --destination=<value> [default: <input>/src/content] path where the 'toc.yml' will be generated.
|
|
351
|
+
-f, --force overwrite changes without asking for user consent.
|
|
352
|
+
-i, --input=<value> [default: ./] path to the parent directory containing the 'src' directory, which includes
|
|
353
|
+
API specifications and configuration files.
|
|
354
|
+
--expand-endpoints include individual entries for each endpoint in the generated 'toc.yml'. Requires a valid
|
|
355
|
+
API specification in the working directory.
|
|
356
|
+
--expand-models include individual entries for each model in the generated 'toc.yml'. Requires a valid API
|
|
357
|
+
specification in the working directory.
|
|
358
|
+
|
|
359
|
+
DESCRIPTION
|
|
360
|
+
Generate a Table of Contents (TOC) file for your API documentation portal
|
|
361
|
+
|
|
362
|
+
This command generates a new Table of Contents (TOC) file used in the
|
|
363
|
+
generation of your API documentation portal.
|
|
364
|
+
|
|
365
|
+
The output is a YAML file with the .yml extension.
|
|
366
|
+
|
|
367
|
+
To learn more about the TOC file and APIMatic build directory structure, visit:
|
|
368
|
+
https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/overview-generating-api-portal
|
|
369
|
+
|
|
370
|
+
EXAMPLES
|
|
371
|
+
$ apimatic portal:toc:new --destination="./src/content/"
|
|
372
|
+
|
|
373
|
+
$ apimatic portal:toc:new --input="./"
|
|
374
|
+
|
|
375
|
+
$ apimatic portal:toc:new --input="./" --destination="./src/content/"
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
_See code: [src/commands/portal/toc/new.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/portal/toc/new.ts)_
|
|
379
|
+
|
|
380
|
+
## `apimatic sdk:generate`
|
|
381
|
+
|
|
382
|
+
Generate an SDK for your API
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
USAGE
|
|
386
|
+
$ apimatic sdk:generate --platform csharp|java|php|python|ruby|typescript|go [--spec <value>] [-d <value>] [-f]
|
|
387
|
+
[--zip] [-k <value>]
|
|
388
|
+
|
|
389
|
+
FLAGS
|
|
390
|
+
-d, --destination=<value> [default: ./sdk/<platform>] path where the sdk will be generated.
|
|
391
|
+
-f, --force overwrite changes without asking for user consent.
|
|
392
|
+
-k, --auth-key=<value> override current authentication state with an authentication key.
|
|
393
|
+
--platform=<option> (required) language platform for sdk
|
|
394
|
+
<options: csharp|java|php|python|ruby|typescript|go>
|
|
395
|
+
--spec=<value> [default: ./src/spec] path to the folder containing the API specification file.
|
|
396
|
+
--zip download the generated SDK as a .zip archive
|
|
397
|
+
|
|
398
|
+
DESCRIPTION
|
|
399
|
+
Generate an SDK for your API
|
|
400
|
+
|
|
401
|
+
EXAMPLES
|
|
402
|
+
$ apimatic sdk:generate --platform="java"
|
|
403
|
+
|
|
404
|
+
$ apimatic sdk:generate --platform="csharp" --spec="./src/spec"
|
|
255
405
|
```
|
|
256
406
|
|
|
257
|
-
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/
|
|
407
|
+
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/alpha/src/commands/sdk/generate.ts)_
|
|
258
408
|
<!-- commandsstop -->
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ActionResult {
|
|
2
|
+
private readonly message;
|
|
3
|
+
private constructor();
|
|
4
|
+
static error(message: string): ActionResult;
|
|
5
|
+
static success(): ActionResult;
|
|
6
|
+
map(onError: (message: string) => void): void;
|
|
7
|
+
mapAll<T>(onSuccess: () => T, onError: (message: string) => T): T;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class ActionResult {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
this.message = message;
|
|
4
|
+
}
|
|
5
|
+
static error(message) {
|
|
6
|
+
return new ActionResult(message);
|
|
7
|
+
}
|
|
8
|
+
static success() {
|
|
9
|
+
return new ActionResult();
|
|
10
|
+
}
|
|
11
|
+
map(onError) {
|
|
12
|
+
if (this.message) {
|
|
13
|
+
onError(this.message);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
mapAll(onSuccess, onError) {
|
|
17
|
+
if (this.message) {
|
|
18
|
+
return onError(this.message);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return onSuccess();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# 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,MAAM,OAAO,YAAY;IAGvB,YAAoB,OAAgB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe;QAC1B,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED,GAAG,CAAC,OAAkC;QACpC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,MAAM,CAAI,SAAiB,EAAE,OAA+B;QAC1D,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;aAAK,CAAC;YACL,OAAO,SAAS,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
import { Result } from "neverthrow";
|
|
3
|
+
export declare class LoginAction {
|
|
4
|
+
private readonly configDir;
|
|
5
|
+
private readonly authService;
|
|
6
|
+
private readonly apiService;
|
|
7
|
+
private readonly prompts;
|
|
8
|
+
constructor(configDir: DirectoryPath);
|
|
9
|
+
execute(apiKey?: string | undefined): Promise<Result<string, string>>;
|
|
10
|
+
private poolDeviceToken;
|
|
11
|
+
private verifyKeyAndSave;
|
|
12
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AuthService } from "../../infrastructure/services/auth-service.js";
|
|
2
|
+
import { ApiService } from "../../infrastructure/services/api-service.js";
|
|
3
|
+
import { err, ok } from "neverthrow";
|
|
4
|
+
import { v4 as uuid } from "uuid";
|
|
5
|
+
import open from "open";
|
|
6
|
+
import { setAuthInfo } from "../../client-utils/auth-manager.js";
|
|
7
|
+
import { LoginPrompts } from "../../prompts/auth/login.js";
|
|
8
|
+
import { getErrorMessage } from "../../infrastructure/api-utils.js";
|
|
9
|
+
export class LoginAction {
|
|
10
|
+
constructor(configDir) {
|
|
11
|
+
this.configDir = configDir;
|
|
12
|
+
this.authService = new AuthService();
|
|
13
|
+
this.apiService = new ApiService();
|
|
14
|
+
this.prompts = new LoginPrompts();
|
|
15
|
+
}
|
|
16
|
+
async execute(apiKey = undefined) {
|
|
17
|
+
if (!apiKey) {
|
|
18
|
+
const result = await this.poolDeviceToken();
|
|
19
|
+
return (await result.asyncMap(async (token) => {
|
|
20
|
+
return await this.verifyKeyAndSave(token);
|
|
21
|
+
})).andThen((r) => r);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return await this.verifyKeyAndSave(apiKey);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async poolDeviceToken() {
|
|
28
|
+
const state = uuid();
|
|
29
|
+
this.prompts.openBrowser();
|
|
30
|
+
await open(this.authService.getDeviceLoginUrl(state));
|
|
31
|
+
const timeoutDuration = 5 * 60 * 1000; // 5 minutes in milliseconds
|
|
32
|
+
const startTime = Date.now();
|
|
33
|
+
const delayMs = 3 * 1000;
|
|
34
|
+
while (true) {
|
|
35
|
+
if (Date.now() - startTime > timeoutDuration) {
|
|
36
|
+
return err("Authentication timed out. Please try again.");
|
|
37
|
+
}
|
|
38
|
+
const result = await this.authService.getDeviceLoginToken(state);
|
|
39
|
+
const token = result.match((res) => res.apiKey, () => {
|
|
40
|
+
/* ignore errors */
|
|
41
|
+
});
|
|
42
|
+
if (token)
|
|
43
|
+
return ok(token);
|
|
44
|
+
// eslint-disable-next-line no-undef
|
|
45
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async verifyKeyAndSave(apiKey) {
|
|
49
|
+
const result = await this.apiService.getAccountInfo(this.configDir, apiKey);
|
|
50
|
+
return result.asyncMap(async (info) => {
|
|
51
|
+
await setAuthInfo(info.Email, apiKey, false, this.configDir);
|
|
52
|
+
return info.Email;
|
|
53
|
+
}).mapErr(e => {
|
|
54
|
+
switch (e) {
|
|
55
|
+
case "UNAUTHORIZED" /* ServiceError.UnAuthorized */:
|
|
56
|
+
return "The provided auth key is invalid";
|
|
57
|
+
default:
|
|
58
|
+
return getErrorMessage(e);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/actions/auth/login.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
import { ActionResult } from "../action-result.js";
|
|
3
|
+
export declare class CopilotAction {
|
|
4
|
+
private readonly apiService;
|
|
5
|
+
private readonly prompts;
|
|
6
|
+
private readonly configDir;
|
|
7
|
+
private readonly authKey;
|
|
8
|
+
constructor(configDir: DirectoryPath, authKey?: string | null);
|
|
9
|
+
execute(buildDirectory: DirectoryPath, enable: boolean): Promise<ActionResult>;
|
|
10
|
+
private selectCopilotKey;
|
|
11
|
+
}
|