@apimatic/cli 1.1.0-alpha.9 → 1.1.0-beta.10

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 (341) hide show
  1. package/README.md +443 -374
  2. package/bin/run.js +5 -0
  3. package/lib/actions/action-result.d.ts +19 -0
  4. package/lib/actions/action-result.js +70 -0
  5. package/lib/actions/action-result.js.map +1 -0
  6. package/lib/actions/api/transform.d.ts +15 -0
  7. package/lib/actions/api/transform.js +48 -0
  8. package/lib/actions/api/transform.js.map +1 -0
  9. package/lib/actions/api/validate.d.ts +14 -0
  10. package/lib/actions/api/validate.js +52 -0
  11. package/lib/actions/api/validate.js.map +1 -0
  12. package/lib/actions/auth/login.d.ts +13 -0
  13. package/lib/actions/auth/login.js +55 -0
  14. package/lib/actions/auth/login.js.map +1 -0
  15. package/lib/actions/auth/logout.d.ts +8 -0
  16. package/lib/actions/auth/logout.js +15 -0
  17. package/lib/actions/auth/logout.js.map +1 -0
  18. package/lib/actions/auth/status.d.ts +11 -0
  19. package/lib/actions/auth/status.js +26 -0
  20. package/lib/actions/auth/status.js.map +1 -0
  21. package/lib/actions/portal/copilot.d.ts +16 -0
  22. package/lib/actions/portal/copilot.js +89 -0
  23. package/lib/actions/portal/copilot.js.map +1 -0
  24. package/lib/actions/portal/generate.d.ts +11 -5
  25. package/lib/actions/portal/generate.js +60 -55
  26. package/lib/actions/portal/generate.js.map +1 -0
  27. package/lib/actions/portal/quickstart.d.ts +17 -0
  28. package/lib/actions/portal/quickstart.js +169 -0
  29. package/lib/actions/portal/quickstart.js.map +1 -0
  30. package/lib/actions/portal/recipe/new-recipe.d.ts +15 -0
  31. package/lib/actions/portal/recipe/new-recipe.js +177 -0
  32. package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
  33. package/lib/actions/portal/serve.d.ts +15 -0
  34. package/lib/actions/portal/serve.js +104 -0
  35. package/lib/actions/portal/serve.js.map +1 -0
  36. package/lib/actions/portal/toc/new-toc.d.ts +17 -13
  37. package/lib/actions/portal/toc/new-toc.js +85 -123
  38. package/lib/actions/portal/toc/new-toc.js.map +1 -0
  39. package/lib/actions/quickstart.d.ts +10 -0
  40. package/lib/actions/quickstart.js +30 -0
  41. package/lib/actions/quickstart.js.map +1 -0
  42. package/lib/actions/sdk/generate.d.ts +13 -0
  43. package/lib/actions/sdk/generate.js +77 -0
  44. package/lib/actions/sdk/generate.js.map +1 -0
  45. package/lib/actions/sdk/quickstart.d.ts +17 -0
  46. package/lib/actions/sdk/quickstart.js +171 -0
  47. package/lib/actions/sdk/quickstart.js.map +1 -0
  48. package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
  49. package/lib/application/portal/recipe/portal-recipe.js +33 -0
  50. package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
  51. package/lib/application/portal/recipe/recipe-generator.d.ts +21 -0
  52. package/lib/application/portal/recipe/recipe-generator.js +145 -0
  53. package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
  54. package/lib/application/portal/toc/toc-content-parser.d.ts +1 -1
  55. package/lib/application/portal/toc/toc-content-parser.js +9 -11
  56. package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
  57. package/lib/application/portal/toc/toc-structure-generator.d.ts +23 -2
  58. package/lib/application/portal/toc/toc-structure-generator.js +133 -66
  59. package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
  60. package/lib/client-utils/auth-manager.d.ts +7 -2
  61. package/lib/client-utils/auth-manager.js +26 -14
  62. package/lib/client-utils/auth-manager.js.map +1 -0
  63. package/lib/commands/api/transform.d.ts +10 -7
  64. package/lib/commands/api/transform.js +51 -111
  65. package/lib/commands/api/transform.js.map +1 -0
  66. package/lib/commands/api/validate.d.ts +7 -4
  67. package/lib/commands/api/validate.js +31 -74
  68. package/lib/commands/api/validate.js.map +1 -0
  69. package/lib/commands/auth/login.d.ts +3 -1
  70. package/lib/commands/auth/login.js +26 -68
  71. package/lib/commands/auth/login.js.map +1 -0
  72. package/lib/commands/auth/logout.d.ts +3 -1
  73. package/lib/commands/auth/logout.js +14 -21
  74. package/lib/commands/auth/logout.js.map +1 -0
  75. package/lib/commands/auth/status.d.ts +1 -0
  76. package/lib/commands/auth/status.js +18 -21
  77. package/lib/commands/auth/status.js.map +1 -0
  78. package/lib/commands/portal/copilot.d.ts +13 -0
  79. package/lib/commands/portal/copilot.js +34 -0
  80. package/lib/commands/portal/copilot.js.map +1 -0
  81. package/lib/commands/portal/generate.d.ts +7 -11
  82. package/lib/commands/portal/generate.js +26 -89
  83. package/lib/commands/portal/generate.js.map +1 -0
  84. package/lib/commands/portal/recipe/new.d.ts +12 -0
  85. package/lib/commands/portal/recipe/new.js +45 -0
  86. package/lib/commands/portal/recipe/new.js.map +1 -0
  87. package/lib/commands/portal/serve.d.ts +8 -8
  88. package/lib/commands/portal/serve.js +41 -125
  89. package/lib/commands/portal/serve.js.map +1 -0
  90. package/lib/commands/portal/toc/new.d.ts +8 -7
  91. package/lib/commands/portal/toc/new.js +52 -49
  92. package/lib/commands/portal/toc/new.js.map +1 -0
  93. package/lib/commands/quickstart.d.ts +9 -0
  94. package/lib/commands/quickstart.js +37 -0
  95. package/lib/commands/quickstart.js.map +1 -0
  96. package/lib/commands/sdk/generate.d.ts +10 -8
  97. package/lib/commands/sdk/generate.js +46 -131
  98. package/lib/commands/sdk/generate.js.map +1 -0
  99. package/lib/config/axios-config.js +4 -6
  100. package/lib/config/axios-config.js.map +1 -0
  101. package/lib/hooks/not-found.d.ts +3 -0
  102. package/lib/hooks/not-found.js +52 -0
  103. package/lib/hooks/not-found.js.map +1 -0
  104. package/lib/hooks/utils.d.ts +5 -0
  105. package/lib/hooks/utils.js +51 -0
  106. package/lib/hooks/utils.js.map +1 -0
  107. package/lib/index.js +2 -5
  108. package/lib/index.js.map +1 -0
  109. package/lib/infrastructure/debounce-service.d.ts +10 -0
  110. package/lib/infrastructure/debounce-service.js +55 -0
  111. package/lib/infrastructure/debounce-service.js.map +1 -0
  112. package/lib/infrastructure/env-info.d.ts +12 -0
  113. package/lib/infrastructure/env-info.js +58 -0
  114. package/lib/infrastructure/env-info.js.map +1 -0
  115. package/lib/infrastructure/file-service.d.ts +25 -0
  116. package/lib/infrastructure/file-service.js +131 -0
  117. package/lib/infrastructure/file-service.js.map +1 -0
  118. package/lib/infrastructure/launcher-service.d.ts +9 -0
  119. package/lib/infrastructure/launcher-service.js +72 -0
  120. package/lib/infrastructure/launcher-service.js.map +1 -0
  121. package/lib/infrastructure/network-service.d.ts +3 -0
  122. package/lib/infrastructure/network-service.js +7 -0
  123. package/lib/infrastructure/network-service.js.map +1 -0
  124. package/lib/infrastructure/service-error.d.ts +16 -0
  125. package/lib/infrastructure/service-error.js +49 -0
  126. package/lib/infrastructure/service-error.js.map +1 -0
  127. package/lib/infrastructure/services/api-client-factory.d.ts +6 -0
  128. package/lib/infrastructure/services/api-client-factory.js +20 -0
  129. package/lib/infrastructure/services/api-client-factory.js.map +1 -0
  130. package/lib/infrastructure/services/api-service.d.ts +13 -0
  131. package/lib/infrastructure/services/api-service.js +103 -0
  132. package/lib/infrastructure/services/api-service.js.map +1 -0
  133. package/lib/infrastructure/services/auth-service.d.ts +11 -0
  134. package/lib/infrastructure/services/auth-service.js +37 -0
  135. package/lib/infrastructure/services/auth-service.js.map +1 -0
  136. package/lib/infrastructure/services/file-download-service.d.ts +15 -0
  137. package/lib/infrastructure/services/file-download-service.js +104 -0
  138. package/lib/infrastructure/services/file-download-service.js.map +1 -0
  139. package/lib/infrastructure/services/portal-service.d.ts +15 -12
  140. package/lib/infrastructure/services/portal-service.js +152 -99
  141. package/lib/infrastructure/services/portal-service.js.map +1 -0
  142. package/lib/infrastructure/services/telemetry-service.d.ts +9 -0
  143. package/lib/infrastructure/services/telemetry-service.js +38 -0
  144. package/lib/infrastructure/services/telemetry-service.js.map +1 -0
  145. package/lib/infrastructure/services/transformation-service.d.ts +23 -0
  146. package/lib/infrastructure/services/transformation-service.js +56 -0
  147. package/lib/infrastructure/services/transformation-service.js.map +1 -0
  148. package/lib/infrastructure/services/validation-service.d.ts +43 -0
  149. package/lib/infrastructure/services/validation-service.js +142 -0
  150. package/lib/infrastructure/services/validation-service.js.map +1 -0
  151. package/lib/infrastructure/tmp-extensions.d.ts +2 -0
  152. package/lib/infrastructure/tmp-extensions.js +6 -0
  153. package/lib/infrastructure/tmp-extensions.js.map +1 -0
  154. package/lib/infrastructure/zip-service.d.ts +6 -0
  155. package/lib/infrastructure/zip-service.js +39 -0
  156. package/lib/infrastructure/zip-service.js.map +1 -0
  157. package/lib/prompts/api/transform.d.ts +11 -0
  158. package/lib/prompts/api/transform.js +29 -0
  159. package/lib/prompts/api/transform.js.map +1 -0
  160. package/lib/prompts/api/validate.d.ts +15 -0
  161. package/lib/prompts/api/validate.js +76 -0
  162. package/lib/prompts/api/validate.js.map +1 -0
  163. package/lib/prompts/auth/login.d.ts +10 -0
  164. package/lib/prompts/auth/login.js +22 -0
  165. package/lib/prompts/auth/login.js.map +1 -0
  166. package/lib/prompts/auth/logout.d.ts +3 -0
  167. package/lib/prompts/auth/logout.js +7 -0
  168. package/lib/prompts/auth/logout.js.map +1 -0
  169. package/lib/prompts/auth/status.d.ts +8 -0
  170. package/lib/prompts/auth/status.js +22 -0
  171. package/lib/prompts/auth/status.js.map +1 -0
  172. package/lib/prompts/format.d.ts +31 -0
  173. package/lib/prompts/format.js +89 -0
  174. package/lib/prompts/format.js.map +1 -0
  175. package/lib/prompts/portal/copilot.d.ts +18 -0
  176. package/lib/prompts/portal/copilot.js +82 -0
  177. package/lib/prompts/portal/copilot.js.map +1 -0
  178. package/lib/prompts/portal/generate.d.ts +13 -8
  179. package/lib/prompts/portal/generate.js +36 -53
  180. package/lib/prompts/portal/generate.js.map +1 -0
  181. package/lib/prompts/portal/quickstart.d.ts +31 -29
  182. package/lib/prompts/portal/quickstart.js +139 -185
  183. package/lib/prompts/portal/quickstart.js.map +1 -0
  184. package/lib/prompts/portal/recipe/new-recipe.d.ts +29 -0
  185. package/lib/prompts/portal/recipe/new-recipe.js +165 -0
  186. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
  187. package/lib/prompts/portal/serve.d.ts +9 -5
  188. package/lib/prompts/portal/serve.js +29 -19
  189. package/lib/prompts/portal/serve.js.map +1 -0
  190. package/lib/prompts/portal/toc/new-toc.d.ts +13 -8
  191. package/lib/prompts/portal/toc/new-toc.js +36 -36
  192. package/lib/prompts/portal/toc/new-toc.js.map +1 -0
  193. package/lib/prompts/prompt.d.ts +3 -0
  194. package/lib/prompts/prompt.js +37 -0
  195. package/lib/prompts/prompt.js.map +1 -0
  196. package/lib/prompts/quickstart.d.ts +6 -0
  197. package/lib/prompts/quickstart.js +25 -0
  198. package/lib/prompts/quickstart.js.map +1 -0
  199. package/lib/prompts/sdk/generate.d.ts +16 -0
  200. package/lib/prompts/sdk/generate.js +57 -0
  201. package/lib/prompts/sdk/generate.js.map +1 -0
  202. package/lib/prompts/sdk/quickstart.d.ts +35 -0
  203. package/lib/prompts/sdk/quickstart.js +177 -0
  204. package/lib/prompts/sdk/quickstart.js.map +1 -0
  205. package/lib/types/api/account.d.ts +10 -0
  206. package/lib/types/api/account.js +2 -0
  207. package/lib/types/api/account.js.map +1 -0
  208. package/lib/types/api/transform.d.ts +14 -25
  209. package/lib/types/api/transform.js +20 -23
  210. package/lib/types/api/transform.js.map +1 -0
  211. package/lib/types/build/build.d.ts +22 -0
  212. package/lib/types/build/build.js +7 -0
  213. package/lib/types/build/build.js.map +1 -0
  214. package/lib/types/build-context.d.ts +13 -0
  215. package/lib/types/build-context.js +33 -0
  216. package/lib/types/build-context.js.map +1 -0
  217. package/lib/types/common/command-metadata.d.ts +4 -0
  218. package/lib/types/common/command-metadata.js +2 -0
  219. package/lib/types/common/command-metadata.js.map +1 -0
  220. package/lib/types/events/domain-event.d.ts +8 -0
  221. package/lib/types/events/domain-event.js +11 -0
  222. package/lib/types/events/domain-event.js.map +1 -0
  223. package/lib/types/events/quickstart-completed.d.ts +7 -0
  224. package/lib/types/events/quickstart-completed.js +10 -0
  225. package/lib/types/events/quickstart-completed.js.map +1 -0
  226. package/lib/types/events/quickstart-initiated.d.ts +7 -0
  227. package/lib/types/events/quickstart-initiated.js +10 -0
  228. package/lib/types/events/quickstart-initiated.js.map +1 -0
  229. package/lib/types/events/recipe-creation-failed.d.ts +5 -0
  230. package/lib/types/events/recipe-creation-failed.js +8 -0
  231. package/lib/types/events/recipe-creation-failed.js.map +1 -0
  232. package/lib/types/events/toc-creation-failed.d.ts +5 -0
  233. package/lib/types/events/toc-creation-failed.js +8 -0
  234. package/lib/types/events/toc-creation-failed.js.map +1 -0
  235. package/lib/types/file/directory.d.ts +17 -0
  236. package/lib/types/file/directory.js +87 -0
  237. package/lib/types/file/directory.js.map +1 -0
  238. package/lib/types/file/directoryPath.d.ts +10 -0
  239. package/lib/types/file/directoryPath.js +26 -0
  240. package/lib/types/file/directoryPath.js.map +1 -0
  241. package/lib/types/file/fileName.d.ts +7 -0
  242. package/lib/types/file/fileName.js +21 -0
  243. package/lib/types/file/fileName.js.map +1 -0
  244. package/lib/types/file/filePath.d.ts +10 -0
  245. package/lib/types/file/filePath.js +32 -0
  246. package/lib/types/file/filePath.js.map +1 -0
  247. package/lib/types/file/resource-input.d.ts +5 -0
  248. package/lib/types/file/resource-input.js +42 -0
  249. package/lib/types/file/resource-input.js.map +1 -0
  250. package/lib/types/file/urlPath.d.ts +6 -0
  251. package/lib/types/file/urlPath.js +22 -0
  252. package/lib/types/file/urlPath.js.map +1 -0
  253. package/lib/types/flags-provider.d.ts +15 -0
  254. package/lib/types/flags-provider.js +34 -0
  255. package/lib/types/flags-provider.js.map +1 -0
  256. package/lib/types/portal-context.d.ts +13 -0
  257. package/lib/types/portal-context.js +38 -0
  258. package/lib/types/portal-context.js.map +1 -0
  259. package/lib/types/recipe/recipe.d.ts +22 -0
  260. package/lib/types/recipe/recipe.js +6 -0
  261. package/lib/types/recipe/recipe.js.map +1 -0
  262. package/lib/types/recipe-context.d.ts +9 -0
  263. package/lib/types/recipe-context.js +26 -0
  264. package/lib/types/recipe-context.js.map +1 -0
  265. package/lib/types/resource-context.d.ts +12 -0
  266. package/lib/types/resource-context.js +30 -0
  267. package/lib/types/resource-context.js.map +1 -0
  268. package/lib/types/sdk/generate.d.ts +9 -22
  269. package/lib/types/sdk/generate.js +25 -14
  270. package/lib/types/sdk/generate.js.map +1 -0
  271. package/lib/types/sdk-context.d.ts +14 -0
  272. package/lib/types/sdk-context.js +32 -0
  273. package/lib/types/sdk-context.js.map +1 -0
  274. package/lib/types/sdl/sdl.d.ts +27 -0
  275. package/lib/types/sdl/sdl.js +145 -3
  276. package/lib/types/sdl/sdl.js.map +1 -0
  277. package/lib/types/spec-context.d.ts +12 -0
  278. package/lib/types/spec-context.js +29 -0
  279. package/lib/types/spec-context.js.map +1 -0
  280. package/lib/types/temp-context.d.ts +11 -0
  281. package/lib/types/temp-context.js +27 -0
  282. package/lib/types/temp-context.js.map +1 -0
  283. package/lib/types/toc/toc.d.ts +31 -6
  284. package/lib/types/toc/toc.js +2 -10
  285. package/lib/types/toc/toc.js.map +1 -0
  286. package/lib/types/toc-context.d.ts +12 -0
  287. package/lib/types/toc-context.js +26 -0
  288. package/lib/types/toc-context.js.map +1 -0
  289. package/lib/types/transform-context.d.ts +13 -0
  290. package/lib/types/transform-context.js +30 -0
  291. package/lib/types/transform-context.js.map +1 -0
  292. package/lib/types/utils.d.ts +0 -9
  293. package/lib/types/utils.js +2 -3
  294. package/lib/types/utils.js.map +1 -0
  295. package/lib/types/versioned-build-context.d.ts +15 -0
  296. package/lib/types/versioned-build-context.js +28 -0
  297. package/lib/types/versioned-build-context.js.map +1 -0
  298. package/lib/utils/string-utils.d.ts +3 -0
  299. package/lib/utils/string-utils.js +79 -0
  300. package/lib/utils/string-utils.js.map +1 -0
  301. package/lib/utils/utils.d.ts +2 -44
  302. package/lib/utils/utils.js +14 -366
  303. package/lib/utils/utils.js.map +1 -0
  304. package/package.json +50 -31
  305. package/bin/run +0 -9
  306. package/lib/application/portal/toc/sdl-parser.d.ts +0 -13
  307. package/lib/application/portal/toc/sdl-parser.js +0 -53
  308. package/lib/client-utils/sdk-client.d.ts +0 -23
  309. package/lib/client-utils/sdk-client.js +0 -124
  310. package/lib/commands/portal/quickstart.d.ts +0 -10
  311. package/lib/commands/portal/quickstart.js +0 -79
  312. package/lib/config/env.d.ts +0 -27
  313. package/lib/config/env.js +0 -31
  314. package/lib/controllers/api/transform.d.ts +0 -5
  315. package/lib/controllers/api/transform.js +0 -56
  316. package/lib/controllers/api/validate.d.ts +0 -3
  317. package/lib/controllers/api/validate.js +0 -33
  318. package/lib/controllers/portal/generate.d.ts +0 -3
  319. package/lib/controllers/portal/generate.js +0 -110
  320. package/lib/controllers/portal/quickstart.d.ts +0 -14
  321. package/lib/controllers/portal/quickstart.js +0 -258
  322. package/lib/controllers/portal/serve.d.ts +0 -3
  323. package/lib/controllers/portal/serve.js +0 -138
  324. package/lib/controllers/sdk/generate.d.ts +0 -4
  325. package/lib/controllers/sdk/generate.js +0 -66
  326. package/lib/services/portal/server.d.ts +0 -14
  327. package/lib/services/portal/server.js +0 -101
  328. package/lib/types/api/validate.d.ts +0 -12
  329. package/lib/types/api/validate.js +0 -3
  330. package/lib/types/common/result.d.ts +0 -17
  331. package/lib/types/common/result.js +0 -36
  332. package/lib/types/portal/generate.d.ts +0 -26
  333. package/lib/types/portal/generate.js +0 -4
  334. package/lib/types/portal/quickstart.d.ts +0 -17
  335. package/lib/types/portal/quickstart.js +0 -3
  336. package/lib/validators/common/directoryValidator.d.ts +0 -9
  337. package/lib/validators/common/directoryValidator.js +0 -53
  338. package/lib/validators/common/portValidator.d.ts +0 -5
  339. package/lib/validators/common/portValidator.js +0 -20
  340. package/lib/validators/portal/serveValidator.d.ts +0 -6
  341. package/lib/validators/portal/serveValidator.js +0 -21
@@ -0,0 +1,6 @@
1
+ export declare class UrlPath {
2
+ private readonly url;
3
+ constructor(url: string);
4
+ static create(url: string): UrlPath | undefined;
5
+ toString(): string;
6
+ }
@@ -0,0 +1,22 @@
1
+ import { URL } from "url";
2
+ export class UrlPath {
3
+ constructor(url) {
4
+ this.url = url;
5
+ }
6
+ static create(url) {
7
+ try {
8
+ const parsed = new URL(url);
9
+ if (["http:", "https:"].includes(parsed.protocol)) {
10
+ return new UrlPath(url);
11
+ }
12
+ }
13
+ catch (_a) {
14
+ // Not a valid URL
15
+ }
16
+ return undefined;
17
+ }
18
+ toString() {
19
+ return this.url;
20
+ }
21
+ }
22
+ //# sourceMappingURL=urlPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlPath.js","sourceRoot":"","sources":["../../../src/types/file/urlPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,OAAO,OAAO;IAGlB,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,GAAW;QAC9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,WAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ export declare class FlagsProvider {
2
+ private static readonly inputFlagName;
3
+ static input: {
4
+ [FlagsProvider.inputFlagName]: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
+ };
6
+ static destination(artifact: string, artifactName: string): {
7
+ destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ static authKey: {
10
+ "auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ static force: {
13
+ force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ }
@@ -0,0 +1,34 @@
1
+ import { Flags } from "@oclif/core";
2
+ export class FlagsProvider {
3
+ static destination(artifact, artifactName) {
4
+ return {
5
+ destination: Flags.string({
6
+ char: "d",
7
+ description: `[default: <${FlagsProvider.inputFlagName}>/${artifact}] path where the ${artifactName} will be generated.`
8
+ })
9
+ };
10
+ }
11
+ }
12
+ FlagsProvider.inputFlagName = "input";
13
+ // Common folder flag group
14
+ FlagsProvider.input = {
15
+ [FlagsProvider.inputFlagName]: Flags.string({
16
+ char: "i",
17
+ description: "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files."
18
+ })
19
+ };
20
+ // Auth key group
21
+ FlagsProvider.authKey = {
22
+ "auth-key": Flags.string({
23
+ char: "k",
24
+ description: "override current authentication state with an authentication key."
25
+ })
26
+ };
27
+ FlagsProvider.force = {
28
+ force: Flags.boolean({
29
+ char: "f",
30
+ default: false,
31
+ description: "overwrite changes without asking for user consent."
32
+ })
33
+ };
34
+ //# sourceMappingURL=flags-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flags-provider.js","sourceRoot":"","sources":["../../src/types/flags-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,OAAO,aAAa;IAWjB,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,YAAoB;QAC9D,OAAO;YACL,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;gBACxB,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,cAAc,aAAa,CAAC,aAAa,KAAK,QAAQ,oBAAoB,YAAY,qBAAqB;aACzH,CAAC;SACH,CAAC;IACJ,CAAC;;AAjBuB,2BAAa,GAAW,OAAgB,CAAC;AACjE,2BAA2B;AACb,mBAAK,GAAG;IACpB,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,GAAG;QACT,WAAW,EACT,uIAAuI;KAC1I,CAAC;CACH,CAAC;AAWF,iBAAiB;AACH,qBAAO,GAAG;IACtB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mEAAmE;KACjF,CAAC;CACH,CAAC;AAEY,mBAAK,GAAG;IACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,oDAAoD;KAClE,CAAC;CACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ export declare class PortalContext {
4
+ private readonly portalDirectory;
5
+ private readonly fileService;
6
+ private readonly zipService;
7
+ constructor(portalDirectory: DirectoryPath);
8
+ private get ZipPath();
9
+ private get reportPath();
10
+ exists(): Promise<boolean>;
11
+ save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
12
+ saveError(tempErrorFilePath: FilePath): Promise<FilePath>;
13
+ }
@@ -0,0 +1,38 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
4
+ import { ZipService } from "../infrastructure/zip-service.js";
5
+ export class PortalContext {
6
+ constructor(portalDirectory) {
7
+ this.portalDirectory = portalDirectory;
8
+ this.fileService = new FileService();
9
+ this.zipService = new ZipService();
10
+ }
11
+ get ZipPath() {
12
+ // TODO: add checks for build file path
13
+ return new FilePath(this.portalDirectory, new FileName("portal.zip"));
14
+ }
15
+ get reportPath() {
16
+ // TODO: add checks for build file path
17
+ const debugPath = this.portalDirectory.join('apimatic-debug');
18
+ return new FilePath(debugPath, new FileName("apimatic-report.html"));
19
+ }
20
+ async exists() {
21
+ return !await this.fileService.directoryEmpty(this.portalDirectory);
22
+ }
23
+ async save(tempPortalFilePath, zipPortal) {
24
+ await this.fileService.cleanDirectory(this.portalDirectory);
25
+ if (zipPortal) {
26
+ await this.fileService.copy(tempPortalFilePath, this.ZipPath);
27
+ }
28
+ else {
29
+ await this.zipService.unArchive(tempPortalFilePath, this.portalDirectory);
30
+ }
31
+ }
32
+ async saveError(tempErrorFilePath) {
33
+ await this.fileService.cleanDirectory(this.portalDirectory);
34
+ await this.zipService.unArchive(tempErrorFilePath, this.portalDirectory);
35
+ return this.reportPath;
36
+ }
37
+ }
38
+ //# sourceMappingURL=portal-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-context.js","sourceRoot":"","sources":["../../src/types/portal-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;AAE9D,MAAM,OAAO,aAAa;IAKxB,YAA6B,eAA8B;QAA9B,oBAAe,GAAf,eAAe,CAAe;QAH1C,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAG/C,CAAC;IAED,IAAY,OAAO;QACjB,uCAAuC;QACvC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,IAAY,UAAU;QACpB,uCAAuC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9D,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE,IAAI,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAA;IACtE,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,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,eAAe,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,iBAA2B;QAChD,MAAM,IAAI,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"}
@@ -0,0 +1,22 @@
1
+ export declare enum StepType {
2
+ Content = "content",
3
+ Endpoint = "endpoint"
4
+ }
5
+ export interface EndpointConfig {
6
+ description: string;
7
+ endpointPermalink: string;
8
+ }
9
+ export interface SerializableRecipe {
10
+ name: string;
11
+ steps: SerializableStep[];
12
+ }
13
+ export interface SerializableStep {
14
+ key: string;
15
+ name: string;
16
+ type: StepType;
17
+ config: ContentStepConfig | EndpointStepConfig;
18
+ }
19
+ export interface ContentStepConfig {
20
+ content: string;
21
+ }
22
+ export type EndpointStepConfig = EndpointConfig;
@@ -0,0 +1,6 @@
1
+ export var StepType;
2
+ (function (StepType) {
3
+ StepType["Content"] = "content";
4
+ StepType["Endpoint"] = "endpoint";
5
+ })(StepType || (StepType = {}));
6
+ //# sourceMappingURL=recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../src/types/recipe/recipe.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;AACvB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB"}
@@ -0,0 +1,9 @@
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
+ getRecipeScriptFileName(): FileName;
7
+ getRecipeMarkdownFileName(): FileName;
8
+ exists(tocData: Toc, recipeName: string, recipeMarkdownFileName: FileName): boolean;
9
+ }
@@ -0,0 +1,26 @@
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
+ getRecipeScriptFileName() {
8
+ return new FileName(toPascalCase(this.recipeName.trim()) + `.js`);
9
+ }
10
+ getRecipeMarkdownFileName() {
11
+ return new FileName(toPascalCase(this.recipeName.trim() + `.md`));
12
+ }
13
+ exists(tocData, recipeName, recipeMarkdownFileName) {
14
+ var _a;
15
+ let apiRecipesGroup = (_a = tocData.toc) === null || _a === void 0 ? void 0 : _a.find((item) => "group" in item && item.group === "API Recipes");
16
+ if (!apiRecipesGroup || !("items" in apiRecipesGroup)) {
17
+ return false;
18
+ }
19
+ // Check if the recipe name or file name already exists
20
+ const existingRecipe = apiRecipesGroup.items.find((item) => "page" in item &&
21
+ "file" in item &&
22
+ (item.page === recipeName || item.file === `recipes/${recipeMarkdownFileName}`));
23
+ return !!existingRecipe;
24
+ }
25
+ }
26
+ //# sourceMapping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@
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/service-error.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,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C,mBAAmB,CAAC,CAAC;IACjC,CAAC;CACF"}
@@ -1,23 +1,10 @@
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 SimplePlatforms {
16
- CSHARP = "CS_NET_STANDARD_LIB",
17
- JAVA = "JAVA_ECLIPSE_JRE_LIB",
18
- PHP = "PHP_GENERIC_LIB_V2",
19
- PYTHON = "PYTHON_GENERIC_LIB",
20
- RUBY = "RUBY_GENERIC_LIB",
21
- TYPESCRIPT = "TS_GENERIC_LIB",
22
- GO = "GO_GENERIC_LIB"
1
+ export declare enum Language {
2
+ CSHARP = "csharp",
3
+ JAVA = "java",
4
+ PHP = "php",
5
+ PYTHON = "python",
6
+ RUBY = "ruby",
7
+ TYPESCRIPT = "typescript",
8
+ GO = "go"
23
9
  }
10
+ export declare function mapLanguages(languageFlag: number): Language[];
@@ -1,14 +1,25 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimplePlatforms = void 0;
4
- var SimplePlatforms;
5
- (function (SimplePlatforms) {
6
- SimplePlatforms["CSHARP"] = "CS_NET_STANDARD_LIB";
7
- SimplePlatforms["JAVA"] = "JAVA_ECLIPSE_JRE_LIB";
8
- SimplePlatforms["PHP"] = "PHP_GENERIC_LIB_V2";
9
- SimplePlatforms["PYTHON"] = "PYTHON_GENERIC_LIB";
10
- SimplePlatforms["RUBY"] = "RUBY_GENERIC_LIB";
11
- SimplePlatforms["TYPESCRIPT"] = "TS_GENERIC_LIB";
12
- SimplePlatforms["GO"] = "GO_GENERIC_LIB";
13
- })(SimplePlatforms || (exports.SimplePlatforms = SimplePlatforms = {}));
14
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHlwZXMvc2RrL2dlbmVyYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQWlCQSxJQUFZLGVBUVg7QUFSRCxXQUFZLGVBQWU7SUFDekIsaURBQThCLENBQUE7SUFDOUIsZ0RBQTZCLENBQUE7SUFDN0IsNkNBQTBCLENBQUE7SUFDMUIsZ0RBQTZCLENBQUE7SUFDN0IsNENBQXlCLENBQUE7SUFDekIsZ0RBQTZCLENBQUE7SUFDN0Isd0NBQXFCLENBQUE7QUFDdkIsQ0FBQyxFQVJXLGVBQWUsK0JBQWYsZUFBZSxRQVExQiJ9
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
+ }
25
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,14 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { Language } from "./sdk/generate.js";
4
+ export declare class SdkContext {
5
+ private readonly sdkDirectory;
6
+ private readonly language;
7
+ private readonly fileService;
8
+ private readonly zipService;
9
+ constructor(sdkDirectory: DirectoryPath, language: Language);
10
+ private get zipPath();
11
+ get sdkLanguageDirectory(): DirectoryPath;
12
+ exists(): Promise<boolean>;
13
+ save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<DirectoryPath>;
14
+ }
@@ -0,0 +1,32 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
4
+ import { ZipService } from "../infrastructure/zip-service.js";
5
+ export class SdkContext {
6
+ constructor(sdkDirectory, language) {
7
+ this.sdkDirectory = sdkDirectory;
8
+ this.language = language;
9
+ this.fileService = new FileService();
10
+ this.zipService = new ZipService();
11
+ }
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);
17
+ }
18
+ async exists() {
19
+ return !(await this.fileService.directoryEmpty(this.sdkLanguageDirectory));
20
+ }
21
+ async save(tempPortalFilePath, zipPortal) {
22
+ await this.fileService.cleanDirectory(this.sdkLanguageDirectory);
23
+ if (zipPortal) {
24
+ await this.fileService.copy(tempPortalFilePath, this.zipPath);
25
+ }
26
+ else {
27
+ await this.zipService.unArchive(tempPortalFilePath, this.sdkLanguageDirectory);
28
+ }
29
+ return this.sdkLanguageDirectory;
30
+ }
31
+ }
32
+ //# sourceMappingURL=sdk-context.js.map
@@ -0,0 +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;IAIrB,YAA6B,YAA2B,EAAmB,QAAkB;QAAhE,iBAAY,GAAZ,YAAY,CAAe;QAAmB,aAAQ,GAAR,QAAQ,CAAU;QAH5E,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAG/C,CAAC;IAED,IAAY,OAAO;QACjB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;IAED,IAAW,oBAAoB;QAC7B,OAAO,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,11 +1,38 @@
1
+ import { TocEndpoint, TocModelPage, TocWebhookPage, TocCallbackPage } from '../toc/toc.js';
2
+ export type EndpointGroup = Map<string, TocEndpoint[]>;
3
+ export type WebhookGroup = Map<string, TocWebhookPage[]>;
4
+ export type CallbackGroup = Map<string, TocCallbackPage[]>;
5
+ export type SdlTocComponents = {
6
+ endpointGroups: EndpointGroup;
7
+ models: TocModelPage[];
8
+ webhookGroups: WebhookGroup;
9
+ callbackGroups: CallbackGroup;
10
+ };
1
11
  export interface Sdl {
2
12
  readonly Endpoints: SdlEndpoint[];
3
13
  readonly CustomTypes: SdlModel[];
14
+ readonly Webhooks: SdlWebhook[];
4
15
  }
5
16
  export interface SdlEndpoint {
6
17
  readonly Name: string;
18
+ readonly Description: string;
7
19
  readonly Group: string;
20
+ readonly Callbacks: SdlCallback[];
8
21
  }
9
22
  export interface SdlModel {
10
23
  readonly Name: string;
11
24
  }
25
+ export interface SdlCallback {
26
+ readonly Id: string;
27
+ readonly CallbackGroupName?: string;
28
+ }
29
+ export interface SdlWebhook {
30
+ readonly Id: string;
31
+ readonly WebhookGroupName?: string;
32
+ }
33
+ export declare function getEndpointDescription(endpointGroups: Map<string, SdlEndpoint[]>, endpointGroupName: string, endpointName: string): string;
34
+ export declare function getEndpointGroupsFromSdl(sdl: Sdl): Map<string, SdlEndpoint[]>;
35
+ export declare function extractEndpointGroupsForToc(sdl: Sdl): Map<string, TocEndpoint[]>;
36
+ export declare function extractModelsForToc(sdl: Sdl): TocModelPage[];
37
+ export declare function extractWebhooksForToc(sdl: Sdl): Map<string, TocWebhookPage[]>;
38
+ export declare function extractCallbacksForToc(sdl: Sdl): Map<string, TocCallbackPage[]>;
@@ -1,3 +1,145 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2RsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3R5cGVzL3NkbC9zZGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
1
+ import { toTitleCase } from '../../utils/string-utils.js';
2
+ export function getEndpointDescription(endpointGroups, endpointGroupName, endpointName) {
3
+ return endpointGroups.get(endpointGroupName).find((e) => e.Name === endpointName).Description;
4
+ }
5
+ export function getEndpointGroupsFromSdl(sdl) {
6
+ const endpointGroups = new Map();
7
+ for (const endpoint of sdl.Endpoints) {
8
+ if (!endpointGroups.has(endpoint.Group)) {
9
+ endpointGroups.set(endpoint.Group, []);
10
+ }
11
+ endpointGroups.get(endpoint.Group).push({
12
+ Name: endpoint.Name,
13
+ Description: endpoint.Description,
14
+ Group: endpoint.Group,
15
+ Callbacks: endpoint.Callbacks
16
+ });
17
+ }
18
+ return endpointGroups;
19
+ }
20
+ export function extractEndpointGroupsForToc(sdl) {
21
+ const endpointGroups = new Map();
22
+ const endpoints = sdl.Endpoints.map((e) => ({
23
+ generate: null,
24
+ from: 'endpoint',
25
+ endpointName: e.Name,
26
+ endpointGroup: e.Group
27
+ }));
28
+ endpoints.forEach((endpoint) => {
29
+ const group = endpoint.endpointGroup;
30
+ if (!endpointGroups.has(group)) {
31
+ endpointGroups.set(group, []);
32
+ }
33
+ endpointGroups.get(group).push(endpoint);
34
+ });
35
+ return endpointGroups;
36
+ }
37
+ export function extractModelsForToc(sdl) {
38
+ return sdl.CustomTypes.map((e) => ({
39
+ generate: null,
40
+ from: 'model',
41
+ modelName: e.Name
42
+ }));
43
+ }
44
+ export function extractWebhooksForToc(sdl) {
45
+ var _a;
46
+ if (sdl.Webhooks.length === 0) {
47
+ return new Map();
48
+ }
49
+ let groupedWebhooks = new Map();
50
+ const ungrouped = [];
51
+ for (const webhook of sdl.Webhooks) {
52
+ const event = {
53
+ generate: null,
54
+ from: 'webhook',
55
+ webhookName: webhook.Id,
56
+ webhookGroup: (_a = webhook.WebhookGroupName) !== null && _a !== void 0 ? _a : null
57
+ };
58
+ if (webhook.WebhookGroupName) {
59
+ const groupTitle = toTitleCase(webhook.WebhookGroupName);
60
+ if (!groupedWebhooks.has(groupTitle)) {
61
+ groupedWebhooks.set(groupTitle, [
62
+ {
63
+ generate: null,
64
+ from: 'webhook-group-overview',
65
+ webhookGroup: webhook.WebhookGroupName
66
+ }
67
+ ]);
68
+ }
69
+ groupedWebhooks.get(groupTitle).push(event);
70
+ }
71
+ else {
72
+ ungrouped.push(event);
73
+ }
74
+ }
75
+ let ungroupedWebhooks = new Map();
76
+ if (ungrouped.length > 0) {
77
+ const uniqueGroupName = getUniqueGroupName('Webhooks', new Set(groupedWebhooks.keys()));
78
+ const uniqueGroupTitle = toTitleCase(uniqueGroupName);
79
+ ungroupedWebhooks.set(uniqueGroupTitle, [
80
+ {
81
+ generate: null,
82
+ from: 'webhook-group-overview',
83
+ webhookGroup: uniqueGroupName
84
+ },
85
+ ...ungrouped.map((event) => (Object.assign(Object.assign({}, event), { webhookGroup: uniqueGroupName })))
86
+ ]);
87
+ }
88
+ return new Map([...[...groupedWebhooks].sort((a, b) => a[0].localeCompare(b[0])), ...ungroupedWebhooks]);
89
+ }
90
+ export function extractCallbacksForToc(sdl) {
91
+ var _a;
92
+ if (sdl.Endpoints.length === 0) {
93
+ return new Map();
94
+ }
95
+ let groupedCallbacks = new Map();
96
+ const ungrouped = [];
97
+ for (const callback of sdl.Endpoints.flatMap((e) => e.Callbacks)) {
98
+ const event = {
99
+ generate: null,
100
+ from: 'callback',
101
+ callbackName: callback.Id,
102
+ callbackGroup: (_a = callback.CallbackGroupName) !== null && _a !== void 0 ? _a : null
103
+ };
104
+ if (callback.CallbackGroupName) {
105
+ const groupTitle = toTitleCase(callback.CallbackGroupName);
106
+ if (!groupedCallbacks.has(groupTitle)) {
107
+ groupedCallbacks.set(groupTitle, [
108
+ {
109
+ generate: null,
110
+ from: 'callback-group-overview',
111
+ callbackGroup: callback.CallbackGroupName
112
+ }
113
+ ]);
114
+ }
115
+ groupedCallbacks.get(groupTitle).push(event);
116
+ }
117
+ else {
118
+ ungrouped.push(event);
119
+ }
120
+ }
121
+ let ungroupedCallbacks = new Map();
122
+ if (ungrouped.length > 0) {
123
+ const uniqueGroupName = getUniqueGroupName('Callbacks', new Set(groupedCallbacks.keys()));
124
+ const uniqueGroupTitle = toTitleCase(uniqueGroupName);
125
+ ungroupedCallbacks.set(uniqueGroupTitle, [
126
+ {
127
+ generate: null,
128
+ from: 'callback-group-overview',
129
+ callbackGroup: uniqueGroupName
130
+ },
131
+ ...ungrouped.map((event) => (Object.assign(Object.assign({}, event), { callbackGroup: uniqueGroupName })))
132
+ ]);
133
+ }
134
+ return new Map([...[...groupedCallbacks].sort((a, b) => a[0].localeCompare(b[0])), ...ungroupedCallbacks]);
135
+ }
136
+ function getUniqueGroupName(baseName, existingGroups) {
137
+ let counter = 1;
138
+ let name = baseName;
139
+ while (existingGroups.has(toTitleCase(name))) {
140
+ name = `${baseName}${counter}`;
141
+ counter++;
142
+ }
143
+ return name;
144
+ }
145
+ //# sourceMappingURL=sdl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdl.js","sourceRoot":"","sources":["../../../src/types/sdl/sdl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAwC1D,MAAM,UAAU,sBAAsB,CACpC,cAA0C,EAC1C,iBAAyB,EACzB,YAAoB;IAEpB,OAAO,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAE,CAAC,WAAW,CAAC;AAClG,CAAC;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;QACrC,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;YACrB,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC9B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,GAAQ;IAClD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAExD,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CACjC,CAAC,CAAc,EAAe,EAAE,CAAC,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";
3
+ import { FileName } from "./file/fileName.js";
4
+ export declare class SpecContext {
5
+ private readonly fileService;
6
+ private readonly zipService;
7
+ private readonly specDirectory;
8
+ constructor(specDirectory: DirectoryPath);
9
+ validate(): Promise<boolean>;
10
+ replaceDefaultSpec(specPath: FilePath): Promise<void>;
11
+ save(stream: NodeJS.ReadableStream, fileName: FileName): Promise<FilePath>;
12
+ }