@uapkg/cli 1.4.0 → 1.5.0
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/README.md +3 -0
- package/dist/build/BuildMetadata.js +2 -2
- package/dist/cli-bootstrap.js +19846 -13
- package/dist/cli.js +1 -1
- package/dist/index.js +19980 -60
- package/dist/licenses/semver-LICENSE +15 -0
- package/dist/profile.js +25 -0
- package/dist/runtime-lock.json +2142 -0
- package/dist/{app → types/uapkg/app}/CompositionRoot.d.ts +4 -5
- package/dist/{app → types/uapkg/app}/UAPKGApplication.d.ts +0 -1
- package/dist/{build → types/uapkg/build}/BuildMetadata.d.ts +1 -2
- package/dist/types/uapkg/cli/DebugEnvironment.d.ts +15 -0
- package/dist/types/uapkg/cli/DebugInfo.d.ts +15 -0
- package/dist/{cli → types/uapkg/cli}/UAPKGCommandLine.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parseCommandLine.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/UAPKGCommandLineParser.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/UAPKGParserRegistry.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/contracts/UAPKGCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/AddCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ConfigCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/InitCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/InstallCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LifecycleCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ListCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LoginCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/LogoutCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/OutdatedCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/PackCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/ProjectGetNameCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/PublishCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RegistryCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RemoveCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/RequestsCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/UpdateCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/WhoamiCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/WhyCommandModule.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/parsing/modules/sharedOptions.d.ts +0 -1
- package/dist/{cli → types/uapkg/cli}/runUAPKGCLI.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/AddCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/Command.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/ConfigCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/InitCommand.d.ts +1 -2
- package/dist/{commands → types/uapkg/commands}/InstallCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/ListCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/LoginCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/LogoutCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/OutdatedCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PackCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PackageLifecycleCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PostinstallCandidateBuilder.d.ts +2 -3
- package/dist/{commands → types/uapkg/commands}/ProjectGetNameCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/PublishCommand.d.ts +1 -2
- package/dist/{commands → types/uapkg/commands}/RegistryCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/RemoveCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/RequestsCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/UpdateCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/WhoamiCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/WhyCommand.d.ts +0 -1
- package/dist/{commands → types/uapkg/commands}/add/DependencyAddResolver.d.ts +3 -4
- package/dist/{control-plane → types/uapkg/control-plane}/AccountManager.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ArtifactObserver.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthMetadataStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthStoragePaths.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/AuthenticationSelector.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneClient.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneEndpoints.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/ControlPlaneTypes.d.ts +4 -2
- package/dist/{control-plane → types/uapkg/control-plane}/CredentialStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/DPoPKeyStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/GitHubActionsOidcCredentialProvider.d.ts +4 -3
- package/dist/{control-plane → types/uapkg/control-plane}/PublishIdempotencyStore.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/PublishRequestErrorMapper.d.ts +1 -2
- package/dist/{control-plane → types/uapkg/control-plane}/RegistryGrantLock.d.ts +0 -1
- package/dist/{control-plane → types/uapkg/control-plane}/RegistryTrustResolver.d.ts +0 -1
- package/dist/types/uapkg/control-plane/RequestWatch.d.ts +15 -0
- package/dist/types/uapkg/control-plane/RetryAfter.d.ts +6 -0
- package/dist/{postinstall → types/uapkg/postinstall}/api/PostinstallDsl.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/api/definePostinstall.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/loader/EntryResolver.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/EsbuildTranspiler.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/ExportValidator.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/ModuleImporter.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/loader/PostinstallLoader.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerBlockEditor.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerBlockService.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/markers/MarkerIntegrityValidator.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/policy/PostinstallPolicyGate.d.ts +2 -3
- package/dist/{postinstall → types/uapkg/postinstall}/runner/PostinstallOrchestrator.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/BuildCsInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpInjectionEngine.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpStructureAnalyzer.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpStructures.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/CSharpWrapperFactory.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/PluginHash.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/PrettyParseError.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/ProjectFileLocator.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/TargetCsInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UProjectInjector.d.ts +1 -2
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UProjectMetadataReader.d.ts +0 -1
- package/dist/{postinstall → types/uapkg/postinstall}/unreal/UnrealSourceCatalog.d.ts +0 -1
- package/dist/{prompts → types/uapkg/prompts}/InkPromptService.d.ts +0 -1
- package/dist/{prompts → types/uapkg/prompts}/ProjectContextDetector.d.ts +1 -2
- package/dist/{prompts → types/uapkg/prompts}/PromptService.d.ts +0 -1
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticDeduplicator.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticRenderer.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/DiagnosticReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/InkDiagnosticRenderer.d.ts +2 -3
- package/dist/{reporting → types/uapkg/reporting}/InstallProgressReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/JsonReporter.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/RegistryRequestTerminalFormatter.d.ts +0 -1
- package/dist/{reporting → types/uapkg/reporting}/TextDiagnosticRenderer.d.ts +1 -2
- package/dist/{reporting → types/uapkg/reporting}/TextSink.d.ts +1 -2
- package/dist/types/uapkg-common/format/prettyBytes.d.ts +19 -0
- package/dist/types/uapkg-common/hash/registryIdentifier.d.ts +28 -0
- package/dist/types/uapkg-common/hash/sha256.d.ts +12 -0
- package/dist/types/uapkg-common/index.d.ts +10 -0
- package/dist/types/uapkg-common/json/safeJsonParse.d.ts +9 -0
- package/dist/types/uapkg-common/json/stableStringify.d.ts +9 -0
- package/dist/types/uapkg-common/normalize/normalizeUrl.d.ts +11 -0
- package/dist/types/uapkg-common/paths/forwardSlash.d.ts +12 -0
- package/dist/types/uapkg-common/runtime/UapkgRuntimeProfile.d.ts +19 -0
- package/dist/types/uapkg-common/spec/parsePackageSpec.d.ts +21 -0
- package/dist/types/uapkg-common-schema/brand/Brand.d.ts +15 -0
- package/dist/types/uapkg-common-schema/index.d.ts +17 -0
- package/dist/types/uapkg-common-schema/primitives/AssetHash.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/ConcurrencyCount.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/DurationSeconds.d.ts +11 -0
- package/dist/types/uapkg-common-schema/primitives/GitTree.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/InstallPath.d.ts +18 -0
- package/dist/types/uapkg-common-schema/primitives/OrgName.d.ts +12 -0
- package/dist/types/uapkg-common-schema/primitives/PackageName.d.ts +14 -0
- package/dist/types/uapkg-common-schema/primitives/PackageSpec.d.ts +21 -0
- package/dist/types/uapkg-common-schema/primitives/PackageVersion.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/PostInstallPolicy.d.ts +21 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryIdentifier.d.ts +15 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryName.d.ts +18 -0
- package/dist/types/uapkg-common-schema/primitives/RegistryURL.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/UnixTimestamp.d.ts +10 -0
- package/dist/types/uapkg-common-schema/primitives/VersionRange.d.ts +10 -0
- package/dist/types/uapkg-config/contracts/ConfigTypes.d.ts +58 -0
- package/dist/types/uapkg-config/core/ConfigInstance.d.ts +43 -0
- package/dist/types/uapkg-config/core/ConfigLayerBuilder.d.ts +13 -0
- package/dist/types/uapkg-config/core/ConfigResolver.d.ts +19 -0
- package/dist/types/uapkg-config/core/ConfigSemanticValidator.d.ts +13 -0
- package/dist/types/uapkg-config/core/ConfigWriter.d.ts +25 -0
- package/dist/types/uapkg-config/core/PostInstallPolicyResolver.d.ts +22 -0
- package/dist/types/uapkg-config/factory/createConfig.d.ts +6 -0
- package/dist/types/uapkg-config/files/ConfigFileRepository.d.ts +11 -0
- package/dist/types/uapkg-config/files/ConfigPathResolver.d.ts +14 -0
- package/dist/types/uapkg-config/index.d.ts +127 -0
- package/dist/types/uapkg-config/merge/ConfigMerger.d.ts +10 -0
- package/dist/types/uapkg-config/merge/ConfigSchemaMergeEngine.d.ts +26 -0
- package/dist/types/uapkg-config/schema/configSchema.d.ts +114 -0
- package/dist/types/uapkg-config/schema/pathSchema.d.ts +12 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigCliValueParser.d.ts +18 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaIntrospection.d.ts +13 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaRuntime.d.ts +26 -0
- package/dist/types/uapkg-config/schema/runtime/ConfigSchemaRuntimeProvider.d.ts +7 -0
- package/dist/types/uapkg-diagnostics/base/Diagnostic.d.ts +32 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticBag.d.ts +44 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticFingerprint.d.ts +12 -0
- package/dist/types/uapkg-diagnostics/base/DiagnosticLevel.d.ts +11 -0
- package/dist/types/uapkg-diagnostics/base/Result.d.ts +26 -0
- package/dist/types/uapkg-diagnostics/config/ConfigDiagnostics.d.ts +49 -0
- package/dist/types/uapkg-diagnostics/controlPlane/ControlPlaneDiagnostics.d.ts +25 -0
- package/dist/types/uapkg-diagnostics/general/GeneralDiagnostics.d.ts +23 -0
- package/dist/types/uapkg-diagnostics/index.d.ts +20 -0
- package/dist/types/uapkg-diagnostics/installer/InstallerDiagnostics.d.ts +55 -0
- package/dist/types/uapkg-diagnostics/manifest/ManifestDiagnostics.d.ts +70 -0
- package/dist/types/uapkg-diagnostics/pack/PackDiagnostics.d.ts +49 -0
- package/dist/types/uapkg-diagnostics/postinstall/PostinstallDiagnostics.d.ts +47 -0
- package/dist/types/uapkg-diagnostics/publishing/PublishingDiagnostics.d.ts +77 -0
- package/dist/types/uapkg-diagnostics/registry/RegistryDiagnostics.d.ts +71 -0
- package/dist/types/uapkg-diagnostics/registryTools/RegistryToolsDiagnostics.d.ts +130 -0
- package/dist/types/uapkg-diagnostics/resolver/ResolverDiagnostics.d.ts +38 -0
- package/dist/types/uapkg-diagnostics/safety/SafetyDiagnostics.d.ts +33 -0
- package/dist/types/uapkg-diagnostics/spec/SpecDiagnostics.d.ts +23 -0
- package/dist/types/uapkg-diagnostics/types.d.ts +37 -0
- package/dist/types/uapkg-diagnostics-format/contracts/FormatterTypes.d.ts +23 -0
- package/dist/types/uapkg-diagnostics-format/defaults/defaultFormatters.d.ts +8 -0
- package/dist/types/uapkg-diagnostics-format/formatters/PlainTextFormatter.d.ts +11 -0
- package/dist/types/uapkg-diagnostics-format/formatters/config/configFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/installer/installerFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/manifest/manifestFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/pack/packFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/postinstall/postinstallFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/publishing/publishingFormatters.d.ts +13 -0
- package/dist/types/uapkg-diagnostics-format/formatters/registry/registryFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/registryTools/registryToolsFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/resolver/resolverFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/safety/safetyFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/formatters/spec/specFormatters.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/index.d.ts +15 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/configInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/installerInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/manifestInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/packInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/postinstallInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/publishingInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/registryInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/resolverInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/safetyInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/components/specInkComponents.d.ts +5 -0
- package/dist/types/uapkg-diagnostics-format/ink/contracts/InkTypes.d.ts +35 -0
- package/dist/types/uapkg-diagnostics-format/ink/defaults/defaultInkComponents.d.ts +15 -0
- package/dist/types/uapkg-diagnostics-format/ink/index.d.ts +17 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/HintLine.d.ts +12 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/PlainTextBody.d.ts +11 -0
- package/dist/types/uapkg-diagnostics-format/ink/primitives/SeverityBadge.d.ts +13 -0
- package/dist/types/uapkg-diagnostics-format/ink/registry/DiagnosticInkRegistry.d.ts +24 -0
- package/dist/types/uapkg-diagnostics-format/ink/views/DiagnosticView.d.ts +21 -0
- package/dist/types/uapkg-diagnostics-format/ink/views/DiagnosticsListView.d.ts +16 -0
- package/dist/types/uapkg-diagnostics-format/registry/FormatterRegistry.d.ts +26 -0
- package/dist/types/uapkg-diagnostics-format/utils/indent.d.ts +7 -0
- package/dist/types/uapkg-installer/contracts/InstallerTypes.d.ts +91 -0
- package/dist/types/uapkg-installer/contracts/SafetyPolicyTypes.d.ts +43 -0
- package/dist/types/uapkg-installer/contracts/StatusStreamTypes.d.ts +42 -0
- package/dist/types/uapkg-installer/core/ClaimsVerifier.d.ts +22 -0
- package/dist/types/uapkg-installer/core/DiskStateInspector.d.ts +29 -0
- package/dist/types/uapkg-installer/core/InstallPlanner.d.ts +35 -0
- package/dist/types/uapkg-installer/core/Installer.d.ts +61 -0
- package/dist/types/uapkg-installer/core/IntegrityVerifier.d.ts +16 -0
- package/dist/types/uapkg-installer/core/PackageDownloader.d.ts +40 -0
- package/dist/types/uapkg-installer/core/PackageExtractor.d.ts +20 -0
- package/dist/types/uapkg-installer/core/PackageRemover.d.ts +14 -0
- package/dist/types/uapkg-installer/index.d.ts +16 -0
- package/dist/types/uapkg-installer/safety/NoMarkerPolicy.d.ts +17 -0
- package/dist/types/uapkg-installer/safety/SafetyPolicyRegistry.d.ts +32 -0
- package/dist/types/uapkg-installer/status/SlotTable.d.ts +36 -0
- package/dist/types/uapkg-installer/status/StatusStream.d.ts +25 -0
- package/dist/types/uapkg-log/contracts/LoggerTypes.d.ts +22 -0
- package/dist/types/uapkg-log/core/LogLevelPolicy.d.ts +15 -0
- package/dist/types/uapkg-log/core/LoggerFactory.d.ts +11 -0
- package/dist/types/uapkg-log/core/LoggerInstance.d.ts +17 -0
- package/dist/types/uapkg-log/core/WinstonLoggerAdapter.d.ts +8 -0
- package/dist/types/uapkg-log/index.d.ts +8 -0
- package/dist/types/uapkg-pack/contracts/PackTypes.d.ts +29 -0
- package/dist/types/uapkg-pack/core/FileCrawler.d.ts +12 -0
- package/dist/types/uapkg-pack/core/IgnoreEvaluator.d.ts +7 -0
- package/dist/types/uapkg-pack/core/IgnoreRuleLoader.d.ts +14 -0
- package/dist/types/uapkg-pack/core/IntegrityWriter.d.ts +6 -0
- package/dist/types/uapkg-pack/core/LFSPointerDetector.d.ts +6 -0
- package/dist/types/uapkg-pack/core/PackArtifactExcluder.d.ts +11 -0
- package/dist/types/uapkg-pack/core/PackManifestReader.d.ts +8 -0
- package/dist/types/uapkg-pack/core/PackService.d.ts +32 -0
- package/dist/types/uapkg-pack/core/PluginDescriptorGuard.d.ts +11 -0
- package/dist/types/uapkg-pack/core/PluginRootResolver.d.ts +14 -0
- package/dist/types/uapkg-pack/core/TarArchiveWriter.d.ts +11 -0
- package/dist/types/uapkg-pack/index.d.ts +7 -0
- package/dist/types/uapkg-package-claims/archive/PackagedManifestReader.d.ts +28 -0
- package/dist/types/uapkg-package-claims/claims/ClaimsComparison.d.ts +44 -0
- package/dist/types/uapkg-package-claims/claims/PackageClaims.d.ts +9 -0
- package/dist/types/uapkg-package-claims/index.d.ts +7 -0
- package/dist/types/uapkg-package-claims/json/CanonicalJson.d.ts +17 -0
- package/dist/types/uapkg-package-claims/schema/PackageClaimsSchema.d.ts +27 -0
- package/dist/types/uapkg-package-claims/schema/index.d.ts +2 -0
- package/dist/types/uapkg-package-manifest/contracts/ManifestTypes.d.ts +37 -0
- package/dist/types/uapkg-package-manifest/core/DependencyMutator.d.ts +48 -0
- package/dist/types/uapkg-package-manifest/core/DevDependencyPolicy.d.ts +30 -0
- package/dist/types/uapkg-package-manifest/core/InstallPathResolver.d.ts +35 -0
- package/dist/types/uapkg-package-manifest/core/LockfileDiffer.d.ts +40 -0
- package/dist/types/uapkg-package-manifest/core/LockfileSyncIssue.d.ts +11 -0
- package/dist/types/uapkg-package-manifest/core/LockfileSyncValidator.d.ts +26 -0
- package/dist/types/uapkg-package-manifest/core/OutdatedChecker.d.ts +36 -0
- package/dist/types/uapkg-package-manifest/core/PackageManifest.d.ts +63 -0
- package/dist/types/uapkg-package-manifest/core/WhyGraph.d.ts +31 -0
- package/dist/types/uapkg-package-manifest/index.d.ts +18 -0
- package/dist/types/uapkg-package-manifest/io/LockfileReader.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/LockfileSyncIssueWriter.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/LockfileWriter.d.ts +11 -0
- package/dist/types/uapkg-package-manifest/io/ManifestReader.d.ts +12 -0
- package/dist/types/uapkg-package-manifest/io/ManifestWriter.d.ts +13 -0
- package/dist/types/uapkg-package-manifest/resolver/LockfileSync.d.ts +13 -0
- package/dist/types/uapkg-package-manifest/resolver/Resolver.d.ts +16 -0
- package/dist/types/uapkg-package-manifest-schema/index.d.ts +10 -0
- package/dist/types/uapkg-package-manifest-schema/lockfile/LockDependencySchema.d.ts +15 -0
- package/dist/types/uapkg-package-manifest-schema/lockfile/LockfileSchema.d.ts +22 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/BaseManifestSchema.d.ts +56 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/DependencySchema.d.ts +57 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ManifestKind.d.ts +17 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ManifestSchema.d.ts +106 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/PluginManifestSchema.d.ts +52 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/ProjectManifestSchema.d.ts +80 -0
- package/dist/types/uapkg-package-manifest-schema/manifest/PublishSchema.d.ts +15 -0
- package/dist/types/uapkg-registry-core/contracts/RegistryCoreTypes.d.ts +54 -0
- package/dist/types/uapkg-registry-core/core/RegistryCore.d.ts +26 -0
- package/dist/types/uapkg-registry-core/index.d.ts +14 -0
- package/dist/types/uapkg-registry-core/paths/RegistryPaths.d.ts +15 -0
- package/dist/types/uapkg-registry-core/registry/GitRunner.d.ts +31 -0
- package/dist/types/uapkg-registry-core/registry/Registry.d.ts +46 -0
- package/dist/types/uapkg-registry-core/registry/RegistryCacheValidator.d.ts +21 -0
- package/dist/types/uapkg-registry-core/registry/RegistryLock.d.ts +27 -0
- package/dist/types/uapkg-registry-core/registry/RegistryMetadataReader.d.ts +18 -0
- package/dist/types/uapkg-registry-core/registry/RegistryPackageReader.d.ts +24 -0
- package/dist/types/uapkg-registry-core/registry/RegistrySyncPolicy.d.ts +14 -0
- package/dist/types/uapkg-registry-core/registry/RegistryUpdater.d.ts +23 -0
- package/dist/types/uapkg-registry-core/registry/RegistryUrlSanitizer.d.ts +10 -0
- package/dist/types/uapkg-registry-core/resolution/PackageResolver.d.ts +21 -0
- package/dist/types/uapkg-registry-core/resolution/SemverSelectionPolicy.d.ts +36 -0
- package/dist/types/uapkg-registry-schema/index.d.ts +9 -0
- package/dist/types/uapkg-registry-schema/paths/RegistryPackagePath.d.ts +15 -0
- package/dist/types/uapkg-registry-schema/schemas/IntegritySchema.d.ts +12 -0
- package/dist/types/uapkg-registry-schema/schemas/PackageRegistryManifestSchema.d.ts +108 -0
- package/dist/types/uapkg-registry-schema/schemas/PackageSourceSchema.d.ts +12 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryAssetSchema.d.ts +15 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryDependencySchema.d.ts +36 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryMetaSchema.d.ts +29 -0
- package/dist/types/uapkg-registry-schema/schemas/RegistryVersionSchema.d.ts +71 -0
- package/dist/types/uapkg-registry-tools/aggregator/RegistryToolsAggregator.d.ts +45 -0
- package/dist/types/uapkg-registry-tools/contracts/RegistryToolsTypes.d.ts +116 -0
- package/dist/types/uapkg-registry-tools/index.d.ts +18 -0
- package/dist/types/uapkg-registry-tools/io/IntegrityCalculator.d.ts +20 -0
- package/dist/types/uapkg-registry-tools/io/ManifestStore.d.ts +41 -0
- package/dist/types/uapkg-registry-tools/listing/PackageLister.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/mutation/AddPackageVersionPlanner.d.ts +25 -0
- package/dist/types/uapkg-registry-tools/mutation/RemovePackagePlanner.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/mutation/RemovePackageVersionPlanner.d.ts +21 -0
- package/dist/types/uapkg-registry-tools/mutation/VersionSorter.d.ts +10 -0
- package/dist/types/uapkg-registry-tools/paths/RegistryRepoPaths.d.ts +23 -0
- package/dist/types/uapkg-registry-tools/tools/RegistryTools.d.ts +64 -0
- package/dist/types/uapkg-registry-tools/validation/DependencyReachabilityValidator.d.ts +24 -0
- package/dist/types/uapkg-registry-tools/validation/ExternalRegistryPolicyValidator.d.ts +22 -0
- package/dist/types/uapkg-registry-tools/validation/ManifestValidator.d.ts +16 -0
- package/dist/types/uapkg-registry-tools/validation/OfficialRegistryPolicyValidator.d.ts +34 -0
- package/dist/types/uapkg-registry-tools/validation/RegistryValidator.d.ts +31 -0
- package/dist/types/uapkg-registry-tools/validation/ReleaseFileNameValidator.d.ts +21 -0
- package/package.json +21 -48
- package/dist/app/CompositionRoot.d.ts.map +0 -1
- package/dist/app/CompositionRoot.js +0 -93
- package/dist/app/CompositionRoot.js.map +0 -1
- package/dist/app/UAPKGApplication.d.ts.map +0 -1
- package/dist/app/UAPKGApplication.js +0 -157
- package/dist/app/UAPKGApplication.js.map +0 -1
- package/dist/build/BuildMetadata.d.ts.map +0 -1
- package/dist/cli/UAPKGCommandLine.d.ts.map +0 -1
- package/dist/cli/UAPKGCommandLine.js +0 -250
- package/dist/cli/UAPKGCommandLine.js.map +0 -1
- package/dist/cli/parseCommandLine.d.ts.map +0 -1
- package/dist/cli/parseCommandLine.js +0 -11
- package/dist/cli/parseCommandLine.js.map +0 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +0 -1
- package/dist/cli/parsing/UAPKGCommandLineParser.js +0 -24
- package/dist/cli/parsing/UAPKGCommandLineParser.js.map +0 -1
- package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +0 -1
- package/dist/cli/parsing/UAPKGParserRegistry.js +0 -54
- package/dist/cli/parsing/UAPKGParserRegistry.js.map +0 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/contracts/UAPKGCommandModule.js +0 -1
- package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/AddCommandModule.js +0 -50
- package/dist/cli/parsing/modules/AddCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ConfigCommandModule.js +0 -88
- package/dist/cli/parsing/modules/ConfigCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/InitCommandModule.js +0 -26
- package/dist/cli/parsing/modules/InitCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/InstallCommandModule.js +0 -37
- package/dist/cli/parsing/modules/InstallCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LifecycleCommandModule.js +0 -84
- package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ListCommandModule.js +0 -27
- package/dist/cli/parsing/modules/ListCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LoginCommandModule.js +0 -35
- package/dist/cli/parsing/modules/LoginCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/LogoutCommandModule.js +0 -31
- package/dist/cli/parsing/modules/LogoutCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/OutdatedCommandModule.js +0 -22
- package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/PackCommandModule.js +0 -31
- package/dist/cli/parsing/modules/PackCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +0 -15
- package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/PublishCommandModule.js +0 -66
- package/dist/cli/parsing/modules/PublishCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RegistryCommandModule.js +0 -118
- package/dist/cli/parsing/modules/RegistryCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RemoveCommandModule.js +0 -26
- package/dist/cli/parsing/modules/RemoveCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/RequestsCommandModule.js +0 -59
- package/dist/cli/parsing/modules/RequestsCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/UpdateCommandModule.js +0 -39
- package/dist/cli/parsing/modules/UpdateCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/WhoamiCommandModule.js +0 -31
- package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +0 -1
- package/dist/cli/parsing/modules/WhyCommandModule.js +0 -26
- package/dist/cli/parsing/modules/WhyCommandModule.js.map +0 -1
- package/dist/cli/parsing/modules/sharedOptions.d.ts.map +0 -1
- package/dist/cli/parsing/modules/sharedOptions.js +0 -21
- package/dist/cli/parsing/modules/sharedOptions.js.map +0 -1
- package/dist/cli/runUAPKGCLI.d.ts.map +0 -1
- package/dist/cli/runUAPKGCLI.js +0 -12
- package/dist/cli/runUAPKGCLI.js.map +0 -1
- package/dist/cli-bootstrap.js.map +0 -1
- package/dist/commands/AddCommand.d.ts.map +0 -1
- package/dist/commands/AddCommand.js +0 -51
- package/dist/commands/AddCommand.js.map +0 -1
- package/dist/commands/Command.d.ts.map +0 -1
- package/dist/commands/Command.js +0 -1
- package/dist/commands/ConfigCommand.d.ts.map +0 -1
- package/dist/commands/ConfigCommand.js +0 -166
- package/dist/commands/ConfigCommand.js.map +0 -1
- package/dist/commands/InitCommand.d.ts.map +0 -1
- package/dist/commands/InitCommand.js +0 -66
- package/dist/commands/InitCommand.js.map +0 -1
- package/dist/commands/InstallCommand.d.ts.map +0 -1
- package/dist/commands/InstallCommand.js +0 -120
- package/dist/commands/InstallCommand.js.map +0 -1
- package/dist/commands/ListCommand.d.ts.map +0 -1
- package/dist/commands/ListCommand.js +0 -78
- package/dist/commands/ListCommand.js.map +0 -1
- package/dist/commands/LoginCommand.d.ts.map +0 -1
- package/dist/commands/LoginCommand.js +0 -67
- package/dist/commands/LoginCommand.js.map +0 -1
- package/dist/commands/LogoutCommand.d.ts.map +0 -1
- package/dist/commands/LogoutCommand.js +0 -37
- package/dist/commands/LogoutCommand.js.map +0 -1
- package/dist/commands/OutdatedCommand.d.ts.map +0 -1
- package/dist/commands/OutdatedCommand.js +0 -43
- package/dist/commands/OutdatedCommand.js.map +0 -1
- package/dist/commands/PackCommand.d.ts.map +0 -1
- package/dist/commands/PackCommand.js +0 -27
- package/dist/commands/PackCommand.js.map +0 -1
- package/dist/commands/PackageLifecycleCommand.d.ts.map +0 -1
- package/dist/commands/PackageLifecycleCommand.js +0 -149
- package/dist/commands/PackageLifecycleCommand.js.map +0 -1
- package/dist/commands/PostinstallCandidateBuilder.d.ts.map +0 -1
- package/dist/commands/PostinstallCandidateBuilder.js +0 -44
- package/dist/commands/PostinstallCandidateBuilder.js.map +0 -1
- package/dist/commands/ProjectGetNameCommand.d.ts.map +0 -1
- package/dist/commands/ProjectGetNameCommand.js +0 -26
- package/dist/commands/ProjectGetNameCommand.js.map +0 -1
- package/dist/commands/PublishCommand.d.ts.map +0 -1
- package/dist/commands/PublishCommand.js +0 -259
- package/dist/commands/PublishCommand.js.map +0 -1
- package/dist/commands/RegistryCommand.d.ts.map +0 -1
- package/dist/commands/RegistryCommand.js +0 -197
- package/dist/commands/RegistryCommand.js.map +0 -1
- package/dist/commands/RemoveCommand.d.ts.map +0 -1
- package/dist/commands/RemoveCommand.js +0 -48
- package/dist/commands/RemoveCommand.js.map +0 -1
- package/dist/commands/RequestsCommand.d.ts.map +0 -1
- package/dist/commands/RequestsCommand.js +0 -85
- package/dist/commands/RequestsCommand.js.map +0 -1
- package/dist/commands/UpdateCommand.d.ts.map +0 -1
- package/dist/commands/UpdateCommand.js +0 -113
- package/dist/commands/UpdateCommand.js.map +0 -1
- package/dist/commands/WhoamiCommand.d.ts.map +0 -1
- package/dist/commands/WhoamiCommand.js +0 -66
- package/dist/commands/WhoamiCommand.js.map +0 -1
- package/dist/commands/WhyCommand.d.ts.map +0 -1
- package/dist/commands/WhyCommand.js +0 -47
- package/dist/commands/WhyCommand.js.map +0 -1
- package/dist/commands/add/DependencyAddResolver.d.ts.map +0 -1
- package/dist/commands/add/DependencyAddResolver.js +0 -38
- package/dist/commands/add/DependencyAddResolver.js.map +0 -1
- package/dist/control-plane/AccountManager.d.ts.map +0 -1
- package/dist/control-plane/AccountManager.js +0 -822
- package/dist/control-plane/AccountManager.js.map +0 -1
- package/dist/control-plane/ArtifactObserver.d.ts.map +0 -1
- package/dist/control-plane/ArtifactObserver.js +0 -77
- package/dist/control-plane/ArtifactObserver.js.map +0 -1
- package/dist/control-plane/AuthMetadataStore.d.ts.map +0 -1
- package/dist/control-plane/AuthMetadataStore.js +0 -114
- package/dist/control-plane/AuthMetadataStore.js.map +0 -1
- package/dist/control-plane/AuthStoragePaths.d.ts.map +0 -1
- package/dist/control-plane/AuthStoragePaths.js +0 -22
- package/dist/control-plane/AuthStoragePaths.js.map +0 -1
- package/dist/control-plane/AuthenticationSelector.d.ts.map +0 -1
- package/dist/control-plane/AuthenticationSelector.js +0 -70
- package/dist/control-plane/AuthenticationSelector.js.map +0 -1
- package/dist/control-plane/ControlPlaneClient.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneClient.js +0 -291
- package/dist/control-plane/ControlPlaneClient.js.map +0 -1
- package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneEndpoints.js +0 -24
- package/dist/control-plane/ControlPlaneEndpoints.js.map +0 -1
- package/dist/control-plane/ControlPlaneTypes.d.ts.map +0 -1
- package/dist/control-plane/ControlPlaneTypes.js +0 -100
- package/dist/control-plane/ControlPlaneTypes.js.map +0 -1
- package/dist/control-plane/CredentialStore.d.ts.map +0 -1
- package/dist/control-plane/CredentialStore.js +0 -70
- package/dist/control-plane/CredentialStore.js.map +0 -1
- package/dist/control-plane/DPoPKeyStore.d.ts.map +0 -1
- package/dist/control-plane/DPoPKeyStore.js +0 -58
- package/dist/control-plane/DPoPKeyStore.js.map +0 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +0 -1
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +0 -201
- package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +0 -1
- package/dist/control-plane/PublishIdempotencyStore.d.ts.map +0 -1
- package/dist/control-plane/PublishIdempotencyStore.js +0 -100
- package/dist/control-plane/PublishIdempotencyStore.js.map +0 -1
- package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +0 -1
- package/dist/control-plane/PublishRequestErrorMapper.js +0 -597
- package/dist/control-plane/PublishRequestErrorMapper.js.map +0 -1
- package/dist/control-plane/RegistryGrantLock.d.ts.map +0 -1
- package/dist/control-plane/RegistryGrantLock.js +0 -163
- package/dist/control-plane/RegistryGrantLock.js.map +0 -1
- package/dist/control-plane/RegistryTrustResolver.d.ts.map +0 -1
- package/dist/control-plane/RegistryTrustResolver.js +0 -105
- package/dist/control-plane/RegistryTrustResolver.js.map +0 -1
- package/dist/postinstall/api/PostinstallDsl.d.ts.map +0 -1
- package/dist/postinstall/api/PostinstallDsl.js +0 -36
- package/dist/postinstall/api/PostinstallDsl.js.map +0 -1
- package/dist/postinstall/api/definePostinstall.d.ts.map +0 -1
- package/dist/postinstall/api/definePostinstall.js +0 -23
- package/dist/postinstall/api/definePostinstall.js.map +0 -1
- package/dist/postinstall/index.js +0 -25
- package/dist/postinstall/loader/EntryResolver.d.ts.map +0 -1
- package/dist/postinstall/loader/EntryResolver.js +0 -39
- package/dist/postinstall/loader/EntryResolver.js.map +0 -1
- package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +0 -1
- package/dist/postinstall/loader/EsbuildTranspiler.js +0 -54
- package/dist/postinstall/loader/EsbuildTranspiler.js.map +0 -1
- package/dist/postinstall/loader/ExportValidator.d.ts.map +0 -1
- package/dist/postinstall/loader/ExportValidator.js +0 -38
- package/dist/postinstall/loader/ExportValidator.js.map +0 -1
- package/dist/postinstall/loader/ModuleImporter.d.ts.map +0 -1
- package/dist/postinstall/loader/ModuleImporter.js +0 -52
- package/dist/postinstall/loader/ModuleImporter.js.map +0 -1
- package/dist/postinstall/loader/PostinstallLoader.d.ts.map +0 -1
- package/dist/postinstall/loader/PostinstallLoader.js +0 -64
- package/dist/postinstall/loader/PostinstallLoader.js.map +0 -1
- package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerBlockEditor.js +0 -50
- package/dist/postinstall/markers/MarkerBlockEditor.js.map +0 -1
- package/dist/postinstall/markers/MarkerBlockService.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerBlockService.js +0 -46
- package/dist/postinstall/markers/MarkerBlockService.js.map +0 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +0 -1
- package/dist/postinstall/markers/MarkerIntegrityValidator.js +0 -48
- package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +0 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +0 -1
- package/dist/postinstall/policy/PostinstallPolicyGate.js +0 -68
- package/dist/postinstall/policy/PostinstallPolicyGate.js.map +0 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +0 -1
- package/dist/postinstall/runner/PostinstallOrchestrator.js +0 -174
- package/dist/postinstall/runner/PostinstallOrchestrator.js.map +0 -1
- package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/BuildCsInjector.js +0 -60
- package/dist/postinstall/unreal/BuildCsInjector.js.map +0 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpInjectionEngine.js +0 -58
- package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +0 -126
- package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpStructures.js +0 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +0 -1
- package/dist/postinstall/unreal/CSharpWrapperFactory.js +0 -56
- package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +0 -1
- package/dist/postinstall/unreal/PluginHash.d.ts.map +0 -1
- package/dist/postinstall/unreal/PluginHash.js +0 -18
- package/dist/postinstall/unreal/PluginHash.js.map +0 -1
- package/dist/postinstall/unreal/PrettyParseError.d.ts.map +0 -1
- package/dist/postinstall/unreal/PrettyParseError.js +0 -43
- package/dist/postinstall/unreal/PrettyParseError.js.map +0 -1
- package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +0 -1
- package/dist/postinstall/unreal/ProjectFileLocator.js +0 -51
- package/dist/postinstall/unreal/ProjectFileLocator.js.map +0 -1
- package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/TargetCsInjector.js +0 -60
- package/dist/postinstall/unreal/TargetCsInjector.js.map +0 -1
- package/dist/postinstall/unreal/UProjectInjector.d.ts.map +0 -1
- package/dist/postinstall/unreal/UProjectInjector.js +0 -58
- package/dist/postinstall/unreal/UProjectInjector.js.map +0 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +0 -1
- package/dist/postinstall/unreal/UProjectMetadataReader.js +0 -24
- package/dist/postinstall/unreal/UProjectMetadataReader.js.map +0 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +0 -1
- package/dist/postinstall/unreal/UnrealSourceCatalog.js +0 -52
- package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +0 -1
- package/dist/prompts/InkPromptService.d.ts.map +0 -1
- package/dist/prompts/InkPromptService.js +0 -105
- package/dist/prompts/InkPromptService.js.map +0 -1
- package/dist/prompts/ProjectContextDetector.d.ts.map +0 -1
- package/dist/prompts/ProjectContextDetector.js +0 -33
- package/dist/prompts/ProjectContextDetector.js.map +0 -1
- package/dist/prompts/PromptService.d.ts.map +0 -1
- package/dist/prompts/PromptService.js +0 -1
- package/dist/reporting/DiagnosticDeduplicator.d.ts.map +0 -1
- package/dist/reporting/DiagnosticDeduplicator.js +0 -38
- package/dist/reporting/DiagnosticDeduplicator.js.map +0 -1
- package/dist/reporting/DiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/DiagnosticRenderer.js +0 -1
- package/dist/reporting/DiagnosticReporter.d.ts.map +0 -1
- package/dist/reporting/DiagnosticReporter.js +0 -42
- package/dist/reporting/DiagnosticReporter.js.map +0 -1
- package/dist/reporting/InkDiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/InkDiagnosticRenderer.js +0 -52
- package/dist/reporting/InkDiagnosticRenderer.js.map +0 -1
- package/dist/reporting/InstallProgressReporter.d.ts.map +0 -1
- package/dist/reporting/InstallProgressReporter.js +0 -50
- package/dist/reporting/InstallProgressReporter.js.map +0 -1
- package/dist/reporting/JsonReporter.d.ts.map +0 -1
- package/dist/reporting/JsonReporter.js +0 -36
- package/dist/reporting/JsonReporter.js.map +0 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +0 -1
- package/dist/reporting/RegistryRequestTerminalFormatter.js +0 -90
- package/dist/reporting/RegistryRequestTerminalFormatter.js.map +0 -1
- package/dist/reporting/TextDiagnosticRenderer.d.ts.map +0 -1
- package/dist/reporting/TextDiagnosticRenderer.js +0 -38
- package/dist/reporting/TextDiagnosticRenderer.js.map +0 -1
- package/dist/reporting/TextSink.d.ts.map +0 -1
- package/dist/reporting/TextSink.js +0 -29
- package/dist/reporting/TextSink.js.map +0 -1
- /package/dist/{cli-bootstrap.d.ts → types/uapkg/cli-bootstrap.d.ts} +0 -0
- /package/dist/{index.d.ts → types/uapkg/index.d.ts} +0 -0
- /package/dist/{postinstall → types/uapkg/postinstall}/index.d.ts +0 -0
|
@@ -1,291 +0,0 @@
|
|
|
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
|
|
7
|
-
const errorSchema = z.object({
|
|
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
|
-
})
|
|
14
|
-
});
|
|
15
|
-
const insufficientScopeDetailsSchema = z.object({
|
|
16
|
-
requiredScopes: z.array(z.string()),
|
|
17
|
-
missingScopes: z.array(z.string())
|
|
18
|
-
});
|
|
19
|
-
const accountSchema = z.object({
|
|
20
|
-
id: z.uuid(),
|
|
21
|
-
username: z.string().min(1),
|
|
22
|
-
displayName: z.string().min(1)
|
|
23
|
-
});
|
|
24
|
-
const accountGrantSchema = z.object({
|
|
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())
|
|
30
|
-
});
|
|
31
|
-
const accountResponseSchema = z.object({
|
|
32
|
-
ok: z.literal(true),
|
|
33
|
-
account: accountSchema,
|
|
34
|
-
registry: z.object({ id: z.uuid() }),
|
|
35
|
-
grant: accountGrantSchema
|
|
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
|
-
}) });
|
|
42
|
-
const activatedCliLoginResponseSchema = z.object({
|
|
43
|
-
ok: z.literal(true),
|
|
44
|
-
grant: z.object({
|
|
45
|
-
id: z.uuid(),
|
|
46
|
-
status: z.literal("active"),
|
|
47
|
-
replacesGrantId: z.uuid().nullable()
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
const requestStatusSchema = z.enum([
|
|
51
|
-
"queued",
|
|
52
|
-
"checking",
|
|
53
|
-
"accepted",
|
|
54
|
-
"ready",
|
|
55
|
-
"ready_superseded",
|
|
56
|
-
"rejected",
|
|
57
|
-
"operationally_failed"
|
|
58
|
-
]);
|
|
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;
|
|
235
|
-
}
|
|
236
|
-
function boundedRequestSignal(signal) {
|
|
237
|
-
const timeout = AbortSignal.timeout(3e4);
|
|
238
|
-
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
239
|
-
}
|
|
240
|
-
async function readJson(response) {
|
|
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
|
-
}
|
|
248
|
-
}
|
|
249
|
-
async function controlPlaneChallengeError(error, credential) {
|
|
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 });
|
|
275
|
-
}
|
|
276
|
-
function validatedOAuthScopeTokens(values) {
|
|
277
|
-
if (values.some((scope) => !isOAuthScopeToken(scope))) return void 0;
|
|
278
|
-
return [...new Set(values)];
|
|
279
|
-
}
|
|
280
|
-
async function tryReadJson(response) {
|
|
281
|
-
try {
|
|
282
|
-
const text = await response.text();
|
|
283
|
-
return text.trim().length > 0 ? JSON.parse(text) : void 0;
|
|
284
|
-
} catch {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
//#endregion
|
|
290
|
-
export { ControlPlaneClient };
|
|
291
|
-
//# sourceMappingURL=ControlPlaneClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ControlPlaneClient.js","names":[],"sources":["../../src/control-plane/ControlPlaneClient.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport * as oauth from 'oauth4webapi';\nimport { z } from 'zod';\nimport {\n type AccountSelf,\n type ActivatedCliLoginGrant,\n type CliLoginConfirmation,\n ControlPlaneError,\n isOAuthScopeToken,\n isUAPKGCliScope,\n knownUAPKGCliScopes,\n OAuthScopeInsufficientError,\n OAuthScopeUnsupportedError,\n parseOAuthScopeTokens,\n type RegistryOperation,\n type RegistryRequestDetail,\n type RegistryRequestStatus,\n type RegistryRequestSubmission,\n type RegistryRequestSummary,\n UAPKG_CONTROL_PLANE_API,\n type UAPKGCliScope,\n} from '#cli/control-plane/ControlPlaneTypes.ts';\n\nexport type ControlPlaneCredential =\n | {\n readonly kind: 'dpop';\n readonly accessToken: string;\n readonly dpop: oauth.DPoPHandle;\n readonly registryAlias: string;\n readonly requestedScopes: readonly UAPKGCliScope[];\n }\n | {\n readonly kind: 'bearer';\n readonly accessToken: string;\n };\n\nconst errorSchema = z.object({\n ok: z.literal(false),\n error: z.object({\n code: z.string(),\n message: z.string(),\n details: z.record(z.string(), z.unknown()).optional(),\n }),\n});\n\nconst insufficientScopeDetailsSchema = z.object({\n requiredScopes: z.array(z.string()),\n missingScopes: z.array(z.string()),\n});\n\nconst accountSchema = z.object({\n id: z.uuid(),\n username: z.string().min(1),\n displayName: z.string().min(1),\n});\n\nconst accountGrantSchema = z.object({\n id: z.uuid(),\n deviceName: z.string().min(1),\n idleExpiresAt: z.iso.datetime(),\n absoluteExpiresAt: z.iso.datetime(),\n scopes: z.array(z.string()),\n});\n\nconst accountResponseSchema = z.object({\n ok: z.literal(true),\n account: accountSchema,\n registry: z.object({\n id: z.uuid(),\n }),\n grant: accountGrantSchema,\n});\n\nconst cliLoginConfirmationResponseSchema = accountResponseSchema.extend({\n grant: accountGrantSchema.extend({\n status: z.enum(['pending', 'active']),\n activationExpiresAt: z.iso.datetime(),\n replacesGrantId: z.uuid().nullable(),\n }),\n});\n\nconst activatedCliLoginResponseSchema = z.object({\n ok: z.literal(true),\n grant: z.object({\n id: z.uuid(),\n status: z.literal('active'),\n replacesGrantId: z.uuid().nullable(),\n }),\n});\n\nconst requestStatusSchema = z.enum([\n 'queued',\n 'checking',\n 'accepted',\n 'ready',\n 'ready_superseded',\n 'rejected',\n 'operationally_failed',\n]);\n\nconst requestSummarySchema = z\n .object({\n id: z.string().min(1),\n registryId: z.string().min(1),\n kind: z.string().min(1),\n status: requestStatusSchema,\n currentStep: z.string().optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n payload: z\n .object({\n packageName: z.string().optional(),\n packageVersion: z.string().optional(),\n })\n .loose()\n .optional(),\n })\n .loose();\n\nconst requestCheckIdSchema = z\n .string()\n .trim()\n .min(1)\n .max(128)\n .refine((value) => !hasUnsafeDisplayCharacter(value));\nconst requestCheckReasonCodeSchema = z\n .string()\n .trim()\n .min(1)\n .max(128)\n .refine((value) => !hasUnsafeDisplayCharacter(value));\nconst terminalFailureReasonCodeSchema = z.string().regex(/^[A-Z][A-Z0-9_]{0,127}$/u);\nconst requestCheckSchema = z.object({\n checkId: requestCheckIdSchema,\n executionState: z.enum(['pending', 'running', 'retrying', 'blocked_by_dependency', 'completed']),\n conclusion: z.enum(['success', 'failure', 'skipped']).optional(),\n reasonCode: requestCheckReasonCodeSchema.optional(),\n});\nconst terminalFailureSchema = z.object({\n reasonCode: terminalFailureReasonCodeSchema,\n attempts: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),\n maxAttempts: z.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional(),\n});\nconst requestDetailResponseSchema = z.object({\n ok: z.literal(true),\n request: requestSummarySchema,\n checks: z.array(requestCheckSchema).max(100).optional(),\n terminalFailure: terminalFailureSchema.optional(),\n});\n\nexport class ControlPlaneClient {\n private readonly apiBaseUrl: string;\n\n public constructor(apiBaseUrl = UAPKG_CONTROL_PLANE_API) {\n const normalized = new URL(apiBaseUrl).href.replace(/\\/+$/, '');\n if (normalized !== UAPKG_CONTROL_PLANE_API) {\n throw new Error(`UAPKG v1 control-plane requests are pinned to ${UAPKG_CONTROL_PLANE_API}.`);\n }\n this.apiBaseUrl = normalized;\n }\n\n public async getSelf(credential: ControlPlaneCredential, signal?: AbortSignal): Promise<AccountSelf> {\n const value = await this.requestJson(credential, 'GET', '/v1/account/self', { signal });\n const parsed = accountResponseSchema.safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError('ACCOUNT_SELF_RESPONSE_INVALID', 'The account identity response was invalid.');\n }\n return {\n account: parsed.data.account,\n registry: parsed.data.registry,\n grant: parsed.data.grant,\n };\n }\n\n public async getCliLoginConfirmation(\n credential: ControlPlaneCredential,\n signal?: AbortSignal,\n ): Promise<CliLoginConfirmation> {\n const value = await this.requestJson(credential, 'GET', '/v1/account/cli-login/confirmation', { signal });\n const parsed = cliLoginConfirmationResponseSchema.safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError(\n 'CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID',\n 'The CLI login confirmation response was invalid.',\n );\n }\n return {\n account: parsed.data.account,\n registry: parsed.data.registry,\n grant: parsed.data.grant,\n };\n }\n\n public async confirmCliLogin(\n credential: ControlPlaneCredential,\n signal?: AbortSignal,\n ): Promise<ActivatedCliLoginGrant> {\n const value = await this.requestJson(credential, 'POST', '/v1/account/cli-login/confirmation', { signal });\n const parsed = activatedCliLoginResponseSchema.safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError(\n 'CLI_LOGIN_CONFIRMATION_RESPONSE_INVALID',\n 'The CLI login confirmation response was invalid.',\n );\n }\n return parsed.data.grant;\n }\n\n public async submitRegistryRequest(\n credential: ControlPlaneCredential,\n operation: RegistryOperation,\n submission: RegistryRequestSubmission,\n options: { readonly idempotencyKey?: string; readonly otp?: string } = {},\n ): Promise<{ requestId: string; status: RegistryRequestStatus; message: string }> {\n const value = await this.requestJson(credential, 'POST', `/v1/registry-requests/${encodeURIComponent(operation)}`, {\n body: JSON.stringify(submission),\n headers: {\n 'content-type': 'application/json',\n 'x-uapkg-idempotency-key': options.idempotencyKey ?? randomUUID(),\n ...(options.otp ? { 'x-uapkg-otp': options.otp } : {}),\n },\n });\n const parsed = z\n .object({\n ok: z.literal(true),\n requestId: z.string().min(1),\n status: requestStatusSchema,\n message: z.string(),\n })\n .safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError('REGISTRY_REQUEST_RESPONSE_INVALID', 'The publishing request response was invalid.');\n }\n return parsed.data;\n }\n\n public async getRegistryRequest(\n credential: ControlPlaneCredential,\n requestId: string,\n ): Promise<RegistryRequestSummary> {\n const value = await this.requestJson(credential, 'GET', `/v1/registry-requests/${encodeURIComponent(requestId)}`);\n const parsed = z.object({ ok: z.literal(true), request: requestSummarySchema }).safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError('REGISTRY_REQUEST_RESPONSE_INVALID', 'The publishing request response was invalid.');\n }\n return parsed.data.request;\n }\n\n /**\n * Reads the additive request-detail projection. The older\n * `getRegistryRequest` method deliberately remains summary-only so callers\n * compiled against the original response contract keep their behavior.\n */\n public async getRegistryRequestDetail(\n credential: ControlPlaneCredential,\n requestId: string,\n ): Promise<RegistryRequestDetail> {\n const value = await this.requestJson(credential, 'GET', `/v1/registry-requests/${encodeURIComponent(requestId)}`);\n const parsed = requestDetailResponseSchema.safeParse(value);\n if (!parsed.success) {\n throw new ControlPlaneError('REGISTRY_REQUEST_RESPONSE_INVALID', 'The publishing request response was invalid.');\n }\n return {\n request: parsed.data.request,\n ...(parsed.data.checks ? { checks: parsed.data.checks } : {}),\n ...(parsed.data.terminalFailure ? { terminalFailure: parsed.data.terminalFailure } : {}),\n };\n }\n\n public async listRegistryRequests(\n credential: ControlPlaneCredential,\n registryId: string,\n status?: RegistryRequestStatus,\n ): Promise<RegistryRequestSummary[]> {\n const query = new URLSearchParams({ registryId });\n if (status) query.set('status', status);\n const value = await this.requestJson(credential, 'GET', `/v1/registry-requests?${query.toString()}`);\n const parsed = z\n .object({\n ok: z.literal(true),\n recentRequests: z.array(requestSummarySchema).optional(),\n requests: z.array(requestSummarySchema).optional(),\n })\n .safeParse(value);\n if (!parsed.success || (!parsed.data.recentRequests && !parsed.data.requests)) {\n throw new ControlPlaneError(\n 'REGISTRY_REQUEST_LIST_RESPONSE_INVALID',\n 'The publishing request list response was invalid.',\n );\n }\n return parsed.data.recentRequests ?? parsed.data.requests ?? [];\n }\n\n private async requestJson(\n credential: ControlPlaneCredential,\n method: string,\n path: string,\n init: {\n readonly headers?: Readonly<Record<string, string>>;\n readonly body?: string;\n readonly signal?: AbortSignal;\n } = {},\n ): Promise<unknown> {\n const url = new URL(path, this.apiBaseUrl);\n const headers = new Headers(init.headers);\n let response: Response;\n\n if (credential.kind === 'dpop') {\n try {\n response = await this.withDPoPNonceRetry(() =>\n oauth.protectedResourceRequest(credential.accessToken, method, url, headers, init.body, {\n DPoP: credential.dpop,\n signal: boundedRequestSignal(init.signal),\n }),\n );\n } catch (error) {\n if (error instanceof oauth.WWWAuthenticateChallengeError) {\n throw await controlPlaneChallengeError(error, credential);\n }\n throw error;\n }\n } else {\n headers.set('authorization', `Bearer ${credential.accessToken}`);\n response = await fetch(url, {\n method,\n headers,\n body: init.body,\n redirect: 'error',\n signal: boundedRequestSignal(init.signal),\n });\n }\n\n const value = await readJson(response);\n if (!response.ok) {\n const parsed = errorSchema.safeParse(value);\n if (parsed.success) {\n throw new ControlPlaneError(\n parsed.data.error.code,\n parsed.data.error.message,\n response.status,\n parsed.data.error.details,\n );\n }\n throw new ControlPlaneError(\n `HTTP_${response.status}`,\n `The UAPKG control plane returned HTTP ${response.status}.`,\n response.status,\n );\n }\n return value;\n }\n\n private async withDPoPNonceRetry<T>(operation: () => Promise<T>): Promise<T> {\n try {\n return await operation();\n } catch (error) {\n if (!oauth.isDPoPNonceError(error)) throw error;\n return operation();\n }\n }\n}\n\nfunction hasUnsafeDisplayCharacter(value: string): boolean {\n for (const character of value) {\n const codePoint = character.codePointAt(0);\n if (\n codePoint !== undefined &&\n (codePoint <= 0x1f ||\n (codePoint >= 0x7f && codePoint <= 0x9f) ||\n codePoint === 0x061c ||\n codePoint === 0x200e ||\n codePoint === 0x200f ||\n (codePoint >= 0x2028 && codePoint <= 0x202e) ||\n (codePoint >= 0x2066 && codePoint <= 0x2069))\n ) {\n return true;\n }\n }\n return false;\n}\n\nfunction boundedRequestSignal(signal?: AbortSignal): AbortSignal {\n const timeout = AbortSignal.timeout(30_000);\n return signal ? AbortSignal.any([signal, timeout]) : timeout;\n}\n\nasync function readJson(response: Response): Promise<unknown> {\n const text = await response.text();\n if (text.trim().length === 0) return {};\n try {\n return JSON.parse(text) as unknown;\n } catch (error) {\n throw new ControlPlaneError(\n 'CONTROL_PLANE_RESPONSE_NOT_JSON',\n `The UAPKG control plane returned a non-JSON response (HTTP ${response.status}).`,\n response.status,\n undefined,\n { cause: error },\n );\n }\n}\n\nasync function controlPlaneChallengeError(\n error: oauth.WWWAuthenticateChallengeError,\n credential: Extract<ControlPlaneCredential, { readonly kind: 'dpop' }>,\n): Promise<ControlPlaneError> {\n const value = await tryReadJson(error.response);\n const parsed = errorSchema.safeParse(value);\n\n if (error.status === 403 && parsed.success && parsed.data.error.code === 'OAUTH_SCOPE_INSUFFICIENT') {\n const details = insufficientScopeDetailsSchema.safeParse(parsed.data.error.details);\n if (details.success) {\n const headerRequiredScopeTokens = error.cause.flatMap((challenge) =>\n challenge.scheme === 'dpop' && challenge.parameters.error === 'insufficient_scope'\n ? parseOAuthScopeTokens(challenge.parameters.scope)\n : [],\n );\n const bodyRequiredScopeTokens = validatedOAuthScopeTokens(details.data.requiredScopes);\n const bodyMissingScopeTokens = validatedOAuthScopeTokens(details.data.missingScopes);\n if (bodyRequiredScopeTokens && bodyMissingScopeTokens) {\n const consistentRequiredScopeTokens = headerRequiredScopeTokens.filter((scope) =>\n bodyRequiredScopeTokens.includes(scope),\n );\n const consistentMissingScopeTokens = consistentRequiredScopeTokens.filter((scope) =>\n bodyMissingScopeTokens.includes(scope),\n );\n const requestedScopes = knownUAPKGCliScopes(credential.requestedScopes);\n if (consistentMissingScopeTokens.some((scope) => !isUAPKGCliScope(scope))) {\n return new OAuthScopeUnsupportedError(credential.registryAlias, requestedScopes, [], {\n cause: error,\n reason: 'cli-update-required',\n status: error.status,\n });\n }\n\n const requiredScopes = knownUAPKGCliScopes(consistentRequiredScopeTokens);\n const missingScopes = knownUAPKGCliScopes(consistentMissingScopeTokens).filter((scope) =>\n requestedScopes.includes(scope),\n );\n if (requiredScopes.length > 0 && missingScopes.length > 0) {\n return new OAuthScopeInsufficientError(\n parsed.data.error.message,\n credential.registryAlias,\n requestedScopes,\n requiredScopes,\n missingScopes,\n error.status,\n { cause: error },\n );\n }\n }\n }\n }\n\n if (parsed.success) {\n return new ControlPlaneError(\n parsed.data.error.code,\n parsed.data.error.message,\n error.status,\n parsed.data.error.details,\n { cause: error },\n );\n }\n return new ControlPlaneError(\n 'CONTROL_PLANE_AUTHENTICATION_REQUIRED',\n 'The UAPKG control plane rejected the saved login.',\n error.status,\n undefined,\n { cause: error },\n );\n}\n\nfunction validatedOAuthScopeTokens(values: readonly string[]): string[] | undefined {\n if (values.some((scope) => !isOAuthScopeToken(scope))) return undefined;\n return [...new Set(values)];\n}\n\nasync function tryReadJson(response: Response): Promise<unknown> {\n try {\n const text = await response.text();\n return text.trim().length > 0 ? (JSON.parse(text) as unknown) : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;AAoCA,M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6B;IACxE,MAAM,gBAAgB,oBAAoB,4BAA4B,CAAC,CAAC,QAAQ,UAC9E,gBAAgB,SAAS,KAAK,CAChC;IACA,IAAI,eAAe,SAAS,KAAK,cAAc,SAAS,GACtD,OAAO,IAAI,4BACT,OAAO,KAAK,MAAM,SAClB,WAAW,eACX,iBACA,gBACA,eACA,MAAM,QACN,EAAE,OAAO,MAAM,CACjB;GAEJ;EACF;CACF;CAEA,IAAI,OAAO,SACT,OAAO,IAAI,kBACT,OAAO,KAAK,MAAM,MAClB,OAAO,KAAK,MAAM,SAClB,MAAM,QACN,OAAO,KAAK,MAAM,SAClB,EAAE,OAAO,MAAM,CACjB;CAEF,OAAO,IAAI,kBACT,yCACA,qDACA,MAAM,QACN,QACA,EAAE,OAAO,MAAM,CACjB;AACF;AAEA,SAAS,0BAA0B,QAAiD;CAClF,IAAI,OAAO,MAAM,UAAU,CAAC,kBAAkB,KAAK,CAAC,GAAG,OAAO;CAC9D,OAAO,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC;AAC5B;AAEA,eAAe,YAAY,UAAsC;CAC/D,IAAI;EACF,MAAM,OAAO,MAAM,SAAS,KAAK;EACjC,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,IAAK,KAAK,MAAM,IAAI,IAAgB;CAClE,QAAQ;EACN;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ControlPlaneEndpoints.d.ts","names":[],"sources":["../../src/control-plane/ControlPlaneEndpoints.ts"],"mappings":";;UAGiB;WACN;WACA;;;;;;;iBAkBK,kCAAkC,MAAM,iBAAiB;cAI5D,+BAA6B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { UAPKG_BUILD_METADATA } from "../build/BuildMetadata.js";
|
|
2
|
-
|
|
3
|
-
//#region src/control-plane/ControlPlaneEndpoints.ts
|
|
4
|
-
const DEVELOPMENT_ENDPOINTS = Object.freeze({
|
|
5
|
-
issuer: "https://account-dev.uapkg.dev/oauth",
|
|
6
|
-
apiBaseUrl: "https://api-dev.uapkg.dev"
|
|
7
|
-
});
|
|
8
|
-
const PRODUCTION_ENDPOINTS = Object.freeze({
|
|
9
|
-
issuer: "https://account.uapkg.dev/oauth",
|
|
10
|
-
apiBaseUrl: "https://api.uapkg.dev"
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Only an explicitly stamped development build can select development trust
|
|
14
|
-
* roots. Source execution and any unrecognized runtime value fail closed to
|
|
15
|
-
* the production control plane.
|
|
16
|
-
*/
|
|
17
|
-
function controlPlaneEndpointsForBuildMode(mode) {
|
|
18
|
-
return mode === "development" ? DEVELOPMENT_ENDPOINTS : PRODUCTION_ENDPOINTS;
|
|
19
|
-
}
|
|
20
|
-
const UAPKG_CONTROL_PLANE_ENDPOINTS = controlPlaneEndpointsForBuildMode(UAPKG_BUILD_METADATA.mode);
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { UAPKG_CONTROL_PLANE_ENDPOINTS, controlPlaneEndpointsForBuildMode };
|
|
24
|
-
//# sourceMappingURL=ControlPlaneEndpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ControlPlaneEndpoints.js","names":[],"sources":["../../src/control-plane/ControlPlaneEndpoints.ts"],"sourcesContent":["import type { UAPKGBuildMode } from '@uapkg/common';\nimport { UAPKG_BUILD_METADATA } from '#cli/build/BuildMetadata.ts';\n\nexport interface UAPKGControlPlaneEndpoints {\n readonly issuer: string;\n readonly apiBaseUrl: string;\n}\n\nconst DEVELOPMENT_ENDPOINTS: UAPKGControlPlaneEndpoints = Object.freeze({\n issuer: 'https://account-dev.uapkg.dev/oauth',\n apiBaseUrl: 'https://api-dev.uapkg.dev',\n});\n\nconst PRODUCTION_ENDPOINTS: UAPKGControlPlaneEndpoints = Object.freeze({\n issuer: 'https://account.uapkg.dev/oauth',\n apiBaseUrl: 'https://api.uapkg.dev',\n});\n\n/**\n * Only an explicitly stamped development build can select development trust\n * roots. Source execution and any unrecognized runtime value fail closed to\n * the production control plane.\n */\nexport function controlPlaneEndpointsForBuildMode(mode: UAPKGBuildMode): UAPKGControlPlaneEndpoints {\n return mode === 'development' ? DEVELOPMENT_ENDPOINTS : PRODUCTION_ENDPOINTS;\n}\n\nexport const UAPKG_CONTROL_PLANE_ENDPOINTS = controlPlaneEndpointsForBuildMode(UAPKG_BUILD_METADATA.mode);\n"],"mappings":";;;AAQA,MAAM,wBAAoD,OAAO,OAAO;CACtE,QAAQ;CACR,YAAY;AACd,CAAC;AAED,MAAM,uBAAmD,OAAO,OAAO;CACrE,QAAQ;CACR,YAAY;AACd,CAAC;;;;;;AAOD,SAAgB,kCAAkC,MAAkD;CAClG,OAAO,SAAS,gBAAgB,wBAAwB;AAC1D;AAEA,MAAa,gCAAgC,kCAAkC,qBAAqB,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ControlPlaneTypes.d.ts","names":[],"sources":["../../src/control-plane/ControlPlaneTypes.ts"],"mappings":";cAEa;cACA;cACA;cACA;cAEA;KAOD,wBAAwB;iBAIpB,oBAAoB,iBAAiB;iBAMrC,yBAAyB,iBAAiB;iBAI1C,sBAAsB;iBAOtB,kBAAkB,iBAAiB;iBAInC,gBAAgB,iBAAiB,SAAS;KAI9C;UAEK;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;;UAGM;WACN,SAAS;WACT;aACE;;WAEF;aACE;aACA;aACA;aACA;aACA;;;UAII,6BAA6B;WACnC,OAAO;aACL;aACA;aACA;;;UAII;WACN;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;;UAGM;WACN;WACA,QAAQ,SAAS,eAAe;;UAG1B;WACN;WACA;WACA;WACA;;;UAIM;;WAEN;WACA;;;UAIM;WACN;WACA;WACA;WACA,cAAc,SAAS;aAA0B;aAA0B;;WAC3E,iBAAiB,SAAS;aAA0B;aAA0B;;WAC9E,kBAAkB,SAAS;aAA0B;aAA0B;;;;KAI9E;;;;;UAMK;WACN;WACA;WACA;aACE;aACA;aACA,SAAS;aACT,oBAAoB;aACpB,SAAS;aACT;;;KAID;UASK;WACN;WACA;WACA;WACA,QAAQ;WACR;WACA;WACA;WACA;aACE;aACA;;;KAID;KAOA;;UAGK;WACN;WACA,gBAAgB;WAChB,aAAa;WACb;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN,SAAS;WACT,kBAAkB;WAClB,kBAAkB;;UAGZ;WACN;WACA;aACE;aACA;aACA,UAAU,SAAS;;;cAInB,0BAA0B;WAEnB;WAEA;WACA,UAAU,SAAS;EAJrC,YACkB,cAChB,iBACgB,6BACA,UAAU,SAAS,sCACnC,UAAU;;cAOD,oCAAoC;WAO7B;WANF,0BAA0B;WAC1B,yBAAyB;WACzB,wBAAwB;EAExC,YACE,iBACgB,uBAChB,0BAA0B,iBAC1B,yBAAyB,iBACzB,wBAAwB,iBACxB,iBACA,UAAU;;cAqBD,mCAAmC;WAM5B;WALF,0BAA0B;WAC1B,4BAA4B;WAC5B;EAEhB,YACkB,uBAChB,0BAA0B,iBAC1B,4BAA4B,iBAC5B,UAAU;aACC;aACA;;;iBA6BC,iBAAiB"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { UAPKG_CONTROL_PLANE_ENDPOINTS } from "./ControlPlaneEndpoints.js";
|
|
2
|
-
|
|
3
|
-
//#region src/control-plane/ControlPlaneTypes.ts
|
|
4
|
-
const UAPKG_AUTHORIZATION_ISSUER = UAPKG_CONTROL_PLANE_ENDPOINTS.issuer;
|
|
5
|
-
const UAPKG_CONTROL_PLANE_API = UAPKG_CONTROL_PLANE_ENDPOINTS.apiBaseUrl;
|
|
6
|
-
const UAPKG_CLI_CLIENT_ID = "uapkg-cli";
|
|
7
|
-
const UAPKG_GITHUB_OIDC_AUDIENCE = "uapkg";
|
|
8
|
-
const UAPKG_CLI_SCOPES = [
|
|
9
|
-
"identity.self.read",
|
|
10
|
-
"publishing.request.create",
|
|
11
|
-
"publishing.request.read.self",
|
|
12
|
-
"registry_grant.revoke.self"
|
|
13
|
-
];
|
|
14
|
-
const UAPKG_CLI_SCOPE_SET = new Set(UAPKG_CLI_SCOPES);
|
|
15
|
-
const OAUTH_SCOPE_TOKEN_PATTERN = /^[\x21\x23-\x5b\x5d-\x7e]+$/;
|
|
16
|
-
function knownUAPKGCliScopes(value) {
|
|
17
|
-
if (!Array.isArray(value)) return [];
|
|
18
|
-
const candidates = new Set(value.filter((scope) => typeof scope === "string"));
|
|
19
|
-
return UAPKG_CLI_SCOPES.filter((scope) => candidates.has(scope));
|
|
20
|
-
}
|
|
21
|
-
function parseUAPKGCliScopeString(value) {
|
|
22
|
-
return knownUAPKGCliScopes(parseOAuthScopeTokens(value));
|
|
23
|
-
}
|
|
24
|
-
function parseOAuthScopeTokens(value) {
|
|
25
|
-
if (typeof value !== "string" || value.length === 0 || value.trim() !== value) return [];
|
|
26
|
-
const scopes = value.split(" ");
|
|
27
|
-
if (scopes.some((scope) => !isOAuthScopeToken(scope))) return [];
|
|
28
|
-
return [...new Set(scopes)];
|
|
29
|
-
}
|
|
30
|
-
function isOAuthScopeToken(value) {
|
|
31
|
-
return typeof value === "string" && OAUTH_SCOPE_TOKEN_PATTERN.test(value);
|
|
32
|
-
}
|
|
33
|
-
function isUAPKGCliScope(value) {
|
|
34
|
-
return typeof value === "string" && UAPKG_CLI_SCOPE_SET.has(value);
|
|
35
|
-
}
|
|
36
|
-
var ControlPlaneError = class extends Error {
|
|
37
|
-
code;
|
|
38
|
-
status;
|
|
39
|
-
details;
|
|
40
|
-
constructor(code, message, status, details, options) {
|
|
41
|
-
super(message, options);
|
|
42
|
-
this.code = code;
|
|
43
|
-
this.status = status;
|
|
44
|
-
this.details = details;
|
|
45
|
-
this.name = "ControlPlaneError";
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var OAuthScopeInsufficientError = class extends ControlPlaneError {
|
|
49
|
-
registryAlias;
|
|
50
|
-
requestedScopes;
|
|
51
|
-
requiredScopes;
|
|
52
|
-
missingScopes;
|
|
53
|
-
constructor(message, registryAlias, requestedScopes, requiredScopes, missingScopes, status = 403, options) {
|
|
54
|
-
const requested = knownUAPKGCliScopes(requestedScopes);
|
|
55
|
-
const required = knownUAPKGCliScopes(requiredScopes);
|
|
56
|
-
const missing = knownUAPKGCliScopes(missingScopes).filter((scope) => requested.includes(scope) && required.includes(scope));
|
|
57
|
-
super("OAUTH_SCOPE_INSUFFICIENT", message, status, {
|
|
58
|
-
requestedScopes: requested,
|
|
59
|
-
requiredScopes: required,
|
|
60
|
-
missingScopes: missing
|
|
61
|
-
}, options);
|
|
62
|
-
this.registryAlias = registryAlias;
|
|
63
|
-
this.name = "OAuthScopeInsufficientError";
|
|
64
|
-
this.requestedScopes = requested;
|
|
65
|
-
this.requiredScopes = required;
|
|
66
|
-
this.missingScopes = missing;
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var OAuthScopeUnsupportedError = class extends ControlPlaneError {
|
|
70
|
-
registryAlias;
|
|
71
|
-
requestedScopes;
|
|
72
|
-
unsupportedScopes;
|
|
73
|
-
reason;
|
|
74
|
-
constructor(registryAlias, requestedScopes, unsupportedScopes, options) {
|
|
75
|
-
const requested = knownUAPKGCliScopes(requestedScopes);
|
|
76
|
-
const unsupported = knownUAPKGCliScopes(unsupportedScopes).filter((scope) => requested.includes(scope));
|
|
77
|
-
const reason = options?.reason ?? "issuer-does-not-support-requested-scope";
|
|
78
|
-
const message = reason === "cli-update-required" ? `The authorization service for "${registryAlias}" requires an OAuth capability that this UAPKG CLI version does not recognize. Update UAPKG CLI and try again.` : unsupportedIssuerScopeMessage(registryAlias, unsupported);
|
|
79
|
-
super("OAUTH_SCOPE_UNSUPPORTED", message, options?.status, {
|
|
80
|
-
requestedScopes: requested,
|
|
81
|
-
unsupportedScopes: unsupported,
|
|
82
|
-
reason
|
|
83
|
-
}, options);
|
|
84
|
-
this.registryAlias = registryAlias;
|
|
85
|
-
this.name = "OAuthScopeUnsupportedError";
|
|
86
|
-
this.requestedScopes = requested;
|
|
87
|
-
this.unsupportedScopes = unsupported;
|
|
88
|
-
this.reason = reason;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function unsupportedIssuerScopeMessage(registryAlias, unsupportedScopes) {
|
|
92
|
-
return `The authorization service for "${registryAlias}" does not support the OAuth ${unsupportedScopes.length === 1 ? "scope" : "scopes"} required by this UAPKG CLI: ${unsupportedScopes.join(", ")}. Update UAPKG CLI and try again; if it is already current, the authorization service must be updated.`;
|
|
93
|
-
}
|
|
94
|
-
function registryAudience(registryId) {
|
|
95
|
-
return `${UAPKG_CONTROL_PLANE_API}/v1/registries/${encodeURIComponent(registryId)}`;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
|
-
export { ControlPlaneError, OAuthScopeInsufficientError, OAuthScopeUnsupportedError, UAPKG_AUTHORIZATION_ISSUER, UAPKG_CLI_CLIENT_ID, UAPKG_CLI_SCOPES, UAPKG_CONTROL_PLANE_API, UAPKG_GITHUB_OIDC_AUDIENCE, isOAuthScopeToken, isUAPKGCliScope, knownUAPKGCliScopes, parseOAuthScopeTokens, parseUAPKGCliScopeString, registryAudience };
|
|
100
|
-
//# sourceMappingURL=ControlPlaneTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ControlPlaneTypes.js","names":[],"sources":["../../src/control-plane/ControlPlaneTypes.ts"],"sourcesContent":["import { UAPKG_CONTROL_PLANE_ENDPOINTS } from '#cli/control-plane/ControlPlaneEndpoints.ts';\n\nexport const UAPKG_AUTHORIZATION_ISSUER = UAPKG_CONTROL_PLANE_ENDPOINTS.issuer;\nexport const UAPKG_CONTROL_PLANE_API = UAPKG_CONTROL_PLANE_ENDPOINTS.apiBaseUrl;\nexport const UAPKG_CLI_CLIENT_ID = 'uapkg-cli';\nexport const UAPKG_GITHUB_OIDC_AUDIENCE = 'uapkg';\n\nexport const UAPKG_CLI_SCOPES = [\n 'identity.self.read',\n 'publishing.request.create',\n 'publishing.request.read.self',\n 'registry_grant.revoke.self',\n] as const;\n\nexport type UAPKGCliScope = (typeof UAPKG_CLI_SCOPES)[number];\nconst UAPKG_CLI_SCOPE_SET = new Set<string>(UAPKG_CLI_SCOPES);\nconst OAUTH_SCOPE_TOKEN_PATTERN = /^[\\x21\\x23-\\x5b\\x5d-\\x7e]+$/;\n\nexport function knownUAPKGCliScopes(value: unknown): UAPKGCliScope[] {\n if (!Array.isArray(value)) return [];\n const candidates = new Set(value.filter((scope): scope is string => typeof scope === 'string'));\n return UAPKG_CLI_SCOPES.filter((scope) => candidates.has(scope));\n}\n\nexport function parseUAPKGCliScopeString(value: unknown): UAPKGCliScope[] {\n return knownUAPKGCliScopes(parseOAuthScopeTokens(value));\n}\n\nexport function parseOAuthScopeTokens(value: unknown): string[] {\n if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) return [];\n const scopes = value.split(' ');\n if (scopes.some((scope) => !isOAuthScopeToken(scope))) return [];\n return [...new Set(scopes)];\n}\n\nexport function isOAuthScopeToken(value: unknown): value is string {\n return typeof value === 'string' && OAUTH_SCOPE_TOKEN_PATTERN.test(value);\n}\n\nexport function isUAPKGCliScope(value: unknown): value is UAPKGCliScope {\n return typeof value === 'string' && UAPKG_CLI_SCOPE_SET.has(value);\n}\n\nexport type ControlPlaneAuthMode = 'auto' | 'login' | 'gat' | 'oidc';\n\nexport interface RegistryTrust {\n readonly alias: string;\n readonly registryId: string;\n readonly registryName: string;\n readonly repositoryUrl: string;\n readonly repositoryFingerprint: string;\n readonly issuer: string;\n readonly apiBaseUrl: string;\n readonly resource: string;\n readonly cacheShortId: string;\n}\n\nexport interface AccountDisplayMetadata {\n readonly id: string;\n readonly username: string;\n readonly displayName: string;\n}\n\nexport interface AccountSelf {\n readonly account: AccountDisplayMetadata;\n readonly registry: {\n readonly id: string;\n };\n readonly grant: {\n readonly id: string;\n readonly deviceName: string;\n readonly idleExpiresAt: string;\n readonly absoluteExpiresAt: string;\n readonly scopes: readonly string[];\n };\n}\n\nexport interface CliLoginConfirmation extends AccountSelf {\n readonly grant: AccountSelf['grant'] & {\n readonly status: 'pending' | 'active';\n readonly activationExpiresAt: string;\n readonly replacesGrantId: string | null;\n };\n}\n\nexport interface ActivatedCliLoginGrant {\n readonly id: string;\n readonly status: 'active';\n readonly replacesGrantId: string | null;\n}\n\nexport interface RegistryGrantMetadata {\n readonly issuer: string;\n readonly registryId: string;\n readonly registryName: string;\n readonly grantId: string;\n readonly clientId: string;\n readonly keyReference: string;\n readonly refreshTokenReference: string;\n readonly publicKeyThumbprint: string;\n readonly deviceName: string;\n readonly repositoryFingerprint: string;\n readonly account: AccountDisplayMetadata;\n readonly createdAt: number;\n readonly idleExpiresAt: number;\n readonly expiresAt: number;\n}\n\nexport interface AuthMetadataFile {\n readonly schemaVersion: 1;\n readonly grants: Readonly<Record<string, RegistryGrantMetadata>>;\n}\n\nexport interface RegistryRequestSource {\n readonly type: 'github_release';\n readonly repository: string;\n readonly releaseTag: string;\n readonly assetName: string;\n}\n\n/** Artifact integrity observed by this client from the exact bytes it inspected. */\nexport interface ObservedArtifactIntegrity {\n /** Exactly `sha256:` + 64 lowercase hex characters. */\n readonly sha256: string;\n readonly sizeBytes: number;\n}\n\n/** Normalized packaged-manifest claims submitted with a publish request. */\nexport interface SubmittedPackageClaims {\n readonly name: string;\n readonly version: string;\n readonly private: boolean;\n readonly dependencies: Readonly<Record<string, { readonly version: string; readonly registry?: string }>>;\n readonly devDependencies: Readonly<Record<string, { readonly version: string; readonly registry?: string }>>;\n readonly peerDependencies: Readonly<Record<string, { readonly version: string; readonly registry?: string }>>;\n}\n\n/** The six route-derived registry operations (PS-REQ-001). */\nexport type RegistryOperation = 'publish' | 'unpublish' | 'yank' | 'unyank' | 'deprecate' | 'undeprecate';\n\n/**\n * Body for `POST /v1/registry-requests/{operation}`. The operation is\n * derived from the route; the body never carries a kind.\n */\nexport interface RegistryRequestSubmission {\n readonly registryId: string;\n readonly ownerOrganizationName?: string;\n readonly payload: {\n readonly packageName: string;\n readonly packageVersion: string;\n readonly source?: RegistryRequestSource;\n readonly observedIntegrity?: ObservedArtifactIntegrity;\n readonly claims?: SubmittedPackageClaims;\n readonly reason?: string;\n };\n}\n\nexport type RegistryRequestStatus =\n | 'queued'\n | 'checking'\n | 'accepted'\n | 'ready'\n | 'ready_superseded'\n | 'rejected'\n | 'operationally_failed';\n\nexport interface RegistryRequestSummary {\n readonly id: string;\n readonly registryId: string;\n readonly kind: string;\n readonly status: RegistryRequestStatus;\n readonly currentStep?: string;\n readonly createdAt?: number;\n readonly updatedAt?: number;\n readonly payload?: {\n readonly packageName?: string;\n readonly packageVersion?: string;\n };\n}\n\nexport type RegistryRequestCheckExecutionState =\n | 'pending'\n | 'running'\n | 'retrying'\n | 'blocked_by_dependency'\n | 'completed';\n\nexport type RegistryRequestCheckConclusion = 'success' | 'failure' | 'skipped';\n\n/** One bounded, caller-visible result from the request's sealed check plan. */\nexport interface RegistryRequestCheck {\n readonly checkId: string;\n readonly executionState: RegistryRequestCheckExecutionState;\n readonly conclusion?: RegistryRequestCheckConclusion;\n readonly reasonCode?: string;\n}\n\n/** Sanitized durable retry-exhaustion details for an operational failure. */\nexport interface RegistryRequestTerminalFailure {\n readonly reasonCode: string;\n readonly attempts?: number;\n readonly maxAttempts?: number;\n}\n\n/** Additive detail returned by the request-status endpoint. */\nexport interface RegistryRequestDetail {\n readonly request: RegistryRequestSummary;\n readonly checks?: readonly RegistryRequestCheck[];\n readonly terminalFailure?: RegistryRequestTerminalFailure;\n}\n\nexport interface ControlPlaneApiErrorBody {\n readonly ok: false;\n readonly error: {\n readonly code: string;\n readonly message: string;\n readonly details?: Readonly<Record<string, unknown>>;\n };\n}\n\nexport class ControlPlaneError extends Error {\n public constructor(\n public readonly code: string,\n message: string,\n public readonly status?: number,\n public readonly details?: Readonly<Record<string, unknown>>,\n options?: ErrorOptions,\n ) {\n super(message, options);\n this.name = 'ControlPlaneError';\n }\n}\n\nexport class OAuthScopeInsufficientError extends ControlPlaneError {\n public readonly requestedScopes: readonly UAPKGCliScope[];\n public readonly requiredScopes: readonly UAPKGCliScope[];\n public readonly missingScopes: readonly UAPKGCliScope[];\n\n public constructor(\n message: string,\n public readonly registryAlias: string,\n requestedScopes: readonly UAPKGCliScope[],\n requiredScopes: readonly UAPKGCliScope[],\n missingScopes: readonly UAPKGCliScope[],\n status = 403,\n options?: ErrorOptions,\n ) {\n const requested = knownUAPKGCliScopes(requestedScopes);\n const required = knownUAPKGCliScopes(requiredScopes);\n const missing = knownUAPKGCliScopes(missingScopes).filter(\n (scope) => requested.includes(scope) && required.includes(scope),\n );\n super(\n 'OAUTH_SCOPE_INSUFFICIENT',\n message,\n status,\n { requestedScopes: requested, requiredScopes: required, missingScopes: missing },\n options,\n );\n this.name = 'OAuthScopeInsufficientError';\n this.requestedScopes = requested;\n this.requiredScopes = required;\n this.missingScopes = missing;\n }\n}\n\nexport class OAuthScopeUnsupportedError extends ControlPlaneError {\n public readonly requestedScopes: readonly UAPKGCliScope[];\n public readonly unsupportedScopes: readonly UAPKGCliScope[];\n public readonly reason: 'issuer-does-not-support-requested-scope' | 'cli-update-required';\n\n public constructor(\n public readonly registryAlias: string,\n requestedScopes: readonly UAPKGCliScope[],\n unsupportedScopes: readonly UAPKGCliScope[],\n options?: ErrorOptions & {\n readonly reason?: 'issuer-does-not-support-requested-scope' | 'cli-update-required';\n readonly status?: number;\n },\n ) {\n const requested = knownUAPKGCliScopes(requestedScopes);\n const unsupported = knownUAPKGCliScopes(unsupportedScopes).filter((scope) => requested.includes(scope));\n const reason = options?.reason ?? 'issuer-does-not-support-requested-scope';\n const message =\n reason === 'cli-update-required'\n ? `The authorization service for \"${registryAlias}\" requires an OAuth capability that this UAPKG CLI version does not recognize. Update UAPKG CLI and try again.`\n : unsupportedIssuerScopeMessage(registryAlias, unsupported);\n super(\n 'OAUTH_SCOPE_UNSUPPORTED',\n message,\n options?.status,\n { requestedScopes: requested, unsupportedScopes: unsupported, reason },\n options,\n );\n this.name = 'OAuthScopeUnsupportedError';\n this.requestedScopes = requested;\n this.unsupportedScopes = unsupported;\n this.reason = reason;\n }\n}\n\nfunction unsupportedIssuerScopeMessage(registryAlias: string, unsupportedScopes: readonly UAPKGCliScope[]): string {\n const noun = unsupportedScopes.length === 1 ? 'scope' : 'scopes';\n return `The authorization service for \"${registryAlias}\" does not support the OAuth ${noun} required by this UAPKG CLI: ${unsupportedScopes.join(', ')}. Update UAPKG CLI and try again; if it is already current, the authorization service must be updated.`;\n}\n\nexport function registryAudience(registryId: string): string {\n return `${UAPKG_CONTROL_PLANE_API}/v1/registries/${encodeURIComponent(registryId)}`;\n}\n"],"mappings":";;;AAEA,MAAa,6BAA6B,8BAA8B;AACxE,MAAa,0BAA0B,8BAA8B;AACrE,MAAa,sBAAsB;AACnC,MAAa,6BAA6B;AAE1C,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;AACF;AAGA,MAAM,sBAAsB,IAAI,IAAY,gBAAgB;AAC5D,MAAM,4BAA4B;AAElC,SAAgB,oBAAoB,OAAiC;CACnE,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;CACnC,MAAM,aAAa,IAAI,IAAI,MAAM,QAAQ,UAA2B,OAAO,UAAU,QAAQ,CAAC;CAC9F,OAAO,iBAAiB,QAAQ,UAAU,WAAW,IAAI,KAAK,CAAC;AACjE;AAEA,SAAgB,yBAAyB,OAAiC;CACxE,OAAO,oBAAoB,sBAAsB,KAAK,CAAC;AACzD;AAEA,SAAgB,sBAAsB,OAA0B;CAC9D,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,KAAK,MAAM,KAAK,MAAM,OAAO,OAAO,CAAC;CACvF,MAAM,SAAS,MAAM,MAAM,GAAG;CAC9B,IAAI,OAAO,MAAM,UAAU,CAAC,kBAAkB,KAAK,CAAC,GAAG,OAAO,CAAC;CA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,cAAc,kHAChD,8BAA8B,eAAe,WAAW;EAC9D,MACE,2BACA,SACA,SAAS,QACT;GAAE,iBAAiB;GAAW,mBAAmB;GAAa;EAAO,GACrE,OACF;EArBgB;EAsBhB,KAAK,OAAO;EACZ,KAAK,kBAAkB;EACvB,KAAK,oBAAoB;EACzB,KAAK,SAAS;CAChB;AACF;AAEA,SAAS,8BAA8B,eAAuB,mBAAqD;CAEjH,OAAO,kCAAkC,cAAc,+BAD1C,kBAAkB,WAAW,IAAI,UAAU,SACmC,+BAA+B,kBAAkB,KAAK,IAAI,EAAE;AACzJ;AAEA,SAAgB,iBAAiB,YAA4B;CAC3D,OAAO,GAAG,wBAAwB,iBAAiB,mBAAmB,UAAU;AAClF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialStore.d.ts","names":[],"sources":["../../src/control-plane/CredentialStore.ts"],"mappings":";UAEU;EACR,YAAY;EACZ;EACA;;UAGQ;EACR,YAAY,iBAAiB,qBAAqB;;KAGxC,sBAAsB,QAAQ;;;;;cAM7B;mBAIQ;mBACA;UAJX;EAER,YACmB,cAAa,eACb;EAGN,mBAAmB;EAkBnB,IAAI,oBAAoB;EAYxB,IAAI,mBAAmB,gBAAgB;EAWvC,OAAO,oBAAoB;EAajC,gBAAgB,4BAA4B,gBAAgB,oBAAoB;UAO/E;UAOM"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
|
|
3
|
-
//#region src/control-plane/CredentialStore.ts
|
|
4
|
-
/**
|
|
5
|
-
* Protected secret storage. The native module is imported only when a
|
|
6
|
-
* control-plane command needs it, so install/search/update remain portable.
|
|
7
|
-
*/
|
|
8
|
-
var CredentialStore = class {
|
|
9
|
-
loadKeyring;
|
|
10
|
-
service;
|
|
11
|
-
module;
|
|
12
|
-
constructor(loadKeyring = async () => await import("@napi-rs/keyring"), service = "uapkg.cli") {
|
|
13
|
-
this.loadKeyring = loadKeyring;
|
|
14
|
-
this.service = service;
|
|
15
|
-
}
|
|
16
|
-
async assertAvailable() {
|
|
17
|
-
const reference = `availability:${randomUUID()}`;
|
|
18
|
-
try {
|
|
19
|
-
await this.set(reference, reference);
|
|
20
|
-
if (await this.get(reference) !== reference) throw new Error("The operating-system credential store failed a round-trip check.");
|
|
21
|
-
} catch (error) {
|
|
22
|
-
throw new Error("Secure operating-system credential storage is unavailable. UAPKG will not save login secrets in plaintext.", { cause: error });
|
|
23
|
-
} finally {
|
|
24
|
-
await this.delete(reference).catch(() => void 0);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async get(reference) {
|
|
28
|
-
await this.ensureModule();
|
|
29
|
-
try {
|
|
30
|
-
return this.entry(reference).getPassword() ?? void 0;
|
|
31
|
-
} catch (error) {
|
|
32
|
-
if (isMissingCredentialError(error)) return void 0;
|
|
33
|
-
throw new Error("Unable to read a UAPKG credential from protected operating-system storage.", { cause: error });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
async set(reference, value) {
|
|
37
|
-
await this.ensureModule();
|
|
38
|
-
try {
|
|
39
|
-
this.entry(reference).setPassword(value);
|
|
40
|
-
} catch (error) {
|
|
41
|
-
throw new Error("Unable to save a UAPKG credential in protected operating-system storage.", { cause: error });
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async delete(reference) {
|
|
45
|
-
await this.ensureModule();
|
|
46
|
-
try {
|
|
47
|
-
this.entry(reference).deleteCredential();
|
|
48
|
-
} catch (error) {
|
|
49
|
-
if (!isMissingCredentialError(error)) throw new Error("Unable to remove a UAPKG credential from protected operating-system storage.", { cause: error });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
createReference(kind, issuer, registryId, grantId) {
|
|
53
|
-
return `${kind}:${createHash("sha256").update(`${kind}\0${issuer.replace(/\/+$/, "")}\0${registryId.toLowerCase()}\0${grantId}`).digest("hex")}`;
|
|
54
|
-
}
|
|
55
|
-
entry(reference) {
|
|
56
|
-
if (!this.module) throw new Error("CredentialStore has not loaded the native keyring yet.");
|
|
57
|
-
return new this.module.Entry(this.service, reference);
|
|
58
|
-
}
|
|
59
|
-
async ensureModule() {
|
|
60
|
-
this.module ??= await this.loadKeyring();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
function isMissingCredentialError(error) {
|
|
64
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
65
|
-
return /no\s*entry|not\s*found|missing/i.test(message);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
|
-
export { CredentialStore };
|
|
70
|
-
//# sourceMappingURL=CredentialStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialStore.js","names":[],"sources":["../../src/control-plane/CredentialStore.ts"],"sourcesContent":["import { createHash, randomUUID } from 'node:crypto';\n\ninterface KeyringEntry {\n setPassword(password: string): void;\n getPassword(): string | null;\n deleteCredential(): boolean;\n}\n\ninterface KeyringModule {\n Entry: new (service: string, username: string) => KeyringEntry;\n}\n\nexport type KeyringLoader = () => Promise<KeyringModule>;\n\n/**\n * Protected secret storage. The native module is imported only when a\n * control-plane command needs it, so install/search/update remain portable.\n */\nexport class CredentialStore {\n private module?: KeyringModule;\n\n public constructor(\n private readonly loadKeyring: KeyringLoader = async () => (await import('@napi-rs/keyring')) as KeyringModule,\n private readonly service = 'uapkg.cli',\n ) {}\n\n public async assertAvailable(): Promise<void> {\n const reference = `availability:${randomUUID()}`;\n try {\n await this.set(reference, reference);\n const roundTrip = await this.get(reference);\n if (roundTrip !== reference) {\n throw new Error('The operating-system credential store failed a round-trip check.');\n }\n } catch (error) {\n throw new Error(\n 'Secure operating-system credential storage is unavailable. UAPKG will not save login secrets in plaintext.',\n { cause: error },\n );\n } finally {\n await this.delete(reference).catch(() => undefined);\n }\n }\n\n public async get(reference: string): Promise<string | undefined> {\n await this.ensureModule();\n try {\n return this.entry(reference).getPassword() ?? undefined;\n } catch (error) {\n if (isMissingCredentialError(error)) return undefined;\n throw new Error('Unable to read a UAPKG credential from protected operating-system storage.', {\n cause: error,\n });\n }\n }\n\n public async set(reference: string, value: string): Promise<void> {\n await this.ensureModule();\n try {\n this.entry(reference).setPassword(value);\n } catch (error) {\n throw new Error('Unable to save a UAPKG credential in protected operating-system storage.', {\n cause: error,\n });\n }\n }\n\n public async delete(reference: string): Promise<void> {\n await this.ensureModule();\n try {\n this.entry(reference).deleteCredential();\n } catch (error) {\n if (!isMissingCredentialError(error)) {\n throw new Error('Unable to remove a UAPKG credential from protected operating-system storage.', {\n cause: error,\n });\n }\n }\n }\n\n public createReference(kind: 'grant' | 'dpop-key', issuer: string, registryId: string, grantId: string): string {\n const digest = createHash('sha256')\n .update(`${kind}\\0${issuer.replace(/\\/+$/, '')}\\0${registryId.toLowerCase()}\\0${grantId}`)\n .digest('hex');\n return `${kind}:${digest}`;\n }\n\n private entry(reference: string): KeyringEntry {\n if (!this.module) {\n throw new Error('CredentialStore has not loaded the native keyring yet.');\n }\n return new this.module.Entry(this.service, reference);\n }\n\n private async ensureModule(): Promise<void> {\n this.module ??= await this.loadKeyring();\n }\n}\n\nfunction isMissingCredentialError(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return /no\\s*entry|not\\s*found|missing/i.test(message);\n}\n"],"mappings":";;;;;;;AAkBA,IAAa,kBAAb,MAA6B;CAIR;CACA;CAJnB,AAAQ;CAER,AAAO,YACL,AAAiB,cAA6B,YAAa,MAAM,OAAO,qBACxE,AAAiB,UAAU,aAC3B;EAFiB;EACA;CAChB;CAEH,MAAa,kBAAiC;EAC5C,MAAM,YAAY,gBAAgB,WAAW;EAC7C,IAAI;GACF,MAAM,KAAK,IAAI,WAAW,SAAS;GAEnC,IAAI,MADoB,KAAK,IAAI,SAAS,MACxB,WAChB,MAAM,IAAI,MAAM,kEAAkE;EAEtF,SAAS,OAAO;GACd,MAAM,IAAI,MACR,8GACA,EAAE,OAAO,MAAM,CACjB;EACF,UAAU;GACR,MAAM,KAAK,O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