@fantastic.dev/better-stripe 0.103.0 → 0.104.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 (43) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts +22 -0
  4. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.d.ts.map +1 -1
  5. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js +105 -3
  6. package/dist/client/billing/renewalAttach/internal/operations/configureReadTransport.js.map +1 -1
  7. package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts +1 -0
  8. package/dist/client/billing/renewalAttach/internal/preflight/output.d.ts.map +1 -1
  9. package/dist/client/billing/renewalAttach/internal/preflight/output.js +6 -2
  10. package/dist/client/billing/renewalAttach/internal/preflight/output.js.map +1 -1
  11. package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts +3 -1
  12. package/dist/client/billing/renewalAttach/internal/preflight/record.d.ts.map +1 -1
  13. package/dist/client/billing/renewalAttach/internal/preflight/record.js +8 -3
  14. package/dist/client/billing/renewalAttach/internal/preflight/record.js.map +1 -1
  15. package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts +2 -0
  16. package/dist/client/billing/renewalAttach/internal/preflight/relations.d.ts.map +1 -1
  17. package/dist/client/billing/renewalAttach/internal/preflight/relations.js +12 -5
  18. package/dist/client/billing/renewalAttach/internal/preflight/relations.js.map +1 -1
  19. package/dist/client/billing/renewalAttach/internal/producer/configureFrontier.d.ts +3 -0
  20. package/dist/client/billing/renewalAttach/internal/producer/configureFrontier.d.ts.map +1 -0
  21. package/dist/client/billing/renewalAttach/internal/producer/configureFrontier.js +25 -0
  22. package/dist/client/billing/renewalAttach/internal/producer/configureFrontier.js.map +1 -0
  23. package/dist/client/billing/renewalAttach/internal/producer/configurePreflight.d.ts +16 -0
  24. package/dist/client/billing/renewalAttach/internal/producer/configurePreflight.d.ts.map +1 -0
  25. package/dist/client/billing/renewalAttach/internal/producer/configurePreflight.js +117 -0
  26. package/dist/client/billing/renewalAttach/internal/producer/configurePreflight.js.map +1 -0
  27. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +32 -32
  28. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +32 -32
  29. package/dist/component/balanceFunding/mutations.d.ts +43 -43
  30. package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
  31. package/dist/component/balanceFunding/queries.d.ts +1 -1
  32. package/dist/component/usageCredits/accounting.fixtures.d.ts +16 -16
  33. package/docs/renewal-context-reads.md +34 -2
  34. package/package.json +1 -1
  35. package/src/client/billing/renewalAttach/internal/operations/configureReadTransport.ts +148 -3
  36. package/src/client/billing/renewalAttach/internal/preflight/output.ts +20 -3
  37. package/src/client/billing/renewalAttach/internal/preflight/record.ts +11 -3
  38. package/src/client/billing/renewalAttach/internal/preflight/relations.ts +20 -5
  39. package/src/client/billing/renewalAttach/internal/producer/configureFrontier.ts +40 -0
  40. package/src/client/billing/renewalAttach/internal/producer/configurePreflight.ts +170 -0
  41. package/src/client/billing/renewalAttach/internal/producer/producerConfigurePreflight.integration.test.ts +67 -0
  42. package/src/client/billing/renewalAttach/internal/producer/producerConfigurePreflightControls.integration.test.ts +475 -0
  43. package/src/client/billing/renewalAttach/internal/test-fixtures/producerConfigureAdmission.ts +51 -4
@@ -0,0 +1,117 @@
1
+ import { readConfigureLineage } from "./configureLineage.js";
2
+ import { ownedAwaitForInitialLineage } from "./ownedAwaitFactory.js";
3
+ import { assertConfigurePreflightFrontier } from "./configureFrontier.js";
4
+ import { createAdmittedConfigureReadTransport } from "../operations/configureReadTransport.js";
5
+ import { createSelectedRawAcquisition } from "../acquisition/ownedAcquisition.js";
6
+ import { projectRenewalConfigurationV2, constructRenewalScheduleAttachmentReceiptV2, } from "../../../renewalV2/index.js";
7
+ import { verifyPreflightRecordDATA, verifyCurrentPreflightDATA, } from "../preflight/relations.js";
8
+ import { releasePreflightDATA } from "../preflight/output.js";
9
+ import { requireConfigure } from "./configureJournalData.js";
10
+ import { equal } from "../../../renewalAggregate/shared.js";
11
+ function matchesCurrentBundle(value, record) {
12
+ return equal(value, {
13
+ ...record.originalBundle,
14
+ wireSubscription: record.configuration.freshSubscription,
15
+ });
16
+ }
17
+ const captures = new WeakSet();
18
+ const completions = new WeakMap();
19
+ /** Actual admitted child only. This readonly consistency actor grants no write. */
20
+ export function captureAdmittedConfigurePreflight(token) {
21
+ requireConfigure(typeof token === "object" && token !== null && !captures.has(token));
22
+ captures.add(token);
23
+ requireConfigure(arguments.length === 1);
24
+ const pair = createAdmittedConfigureReadTransport(token);
25
+ const lineage = readConfigureLineage(token), owned = ownedAwaitForInitialLineage(lineage.parentToken);
26
+ let used = false, closed = false;
27
+ function guard() {
28
+ requireConfigure(!closed);
29
+ try {
30
+ pair.guard();
31
+ }
32
+ catch (error) {
33
+ closed = true;
34
+ throw error;
35
+ }
36
+ }
37
+ async function checked(call) {
38
+ guard();
39
+ const result = await owned(call);
40
+ guard();
41
+ return result;
42
+ }
43
+ const actor = Object.freeze({
44
+ async invoke() {
45
+ requireConfigure(!used);
46
+ used = true;
47
+ requireConfigure(arguments.length === 0);
48
+ try {
49
+ guard();
50
+ await checked(() => assertConfigurePreflightFrontier(token));
51
+ const original = await checked(() => projectRenewalConfigurationV2(pair.retained.configuration));
52
+ requireConfigure(original.status === "projected_configure_request");
53
+ const ack = await checked(() => constructRenewalScheduleAttachmentReceiptV2(pair.retained.configuration.attachReceipt));
54
+ const record = verifyPreflightRecordDATA(pair.retained, original, ack);
55
+ await checked(() => assertConfigurePreflightFrontier(token));
56
+ guard();
57
+ const reader = createSelectedRawAcquisition(lineage.owner, pair.readTransport, pair.scheduleId);
58
+ const acquired = await checked(() => reader.acquire(record.configuration.preparation.expected));
59
+ requireConfigure(acquired.ok);
60
+ requireConfigure(matchesCurrentBundle(acquired.bundle, record));
61
+ const evidence = Object.freeze({
62
+ bundle: acquired.bundle,
63
+ schedule: acquired.schedule,
64
+ observedAt: acquired.observedAt,
65
+ });
66
+ verifyCurrentPreflightDATA(record, evidence);
67
+ guard();
68
+ const configuration = {
69
+ ...record.configuration,
70
+ freshSubscription: evidence.bundle.wireSubscription,
71
+ targetPrice: evidence.bundle.wireTargetPrice,
72
+ ...(Object.prototype.hasOwnProperty.call(record.configuration, "billingCustomer")
73
+ ? { billingCustomer: evidence.bundle.wireBillingCustomer }
74
+ : {}),
75
+ schedule: evidence.schedule,
76
+ observedAt: evidence.observedAt,
77
+ };
78
+ const fresh = await checked(() => projectRenewalConfigurationV2(configuration));
79
+ requireConfigure(fresh.status === "projected_configure_request" &&
80
+ equal(fresh, original) &&
81
+ equal(fresh, record.request));
82
+ requireConfigure(Reflect.apply(pair.covers, pair.entry, [record, evidence, fresh]) ===
83
+ true);
84
+ guard();
85
+ const output = releasePreflightDATA(record, evidence, fresh, original, ack);
86
+ await checked(() => assertConfigurePreflightFrontier(token));
87
+ guard();
88
+ completions.set(token, {
89
+ guard,
90
+ view: Object.freeze({
91
+ output,
92
+ originalEntry: pair.acknowledgement.originalEntry,
93
+ preflightEntry: pair.entry,
94
+ coversPreflight: pair.covers,
95
+ acknowledgement: pair.acknowledgement,
96
+ operationalAuthority: false,
97
+ }),
98
+ });
99
+ return output;
100
+ }
101
+ catch (error) {
102
+ closed = true;
103
+ throw error;
104
+ }
105
+ },
106
+ });
107
+ return actor;
108
+ }
109
+ /** Actual completed return identity; copied output is never a registration input. */
110
+ export function readAdmittedConfigurePreflight(token) {
111
+ requireConfigure(arguments.length === 1);
112
+ const completed = completions.get(token);
113
+ requireConfigure(completed);
114
+ completed.guard();
115
+ return completed.view;
116
+ }
117
+ //# sourceMappingURL=configurePreflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurePreflight.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/configurePreflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,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;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AACD,qFAAqF;AACrF,MAAM,UAAU,8BAA8B,CAAC,KAAa;IAC1D,gBAAgB,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC5B,SAAS,CAAC,KAAK,EAAE,CAAC;IAClB,OAAO,SAAS,CAAC,IAAI,CAAC;AACxB,CAAC"}
@@ -2641,6 +2641,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2641
2641
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2642
2642
  requestKey: string;
2643
2643
  result?: {
2644
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2645
+ retryable: false;
2646
+ status: "conflict";
2647
+ } | {
2648
+ reason: "policy_invalid";
2649
+ retryable: false;
2650
+ status: "rejected";
2651
+ } | {
2644
2652
  operation: {
2645
2653
  accountId: string;
2646
2654
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2651,14 +2659,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2651
2659
  } | {
2652
2660
  enabled: boolean;
2653
2661
  status: "unchanged";
2654
- } | {
2655
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2656
- retryable: false;
2657
- status: "conflict";
2658
- } | {
2659
- reason: "policy_invalid";
2660
- retryable: false;
2661
- status: "rejected";
2662
2662
  } | {
2663
2663
  reason: "provider_pending";
2664
2664
  retryable: true;
@@ -2669,6 +2669,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2669
2669
  payload: import("convex/values").VString<string, "required">;
2670
2670
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2671
2671
  result: import("convex/values").VUnion<{
2672
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2673
+ retryable: false;
2674
+ status: "conflict";
2675
+ } | {
2676
+ reason: "policy_invalid";
2677
+ retryable: false;
2678
+ status: "rejected";
2679
+ } | {
2672
2680
  operation: {
2673
2681
  accountId: string;
2674
2682
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2679,14 +2687,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
2679
2687
  } | {
2680
2688
  enabled: boolean;
2681
2689
  status: "unchanged";
2682
- } | {
2683
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2684
- retryable: false;
2685
- status: "conflict";
2686
- } | {
2687
- reason: "policy_invalid";
2688
- retryable: false;
2689
- status: "rejected";
2690
2690
  } | {
2691
2691
  reason: "provider_pending";
2692
2692
  retryable: true;
@@ -7777,6 +7777,14 @@ export declare function historical(currency?: string): Promise<{
7777
7777
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
7778
7778
  requestKey: string;
7779
7779
  result?: {
7780
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7781
+ retryable: false;
7782
+ status: "conflict";
7783
+ } | {
7784
+ reason: "policy_invalid";
7785
+ retryable: false;
7786
+ status: "rejected";
7787
+ } | {
7780
7788
  operation: {
7781
7789
  accountId: string;
7782
7790
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7787,14 +7795,6 @@ export declare function historical(currency?: string): Promise<{
7787
7795
  } | {
7788
7796
  enabled: boolean;
7789
7797
  status: "unchanged";
7790
- } | {
7791
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7792
- retryable: false;
7793
- status: "conflict";
7794
- } | {
7795
- reason: "policy_invalid";
7796
- retryable: false;
7797
- status: "rejected";
7798
7798
  } | {
7799
7799
  reason: "provider_pending";
7800
7800
  retryable: true;
@@ -7805,6 +7805,14 @@ export declare function historical(currency?: string): Promise<{
7805
7805
  payload: import("convex/values").VString<string, "required">;
7806
7806
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
7807
7807
  result: import("convex/values").VUnion<{
7808
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7809
+ retryable: false;
7810
+ status: "conflict";
7811
+ } | {
7812
+ reason: "policy_invalid";
7813
+ retryable: false;
7814
+ status: "rejected";
7815
+ } | {
7808
7816
  operation: {
7809
7817
  accountId: string;
7810
7818
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7815,14 +7823,6 @@ export declare function historical(currency?: string): Promise<{
7815
7823
  } | {
7816
7824
  enabled: boolean;
7817
7825
  status: "unchanged";
7818
- } | {
7819
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7820
- retryable: false;
7821
- status: "conflict";
7822
- } | {
7823
- reason: "policy_invalid";
7824
- retryable: false;
7825
- status: "rejected";
7826
7826
  } | {
7827
7827
  reason: "provider_pending";
7828
7828
  retryable: true;
@@ -2632,14 +2632,6 @@ export declare function large(count?: number, amount?: number): Promise<{
2632
2632
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2633
2633
  requestKey: string;
2634
2634
  result?: {
2635
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2636
- retryable: false;
2637
- status: "conflict";
2638
- } | {
2639
- reason: "policy_invalid";
2640
- retryable: false;
2641
- status: "rejected";
2642
- } | {
2643
2635
  operation: {
2644
2636
  accountId: string;
2645
2637
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2650,6 +2642,14 @@ export declare function large(count?: number, amount?: number): Promise<{
2650
2642
  } | {
2651
2643
  enabled: boolean;
2652
2644
  status: "unchanged";
2645
+ } | {
2646
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2647
+ retryable: false;
2648
+ status: "conflict";
2649
+ } | {
2650
+ reason: "policy_invalid";
2651
+ retryable: false;
2652
+ status: "rejected";
2653
2653
  } | {
2654
2654
  reason: "provider_pending";
2655
2655
  retryable: true;
@@ -2660,14 +2660,6 @@ export declare function large(count?: number, amount?: number): Promise<{
2660
2660
  payload: import("convex/values").VString<string, "required">;
2661
2661
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2662
2662
  result: import("convex/values").VUnion<{
2663
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2664
- retryable: false;
2665
- status: "conflict";
2666
- } | {
2667
- reason: "policy_invalid";
2668
- retryable: false;
2669
- status: "rejected";
2670
- } | {
2671
2663
  operation: {
2672
2664
  accountId: string;
2673
2665
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2678,6 +2670,14 @@ export declare function large(count?: number, amount?: number): Promise<{
2678
2670
  } | {
2679
2671
  enabled: boolean;
2680
2672
  status: "unchanged";
2673
+ } | {
2674
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2675
+ retryable: false;
2676
+ status: "conflict";
2677
+ } | {
2678
+ reason: "policy_invalid";
2679
+ retryable: false;
2680
+ status: "rejected";
2681
2681
  } | {
2682
2682
  reason: "provider_pending";
2683
2683
  retryable: true;
@@ -7769,14 +7769,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7769
7769
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
7770
7770
  requestKey: string;
7771
7771
  result?: {
7772
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7773
- retryable: false;
7774
- status: "conflict";
7775
- } | {
7776
- reason: "policy_invalid";
7777
- retryable: false;
7778
- status: "rejected";
7779
- } | {
7780
7772
  operation: {
7781
7773
  accountId: string;
7782
7774
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7787,6 +7779,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7787
7779
  } | {
7788
7780
  enabled: boolean;
7789
7781
  status: "unchanged";
7782
+ } | {
7783
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7784
+ retryable: false;
7785
+ status: "conflict";
7786
+ } | {
7787
+ reason: "policy_invalid";
7788
+ retryable: false;
7789
+ status: "rejected";
7790
7790
  } | {
7791
7791
  reason: "provider_pending";
7792
7792
  retryable: true;
@@ -7797,14 +7797,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7797
7797
  payload: import("convex/values").VString<string, "required">;
7798
7798
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
7799
7799
  result: import("convex/values").VUnion<{
7800
- reason: "identity_changed" | "revision_changed" | "scope_busy";
7801
- retryable: false;
7802
- status: "conflict";
7803
- } | {
7804
- reason: "policy_invalid";
7805
- retryable: false;
7806
- status: "rejected";
7807
- } | {
7808
7800
  operation: {
7809
7801
  accountId: string;
7810
7802
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7815,6 +7807,14 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7815
7807
  } | {
7816
7808
  enabled: boolean;
7817
7809
  status: "unchanged";
7810
+ } | {
7811
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
7812
+ retryable: false;
7813
+ status: "conflict";
7814
+ } | {
7815
+ reason: "policy_invalid";
7816
+ retryable: false;
7817
+ status: "rejected";
7818
7818
  } | {
7819
7819
  reason: "provider_pending";
7820
7820
  retryable: true;
@@ -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;
@@ -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;
@@ -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;
@@ -2632,6 +2632,14 @@ export declare function setupCredits(): Promise<{
2632
2632
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2633
2633
  requestKey: string;
2634
2634
  result?: {
2635
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2636
+ retryable: false;
2637
+ status: "conflict";
2638
+ } | {
2639
+ reason: "policy_invalid";
2640
+ retryable: false;
2641
+ status: "rejected";
2642
+ } | {
2635
2643
  operation: {
2636
2644
  accountId: string;
2637
2645
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2642,14 +2650,6 @@ export declare function setupCredits(): Promise<{
2642
2650
  } | {
2643
2651
  enabled: boolean;
2644
2652
  status: "unchanged";
2645
- } | {
2646
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2647
- retryable: false;
2648
- status: "conflict";
2649
- } | {
2650
- reason: "policy_invalid";
2651
- retryable: false;
2652
- status: "rejected";
2653
2653
  } | {
2654
2654
  reason: "provider_pending";
2655
2655
  retryable: true;
@@ -2660,6 +2660,14 @@ export declare function setupCredits(): Promise<{
2660
2660
  payload: import("convex/values").VString<string, "required">;
2661
2661
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
2662
2662
  result: import("convex/values").VUnion<{
2663
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2664
+ retryable: false;
2665
+ status: "conflict";
2666
+ } | {
2667
+ reason: "policy_invalid";
2668
+ retryable: false;
2669
+ status: "rejected";
2670
+ } | {
2663
2671
  operation: {
2664
2672
  accountId: string;
2665
2673
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2670,14 +2678,6 @@ export declare function setupCredits(): Promise<{
2670
2678
  } | {
2671
2679
  enabled: boolean;
2672
2680
  status: "unchanged";
2673
- } | {
2674
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2675
- retryable: false;
2676
- status: "conflict";
2677
- } | {
2678
- reason: "policy_invalid";
2679
- retryable: false;
2680
- status: "rejected";
2681
2681
  } | {
2682
2682
  reason: "provider_pending";
2683
2683
  retryable: true;
@@ -263,7 +263,7 @@ call.
263
263
 
264
264
  The result is an opaque private view containing `owner`, `basisJSON` and
265
265
  `operationalAuthority: false`. The separate private C10 factory below can use
266
- that identity. Configure transport, preflight/write actors and public scheduling
266
+ that identity. Configure write transport, write actors and public scheduling
267
267
  remain required, as do genuine generation and operational qualification.
268
268
  Production Source profile arrays remain empty.
269
269
 
@@ -301,7 +301,39 @@ dispatch permission. Receipt retention remains a separate operation; a future
301
301
  configure completion pipeline must retain the complete C9 before publishing
302
302
  receipt event 3 and returning its actual acknowledgement. Future execution also
303
303
  requires its own frontier checks. This channel factory supplies no provider
304
- transport or preflight/write actor and activates no operational Source profile.
304
+ transport or write actor and activates no operational Source profile.
305
+
306
+ ## Private admitted configure preflight
307
+
308
+ `captureAdmittedConfigurePreflight(token)` captures one readonly actor for the
309
+ actual admitted child. Capture and invocation are each spent once, including
310
+ failed calls and invalid extra arguments. The factory requires a unique compiled
311
+ preflight entry linked to the actual returned parent ACK entry and retains its
312
+ predicate identity. Production profile arrays remain empty, so this private path
313
+ still refuses without a qualified Source profile.
314
+
315
+ The actor uses the original parent Owner, SDK client, stock delegate promise and
316
+ class-bound child journal. It never loads the legacy singleton Owner or transport
317
+ source. The fixed plan reads the subscription with its existing expansions,
318
+ price, customer, original coupons in order and attached schedule last. Its 4–44
319
+ requests are GETs with explicit undefined bodies, API version
320
+ `2026-09-30.endive` and zero network retries. No caller can substitute a plan,
321
+ transport, source, clock, predicate or output.
322
+
323
+ The actor reconstructs retained C6 and C3 DATA, compares complete current reads,
324
+ reprojects the immutable C7 request and checks the compiled preflight predicate.
325
+ Observation time comes from the original Owner. Reconstruction preserves the
326
+ original first-dispatch time, key and deadlines. Complete operation, basis,
327
+ head-zero and ACK-null journal checks fence acquisition and output release.
328
+ ACK-null precedes the final head read. These bounded reads do not lock the journal
329
+ against a later concurrent write.
330
+
331
+ Successful completion privately retains the actual output identity, parent ACK
332
+ view and compiled entry pointers. Pending reads, copied output or copied tokens
333
+ cannot register completion. Owner retirement and observed custody changes close
334
+ the actor. The legacy preflight functions retain their original Owner checks
335
+ around shared DATA kernels. This readonly consistency result grants no configure
336
+ POST permission, returned configure ACK custody or public scheduling support.
305
337
 
306
338
  ## Component operation journal
307
339
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fantastic.dev/better-stripe",
3
- "version": "0.103.0",
3
+ "version": "0.104.0",
4
4
  "description": "Convex component for Stripe Accounts v2, subscriptions, metered billing and Connect marketplaces, with React workflows.",
5
5
  "keywords": [
6
6
  "stripe",