@uapkg/cli 1.3.0 → 1.3.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 (412) hide show
  1. package/dist/app/CompositionRoot.d.ts +36 -33
  2. package/dist/app/CompositionRoot.d.ts.map +1 -1
  3. package/dist/app/CompositionRoot.js +91 -109
  4. package/dist/app/CompositionRoot.js.map +1 -1
  5. package/dist/app/UAPKGApplication.d.ts +6 -3
  6. package/dist/app/UAPKGApplication.d.ts.map +1 -1
  7. package/dist/app/UAPKGApplication.js +155 -169
  8. package/dist/app/UAPKGApplication.js.map +1 -1
  9. package/dist/build/BuildMetadata.d.ts +9 -6
  10. package/dist/build/BuildMetadata.d.ts.map +1 -1
  11. package/dist/build/BuildMetadata.js +2 -2
  12. package/dist/cli/UAPKGCommandLine.d.ts +259 -257
  13. package/dist/cli/UAPKGCommandLine.d.ts.map +1 -1
  14. package/dist/cli/UAPKGCommandLine.js +248 -239
  15. package/dist/cli/UAPKGCommandLine.js.map +1 -1
  16. package/dist/cli/parseCommandLine.d.ts +5 -1
  17. package/dist/cli/parseCommandLine.d.ts.map +1 -1
  18. package/dist/cli/parseCommandLine.js +8 -3
  19. package/dist/cli/parseCommandLine.js.map +1 -1
  20. package/dist/cli/parsing/UAPKGCommandLineParser.d.ts +9 -6
  21. package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +1 -1
  22. package/dist/cli/parsing/UAPKGCommandLineParser.js +23 -31
  23. package/dist/cli/parsing/UAPKGCommandLineParser.js.map +1 -1
  24. package/dist/cli/parsing/UAPKGParserRegistry.d.ts +12 -9
  25. package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +1 -1
  26. package/dist/cli/parsing/UAPKGParserRegistry.js +53 -50
  27. package/dist/cli/parsing/UAPKGParserRegistry.js.map +1 -1
  28. package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts +9 -6
  29. package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +1 -1
  30. package/dist/cli/parsing/contracts/UAPKGCommandModule.js +1 -2
  31. package/dist/cli/parsing/modules/AddCommandModule.d.ts +8 -5
  32. package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +1 -1
  33. package/dist/cli/parsing/modules/AddCommandModule.js +49 -36
  34. package/dist/cli/parsing/modules/AddCommandModule.js.map +1 -1
  35. package/dist/cli/parsing/modules/ConfigCommandModule.d.ts +8 -5
  36. package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +1 -1
  37. package/dist/cli/parsing/modules/ConfigCommandModule.js +87 -83
  38. package/dist/cli/parsing/modules/ConfigCommandModule.js.map +1 -1
  39. package/dist/cli/parsing/modules/InitCommandModule.d.ts +8 -5
  40. package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +1 -1
  41. package/dist/cli/parsing/modules/InitCommandModule.js +25 -22
  42. package/dist/cli/parsing/modules/InitCommandModule.js.map +1 -1
  43. package/dist/cli/parsing/modules/InstallCommandModule.d.ts +8 -5
  44. package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +1 -1
  45. package/dist/cli/parsing/modules/InstallCommandModule.js +36 -28
  46. package/dist/cli/parsing/modules/InstallCommandModule.js.map +1 -1
  47. package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts +8 -5
  48. package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +1 -1
  49. package/dist/cli/parsing/modules/LifecycleCommandModule.js +78 -50
  50. package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +1 -1
  51. package/dist/cli/parsing/modules/ListCommandModule.d.ts +8 -5
  52. package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +1 -1
  53. package/dist/cli/parsing/modules/ListCommandModule.js +26 -15
  54. package/dist/cli/parsing/modules/ListCommandModule.js.map +1 -1
  55. package/dist/cli/parsing/modules/LoginCommandModule.d.ts +8 -5
  56. package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +1 -1
  57. package/dist/cli/parsing/modules/LoginCommandModule.js +34 -33
  58. package/dist/cli/parsing/modules/LoginCommandModule.js.map +1 -1
  59. package/dist/cli/parsing/modules/LogoutCommandModule.d.ts +8 -5
  60. package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +1 -1
  61. package/dist/cli/parsing/modules/LogoutCommandModule.js +30 -28
  62. package/dist/cli/parsing/modules/LogoutCommandModule.js.map +1 -1
  63. package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts +8 -5
  64. package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +1 -1
  65. package/dist/cli/parsing/modules/OutdatedCommandModule.js +21 -16
  66. package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +1 -1
  67. package/dist/cli/parsing/modules/PackCommandModule.d.ts +8 -5
  68. package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +1 -1
  69. package/dist/cli/parsing/modules/PackCommandModule.js +30 -28
  70. package/dist/cli/parsing/modules/PackCommandModule.js.map +1 -1
  71. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts +8 -5
  72. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +1 -1
  73. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +14 -11
  74. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +1 -1
  75. package/dist/cli/parsing/modules/PublishCommandModule.d.ts +8 -5
  76. package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +1 -1
  77. package/dist/cli/parsing/modules/PublishCommandModule.js +63 -47
  78. package/dist/cli/parsing/modules/PublishCommandModule.js.map +1 -1
  79. package/dist/cli/parsing/modules/RegistryCommandModule.d.ts +8 -5
  80. package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +1 -1
  81. package/dist/cli/parsing/modules/RegistryCommandModule.js +117 -120
  82. package/dist/cli/parsing/modules/RegistryCommandModule.js.map +1 -1
  83. package/dist/cli/parsing/modules/RemoveCommandModule.d.ts +8 -5
  84. package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +1 -1
  85. package/dist/cli/parsing/modules/RemoveCommandModule.js +25 -14
  86. package/dist/cli/parsing/modules/RemoveCommandModule.js.map +1 -1
  87. package/dist/cli/parsing/modules/RequestsCommandModule.d.ts +8 -5
  88. package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +1 -1
  89. package/dist/cli/parsing/modules/RequestsCommandModule.js +56 -60
  90. package/dist/cli/parsing/modules/RequestsCommandModule.js.map +1 -1
  91. package/dist/cli/parsing/modules/UpdateCommandModule.d.ts +8 -5
  92. package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +1 -1
  93. package/dist/cli/parsing/modules/UpdateCommandModule.js +38 -25
  94. package/dist/cli/parsing/modules/UpdateCommandModule.js.map +1 -1
  95. package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts +8 -5
  96. package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +1 -1
  97. package/dist/cli/parsing/modules/WhoamiCommandModule.js +30 -28
  98. package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +1 -1
  99. package/dist/cli/parsing/modules/WhyCommandModule.d.ts +8 -5
  100. package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +1 -1
  101. package/dist/cli/parsing/modules/WhyCommandModule.js +25 -14
  102. package/dist/cli/parsing/modules/WhyCommandModule.js.map +1 -1
  103. package/dist/cli/parsing/modules/sharedOptions.d.ts +8 -5
  104. package/dist/cli/parsing/modules/sharedOptions.d.ts.map +1 -1
  105. package/dist/cli/parsing/modules/sharedOptions.js +18 -23
  106. package/dist/cli/parsing/modules/sharedOptions.js.map +1 -1
  107. package/dist/cli/runUAPKGCLI.d.ts +4 -1
  108. package/dist/cli/runUAPKGCLI.d.ts.map +1 -1
  109. package/dist/cli/runUAPKGCLI.js +10 -5
  110. package/dist/cli/runUAPKGCLI.js.map +1 -1
  111. package/dist/cli-bootstrap.d.ts +1 -2
  112. package/dist/cli-bootstrap.js +15 -12
  113. package/dist/cli-bootstrap.js.map +1 -1
  114. package/dist/commands/AddCommand.d.ts +19 -16
  115. package/dist/commands/AddCommand.d.ts.map +1 -1
  116. package/dist/commands/AddCommand.js +49 -53
  117. package/dist/commands/AddCommand.js.map +1 -1
  118. package/dist/commands/Command.d.ts +5 -2
  119. package/dist/commands/Command.d.ts.map +1 -1
  120. package/dist/commands/Command.js +1 -2
  121. package/dist/commands/ConfigCommand.d.ts +28 -25
  122. package/dist/commands/ConfigCommand.d.ts.map +1 -1
  123. package/dist/commands/ConfigCommand.js +165 -186
  124. package/dist/commands/ConfigCommand.js.map +1 -1
  125. package/dist/commands/InitCommand.d.ts +19 -16
  126. package/dist/commands/InitCommand.d.ts.map +1 -1
  127. package/dist/commands/InitCommand.js +65 -60
  128. package/dist/commands/InitCommand.js.map +1 -1
  129. package/dist/commands/InstallCommand.d.ts +16 -13
  130. package/dist/commands/InstallCommand.d.ts.map +1 -1
  131. package/dist/commands/InstallCommand.js +118 -110
  132. package/dist/commands/InstallCommand.js.map +1 -1
  133. package/dist/commands/ListCommand.d.ts +13 -10
  134. package/dist/commands/ListCommand.d.ts.map +1 -1
  135. package/dist/commands/ListCommand.js +76 -81
  136. package/dist/commands/ListCommand.js.map +1 -1
  137. package/dist/commands/LoginCommand.d.ts +17 -14
  138. package/dist/commands/LoginCommand.d.ts.map +1 -1
  139. package/dist/commands/LoginCommand.js +66 -72
  140. package/dist/commands/LoginCommand.js.map +1 -1
  141. package/dist/commands/LogoutCommand.d.ts +15 -12
  142. package/dist/commands/LogoutCommand.d.ts.map +1 -1
  143. package/dist/commands/LogoutCommand.js +36 -37
  144. package/dist/commands/LogoutCommand.js.map +1 -1
  145. package/dist/commands/OutdatedCommand.d.ts +12 -9
  146. package/dist/commands/OutdatedCommand.d.ts.map +1 -1
  147. package/dist/commands/OutdatedCommand.js +41 -40
  148. package/dist/commands/OutdatedCommand.js.map +1 -1
  149. package/dist/commands/PackCommand.d.ts +13 -10
  150. package/dist/commands/PackCommand.d.ts.map +1 -1
  151. package/dist/commands/PackCommand.js +26 -21
  152. package/dist/commands/PackCommand.js.map +1 -1
  153. package/dist/commands/PackageLifecycleCommand.d.ts +23 -19
  154. package/dist/commands/PackageLifecycleCommand.d.ts.map +1 -1
  155. package/dist/commands/PackageLifecycleCommand.js +144 -138
  156. package/dist/commands/PackageLifecycleCommand.js.map +1 -1
  157. package/dist/commands/PostinstallCandidateBuilder.d.ts +11 -8
  158. package/dist/commands/PostinstallCandidateBuilder.d.ts.map +1 -1
  159. package/dist/commands/PostinstallCandidateBuilder.js +42 -42
  160. package/dist/commands/PostinstallCandidateBuilder.js.map +1 -1
  161. package/dist/commands/ProjectGetNameCommand.d.ts +10 -7
  162. package/dist/commands/ProjectGetNameCommand.d.ts.map +1 -1
  163. package/dist/commands/ProjectGetNameCommand.js +25 -25
  164. package/dist/commands/ProjectGetNameCommand.js.map +1 -1
  165. package/dist/commands/PublishCommand.d.ts +29 -23
  166. package/dist/commands/PublishCommand.d.ts.map +1 -1
  167. package/dist/commands/PublishCommand.js +243 -254
  168. package/dist/commands/PublishCommand.js.map +1 -1
  169. package/dist/commands/RegistryCommand.d.ts +38 -35
  170. package/dist/commands/RegistryCommand.d.ts.map +1 -1
  171. package/dist/commands/RegistryCommand.js +195 -223
  172. package/dist/commands/RegistryCommand.js.map +1 -1
  173. package/dist/commands/RemoveCommand.d.ts +14 -11
  174. package/dist/commands/RemoveCommand.d.ts.map +1 -1
  175. package/dist/commands/RemoveCommand.js +47 -54
  176. package/dist/commands/RemoveCommand.js.map +1 -1
  177. package/dist/commands/RequestsCommand.d.ts +21 -18
  178. package/dist/commands/RequestsCommand.d.ts.map +1 -1
  179. package/dist/commands/RequestsCommand.js +82 -95
  180. package/dist/commands/RequestsCommand.js.map +1 -1
  181. package/dist/commands/UpdateCommand.d.ts +29 -26
  182. package/dist/commands/UpdateCommand.d.ts.map +1 -1
  183. package/dist/commands/UpdateCommand.js +111 -111
  184. package/dist/commands/UpdateCommand.js.map +1 -1
  185. package/dist/commands/WhoamiCommand.d.ts +30 -27
  186. package/dist/commands/WhoamiCommand.d.ts.map +1 -1
  187. package/dist/commands/WhoamiCommand.js +63 -72
  188. package/dist/commands/WhoamiCommand.js.map +1 -1
  189. package/dist/commands/WhyCommand.d.ts +13 -10
  190. package/dist/commands/WhyCommand.d.ts.map +1 -1
  191. package/dist/commands/WhyCommand.js +45 -44
  192. package/dist/commands/WhyCommand.js.map +1 -1
  193. package/dist/commands/add/DependencyAddResolver.d.ts +14 -11
  194. package/dist/commands/add/DependencyAddResolver.d.ts.map +1 -1
  195. package/dist/commands/add/DependencyAddResolver.js +36 -36
  196. package/dist/commands/add/DependencyAddResolver.js.map +1 -1
  197. package/dist/control-plane/AccountManager.d.ts +96 -94
  198. package/dist/control-plane/AccountManager.d.ts.map +1 -1
  199. package/dist/control-plane/AccountManager.js +775 -967
  200. package/dist/control-plane/AccountManager.js.map +1 -1
  201. package/dist/control-plane/ArtifactObserver.d.ts +19 -16
  202. package/dist/control-plane/ArtifactObserver.d.ts.map +1 -1
  203. package/dist/control-plane/ArtifactObserver.js +73 -59
  204. package/dist/control-plane/ArtifactObserver.js.map +1 -1
  205. package/dist/control-plane/AuthMetadataStore.d.ts +16 -13
  206. package/dist/control-plane/AuthMetadataStore.d.ts.map +1 -1
  207. package/dist/control-plane/AuthMetadataStore.js +111 -113
  208. package/dist/control-plane/AuthMetadataStore.js.map +1 -1
  209. package/dist/control-plane/AuthStoragePaths.d.ts +7 -4
  210. package/dist/control-plane/AuthStoragePaths.d.ts.map +1 -1
  211. package/dist/control-plane/AuthStoragePaths.js +19 -14
  212. package/dist/control-plane/AuthStoragePaths.js.map +1 -1
  213. package/dist/control-plane/AuthenticationSelector.d.ts +21 -18
  214. package/dist/control-plane/AuthenticationSelector.d.ts.map +1 -1
  215. package/dist/control-plane/AuthenticationSelector.js +69 -63
  216. package/dist/control-plane/AuthenticationSelector.js.map +1 -1
  217. package/dist/control-plane/ControlPlaneClient.d.ts +37 -28
  218. package/dist/control-plane/ControlPlaneClient.d.ts.map +1 -1
  219. package/dist/control-plane/ControlPlaneClient.js +265 -254
  220. package/dist/control-plane/ControlPlaneClient.js.map +1 -1
  221. package/dist/control-plane/ControlPlaneEndpoints.d.ts +9 -6
  222. package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +1 -1
  223. package/dist/control-plane/ControlPlaneEndpoints.js +17 -12
  224. package/dist/control-plane/ControlPlaneEndpoints.js.map +1 -1
  225. package/dist/control-plane/ControlPlaneTypes.d.ts +176 -152
  226. package/dist/control-plane/ControlPlaneTypes.d.ts.map +1 -1
  227. package/dist/control-plane/ControlPlaneTypes.js +88 -81
  228. package/dist/control-plane/ControlPlaneTypes.js.map +1 -1
  229. package/dist/control-plane/CredentialStore.d.ts +20 -18
  230. package/dist/control-plane/CredentialStore.d.ts.map +1 -1
  231. package/dist/control-plane/CredentialStore.js +66 -83
  232. package/dist/control-plane/CredentialStore.js.map +1 -1
  233. package/dist/control-plane/DPoPKeyStore.d.ts +12 -9
  234. package/dist/control-plane/DPoPKeyStore.d.ts.map +1 -1
  235. package/dist/control-plane/DPoPKeyStore.js +57 -53
  236. package/dist/control-plane/DPoPKeyStore.js.map +1 -1
  237. package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts +37 -4
  238. package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +1 -1
  239. package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +197 -63
  240. package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +1 -1
  241. package/dist/control-plane/PublishIdempotencyStore.d.ts +25 -9
  242. package/dist/control-plane/PublishIdempotencyStore.d.ts.map +1 -1
  243. package/dist/control-plane/PublishIdempotencyStore.js +97 -68
  244. package/dist/control-plane/PublishIdempotencyStore.js.map +1 -1
  245. package/dist/control-plane/PublishRequestErrorMapper.d.ts +155 -0
  246. package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +1 -0
  247. package/dist/control-plane/PublishRequestErrorMapper.js +597 -0
  248. package/dist/control-plane/PublishRequestErrorMapper.js.map +1 -0
  249. package/dist/control-plane/RegistryGrantLock.d.ts +29 -26
  250. package/dist/control-plane/RegistryGrantLock.d.ts.map +1 -1
  251. package/dist/control-plane/RegistryGrantLock.js +149 -185
  252. package/dist/control-plane/RegistryGrantLock.js.map +1 -1
  253. package/dist/control-plane/RegistryTrustResolver.d.ts +13 -10
  254. package/dist/control-plane/RegistryTrustResolver.d.ts.map +1 -1
  255. package/dist/control-plane/RegistryTrustResolver.js +97 -132
  256. package/dist/control-plane/RegistryTrustResolver.js.map +1 -1
  257. package/dist/index.d.ts +62 -39
  258. package/dist/index.js +60 -53
  259. package/dist/postinstall/api/PostinstallDsl.d.ts +24 -21
  260. package/dist/postinstall/api/PostinstallDsl.d.ts.map +1 -1
  261. package/dist/postinstall/api/PostinstallDsl.js +32 -35
  262. package/dist/postinstall/api/PostinstallDsl.js.map +1 -1
  263. package/dist/postinstall/api/definePostinstall.d.ts +5 -2
  264. package/dist/postinstall/api/definePostinstall.d.ts.map +1 -1
  265. package/dist/postinstall/api/definePostinstall.js +20 -16
  266. package/dist/postinstall/api/definePostinstall.js.map +1 -1
  267. package/dist/postinstall/index.d.ts +25 -26
  268. package/dist/postinstall/index.js +25 -37
  269. package/dist/postinstall/loader/EntryResolver.d.ts +11 -9
  270. package/dist/postinstall/loader/EntryResolver.d.ts.map +1 -1
  271. package/dist/postinstall/loader/EntryResolver.js +36 -32
  272. package/dist/postinstall/loader/EntryResolver.js.map +1 -1
  273. package/dist/postinstall/loader/EsbuildTranspiler.d.ts +6 -3
  274. package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +1 -1
  275. package/dist/postinstall/loader/EsbuildTranspiler.js +52 -56
  276. package/dist/postinstall/loader/EsbuildTranspiler.js.map +1 -1
  277. package/dist/postinstall/loader/ExportValidator.d.ts +8 -5
  278. package/dist/postinstall/loader/ExportValidator.d.ts.map +1 -1
  279. package/dist/postinstall/loader/ExportValidator.js +36 -32
  280. package/dist/postinstall/loader/ExportValidator.js.map +1 -1
  281. package/dist/postinstall/loader/ModuleImporter.d.ts +17 -14
  282. package/dist/postinstall/loader/ModuleImporter.d.ts.map +1 -1
  283. package/dist/postinstall/loader/ModuleImporter.js +50 -58
  284. package/dist/postinstall/loader/ModuleImporter.js.map +1 -1
  285. package/dist/postinstall/loader/PostinstallLoader.d.ts +22 -19
  286. package/dist/postinstall/loader/PostinstallLoader.d.ts.map +1 -1
  287. package/dist/postinstall/loader/PostinstallLoader.js +62 -58
  288. package/dist/postinstall/loader/PostinstallLoader.js.map +1 -1
  289. package/dist/postinstall/markers/MarkerBlockEditor.d.ts +19 -16
  290. package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +1 -1
  291. package/dist/postinstall/markers/MarkerBlockEditor.js +48 -44
  292. package/dist/postinstall/markers/MarkerBlockEditor.js.map +1 -1
  293. package/dist/postinstall/markers/MarkerBlockService.d.ts +10 -7
  294. package/dist/postinstall/markers/MarkerBlockService.d.ts.map +1 -1
  295. package/dist/postinstall/markers/MarkerBlockService.js +44 -44
  296. package/dist/postinstall/markers/MarkerBlockService.js.map +1 -1
  297. package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts +12 -9
  298. package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +1 -1
  299. package/dist/postinstall/markers/MarkerIntegrityValidator.js +47 -52
  300. package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +1 -1
  301. package/dist/postinstall/policy/PostinstallPolicyGate.d.ts +25 -23
  302. package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +1 -1
  303. package/dist/postinstall/policy/PostinstallPolicyGate.js +63 -52
  304. package/dist/postinstall/policy/PostinstallPolicyGate.js.map +1 -1
  305. package/dist/postinstall/runner/PostinstallOrchestrator.d.ts +48 -45
  306. package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +1 -1
  307. package/dist/postinstall/runner/PostinstallOrchestrator.js +172 -170
  308. package/dist/postinstall/runner/PostinstallOrchestrator.js.map +1 -1
  309. package/dist/postinstall/unreal/BuildCsInjector.d.ts +16 -13
  310. package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +1 -1
  311. package/dist/postinstall/unreal/BuildCsInjector.js +58 -53
  312. package/dist/postinstall/unreal/BuildCsInjector.js.map +1 -1
  313. package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts +13 -10
  314. package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +1 -1
  315. package/dist/postinstall/unreal/CSharpInjectionEngine.js +56 -59
  316. package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +1 -1
  317. package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts +11 -8
  318. package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +1 -1
  319. package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +123 -127
  320. package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +1 -1
  321. package/dist/postinstall/unreal/CSharpStructures.d.ts +18 -15
  322. package/dist/postinstall/unreal/CSharpStructures.d.ts.map +1 -1
  323. package/dist/postinstall/unreal/CSharpStructures.js +1 -2
  324. package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts +7 -4
  325. package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +1 -1
  326. package/dist/postinstall/unreal/CSharpWrapperFactory.js +54 -58
  327. package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +1 -1
  328. package/dist/postinstall/unreal/PluginHash.d.ts +5 -2
  329. package/dist/postinstall/unreal/PluginHash.d.ts.map +1 -1
  330. package/dist/postinstall/unreal/PluginHash.js +13 -8
  331. package/dist/postinstall/unreal/PluginHash.js.map +1 -1
  332. package/dist/postinstall/unreal/PrettyParseError.d.ts +8 -5
  333. package/dist/postinstall/unreal/PrettyParseError.d.ts.map +1 -1
  334. package/dist/postinstall/unreal/PrettyParseError.js +37 -37
  335. package/dist/postinstall/unreal/PrettyParseError.js.map +1 -1
  336. package/dist/postinstall/unreal/ProjectFileLocator.d.ts +12 -9
  337. package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +1 -1
  338. package/dist/postinstall/unreal/ProjectFileLocator.js +49 -51
  339. package/dist/postinstall/unreal/ProjectFileLocator.js.map +1 -1
  340. package/dist/postinstall/unreal/TargetCsInjector.d.ts +16 -13
  341. package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +1 -1
  342. package/dist/postinstall/unreal/TargetCsInjector.js +58 -53
  343. package/dist/postinstall/unreal/TargetCsInjector.js.map +1 -1
  344. package/dist/postinstall/unreal/UProjectInjector.d.ts +6 -3
  345. package/dist/postinstall/unreal/UProjectInjector.d.ts.map +1 -1
  346. package/dist/postinstall/unreal/UProjectInjector.js +56 -52
  347. package/dist/postinstall/unreal/UProjectInjector.js.map +1 -1
  348. package/dist/postinstall/unreal/UProjectMetadataReader.d.ts +5 -2
  349. package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +1 -1
  350. package/dist/postinstall/unreal/UProjectMetadataReader.js +22 -18
  351. package/dist/postinstall/unreal/UProjectMetadataReader.js.map +1 -1
  352. package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts +17 -14
  353. package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +1 -1
  354. package/dist/postinstall/unreal/UnrealSourceCatalog.js +50 -50
  355. package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +1 -1
  356. package/dist/prompts/InkPromptService.d.ts +10 -7
  357. package/dist/prompts/InkPromptService.d.ts.map +1 -1
  358. package/dist/prompts/InkPromptService.js +100 -71
  359. package/dist/prompts/InkPromptService.js.map +1 -1
  360. package/dist/prompts/ProjectContextDetector.d.ts +10 -7
  361. package/dist/prompts/ProjectContextDetector.d.ts.map +1 -1
  362. package/dist/prompts/ProjectContextDetector.js +32 -26
  363. package/dist/prompts/ProjectContextDetector.js.map +1 -1
  364. package/dist/prompts/PromptService.d.ts +11 -8
  365. package/dist/prompts/PromptService.d.ts.map +1 -1
  366. package/dist/prompts/PromptService.js +1 -8
  367. package/dist/reporting/DiagnosticDeduplicator.d.ts +8 -5
  368. package/dist/reporting/DiagnosticDeduplicator.d.ts.map +1 -1
  369. package/dist/reporting/DiagnosticDeduplicator.js +36 -35
  370. package/dist/reporting/DiagnosticDeduplicator.js.map +1 -1
  371. package/dist/reporting/DiagnosticRenderer.d.ts +11 -8
  372. package/dist/reporting/DiagnosticRenderer.d.ts.map +1 -1
  373. package/dist/reporting/DiagnosticRenderer.js +1 -2
  374. package/dist/reporting/DiagnosticReporter.d.ts +12 -9
  375. package/dist/reporting/DiagnosticReporter.d.ts.map +1 -1
  376. package/dist/reporting/DiagnosticReporter.js +40 -39
  377. package/dist/reporting/DiagnosticReporter.js.map +1 -1
  378. package/dist/reporting/InkDiagnosticRenderer.d.ts +12 -9
  379. package/dist/reporting/InkDiagnosticRenderer.d.ts.map +1 -1
  380. package/dist/reporting/InkDiagnosticRenderer.js +50 -42
  381. package/dist/reporting/InkDiagnosticRenderer.js.map +1 -1
  382. package/dist/reporting/InstallProgressReporter.d.ts +23 -20
  383. package/dist/reporting/InstallProgressReporter.d.ts.map +1 -1
  384. package/dist/reporting/InstallProgressReporter.js +48 -47
  385. package/dist/reporting/InstallProgressReporter.js.map +1 -1
  386. package/dist/reporting/JsonReporter.d.ts +16 -13
  387. package/dist/reporting/JsonReporter.d.ts.map +1 -1
  388. package/dist/reporting/JsonReporter.js +34 -20
  389. package/dist/reporting/JsonReporter.js.map +1 -1
  390. package/dist/reporting/RegistryRequestTerminalFormatter.d.ts +36 -0
  391. package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +1 -0
  392. package/dist/reporting/RegistryRequestTerminalFormatter.js +90 -0
  393. package/dist/reporting/RegistryRequestTerminalFormatter.js.map +1 -0
  394. package/dist/reporting/TextDiagnosticRenderer.d.ts +11 -8
  395. package/dist/reporting/TextDiagnosticRenderer.d.ts.map +1 -1
  396. package/dist/reporting/TextDiagnosticRenderer.js +36 -28
  397. package/dist/reporting/TextDiagnosticRenderer.js.map +1 -1
  398. package/dist/reporting/TextSink.d.ts +14 -11
  399. package/dist/reporting/TextSink.d.ts.map +1 -1
  400. package/dist/reporting/TextSink.js +24 -20
  401. package/dist/reporting/TextSink.js.map +1 -1
  402. package/package.json +31 -32
  403. package/dist/cli/parsing/contracts/UAPKGCommandModule.js.map +0 -1
  404. package/dist/cli-bootstrap.d.ts.map +0 -1
  405. package/dist/commands/Command.js.map +0 -1
  406. package/dist/index.d.ts.map +0 -1
  407. package/dist/index.js.map +0 -1
  408. package/dist/postinstall/index.d.ts.map +0 -1
  409. package/dist/postinstall/index.js.map +0 -1
  410. package/dist/postinstall/unreal/CSharpStructures.js.map +0 -1
  411. package/dist/prompts/PromptService.js.map +0 -1
  412. package/dist/reporting/DiagnosticRenderer.js.map +0 -1
@@ -1,280 +1,291 @@
1
- import { randomUUID } from 'node:crypto';
2
- import * as oauth from 'oauth4webapi';
3
- import { z } from 'zod';
4
- import { ControlPlaneError, isOAuthScopeToken, isUAPKGCliScope, knownUAPKGCliScopes, OAuthScopeInsufficientError, OAuthScopeUnsupportedError, parseOAuthScopeTokens, UAPKG_CONTROL_PLANE_API, } from './ControlPlaneTypes.js';
1
+ import { ControlPlaneError, OAuthScopeInsufficientError, OAuthScopeUnsupportedError, UAPKG_CONTROL_PLANE_API, isOAuthScopeToken, isUAPKGCliScope, knownUAPKGCliScopes, parseOAuthScopeTokens } from "./ControlPlaneTypes.js";
2
+ import * as oauth from "oauth4webapi";
3
+ import { randomUUID } from "node:crypto";
4
+ import { z } from "zod";
5
+
6
+ //#region src/control-plane/ControlPlaneClient.ts
5
7
  const errorSchema = z.object({
6
- ok: z.literal(false),
7
- error: z.object({
8
- code: z.string(),
9
- message: z.string(),
10
- details: z.record(z.string(), z.unknown()).optional(),
11
- }),
8
+ ok: z.literal(false),
9
+ error: z.object({
10
+ code: z.string(),
11
+ message: z.string(),
12
+ details: z.record(z.string(), z.unknown()).optional()
13
+ })
12
14
  });
13
15
  const insufficientScopeDetailsSchema = z.object({
14
- requiredScopes: z.array(z.string()),
15
- missingScopes: z.array(z.string()),
16
+ requiredScopes: z.array(z.string()),
17
+ missingScopes: z.array(z.string())
16
18
  });
17
19
  const accountSchema = z.object({
18
- id: z.uuid(),
19
- username: z.string().min(1),
20
- displayName: z.string().min(1),
20
+ id: z.uuid(),
21
+ username: z.string().min(1),
22
+ displayName: z.string().min(1)
21
23
  });
22
24
  const accountGrantSchema = z.object({
23
- id: z.uuid(),
24
- deviceName: z.string().min(1),
25
- idleExpiresAt: z.iso.datetime(),
26
- absoluteExpiresAt: z.iso.datetime(),
27
- scopes: z.array(z.string()),
25
+ id: z.uuid(),
26
+ deviceName: z.string().min(1),
27
+ idleExpiresAt: z.iso.datetime(),
28
+ absoluteExpiresAt: z.iso.datetime(),
29
+ scopes: z.array(z.string())
28
30
  });
29
31
  const accountResponseSchema = z.object({
30
- ok: z.literal(true),
31
- account: accountSchema,
32
- registry: z.object({
33
- id: z.uuid(),
34
- }),
35
- grant: accountGrantSchema,
36
- });
37
- const cliLoginConfirmationResponseSchema = accountResponseSchema.extend({
38
- grant: accountGrantSchema.extend({
39
- status: z.enum(['pending', 'active']),
40
- activationExpiresAt: z.iso.datetime(),
41
- replacesGrantId: z.uuid().nullable(),
42
- }),
32
+ ok: z.literal(true),
33
+ account: accountSchema,
34
+ registry: z.object({ id: z.uuid() }),
35
+ grant: accountGrantSchema
43
36
  });
37
+ const cliLoginConfirmationResponseSchema = accountResponseSchema.extend({ grant: accountGrantSchema.extend({
38
+ status: z.enum(["pending", "active"]),
39
+ activationExpiresAt: z.iso.datetime(),
40
+ replacesGrantId: z.uuid().nullable()
41
+ }) });
44
42
  const activatedCliLoginResponseSchema = z.object({
45
- ok: z.literal(true),
46
- grant: z.object({
47
- id: z.uuid(),
48
- status: z.literal('active'),
49
- replacesGrantId: z.uuid().nullable(),
50
- }),
43
+ ok: z.literal(true),
44
+ grant: z.object({
45
+ id: z.uuid(),
46
+ status: z.literal("active"),
47
+ replacesGrantId: z.uuid().nullable()
48
+ })
51
49
  });
52
50
  const requestStatusSchema = z.enum([
53
- 'queued',
54
- 'checking',
55
- 'accepted',
56
- 'ready',
57
- 'ready_superseded',
58
- 'rejected',
59
- 'operationally_failed',
51
+ "queued",
52
+ "checking",
53
+ "accepted",
54
+ "ready",
55
+ "ready_superseded",
56
+ "rejected",
57
+ "operationally_failed"
60
58
  ]);
61
- const requestSummarySchema = z
62
- .object({
63
- id: z.string().min(1),
64
- registryId: z.string().min(1),
65
- kind: z.string().min(1),
66
- status: requestStatusSchema,
67
- currentStep: z.string().optional(),
68
- createdAt: z.number().optional(),
69
- updatedAt: z.number().optional(),
70
- payload: z
71
- .object({
72
- packageName: z.string().optional(),
73
- packageVersion: z.string().optional(),
74
- })
75
- .passthrough()
76
- .optional(),
77
- })
78
- .passthrough();
79
- export class ControlPlaneClient {
80
- apiBaseUrl;
81
- constructor(apiBaseUrl = UAPKG_CONTROL_PLANE_API) {
82
- const normalized = new URL(apiBaseUrl).href.replace(/\/+$/, '');
83
- if (normalized !== UAPKG_CONTROL_PLANE_API) {
84
- throw new Error(`UAPKG v1 control-plane requests are pinned to ${UAPKG_CONTROL_PLANE_API}.`);
85
- }
86
- this.apiBaseUrl = normalized;
87
- }
88
- async getSelf(credential, signal) {
89
- const value = await this.requestJson(credential, 'GET', '/v1/account/self', { signal });
90
- const parsed = accountResponseSchema.safeParse(value);
91
- if (!parsed.success) {
92
- throw new ControlPlaneError('ACCOUNT_SELF_RESPONSE_INVALID', 'The account identity response was invalid.');
93
- }
94
- return {
95
- account: parsed.data.account,
96
- registry: parsed.data.registry,
97
- grant: parsed.data.grant,
98
- };
99
- }
100
- async getCliLoginConfirmation(credential, signal) {
101
- const value = await this.requestJson(credential, 'GET', '/v1/account/cli-login/confirmation', { signal });
102
- const parsed = cliLoginConfirmationResponseSchema.safeParse(value);
103
- if (!parsed.success) {
104
- throw new ControlPlaneError('CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID', 'The CLI login confirmation response was invalid.');
105
- }
106
- return {
107
- account: parsed.data.account,
108
- registry: parsed.data.registry,
109
- grant: parsed.data.grant,
110
- };
111
- }
112
- async confirmCliLogin(credential, signal) {
113
- const value = await this.requestJson(credential, 'POST', '/v1/account/cli-login/confirmation', { signal });
114
- const parsed = activatedCliLoginResponseSchema.safeParse(value);
115
- if (!parsed.success) {
116
- throw new ControlPlaneError('CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID', 'The CLI login confirmation response was invalid.');
117
- }
118
- return parsed.data.grant;
119
- }
120
- async submitRegistryRequest(credential, operation, submission, options = {}) {
121
- const value = await this.requestJson(credential, 'POST', `/v1/registry-requests/${encodeURIComponent(operation)}`, {
122
- body: JSON.stringify(submission),
123
- headers: {
124
- 'content-type': 'application/json',
125
- 'x-uapkg-idempotency-key': options.idempotencyKey ?? randomUUID(),
126
- ...(options.otp ? { 'x-uapkg-otp': options.otp } : {}),
127
- },
128
- });
129
- const parsed = z
130
- .object({
131
- ok: z.literal(true),
132
- requestId: z.string().min(1),
133
- status: requestStatusSchema,
134
- message: z.string(),
135
- })
136
- .safeParse(value);
137
- if (!parsed.success) {
138
- throw new ControlPlaneError('REGISTRY_REQUEST_RESPONSE_INVALID', 'The publishing request response was invalid.');
139
- }
140
- return parsed.data;
141
- }
142
- async getRegistryRequest(credential, requestId) {
143
- const value = await this.requestJson(credential, 'GET', `/v1/registry-requests/${encodeURIComponent(requestId)}`);
144
- const parsed = z.object({ ok: z.literal(true), request: requestSummarySchema }).safeParse(value);
145
- if (!parsed.success) {
146
- throw new ControlPlaneError('REGISTRY_REQUEST_RESPONSE_INVALID', 'The publishing request response was invalid.');
147
- }
148
- return parsed.data.request;
149
- }
150
- async listRegistryRequests(credential, registryId, status) {
151
- const query = new URLSearchParams({ registryId });
152
- if (status)
153
- query.set('status', status);
154
- const value = await this.requestJson(credential, 'GET', `/v1/registry-requests?${query}`);
155
- const parsed = z
156
- .object({
157
- ok: z.literal(true),
158
- recentRequests: z.array(requestSummarySchema).optional(),
159
- requests: z.array(requestSummarySchema).optional(),
160
- })
161
- .safeParse(value);
162
- if (!parsed.success || (!parsed.data.recentRequests && !parsed.data.requests)) {
163
- throw new ControlPlaneError('REGISTRY_REQUEST_LIST_RESPONSE_INVALID', 'The publishing request list response was invalid.');
164
- }
165
- return parsed.data.recentRequests ?? parsed.data.requests ?? [];
166
- }
167
- async requestJson(credential, method, path, init = {}) {
168
- const url = new URL(path, this.apiBaseUrl);
169
- const headers = new Headers(init.headers);
170
- let response;
171
- if (credential.kind === 'dpop') {
172
- try {
173
- response = await this.withDPoPNonceRetry(() => oauth.protectedResourceRequest(credential.accessToken, method, url, headers, init.body, {
174
- DPoP: credential.dpop,
175
- signal: boundedRequestSignal(init.signal),
176
- }));
177
- }
178
- catch (error) {
179
- if (error instanceof oauth.WWWAuthenticateChallengeError) {
180
- throw await controlPlaneChallengeError(error, credential);
181
- }
182
- throw error;
183
- }
184
- }
185
- else {
186
- headers.set('authorization', `Bearer ${credential.accessToken}`);
187
- response = await fetch(url, {
188
- method,
189
- headers,
190
- body: init.body,
191
- redirect: 'error',
192
- signal: boundedRequestSignal(init.signal),
193
- });
194
- }
195
- const value = await readJson(response);
196
- if (!response.ok) {
197
- const parsed = errorSchema.safeParse(value);
198
- if (parsed.success) {
199
- throw new ControlPlaneError(parsed.data.error.code, parsed.data.error.message, response.status, parsed.data.error.details);
200
- }
201
- throw new ControlPlaneError(`HTTP_${response.status}`, `The UAPKG control plane returned HTTP ${response.status}.`, response.status);
202
- }
203
- return value;
204
- }
205
- async withDPoPNonceRetry(operation) {
206
- try {
207
- return await operation();
208
- }
209
- catch (error) {
210
- if (!oauth.isDPoPNonceError(error))
211
- throw error;
212
- return operation();
213
- }
214
- }
59
+ const requestSummarySchema = z.object({
60
+ id: z.string().min(1),
61
+ registryId: z.string().min(1),
62
+ kind: z.string().min(1),
63
+ status: requestStatusSchema,
64
+ currentStep: z.string().optional(),
65
+ createdAt: z.number().optional(),
66
+ updatedAt: z.number().optional(),
67
+ payload: z.object({
68
+ packageName: z.string().optional(),
69
+ packageVersion: z.string().optional()
70
+ }).loose().optional()
71
+ }).loose();
72
+ const requestCheckIdSchema = z.string().trim().min(1).max(128).refine((value) => !hasUnsafeDisplayCharacter(value));
73
+ const requestCheckReasonCodeSchema = z.string().trim().min(1).max(128).refine((value) => !hasUnsafeDisplayCharacter(value));
74
+ const terminalFailureReasonCodeSchema = z.string().regex(/^[A-Z][A-Z0-9_]{0,127}$/u);
75
+ const requestCheckSchema = z.object({
76
+ checkId: requestCheckIdSchema,
77
+ executionState: z.enum([
78
+ "pending",
79
+ "running",
80
+ "retrying",
81
+ "blocked_by_dependency",
82
+ "completed"
83
+ ]),
84
+ conclusion: z.enum([
85
+ "success",
86
+ "failure",
87
+ "skipped"
88
+ ]).optional(),
89
+ reasonCode: requestCheckReasonCodeSchema.optional()
90
+ });
91
+ const terminalFailureSchema = z.object({
92
+ reasonCode: terminalFailureReasonCodeSchema,
93
+ attempts: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),
94
+ maxAttempts: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional()
95
+ });
96
+ const requestDetailResponseSchema = z.object({
97
+ ok: z.literal(true),
98
+ request: requestSummarySchema,
99
+ checks: z.array(requestCheckSchema).max(100).optional(),
100
+ terminalFailure: terminalFailureSchema.optional()
101
+ });
102
+ var ControlPlaneClient = class {
103
+ apiBaseUrl;
104
+ constructor(apiBaseUrl = UAPKG_CONTROL_PLANE_API) {
105
+ const normalized = new URL(apiBaseUrl).href.replace(/\/+$/, "");
106
+ if (normalized !== UAPKG_CONTROL_PLANE_API) throw new Error(`UAPKG v1 control-plane requests are pinned to ${UAPKG_CONTROL_PLANE_API}.`);
107
+ this.apiBaseUrl = normalized;
108
+ }
109
+ async getSelf(credential, signal) {
110
+ const value = await this.requestJson(credential, "GET", "/v1/account/self", { signal });
111
+ const parsed = accountResponseSchema.safeParse(value);
112
+ if (!parsed.success) throw new ControlPlaneError("ACCOUNT_SELF_RESPONSE_INVALID", "The account identity response was invalid.");
113
+ return {
114
+ account: parsed.data.account,
115
+ registry: parsed.data.registry,
116
+ grant: parsed.data.grant
117
+ };
118
+ }
119
+ async getCliLoginConfirmation(credential, signal) {
120
+ const value = await this.requestJson(credential, "GET", "/v1/account/cli-login/confirmation", { signal });
121
+ const parsed = cliLoginConfirmationResponseSchema.safeParse(value);
122
+ if (!parsed.success) throw new ControlPlaneError("CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID", "The CLI login confirmation response was invalid.");
123
+ return {
124
+ account: parsed.data.account,
125
+ registry: parsed.data.registry,
126
+ grant: parsed.data.grant
127
+ };
128
+ }
129
+ async confirmCliLogin(credential, signal) {
130
+ const value = await this.requestJson(credential, "POST", "/v1/account/cli-login/confirmation", { signal });
131
+ const parsed = activatedCliLoginResponseSchema.safeParse(value);
132
+ if (!parsed.success) throw new ControlPlaneError("CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID", "The CLI login confirmation response was invalid.");
133
+ return parsed.data.grant;
134
+ }
135
+ async submitRegistryRequest(credential, operation, submission, options = {}) {
136
+ const value = await this.requestJson(credential, "POST", `/v1/registry-requests/${encodeURIComponent(operation)}`, {
137
+ body: JSON.stringify(submission),
138
+ headers: {
139
+ "content-type": "application/json",
140
+ "x-uapkg-idempotency-key": options.idempotencyKey ?? randomUUID(),
141
+ ...options.otp ? { "x-uapkg-otp": options.otp } : {}
142
+ }
143
+ });
144
+ const parsed = z.object({
145
+ ok: z.literal(true),
146
+ requestId: z.string().min(1),
147
+ status: requestStatusSchema,
148
+ message: z.string()
149
+ }).safeParse(value);
150
+ if (!parsed.success) throw new ControlPlaneError("REGISTRY_REQUEST_RESPONSE_INVALID", "The publishing request response was invalid.");
151
+ return parsed.data;
152
+ }
153
+ async getRegistryRequest(credential, requestId) {
154
+ const value = await this.requestJson(credential, "GET", `/v1/registry-requests/${encodeURIComponent(requestId)}`);
155
+ const parsed = z.object({
156
+ ok: z.literal(true),
157
+ request: requestSummarySchema
158
+ }).safeParse(value);
159
+ if (!parsed.success) throw new ControlPlaneError("REGISTRY_REQUEST_RESPONSE_INVALID", "The publishing request response was invalid.");
160
+ return parsed.data.request;
161
+ }
162
+ /**
163
+ * Reads the additive request-detail projection. The older
164
+ * `getRegistryRequest` method deliberately remains summary-only so callers
165
+ * compiled against the original response contract keep their behavior.
166
+ */
167
+ async getRegistryRequestDetail(credential, requestId) {
168
+ const value = await this.requestJson(credential, "GET", `/v1/registry-requests/${encodeURIComponent(requestId)}`);
169
+ const parsed = requestDetailResponseSchema.safeParse(value);
170
+ if (!parsed.success) throw new ControlPlaneError("REGISTRY_REQUEST_RESPONSE_INVALID", "The publishing request response was invalid.");
171
+ return {
172
+ request: parsed.data.request,
173
+ ...parsed.data.checks ? { checks: parsed.data.checks } : {},
174
+ ...parsed.data.terminalFailure ? { terminalFailure: parsed.data.terminalFailure } : {}
175
+ };
176
+ }
177
+ async listRegistryRequests(credential, registryId, status) {
178
+ const query = new URLSearchParams({ registryId });
179
+ if (status) query.set("status", status);
180
+ const value = await this.requestJson(credential, "GET", `/v1/registry-requests?${query.toString()}`);
181
+ const parsed = z.object({
182
+ ok: z.literal(true),
183
+ recentRequests: z.array(requestSummarySchema).optional(),
184
+ requests: z.array(requestSummarySchema).optional()
185
+ }).safeParse(value);
186
+ if (!parsed.success || !parsed.data.recentRequests && !parsed.data.requests) throw new ControlPlaneError("REGISTRY_REQUEST_LIST_RESPONSE_INVALID", "The publishing request list response was invalid.");
187
+ return parsed.data.recentRequests ?? parsed.data.requests ?? [];
188
+ }
189
+ async requestJson(credential, method, path, init = {}) {
190
+ const url = new URL(path, this.apiBaseUrl);
191
+ const headers = new Headers(init.headers);
192
+ let response;
193
+ if (credential.kind === "dpop") try {
194
+ response = await this.withDPoPNonceRetry(() => oauth.protectedResourceRequest(credential.accessToken, method, url, headers, init.body, {
195
+ DPoP: credential.dpop,
196
+ signal: boundedRequestSignal(init.signal)
197
+ }));
198
+ } catch (error) {
199
+ if (error instanceof oauth.WWWAuthenticateChallengeError) throw await controlPlaneChallengeError(error, credential);
200
+ throw error;
201
+ }
202
+ else {
203
+ headers.set("authorization", `Bearer ${credential.accessToken}`);
204
+ response = await fetch(url, {
205
+ method,
206
+ headers,
207
+ body: init.body,
208
+ redirect: "error",
209
+ signal: boundedRequestSignal(init.signal)
210
+ });
211
+ }
212
+ const value = await readJson(response);
213
+ if (!response.ok) {
214
+ const parsed = errorSchema.safeParse(value);
215
+ if (parsed.success) throw new ControlPlaneError(parsed.data.error.code, parsed.data.error.message, response.status, parsed.data.error.details);
216
+ throw new ControlPlaneError(`HTTP_${response.status}`, `The UAPKG control plane returned HTTP ${response.status}.`, response.status);
217
+ }
218
+ return value;
219
+ }
220
+ async withDPoPNonceRetry(operation) {
221
+ try {
222
+ return await operation();
223
+ } catch (error) {
224
+ if (!oauth.isDPoPNonceError(error)) throw error;
225
+ return operation();
226
+ }
227
+ }
228
+ };
229
+ function hasUnsafeDisplayCharacter(value) {
230
+ for (const character of value) {
231
+ const codePoint = character.codePointAt(0);
232
+ if (codePoint !== void 0 && (codePoint <= 31 || codePoint >= 127 && codePoint <= 159 || codePoint === 1564 || codePoint === 8206 || codePoint === 8207 || codePoint >= 8232 && codePoint <= 8238 || codePoint >= 8294 && codePoint <= 8297)) return true;
233
+ }
234
+ return false;
215
235
  }
216
236
  function boundedRequestSignal(signal) {
217
- const timeout = AbortSignal.timeout(30_000);
218
- return signal ? AbortSignal.any([signal, timeout]) : timeout;
237
+ const timeout = AbortSignal.timeout(3e4);
238
+ return signal ? AbortSignal.any([signal, timeout]) : timeout;
219
239
  }
220
240
  async function readJson(response) {
221
- const text = await response.text();
222
- if (text.trim().length === 0)
223
- return {};
224
- try {
225
- return JSON.parse(text);
226
- }
227
- catch (error) {
228
- throw new ControlPlaneError('CONTROL_PLANE_RESPONSE_NOT_JSON', `The UAPKG control plane returned a non-JSON response (HTTP ${response.status}).`, response.status, undefined, { cause: error });
229
- }
241
+ const text = await response.text();
242
+ if (text.trim().length === 0) return {};
243
+ try {
244
+ return JSON.parse(text);
245
+ } catch (error) {
246
+ throw new ControlPlaneError("CONTROL_PLANE_RESPONSE_NOT_JSON", `The UAPKG control plane returned a non-JSON response (HTTP ${response.status}).`, response.status, void 0, { cause: error });
247
+ }
230
248
  }
231
249
  async function controlPlaneChallengeError(error, credential) {
232
- const value = await tryReadJson(error.response);
233
- const parsed = errorSchema.safeParse(value);
234
- if (error.status === 403 && parsed.success && parsed.data.error.code === 'OAUTH_SCOPE_INSUFFICIENT') {
235
- const details = insufficientScopeDetailsSchema.safeParse(parsed.data.error.details);
236
- if (details.success) {
237
- const headerRequiredScopeTokens = error.cause.flatMap((challenge) => challenge.scheme === 'dpop' && challenge.parameters.error === 'insufficient_scope'
238
- ? parseOAuthScopeTokens(challenge.parameters.scope)
239
- : []);
240
- const bodyRequiredScopeTokens = validatedOAuthScopeTokens(details.data.requiredScopes);
241
- const bodyMissingScopeTokens = validatedOAuthScopeTokens(details.data.missingScopes);
242
- if (bodyRequiredScopeTokens && bodyMissingScopeTokens) {
243
- const consistentRequiredScopeTokens = headerRequiredScopeTokens.filter((scope) => bodyRequiredScopeTokens.includes(scope));
244
- const consistentMissingScopeTokens = consistentRequiredScopeTokens.filter((scope) => bodyMissingScopeTokens.includes(scope));
245
- const requestedScopes = knownUAPKGCliScopes(credential.requestedScopes);
246
- if (consistentMissingScopeTokens.some((scope) => !isUAPKGCliScope(scope))) {
247
- return new OAuthScopeUnsupportedError(credential.registryAlias, requestedScopes, [], {
248
- cause: error,
249
- reason: 'cli-update-required',
250
- status: error.status,
251
- });
252
- }
253
- const requiredScopes = knownUAPKGCliScopes(consistentRequiredScopeTokens);
254
- const missingScopes = knownUAPKGCliScopes(consistentMissingScopeTokens).filter((scope) => requestedScopes.includes(scope));
255
- if (requiredScopes.length > 0 && missingScopes.length > 0) {
256
- return new OAuthScopeInsufficientError(parsed.data.error.message, credential.registryAlias, requestedScopes, requiredScopes, missingScopes, error.status, { cause: error });
257
- }
258
- }
259
- }
260
- }
261
- if (parsed.success) {
262
- return new ControlPlaneError(parsed.data.error.code, parsed.data.error.message, error.status, parsed.data.error.details, { cause: error });
263
- }
264
- return new ControlPlaneError('CONTROL_PLANE_AUTHENTICATION_REQUIRED', 'The UAPKG control plane rejected the saved login.', error.status, undefined, { cause: error });
250
+ const value = await tryReadJson(error.response);
251
+ const parsed = errorSchema.safeParse(value);
252
+ if (error.status === 403 && parsed.success && parsed.data.error.code === "OAUTH_SCOPE_INSUFFICIENT") {
253
+ const details = insufficientScopeDetailsSchema.safeParse(parsed.data.error.details);
254
+ if (details.success) {
255
+ const headerRequiredScopeTokens = error.cause.flatMap((challenge) => challenge.scheme === "dpop" && challenge.parameters.error === "insufficient_scope" ? parseOAuthScopeTokens(challenge.parameters.scope) : []);
256
+ const bodyRequiredScopeTokens = validatedOAuthScopeTokens(details.data.requiredScopes);
257
+ const bodyMissingScopeTokens = validatedOAuthScopeTokens(details.data.missingScopes);
258
+ if (bodyRequiredScopeTokens && bodyMissingScopeTokens) {
259
+ const consistentRequiredScopeTokens = headerRequiredScopeTokens.filter((scope) => bodyRequiredScopeTokens.includes(scope));
260
+ const consistentMissingScopeTokens = consistentRequiredScopeTokens.filter((scope) => bodyMissingScopeTokens.includes(scope));
261
+ const requestedScopes = knownUAPKGCliScopes(credential.requestedScopes);
262
+ if (consistentMissingScopeTokens.some((scope) => !isUAPKGCliScope(scope))) return new OAuthScopeUnsupportedError(credential.registryAlias, requestedScopes, [], {
263
+ cause: error,
264
+ reason: "cli-update-required",
265
+ status: error.status
266
+ });
267
+ const requiredScopes = knownUAPKGCliScopes(consistentRequiredScopeTokens);
268
+ const missingScopes = knownUAPKGCliScopes(consistentMissingScopeTokens).filter((scope) => requestedScopes.includes(scope));
269
+ if (requiredScopes.length > 0 && missingScopes.length > 0) return new OAuthScopeInsufficientError(parsed.data.error.message, credential.registryAlias, requestedScopes, requiredScopes, missingScopes, error.status, { cause: error });
270
+ }
271
+ }
272
+ }
273
+ if (parsed.success) return new ControlPlaneError(parsed.data.error.code, parsed.data.error.message, error.status, parsed.data.error.details, { cause: error });
274
+ return new ControlPlaneError("CONTROL_PLANE_AUTHENTICATION_REQUIRED", "The UAPKG control plane rejected the saved login.", error.status, void 0, { cause: error });
265
275
  }
266
276
  function validatedOAuthScopeTokens(values) {
267
- if (values.some((scope) => !isOAuthScopeToken(scope)))
268
- return undefined;
269
- return [...new Set(values)];
277
+ if (values.some((scope) => !isOAuthScopeToken(scope))) return void 0;
278
+ return [...new Set(values)];
270
279
  }
271
280
  async function tryReadJson(response) {
272
- try {
273
- const text = await response.text();
274
- return text.trim().length > 0 ? JSON.parse(text) : undefined;
275
- }
276
- catch {
277
- return undefined;
278
- }
281
+ try {
282
+ const text = await response.text();
283
+ return text.trim().length > 0 ? JSON.parse(text) : void 0;
284
+ } catch {
285
+ return;
286
+ }
279
287
  }
288
+
289
+ //#endregion
290
+ export { ControlPlaneClient };
280
291
  //# sourceMappingURL=ControlPlaneClient.js.map