@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
@@ -4,119 +4,118 @@ import { DirectoryPath } from '../../../types/file/directoryPath.js';
4
4
  import { PublishType } from '../../../types/publish-api/publishing-profile-item.js';
5
5
  import { PublishingProfile } from '../../../types/publish/publishing-profile.js';
6
6
  import { PublishingProfiles } from '../../../types/publish/publishing-profiles.js';
7
- import { getCodegenOptions } from '../../../types/sdk/generate.js';
7
+ import { AVAILABLE_LANGUAGES, stabilityLevelsFor } from '../../../types/sdk/generate.js';
8
8
  import { formatPublishingDetails } from '../../../prompts/sdk/publish.js';
9
9
  import { ActionResult } from '../../action-result.js';
10
- import { PluginRecordSdkAction } from '../../plugin/record-sdk.js';
10
+ import { RecordPublishedSdkAction } from '../record-published-sdk.js';
11
11
  import { SdkPublishAction } from '../publish.js';
12
- import { BuildContext } from '../../../types/build-context.js';
12
+ import { ProjectContext } from '../../../types/project-context.js';
13
13
  import { ProfileId } from '../../../types/publish/profile-id.js';
14
- import { removeQuotes } from '../../../utils/string-utils.js';
15
14
  export class SdkPublishInteractiveAction {
15
+ configDir;
16
+ commandMetadata;
17
+ prompts = new SdkPublishInteractivePrompts();
18
+ publishingApiService = new PublishingApiService();
16
19
  constructor(configDir, commandMetadata) {
17
20
  this.configDir = configDir;
18
21
  this.commandMetadata = commandMetadata;
19
- this.prompts = new SdkPublishInteractivePrompts();
20
- this.publishingApiService = new PublishingApiService();
21
- this.execute = async (defaultBuildDirectory, onPublishSdkError) => {
22
- const workingDirectory = await this.prompts.inputWorkingDirectory(defaultBuildDirectory, SdkPublishInteractiveAction.workingDirectoryValidator(defaultBuildDirectory));
23
- if (!workingDirectory) {
24
- await this.prompts.noInputDirectoryProvided();
25
- return ActionResult.cancelled();
26
- }
27
- const buildDirectory = workingDirectory.join('src');
28
- const defaultSdkDirectory = workingDirectory.join('sdk');
29
- const sdkDirectory = await this.prompts.inputSdkDirectory(defaultSdkDirectory, SdkPublishInteractiveAction.sdkDirectoryValidator(buildDirectory));
30
- if (!sdkDirectory) {
31
- await this.prompts.noSdkDirectoryProvided();
32
- return ActionResult.cancelled();
33
- }
34
- const publishingProfilesResponse = await this.prompts.getPublishingProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell));
35
- if (publishingProfilesResponse.isErr()) {
36
- this.prompts.getPublishingProfilesServiceError(publishingProfilesResponse.error);
37
- return ActionResult.failed();
38
- }
39
- const publishingProfileItems = publishingProfilesResponse.value;
40
- const publishingProfilesResult = PublishingProfiles.create(publishingProfileItems);
41
- if (publishingProfilesResult.isErr()) {
42
- this.prompts.noPublishingProfilesFound();
43
- return ActionResult.failed();
44
- }
45
- const activePublishingProfiles = publishingProfilesResult.value.getActiveProfiles();
46
- if (activePublishingProfiles.length === 0) {
47
- this.prompts.noProfileWithEnabledLanguagesFound();
48
- return ActionResult.failed();
49
- }
50
- const publishingProfileItem = await this.prompts.selectPublishingProfile(publishingProfilesResult.value.toActiveProfilesGroups());
51
- if (!publishingProfileItem) {
52
- this.prompts.noPublishingProfileSelected();
53
- return ActionResult.cancelled();
54
- }
55
- const publishingProfile = PublishingProfile.create(publishingProfileItem);
56
- const language = await this.prompts.selectLanguage(publishingProfile);
57
- if (!language) {
58
- this.prompts.noLanguageSelected();
59
- return ActionResult.cancelled();
60
- }
61
- const codegenOptions = getCodegenOptions(language);
62
- const codegenOption = codegenOptions.length === 1 ? codegenOptions[0]
63
- : await this.prompts.selectCodegenVersion(codegenOptions);
64
- if (!codegenOption) {
65
- this.prompts.noCodegenVersionSelected();
66
- return ActionResult.cancelled();
67
- }
68
- const version = await this.prompts.inputVersion();
69
- if (!version) {
70
- this.prompts.noVersionSpecified();
71
- return ActionResult.cancelled();
72
- }
73
- const publishTypes = publishingProfile.getPublishTypesForLanguage(language);
74
- const publishingSummary = formatPublishingDetails({
75
- profile: publishingProfile,
76
- language,
77
- version,
78
- publishType: publishTypes,
79
- codegenOption: codegenOptions.length === 1 ? undefined : codegenOption
80
- });
81
- this.prompts.publishingSummary(publishingSummary);
82
- const confirmed = await this.prompts.confirmPublishing();
83
- if (!confirmed) {
84
- this.prompts.publishingCancelled();
85
- return ActionResult.cancelled();
86
- }
87
- if (!publishTypes.includes(PublishType.PackagePublishing)) {
88
- this.prompts.sourceCodeOnlyPublishingNotice();
89
- }
90
- const publishingProfileId = ProfileId.createFromPublishingProfileItem(publishingProfileItem);
91
- const publishResult = await new SdkPublishAction(this.configDir, this.commandMetadata).execute(buildDirectory, sdkDirectory, language, publishTypes, false, publishingProfileId, version, publishingProfile, false, codegenOption, false, publishingSummary, onPublishSdkError);
92
- if (publishResult.isFailed()) {
93
- return ActionResult.failed();
94
- }
95
- if (publishResult.isCancelled()) {
96
- return ActionResult.cancelled();
97
- }
98
- if (await this.prompts.confirmRecordSdk()) {
99
- await new PluginRecordSdkAction().execute(buildDirectory, language, publishingProfile, publishTypes, version, codegenOption.codeGenerationVersion(), true);
100
- }
101
- return ActionResult.success();
102
- };
103
22
  }
104
- static workingDirectoryValidator(defaultBuildDirectory) {
23
+ execute = async (defaultProjectDirectory, onPublishSdkError) => {
24
+ const workingDirectory = await this.prompts.inputWorkingDirectory(defaultProjectDirectory, SdkPublishInteractiveAction.workingDirectoryValidator(defaultProjectDirectory));
25
+ if (!workingDirectory) {
26
+ await this.prompts.noInputDirectoryProvided();
27
+ return ActionResult.cancelled();
28
+ }
29
+ const project = ProjectContext.in(workingDirectory);
30
+ const sdkDirectory = await this.prompts.inputSdkDirectory(project.sdkDirectory(), SdkPublishInteractiveAction.sdkDirectoryValidator(project));
31
+ if (!sdkDirectory) {
32
+ await this.prompts.noSdkDirectoryProvided();
33
+ return ActionResult.cancelled();
34
+ }
35
+ const publishingProfilesResponse = await this.prompts.getPublishingProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell));
36
+ if (publishingProfilesResponse.isErr()) {
37
+ this.prompts.getPublishingProfilesServiceError(publishingProfilesResponse.error);
38
+ return ActionResult.failed();
39
+ }
40
+ const publishingProfileItems = publishingProfilesResponse.value;
41
+ const publishingProfilesResult = PublishingProfiles.create(publishingProfileItems);
42
+ if (publishingProfilesResult.isErr()) {
43
+ this.prompts.noPublishingProfilesFound();
44
+ return ActionResult.failed();
45
+ }
46
+ const activePublishingProfiles = publishingProfilesResult.value.getActiveProfiles();
47
+ if (activePublishingProfiles.length === 0) {
48
+ this.prompts.noProfileWithEnabledLanguagesFound();
49
+ return ActionResult.failed();
50
+ }
51
+ const publishingProfileItem = await this.prompts.selectPublishingProfile(publishingProfilesResult.value.toActiveProfilesGroups());
52
+ if (!publishingProfileItem) {
53
+ this.prompts.noPublishingProfileSelected();
54
+ return ActionResult.cancelled();
55
+ }
56
+ const publishingProfile = PublishingProfile.create(publishingProfileItem);
57
+ // Offering one v4 cannot render would end the run after the version was already asked for.
58
+ const offered = publishingProfile.getEnabledLanguages().filter((enabled) => AVAILABLE_LANGUAGES.includes(enabled));
59
+ if (offered.length === 0) {
60
+ this.prompts.noAvailableLanguageOnProfile(publishingProfile.getEnabledLanguages());
61
+ return ActionResult.failed();
62
+ }
63
+ const language = await this.prompts.selectLanguage(publishingProfile, offered);
64
+ if (!language) {
65
+ this.prompts.noLanguageSelected();
66
+ return ActionResult.cancelled();
67
+ }
68
+ const levels = stabilityLevelsFor(language);
69
+ const stability = levels.length === 1 ? levels[0] : await this.prompts.selectStability(levels);
70
+ if (!stability) {
71
+ this.prompts.noStabilitySelected();
72
+ return ActionResult.cancelled();
73
+ }
74
+ const version = await this.prompts.inputVersion();
75
+ if (!version) {
76
+ this.prompts.noVersionSpecified();
77
+ return ActionResult.cancelled();
78
+ }
79
+ const publishTypes = publishingProfile.getPublishTypesForLanguage(language);
80
+ const publishingSummary = formatPublishingDetails({
81
+ profile: publishingProfile,
82
+ language,
83
+ version,
84
+ publishType: publishTypes,
85
+ stability: levels.length === 1 ? undefined : stability
86
+ });
87
+ this.prompts.publishingSummary(publishingSummary);
88
+ const confirmed = await this.prompts.confirmPublishing();
89
+ if (!confirmed) {
90
+ this.prompts.publishingCancelled();
91
+ return ActionResult.cancelled();
92
+ }
93
+ if (!publishTypes.includes(PublishType.PackagePublishing)) {
94
+ this.prompts.sourceCodeOnlyPublishingNotice();
95
+ }
96
+ const publishingProfileId = ProfileId.createFromPublishingProfileItem(publishingProfileItem);
97
+ const publishResult = await new SdkPublishAction(this.configDir, this.commandMetadata).execute(project, sdkDirectory, language, publishTypes, false, publishingProfileId, version, publishingProfile, false, stability, publishingSummary, onPublishSdkError);
98
+ if (publishResult.isFailed()) {
99
+ return ActionResult.failed();
100
+ }
101
+ if (publishResult.isCancelled()) {
102
+ return ActionResult.cancelled();
103
+ }
104
+ await new RecordPublishedSdkAction().execute(project, language, publishingProfile, publishTypes, version);
105
+ return ActionResult.success();
106
+ };
107
+ static workingDirectoryValidator(defaultProjectDirectory) {
105
108
  return (value) => {
106
- if (!value) {
107
- if (!new BuildContext(defaultBuildDirectory.join('src')).existsSync())
108
- return "The 'src' directory does not exist at the provided location. Please check the path and try again.";
109
- return;
110
- }
111
- if (!new BuildContext(new DirectoryPath(removeQuotes(value.trim())).join('src')).existsSync())
109
+ const projectDirectory = value ? DirectoryPath.fromUserInput(value) : defaultProjectDirectory;
110
+ if (!ProjectContext.in(projectDirectory).sourceExistsSync())
112
111
  return "The 'src' directory does not exist at the provided location. Please check the path and try again.";
113
112
  };
114
113
  }
115
- static sdkDirectoryValidator(buildDirectory) {
114
+ static sdkDirectoryValidator(project) {
116
115
  return (value) => {
117
116
  if (!value)
118
117
  return;
119
- if (new DirectoryPath(removeQuotes(value.trim())).isEqual(buildDirectory))
118
+ if (project.isSourceDirectory(DirectoryPath.fromUserInput(value)))
120
119
  return 'SDK directory must be different from the src directory.';
121
120
  };
122
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interactive.js","sourceRoot":"","sources":["../../../../src/actions/sdk/publish/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,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AEK,MAAM,CAAC,yBAAyB,CACrC,uBAAsC;QAEtC,OAAO,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC;YAC9F,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,EAAE;gBACzD,OAAO,mGAAmG,CAAC;QAC/G,CAAC,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,OAAuB;QACzD,OAAO,CAAC,KAAK,EAAE,EAAE;YACf,IAAI,CAAC,KAAK;gBAAE,OAAO;YACnB,IAAI,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;gBAC/D,OAAO,yDAAyD,CAAC;QACrE,CAAC,CAAC;IACJ,CAAC;CACF"}
@@ -1,8 +1,10 @@
1
1
  import { CommandMetadata } from '../../../types/common/command-metadata.js';
2
2
  import { DirectoryPath } from '../../../types/file/directoryPath.js';
3
3
  import { PublishType } from '../../../types/publish-api/publishing-profile-item.js';
4
- import { CodegenOption, Language } from '../../../types/sdk/generate.js';
4
+ import { Language } from '../../../types/sdk/generate.js';
5
+ import { StabilityChoice } from '../../../types/sdk/stability-choice.js';
5
6
  import { ActionResult } from '../../action-result.js';
7
+ import { ProjectContext } from '../../../types/project-context.js';
6
8
  export declare class SdkPublishNonInteractiveAction {
7
9
  private readonly configDir;
8
10
  private readonly commandMetadata;
@@ -10,5 +12,5 @@ export declare class SdkPublishNonInteractiveAction {
10
12
  private readonly publishingApiService;
11
13
  private readonly fileService;
12
14
  constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
13
- readonly execute: (buildDirectory: DirectoryPath, sdkDirectory: DirectoryPath, language: Language, publishTypes: PublishType[], force: boolean, dryRun: boolean, codegenOption: CodegenOption, stabilityWasProvided: boolean, updatePluginConfig: boolean, onPublishSdkError: (errorMessage: string) => void, profileId?: string, version?: string) => Promise<ActionResult>;
15
+ readonly execute: (project: ProjectContext, sdkDirectory: DirectoryPath, language: Language, publishTypes: PublishType[], force: boolean, dryRun: boolean, stability: StabilityChoice, onPublishSdkError: (errorMessage: string) => void, profileId?: string, version?: string) => Promise<ActionResult>;
14
16
  }
@@ -7,102 +7,103 @@ import { ActionResult } from '../../action-result.js';
7
7
  import { getDownloadsDirectory } from '../../../infrastructure/os-extensions.js';
8
8
  import { SemVersion } from '../../../types/publish/version.js';
9
9
  import { ProfileId } from '../../../types/publish/profile-id.js';
10
- import { BuildContext } from '../../../types/build-context.js';
11
- import { PluginRecordSdkAction } from '../../plugin/record-sdk.js';
10
+ import { RecordPublishedSdkAction } from '../record-published-sdk.js';
12
11
  import { SdkPublishAction } from '../publish.js';
13
12
  import { FileService } from '../../../infrastructure/file-service.js';
14
13
  export class SdkPublishNonInteractiveAction {
14
+ configDir;
15
+ commandMetadata;
16
+ prompts = new SdkPublishNonInteractivePrompts();
17
+ publishingApiService = new PublishingApiService();
18
+ fileService = new FileService();
15
19
  constructor(configDir, commandMetadata) {
16
20
  this.configDir = configDir;
17
21
  this.commandMetadata = commandMetadata;
18
- this.prompts = new SdkPublishNonInteractivePrompts();
19
- this.publishingApiService = new PublishingApiService();
20
- this.fileService = new FileService();
21
- this.execute = async (buildDirectory, sdkDirectory, language, publishTypes, force, dryRun, codegenOption, stabilityWasProvided, updatePluginConfig, onPublishSdkError, profileId, version) => {
22
- if (buildDirectory.isEqual(sdkDirectory)) {
23
- this.prompts.directoryCannotBeSame(sdkDirectory);
24
- return ActionResult.failed();
25
- }
26
- const buildContext = new BuildContext(buildDirectory);
27
- if (!(await buildContext.exists())) {
28
- this.prompts.srcDirectoryDoesNotExist(buildDirectory);
29
- return ActionResult.failed();
30
- }
31
- const missing = [];
32
- if (!profileId)
33
- missing.push('--profile-id');
34
- if (!language)
35
- missing.push('--language');
36
- if (!version)
37
- missing.push('--version');
38
- if (!publishTypes || publishTypes.length === 0)
39
- missing.push('--publish-type');
40
- if (missing.length > 0) {
41
- this.prompts.missingRequiredFlags(missing);
42
- this.prompts.interactiveModeNotice();
43
- return ActionResult.failed();
44
- }
45
- const semVersionResult = SemVersion.tryCreate(version);
46
- if (semVersionResult.isErr()) {
47
- this.prompts.invalidVersion(version);
48
- return ActionResult.failed();
49
- }
50
- const profileIdResult = ProfileId.tryCreate(profileId);
51
- if (profileIdResult.isErr()) {
52
- this.prompts.invalidProfileId(profileId);
53
- return ActionResult.failed();
54
- }
55
- const publishingProfilesResponse = await this.prompts.getPublishingProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell));
56
- if (publishingProfilesResponse.isErr()) {
57
- this.prompts.getPublishingProfilesServiceError(publishingProfilesResponse.error);
58
- return ActionResult.failed();
59
- }
60
- const publishingProfileId = profileIdResult.value;
61
- const publishingProfileItem = publishingProfilesResponse.value.find((profile) => ProfileId.tryCreate(profile.id).match((id) => publishingProfileId.isEqual(id), () => false));
62
- if (!publishingProfileItem) {
63
- this.prompts.publishingProfileNotFound(publishingProfileId);
64
- return ActionResult.failed();
65
- }
66
- const publishingProfile = PublishingProfile.create(publishingProfileItem);
67
- if (!publishingProfile.isLanguageEnabled(language)) {
68
- this.prompts.languageNotConfiguredForProfile(language);
69
- return ActionResult.failed();
70
- }
71
- const unallowedPublishTypes = publishingProfile.getUnallowedPublishTypes(language, publishTypes);
72
- if (unallowedPublishTypes.length > 0) {
73
- this.prompts.publishTypesNotAvailableForLanguage(unallowedPublishTypes, language);
74
- return ActionResult.failed();
75
- }
76
- if (!publishTypes.includes(PublishType.PackagePublishing)) {
77
- this.prompts.sourceCodeOnlyPublishingNotice();
78
- }
79
- const semVersion = semVersionResult.value;
80
- const publishingSummary = formatPublishingDetails({
81
- profile: publishingProfile,
82
- language,
83
- version: semVersion,
84
- publishType: publishTypes,
85
- codegenOption
86
- });
87
- const outputDir = dryRun ? await this.fileService.getAvailableDirectoryPath(getDownloadsDirectory('apimatic-sdk')) : sdkDirectory;
88
- const publishResult = await new SdkPublishAction(this.configDir, this.commandMetadata).execute(buildDirectory, outputDir, language, publishTypes, force, publishingProfileId, semVersion, publishingProfile, dryRun, codegenOption, stabilityWasProvided, publishingSummary, onPublishSdkError);
89
- if (publishResult.isFailed()) {
90
- return ActionResult.failed();
91
- }
92
- if (publishResult.isCancelled()) {
93
- return ActionResult.cancelled();
94
- }
95
- // A dry run publishes nothing, so recording it would claim an SDK that does not exist anywhere.
96
- if (updatePluginConfig) {
97
- if (dryRun) {
98
- this.prompts.dryRunPluginConfigNotice();
99
- }
100
- else {
101
- await new PluginRecordSdkAction().execute(buildDirectory, language, publishingProfile, publishTypes, semVersion, codegenOption.codeGenerationVersion(), false);
102
- }
103
- }
104
- return ActionResult.success();
105
- };
106
22
  }
23
+ execute = async (project, sdkDirectory, language, publishTypes, force, dryRun, stability, onPublishSdkError, profileId, version) => {
24
+ if (project.isSourceDirectory(sdkDirectory)) {
25
+ this.prompts.directoryCannotBeSame(sdkDirectory);
26
+ return ActionResult.failed();
27
+ }
28
+ if (!(await project.sourceExists())) {
29
+ this.prompts.sourceDirectoryDoesNotExist(project.sourceDirectory());
30
+ return ActionResult.failed();
31
+ }
32
+ const missing = [];
33
+ if (!profileId)
34
+ missing.push('--profile-id');
35
+ if (!language)
36
+ missing.push('--language');
37
+ if (!version)
38
+ missing.push('--version');
39
+ if (!publishTypes || publishTypes.length === 0)
40
+ missing.push('--publish-type');
41
+ if (missing.length > 0) {
42
+ this.prompts.missingRequiredFlags(missing);
43
+ this.prompts.interactiveModeNotice();
44
+ return ActionResult.failed();
45
+ }
46
+ const semVersionResult = SemVersion.tryCreate(version);
47
+ if (semVersionResult.isErr()) {
48
+ this.prompts.invalidVersion(version);
49
+ return ActionResult.failed();
50
+ }
51
+ const profileIdResult = ProfileId.tryCreate(profileId);
52
+ if (profileIdResult.isErr()) {
53
+ this.prompts.invalidProfileId(profileId);
54
+ return ActionResult.failed();
55
+ }
56
+ const publishingProfilesResponse = await this.prompts.getPublishingProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell));
57
+ if (publishingProfilesResponse.isErr()) {
58
+ this.prompts.getPublishingProfilesServiceError(publishingProfilesResponse.error);
59
+ return ActionResult.failed();
60
+ }
61
+ const publishingProfileId = profileIdResult.value;
62
+ const publishingProfileItem = publishingProfilesResponse.value.find((profile) => ProfileId.tryCreate(profile.id).match((id) => publishingProfileId.isEqual(id), () => false));
63
+ if (!publishingProfileItem) {
64
+ this.prompts.publishingProfileNotFound(publishingProfileId);
65
+ return ActionResult.failed();
66
+ }
67
+ const publishingProfile = PublishingProfile.create(publishingProfileItem);
68
+ if (!publishingProfile.isLanguageEnabled(language)) {
69
+ this.prompts.languageNotConfiguredForProfile(language);
70
+ return ActionResult.failed();
71
+ }
72
+ const unallowedPublishTypes = publishingProfile.getUnallowedPublishTypes(language, publishTypes);
73
+ if (unallowedPublishTypes.length > 0) {
74
+ this.prompts.publishTypesNotAvailableForLanguage(unallowedPublishTypes, language);
75
+ return ActionResult.failed();
76
+ }
77
+ if (!publishTypes.includes(PublishType.PackagePublishing)) {
78
+ this.prompts.sourceCodeOnlyPublishingNotice();
79
+ }
80
+ const semVersion = semVersionResult.value;
81
+ const publishingSummary = formatPublishingDetails({
82
+ profile: publishingProfile,
83
+ language,
84
+ version: semVersion,
85
+ publishType: publishTypes,
86
+ // Named only when the user chose it, so a run that took the default reads as the doc does.
87
+ stability: stability.chosenLevel()
88
+ });
89
+ const outputDir = dryRun
90
+ ? await this.fileService.getAvailableDirectoryPath(getDownloadsDirectory('apimatic-sdk'))
91
+ : sdkDirectory;
92
+ const publishResult = await new SdkPublishAction(this.configDir, this.commandMetadata).execute(project, outputDir, language, publishTypes, force, publishingProfileId, semVersion, publishingProfile, dryRun, stability.stabilityLevel(), publishingSummary, onPublishSdkError);
93
+ if (publishResult.isFailed()) {
94
+ return ActionResult.failed();
95
+ }
96
+ if (publishResult.isCancelled()) {
97
+ return ActionResult.cancelled();
98
+ }
99
+ // A dry run publishes nothing, so recording it would claim an SDK that does not exist anywhere.
100
+ if (dryRun) {
101
+ this.prompts.dryRunPluginConfigNotice();
102
+ }
103
+ else {
104
+ await new RecordPublishedSdkAction().execute(project, language, publishingProfile, publishTypes, semVersion);
105
+ }
106
+ return ActionResult.success();
107
+ };
107
108
  }
108
109
  //# sourceMappingURL=non-interactive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"non-interactive.js","sourceRoot":"","sources":["../../../../src/actions/sdk/publish/non-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAAyB,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,MAAM,OAAO,8BAA8B;IAKzC,YAAoC,SAAwB,EAAmB,eAAgC;QAA3E,cAAS,GAAT,SAAS,CAAe;QAAmB,oBAAe,GAAf,eAAe,CAAiB;QAJ9F,YAAO,GAAoC,IAAI,+BAA+B,EAAE,CAAC;QACjF,yBAAoB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Y,CAAC;YAClI,MAAM,aAAa,GAAG,MAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAC5F,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,CAClB,CAAC;YACF,IAAI,aAAa,CAAC,QAAQ,EAAE,EAAE,CAAC;gBAC7B,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC;gBAChC,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC;YAClC,CAAC;YAED,gGAAgG;YAChG,IAAI,kBAAkB,EAAE,CAAC;gBACvB,IAAI,MAAM,EAAE,CAAC;oBACX,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;gBAC1C,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,qBAAqB,EAAE,CAAC,OAAO,CACvC,cAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,aAAa,CAAC,qBAAqB,EAAE,EACrC,KAAK,CACN,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC,CAAC;IAvIgH,CAAC;CAwIpH"}
1
+ {"version":3,"file":"non-interactive.js","sourceRoot":"","sources":["../../../../src/actions/sdk/publish/non-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,+BAA+B,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAAyB,WAAW,EAAE,MAAM,uDAAuD,CAAC;AAC3G,O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EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAC/G,CAAC;QAED,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC,CAAC;CACH"}
@@ -3,8 +3,9 @@ import { DirectoryPath } from '../../types/file/directoryPath.js';
3
3
  import { PublishType } from '../../types/publish-api/publishing-profile-item.js';
4
4
  import { ProfileId } from '../../types/publish/profile-id.js';
5
5
  import { SemVersion } from '../../types/publish/version.js';
6
- import { CodegenOption, Language } from '../../types/sdk/generate.js';
6
+ import { Language, Stability } from '../../types/sdk/generate.js';
7
7
  import { PublishingProfile } from '../../types/publish/publishing-profile.js';
8
+ import { ProjectContext } from '../../types/project-context.js';
8
9
  import { ActionResult } from '../action-result.js';
9
10
  export declare class SdkPublishAction {
10
11
  private readonly configDir;
@@ -13,5 +14,5 @@ export declare class SdkPublishAction {
13
14
  private readonly publishingApiService;
14
15
  private readonly launcherService;
15
16
  constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
16
- readonly execute: (buildDirectory: DirectoryPath, outputDirectory: DirectoryPath, language: Language, publishType: PublishType[], force: boolean, profileId: ProfileId, semVersion: SemVersion, publishingProfile: PublishingProfile, dryRun: boolean, codegenOption: CodegenOption, stabilityWasProvided: boolean, publishingSummary: string, onPublishSdkError: (errorMessage: string) => void) => Promise<ActionResult>;
17
+ readonly execute: (project: ProjectContext, outputDirectory: DirectoryPath, language: Language, publishType: PublishType[], force: boolean, profileId: ProfileId, semVersion: SemVersion, publishingProfile: PublishingProfile, dryRun: boolean, stability: Stability, publishingSummary: string, onPublishSdkError: (errorMessage: string) => void) => Promise<ActionResult>;
17
18
  }
@@ -9,69 +9,71 @@ import { GenerateAction } from './generate.js';
9
9
  import { FileName } from '../../types/file/fileName.js';
10
10
  import { FilePath } from '../../types/file/filePath.js';
11
11
  export class SdkPublishAction {
12
+ configDir;
13
+ commandMetadata;
14
+ prompts = new SdkPublishPrompts();
15
+ publishingApiService = new PublishingApiService();
16
+ launcherService = new LauncherService();
12
17
  constructor(configDir, commandMetadata) {
13
18
  this.configDir = configDir;
14
19
  this.commandMetadata = commandMetadata;
15
- this.prompts = new SdkPublishPrompts();
16
- this.publishingApiService = new PublishingApiService();
17
- this.launcherService = new LauncherService();
18
- this.execute = async (buildDirectory, outputDirectory, language, publishType, force, profileId, semVersion, publishingProfile, dryRun, codegenOption, stabilityWasProvided, publishingSummary, onPublishSdkError) => {
19
- const publishResult = await withDirPath(async (tempDirectory) => {
20
- const packageConfigurationData = publishingProfile.getPackageConfigurationDataForLanguage(language);
21
- let packageSettingsDirectory;
22
- if (packageConfigurationData) {
23
- packageSettingsDirectory = tempDirectory.join('package-settings');
24
- const packageSettingsContext = new PackageSettingsContext(packageSettingsDirectory);
25
- await packageSettingsContext.writeConfiguration(packageConfigurationData, language);
26
- }
27
- const sdkGenerateAction = new GenerateAction(this.configDir, this.commandMetadata);
28
- const sdkGenerationResult = await sdkGenerateAction.execute(buildDirectory, outputDirectory, language, force, false, false, false, codegenOption, stabilityWasProvided, undefined, semVersion, packageSettingsDirectory);
29
- if (sdkGenerationResult.isFailed()) {
30
- return ActionResult.failed();
31
- }
32
- if (sdkGenerationResult.isCancelled()) {
33
- return ActionResult.cancelled();
34
- }
35
- const sdkLanguageDirectory = outputDirectory.join(language);
36
- if (dryRun) {
37
- this.prompts.dryRunNotice(publishingSummary);
38
- const readmeFilePath = new FilePath(sdkLanguageDirectory, new FileName('README.md'));
39
- await this.launcherService.openDirectoryInEditorOrFileExplorer(sdkLanguageDirectory, readmeFilePath);
40
- return ActionResult.success();
41
- }
42
- const tempContext = new TempContext(tempDirectory);
43
- const sdkFilePath = await tempContext.zip(sdkLanguageDirectory);
44
- const publishSdkResponse = await this.prompts.publishSdk(this.publishingApiService.publishSdkPackage(sdkFilePath, profileId, language, semVersion, publishType, this.configDir, this.commandMetadata.shell));
45
- if (publishSdkResponse.isErr()) {
46
- this.prompts.sdkPublishingServiceError(publishSdkResponse.error);
47
- onPublishSdkError(publishSdkResponse.error.errorMessage);
48
- return ActionResult.failed();
49
- }
50
- return ActionResult.success(publishSdkResponse.value);
51
- });
52
- if (publishResult.isFailed()) {
20
+ }
21
+ execute = async (project, outputDirectory, language, publishType, force, profileId, semVersion, publishingProfile, dryRun, stability, publishingSummary, onPublishSdkError) => {
22
+ const publishResult = await withDirPath(async (tempDirectory) => {
23
+ const packageConfigurationData = publishingProfile.getPackageConfigurationDataForLanguage(language);
24
+ let packageSettingsDirectory;
25
+ if (packageConfigurationData) {
26
+ packageSettingsDirectory = tempDirectory.join('package-settings');
27
+ const packageSettingsContext = new PackageSettingsContext(packageSettingsDirectory);
28
+ await packageSettingsContext.writeConfiguration(packageConfigurationData, language);
29
+ }
30
+ const sdkGenerateAction = new GenerateAction(this.configDir, this.commandMetadata);
31
+ const sdkGenerationResult = await sdkGenerateAction.execute(project, outputDirectory, language, stability, force, false, undefined, packageSettingsDirectory);
32
+ if (sdkGenerationResult.isFailed()) {
53
33
  return ActionResult.failed();
54
34
  }
55
- if (publishResult.isCancelled()) {
35
+ if (sdkGenerationResult.isCancelled()) {
56
36
  return ActionResult.cancelled();
57
37
  }
58
- // Since publishing was not initiated, skip the next steps for polling.
38
+ const sdkLanguageDirectory = outputDirectory.join(language);
59
39
  if (dryRun) {
40
+ this.prompts.dryRunNotice(publishingSummary);
41
+ const readmeFilePath = new FilePath(sdkLanguageDirectory, new FileName('README.md'));
42
+ await this.launcherService.openDirectoryInEditorOrFileExplorer(sdkLanguageDirectory, readmeFilePath);
60
43
  return ActionResult.success();
61
44
  }
62
- const publishingInfo = publishResult.getValue();
63
- this.prompts.publishingRunningNotice(publishingSummary);
64
- this.prompts.publishingLogsMessage(publishingInfo.publishingLogUrl);
65
- const publishingOutcome = await this.prompts.pollPublishingStatus(() => this.publishingApiService.getSdkPublishingLog(publishingInfo.publishLogId, this.configDir, this.commandMetadata.shell));
66
- switch (publishingOutcome) {
67
- case 'succeeded':
68
- return ActionResult.success();
69
- case 'cancelled':
70
- return ActionResult.cancelled();
71
- default:
72
- return ActionResult.failed();
45
+ const tempContext = new TempContext(tempDirectory);
46
+ const sdkFilePath = await tempContext.zip(sdkLanguageDirectory);
47
+ const publishSdkResponse = await this.prompts.publishSdk(this.publishingApiService.publishSdkPackage(sdkFilePath, profileId, language, semVersion, publishType, this.configDir, this.commandMetadata.shell));
48
+ if (publishSdkResponse.isErr()) {
49
+ this.prompts.sdkPublishingServiceError(publishSdkResponse.error);
50
+ onPublishSdkError(publishSdkResponse.error.errorMessage);
51
+ return ActionResult.failed();
73
52
  }
74
- };
75
- }
53
+ return ActionResult.success(publishSdkResponse.value);
54
+ });
55
+ if (publishResult.isFailed()) {
56
+ return ActionResult.failed();
57
+ }
58
+ if (publishResult.isCancelled()) {
59
+ return ActionResult.cancelled();
60
+ }
61
+ // Since publishing was not initiated, skip the next steps for polling.
62
+ if (dryRun) {
63
+ return ActionResult.success();
64
+ }
65
+ const publishingInfo = publishResult.getValue();
66
+ this.prompts.publishingRunningNotice(publishingSummary);
67
+ this.prompts.publishingLogsMessage(publishingInfo.publishingLogUrl);
68
+ const publishingOutcome = await this.prompts.pollPublishingStatus(() => this.publishingApiService.getSdkPublishingLog(publishingInfo.publishLogId, this.configDir, this.commandMetadata.shell));
69
+ switch (publishingOutcome) {
70
+ case 'succeeded':
71
+ return ActionResult.success();
72
+ case 'cancelled':
73
+ return ActionResult.cancelled();
74
+ default:
75
+ return ActionResult.failed();
76
+ }
77
+ };
76
78
  }
77
79
  //# sourceMappingURL=publish.js.map