@apimatic/cli 1.4.0 → 2.0.0-beta.1

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 +222 -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 +102 -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 +199 -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 +70 -0
  227. package/lib/types/apimatic-config/document.js +167 -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 +69 -357
  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
@@ -1,57 +1,14 @@
1
- import { SemVersionString } from '../publish/version.js';
2
- import { CodeGenerationVersion, Language } from '../sdk/generate.js';
1
+ import { PluginLanguages } from '../apimatic-config/languages-block.js';
3
2
  /** Written unprompted: the backend consumes it, and nothing in the CLI asks for it. */
4
3
  export declare const DEFAULT_PLUGIN_LICENSE = "MIT";
4
+ /** Also the rule the metadata prompt validates against, so a plugin ID is legal as a repository name. */
5
+ export declare const PLUGIN_ID_PATTERN: RegExp;
5
6
  export interface PluginAuthor {
6
7
  name: string;
7
8
  email?: string;
8
9
  }
9
- export interface LanguageSource {
10
- repositoryUrl: string;
11
- branch?: string;
12
- }
13
- interface CSharpPackageConfig {
14
- packageId: string;
15
- version: SemVersionString;
16
- }
17
- interface JavaPackageConfig {
18
- groupId: string;
19
- artifactId: string;
20
- version: SemVersionString;
21
- }
22
- interface PhpPackageConfig {
23
- vendorName: string;
24
- projectName: string;
25
- version: SemVersionString;
26
- }
27
- interface NamedPackageConfig {
28
- name: string;
29
- version: SemVersionString;
30
- }
31
- type PythonPackageConfig = NamedPackageConfig;
32
- type RubyPackageConfig = NamedPackageConfig;
33
- type TypeScriptPackageConfig = NamedPackageConfig;
34
- interface GoPackageConfig {
35
- packageName: string;
36
- version: SemVersionString;
37
- }
38
- interface PluginConfig<TPackage> {
39
- source?: LanguageSource;
40
- package?: TPackage;
41
- codegenVersion: CodeGenerationVersion;
42
- }
43
- interface PluginConfigForLanguage {
44
- [Language.CSHARP]: PluginConfig<CSharpPackageConfig>;
45
- [Language.JAVA]: PluginConfig<JavaPackageConfig>;
46
- [Language.PHP]: PluginConfig<PhpPackageConfig>;
47
- [Language.PYTHON]: PluginConfig<PythonPackageConfig>;
48
- [Language.RUBY]: PluginConfig<RubyPackageConfig>;
49
- [Language.TYPESCRIPT]: PluginConfig<TypeScriptPackageConfig>;
50
- [Language.GO]: PluginConfig<GoPackageConfig>;
51
- }
52
- export type PluginLanguageEntry<L extends Language> = PluginConfigForLanguage[L];
53
- export type PluginLanguages = Partial<PluginConfigForLanguage>;
54
- export interface PluginConfigData {
10
+ /** The `plugin` block of `apimatic.json`: the identity `plugin generate` records. */
11
+ export interface PluginIdentityData {
55
12
  pluginId?: string;
56
13
  pluginName?: string;
57
14
  pluginVersion?: string;
@@ -60,13 +17,16 @@ export interface PluginConfigData {
60
17
  license?: string;
61
18
  homepage?: string;
62
19
  repository?: string;
63
- languages: PluginLanguages;
64
20
  [key: string]: unknown;
65
21
  }
22
+ /** The identity with `languages` beside it: the one configuration the plugin commands judge. */
23
+ export interface PluginConfigData extends PluginIdentityData {
24
+ languages: PluginLanguages;
25
+ }
66
26
  /** The fields the CLI asks for; everything else is derived, resolved or constant. */
67
27
  export interface PluginMetadata {
68
28
  pluginId: string;
69
29
  pluginName: string;
70
30
  pluginVersion: string;
71
31
  }
72
- export {};
32
+ export declare const PLACEHOLDER_METADATA: Readonly<PluginMetadata>;
@@ -1,4 +1,10 @@
1
- import { Language } from '../sdk/generate.js';
2
1
  /** Written unprompted: the backend consumes it, and nothing in the CLI asks for it. */
3
2
  export const DEFAULT_PLUGIN_LICENSE = 'MIT';
3
+ /** Also the rule the metadata prompt validates against, so a plugin ID is legal as a repository name. */
4
+ export const PLUGIN_ID_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
5
+ export const PLACEHOLDER_METADATA = Object.freeze({
6
+ pluginId: 'my-api-plugin',
7
+ pluginName: 'My API Plugin',
8
+ pluginVersion: '0.1.0'
9
+ });
4
10
  //# sourceMappingURL=plugin-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-config.js","sourceRoot":"","sources":["../../../src/types/plugin/plugin-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAErE,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"plugin-config.js","sourceRoot":"","sources":["../../../src/types/plugin/plugin-config.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAE5C,yGAAyG;AACzG,MAAM,CAAC,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAoC5D,MAAM,CAAC,MAAM,oBAAoB,GAA6B,MAAM,CAAC,MAAM,CAAC;IAC1E,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,eAAe;IAC3B,aAAa,EAAE,OAAO;CACvB,CAAC,CAAC"}
@@ -1,63 +1,56 @@
1
+ import { Result } from 'neverthrow';
2
+ import { ApimaticConfigWriteFailure } from './apimatic-config-context.js';
1
3
  import { DirectoryPath } from './file/directoryPath.js';
2
4
  import { FilePath } from './file/filePath.js';
3
- import { CodeGenerationVersion, Language } from './sdk/generate.js';
4
- import { PluginAuthor, PluginConfigData, PluginLanguageEntry, PluginMetadata } from './plugin/plugin-config.js';
5
+ import { PluginAuthor, PluginConfigData, PluginMetadata } from './plugin/plugin-config.js';
5
6
  import { SemVersion } from './publish/version.js';
6
- import { Result } from 'neverthrow';
7
- /** Also the rule the metadata prompt validates against, so a plugin ID is legal as a repository name. */
8
- export declare const PLUGIN_ID_PATTERN: RegExp;
7
+ import { Language } from './sdk/generate.js';
9
8
  export type PluginReleaseData = {
10
9
  pluginId: string;
11
10
  version: SemVersion;
12
11
  };
13
- /**
14
- * What a caller needs to know before generating. Metadata and languages are written by different
15
- * commands — `plugin generate` owns the first, `sdk publish` the second — so they are reported
16
- * separately. `path` rides on `unreadable` purely so the prompt can say where to fix the file.
17
- */
18
12
  export type PluginConfigState = {
19
13
  state: 'missing';
20
14
  } | {
21
15
  state: 'unreadable';
22
16
  reason: string;
23
17
  path: FilePath;
24
- } | PluginConfigPresent;
25
- export declare class PluginConfigPresent {
18
+ } | PluginConfig;
19
+ export declare class PluginConfig {
26
20
  private readonly config;
27
- readonly state: "present";
21
+ private readonly entries;
22
+ private readonly unsupported;
23
+ readonly state: 'present';
24
+ /** What a project without `apimatic.json` has recorded: nothing. */
25
+ static readonly empty: PluginConfig;
28
26
  private constructor();
29
- static create(config: PluginConfigData): PluginConfigPresent;
30
- hasPublishedSdks(): boolean;
27
+ /** The one place `languages` is sorted into what a plugin can carry and what it cannot. */
28
+ static create(config: PluginConfigData): PluginConfig;
29
+ publishedLanguages(): readonly Language[];
30
+ /** What `languages` names that a plugin can carry. */
31
+ recordedLanguages(): readonly Language[];
32
+ hasRecordedLanguages(): boolean;
33
+ unsupportedLanguages(): readonly string[];
31
34
  hasMetadata(): boolean;
32
- /**
33
- * Absent until `plugin generate` records the identity. The fields are checked rather than trusted:
34
- * they reach this class through a cast of parsed JSON, so a hand-edited config can hold a number
35
- * where the type promises a string.
36
- */
35
+ /** Nothing is left for `plugin generate` to ask: the identity and the languages are both recorded. */
36
+ isSetUp(): boolean;
37
37
  getRelease(): PluginReleaseData | undefined;
38
38
  hasNoSourceRepository(language: Language): boolean;
39
- assertNoCodegenVersionMismatch(codegenVersion: CodeGenerationVersion, language: Language, entry: PluginLanguageEntry<Language>): Result<void, {
40
- expected: CodeGenerationVersion;
41
- actual: CodeGenerationVersion;
42
- }>;
43
39
  }
44
- export type PluginConfigWriteFailure = 'unreadable' | 'unwritable';
40
+ export type PluginConfigWriteFailure = ApimaticConfigWriteFailure;
45
41
  export declare class PluginConfigContext {
46
- private readonly buildDirectory;
42
+ private readonly sourceDirectory;
43
+ private readonly configContext;
47
44
  private readonly fileService;
48
- constructor(buildDirectory: DirectoryPath);
49
- private get configPath();
45
+ constructor(sourceDirectory: DirectoryPath);
50
46
  getPluginConfigState(): Promise<PluginConfigState>;
51
- upsertMetadata(metadata: PluginMetadata, author?: PluginAuthor): Promise<Result<PluginConfigPresent, PluginConfigWriteFailure>>;
52
- upsertLanguage<L extends Language>(language: L, entry: PluginLanguageEntry<L>): Promise<Result<PluginConfigPresent, PluginConfigWriteFailure>>;
47
+ upsertMetadata(metadata: PluginMetadata, author?: PluginAuthor): Promise<Result<PluginConfig, PluginConfigWriteFailure>>;
48
+ recordLanguages(languages: readonly Language[]): Promise<Result<PluginConfig, PluginConfigWriteFailure>>;
53
49
  /**
54
- * A file that exists but cannot be parsed is left alone rather than overwritten, and a write
55
- * fault is reported rather than thrown: this runs after a publish that already succeeded, and
56
- * nothing here may turn that into a crash. A success carries the config as it now stands, so a
57
- * caller that has to decide something after writing does not have to read the file back.
50
+ * The `src/` to upload: a copy whose `languages` names exactly what the plugin covers. The
51
+ * user's file keeps the published entries this run leaves out; the service reads the copy.
58
52
  */
53
+ stageUpload(into: DirectoryPath, languages: readonly Language[]): Promise<Result<DirectoryPath, PluginConfigWriteFailure>>;
59
54
  private merge;
60
- private read;
61
- private parse;
62
- private write;
55
+ private static configOf;
63
56
  }
@@ -1,38 +1,60 @@
1
+ import { ResultAsync } from 'neverthrow';
1
2
  import { FileService } from '../infrastructure/file-service.js';
2
- import { FileName } from './file/fileName.js';
3
- import { FilePath } from './file/filePath.js';
3
+ import { ApimaticConfigContext } from './apimatic-config-context.js';
4
+ import { findingClause } from './apimatic-config/document.js';
5
+ import { isPublished, languagesOf } from './apimatic-config/languages-block.js';
4
6
  import { DEFAULT_PLUGIN_LICENSE } from './plugin/plugin-config.js';
5
7
  import { SemVersion } from './publish/version.js';
6
- import { err, ok } from 'neverthrow';
7
- /** Also the rule the metadata prompt validates against, so a plugin ID is legal as a repository name. */
8
- export const PLUGIN_ID_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
9
- const MALFORMED_PLUGIN_ID = `its 'pluginId' must be lower-case alphanumeric words separated by single dashes, ` +
10
- `for example 'acme-payments'`;
11
- const MALFORMED_PLUGIN_VERSION = `its 'pluginVersion' must be a version in the format major.minor.patch, for example '0.1.0'`;
12
- export class PluginConfigPresent {
13
- constructor(config) {
8
+ import { isAvailableLanguage } from './sdk/generate.js';
9
+ export class PluginConfig {
10
+ config;
11
+ entries;
12
+ unsupported;
13
+ state = 'present';
14
+ /** What a project without `apimatic.json` has recorded: nothing. */
15
+ static empty = PluginConfig.create({ languages: {} });
16
+ constructor(config, entries, unsupported) {
14
17
  this.config = config;
15
- this.state = 'present';
18
+ this.entries = entries;
19
+ this.unsupported = unsupported;
16
20
  }
21
+ /** The one place `languages` is sorted into what a plugin can carry and what it cannot. */
17
22
  static create(config) {
18
- return new PluginConfigPresent(config);
19
- }
20
- hasPublishedSdks() {
21
- const languages = this.config.languages;
22
- if (typeof languages !== 'object' || languages === null) {
23
- return false;
23
+ const entries = [];
24
+ const unsupported = [];
25
+ for (const [language, entry] of Object.entries(config.languages)) {
26
+ if (isAvailableLanguage(language)) {
27
+ entries.push([language, entry]);
28
+ }
29
+ else {
30
+ unsupported.push(language);
31
+ }
24
32
  }
25
- return Object.values(languages).some((entry) => (entry === null || entry === void 0 ? void 0 : entry.source) || (entry === null || entry === void 0 ? void 0 : entry.package));
33
+ return new PluginConfig(config, entries, unsupported);
34
+ }
35
+ publishedLanguages() {
36
+ return this.entries.filter(([, entry]) => isPublished(entry)).map(([language]) => language);
37
+ }
38
+ /** What `languages` names that a plugin can carry. */
39
+ recordedLanguages() {
40
+ return this.entries.map(([language]) => language);
26
41
  }
42
+ hasRecordedLanguages() {
43
+ return this.entries.length > 0;
44
+ }
45
+ unsupportedLanguages() {
46
+ return this.unsupported;
47
+ }
48
+ // Checked, not trusted: the config arrives through a cast of parsed JSON, so a hand-edited
49
+ // file can hold a number where the type promises a string.
27
50
  hasMetadata() {
28
51
  const isNonBlankString = (value) => typeof value === 'string' && value.trim() !== '';
29
52
  return isNonBlankString(this.config.pluginId) && isNonBlankString(this.config.pluginName);
30
53
  }
31
- /**
32
- * Absent until `plugin generate` records the identity. The fields are checked rather than trusted:
33
- * they reach this class through a cast of parsed JSON, so a hand-edited config can hold a number
34
- * where the type promises a string.
35
- */
54
+ /** Nothing is left for `plugin generate` to ask: the identity and the languages are both recorded. */
55
+ isSetUp() {
56
+ return this.hasMetadata() && this.hasRecordedLanguages();
57
+ }
36
58
  getRelease() {
37
59
  const pluginId = typeof this.config.pluginId === 'string' ? this.config.pluginId.trim() : '';
38
60
  const rawVersion = typeof this.config.pluginVersion === 'string' ? this.config.pluginVersion.trim() : '';
@@ -42,138 +64,85 @@ export class PluginConfigPresent {
42
64
  return SemVersion.tryCreate(rawVersion).match((version) => ({ pluginId, version }), () => undefined);
43
65
  }
44
66
  hasNoSourceRepository(language) {
45
- var _a, _b;
46
- return !((_b = (_a = this.config.languages) === null || _a === void 0 ? void 0 : _a[language]) === null || _b === void 0 ? void 0 : _b.source);
47
- }
48
- assertNoCodegenVersionMismatch(codegenVersion, language, entry) {
49
- var _a, _b, _c;
50
- if (entry.package && entry.source) {
51
- return ok(); // if both package and source are given, there is no possible mismatch
52
- }
53
- const existingEntry = (_a = this.config.languages) === null || _a === void 0 ? void 0 : _a[language];
54
- if (!existingEntry) {
55
- return ok();
56
- }
57
- if (!existingEntry.package && !existingEntry.source) {
58
- return ok();
59
- }
60
- const extractedVersion = (_c = (_b = this.config.languages) === null || _b === void 0 ? void 0 : _b[language]) === null || _c === void 0 ? void 0 : _c.codegenVersion;
61
- if (!extractedVersion) {
62
- return ok();
63
- }
64
- if (extractedVersion === codegenVersion) {
65
- return ok();
66
- }
67
- return err({ expected: codegenVersion, actual: extractedVersion });
67
+ return !this.config.languages?.[language]?.publishing?.source;
68
68
  }
69
69
  }
70
- function isJsonObject(value) {
71
- return typeof value === 'object' && value !== null && !Array.isArray(value);
72
- }
70
+ const OWNED_BLOCKS = ['plugin', 'languages'];
71
+ /**
72
+ * A `languages` block holding what the selection covers plus every entry `keep` speaks for.
73
+ * Existing keys stay in place, so a merge that changes nothing writes nothing.
74
+ */
75
+ const recorded = (document, languages, keep) => {
76
+ const existing = languagesOf(document);
77
+ const covered = new Set(languages);
78
+ const kept = Object.entries(existing).filter(([language, entry]) => covered.has(language) || keep(language, entry));
79
+ const added = languages.filter((language) => !(language in existing)).map((language) => [language, {}]);
80
+ return Object.fromEntries([...kept, ...added]);
81
+ };
82
+ /** In the user's file a cleared language goes, unless its entry records where an SDK was published. */
83
+ const keepsRecord = (language, entry) => !isAvailableLanguage(language) || isPublished(entry);
84
+ const isUnavailableLanguage = (language) => !isAvailableLanguage(language);
73
85
  export class PluginConfigContext {
74
- constructor(buildDirectory) {
75
- this.buildDirectory = buildDirectory;
76
- this.fileService = new FileService();
77
- }
78
- get configPath() {
79
- return new FilePath(this.buildDirectory, new FileName('plugin-config.json'));
86
+ sourceDirectory;
87
+ configContext;
88
+ fileService = new FileService();
89
+ constructor(sourceDirectory) {
90
+ this.sourceDirectory = sourceDirectory;
91
+ this.configContext = new ApimaticConfigContext(this.sourceDirectory);
80
92
  }
81
93
  async getPluginConfigState() {
82
- if (!(await this.fileService.fileExists(this.configPath))) {
94
+ const state = await this.configContext.read();
95
+ if (state.state === 'missing') {
83
96
  return { state: 'missing' };
84
97
  }
85
- const parsed = await this.parse();
86
- if ('reason' in parsed) {
87
- return { state: 'unreadable', reason: parsed.reason, path: this.configPath };
98
+ if (state.state === 'unparseable') {
99
+ return { state: 'unreadable', reason: findingClause(state.findings), path: state.path };
88
100
  }
89
- return PluginConfigPresent.create(parsed.config);
101
+ const findings = state.document.findingsFor('root', ...OWNED_BLOCKS);
102
+ if (findings.length > 0) {
103
+ return { state: 'unreadable', reason: findingClause(findings), path: state.path };
104
+ }
105
+ return PluginConfig.create(PluginConfigContext.configOf(state.document));
90
106
  }
91
107
  async upsertMetadata(metadata, author) {
92
- return await this.merge((config) => {
93
- var _a;
94
- return (Object.assign(Object.assign(Object.assign(Object.assign({}, config), { pluginId: metadata.pluginId, pluginName: metadata.pluginName, pluginVersion: metadata.pluginVersion }), (!config.author && author && { author })), { license: (_a = config.license) !== null && _a !== void 0 ? _a : DEFAULT_PLUGIN_LICENSE }));
108
+ return await this.merge((document) => {
109
+ const plugin = (document.plugin() ?? {});
110
+ return document.with('plugin', {
111
+ ...plugin,
112
+ pluginId: metadata.pluginId,
113
+ pluginName: metadata.pluginName,
114
+ pluginVersion: metadata.pluginVersion,
115
+ ...(!plugin.author && author && { author }),
116
+ license: plugin.license ?? DEFAULT_PLUGIN_LICENSE
117
+ });
95
118
  });
96
119
  }
97
- async upsertLanguage(language, entry) {
98
- return await this.merge((config) => {
99
- var _a, _b, _c;
100
- const languages = Object.assign({}, config.languages);
101
- const existingEntry = (_a = config.languages) === null || _a === void 0 ? void 0 : _a[language];
102
- languages[language] = Object.assign(Object.assign(Object.assign({}, existingEntry), entry), { source: (_b = entry.source) !== null && _b !== void 0 ? _b : existingEntry === null || existingEntry === void 0 ? void 0 : existingEntry.source, package: (_c = entry.package) !== null && _c !== void 0 ? _c : existingEntry === null || existingEntry === void 0 ? void 0 : existingEntry.package });
103
- return Object.assign(Object.assign({}, config), { languages });
104
- });
120
+ // A published entry survives a cleared checkbox: only `sdk publish` can write that record.
121
+ async recordLanguages(languages) {
122
+ return await this.merge((document) => document.with('languages', recorded(document, languages, keepsRecord)));
105
123
  }
106
124
  /**
107
- * A file that exists but cannot be parsed is left alone rather than overwritten, and a write
108
- * fault is reported rather than thrown: this runs after a publish that already succeeded, and
109
- * nothing here may turn that into a crash. A success carries the config as it now stands, so a
110
- * caller that has to decide something after writing does not have to read the file back.
125
+ * The `src/` to upload: a copy whose `languages` names exactly what the plugin covers. The
126
+ * user's file keeps the published entries this run leaves out; the service reads the copy.
111
127
  */
112
- async merge(apply) {
113
- const existing = await this.read();
114
- if ('reason' in existing) {
115
- return err('unreadable');
116
- }
117
- const merged = apply(existing.config);
118
- try {
119
- await this.write(merged);
120
- }
121
- catch (_a) {
122
- return err('unwritable');
123
- }
124
- return ok(PluginConfigPresent.create(merged));
128
+ async stageUpload(into, languages) {
129
+ const staged = into.join('build');
130
+ await this.fileService.copyDirectoryContents(this.sourceDirectory, staged);
131
+ const config = new ApimaticConfigContext(staged);
132
+ const covered = await config.merge(OWNED_BLOCKS, (document) => document.with('languages', recorded(document, languages, isUnavailableLanguage)));
133
+ // The merge writes nothing when it changes nothing, so a mark on the copy can outlive it —
134
+ // and the service reads this file with a parser that will not look past one.
135
+ return await covered.asyncAndThen(() => new ResultAsync(config.removeByteOrderMark())).map(() => staged);
125
136
  }
126
- async read() {
127
- if (!(await this.fileService.fileExists(this.configPath))) {
128
- return { config: { languages: {} } };
129
- }
130
- return await this.parse();
131
- }
132
- async parse() {
133
- const BYTE_ORDER_MARK = 0xfeff; // Notepad and PowerShell redirection can write it
134
- try {
135
- // TODO: JSON Parsing/Stringify should be in a dedicated JSON infra layer which preferably uses zod
136
- const contents = await this.fileService.getContents(this.configPath);
137
- if (contents.trim() === '') {
138
- return { reason: 'it is empty' };
139
- }
140
- if (contents.codePointAt(0) === BYTE_ORDER_MARK) {
141
- return { reason: 'it starts with a byte-order mark, which JSON does not allow' };
142
- }
143
- const parsed = JSON.parse(contents);
144
- if (!isJsonObject(parsed)) {
145
- return { reason: 'it is not a JSON object' };
146
- }
147
- // Every write merges these by spreading them, which turns a string into `{"0":"a"}` and a
148
- // number into nothing, so a wrong shape has to be refused before it can corrupt the file.
149
- const languages = parsed.languages;
150
- if (languages !== undefined) {
151
- if (!isJsonObject(languages)) {
152
- return { reason: `its 'languages' field is not a JSON object` };
153
- }
154
- for (const [language, entry] of Object.entries(languages)) {
155
- if (!isJsonObject(entry)) {
156
- return { reason: `its 'languages.${language}' entry is not a JSON object` };
157
- }
158
- }
159
- }
160
- const id = parsed.pluginId;
161
- if (typeof id === 'string' && (id.trim() === '' || !PLUGIN_ID_PATTERN.test(id))) {
162
- return { reason: MALFORMED_PLUGIN_ID };
163
- }
164
- const rawVersion = parsed.pluginVersion;
165
- if (typeof rawVersion === 'string' && (rawVersion.trim() === '' || SemVersion.tryCreate(rawVersion).isErr())) {
166
- return { reason: MALFORMED_PLUGIN_VERSION };
167
- }
168
- return { config: parsed };
169
- }
170
- catch (error) {
171
- return { reason: error instanceof Error ? error.message : String(error) };
172
- }
173
- }
174
- async write(config) {
175
- await this.fileService.ensurePathExists(this.configPath);
176
- await this.fileService.writeContents(this.configPath, JSON.stringify(config, null, 2));
137
+ async merge(apply) {
138
+ const merged = await this.configContext.merge(OWNED_BLOCKS, apply);
139
+ return merged.map((document) => PluginConfig.create(PluginConfigContext.configOf(document)));
140
+ }
141
+ static configOf(document) {
142
+ return {
143
+ ...document.plugin(),
144
+ languages: languagesOf(document)
145
+ };
177
146
  }
178
147
  }
179
148
  //# sourceMappingURL=plugin-config-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-config-context.js","sourceRoot":"","sources":["../../src/types/plugin-config-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EACL,sBAAsB,EAMvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,G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C,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAEO,MAAM,CAAC,QAAQ,CAAC,QAAgC;QACtD,OAAO;YACL,GAAI,QAAQ,CAAC,MAAM,EAAqC;YACxD,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC;SACjC,CAAC;IACJ,CAAC;CACF"}
@@ -3,10 +3,11 @@ import { ZipService } from '../infrastructure/zip-service.js';
3
3
  import { FileName } from './file/fileName.js';
4
4
  const GIT_DIRECTORY_NAME = '.git';
5
5
  export class PluginContext {
6
+ pluginDirectory;
7
+ fileService = new FileService();
8
+ zipService = new ZipService();
6
9
  constructor(pluginDirectory) {
7
10
  this.pluginDirectory = pluginDirectory;
8
- this.fileService = new FileService();
9
- this.zipService = new ZipService();
10
11
  }
11
12
  async exists() {
12
13
  return !(await this.fileService.directoryEmpty(this.pluginDirectory));
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-context.js","sourceRoot":"","sources":["../../src/types/plugin-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,OAAO,aAAa;IAIxB,YAA6B,eAA8B;QAA9B,oBAAe,GAAf,eAAe,CAAe;QAH1C,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEe,CAAC;IAExD,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC3B,MAAM,SAAS,GAAG,MAAM,IA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C,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC3B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5E,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAE5E,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,UAAU,EAAE,EAAE,cAAc,EAAE,WAAW,CAAC,gBAAgB,EAAE,EAAE,CAAC;IACjG,CAAC;IAEM,KAAK,CAAC,gBAAgB;QAC3B,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC/F,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B;QAC5C,4GAA4G;QAC5G,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAuB,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACzG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5E,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import { Language } from '../sdk/generate.js';
2
+ import { Endpoint } from './endpoint.js';
3
+ type Sources = Record<string, string>;
4
+ export interface CodeSample {
5
+ lang: Language;
6
+ label: string;
7
+ sources: Sources;
8
+ }
9
+ /** Each endpoint's samples, keyed by path and then by upper-case method: what the portal template reads. */
10
+ export type CodeSamplesByEndpoint = Record<string, Record<string, CodeSample[]>>;
11
+ export declare class CodeSampleCatalog {
12
+ private readonly samplesByEndpoint;
13
+ private constructor();
14
+ static fromJson(language: Language, json: unknown): CodeSampleCatalog | undefined;
15
+ sampleFor(endpoint: Endpoint): CodeSample | undefined;
16
+ endpoints(): Endpoint[];
17
+ }
18
+ export declare class CodeSampleCatalogs {
19
+ private readonly catalogs;
20
+ constructor(catalogs: CodeSampleCatalog[]);
21
+ isEmpty(): boolean;
22
+ samplesFor(endpoint: Endpoint): CodeSample[];
23
+ unplacedIn(documented: Endpoint[]): string[];
24
+ toJson(): CodeSamplesByEndpoint;
25
+ private endpoints;
26
+ }
27
+ export {};