@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
@@ -1,243 +0,0 @@
1
- import { isCancel, log, multiselect, select, text } from "@clack/prompts";
2
- import { LANGUAGE_CHOICES } from "../../types/sdk/generate.js";
3
- import { format as f, getTree } from "../format.js";
4
- import { DirectoryPath } from "../../types/file/directoryPath.js";
5
- import { removeQuotes } from "../../utils/string-utils.js";
6
- import { createResourceInputFromInput } from "../../types/file/resource-input.js";
7
- import { noteWrapped, withSpinner } from "../prompt.js";
8
- const vscodeExtensionUrl = "https://marketplace.visualstudio.com/items?itemName=apimatic-developers.apimatic-for-vscode";
9
- const referenceDocumentationUrl = "https://docs.apimatic.io/cli-getting-started/advanced-portal-setup";
10
- const pricingUrl = "https://www.apimatic.io/pricing";
11
- export class PortalQuickstartPrompts {
12
- importSpecStep() {
13
- log.info(`Step 1 of 4: Import your OpenAPI Definition`);
14
- }
15
- async specPathPrompt(defaultSpecUrl) {
16
- const spec = await text({
17
- message: `Provide a local path or a public URL for your OpenAPI Definition file:`,
18
- placeholder: "Provide absolute URL/local path or press Enter to use a sample OpenAPI file from APIMatic.",
19
- defaultValue: defaultSpecUrl.toString(),
20
- validate: (value) => {
21
- if (value && !createResourceInputFromInput(value)) {
22
- return "Please enter a valid file path or URL.";
23
- }
24
- }
25
- });
26
- if (isCancel(spec)) {
27
- return undefined;
28
- }
29
- return createResourceInputFromInput(spec);
30
- }
31
- specFileDoesNotExist() {
32
- log.error("The specified file does not exist or is not a valid file. Please enter a valid file path.");
33
- }
34
- noSpecSpecified() {
35
- log.error("No API Definition was provided.");
36
- }
37
- async useDefaultSpecPrompt() {
38
- const useDefaultSpec = await select({
39
- message: `How would you like to proceed?`,
40
- options: [
41
- {
42
- value: "no",
43
- label: `1. Fix the issues using APIMatic's interactive VS Code Extension: ${vscodeExtensionUrl}`
44
- },
45
- { value: "yes", label: `2. Use an example API spec instead (recommended)` }
46
- ]
47
- });
48
- if (isCancel(useDefaultSpec)) {
49
- return false;
50
- }
51
- return useDefaultSpec === "yes";
52
- }
53
- fixYourSpec() {
54
- const message = `Good luck fixing your API Definition! Feel free to run this command again once you're done.`;
55
- log.info(message);
56
- }
57
- validateSpecStep() {
58
- log.info(`Step 2 of 4: Validate and Lint your OpenAPI Definition`);
59
- }
60
- splitSpecDetected(unallowed) {
61
- const featuresList = unallowed.Features.map((f) => ` • ${f}`).join("\n");
62
- let endpointMessage = "";
63
- if (unallowed.EndpointLimit < unallowed.EndpointCount) {
64
- endpointMessage = `\nEndpoint limit exceeded: ${unallowed.EndpointCount} endpoints found, but your plan allows ${unallowed.EndpointLimit}\n`;
65
- }
66
- const message = [
67
- "Your API Specification includes components not available on your current subscription plan:",
68
- "",
69
- featuresList,
70
- endpointMessage,
71
- "To continue:",
72
- "- Remove these components from your API Specification and re-run this command.",
73
- "- Combine your split API Specification files into a single file. We can automatically remove unsupported components from single-file specs.",
74
- `- Upgrade your subscription to unlock additional features: ${f.link(pricingUrl)}`
75
- ].join("\n");
76
- log.info(message);
77
- }
78
- stripUnallowedFeaturesStep(unallowed) {
79
- const featuresList = unallowed.Features.map((f) => ` • ${f}`).join("\n");
80
- let endpointMessage = "";
81
- if (unallowed.EndpointLimit < unallowed.EndpointCount) {
82
- const endpointsToRemove = unallowed.EndpointCount - unallowed.EndpointLimit;
83
- endpointMessage = `\n${endpointsToRemove} endpoint(s) will be removed from your spec\n`;
84
- }
85
- const message = [
86
- "Your API Specification includes components not available on your current subscription plan.",
87
- "We'll automatically remove these components before proceeding:",
88
- featuresList,
89
- endpointMessage,
90
- "",
91
- "You won't see these components in the generated SDKs or documentation.",
92
- `Want to keep them? Upgrade your subscription to unlock additional features: ${f.link(pricingUrl)}`
93
- ].join("\n");
94
- log.info(message);
95
- }
96
- selectLanguagesStep() {
97
- log.info(`Step 3 of 4: Select programming languages`);
98
- }
99
- async selectLanguagesPrompt(allowedLanguages) {
100
- const allowed = new Set(allowedLanguages);
101
- const available = LANGUAGE_CHOICES.filter(({ value }) => allowed.has(value));
102
- const excluded = LANGUAGE_CHOICES.filter(({ value }) => !allowed.has(value));
103
- if (excluded.length > 0) {
104
- log.info(this.languagesNotOnPlanNote(excluded.map(({ label }) => label)));
105
- }
106
- const languages = (await multiselect({
107
- message: "Your API Portal can contain Context Plugins for AI agents, SDKs, and SDK documentation in the following languages (HTTP is enabled by default). Press Enter to continue with all languages, or use the arrow keys and Space to customize your selection",
108
- options: available.map(({ label, value }) => ({ label, value })),
109
- initialValues: available.map(({ value }) => value),
110
- required: false
111
- }));
112
- if (isCancel(languages)) {
113
- return undefined;
114
- }
115
- return ["http", ...languages];
116
- }
117
- httpOnlyPortalOnPlan() {
118
- const message = [
119
- "Your current subscription plan doesn't include any SDK languages, so the portal will contain HTTP documentation only.",
120
- `Upgrade your subscription to unlock SDK languages: ${f.link(pricingUrl)}`
121
- ].join("\n");
122
- log.warn(message);
123
- }
124
- onPremGenerationNotAllowedOnPlan() {
125
- const message = [
126
- "Your current subscription plan doesn't include on-prem generation.",
127
- `Upgrade your subscription to get started: ${f.link(pricingUrl)}`
128
- ].join("\n");
129
- log.warn(message);
130
- }
131
- languagesNotOnPlanNote(languages) {
132
- return [
133
- `The following languages aren't included in your current subscription plan`,
134
- ...languages.map((language) => ` • ${language}`),
135
- "",
136
- `Upgrade your subscription to unlock them: ${f.link(pricingUrl)}`
137
- ].join("\n");
138
- }
139
- noLanguagesSelected() {
140
- log.error("No programming languages were selected.");
141
- }
142
- buildFilePruned(report) {
143
- const removed = [];
144
- if (report.removedLanguages.length > 0) {
145
- removed.push(`SDK languages: ${report.removedLanguages.join(", ")}`);
146
- }
147
- if (report.removedApiCopilot) {
148
- removed.push("API Copilot");
149
- }
150
- if (report.removedAiIntegration) {
151
- removed.push("Context plugins (Cursor / VS Code / Claude Code)");
152
- }
153
- if (removed.length === 0) {
154
- return;
155
- }
156
- const message = [
157
- "Some portal features aren't on your current subscription plan and were removed before generation:",
158
- "",
159
- ...removed.map((item) => ` • ${item}`),
160
- "",
161
- `Upgrade your subscription to unlock these: ${f.link(pricingUrl)}`
162
- ].join("\n");
163
- log.warn(message);
164
- }
165
- selectInputDirectoryStep() {
166
- log.info(`Step 4 of 4: Generate source files for Docs as Code`);
167
- }
168
- async inputDirectoryPathPrompt() {
169
- var _a;
170
- const inputDirectory = await text({
171
- message: "Enter the directory path where you would like to setup the API Portal (Requires an empty directory):",
172
- placeholder: "Provide absolute path to the directory or press Enter to use the current directory.",
173
- defaultValue: "./"
174
- });
175
- if (isCancel(inputDirectory)) {
176
- return undefined;
177
- }
178
- const cleanedPath = removeQuotes((_a = inputDirectory === null || inputDirectory === void 0 ? void 0 : inputDirectory.trim()) !== null && _a !== void 0 ? _a : "");
179
- return new DirectoryPath(cleanedPath);
180
- }
181
- inputDirectoryPathDoesNotExist(inputDirectory) {
182
- log.error(`The specified directory path ${f.path(inputDirectory)} does not exist.`);
183
- }
184
- inputDirectoryNotEmpty(inputDirectory) {
185
- log.error(`The target directory ${f.path(inputDirectory)} is not empty. Please provide a path to an empty directory or clear its contents.`);
186
- }
187
- noInputDirectoryProvided() {
188
- log.error("No directory was specified.");
189
- }
190
- downloadBuildDirectory(fn) {
191
- return withSpinner("Setting up source directory", `Source directory set up successfully`, "Unable to set up source directory", fn);
192
- }
193
- downloadSpecFile(fn) {
194
- return withSpinner("Downloading API Definition", `API Definition downloaded`, "Unable to download API Definition", fn);
195
- }
196
- nextSteps(hasAiIntegration) {
197
- const message = hasAiIntegration
198
- ? `Your API Portal is ready with Context Plugins enabled.
199
-
200
- Install your API's Context Plugins in Cursor, VS Code, or Claude Code to help AI coding agents understand your API and generate more accurate code.
201
-
202
- Explore customization options, including Portal themes and API Recipes.
203
- ${f.link(referenceDocumentationUrl)}`
204
- : `Use the API Playground or an SDK to call your API.
205
- Customize the Portal theme, add API recipes and enable AI features
206
- ${f.link(referenceDocumentationUrl)}`;
207
- noteWrapped(message, "Next Steps");
208
- }
209
- serviceError(serviceError) {
210
- log.error(serviceError.errorMessage);
211
- }
212
- async selectCopilotKey(keys) {
213
- const selectedKey = await select({
214
- message: "Select an API Copilot key for this portal:",
215
- maxItems: 10,
216
- options: keys.map((key) => ({ value: key, label: key }))
217
- });
218
- if (isCancel(selectedKey)) {
219
- return undefined;
220
- }
221
- return selectedKey;
222
- }
223
- noCopilotKeySelected() {
224
- log.error("No API Copilot key was selected.");
225
- }
226
- accountInfoFetchFailed(serviceError) {
227
- log.error(`Failed to fetch your account information. ${serviceError.errorMessage}`);
228
- }
229
- copilotEnabled(key) {
230
- const message = `API Copilot is enabled with key ${f.var(key)}. ` +
231
- `Any existing Copilot context associated with this key will be overwritten when the portal is generated.`;
232
- log.warn(message);
233
- }
234
- printDirectoryStructure(inputDirectory, directory) {
235
- const heading = `${f.var("src")} directory containing source files created at ${f.path(inputDirectory)}\n`;
236
- const message = getTree(directory.toTreeNode());
237
- log.info(heading + message);
238
- }
239
- specValidationFailed() {
240
- log.error(`Oops, it looks like there are some errors in your API Definition`);
241
- }
242
- }
243
- //# sourceMappingURL=quickstart.js.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AAO,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;QAChD,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAEM,oBAAoB;QACzB,GAAG,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;IAChF,CAAC;CACF"}
@@ -1,29 +0,0 @@
1
- import { Sdl, SdlEndpoint } from "../../../types/sdl/sdl.js";
2
- import { DirectoryPath } from "../../../types/file/directoryPath.js";
3
- import { TreeNode } from "../../format.js";
4
- import { StepType } from "../../../types/recipe/recipe.js";
5
- import { ServiceError } from "../../../infrastructure/service-error.js";
6
- import { Result } from "neverthrow";
7
- export declare class PortalRecipePrompts {
8
- displayWelcomeMessage(): void;
9
- recipeNameEmpty(): void;
10
- contentFolderNotFound(): void;
11
- specFileEmptyInvalid(): void;
12
- recipeNamePrompt(): Promise<string | undefined>;
13
- stepNamePrompt(defaultStepName: string): Promise<string | undefined>;
14
- displayStepsInformation(): void;
15
- stepTypeSelectionPrompt(): Promise<StepType | undefined>;
16
- endpointGroupNamePrompt(endpointGroups: Map<string, SdlEndpoint[]>): Promise<string | undefined>;
17
- endpointNamePrompt(endpointGroups: Map<string, SdlEndpoint[]>, endpointGroupName: string): Promise<string | undefined>;
18
- endpointDescriptionPrompt(defaultDescription: string): Promise<string | undefined>;
19
- addAnotherStepSelectionPrompt(): Promise<boolean>;
20
- overwriteApiRecipeInTocPrompt(name: string): Promise<boolean>;
21
- displayStepAddedSuccessfullyMessage(): void;
22
- invalidBuildDirectory(directory: DirectoryPath): void;
23
- serviceError(serviceError: ServiceError): void;
24
- openRecipeMarkdownEditor(): void;
25
- displayRecipeStructure(tocStructure: TreeNode): void;
26
- nextSteps(): void;
27
- generateSdl(fn: Promise<Result<Sdl, ServiceError>>): Promise<Result<Sdl, ServiceError>>;
28
- recipeCreated(): void;
29
- }
@@ -1,165 +0,0 @@
1
- import { select, text, isCancel, log, autocomplete, confirm } from "@clack/prompts";
2
- import { format as f, getTree } from "../../format.js";
3
- import { noteWrapped, withSpinner } from "../../prompt.js";
4
- export class PortalRecipePrompts {
5
- displayWelcomeMessage() {
6
- log.step(`Welcome to the API Recipe Generation Wizard.`);
7
- const message = `This wizard will guide you through the process of creating an API Recipe.
8
-
9
- An API Recipe is a collection of steps that allows you to define a single use case for your API Documentation portal.
10
- Learn more: ${f.link("https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/api-recipes")}
11
-
12
- Let's get started!`;
13
- log.info(message);
14
- }
15
- recipeNameEmpty() {
16
- const message = "No recipe name provided";
17
- log.error(message);
18
- }
19
- contentFolderNotFound() {
20
- const message = "Content folder not found.";
21
- log.error(message);
22
- }
23
- specFileEmptyInvalid() {
24
- const message = "Spec file is empty or invalid.";
25
- log.error(message);
26
- }
27
- async recipeNamePrompt() {
28
- const recipeName = await text({
29
- message: `Enter a name for your API Recipe:`,
30
- placeholder: "This name will be displayed in your API Documentation portal sidebar.",
31
- validate: (name) => {
32
- if (!name) {
33
- return "Recipe name cannot be empty. Please provide a name for your API Recipe.";
34
- }
35
- }
36
- });
37
- if (isCancel(recipeName)) {
38
- return undefined;
39
- }
40
- return recipeName.trim();
41
- }
42
- async stepNamePrompt(defaultStepName) {
43
- const stepName = await text({
44
- message: `Enter a name for the step:`,
45
- defaultValue: defaultStepName,
46
- placeholder: `Press enter to use the default, i.e. ${defaultStepName}`
47
- });
48
- if (isCancel(stepName)) {
49
- return undefined;
50
- }
51
- return stepName.trim();
52
- }
53
- displayStepsInformation() {
54
- log.step(`Add Steps to your API Recipe:`);
55
- const message = `You can add:
56
- 1. Content Step: Display custom content, such as instructions or information related to your API.
57
- 2. Endpoint Step: Display an API endpoint, its playground and other relevant details.
58
- Steps appear in the order you add them.
59
- Let's proceed to adding steps to your API Recipe.`;
60
- log.message(message);
61
- }
62
- async stepTypeSelectionPrompt() {
63
- const stepType = await select({
64
- message: `Select the type of step you want to add:`,
65
- options: [
66
- { value: "content", label: "Content Step", hint: "For displaying custom content" },
67
- { value: "endpoint", label: "Endpoint Step", hint: "For displaying an API endpoint with its details" }
68
- ]
69
- });
70
- if (isCancel(stepType)) {
71
- return undefined;
72
- }
73
- return stepType;
74
- }
75
- async endpointGroupNamePrompt(endpointGroups) {
76
- const groupNames = Array.from(endpointGroups.keys()).map((name) => ({
77
- value: name,
78
- label: name
79
- }));
80
- const endpointGroupName = await autocomplete({
81
- message: `Select the endpoint group name:`,
82
- maxItems: 10,
83
- options: groupNames
84
- });
85
- if (isCancel(endpointGroupName)) {
86
- return undefined;
87
- }
88
- return endpointGroupName.trim();
89
- }
90
- async endpointNamePrompt(endpointGroups, endpointGroupName) {
91
- const endpoints = endpointGroups.get(endpointGroupName);
92
- const endpointName = await autocomplete({
93
- message: `Select the name of the endpoint:`,
94
- maxItems: 10,
95
- options: endpoints.map((endpoint) => ({
96
- value: endpoint.Name,
97
- label: endpoint.Name
98
- }))
99
- });
100
- if (isCancel(endpointName)) {
101
- return undefined;
102
- }
103
- return endpointName.trim();
104
- }
105
- async endpointDescriptionPrompt(defaultDescription) {
106
- const endpointDescription = await text({
107
- message: `Enter a description for the endpoint:`,
108
- placeholder: `Optional. Leave this empty to use the endpoint description defined in the API Specification`,
109
- defaultValue: defaultDescription
110
- });
111
- if (isCancel(endpointDescription)) {
112
- return undefined;
113
- }
114
- return endpointDescription.trim();
115
- }
116
- async addAnotherStepSelectionPrompt() {
117
- const addAnotherStep = await confirm({
118
- message: `Do you want to add another step?`,
119
- initialValue: true
120
- });
121
- if (isCancel(addAnotherStep)) {
122
- return false;
123
- }
124
- return addAnotherStep;
125
- }
126
- async overwriteApiRecipeInTocPrompt(name) {
127
- const overwrite = await confirm({
128
- message: `An API Recipe with name ${f.var(name)} already exists. Do you want to overwrite it?`,
129
- initialValue: false
130
- });
131
- if (isCancel(overwrite)) {
132
- return false;
133
- }
134
- return overwrite;
135
- }
136
- displayStepAddedSuccessfullyMessage() {
137
- log.step(`Step has been added successfully.`);
138
- }
139
- invalidBuildDirectory(directory) {
140
- const message = `The ${f.var("src")} directory is either empty or invalid: ${f.path(directory)}`;
141
- log.error(message);
142
- }
143
- serviceError(serviceError) {
144
- log.error(serviceError.errorMessage);
145
- }
146
- openRecipeMarkdownEditor() {
147
- log.step("Opening markdown editor for you to enter recipe content...");
148
- }
149
- displayRecipeStructure(tocStructure) {
150
- const heading = `You can edit the following files to customize your API Recipe:\n`;
151
- const message = getTree(tocStructure);
152
- log.info(heading + message);
153
- }
154
- nextSteps() {
155
- const message = `Run the command '${f.cmdAlt(`apimatic`, 'portal', 'serve')}' to preview your documentation portal`;
156
- noteWrapped(message, "Next Steps");
157
- }
158
- generateSdl(fn) {
159
- return withSpinner("Extracting endpoints", "Endpoints extracted", "Endpoints extraction failed", fn);
160
- }
161
- recipeCreated() {
162
- log.info(`A new API Recipe has been created successfully.`);
163
- }
164
- }
165
- //# sourceMappingURL=new-recipe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-recipe.js","sourceRoot":"","sources":["../../../../src/prompts/portal/recipe/new-recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGpF,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAIjE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,OAAO,mBAAmB;IACvB,qBAAqB;QAC1B,GAAG,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG;;;cAGN,CAAC,CAAC,IAAI,CAAC,+FAA+F,CAAC;;mBAElG,CAAC;QAChB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IAEM,eAAe;QACpB,MAAM,OAAO,GAAG,yBAAyB,CAAC;QAC1C,GAAG,CAAC,KAAK,CA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CAAC,SAAwB;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACjG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAEM,YAAY,CAAC,YAA0B;QAC5C,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAEM,wBAAwB;QAC7B,GAAG,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IACzE,CAAC;IAEM,sBAAsB,CAAC,YAAsB;QAClD,MAAM,OAAO,GAAG,kEAAkE,CAAC;QACnF,MAAM,OAAO,GAAI,OAAO,CAAC,YAAY,CAAC,CAAC;QACvC,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC;IAC9B,CAAC;IAEM,SAAS;QACd,MAAM,OAAO,GAAG,oBAAoB,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,wCAAwC,CAAC;QACpH,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IAEM,WAAW,CAAC,EAAsC;QACvD,OAAO,WAAW,CAChB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,EAAE,CACH,CAAC;IACJ,CAAC;IAEM,aAAa;QAClB,GAAG,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -1,16 +0,0 @@
1
- import { FilePath } from "../../../types/file/filePath.js";
2
- import { Result } from "neverthrow";
3
- import { DirectoryPath } from "../../../types/file/directoryPath.js";
4
- import { ServiceError } from "../../../infrastructure/service-error.js";
5
- import { TocData } from "../../../types/toc/toc-components.js";
6
- export declare class PortalNewTocPrompts {
7
- overwriteToc(tocPath: FilePath): Promise<boolean>;
8
- specDirectoryNotFound(directory: DirectoryPath): void;
9
- specDirectoryEmpty(directory: DirectoryPath): void;
10
- tocFileAlreadyExists(): void;
11
- tocExtractionFailed(message: string): void;
12
- contentDirectoryNotFound(contentFolderPath: DirectoryPath): void;
13
- invalidBuildDirectory(directory: DirectoryPath): void;
14
- extractTocData(fn: Promise<Result<TocData, ServiceError>>, expandEndpoints: boolean, expandModels: boolean, expandWebhooks: boolean, expandCallbacks: boolean): Promise<Result<TocData, ServiceError>>;
15
- tocCreated(tocPath: FilePath): void;
16
- }
@@ -1,50 +0,0 @@
1
- import { confirm, isCancel, log } from "@clack/prompts";
2
- import { format as f } from "../../format.js";
3
- import { withSpinner } from "../../prompt.js";
4
- export class PortalNewTocPrompts {
5
- async overwriteToc(tocPath) {
6
- const overwrite = await confirm({
7
- message: `The destination file ${f.path(tocPath)} already exists, do you want to overwrite it?`,
8
- initialValue: false
9
- });
10
- if (isCancel(overwrite)) {
11
- return false;
12
- }
13
- return overwrite;
14
- }
15
- specDirectoryNotFound(directory) {
16
- log.error(`The ${f.var("spec")} directory was not found in ${f.path(directory)}.\n` +
17
- `Add your API specification there and try again.`);
18
- }
19
- specDirectoryEmpty(directory) {
20
- log.error(`The ${f.var("spec")} directory in ${f.path(directory)} is either empty or invalid.`);
21
- }
22
- tocFileAlreadyExists() {
23
- log.error(`Please enter a different destination path or delete the existing toc.yml file and try again.`);
24
- }
25
- tocExtractionFailed(message) {
26
- log.error(message);
27
- }
28
- contentDirectoryNotFound(contentFolderPath) {
29
- log.error(`Content folder not found at: ${contentFolderPath}`);
30
- }
31
- invalidBuildDirectory(directory) {
32
- const message = `The ${f.var("src")} directory is either empty or invalid: ${f.path(directory)}`;
33
- log.error(message);
34
- }
35
- extractTocData(fn, expandEndpoints, expandModels, expandWebhooks, expandCallbacks) {
36
- const components = [
37
- expandEndpoints && "Endpoint groups",
38
- expandModels && "Models",
39
- expandWebhooks && "Webhooks",
40
- expandCallbacks && "Callbacks"
41
- ]
42
- .filter(Boolean)
43
- .join(" and ") || "TOC data";
44
- return withSpinner(`Extracting ${components}`, `${components} extracted`, `${components} extraction Failed`, fn);
45
- }
46
- tocCreated(tocPath) {
47
- log.info(`The TOC file successfully created at: ${f.path(tocPath)}`);
48
- }
49
- }
50
- //# sourceMappingURL=new-toc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-toc.js","sourceRoot":"","sources":["../../../../src/prompts/portal/toc/new-toc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,OAAO,mBAAmB;IACvB,KAAK,CAAC,YAAY,CAAC,OAAiB;QACzC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;YAC9B,OAAO,EAAE,wBAAwB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,+CAA+C;YAC/F,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,qBAAqB,CAAC,SAAwB;QACnD,GAAG,CAAC,KAAK,CACP,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;YACvE,iDAAiD,CACpD,CAAC;IACJ,CAAC;IAEM,kBAAkB,CAAC,SAAwB;QAChD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC;IAClG,CAAC;IAEM,oBAAoB;QACzB,GAAG,CAAC,KAAK,CAAC,8FAA8F,CAAC,CAAC;IAC5G,CAAC;IAEM,mBAAmB,CAAC,OAAe;QACxC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAEM,wBAAwB,CAAC,iBAAgC;QAC9D,GAAG,CAAC,KAAK,CAAC,gCAAgC,iBAAiB,EAAE,CAAC,CAAC;IACjE,CAAC;IAEM,qBAAqB,CAAC,SAAwB;QACnD,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACjG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAEM,cAAc,CACnB,EAA0C,EAC1C,eAAwB,EACxB,YAAqB,EACrB,cAAuB,EACvB,eAAwB;QAExB,MAAM,UAAU,GAAG;YACjB,eAAe,IAAI,iBAAiB;YACpC,YAAY,IAAI,QAAQ;YACxB,cAAc,IAAI,UAAU;YAC5B,eAAe,IAAI,WAAW;SAC/B;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC;QAE/B,OAAO,WAAW,CAAC,cAAc,UAAU,EAAE,EAAE,GAAG,UAAU,YAAY,EAAE,GAAG,UAAU,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACnH,CAAC;IAEM,UAAU,CAAC,OAAiB;QACjC,GAAG,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
@@ -1,22 +0,0 @@
1
- import { DirectoryPath } from "../../types/file/directoryPath.js";
2
- import { Language } from "../../types/sdk/generate.js";
3
- import { Directory } from "../../types/file/directory.js";
4
- import { FilePath } from "../../types/file/filePath.js";
5
- export declare class MergeSourceTreePrompts {
6
- successfullySkippedChanges(language: Language): void;
7
- successfullyAppliedChanges(language: Language): void;
8
- changeTrackingEnabled(language: Language, destinationSourceTreePath: FilePath): void;
9
- changeTrackingAlreadyEnabled(language: Language): void;
10
- sdkGenerated(sdk: DirectoryPath): void;
11
- sdkGeneratedWithSourceTree(sdk: DirectoryPath, sourceTree: FilePath): void;
12
- startApplyingConflictedChanges(language: Language): void;
13
- conflictsDetectedInCi(language: Language, directory: Directory): void;
14
- conflictsDetected(directory: Directory): void;
15
- resolveNowOrAbandon(): Promise<boolean>;
16
- openingVsCodeForConflictResolution(language: Language): void;
17
- openFilesForConflictResolution(language: Language, sdkDir: DirectoryPath): void;
18
- confirmConflictsResolved(): Promise<"resolved" | "unresolved" | "cancelled">;
19
- conflictsResolved(language: Language): void;
20
- mergeAbandoned(language: Language): void;
21
- directoryStillOpen(directory: DirectoryPath): Promise<void>;
22
- }
@@ -1,90 +0,0 @@
1
- import { isCancel, log, confirm } from "@clack/prompts";
2
- import { format as f, getTree } from "../format.js";
3
- import { noteWrapped } from "../prompt.js";
4
- export class MergeSourceTreePrompts {
5
- successfullySkippedChanges(language) {
6
- log.info(`Skipped saved changes for ${f.var(language)} SDK.`);
7
- }
8
- successfullyAppliedChanges(language) {
9
- log.info(`Successfully applied saved changes for ${f.var(language)} SDK.`);
10
- }
11
- changeTrackingEnabled(language, destinationSourceTreePath) {
12
- log.info(`Change tracking is enabled for ${f.var(language)}. The 'sdk-source-tree' has been saved to ${f.path(destinationSourceTreePath)}.`);
13
- const message = `Customize your SDK, then run:
14
- '${f.cmdAlt("apimatic", "sdk", "save-changes")} ${f.flag("language", language)}'
15
- This persists your changes so they reapply on every future generation.`;
16
- noteWrapped(message, "Next Steps");
17
- }
18
- changeTrackingAlreadyEnabled(language) {
19
- log.warn(`Change tracking is already enabled for ${f.var(language)}. The ${f.flag("track-changes")} flag will be ignored.`);
20
- }
21
- sdkGenerated(sdk) {
22
- log.info(`The generated SDK can be found at ${f.path(sdk)}.`);
23
- }
24
- sdkGeneratedWithSourceTree(sdk, sourceTree) {
25
- log.info(`The generated SDK can be found at ${f.path(sdk)}
26
- and the 'sdk-source-tree' can be found at ${f.path(sourceTree)}.`);
27
- }
28
- startApplyingConflictedChanges(language) {
29
- log.info(`Applying saved changes for '${f.var(language)}'...`);
30
- }
31
- conflictsDetectedInCi(language, directory) {
32
- log.error(`Merge conflicts found while applying saved changes:
33
- ${getTree(directory.toTreeNode())}`);
34
- noteWrapped(`Run the command
35
- '${f.cmdAlt("apimatic", "sdk", "generate")} ${f.flag("language", language)}'
36
- interactively to review and resolve the conflicts with SDK generation.`, "Next Steps");
37
- }
38
- conflictsDetected(directory) {
39
- log.warn(`Merge conflicts found while applying saved changes:
40
- ${getTree(directory.toTreeNode())}
41
- Your SDK may not work until all issues are resolved. Conflict markers have been added to the affected files. Resolve each conflict and remove the markers.`);
42
- }
43
- async resolveNowOrAbandon() {
44
- const continueResolving = await confirm({
45
- message: `Resolve now, or abandon SDK generation?`,
46
- active: "Resolve now",
47
- inactive: "Abandon",
48
- initialValue: true
49
- });
50
- if (isCancel(continueResolving)) {
51
- return false;
52
- }
53
- return continueResolving;
54
- }
55
- openingVsCodeForConflictResolution(language) {
56
- log.info(`Opening ${f.var(language)} SDK in VS Code for conflicts resolution.
57
- 1. Resolve each conflict block.
58
- 2. Save the files.
59
- 3. Close the editor.`);
60
- }
61
- openFilesForConflictResolution(language, sdkDir) {
62
- log.info(`Open ${f.var(language)} SDK at ${f.path(sdkDir)} in your editor for conflicts resolution.
63
- 1. Resolve each conflict block.
64
- 2. Save the files.
65
- 3. Close the editor.`);
66
- }
67
- async confirmConflictsResolved() {
68
- const conflictsResolved = await confirm({
69
- message: `Have you finished resolving all conflicts?`,
70
- initialValue: false
71
- });
72
- if (isCancel(conflictsResolved)) {
73
- return "cancelled";
74
- }
75
- return conflictsResolved ? "resolved" : "unresolved";
76
- }
77
- conflictsResolved(language) {
78
- log.info(`Saved the current state of ${f.var(language)} SDK as resolved.`);
79
- }
80
- mergeAbandoned(language) {
81
- log.error(`SDK generation has been abandoned. The generated SDK will be discarded.`);
82
- noteWrapped(`Run the command
83
- '${f.cmdAlt("apimatic", "sdk", "generate")} ${f.flag("language", language)}'
84
- to regenerate the SDK and resolve merge conflicts.`, "Next Steps");
85
- }
86
- async directoryStillOpen(directory) {
87
- log.info(`Please close all applications using the directory ${f.path(directory)} to allow cleanup of temporary files.`);
88
- }
89
- }
90
- //# sourceMappingURL=merge-source-tree.js.map