@fantastic.dev/better-stripe 0.106.0 → 0.107.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 (28) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/observation/history.d.ts +41 -0
  4. package/dist/client/billing/renewalAttach/internal/observation/history.d.ts.map +1 -0
  5. package/dist/client/billing/renewalAttach/internal/observation/history.js +161 -0
  6. package/dist/client/billing/renewalAttach/internal/observation/history.js.map +1 -0
  7. package/dist/client/billing/renewalAttach/internal/observation/historyEvents.d.ts +55 -0
  8. package/dist/client/billing/renewalAttach/internal/observation/historyEvents.d.ts.map +1 -0
  9. package/dist/client/billing/renewalAttach/internal/observation/historyEvents.js +83 -0
  10. package/dist/client/billing/renewalAttach/internal/observation/historyEvents.js.map +1 -0
  11. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
  12. package/dist/client/connect/payoutSyncTestHelpers.d.ts +16 -16
  13. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  14. package/dist/component/balanceFunding/mutations.d.ts +27 -27
  15. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  16. package/dist/component/earnings/triggers.d.ts +16 -16
  17. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  18. package/dist/component/payoutRelease/queries.d.ts +2 -2
  19. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  20. package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
  21. package/dist/component/usage/allowance.fixtures.d.ts +16 -16
  22. package/docs/renewal-context-reads.md +35 -0
  23. package/package.json +1 -1
  24. package/src/client/billing/renewalAttach/internal/observation/history.integration.test.ts +79 -0
  25. package/src/client/billing/renewalAttach/internal/observation/history.ts +200 -0
  26. package/src/client/billing/renewalAttach/internal/observation/historyControls.integration.test.ts +238 -0
  27. package/src/client/billing/renewalAttach/internal/observation/historyEvents.ts +114 -0
  28. package/src/client/billing/renewalAttach/internal/test-fixtures/historySnapshot.ts +47 -0
package/CHANGELOG.md CHANGED
@@ -26,6 +26,12 @@
26
26
  - Remove internal tracker references from public documentation and add a
27
27
  regression check that prevents their reintroduction.
28
28
 
29
+ ## [0.107.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.106.0...v0.107.0) (2026-10-31)
30
+
31
+ ### Features
32
+
33
+ - reconstruct retained renewal observation history ([#456](https://github.com/FantasticDevHQ/better-stripe/issues/456)) ([0d42eb5](https://github.com/FantasticDevHQ/better-stripe/commit/0d42eb5573c661b376f2dcf824441d92e1fb1b61))
34
+
29
35
  ## [0.106.0](https://github.com/FantasticDevHQ/better-stripe/compare/v0.105.0...v0.106.0) (2026-10-31)
30
36
 
31
37
  ### Features
package/README.md CHANGED
@@ -5,7 +5,7 @@ billing, and Connect marketplaces. It provides checkout, subscriptions, webhook
5
5
  syncing, marketplace fees and splits, payouts, refunds, and disputes, with React
6
6
  hooks and headless UI components.
7
7
 
8
- **Version**: `0.106.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
8
+ **Version**: `0.107.0` <!-- x-release-please-version --> (pre-1.0). API may change between minor versions until 1.0.
9
9
 
10
10
  Connect platforms use the default GA API version. Non-Connect merchants using
11
11
  customer-only Accounts v2 need preview access and an explicit preview version.
@@ -0,0 +1,41 @@
1
+ /** Pure retained DATA. No Source, actual returned ACK, authorization or execution grant. */
2
+ export declare function captureRetainedObservationHistory(raw: unknown): Promise<{
3
+ status: "retained_observation_history_data";
4
+ record: import("../preflight/grammar.js").PreflightRecord;
5
+ configureHead: number;
6
+ configureReceipt: import("../../../renewalV2/index.js").RenewalConfigurationReceiptV2 | null;
7
+ rawConfigureReceipt: {
8
+ configuration: import("../preflight/grammar.js").Configuration;
9
+ actualDispatch: Pick<import("../../../renewalV2/index.js").ProjectedRenewalConfigurationV2, keyof {
10
+ scope: string;
11
+ apiVersion: string;
12
+ method: string;
13
+ path: string;
14
+ payload: unknown;
15
+ key: string;
16
+ firstDispatchedAt: number;
17
+ }>;
18
+ providerSnapshot: Record<string, unknown>;
19
+ transport: {
20
+ status: number;
21
+ requestId?: string | undefined;
22
+ };
23
+ } | null;
24
+ attachmentReceipt: import("../../../renewalV2/index.js").RenewalScheduleAttachmentReceiptV2;
25
+ attachmentRetention: {
26
+ retention: unknown;
27
+ receiptJSON: string;
28
+ };
29
+ configureRetention: {
30
+ retention: unknown;
31
+ receiptJSON: string;
32
+ } | null;
33
+ snapshot: {
34
+ parent: unknown;
35
+ configure: unknown;
36
+ };
37
+ operationalAuthority: false;
38
+ authenticationEstablished: false;
39
+ publicDeliveryEstablished: false;
40
+ }>;
41
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/history.ts"],"names":[],"mappings":"AAuBA,4FAA4F;AAC5F,wBAAsB,iCAAiC,CAAC,GAAG,EAAE,OAAO;YAkKxD,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAQ/B,MAAM;QAAmB,SAAS;;;;;GAKjD"}
@@ -0,0 +1,161 @@
1
+ import { rejectProxyJSON } from "../acquisition/rawWireSource.js";
2
+ import { renewalSnapshot } from "../../../renewalReplacementSnapshot.js";
3
+ import { closed, freeze, sevenWire } from "../c10/ownData.js";
4
+ import { canonicalInitialBasis } from "../../../../../shared/renewalOperationJournal.js";
5
+ import { reconstructConfigurationV2, constructRenewalConfigurationReceiptV2, } from "../../../renewalV2/index.js";
6
+ import { captureObservationRecord, verifyObservationRecord } from "./record.js";
7
+ import { admitConfigureACK } from "../configure/output.js";
8
+ import { checkOperationLoad, matchConfigureDATA, object, text, requireConfigure as need, } from "../producer/configureJournalData.js";
9
+ import { captureHistoryStage, verifyHistoryEvents, verifyHistoryRetention, } from "./historyEvents.js";
10
+ /** Pure retained DATA. No Source, actual returned ACK, authorization or execution grant. */
11
+ export async function captureRetainedObservationHistory(raw) {
12
+ need(arguments.length === 1);
13
+ // Capture the complete graph before the first await, including opaque JSON strings.
14
+ rejectProxyJSON(raw);
15
+ const copy = renewalSnapshot(raw);
16
+ need(new TextEncoder().encode(JSON.stringify(copy)).length <= 500000);
17
+ matchConfigureDATA(raw, copy);
18
+ freeze(copy);
19
+ const snapshot = closed(copy, ["parent", "configure"]);
20
+ const parent = captureHistoryStage(snapshot.parent, "attach");
21
+ const child = captureHistoryStage(snapshot.configure, "configure");
22
+ need(parent.reservation.operationId !== child.reservation.operationId &&
23
+ parent.reservation.attemptId !== child.reservation.attemptId);
24
+ const original = object(JSON.parse(child.reservation.recordJSON));
25
+ const parentOriginal = object(JSON.parse(parent.reservation.recordJSON));
26
+ const captured = captureObservationRecord(original.configureRecord);
27
+ const record = captured.record;
28
+ const rebuilt = await reconstructConfigurationV2(record.configuration);
29
+ need(rebuilt.material && "requestIdentity" in rebuilt.result);
30
+ verifyObservationRecord(captured, rebuilt.result, rebuilt.material.receipt);
31
+ const receipt = rebuilt.material.receipt, request = rebuilt.result;
32
+ matchConfigureDATA(original.parentAttachment, {
33
+ operationId: parent.reservation.operationId,
34
+ attemptId: parent.reservation.attemptId,
35
+ sourcePayloadId: parent.reservation.payloadId,
36
+ receiptBinding: receipt.binding,
37
+ });
38
+ matchConfigureDATA(record.configuration.attachReceipt.attachRequest, parentOriginal.attachRequest);
39
+ matchConfigureDATA(record.originalBundle, parentOriginal.originalBundle);
40
+ matchConfigureDATA(original.account, parentOriginal.account);
41
+ matchConfigureDATA(original.account, {
42
+ mode: "platform",
43
+ stripeAccount: null,
44
+ livemode: receipt.livemode,
45
+ });
46
+ need(original.apiVersion === parentOriginal.apiVersion &&
47
+ original.apiVersion === request.apiVersion);
48
+ matchConfigureDATA(original.dispatch, sevenWire(request));
49
+ matchConfigureDATA(parentOriginal.dispatch, sevenWire(receipt.request));
50
+ need(child.reservation.requestBinding === request.requestIdentity.binding &&
51
+ parent.reservation.requestBinding ===
52
+ receipt.request.requestIdentity.binding);
53
+ const policy = object(original.timingPolicy), parentPolicy = object(parentOriginal.timingPolicy);
54
+ for (const key of ["workEndWallMs", "endWallMs", "periodStart", "periodEnd"])
55
+ need(policy[key] === parentPolicy[key]);
56
+ const parentLoad = object(parent.operation), basis = object(parentLoad.initialBasis);
57
+ const basisJSON = text(basis.basisJSON);
58
+ need(canonicalInitialBasis(parent.reservation.timingPolicyJSON, basisJSON)
59
+ .basisJSON === basisJSON);
60
+ need(canonicalInitialBasis(child.reservation.timingPolicyJSON, basisJSON)
61
+ .basisJSON === basisJSON);
62
+ checkOperationLoad(parent.operation, parent.reservation, basisJSON);
63
+ checkOperationLoad(child.operation, child.reservation, basisJSON, child.events.length === 0);
64
+ await verifyHistoryEvents(parent, [
65
+ { event: "dispatch", stage: "attach", request: receipt.request },
66
+ {
67
+ event: "response",
68
+ stage: "attach",
69
+ request: receipt.request,
70
+ body: receipt.providerSnapshot,
71
+ status: parent.events[1].data.status,
72
+ },
73
+ { event: "receipt", stage: "attach", request: receipt.request, receipt },
74
+ ]);
75
+ const attachmentRetention = verifyHistoryRetention(parent, receipt);
76
+ const expected = [];
77
+ if (child.events.length >= 1)
78
+ expected.push({ event: "dispatch", stage: "configure", request });
79
+ const response = child.events[1]?.data;
80
+ if (response)
81
+ expected.push({
82
+ event: "response",
83
+ stage: "configure",
84
+ request,
85
+ body: response.body,
86
+ transport: response.transport,
87
+ });
88
+ let configureReceipt = null, rawConfigureReceipt = null, configureRetention = null;
89
+ if (response) {
90
+ const t = closed(response.transport, ["status"], ["requestId"]);
91
+ need(typeof t.status === "number");
92
+ need(t.requestId === undefined || typeof t.requestId === "string");
93
+ const rawResponse = {
94
+ configuration: record.configuration,
95
+ actualDispatch: sevenWire(request),
96
+ providerSnapshot: object(response.body),
97
+ transport: {
98
+ status: t.status,
99
+ ...(typeof t.requestId === "string" ? { requestId: t.requestId } : {}),
100
+ },
101
+ };
102
+ const reconstructed = await constructRenewalConfigurationReceiptV2(rawResponse);
103
+ admitConfigureACK(record, rawResponse, reconstructed);
104
+ // Response2 may be valid without durable C9. Reconstruction does not retain it.
105
+ if (child.acknowledgement !== null) {
106
+ rawConfigureReceipt = rawResponse;
107
+ configureReceipt = reconstructed;
108
+ configureRetention = verifyHistoryRetention(child, configureReceipt);
109
+ }
110
+ }
111
+ else
112
+ need(child.acknowledgement === null);
113
+ if (child.events.length === 3) {
114
+ need(configureReceipt);
115
+ expected.push({
116
+ event: "receipt",
117
+ stage: "configure",
118
+ request,
119
+ receipt: configureReceipt,
120
+ });
121
+ }
122
+ await verifyHistoryEvents(child, expected);
123
+ // IDs remain opaque DATA. Even equal complete records never become runtime tokens.
124
+ const payloads = [
125
+ parent.reservation.payloadId,
126
+ child.reservation.payloadId,
127
+ ...parent.events.map((e) => e.descriptor.payloadId),
128
+ ...child.events.map((e) => e.descriptor.payloadId),
129
+ object(attachmentRetention.retention).receiptPayloadId,
130
+ ...(configureRetention
131
+ ? [object(configureRetention.retention).receiptPayloadId]
132
+ : []),
133
+ ];
134
+ const eventIds = [...parent.events, ...child.events].map((e) => e.descriptor.eventId);
135
+ need(new Set(payloads).size === payloads.length &&
136
+ new Set(eventIds).size === eventIds.length);
137
+ const ids = [
138
+ parent.reservation.operationId,
139
+ child.reservation.operationId,
140
+ parent.reservation.attemptId,
141
+ child.reservation.attemptId,
142
+ ...payloads,
143
+ ...eventIds,
144
+ ];
145
+ need(new Set(ids).size === ids.length);
146
+ return freeze({
147
+ status: "retained_observation_history_data",
148
+ record,
149
+ configureHead: child.events.length,
150
+ configureReceipt,
151
+ rawConfigureReceipt,
152
+ attachmentReceipt: receipt,
153
+ attachmentRetention,
154
+ configureRetention,
155
+ snapshot: { parent: snapshot.parent, configure: snapshot.configure },
156
+ operationalAuthority: false,
157
+ authenticationEstablished: false,
158
+ publicDeliveryEstablished: false,
159
+ });
160
+ }
161
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalA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AAM,QAAQ,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CACtD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAC5B,CAAC;IACF,IAAI,CACF,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM;QACxC,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,MAAM,CAC7C,CAAC;IACF,MAAM,GAAG,GAAG;QACV,MAAM,CAAC,WAAW,CAAC,WAAW;QAC9B,KAAK,CAAC,WAAW,CAAC,WAAW;QAC7B,MAAM,CAAC,WAAW,CAAC,SAAS;QAC5B,KAAK,CAAC,WAAW,CAAC,SAAS;QAC3B,GAAG,QAAQ;QACX,GAAG,QAAQ;KACZ,CAAC;IACF,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC;QACZ,MAAM,EAAE,mCAA4C;QACpD,MAAM;QACN,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;QAClC,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB,EAAE,OAAO;QAC1B,mBAAmB;QACnB,kBAAkB;QAClB,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE;QACpE,oBAAoB,EAAE,KAAc;QACpC,yBAAyB,EAAE,KAAc;QACzC,yBAAyB,EAAE,KAAc;KAC1C,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ /** Complete bounded query DATA, never a class journal or actual ACK. */
2
+ export declare function captureHistoryStage(raw: unknown, stage: "attach" | "configure"): {
3
+ operation: unknown;
4
+ reservation: Readonly<{
5
+ key: string;
6
+ apiVersion: string;
7
+ firstDispatchedAt: number;
8
+ accountJSON: string;
9
+ recordVersion: 2;
10
+ timingPolicyJSON: string;
11
+ operationId: string;
12
+ attemptId: string;
13
+ payloadId: string;
14
+ authorizationScope: string;
15
+ authorizationId: string;
16
+ authorizationRevision: number;
17
+ logicalOperationId: string;
18
+ requestBinding: string;
19
+ ordinal: 1;
20
+ preparedRevision: 0;
21
+ committedRevision: 1;
22
+ recordJSON: string;
23
+ stage: "attach" | "configure";
24
+ }>;
25
+ events: {
26
+ descriptor: {
27
+ operationId: string;
28
+ attemptId: string;
29
+ stage: "attach";
30
+ sourcePayloadId: string;
31
+ sequence: 1 | 2 | 3;
32
+ binding: string;
33
+ payloadId: string;
34
+ eventId: string;
35
+ } | {
36
+ operationId: string;
37
+ attemptId: string;
38
+ stage: "configure";
39
+ sourcePayloadId: string;
40
+ sequence: number;
41
+ binding: string;
42
+ payloadId: string;
43
+ eventId: string;
44
+ };
45
+ dataJSON: string;
46
+ data: Record<string, unknown>;
47
+ }[];
48
+ acknowledgement: unknown;
49
+ };
50
+ export declare function verifyHistoryEvents(stage: ReturnType<typeof captureHistoryStage>, expected: readonly unknown[]): Promise<void>;
51
+ export declare function verifyHistoryRetention(stage: ReturnType<typeof captureHistoryStage>, receipt: unknown): {
52
+ retention: unknown;
53
+ receiptJSON: string;
54
+ };
55
+ //# sourceMappingURL=historyEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/historyEvents.ts"],"names":[],"mappings":"AAqBA,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,QAAQ,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C9B;AACD,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EAC7C,QAAQ,EAAE,SAAS,OAAO,EAAE,iBAY7B;AACD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,EAC7C,OAAO,EAAE,OAAO;;;EA6BjB"}
@@ -0,0 +1,83 @@
1
+ import { canonicalJournalEvent } from "../../../../../shared/renewalOperationJournal.js";
2
+ import { renewalSnapshot } from "../../../renewalReplacementSnapshot.js";
3
+ import { closed, freeze } from "../c10/ownData.js";
4
+ import { captureAttachDispatch, captureAttachResponse, captureAttachReceipt, captureConfigureDispatch, captureConfigureResponse, captureConfigureReceipt, } from "../c10/eventCapture.js";
5
+ import { captureOperationalReservation, captureParentHistory, captureConfigureHistory, matchConfigureDATA, object, text, requireConfigure as need, } from "../producer/configureJournalData.js";
6
+ /** Complete bounded query DATA, never a class journal or actual ACK. */
7
+ export function captureHistoryStage(raw, stage) {
8
+ const x = closed(raw, ["operation", "attempt", "events", "acknowledgement"]);
9
+ const attempt = closed(x.attempt, ["reservation", "events"]);
10
+ const reservation = captureOperationalReservation(attempt.reservation, stage);
11
+ need(Array.isArray(attempt.events) && Array.isArray(x.events));
12
+ const count = attempt.events.length;
13
+ need(count <= 3 && x.events.length === count);
14
+ const descriptors = stage === "attach"
15
+ ? captureParentHistory(x.attempt, reservation)
16
+ : count === 0
17
+ ? (matchConfigureDATA(x.attempt, { reservation, events: [] }), [])
18
+ : captureConfigureHistory(x.attempt, reservation, count);
19
+ const allPayloads = [
20
+ reservation.payloadId,
21
+ ...descriptors.map((e) => e.payloadId),
22
+ ];
23
+ need(new Set(allPayloads).size === allPayloads.length);
24
+ const events = x.events.map((raw, index) => {
25
+ const event = closed(raw, [...Object.keys(descriptors[index]), "dataJSON"]);
26
+ const dataJSON = text(event.dataJSON);
27
+ need(dataJSON.length <= 500000);
28
+ const parsed = JSON.parse(dataJSON);
29
+ const captures = stage === "attach"
30
+ ? [captureAttachDispatch, captureAttachResponse, captureAttachReceipt]
31
+ : [
32
+ captureConfigureDispatch,
33
+ captureConfigureResponse,
34
+ captureConfigureReceipt,
35
+ ];
36
+ captures[index](parsed);
37
+ matchConfigureDATA(raw, { ...descriptors[index], dataJSON });
38
+ return { descriptor: descriptors[index], dataJSON, data: object(parsed) };
39
+ });
40
+ return {
41
+ operation: x.operation,
42
+ reservation,
43
+ events,
44
+ acknowledgement: x.acknowledgement,
45
+ };
46
+ }
47
+ export async function verifyHistoryEvents(stage, expected) {
48
+ need(stage.events.length === expected.length);
49
+ for (let index = 0; index < expected.length; index++) {
50
+ const event = stage.events[index];
51
+ matchConfigureDATA(event.data, expected[index]);
52
+ const canonical = await canonicalJournalEvent(index + 1, event.dataJSON);
53
+ need(canonical.json === event.dataJSON &&
54
+ canonical.binding === event.descriptor.binding);
55
+ }
56
+ }
57
+ export function verifyHistoryRetention(stage, receipt) {
58
+ need(stage.events.length >= 2);
59
+ const ack = closed(stage.acknowledgement, ["retention", "receiptJSON"]);
60
+ const retention = object(ack.retention), r = object(receipt);
61
+ const receiptPayloadId = text(retention.receiptPayloadId);
62
+ need(receiptPayloadId !== stage.reservation.payloadId &&
63
+ stage.events.every((e) => e.descriptor.payloadId !== receiptPayloadId));
64
+ const [dispatch, response] = stage.events;
65
+ matchConfigureDATA(JSON.parse(text(ack.receiptJSON)), receipt);
66
+ need(JSON.stringify(renewalSnapshot(receipt)) === ack.receiptJSON);
67
+ matchConfigureDATA(ack.retention, {
68
+ status: "retained",
69
+ operationId: stage.reservation.operationId,
70
+ schemaVersion: 1,
71
+ stage: stage.reservation.stage,
72
+ attemptId: stage.reservation.attemptId,
73
+ sourcePayloadId: stage.reservation.payloadId,
74
+ dispatchEventId: dispatch.descriptor.eventId,
75
+ dispatchPayloadId: dispatch.descriptor.payloadId,
76
+ responseEventId: response.descriptor.eventId,
77
+ responsePayloadId: response.descriptor.payloadId,
78
+ receiptPayloadId,
79
+ receiptBinding: r.binding,
80
+ });
81
+ return freeze({ retention: ack.retention, receiptJSON: ack.receiptJSON });
82
+ }
83
+ //# sourceMappingURL=historyEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyEvents.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/observation/historyEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,MAAM,EACN,IAAI,EACJ,gBAAgB,IAAI,IAAI,GACzB,MAAM,qCAAqC,CAAC;AAE7C,wEAAwE;AACxE,MAAM,UAAU,mBAAmB,CACjC,GAAY,EACZ,KAA6B;IAE7B,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC7E,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,6BAA6B,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;IAC9C,MAAM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AU,CAAC,SAAS;QAChD,gBAAgB;QAChB,cAAc,EAAE,CAAC,CAAC,OAAO;KAC1B,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5E,CAAC"}
@@ -2642,6 +2642,14 @@ export declare function setup(amounts?: number[]): Promise<{
2642
2642
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2643
2643
  requestKey: string;
2644
2644
  result?: {
2645
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2646
+ retryable: false;
2647
+ status: "conflict";
2648
+ } | {
2649
+ reason: "policy_invalid";
2650
+ retryable: false;
2651
+ status: "rejected";
2652
+ } | {
2645
2653
  operation: {
2646
2654
  accountId: string;
2647
2655
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2652,14 +2660,6 @@ export declare function setup(amounts?: number[]): Promise<{
2652
2660
  } | {
2653
2661
  enabled: boolean;
2654
2662
  status: "unchanged";
2655
- } | {
2656
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2657
- retryable: false;
2658
- status: "conflict";
2659
- } | {
2660
- reason: "policy_invalid";
2661
- retryable: false;
2662
- status: "rejected";
2663
2663
  } | {
2664
2664
  reason: "provider_pending";
2665
2665
  retryable: true;
@@ -2670,6 +2670,14 @@ export declare function setup(amounts?: number[]): Promise<{
2670
2670
  payload: import("convex/values").VString<string, "required">;
2671
2671
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2672
2672
  result: import("convex/values").VUnion<{
2673
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2674
+ retryable: false;
2675
+ status: "conflict";
2676
+ } | {
2677
+ reason: "policy_invalid";
2678
+ retryable: false;
2679
+ status: "rejected";
2680
+ } | {
2673
2681
  operation: {
2674
2682
  accountId: string;
2675
2683
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2680,14 +2688,6 @@ export declare function setup(amounts?: number[]): Promise<{
2680
2688
  } | {
2681
2689
  enabled: boolean;
2682
2690
  status: "unchanged";
2683
- } | {
2684
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2685
- retryable: false;
2686
- status: "conflict";
2687
- } | {
2688
- reason: "policy_invalid";
2689
- retryable: false;
2690
- status: "rejected";
2691
2691
  } | {
2692
2692
  reason: "provider_pending";
2693
2693
  retryable: true;
@@ -2646,14 +2646,6 @@ export declare function setup(scope?: Scope): Promise<{
2646
2646
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2647
2647
  requestKey: string;
2648
2648
  result?: {
2649
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2650
- retryable: false;
2651
- status: "conflict";
2652
- } | {
2653
- reason: "policy_invalid";
2654
- retryable: false;
2655
- status: "rejected";
2656
- } | {
2657
2649
  operation: {
2658
2650
  accountId: string;
2659
2651
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2664,6 +2656,14 @@ export declare function setup(scope?: Scope): Promise<{
2664
2656
  } | {
2665
2657
  enabled: boolean;
2666
2658
  status: "unchanged";
2659
+ } | {
2660
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2661
+ retryable: false;
2662
+ status: "conflict";
2663
+ } | {
2664
+ reason: "policy_invalid";
2665
+ retryable: false;
2666
+ status: "rejected";
2667
2667
  } | {
2668
2668
  reason: "provider_pending";
2669
2669
  retryable: true;
@@ -2674,14 +2674,6 @@ export declare function setup(scope?: Scope): Promise<{
2674
2674
  payload: import("convex/values").VString<string, "required">;
2675
2675
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2676
2676
  result: import("convex/values").VUnion<{
2677
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2678
- retryable: false;
2679
- status: "conflict";
2680
- } | {
2681
- reason: "policy_invalid";
2682
- retryable: false;
2683
- status: "rejected";
2684
- } | {
2685
2677
  operation: {
2686
2678
  accountId: string;
2687
2679
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2692,6 +2684,14 @@ export declare function setup(scope?: Scope): Promise<{
2692
2684
  } | {
2693
2685
  enabled: boolean;
2694
2686
  status: "unchanged";
2687
+ } | {
2688
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2689
+ retryable: false;
2690
+ status: "conflict";
2691
+ } | {
2692
+ reason: "policy_invalid";
2693
+ retryable: false;
2694
+ status: "rejected";
2695
2695
  } | {
2696
2696
  reason: "provider_pending";
2697
2697
  retryable: true;
@@ -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
@@ -595,22 +595,6 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
595
595
  } & {
596
596
  providerAction: string;
597
597
  }, Promise<{
598
- reason: "history_incomplete" | "provider_outcome_unknown";
599
- retryable: false;
600
- status: "unknown";
601
- } | {
602
- reason: "identity_changed" | "revision_changed" | "scope_busy";
603
- retryable: false;
604
- status: "conflict";
605
- } | {
606
- reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
607
- retryable: false;
608
- status: "rejected";
609
- } | {
610
- reason: "provider_pending";
611
- retryable: true;
612
- status: "not_ready";
613
- } | {
614
598
  operation: {
615
599
  accountId: string;
616
600
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -627,16 +611,7 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
627
611
  version: number;
628
612
  };
629
613
  status: "canceled";
630
- }>>;
631
- export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
632
- accountId: string;
633
- definitionVersion: string;
634
- operationId: import("convex/values").GenericId<"balanceFundingOperations">;
635
- providerApiVersion: string;
636
- scopeKey: string;
637
- stripeSubscriptionId: string;
638
- version: number;
639
- }, Promise<{
614
+ } | {
640
615
  reason: "history_incomplete" | "provider_outcome_unknown";
641
616
  retryable: false;
642
617
  status: "unknown";
@@ -652,7 +627,16 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
652
627
  reason: "provider_pending";
653
628
  retryable: true;
654
629
  status: "not_ready";
655
- } | {
630
+ }>>;
631
+ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
632
+ accountId: string;
633
+ definitionVersion: string;
634
+ operationId: import("convex/values").GenericId<"balanceFundingOperations">;
635
+ providerApiVersion: string;
636
+ scopeKey: string;
637
+ stripeSubscriptionId: string;
638
+ version: number;
639
+ }, Promise<{
656
640
  operation: {
657
641
  accountId: string;
658
642
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -669,6 +653,22 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
669
653
  version: number;
670
654
  };
671
655
  status: "canceled";
656
+ } | {
657
+ reason: "history_incomplete" | "provider_outcome_unknown";
658
+ retryable: false;
659
+ status: "unknown";
660
+ } | {
661
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
662
+ retryable: false;
663
+ status: "conflict";
664
+ } | {
665
+ reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
666
+ retryable: false;
667
+ status: "rejected";
668
+ } | {
669
+ reason: "provider_pending";
670
+ retryable: true;
671
+ status: "not_ready";
672
672
  }>>;
673
673
  export declare const cancelWorkflow: import("convex/server").RegisteredMutation<"public", {
674
674
  accountId: string;