@fantastic.dev/better-stripe 0.110.0 → 0.112.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 (134) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/observation/freshActor.d.ts +564 -0
  4. package/dist/client/billing/renewalAttach/internal/observation/freshActor.d.ts.map +1 -1
  5. package/dist/client/billing/renewalAttach/internal/observation/freshActor.js +103 -21
  6. package/dist/client/billing/renewalAttach/internal/observation/freshActor.js.map +1 -1
  7. package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts +18 -1
  8. package/dist/client/billing/renewalAttach/internal/observation/freshTransport.d.ts.map +1 -1
  9. package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js +54 -1
  10. package/dist/client/billing/renewalAttach/internal/observation/freshTransport.js.map +1 -1
  11. package/dist/client/billing/renewalAttach/internal/observation/invocation.d.ts +4 -0
  12. package/dist/client/billing/renewalAttach/internal/observation/invocation.d.ts.map +1 -1
  13. package/dist/client/billing/renewalAttach/internal/observation/invocation.js +1 -0
  14. package/dist/client/billing/renewalAttach/internal/observation/invocation.js.map +1 -1
  15. package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.d.ts +4 -0
  16. package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.d.ts.map +1 -1
  17. package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.js +6 -1
  18. package/dist/client/billing/renewalAttach/internal/observation/readerAuthorization.js.map +1 -1
  19. package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.d.ts +38 -0
  20. package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.d.ts.map +1 -0
  21. package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.js +172 -0
  22. package/dist/client/billing/renewalAttach/internal/observation/witnessAuthorization.js.map +1 -0
  23. package/dist/client/billing/renewalAttach/internal/observation/witnessData.d.ts +135 -0
  24. package/dist/client/billing/renewalAttach/internal/observation/witnessData.d.ts.map +1 -0
  25. package/dist/client/billing/renewalAttach/internal/observation/witnessData.js +143 -0
  26. package/dist/client/billing/renewalAttach/internal/observation/witnessData.js.map +1 -0
  27. package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.d.ts +85 -0
  28. package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.d.ts.map +1 -0
  29. package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.js +121 -0
  30. package/dist/client/billing/renewalAttach/internal/observation/witnessOperation.js.map +1 -0
  31. package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.d.ts +44 -0
  32. package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.d.ts.map +1 -0
  33. package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.js +4 -0
  34. package/dist/client/billing/renewalAttach/internal/operations/witnessProfiles.js.map +1 -0
  35. package/dist/client/billing/renewalAttach/internal/producer/configureJournalWork.d.ts +1 -1
  36. package/dist/client/billing/renewalAttach/internal/producer/configureLineage.d.ts +21 -21
  37. package/dist/client/billing/renewalAttach/internal/producer/journalWorkFactory.d.ts +3 -3
  38. package/dist/client/billing/renewalAttach/internal/producer/operationFactory.d.ts +1 -1
  39. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +84 -32
  40. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  41. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +26 -0
  42. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  43. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +84 -32
  44. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  45. package/dist/client/connect/payoutSyncTestHelpers.d.ts +26 -0
  46. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  47. package/dist/component/_generated/api.d.ts +24 -0
  48. package/dist/component/_generated/api.d.ts.map +1 -1
  49. package/dist/component/_generated/api.js.map +1 -1
  50. package/dist/component/_generated/component.d.ts +94 -10
  51. package/dist/component/_generated/component.d.ts.map +1 -1
  52. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  53. package/dist/component/balanceFunding/mutations.d.ts +16 -16
  54. package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
  55. package/dist/component/balanceFunding/queries.d.ts +1 -1
  56. package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
  57. package/dist/component/earnings/triggers.d.ts +44 -0
  58. package/dist/component/earnings/triggers.d.ts.map +1 -1
  59. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  60. package/dist/component/renewalWitnesses/eligibility.d.ts +36 -0
  61. package/dist/component/renewalWitnesses/eligibility.d.ts.map +1 -0
  62. package/dist/component/renewalWitnesses/eligibility.js +60 -0
  63. package/dist/component/renewalWitnesses/eligibility.js.map +1 -0
  64. package/dist/component/renewalWitnesses/mutations.d.ts +45 -0
  65. package/dist/component/renewalWitnesses/mutations.d.ts.map +1 -0
  66. package/dist/component/renewalWitnesses/mutations.js +14 -0
  67. package/dist/component/renewalWitnesses/mutations.js.map +1 -0
  68. package/dist/component/renewalWitnesses/protocol.d.ts +75 -0
  69. package/dist/component/renewalWitnesses/protocol.d.ts.map +1 -0
  70. package/dist/component/renewalWitnesses/protocol.js +82 -0
  71. package/dist/component/renewalWitnesses/protocol.js.map +1 -0
  72. package/dist/component/renewalWitnesses/queries.d.ts +39 -0
  73. package/dist/component/renewalWitnesses/queries.d.ts.map +1 -0
  74. package/dist/component/renewalWitnesses/queries.js +11 -0
  75. package/dist/component/renewalWitnesses/queries.js.map +1 -0
  76. package/dist/component/renewalWitnesses/schema.d.ts +99 -0
  77. package/dist/component/renewalWitnesses/schema.d.ts.map +1 -0
  78. package/dist/component/renewalWitnesses/schema.js +36 -0
  79. package/dist/component/renewalWitnesses/schema.js.map +1 -0
  80. package/dist/component/renewalWitnesses/source.d.ts +22 -0
  81. package/dist/component/renewalWitnesses/source.d.ts.map +1 -0
  82. package/dist/component/renewalWitnesses/source.js +108 -0
  83. package/dist/component/renewalWitnesses/source.js.map +1 -0
  84. package/dist/component/schema.d.ts +42 -16
  85. package/dist/component/schema.js +2 -0
  86. package/dist/component/schema.js.map +1 -1
  87. package/dist/component/usage/allowance.fixtures.d.ts +42 -16
  88. package/dist/component/usage/allowance.fixtures.d.ts.map +1 -1
  89. package/dist/component/usageCredits/accounting.fixtures.d.ts +26 -0
  90. package/dist/component/usageCredits/accounting.fixtures.d.ts.map +1 -1
  91. package/dist/shared/renewalWitness.d.ts +51 -0
  92. package/dist/shared/renewalWitness.d.ts.map +1 -0
  93. package/dist/shared/renewalWitness.js +127 -0
  94. package/dist/shared/renewalWitness.js.map +1 -0
  95. package/docs/renewal-witness-protocol.md +139 -0
  96. package/package.json +1 -1
  97. package/src/client/billing/renewalAttach/internal/observation/freshActor.ts +142 -19
  98. package/src/client/billing/renewalAttach/internal/observation/freshTransport.ts +90 -1
  99. package/src/client/billing/renewalAttach/internal/observation/invocation.ts +2 -0
  100. package/src/client/billing/renewalAttach/internal/observation/readerAuthorization.ts +6 -1
  101. package/src/client/billing/renewalAttach/internal/observation/witnessAcquisition.integration.test.ts +348 -0
  102. package/src/client/billing/renewalAttach/internal/observation/witnessActor.integration.test.ts +204 -0
  103. package/src/client/billing/renewalAttach/internal/observation/witnessAuthorization.ts +239 -0
  104. package/src/client/billing/renewalAttach/internal/observation/witnessCapabilities.integration.test.ts +231 -0
  105. package/src/client/billing/renewalAttach/internal/observation/witnessData.ts +189 -0
  106. package/src/client/billing/renewalAttach/internal/observation/witnessHistorical.integration.test.ts +98 -0
  107. package/src/client/billing/renewalAttach/internal/observation/witnessImmutable.integration.test.ts +78 -0
  108. package/src/client/billing/renewalAttach/internal/observation/witnessInvoice.integration.test.ts +85 -0
  109. package/src/client/billing/renewalAttach/internal/observation/witnessLifecycle.integration.test.ts +264 -0
  110. package/src/client/billing/renewalAttach/internal/observation/witnessOperation.ts +205 -0
  111. package/src/client/billing/renewalAttach/internal/observation/witnessProfile.integration.test.ts +93 -0
  112. package/src/client/billing/renewalAttach/internal/observation/witnessRPCControls.integration.test.ts +256 -0
  113. package/src/client/billing/renewalAttach/internal/operations/witnessProfiles.ts +58 -0
  114. package/src/client/billing/renewalAttach/internal/test-fixtures/invoiceObservation.ts +3 -1
  115. package/src/client/billing/renewalAttach/internal/test-fixtures/producerConfigureAdmission.ts +8 -0
  116. package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +18 -7
  117. package/src/client/billing/renewalAttach/internal/test-fixtures/witnessHistory.ts +70 -0
  118. package/src/client/billing/renewalAttach/internal/test-fixtures/witnessObservation.ts +353 -0
  119. package/src/component/_generated/api.ts +24 -0
  120. package/src/component/_generated/component.ts +98 -10
  121. package/src/component/renewalOperations/configureJournal.fixtures.ts +25 -3
  122. package/src/component/renewalWitnesses/bounds.test.ts +204 -0
  123. package/src/component/renewalWitnesses/codec.test.ts +84 -0
  124. package/src/component/renewalWitnesses/controls.test.ts +250 -0
  125. package/src/component/renewalWitnesses/eligibility.ts +78 -0
  126. package/src/component/renewalWitnesses/mutations.ts +17 -0
  127. package/src/component/renewalWitnesses/protocol.test.ts +63 -0
  128. package/src/component/renewalWitnesses/protocol.ts +103 -0
  129. package/src/component/renewalWitnesses/queries.ts +11 -0
  130. package/src/component/renewalWitnesses/routes.test.ts +154 -0
  131. package/src/component/renewalWitnesses/schema.ts +36 -0
  132. package/src/component/renewalWitnesses/source.ts +157 -0
  133. package/src/component/schema.ts +2 -0
  134. package/src/shared/renewalWitness.ts +179 -0
@@ -9,17 +9,6 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
9
9
  stripeSubscriptionId: string;
10
10
  version: number;
11
11
  }, Promise<{
12
- status: "ready";
13
- value: {
14
- customerAccount: string;
15
- enabled?: boolean | undefined;
16
- paymentMethodId: string | null;
17
- paymentMethodTypes?: string[] | null | undefined;
18
- phase: "apply" | "attach" | "create";
19
- providerApiVersion: string;
20
- stripeSubscriptionId: string;
21
- };
22
- } | {
23
12
  reason: "history_incomplete" | "provider_outcome_unknown";
24
13
  retryable: false;
25
14
  status: "unknown";
@@ -35,5 +24,16 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
35
24
  reason: "provider_pending";
36
25
  retryable: true;
37
26
  status: "not_ready";
27
+ } | {
28
+ status: "ready";
29
+ value: {
30
+ customerAccount: string;
31
+ enabled?: boolean | undefined;
32
+ paymentMethodId: string | null;
33
+ paymentMethodTypes?: string[] | null | undefined;
34
+ phase: "apply" | "attach" | "create";
35
+ providerApiVersion: string;
36
+ stripeSubscriptionId: string;
37
+ };
38
38
  }>>;
39
39
  //# sourceMappingURL=actions.d.ts.map
@@ -22,14 +22,6 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
22
22
  requestKey: string;
23
23
  scopeKey: string;
24
24
  }, Promise<{
25
- reason: "identity_changed" | "revision_changed" | "scope_busy";
26
- retryable: false;
27
- status: "conflict";
28
- } | {
29
- reason: "policy_invalid";
30
- retryable: false;
31
- status: "rejected";
32
- } | {
33
25
  operation: {
34
26
  accountId: string;
35
27
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -40,6 +32,14 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
40
32
  } | {
41
33
  enabled: boolean;
42
34
  status: "unchanged";
35
+ } | {
36
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
37
+ retryable: false;
38
+ status: "conflict";
39
+ } | {
40
+ reason: "policy_invalid";
41
+ retryable: false;
42
+ status: "rejected";
43
43
  } | {
44
44
  reason: "provider_pending";
45
45
  retryable: true;
@@ -395,14 +395,6 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
395
395
  requestKey: string;
396
396
  scopeKey: string;
397
397
  }, Promise<{
398
- reason: "identity_changed" | "revision_changed" | "scope_busy";
399
- retryable: false;
400
- status: "conflict";
401
- } | {
402
- reason: "policy_invalid";
403
- retryable: false;
404
- status: "rejected";
405
- } | {
406
398
  operation: {
407
399
  accountId: string;
408
400
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -413,6 +405,14 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
413
405
  } | {
414
406
  enabled: boolean;
415
407
  status: "unchanged";
408
+ } | {
409
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
410
+ retryable: false;
411
+ status: "conflict";
412
+ } | {
413
+ reason: "policy_invalid";
414
+ retryable: false;
415
+ status: "rejected";
416
416
  } | {
417
417
  reason: "provider_pending";
418
418
  retryable: true;
@@ -2,6 +2,14 @@ import type { Infer } from "convex/values";
2
2
  import type { MutationCtx } from "../_generated/server.js";
3
3
  import { prepareArgs, finishPreparationArgs } from "./mutationValidators.js";
4
4
  export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prepareArgs>): Promise<{
5
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
6
+ retryable: false;
7
+ status: "conflict";
8
+ } | {
9
+ reason: "policy_invalid";
10
+ retryable: false;
11
+ status: "rejected";
12
+ } | {
5
13
  operation: {
6
14
  accountId: string;
7
15
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -12,14 +20,6 @@ export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prep
12
20
  } | {
13
21
  enabled: boolean;
14
22
  status: "unchanged";
15
- } | {
16
- reason: "identity_changed" | "revision_changed" | "scope_busy";
17
- retryable: false;
18
- status: "conflict";
19
- } | {
20
- reason: "policy_invalid";
21
- retryable: false;
22
- status: "rejected";
23
23
  } | {
24
24
  reason: "provider_pending";
25
25
  retryable: true;
@@ -180,11 +180,11 @@ export declare const findPreparationOperation: import("convex/server").Registere
180
180
  retryable: false;
181
181
  } | {
182
182
  reason?: undefined;
183
+ retryable?: undefined;
183
184
  accountId: string;
184
185
  scopeKey: string;
185
186
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
186
187
  version: number;
187
- retryable?: undefined;
188
188
  status?: undefined;
189
189
  state: "canceled" | "failed" | "pending" | "running" | "succeeded" | "unknown";
190
190
  cancelRequested: boolean;
@@ -60,22 +60,6 @@ export declare const phaseRef: import("convex/values").VObject<{
60
60
  }, "required", "accountId" | "definitionVersion" | "operationId" | "phase" | "providerApiVersion" | "providerKey" | "scopeKey" | "stripeSubscriptionId" | "version">;
61
61
  export type FundingPhaseRef = Infer<typeof phaseRef>;
62
62
  export declare const workflowStartResult: import("convex/values").VUnion<{
63
- reason: "history_incomplete" | "provider_outcome_unknown";
64
- retryable: false;
65
- status: "unknown";
66
- } | {
67
- reason: "identity_changed" | "revision_changed" | "scope_busy";
68
- retryable: false;
69
- status: "conflict";
70
- } | {
71
- reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
72
- retryable: false;
73
- status: "rejected";
74
- } | {
75
- reason: "provider_pending";
76
- retryable: true;
77
- status: "not_ready";
78
- } | {
79
63
  operation: {
80
64
  accountId: string;
81
65
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -92,6 +76,22 @@ export declare const workflowStartResult: import("convex/values").VUnion<{
92
76
  version: number;
93
77
  };
94
78
  status: "canceled";
79
+ } | {
80
+ reason: "history_incomplete" | "provider_outcome_unknown";
81
+ retryable: false;
82
+ status: "unknown";
83
+ } | {
84
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
85
+ retryable: false;
86
+ status: "conflict";
87
+ } | {
88
+ reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
89
+ retryable: false;
90
+ status: "rejected";
91
+ } | {
92
+ reason: "provider_pending";
93
+ retryable: true;
94
+ status: "not_ready";
95
95
  }, [import("convex/values").VObject<{
96
96
  operation: {
97
97
  accountId: string;
@@ -2005,6 +2005,28 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2005
2005
  searchIndexes: {};
2006
2006
  vectorIndexes: {};
2007
2007
  };
2008
+ renewalObservationWitnesses: {
2009
+ document: {
2010
+ _creationTime: number;
2011
+ _id: import("convex/values").GenericId<"renewalObservationWitnesses">;
2012
+ identity: {
2013
+ componentScope: string;
2014
+ operationId: import("convex/values").GenericId<"renewalOperations">;
2015
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
2016
+ witnessId: string;
2017
+ };
2018
+ payloadBinding: string;
2019
+ payloadJSON: string;
2020
+ };
2021
+ fieldPaths: "_id" | ("_creationTime" | "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "payloadBinding" | "payloadJSON");
2022
+ indexes: {
2023
+ by_id: ["_id"];
2024
+ by_creation_time: ["_creationTime"];
2025
+ by_componentScope_and_witnessId: ["identity.componentScope", "identity.witnessId", "_creationTime"];
2026
+ };
2027
+ searchIndexes: {};
2028
+ vectorIndexes: {};
2029
+ };
2008
2030
  renewalOperationAttempts: {
2009
2031
  document: {
2010
2032
  _creationTime: number;
@@ -5050,6 +5072,28 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
5050
5072
  searchIndexes: {};
5051
5073
  vectorIndexes: {};
5052
5074
  };
5075
+ renewalObservationWitnesses: {
5076
+ document: {
5077
+ _creationTime: number;
5078
+ _id: import("convex/values").GenericId<"renewalObservationWitnesses">;
5079
+ identity: {
5080
+ componentScope: string;
5081
+ operationId: import("convex/values").GenericId<"renewalOperations">;
5082
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
5083
+ witnessId: string;
5084
+ };
5085
+ payloadBinding: string;
5086
+ payloadJSON: string;
5087
+ };
5088
+ fieldPaths: "_id" | ("_creationTime" | "identity" | "identity.componentScope" | "identity.operationId" | "identity.parentOperationId" | "identity.witnessId" | "payloadBinding" | "payloadJSON");
5089
+ indexes: {
5090
+ by_id: ["_id"];
5091
+ by_creation_time: ["_creationTime"];
5092
+ by_componentScope_and_witnessId: ["identity.componentScope", "identity.witnessId", "_creationTime"];
5093
+ };
5094
+ searchIndexes: {};
5095
+ vectorIndexes: {};
5096
+ };
5053
5097
  renewalOperationAttempts: {
5054
5098
  document: {
5055
5099
  _creationTime: number;
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAA0D,CAAC"}
@@ -9,9 +9,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
9
9
  orgId: string | undefined;
10
10
  ownershipStatus: "ambiguous";
11
11
  } | {
12
- registrationId?: undefined;
13
12
  userId?: undefined;
14
13
  orgId?: undefined;
14
+ registrationId?: undefined;
15
15
  ownershipStatus: "ambiguous";
16
16
  } | {
17
17
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -19,9 +19,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
19
19
  orgId: string | undefined;
20
20
  ownershipStatus: "unknown";
21
21
  } | {
22
- registrationId?: undefined;
23
22
  userId?: undefined;
24
23
  orgId?: undefined;
24
+ registrationId?: undefined;
25
25
  ownershipStatus: "unknown";
26
26
  } | {
27
27
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -29,9 +29,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
29
29
  orgId: string | undefined;
30
30
  ownershipStatus: "contradictory";
31
31
  } | {
32
- registrationId?: undefined;
33
32
  userId?: undefined;
34
33
  orgId?: undefined;
34
+ registrationId?: undefined;
35
35
  ownershipStatus: "contradictory";
36
36
  } | {
37
37
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -0,0 +1,36 @@
1
+ import type { QueryCtx } from "../_generated/server.js";
2
+ import { type WitnessPayload } from "../../shared/renewalWitness.js";
3
+ /** Full material and exact source qualify unsigned storage DATA, not provider provenance. */
4
+ export declare function validateWitness(ctx: Pick<QueryCtx, "db">, raw: string): Promise<{
5
+ payload: Readonly<{
6
+ json: string;
7
+ value: WitnessPayload;
8
+ }>;
9
+ fields: {
10
+ version: 1;
11
+ identity: {
12
+ componentScope: string;
13
+ witnessId: string;
14
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
15
+ operationId: import("convex/values").GenericId<"renewalOperations">;
16
+ };
17
+ capturedSubject: string;
18
+ observedAtMs: number;
19
+ customerAccountId: string;
20
+ customerId: string;
21
+ livemode: boolean;
22
+ subscriptionId: string;
23
+ scheduleId: string;
24
+ observedItemId: string;
25
+ nativePeriod: Readonly<{
26
+ start: number;
27
+ end: number;
28
+ }>;
29
+ operationalAuthority: false;
30
+ authenticationEstablished: false;
31
+ publicDeliveryEstablished: false;
32
+ providerQualificationRequired: true;
33
+ };
34
+ payloadBinding: string;
35
+ }>;
36
+ //# sourceMappingURL=eligibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/eligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAC;AAkBxC,6FAA6F;AAC7F,wBAAsB,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM;;;;;;iBAwB/D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GA4Bb"}
@@ -0,0 +1,60 @@
1
+ import { inspectRenewalEvidenceV1 } from "../../client/billing/renewalObservation/evidence-v1.js";
2
+ import { canonicalWitnessJSON, witnessNeed as need, } from "../../shared/renewalWitness.js";
3
+ import { validateWitnessSource } from "./source.js";
4
+ function configureInput(value, configuration, dispatch) {
5
+ const known = value.source.configure.acknowledgement;
6
+ return known === null
7
+ ? null
8
+ : {
9
+ configuration,
10
+ actualDispatch: dispatch,
11
+ providerSnapshot: known.receipt.providerSnapshot,
12
+ transport: known.receipt.transport,
13
+ };
14
+ }
15
+ /** Full material and exact source qualify unsigned storage DATA, not provider provenance. */
16
+ export async function validateWitness(ctx, raw) {
17
+ const payload = canonicalWitnessJSON(raw);
18
+ const source = await validateWitnessSource(ctx, payload.value);
19
+ const evidence = await inspectRenewalEvidenceV1({
20
+ version: 1,
21
+ apiVersion: "2026-09-30.endive",
22
+ configuration: source.configuration,
23
+ configureReceipt: configureInput(payload.value, source.configuration, source.dispatch),
24
+ reads: payload.value.reads,
25
+ invoiceContext: payload.value.invoiceContext,
26
+ historicalSnapshot: null,
27
+ });
28
+ need(evidence.identity &&
29
+ evidence.currentMaterial.predicate === "current_target_material_match");
30
+ if (payload.value.invoiceContext !== null)
31
+ need(evidence.invoiceEvidence.predicate === "invoice_lines_correlated");
32
+ const { identity } = evidence;
33
+ const fields = {
34
+ version: 1,
35
+ identity: source.identity,
36
+ capturedSubject: payload.value.capturedSubject,
37
+ observedAtMs: payload.value.acquisition.observedAtMs,
38
+ customerAccountId: identity.customerAccountId,
39
+ customerId: identity.customerId,
40
+ livemode: identity.livemode,
41
+ subscriptionId: identity.subscriptionId,
42
+ scheduleId: identity.scheduleId,
43
+ observedItemId: evidence.currentMaterial.observedItemId,
44
+ nativePeriod: evidence.currentMaterial.nativePeriod,
45
+ operationalAuthority: false,
46
+ authenticationEstablished: false,
47
+ publicDeliveryEstablished: false,
48
+ providerQualificationRequired: true,
49
+ };
50
+ const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode("renewal-witness:v1\u0000" + payload.json));
51
+ const hex = [...new Uint8Array(digest)]
52
+ .map((n) => n.toString(16).padStart(2, "0"))
53
+ .join("");
54
+ return {
55
+ payload,
56
+ fields,
57
+ payloadBinding: "renewal-witness:v1:sha256:" + hex,
58
+ };
59
+ }
60
+ //# sourceMappingURL=eligibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eligibility.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/eligibility.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,WAAW,IAAI,IAAI,GAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,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AAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAC9B,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,CAAU;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,eAAe;QAC9C,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY;QACpD,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;QAC7C,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,cAAc,EAAE,QAAQ,CAAC,eAAe,CAAC,cAAc;QACvD,YAAY,EAAE,QAAQ,CAAC,eAAe,CAAC,YAAY;QACnD,oBAAoB,EAAE,KAAc;QACpC,yBAAyB,EAAE,KAAc;QACzC,yBAAyB,EAAE,KAAc;QACzC,6BAA6B,EAAE,IAAa;KAC7C,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CACvC,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CACpE,CAAC;IACF,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO;QACL,OAAO;QACP,MAAM;QACN,cAAc,EAAE,4BAA4B,GAAG,GAAG;KACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /** Trusted host component API. Host authorization and live capture remain separate requirements. */
2
+ export declare const retainAuthorizedWitness: import("convex/server").RegisteredMutation<"public", {
3
+ identity: {
4
+ componentScope: string;
5
+ operationId: import("convex/values").GenericId<"renewalOperations">;
6
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
7
+ witnessId: string;
8
+ };
9
+ payloadJSON: string;
10
+ }, Promise<{
11
+ status: "conflict";
12
+ reason: "identity_changed";
13
+ descriptor?: undefined;
14
+ } | {
15
+ reason?: undefined;
16
+ status: "retained";
17
+ descriptor: {
18
+ version: 1;
19
+ identity: {
20
+ componentScope: string;
21
+ witnessId: string;
22
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
23
+ operationId: import("convex/values").GenericId<"renewalOperations">;
24
+ };
25
+ capturedSubject: string;
26
+ observedAtMs: number;
27
+ customerAccountId: string;
28
+ customerId: string;
29
+ livemode: boolean;
30
+ subscriptionId: string;
31
+ scheduleId: string;
32
+ observedItemId: string;
33
+ nativePeriod: Readonly<{
34
+ start: number;
35
+ end: number;
36
+ }>;
37
+ operationalAuthority: false;
38
+ authenticationEstablished: false;
39
+ publicDeliveryEstablished: false;
40
+ providerQualificationRequired: true;
41
+ payloadBinding: string;
42
+ witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
43
+ };
44
+ }>>;
45
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/mutations.ts"],"names":[],"mappings":"AAKA,oGAAoG;AACpG,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { v } from "convex/values";
2
+ import { mutation } from "../_generated/server.js";
3
+ import { descriptor, identity } from "./schema.js";
4
+ import { retainWitness } from "./protocol.js";
5
+ /** Trusted host component API. Host authorization and live capture remain separate requirements. */
6
+ export const retainAuthorizedWitness = mutation({
7
+ args: { identity, payloadJSON: v.string() },
8
+ returns: v.union(v.object({ status: v.literal("retained"), descriptor }), v.object({
9
+ status: v.literal("conflict"),
10
+ reason: v.literal("identity_changed"),
11
+ })),
12
+ handler: retainWitness,
13
+ });
14
+ //# sourceMappingURL=mutations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,oGAAoG;AACpG,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC9C,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CACd,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,EACvD,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC7B,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;KACtC,CAAC,CACH;IACD,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC"}
@@ -0,0 +1,75 @@
1
+ import type { MutationCtx, QueryCtx } from "../_generated/server.js";
2
+ import { type WitnessIdentity } from "../../shared/renewalWitness.js";
3
+ type Reader = Pick<QueryCtx, "db">;
4
+ /** Trusted component helper only. A host retention capability and live capture remain required. */
5
+ export declare function retainWitness(ctx: Pick<MutationCtx, "db">, args: {
6
+ identity: WitnessIdentity;
7
+ payloadJSON: string;
8
+ }): Promise<{
9
+ status: "conflict";
10
+ reason: "identity_changed";
11
+ descriptor?: undefined;
12
+ } | {
13
+ reason?: undefined;
14
+ status: "retained";
15
+ descriptor: {
16
+ version: 1;
17
+ identity: {
18
+ componentScope: string;
19
+ witnessId: string;
20
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
21
+ operationId: import("convex/values").GenericId<"renewalOperations">;
22
+ };
23
+ capturedSubject: string;
24
+ observedAtMs: number;
25
+ customerAccountId: string;
26
+ customerId: string;
27
+ livemode: boolean;
28
+ subscriptionId: string;
29
+ scheduleId: string;
30
+ observedItemId: string;
31
+ nativePeriod: Readonly<{
32
+ start: number;
33
+ end: number;
34
+ }>;
35
+ operationalAuthority: false;
36
+ authenticationEstablished: false;
37
+ publicDeliveryEstablished: false;
38
+ providerQualificationRequired: true;
39
+ payloadBinding: string;
40
+ witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
41
+ };
42
+ }>;
43
+ /** Fresh host read authorization belongs to the caller; this cannot establish public ACK delivery. */
44
+ export declare function readWitness(ctx: Reader, raw: WitnessIdentity): Promise<{
45
+ descriptor: {
46
+ version: 1;
47
+ identity: {
48
+ componentScope: string;
49
+ witnessId: string;
50
+ parentOperationId: import("convex/values").GenericId<"renewalOperations">;
51
+ operationId: import("convex/values").GenericId<"renewalOperations">;
52
+ };
53
+ capturedSubject: string;
54
+ observedAtMs: number;
55
+ customerAccountId: string;
56
+ customerId: string;
57
+ livemode: boolean;
58
+ subscriptionId: string;
59
+ scheduleId: string;
60
+ observedItemId: string;
61
+ nativePeriod: Readonly<{
62
+ start: number;
63
+ end: number;
64
+ }>;
65
+ operationalAuthority: false;
66
+ authenticationEstablished: false;
67
+ publicDeliveryEstablished: false;
68
+ providerQualificationRequired: true;
69
+ payloadBinding: string;
70
+ witnessRowId: import("convex/values").GenericId<"renewalObservationWitnesses">;
71
+ };
72
+ payloadJSON: string;
73
+ } | null>;
74
+ export {};
75
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/component/renewalWitnesses/protocol.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAIxC,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAiDnC,mGAAmG;AACnG,wBAAsB,aAAa,CACjC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC5B,IAAI,EAAE;IAAE,QAAQ,EAAE,eAAe,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE;YAc1C,UAAU;YACV,kBAAkB;;;;YAEb,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAe9B;AACD,sGAAsG;AACtG,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKlE"}
@@ -0,0 +1,82 @@
1
+ import { getConvexSize } from "convex/values";
2
+ import { sameJSON } from "../renewalOperations/attachValidation.js";
3
+ import { witnessNeed as need, witnessIdentity, } from "../../shared/renewalWitness.js";
4
+ import { normalizedWitnessIdentity } from "./source.js";
5
+ import { validateWitness } from "./eligibility.js";
6
+ async function find(ctx, identity) {
7
+ const rows = await ctx.db
8
+ .query("renewalObservationWitnesses")
9
+ .withIndex("by_componentScope_and_witnessId", (q) => q
10
+ .eq("identity.componentScope", identity.componentScope)
11
+ .eq("identity.witnessId", identity.witnessId))
12
+ .take(2);
13
+ need(rows.length <= 1);
14
+ return rows[0] ?? null;
15
+ }
16
+ function budget(admitted) {
17
+ const { payload, fields, payloadBinding } = admitted;
18
+ need(getConvexSize({
19
+ identity: fields.identity,
20
+ payloadJSON: payload.json,
21
+ payloadBinding,
22
+ }) <= 500000);
23
+ // Reserve the maximum admitted opaque ID length before making any insert.
24
+ need(getConvexSize({
25
+ descriptor: { ...fields, payloadBinding, witnessRowId: "x".repeat(255) },
26
+ payloadJSON: payload.json,
27
+ }) <= 500000);
28
+ }
29
+ async function checked(ctx, row) {
30
+ const admitted = await validateWitness(ctx, row.payloadJSON);
31
+ budget(admitted);
32
+ need(sameJSON(admitted.fields.identity, row.identity) &&
33
+ admitted.payloadBinding === row.payloadBinding);
34
+ return {
35
+ descriptor: {
36
+ ...admitted.fields,
37
+ payloadBinding: admitted.payloadBinding,
38
+ witnessRowId: row._id,
39
+ },
40
+ payloadJSON: admitted.payload.json,
41
+ };
42
+ }
43
+ /** Trusted component helper only. A host retention capability and live capture remain required. */
44
+ export async function retainWitness(ctx, args) {
45
+ const identity = normalizedWitnessIdentity(ctx, args.identity);
46
+ const admitted = await validateWitness(ctx, args.payloadJSON);
47
+ need(sameJSON(admitted.fields.identity, identity));
48
+ budget(admitted);
49
+ const existing = await find(ctx, identity);
50
+ if (existing) {
51
+ const original = await checked(ctx, existing);
52
+ if (existing.payloadJSON !== admitted.payload.json ||
53
+ !sameJSON(existing.identity, identity))
54
+ return {
55
+ status: "conflict",
56
+ reason: "identity_changed",
57
+ };
58
+ return { status: "retained", descriptor: original.descriptor };
59
+ }
60
+ const witnessRowId = await ctx.db.insert("renewalObservationWitnesses", {
61
+ identity,
62
+ payloadJSON: admitted.payload.json,
63
+ payloadBinding: admitted.payloadBinding,
64
+ });
65
+ return {
66
+ status: "retained",
67
+ descriptor: {
68
+ ...admitted.fields,
69
+ payloadBinding: admitted.payloadBinding,
70
+ witnessRowId,
71
+ },
72
+ };
73
+ }
74
+ /** Fresh host read authorization belongs to the caller; this cannot establish public ACK delivery. */
75
+ export async function readWitness(ctx, raw) {
76
+ const identity = witnessIdentity(raw);
77
+ const row = await find(ctx, identity);
78
+ if (!row || !sameJSON(row.identity, identity))
79
+ return null;
80
+ return checked(ctx, row);
81
+ }
82
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources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