@uapkg/cli 1.2.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.
- package/dist/app/CompositionRoot.d.ts +36 -33
- package/dist/app/CompositionRoot.d.ts.map +1 -1
- package/dist/app/CompositionRoot.js +91 -109
- package/dist/app/CompositionRoot.js.map +1 -1
- package/dist/app/UAPKGApplication.d.ts +6 -3
- package/dist/app/UAPKGApplication.d.ts.map +1 -1
- package/dist/app/UAPKGApplication.js +155 -169
- package/dist/app/UAPKGApplication.js.map +1 -1
- package/dist/build/BuildMetadata.d.ts +9 -6
- package/dist/build/BuildMetadata.d.ts.map +1 -1
- package/dist/build/BuildMetadata.js +2 -2
- package/dist/cli/UAPKGCommandLine.d.ts +259 -257
- package/dist/cli/UAPKGCommandLine.d.ts.map +1 -1
- package/dist/cli/UAPKGCommandLine.js +248 -239
- package/dist/cli/UAPKGCommandLine.js.map +1 -1
- package/dist/cli/parseCommandLine.d.ts +5 -1
- package/dist/cli/parseCommandLine.d.ts.map +1 -1
- package/dist/cli/parseCommandLine.js +8 -3
- package/dist/cli/parseCommandLine.js.map +1 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts +9 -6
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +1 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.js +23 -31
- package/dist/cli/parsing/UAPKGCommandLineParser.js.map +1 -1
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts +12 -9
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +1 -1
- package/dist/cli/parsing/UAPKGParserRegistry.js +53 -50
- package/dist/cli/parsing/UAPKGParserRegistry.js.map +1 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts +9 -6
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js +1 -2
- package/dist/cli/parsing/modules/AddCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/AddCommandModule.js +49 -36
- package/dist/cli/parsing/modules/AddCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.js +87 -83
- package/dist/cli/parsing/modules/ConfigCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/InitCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/InitCommandModule.js +25 -22
- package/dist/cli/parsing/modules/InitCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/InstallCommandModule.js +36 -28
- package/dist/cli/parsing/modules/InstallCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.js +78 -50
- package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ListCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ListCommandModule.js +26 -15
- package/dist/cli/parsing/modules/ListCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LoginCommandModule.js +34 -33
- package/dist/cli/parsing/modules/LoginCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.js +30 -28
- package/dist/cli/parsing/modules/LogoutCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.js +21 -16
- package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/PackCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/PackCommandModule.js +30 -28
- package/dist/cli/parsing/modules/PackCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +14 -11
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/PublishCommandModule.js +63 -47
- package/dist/cli/parsing/modules/PublishCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.js +117 -120
- package/dist/cli/parsing/modules/RegistryCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.js +25 -14
- package/dist/cli/parsing/modules/RemoveCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.js +56 -60
- package/dist/cli/parsing/modules/RequestsCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.js +38 -25
- package/dist/cli/parsing/modules/UpdateCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.js +30 -28
- package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts +8 -5
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +1 -1
- package/dist/cli/parsing/modules/WhyCommandModule.js +25 -14
- package/dist/cli/parsing/modules/WhyCommandModule.js.map +1 -1
- package/dist/cli/parsing/modules/sharedOptions.d.ts +8 -5
- package/dist/cli/parsing/modules/sharedOptions.d.ts.map +1 -1
- package/dist/cli/parsing/modules/sharedOptions.js +18 -23
- package/dist/cli/parsing/modules/sharedOptions.js.map +1 -1
- package/dist/cli/runUAPKGCLI.d.ts +4 -1
- package/dist/cli/runUAPKGCLI.d.ts.map +1 -1
- package/dist/cli/runUAPKGCLI.js +10 -5
- package/dist/cli/runUAPKGCLI.js.map +1 -1
- package/dist/cli-bootstrap.d.ts +1 -2
- package/dist/cli-bootstrap.js +15 -12
- package/dist/cli-bootstrap.js.map +1 -1
- package/dist/commands/AddCommand.d.ts +19 -16
- package/dist/commands/AddCommand.d.ts.map +1 -1
- package/dist/commands/AddCommand.js +49 -53
- package/dist/commands/AddCommand.js.map +1 -1
- package/dist/commands/Command.d.ts +5 -2
- package/dist/commands/Command.d.ts.map +1 -1
- package/dist/commands/Command.js +1 -2
- package/dist/commands/ConfigCommand.d.ts +28 -25
- package/dist/commands/ConfigCommand.d.ts.map +1 -1
- package/dist/commands/ConfigCommand.js +165 -186
- package/dist/commands/ConfigCommand.js.map +1 -1
- package/dist/commands/InitCommand.d.ts +19 -16
- package/dist/commands/InitCommand.d.ts.map +1 -1
- package/dist/commands/InitCommand.js +65 -60
- package/dist/commands/InitCommand.js.map +1 -1
- package/dist/commands/InstallCommand.d.ts +16 -13
- package/dist/commands/InstallCommand.d.ts.map +1 -1
- package/dist/commands/InstallCommand.js +118 -110
- package/dist/commands/InstallCommand.js.map +1 -1
- package/dist/commands/ListCommand.d.ts +13 -10
- package/dist/commands/ListCommand.d.ts.map +1 -1
- package/dist/commands/ListCommand.js +76 -81
- package/dist/commands/ListCommand.js.map +1 -1
- package/dist/commands/LoginCommand.d.ts +17 -14
- package/dist/commands/LoginCommand.d.ts.map +1 -1
- package/dist/commands/LoginCommand.js +66 -72
- package/dist/commands/LoginCommand.js.map +1 -1
- package/dist/commands/LogoutCommand.d.ts +15 -12
- package/dist/commands/LogoutCommand.d.ts.map +1 -1
- package/dist/commands/LogoutCommand.js +36 -37
- package/dist/commands/LogoutCommand.js.map +1 -1
- package/dist/commands/OutdatedCommand.d.ts +12 -9
- package/dist/commands/OutdatedCommand.d.ts.map +1 -1
- package/dist/commands/OutdatedCommand.js +41 -40
- package/dist/commands/OutdatedCommand.js.map +1 -1
- package/dist/commands/PackCommand.d.ts +13 -10
- package/dist/commands/PackCommand.d.ts.map +1 -1
- package/dist/commands/PackCommand.js +26 -21
- package/dist/commands/PackCommand.js.map +1 -1
- package/dist/commands/PackageLifecycleCommand.d.ts +23 -19
- package/dist/commands/PackageLifecycleCommand.d.ts.map +1 -1
- package/dist/commands/PackageLifecycleCommand.js +144 -129
- package/dist/commands/PackageLifecycleCommand.js.map +1 -1
- package/dist/commands/PostinstallCandidateBuilder.d.ts +11 -8
- package/dist/commands/PostinstallCandidateBuilder.d.ts.map +1 -1
- package/dist/commands/PostinstallCandidateBuilder.js +42 -42
- package/dist/commands/PostinstallCandidateBuilder.js.map +1 -1
- package/dist/commands/ProjectGetNameCommand.d.ts +10 -7
- package/dist/commands/ProjectGetNameCommand.d.ts.map +1 -1
- package/dist/commands/ProjectGetNameCommand.js +25 -25
- package/dist/commands/ProjectGetNameCommand.js.map +1 -1
- package/dist/commands/PublishCommand.d.ts +29 -23
- package/dist/commands/PublishCommand.d.ts.map +1 -1
- package/dist/commands/PublishCommand.js +243 -244
- package/dist/commands/PublishCommand.js.map +1 -1
- package/dist/commands/RegistryCommand.d.ts +38 -35
- package/dist/commands/RegistryCommand.d.ts.map +1 -1
- package/dist/commands/RegistryCommand.js +195 -223
- package/dist/commands/RegistryCommand.js.map +1 -1
- package/dist/commands/RemoveCommand.d.ts +14 -11
- package/dist/commands/RemoveCommand.d.ts.map +1 -1
- package/dist/commands/RemoveCommand.js +47 -54
- package/dist/commands/RemoveCommand.js.map +1 -1
- package/dist/commands/RequestsCommand.d.ts +21 -18
- package/dist/commands/RequestsCommand.d.ts.map +1 -1
- package/dist/commands/RequestsCommand.js +82 -95
- package/dist/commands/RequestsCommand.js.map +1 -1
- package/dist/commands/UpdateCommand.d.ts +29 -26
- package/dist/commands/UpdateCommand.d.ts.map +1 -1
- package/dist/commands/UpdateCommand.js +111 -111
- package/dist/commands/UpdateCommand.js.map +1 -1
- package/dist/commands/WhoamiCommand.d.ts +30 -27
- package/dist/commands/WhoamiCommand.d.ts.map +1 -1
- package/dist/commands/WhoamiCommand.js +63 -72
- package/dist/commands/WhoamiCommand.js.map +1 -1
- package/dist/commands/WhyCommand.d.ts +13 -10
- package/dist/commands/WhyCommand.d.ts.map +1 -1
- package/dist/commands/WhyCommand.js +45 -44
- package/dist/commands/WhyCommand.js.map +1 -1
- package/dist/commands/add/DependencyAddResolver.d.ts +14 -11
- package/dist/commands/add/DependencyAddResolver.d.ts.map +1 -1
- package/dist/commands/add/DependencyAddResolver.js +36 -36
- package/dist/commands/add/DependencyAddResolver.js.map +1 -1
- package/dist/control-plane/AccountManager.d.ts +96 -94
- package/dist/control-plane/AccountManager.d.ts.map +1 -1
- package/dist/control-plane/AccountManager.js +775 -967
- package/dist/control-plane/AccountManager.js.map +1 -1
- package/dist/control-plane/ArtifactObserver.d.ts +19 -16
- package/dist/control-plane/ArtifactObserver.d.ts.map +1 -1
- package/dist/control-plane/ArtifactObserver.js +73 -59
- package/dist/control-plane/ArtifactObserver.js.map +1 -1
- package/dist/control-plane/AuthMetadataStore.d.ts +16 -13
- package/dist/control-plane/AuthMetadataStore.d.ts.map +1 -1
- package/dist/control-plane/AuthMetadataStore.js +111 -113
- package/dist/control-plane/AuthMetadataStore.js.map +1 -1
- package/dist/control-plane/AuthStoragePaths.d.ts +7 -4
- package/dist/control-plane/AuthStoragePaths.d.ts.map +1 -1
- package/dist/control-plane/AuthStoragePaths.js +19 -14
- package/dist/control-plane/AuthStoragePaths.js.map +1 -1
- package/dist/control-plane/AuthenticationSelector.d.ts +21 -18
- package/dist/control-plane/AuthenticationSelector.d.ts.map +1 -1
- package/dist/control-plane/AuthenticationSelector.js +69 -63
- package/dist/control-plane/AuthenticationSelector.js.map +1 -1
- package/dist/control-plane/ControlPlaneClient.d.ts +37 -28
- package/dist/control-plane/ControlPlaneClient.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneClient.js +265 -254
- package/dist/control-plane/ControlPlaneClient.js.map +1 -1
- package/dist/control-plane/ControlPlaneEndpoints.d.ts +9 -6
- package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneEndpoints.js +17 -12
- package/dist/control-plane/ControlPlaneEndpoints.js.map +1 -1
- package/dist/control-plane/ControlPlaneTypes.d.ts +176 -152
- package/dist/control-plane/ControlPlaneTypes.d.ts.map +1 -1
- package/dist/control-plane/ControlPlaneTypes.js +88 -81
- package/dist/control-plane/ControlPlaneTypes.js.map +1 -1
- package/dist/control-plane/CredentialStore.d.ts +20 -18
- package/dist/control-plane/CredentialStore.d.ts.map +1 -1
- package/dist/control-plane/CredentialStore.js +66 -83
- package/dist/control-plane/CredentialStore.js.map +1 -1
- package/dist/control-plane/DPoPKeyStore.d.ts +12 -9
- package/dist/control-plane/DPoPKeyStore.d.ts.map +1 -1
- package/dist/control-plane/DPoPKeyStore.js +57 -53
- package/dist/control-plane/DPoPKeyStore.js.map +1 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts +37 -4
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +1 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +197 -63
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +1 -1
- package/dist/control-plane/PublishIdempotencyStore.d.ts +25 -9
- package/dist/control-plane/PublishIdempotencyStore.d.ts.map +1 -1
- package/dist/control-plane/PublishIdempotencyStore.js +97 -68
- package/dist/control-plane/PublishIdempotencyStore.js.map +1 -1
- package/dist/control-plane/PublishRequestErrorMapper.d.ts +155 -0
- package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +1 -0
- package/dist/control-plane/PublishRequestErrorMapper.js +597 -0
- package/dist/control-plane/PublishRequestErrorMapper.js.map +1 -0
- package/dist/control-plane/RegistryGrantLock.d.ts +29 -26
- package/dist/control-plane/RegistryGrantLock.d.ts.map +1 -1
- package/dist/control-plane/RegistryGrantLock.js +149 -185
- package/dist/control-plane/RegistryGrantLock.js.map +1 -1
- package/dist/control-plane/RegistryTrustResolver.d.ts +13 -10
- package/dist/control-plane/RegistryTrustResolver.d.ts.map +1 -1
- package/dist/control-plane/RegistryTrustResolver.js +97 -132
- package/dist/control-plane/RegistryTrustResolver.js.map +1 -1
- package/dist/index.d.ts +62 -39
- package/dist/index.js +60 -53
- package/dist/postinstall/api/PostinstallDsl.d.ts +24 -21
- package/dist/postinstall/api/PostinstallDsl.d.ts.map +1 -1
- package/dist/postinstall/api/PostinstallDsl.js +32 -35
- package/dist/postinstall/api/PostinstallDsl.js.map +1 -1
- package/dist/postinstall/api/definePostinstall.d.ts +5 -2
- package/dist/postinstall/api/definePostinstall.d.ts.map +1 -1
- package/dist/postinstall/api/definePostinstall.js +20 -16
- package/dist/postinstall/api/definePostinstall.js.map +1 -1
- package/dist/postinstall/index.d.ts +25 -26
- package/dist/postinstall/index.js +25 -37
- package/dist/postinstall/loader/EntryResolver.d.ts +11 -9
- package/dist/postinstall/loader/EntryResolver.d.ts.map +1 -1
- package/dist/postinstall/loader/EntryResolver.js +36 -32
- package/dist/postinstall/loader/EntryResolver.js.map +1 -1
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts +6 -3
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +1 -1
- package/dist/postinstall/loader/EsbuildTranspiler.js +52 -56
- package/dist/postinstall/loader/EsbuildTranspiler.js.map +1 -1
- package/dist/postinstall/loader/ExportValidator.d.ts +8 -5
- package/dist/postinstall/loader/ExportValidator.d.ts.map +1 -1
- package/dist/postinstall/loader/ExportValidator.js +36 -32
- package/dist/postinstall/loader/ExportValidator.js.map +1 -1
- package/dist/postinstall/loader/ModuleImporter.d.ts +17 -14
- package/dist/postinstall/loader/ModuleImporter.d.ts.map +1 -1
- package/dist/postinstall/loader/ModuleImporter.js +50 -58
- package/dist/postinstall/loader/ModuleImporter.js.map +1 -1
- package/dist/postinstall/loader/PostinstallLoader.d.ts +22 -19
- package/dist/postinstall/loader/PostinstallLoader.d.ts.map +1 -1
- package/dist/postinstall/loader/PostinstallLoader.js +62 -58
- package/dist/postinstall/loader/PostinstallLoader.js.map +1 -1
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts +19 -16
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerBlockEditor.js +48 -44
- package/dist/postinstall/markers/MarkerBlockEditor.js.map +1 -1
- package/dist/postinstall/markers/MarkerBlockService.d.ts +10 -7
- package/dist/postinstall/markers/MarkerBlockService.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerBlockService.js +44 -44
- package/dist/postinstall/markers/MarkerBlockService.js.map +1 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts +12 -9
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +1 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.js +47 -52
- package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +1 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts +25 -23
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +1 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.js +63 -52
- package/dist/postinstall/policy/PostinstallPolicyGate.js.map +1 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts +48 -45
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +1 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.js +172 -170
- package/dist/postinstall/runner/PostinstallOrchestrator.js.map +1 -1
- package/dist/postinstall/unreal/BuildCsInjector.d.ts +16 -13
- package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/BuildCsInjector.js +58 -53
- package/dist/postinstall/unreal/BuildCsInjector.js.map +1 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts +13 -10
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.js +56 -59
- package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +1 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts +11 -8
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +123 -127
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +1 -1
- package/dist/postinstall/unreal/CSharpStructures.d.ts +18 -15
- package/dist/postinstall/unreal/CSharpStructures.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpStructures.js +1 -2
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts +7 -4
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +1 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.js +54 -58
- package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +1 -1
- package/dist/postinstall/unreal/PluginHash.d.ts +5 -2
- package/dist/postinstall/unreal/PluginHash.d.ts.map +1 -1
- package/dist/postinstall/unreal/PluginHash.js +13 -8
- package/dist/postinstall/unreal/PluginHash.js.map +1 -1
- package/dist/postinstall/unreal/PrettyParseError.d.ts +8 -5
- package/dist/postinstall/unreal/PrettyParseError.d.ts.map +1 -1
- package/dist/postinstall/unreal/PrettyParseError.js +37 -37
- package/dist/postinstall/unreal/PrettyParseError.js.map +1 -1
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts +12 -9
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +1 -1
- package/dist/postinstall/unreal/ProjectFileLocator.js +49 -51
- package/dist/postinstall/unreal/ProjectFileLocator.js.map +1 -1
- package/dist/postinstall/unreal/TargetCsInjector.d.ts +16 -13
- package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/TargetCsInjector.js +58 -53
- package/dist/postinstall/unreal/TargetCsInjector.js.map +1 -1
- package/dist/postinstall/unreal/UProjectInjector.d.ts +6 -3
- package/dist/postinstall/unreal/UProjectInjector.d.ts.map +1 -1
- package/dist/postinstall/unreal/UProjectInjector.js +56 -52
- package/dist/postinstall/unreal/UProjectInjector.js.map +1 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts +5 -2
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +1 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.js +22 -18
- package/dist/postinstall/unreal/UProjectMetadataReader.js.map +1 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts +17 -14
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +1 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.js +50 -50
- package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +1 -1
- package/dist/prompts/InkPromptService.d.ts +10 -7
- package/dist/prompts/InkPromptService.d.ts.map +1 -1
- package/dist/prompts/InkPromptService.js +100 -71
- package/dist/prompts/InkPromptService.js.map +1 -1
- package/dist/prompts/ProjectContextDetector.d.ts +10 -7
- package/dist/prompts/ProjectContextDetector.d.ts.map +1 -1
- package/dist/prompts/ProjectContextDetector.js +32 -26
- package/dist/prompts/ProjectContextDetector.js.map +1 -1
- package/dist/prompts/PromptService.d.ts +11 -8
- package/dist/prompts/PromptService.d.ts.map +1 -1
- package/dist/prompts/PromptService.js +1 -8
- package/dist/reporting/DiagnosticDeduplicator.d.ts +8 -5
- package/dist/reporting/DiagnosticDeduplicator.d.ts.map +1 -1
- package/dist/reporting/DiagnosticDeduplicator.js +36 -35
- package/dist/reporting/DiagnosticDeduplicator.js.map +1 -1
- package/dist/reporting/DiagnosticRenderer.d.ts +11 -8
- package/dist/reporting/DiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/DiagnosticRenderer.js +1 -2
- package/dist/reporting/DiagnosticReporter.d.ts +12 -9
- package/dist/reporting/DiagnosticReporter.d.ts.map +1 -1
- package/dist/reporting/DiagnosticReporter.js +40 -39
- package/dist/reporting/DiagnosticReporter.js.map +1 -1
- package/dist/reporting/InkDiagnosticRenderer.d.ts +12 -9
- package/dist/reporting/InkDiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/InkDiagnosticRenderer.js +50 -42
- package/dist/reporting/InkDiagnosticRenderer.js.map +1 -1
- package/dist/reporting/InstallProgressReporter.d.ts +23 -20
- package/dist/reporting/InstallProgressReporter.d.ts.map +1 -1
- package/dist/reporting/InstallProgressReporter.js +48 -47
- package/dist/reporting/InstallProgressReporter.js.map +1 -1
- package/dist/reporting/JsonReporter.d.ts +16 -13
- package/dist/reporting/JsonReporter.d.ts.map +1 -1
- package/dist/reporting/JsonReporter.js +34 -20
- package/dist/reporting/JsonReporter.js.map +1 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts +36 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +1 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.js +90 -0
- package/dist/reporting/RegistryRequestTerminalFormatter.js.map +1 -0
- package/dist/reporting/TextDiagnosticRenderer.d.ts +11 -8
- package/dist/reporting/TextDiagnosticRenderer.d.ts.map +1 -1
- package/dist/reporting/TextDiagnosticRenderer.js +36 -28
- package/dist/reporting/TextDiagnosticRenderer.js.map +1 -1
- package/dist/reporting/TextSink.d.ts +14 -11
- package/dist/reporting/TextSink.d.ts.map +1 -1
- package/dist/reporting/TextSink.js +24 -20
- package/dist/reporting/TextSink.js.map +1 -1
- package/package.json +31 -32
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js.map +0 -1
- package/dist/cli-bootstrap.d.ts.map +0 -1
- package/dist/commands/Command.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/postinstall/index.d.ts.map +0 -1
- package/dist/postinstall/index.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.js.map +0 -1
- package/dist/prompts/PromptService.js.map +0 -1
- package/dist/reporting/DiagnosticRenderer.js.map +0 -1
|
@@ -1,280 +1,291 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as oauth from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
+
requiredScopes: z.array(z.string()),
|
|
17
|
+
missingScopes: z.array(z.string())
|
|
16
18
|
});
|
|
17
19
|
const accountSchema = z.object({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
"queued",
|
|
52
|
+
"checking",
|
|
53
|
+
"accepted",
|
|
54
|
+
"ready",
|
|
55
|
+
"ready_superseded",
|
|
56
|
+
"rejected",
|
|
57
|
+
"operationally_failed"
|
|
60
58
|
]);
|
|
61
|
-
const requestSummarySchema = z
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
218
|
-
|
|
237
|
+
const timeout = AbortSignal.timeout(3e4);
|
|
238
|
+
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
219
239
|
}
|
|
220
240
|
async function readJson(response) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
268
|
-
|
|
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
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|