@apimatic/cli 1.5.0 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (610) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -212
  3. package/apimatic.schema.json +550 -0
  4. package/lib/actions/action-result.js +3 -0
  5. package/lib/actions/action-result.js.map +1 -1
  6. package/lib/actions/api/transform.js +36 -33
  7. package/lib/actions/api/transform.js.map +1 -1
  8. package/lib/actions/api/validate.d.ts +9 -6
  9. package/lib/actions/api/validate.js +44 -38
  10. package/lib/actions/api/validate.js.map +1 -1
  11. package/lib/actions/auth/login.js +7 -4
  12. package/lib/actions/auth/login.js.map +1 -1
  13. package/lib/actions/auth/logout.js +2 -1
  14. package/lib/actions/auth/logout.js.map +1 -1
  15. package/lib/actions/auth/status.js +5 -3
  16. package/lib/actions/auth/status.js.map +1 -1
  17. package/lib/actions/plugin/generate.d.ts +5 -1
  18. package/lib/actions/plugin/generate.js +83 -56
  19. package/lib/actions/plugin/generate.js.map +1 -1
  20. package/lib/actions/plugin/publish.d.ts +2 -1
  21. package/lib/actions/plugin/publish.js +34 -37
  22. package/lib/actions/plugin/publish.js.map +1 -1
  23. package/lib/actions/plugin/record-metadata.d.ts +3 -2
  24. package/lib/actions/plugin/record-metadata.js +33 -30
  25. package/lib/actions/plugin/record-metadata.js.map +1 -1
  26. package/lib/actions/portal/generate.d.ts +8 -6
  27. package/lib/actions/portal/generate.js +50 -61
  28. package/lib/actions/portal/generate.js.map +1 -1
  29. package/lib/actions/portal/prepare-project.d.ts +25 -0
  30. package/lib/actions/portal/prepare-project.js +68 -0
  31. package/lib/actions/portal/prepare-project.js.map +1 -0
  32. package/lib/actions/portal/serve.d.ts +21 -6
  33. package/lib/actions/portal/serve.js +170 -153
  34. package/lib/actions/portal/serve.js.map +1 -1
  35. package/lib/actions/publishing/profile/list.js +4 -2
  36. package/lib/actions/publishing/profile/list.js.map +1 -1
  37. package/lib/actions/quickstart.d.ts +23 -5
  38. package/lib/actions/quickstart.js +222 -21
  39. package/lib/actions/quickstart.js.map +1 -1
  40. package/lib/actions/sdk/generate.d.ts +4 -7
  41. package/lib/actions/sdk/generate.js +53 -93
  42. package/lib/actions/sdk/generate.js.map +1 -1
  43. package/lib/actions/sdk/publish/interactive.d.ts +4 -3
  44. package/lib/actions/sdk/publish/interactive.js +96 -97
  45. package/lib/actions/sdk/publish/interactive.js.map +1 -1
  46. package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
  47. package/lib/actions/sdk/publish/non-interactive.js +91 -90
  48. package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
  49. package/lib/actions/sdk/publish.d.ts +3 -2
  50. package/lib/actions/sdk/publish.js +55 -53
  51. package/lib/actions/sdk/publish.js.map +1 -1
  52. package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
  53. package/lib/actions/sdk/record-published-sdk.js +57 -0
  54. package/lib/actions/sdk/record-published-sdk.js.map +1 -0
  55. package/lib/client-utils/auth-manager.js +1 -1
  56. package/lib/client-utils/auth-manager.js.map +1 -1
  57. package/lib/commands/api/transform.d.ts +1 -1
  58. package/lib/commands/api/transform.js +44 -40
  59. package/lib/commands/api/transform.js.map +1 -1
  60. package/lib/commands/api/validate.js +16 -16
  61. package/lib/commands/api/validate.js.map +1 -1
  62. package/lib/commands/auth/login.js +14 -15
  63. package/lib/commands/auth/login.js.map +1 -1
  64. package/lib/commands/auth/logout.js +5 -6
  65. package/lib/commands/auth/logout.js.map +1 -1
  66. package/lib/commands/auth/status.js +4 -5
  67. package/lib/commands/auth/status.js.map +1 -1
  68. package/lib/commands/plugin/generate.d.ts +3 -3
  69. package/lib/commands/plugin/generate.js +20 -20
  70. package/lib/commands/plugin/generate.js.map +1 -1
  71. package/lib/commands/plugin/publish.js +18 -18
  72. package/lib/commands/plugin/publish.js.map +1 -1
  73. package/lib/commands/portal/generate.d.ts +9 -8
  74. package/lib/commands/portal/generate.js +36 -27
  75. package/lib/commands/portal/generate.js.map +1 -1
  76. package/lib/commands/portal/serve.d.ts +7 -9
  77. package/lib/commands/portal/serve.js +41 -44
  78. package/lib/commands/portal/serve.js.map +1 -1
  79. package/lib/commands/publishing/profile/list.js +8 -12
  80. package/lib/commands/publishing/profile/list.js.map +1 -1
  81. package/lib/commands/quickstart.d.ts +5 -5
  82. package/lib/commands/quickstart.js +18 -24
  83. package/lib/commands/quickstart.js.map +1 -1
  84. package/lib/commands/sdk/generate.d.ts +5 -7
  85. package/lib/commands/sdk/generate.js +58 -70
  86. package/lib/commands/sdk/generate.js.map +1 -1
  87. package/lib/commands/sdk/publish.d.ts +6 -7
  88. package/lib/commands/sdk/publish.js +66 -60
  89. package/lib/commands/sdk/publish.js.map +1 -1
  90. package/lib/hooks/node-version.d.ts +3 -0
  91. package/lib/hooks/node-version.js +12 -0
  92. package/lib/hooks/node-version.js.map +1 -0
  93. package/lib/hooks/not-found.js +2 -3
  94. package/lib/hooks/not-found.js.map +1 -1
  95. package/lib/hooks/utils.d.ts +4 -2
  96. package/lib/hooks/utils.js +2 -2
  97. package/lib/hooks/utils.js.map +1 -1
  98. package/lib/infrastructure/env-info.d.ts +3 -0
  99. package/lib/infrastructure/env-info.js +13 -6
  100. package/lib/infrastructure/env-info.js.map +1 -1
  101. package/lib/infrastructure/file-service.d.ts +35 -8
  102. package/lib/infrastructure/file-service.js +149 -53
  103. package/lib/infrastructure/file-service.js.map +1 -1
  104. package/lib/infrastructure/file-watch-service.d.ts +40 -0
  105. package/lib/infrastructure/file-watch-service.js +167 -0
  106. package/lib/infrastructure/file-watch-service.js.map +1 -0
  107. package/lib/infrastructure/generation-status-poller.d.ts +8 -7
  108. package/lib/infrastructure/generation-status-poller.js +20 -12
  109. package/lib/infrastructure/generation-status-poller.js.map +1 -1
  110. package/lib/infrastructure/launcher-service.js +6 -6
  111. package/lib/infrastructure/launcher-service.js.map +1 -1
  112. package/lib/infrastructure/network-service.d.ts +3 -0
  113. package/lib/infrastructure/network-service.js +15 -1
  114. package/lib/infrastructure/network-service.js.map +1 -1
  115. package/lib/infrastructure/portal-build-service.d.ts +19 -0
  116. package/lib/infrastructure/portal-build-service.js +58 -0
  117. package/lib/infrastructure/portal-build-service.js.map +1 -0
  118. package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
  119. package/lib/infrastructure/portal-dev-server-service.js +135 -0
  120. package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
  121. package/lib/infrastructure/portal-pages-service.d.ts +17 -0
  122. package/lib/infrastructure/portal-pages-service.js +103 -0
  123. package/lib/infrastructure/portal-pages-service.js.map +1 -0
  124. package/lib/infrastructure/portal-project-service.d.ts +77 -0
  125. package/lib/infrastructure/portal-project-service.js +309 -0
  126. package/lib/infrastructure/portal-project-service.js.map +1 -0
  127. package/lib/infrastructure/service-error.d.ts +1 -0
  128. package/lib/infrastructure/service-error.js +39 -41
  129. package/lib/infrastructure/service-error.js.map +1 -1
  130. package/lib/infrastructure/services/api-client-factory.js +15 -13
  131. package/lib/infrastructure/services/api-client-factory.js.map +1 -1
  132. package/lib/infrastructure/services/api-service.d.ts +7 -5
  133. package/lib/infrastructure/services/api-service.js +28 -20
  134. package/lib/infrastructure/services/api-service.js.map +1 -1
  135. package/lib/infrastructure/services/auth-service.js +4 -9
  136. package/lib/infrastructure/services/auth-service.js.map +1 -1
  137. package/lib/infrastructure/services/file-download-service.js +3 -3
  138. package/lib/infrastructure/services/file-download-service.js.map +1 -1
  139. package/lib/infrastructure/services/plugin-service.d.ts +1 -8
  140. package/lib/infrastructure/services/plugin-service.js +11 -22
  141. package/lib/infrastructure/services/plugin-service.js.map +1 -1
  142. package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
  143. package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
  144. package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
  145. package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
  146. package/lib/infrastructure/services/portal-authorization-service.js +23 -0
  147. package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
  148. package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
  149. package/lib/infrastructure/services/publishing-api-service.js +11 -15
  150. package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
  151. package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
  152. package/lib/infrastructure/services/sdk-generation-service.js +118 -0
  153. package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
  154. package/lib/infrastructure/services/telemetry-service.js +5 -4
  155. package/lib/infrastructure/services/telemetry-service.js.map +1 -1
  156. package/lib/infrastructure/services/transformation-service.js +29 -32
  157. package/lib/infrastructure/services/transformation-service.js.map +1 -1
  158. package/lib/infrastructure/services/validation-service.d.ts +12 -53
  159. package/lib/infrastructure/services/validation-service.js +24 -199
  160. package/lib/infrastructure/services/validation-service.js.map +1 -1
  161. package/lib/infrastructure/timer-extensions.d.ts +2 -0
  162. package/lib/infrastructure/timer-extensions.js +10 -0
  163. package/lib/infrastructure/timer-extensions.js.map +1 -0
  164. package/lib/infrastructure/tmp-extensions.d.ts +31 -1
  165. package/lib/infrastructure/tmp-extensions.js +86 -3
  166. package/lib/infrastructure/tmp-extensions.js.map +1 -1
  167. package/lib/infrastructure/zip-service.js +2 -2
  168. package/lib/infrastructure/zip-service.js.map +1 -1
  169. package/lib/prompts/api/validate.d.ts +6 -7
  170. package/lib/prompts/api/validate.js +12 -12
  171. package/lib/prompts/api/validate.js.map +1 -1
  172. package/lib/prompts/format.d.ts +4 -0
  173. package/lib/prompts/format.js +5 -0
  174. package/lib/prompts/format.js.map +1 -1
  175. package/lib/prompts/plugin/generate.d.ts +17 -12
  176. package/lib/prompts/plugin/generate.js +94 -44
  177. package/lib/prompts/plugin/generate.js.map +1 -1
  178. package/lib/prompts/plugin/publish.d.ts +2 -1
  179. package/lib/prompts/plugin/publish.js +8 -7
  180. package/lib/prompts/plugin/publish.js.map +1 -1
  181. package/lib/prompts/plugin/record-metadata.d.ts +1 -0
  182. package/lib/prompts/plugin/record-metadata.js +10 -7
  183. package/lib/prompts/plugin/record-metadata.js.map +1 -1
  184. package/lib/prompts/portal/artifacts.d.ts +8 -0
  185. package/lib/prompts/portal/artifacts.js +26 -0
  186. package/lib/prompts/portal/artifacts.js.map +1 -0
  187. package/lib/prompts/portal/authorization.d.ts +6 -0
  188. package/lib/prompts/portal/authorization.js +29 -0
  189. package/lib/prompts/portal/authorization.js.map +1 -0
  190. package/lib/prompts/portal/code-samples.d.ts +1 -0
  191. package/lib/prompts/portal/code-samples.js +9 -0
  192. package/lib/prompts/portal/code-samples.js.map +1 -0
  193. package/lib/prompts/portal/generate.d.ts +14 -9
  194. package/lib/prompts/portal/generate.js +48 -26
  195. package/lib/prompts/portal/generate.js.map +1 -1
  196. package/lib/prompts/portal/prepare-project.d.ts +20 -0
  197. package/lib/prompts/portal/prepare-project.js +36 -0
  198. package/lib/prompts/portal/prepare-project.js.map +1 -0
  199. package/lib/prompts/portal/serve.d.ts +32 -12
  200. package/lib/prompts/portal/serve.js +102 -39
  201. package/lib/prompts/portal/serve.js.map +1 -1
  202. package/lib/prompts/portal/source.d.ts +26 -0
  203. package/lib/prompts/portal/source.js +253 -0
  204. package/lib/prompts/portal/source.js.map +1 -0
  205. package/lib/prompts/prompt.d.ts +11 -3
  206. package/lib/prompts/prompt.js +39 -15
  207. package/lib/prompts/prompt.js.map +1 -1
  208. package/lib/prompts/quickstart.d.ts +46 -3
  209. package/lib/prompts/quickstart.js +199 -12
  210. package/lib/prompts/quickstart.js.map +1 -1
  211. package/lib/prompts/sdk/generate.d.ts +15 -13
  212. package/lib/prompts/sdk/generate.js +29 -32
  213. package/lib/prompts/sdk/generate.js.map +1 -1
  214. package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
  215. package/lib/prompts/sdk/publish/interactive.js +26 -24
  216. package/lib/prompts/sdk/publish/interactive.js.map +1 -1
  217. package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
  218. package/lib/prompts/sdk/publish/non-interactive.js +5 -4
  219. package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
  220. package/lib/prompts/sdk/publish.d.ts +3 -3
  221. package/lib/prompts/sdk/publish.js +13 -17
  222. package/lib/prompts/sdk/publish.js.map +1 -1
  223. package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
  224. package/lib/prompts/sdk/record-published-sdk.js +26 -0
  225. package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
  226. package/lib/types/apimatic-config/document.d.ts +70 -0
  227. package/lib/types/apimatic-config/document.js +167 -0
  228. package/lib/types/apimatic-config/document.js.map +1 -0
  229. package/lib/types/apimatic-config/languages-block.d.ts +39 -0
  230. package/lib/types/apimatic-config/languages-block.js +58 -0
  231. package/lib/types/apimatic-config/languages-block.js.map +1 -0
  232. package/lib/types/apimatic-config-context.d.ts +48 -0
  233. package/lib/types/apimatic-config-context.js +121 -0
  234. package/lib/types/apimatic-config-context.js.map +1 -0
  235. package/lib/types/build/build.d.ts +1 -89
  236. package/lib/types/build/build.js +6 -161
  237. package/lib/types/build/build.js.map +1 -1
  238. package/lib/types/events/domain-event.js +3 -0
  239. package/lib/types/events/domain-event.js.map +1 -1
  240. package/lib/types/events/quickstart-completed.js +3 -3
  241. package/lib/types/events/quickstart-completed.js.map +1 -1
  242. package/lib/types/events/quickstart-initiated.js +3 -3
  243. package/lib/types/events/quickstart-initiated.js.map +1 -1
  244. package/lib/types/events/sdk-publish-validation-failed.js +1 -1
  245. package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
  246. package/lib/types/file/directory.d.ts +4 -9
  247. package/lib/types/file/directory.js +17 -65
  248. package/lib/types/file/directory.js.map +1 -1
  249. package/lib/types/file/directoryPath.d.ts +17 -0
  250. package/lib/types/file/directoryPath.js +47 -2
  251. package/lib/types/file/directoryPath.js.map +1 -1
  252. package/lib/types/file/fileName.d.ts +8 -0
  253. package/lib/types/file/fileName.js +28 -6
  254. package/lib/types/file/fileName.js.map +1 -1
  255. package/lib/types/file/filePath.d.ts +18 -2
  256. package/lib/types/file/filePath.js +39 -4
  257. package/lib/types/file/filePath.js.map +1 -1
  258. package/lib/types/file/resource-input.js +1 -2
  259. package/lib/types/file/resource-input.js.map +1 -1
  260. package/lib/types/file/urlPath.js +2 -1
  261. package/lib/types/file/urlPath.js.map +1 -1
  262. package/lib/types/flags-provider.js +22 -22
  263. package/lib/types/flags-provider.js.map +1 -1
  264. package/lib/types/package-settings-context.js +2 -1
  265. package/lib/types/package-settings-context.js.map +1 -1
  266. package/lib/types/plugin/plugin-config.d.ts +10 -50
  267. package/lib/types/plugin/plugin-config.js +7 -1
  268. package/lib/types/plugin/plugin-config.js.map +1 -1
  269. package/lib/types/plugin-config-context.d.ts +30 -37
  270. package/lib/types/plugin-config-context.js +108 -139
  271. package/lib/types/plugin-config-context.js.map +1 -1
  272. package/lib/types/plugin-context.js +3 -2
  273. package/lib/types/plugin-context.js.map +1 -1
  274. package/lib/types/portal/code-samples.d.ts +27 -0
  275. package/lib/types/portal/code-samples.js +67 -0
  276. package/lib/types/portal/code-samples.js.map +1 -0
  277. package/lib/types/portal/config/ai-config.d.ts +15 -0
  278. package/lib/types/portal/config/ai-config.js +26 -0
  279. package/lib/types/portal/config/ai-config.js.map +1 -0
  280. package/lib/types/portal/config/brand-config.d.ts +55 -0
  281. package/lib/types/portal/config/brand-config.js +105 -0
  282. package/lib/types/portal/config/brand-config.js.map +1 -0
  283. package/lib/types/portal/config/color.d.ts +19 -0
  284. package/lib/types/portal/config/color.js +43 -0
  285. package/lib/types/portal/config/color.js.map +1 -0
  286. package/lib/types/portal/config/fields.d.ts +23 -0
  287. package/lib/types/portal/config/fields.js +67 -0
  288. package/lib/types/portal/config/fields.js.map +1 -0
  289. package/lib/types/portal/config/link.d.ts +18 -0
  290. package/lib/types/portal/config/link.js +72 -0
  291. package/lib/types/portal/config/link.js.map +1 -0
  292. package/lib/types/portal/config/navigation-config.d.ts +13 -0
  293. package/lib/types/portal/config/navigation-config.js +30 -0
  294. package/lib/types/portal/config/navigation-config.js.map +1 -0
  295. package/lib/types/portal/config/site-config.d.ts +32 -0
  296. package/lib/types/portal/config/site-config.js +88 -0
  297. package/lib/types/portal/config/site-config.js.map +1 -0
  298. package/lib/types/portal/config/static-asset.d.ts +25 -0
  299. package/lib/types/portal/config/static-asset.js +77 -0
  300. package/lib/types/portal/config/static-asset.js.map +1 -0
  301. package/lib/types/portal/content-notices.d.ts +20 -0
  302. package/lib/types/portal/content-notices.js +2 -0
  303. package/lib/types/portal/content-notices.js.map +1 -0
  304. package/lib/types/portal/content-tree.d.ts +103 -0
  305. package/lib/types/portal/content-tree.js +344 -0
  306. package/lib/types/portal/content-tree.js.map +1 -0
  307. package/lib/types/portal/endpoint.d.ts +6 -0
  308. package/lib/types/portal/endpoint.js +12 -0
  309. package/lib/types/portal/endpoint.js.map +1 -0
  310. package/lib/types/portal/generated-pages.d.ts +68 -0
  311. package/lib/types/portal/generated-pages.js +111 -0
  312. package/lib/types/portal/generated-pages.js.map +1 -0
  313. package/lib/types/portal/generation-status.d.ts +31 -0
  314. package/lib/types/portal/generation-status.js +26 -0
  315. package/lib/types/portal/generation-status.js.map +1 -0
  316. package/lib/types/portal/openapi-document.d.ts +48 -0
  317. package/lib/types/portal/openapi-document.js +138 -0
  318. package/lib/types/portal/openapi-document.js.map +1 -0
  319. package/lib/types/portal/page-fragments.d.ts +13 -0
  320. package/lib/types/portal/page-fragments.js +24 -0
  321. package/lib/types/portal/page-fragments.js.map +1 -0
  322. package/lib/types/portal/page-template.d.ts +15 -0
  323. package/lib/types/portal/page-template.js +64 -0
  324. package/lib/types/portal/page-template.js.map +1 -0
  325. package/lib/types/portal/page.d.ts +24 -0
  326. package/lib/types/portal/page.js +100 -0
  327. package/lib/types/portal/page.js.map +1 -0
  328. package/lib/types/portal/portal-artifacts.d.ts +25 -0
  329. package/lib/types/portal/portal-artifacts.js +30 -0
  330. package/lib/types/portal/portal-artifacts.js.map +1 -0
  331. package/lib/types/portal/portal-config.d.ts +69 -0
  332. package/lib/types/portal/portal-config.js +105 -0
  333. package/lib/types/portal/portal-config.js.map +1 -0
  334. package/lib/types/portal/portal-downloads.d.ts +8 -0
  335. package/lib/types/portal/portal-downloads.js +14 -0
  336. package/lib/types/portal/portal-downloads.js.map +1 -0
  337. package/lib/types/portal/portal-languages.d.ts +15 -0
  338. package/lib/types/portal/portal-languages.js +45 -0
  339. package/lib/types/portal/portal-languages.js.map +1 -0
  340. package/lib/types/portal/portal-navigation.d.ts +65 -0
  341. package/lib/types/portal/portal-navigation.js +217 -0
  342. package/lib/types/portal/portal-navigation.js.map +1 -0
  343. package/lib/types/portal/portal-sdk.d.ts +15 -0
  344. package/lib/types/portal/portal-sdk.js +28 -0
  345. package/lib/types/portal/portal-sdk.js.map +1 -0
  346. package/lib/types/portal/portal-source.d.ts +129 -0
  347. package/lib/types/portal/portal-source.js +2 -0
  348. package/lib/types/portal/portal-source.js.map +1 -0
  349. package/lib/types/portal/portal-stylesheet.d.ts +19 -0
  350. package/lib/types/portal/portal-stylesheet.js +40 -0
  351. package/lib/types/portal/portal-stylesheet.js.map +1 -0
  352. package/lib/types/portal/portal-tabs.d.ts +33 -0
  353. package/lib/types/portal/portal-tabs.js +38 -0
  354. package/lib/types/portal/portal-tabs.js.map +1 -0
  355. package/lib/types/portal/preview-config.d.ts +20 -0
  356. package/lib/types/portal/preview-config.js +32 -0
  357. package/lib/types/portal/preview-config.js.map +1 -0
  358. package/lib/types/portal/preview-content.d.ts +18 -0
  359. package/lib/types/portal/preview-content.js +50 -0
  360. package/lib/types/portal/preview-content.js.map +1 -0
  361. package/lib/types/portal/published-package.d.ts +12 -0
  362. package/lib/types/portal/published-package.js +35 -0
  363. package/lib/types/portal/published-package.js.map +1 -0
  364. package/lib/types/portal/unknown-fields.d.ts +5 -0
  365. package/lib/types/portal/unknown-fields.js +10 -0
  366. package/lib/types/portal/unknown-fields.js.map +1 -0
  367. package/lib/types/portal-context.d.ts +38 -6
  368. package/lib/types/portal-context.js +71 -24
  369. package/lib/types/portal-context.js.map +1 -1
  370. package/lib/types/portal-source-context.d.ts +77 -0
  371. package/lib/types/portal-source-context.js +408 -0
  372. package/lib/types/portal-source-context.js.map +1 -0
  373. package/lib/types/project-context.d.ts +49 -0
  374. package/lib/types/project-context.js +151 -0
  375. package/lib/types/project-context.js.map +1 -0
  376. package/lib/types/project-layout.d.ts +9 -0
  377. package/lib/types/project-layout.js +10 -0
  378. package/lib/types/project-layout.js.map +1 -0
  379. package/lib/types/publish/package-settings-configuration.d.ts +2 -0
  380. package/lib/types/publish/profile-id.js +1 -0
  381. package/lib/types/publish/profile-id.js.map +1 -1
  382. package/lib/types/publish/publishing-profile.d.ts +3 -1
  383. package/lib/types/publish/publishing-profile.js +33 -15
  384. package/lib/types/publish/publishing-profile.js.map +1 -1
  385. package/lib/types/publish/publishing-profiles.js +2 -1
  386. package/lib/types/publish/publishing-profiles.js.map +1 -1
  387. package/lib/types/publish/version.js +1 -0
  388. package/lib/types/publish/version.js.map +1 -1
  389. package/lib/types/resource-context.js +3 -2
  390. package/lib/types/resource-context.js.map +1 -1
  391. package/lib/types/sdk/generate.d.ts +22 -16
  392. package/lib/types/sdk/generate.js +64 -41
  393. package/lib/types/sdk/generate.js.map +1 -1
  394. package/lib/types/sdk/stability-choice.d.ts +12 -0
  395. package/lib/types/sdk/stability-choice.js +24 -0
  396. package/lib/types/sdk/stability-choice.js.map +1 -0
  397. package/lib/types/sdk-context.d.ts +4 -5
  398. package/lib/types/sdk-context.js +10 -18
  399. package/lib/types/sdk-context.js.map +1 -1
  400. package/lib/types/spec-context.d.ts +5 -4
  401. package/lib/types/spec-context.js +9 -8
  402. package/lib/types/spec-context.js.map +1 -1
  403. package/lib/types/temp-context.d.ts +1 -1
  404. package/lib/types/temp-context.js +5 -4
  405. package/lib/types/temp-context.js.map +1 -1
  406. package/lib/types/transform-context.d.ts +9 -5
  407. package/lib/types/transform-context.js +21 -18
  408. package/lib/types/transform-context.js.map +1 -1
  409. package/lib/utils/error-utils.d.ts +2 -0
  410. package/lib/utils/error-utils.js +5 -0
  411. package/lib/utils/error-utils.js.map +1 -0
  412. package/lib/utils/json-utils.d.ts +2 -0
  413. package/lib/utils/json-utils.js +4 -0
  414. package/lib/utils/json-utils.js.map +1 -0
  415. package/lib/utils/string-utils.d.ts +8 -1
  416. package/lib/utils/string-utils.js +13 -26
  417. package/lib/utils/string-utils.js.map +1 -1
  418. package/lib/utils/utils.d.ts +1 -3
  419. package/lib/utils/utils.js +12 -40
  420. package/lib/utils/utils.js.map +1 -1
  421. package/oclif.manifest.json +69 -357
  422. package/package.json +47 -25
  423. package/portal-pages/context-plugin.mdx +26 -0
  424. package/portal-pages/sdk.mdx +8 -0
  425. package/portal-pages/sdks.mdx +11 -0
  426. package/portal-template/NOTICE +37 -0
  427. package/portal-template/downloads.ts +41 -0
  428. package/portal-template/generated-pages-reload.ts +51 -0
  429. package/portal-template/package.json +11 -0
  430. package/portal-template/portal-config.ts +32 -0
  431. package/portal-template/prerender-pages.ts +81 -0
  432. package/portal-template/spec-reload.ts +26 -0
  433. package/portal-template/src/components/api-page.tsx +15 -0
  434. package/portal-template/src/components/code-block.tsx +9 -0
  435. package/portal-template/src/components/command-block.tsx +50 -0
  436. package/portal-template/src/components/example-layout.tsx +99 -0
  437. package/portal-template/src/components/logos.tsx +127 -0
  438. package/portal-template/src/components/mdx.tsx +28 -0
  439. package/portal-template/src/components/not-found.tsx +11 -0
  440. package/portal-template/src/components/plugin-install.tsx +22 -0
  441. package/portal-template/src/components/plugin-support.tsx +53 -0
  442. package/portal-template/src/components/sdk-actions.tsx +79 -0
  443. package/portal-template/src/components/sdk-cards.tsx +100 -0
  444. package/portal-template/src/components/search.tsx +41 -0
  445. package/portal-template/src/components/usage-tabs.tsx +92 -0
  446. package/portal-template/src/lib/code-samples.server.ts +40 -0
  447. package/portal-template/src/lib/code-samples.ts +43 -0
  448. package/portal-template/src/lib/code-titles.ts +29 -0
  449. package/portal-template/src/lib/install-command.ts +13 -0
  450. package/portal-template/src/lib/json.ts +5 -0
  451. package/portal-template/src/lib/layout.shared.tsx +41 -0
  452. package/portal-template/src/lib/layout.tsx +16 -0
  453. package/portal-template/src/lib/llms.server.ts +54 -0
  454. package/portal-template/src/lib/media-adapters.ts +34 -0
  455. package/portal-template/src/lib/navigation.ts +406 -0
  456. package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
  457. package/portal-template/src/lib/openapi-filter.ts +191 -0
  458. package/portal-template/src/lib/openapi-labels.ts +15 -0
  459. package/portal-template/src/lib/openapi-methods.ts +12 -0
  460. package/portal-template/src/lib/openapi-section.server.ts +280 -0
  461. package/portal-template/src/lib/openapi-slim.ts +202 -0
  462. package/portal-template/src/lib/openapi.server.ts +16 -0
  463. package/portal-template/src/lib/portal-types.ts +36 -0
  464. package/portal-template/src/lib/portal.server.ts +13 -0
  465. package/portal-template/src/lib/portal.ts +11 -0
  466. package/portal-template/src/lib/rehype-code-titles.ts +53 -0
  467. package/portal-template/src/lib/request-examples.ts +72 -0
  468. package/portal-template/src/lib/seo.ts +21 -0
  469. package/portal-template/src/lib/shared.ts +51 -0
  470. package/portal-template/src/lib/shiki-bundle.ts +104 -0
  471. package/portal-template/src/lib/sitemap.server.ts +20 -0
  472. package/portal-template/src/lib/source.server.ts +27 -0
  473. package/portal-template/src/lib/source.ts +49 -0
  474. package/portal-template/src/lib/tabs.ts +37 -0
  475. package/portal-template/src/router.tsx +12 -0
  476. package/portal-template/src/routes/$.tsx +194 -0
  477. package/portal-template/src/routes/__root.tsx +56 -0
  478. package/portal-template/src/routes/api/search[.]json.ts +9 -0
  479. package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
  480. package/portal-template/src/routes/llms[.]txt.ts +10 -0
  481. package/portal-template/src/routes/robots[.]txt.ts +10 -0
  482. package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
  483. package/portal-template/src/routes/spa-shell.tsx +7 -0
  484. package/portal-template/src/routes/{$}[.]md.ts +21 -0
  485. package/portal-template/src/styles/app.css +33 -0
  486. package/portal-template/tsconfig.json +26 -0
  487. package/portal-template/vite.config.ts +68 -0
  488. package/lib/actions/plugin/record-sdk.d.ts +0 -14
  489. package/lib/actions/plugin/record-sdk.js +0 -60
  490. package/lib/actions/plugin/record-sdk.js.map +0 -1
  491. package/lib/actions/portal/copilot.d.ts +0 -17
  492. package/lib/actions/portal/copilot.js +0 -89
  493. package/lib/actions/portal/copilot.js.map +0 -1
  494. package/lib/actions/portal/quickstart.d.ts +0 -18
  495. package/lib/actions/portal/quickstart.js +0 -238
  496. package/lib/actions/portal/quickstart.js.map +0 -1
  497. package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
  498. package/lib/actions/portal/recipe/new-recipe.js +0 -177
  499. package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
  500. package/lib/actions/portal/toc/new-toc.d.ts +0 -21
  501. package/lib/actions/portal/toc/new-toc.js +0 -95
  502. package/lib/actions/portal/toc/new-toc.js.map +0 -1
  503. package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
  504. package/lib/actions/sdk/merge-source-tree.js +0 -78
  505. package/lib/actions/sdk/merge-source-tree.js.map +0 -1
  506. package/lib/actions/sdk/quickstart.d.ts +0 -18
  507. package/lib/actions/sdk/quickstart.js +0 -188
  508. package/lib/actions/sdk/quickstart.js.map +0 -1
  509. package/lib/actions/sdk/save-changes.d.ts +0 -8
  510. package/lib/actions/sdk/save-changes.js +0 -93
  511. package/lib/actions/sdk/save-changes.js.map +0 -1
  512. package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
  513. package/lib/application/portal/recipe/portal-recipe.js +0 -33
  514. package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
  515. package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
  516. package/lib/application/portal/recipe/recipe-generator.js +0 -130
  517. package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
  518. package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
  519. package/lib/application/portal/toc/toc-content-parser.js +0 -44
  520. package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
  521. package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
  522. package/lib/application/portal/toc/toc-structure-generator.js +0 -165
  523. package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
  524. package/lib/commands/portal/copilot.d.ts +0 -13
  525. package/lib/commands/portal/copilot.js +0 -34
  526. package/lib/commands/portal/copilot.js.map +0 -1
  527. package/lib/commands/portal/recipe/new.d.ts +0 -12
  528. package/lib/commands/portal/recipe/new.js +0 -45
  529. package/lib/commands/portal/recipe/new.js.map +0 -1
  530. package/lib/commands/portal/toc/new.d.ts +0 -16
  531. package/lib/commands/portal/toc/new.js +0 -68
  532. package/lib/commands/portal/toc/new.js.map +0 -1
  533. package/lib/commands/sdk/save-changes.d.ts +0 -14
  534. package/lib/commands/sdk/save-changes.js +0 -51
  535. package/lib/commands/sdk/save-changes.js.map +0 -1
  536. package/lib/infrastructure/debounce-service.d.ts +0 -10
  537. package/lib/infrastructure/debounce-service.js +0 -55
  538. package/lib/infrastructure/debounce-service.js.map +0 -1
  539. package/lib/infrastructure/services/portal-service.d.ts +0 -43
  540. package/lib/infrastructure/services/portal-service.js +0 -337
  541. package/lib/infrastructure/services/portal-service.js.map +0 -1
  542. package/lib/prompts/plugin/record-sdk.d.ts +0 -9
  543. package/lib/prompts/plugin/record-sdk.js +0 -40
  544. package/lib/prompts/plugin/record-sdk.js.map +0 -1
  545. package/lib/prompts/portal/copilot.d.ts +0 -18
  546. package/lib/prompts/portal/copilot.js +0 -82
  547. package/lib/prompts/portal/copilot.js.map +0 -1
  548. package/lib/prompts/portal/quickstart.d.ts +0 -42
  549. package/lib/prompts/portal/quickstart.js +0 -243
  550. package/lib/prompts/portal/quickstart.js.map +0 -1
  551. package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
  552. package/lib/prompts/portal/recipe/new-recipe.js +0 -165
  553. package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
  554. package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
  555. package/lib/prompts/portal/toc/new-toc.js +0 -50
  556. package/lib/prompts/portal/toc/new-toc.js.map +0 -1
  557. package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
  558. package/lib/prompts/sdk/merge-source-tree.js +0 -90
  559. package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
  560. package/lib/prompts/sdk/quickstart.d.ts +0 -38
  561. package/lib/prompts/sdk/quickstart.js +0 -196
  562. package/lib/prompts/sdk/quickstart.js.map +0 -1
  563. package/lib/prompts/sdk/save-changes.d.ts +0 -21
  564. package/lib/prompts/sdk/save-changes.js +0 -84
  565. package/lib/prompts/sdk/save-changes.js.map +0 -1
  566. package/lib/types/build-context.d.ts +0 -26
  567. package/lib/types/build-context.js +0 -111
  568. package/lib/types/build-context.js.map +0 -1
  569. package/lib/types/events/recipe-creation-failed.d.ts +0 -5
  570. package/lib/types/events/recipe-creation-failed.js +0 -8
  571. package/lib/types/events/recipe-creation-failed.js.map +0 -1
  572. package/lib/types/events/sdk-changes-saved.d.ts +0 -8
  573. package/lib/types/events/sdk-changes-saved.js +0 -11
  574. package/lib/types/events/sdk-changes-saved.js.map +0 -1
  575. package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
  576. package/lib/types/events/sdk-changes-tracked.js +0 -11
  577. package/lib/types/events/sdk-changes-tracked.js.map +0 -1
  578. package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
  579. package/lib/types/events/sdk-conflicts-resolved.js +0 -11
  580. package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
  581. package/lib/types/events/toc-creation-failed.d.ts +0 -5
  582. package/lib/types/events/toc-creation-failed.js +0 -8
  583. package/lib/types/events/toc-creation-failed.js.map +0 -1
  584. package/lib/types/merge-source-tree-context.d.ts +0 -28
  585. package/lib/types/merge-source-tree-context.js +0 -63
  586. package/lib/types/merge-source-tree-context.js.map +0 -1
  587. package/lib/types/plugin/language-entry.d.ts +0 -9
  588. package/lib/types/plugin/language-entry.js +0 -64
  589. package/lib/types/plugin/language-entry.js.map +0 -1
  590. package/lib/types/recipe/recipe.d.ts +0 -22
  591. package/lib/types/recipe/recipe.js +0 -6
  592. package/lib/types/recipe/recipe.js.map +0 -1
  593. package/lib/types/recipe-context.d.ts +0 -9
  594. package/lib/types/recipe-context.js +0 -26
  595. package/lib/types/recipe-context.js.map +0 -1
  596. package/lib/types/save-changes-context.d.ts +0 -17
  597. package/lib/types/save-changes-context.js +0 -42
  598. package/lib/types/save-changes-context.js.map +0 -1
  599. package/lib/types/sdl/sdl.d.ts +0 -10
  600. package/lib/types/sdl/sdl.js +0 -18
  601. package/lib/types/sdl/sdl.js.map +0 -1
  602. package/lib/types/toc/toc-components.d.ts +0 -36
  603. package/lib/types/toc/toc-components.js +0 -94
  604. package/lib/types/toc/toc-components.js.map +0 -1
  605. package/lib/types/toc/toc.d.ts +0 -67
  606. package/lib/types/toc/toc.js +0 -2
  607. package/lib/types/toc/toc.js.map +0 -1
  608. package/lib/types/toc-context.d.ts +0 -12
  609. package/lib/types/toc-context.js +0 -26
  610. package/lib/types/toc-context.js.map +0 -1
@@ -0,0 +1,129 @@
1
+ import { DirectoryPath } from '../file/directoryPath.js';
2
+ import { FileName } from '../file/fileName.js';
3
+ import { FilePath } from '../file/filePath.js';
4
+ import { Endpoint } from './endpoint.js';
5
+ import { SuggestedSite } from './config/site-config.js';
6
+ import { ContentNotices } from './content-notices.js';
7
+ import { GeneratedPages, GeneratedSection } from './generated-pages.js';
8
+ import { PortalConfig } from './portal-config.js';
9
+ /** An OpenAPI document found in `src/spec/`, with the slug its section is mounted at. */
10
+ export interface PortalSpec {
11
+ slug: string;
12
+ file: FilePath;
13
+ /** Its operations, including those behind a `$ref` path item. */
14
+ endpoints: Endpoint[];
15
+ }
16
+ /** What `apimatic.json` decides about a portal, which `portal serve` reads again on every edit. */
17
+ export interface PortalSettings {
18
+ config: PortalConfig;
19
+ generatedPages: GeneratedPages;
20
+ }
21
+ /** A validated portal source directory, ready to be built. */
22
+ export interface PortalSource extends PortalSettings {
23
+ /**
24
+ * What the only specification says about itself, or null with several. Kept so `portal serve`
25
+ * can judge an edited config without reading the specifications again.
26
+ */
27
+ suggestedSite: SuggestedSite | null;
28
+ specs: PortalSpec[];
29
+ contentDirectory: DirectoryPath | null;
30
+ staticDirectory: DirectoryPath | null;
31
+ shadowedFiles: FileName[];
32
+ contentNotices: ContentNotices;
33
+ }
34
+ /** Why a source directory could not be written; each variant maps to its own message. */
35
+ export type PortalScaffoldProblem = {
36
+ kind: 'configUnreadable';
37
+ } | {
38
+ kind: 'configUnwritable';
39
+ } | {
40
+ kind: 'sourceUnwritable';
41
+ reason: string;
42
+ };
43
+ /** A file the build reads and cannot find. */
44
+ export interface MissingFile {
45
+ file: FilePath;
46
+ /**
47
+ * The same file in another case, when there is one. Found here because Windows and macOS
48
+ * ignore case, but a link in it 404s on the hosts portals are published to, which do not.
49
+ */
50
+ foundAs: FilePath | null;
51
+ }
52
+ /** A file `apimatic.json` names, by the setting that names it. */
53
+ export interface MissingStaticFile extends MissingFile {
54
+ setting: string;
55
+ }
56
+ /** A page of the user's served at an address the CLI keeps for the pages it generates. */
57
+ export interface ReservedAddressPage {
58
+ file: FilePath;
59
+ /** Where the page would be served, which a `(group)` folder makes differ from its path. */
60
+ address: string;
61
+ section: GeneratedSection;
62
+ }
63
+ /** Pages of the user's that would be served at one address, which only one of them can have. */
64
+ export interface SharedAddress {
65
+ address: string;
66
+ pages: FilePath[];
67
+ }
68
+ /** A page's Markdown image that the build would import and not find, which fails the whole build. */
69
+ export interface MissingImage {
70
+ page: FilePath;
71
+ line: number;
72
+ url: string;
73
+ /** Null for an image beside its page that points out of `content/`'s copy, which the build never looks for. */
74
+ missing: MissingFile | null;
75
+ }
76
+ /** Why `content/` cannot be built; each variant maps to its own message. */
77
+ export type ContentProblem = {
78
+ kind: 'unreadableContent';
79
+ } | {
80
+ kind: 'groupNamedPages';
81
+ pages: FilePath[];
82
+ } | {
83
+ kind: 'reservedAddresses';
84
+ pages: ReservedAddressPage[];
85
+ } | {
86
+ kind: 'sharedAddresses';
87
+ addresses: SharedAddress[];
88
+ } | {
89
+ kind: 'invalidFrontMatter';
90
+ errors: string[];
91
+ } | {
92
+ kind: 'invalidNavigation';
93
+ errors: string[];
94
+ } | {
95
+ kind: 'missingImages';
96
+ images: MissingImage[];
97
+ };
98
+ /** How `api transform` would turn the first document in `spec/` into one the portal reads. */
99
+ export interface SpecConversion {
100
+ file: FilePath;
101
+ /** What the document is instead, when it says; null for one that names no format. */
102
+ format: string | null;
103
+ /** Where `api transform --destination` of `spec/` writes it, which is one folder too deep. */
104
+ converted: FilePath;
105
+ others: number;
106
+ }
107
+ /** Why a source directory cannot be built; each variant maps to its own message. */
108
+ export type PortalSourceProblem = {
109
+ kind: 'missingConfig';
110
+ } | {
111
+ kind: 'invalidConfig';
112
+ errors: string[];
113
+ missingPortal: boolean;
114
+ } | {
115
+ kind: 'invalidContent';
116
+ problems: ContentProblem[];
117
+ } | {
118
+ kind: 'unreadableSpec';
119
+ fileName: FileName;
120
+ } | {
121
+ kind: 'emptySpecDirectory';
122
+ folders: DirectoryPath[];
123
+ } | {
124
+ kind: 'noOpenApiSpec';
125
+ conversion: SpecConversion;
126
+ } | {
127
+ kind: 'missingStaticFiles';
128
+ files: MissingStaticFile[];
129
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=portal-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-source.js","sourceRoot":"","sources":["../../../src/types/portal/portal-source.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { PortalConfig } from './portal-config.js';
2
+ /**
3
+ * Scoped with `:not(.dark)`: a bare `:root` has the specificity of the theme's `.dark` block and
4
+ * comes after it, so a colour meant for light mode would win in dark mode too.
5
+ */
6
+ export declare const LIGHT_SELECTOR = ":root:not(.dark)";
7
+ export declare const DARK_SELECTOR = ".dark";
8
+ /**
9
+ * The build project's `src/styles/theme.css`. `app.css` imports it after the Fumadocs theme,
10
+ * so what it sets comes last. A file of its own rather than a substitution, so `portal serve`
11
+ * can rewrite it whole when the block changes; rendered here so the CSS is tested without a build.
12
+ */
13
+ export declare class PortalStylesheet {
14
+ private readonly primary;
15
+ private constructor();
16
+ static of(config: PortalConfig): PortalStylesheet;
17
+ toString(): string;
18
+ private static rule;
19
+ }
@@ -0,0 +1,40 @@
1
+ const HEADER = "/* Written by the APIMatic CLI from the 'portal' block of src/apimatic.json. Edit that instead. */";
2
+ /**
3
+ * Scoped with `:not(.dark)`: a bare `:root` has the specificity of the theme's `.dark` block and
4
+ * comes after it, so a colour meant for light mode would win in dark mode too.
5
+ */
6
+ export const LIGHT_SELECTOR = ':root:not(.dark)';
7
+ export const DARK_SELECTOR = '.dark';
8
+ /**
9
+ * The build project's `src/styles/theme.css`. `app.css` imports it after the Fumadocs theme,
10
+ * so what it sets comes last. A file of its own rather than a substitution, so `portal serve`
11
+ * can rewrite it whole when the block changes; rendered here so the CSS is tested without a build.
12
+ */
13
+ export class PortalStylesheet {
14
+ primary;
15
+ constructor(primary) {
16
+ this.primary = primary;
17
+ }
18
+ static of(config) {
19
+ return new PortalStylesheet(config.brandSettings().brandColors().primaryColors());
20
+ }
21
+ toString() {
22
+ const rules = this.primary === null
23
+ ? []
24
+ : [
25
+ PortalStylesheet.rule(LIGHT_SELECTOR, this.primary.light),
26
+ PortalStylesheet.rule(DARK_SELECTOR, this.primary.dark)
27
+ ];
28
+ return [HEADER, ...rules].join('\n\n').concat('\n');
29
+ }
30
+ static rule(selector, primary) {
31
+ const declarations = [
32
+ ['--color-fd-primary', primary.toString()],
33
+ ['--color-fd-primary-foreground', primary.foreground().toString()],
34
+ ['--color-fd-ring', primary.toString()]
35
+ ];
36
+ const body = declarations.map(([name, value]) => ` ${name}: ${value};`).join('\n');
37
+ return `${selector} {\n${body}\n}`;
38
+ }
39
+ }
40
+ //# sourceMappingURL=portal-stylesheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-stylesheet.js","sourceRoot":"","sources":["../../../src/types/portal/portal-stylesheet.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,GAAG,oGAAoG,CAAC;AAEpH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAErC;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IACU,OAAO;IAA5C,YAAqC,OAA6C;uBAA7C,OAAO;IAAyC,CAAC;IAE/E,MAAM,CAAC,EAAE,CAAC,MAAoB;QACnC,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ;QACb,MAAM,KAAK,GACT,IAAI,CAAC,OAAO,KAAK,IAAI;YACnB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBACzD,gBAAgB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;aACxD,CAAC;QACR,OAAO,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEO,MAAM,CAAC,IAAI,CAAC,QAAgB,EAAE,OAAc;QAClD,MAAM,YAAY,GAAG;YACnB,CAAC,oBAAoB,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC1C,CAAC,+BAA+B,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC;YAClE,CAAC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;SACxC,CAAC;QACF,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpF,OAAO,GAAG,QAAQ,OAAO,IAAI,KAAK,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import { DirectoryPath } from '../file/directoryPath.js';
2
+ import { FilePath } from '../file/filePath.js';
3
+ import { GeneratedSection } from './generated-pages.js';
4
+ /** What a tab is made of. */
5
+ export type TabOwner = {
6
+ kind: 'home';
7
+ } | {
8
+ kind: 'folder';
9
+ directory: DirectoryPath;
10
+ } | {
11
+ kind: 'apiReference';
12
+ } | {
13
+ kind: 'generated';
14
+ section: GeneratedSection;
15
+ };
16
+ /** A tab by the name the tab bar shows for it. */
17
+ export interface PortalTab {
18
+ owner: TabOwner;
19
+ name: string;
20
+ /** The `nav.json` or index page whose title gives the name, or null when the portal gives it. */
21
+ namedBy: FilePath | null;
22
+ }
23
+ /** A name the tab bar would show for more than one tab, which leaves them indistinguishable. */
24
+ export interface SharedTabName {
25
+ /** As the first of the tabs spells it; the others may differ from it in case. */
26
+ name: string;
27
+ tabs: PortalTab[];
28
+ }
29
+ export declare function sharedTabNames(tabs: PortalTab[]): SharedTabName[];
30
+ /** The name the template gives a tab that no title names. */
31
+ export declare function untitledTabName(owner: TabOwner): string;
32
+ /** Fumadocs' name for a folder that nothing names: its directory's, as `pathToName` spells it. */
33
+ export declare function directoryTabName(directoryName: string): string;
@@ -0,0 +1,38 @@
1
+ import { GROUP_FOLDER } from './portal-navigation.js';
2
+ // A reader cannot tell Guides from guides in a tab bar any more than Guides from Guides.
3
+ export function sharedTabNames(tabs) {
4
+ const byName = new Map();
5
+ for (const tab of tabs) {
6
+ const key = tab.name.toLowerCase();
7
+ byName.set(key, [...(byName.get(key) ?? []), tab]);
8
+ }
9
+ return [...byName.values()]
10
+ .filter((named) => named.length > 1)
11
+ .map((named) => ({ name: named[0].name, tabs: named }));
12
+ }
13
+ /** The name the template gives a tab that no title names. */
14
+ export function untitledTabName(owner) {
15
+ switch (owner.kind) {
16
+ case 'home':
17
+ return 'Home';
18
+ case 'apiReference':
19
+ return 'API Reference';
20
+ case 'generated':
21
+ return owner.section.title;
22
+ case 'folder':
23
+ return directoryTabName(owner.directory.leafName());
24
+ }
25
+ }
26
+ /** Fumadocs' name for a folder that nothing names: its directory's, as `pathToName` spells it. */
27
+ export function directoryTabName(directoryName) {
28
+ const name = GROUP_FOLDER.exec(directoryName)?.[1] ?? directoryName;
29
+ return [...name]
30
+ .map((character, index) => {
31
+ if (index === 0) {
32
+ return character.toLocaleUpperCase();
33
+ }
34
+ return character === '-' ? ' ' : character;
35
+ })
36
+ .join('');
37
+ }
38
+ //# sourceMappingURL=portal-tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-tabs.js","sourceRoot":"","sources":["../../../src/types/portal/portal-tabs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAyBtD,yFAAyF;AACzF,MAAM,UAAU,cAAc,CAAC,IAAiB;IAC9C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;SACxB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;SACnC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,KAAe;IAC7C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,cAAc;YACjB,OAAO,eAAe,CAAC;QACzB,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,gBAAgB,CAAC,aAAqB;IACpD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC;IACpE,OAAO,CAAC,GAAG,IAAI,CAAC;SACb,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;QACxB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC,iBAAiB,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { PortalConfig } from './portal-config.js';
2
+ /** The notice is given once, on the save that brings it about, rather than on every save after it. */
3
+ export declare class PreviewConfig {
4
+ private readonly servesStatic;
5
+ private shown;
6
+ private refused;
7
+ /**
8
+ * `servesStatic`: the dev server serves `static/` only if it was there at startup, and a
9
+ * block that names a file in it was refused unless it was.
10
+ */
11
+ constructor(startup: PortalConfig, servesStatic: boolean);
12
+ refuse(): void;
13
+ staticDirectoryNotServed(config: PortalConfig): boolean;
14
+ /**
15
+ * Records the edit as shown, and answers whether to say it was applied: a file fixed back to
16
+ * what the preview shows writes nothing, but the user was told it was refused, so hears that
17
+ * it is accepted again.
18
+ */
19
+ show(config: PortalConfig, written: boolean): boolean;
20
+ }
@@ -0,0 +1,32 @@
1
+ /** The notice is given once, on the save that brings it about, rather than on every save after it. */
2
+ export class PreviewConfig {
3
+ servesStatic;
4
+ shown;
5
+ refused = false;
6
+ /**
7
+ * `servesStatic`: the dev server serves `static/` only if it was there at startup, and a
8
+ * block that names a file in it was refused unless it was.
9
+ */
10
+ constructor(startup, servesStatic) {
11
+ this.servesStatic = servesStatic;
12
+ this.shown = startup;
13
+ }
14
+ refuse() {
15
+ this.refused = true;
16
+ }
17
+ staticDirectoryNotServed(config) {
18
+ return !this.servesStatic && config.staticFiles().length > 0 && this.shown.staticFiles().length === 0;
19
+ }
20
+ /**
21
+ * Records the edit as shown, and answers whether to say it was applied: a file fixed back to
22
+ * what the preview shows writes nothing, but the user was told it was refused, so hears that
23
+ * it is accepted again.
24
+ */
25
+ show(config, written) {
26
+ const announce = written || this.refused;
27
+ this.refused = false;
28
+ this.shown = config;
29
+ return announce;
30
+ }
31
+ }
32
+ //# sourceMappingURL=preview-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-config.js","sourceRoot":"","sources":["../../../src/types/portal/preview-config.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,MAAM,OAAO,aAAa;IAQ4B,YAAY;IAPxD,KAAK,CAAe;IACpB,OAAO,GAAG,KAAK,CAAC;IAExB;;;OAGG;IACH,YAAY,OAAqB,EAAmB,YAAqB;4BAArB,YAAY;QAC9D,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;IACvB,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAEM,wBAAwB,CAAC,MAAoB;QAClD,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;IACxG,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,MAAoB,EAAE,OAAgB;QAChD,MAAM,QAAQ,GAAG,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import { ContentNotices } from './content-notices.js';
2
+ /** A notice is given once, on the save that brings it about, rather than on every save after it. */
3
+ export declare class PreviewContent {
4
+ private shown;
5
+ private refused;
6
+ /** `startup`: what the checks before the preview started reported. */
7
+ constructor(startup: ContentNotices);
8
+ refuse(): void;
9
+ /**
10
+ * Records the content as shown, and answers whether to say it is fixed, having been refused,
11
+ * and which notices to give: each kind in full when it holds something new, and none otherwise.
12
+ */
13
+ show(notices: ContentNotices): {
14
+ fixed: boolean;
15
+ notices: ContentNotices;
16
+ };
17
+ private static since;
18
+ }
@@ -0,0 +1,50 @@
1
+ /** A notice is given once, on the save that brings it about, rather than on every save after it. */
2
+ export class PreviewContent {
3
+ shown;
4
+ refused = false;
5
+ /** `startup`: what the checks before the preview started reported. */
6
+ constructor(startup) {
7
+ this.shown = startup;
8
+ }
9
+ refuse() {
10
+ this.refused = true;
11
+ }
12
+ /**
13
+ * Records the content as shown, and answers whether to say it is fixed, having been refused,
14
+ * and which notices to give: each kind in full when it holds something new, and none otherwise.
15
+ */
16
+ show(notices) {
17
+ const shown = { fixed: this.refused, notices: PreviewContent.since(notices, this.shown) };
18
+ this.refused = false;
19
+ this.shown = notices;
20
+ return shown;
21
+ }
22
+ static since(current, previous) {
23
+ return {
24
+ hiddenPages: whenAnyNew(current.hiddenPages, previous.hiddenPages, (left, right) => left.isEqual(right)),
25
+ ignoredNavigationFiles: whenAnyNew(current.ignoredNavigationFiles, previous.ignoredNavigationFiles, (left, right) => left.isEqual(right)),
26
+ folderTabs: whenAnyNew(current.folderTabs, previous.folderTabs, (left, right) => left.isEqual(right)),
27
+ sharedTabNames: whenAnyNew(current.sharedTabNames, previous.sharedTabNames, isSameSharedName)
28
+ };
29
+ }
30
+ }
31
+ function whenAnyNew(current, previous, isSame) {
32
+ return current.some((item) => !previous.some((earlier) => isSame(item, earlier))) ? current : [];
33
+ }
34
+ /** The same name on the same tabs, whichever file gives it to each. */
35
+ function isSameSharedName(left, right) {
36
+ return (left.name === right.name &&
37
+ left.tabs.length === right.tabs.length &&
38
+ left.tabs.every((tab) => right.tabs.some((other) => isSameOwner(tab.owner, other.owner))));
39
+ }
40
+ function isSameOwner(left, right) {
41
+ switch (left.kind) {
42
+ case 'folder':
43
+ return right.kind === 'folder' && left.directory.isEqual(right.directory);
44
+ case 'generated':
45
+ return right.kind === 'generated' && left.section === right.section;
46
+ default:
47
+ return left.kind === right.kind;
48
+ }
49
+ }
50
+ //# sourceMappingURL=preview-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-content.js","sourceRoot":"","sources":["../../../src/types/portal/preview-content.ts"],"names":[],"mappings":"AAGA,oGAAoG;AACpG,MAAM,OAAO,cAAc;IACjB,KAAK,CAAiB;IACtB,OAAO,GAAG,KAAK,CAAC;IAExB,sEAAsE;IACtE,YAAY,OAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;IACvB,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,IAAI,CAAC,OAAuB;QACjC,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1F,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,OAAuB,EAAE,QAAwB;QACpE,OAAO;YACL,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACxG,sBAAsB,EAAE,UAAU,CAChC,OAAO,CAAC,sBAAsB,EAC9B,QAAQ,CAAC,sBAAsB,EAC/B,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CACrC;YACD,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACrG,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;SAC9F,CAAC;IACJ,CAAC;CACF;AAED,SAAS,UAAU,CAAI,OAAY,EAAE,QAAa,EAAE,MAAsC;IACxF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;AACnG,CAAC;AAED,uEAAuE;AACvE,SAAS,gBAAgB,CAAC,IAAmB,EAAE,KAAoB;IACjE,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;QACxB,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM;QACtC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAC1F,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAc,EAAE,KAAe;IAClD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5E,KAAK,WAAW;YACd,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,CAAC;QACtE;YACE,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { UrlPath } from '../file/urlPath.js';
2
+ import { Language } from '../sdk/generate.js';
3
+ /** A released SDK package, as its public registry lists it. */
4
+ export interface PublishedPackage {
5
+ name: string;
6
+ registry: string;
7
+ url: UrlPath;
8
+ /** The shell command that adds the package to a project. */
9
+ install: string;
10
+ }
11
+ /** Null when the configuration does not name the package, which the backend's validation reports. */
12
+ export declare function publishedPackage(language: Language, configuration: Readonly<Record<string, unknown>>): PublishedPackage | null;
@@ -0,0 +1,35 @@
1
+ import { UrlPath } from '../file/urlPath.js';
2
+ import { Language } from '../sdk/generate.js';
3
+ // The public registry of each language the portal supports; a private one is not told apart.
4
+ const REGISTRIES = {
5
+ [Language.TYPESCRIPT]: {
6
+ name: 'npm',
7
+ nameField: 'name',
8
+ // `encodeURI` keeps a scoped name's `@` and `/`, which npm addresses as they are.
9
+ address: (packageName) => `https://www.npmjs.com/package/${encodeURI(packageName)}`,
10
+ install: (packageName) => `npm install ${packageName}`
11
+ },
12
+ [Language.PYTHON]: {
13
+ name: 'PyPI',
14
+ nameField: 'name',
15
+ address: (packageName) => `https://pypi.org/project/${encodeURIComponent(packageName)}/`,
16
+ install: (packageName) => `pip install ${packageName}`
17
+ },
18
+ [Language.CSHARP]: {
19
+ name: 'NuGet',
20
+ nameField: 'packageId',
21
+ address: (packageName) => `https://www.nuget.org/packages/${encodeURIComponent(packageName)}`,
22
+ install: (packageName) => `dotnet add package ${packageName}`
23
+ }
24
+ };
25
+ /** Null when the configuration does not name the package, which the backend's validation reports. */
26
+ export function publishedPackage(language, configuration) {
27
+ const registry = REGISTRIES[language];
28
+ const field = registry === undefined ? undefined : configuration[registry.nameField];
29
+ const name = typeof field === 'string' ? field.trim() : '';
30
+ if (registry === undefined || name.length === 0) {
31
+ return null;
32
+ }
33
+ return { name, registry: registry.name, url: new UrlPath(registry.address(name)), install: registry.install(name) };
34
+ }
35
+ //# sourceMappingURL=published-package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"published-package.js","sourceRoot":"","sources":["../../../src/types/portal/published-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAkB9C,6FAA6F;AAC7F,MAAM,UAAU,GAA6C;IAC3D,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QACrB,IAAI,EAAE,KAAK;QACX,SAAS,EAAE,MAAM;QACjB,kFAAkF;QAClF,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,iCAAiC,SAAS,CAAC,WAAW,CAAC,EAAE;QACnF,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,eAAe,WAAW,EAAE;KACvD;IACD,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjB,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,4BAA4B,kBAAkB,CAAC,WAAW,CAAC,GAAG;QACxF,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,eAAe,WAAW,EAAE;KACvD;IACD,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjB,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,kCAAkC,kBAAkB,CAAC,WAAW,CAAC,EAAE;QAC7F,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,sBAAsB,WAAW,EAAE;KAC9D;CACF,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,gBAAgB,CAC9B,QAAkB,EAClB,aAAgD;IAEhD,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAI,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;AACtH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A misspelled field is the one mistake that otherwise produces a portal that builds and is
3
+ * quietly wrong, so each is reported.
4
+ */
5
+ export declare function unknownFieldErrors(data: Record<string, unknown>, known: ReadonlySet<string>, describe: (field: string) => string): string[];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A misspelled field is the one mistake that otherwise produces a portal that builds and is
3
+ * quietly wrong, so each is reported.
4
+ */
5
+ export function unknownFieldErrors(data, known, describe) {
6
+ return Object.keys(data)
7
+ .filter((field) => !known.has(field))
8
+ .map(describe);
9
+ }
10
+ //# sourceMappingURL=unknown-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown-fields.js","sourceRoot":"","sources":["../../../src/types/portal/unknown-fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAA6B,EAC7B,KAA0B,EAC1B,QAAmC;IAEnC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;SACrB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACpC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnB,CAAC"}
@@ -1,13 +1,45 @@
1
- import { DirectoryPath } from "./file/directoryPath.js";
2
- import { FilePath } from "./file/filePath.js";
1
+ import { Result } from 'neverthrow';
2
+ import { DirectoryPath } from './file/directoryPath.js';
3
+ import { FilePath } from './file/filePath.js';
4
+ /** Emitted even by a failed build, so it never counts as a page. */
5
+ export declare const SHELL_FILE_NAME = "_shell.html";
6
+ export declare const NOT_FOUND_FILE_NAME = "404.html";
7
+ export declare const ZIP_FILE_NAME = "portal.zip";
8
+ /**
9
+ * Why the finished site did not reach the portal directory. `stagingFailed` leaves the
10
+ * previous portal as it was; `replaceFailed` happened while it was being swapped out, so
11
+ * whatever did not make it into place is kept at `stagedAt` for the user to move by hand.
12
+ */
13
+ export type PortalSaveProblem = {
14
+ kind: 'stagingFailed';
15
+ reason: string;
16
+ } | {
17
+ kind: 'replaceFailed';
18
+ reason: string;
19
+ stagedAt: DirectoryPath;
20
+ };
3
21
  export declare class PortalContext {
4
22
  private readonly portalDirectory;
5
23
  private readonly fileService;
6
24
  private readonly zipService;
7
25
  constructor(portalDirectory: DirectoryPath);
8
- private get ZipPath();
9
- private get reportPath();
26
+ private get stagingDirectory();
27
+ private get buildLogPath();
28
+ /**
29
+ * Whether anything is there to overwrite. A staging directory left by a save that could
30
+ * not finish counts, hidden as it is: it may hold the only complete copy of the site.
31
+ */
10
32
  exists(): Promise<boolean>;
11
- save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
12
- saveError(tempErrorFilePath: FilePath): Promise<FilePath>;
33
+ /**
34
+ * Writes the finished site to the portal directory, as files or as a single archive.
35
+ * The site is staged inside the destination first, so the previous portal is only
36
+ * touched once the whole new one is on the same volume and what remains is a rename.
37
+ */
38
+ save(builtDirectory: DirectoryPath, asZip: boolean): Promise<Result<void, PortalSaveProblem>>;
39
+ /**
40
+ * Keeps a failed build's output for the user to inspect after the temp project is gone.
41
+ * Null when the log itself could not be written.
42
+ */
43
+ saveBuildLog(log: string): Promise<FilePath | null>;
44
+ private addNotFoundPage;
13
45
  }