@fantastic.dev/better-stripe 0.99.0 → 0.100.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 (40) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts +8 -0
  4. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts.map +1 -1
  5. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js +27 -1
  6. package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js.map +1 -1
  7. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.d.ts +10 -0
  8. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.d.ts.map +1 -0
  9. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.js +49 -0
  10. package/dist/client/billing/renewalAttach/internal/producer/attachAcknowledgement.js.map +1 -0
  11. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts +2 -0
  12. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts.map +1 -1
  13. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js +6 -0
  14. package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js.map +1 -1
  15. package/dist/client/billing/renewalAttach/internal/producer/recoveryEntry.d.ts +9 -0
  16. package/dist/client/billing/renewalAttach/internal/producer/recoveryEntry.d.ts.map +1 -1
  17. package/dist/client/billing/renewalAttach/internal/producer/recoveryEntry.js +22 -0
  18. package/dist/client/billing/renewalAttach/internal/producer/recoveryEntry.js.map +1 -1
  19. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts +9 -0
  20. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.d.ts.map +1 -1
  21. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js +27 -0
  22. package/dist/client/billing/renewalAttach/internal/recovery/recoveryActor.js.map +1 -1
  23. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +32 -32
  24. package/dist/client/connect/payoutSyncTestHelpers.d.ts +16 -16
  25. package/dist/component/balanceFunding/mutations.d.ts +43 -43
  26. package/dist/component/balanceFunding/queries.d.ts +1 -1
  27. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  28. package/dist/component/earnings/triggers.d.ts +16 -16
  29. package/dist/component/payoutRelease/queries.d.ts +2 -2
  30. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  31. package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
  32. package/docs/renewal-context-reads.md +23 -0
  33. package/package.json +1 -1
  34. package/src/client/billing/renewalAttach/internal/operations/initialAttach.ts +28 -1
  35. package/src/client/billing/renewalAttach/internal/producer/attachAcknowledgement.ts +65 -0
  36. package/src/client/billing/renewalAttach/internal/producer/invocationProducer.ts +8 -0
  37. package/src/client/billing/renewalAttach/internal/producer/producerAcknowledgement.integration.test.ts +320 -0
  38. package/src/client/billing/renewalAttach/internal/producer/producerAcknowledgementControls.integration.test.ts +411 -0
  39. package/src/client/billing/renewalAttach/internal/producer/recoveryEntry.ts +35 -1
  40. package/src/client/billing/renewalAttach/internal/recovery/recoveryActor.ts +39 -0
@@ -2632,6 +2632,14 @@ 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
+ } | {
2635
2643
  operation: {
2636
2644
  accountId: string;
2637
2645
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2642,14 +2650,6 @@ export declare function large(count?: number, amount?: number): 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 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
+ } | {
2663
2671
  operation: {
2664
2672
  accountId: string;
2665
2673
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2670,14 +2678,6 @@ export declare function large(count?: number, amount?: number): 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;
@@ -7769,6 +7769,14 @@ 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
+ } | {
7772
7780
  operation: {
7773
7781
  accountId: string;
7774
7782
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7779,14 +7787,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7779
7787
  } | {
7780
7788
  enabled: boolean;
7781
7789
  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,6 +7797,14 @@ 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
+ } | {
7800
7808
  operation: {
7801
7809
  accountId: string;
7802
7810
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -7807,14 +7815,6 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7807
7815
  } | {
7808
7816
  enabled: boolean;
7809
7817
  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;
@@ -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;
@@ -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;
@@ -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;
184
183
  accountId: string;
185
184
  scopeKey: string;
186
185
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
187
186
  version: number;
187
+ retryable?: undefined;
188
188
  status?: undefined;
189
189
  state: "canceled" | "failed" | "pending" | "running" | "succeeded" | "unknown";
190
190
  cancelRequested: boolean;
@@ -5,14 +5,6 @@ export declare function savePreparationHandler(ctx: MutationCtx, args: Infer<typ
5
5
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
6
6
  }>;
7
7
  export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginArgs>): Promise<{
8
- reason: "identity_changed" | "revision_changed" | "scope_busy";
9
- retryable: false;
10
- status: "conflict";
11
- } | {
12
- reason: "policy_invalid";
13
- retryable: false;
14
- status: "rejected";
15
- } | {
16
8
  operation: {
17
9
  accountId: string;
18
10
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -23,6 +15,14 @@ export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginA
23
15
  } | {
24
16
  enabled: boolean;
25
17
  status: "unchanged";
18
+ } | {
19
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
20
+ retryable: false;
21
+ status: "conflict";
22
+ } | {
23
+ reason: "policy_invalid";
24
+ retryable: false;
25
+ status: "rejected";
26
26
  } | {
27
27
  reason: "provider_pending";
28
28
  retryable: true;
@@ -372,14 +372,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
372
372
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
373
373
  requestKey: string;
374
374
  result?: {
375
- reason: "identity_changed" | "revision_changed" | "scope_busy";
376
- retryable: false;
377
- status: "conflict";
378
- } | {
379
- reason: "policy_invalid";
380
- retryable: false;
381
- status: "rejected";
382
- } | {
383
375
  operation: {
384
376
  accountId: string;
385
377
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -390,6 +382,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
390
382
  } | {
391
383
  enabled: boolean;
392
384
  status: "unchanged";
385
+ } | {
386
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
387
+ retryable: false;
388
+ status: "conflict";
389
+ } | {
390
+ reason: "policy_invalid";
391
+ retryable: false;
392
+ status: "rejected";
393
393
  } | {
394
394
  reason: "provider_pending";
395
395
  retryable: true;
@@ -3417,14 +3417,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
3417
3417
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
3418
3418
  requestKey: string;
3419
3419
  result?: {
3420
- reason: "identity_changed" | "revision_changed" | "scope_busy";
3421
- retryable: false;
3422
- status: "conflict";
3423
- } | {
3424
- reason: "policy_invalid";
3425
- retryable: false;
3426
- status: "rejected";
3427
- } | {
3428
3420
  operation: {
3429
3421
  accountId: string;
3430
3422
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -3435,6 +3427,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
3435
3427
  } | {
3436
3428
  enabled: boolean;
3437
3429
  status: "unchanged";
3430
+ } | {
3431
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
3432
+ retryable: false;
3433
+ status: "conflict";
3434
+ } | {
3435
+ reason: "policy_invalid";
3436
+ retryable: false;
3437
+ status: "rejected";
3438
3438
  } | {
3439
3439
  reason: "provider_pending";
3440
3440
  retryable: true;
@@ -163,10 +163,10 @@ export declare const snapshot: import("convex/server").RegisteredQuery<"public",
163
163
  accountId: string;
164
164
  ownerKey: string;
165
165
  }, Promise<{
166
- status: "held";
167
- reason: "snapshot_limit";
168
166
  transfers?: undefined;
169
167
  claims?: undefined;
168
+ status: "held";
169
+ reason: "snapshot_limit";
170
170
  } | {
171
171
  reason?: undefined;
172
172
  status: "ready";
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIlB,CAAC;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiBd,CAAC;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BlB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;GAQf,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,QAAQ;;;;YAsBE,MAAM;YAAmB,gBAAgB;;;;;YAS3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE1B,CAAC"}
1
+ {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/payoutRelease/queries.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIlB,CAAC;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiBd,CAAC;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BlB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;GAQf,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,QAAQ;;;;;;YAsBE,MAAM;YAAmB,gBAAgB;;;YAS3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE1B,CAAC"}
@@ -14,7 +14,7 @@ export declare function checkRollback(ctx: MutationCtx, op: Doc<"processingCostR
14
14
  readonly bindFunding?: undefined;
15
15
  } | {
16
16
  reason?: undefined;
17
- readonly retryable?: undefined;
17
+ retryable?: undefined;
18
18
  readonly status: "ready";
19
19
  readonly bindFunding: boolean;
20
20
  }>;
@@ -202,6 +202,29 @@ ordinary Node and Convex-test mechanics with controlled HTTP, not native or
202
202
  provider qualification. Cross-process recovery cannot revive this Owner or
203
203
  reconstruct actual live response custody from stored DATA.
204
204
 
205
+ The core's private `attachAcknowledgement()` reader retains the exact admitted
206
+ output and receipt identities from one successful initial attachment, explicit
207
+ replay or no-POST acknowledgement resumption. Each completion pipeline records
208
+ its own return privately. The reader accepts no replacement receipt or context,
209
+ checks the original Owner and entry predicates on every successful read, and
210
+ returns one canonical process-local view with `operationalAuthority: false`.
211
+ Serializing that view discards its process-local custody identity.
212
+
213
+ Committed receipt DATA and even a complete receipt3 event can exist while the
214
+ actual pipeline is still awaiting a journal reply. The reader refuses until the
215
+ pipeline completes its successful internal return. An absent completion is not
216
+ cached and does not construct an Owner, sample clocks or allocate a timer. A
217
+ later successful read uses the existing original Owner and budget. Retirement,
218
+ changed predicates, removed class eligibility, copied DATA or unknown lineage
219
+ identities refuse. The same checks apply to cached views, and separate SDK roots
220
+ retain distinct output and receipt identities.
221
+
222
+ This reader supports future configure-source binding to the actual attachment
223
+ receipt. Configure still needs its separately authorized stage operation,
224
+ request/key, journal protocol and runtime factories. The internal return record
225
+ does not establish delivery to a disconnected caller, qualify a provider profile
226
+ or create a public scheduling entrypoint.
227
+
205
228
  ## Component operation journal
206
229
 
207
230
  The component's `renewalOperations` functions retain host-authorized operation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fantastic.dev/better-stripe",
3
- "version": "0.99.0",
3
+ "version": "0.100.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",
@@ -55,9 +55,33 @@ type AttemptCustody = {
55
55
  response: Readonly<{ body: unknown; status: number }> | null;
56
56
  settled: boolean;
57
57
  returnedACK: boolean;
58
+ returnedOutput?: unknown;
58
59
  reserved: boolean;
59
60
  };
60
61
  const attempts = new WeakMap<object, AttemptCustody>();
62
+ /** Exact successful return only; retained journal DATA never populates this reader. */
63
+ export function readInitialAttachAcknowledgement(token: object) {
64
+ need(arguments.length === 1);
65
+ readInitialLineage(token);
66
+ const attempt = attempts.get(token);
67
+ if (!attempt?.returnedACK || !attempt.settled) return null;
68
+ const owner = ownerForInitialLineage(token);
69
+ owner.check();
70
+ const output = attempt.returnedOutput;
71
+ const receipt = closed(output, [
72
+ "status",
73
+ "operationalAuthority",
74
+ "receipt",
75
+ ]).receipt;
76
+ owner.check();
77
+ return Object.freeze({
78
+ originalEntry: attempt.entry,
79
+ retainedPredicate: attempt.retainedPredicate,
80
+ freshPredicate: attempt.freshPredicate,
81
+ output,
82
+ receipt,
83
+ });
84
+ }
61
85
  /** Consumes only actual settled attempt custody; stored DATA cannot register it. */
62
86
  export function takeInitialRecoveryRecord(token: object) {
63
87
  need(arguments.length === 1);
@@ -457,7 +481,10 @@ function initialKernel(token: object | null) {
457
481
  const result = admitInitialOutput(receipt, prepared, request);
458
482
  OWNER.check();
459
483
  control.takePostQuarantine();
460
- if (attempt) attempt.returnedACK = true;
484
+ if (attempt) {
485
+ attempt.returnedOutput = result;
486
+ attempt.returnedACK = true;
487
+ }
461
488
  return result;
462
489
  } catch (error) {
463
490
  let live = false;
@@ -0,0 +1,65 @@
1
+ import { types } from "node:util";
2
+ import { readInitialLineage } from "./lineageAuthority.js";
3
+ import { ownerForInitialLineage } from "./ownerFactory.js";
4
+ import { readInitialAttachAcknowledgement } from "../operations/initialAttach.js";
5
+ import { readReplayAttachAcknowledgement } from "../recovery/recoveryActor.js";
6
+ import { readResumedAttachAcknowledgement } from "./recoveryEntry.js";
7
+ import { COMPILED_INITIAL_ENTRIES } from "../operations/sourceOperations.js";
8
+ import { sourceMethod } from "../operations/initialActorData.js";
9
+
10
+ const views = new WeakMap<
11
+ object,
12
+ Readonly<{
13
+ originalEntry: unknown;
14
+ retainedPredicate: unknown;
15
+ freshPredicate: unknown;
16
+ output: unknown;
17
+ receipt: unknown;
18
+ operationalAuthority: false;
19
+ }>
20
+ >();
21
+ function need(value: unknown): asserts value {
22
+ if (!value) throw Error("ATTACH_ACKNOWLEDGEMENT_UNAVAILABLE");
23
+ }
24
+ /** Read actual completion identity only; no receipt registration or Owner revival. */
25
+ export function readAttachAcknowledgementForLineage(token: object) {
26
+ need(arguments.length === 1);
27
+ readInitialLineage(token);
28
+ need(
29
+ !types.isProxy(COMPILED_INITIAL_ENTRIES) &&
30
+ Array.isArray(COMPILED_INITIAL_ENTRIES) &&
31
+ COMPILED_INITIAL_ENTRIES.length > 0,
32
+ );
33
+ const candidates = [
34
+ readInitialAttachAcknowledgement(token),
35
+ readReplayAttachAcknowledgement(token),
36
+ readResumedAttachAcknowledgement(token),
37
+ ].filter((value) => value !== null);
38
+ need(candidates.length === 1);
39
+ const owner = ownerForInitialLineage(token);
40
+ owner.check();
41
+ const actual = candidates[0];
42
+ need(COMPILED_INITIAL_ENTRIES.includes(actual.originalEntry));
43
+ need(
44
+ sourceMethod(actual.originalEntry, "coversRetained") ===
45
+ actual.retainedPredicate,
46
+ );
47
+ need(
48
+ sourceMethod(actual.originalEntry, "coversFresh") === actual.freshPredicate,
49
+ );
50
+ let view = views.get(token);
51
+ if (view) {
52
+ need(
53
+ view.output === actual.output &&
54
+ view.receipt === actual.receipt &&
55
+ view.originalEntry === actual.originalEntry &&
56
+ view.retainedPredicate === actual.retainedPredicate &&
57
+ view.freshPredicate === actual.freshPredicate,
58
+ );
59
+ } else {
60
+ view = Object.freeze({ ...actual, operationalAuthority: false });
61
+ views.set(token, view);
62
+ }
63
+ owner.check();
64
+ return view;
65
+ }
@@ -1,5 +1,6 @@
1
1
  import { mintInitialLineage, readInitialLineage } from "./lineageAuthority.js";
2
2
  import { captureLiveAttachRecovery } from "./recoveryEntry.js";
3
+ import { readAttachAcknowledgementForLineage } from "./attachAcknowledgement.js";
3
4
  import { ownerForInitialLineage, type InitialOwner } from "./ownerFactory.js";
4
5
  import { ownedAwaitForInitialLineage } from "./ownedAwaitFactory.js";
5
6
  import { stockDelegateForInitialLineage } from "./stockDelegateFactory.js";
@@ -24,6 +25,9 @@ export type InitialInvocationCore = Readonly<{
24
25
  acquire(): Promise<RawAcquisitionResult>;
25
26
  initialAttach(): ReturnType<typeof captureInitialAttachForLineage>;
26
27
  recoverAttach(): ReturnType<typeof captureLiveAttachRecovery>;
28
+ attachAcknowledgement(): ReturnType<
29
+ typeof readAttachAcknowledgementForLineage
30
+ >;
27
31
  operationalAuthority: false;
28
32
  }>;
29
33
 
@@ -90,6 +94,10 @@ export async function captureInitialInvocationCore(
90
94
  if (arguments.length !== 0) throw Error("INITIAL_OPERATION_UNBOUND");
91
95
  return captureLiveAttachRecovery(token);
92
96
  },
97
+ attachAcknowledgement() {
98
+ if (arguments.length !== 0) throw Error("INITIAL_OPERATION_UNBOUND");
99
+ return readAttachAcknowledgementForLineage(token);
100
+ },
93
101
  operationalAuthority: false,
94
102
  });
95
103
  } catch (error) {