@eventsdk/sdk 0.0.0-stage → 0.4.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.
Files changed (178) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +9 -0
  3. package/dist/compatibility-http/bridge/receive.d.ts +3 -0
  4. package/dist/compatibility-http/bridge/types.d.ts +44 -0
  5. package/dist/compatibility-http/index.d.ts +4 -0
  6. package/dist/compatibility-http/index.js +1 -0
  7. package/dist/compatibility-http/policy/validate-policy.d.ts +3 -0
  8. package/dist/conformance/admission/harness.d.ts +20 -0
  9. package/dist/conformance/admission/run-suite.d.ts +2 -0
  10. package/dist/conformance/consumer/harness.d.ts +24 -0
  11. package/dist/conformance/consumer/run-apply-suite.d.ts +2 -0
  12. package/dist/conformance/consumer/run-worker-suite.d.ts +2 -0
  13. package/dist/conformance/event-link/harness.d.ts +13 -0
  14. package/dist/conformance/event-link/run-suite.d.ts +2 -0
  15. package/dist/conformance/fanout/harness.d.ts +39 -0
  16. package/dist/conformance/fanout/run-suite.d.ts +2 -0
  17. package/dist/conformance/gap/harness.d.ts +19 -0
  18. package/dist/conformance/gap/run-suite.d.ts +2 -0
  19. package/dist/conformance/index.d.ts +22 -0
  20. package/dist/conformance/index.js +1 -0
  21. package/dist/conformance/producer/harness.d.ts +21 -0
  22. package/dist/conformance/producer/run-suite.d.ts +2 -0
  23. package/dist/conformance/receipt/harness.d.ts +12 -0
  24. package/dist/conformance/receipt/projection-harness.d.ts +9 -0
  25. package/dist/conformance/receipt/run-projection-suite.d.ts +2 -0
  26. package/dist/conformance/receipt/run-suite.d.ts +2 -0
  27. package/dist/conformance/reliability/checks.d.ts +4 -0
  28. package/dist/conformance/result/harness.d.ts +15 -0
  29. package/dist/conformance/result/run-suite.d.ts +2 -0
  30. package/dist/conformance/version/compatibility.d.ts +13 -0
  31. package/dist/contracts/canonical/canonical-json.d.ts +1 -0
  32. package/dist/contracts/contract-types.d.ts +34 -0
  33. package/dist/contracts/generated/business-receipt.d.ts +21 -0
  34. package/dist/contracts/generated/cloud-event-context.d.ts +32 -0
  35. package/dist/contracts/generated/cloud-event-fanout.d.ts +33 -0
  36. package/dist/contracts/generated/cloud-event.d.ts +24 -0
  37. package/dist/contracts/generated/event-link-authorization-request.d.ts +22 -0
  38. package/dist/contracts/generated/event-link-proposal.d.ts +27 -0
  39. package/dist/contracts/generated/event-link-token-request.d.ts +7 -0
  40. package/dist/contracts/generated/event-origin-claims.d.ts +13 -0
  41. package/dist/contracts/generated/exchange-grant.d.ts +11 -0
  42. package/dist/contracts/generated/exchange-registration.d.ts +24 -0
  43. package/dist/contracts/generated/fanout-event-draft.d.ts +28 -0
  44. package/dist/contracts/generated/gap-baseline.d.ts +18 -0
  45. package/dist/contracts/generated/gap-recovery-command.d.ts +7 -0
  46. package/dist/contracts/generated/identity-context.d.ts +15 -0
  47. package/dist/contracts/generated/namespaced-reference.d.ts +4 -0
  48. package/dist/contracts/generated/native-event-catalog.d.ts +19 -0
  49. package/dist/contracts/generated/node-connection-profile.d.ts +217 -0
  50. package/dist/contracts/generated/node-worker-observation.d.ts +7 -0
  51. package/dist/contracts/generated/outbox-recovery-command.d.ts +8 -0
  52. package/dist/contracts/generated/portable-event-link-authorization-request.d.ts +98 -0
  53. package/dist/contracts/generated/portable-event-link-proposal.d.ts +121 -0
  54. package/dist/contracts/generated/portable-event-link-token-request.d.ts +34 -0
  55. package/dist/contracts/generated/portable-exchange-registration.d.ts +109 -0
  56. package/dist/contracts/generated/portable-gap-baseline.d.ts +93 -0
  57. package/dist/contracts/generated/portable-gap-recovery-command.d.ts +35 -0
  58. package/dist/contracts/generated/portable-outbox-recovery-command.d.ts +37 -0
  59. package/dist/contracts/generated/public-jwks-snapshot.d.ts +141 -0
  60. package/dist/contracts/generated/result-ref.d.ts +8 -0
  61. package/dist/contracts/generated/supported-profiles.d.ts +3 -0
  62. package/dist/contracts/generated/tenant-connection.d.ts +13 -0
  63. package/dist/contracts/generated/tenant-context.d.ts +4 -0
  64. package/dist/contracts/index.d.ts +31 -0
  65. package/dist/contracts/index.js +1 -0
  66. package/dist/contracts/validation/contract-error.d.ts +16 -0
  67. package/dist/contracts/validation/contracts.d.ts +316 -0
  68. package/dist/contracts/validation/decode-cloud-event.d.ts +2 -0
  69. package/dist/contracts/validation/event-link.d.ts +9 -0
  70. package/dist/contracts/validation/identity-context.d.ts +3 -0
  71. package/dist/contracts/validation/origin-proof-wire.d.ts +3 -0
  72. package/dist/contracts/validation/strict-json.d.ts +1 -0
  73. package/dist/core/inbox/accept-delivery.d.ts +26 -0
  74. package/dist/core/inbox/apply-delivery.d.ts +29 -0
  75. package/dist/core/inbox/domain-apply-result.d.ts +13 -0
  76. package/dist/core/inbox/inbox-worker.d.ts +2 -0
  77. package/dist/core/inbox/read-result.d.ts +12 -0
  78. package/dist/core/inbox/worker-types.d.ts +21 -0
  79. package/dist/core/index.d.ts +50 -0
  80. package/dist/core/index.js +1 -0
  81. package/dist/core/outbox/authorize-recovery.d.ts +75 -0
  82. package/dist/core/outbox/outbox-relay.d.ts +26 -0
  83. package/dist/core/outbox/record-event.d.ts +10 -0
  84. package/dist/core/outbox/record-fanout.d.ts +16 -0
  85. package/dist/core/ports/dead-letter.d.ts +29 -0
  86. package/dist/core/ports/inbox.d.ts +43 -0
  87. package/dist/core/ports/observability.d.ts +21 -0
  88. package/dist/core/ports/origin-refresh.d.ts +5 -0
  89. package/dist/core/ports/outbox.d.ts +46 -0
  90. package/dist/core/ports/result-reader.d.ts +14 -0
  91. package/dist/core/ports/transport.d.ts +13 -0
  92. package/dist/core/receipt/receipt-state.d.ts +3 -0
  93. package/dist/core/recovery/event-log.d.ts +28 -0
  94. package/dist/core/recovery/gap-baseline-binding.d.ts +2 -0
  95. package/dist/core/recovery/gap-recovery.d.ts +15 -0
  96. package/dist/core/recovery/receipt-identity-recovery.d.ts +8 -0
  97. package/dist/core/recovery/receipt-recovery.d.ts +14 -0
  98. package/dist/core/recovery/replay-dead-letter.d.ts +4 -0
  99. package/dist/core/runtime/dependencies.d.ts +19 -0
  100. package/dist/core/runtime/errors.d.ts +6 -0
  101. package/dist/core/runtime/event-identity.d.ts +14 -0
  102. package/dist/core/runtime/exchange-connection.d.ts +7 -0
  103. package/dist/core/runtime/fanout-identity.d.ts +6 -0
  104. package/dist/core/runtime/lease.d.ts +6 -0
  105. package/dist/core/runtime/observe-health.d.ts +3 -0
  106. package/dist/core/runtime/operation.d.ts +2 -0
  107. package/dist/core/runtime/retry.d.ts +14 -0
  108. package/dist/event-link/errors.d.ts +5 -0
  109. package/dist/event-link/exchange.d.ts +9 -0
  110. package/dist/event-link/index.d.ts +12 -0
  111. package/dist/event-link/index.js +1 -0
  112. package/dist/event-link/primitives.d.ts +10 -0
  113. package/dist/event-link/protocol.d.ts +21 -0
  114. package/dist/event-link/receiver-ports.d.ts +42 -0
  115. package/dist/event-link/receiver.d.ts +18 -0
  116. package/dist/event-link/registration.d.ts +21 -0
  117. package/dist/event-link/sender.d.ts +22 -0
  118. package/dist/identity-contracts/authorization/authorization-port.d.ts +35 -0
  119. package/dist/identity-contracts/index.d.ts +2 -0
  120. package/dist/identity-contracts/index.js +0 -0
  121. package/dist/identity-contracts/origin/verified-origin.d.ts +28 -0
  122. package/dist/identity-verifier/index.d.ts +6 -0
  123. package/dist/identity-verifier/index.js +1 -0
  124. package/dist/identity-verifier/jwt/service-token-verifier.d.ts +15 -0
  125. package/dist/identity-verifier/origin/event-origin-policy.d.ts +36 -0
  126. package/dist/identity-verifier/origin/event-origin-signer.d.ts +6 -0
  127. package/dist/identity-verifier/origin/event-origin-verifier.d.ts +6 -0
  128. package/dist/index.d.ts +24 -0
  129. package/dist/index.js +22 -0
  130. package/dist/node-config/configuration-error.d.ts +4 -0
  131. package/dist/node-config/diagnostics/check-configuration.d.ts +40 -0
  132. package/dist/node-config/identity/load-identity.d.ts +14 -0
  133. package/dist/node-config/identity/local-recovery-origin.d.ts +3 -0
  134. package/dist/node-config/identity/public-identity.d.ts +87 -0
  135. package/dist/node-config/identity/public-snapshot.d.ts +2 -0
  136. package/dist/node-config/identity/signing-identity.d.ts +5 -0
  137. package/dist/node-config/index.d.ts +12 -0
  138. package/dist/node-config/index.js +1 -0
  139. package/dist/node-config/main.js +3 -0
  140. package/dist/node-config/operations/export-own-public.d.ts +8 -0
  141. package/dist/node-config/operations/refresh-trust.d.ts +10 -0
  142. package/dist/node-config/profile/load-profile.d.ts +6 -0
  143. package/dist/node-config/profile/validate-profile.d.ts +2 -0
  144. package/dist/node-worker/index.d.ts +3 -0
  145. package/dist/node-worker/index.js +1 -0
  146. package/dist/node-worker/lifecycle.d.ts +19 -0
  147. package/dist/node-worker/route-scheduler.d.ts +17 -0
  148. package/dist/node-worker/session.d.ts +15 -0
  149. package/dist/provisioner/application/apply.d.ts +11 -0
  150. package/dist/provisioner/application/ports.d.ts +44 -0
  151. package/dist/provisioner/application/verify.d.ts +7 -0
  152. package/dist/provisioner/cli/arguments.d.ts +9 -0
  153. package/dist/provisioner/cli/live-command.d.ts +7 -0
  154. package/dist/provisioner/cli/main.js +2 -0
  155. package/dist/provisioner/cli/run.d.ts +2 -0
  156. package/dist/provisioner/cli/session-types.d.ts +26 -0
  157. package/dist/provisioner/conformance/policy.d.ts +9 -0
  158. package/dist/provisioner/index.d.ts +17 -0
  159. package/dist/provisioner/index.js +1 -0
  160. package/dist/provisioner/manifest/types.d.ts +55 -0
  161. package/dist/provisioner/manifest/validate.d.ts +3 -0
  162. package/dist/provisioner/nats/inspector.d.ts +13 -0
  163. package/dist/provisioner/nats/types.d.ts +38 -0
  164. package/dist/provisioner/nats/writer-types.d.ts +11 -0
  165. package/dist/provisioner/nats/writer.d.ts +18 -0
  166. package/dist/provisioner/planning/digest.d.ts +1 -0
  167. package/dist/provisioner/planning/plan.d.ts +18 -0
  168. package/dist/transport-nats/connection/delivery-session.d.ts +10 -0
  169. package/dist/transport-nats/connection/verified-connection.d.ts +12 -0
  170. package/dist/transport-nats/consume/delivery-handler.d.ts +34 -0
  171. package/dist/transport-nats/consume/nats-consumer.d.ts +18 -0
  172. package/dist/transport-nats/index.d.ts +12 -0
  173. package/dist/transport-nats/index.js +3 -0
  174. package/dist/transport-nats/publish/nats-publisher.d.ts +24 -0
  175. package/dist/transport-nats/transport-error.d.ts +5 -0
  176. package/licenses/NATS-LICENSE +201 -0
  177. package/package.json +79 -3
  178. package/README.md +0 -3
@@ -0,0 +1,16 @@
1
+ export interface ValidationIssue {
2
+ readonly path: string;
3
+ readonly keyword: string;
4
+ }
5
+ export type ValidationResult<T> = {
6
+ readonly valid: true;
7
+ readonly value: T;
8
+ } | {
9
+ readonly valid: false;
10
+ readonly issues: readonly ValidationIssue[];
11
+ };
12
+ export declare class ContractError extends Error {
13
+ readonly issues: readonly ValidationIssue[];
14
+ readonly code = "INVALID_CONTRACT";
15
+ constructor(issues: readonly ValidationIssue[]);
16
+ }
@@ -0,0 +1,316 @@
1
+ import type { GapBaseline } from '../generated/gap-baseline.js';
2
+ import type { GapRecoveryCommand } from '../generated/gap-recovery-command.js';
3
+ import type { ExchangeRegistration } from '../generated/exchange-registration.js';
4
+ import type { OutboxRecoveryCommand } from '../generated/outbox-recovery-command.js';
5
+ import type { NodeWorkerObservation } from '../generated/node-worker-observation.js';
6
+ import type { NativeEventCatalog } from '../generated/native-event-catalog.js';
7
+ import type { CloudEvent, FanoutEventDraft, NamespacedReference, IdentityContext, BusinessReceipt, ResultRef, TenantContext, TenantConnection, ExchangeGrant, EventOriginClaims, NodeConnectionProfile, PublicJwksSnapshot } from '../contract-types.js';
8
+ export declare const parseNativeEventCatalog: (value: unknown) => NativeEventCatalog;
9
+ export declare const parseNodeWorkerObservation: (value: unknown) => NodeWorkerObservation;
10
+ export declare const validateOutboxRecoveryCommand: (value: unknown) => import("./contract-error.js").ValidationResult<OutboxRecoveryCommand>;
11
+ export declare const parseOutboxRecoveryCommand: (value: unknown) => OutboxRecoveryCommand;
12
+ export declare const validateCloudEvent: (value: unknown) => import("./contract-error.js").ValidationResult<CloudEvent>;
13
+ export declare const validateCloudEventV1: (value: unknown) => import("./contract-error.js").ValidationResult<{
14
+ readonly specversion: "1.0";
15
+ readonly id: string;
16
+ readonly source: string;
17
+ readonly type: string;
18
+ readonly time: string;
19
+ readonly dataschema: string;
20
+ readonly datacontenttype: "application/json";
21
+ readonly profile: "eventsdk/1.0";
22
+ readonly kind: "EVENT" | "HANDOFF" | "RECEIPT";
23
+ readonly serviceorigin: string;
24
+ readonly sourcetenant: string;
25
+ readonly audience: string;
26
+ readonly connectionref: string;
27
+ readonly grantref: string;
28
+ readonly grantversion: number;
29
+ readonly correlationid: string;
30
+ readonly causationid?: string;
31
+ readonly subject?: string;
32
+ readonly data: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
33
+ readonly [x: string]: string | number | boolean | any | any | null;
34
+ } | null)[] | {
35
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null;
36
+ } | null)[] | {
37
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null;
38
+ } | null)[] | {
39
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null;
40
+ } | null)[] | {
41
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
42
+ } | null)[] | {
43
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
44
+ } | null)[] | {
45
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
46
+ } | null)[] | {
47
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
48
+ } | null)[] | {
49
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
50
+ } | null)[] | {
51
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
52
+ } | null)[] | {
53
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
54
+ } | null)[] | {
55
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
56
+ } | null;
57
+ }>;
58
+ export declare const validateCloudEventV11: (value: unknown) => import("./contract-error.js").ValidationResult<{
59
+ readonly specversion: "1.0";
60
+ readonly id: string;
61
+ readonly source: string;
62
+ readonly type: string;
63
+ readonly time: string;
64
+ readonly dataschema: string;
65
+ readonly datacontenttype: "application/json";
66
+ readonly profile: "eventsdk/1.1";
67
+ readonly kind: "EVENT" | "HANDOFF" | "RECEIPT";
68
+ readonly serviceorigin: string;
69
+ readonly sourcetenant: string;
70
+ readonly audience: string;
71
+ readonly connectionref: string;
72
+ readonly grantref: string;
73
+ readonly grantversion: number;
74
+ readonly correlationid: string;
75
+ readonly causationid?: string;
76
+ readonly subject?: string;
77
+ readonly data: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
78
+ readonly [x: string]: string | number | boolean | any | any | null;
79
+ } | null)[] | {
80
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null;
81
+ } | null)[] | {
82
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null;
83
+ } | null)[] | {
84
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null;
85
+ } | null)[] | {
86
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
87
+ } | null)[] | {
88
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
89
+ } | null)[] | {
90
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
91
+ } | null)[] | {
92
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
93
+ } | null)[] | {
94
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
95
+ } | null)[] | {
96
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
97
+ } | null)[] | {
98
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
99
+ } | null)[] | {
100
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
101
+ } | null;
102
+ readonly orgnamespace?: string;
103
+ readonly orgref?: string;
104
+ readonly projectnamespace?: string;
105
+ readonly projectref?: string;
106
+ readonly principalnamespace?: string;
107
+ readonly principalref?: string;
108
+ readonly resourcenamespace?: string;
109
+ readonly resourceref?: string;
110
+ }>;
111
+ export declare const validateNamespacedReference: (value: unknown) => import("./contract-error.js").ValidationResult<{
112
+ readonly namespace: string;
113
+ readonly ref: string;
114
+ }>;
115
+ export declare const validateIdentityContext: (value: unknown) => import("./contract-error.js").ValidationResult<{
116
+ readonly sourceTenant: {
117
+ readonly serviceRef: string;
118
+ readonly tenantRef: string;
119
+ };
120
+ readonly organization?: {
121
+ readonly namespace: string;
122
+ readonly ref: string;
123
+ };
124
+ readonly project?: {
125
+ readonly namespace: string;
126
+ readonly ref: string;
127
+ };
128
+ readonly actorPrincipal?: {
129
+ readonly namespace: string;
130
+ readonly ref: string;
131
+ };
132
+ readonly resource?: {
133
+ readonly namespace: string;
134
+ readonly ref: string;
135
+ };
136
+ }>;
137
+ export declare const validateBusinessReceipt: (value: unknown) => import("./contract-error.js").ValidationResult<{
138
+ readonly receiptRef: string;
139
+ readonly originSource: string;
140
+ readonly originEventId: string;
141
+ readonly deliveryRef: string;
142
+ readonly consumerRef: string;
143
+ readonly targetScope: string;
144
+ readonly disposition: "RECEIVED" | "APPLIED" | "REJECTED" | "HOLD" | "UNKNOWN";
145
+ readonly recordedAt: string;
146
+ readonly revision: number;
147
+ readonly reasonCode?: string;
148
+ readonly resultRef?: {
149
+ readonly sourceSystem: string;
150
+ readonly resourceType: string;
151
+ readonly resourceId: string;
152
+ readonly revision: string;
153
+ readonly digest: string;
154
+ readonly evidenceRef?: string;
155
+ };
156
+ }>;
157
+ export declare const validateResultRef: (value: unknown) => import("./contract-error.js").ValidationResult<{
158
+ readonly sourceSystem: string;
159
+ readonly resourceType: string;
160
+ readonly resourceId: string;
161
+ readonly revision: string;
162
+ readonly digest: string;
163
+ readonly evidenceRef?: string;
164
+ }>;
165
+ export declare const validateTenantContext: (value: unknown) => import("./contract-error.js").ValidationResult<{
166
+ readonly serviceRef: string;
167
+ readonly tenantRef: string;
168
+ }>;
169
+ export declare const validateTenantConnection: (value: unknown) => import("./contract-error.js").ValidationResult<{
170
+ readonly connectionRef: string;
171
+ readonly version: number;
172
+ readonly local: {
173
+ readonly serviceRef: string;
174
+ readonly tenantRef: string;
175
+ };
176
+ readonly remote: {
177
+ readonly serviceRef: string;
178
+ readonly tenantRef: string;
179
+ };
180
+ readonly status: "ACTIVE" | "SUSPENDED" | "REVOKED";
181
+ readonly updatedAt: string;
182
+ readonly organizationRef?: string;
183
+ }>;
184
+ export declare const validateExchangeGrant: (value: unknown) => import("./contract-error.js").ValidationResult<{
185
+ readonly grantRef: string;
186
+ readonly version: number;
187
+ readonly connectionRef: string;
188
+ readonly direction: "OUTBOUND" | "INBOUND";
189
+ readonly status: "ACTIVE" | "SUSPENDED" | "REVOKED";
190
+ readonly eventTypes: readonly string[];
191
+ readonly audience: string;
192
+ readonly notBefore: string;
193
+ readonly expiresAt: string;
194
+ }>;
195
+ export declare const parseCloudEvent: (value: unknown) => CloudEvent;
196
+ export declare const parseBusinessReceipt: (value: unknown) => BusinessReceipt;
197
+ export declare const parseResultRef: (value: unknown) => ResultRef;
198
+ export declare const parseTenantContext: (value: unknown) => TenantContext;
199
+ export declare const parseTenantConnection: (value: unknown) => TenantConnection;
200
+ export declare const parseExchangeGrant: (value: unknown) => ExchangeGrant;
201
+ export declare const parseNamespacedReference: (value: unknown) => NamespacedReference;
202
+ export declare const parseIdentityContext: (value: unknown) => IdentityContext;
203
+ export declare const validateCloudEventV12: (value: unknown) => import("./contract-error.js").ValidationResult<{
204
+ readonly specversion: "1.0";
205
+ readonly id: string;
206
+ readonly source: string;
207
+ readonly type: string;
208
+ readonly time: string;
209
+ readonly dataschema: string;
210
+ readonly datacontenttype: "application/json";
211
+ readonly profile: "eventsdk/1.2";
212
+ readonly kind: "EVENT";
213
+ readonly serviceorigin: string;
214
+ readonly sourcetenant: string;
215
+ readonly audience: string;
216
+ readonly connectionref: string;
217
+ readonly grantref: string;
218
+ readonly grantversion: number;
219
+ readonly correlationid: string;
220
+ readonly causationid?: string;
221
+ readonly subject?: string;
222
+ readonly data: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
223
+ readonly [x: string]: string | number | boolean | any | any | null;
224
+ } | null)[] | {
225
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null;
226
+ } | null)[] | {
227
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null;
228
+ } | null)[] | {
229
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null;
230
+ } | null)[] | {
231
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
232
+ } | null)[] | {
233
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
234
+ } | null)[] | {
235
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
236
+ } | null)[] | {
237
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
238
+ } | null)[] | {
239
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
240
+ } | null)[] | {
241
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
242
+ } | null)[] | {
243
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
244
+ } | null)[] | {
245
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
246
+ } | null;
247
+ readonly orgnamespace?: string;
248
+ readonly orgref?: string;
249
+ readonly projectnamespace?: string;
250
+ readonly projectref?: string;
251
+ readonly principalnamespace?: string;
252
+ readonly principalref?: string;
253
+ readonly resourcenamespace?: string;
254
+ readonly resourceref?: string;
255
+ readonly deliveryid: string;
256
+ }>;
257
+ export declare const validateFanoutEventDraft: (value: unknown) => import("./contract-error.js").ValidationResult<{
258
+ readonly specversion: "1.0";
259
+ readonly id: string;
260
+ readonly source: string;
261
+ readonly type: string;
262
+ readonly time: string;
263
+ readonly dataschema: string;
264
+ readonly datacontenttype: "application/json";
265
+ readonly profile: "eventsdk/1.2";
266
+ readonly kind: "EVENT";
267
+ readonly serviceorigin: string;
268
+ readonly sourcetenant: string;
269
+ readonly correlationid: string;
270
+ readonly causationid?: string;
271
+ readonly subject?: string;
272
+ readonly data: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | {
273
+ readonly [x: string]: string | number | boolean | any | any | null;
274
+ } | null)[] | {
275
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null;
276
+ } | null)[] | {
277
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null;
278
+ } | null)[] | {
279
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null;
280
+ } | null)[] | {
281
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
282
+ } | null)[] | {
283
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
284
+ } | null)[] | {
285
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
286
+ } | null)[] | {
287
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
288
+ } | null)[] | {
289
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
290
+ } | null)[] | {
291
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
292
+ } | null)[] | {
293
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
294
+ } | null)[] | {
295
+ readonly [x: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | any | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null)[] | any | null;
296
+ } | null;
297
+ readonly orgnamespace?: string;
298
+ readonly orgref?: string;
299
+ readonly projectnamespace?: string;
300
+ readonly projectref?: string;
301
+ readonly principalnamespace?: string;
302
+ readonly principalref?: string;
303
+ readonly resourcenamespace?: string;
304
+ readonly resourceref?: string;
305
+ }>;
306
+ export declare const parseFanoutEventDraft: (value: unknown) => FanoutEventDraft;
307
+ export declare const validateEventOriginClaims: (value: unknown) => import("./contract-error.js").ValidationResult<EventOriginClaims>;
308
+ export declare const parseEventOriginClaims: (value: unknown) => EventOriginClaims;
309
+ export declare const validateNodeConnectionProfile: (value: unknown) => import("./contract-error.js").ValidationResult<NodeConnectionProfile>;
310
+ export declare const parseNodeConnectionProfile: (value: unknown) => NodeConnectionProfile;
311
+ export declare const validatePublicJwksSnapshot: (value: unknown) => import("./contract-error.js").ValidationResult<PublicJwksSnapshot>;
312
+ export declare const parsePublicJwksSnapshot: (value: unknown) => PublicJwksSnapshot;
313
+ export declare const validateExchangeRegistration: (value: unknown) => import("./contract-error.js").ValidationResult<ExchangeRegistration>;
314
+ export declare const parseExchangeRegistration: (value: unknown) => ExchangeRegistration;
315
+ export declare const parseGapBaseline: (value: unknown) => GapBaseline;
316
+ export declare const parseGapRecoveryCommand: (value: unknown) => GapRecoveryCommand;
@@ -0,0 +1,2 @@
1
+ import type { CloudEvent } from '../contract-types.js';
2
+ export declare function decodeCloudEvent(input: string | Uint8Array): CloudEvent;
@@ -0,0 +1,9 @@
1
+ import type { EventLinkAuthorizationRequest } from '../generated/event-link-authorization-request.js';
2
+ import type { EventLinkTokenRequest } from '../generated/event-link-token-request.js';
3
+ import type { EventLinkProposal } from '../generated/event-link-proposal.js';
4
+ export declare const validateEventLinkAuthorizationRequest: (value: unknown) => import("./contract-error.js").ValidationResult<EventLinkAuthorizationRequest>;
5
+ export declare const validateEventLinkTokenRequest: (value: unknown) => import("./contract-error.js").ValidationResult<EventLinkTokenRequest>;
6
+ export declare const validateEventLinkProposal: (value: unknown) => import("./contract-error.js").ValidationResult<EventLinkProposal>;
7
+ export declare const parseEventLinkAuthorizationRequest: (value: unknown) => EventLinkAuthorizationRequest;
8
+ export declare const parseEventLinkTokenRequest: (value: unknown) => EventLinkTokenRequest;
9
+ export declare const parseEventLinkProposal: (value: unknown) => EventLinkProposal;
@@ -0,0 +1,3 @@
1
+ import type { IdentityContext } from '../contract-types.js';
2
+ export declare function extractIdentityContext(input: unknown): IdentityContext;
3
+ export declare function assertWireGrantVersion(version: number): void;
@@ -0,0 +1,3 @@
1
+ export declare const EVENTSDK_ORIGIN_PROOF_HEADER = "EventSDK-Origin-Proof";
2
+ export declare const EVENTSDK_ORIGIN_PROOF_TYPE = "eventsdk-origin+jws";
3
+ export declare function isEventOriginProofWireForm(value: unknown): value is string;
@@ -0,0 +1 @@
1
+ export declare function parseJsonStrict(input: string | Uint8Array): unknown;
@@ -0,0 +1,26 @@
1
+ import { type BusinessReceipt } from '@eventsdk/sdk/contracts';
2
+ import type { AuthorizationPort, VerifiedOrigin } from '@eventsdk/sdk/identity-contracts';
3
+ import type { InboxAdmissionPort } from '../ports/inbox.js';
4
+ import type { Clock, Digest, IdGenerator, OperationOptions } from '../runtime/dependencies.js';
5
+ export interface DeliveryInput {
6
+ readonly event: unknown;
7
+ readonly origin: VerifiedOrigin;
8
+ readonly deliveryRef: string;
9
+ readonly consumerRef: string;
10
+ }
11
+ export interface AdmissionDependencies {
12
+ readonly audience: string;
13
+ readonly inbox: InboxAdmissionPort;
14
+ readonly authorization: AuthorizationPort;
15
+ readonly clock: Clock;
16
+ readonly ids: IdGenerator;
17
+ readonly digest: Digest;
18
+ }
19
+ export type DurableAdmission = {
20
+ readonly kind: 'RECEIVED' | 'DUPLICATE';
21
+ readonly receipt: BusinessReceipt;
22
+ } | {
23
+ readonly kind: 'REJECTED';
24
+ readonly reasonCode: string;
25
+ };
26
+ export declare function acceptDelivery(input: DeliveryInput, deps: AdmissionDependencies, options: OperationOptions): Promise<DurableAdmission>;
@@ -0,0 +1,29 @@
1
+ import { type BusinessReceipt, type ResultRef } from '@eventsdk/sdk/contracts';
2
+ import type { AuthorizationDecision, AuthorizationPort, AuthorizationRequest } from '@eventsdk/sdk/identity-contracts';
3
+ import type { ClaimedInbox, InboxApplyPort } from '../ports/inbox.js';
4
+ import type { ResultReadPort, ResultSnapshot } from '../ports/result-reader.js';
5
+ import type { Clock, Digest, OperationOptions } from '../runtime/dependencies.js';
6
+ import type { OriginRefreshPort } from '../ports/origin-refresh.js';
7
+ import type { DomainApplyResult } from './domain-apply-result.js';
8
+ export type { DomainApplyResult } from './domain-apply-result.js';
9
+ export interface ApplyAuthorizationPort<TTransaction> {
10
+ authorizeInTransaction(tx: TTransaction, request: AuthorizationRequest): Promise<AuthorizationDecision>;
11
+ }
12
+ export interface DomainApplyPort<TTransaction> {
13
+ apply(tx: TTransaction, claim: ClaimedInbox, snapshot: ResultSnapshot | undefined, signal: AbortSignal): Promise<void | DomainApplyResult>;
14
+ }
15
+ export interface ApplyDependencies<TTransaction> {
16
+ readonly inbox: InboxApplyPort<TTransaction>;
17
+ readonly authorization: ApplyAuthorizationPort<TTransaction>;
18
+ readonly domain: DomainApplyPort<TTransaction>;
19
+ readonly clock: Clock;
20
+ readonly digest: Digest;
21
+ readonly originRefresh?: OriginRefreshPort;
22
+ }
23
+ export interface ApplyReadback {
24
+ readonly reference: ResultRef;
25
+ readonly reader: ResultReadPort;
26
+ readonly authorization: AuthorizationPort;
27
+ readonly digest: Digest;
28
+ }
29
+ export declare function applyDelivery<T>(claim: ClaimedInbox, deps: ApplyDependencies<T>, options: OperationOptions, readback?: ApplyReadback): Promise<BusinessReceipt>;
@@ -0,0 +1,13 @@
1
+ import { type ResultRef } from '@eventsdk/sdk/contracts';
2
+ export interface LegacyDomainApplyResult {
3
+ readonly resultRef?: ResultRef;
4
+ }
5
+ export type DomainApplyOutcome = {
6
+ readonly disposition: 'APPLIED';
7
+ readonly resultRef?: ResultRef;
8
+ } | {
9
+ readonly disposition: 'REJECTED' | 'HOLD';
10
+ readonly reasonCode: string;
11
+ };
12
+ export type DomainApplyResult = LegacyDomainApplyResult | DomainApplyOutcome;
13
+ export declare function normalizeDomainApplyResult(value: unknown): DomainApplyOutcome;
@@ -0,0 +1,2 @@
1
+ import type { InboxWorkerDependencies, InboxWorkerOptions, InboxWorkerSummary } from './worker-types.js';
2
+ export declare function runInboxWorker<T>(deps: InboxWorkerDependencies<T>, options: InboxWorkerOptions): Promise<InboxWorkerSummary>;
@@ -0,0 +1,12 @@
1
+ import { type CloudEvent, type ResultRef } from '@eventsdk/sdk/contracts';
2
+ import type { AuthorizationPort, VerifiedOrigin } from '@eventsdk/sdk/identity-contracts';
3
+ import type { ResultReadPort, ResultSnapshot } from '../ports/result-reader.js';
4
+ import type { Clock, Digest } from '../runtime/dependencies.js';
5
+ export interface ResultReadRequest {
6
+ readonly reference: ResultRef;
7
+ readonly event: CloudEvent;
8
+ readonly origin: VerifiedOrigin;
9
+ readonly consumerRef: string;
10
+ readonly targetScope: string;
11
+ }
12
+ export declare function readAuthorizedResult(request: ResultReadRequest, reader: ResultReadPort, authorization: AuthorizationPort, digest: Digest, signal: AbortSignal, clock: Clock): Promise<ResultSnapshot>;
@@ -0,0 +1,21 @@
1
+ import type { BusinessReceipt } from '@eventsdk/sdk/contracts';
2
+ import type { DeadLetterPort, InboxWorkClaim, InboxWorkPort } from '../ports/dead-letter.js';
3
+ import type { InboxApplyPort } from '../ports/inbox.js';
4
+ import type { Clock, IdGenerator, OperationOptions, Random } from '../runtime/dependencies.js';
5
+ import type { RetryPolicy } from '../runtime/retry.js';
6
+ export interface InboxWorkerDependencies<TTransaction> {
7
+ readonly work: InboxWorkPort;
8
+ readonly receipts: Pick<InboxApplyPort<TTransaction>, 'readReceipt'>;
9
+ readonly deadLetters: DeadLetterPort<TTransaction>;
10
+ readonly clock: Clock;
11
+ readonly ids: IdGenerator;
12
+ readonly random: Random;
13
+ readonly process: (claim: InboxWorkClaim, options: OperationOptions) => Promise<BusinessReceipt>;
14
+ }
15
+ export interface InboxWorkerOptions extends OperationOptions {
16
+ readonly batchSize: number;
17
+ readonly leaseMs: number;
18
+ readonly retry: RetryPolicy;
19
+ }
20
+ export type InboxWorkOutcome = 'APPLIED' | 'REJECTED' | 'RETRY' | 'QUARANTINED' | 'UNRESOLVED';
21
+ export type InboxWorkerSummary = Readonly<Record<InboxWorkOutcome, number>>;
@@ -0,0 +1,50 @@
1
+ export { CoreError, assertNotAborted } from './runtime/errors.js';
2
+ export type { CoreErrorCode } from './runtime/errors.js';
3
+ export type { Clock, IdGenerator, Digest, Random, OperationOptions, MetricSink, } from './runtime/dependencies.js';
4
+ export { boundedOperation } from './runtime/operation.js';
5
+ export { assertLiveLease } from './runtime/lease.js';
6
+ export type { Lease } from './runtime/lease.js';
7
+ export { decideRetry } from './runtime/retry.js';
8
+ export type { RetryPolicy, RetryDecision } from './runtime/retry.js';
9
+ export { eventMessageId, eventDigest, inboxKey } from './runtime/event-identity.js';
10
+ export type { EventIdentity, InboxKey } from './runtime/event-identity.js';
11
+ export type { PublishPort, PublishAck, PublishContext } from './ports/transport.js';
12
+ export type { OutboxRecordPort, OutboxRelayPort, OutboxPort, OutboxRecord, ClaimedEvent, PublishOutcome, } from './ports/outbox.js';
13
+ export type { InboxAdmissionPort, InboxApplyPort, AcceptedEvent, PersistResult, QuarantineRecord, ClaimedInbox, } from './ports/inbox.js';
14
+ export type { ResultReadPort, ResultSnapshot } from './ports/result-reader.js';
15
+ export { recordEvent } from './outbox/record-event.js';
16
+ export type { RecordDependencies } from './outbox/record-event.js';
17
+ export { relayOutbox } from './outbox/outbox-relay.js';
18
+ export type { RelayDependencies, RelayOptions, RelaySummary } from './outbox/outbox-relay.js';
19
+ export { acceptDelivery } from './inbox/accept-delivery.js';
20
+ export type { DeliveryInput, AdmissionDependencies, DurableAdmission, } from './inbox/accept-delivery.js';
21
+ export { applyDelivery } from './inbox/apply-delivery.js';
22
+ export type { ApplyAuthorizationPort, DomainApplyPort, DomainApplyResult, ApplyDependencies, ApplyReadback, } from './inbox/apply-delivery.js';
23
+ export { readAuthorizedResult } from './inbox/read-result.js';
24
+ export type { ResultReadRequest } from './inbox/read-result.js';
25
+ export { assertReceiptTransition, classifyReceiptCommit } from './receipt/receipt-state.js';
26
+ export { recoverReceipt } from './recovery/receipt-recovery.js';
27
+ export { recoverReceiptByIdentity } from './recovery/receipt-identity-recovery.js';
28
+ export type { ReceiptIdentityLookupPort } from './recovery/receipt-identity-recovery.js';
29
+ export type { ReceiptLookupPort, RecoveryObservation } from './recovery/receipt-recovery.js';
30
+ export { stageEventLogPage } from './recovery/event-log.js';
31
+ export type { EventLogItem, EventLogPage, NativeEventLogPort, EventLogCheckpointPort, } from './recovery/event-log.js';
32
+ export { recoverGap } from './recovery/gap-recovery.js';
33
+ export type { AuthorizedSnapshot, SnapshotRecoveryPort } from './recovery/gap-recovery.js';
34
+ export type { DeadLetterEntry, DeadLetterPort, InboxWorkPort } from './ports/dead-letter.js';
35
+ export { replayDeadLetter } from './recovery/replay-dead-letter.js';
36
+ export type { OriginRefreshPort } from './ports/origin-refresh.js';
37
+ export type { DeliveryHealth, DeliveryHealthPort, HealthMetricSink, } from './ports/observability.js';
38
+ export { observeDeliveryHealth } from './runtime/observe-health.js';
39
+ export type { InboxWorkClaim } from './ports/dead-letter.js';
40
+ export type { InboxWorkerDependencies, InboxWorkerOptions, InboxWorkerSummary, InboxWorkOutcome, } from './inbox/worker-types.js';
41
+ export { runInboxWorker } from './inbox/inbox-worker.js';
42
+ export type { DomainApplyOutcome, LegacyDomainApplyResult } from './inbox/domain-apply-result.js';
43
+ export { deriveDeliveryId, logicalEventDigest, fanoutLogicalEvent, assertDeliveryIdentity, } from './runtime/fanout-identity.js';
44
+ export { recordFanoutEvent, prepareFanoutDelivery } from './outbox/record-fanout.js';
45
+ export type { FanoutRoute, FanoutRecipient } from './outbox/record-fanout.js';
46
+ export type { FanoutOutboxRecord } from './ports/outbox.js';
47
+ export type { FanoutAcceptedEvent } from './ports/inbox.js';
48
+ export { deriveExchangeConnectionRef } from './runtime/exchange-connection.js';
49
+ export { authorizeOutboxRecovery, type HeldOutboxRecord } from './outbox/authorize-recovery.js';
50
+ export { assertGapBaselineBinding } from './recovery/gap-baseline-binding.js';