@decionis/agentsafe 0.1.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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +909 -0
- package/dist/Cli.d.ts +3 -0
- package/dist/Cli.d.ts.map +1 -0
- package/dist/Cli.js +150 -0
- package/dist/Cli.js.map +1 -0
- package/dist/Index.d.ts +104 -0
- package/dist/Index.d.ts.map +1 -0
- package/dist/Index.js +102 -0
- package/dist/Index.js.map +1 -0
- package/dist/Serve.d.ts +26 -0
- package/dist/Serve.d.ts.map +1 -0
- package/dist/Serve.js +143 -0
- package/dist/Serve.js.map +1 -0
- package/dist/TrustedExecutor.d.ts +66 -0
- package/dist/TrustedExecutor.d.ts.map +1 -0
- package/dist/TrustedExecutor.js +170 -0
- package/dist/TrustedExecutor.js.map +1 -0
- package/dist/Version.d.ts +6 -0
- package/dist/Version.d.ts.map +1 -0
- package/dist/Version.js +21 -0
- package/dist/Version.js.map +1 -0
- package/dist/adapters/AdapterActionHandler.d.ts +48 -0
- package/dist/adapters/AdapterActionHandler.d.ts.map +1 -0
- package/dist/adapters/AdapterActionHandler.js +148 -0
- package/dist/adapters/AdapterActionHandler.js.map +1 -0
- package/dist/adapters/EffectAdapter.d.ts +96 -0
- package/dist/adapters/EffectAdapter.d.ts.map +1 -0
- package/dist/adapters/EffectAdapter.js +16 -0
- package/dist/adapters/EffectAdapter.js.map +1 -0
- package/dist/adapters/EffectAwareGrantVerifier.d.ts +30 -0
- package/dist/adapters/EffectAwareGrantVerifier.d.ts.map +1 -0
- package/dist/adapters/EffectAwareGrantVerifier.js +38 -0
- package/dist/adapters/EffectAwareGrantVerifier.js.map +1 -0
- package/dist/adapters/EffectComparison.d.ts +20 -0
- package/dist/adapters/EffectComparison.d.ts.map +1 -0
- package/dist/adapters/EffectComparison.js +48 -0
- package/dist/adapters/EffectComparison.js.map +1 -0
- package/dist/adapters/EffectEvidenceBuilder.d.ts +60 -0
- package/dist/adapters/EffectEvidenceBuilder.d.ts.map +1 -0
- package/dist/adapters/EffectEvidenceBuilder.js +127 -0
- package/dist/adapters/EffectEvidenceBuilder.js.map +1 -0
- package/dist/adapters/EffectEvidenceRegister.d.ts +31 -0
- package/dist/adapters/EffectEvidenceRegister.d.ts.map +1 -0
- package/dist/adapters/EffectEvidenceRegister.js +21 -0
- package/dist/adapters/EffectEvidenceRegister.js.map +1 -0
- package/dist/adapters/JcsDigest.d.ts +43 -0
- package/dist/adapters/JcsDigest.d.ts.map +1 -0
- package/dist/adapters/JcsDigest.js +86 -0
- package/dist/adapters/JcsDigest.js.map +1 -0
- package/dist/adapters/banking/BankingAction.d.ts +146 -0
- package/dist/adapters/banking/BankingAction.d.ts.map +1 -0
- package/dist/adapters/banking/BankingAction.js +102 -0
- package/dist/adapters/banking/BankingAction.js.map +1 -0
- package/dist/adapters/banking/BankingAdapter.d.ts +60 -0
- package/dist/adapters/banking/BankingAdapter.d.ts.map +1 -0
- package/dist/adapters/banking/BankingAdapter.js +107 -0
- package/dist/adapters/banking/BankingAdapter.js.map +1 -0
- package/dist/adapters/banking/BankingHandlers.d.ts +24 -0
- package/dist/adapters/banking/BankingHandlers.d.ts.map +1 -0
- package/dist/adapters/banking/BankingHandlers.js +47 -0
- package/dist/adapters/banking/BankingHandlers.js.map +1 -0
- package/dist/adapters/banking/BankingIntentBinder.d.ts +47 -0
- package/dist/adapters/banking/BankingIntentBinder.d.ts.map +1 -0
- package/dist/adapters/banking/BankingIntentBinder.js +64 -0
- package/dist/adapters/banking/BankingIntentBinder.js.map +1 -0
- package/dist/adapters/banking/CoreBankingHttpAdapter.d.ts +55 -0
- package/dist/adapters/banking/CoreBankingHttpAdapter.d.ts.map +1 -0
- package/dist/adapters/banking/CoreBankingHttpAdapter.js +248 -0
- package/dist/adapters/banking/CoreBankingHttpAdapter.js.map +1 -0
- package/dist/adapters/banking/Currency.d.ts +10 -0
- package/dist/adapters/banking/Currency.d.ts.map +1 -0
- package/dist/adapters/banking/Currency.js +91 -0
- package/dist/adapters/banking/Currency.js.map +1 -0
- package/dist/adapters/banking/EffectProjections.d.ts +52 -0
- package/dist/adapters/banking/EffectProjections.d.ts.map +1 -0
- package/dist/adapters/banking/EffectProjections.js +140 -0
- package/dist/adapters/banking/EffectProjections.js.map +1 -0
- package/dist/adapters/banking/Iban.d.ts +18 -0
- package/dist/adapters/banking/Iban.d.ts.map +1 -0
- package/dist/adapters/banking/Iban.js +38 -0
- package/dist/adapters/banking/Iban.js.map +1 -0
- package/dist/adapters/banking/Money.d.ts +32 -0
- package/dist/adapters/banking/Money.d.ts.map +1 -0
- package/dist/adapters/banking/Money.js +81 -0
- package/dist/adapters/banking/Money.js.map +1 -0
- package/dist/adapters/banking/ReasonCodes.d.ts +19 -0
- package/dist/adapters/banking/ReasonCodes.d.ts.map +1 -0
- package/dist/adapters/banking/ReasonCodes.js +35 -0
- package/dist/adapters/banking/ReasonCodes.js.map +1 -0
- package/dist/audit/ChainJournal.d.ts +38 -0
- package/dist/audit/ChainJournal.d.ts.map +1 -0
- package/dist/audit/ChainJournal.js +97 -0
- package/dist/audit/ChainJournal.js.map +1 -0
- package/dist/audit/HashChain.d.ts +39 -0
- package/dist/audit/HashChain.d.ts.map +1 -0
- package/dist/audit/HashChain.js +63 -0
- package/dist/audit/HashChain.js.map +1 -0
- package/dist/audit/HashChainedAuditSink.d.ts +22 -0
- package/dist/audit/HashChainedAuditSink.d.ts.map +1 -0
- package/dist/audit/HashChainedAuditSink.js +26 -0
- package/dist/audit/HashChainedAuditSink.js.map +1 -0
- package/dist/audit/LineAuditSink.d.ts +19 -0
- package/dist/audit/LineAuditSink.d.ts.map +1 -0
- package/dist/audit/LineAuditSink.js +35 -0
- package/dist/audit/LineAuditSink.js.map +1 -0
- package/dist/cli/Arguments.d.ts +26 -0
- package/dist/cli/Arguments.d.ts.map +1 -0
- package/dist/cli/Arguments.js +66 -0
- package/dist/cli/Arguments.js.map +1 -0
- package/dist/cli/CliProcess.d.ts +29 -0
- package/dist/cli/CliProcess.d.ts.map +1 -0
- package/dist/cli/CliProcess.js +78 -0
- package/dist/cli/CliProcess.js.map +1 -0
- package/dist/cli/Commands.d.ts +8 -0
- package/dist/cli/Commands.d.ts.map +1 -0
- package/dist/cli/Commands.js +67 -0
- package/dist/cli/Commands.js.map +1 -0
- package/dist/cli/ConfigCommand.d.ts +7 -0
- package/dist/cli/ConfigCommand.d.ts.map +1 -0
- package/dist/cli/ConfigCommand.js +77 -0
- package/dist/cli/ConfigCommand.js.map +1 -0
- package/dist/cli/ConfigFile.d.ts +21 -0
- package/dist/cli/ConfigFile.d.ts.map +1 -0
- package/dist/cli/ConfigFile.js +57 -0
- package/dist/cli/ConfigFile.js.map +1 -0
- package/dist/cli/Credentials.d.ts +15 -0
- package/dist/cli/Credentials.d.ts.map +1 -0
- package/dist/cli/Credentials.js +51 -0
- package/dist/cli/Credentials.js.map +1 -0
- package/dist/cli/Doctor.d.ts +25 -0
- package/dist/cli/Doctor.d.ts.map +1 -0
- package/dist/cli/Doctor.js +211 -0
- package/dist/cli/Doctor.js.map +1 -0
- package/dist/cli/Help.d.ts +3 -0
- package/dist/cli/Help.d.ts.map +1 -0
- package/dist/cli/Help.js +38 -0
- package/dist/cli/Help.js.map +1 -0
- package/dist/cli/Init.d.ts +32 -0
- package/dist/cli/Init.d.ts.map +1 -0
- package/dist/cli/Init.js +163 -0
- package/dist/cli/Init.js.map +1 -0
- package/dist/cli/Login.d.ts +16 -0
- package/dist/cli/Login.d.ts.map +1 -0
- package/dist/cli/Login.js +74 -0
- package/dist/cli/Login.js.map +1 -0
- package/dist/cli/Proxy.d.ts +41 -0
- package/dist/cli/Proxy.d.ts.map +1 -0
- package/dist/cli/Proxy.js +161 -0
- package/dist/cli/Proxy.js.map +1 -0
- package/dist/cli/Status.d.ts +7 -0
- package/dist/cli/Status.d.ts.map +1 -0
- package/dist/cli/Status.js +64 -0
- package/dist/cli/Status.js.map +1 -0
- package/dist/cli/TestCommand.d.ts +36 -0
- package/dist/cli/TestCommand.d.ts.map +1 -0
- package/dist/cli/TestCommand.js +173 -0
- package/dist/cli/TestCommand.js.map +1 -0
- package/dist/config/ConfigKeys.d.ts +10 -0
- package/dist/config/ConfigKeys.d.ts.map +1 -0
- package/dist/config/ConfigKeys.js +105 -0
- package/dist/config/ConfigKeys.js.map +1 -0
- package/dist/config/ExecutorConfig.d.ts +254 -0
- package/dist/config/ExecutorConfig.d.ts.map +1 -0
- package/dist/config/ExecutorConfig.js +637 -0
- package/dist/config/ExecutorConfig.js.map +1 -0
- package/dist/containment/ContainmentProbe.d.ts +87 -0
- package/dist/containment/ContainmentProbe.d.ts.map +1 -0
- package/dist/containment/ContainmentProbe.js +103 -0
- package/dist/containment/ContainmentProbe.js.map +1 -0
- package/dist/credential/CredentialError.d.ts +6 -0
- package/dist/credential/CredentialError.d.ts.map +1 -0
- package/dist/credential/CredentialError.js +10 -0
- package/dist/credential/CredentialError.js.map +1 -0
- package/dist/credential/DownstreamCredential.d.ts +38 -0
- package/dist/credential/DownstreamCredential.d.ts.map +1 -0
- package/dist/credential/DownstreamCredential.js +2 -0
- package/dist/credential/DownstreamCredential.js.map +1 -0
- package/dist/credential/GrantOf.d.ts +10 -0
- package/dist/credential/GrantOf.d.ts.map +1 -0
- package/dist/credential/GrantOf.js +16 -0
- package/dist/credential/GrantOf.js.map +1 -0
- package/dist/credential/PrivateKeyJwtCredential.d.ts +43 -0
- package/dist/credential/PrivateKeyJwtCredential.d.ts.map +1 -0
- package/dist/credential/PrivateKeyJwtCredential.js +126 -0
- package/dist/credential/PrivateKeyJwtCredential.js.map +1 -0
- package/dist/credential/SignedRequestCredential.d.ts +112 -0
- package/dist/credential/SignedRequestCredential.d.ts.map +1 -0
- package/dist/credential/SignedRequestCredential.js +255 -0
- package/dist/credential/SignedRequestCredential.js.map +1 -0
- package/dist/credential/StaticHeaderCredential.d.ts +16 -0
- package/dist/credential/StaticHeaderCredential.d.ts.map +1 -0
- package/dist/credential/StaticHeaderCredential.js +21 -0
- package/dist/credential/StaticHeaderCredential.js.map +1 -0
- package/dist/egress/EgressError.d.ts +13 -0
- package/dist/egress/EgressError.d.ts.map +1 -0
- package/dist/egress/EgressError.js +16 -0
- package/dist/egress/EgressError.js.map +1 -0
- package/dist/egress/EgressPolicy.d.ts +55 -0
- package/dist/egress/EgressPolicy.d.ts.map +1 -0
- package/dist/egress/EgressPolicy.js +137 -0
- package/dist/egress/EgressPolicy.js.map +1 -0
- package/dist/egress/GlobalFetchLock.d.ts +16 -0
- package/dist/egress/GlobalFetchLock.d.ts.map +1 -0
- package/dist/egress/GlobalFetchLock.js +34 -0
- package/dist/egress/GlobalFetchLock.js.map +1 -0
- package/dist/egress/GuardedFetch.d.ts +56 -0
- package/dist/egress/GuardedFetch.d.ts.map +1 -0
- package/dist/egress/GuardedFetch.js +300 -0
- package/dist/egress/GuardedFetch.js.map +1 -0
- package/dist/egress/TcpProbe.d.ts +35 -0
- package/dist/egress/TcpProbe.d.ts.map +1 -0
- package/dist/egress/TcpProbe.js +45 -0
- package/dist/egress/TcpProbe.js.map +1 -0
- package/dist/gateway/Activation.d.ts +39 -0
- package/dist/gateway/Activation.d.ts.map +1 -0
- package/dist/gateway/Activation.js +61 -0
- package/dist/gateway/Activation.js.map +1 -0
- package/dist/gateway/BoundaryTest.d.ts +92 -0
- package/dist/gateway/BoundaryTest.d.ts.map +1 -0
- package/dist/gateway/BoundaryTest.js +349 -0
- package/dist/gateway/BoundaryTest.js.map +1 -0
- package/dist/gateway/DemoAuthority.d.ts +41 -0
- package/dist/gateway/DemoAuthority.d.ts.map +1 -0
- package/dist/gateway/DemoAuthority.js +66 -0
- package/dist/gateway/DemoAuthority.js.map +1 -0
- package/dist/gateway/ForwardHandler.d.ts +56 -0
- package/dist/gateway/ForwardHandler.d.ts.map +1 -0
- package/dist/gateway/ForwardHandler.js +111 -0
- package/dist/gateway/ForwardHandler.js.map +1 -0
- package/dist/gateway/Gateway.d.ts +142 -0
- package/dist/gateway/Gateway.d.ts.map +1 -0
- package/dist/gateway/Gateway.js +819 -0
- package/dist/gateway/Gateway.js.map +1 -0
- package/dist/gateway/GatewayConfig.d.ts +237 -0
- package/dist/gateway/GatewayConfig.d.ts.map +1 -0
- package/dist/gateway/GatewayConfig.js +706 -0
- package/dist/gateway/GatewayConfig.js.map +1 -0
- package/dist/gateway/GatewayMetrics.d.ts +26 -0
- package/dist/gateway/GatewayMetrics.d.ts.map +1 -0
- package/dist/gateway/GatewayMetrics.js +28 -0
- package/dist/gateway/GatewayMetrics.js.map +1 -0
- package/dist/gateway/GatewayReport.d.ts +74 -0
- package/dist/gateway/GatewayReport.d.ts.map +1 -0
- package/dist/gateway/GatewayReport.js +109 -0
- package/dist/gateway/GatewayReport.js.map +1 -0
- package/dist/gateway/InterceptedRequest.d.ts +53 -0
- package/dist/gateway/InterceptedRequest.d.ts.map +1 -0
- package/dist/gateway/InterceptedRequest.js +80 -0
- package/dist/gateway/InterceptedRequest.js.map +1 -0
- package/dist/gateway/RouteTable.d.ts +28 -0
- package/dist/gateway/RouteTable.d.ts.map +1 -0
- package/dist/gateway/RouteTable.js +72 -0
- package/dist/gateway/RouteTable.js.map +1 -0
- package/dist/gateway/Upstream.d.ts +46 -0
- package/dist/gateway/Upstream.d.ts.map +1 -0
- package/dist/gateway/Upstream.js +158 -0
- package/dist/gateway/Upstream.js.map +1 -0
- package/dist/handlers/ForwardRequestHandler.d.ts +26 -0
- package/dist/handlers/ForwardRequestHandler.d.ts.map +1 -0
- package/dist/handlers/ForwardRequestHandler.js +98 -0
- package/dist/handlers/ForwardRequestHandler.js.map +1 -0
- package/dist/handlers/HandlerRegistration.d.ts +37 -0
- package/dist/handlers/HandlerRegistration.d.ts.map +1 -0
- package/dist/handlers/HandlerRegistration.js +2 -0
- package/dist/handlers/HandlerRegistration.js.map +1 -0
- package/dist/handlers/JournaledActionHandler.d.ts +31 -0
- package/dist/handlers/JournaledActionHandler.d.ts.map +1 -0
- package/dist/handlers/JournaledActionHandler.js +63 -0
- package/dist/handlers/JournaledActionHandler.js.map +1 -0
- package/dist/http/ExecutorHttpServer.d.ts +33 -0
- package/dist/http/ExecutorHttpServer.d.ts.map +1 -0
- package/dist/http/ExecutorHttpServer.js +176 -0
- package/dist/http/ExecutorHttpServer.js.map +1 -0
- package/dist/http/GatewayHttpServer.d.ts +42 -0
- package/dist/http/GatewayHttpServer.d.ts.map +1 -0
- package/dist/http/GatewayHttpServer.js +195 -0
- package/dist/http/GatewayHttpServer.js.map +1 -0
- package/dist/http/RecordingTarget.d.ts +18 -0
- package/dist/http/RecordingTarget.d.ts.map +1 -0
- package/dist/http/RecordingTarget.js +71 -0
- package/dist/http/RecordingTarget.js.map +1 -0
- package/dist/http/RequestContext.d.ts +17 -0
- package/dist/http/RequestContext.d.ts.map +1 -0
- package/dist/http/RequestContext.js +19 -0
- package/dist/http/RequestContext.js.map +1 -0
- package/dist/http/Routes.d.ts +93 -0
- package/dist/http/Routes.d.ts.map +1 -0
- package/dist/http/Routes.js +46 -0
- package/dist/http/Routes.js.map +1 -0
- package/dist/http/TlsListener.d.ts +38 -0
- package/dist/http/TlsListener.d.ts.map +1 -0
- package/dist/http/TlsListener.js +52 -0
- package/dist/http/TlsListener.js.map +1 -0
- package/dist/identity/Authenticator.d.ts +58 -0
- package/dist/identity/Authenticator.d.ts.map +1 -0
- package/dist/identity/Authenticator.js +170 -0
- package/dist/identity/Authenticator.js.map +1 -0
- package/dist/identity/PeerIdentity.d.ts +24 -0
- package/dist/identity/PeerIdentity.d.ts.map +1 -0
- package/dist/identity/PeerIdentity.js +29 -0
- package/dist/identity/PeerIdentity.js.map +1 -0
- package/dist/identity/PrincipalRegistry.d.ts +102 -0
- package/dist/identity/PrincipalRegistry.d.ts.map +1 -0
- package/dist/identity/PrincipalRegistry.js +191 -0
- package/dist/identity/PrincipalRegistry.js.map +1 -0
- package/dist/identity/PrincipalsFile.d.ts +152 -0
- package/dist/identity/PrincipalsFile.d.ts.map +1 -0
- package/dist/identity/PrincipalsFile.js +125 -0
- package/dist/identity/PrincipalsFile.js.map +1 -0
- package/dist/identity/RateLimiter.d.ts +43 -0
- package/dist/identity/RateLimiter.d.ts.map +1 -0
- package/dist/identity/RateLimiter.js +84 -0
- package/dist/identity/RateLimiter.js.map +1 -0
- package/dist/identity/SeparationOfDuties.d.ts +11 -0
- package/dist/identity/SeparationOfDuties.d.ts.map +1 -0
- package/dist/identity/SeparationOfDuties.js +25 -0
- package/dist/identity/SeparationOfDuties.js.map +1 -0
- package/dist/identity/WorkloadJwtVerifier.d.ts +57 -0
- package/dist/identity/WorkloadJwtVerifier.d.ts.map +1 -0
- package/dist/identity/WorkloadJwtVerifier.js +145 -0
- package/dist/identity/WorkloadJwtVerifier.js.map +1 -0
- package/dist/incident/EvidenceExport.d.ts +128 -0
- package/dist/incident/EvidenceExport.d.ts.map +1 -0
- package/dist/incident/EvidenceExport.js +187 -0
- package/dist/incident/EvidenceExport.js.map +1 -0
- package/dist/incident/FileProbe.d.ts +22 -0
- package/dist/incident/FileProbe.d.ts.map +1 -0
- package/dist/incident/FileProbe.js +31 -0
- package/dist/incident/FileProbe.js.map +1 -0
- package/dist/incident/HaltSwitch.d.ts +95 -0
- package/dist/incident/HaltSwitch.d.ts.map +1 -0
- package/dist/incident/HaltSwitch.js +171 -0
- package/dist/incident/HaltSwitch.js.map +1 -0
- package/dist/incident/Metrics.d.ts +71 -0
- package/dist/incident/Metrics.d.ts.map +1 -0
- package/dist/incident/Metrics.js +146 -0
- package/dist/incident/Metrics.js.map +1 -0
- package/dist/incident/SecurityEvents.d.ts +182 -0
- package/dist/incident/SecurityEvents.d.ts.map +1 -0
- package/dist/incident/SecurityEvents.js +167 -0
- package/dist/incident/SecurityEvents.js.map +1 -0
- package/dist/journal/ExecutionJournal.d.ts +96 -0
- package/dist/journal/ExecutionJournal.d.ts.map +1 -0
- package/dist/journal/ExecutionJournal.js +100 -0
- package/dist/journal/ExecutionJournal.js.map +1 -0
- package/dist/journal/FileExecutionJournal.d.ts +38 -0
- package/dist/journal/FileExecutionJournal.d.ts.map +1 -0
- package/dist/journal/FileExecutionJournal.js +137 -0
- package/dist/journal/FileExecutionJournal.js.map +1 -0
- package/dist/journal/InMemoryExecutionJournal.d.ts +23 -0
- package/dist/journal/InMemoryExecutionJournal.d.ts.map +1 -0
- package/dist/journal/InMemoryExecutionJournal.js +47 -0
- package/dist/journal/InMemoryExecutionJournal.js.map +1 -0
- package/dist/journal/StartupReconciler.d.ts +47 -0
- package/dist/journal/StartupReconciler.d.ts.map +1 -0
- package/dist/journal/StartupReconciler.js +89 -0
- package/dist/journal/StartupReconciler.js.map +1 -0
- package/dist/limits/HardLimits.d.ts +63 -0
- package/dist/limits/HardLimits.d.ts.map +1 -0
- package/dist/limits/HardLimits.js +120 -0
- package/dist/limits/HardLimits.js.map +1 -0
- package/dist/logging/LineEmitter.d.ts +26 -0
- package/dist/logging/LineEmitter.d.ts.map +1 -0
- package/dist/logging/LineEmitter.js +36 -0
- package/dist/logging/LineEmitter.js.map +1 -0
- package/dist/posture/HostPosture.d.ts +60 -0
- package/dist/posture/HostPosture.d.ts.map +1 -0
- package/dist/posture/HostPosture.js +104 -0
- package/dist/posture/HostPosture.js.map +1 -0
- package/dist/posture/PostureChecks.d.ts +52 -0
- package/dist/posture/PostureChecks.d.ts.map +1 -0
- package/dist/posture/PostureChecks.js +172 -0
- package/dist/posture/PostureChecks.js.map +1 -0
- package/dist/secrets/CompositeSecretStore.d.ts +37 -0
- package/dist/secrets/CompositeSecretStore.d.ts.map +1 -0
- package/dist/secrets/CompositeSecretStore.js +99 -0
- package/dist/secrets/CompositeSecretStore.js.map +1 -0
- package/dist/secrets/EnvSecretStore.d.ts +18 -0
- package/dist/secrets/EnvSecretStore.d.ts.map +1 -0
- package/dist/secrets/EnvSecretStore.js +46 -0
- package/dist/secrets/EnvSecretStore.js.map +1 -0
- package/dist/secrets/FileSecretStore.d.ts +60 -0
- package/dist/secrets/FileSecretStore.d.ts.map +1 -0
- package/dist/secrets/FileSecretStore.js +180 -0
- package/dist/secrets/FileSecretStore.js.map +1 -0
- package/dist/secrets/Redactor.d.ts +32 -0
- package/dist/secrets/Redactor.d.ts.map +1 -0
- package/dist/secrets/Redactor.js +108 -0
- package/dist/secrets/Redactor.js.map +1 -0
- package/dist/secrets/SecretHandle.d.ts +34 -0
- package/dist/secrets/SecretHandle.d.ts.map +1 -0
- package/dist/secrets/SecretHandle.js +71 -0
- package/dist/secrets/SecretHandle.js.map +1 -0
- package/dist/secrets/SecretStore.d.ts +37 -0
- package/dist/secrets/SecretStore.d.ts.map +1 -0
- package/dist/secrets/SecretStore.js +12 -0
- package/dist/secrets/SecretStore.js.map +1 -0
- package/dist/service/AuthorityClients.d.ts +50 -0
- package/dist/service/AuthorityClients.d.ts.map +1 -0
- package/dist/service/AuthorityClients.js +83 -0
- package/dist/service/AuthorityClients.js.map +1 -0
- package/dist/service/EscalationResolver.d.ts +97 -0
- package/dist/service/EscalationResolver.d.ts.map +1 -0
- package/dist/service/EscalationResolver.js +196 -0
- package/dist/service/EscalationResolver.js.map +1 -0
- package/dist/service/Requests.d.ts +99 -0
- package/dist/service/Requests.d.ts.map +1 -0
- package/dist/service/Requests.js +42 -0
- package/dist/service/Requests.js.map +1 -0
- package/dist/service/ServiceError.d.ts +20 -0
- package/dist/service/ServiceError.d.ts.map +1 -0
- package/dist/service/ServiceError.js +25 -0
- package/dist/service/ServiceError.js.map +1 -0
- package/dist/service/TrustedExecutorService.d.ts +221 -0
- package/dist/service/TrustedExecutorService.d.ts.map +1 -0
- package/dist/service/TrustedExecutorService.js +1066 -0
- package/dist/service/TrustedExecutorService.js.map +1 -0
- package/dist/time/ClockSkewGuard.d.ts +25 -0
- package/dist/time/ClockSkewGuard.d.ts.map +1 -0
- package/dist/time/ClockSkewGuard.js +35 -0
- package/dist/time/ClockSkewGuard.js.map +1 -0
- package/dist/time/MonotonicClock.d.ts +35 -0
- package/dist/time/MonotonicClock.d.ts.map +1 -0
- package/dist/time/MonotonicClock.js +52 -0
- package/dist/time/MonotonicClock.js.map +1 -0
- package/dist/verify/VerifyAuditChain.d.ts +36 -0
- package/dist/verify/VerifyAuditChain.d.ts.map +1 -0
- package/dist/verify/VerifyAuditChain.js +109 -0
- package/dist/verify/VerifyAuditChain.js.map +1 -0
- package/dist/verify/VerifyEvidenceBundle.d.ts +50 -0
- package/dist/verify/VerifyEvidenceBundle.d.ts.map +1 -0
- package/dist/verify/VerifyEvidenceBundle.js +157 -0
- package/dist/verify/VerifyEvidenceBundle.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BEAP_PROFILE = "decionis.beap/v1.0";
|
|
3
|
+
export declare const BankingActionSchema: z.ZodObject<{
|
|
4
|
+
profile: z.ZodLiteral<"decionis.beap/v1.0">;
|
|
5
|
+
domain: z.ZodString;
|
|
6
|
+
action: z.ZodObject<{
|
|
7
|
+
type: z.ZodString;
|
|
8
|
+
request_id: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
actor: z.ZodObject<{
|
|
11
|
+
type: z.ZodEnum<{
|
|
12
|
+
HUMAN: "HUMAN";
|
|
13
|
+
APPLICATION: "APPLICATION";
|
|
14
|
+
AGENT: "AGENT";
|
|
15
|
+
SERVICE: "SERVICE";
|
|
16
|
+
WORKFLOW: "WORKFLOW";
|
|
17
|
+
BATCH_PROCESS: "BATCH_PROCESS";
|
|
18
|
+
MIDDLEWARE: "MIDDLEWARE";
|
|
19
|
+
SYSTEM: "SYSTEM";
|
|
20
|
+
}>;
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
principal: z.ZodObject<{
|
|
25
|
+
type: z.ZodEnum<{
|
|
26
|
+
SERVICE: "SERVICE";
|
|
27
|
+
PERSON: "PERSON";
|
|
28
|
+
ORGANIZATION: "ORGANIZATION";
|
|
29
|
+
ORGANIZATIONAL_FUNCTION: "ORGANIZATIONAL_FUNCTION";
|
|
30
|
+
}>;
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
subject: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
type: z.ZodString;
|
|
35
|
+
ref: z.ZodString;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
target: z.ZodObject<{
|
|
38
|
+
type: z.ZodString;
|
|
39
|
+
ref: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
financial_context: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
amount: z.ZodString;
|
|
43
|
+
currency: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
requested_effect: z.ZodObject<{
|
|
46
|
+
operation: z.ZodString;
|
|
47
|
+
source_ref: z.ZodOptional<z.ZodString>;
|
|
48
|
+
destination_ref: z.ZodOptional<z.ZodString>;
|
|
49
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
downstream: z.ZodObject<{
|
|
52
|
+
provider: z.ZodString;
|
|
53
|
+
product: z.ZodOptional<z.ZodString>;
|
|
54
|
+
operation: z.ZodString;
|
|
55
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
batch: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
manifest_digest: z.ZodString;
|
|
59
|
+
item_count: z.ZodNumber;
|
|
60
|
+
source_file_digest: z.ZodString;
|
|
61
|
+
}, z.core.$strict>>;
|
|
62
|
+
evidence_refs: z.ZodArray<z.ZodObject<{
|
|
63
|
+
kind: z.ZodString;
|
|
64
|
+
ref: z.ZodString;
|
|
65
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
export type BankingAction = z.infer<typeof BankingActionSchema>;
|
|
69
|
+
/**
|
|
70
|
+
* The profile's own conditional rule: releasing a batch requires the batch
|
|
71
|
+
* block and the amount, because a release with neither is not a release of
|
|
72
|
+
* anything. Expressed here rather than left to the JSON schema, since this
|
|
73
|
+
* is the schema the runtime uses.
|
|
74
|
+
*/
|
|
75
|
+
export declare const BankingActionWireSchema: z.ZodObject<{
|
|
76
|
+
profile: z.ZodLiteral<"decionis.beap/v1.0">;
|
|
77
|
+
domain: z.ZodString;
|
|
78
|
+
action: z.ZodObject<{
|
|
79
|
+
type: z.ZodString;
|
|
80
|
+
request_id: z.ZodString;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
actor: z.ZodObject<{
|
|
83
|
+
type: z.ZodEnum<{
|
|
84
|
+
HUMAN: "HUMAN";
|
|
85
|
+
APPLICATION: "APPLICATION";
|
|
86
|
+
AGENT: "AGENT";
|
|
87
|
+
SERVICE: "SERVICE";
|
|
88
|
+
WORKFLOW: "WORKFLOW";
|
|
89
|
+
BATCH_PROCESS: "BATCH_PROCESS";
|
|
90
|
+
MIDDLEWARE: "MIDDLEWARE";
|
|
91
|
+
SYSTEM: "SYSTEM";
|
|
92
|
+
}>;
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
principal: z.ZodObject<{
|
|
97
|
+
type: z.ZodEnum<{
|
|
98
|
+
SERVICE: "SERVICE";
|
|
99
|
+
PERSON: "PERSON";
|
|
100
|
+
ORGANIZATION: "ORGANIZATION";
|
|
101
|
+
ORGANIZATIONAL_FUNCTION: "ORGANIZATIONAL_FUNCTION";
|
|
102
|
+
}>;
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
subject: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
type: z.ZodString;
|
|
107
|
+
ref: z.ZodString;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
target: z.ZodObject<{
|
|
110
|
+
type: z.ZodString;
|
|
111
|
+
ref: z.ZodString;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
financial_context: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
amount: z.ZodString;
|
|
115
|
+
currency: z.ZodString;
|
|
116
|
+
}, z.core.$strict>>;
|
|
117
|
+
requested_effect: z.ZodObject<{
|
|
118
|
+
operation: z.ZodString;
|
|
119
|
+
source_ref: z.ZodOptional<z.ZodString>;
|
|
120
|
+
destination_ref: z.ZodOptional<z.ZodString>;
|
|
121
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
downstream: z.ZodObject<{
|
|
124
|
+
provider: z.ZodString;
|
|
125
|
+
product: z.ZodOptional<z.ZodString>;
|
|
126
|
+
operation: z.ZodString;
|
|
127
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
batch: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
manifest_digest: z.ZodString;
|
|
131
|
+
item_count: z.ZodNumber;
|
|
132
|
+
source_file_digest: z.ZodString;
|
|
133
|
+
}, z.core.$strict>>;
|
|
134
|
+
evidence_refs: z.ZodArray<z.ZodObject<{
|
|
135
|
+
kind: z.ZodString;
|
|
136
|
+
ref: z.ZodString;
|
|
137
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
}, z.core.$strict>;
|
|
140
|
+
/** The action name the transport carries for a BEAP action, per Appendix B.5. */
|
|
141
|
+
export declare function transportActionName(action: BankingAction): string;
|
|
142
|
+
/** The transport target, per Appendix B.5: the entity's type and reference. */
|
|
143
|
+
export declare function transportTarget(action: BankingAction): string;
|
|
144
|
+
/** Whether a transport action name belongs to the banking family at all. */
|
|
145
|
+
export declare function isBankingActionName(action: string): boolean;
|
|
146
|
+
//# sourceMappingURL=BankingAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingAction.d.ts","sourceRoot":"","sources":["../../../src/adapters/banking/BankingAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAqBjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkD9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYlC,CAAC;AAEH,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAEjE;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE7D;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const BEAP_PROFILE = "decionis.beap/v1.0";
|
|
3
|
+
/** The identifier shape the profile uses for every registered name. */
|
|
4
|
+
const identifier = z.string().regex(/^[A-Z][A-Z0-9_]{1,63}$/);
|
|
5
|
+
const reference = z.string().min(1).max(500);
|
|
6
|
+
const sha256 = z.string().regex(/^sha256:[0-9a-f]{64}$/);
|
|
7
|
+
const currency = z.string().regex(/^[A-Z]{3}$/);
|
|
8
|
+
/**
|
|
9
|
+
* The wire form of an amount: a decimal string. A JSON number is refused by
|
|
10
|
+
* this schema, not merely discouraged, so a float never reaches the
|
|
11
|
+
* canonicaliser and `1e3`, `-0` and `250000.00000000000000001` cannot become
|
|
12
|
+
* an amount the authority signed something else about. The scale rule is the
|
|
13
|
+
* currency's, and `Money` enforces it.
|
|
14
|
+
*/
|
|
15
|
+
const decimalAmount = z.string().regex(/^(0|[1-9]\d{0,27})(\.\d{1,18})?$/);
|
|
16
|
+
const entity = z.strictObject({ type: identifier, ref: reference });
|
|
17
|
+
/** A scalar parameter: the profile allows a string, a number, a boolean, or null. */
|
|
18
|
+
const parameterValue = z.union([z.string().max(500), z.number(), z.boolean(), z.null()]);
|
|
19
|
+
export const BankingActionSchema = z.strictObject({
|
|
20
|
+
profile: z.literal(BEAP_PROFILE),
|
|
21
|
+
domain: identifier,
|
|
22
|
+
action: z.strictObject({ type: identifier, request_id: reference }),
|
|
23
|
+
actor: z.strictObject({
|
|
24
|
+
type: z.enum([
|
|
25
|
+
"HUMAN",
|
|
26
|
+
"APPLICATION",
|
|
27
|
+
"AGENT",
|
|
28
|
+
"SERVICE",
|
|
29
|
+
"WORKFLOW",
|
|
30
|
+
"BATCH_PROCESS",
|
|
31
|
+
"MIDDLEWARE",
|
|
32
|
+
"SYSTEM",
|
|
33
|
+
]),
|
|
34
|
+
id: reference,
|
|
35
|
+
runtime: reference.optional(),
|
|
36
|
+
}),
|
|
37
|
+
principal: z.strictObject({
|
|
38
|
+
type: z.enum(["PERSON", "ORGANIZATION", "ORGANIZATIONAL_FUNCTION", "SERVICE"]),
|
|
39
|
+
id: reference,
|
|
40
|
+
}),
|
|
41
|
+
subject: entity.optional(),
|
|
42
|
+
target: entity,
|
|
43
|
+
financial_context: z.strictObject({ amount: decimalAmount, currency }).optional(),
|
|
44
|
+
requested_effect: z.strictObject({
|
|
45
|
+
operation: identifier,
|
|
46
|
+
source_ref: reference.optional(),
|
|
47
|
+
destination_ref: reference.optional(),
|
|
48
|
+
parameters: z
|
|
49
|
+
.record(z.string().regex(/^[a-z][a-z0-9_]{0,63}$/), parameterValue)
|
|
50
|
+
.refine((value) => Object.keys(value).length <= 64, { message: "too many parameters" })
|
|
51
|
+
.optional(),
|
|
52
|
+
}),
|
|
53
|
+
downstream: z.strictObject({
|
|
54
|
+
provider: identifier,
|
|
55
|
+
product: identifier.optional(),
|
|
56
|
+
operation: identifier,
|
|
57
|
+
environment: identifier.optional(),
|
|
58
|
+
}),
|
|
59
|
+
batch: z
|
|
60
|
+
.strictObject({
|
|
61
|
+
manifest_digest: sha256,
|
|
62
|
+
item_count: z.number().int().min(1),
|
|
63
|
+
source_file_digest: sha256,
|
|
64
|
+
})
|
|
65
|
+
.optional(),
|
|
66
|
+
evidence_refs: z
|
|
67
|
+
.array(z.strictObject({ kind: identifier, ref: reference, digest: sha256.optional() }))
|
|
68
|
+
.max(100),
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* The profile's own conditional rule: releasing a batch requires the batch
|
|
72
|
+
* block and the amount, because a release with neither is not a release of
|
|
73
|
+
* anything. Expressed here rather than left to the JSON schema, since this
|
|
74
|
+
* is the schema the runtime uses.
|
|
75
|
+
*/
|
|
76
|
+
export const BankingActionWireSchema = BankingActionSchema.superRefine((action, context) => {
|
|
77
|
+
if (action.action.type !== "RELEASE_PAYMENT_BATCH")
|
|
78
|
+
return;
|
|
79
|
+
if (action.batch === undefined) {
|
|
80
|
+
context.addIssue({ code: "custom", path: ["batch"], message: "required for a batch release" });
|
|
81
|
+
}
|
|
82
|
+
if (action.financial_context === undefined) {
|
|
83
|
+
context.addIssue({
|
|
84
|
+
code: "custom",
|
|
85
|
+
path: ["financial_context"],
|
|
86
|
+
message: "required for a batch release",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
/** The action name the transport carries for a BEAP action, per Appendix B.5. */
|
|
91
|
+
export function transportActionName(action) {
|
|
92
|
+
return `beap.${action.domain.toLowerCase()}.${action.action.type.toLowerCase()}`;
|
|
93
|
+
}
|
|
94
|
+
/** The transport target, per Appendix B.5: the entity's type and reference. */
|
|
95
|
+
export function transportTarget(action) {
|
|
96
|
+
return `${action.target.type.toLowerCase()}:${action.target.ref}`;
|
|
97
|
+
}
|
|
98
|
+
/** Whether a transport action name belongs to the banking family at all. */
|
|
99
|
+
export function isBankingActionName(action) {
|
|
100
|
+
return action.startsWith("beap.");
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=BankingAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingAction.js","sourceRoot":"","sources":["../../../src/adapters/banking/BankingAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEjD,uEAAuE;AACvE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;AACzD,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAChD;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAE3E,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpE,qFAAqF;AACrF,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,E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AC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,mBAAmB,CAAC;YAC3B,OAAO,EAAE,8BAA8B;SACxC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,iFAAiF;AACjF,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACvD,OAAO,QAAQ,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;AACnF,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,MAAqB;IACnD,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AACpE,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { JsonObject } from "@decionis/agent-safe-pipeline";
|
|
2
|
+
import { type Sha256 } from "../JcsDigest.js";
|
|
3
|
+
import type { AdapterExecution, AdapterReconciliation, EffectAdapter, PreparedAction, ProviderReconciliationResult, ProviderResult } from "../EffectAdapter.js";
|
|
4
|
+
import { transportActionName, type BankingAction } from "./BankingAction.js";
|
|
5
|
+
export declare class BankingActionError extends Error {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
constructor(code: string);
|
|
8
|
+
}
|
|
9
|
+
/** What a banking adapter needs beyond the generic contract. */
|
|
10
|
+
export interface BankingTransport {
|
|
11
|
+
/** Sends the action, once. Throws `IndeterminateOutcome` when nothing can be concluded. */
|
|
12
|
+
execute(execution: AdapterExecution<BankingAction>): Promise<ProviderResult>;
|
|
13
|
+
/** Asks what happened to an idempotency key. Read-only, always. */
|
|
14
|
+
reconcile(context: AdapterReconciliation): Promise<ProviderReconciliationResult>;
|
|
15
|
+
}
|
|
16
|
+
export interface BankingAdapterOptions {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly version: string;
|
|
19
|
+
readonly transport: BankingTransport;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The banking family's adapter: the BEAP vocabulary over the generic
|
|
23
|
+
* contract. `prepare` is where the profile's arithmetic happens and where a
|
|
24
|
+
* malformed action is refused before the authority is asked:
|
|
25
|
+
*
|
|
26
|
+
* - the amount is read through `Money`, so a decimal whose scale is not the
|
|
27
|
+
* currency's is `AMOUNT_SCALE_INVALID` rather than a rounded number;
|
|
28
|
+
* - an `iban:` reference with bad check digits is refused, because a typo
|
|
29
|
+
* that would still reach a valid-looking account is worth catching here;
|
|
30
|
+
* - the action type must be one the profile registers for its domain, and
|
|
31
|
+
* the expected effect is the projection that registry names.
|
|
32
|
+
*
|
|
33
|
+
* The intent digest is taken over the canonical action exactly as received,
|
|
34
|
+
* which is what the authority signs its binding against, and the
|
|
35
|
+
* expected-effect digest over the projection, which is what an observation
|
|
36
|
+
* is later compared to.
|
|
37
|
+
*/
|
|
38
|
+
export declare class BankingAdapter implements EffectAdapter<BankingAction> {
|
|
39
|
+
private readonly options;
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly version: string;
|
|
42
|
+
constructor(options: BankingAdapterOptions);
|
|
43
|
+
/** Every transport name the profile's registered actions produce. */
|
|
44
|
+
get actionTypes(): readonly string[];
|
|
45
|
+
prepare(action: BankingAction): PreparedAction;
|
|
46
|
+
execute(execution: AdapterExecution<BankingAction>): Promise<ProviderResult>;
|
|
47
|
+
/**
|
|
48
|
+
* The observation, as the profile's projection. Only a provider that
|
|
49
|
+
* returned the effect's own fields can produce one; an acknowledgement
|
|
50
|
+
* carries none, and none is invented for it.
|
|
51
|
+
*/
|
|
52
|
+
observeEffect(result: ProviderResult, prepared: PreparedAction): JsonObject | null;
|
|
53
|
+
reconcile(context: AdapterReconciliation): Promise<ProviderReconciliationResult>;
|
|
54
|
+
/** The digest of an action, for a caller that wants it without preparing. */
|
|
55
|
+
static intentDigest(action: BankingAction): Sha256;
|
|
56
|
+
}
|
|
57
|
+
/** The transport names of every action this build registers. */
|
|
58
|
+
export declare function registeredActionNames(): readonly string[];
|
|
59
|
+
export { transportActionName };
|
|
60
|
+
//# sourceMappingURL=BankingAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/banking/BankingAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAgB,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK3F,qBAAa,kBAAmB,SAAQ,KAAK;aACR,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIhD;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,2FAA2F;IAC3F,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7E,mEAAmE;IACnE,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CAClF;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,YAAW,aAAa,CAAC,aAAa,CAAC;IAI9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH3C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,OAAO,EAAE,MAAM,CAAC;gBAEI,OAAO,EAAE,qBAAqB;IAKlE,qEAAqE;IACrE,IAAW,WAAW,IAAI,SAAS,MAAM,EAAE,CAE1C;IAEM,OAAO,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc;IA8BxC,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIzF;;;;OAIG;IACI,aAAa,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,GAAG,UAAU,GAAG,IAAI;IAU5E,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAI7F,6EAA6E;WAC/D,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM;CAG1D;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,IAAI,SAAS,MAAM,EAAE,CAEzD;AAMD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { jcsDigest } from "../JcsDigest.js";
|
|
2
|
+
import { BEAP_PROFILE, transportActionName } from "./BankingAction.js";
|
|
3
|
+
import { expectedEffect, registeredAction, REGISTERED_ACTIONS } from "./EffectProjections.js";
|
|
4
|
+
import { Money } from "./Money.js";
|
|
5
|
+
import { referenceIsValid } from "./Iban.js";
|
|
6
|
+
export class BankingActionError extends Error {
|
|
7
|
+
code;
|
|
8
|
+
constructor(code) {
|
|
9
|
+
super(code);
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.name = "BankingActionError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The banking family's adapter: the BEAP vocabulary over the generic
|
|
16
|
+
* contract. `prepare` is where the profile's arithmetic happens and where a
|
|
17
|
+
* malformed action is refused before the authority is asked:
|
|
18
|
+
*
|
|
19
|
+
* - the amount is read through `Money`, so a decimal whose scale is not the
|
|
20
|
+
* currency's is `AMOUNT_SCALE_INVALID` rather than a rounded number;
|
|
21
|
+
* - an `iban:` reference with bad check digits is refused, because a typo
|
|
22
|
+
* that would still reach a valid-looking account is worth catching here;
|
|
23
|
+
* - the action type must be one the profile registers for its domain, and
|
|
24
|
+
* the expected effect is the projection that registry names.
|
|
25
|
+
*
|
|
26
|
+
* The intent digest is taken over the canonical action exactly as received,
|
|
27
|
+
* which is what the authority signs its binding against, and the
|
|
28
|
+
* expected-effect digest over the projection, which is what an observation
|
|
29
|
+
* is later compared to.
|
|
30
|
+
*/
|
|
31
|
+
export class BankingAdapter {
|
|
32
|
+
options;
|
|
33
|
+
id;
|
|
34
|
+
version;
|
|
35
|
+
constructor(options) {
|
|
36
|
+
this.options = options;
|
|
37
|
+
this.id = options.id;
|
|
38
|
+
this.version = options.version;
|
|
39
|
+
}
|
|
40
|
+
/** Every transport name the profile's registered actions produce. */
|
|
41
|
+
get actionTypes() {
|
|
42
|
+
return registeredActionNames();
|
|
43
|
+
}
|
|
44
|
+
prepare(action) {
|
|
45
|
+
if (action.profile !== BEAP_PROFILE)
|
|
46
|
+
throw new BankingActionError("BANKING_PROFILE_UNKNOWN");
|
|
47
|
+
const registered = registeredAction(action.domain, action.action.type);
|
|
48
|
+
// The amount is arithmetic, not text: reading it through Money refuses a
|
|
49
|
+
// scale the currency does not have before anything is hashed.
|
|
50
|
+
if (action.financial_context !== undefined) {
|
|
51
|
+
Money.fromDecimal(action.financial_context.amount, action.financial_context.currency);
|
|
52
|
+
}
|
|
53
|
+
for (const reference of [
|
|
54
|
+
action.requested_effect.source_ref,
|
|
55
|
+
action.requested_effect.destination_ref,
|
|
56
|
+
action.target.ref,
|
|
57
|
+
]) {
|
|
58
|
+
if (reference !== undefined && !referenceIsValid(reference)) {
|
|
59
|
+
throw new BankingActionError("BANKING_REFERENCE_INVALID");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const projection = expectedEffect(action);
|
|
63
|
+
return {
|
|
64
|
+
expectedEffect: projection,
|
|
65
|
+
expectedEffectDigest: jcsDigest(projection),
|
|
66
|
+
intentDigest: jcsDigest(action),
|
|
67
|
+
requestDigest: jcsDigest(action.requested_effect),
|
|
68
|
+
resourceRef: action.target.ref,
|
|
69
|
+
effectType: registered.effectType,
|
|
70
|
+
domain: action.domain,
|
|
71
|
+
actionType: action.action.type,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async execute(execution) {
|
|
75
|
+
return await this.options.transport.execute(execution);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The observation, as the profile's projection. Only a provider that
|
|
79
|
+
* returned the effect's own fields can produce one; an acknowledgement
|
|
80
|
+
* carries none, and none is invented for it.
|
|
81
|
+
*/
|
|
82
|
+
observeEffect(result, prepared) {
|
|
83
|
+
if (result.observed === null)
|
|
84
|
+
return null;
|
|
85
|
+
const observed = {};
|
|
86
|
+
for (const field of Object.keys(prepared.expectedEffect)) {
|
|
87
|
+
const value = result.observed[field];
|
|
88
|
+
if (value !== undefined)
|
|
89
|
+
observed[field] = value;
|
|
90
|
+
}
|
|
91
|
+
return observed;
|
|
92
|
+
}
|
|
93
|
+
async reconcile(context) {
|
|
94
|
+
return await this.options.transport.reconcile(context);
|
|
95
|
+
}
|
|
96
|
+
/** The digest of an action, for a caller that wants it without preparing. */
|
|
97
|
+
static intentDigest(action) {
|
|
98
|
+
return jcsDigest(action);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** The transport names of every action this build registers. */
|
|
102
|
+
export function registeredActionNames() {
|
|
103
|
+
return REGISTERED_TRANSPORT_NAMES;
|
|
104
|
+
}
|
|
105
|
+
const REGISTERED_TRANSPORT_NAMES = REGISTERED_ACTIONS.map((entry) => `beap.${entry.domain.toLowerCase()}.${entry.type.toLowerCase()}`);
|
|
106
|
+
export { transportActionName };
|
|
107
|
+
//# sourceMappingURL=BankingAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingAdapter.js","sourceRoot":"","sources":["../../../src/adapters/banking/BankingAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAe,MAAM,iBAAiB,CAAC;AASzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAsB,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACR;IAAnC,YAAmC,IAAY;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAC;QADqB,SAAI,GAAJ,IAAI,CAAQ;QAE7C,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAgBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,cAAc;IAIW;IAHpB,EAAE,CAAS;IACX,OAAO,CAAS;IAEhC,YAAoC,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;QAChE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACjC,CAAC;IAED,qEAAqE;IACrE,IAAW,WAAW;QACpB,OAAO,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAEM,OAAO,CAAC,MAAqB;QAClC,IAAI,MAAM,CAAC,OAAO,KAAK,YAAY;YAAE,MAAM,IAAI,kBAAkB,CAAC,yBAAyB,CAAC,CAAC;QAC7F,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,MAA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;YAAE,OAAO,IAAI,CAAC;QAC1C,MAAM,QAAQ,GAAe,EAAE,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrC,IAAI,KAAK,KAAK,SAAS;gBAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACnD,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAA8B;QACnD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,6EAA6E;IACtE,MAAM,CAAC,YAAY,CAAC,MAAqB;QAC9C,OAAO,SAAS,CAAC,MAA+B,CAAC,CAAC;IACpD,CAAC;CACF;AAED,gEAAgE;AAChE,MAAM,UAAU,qBAAqB;IACnC,OAAO,0BAA0B,CAAC;AACpC,CAAC;AAED,MAAM,0BAA0B,GAAsB,kBAAkB,CAAC,GAAG,CAC1E,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAC5E,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HandlerRegistration } from "../../handlers/HandlerRegistration.js";
|
|
2
|
+
export interface BankingHandlerOptions {
|
|
3
|
+
/** Overrides the configured identity; the configuration's is the default. */
|
|
4
|
+
readonly id?: string;
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
/** Where the effect of a posted action is read back from, by provider reference. */
|
|
7
|
+
readonly lookupByReferenceUrl?: string | null;
|
|
8
|
+
readonly onMismatch?: (mismatched: readonly string[]) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The reference registration for the banking family: every action type this
|
|
12
|
+
* build mirrors from the profile, each bridged to the same adapter over the
|
|
13
|
+
* configured downstream. An adopter with their own core replaces the
|
|
14
|
+
* transport and keeps everything else, because the profile's arithmetic, the
|
|
15
|
+
* projection, the comparison and the evidence are the adapter's, not the
|
|
16
|
+
* transport's.
|
|
17
|
+
*
|
|
18
|
+
* The adapter's identity comes from the configuration unless a caller
|
|
19
|
+
* overrides it, so the observer named in the effect record is the observer
|
|
20
|
+
* the executor reports to the authority: two sources that could disagree
|
|
21
|
+
* would put one attempt's observation under two names.
|
|
22
|
+
*/
|
|
23
|
+
export declare function bankingHandlers(options?: BankingHandlerOptions): HandlerRegistration;
|
|
24
|
+
//# sourceMappingURL=BankingHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingHandlers.d.ts","sourceRoot":"","sources":["../../../src/adapters/banking/BankingHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAOjF,MAAM,WAAW,qBAAqB;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,qBAA0B,GAAG,mBAAmB,CA4BxF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { adapterActionHandler } from "../AdapterActionHandler.js";
|
|
2
|
+
import { BankingActionWireSchema } from "./BankingAction.js";
|
|
3
|
+
import { BankingAdapter } from "./BankingAdapter.js";
|
|
4
|
+
import { CoreBankingHttpAdapter } from "./CoreBankingHttpAdapter.js";
|
|
5
|
+
import { REGISTERED_ACTIONS } from "./EffectProjections.js";
|
|
6
|
+
/**
|
|
7
|
+
* The reference registration for the banking family: every action type this
|
|
8
|
+
* build mirrors from the profile, each bridged to the same adapter over the
|
|
9
|
+
* configured downstream. An adopter with their own core replaces the
|
|
10
|
+
* transport and keeps everything else, because the profile's arithmetic, the
|
|
11
|
+
* projection, the comparison and the evidence are the adapter's, not the
|
|
12
|
+
* transport's.
|
|
13
|
+
*
|
|
14
|
+
* The adapter's identity comes from the configuration unless a caller
|
|
15
|
+
* overrides it, so the observer named in the effect record is the observer
|
|
16
|
+
* the executor reports to the authority: two sources that could disagree
|
|
17
|
+
* would put one attempt's observation under two names.
|
|
18
|
+
*/
|
|
19
|
+
export function bankingHandlers(options = {}) {
|
|
20
|
+
return (context) => {
|
|
21
|
+
const register = context.effects;
|
|
22
|
+
const adapter = new BankingAdapter({
|
|
23
|
+
id: options.id ?? context.banking.adapterId,
|
|
24
|
+
version: options.version ?? context.banking.adapterVersion,
|
|
25
|
+
transport: new CoreBankingHttpAdapter({
|
|
26
|
+
url: context.downstream.url,
|
|
27
|
+
lookupByReferenceUrl: options.lookupByReferenceUrl ?? context.banking.lookupByReferenceUrl,
|
|
28
|
+
lookupByKeyUrl: context.downstream.lookupUrl,
|
|
29
|
+
credential: context.credential,
|
|
30
|
+
fetch: context.fetch,
|
|
31
|
+
source: "CORE_BANKING_RESPONSE",
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
const handler = adapterActionHandler({
|
|
35
|
+
adapter,
|
|
36
|
+
schema: BankingActionWireSchema,
|
|
37
|
+
register,
|
|
38
|
+
timeoutMs: context.downstream.timeoutMs,
|
|
39
|
+
...(options.onMismatch === undefined ? {} : { onMismatch: options.onMismatch }),
|
|
40
|
+
});
|
|
41
|
+
const names = REGISTERED_ACTIONS.map((entry) => `beap.${entry.domain.toLowerCase()}.${entry.type.toLowerCase()}`);
|
|
42
|
+
for (const name of names)
|
|
43
|
+
context.registry.register(name, handler);
|
|
44
|
+
return names;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=BankingHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingHandlers.js","sourceRoot":"","sources":["../../../src/adapters/banking/BankingHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAsB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAW5D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,UAAiC,EAAE;IACjE,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC;YACjC,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,cAAc;YAC1D,SAAS,EAAE,IAAI,sBAAsB,CAAC;gBACpC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;gBAC3B,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,oBAAoB;gBAC1F,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBAC5C,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,uBAAuB;aAChC,CAAC;SACH,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,oBAAoB,CAAgB;YAClD,OAAO;YACP,MAAM,EAAE,uBAAuB;YAC/B,QAAQ;YACR,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;YACvC,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;SAChF,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAClC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAC5E,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { JsonObject } from "@decionis/agent-safe-pipeline";
|
|
2
|
+
import type { DownstreamConfig } from "../../config/ExecutorConfig.js";
|
|
3
|
+
import type { PrincipalActor } from "../../identity/PrincipalRegistry.js";
|
|
4
|
+
import { type BankingAction } from "./BankingAction.js";
|
|
5
|
+
export declare class BindingError extends Error {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
constructor(code: string);
|
|
8
|
+
}
|
|
9
|
+
export interface BindingInput {
|
|
10
|
+
/** The action and target the caller proposed, over the transport. */
|
|
11
|
+
readonly action: string;
|
|
12
|
+
readonly target: string;
|
|
13
|
+
readonly parameters: JsonObject;
|
|
14
|
+
readonly idempotencyKey: string;
|
|
15
|
+
readonly downstream: DownstreamConfig;
|
|
16
|
+
readonly actor: PrincipalActor;
|
|
17
|
+
}
|
|
18
|
+
export interface BoundBankingAction {
|
|
19
|
+
readonly action: BankingAction;
|
|
20
|
+
/** The trusted context the executor computes; never anything the caller sent. */
|
|
21
|
+
readonly context: JsonObject;
|
|
22
|
+
readonly expectedEffectDigest: string;
|
|
23
|
+
readonly intentDigest: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The gate between the transport and the profile. A BEAP action arrives as
|
|
27
|
+
* the canonical `BankingAction` in the proposal's parameters, and the
|
|
28
|
+
* transport's own action name and target are derived from it rather than
|
|
29
|
+
* trusted: if they disagree, the caller is describing one thing and asking
|
|
30
|
+
* for another, and the proposal is refused before the authority is asked.
|
|
31
|
+
*
|
|
32
|
+
* The same rule covers the request id, which must be the idempotency key the
|
|
33
|
+
* attempt is bound to; the downstream, which must be the one this process is
|
|
34
|
+
* configured for and not a provider the caller named; and the actor, which
|
|
35
|
+
* must be the principal the door authenticated. Every one of these is a
|
|
36
|
+
* `422` refusal, and none of them costs a dossier.
|
|
37
|
+
*
|
|
38
|
+
* What the executor adds is the trusted context: the profile, the intent
|
|
39
|
+
* digest and the expected-effect digest, computed here from the action
|
|
40
|
+
* itself. The proposal schema already refuses a caller-supplied context, so
|
|
41
|
+
* these cannot be presented from outside.
|
|
42
|
+
*/
|
|
43
|
+
export declare function bindBankingAction(input: BindingInput, digests: (action: BankingAction) => {
|
|
44
|
+
readonly intentDigest: string;
|
|
45
|
+
readonly expectedEffectDigest: string;
|
|
46
|
+
}): BoundBankingAction;
|
|
47
|
+
//# sourceMappingURL=BankingIntentBinder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingIntentBinder.d.ts","sourceRoot":"","sources":["../../../src/adapters/banking/BankingIntentBinder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,YAAa,SAAQ,KAAK;aACF,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIhD;AAED,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,GACA,kBAAkB,CAkCpB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BankingActionWireSchema, transportActionName, transportTarget, } from "./BankingAction.js";
|
|
2
|
+
export class BindingError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
constructor(code) {
|
|
5
|
+
super(code);
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = "BindingError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The gate between the transport and the profile. A BEAP action arrives as
|
|
12
|
+
* the canonical `BankingAction` in the proposal's parameters, and the
|
|
13
|
+
* transport's own action name and target are derived from it rather than
|
|
14
|
+
* trusted: if they disagree, the caller is describing one thing and asking
|
|
15
|
+
* for another, and the proposal is refused before the authority is asked.
|
|
16
|
+
*
|
|
17
|
+
* The same rule covers the request id, which must be the idempotency key the
|
|
18
|
+
* attempt is bound to; the downstream, which must be the one this process is
|
|
19
|
+
* configured for and not a provider the caller named; and the actor, which
|
|
20
|
+
* must be the principal the door authenticated. Every one of these is a
|
|
21
|
+
* `422` refusal, and none of them costs a dossier.
|
|
22
|
+
*
|
|
23
|
+
* What the executor adds is the trusted context: the profile, the intent
|
|
24
|
+
* digest and the expected-effect digest, computed here from the action
|
|
25
|
+
* itself. The proposal schema already refuses a caller-supplied context, so
|
|
26
|
+
* these cannot be presented from outside.
|
|
27
|
+
*/
|
|
28
|
+
export function bindBankingAction(input, digests) {
|
|
29
|
+
const parsed = BankingActionWireSchema.safeParse(input.parameters);
|
|
30
|
+
if (!parsed.success)
|
|
31
|
+
throw new BindingError("BANKING_ACTION_INVALID");
|
|
32
|
+
const action = parsed.data;
|
|
33
|
+
if (transportActionName(action) !== input.action) {
|
|
34
|
+
throw new BindingError("BANKING_ACTION_NAME_MISMATCH");
|
|
35
|
+
}
|
|
36
|
+
if (transportTarget(action) !== input.target)
|
|
37
|
+
throw new BindingError("BANKING_TARGET_MISMATCH");
|
|
38
|
+
if (action.action.request_id !== input.idempotencyKey) {
|
|
39
|
+
throw new BindingError("BANKING_REQUEST_ID_MISMATCH");
|
|
40
|
+
}
|
|
41
|
+
if (action.downstream.provider !== input.downstream.system.toUpperCase() ||
|
|
42
|
+
action.downstream.operation !== input.downstream.operation.toUpperCase() ||
|
|
43
|
+
(action.downstream.environment !== undefined &&
|
|
44
|
+
action.downstream.environment !== input.downstream.environment.toUpperCase())) {
|
|
45
|
+
throw new BindingError("BANKING_DOWNSTREAM_MISMATCH");
|
|
46
|
+
}
|
|
47
|
+
if (action.actor.id !== input.actor.id)
|
|
48
|
+
throw new BindingError("BANKING_ACTOR_MISMATCH");
|
|
49
|
+
const { intentDigest, expectedEffectDigest } = digests(action);
|
|
50
|
+
return {
|
|
51
|
+
action,
|
|
52
|
+
context: {
|
|
53
|
+
beap_profile: action.profile,
|
|
54
|
+
beap_intent_digest: intentDigest,
|
|
55
|
+
beap_expected_effect_digest: expectedEffectDigest,
|
|
56
|
+
...(action.batch === undefined
|
|
57
|
+
? {}
|
|
58
|
+
: { beap_batch_manifest_digest: action.batch.manifest_digest }),
|
|
59
|
+
},
|
|
60
|
+
expectedEffectDigest,
|
|
61
|
+
intentDigest,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=BankingIntentBinder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BankingIntentBinder.js","sourceRoot":"","sources":["../../../src/adapters/banking/BankingIntentBinder.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,OAAO,YAAa,SAAQ,KAAK;IACF;IAAnC,YAAmC,IAAY;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAC;QADqB,SAAI,GAAJ,IAAI,CAAQ;QAE7C,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAoBD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAmB,EACnB,OAGC;IAED,MAAM,MAAM,GAAG,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,MAAM,IAAI,YAAY,CAAC,wBAAwB,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAC3B,IAAI,mBAAmB,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,Y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