@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.
Files changed (251) hide show
  1. package/README.md +249 -99
  2. package/bin/run.js +5 -0
  3. package/lib/actions/action-result.d.ts +8 -0
  4. package/lib/actions/action-result.js +25 -0
  5. package/lib/actions/action-result.js.map +1 -0
  6. package/lib/actions/auth/login.d.ts +12 -0
  7. package/lib/actions/auth/login.js +63 -0
  8. package/lib/actions/auth/login.js.map +1 -0
  9. package/lib/actions/portal/copilot.d.ts +11 -0
  10. package/lib/actions/portal/copilot.js +49 -0
  11. package/lib/actions/portal/copilot.js.map +1 -0
  12. package/lib/actions/portal/generate.d.ts +13 -0
  13. package/lib/actions/portal/generate.js +61 -0
  14. package/lib/actions/portal/generate.js.map +1 -0
  15. package/lib/actions/portal/recipe/new-recipe.d.ts +24 -0
  16. package/lib/actions/portal/recipe/new-recipe.js +250 -0
  17. package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
  18. package/lib/actions/portal/serve.d.ts +14 -0
  19. package/lib/actions/portal/serve.js +24 -0
  20. package/lib/actions/portal/serve.js.map +1 -0
  21. package/lib/actions/portal/toc/new-toc.d.ts +20 -0
  22. package/lib/actions/portal/toc/new-toc.js +133 -0
  23. package/lib/actions/portal/toc/new-toc.js.map +1 -0
  24. package/lib/actions/sdk/generate.d.ts +14 -0
  25. package/lib/actions/sdk/generate.js +72 -0
  26. package/lib/actions/sdk/generate.js.map +1 -0
  27. package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
  28. package/lib/application/portal/recipe/portal-recipe.js +33 -0
  29. package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
  30. package/lib/application/portal/recipe/recipe-generator.d.ts +16 -0
  31. package/lib/application/portal/recipe/recipe-generator.js +147 -0
  32. package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
  33. package/lib/application/portal/serve/portal-watcher.d.ts +11 -0
  34. package/lib/application/portal/serve/portal-watcher.js +64 -0
  35. package/lib/application/portal/serve/portal-watcher.js.map +1 -0
  36. package/lib/application/portal/serve/serve-handler.d.ts +16 -0
  37. package/lib/application/portal/serve/serve-handler.js +91 -0
  38. package/lib/application/portal/serve/serve-handler.js.map +1 -0
  39. package/lib/application/portal/serve/watcher-handler.d.ts +10 -0
  40. package/lib/application/portal/serve/watcher-handler.js +51 -0
  41. package/lib/application/portal/serve/watcher-handler.js.map +1 -0
  42. package/lib/application/portal/toc/sdl-parser.d.ts +19 -0
  43. package/lib/application/portal/toc/sdl-parser.js +90 -0
  44. package/lib/application/portal/toc/sdl-parser.js.map +1 -0
  45. package/lib/application/portal/toc/toc-content-parser.d.ts +5 -0
  46. package/lib/application/portal/toc/toc-content-parser.js +44 -0
  47. package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
  48. package/lib/application/portal/toc/toc-structure-generator.d.ts +6 -0
  49. package/lib/application/portal/toc/toc-structure-generator.js +84 -0
  50. package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
  51. package/lib/client-utils/auth-manager.d.ts +8 -3
  52. package/lib/client-utils/auth-manager.js +23 -10
  53. package/lib/client-utils/auth-manager.js.map +1 -0
  54. package/lib/client-utils/sdk-client.d.ts +0 -1
  55. package/lib/client-utils/sdk-client.js +25 -55
  56. package/lib/client-utils/sdk-client.js.map +1 -0
  57. package/lib/commands/api/transform.d.ts +7 -7
  58. package/lib/commands/api/transform.js +43 -51
  59. package/lib/commands/api/transform.js.map +1 -0
  60. package/lib/commands/api/validate.d.ts +4 -4
  61. package/lib/commands/api/validate.js +26 -33
  62. package/lib/commands/api/validate.js.map +1 -0
  63. package/lib/commands/auth/login.d.ts +3 -2
  64. package/lib/commands/auth/login.js +22 -53
  65. package/lib/commands/auth/login.js.map +1 -0
  66. package/lib/commands/auth/logout.d.ts +1 -1
  67. package/lib/commands/auth/logout.js +8 -13
  68. package/lib/commands/auth/logout.js.map +1 -0
  69. package/lib/commands/auth/status.d.ts +1 -1
  70. package/lib/commands/auth/status.js +9 -13
  71. package/lib/commands/auth/status.js.map +1 -0
  72. package/lib/commands/portal/copilot.d.ts +12 -0
  73. package/lib/commands/portal/copilot.js +32 -0
  74. package/lib/commands/portal/copilot.js.map +1 -0
  75. package/lib/commands/portal/generate.d.ts +10 -8
  76. package/lib/commands/portal/generate.js +28 -107
  77. package/lib/commands/portal/generate.js.map +1 -0
  78. package/lib/commands/portal/quickstart.d.ts +10 -0
  79. package/lib/commands/portal/quickstart.js +105 -0
  80. package/lib/commands/portal/quickstart.js.map +1 -0
  81. package/lib/commands/portal/recipe/new.d.ts +10 -0
  82. package/lib/commands/portal/recipe/new.js +38 -0
  83. package/lib/commands/portal/recipe/new.js.map +1 -0
  84. package/lib/commands/portal/serve.d.ts +16 -0
  85. package/lib/commands/portal/serve.js +80 -0
  86. package/lib/commands/portal/serve.js.map +1 -0
  87. package/lib/commands/portal/toc/new.d.ts +14 -0
  88. package/lib/commands/portal/toc/new.js +52 -0
  89. package/lib/commands/portal/toc/new.js.map +1 -0
  90. package/lib/commands/sdk/generate.d.ts +9 -8
  91. package/lib/commands/sdk/generate.js +39 -128
  92. package/lib/commands/sdk/generate.js.map +1 -0
  93. package/lib/config/axios-config.d.ts +2 -0
  94. package/lib/config/axios-config.js +10 -0
  95. package/lib/config/axios-config.js.map +1 -0
  96. package/lib/config/env.d.ts +26 -1
  97. package/lib/config/env.js +27 -4
  98. package/lib/config/env.js.map +1 -0
  99. package/lib/controllers/api/transform.d.ts +1 -1
  100. package/lib/controllers/api/transform.js +23 -22
  101. package/lib/controllers/api/transform.js.map +1 -0
  102. package/lib/controllers/api/validate.d.ts +3 -3
  103. package/lib/controllers/api/validate.js +19 -12
  104. package/lib/controllers/api/validate.js.map +1 -0
  105. package/lib/controllers/portal/quickstart.d.ts +15 -0
  106. package/lib/controllers/portal/quickstart.js +217 -0
  107. package/lib/controllers/portal/quickstart.js.map +1 -0
  108. package/lib/index.d.ts +1 -1
  109. package/lib/index.js +2 -4
  110. package/lib/index.js.map +1 -0
  111. package/lib/infrastructure/api-utils.d.ts +9 -0
  112. package/lib/infrastructure/api-utils.js +33 -0
  113. package/lib/infrastructure/api-utils.js.map +1 -0
  114. package/lib/infrastructure/env-info.d.ts +8 -0
  115. package/lib/infrastructure/env-info.js +37 -0
  116. package/lib/infrastructure/env-info.js.map +1 -0
  117. package/lib/infrastructure/file-service.d.ts +18 -0
  118. package/lib/infrastructure/file-service.js +76 -0
  119. package/lib/infrastructure/file-service.js.map +1 -0
  120. package/lib/infrastructure/services/api-service.d.ts +10 -0
  121. package/lib/infrastructure/services/api-service.js +54 -0
  122. package/lib/infrastructure/services/api-service.js.map +1 -0
  123. package/lib/infrastructure/services/auth-service.d.ts +11 -0
  124. package/lib/infrastructure/services/auth-service.js +33 -0
  125. package/lib/infrastructure/services/auth-service.js.map +1 -0
  126. package/lib/infrastructure/services/portal-service.d.ts +20 -0
  127. package/lib/infrastructure/services/portal-service.js +163 -0
  128. package/lib/infrastructure/services/portal-service.js.map +1 -0
  129. package/lib/infrastructure/services/telemetry-service.d.ts +8 -0
  130. package/lib/infrastructure/services/telemetry-service.js +40 -0
  131. package/lib/infrastructure/services/telemetry-service.js.map +1 -0
  132. package/lib/infrastructure/tmp-extensions.d.ts +2 -0
  133. package/lib/infrastructure/tmp-extensions.js +6 -0
  134. package/lib/infrastructure/tmp-extensions.js.map +1 -0
  135. package/lib/infrastructure/zip-service.d.ts +6 -0
  136. package/lib/infrastructure/zip-service.js +39 -0
  137. package/lib/infrastructure/zip-service.js.map +1 -0
  138. package/lib/prompts/auth/login.d.ts +5 -0
  139. package/lib/prompts/auth/login.js +13 -0
  140. package/lib/prompts/auth/login.js.map +1 -0
  141. package/lib/prompts/portal/common/base-prompts.d.ts +7 -0
  142. package/lib/prompts/portal/common/base-prompts.js +19 -0
  143. package/lib/prompts/portal/common/base-prompts.js.map +1 -0
  144. package/lib/prompts/portal/copilot.d.ts +8 -0
  145. package/lib/prompts/portal/copilot.js +54 -0
  146. package/lib/prompts/portal/copilot.js.map +1 -0
  147. package/lib/prompts/portal/generate.d.ts +11 -0
  148. package/lib/prompts/portal/generate.js +42 -0
  149. package/lib/prompts/portal/generate.js.map +1 -0
  150. package/lib/prompts/portal/quickstart.d.ts +30 -0
  151. package/lib/prompts/portal/quickstart.js +240 -0
  152. package/lib/prompts/portal/quickstart.js.map +1 -0
  153. package/lib/prompts/portal/recipe/new-recipe.d.ts +24 -0
  154. package/lib/prompts/portal/recipe/new-recipe.js +203 -0
  155. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
  156. package/lib/prompts/portal/serve.d.ts +4 -0
  157. package/lib/prompts/portal/serve.js +14 -0
  158. package/lib/prompts/portal/serve.js.map +1 -0
  159. package/lib/prompts/portal/toc/new-toc.d.ts +11 -0
  160. package/lib/prompts/portal/toc/new-toc.js +39 -0
  161. package/lib/prompts/portal/toc/new-toc.js.map +1 -0
  162. package/lib/prompts/sdk/generate.d.ts +11 -0
  163. package/lib/prompts/sdk/generate.js +42 -0
  164. package/lib/prompts/sdk/generate.js.map +1 -0
  165. package/lib/types/api/account.d.ts +10 -0
  166. package/lib/types/api/account.js +2 -0
  167. package/lib/types/api/account.js.map +1 -0
  168. package/lib/types/api/transform.d.ts +19 -4
  169. package/lib/types/api/transform.js +19 -4
  170. package/lib/types/api/transform.js.map +1 -0
  171. package/lib/types/api/validate.d.ts +3 -3
  172. package/lib/types/api/validate.js +2 -2
  173. package/lib/types/api/validate.js.map +1 -0
  174. package/lib/types/build/build.d.ts +14 -0
  175. package/lib/types/build/build.js +4 -0
  176. package/lib/types/build/build.js.map +1 -0
  177. package/lib/types/build-context.d.ts +13 -0
  178. package/lib/types/build-context.js +30 -0
  179. package/lib/types/build-context.js.map +1 -0
  180. package/lib/types/common/result.d.ts +17 -0
  181. package/lib/types/common/result.js +32 -0
  182. package/lib/types/common/result.js.map +1 -0
  183. package/lib/types/events/domain-event.d.ts +8 -0
  184. package/lib/types/events/domain-event.js +11 -0
  185. package/lib/types/events/domain-event.js.map +1 -0
  186. package/lib/types/events/recipe-creation-failed.d.ts +5 -0
  187. package/lib/types/events/recipe-creation-failed.js +8 -0
  188. package/lib/types/events/recipe-creation-failed.js.map +1 -0
  189. package/lib/types/events/toc-creation-failed.d.ts +5 -0
  190. package/lib/types/events/toc-creation-failed.js +8 -0
  191. package/lib/types/events/toc-creation-failed.js.map +1 -0
  192. package/lib/types/file/directoryPath.d.ts +7 -0
  193. package/lib/types/file/directoryPath.js +16 -0
  194. package/lib/types/file/directoryPath.js.map +1 -0
  195. package/lib/types/file/fileName.d.ts +5 -0
  196. package/lib/types/file/fileName.js +9 -0
  197. package/lib/types/file/fileName.js.map +1 -0
  198. package/lib/types/file/filePath.d.ts +8 -0
  199. package/lib/types/file/filePath.js +11 -0
  200. package/lib/types/file/filePath.js.map +1 -0
  201. package/lib/types/flags-provider.d.ts +15 -0
  202. package/lib/types/flags-provider.js +34 -0
  203. package/lib/types/flags-provider.js.map +1 -0
  204. package/lib/types/portal/generate.d.ts +13 -9
  205. package/lib/types/portal/generate.js +3 -2
  206. package/lib/types/portal/generate.js.map +1 -0
  207. package/lib/types/portal/quickstart.d.ts +17 -0
  208. package/lib/types/portal/quickstart.js +2 -0
  209. package/lib/types/portal/quickstart.js.map +1 -0
  210. package/lib/types/portal/serve.d.ts +12 -0
  211. package/lib/types/portal/serve.js +2 -0
  212. package/lib/types/portal/serve.js.map +1 -0
  213. package/lib/types/portal-context.d.ts +11 -0
  214. package/lib/types/portal-context.js +28 -0
  215. package/lib/types/portal-context.js.map +1 -0
  216. package/lib/types/recipe/recipe.d.ts +37 -0
  217. package/lib/types/recipe/recipe.js +6 -0
  218. package/lib/types/recipe/recipe.js.map +1 -0
  219. package/lib/types/sdk/generate.d.ts +11 -10
  220. package/lib/types/sdk/generate.js +11 -12
  221. package/lib/types/sdk/generate.js.map +1 -0
  222. package/lib/types/sdk-context.d.ts +13 -0
  223. package/lib/types/sdk-context.js +28 -0
  224. package/lib/types/sdk-context.js.map +1 -0
  225. package/lib/types/sdl/sdl.d.ts +12 -0
  226. package/lib/types/sdl/sdl.js +2 -0
  227. package/lib/types/sdl/sdl.js.map +1 -0
  228. package/lib/types/spec-context.d.ts +7 -0
  229. package/lib/types/spec-context.js +12 -0
  230. package/lib/types/spec-context.js.map +1 -0
  231. package/lib/types/toc/toc.d.ts +31 -0
  232. package/lib/types/toc/toc.js +9 -0
  233. package/lib/types/toc/toc.js.map +1 -0
  234. package/lib/types/utils.d.ts +3 -3
  235. package/lib/types/utils.js +2 -2
  236. package/lib/types/utils.js.map +1 -0
  237. package/lib/utils/utils.d.ts +16 -7
  238. package/lib/utils/utils.js +142 -86
  239. package/lib/utils/utils.js.map +1 -0
  240. package/lib/validators/common/directoryValidator.d.ts +5 -0
  241. package/lib/validators/common/directoryValidator.js +22 -0
  242. package/lib/validators/common/directoryValidator.js.map +1 -0
  243. package/lib/validators/portal/serve-validator.d.ts +6 -0
  244. package/lib/validators/portal/serve-validator.js +15 -0
  245. package/lib/validators/portal/serve-validator.js.map +1 -0
  246. package/package.json +96 -40
  247. package/bin/run +0 -5
  248. package/lib/controllers/portal/generate.d.ts +0 -2
  249. package/lib/controllers/portal/generate.js +0 -49
  250. package/lib/controllers/sdk/generate.d.ts +0 -4
  251. 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
  [![Downloads/week](https://img.shields.io/npm/dw/@apimatic/cli.svg)](https://npmjs.org/package/@apimatic/cli)
9
10
  [![License](https://img.shields.io/npm/l/@apimatic/cli.svg)](https://github.com/apimatic/apimatic-cli/blob/master/package.json)
10
11
 
11
- <!-- toc -->
12
- * [Usage](#usage)
13
- * [Commands](#commands)
14
- <!-- tocstop -->
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@1.0.1-alpha.3
23
+ $ npm install -g @apimatic/cli
19
24
  $ apimatic COMMAND
20
25
  running command...
21
- $ apimatic (-v|--version|version)
22
- @apimatic/cli/0.0.0-alpha.3 linux-x64 node-v16.13.0
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
- OPTIONS
51
- -f, --force overwrite if same file exist in the destination
52
- --auth-key=auth-key override current authentication state with an authentication key
53
-
54
- --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download
55
- transformed file to
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/v0.0.0-alpha.3/src/commands/api/transform.ts)_
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
- OPTIONS
85
- --auth-key=auth-key override current authentication state with an authentication key
86
- --file=file Path to the API specification file to validate
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
- --url=url URL to the specification file to validate. Can be used in place of the --file option if the API
89
- specification is publicly available.
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/v0.0.0-alpha.3/src/commands/api/validate.ts)_
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
- OPTIONS
110
- --auth-key=auth-key Set authentication key for all commands
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=xxxxxx
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/v0.0.0-alpha.3/src/commands/auth/login.ts)_
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
- Clear local login credentials
133
+ Clears the local login credentials.
128
134
 
129
135
  ```
130
136
  USAGE
131
137
  $ apimatic auth:logout
132
138
 
133
- EXAMPLE
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/v0.0.0-alpha.3/src/commands/auth/logout.ts)_
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 current authentication state
150
+ View the currently logged in user.
143
151
 
144
152
  ```
145
153
  USAGE
146
154
  $ apimatic auth:status
147
155
 
148
- EXAMPLE
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/v0.0.0-alpha.3/src/commands/auth/status.ts)_
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
- display autocomplete installation instructions
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
- OPTIONS
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/v0.3.0/src/commands/autocomplete/index.ts)_
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
- display help for apimatic
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 command to show help for
200
+ COMMAND... Command to show help for.
201
+
202
+ FLAGS
203
+ -n, --nested-commands Include all nested commands in the output.
188
204
 
189
- OPTIONS
190
- --all see all commands in CLI
205
+ DESCRIPTION
206
+ Display help for apimatic.
191
207
  ```
192
208
 
193
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.14/src/commands/help.ts)_
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 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)
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
- OPTIONS
204
- -f, --force overwrite if a portal exists in the destination
205
- --auth-key=auth-key override current authentication state with an authentication key
206
- --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] path to the downloaded portal
207
- --folder=folder [default: ./] path to the input directory containing API specifications and config files
208
- --zip download the generated portal as a .zip archive
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
- _See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v0.0.0-alpha.3/src/commands/portal/generate.ts)_
277
+ DESCRIPTION
278
+ Create your first API Portal using APIMatic's Docs as Code offering.
216
279
 
217
- ## `apimatic sdk:generate`
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
- Generate SDK for your APIs
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 sdk:generate
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
- OPTIONS
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
- --destination=destination [default: /home/runner/work/apimatic-cli/apimatic-cli/cli] directory to download the
230
- generated SDK to
313
+ ## `apimatic portal:serve`
231
314
 
232
- --file=file path to the API specification to generate SDKs for
315
+ Generate and deploy a Docs as Code portal with hot reload.
233
316
 
234
- --platform=platform (required) language platform for sdk
235
- Simple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT
236
- Legacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|
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
- --url=url URL to the API specification to generate SDKs for. Can be used in place of the --file
241
- option if the API specification is publicly available.
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
- --zip download the generated SDK as a .zip archive
330
+ DESCRIPTION
331
+ Generate and deploy a Docs as Code portal with hot reload.
244
332
 
245
333
  EXAMPLES
246
- $ apimatic sdk:generate --platform="CSHARP" --file="./specs/sample.json"
247
- Generating SDK... done
248
- Downloading SDK... done
249
- Success! Your SDK is located at swagger_sdk_csharp
250
-
251
- $ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
252
- Generating SDK... done
253
- Downloading SDK... done
254
- Success! Your SDK is located at swagger_sdk_csharp
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/v0.0.0-alpha.3/src/commands/sdk/generate.ts)_
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,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({dir: import.meta.url})
@@ -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
+ }