@apimatic/cli 1.5.0 → 2.0.0-beta.2

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 (610) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -212
  3. package/apimatic.schema.json +550 -0
  4. package/lib/actions/action-result.js +3 -0
  5. package/lib/actions/action-result.js.map +1 -1
  6. package/lib/actions/api/transform.js +36 -33
  7. package/lib/actions/api/transform.js.map +1 -1
  8. package/lib/actions/api/validate.d.ts +9 -6
  9. package/lib/actions/api/validate.js +44 -38
  10. package/lib/actions/api/validate.js.map +1 -1
  11. package/lib/actions/auth/login.js +7 -4
  12. package/lib/actions/auth/login.js.map +1 -1
  13. package/lib/actions/auth/logout.js +2 -1
  14. package/lib/actions/auth/logout.js.map +1 -1
  15. package/lib/actions/auth/status.js +5 -3
  16. package/lib/actions/auth/status.js.map +1 -1
  17. package/lib/actions/plugin/generate.d.ts +5 -1
  18. package/lib/actions/plugin/generate.js +83 -56
  19. package/lib/actions/plugin/generate.js.map +1 -1
  20. package/lib/actions/plugin/publish.d.ts +2 -1
  21. package/lib/actions/plugin/publish.js +34 -37
  22. package/lib/actions/plugin/publish.js.map +1 -1
  23. package/lib/actions/plugin/record-metadata.d.ts +3 -2
  24. package/lib/actions/plugin/record-metadata.js +33 -30
  25. package/lib/actions/plugin/record-metadata.js.map +1 -1
  26. package/lib/actions/portal/generate.d.ts +8 -6
  27. package/lib/actions/portal/generate.js +50 -61
  28. package/lib/actions/portal/generate.js.map +1 -1
  29. package/lib/actions/portal/prepare-project.d.ts +25 -0
  30. package/lib/actions/portal/prepare-project.js +68 -0
  31. package/lib/actions/portal/prepare-project.js.map +1 -0
  32. package/lib/actions/portal/serve.d.ts +21 -6
  33. package/lib/actions/portal/serve.js +170 -153
  34. package/lib/actions/portal/serve.js.map +1 -1
  35. package/lib/actions/publishing/profile/list.js +4 -2
  36. package/lib/actions/publishing/profile/list.js.map +1 -1
  37. package/lib/actions/quickstart.d.ts +23 -5
  38. package/lib/actions/quickstart.js +221 -21
  39. package/lib/actions/quickstart.js.map +1 -1
  40. package/lib/actions/sdk/generate.d.ts +4 -7
  41. package/lib/actions/sdk/generate.js +53 -93
  42. package/lib/actions/sdk/generate.js.map +1 -1
  43. package/lib/actions/sdk/publish/interactive.d.ts +4 -3
  44. package/lib/actions/sdk/publish/interactive.js +96 -97
  45. package/lib/actions/sdk/publish/interactive.js.map +1 -1
  46. package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
  47. package/lib/actions/sdk/publish/non-interactive.js +91 -90
  48. package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
  49. package/lib/actions/sdk/publish.d.ts +3 -2
  50. package/lib/actions/sdk/publish.js +55 -53
  51. package/lib/actions/sdk/publish.js.map +1 -1
  52. package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
  53. package/lib/actions/sdk/record-published-sdk.js +57 -0
  54. package/lib/actions/sdk/record-published-sdk.js.map +1 -0
  55. package/lib/client-utils/auth-manager.js +1 -1
  56. package/lib/client-utils/auth-manager.js.map +1 -1
  57. package/lib/commands/api/transform.d.ts +1 -1
  58. package/lib/commands/api/transform.js +44 -40
  59. package/lib/commands/api/transform.js.map +1 -1
  60. package/lib/commands/api/validate.js +16 -16
  61. package/lib/commands/api/validate.js.map +1 -1
  62. package/lib/commands/auth/login.js +14 -15
  63. package/lib/commands/auth/login.js.map +1 -1
  64. package/lib/commands/auth/logout.js +5 -6
  65. package/lib/commands/auth/logout.js.map +1 -1
  66. package/lib/commands/auth/status.js +4 -5
  67. package/lib/commands/auth/status.js.map +1 -1
  68. package/lib/commands/plugin/generate.d.ts +3 -3
  69. package/lib/commands/plugin/generate.js +20 -20
  70. package/lib/commands/plugin/generate.js.map +1 -1
  71. package/lib/commands/plugin/publish.js +18 -18
  72. package/lib/commands/plugin/publish.js.map +1 -1
  73. package/lib/commands/portal/generate.d.ts +9 -8
  74. package/lib/commands/portal/generate.js +36 -27
  75. package/lib/commands/portal/generate.js.map +1 -1
  76. package/lib/commands/portal/serve.d.ts +7 -9
  77. package/lib/commands/portal/serve.js +41 -44
  78. package/lib/commands/portal/serve.js.map +1 -1
  79. package/lib/commands/publishing/profile/list.js +8 -12
  80. package/lib/commands/publishing/profile/list.js.map +1 -1
  81. package/lib/commands/quickstart.d.ts +5 -5
  82. package/lib/commands/quickstart.js +18 -24
  83. package/lib/commands/quickstart.js.map +1 -1
  84. package/lib/commands/sdk/generate.d.ts +5 -7
  85. package/lib/commands/sdk/generate.js +58 -70
  86. package/lib/commands/sdk/generate.js.map +1 -1
  87. package/lib/commands/sdk/publish.d.ts +6 -7
  88. package/lib/commands/sdk/publish.js +66 -60
  89. package/lib/commands/sdk/publish.js.map +1 -1
  90. package/lib/hooks/node-version.d.ts +3 -0
  91. package/lib/hooks/node-version.js +12 -0
  92. package/lib/hooks/node-version.js.map +1 -0
  93. package/lib/hooks/not-found.js +2 -3
  94. package/lib/hooks/not-found.js.map +1 -1
  95. package/lib/hooks/utils.d.ts +4 -2
  96. package/lib/hooks/utils.js +2 -2
  97. package/lib/hooks/utils.js.map +1 -1
  98. package/lib/infrastructure/env-info.d.ts +3 -0
  99. package/lib/infrastructure/env-info.js +13 -6
  100. package/lib/infrastructure/env-info.js.map +1 -1
  101. package/lib/infrastructure/file-service.d.ts +35 -8
  102. package/lib/infrastructure/file-service.js +149 -53
  103. package/lib/infrastructure/file-service.js.map +1 -1
  104. package/lib/infrastructure/file-watch-service.d.ts +40 -0
  105. package/lib/infrastructure/file-watch-service.js +167 -0
  106. package/lib/infrastructure/file-watch-service.js.map +1 -0
  107. package/lib/infrastructure/generation-status-poller.d.ts +8 -7
  108. package/lib/infrastructure/generation-status-poller.js +20 -12
  109. package/lib/infrastructure/generation-status-poller.js.map +1 -1
  110. package/lib/infrastructure/launcher-service.js +6 -6
  111. package/lib/infrastructure/launcher-service.js.map +1 -1
  112. package/lib/infrastructure/network-service.d.ts +3 -0
  113. package/lib/infrastructure/network-service.js +15 -1
  114. package/lib/infrastructure/network-service.js.map +1 -1
  115. package/lib/infrastructure/portal-build-service.d.ts +19 -0
  116. package/lib/infrastructure/portal-build-service.js +58 -0
  117. package/lib/infrastructure/portal-build-service.js.map +1 -0
  118. package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
  119. package/lib/infrastructure/portal-dev-server-service.js +135 -0
  120. package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
  121. package/lib/infrastructure/portal-pages-service.d.ts +17 -0
  122. package/lib/infrastructure/portal-pages-service.js +103 -0
  123. package/lib/infrastructure/portal-pages-service.js.map +1 -0
  124. package/lib/infrastructure/portal-project-service.d.ts +77 -0
  125. package/lib/infrastructure/portal-project-service.js +309 -0
  126. package/lib/infrastructure/portal-project-service.js.map +1 -0
  127. package/lib/infrastructure/service-error.d.ts +1 -0
  128. package/lib/infrastructure/service-error.js +39 -41
  129. package/lib/infrastructure/service-error.js.map +1 -1
  130. package/lib/infrastructure/services/api-client-factory.js +15 -13
  131. package/lib/infrastructure/services/api-client-factory.js.map +1 -1
  132. package/lib/infrastructure/services/api-service.d.ts +7 -5
  133. package/lib/infrastructure/services/api-service.js +28 -20
  134. package/lib/infrastructure/services/api-service.js.map +1 -1
  135. package/lib/infrastructure/services/auth-service.js +4 -9
  136. package/lib/infrastructure/services/auth-service.js.map +1 -1
  137. package/lib/infrastructure/services/file-download-service.js +3 -3
  138. package/lib/infrastructure/services/file-download-service.js.map +1 -1
  139. package/lib/infrastructure/services/plugin-service.d.ts +1 -8
  140. package/lib/infrastructure/services/plugin-service.js +11 -22
  141. package/lib/infrastructure/services/plugin-service.js.map +1 -1
  142. package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
  143. package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
  144. package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
  145. package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
  146. package/lib/infrastructure/services/portal-authorization-service.js +23 -0
  147. package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
  148. package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
  149. package/lib/infrastructure/services/publishing-api-service.js +11 -15
  150. package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
  151. package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
  152. package/lib/infrastructure/services/sdk-generation-service.js +118 -0
  153. package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
  154. package/lib/infrastructure/services/telemetry-service.js +5 -4
  155. package/lib/infrastructure/services/telemetry-service.js.map +1 -1
  156. package/lib/infrastructure/services/transformation-service.js +29 -32
  157. package/lib/infrastructure/services/transformation-service.js.map +1 -1
  158. package/lib/infrastructure/services/validation-service.d.ts +12 -53
  159. package/lib/infrastructure/services/validation-service.js +24 -199
  160. package/lib/infrastructure/services/validation-service.js.map +1 -1
  161. package/lib/infrastructure/timer-extensions.d.ts +2 -0
  162. package/lib/infrastructure/timer-extensions.js +10 -0
  163. package/lib/infrastructure/timer-extensions.js.map +1 -0
  164. package/lib/infrastructure/tmp-extensions.d.ts +31 -1
  165. package/lib/infrastructure/tmp-extensions.js +86 -3
  166. package/lib/infrastructure/tmp-extensions.js.map +1 -1
  167. package/lib/infrastructure/zip-service.js +2 -2
  168. package/lib/infrastructure/zip-service.js.map +1 -1
  169. package/lib/prompts/api/validate.d.ts +6 -7
  170. package/lib/prompts/api/validate.js +12 -12
  171. package/lib/prompts/api/validate.js.map +1 -1
  172. package/lib/prompts/format.d.ts +4 -0
  173. package/lib/prompts/format.js +5 -0
  174. package/lib/prompts/format.js.map +1 -1
  175. package/lib/prompts/plugin/generate.d.ts +17 -12
  176. package/lib/prompts/plugin/generate.js +94 -44
  177. package/lib/prompts/plugin/generate.js.map +1 -1
  178. package/lib/prompts/plugin/publish.d.ts +2 -1
  179. package/lib/prompts/plugin/publish.js +8 -7
  180. package/lib/prompts/plugin/publish.js.map +1 -1
  181. package/lib/prompts/plugin/record-metadata.d.ts +1 -0
  182. package/lib/prompts/plugin/record-metadata.js +10 -7
  183. package/lib/prompts/plugin/record-metadata.js.map +1 -1
  184. package/lib/prompts/portal/artifacts.d.ts +8 -0
  185. package/lib/prompts/portal/artifacts.js +26 -0
  186. package/lib/prompts/portal/artifacts.js.map +1 -0
  187. package/lib/prompts/portal/authorization.d.ts +6 -0
  188. package/lib/prompts/portal/authorization.js +29 -0
  189. package/lib/prompts/portal/authorization.js.map +1 -0
  190. package/lib/prompts/portal/code-samples.d.ts +1 -0
  191. package/lib/prompts/portal/code-samples.js +9 -0
  192. package/lib/prompts/portal/code-samples.js.map +1 -0
  193. package/lib/prompts/portal/generate.d.ts +14 -9
  194. package/lib/prompts/portal/generate.js +48 -26
  195. package/lib/prompts/portal/generate.js.map +1 -1
  196. package/lib/prompts/portal/prepare-project.d.ts +20 -0
  197. package/lib/prompts/portal/prepare-project.js +36 -0
  198. package/lib/prompts/portal/prepare-project.js.map +1 -0
  199. package/lib/prompts/portal/serve.d.ts +32 -12
  200. package/lib/prompts/portal/serve.js +100 -39
  201. package/lib/prompts/portal/serve.js.map +1 -1
  202. package/lib/prompts/portal/source.d.ts +26 -0
  203. package/lib/prompts/portal/source.js +253 -0
  204. package/lib/prompts/portal/source.js.map +1 -0
  205. package/lib/prompts/prompt.d.ts +11 -3
  206. package/lib/prompts/prompt.js +39 -15
  207. package/lib/prompts/prompt.js.map +1 -1
  208. package/lib/prompts/quickstart.d.ts +46 -3
  209. package/lib/prompts/quickstart.js +193 -12
  210. package/lib/prompts/quickstart.js.map +1 -1
  211. package/lib/prompts/sdk/generate.d.ts +15 -13
  212. package/lib/prompts/sdk/generate.js +29 -32
  213. package/lib/prompts/sdk/generate.js.map +1 -1
  214. package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
  215. package/lib/prompts/sdk/publish/interactive.js +26 -24
  216. package/lib/prompts/sdk/publish/interactive.js.map +1 -1
  217. package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
  218. package/lib/prompts/sdk/publish/non-interactive.js +5 -4
  219. package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
  220. package/lib/prompts/sdk/publish.d.ts +3 -3
  221. package/lib/prompts/sdk/publish.js +13 -17
  222. package/lib/prompts/sdk/publish.js.map +1 -1
  223. package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
  224. package/lib/prompts/sdk/record-published-sdk.js +26 -0
  225. package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
  226. package/lib/types/apimatic-config/document.d.ts +68 -0
  227. package/lib/types/apimatic-config/document.js +161 -0
  228. package/lib/types/apimatic-config/document.js.map +1 -0
  229. package/lib/types/apimatic-config/languages-block.d.ts +39 -0
  230. package/lib/types/apimatic-config/languages-block.js +58 -0
  231. package/lib/types/apimatic-config/languages-block.js.map +1 -0
  232. package/lib/types/apimatic-config-context.d.ts +48 -0
  233. package/lib/types/apimatic-config-context.js +121 -0
  234. package/lib/types/apimatic-config-context.js.map +1 -0
  235. package/lib/types/build/build.d.ts +1 -89
  236. package/lib/types/build/build.js +6 -161
  237. package/lib/types/build/build.js.map +1 -1
  238. package/lib/types/events/domain-event.js +3 -0
  239. package/lib/types/events/domain-event.js.map +1 -1
  240. package/lib/types/events/quickstart-completed.js +3 -3
  241. package/lib/types/events/quickstart-completed.js.map +1 -1
  242. package/lib/types/events/quickstart-initiated.js +3 -3
  243. package/lib/types/events/quickstart-initiated.js.map +1 -1
  244. package/lib/types/events/sdk-publish-validation-failed.js +1 -1
  245. package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
  246. package/lib/types/file/directory.d.ts +4 -9
  247. package/lib/types/file/directory.js +17 -65
  248. package/lib/types/file/directory.js.map +1 -1
  249. package/lib/types/file/directoryPath.d.ts +17 -0
  250. package/lib/types/file/directoryPath.js +47 -2
  251. package/lib/types/file/directoryPath.js.map +1 -1
  252. package/lib/types/file/fileName.d.ts +8 -0
  253. package/lib/types/file/fileName.js +28 -6
  254. package/lib/types/file/fileName.js.map +1 -1
  255. package/lib/types/file/filePath.d.ts +18 -2
  256. package/lib/types/file/filePath.js +39 -4
  257. package/lib/types/file/filePath.js.map +1 -1
  258. package/lib/types/file/resource-input.js +1 -2
  259. package/lib/types/file/resource-input.js.map +1 -1
  260. package/lib/types/file/urlPath.js +2 -1
  261. package/lib/types/file/urlPath.js.map +1 -1
  262. package/lib/types/flags-provider.js +22 -22
  263. package/lib/types/flags-provider.js.map +1 -1
  264. package/lib/types/package-settings-context.js +2 -1
  265. package/lib/types/package-settings-context.js.map +1 -1
  266. package/lib/types/plugin/plugin-config.d.ts +10 -50
  267. package/lib/types/plugin/plugin-config.js +7 -1
  268. package/lib/types/plugin/plugin-config.js.map +1 -1
  269. package/lib/types/plugin-config-context.d.ts +30 -37
  270. package/lib/types/plugin-config-context.js +108 -139
  271. package/lib/types/plugin-config-context.js.map +1 -1
  272. package/lib/types/plugin-context.js +3 -2
  273. package/lib/types/plugin-context.js.map +1 -1
  274. package/lib/types/portal/code-samples.d.ts +27 -0
  275. package/lib/types/portal/code-samples.js +67 -0
  276. package/lib/types/portal/code-samples.js.map +1 -0
  277. package/lib/types/portal/config/ai-config.d.ts +15 -0
  278. package/lib/types/portal/config/ai-config.js +26 -0
  279. package/lib/types/portal/config/ai-config.js.map +1 -0
  280. package/lib/types/portal/config/brand-config.d.ts +55 -0
  281. package/lib/types/portal/config/brand-config.js +105 -0
  282. package/lib/types/portal/config/brand-config.js.map +1 -0
  283. package/lib/types/portal/config/color.d.ts +19 -0
  284. package/lib/types/portal/config/color.js +43 -0
  285. package/lib/types/portal/config/color.js.map +1 -0
  286. package/lib/types/portal/config/fields.d.ts +23 -0
  287. package/lib/types/portal/config/fields.js +67 -0
  288. package/lib/types/portal/config/fields.js.map +1 -0
  289. package/lib/types/portal/config/link.d.ts +18 -0
  290. package/lib/types/portal/config/link.js +72 -0
  291. package/lib/types/portal/config/link.js.map +1 -0
  292. package/lib/types/portal/config/navigation-config.d.ts +13 -0
  293. package/lib/types/portal/config/navigation-config.js +30 -0
  294. package/lib/types/portal/config/navigation-config.js.map +1 -0
  295. package/lib/types/portal/config/site-config.d.ts +32 -0
  296. package/lib/types/portal/config/site-config.js +88 -0
  297. package/lib/types/portal/config/site-config.js.map +1 -0
  298. package/lib/types/portal/config/static-asset.d.ts +25 -0
  299. package/lib/types/portal/config/static-asset.js +77 -0
  300. package/lib/types/portal/config/static-asset.js.map +1 -0
  301. package/lib/types/portal/content-notices.d.ts +20 -0
  302. package/lib/types/portal/content-notices.js +2 -0
  303. package/lib/types/portal/content-notices.js.map +1 -0
  304. package/lib/types/portal/content-tree.d.ts +103 -0
  305. package/lib/types/portal/content-tree.js +344 -0
  306. package/lib/types/portal/content-tree.js.map +1 -0
  307. package/lib/types/portal/endpoint.d.ts +6 -0
  308. package/lib/types/portal/endpoint.js +12 -0
  309. package/lib/types/portal/endpoint.js.map +1 -0
  310. package/lib/types/portal/generated-pages.d.ts +68 -0
  311. package/lib/types/portal/generated-pages.js +111 -0
  312. package/lib/types/portal/generated-pages.js.map +1 -0
  313. package/lib/types/portal/generation-status.d.ts +31 -0
  314. package/lib/types/portal/generation-status.js +26 -0
  315. package/lib/types/portal/generation-status.js.map +1 -0
  316. package/lib/types/portal/openapi-document.d.ts +48 -0
  317. package/lib/types/portal/openapi-document.js +138 -0
  318. package/lib/types/portal/openapi-document.js.map +1 -0
  319. package/lib/types/portal/page-fragments.d.ts +13 -0
  320. package/lib/types/portal/page-fragments.js +24 -0
  321. package/lib/types/portal/page-fragments.js.map +1 -0
  322. package/lib/types/portal/page-template.d.ts +15 -0
  323. package/lib/types/portal/page-template.js +64 -0
  324. package/lib/types/portal/page-template.js.map +1 -0
  325. package/lib/types/portal/page.d.ts +24 -0
  326. package/lib/types/portal/page.js +100 -0
  327. package/lib/types/portal/page.js.map +1 -0
  328. package/lib/types/portal/portal-artifacts.d.ts +25 -0
  329. package/lib/types/portal/portal-artifacts.js +30 -0
  330. package/lib/types/portal/portal-artifacts.js.map +1 -0
  331. package/lib/types/portal/portal-config.d.ts +69 -0
  332. package/lib/types/portal/portal-config.js +105 -0
  333. package/lib/types/portal/portal-config.js.map +1 -0
  334. package/lib/types/portal/portal-downloads.d.ts +8 -0
  335. package/lib/types/portal/portal-downloads.js +14 -0
  336. package/lib/types/portal/portal-downloads.js.map +1 -0
  337. package/lib/types/portal/portal-languages.d.ts +15 -0
  338. package/lib/types/portal/portal-languages.js +45 -0
  339. package/lib/types/portal/portal-languages.js.map +1 -0
  340. package/lib/types/portal/portal-navigation.d.ts +65 -0
  341. package/lib/types/portal/portal-navigation.js +217 -0
  342. package/lib/types/portal/portal-navigation.js.map +1 -0
  343. package/lib/types/portal/portal-sdk.d.ts +15 -0
  344. package/lib/types/portal/portal-sdk.js +28 -0
  345. package/lib/types/portal/portal-sdk.js.map +1 -0
  346. package/lib/types/portal/portal-source.d.ts +129 -0
  347. package/lib/types/portal/portal-source.js +2 -0
  348. package/lib/types/portal/portal-source.js.map +1 -0
  349. package/lib/types/portal/portal-stylesheet.d.ts +19 -0
  350. package/lib/types/portal/portal-stylesheet.js +40 -0
  351. package/lib/types/portal/portal-stylesheet.js.map +1 -0
  352. package/lib/types/portal/portal-tabs.d.ts +33 -0
  353. package/lib/types/portal/portal-tabs.js +38 -0
  354. package/lib/types/portal/portal-tabs.js.map +1 -0
  355. package/lib/types/portal/preview-config.d.ts +20 -0
  356. package/lib/types/portal/preview-config.js +32 -0
  357. package/lib/types/portal/preview-config.js.map +1 -0
  358. package/lib/types/portal/preview-content.d.ts +18 -0
  359. package/lib/types/portal/preview-content.js +50 -0
  360. package/lib/types/portal/preview-content.js.map +1 -0
  361. package/lib/types/portal/published-package.d.ts +12 -0
  362. package/lib/types/portal/published-package.js +35 -0
  363. package/lib/types/portal/published-package.js.map +1 -0
  364. package/lib/types/portal/unknown-fields.d.ts +5 -0
  365. package/lib/types/portal/unknown-fields.js +10 -0
  366. package/lib/types/portal/unknown-fields.js.map +1 -0
  367. package/lib/types/portal-context.d.ts +38 -6
  368. package/lib/types/portal-context.js +71 -24
  369. package/lib/types/portal-context.js.map +1 -1
  370. package/lib/types/portal-source-context.d.ts +77 -0
  371. package/lib/types/portal-source-context.js +408 -0
  372. package/lib/types/portal-source-context.js.map +1 -0
  373. package/lib/types/project-context.d.ts +49 -0
  374. package/lib/types/project-context.js +151 -0
  375. package/lib/types/project-context.js.map +1 -0
  376. package/lib/types/project-layout.d.ts +9 -0
  377. package/lib/types/project-layout.js +10 -0
  378. package/lib/types/project-layout.js.map +1 -0
  379. package/lib/types/publish/package-settings-configuration.d.ts +2 -0
  380. package/lib/types/publish/profile-id.js +1 -0
  381. package/lib/types/publish/profile-id.js.map +1 -1
  382. package/lib/types/publish/publishing-profile.d.ts +3 -1
  383. package/lib/types/publish/publishing-profile.js +33 -15
  384. package/lib/types/publish/publishing-profile.js.map +1 -1
  385. package/lib/types/publish/publishing-profiles.js +2 -1
  386. package/lib/types/publish/publishing-profiles.js.map +1 -1
  387. package/lib/types/publish/version.js +1 -0
  388. package/lib/types/publish/version.js.map +1 -1
  389. package/lib/types/resource-context.js +3 -2
  390. package/lib/types/resource-context.js.map +1 -1
  391. package/lib/types/sdk/generate.d.ts +22 -16
  392. package/lib/types/sdk/generate.js +64 -41
  393. package/lib/types/sdk/generate.js.map +1 -1
  394. package/lib/types/sdk/stability-choice.d.ts +12 -0
  395. package/lib/types/sdk/stability-choice.js +24 -0
  396. package/lib/types/sdk/stability-choice.js.map +1 -0
  397. package/lib/types/sdk-context.d.ts +4 -5
  398. package/lib/types/sdk-context.js +10 -18
  399. package/lib/types/sdk-context.js.map +1 -1
  400. package/lib/types/spec-context.d.ts +5 -4
  401. package/lib/types/spec-context.js +9 -8
  402. package/lib/types/spec-context.js.map +1 -1
  403. package/lib/types/temp-context.d.ts +1 -1
  404. package/lib/types/temp-context.js +5 -4
  405. package/lib/types/temp-context.js.map +1 -1
  406. package/lib/types/transform-context.d.ts +9 -5
  407. package/lib/types/transform-context.js +21 -18
  408. package/lib/types/transform-context.js.map +1 -1
  409. package/lib/utils/error-utils.d.ts +2 -0
  410. package/lib/utils/error-utils.js +5 -0
  411. package/lib/utils/error-utils.js.map +1 -0
  412. package/lib/utils/json-utils.d.ts +2 -0
  413. package/lib/utils/json-utils.js +4 -0
  414. package/lib/utils/json-utils.js.map +1 -0
  415. package/lib/utils/string-utils.d.ts +8 -1
  416. package/lib/utils/string-utils.js +13 -26
  417. package/lib/utils/string-utils.js.map +1 -1
  418. package/lib/utils/utils.d.ts +1 -3
  419. package/lib/utils/utils.js +12 -40
  420. package/lib/utils/utils.js.map +1 -1
  421. package/oclif.manifest.json +154 -442
  422. package/package.json +47 -25
  423. package/portal-pages/context-plugin.mdx +26 -0
  424. package/portal-pages/sdk.mdx +8 -0
  425. package/portal-pages/sdks.mdx +11 -0
  426. package/portal-template/NOTICE +37 -0
  427. package/portal-template/downloads.ts +41 -0
  428. package/portal-template/generated-pages-reload.ts +51 -0
  429. package/portal-template/package.json +11 -0
  430. package/portal-template/portal-config.ts +32 -0
  431. package/portal-template/prerender-pages.ts +81 -0
  432. package/portal-template/spec-reload.ts +26 -0
  433. package/portal-template/src/components/api-page.tsx +15 -0
  434. package/portal-template/src/components/code-block.tsx +9 -0
  435. package/portal-template/src/components/command-block.tsx +50 -0
  436. package/portal-template/src/components/example-layout.tsx +99 -0
  437. package/portal-template/src/components/logos.tsx +127 -0
  438. package/portal-template/src/components/mdx.tsx +28 -0
  439. package/portal-template/src/components/not-found.tsx +11 -0
  440. package/portal-template/src/components/plugin-install.tsx +22 -0
  441. package/portal-template/src/components/plugin-support.tsx +53 -0
  442. package/portal-template/src/components/sdk-actions.tsx +79 -0
  443. package/portal-template/src/components/sdk-cards.tsx +100 -0
  444. package/portal-template/src/components/search.tsx +41 -0
  445. package/portal-template/src/components/usage-tabs.tsx +92 -0
  446. package/portal-template/src/lib/code-samples.server.ts +40 -0
  447. package/portal-template/src/lib/code-samples.ts +43 -0
  448. package/portal-template/src/lib/code-titles.ts +29 -0
  449. package/portal-template/src/lib/install-command.ts +13 -0
  450. package/portal-template/src/lib/json.ts +5 -0
  451. package/portal-template/src/lib/layout.shared.tsx +41 -0
  452. package/portal-template/src/lib/layout.tsx +16 -0
  453. package/portal-template/src/lib/llms.server.ts +54 -0
  454. package/portal-template/src/lib/media-adapters.ts +34 -0
  455. package/portal-template/src/lib/navigation.ts +406 -0
  456. package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
  457. package/portal-template/src/lib/openapi-filter.ts +191 -0
  458. package/portal-template/src/lib/openapi-labels.ts +15 -0
  459. package/portal-template/src/lib/openapi-methods.ts +12 -0
  460. package/portal-template/src/lib/openapi-section.server.ts +280 -0
  461. package/portal-template/src/lib/openapi-slim.ts +202 -0
  462. package/portal-template/src/lib/openapi.server.ts +16 -0
  463. package/portal-template/src/lib/portal-types.ts +36 -0
  464. package/portal-template/src/lib/portal.server.ts +13 -0
  465. package/portal-template/src/lib/portal.ts +11 -0
  466. package/portal-template/src/lib/rehype-code-titles.ts +53 -0
  467. package/portal-template/src/lib/request-examples.ts +72 -0
  468. package/portal-template/src/lib/seo.ts +21 -0
  469. package/portal-template/src/lib/shared.ts +51 -0
  470. package/portal-template/src/lib/shiki-bundle.ts +104 -0
  471. package/portal-template/src/lib/sitemap.server.ts +20 -0
  472. package/portal-template/src/lib/source.server.ts +27 -0
  473. package/portal-template/src/lib/source.ts +49 -0
  474. package/portal-template/src/lib/tabs.ts +37 -0
  475. package/portal-template/src/router.tsx +12 -0
  476. package/portal-template/src/routes/$.tsx +194 -0
  477. package/portal-template/src/routes/__root.tsx +56 -0
  478. package/portal-template/src/routes/api/search[.]json.ts +9 -0
  479. package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
  480. package/portal-template/src/routes/llms[.]txt.ts +10 -0
  481. package/portal-template/src/routes/robots[.]txt.ts +10 -0
  482. package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
  483. package/portal-template/src/routes/spa-shell.tsx +7 -0
  484. package/portal-template/src/routes/{$}[.]md.ts +21 -0
  485. package/portal-template/src/styles/app.css +33 -0
  486. package/portal-template/tsconfig.json +26 -0
  487. package/portal-template/vite.config.ts +68 -0
  488. package/lib/actions/plugin/record-sdk.d.ts +0 -14
  489. package/lib/actions/plugin/record-sdk.js +0 -60
  490. package/lib/actions/plugin/record-sdk.js.map +0 -1
  491. package/lib/actions/portal/copilot.d.ts +0 -17
  492. package/lib/actions/portal/copilot.js +0 -89
  493. package/lib/actions/portal/copilot.js.map +0 -1
  494. package/lib/actions/portal/quickstart.d.ts +0 -18
  495. package/lib/actions/portal/quickstart.js +0 -238
  496. package/lib/actions/portal/quickstart.js.map +0 -1
  497. package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
  498. package/lib/actions/portal/recipe/new-recipe.js +0 -177
  499. package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
  500. package/lib/actions/portal/toc/new-toc.d.ts +0 -21
  501. package/lib/actions/portal/toc/new-toc.js +0 -95
  502. package/lib/actions/portal/toc/new-toc.js.map +0 -1
  503. package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
  504. package/lib/actions/sdk/merge-source-tree.js +0 -78
  505. package/lib/actions/sdk/merge-source-tree.js.map +0 -1
  506. package/lib/actions/sdk/quickstart.d.ts +0 -18
  507. package/lib/actions/sdk/quickstart.js +0 -188
  508. package/lib/actions/sdk/quickstart.js.map +0 -1
  509. package/lib/actions/sdk/save-changes.d.ts +0 -8
  510. package/lib/actions/sdk/save-changes.js +0 -93
  511. package/lib/actions/sdk/save-changes.js.map +0 -1
  512. package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
  513. package/lib/application/portal/recipe/portal-recipe.js +0 -33
  514. package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
  515. package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
  516. package/lib/application/portal/recipe/recipe-generator.js +0 -130
  517. package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
  518. package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
  519. package/lib/application/portal/toc/toc-content-parser.js +0 -44
  520. package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
  521. package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
  522. package/lib/application/portal/toc/toc-structure-generator.js +0 -165
  523. package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
  524. package/lib/commands/portal/copilot.d.ts +0 -13
  525. package/lib/commands/portal/copilot.js +0 -34
  526. package/lib/commands/portal/copilot.js.map +0 -1
  527. package/lib/commands/portal/recipe/new.d.ts +0 -12
  528. package/lib/commands/portal/recipe/new.js +0 -45
  529. package/lib/commands/portal/recipe/new.js.map +0 -1
  530. package/lib/commands/portal/toc/new.d.ts +0 -16
  531. package/lib/commands/portal/toc/new.js +0 -68
  532. package/lib/commands/portal/toc/new.js.map +0 -1
  533. package/lib/commands/sdk/save-changes.d.ts +0 -14
  534. package/lib/commands/sdk/save-changes.js +0 -51
  535. package/lib/commands/sdk/save-changes.js.map +0 -1
  536. package/lib/infrastructure/debounce-service.d.ts +0 -10
  537. package/lib/infrastructure/debounce-service.js +0 -55
  538. package/lib/infrastructure/debounce-service.js.map +0 -1
  539. package/lib/infrastructure/services/portal-service.d.ts +0 -43
  540. package/lib/infrastructure/services/portal-service.js +0 -337
  541. package/lib/infrastructure/services/portal-service.js.map +0 -1
  542. package/lib/prompts/plugin/record-sdk.d.ts +0 -9
  543. package/lib/prompts/plugin/record-sdk.js +0 -40
  544. package/lib/prompts/plugin/record-sdk.js.map +0 -1
  545. package/lib/prompts/portal/copilot.d.ts +0 -18
  546. package/lib/prompts/portal/copilot.js +0 -82
  547. package/lib/prompts/portal/copilot.js.map +0 -1
  548. package/lib/prompts/portal/quickstart.d.ts +0 -42
  549. package/lib/prompts/portal/quickstart.js +0 -243
  550. package/lib/prompts/portal/quickstart.js.map +0 -1
  551. package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
  552. package/lib/prompts/portal/recipe/new-recipe.js +0 -165
  553. package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
  554. package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
  555. package/lib/prompts/portal/toc/new-toc.js +0 -50
  556. package/lib/prompts/portal/toc/new-toc.js.map +0 -1
  557. package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
  558. package/lib/prompts/sdk/merge-source-tree.js +0 -90
  559. package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
  560. package/lib/prompts/sdk/quickstart.d.ts +0 -38
  561. package/lib/prompts/sdk/quickstart.js +0 -196
  562. package/lib/prompts/sdk/quickstart.js.map +0 -1
  563. package/lib/prompts/sdk/save-changes.d.ts +0 -21
  564. package/lib/prompts/sdk/save-changes.js +0 -84
  565. package/lib/prompts/sdk/save-changes.js.map +0 -1
  566. package/lib/types/build-context.d.ts +0 -26
  567. package/lib/types/build-context.js +0 -111
  568. package/lib/types/build-context.js.map +0 -1
  569. package/lib/types/events/recipe-creation-failed.d.ts +0 -5
  570. package/lib/types/events/recipe-creation-failed.js +0 -8
  571. package/lib/types/events/recipe-creation-failed.js.map +0 -1
  572. package/lib/types/events/sdk-changes-saved.d.ts +0 -8
  573. package/lib/types/events/sdk-changes-saved.js +0 -11
  574. package/lib/types/events/sdk-changes-saved.js.map +0 -1
  575. package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
  576. package/lib/types/events/sdk-changes-tracked.js +0 -11
  577. package/lib/types/events/sdk-changes-tracked.js.map +0 -1
  578. package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
  579. package/lib/types/events/sdk-conflicts-resolved.js +0 -11
  580. package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
  581. package/lib/types/events/toc-creation-failed.d.ts +0 -5
  582. package/lib/types/events/toc-creation-failed.js +0 -8
  583. package/lib/types/events/toc-creation-failed.js.map +0 -1
  584. package/lib/types/merge-source-tree-context.d.ts +0 -28
  585. package/lib/types/merge-source-tree-context.js +0 -63
  586. package/lib/types/merge-source-tree-context.js.map +0 -1
  587. package/lib/types/plugin/language-entry.d.ts +0 -9
  588. package/lib/types/plugin/language-entry.js +0 -64
  589. package/lib/types/plugin/language-entry.js.map +0 -1
  590. package/lib/types/recipe/recipe.d.ts +0 -22
  591. package/lib/types/recipe/recipe.js +0 -6
  592. package/lib/types/recipe/recipe.js.map +0 -1
  593. package/lib/types/recipe-context.d.ts +0 -9
  594. package/lib/types/recipe-context.js +0 -26
  595. package/lib/types/recipe-context.js.map +0 -1
  596. package/lib/types/save-changes-context.d.ts +0 -17
  597. package/lib/types/save-changes-context.js +0 -42
  598. package/lib/types/save-changes-context.js.map +0 -1
  599. package/lib/types/sdl/sdl.d.ts +0 -10
  600. package/lib/types/sdl/sdl.js +0 -18
  601. package/lib/types/sdl/sdl.js.map +0 -1
  602. package/lib/types/toc/toc-components.d.ts +0 -36
  603. package/lib/types/toc/toc-components.js +0 -94
  604. package/lib/types/toc/toc-components.js.map +0 -1
  605. package/lib/types/toc/toc.d.ts +0 -67
  606. package/lib/types/toc/toc.js +0 -2
  607. package/lib/types/toc/toc.js.map +0 -1
  608. package/lib/types/toc-context.d.ts +0 -12
  609. package/lib/types/toc-context.js +0 -26
  610. package/lib/types/toc-context.js.map +0 -1
@@ -0,0 +1,121 @@
1
+ import { err, ok } from 'neverthrow';
2
+ import { FileService } from '../infrastructure/file-service.js';
3
+ import { errorMessage } from '../utils/error-utils.js';
4
+ import { stripByteOrderMark } from '../utils/string-utils.js';
5
+ import { APIMATIC_CONFIG_FILE_NAME, ApimaticConfigDocument } from './apimatic-config/document.js';
6
+ import { FileName } from './file/fileName.js';
7
+ import { FilePath } from './file/filePath.js';
8
+ /** How a file the CLI creates is laid out; one it found keeps its own layout. */
9
+ const DEFAULT_FORMAT = { indent: ' ', trailingNewline: true };
10
+ /** The `apimatic.json` in a project's `src/`, beside `APIMATIC-BUILD.json`. */
11
+ export class ApimaticConfigContext {
12
+ sourceDirectory;
13
+ fileService = new FileService();
14
+ constructor(sourceDirectory) {
15
+ this.sourceDirectory = sourceDirectory;
16
+ }
17
+ get configFile() {
18
+ return new FilePath(this.sourceDirectory, new FileName(APIMATIC_CONFIG_FILE_NAME));
19
+ }
20
+ async exists() {
21
+ return await this.fileService.fileExists(this.configFile);
22
+ }
23
+ async read() {
24
+ const loaded = await this.load();
25
+ if (loaded === undefined) {
26
+ return { state: 'missing' };
27
+ }
28
+ if (loaded.parsed.isErr()) {
29
+ return { state: 'unparseable', findings: loaded.parsed.error, path: this.configFile };
30
+ }
31
+ return { state: 'parsed', document: loaded.parsed.value, path: this.configFile };
32
+ }
33
+ /**
34
+ * Reads the document, hands the whole of it to `apply`, writes back the whole of what comes
35
+ * back. `blocks` names what the caller is about to write: a finding in one of them, or at
36
+ * the root, refuses the write, so a merge never spreads a malformed block into the file. A
37
+ * missing file starts from the empty document. A file that exists but cannot be parsed is
38
+ * left alone rather than overwritten, and a write fault is reported rather than thrown: this
39
+ * runs after work that already succeeded, and nothing here may turn that into a crash. A merge
40
+ * that changes nothing writes nothing, so re-running a command leaves the file as it was saved.
41
+ */
42
+ async merge(blocks, apply) {
43
+ const loaded = await this.load();
44
+ let document = ApimaticConfigDocument.empty();
45
+ let format = DEFAULT_FORMAT;
46
+ if (loaded !== undefined) {
47
+ if (loaded.parsed.isErr()) {
48
+ return err('unreadable');
49
+ }
50
+ document = loaded.parsed.value;
51
+ if (document.findingsFor('root', ...blocks).length > 0) {
52
+ return err('unreadable');
53
+ }
54
+ format = loaded.format;
55
+ }
56
+ const next = apply(document);
57
+ const serialized = next.serialize(format.indent, format.trailingNewline);
58
+ if (serialized === document.serialize(format.indent, format.trailingNewline)) {
59
+ return ok(next);
60
+ }
61
+ try {
62
+ await this.fileService.replaceContents(this.configFile, serialized);
63
+ }
64
+ catch {
65
+ return err('unwritable');
66
+ }
67
+ return ok(next);
68
+ }
69
+ /**
70
+ * Rewrites the file without its byte-order mark, if it has one. Reading past a mark is enough
71
+ * while the file stays here, but `plugin generate` zips it and sends it to a parser that is
72
+ * not this one. Only the mark goes: the rest is written back byte for byte, so a layout this
73
+ * CLI never chose, and the line endings with it, survive a rewrite nobody asked for.
74
+ */
75
+ async removeByteOrderMark() {
76
+ if (!(await this.fileService.fileExists(this.configFile))) {
77
+ return ok(undefined);
78
+ }
79
+ let text;
80
+ try {
81
+ text = await this.fileService.getContents(this.configFile);
82
+ }
83
+ catch {
84
+ return err('unreadable');
85
+ }
86
+ const stripped = stripByteOrderMark(text);
87
+ if (stripped === text) {
88
+ return ok(undefined);
89
+ }
90
+ try {
91
+ await this.fileService.replaceContents(this.configFile, stripped);
92
+ }
93
+ catch {
94
+ return err('unwritable');
95
+ }
96
+ return ok(undefined);
97
+ }
98
+ async load() {
99
+ if (!(await this.fileService.fileExists(this.configFile))) {
100
+ return undefined;
101
+ }
102
+ let text;
103
+ try {
104
+ text = await this.fileService.getContents(this.configFile);
105
+ }
106
+ catch (error) {
107
+ return {
108
+ parsed: err([{ block: 'root', field: null, problem: `could not be read: ${errorMessage(error)}` }]),
109
+ format: DEFAULT_FORMAT
110
+ };
111
+ }
112
+ return { parsed: ApimaticConfigDocument.parse(text), format: ApimaticConfigContext.detectFormat(text) };
113
+ }
114
+ // The first indented line says how the file is indented; a file with none gets the default.
115
+ // Line endings are not kept: the output is `\n` whatever the file used.
116
+ static detectFormat(text) {
117
+ const indent = /^([ \t]+)"/m.exec(text)?.[1] ?? DEFAULT_FORMAT.indent;
118
+ return { indent, trailingNewline: text.endsWith('\n') };
119
+ }
120
+ }
121
+ //# sourceMappingURL=apimatic-config-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apimatic-config-context.js","sourceRoot":"","sources":["../../src/types/apimatic-config-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EAGvB,MAAM,+BAA+B,CA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,CAAC;gBACnG,MAAM,EAAE,cAAc;aACvB,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1G,CAAC;IAED,4FAA4F;IAC5F,wEAAwE;IAChE,MAAM,CAAC,YAAY,CAAC,IAAY;QACtC,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC;QACtE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1D,CAAC;CACF"}
@@ -1,103 +1,15 @@
1
- import { DirectoryPath } from "../file/directoryPath.js";
2
- import { UrlPath } from "../file/urlPath.js";
3
1
  export interface BuildConfigData {
4
- generatePortal?: PortalConfig;
5
2
  generateVersionedPortal?: object;
6
3
  versionsPath?: string;
7
- apiCopilotConfig?: CopilotConfig;
8
- recipes?: RecipesConfig;
9
4
  [key: string]: unknown;
10
5
  }
11
- export interface PortalConfig {
12
- contentFolder?: string;
13
- languageConfig: {
14
- [key: string]: object;
15
- };
16
- /** URL where the portal will be hosted. Mirrors `generatePortal.baseUrl` in codegen. */
17
- baseUrl?: string;
18
- /** Portal UI settings. Mirrors `generatePortal.portalSettings` in codegen. */
19
- portalSettings?: PortalSettingsData;
20
- apiSpecPath?: DirectoryPath;
21
- [key: string]: unknown;
22
- }
23
- export interface PortalSettingsData {
24
- /** Base URL for the API calls made by the portal. Preferred over `generatePortal.baseUrl` for portal artifacts. */
25
- baseUrl?: string;
26
- /** Language/template id the portal opens on first load. */
27
- initialPlatform?: string;
28
- /** Per-language portal settings, keyed by language/template id. */
29
- languageSettings?: {
30
- [language: string]: LanguageSettingData;
31
- };
32
- [key: string]: unknown;
33
- }
34
- export interface LanguageSettingData {
35
- aiIntegration?: AiIntegration;
36
- [key: string]: unknown;
37
- }
38
- export interface AiIntegration {
39
- cursor?: AiIntegrationSetting;
40
- claudeCode?: AiIntegrationSetting;
41
- vscode?: AiIntegrationSetting;
42
- }
43
- export interface AiIntegrationSetting {
44
- isEnabled: boolean;
45
- stabilityLevelTag?: string;
46
- }
47
- export interface CopilotConfig {
48
- isEnabled: boolean;
49
- key: string;
50
- welcomeMessage: string;
51
- }
52
- export interface RecipesConfig {
53
- workflows?: RecipeWorkflow[];
54
- }
55
- export interface RecipeWorkflow {
56
- name: string;
57
- permalink: string;
58
- functionName: string;
59
- scriptPath: string;
60
- }
61
- export declare function getLanguagesConfig(selectedLanguages: string[]): {
62
- [key: string]: object;
63
- };
64
- export declare class LanguageSetting {
65
- private readonly data;
66
- private constructor();
67
- static from(data?: LanguageSettingData): LanguageSetting;
68
- /** Returns a copy with all AI editor integrations (Cursor/Claude Code/VS Code) enabled. */
69
- withAiIntegrationsEnabled(): LanguageSetting;
70
- toLanguageSettingData(): LanguageSettingData;
71
- }
72
- export declare class PortalSettings {
73
- private readonly data;
74
- private constructor();
75
- static from(data?: PortalSettingsData): PortalSettings;
76
- /** Returns a copy with the API-call base URL set. */
77
- withBaseUrl(baseUrl: UrlPath): PortalSettings;
78
- withAiIntegrations(languages: string[]): PortalSettings;
79
- toPortalSettingsData(): PortalSettingsData;
80
- }
81
6
  export declare class BuildConfig {
82
7
  private readonly data;
83
8
  private constructor();
84
9
  static parse(json: string): BuildConfig;
85
10
  static from(data: BuildConfigData): BuildConfig;
86
11
  toJSON(): BuildConfigData;
87
- /** Content directory for the portal, relative to the build directory. Defaults to "content". */
88
- contentFolder(): string;
89
- /** True when this build produces a multi-versioned portal. */
90
12
  isVersioned(): boolean;
91
- /** Directory holding the versioned portals, relative to the build directory. Defaults to "versioned_docs". */
13
+ /** Directory holding the versioned builds, relative to the source directory. Defaults to "versioned_docs". */
92
14
  versionsPath(): string;
93
- /** True when API Copilot is already configured for this build. */
94
- hasApiCopilot(): boolean;
95
- hasAiIntegration(): boolean;
96
- /** Returns a copy with the portal's languageConfig set from the selected friendly language ids. */
97
- withPortalLanguages(languages: string[]): BuildConfig;
98
- /** Returns a copy with the API Copilot configuration set (or overwritten). */
99
- withApiCopilotConfig(config: CopilotConfig): BuildConfig;
100
- withApiCopilotForPortal(key: string, welcomeMessage: string, baseUrl: UrlPath): BuildConfig;
101
- updateBuildConfigBaseUrl(serveUrl: UrlPath): BuildConfig;
102
- withRecipeWorkflow(name: string, functionName: string, scriptPath: string): BuildConfig;
103
15
  }
@@ -1,88 +1,8 @@
1
- import { UrlPath } from "../file/urlPath.js";
2
- export function getLanguagesConfig(selectedLanguages) {
3
- return selectedLanguages.reduce((config, lang) => {
4
- config[lang] = {};
5
- return config;
6
- }, {});
7
- }
8
- // Maps the CLI's friendly language identifiers (used as languageConfig keys) to
9
- // codegen's SupportedTemplates ids, which is what portalSettings.languageSettings
10
- // must be keyed by (codegen resolves these via SdkLanguage.FromSupportedTemplate).
11
- // These ids are version-specific in codegen (e.g. php_generic_lib_v2) — keep in sync
12
- // with APIMatic.CodeGen.Common.SdkLanguage.
13
- const CODEGEN_TEMPLATE_ID_BY_LANGUAGE = {
14
- typescript: "ts_generic_lib",
15
- csharp: "cs_net_standard_lib",
16
- java: "java_eclipse_jre_lib",
17
- php: "php_generic_lib_v2",
18
- python: "python_generic_lib",
19
- ruby: "ruby_generic_lib",
20
- go: "go_generic_lib"
21
- };
22
- // codegen derives initialPlatform from languageConfig (http is always first), so a
23
- // languageSettings entry for http must exist or the portal widget fails to render.
24
- const HTTP_TEMPLATE_ID = "http_curl_v1";
25
- // Immutable per-language portal setting. Build new values via the static factory and
26
- // the with* transforms; the wrapped data is never mutated after construction.
27
- export class LanguageSetting {
28
- constructor(data) {
29
- this.data = data;
30
- }
31
- static from(data = {}) {
32
- return new LanguageSetting(data);
33
- }
34
- /** Returns a copy with all AI editor integrations (Cursor/Claude Code/VS Code) enabled. */
35
- withAiIntegrationsEnabled() {
36
- return new LanguageSetting(Object.assign(Object.assign({}, this.data), { aiIntegration: {
37
- cursor: { isEnabled: true },
38
- claudeCode: { isEnabled: true },
39
- vscode: { isEnabled: true }
40
- } }));
41
- }
42
- toLanguageSettingData() {
43
- return this.data;
44
- }
45
- }
46
- // Immutable portal UI settings. Build new values via the static factory and the with*
47
- // transforms; the wrapped data is never mutated after construction.
48
- export class PortalSettings {
49
- constructor(data) {
50
- this.data = data;
51
- }
52
- static from(data = {}) {
53
- return new PortalSettings(data);
54
- }
55
- /** Returns a copy with the API-call base URL set. */
56
- withBaseUrl(baseUrl) {
57
- return new PortalSettings(Object.assign(Object.assign({}, this.data), { baseUrl: baseUrl.toString() }));
58
- }
59
- // Returns a copy with AI editor integrations enabled for the given SDK languages
60
- // (friendly ids). Always adds the http entry the portal needs to render and opens the
61
- // portal on the first SDK language. Languages without a codegen template id are skipped.
62
- withAiIntegrations(languages) {
63
- var _a;
64
- const languageSettings = Object.assign({}, this.data.languageSettings);
65
- languageSettings[HTTP_TEMPLATE_ID] = (_a = languageSettings[HTTP_TEMPLATE_ID]) !== null && _a !== void 0 ? _a : {};
66
- let firstSdkTemplateId;
67
- for (const language of languages) {
68
- const templateId = CODEGEN_TEMPLATE_ID_BY_LANGUAGE[language];
69
- if (!templateId) {
70
- continue;
71
- }
72
- firstSdkTemplateId !== null && firstSdkTemplateId !== void 0 ? firstSdkTemplateId : (firstSdkTemplateId = templateId);
73
- languageSettings[templateId] = LanguageSetting.from(languageSettings[templateId]).withAiIntegrationsEnabled().toLanguageSettingData();
74
- }
75
- return new PortalSettings(Object.assign(Object.assign(Object.assign({}, this.data), { languageSettings }), (firstSdkTemplateId ? { initialPlatform: firstSdkTemplateId } : {})));
76
- }
77
- toPortalSettingsData() {
78
- return this.data;
79
- }
80
- }
81
- // Immutable wrapper around the parsed APIMATIC-BUILD.json. All build-config reads go
82
- // through accessor methods and all changes go through with*/update methods that
83
- // return a NEW BuildConfig — the wrapped data is never mutated after construction.
84
- // Construct via `BuildConfig.parse`; persist via `BuildContext`.
1
+ // Immutable wrapper around the parsed APIMATIC-BUILD.json. Since version 2 the portal is
2
+ // configured by `src/apimatic.json` and built locally, so this file only describes SDK and
3
+ // plugin generation.
85
4
  export class BuildConfig {
5
+ data;
86
6
  constructor(data) {
87
7
  this.data = data;
88
8
  }
@@ -96,87 +16,12 @@ export class BuildConfig {
96
16
  toJSON() {
97
17
  return this.data;
98
18
  }
99
- /** Content directory for the portal, relative to the build directory. Defaults to "content". */
100
- contentFolder() {
101
- var _a, _b;
102
- return (_b = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.contentFolder) !== null && _b !== void 0 ? _b : "content";
103
- }
104
- /** True when this build produces a multi-versioned portal. */
105
19
  isVersioned() {
106
20
  return this.data.generateVersionedPortal != null;
107
21
  }
108
- /** Directory holding the versioned portals, relative to the build directory. Defaults to "versioned_docs". */
22
+ /** Directory holding the versioned builds, relative to the source directory. Defaults to "versioned_docs". */
109
23
  versionsPath() {
110
- var _a;
111
- return (_a = this.data.versionsPath) !== null && _a !== void 0 ? _a : "versioned_docs";
112
- }
113
- /** True when API Copilot is already configured for this build. */
114
- hasApiCopilot() {
115
- return this.data.apiCopilotConfig != null;
116
- }
117
- // True when at least one language has an AI editor integration (Context Plugin)
118
- // enabled in the portal settings. AI integration cannot exist without Copilot, but
119
- // Copilot can be present with AI integration disabled — so this is a distinct check.
120
- hasAiIntegration() {
121
- var _a, _b;
122
- const languageSettings = (_b = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.portalSettings) === null || _b === void 0 ? void 0 : _b.languageSettings;
123
- if (!languageSettings) {
124
- return false;
125
- }
126
- return Object.values(languageSettings).some((setting) => {
127
- const ai = setting.aiIntegration;
128
- return ai != null && [ai.cursor, ai.claudeCode, ai.vscode].some((editor) => (editor === null || editor === void 0 ? void 0 : editor.isEnabled) === true);
129
- });
130
- }
131
- /** Returns a copy with the portal's languageConfig set from the selected friendly language ids. */
132
- withPortalLanguages(languages) {
133
- const portal = this.data.generatePortal;
134
- return new BuildConfig(Object.assign(Object.assign({}, this.data), { generatePortal: Object.assign(Object.assign({}, portal), { languageConfig: getLanguagesConfig(languages) }) }));
135
- }
136
- /** Returns a copy with the API Copilot configuration set (or overwritten). */
137
- withApiCopilotConfig(config) {
138
- return new BuildConfig(Object.assign(Object.assign({}, this.data), { apiCopilotConfig: Object.assign({}, config) }));
139
- }
140
- // Returns a copy with API Copilot enabled for a locally-served portal: stores the
141
- // Copilot config, points the portal base URL at the local serve URL, and turns on AI
142
- // editor integrations for the configured SDK languages.
143
- withApiCopilotForPortal(key, welcomeMessage, baseUrl) {
144
- const portal = this.data.generatePortal;
145
- return new BuildConfig(Object.assign(Object.assign({}, this.data), { apiCopilotConfig: { isEnabled: true, key, welcomeMessage }, generatePortal: Object.assign(Object.assign({}, portal), { baseUrl: baseUrl.toString(), portalSettings: PortalSettings.from(portal.portalSettings)
146
- .withAiIntegrations(Object.keys(portal.languageConfig))
147
- .toPortalSettingsData() }) }));
148
- }
149
- // Returns a copy with the portal base URL repointed at the serve URL, or `this`
150
- // unchanged when there's no localhost base URL to rewrite (or it already matches the
151
- // serve URL). Callers detect a change via reference identity: `result !== original`.
152
- updateBuildConfigBaseUrl(serveUrl) {
153
- var _a, _b, _c, _d;
154
- // `portalSettings.baseUrl` is preferred for portal artifacts; otherwise fall back
155
- // to `generatePortal.baseUrl`. Mirrors how codegen resolves the base URL.
156
- const portalSettings = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.portalSettings;
157
- const baseUrl = (_b = portalSettings === null || portalSettings === void 0 ? void 0 : portalSettings.baseUrl) !== null && _b !== void 0 ? _b : (_c = this.data.generatePortal) === null || _c === void 0 ? void 0 : _c.baseUrl;
158
- if (!baseUrl) {
159
- return this;
160
- }
161
- const parsedUrl = UrlPath.create(baseUrl);
162
- if (!(parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.isLocalhost()) || parsedUrl.isEqual(serveUrl)) {
163
- return this;
164
- }
165
- const portal = this.data.generatePortal;
166
- const updatedPortal = ((_d = portal.portalSettings) === null || _d === void 0 ? void 0 : _d.baseUrl)
167
- ? Object.assign(Object.assign({}, portal), { portalSettings: PortalSettings.from(portal.portalSettings).withBaseUrl(serveUrl).toPortalSettingsData() }) : Object.assign(Object.assign({}, portal), { baseUrl: serveUrl.toString() });
168
- return new BuildConfig(Object.assign(Object.assign({}, this.data), { generatePortal: updatedPortal }));
169
- }
170
- // Returns a copy with a recipe workflow added (or replaced, matched by permalink).
171
- withRecipeWorkflow(name, functionName, scriptPath) {
172
- var _a, _b;
173
- const recipes = (_a = this.data.recipes) !== null && _a !== void 0 ? _a : {};
174
- const workflows = (_b = recipes.workflows) !== null && _b !== void 0 ? _b : [];
175
- const permalink = `page:recipes/${functionName}`;
176
- const workflow = { name, permalink, functionName, scriptPath };
177
- const existingIndex = workflows.findIndex((w) => w.permalink === permalink);
178
- const updatedWorkflows = existingIndex === -1 ? [...workflows, workflow] : workflows.map((w, index) => (index === existingIndex ? workflow : w));
179
- return new BuildConfig(Object.assign(Object.assign({}, this.data), { recipes: Object.assign(Object.assign({}, recipes), { workflows: updatedWorkflows }) }));
24
+ return this.data.versionsPath ?? 'versioned_docs';
180
25
  }
181
26
  }
182
27
  //# sourceMappingURL=build.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/types/build/build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAiE7C,MAAM,UAAU,kBAAkB,CAAC,iBAA2B;IAC5D,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;QAC/C,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAA+B,CAAC,CAAC;AACtC,CAAC;AAED,gFAAgF;AAChF,kFAAkF;AAClF,mFAAmF;AACnF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E,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;QAC5E,MAAM,gBAAgB,GACpB,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1H,OAAO,IAAI,WAAW,iCAAM,IAAI,CAAC,IAAI,KAAE,OAAO,kCAAO,OAAO,KAAE,SAAS,EAAE,gBAAgB,OAAK,CAAC;IACjG,CAAC;CACF"}
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/types/build/build.ts"],"names":[],"mappings":"AAMA,yFAAyF;AACzF,2FAA2F;AAC3F,qBAAqB;AACrB,MAAM,OAAO,WAAW;IACe,IAAI;IAAzC,YAAqC,IAAqB;oBAArB,IAAI;IAAoB,CAAC;IAEvD,MAAM,CAAC,KAAK,CAAC,IAAY;QAC9B,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC,CAAC;IAC/D,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,IAAqB;QACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,+EAA+E;IACxE,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC;IACnD,CAAC;IAED,8GAA8G;IACvG,YAAY;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,gBAAgB,CAAC;IACpD,CAAC;CACF"}
@@ -1,4 +1,7 @@
1
1
  export class DomainEvent {
2
+ message;
3
+ commandName;
4
+ flags;
2
5
  constructor(message, commandName, flags) {
3
6
  this.message = message;
4
7
  this.commandName = commandName;
@@ -1 +1 @@
1
- {"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/types/events/domain-event.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,WAAW;IAM/B,YAAsB,OAAe,EAAE,WAAmB,EAAE,KAA8B;QACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,eAAe,CAAC,KAA8B;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF"}
1
+ {"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/types/events/domain-event.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,WAAW;IAEd,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,KAAK,CAAW;IAEjC,YAAsB,OAAe,EAAE,WAAmB,EAAE,KAA8B;QACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,eAAe,CAAC,KAA8B;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF"}
@@ -1,10 +1,10 @@
1
1
  import { DomainEvent } from "./domain-event.js";
2
2
  export class QuickstartCompletedEvent extends DomainEvent {
3
+ eventName = QuickstartCompletedEvent.name;
4
+ static message = "Quickstart completed.";
5
+ static commandName = "quickstart";
3
6
  constructor() {
4
7
  super(QuickstartCompletedEvent.message, QuickstartCompletedEvent.commandName, {});
5
- this.eventName = QuickstartCompletedEvent.name;
6
8
  }
7
9
  }
8
- QuickstartCompletedEvent.message = "Quickstart completed.";
9
- QuickstartCompletedEvent.commandName = "quickstart";
10
10
  //# sourceMappingURL=quickstart-completed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quickstart-completed.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAKvD;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QALjE,cAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IAM7D,CAAC;;AALuB,gCAAO,GAAG,uBAAgC,AAAnC,CAAoC;AAC3C,oCAAW,GAAG,YAAqB,AAAxB,CAAyB"}
1
+ {"version":3,"file":"quickstart-completed.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACpC,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IACrD,MAAM,CAAU,OAAO,GAAG,uBAAgC,CAAC;IAC3D,MAAM,CAAU,WAAW,GAAG,YAAqB,CAAC;IAE5D;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;CACF"}
@@ -1,10 +1,10 @@
1
1
  import { DomainEvent } from "./domain-event.js";
2
2
  export class QuickstartInitiatedEvent extends DomainEvent {
3
+ eventName = QuickstartInitiatedEvent.name;
4
+ static message = "Quickstart initiated.";
5
+ static commandName = "quickstart";
3
6
  constructor() {
4
7
  super(QuickstartInitiatedEvent.message, QuickstartInitiatedEvent.commandName, {});
5
- this.eventName = QuickstartInitiatedEvent.name;
6
8
  }
7
9
  }
8
- QuickstartInitiatedEvent.message = "Quickstart initiated.";
9
- QuickstartInitiatedEvent.commandName = "quickstart";
10
10
  //# sourceMappingURL=quickstart-initiated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"quickstart-initiated.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-initiated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAKvD;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QALjE,cAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IAM7D,CAAC;;AALuB,gCAAO,GAAG,uBAAgC,AAAnC,CAAoC;AAC3C,oCAAW,GAAG,YAAqB,AAAxB,CAAyB"}
1
+ {"version":3,"file":"quickstart-initiated.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-initiated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACpC,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IACrD,MAAM,CAAU,OAAO,GAAG,uBAAgC,CAAC;IAC3D,MAAM,CAAU,WAAW,GAAG,YAAqB,CAAC;IAE5D;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;CACF"}
@@ -1,8 +1,8 @@
1
1
  import { DomainEvent } from './domain-event.js';
2
2
  export class SdkPublishValidationFailedEvent extends DomainEvent {
3
+ eventName = SdkPublishValidationFailedEvent.name;
3
4
  constructor(message, commandName, flags) {
4
5
  super(message, commandName, flags);
5
- this.eventName = SdkPublishValidationFailedEvent.name;
6
6
  }
7
7
  }
8
8
  //# sourceMappingURL=sdk-publish-validation-failed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-publish-validation-failed.js","sourceRoot":"","sources":["../../../src/types/events/sdk-publish-validation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,+BAAgC,SAAQ,WAAW;IAG9D,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAHlB,cAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;IAIpE,CAAC;CACF"}
1
+ {"version":3,"file":"sdk-publish-validation-failed.js","sourceRoot":"","sources":["../../../src/types/events/sdk-publish-validation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,+BAAgC,SAAQ,WAAW;IAC3C,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;IAEpE,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -1,8 +1,7 @@
1
- import { DirectoryPath } from "./directoryPath.js";
2
- import { FileName } from "./fileName.js";
3
- import { TocGroup } from "../toc/toc.js";
4
- import { FilePath } from "./filePath.js";
5
- import { TreeNode } from "../../prompts/format.js";
1
+ import { DirectoryPath } from './directoryPath.js';
2
+ import { FileName } from './fileName.js';
3
+ import { FilePath } from './filePath.js';
4
+ import { TreeNode } from '../../prompts/format.js';
6
5
  export type FileItem = {
7
6
  fileName: FileName;
8
7
  description?: string;
@@ -11,7 +10,6 @@ export type DirectoryItem = FileItem | Directory;
11
10
  export declare class Directory {
12
11
  readonly directoryPath: DirectoryPath;
13
12
  readonly items: DirectoryItem[];
14
- private readonly fileService;
15
13
  constructor(directoryPath: DirectoryPath, filePaths: DirectoryItem[]);
16
14
  private static readonly folderDescriptions;
17
15
  private static readonly fileDescriptions;
@@ -22,8 +20,5 @@ export declare class Directory {
22
20
  countFiles(): number;
23
21
  countDirectories(): number;
24
22
  getAllFiles(): FilePath[];
25
- parseContentFolder(baseContentPath: DirectoryPath): Promise<TocGroup[]>;
26
- private getPageName;
27
- private isRootContentDirectory;
28
23
  static createFromRelativePaths(rootDir: DirectoryPath, fileItems: FileItem[]): Directory;
29
24
  }