@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
@@ -1 +1 @@
1
- {"version":3,"file":"portal-context.js","sourceRoot":"","sources":["../../src/types/portal-context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,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
@@ -2,21 +2,10 @@ export declare enum StepType {
2
2
  Content = "content",
3
3
  Endpoint = "endpoint"
4
4
  }
5
- export interface RecipeContext {
6
- showContent(content: string): Promise<any>;
7
- showEndpoint(config: EndpointConfig): Promise<any>;
8
- }
9
5
  export interface EndpointConfig {
10
6
  description: string;
11
7
  endpointPermalink: string;
12
8
  }
13
- export interface StepConfig {
14
- name: string;
15
- stepCallback: () => Promise<any>;
16
- }
17
- export interface RecipeDefinition {
18
- [stepKey: string]: StepConfig;
19
- }
20
9
  export interface SerializableRecipe {
21
10
  name: string;
22
11
  steps: SerializableStep[];
@@ -24,14 +13,10 @@ export interface SerializableRecipe {
24
13
  export interface SerializableStep {
25
14
  key: string;
26
15
  name: string;
27
- type: "content" | "endpoint";
16
+ type: StepType;
28
17
  config: ContentStepConfig | EndpointStepConfig;
29
18
  }
30
19
  export interface ContentStepConfig {
31
20
  content: string;
32
21
  }
33
- export interface EndpointStepConfig extends EndpointConfig {
34
- }
35
- export interface DirectoryNode {
36
- [key: string]: DirectoryNode | string | null | undefined;
37
- }
22
+ export type EndpointStepConfig = EndpointConfig;
@@ -0,0 +1,8 @@
1
+ import { FileName } from "./file/fileName.js";
2
+ import { Toc } from "./toc/toc.js";
3
+ export declare class RecipeContext {
4
+ private readonly recipeName;
5
+ constructor(recipeName: string);
6
+ getRecipeName(): FileName;
7
+ exists(tocData: Toc, recipeName: string, recipeFileName: FileName): boolean;
8
+ }
@@ -0,0 +1,21 @@
1
+ import { toPascalCase } from "../utils/utils.js";
2
+ import { FileName } from "./file/fileName.js";
3
+ export class RecipeContext {
4
+ constructor(recipeName) {
5
+ this.recipeName = recipeName;
6
+ }
7
+ getRecipeName() {
8
+ return new FileName(toPascalCase(this.recipeName.trim()) + `.js`);
9
+ }
10
+ exists(tocData, recipeName, recipeFileName) {
11
+ var _a;
12
+ let apiRecipesGroup = (_a = tocData.toc) === null || _a === void 0 ? void 0 : _a.find((item) => "group" in item && item.group === "API Recipes");
13
+ if (!apiRecipesGroup || !("items" in apiRecipesGroup)) {
14
+ return false;
15
+ }
16
+ // Check if the recipe name or file name already exists
17
+ const existingRecipe = apiRecipesGroup.items.find((item) => "page" in item && "file" in item && (item.page === recipeName || item.file === `recipes/${recipeFileName}.md`));
18
+ return !!existingRecipe;
19
+ }
20
+ }
21
+ //# sourceMappingURL=recipe-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe-context.js","sourceRoot":"","sources":["../../src/types/recipe-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,OAAO,aAAa;IACxB,YAA6B,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAEnD,aAAa;QACX,OAAO,IAAI,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,OAAY,EAAE,UAAkB,EAAE,cAAwB;;QAC/D,IAAI,eAAe,GAAG,MAAA,OAAO,CAAC,GAAG,0CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC;QACnG,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,OAAO,IAAI,eAAe,CAAC,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,uDAAuD;QACvD,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAC/C,CAAC,IAAI,EAAE,EAAE,CACP,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,cAAc,KAAK,CAAC,CACjH,CAAC;QACF,OAAO,CAAC,CAAC,cAAc,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { Result } from "neverthrow";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { DirectoryPath } from "./file/directoryPath.js";
4
+ import { ResourceInput } from "./file/resource-input.js";
5
+ import { ServiceError } from "../infrastructure/api-utils.js";
6
+ export declare class ResourceContext {
7
+ private readonly tempDirectory;
8
+ private readonly fileDownloadService;
9
+ private readonly fileService;
10
+ constructor(tempDirectory: DirectoryPath);
11
+ resolveTo(resourcePath: ResourceInput): Promise<Result<FilePath, ServiceError>>;
12
+ }
@@ -0,0 +1,30 @@
1
+ import * as path from "path";
2
+ import { err, ok } from "neverthrow";
3
+ import { UrlPath } from "./file/urlPath.js";
4
+ import { FilePath } from "./file/filePath.js";
5
+ import { FileName } from "./file/fileName.js";
6
+ import { FileDownloadService } from "../infrastructure/services/file-download-service.js";
7
+ import { FileService } from "../infrastructure/file-service.js";
8
+ export class ResourceContext {
9
+ constructor(tempDirectory) {
10
+ this.tempDirectory = tempDirectory;
11
+ this.fileDownloadService = new FileDownloadService();
12
+ this.fileService = new FileService();
13
+ }
14
+ async resolveTo(resourcePath) {
15
+ const fileName = new FileName(path.basename(resourcePath.toString()));
16
+ const destinationFilePath = new FilePath(this.tempDirectory, fileName);
17
+ if (resourcePath instanceof UrlPath) {
18
+ const downloadFileResult = await this.fileDownloadService.downloadFile(resourcePath);
19
+ if (downloadFileResult.isErr()) {
20
+ return err(downloadFileResult.error);
21
+ }
22
+ await this.fileService.writeFile(destinationFilePath, downloadFileResult.value.stream);
23
+ }
24
+ if (resourcePath instanceof FilePath) {
25
+ await this.fileService.copy(resourcePath, destinationFilePath);
26
+ }
27
+ return ok(destinationFilePath);
28
+ }
29
+ }
30
+ //# sourceMappingURL=resource-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-context.js","sourceRoot":"","sources":["../../src/types/resource-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAIhE,MAAM,OAAO,eAAe;IAI1B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAHxC,wBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;QAChD,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAEW,CAAC;IAEtD,KAAK,CAAC,SAAS,CAAC,YAA2B;QAChD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,mBAAmB,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAEvE,IAAI,YAAY,YAAY,OAAO,EAAE,CAAC;YACpC,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YACrF,IAAI,kBAAkB,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC/B,OAAO,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YACvC,CAAC;YACD,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzF,CAAC;QACD,IAAI,YAAY,YAAY,QAAQ,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;QACjE,CAAC;QACD,OAAO,EAAE,CAAC,mBAAmB,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1,18 +1,4 @@
1
- export type GenerationIdParams = {
2
- file: string;
3
- url: string;
4
- platform: string;
5
- };
6
- export type DownloadSDKParams = {
7
- codeGenId: string;
8
- zip: boolean;
9
- zippedSDKPath: string;
10
- sdkFolderPath: string;
11
- };
12
- export type SDKGenerateUnprocessableError = {
13
- message: string;
14
- };
15
- export declare enum LanguagePlatform {
1
+ export declare enum Language {
16
2
  CSHARP = "csharp",
17
3
  JAVA = "java",
18
4
  PHP = "php",
@@ -21,3 +7,4 @@ export declare enum LanguagePlatform {
21
7
  TYPESCRIPT = "typescript",
22
8
  GO = "go"
23
9
  }
10
+ export declare function mapLanguages(languageFlag: number): Language[];
@@ -1,11 +1,25 @@
1
- export var LanguagePlatform;
2
- (function (LanguagePlatform) {
3
- LanguagePlatform["CSHARP"] = "csharp";
4
- LanguagePlatform["JAVA"] = "java";
5
- LanguagePlatform["PHP"] = "php";
6
- LanguagePlatform["PYTHON"] = "python";
7
- LanguagePlatform["RUBY"] = "ruby";
8
- LanguagePlatform["TYPESCRIPT"] = "typescript";
9
- LanguagePlatform["GO"] = "go";
10
- })(LanguagePlatform || (LanguagePlatform = {}));
1
+ export var Language;
2
+ (function (Language) {
3
+ Language["CSHARP"] = "csharp";
4
+ Language["JAVA"] = "java";
5
+ Language["PHP"] = "php";
6
+ Language["PYTHON"] = "python";
7
+ Language["RUBY"] = "ruby";
8
+ Language["TYPESCRIPT"] = "typescript";
9
+ Language["GO"] = "go";
10
+ })(Language || (Language = {}));
11
+ const languageMap = {
12
+ 1: Language.CSHARP,
13
+ 2: Language.GO,
14
+ 4: Language.JAVA,
15
+ 8: Language.PHP,
16
+ 16: Language.PYTHON,
17
+ 32: Language.RUBY,
18
+ 128: Language.TYPESCRIPT,
19
+ };
20
+ export function mapLanguages(languageFlag) {
21
+ return Object.entries(languageMap)
22
+ .filter(([flag]) => (languageFlag & parseInt(flag)) !== 0)
23
+ .map(([, language]) => language);
24
+ }
11
25
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,6CAAyB,CAAA;IACzB,6BAAS,CAAA;AACX,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B"}
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,uBAAW,CAAA;IACX,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,qCAAyB,CAAA;IACzB,qBAAS,CAAA;AACX,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,WAAW,GAAgC;IAC/C,CAAC,EAAE,QAAQ,CAAC,MAAM;IAClB,CAAC,EAAE,QAAQ,CAAC,EAAE;IACd,CAAC,EAAE,QAAQ,CAAC,IAAI;IAChB,CAAC,EAAE,QAAQ,CAAC,GAAG;IACf,EAAE,EAAE,QAAQ,CAAC,MAAM;IACnB,EAAE,EAAE,QAAQ,CAAC,IAAI;IACjB,GAAG,EAAE,QAAQ,CAAC,UAAU;CACzB,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,YAAoB;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { DirectoryPath } from "./file/directoryPath.js";
2
2
  import { FilePath } from "./file/filePath.js";
3
- import { LanguagePlatform } from "./sdk/generate.js";
3
+ import { Language } from "./sdk/generate.js";
4
4
  export declare class SdkContext {
5
5
  private readonly sdkDirectory;
6
- private readonly platform;
6
+ private readonly language;
7
7
  private readonly fileService;
8
8
  private readonly zipService;
9
- constructor(sdkDirectory: DirectoryPath, platform: LanguagePlatform);
10
- get ZipPath(): FilePath;
9
+ constructor(sdkDirectory: DirectoryPath, language: Language);
10
+ private get zipPath();
11
+ get sdkLanguageDirectory(): DirectoryPath;
11
12
  exists(): Promise<boolean>;
12
- save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
13
+ save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<DirectoryPath>;
13
14
  }
@@ -3,26 +3,30 @@ import { FilePath } from "./file/filePath.js";
3
3
  import { FileName } from "./file/fileName.js";
4
4
  import { ZipService } from "../infrastructure/zip-service.js";
5
5
  export class SdkContext {
6
- constructor(sdkDirectory, platform) {
6
+ constructor(sdkDirectory, language) {
7
7
  this.sdkDirectory = sdkDirectory;
8
- this.platform = platform;
8
+ this.language = language;
9
9
  this.fileService = new FileService();
10
10
  this.zipService = new ZipService();
11
11
  }
12
- get ZipPath() {
13
- return new FilePath(this.sdkDirectory, new FileName(`${this.platform}.zip`));
12
+ get zipPath() {
13
+ return new FilePath(this.sdkLanguageDirectory, new FileName(`${this.language}.zip`));
14
+ }
15
+ get sdkLanguageDirectory() {
16
+ return this.sdkDirectory.join(this.language);
14
17
  }
15
18
  async exists() {
16
- return !await this.fileService.directoryEmpty(this.sdkDirectory);
19
+ return !(await this.fileService.directoryEmpty(this.sdkLanguageDirectory));
17
20
  }
18
21
  async save(tempPortalFilePath, zipPortal) {
19
- await this.fileService.cleanDirectory(this.sdkDirectory);
22
+ await this.fileService.cleanDirectory(this.sdkLanguageDirectory);
20
23
  if (zipPortal) {
21
- await this.fileService.copy(tempPortalFilePath, this.ZipPath);
24
+ await this.fileService.copy(tempPortalFilePath, this.zipPath);
22
25
  }
23
26
  else {
24
- await this.zipService.unArchive(tempPortalFilePath, this.sdkDirectory);
27
+ await this.zipService.unArchive(tempPortalFilePath, this.sdkLanguageDirectory);
25
28
  }
29
+ return this.sdkLanguageDirectory;
26
30
  }
27
31
  }
28
32
  //# sourceMappingURL=sdk-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-context.js","sourceRoot":"","sources":["../../src/types/sdk-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9D,MAAM,OAAO,UAAU;IAKrB,YAA6B,YAA2B,EACrC,QAA0B;QADhB,iBAAY,GAAZ,YAAY,CAAe;QACrC,aAAQ,GAAR,QAAQ,CAAkB;QAJ5B,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAI/C,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC;IA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,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC7E,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjE,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACnC,CAAC;CACF"}
@@ -1,3 +1,9 @@
1
+ import { TocEndpoint, TocModel } from "../toc/toc.js";
2
+ export type EndpointGroup = Map<string, TocEndpoint[]>;
3
+ export type SdlTocComponents = {
4
+ endpointGroups: EndpointGroup;
5
+ models: TocModel[];
6
+ };
1
7
  export interface Sdl {
2
8
  readonly Endpoints: SdlEndpoint[];
3
9
  readonly CustomTypes: SdlModel[];
@@ -10,3 +16,6 @@ export interface SdlEndpoint {
10
16
  export interface SdlModel {
11
17
  readonly Name: string;
12
18
  }
19
+ export declare function getEndpointGroupsAndModels(sdl: Sdl): SdlTocComponents;
20
+ export declare function getEndpointDescription(endpointGroups: Map<string, SdlEndpoint[]>, endpointGroupName: string, endpointName: string): string;
21
+ export declare function getEndpointGroupsFromSdl(sdl: Sdl): Map<string, SdlEndpoint[]>;
@@ -1,2 +1,47 @@
1
- export {};
1
+ function extractEndpointGroupsForToc(sdl) {
2
+ const endpointGroups = new Map();
3
+ const endpoints = sdl.Endpoints.map((e) => ({
4
+ generate: null,
5
+ from: "endpoint",
6
+ endpointName: e.Name,
7
+ endpointGroup: e.Group
8
+ }));
9
+ endpoints.forEach((endpoint) => {
10
+ const group = endpoint.endpointGroup;
11
+ if (!endpointGroups.has(group)) {
12
+ endpointGroups.set(group, []);
13
+ }
14
+ endpointGroups.get(group).push(endpoint);
15
+ });
16
+ return endpointGroups;
17
+ }
18
+ function extractModelsForToc(sdl) {
19
+ return sdl.CustomTypes.map((e) => ({
20
+ generate: null,
21
+ from: "model",
22
+ modelName: e.Name
23
+ }));
24
+ }
25
+ export function getEndpointGroupsAndModels(sdl) {
26
+ const endpointGroups = extractEndpointGroupsForToc(sdl);
27
+ const models = extractModelsForToc(sdl);
28
+ return { endpointGroups, models };
29
+ }
30
+ export function getEndpointDescription(endpointGroups, endpointGroupName, endpointName) {
31
+ return endpointGroups.get(endpointGroupName).find((e) => e.Name === endpointName).Description;
32
+ }
33
+ export function getEndpointGroupsFromSdl(sdl) {
34
+ const endpointGroups = new Map();
35
+ for (const endpoint of sdl.Endpoints) {
36
+ if (!endpointGroups.has(endpoint.Group)) {
37
+ endpointGroups.set(endpoint.Group, []);
38
+ }
39
+ endpointGroups.get(endpoint.Group).push({
40
+ Name: endpoint.Name,
41
+ Description: endpoint.Description,
42
+ Group: endpoint.Group
43
+ });
44
+ }
45
+ return endpointGroups;
46
+ }
2
47
  //# sourceMappingURL=sdl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdl.js","sourceRoot":"","sources":["../../../src/types/sdl/sdl.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"sdl.js","sourceRoot":"","sources":["../../../src/types/sdl/sdl.ts"],"names":[],"mappings":"AAoBA,SAAS,2BAA2B,CAAC,GAAQ;IAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAExD,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CACjC,CAAC,CAAc,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;AAED,MAAM,UAAU,wBAAwB,CAAC,GAAQ;IAC/C,MAAM,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IACxD,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QACvC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC;YACvC,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,KAAK,EAAE,QAAQ,CAAC,KAAK;SACtB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,cAAc,CAAC;AACtB,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
2
4
  export declare class SpecContext {
3
5
  private readonly fileService;
4
6
  private readonly specDirectory;
5
7
  constructor(specDirectory: DirectoryPath);
6
8
  validate(): Promise<boolean>;
9
+ save(stream: NodeJS.ReadableStream, fileName: FileName): Promise<FilePath>;
7
10
  }
@@ -1,12 +1,17 @@
1
1
  import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
2
3
  export class SpecContext {
3
4
  constructor(specDirectory) {
4
5
  this.fileService = new FileService();
5
6
  this.specDirectory = specDirectory;
6
7
  }
7
8
  async validate() {
8
- // TODO: add more checks here
9
- return await this.fileService.directoryExists(this.specDirectory);
9
+ return !(await this.fileService.directoryEmpty(this.specDirectory));
10
+ }
11
+ async save(stream, fileName) {
12
+ const filePath = new FilePath(this.specDirectory, fileName);
13
+ await this.fileService.writeFile(filePath, stream);
14
+ return filePath;
10
15
  }
11
16
  }
12
17
  //# sourceMappingURL=spec-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,MAAM,OAAO,WAAW;IAItB,YAAY,aAA4B;QAHvB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,6BAA6B;QAC7B,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACnE,CAAC;CACF"}
1
+ {"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,MAAM,OAAO,WAAW;IAItB,YAAY,aAA4B;QAHvB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,MAA6B,EAAE,QAAkB;QAC1D,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ export declare class TempContext {
4
+ private readonly tempDirectory;
5
+ private readonly fileService;
6
+ private readonly zipService;
7
+ constructor(tempDirectory: DirectoryPath);
8
+ private get getTempFileName();
9
+ zip(buildDirectory: DirectoryPath): Promise<FilePath>;
10
+ save(portalStream: NodeJS.ReadableStream): Promise<FilePath>;
11
+ }
@@ -0,0 +1,27 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { ZipService } from "../infrastructure/zip-service.js";
3
+ import { FilePath } from "./file/filePath.js";
4
+ import { FileName } from "./file/fileName.js";
5
+ import { randomUUID } from "crypto";
6
+ export class TempContext {
7
+ constructor(tempDirectory) {
8
+ this.tempDirectory = tempDirectory;
9
+ this.fileService = new FileService();
10
+ this.zipService = new ZipService();
11
+ }
12
+ get getTempFileName() {
13
+ const uuid = randomUUID();
14
+ return new FilePath(this.tempDirectory, new FileName(`${uuid}`));
15
+ }
16
+ async zip(buildDirectory) {
17
+ const tempFile = this.getTempFileName;
18
+ await this.zipService.archive(buildDirectory, tempFile);
19
+ return tempFile;
20
+ }
21
+ async save(portalStream) {
22
+ const tempFile = this.getTempFileName;
23
+ await this.fileService.writeFile(tempFile, portalStream);
24
+ return tempFile;
25
+ }
26
+ }
27
+ //# sourceMappingURL=temp-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temp-context.js","sourceRoot":"","sources":["../../src/types/temp-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,WAAW;IAItB,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAHxC,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEa,CAAC;IAE7D,IAAY,eAAe;QACzB,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,cAA6B;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;QACtC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAAmC;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;QACtC,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { Toc } from "./toc/toc.js";
4
+ export declare class TocContext {
5
+ private readonly fileService;
6
+ private readonly tocFilePath;
7
+ constructor(tocDirectory: DirectoryPath);
8
+ get tocPath(): FilePath;
9
+ exists(): Promise<boolean>;
10
+ parseTocData(): Promise<Toc>;
11
+ save(contents: string): Promise<FilePath>;
12
+ }
@@ -0,0 +1,26 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
4
+ import { parse } from "yaml";
5
+ export class TocContext {
6
+ constructor(tocDirectory) {
7
+ this.fileService = new FileService();
8
+ this.tocFilePath = new FilePath(tocDirectory, new FileName("toc.yml"));
9
+ }
10
+ get tocPath() {
11
+ return this.tocFilePath;
12
+ }
13
+ async exists() {
14
+ return await this.fileService.fileExists(this.tocFilePath);
15
+ }
16
+ async parseTocData() {
17
+ const tocContent = await this.fileService.getContents(this.tocFilePath);
18
+ return parse(tocContent);
19
+ }
20
+ async save(contents) {
21
+ await this.fileService.ensurePathExists(this.tocFilePath);
22
+ await this.fileService.writeContents(this.tocFilePath, contents);
23
+ return this.tocPath;
24
+ }
25
+ }
26
+ //# sourceMappingURL=toc-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toc-context.js","sourceRoot":"","sources":["../../src/types/toc-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7B,MAAM,OAAO,UAAU;IAIrB,YAAY,YAA2B;QAHtB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,WAAW,GAAG,IAAI,QAAQ,CAAC,YAAY,EAAE,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC;IAEM,KAAK,CAAC,YAAY;QACvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,KAAK,CAAC,UAAU,CAAQ,CAAC;IAClC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,QAAgB;QAChC,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import { ExportFormats } from "@apimatic/sdk";
2
+ import { DirectoryPath } from "./file/directoryPath.js";
3
+ import { FilePath } from "./file/filePath.js";
4
+ export declare class TransformContext {
5
+ private readonly destinationDirectory;
6
+ private readonly fileService;
7
+ private readonly transformedApi;
8
+ constructor(specFilePath: FilePath, format: ExportFormats, destinationDirectory: DirectoryPath);
9
+ private get specPath();
10
+ exists(): Promise<boolean>;
11
+ save(stream: NodeJS.ReadableStream): Promise<FilePath>;
12
+ private parseFileName;
13
+ }
@@ -0,0 +1,30 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { getFileNameFromPath } from "../utils/utils.js";
3
+ import { DestinationFormats } from "./api/transform.js";
4
+ import { FileName } from "./file/fileName.js";
5
+ import { FilePath } from "./file/filePath.js";
6
+ export class TransformContext {
7
+ constructor(specFilePath, format, destinationDirectory) {
8
+ this.destinationDirectory = destinationDirectory;
9
+ this.fileService = new FileService();
10
+ this.transformedApi = this.parseFileName(format, specFilePath);
11
+ }
12
+ get specPath() {
13
+ return new FilePath(this.destinationDirectory, this.transformedApi);
14
+ }
15
+ async exists() {
16
+ const transformedApiPath = new FilePath(this.destinationDirectory, this.transformedApi);
17
+ return await this.fileService.fileExists(transformedApiPath);
18
+ }
19
+ async save(stream) {
20
+ await this.fileService.createDirectoryIfNotExists(this.destinationDirectory);
21
+ await this.fileService.writeFile(this.specPath, stream);
22
+ return this.specPath;
23
+ }
24
+ parseFileName(format, file) {
25
+ const destinationFileExt = DestinationFormats[format];
26
+ const destinationFilePrefix = getFileNameFromPath(file.toString());
27
+ return new FileName(`${destinationFilePrefix}_${format}.${destinationFileExt}`);
28
+ }
29
+ }
30
+ //# sourceMappingURL=transform-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-context.js","sourceRoot":"","sources":["../../src/types/transform-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,gBAAgB;IAK3B,YAAY,YAAsB,EACtB,MAAqB,EACJ,oBAAmC;QAAnC,yBAAoB,GAApB,oBAAoB,CAAe;QAN/C,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAO/C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACjE,CAAC;IAED,IAAY,QAAQ;QAClB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,MAAM,kBAAkB,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACxF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAE/D,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA6B;QAC7C,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC7E,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEO,aAAa,CAAC,MAAc,EAAE,IAAc;QAClD,MAAM,kBAAkB,GAAW,kBAAkB,CAAC,MAAyC,CAAC,CAAC;QACjG,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnE,OAAO,IAAI,QAAQ,CAAC,GAAG,qBAAqB,IAAI,MAAM,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAClF,CAAC;CACF"}
@@ -3,12 +3,3 @@ export type ValidationMessages = {
3
3
  warnings: string[];
4
4
  errors: string[];
5
5
  };
6
- export type loggers = {
7
- log: (message: string) => void;
8
- warn: (message: string) => void;
9
- error: (message: string) => void;
10
- };
11
- export type AuthenticationError = {
12
- statusCode: number;
13
- body: string;
14
- };
@@ -0,0 +1 @@
1
+ export declare const removeQuotes: (input: string) => string;
@@ -0,0 +1,10 @@
1
+ export const removeQuotes = (input) => {
2
+ const quotes = ['"', "'"];
3
+ for (const quote of quotes) {
4
+ if (input.startsWith(quote) && input.endsWith(quote) && input.length > 1) {
5
+ return removeQuotes(input.slice(1, -1)); // Recursive call
6
+ }
7
+ }
8
+ return input;
9
+ };
10
+ //# sourceMappingURL=string-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../src/utils/string-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IACpD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -1,29 +1,4 @@
1
- import { loggers, ValidationMessages } from "../types/utils.js";
2
- export declare const createTempDirectory: () => Promise<string>;
3
- export declare const clearDirectory: (folderPath: string) => Promise<void>;
4
- interface DirectoryNode {
5
- [key: string]: DirectoryNode | string | null | undefined;
6
- }
7
- export declare const directoryToJson: (dirPath: string, parentPath?: string) => DirectoryNode;
8
- export declare const isValidUrl: (input: string) => boolean;
9
- export declare const deleteFile: (filePath: string) => Promise<void>;
10
- export declare const writeFileUsingReadableStream: (stream: NodeJS.ReadableStream, destinationPath: string) => Promise<unknown>;
11
- /**
12
- * Packages local files into a ZIP archive
13
- *
14
- * @param {docsPortalFolderPath} path to portal directory.
15
- * @param {destinationZipPath} path to generated zip
16
- * return {string}
17
- */
18
- export declare const zipDirectory: (sourcePath: string, destinationPath: string) => Promise<string>;
19
1
  export declare const replaceHTML: (string: string) => string;
20
2
  export declare const getFileNameFromPath: (filePath: string) => string;
21
- export declare const printValidationMessages: ({ warnings, errors, messages }: ValidationMessages, { log, warn, error }: loggers) => void;
22
- export declare function parseStreamBodyToJson(body: NodeJS.ReadableStream): Promise<any>;
23
- export declare const getMessageInOrangeColor: (message: string) => string;
24
- export declare const getMessageInBlueColor: (message: string) => string;
25
- export declare const getMessageInCyanColor: (message: string) => string;
26
- export declare const getMessageInGreenColor: (message: string) => string;
27
- export declare const getMessageInMagentaColor: (message: string) => string;
28
- export declare const getMessageInRedColor: (message: string) => string;
29
- export {};
3
+ export declare function parseStreamBodyToJson(body: NodeJS.ReadableStream): Promise<unknown>;
4
+ export declare const toPascalCase: (str: string) => string;