@apimatic/cli 1.1.0-alpha.21 → 1.1.0-alpha.22

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 (299) hide show
  1. package/README.md +112 -90
  2. package/lib/actions/action-result.d.ts +8 -3
  3. package/lib/actions/action-result.js +34 -15
  4. package/lib/actions/action-result.js.map +1 -1
  5. package/lib/actions/api/transform.d.ts +15 -0
  6. package/lib/actions/api/transform.js +48 -0
  7. package/lib/actions/api/transform.js.map +1 -0
  8. package/lib/actions/api/validate.d.ts +12 -0
  9. package/lib/actions/api/validate.js +41 -0
  10. package/lib/actions/api/validate.js.map +1 -0
  11. package/lib/actions/auth/login.d.ts +6 -5
  12. package/lib/actions/auth/login.js +25 -33
  13. package/lib/actions/auth/login.js.map +1 -1
  14. package/lib/actions/auth/logout.d.ts +8 -0
  15. package/lib/actions/auth/logout.js +15 -0
  16. package/lib/actions/auth/logout.js.map +1 -0
  17. package/lib/actions/auth/status.d.ts +11 -0
  18. package/lib/actions/auth/status.js +26 -0
  19. package/lib/actions/auth/status.js.map +1 -0
  20. package/lib/actions/portal/copilot.d.ts +5 -3
  21. package/lib/actions/portal/copilot.js +47 -37
  22. package/lib/actions/portal/copilot.js.map +1 -1
  23. package/lib/actions/portal/generate.d.ts +4 -5
  24. package/lib/actions/portal/generate.js +30 -37
  25. package/lib/actions/portal/generate.js.map +1 -1
  26. package/lib/actions/portal/quickstart.d.ts +16 -0
  27. package/lib/actions/portal/quickstart.js +145 -0
  28. package/lib/actions/portal/quickstart.js.map +1 -0
  29. package/lib/actions/portal/recipe/new-recipe.d.ts +11 -20
  30. package/lib/actions/portal/recipe/new-recipe.js +147 -221
  31. package/lib/actions/portal/recipe/new-recipe.js.map +1 -1
  32. package/lib/actions/portal/serve.d.ts +12 -10
  33. package/lib/actions/portal/serve.js +112 -17
  34. package/lib/actions/portal/serve.js.map +1 -1
  35. package/lib/actions/portal/toc/new-toc.d.ts +16 -15
  36. package/lib/actions/portal/toc/new-toc.js +80 -116
  37. package/lib/actions/portal/toc/new-toc.js.map +1 -1
  38. package/lib/actions/sdk/generate.d.ts +5 -6
  39. package/lib/actions/sdk/generate.js +22 -47
  40. package/lib/actions/sdk/generate.js.map +1 -1
  41. package/lib/application/portal/recipe/portal-recipe.d.ts +2 -2
  42. package/lib/application/portal/recipe/portal-recipe.js +9 -9
  43. package/lib/application/portal/recipe/portal-recipe.js.map +1 -1
  44. package/lib/application/portal/recipe/recipe-generator.d.ts +7 -2
  45. package/lib/application/portal/recipe/recipe-generator.js +21 -22
  46. package/lib/application/portal/recipe/recipe-generator.js.map +1 -1
  47. package/lib/client-utils/auth-manager.d.ts +1 -1
  48. package/lib/client-utils/auth-manager.js +3 -4
  49. package/lib/client-utils/auth-manager.js.map +1 -1
  50. package/lib/commands/api/transform.d.ts +6 -3
  51. package/lib/commands/api/transform.js +43 -94
  52. package/lib/commands/api/transform.js.map +1 -1
  53. package/lib/commands/api/validate.d.ts +6 -3
  54. package/lib/commands/api/validate.js +27 -66
  55. package/lib/commands/api/validate.js.map +1 -1
  56. package/lib/commands/auth/login.d.ts +2 -1
  57. package/lib/commands/auth/login.js +15 -9
  58. package/lib/commands/auth/login.js.map +1 -1
  59. package/lib/commands/auth/logout.d.ts +3 -1
  60. package/lib/commands/auth/logout.js +12 -13
  61. package/lib/commands/auth/logout.js.map +1 -1
  62. package/lib/commands/auth/status.d.ts +1 -0
  63. package/lib/commands/auth/status.js +13 -11
  64. package/lib/commands/auth/status.js.map +1 -1
  65. package/lib/commands/portal/copilot.d.ts +2 -2
  66. package/lib/commands/portal/copilot.js +22 -20
  67. package/lib/commands/portal/copilot.js.map +1 -1
  68. package/lib/commands/portal/generate.d.ts +3 -4
  69. package/lib/commands/portal/generate.js +19 -14
  70. package/lib/commands/portal/generate.js.map +1 -1
  71. package/lib/commands/portal/quickstart.d.ts +3 -4
  72. package/lib/commands/portal/quickstart.js +24 -101
  73. package/lib/commands/portal/quickstart.js.map +1 -1
  74. package/lib/commands/portal/recipe/new.d.ts +3 -1
  75. package/lib/commands/portal/recipe/new.js +31 -23
  76. package/lib/commands/portal/recipe/new.js.map +1 -1
  77. package/lib/commands/portal/serve.d.ts +5 -5
  78. package/lib/commands/portal/serve.js +31 -57
  79. package/lib/commands/portal/serve.js.map +1 -1
  80. package/lib/commands/portal/toc/new.d.ts +2 -2
  81. package/lib/commands/portal/toc/new.js +35 -26
  82. package/lib/commands/portal/toc/new.js.map +1 -1
  83. package/lib/commands/sdk/generate.d.ts +5 -4
  84. package/lib/commands/sdk/generate.js +26 -17
  85. package/lib/commands/sdk/generate.js.map +1 -1
  86. package/lib/hooks/not-found.js +1 -1
  87. package/lib/hooks/not-found.js.map +1 -1
  88. package/lib/infrastructure/api-utils.js +3 -2
  89. package/lib/infrastructure/api-utils.js.map +1 -1
  90. package/lib/{application/portal/serve/watcher-handler.d.ts → infrastructure/debounce-service.d.ts} +3 -3
  91. package/lib/{application/portal/serve/watcher-handler.js → infrastructure/debounce-service.js} +5 -4
  92. package/lib/infrastructure/debounce-service.js.map +1 -0
  93. package/lib/infrastructure/env-info.d.ts +1 -1
  94. package/lib/infrastructure/env-info.js +2 -2
  95. package/lib/infrastructure/env-info.js.map +1 -1
  96. package/lib/infrastructure/file-service.d.ts +7 -2
  97. package/lib/infrastructure/file-service.js +46 -5
  98. package/lib/infrastructure/file-service.js.map +1 -1
  99. package/lib/infrastructure/launcher-service.d.ts +2 -0
  100. package/lib/infrastructure/launcher-service.js +4 -0
  101. package/lib/infrastructure/launcher-service.js.map +1 -1
  102. package/lib/infrastructure/network-service.d.ts +3 -0
  103. package/lib/infrastructure/network-service.js +7 -0
  104. package/lib/infrastructure/network-service.js.map +1 -0
  105. package/lib/infrastructure/services/api-client-factory.d.ts +6 -0
  106. package/lib/infrastructure/services/api-client-factory.js +20 -0
  107. package/lib/infrastructure/services/api-client-factory.js.map +1 -0
  108. package/lib/infrastructure/services/api-service.d.ts +2 -2
  109. package/lib/infrastructure/services/api-service.js +6 -6
  110. package/lib/infrastructure/services/api-service.js.map +1 -1
  111. package/lib/infrastructure/services/auth-service.d.ts +1 -1
  112. package/lib/infrastructure/services/auth-service.js +7 -5
  113. package/lib/infrastructure/services/auth-service.js.map +1 -1
  114. package/lib/infrastructure/services/file-download-service.d.ts +15 -0
  115. package/lib/infrastructure/services/file-download-service.js +104 -0
  116. package/lib/infrastructure/services/file-download-service.js.map +1 -0
  117. package/lib/infrastructure/services/portal-service.d.ts +11 -13
  118. package/lib/infrastructure/services/portal-service.js +73 -102
  119. package/lib/infrastructure/services/portal-service.js.map +1 -1
  120. package/lib/infrastructure/services/telemetry-service.d.ts +3 -2
  121. package/lib/infrastructure/services/telemetry-service.js +4 -6
  122. package/lib/infrastructure/services/telemetry-service.js.map +1 -1
  123. package/lib/infrastructure/services/transformation-service.d.ts +23 -0
  124. package/lib/infrastructure/services/transformation-service.js +56 -0
  125. package/lib/infrastructure/services/transformation-service.js.map +1 -0
  126. package/lib/infrastructure/services/validation-service.d.ts +17 -0
  127. package/lib/infrastructure/services/validation-service.js +49 -0
  128. package/lib/infrastructure/services/validation-service.js.map +1 -0
  129. package/lib/prompts/api/transform.d.ts +11 -0
  130. package/lib/prompts/api/transform.js +30 -0
  131. package/lib/prompts/api/transform.js.map +1 -0
  132. package/lib/prompts/api/validate.d.ts +12 -0
  133. package/lib/prompts/api/validate.js +41 -0
  134. package/lib/prompts/api/validate.js.map +1 -0
  135. package/lib/prompts/auth/login.d.ts +6 -1
  136. package/lib/prompts/auth/login.js +12 -3
  137. package/lib/prompts/auth/login.js.map +1 -1
  138. package/lib/prompts/auth/logout.d.ts +3 -0
  139. package/lib/prompts/auth/logout.js +7 -0
  140. package/lib/prompts/auth/logout.js.map +1 -0
  141. package/lib/prompts/auth/status.d.ts +8 -0
  142. package/lib/prompts/auth/status.js +21 -0
  143. package/lib/prompts/auth/status.js.map +1 -0
  144. package/lib/prompts/format.d.ts +33 -0
  145. package/lib/prompts/format.js +99 -0
  146. package/lib/prompts/format.js.map +1 -0
  147. package/lib/prompts/portal/copilot.d.ts +8 -4
  148. package/lib/prompts/portal/copilot.js +35 -24
  149. package/lib/prompts/portal/copilot.js.map +1 -1
  150. package/lib/prompts/portal/generate.d.ts +9 -7
  151. package/lib/prompts/portal/generate.js +22 -23
  152. package/lib/prompts/portal/generate.js.map +1 -1
  153. package/lib/prompts/portal/quickstart.d.ts +30 -29
  154. package/lib/prompts/portal/quickstart.js +99 -193
  155. package/lib/prompts/portal/quickstart.js.map +1 -1
  156. package/lib/prompts/portal/recipe/new-recipe.d.ts +23 -18
  157. package/lib/prompts/portal/recipe/new-recipe.js +70 -108
  158. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -1
  159. package/lib/prompts/portal/serve.d.ts +10 -3
  160. package/lib/prompts/portal/serve.js +30 -11
  161. package/lib/prompts/portal/serve.js.map +1 -1
  162. package/lib/prompts/portal/toc/new-toc.d.ts +12 -8
  163. package/lib/prompts/portal/toc/new-toc.js +20 -22
  164. package/lib/prompts/portal/toc/new-toc.js.map +1 -1
  165. package/lib/prompts/sdk/generate.d.ts +7 -7
  166. package/lib/prompts/sdk/generate.js +17 -23
  167. package/lib/prompts/sdk/generate.js.map +1 -1
  168. package/lib/types/api/account.d.ts +1 -1
  169. package/lib/types/api/transform.d.ts +14 -25
  170. package/lib/types/api/transform.js +16 -16
  171. package/lib/types/api/transform.js.map +1 -1
  172. package/lib/types/build/build.d.ts +9 -1
  173. package/lib/types/build/build.js +5 -2
  174. package/lib/types/build/build.js.map +1 -1
  175. package/lib/types/build-context.d.ts +5 -1
  176. package/lib/types/build-context.js +21 -4
  177. package/lib/types/build-context.js.map +1 -1
  178. package/lib/types/common/command-metadata.d.ts +4 -0
  179. package/lib/types/common/command-metadata.js +2 -0
  180. package/lib/types/common/command-metadata.js.map +1 -0
  181. package/lib/types/events/domain-event.d.ts +1 -1
  182. package/lib/types/events/domain-event.js.map +1 -1
  183. package/lib/types/events/quickstart-completed.js +1 -1
  184. package/lib/types/events/quickstart-initiated.js +1 -1
  185. package/lib/types/events/recipe-creation-failed.d.ts +1 -1
  186. package/lib/types/events/recipe-creation-failed.js +1 -1
  187. package/lib/types/events/recipe-creation-failed.js.map +1 -1
  188. package/lib/types/events/toc-creation-failed.d.ts +1 -1
  189. package/lib/types/events/toc-creation-failed.js +1 -1
  190. package/lib/types/events/toc-creation-failed.js.map +1 -1
  191. package/lib/types/file/directory.d.ts +17 -0
  192. package/lib/types/file/directory.js +86 -0
  193. package/lib/types/file/directory.js.map +1 -0
  194. package/lib/types/file/directoryPath.d.ts +3 -1
  195. package/lib/types/file/directoryPath.js +8 -2
  196. package/lib/types/file/directoryPath.js.map +1 -1
  197. package/lib/types/file/fileName.d.ts +2 -0
  198. package/lib/types/file/fileName.js +12 -0
  199. package/lib/types/file/fileName.js.map +1 -1
  200. package/lib/types/file/filePath.d.ts +2 -0
  201. package/lib/types/file/filePath.js +21 -0
  202. package/lib/types/file/filePath.js.map +1 -1
  203. package/lib/types/file/resource-input.d.ts +5 -0
  204. package/lib/types/file/resource-input.js +42 -0
  205. package/lib/types/file/resource-input.js.map +1 -0
  206. package/lib/types/file/urlPath.d.ts +6 -0
  207. package/lib/types/file/urlPath.js +22 -0
  208. package/lib/types/file/urlPath.js.map +1 -0
  209. package/lib/types/portal-context.d.ts +3 -1
  210. package/lib/types/portal-context.js +10 -0
  211. package/lib/types/portal-context.js.map +1 -1
  212. package/lib/types/recipe/recipe.d.ts +2 -17
  213. package/lib/types/recipe-context.d.ts +8 -0
  214. package/lib/types/recipe-context.js +21 -0
  215. package/lib/types/recipe-context.js.map +1 -0
  216. package/lib/types/resource-context.d.ts +12 -0
  217. package/lib/types/resource-context.js +30 -0
  218. package/lib/types/resource-context.js.map +1 -0
  219. package/lib/types/sdk/generate.d.ts +2 -15
  220. package/lib/types/sdk/generate.js +24 -10
  221. package/lib/types/sdk/generate.js.map +1 -1
  222. package/lib/types/sdk-context.d.ts +6 -5
  223. package/lib/types/sdk-context.js +12 -8
  224. package/lib/types/sdk-context.js.map +1 -1
  225. package/lib/types/sdl/sdl.d.ts +9 -0
  226. package/lib/types/sdl/sdl.js +46 -1
  227. package/lib/types/sdl/sdl.js.map +1 -1
  228. package/lib/types/spec-context.d.ts +3 -0
  229. package/lib/types/spec-context.js +7 -2
  230. package/lib/types/spec-context.js.map +1 -1
  231. package/lib/types/temp-context.d.ts +11 -0
  232. package/lib/types/temp-context.js +27 -0
  233. package/lib/types/temp-context.js.map +1 -0
  234. package/lib/types/toc-context.d.ts +12 -0
  235. package/lib/types/toc-context.js +26 -0
  236. package/lib/types/toc-context.js.map +1 -0
  237. package/lib/types/transform-context.d.ts +13 -0
  238. package/lib/types/transform-context.js +30 -0
  239. package/lib/types/transform-context.js.map +1 -0
  240. package/lib/types/utils.d.ts +0 -9
  241. package/lib/utils/string-utils.d.ts +1 -0
  242. package/lib/utils/string-utils.js +10 -0
  243. package/lib/utils/string-utils.js.map +1 -0
  244. package/lib/utils/utils.d.ts +2 -27
  245. package/lib/utils/utils.js +6 -145
  246. package/lib/utils/utils.js.map +1 -1
  247. package/package.json +4 -4
  248. package/lib/application/portal/serve/portal-watcher.d.ts +0 -11
  249. package/lib/application/portal/serve/portal-watcher.js +0 -64
  250. package/lib/application/portal/serve/portal-watcher.js.map +0 -1
  251. package/lib/application/portal/serve/serve-handler.d.ts +0 -16
  252. package/lib/application/portal/serve/serve-handler.js +0 -91
  253. package/lib/application/portal/serve/serve-handler.js.map +0 -1
  254. package/lib/application/portal/serve/watcher-handler.js.map +0 -1
  255. package/lib/application/portal/toc/sdl-parser.d.ts +0 -19
  256. package/lib/application/portal/toc/sdl-parser.js +0 -90
  257. package/lib/application/portal/toc/sdl-parser.js.map +0 -1
  258. package/lib/client-utils/sdk-client.d.ts +0 -18
  259. package/lib/client-utils/sdk-client.js +0 -41
  260. package/lib/client-utils/sdk-client.js.map +0 -1
  261. package/lib/config/env.d.ts +0 -26
  262. package/lib/config/env.js +0 -27
  263. package/lib/config/env.js.map +0 -1
  264. package/lib/controllers/api/transform.d.ts +0 -5
  265. package/lib/controllers/api/transform.js +0 -50
  266. package/lib/controllers/api/transform.js.map +0 -1
  267. package/lib/controllers/api/validate.d.ts +0 -3
  268. package/lib/controllers/api/validate.js +0 -29
  269. package/lib/controllers/api/validate.js.map +0 -1
  270. package/lib/controllers/portal/quickstart.d.ts +0 -13
  271. package/lib/controllers/portal/quickstart.js +0 -214
  272. package/lib/controllers/portal/quickstart.js.map +0 -1
  273. package/lib/infrastructure/api-client-utils.d.ts +0 -6
  274. package/lib/infrastructure/api-client-utils.js +0 -34
  275. package/lib/infrastructure/api-client-utils.js.map +0 -1
  276. package/lib/prompts/portal/common/base-prompts.d.ts +0 -7
  277. package/lib/prompts/portal/common/base-prompts.js +0 -19
  278. package/lib/prompts/portal/common/base-prompts.js.map +0 -1
  279. package/lib/types/api/validate.d.ts +0 -12
  280. package/lib/types/api/validate.js +0 -2
  281. package/lib/types/api/validate.js.map +0 -1
  282. package/lib/types/common/result.d.ts +0 -17
  283. package/lib/types/common/result.js +0 -32
  284. package/lib/types/common/result.js.map +0 -1
  285. package/lib/types/portal/generate.d.ts +0 -13
  286. package/lib/types/portal/generate.js +0 -3
  287. package/lib/types/portal/generate.js.map +0 -1
  288. package/lib/types/portal/quickstart.d.ts +0 -17
  289. package/lib/types/portal/quickstart.js +0 -2
  290. package/lib/types/portal/quickstart.js.map +0 -1
  291. package/lib/types/portal/serve.d.ts +0 -12
  292. package/lib/types/portal/serve.js +0 -2
  293. package/lib/types/portal/serve.js.map +0 -1
  294. package/lib/validators/common/directoryValidator.d.ts +0 -5
  295. package/lib/validators/common/directoryValidator.js +0 -22
  296. package/lib/validators/common/directoryValidator.js.map +0 -1
  297. package/lib/validators/portal/serve-validator.d.ts +0 -6
  298. package/lib/validators/portal/serve-validator.js +0 -15
  299. package/lib/validators/portal/serve-validator.js.map +0 -1
package/lib/config/env.js DELETED
@@ -1,27 +0,0 @@
1
- export const baseURL = "https://api.apimatic.io";
2
- export const metadataFileContent = {
3
- ImportSettings: {
4
- AutoGenerateTestCases: false,
5
- ImportAdditionalHeader: false,
6
- ImportAdditionalTypeCombinatorModels: false,
7
- ImportTypeCombinatorsWithOnlyOneType: false
8
- },
9
- CodeGenSettings: {
10
- Timeout: 30,
11
- ValidateRequiredParameters: true,
12
- AddSingleAuthDeprecatedCode: false,
13
- EnableGlobalUserAgent: true,
14
- UserAgent: "{language}-SDK/{version} (OS: {os-info}, Engine: {engine}/{engine-version})",
15
- EnableLogging: true,
16
- EnableModelKeywordArgsInRuby: true,
17
- SymbolizeHashKeysInRuby: true,
18
- ReturnCompleteHttpResponse: true,
19
- UserConfigurableRetries: true,
20
- UseEnumPrefix: false,
21
- ExtendedAdditionalPropertiesSupport: true,
22
- EnforceStandardizedCasing: true,
23
- ControllerPostfix: "Api",
24
- DoNotSplitWords: ["oauth"]
25
- }
26
- };
27
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,yBAAyB,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,cAAc,EAAE;QACd,qBAAqB,EAAE,KAAK;QAC5B,sBAAsB,EAAE,KAAK;QAC7B,oCAAoC,EAAE,KAAK;QAC3C,oCAAoC,EAAE,KAAK;KAC5C;IACD,eAAe,EAAE;QACf,OAAO,EAAE,EAAE;QACX,0BAA0B,EAAE,IAAI;QAChC,2BAA2B,EAAE,KAAK;QAClC,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,6EAA6E;QACxF,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,uBAAuB,EAAE,IAAI;QAC7B,0BAA0B,EAAE,IAAI;QAChC,uBAAuB,EAAE,IAAI;QAC7B,aAAa,EAAE,KAAK;QACpB,mCAAmC,EAAE,IAAI;QACzC,yBAAyB,EAAE,IAAI;QAC/B,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,CAAC,OAAO,CAAC;KAC3B;CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- import { DownloadTransformationParams, TransformationIdParams } from "../../types/api/transform.js";
2
- import { ExportFormats, Transformation, TransformationController } from "@apimatic/sdk";
3
- export declare const getTransformationId: ({ file, url, format }: TransformationIdParams, transformationController: TransformationController) => Promise<Transformation>;
4
- export declare const downloadTransformationFile: ({ id, destinationFilePath, transformationController }: DownloadTransformationParams) => Promise<string>;
5
- export declare const getValidFormat: (format: string) => ExportFormats;
@@ -1,50 +0,0 @@
1
- import { ux } from "@oclif/core";
2
- import fsExtra from "fs-extra";
3
- import { writeFileUsingReadableStream } from "../../utils/utils.js";
4
- import { TransformationFormats } from "../../types/api/transform.js";
5
- import { ContentType, ExportFormats, FileWrapper } from "@apimatic/sdk";
6
- export const getTransformationId = async ({ file, url, format }, transformationController) => {
7
- ux.action.start("Transforming API specification");
8
- let generation;
9
- if (file) {
10
- const fileDescriptor = new FileWrapper(fsExtra.createReadStream(file));
11
- generation = await transformationController.transformViaFile(ContentType.EnumMultipartformdata, fileDescriptor, format);
12
- }
13
- else if (url) {
14
- const body = {
15
- url: url,
16
- exportFormat: format
17
- };
18
- generation = await transformationController.transformViaUrl(body);
19
- }
20
- else {
21
- throw new Error("Please provide a specification file");
22
- }
23
- ux.action.stop();
24
- return generation.result;
25
- };
26
- export const downloadTransformationFile = async ({ id, destinationFilePath, transformationController }) => {
27
- ux.action.start("Downloading Transformed file");
28
- const { result } = await transformationController.downloadTransformedFile(id);
29
- if (result.readable) {
30
- await writeFileUsingReadableStream(result, destinationFilePath);
31
- }
32
- else {
33
- throw new Error("Couldn't save transformation file");
34
- }
35
- ux.action.stop();
36
- return destinationFilePath;
37
- };
38
- // Get valid platform from user's input, convert simple platform to valid Platforms enum value
39
- export const getValidFormat = (format) => {
40
- const key = Object.keys(TransformationFormats).find((value) => value === format);
41
- if (key) {
42
- const transformationFormat = TransformationFormats[key];
43
- return ExportFormats[transformationFormat];
44
- }
45
- else {
46
- const formats = Object.keys(TransformationFormats).join("|");
47
- throw new Error(`Please provide a valid platform, e.g. ${formats}`);
48
- }
49
- };
50
- //# sourceMappingURL=transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/controllers/api/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAGL,qBAAqB,EAEtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,WAAW,EACX,aAAa,EACb,WAAW,EAIZ,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAA0B,EAC7C,wBAAkD,EACzB,EAAE;IAC3B,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAElD,IAAI,UAAuC,CAAC;IAC5C,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,cAAc,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,UAAU,GAAG,MAAM,wBAAwB,CAAC,gBAAgB,CAC1D,WAAW,CAAC,qBAAqB,EACjC,cAAc,EACd,MAAuB,CACxB,CAAC;IACJ,CAAC;SAAM,IAAI,GAAG,EAAE,CAAC;QACf,MAAM,IAAI,GAA2B;YACnC,GAAG,EAAE,GAAG;YACR,YAAY,EAAE,MAAuB;SACtC,CAAC;QACF,UAAU,GAAG,MAAM,wBAAwB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAC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@
1
- import { ApiValidationExternalApisController, ApiValidationSummary } from "@apimatic/sdk";
2
- import { GetValidationParams } from "../../types/api/validate.js";
3
- export declare const getValidationSummary: ({ file, url }: GetValidationParams, apiValidationController: ApiValidationExternalApisController) => Promise<ApiValidationSummary>;
@@ -1,29 +0,0 @@
1
- import fsExtra from "fs-extra";
2
- import { ContentType, FileWrapper } from "@apimatic/sdk";
3
- import { createTempDirectory, deleteFile, zipDirectory } from "../../utils/utils.js";
4
- export const getValidationSummary = async ({ file, url }, apiValidationController) => {
5
- let validation;
6
- if (file) {
7
- const fileStatus = fsExtra.statSync(file);
8
- if (fileStatus.isDirectory()) {
9
- const tempDir = await createTempDirectory();
10
- const zipPath = await zipDirectory(file, tempDir);
11
- const zipFile = new FileWrapper(fsExtra.createReadStream(zipPath));
12
- validation = await apiValidationController.validateApiViaFile(ContentType.EnumMultipartformdata, zipFile);
13
- await deleteFile(zipPath);
14
- await fsExtra.remove(tempDir);
15
- }
16
- else {
17
- const fileDescriptor = new FileWrapper(fsExtra.createReadStream(file));
18
- validation = await apiValidationController.validateApiViaFile(ContentType.EnumMultipartformdata, fileDescriptor);
19
- }
20
- }
21
- else if (url) {
22
- validation = await apiValidationController.validateApiViaUrl(url);
23
- }
24
- else {
25
- throw new Error("Please provide a specification file");
26
- }
27
- return validation.result;
28
- };
29
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/controllers/api/validate.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAA0E,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjI,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAErF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,EAAE,IAAI,EAAE,GAAG,EAAuB,EAClC,uBAA4D,EAC7B,EAAE;IACjC,IAAI,UAA6C,CAAC;IAElD,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAG,MAAM,mBAAmB,EAAE,CAAC;YAC5C,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;YACnE,UAAU,GAAG,MAAM,uBAAuB,CAAC,kBAAkB,CAAC,WAAW,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;YAE1G,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;YAE1B,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;YACvE,UAAU,GAAG,MAAM,uBAAuB,CAAC,kBAAkB,CAAC,WAAW,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;QACnH,CAAC;IACH,CAAC;SAAM,IAAI,GAAG,EAAE,CAAC;QACf,UAAU,GAAG,MAAM,uBAAuB,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,CAAC;AAC3B,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- import { ApiValidationExternalApisController, ApiValidationSummary } from "@apimatic/sdk";
2
- import { SpecFile } from "../../types/portal/quickstart.js";
3
- import { PortalQuickstartPrompts } from "../../prompts/portal/quickstart.js";
4
- export declare class PortalQuickstartController {
5
- private readonly zipService;
6
- private readonly fileService;
7
- private readonly specUrl;
8
- isUserAuthenticated(configDir: string): Promise<boolean>;
9
- getSpecFile(spec: string): Promise<SpecFile>;
10
- getSpecValidationSummary(prompts: PortalQuickstartPrompts, specFile: SpecFile, apiValidationController: ApiValidationExternalApisController): Promise<ApiValidationSummary>;
11
- private downloadRepositoryFromGitHub;
12
- setupBuildDirectory(prompts: PortalQuickstartPrompts, targetFolder: string, specFile: SpecFile, validationSummary: ApiValidationSummary, languages: string[]): Promise<void>;
13
- }
@@ -1,214 +0,0 @@
1
- import axios from "axios";
2
- import * as path from "path";
3
- import filetype from "file-type";
4
- import fs from "fs";
5
- import fsExtra from "fs-extra";
6
- import { readdir } from "fs/promises";
7
- import { getAuthInfo } from "../../client-utils/auth-manager.js";
8
- import { createTempDirectory, isValidUrl, getMessageInRedColor, clearDirectory, deleteFile } from "../../utils/utils.js";
9
- import { getValidationSummary } from "../api/validate.js";
10
- import { metadataFileContent } from "../../config/env.js";
11
- import { ZipService } from "../../infrastructure/zip-service.js";
12
- import { FilePath } from "../../types/file/filePath.js";
13
- import { DirectoryPath } from "../../types/file/directoryPath.js";
14
- import { FileName } from "../../types/file/fileName.js";
15
- import { withDirPath } from "../../infrastructure/tmp-extensions.js";
16
- import { FileService } from "../../infrastructure/file-service.js";
17
- export class PortalQuickstartController {
18
- constructor() {
19
- this.zipService = new ZipService();
20
- this.fileService = new FileService();
21
- this.specUrl = "https://github.com/apimatic/static-portal-workflow/blob/master/spec/openapi.json";
22
- }
23
- async isUserAuthenticated(configDir) {
24
- const storedAuth = await getAuthInfo(configDir);
25
- if (!(storedAuth === null || storedAuth === void 0 ? void 0 : storedAuth.authKey)) {
26
- return false;
27
- }
28
- return true;
29
- }
30
- async getSpecFile(spec) {
31
- const tempSpecDir = await createTempDirectory();
32
- if (spec) {
33
- let specPath = String(spec);
34
- if (isValidUrl(specPath)) {
35
- try {
36
- const response = await axios.head(specPath);
37
- if (response.headers["content-type"].includes("text/html")) {
38
- throw new Error(getMessageInRedColor(`Invalid URL. Please check the URL and ensure it points to a valid OpenAPI definition.`));
39
- }
40
- const specFile = await axios.get(specPath, { responseType: "arraybuffer" });
41
- const fileName = path.basename(specPath);
42
- const filePath = path.join(tempSpecDir, fileName);
43
- await fsExtra.writeFile(filePath, specFile.data);
44
- }
45
- catch (error) {
46
- if (axios.isAxiosError(error)) {
47
- if (error.response) {
48
- if (error.response.status === 404) {
49
- throw new Error(getMessageInRedColor(`Unable to download the API Definition. The server returned a 404 Not Found error. Please verify that the provided URL is correct and publicly accessible.`));
50
- }
51
- else {
52
- throw new Error(getMessageInRedColor(`Unable to download the API Definition. The server returned ${error.response.status} ${error.response.statusText}`));
53
- }
54
- }
55
- else if (error.request) {
56
- if (error.code === "ECONNABORTED") {
57
- throw new Error(getMessageInRedColor(`Unable to download the API Definition, your request timed out. Please check your internet connection and try again, or contact APIMatic support for help if your problem persists.`));
58
- }
59
- else if (error.code === "ENOTFOUND" || error.code === "ERR_NETWORK") {
60
- throw new Error(getMessageInRedColor(`Failed to download the API Definition file due to network issues. Please check your internet connection and try again.`));
61
- }
62
- else {
63
- throw new Error(getMessageInRedColor(`Failed to download the API Definition file, no response was received from the server. Please try again later.`));
64
- }
65
- }
66
- else {
67
- throw new Error(getMessageInRedColor(`Failed to download API Definition: ${error.message}`));
68
- }
69
- }
70
- else {
71
- throw new Error(getMessageInRedColor(`Unable to save API Definition : ${error instanceof Error ? error.message : "Unknown error"}`));
72
- }
73
- }
74
- }
75
- else {
76
- specPath = path.normalize(specPath);
77
- const fileType = await filetype.fromFile(specPath);
78
- if ((fileType === null || fileType === void 0 ? void 0 : fileType.ext) === "zip") {
79
- await this.zipService.unArchive(new FilePath(new DirectoryPath(path.dirname(specPath)), new FileName(path.basename(specPath))), new DirectoryPath(tempSpecDir));
80
- }
81
- else {
82
- const destinationPath = path.join(tempSpecDir, path.basename(specPath));
83
- await fsExtra.copy(specPath, destinationPath);
84
- }
85
- }
86
- }
87
- return { localPath: tempSpecDir, url: this.specUrl };
88
- }
89
- async getSpecValidationSummary(prompts, specFile, apiValidationController) {
90
- const validationFlags = {
91
- file: specFile.localPath,
92
- url: specFile.url
93
- };
94
- try {
95
- const validationSummary = await getValidationSummary(validationFlags, apiValidationController);
96
- return validationSummary;
97
- }
98
- catch (error) {
99
- prompts.displaySpecValidationErrorMessage();
100
- if (axios.isAxiosError(error)) {
101
- if (error.response) {
102
- if (error.response.status === 400) {
103
- throw new Error(getMessageInRedColor(`The provided spec file is not valid. Please ensure that the spec you have provided is a valid API definition file.`));
104
- }
105
- else if (error.response.status === 500) {
106
- throw new Error(getMessageInRedColor(`The server encountered an error while validating your spec file, please try again later. If the issue persists, contact our team at support@apimatic.io`));
107
- }
108
- else {
109
- throw new Error(getMessageInRedColor(`Something went wrong while validating your spec file. The server returned the following error ${error.response.status} ${error.response.statusText}. Please try again later. If the issue persists, contact our team at support@apimatic.io`));
110
- }
111
- }
112
- else if (error.request) {
113
- if (error.code === "ECONNABORTED") {
114
- throw new Error(getMessageInRedColor(`The spec validation request timed out. Please try again.`));
115
- }
116
- else if (error.code === "ENOTFOUND" || error.code === "ERR_NETWORK") {
117
- throw new Error(getMessageInRedColor(`Network error encountered while validating the spec file. Please check your connection and try again.`));
118
- }
119
- else {
120
- throw new Error(getMessageInRedColor(`Something went wrong while validating the spec file, please try again. If the issue persists, reach out to our support team at support@apimatic.io`));
121
- }
122
- }
123
- else {
124
- throw new Error(getMessageInRedColor(`Failed to validate spec file: ${error.message}`));
125
- }
126
- }
127
- else if (error.result) {
128
- const apiError = error;
129
- if (error.body && apiError.statusCode === 401) {
130
- throw new Error("You are not authorized to perform this action.");
131
- }
132
- else {
133
- throw new Error(error.message);
134
- }
135
- }
136
- else if (error.statusCode === 401) {
137
- throw new Error("You are not authorized to perform this action.");
138
- }
139
- else if (error.statusCode === 402 &&
140
- error.body &&
141
- typeof error.body === "string") {
142
- throw new Error(error.body);
143
- }
144
- else {
145
- throw new Error(getMessageInRedColor(`Something went wrong while validating the spec file, please try again later. If the issue persists, contact our team at support@apimatic.io`));
146
- }
147
- }
148
- }
149
- async downloadRepositoryFromGitHub(targetFolder) {
150
- return await withDirPath(async (tempDirectory) => {
151
- const zipUrl = `https://github.com/apimatic/static-portal-workflow/archive/refs/heads/master.zip`;
152
- const response = await fetch(zipUrl);
153
- const repositoryFolderName = "static-portal-workflow-master";
154
- if (!response.ok) {
155
- throw new Error(`Unable to setup your portal, please try again later.`);
156
- }
157
- const arrayBuffer = await response.arrayBuffer();
158
- const tempZipPath = new FilePath(tempDirectory, new FileName("static-repo.zip"));
159
- await this.fileService.writeBuffer(tempZipPath, Buffer.from(arrayBuffer));
160
- await this.zipService.unArchive(tempZipPath, tempDirectory);
161
- const extractedFolderPath = new DirectoryPath(tempDirectory.toString(), repositoryFolderName);
162
- await this.fileService.copyDirectoryContents(extractedFolderPath, new DirectoryPath(targetFolder));
163
- });
164
- }
165
- async setupBuildDirectory(prompts, targetFolder, specFile, validationSummary, languages) {
166
- fsExtra.emptyDirSync(targetFolder);
167
- try {
168
- await this.downloadRepositoryFromGitHub(targetFolder);
169
- }
170
- catch (error) {
171
- prompts.displayBuildDirectoryGenerationErrorMessage();
172
- if (error instanceof Error) {
173
- if (error.message.includes("timed out") || error.message.includes("timeout")) {
174
- throw new Error(getMessageInRedColor("The operation timed out while setting up the build directory. Please check your internet connection and try again."));
175
- }
176
- else if (error.message.includes("Could not resolve host")) {
177
- throw new Error(getMessageInRedColor("Unable to resolve the host. Please check your network settings and try again."));
178
- }
179
- else {
180
- throw new Error(getMessageInRedColor(`Failed to set up the build directory. ${error.message}`));
181
- }
182
- }
183
- else {
184
- throw new Error(getMessageInRedColor(`Failed to set up the build directory. ${error}`));
185
- }
186
- }
187
- await clearDirectory(path.join(targetFolder, ".github"));
188
- if (specFile.localPath && validationSummary.success) {
189
- const specFolder = path.join(targetFolder, "spec");
190
- await deleteFile(path.join(specFolder, "openapi.json"));
191
- const files = await readdir(specFile.localPath);
192
- for (const file of files) {
193
- const srcPath = path.join(specFile.localPath, file);
194
- const destPath = path.join(specFolder, file);
195
- await fsExtra.copy(srcPath, destPath);
196
- }
197
- }
198
- const buildFilePath = path.join(targetFolder, "APIMATIC-BUILD.json");
199
- const buildFileContent = JSON.parse(fs.readFileSync(buildFilePath, "utf8"));
200
- const languageConfig = languages.reduce((config, lang) => {
201
- config[lang] = {};
202
- return config;
203
- }, {});
204
- buildFileContent.generatePortal.languageConfig = languageConfig;
205
- fs.writeFileSync(buildFilePath, JSON.stringify(buildFileContent, null, 2));
206
- const specFolder = path.join(targetFolder, "spec");
207
- const metadataFile = fs.readdirSync(specFolder).find((file) => file.startsWith("APIMATIC-META"));
208
- if (!metadataFile) {
209
- const newMetadataFilePath = path.join(specFolder, "APIMATIC-META.json");
210
- fs.writeFileSync(newMetadataFilePath, JSON.stringify(metadataFileContent, null, 2));
211
- }
212
- }
213
- }
214
- //# sourceMappingURL=quickstart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../../src/controllers/portal/quickstart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGjE,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,oBAAoB,EACpB,cAAc,EACd,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EA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a,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC;QACrE,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;QAE5E,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;YACvD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,EAA+B,CAAC,CAAC;QAEpC,gBAAgB,CAAC,cAAc,CAAC,cAAc,GAAG,cAAc,CAAC;QAEhE,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAE3E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAEnD,MAAM,YAAY,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;QAEjG,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;YACxE,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;CACF"}
@@ -1,6 +0,0 @@
1
- import { Client } from "@apimatic/sdk";
2
- import { AuthInfo } from "../client-utils/auth-manager.js";
3
- export declare function createAuthorizationHeader(authInfo: AuthInfo | null, overrideAuthKey: string | null): string;
4
- export declare function createApiClient(authorizationHeader: string, timeout: number): Client;
5
- export declare function createProductionApiClient(authorizationHeader: string, timeout: number): Client;
6
- export declare function createTestingApiClient(authorizationHeader: string, timeout: number): Client;
@@ -1,34 +0,0 @@
1
- import { Client, Environment } from "@apimatic/sdk";
2
- import { envInfo } from "./env-info.js";
3
- export function createAuthorizationHeader(authInfo, overrideAuthKey) {
4
- const key = overrideAuthKey || (authInfo === null || authInfo === void 0 ? void 0 : authInfo.authKey);
5
- return `X-Auth-Key ${key !== null && key !== void 0 ? key : ""}`;
6
- }
7
- export function createApiClient(authorizationHeader, timeout) {
8
- if (envInfo.getBaseUrl()) {
9
- return createTestingApiClient(authorizationHeader, timeout);
10
- }
11
- return createProductionApiClient(authorizationHeader, timeout);
12
- }
13
- export function createProductionApiClient(authorizationHeader, timeout) {
14
- return new Client({
15
- customHeaderAuthenticationCredentials: {
16
- Authorization: authorizationHeader
17
- },
18
- userAgent: envInfo.getUserAgent(),
19
- timeout: timeout,
20
- environment: Environment.Production
21
- });
22
- }
23
- export function createTestingApiClient(authorizationHeader, timeout) {
24
- return new Client({
25
- customHeaderAuthenticationCredentials: {
26
- Authorization: authorizationHeader
27
- },
28
- userAgent: envInfo.getUserAgent(),
29
- timeout: timeout,
30
- environment: Environment.Testing,
31
- customUrl: envInfo.getBaseUrl()
32
- });
33
- }
34
- //# sourceMappingURL=api-client-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-client-utils.js","sourceRoot":"","sources":["../../src/infrastructure/api-client-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,UAAU,yBAAyB,CAAC,QAAyB,EAAE,eAA8B;IACjG,MAAM,GAAG,GAAG,eAAe,KAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,CAAA,CAAC;IACjD,OAAO,cAAc,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,mBAA2B,EAAE,OAAe;IAC1E,IAAI,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QACzB,OAAO,sBAAsB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,yBAAyB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,mBAA2B,EAAE,OAAe;IACpF,OAAO,IAAI,MAAM,CAAC;QAChB,qCAAqC,EAAE;YACrC,aAAa,EAAE,mBAAmB;SACnC;QACD,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE;QACjC,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW,CAAC,UAAU;KACpC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,mBAA2B,EAAE,OAAe;IACjF,OAAO,IAAI,MAAM,CAAC;QAChB,qCAAqC,EAAE;YACrC,aAAa,EAAE,mBAAmB;SACnC;QACD,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE;QACjC,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,WAAW,CAAC,OAAO;QAChC,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE;KAChC,CAAC,CAAC;AACL,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare abstract class BasePrompts {
2
- protected readonly spin: import("@clack/prompts").SpinnerResult;
3
- startProgressIndicator(message: string): void;
4
- stopProgressIndicator(message: string): void;
5
- displayInfo(message: string): void;
6
- logError(errorMessage: string): void;
7
- }
@@ -1,19 +0,0 @@
1
- import { log, spinner } from "@clack/prompts";
2
- export class BasePrompts {
3
- constructor() {
4
- this.spin = spinner();
5
- }
6
- startProgressIndicator(message) {
7
- this.spin.start(message);
8
- }
9
- stopProgressIndicator(message) {
10
- this.spin.stop(message);
11
- }
12
- displayInfo(message) {
13
- log.step(message);
14
- }
15
- logError(errorMessage) {
16
- log.error(errorMessage);
17
- }
18
- }
19
- //# sourceMappingURL=base-prompts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-prompts.js","sourceRoot":"","sources":["../../../../src/prompts/portal/common/base-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,OAAgB,WAAW;IAAjC;QACuB,SAAI,GAAG,OAAO,EAAE,CAAC;IAiBxC,CAAC;IAfU,sBAAsB,CAAC,OAAe;QACzC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEM,qBAAqB,CAAC,OAAe;QACxC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAEM,WAAW,CAAC,OAAe;QAC9B,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAEM,QAAQ,CAAC,YAAoB;QAChC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;CACJ"}
@@ -1,12 +0,0 @@
1
- export type GetValidationParams = {
2
- file: string;
3
- url: string;
4
- };
5
- export type APIValidateError = {
6
- modelState: {
7
- "exception Error": string[];
8
- };
9
- };
10
- export type AuthorizationError = {
11
- body: string;
12
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/types/api/validate.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- export declare class Result<T, TError> {
2
- private readonly Status;
3
- readonly value?: T | undefined;
4
- readonly error?: TError | undefined;
5
- private constructor();
6
- static success<T, TError>(value: T): Result<T, TError>;
7
- static failure<T, TError>(error: TError): Result<T, TError>;
8
- static cancelled<T, TError>(value: T): Result<T, TError>;
9
- isFailed(): boolean;
10
- isCancelled(): boolean;
11
- isSuccess(): boolean;
12
- }
13
- export declare enum ResultStatus {
14
- Success = 0,
15
- Failed = 1,
16
- Cancelled = 2
17
- }
@@ -1,32 +0,0 @@
1
- export class Result {
2
- constructor(Status, value, error) {
3
- this.Status = Status;
4
- this.value = value;
5
- this.error = error;
6
- }
7
- static success(value) {
8
- return new Result(ResultStatus.Success, value, undefined);
9
- }
10
- static failure(error) {
11
- return new Result(ResultStatus.Failed, undefined, error);
12
- }
13
- static cancelled(value) {
14
- return new Result(ResultStatus.Cancelled, value, undefined);
15
- }
16
- isFailed() {
17
- return this.Status == ResultStatus.Failed;
18
- }
19
- isCancelled() {
20
- return this.Status == ResultStatus.Cancelled;
21
- }
22
- isSuccess() {
23
- return this.Status == ResultStatus.Success;
24
- }
25
- }
26
- export var ResultStatus;
27
- (function (ResultStatus) {
28
- ResultStatus[ResultStatus["Success"] = 0] = "Success";
29
- ResultStatus[ResultStatus["Failed"] = 1] = "Failed";
30
- ResultStatus[ResultStatus["Cancelled"] = 2] = "Cancelled";
31
- })(ResultStatus || (ResultStatus = {}));
32
- //# sourceMappingURL=result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/types/common/result.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,MAAM;IACjB,YACmB,MAAoB,EACrB,KAAS,EACT,KAAc;QAFb,WAAM,GAAN,MAAM,CAAc;QACrB,UAAK,GAAL,KAAK,CAAI;QACT,UAAK,GAAL,KAAK,CAAS;IAC7B,CAAC;IAEG,MAAM,CAAC,OAAO,CAAY,KAAQ;QACvC,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,MAAM,CAAC,OAAO,CAAY,KAAa;QAC5C,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAEM,MAAM,CAAC,SAAS,CAAY,KAAQ;QACzC,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC;IAC5C,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,SAAS,CAAC;IAC/C,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,OAAO,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,yDAAS,CAAA;AACX,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
@@ -1,13 +0,0 @@
1
- export interface GeneratePortalParams {
2
- readonly sourceBuildInputZipFilePath: string;
3
- readonly generatedPortalArtifactsFolderPath: string;
4
- readonly generatedPortalArtifactsZipFilePath: string;
5
- readonly overrideAuthKey: string | null;
6
- readonly generateZipFile: boolean;
7
- }
8
- export interface ErrorResponse {
9
- readonly title: string;
10
- readonly detail?: string;
11
- readonly errors: Record<string, string[]>;
12
- readonly message?: string;
13
- }
@@ -1,3 +0,0 @@
1
- ;
2
- export {};
3
- //# sourceMappingURL=generate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/portal/generate.ts"],"names":[],"mappings":"AAMC,CAAC"}
@@ -1,17 +0,0 @@
1
- export type LoginCredentials = {
2
- email: string;
3
- password: string;
4
- };
5
- export type SpecFile = {
6
- localPath: string;
7
- url: string;
8
- };
9
- export type PortalServerConfig = {
10
- generatedPortalPath: string;
11
- sourceDirectoryPath: string;
12
- configDir: string;
13
- authKey: string | null;
14
- ignoredPaths?: string[];
15
- port?: number;
16
- openInBrowser?: boolean;
17
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=quickstart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../../src/types/portal/quickstart.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- export interface ServeFlags {
2
- readonly port: number;
3
- readonly folder: string;
4
- readonly destination: string;
5
- readonly open: boolean;
6
- readonly "auth-key": string | undefined;
7
- readonly "no-reload": boolean;
8
- }
9
- export interface ServePaths {
10
- readonly sourceDirectoryPath: string;
11
- readonly destinationDirectoryPath: string;
12
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=serve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/types/portal/serve.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { Result } from "../../types/common/result.js";
2
- export declare class DirectoryValidator {
3
- validateSourceDirectory(sourceDir: string): Result<string, string>;
4
- private getDirectoryItems;
5
- }