@fantastic.dev/better-stripe 0.95.0 → 0.96.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 (63) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.d.ts.map +1 -1
  4. package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.js +2 -5
  5. package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.js.map +1 -1
  6. package/dist/client/billing/renewalAttach/internal/producer/ownerFactory.d.ts.map +1 -1
  7. package/dist/client/billing/renewalAttach/internal/producer/ownerFactory.js +15 -4
  8. package/dist/client/billing/renewalAttach/internal/producer/ownerFactory.js.map +1 -1
  9. package/dist/client/billing/renewalObservation/evidence-invoice-lines.d.ts +27 -0
  10. package/dist/client/billing/renewalObservation/evidence-invoice-lines.d.ts.map +1 -0
  11. package/dist/client/billing/renewalObservation/evidence-invoice-lines.js +164 -0
  12. package/dist/client/billing/renewalObservation/evidence-invoice-lines.js.map +1 -0
  13. package/dist/client/billing/renewalObservation/evidence-invoice.d.ts +4 -0
  14. package/dist/client/billing/renewalObservation/evidence-invoice.d.ts.map +1 -0
  15. package/dist/client/billing/renewalObservation/evidence-invoice.js +190 -0
  16. package/dist/client/billing/renewalObservation/evidence-invoice.js.map +1 -0
  17. package/dist/client/billing/renewalObservation/evidence-material.d.ts +26 -0
  18. package/dist/client/billing/renewalObservation/evidence-material.d.ts.map +1 -0
  19. package/dist/client/billing/renewalObservation/evidence-material.js +253 -0
  20. package/dist/client/billing/renewalObservation/evidence-material.js.map +1 -0
  21. package/dist/client/billing/renewalObservation/evidence-v1-types.d.ts +156 -0
  22. package/dist/client/billing/renewalObservation/evidence-v1-types.d.ts.map +1 -0
  23. package/dist/client/billing/renewalObservation/evidence-v1-types.js +2 -0
  24. package/dist/client/billing/renewalObservation/evidence-v1-types.js.map +1 -0
  25. package/dist/client/billing/renewalObservation/evidence-v1.d.ts +4 -0
  26. package/dist/client/billing/renewalObservation/evidence-v1.d.ts.map +1 -0
  27. package/dist/client/billing/renewalObservation/evidence-v1.js +263 -0
  28. package/dist/client/billing/renewalObservation/evidence-v1.js.map +1 -0
  29. package/dist/client/billing/renewalObservation/terminal-evidence.d.ts +17 -0
  30. package/dist/client/billing/renewalObservation/terminal-evidence.d.ts.map +1 -0
  31. package/dist/client/billing/renewalObservation/terminal-evidence.js +289 -0
  32. package/dist/client/billing/renewalObservation/terminal-evidence.js.map +1 -0
  33. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
  34. package/dist/client/connect/payoutSyncTestHelpers.d.ts +16 -16
  35. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  36. package/dist/component/balanceFunding/mutations.d.ts +43 -43
  37. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  38. package/dist/component/earnings/triggers.d.ts +16 -16
  39. package/dist/component/financialObservations/settlementHelpers.d.ts +3 -3
  40. package/dist/component/payoutRelease/queries.d.ts +2 -2
  41. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  42. package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
  43. package/dist/component/usageCredits/accounting.fixtures.d.ts +16 -16
  44. package/docs/renewal-context-reads.md +9 -5
  45. package/docs/renewal-material-observation.md +50 -0
  46. package/package.json +1 -1
  47. package/src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts +2 -5
  48. package/src/client/billing/renewalAttach/internal/producer/ownerFactory.ts +17 -5
  49. package/src/client/billing/renewalAttach/internal/producer/producerClock.integration.test.ts +175 -0
  50. package/src/client/billing/renewalAttach/internal/producer/producerOwner.integration.test.ts +15 -23
  51. package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +62 -0
  52. package/src/client/billing/renewalObservation/evidence-admission.test.ts +219 -0
  53. package/src/client/billing/renewalObservation/evidence-history.test.ts +187 -0
  54. package/src/client/billing/renewalObservation/evidence-invoice-controls.test.ts +293 -0
  55. package/src/client/billing/renewalObservation/evidence-invoice-lines.ts +238 -0
  56. package/src/client/billing/renewalObservation/evidence-invoice.test.ts +177 -0
  57. package/src/client/billing/renewalObservation/evidence-invoice.ts +271 -0
  58. package/src/client/billing/renewalObservation/evidence-material.test.ts +289 -0
  59. package/src/client/billing/renewalObservation/evidence-material.ts +313 -0
  60. package/src/client/billing/renewalObservation/evidence-v1-types.ts +186 -0
  61. package/src/client/billing/renewalObservation/evidence-v1.test.ts +371 -0
  62. package/src/client/billing/renewalObservation/evidence-v1.ts +286 -0
  63. package/src/client/billing/renewalObservation/terminal-evidence.ts +379 -0
@@ -2642,14 +2642,6 @@ 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
- } | {
2653
2645
  operation: {
2654
2646
  accountId: string;
2655
2647
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2660,6 +2652,14 @@ export declare function setup(amounts?: number[]): Promise<{
2660
2652
  } | {
2661
2653
  enabled: boolean;
2662
2654
  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,14 +2670,6 @@ 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
- } | {
2681
2673
  operation: {
2682
2674
  accountId: string;
2683
2675
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2688,6 +2680,14 @@ export declare function setup(amounts?: number[]): Promise<{
2688
2680
  } | {
2689
2681
  enabled: boolean;
2690
2682
  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,6 +2646,14 @@ 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
+ } | {
2649
2657
  operation: {
2650
2658
  accountId: string;
2651
2659
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2656,14 +2664,6 @@ export declare function setup(scope?: Scope): Promise<{
2656
2664
  } | {
2657
2665
  enabled: boolean;
2658
2666
  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,6 +2674,14 @@ 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
+ } | {
2677
2685
  operation: {
2678
2686
  accountId: string;
2679
2687
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2684,14 +2692,6 @@ export declare function setup(scope?: Scope): Promise<{
2684
2692
  } | {
2685
2693
  enabled: boolean;
2686
2694
  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,6 +9,17 @@ 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
+ } | {
12
23
  reason: "history_incomplete" | "provider_outcome_unknown";
13
24
  retryable: false;
14
25
  status: "unknown";
@@ -24,16 +35,5 @@ export declare const bridge: import("convex/server").RegisteredAction<"internal"
24
35
  reason: "provider_pending";
25
36
  retryable: true;
26
37
  status: "not_ready";
27
- } | {
28
- status: "ready";
29
- value: {
30
- customerAccount: string;
31
- enabled?: boolean | undefined;
32
- paymentMethodId: string | null;
33
- paymentMethodTypes?: string[] | null | undefined;
34
- phase: "apply" | "attach" | "create";
35
- providerApiVersion: string;
36
- stripeSubscriptionId: string;
37
- };
38
38
  }>>;
39
39
  //# sourceMappingURL=actions.d.ts.map
@@ -22,6 +22,14 @@ 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
+ } | {
25
33
  operation: {
26
34
  accountId: string;
27
35
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -32,14 +40,6 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
32
40
  } | {
33
41
  enabled: boolean;
34
42
  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,6 +395,14 @@ 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
+ } | {
398
406
  operation: {
399
407
  accountId: string;
400
408
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -405,14 +413,6 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
405
413
  } | {
406
414
  enabled: boolean;
407
415
  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,6 +595,22 @@ 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
+ } | {
598
614
  operation: {
599
615
  accountId: string;
600
616
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -611,7 +627,16 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
611
627
  version: number;
612
628
  };
613
629
  status: "canceled";
614
- } | {
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<{
615
640
  reason: "history_incomplete" | "provider_outcome_unknown";
616
641
  retryable: false;
617
642
  status: "unknown";
@@ -627,16 +652,7 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
627
652
  reason: "provider_pending";
628
653
  retryable: true;
629
654
  status: "not_ready";
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<{
655
+ } | {
640
656
  operation: {
641
657
  accountId: string;
642
658
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -653,22 +669,6 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
653
669
  version: number;
654
670
  };
655
671
  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;
@@ -5,6 +5,14 @@ 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
+ } | {
8
16
  operation: {
9
17
  accountId: string;
10
18
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -15,14 +23,6 @@ export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginA
15
23
  } | {
16
24
  enabled: boolean;
17
25
  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,6 +372,14 @@ 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
+ } | {
375
383
  operation: {
376
384
  accountId: string;
377
385
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -382,14 +390,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
382
390
  } | {
383
391
  enabled: boolean;
384
392
  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,6 +3417,14 @@ 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
+ } | {
3420
3428
  operation: {
3421
3429
  accountId: string;
3422
3430
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -3427,14 +3435,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
3427
3435
  } | {
3428
3436
  enabled: boolean;
3429
3437
  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;
@@ -9,9 +9,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
9
9
  orgId: string | undefined;
10
10
  ownershipStatus: "ambiguous";
11
11
  } | {
12
+ registrationId?: undefined;
12
13
  userId?: undefined;
13
14
  orgId?: undefined;
14
- registrationId?: undefined;
15
15
  ownershipStatus: "ambiguous";
16
16
  } | {
17
17
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -19,9 +19,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
19
19
  orgId: string | undefined;
20
20
  ownershipStatus: "unknown";
21
21
  } | {
22
+ registrationId?: undefined;
22
23
  userId?: undefined;
23
24
  orgId?: undefined;
24
- registrationId?: undefined;
25
25
  ownershipStatus: "unknown";
26
26
  } | {
27
27
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -29,9 +29,9 @@ export declare function legOwnership(ctx: MutationCtx, bucketKey: string, prior:
29
29
  orgId: string | undefined;
30
30
  ownershipStatus: "contradictory";
31
31
  } | {
32
+ registrationId?: undefined;
32
33
  userId?: undefined;
33
34
  orgId?: undefined;
34
- registrationId?: undefined;
35
35
  ownershipStatus: "contradictory";
36
36
  } | {
37
37
  registrationId: import("convex/values").GenericId<"financialOwnership">;
@@ -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
- transfers?: undefined;
167
- claims?: undefined;
168
166
  status: "held";
169
167
  reason: "snapshot_limit";
168
+ transfers?: undefined;
169
+ claims?: undefined;
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
- retryable?: undefined;
17
+ readonly retryable?: undefined;
18
18
  readonly status: "ready";
19
19
  readonly bindFunding: boolean;
20
20
  }>;
@@ -2632,14 +2632,6 @@ 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
- } | {
2643
2635
  operation: {
2644
2636
  accountId: string;
2645
2637
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2650,6 +2642,14 @@ export declare function setupCredits(): 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 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
- } | {
2671
2663
  operation: {
2672
2664
  accountId: string;
2673
2665
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2678,6 +2670,14 @@ export declare function setupCredits(): 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;
@@ -99,15 +99,19 @@ Each lineage retains one selected stock client, its original raw-request method
99
99
  and receiver, and one canonical Owner. The core samples monotonic time immediately
100
100
  before and after its initial wall-clock sample. It uses the lower monotonic sample
101
101
  with the existing six-field basis formula and the original absolute wall cutoffs.
102
- Capture apertures above one millisecond, u64 overflow and timer spans above
103
- 2,147,483,647 milliseconds refuse. Both clocks must remain monotone and below
104
- their work cutoffs, independently of paid-period and replay-age checks. These are
102
+ The upper capture sample must remain below both projected cutoffs; elapsed
103
+ capture time does not create a new budget. Exact u64 projection overflow refuses.
104
+ Both clocks must remain monotone and below their work cutoffs, independently of
105
+ paid-period and replay-age checks. These are
105
106
  local Node clock assumptions, not provider or real-time execution qualification.
106
107
 
107
108
  The core awaits the actual component basis-binding result before returning.
108
109
  Pending continuations retain their own Owner; retiring one lineage cannot retire
109
- another. Deadline notification uses a Node timer, whose callback can be delayed
110
- by event-loop suspension. Every continuation therefore checks both clocks before
110
+ another. Deadline notification uses Node timer chunks capped at 2,147,483,647
111
+ milliseconds and bounded by the earlier remaining wall or monotonic work cutoff.
112
+ Each callback rechecks both clocks and the original policy before rearming. The
113
+ later final deadline is not a timer span limit. Event-loop suspension can delay
114
+ callbacks. Every continuation therefore checks both clocks before
111
115
  returning a value. Retirement is irreversible and never extends either original
112
116
  cutoff. Legacy actors still use their separate dormant identity; extracting and
113
117
  wiring their per-invocation kernels remains required before runtime activation.
@@ -180,3 +180,53 @@ pending/effective classes and invoice-pointer limitation. Historical and termina
180
180
  provider qualification, successor invoice evidence and genuine Source binding
181
181
  remain separate requirements. These sequential reads do not atomically exclude other provider
182
182
  writers or establish payment, authentication or entitlement.
183
+
184
+ ## Private evidence analyzer development
185
+
186
+ The private version 1 evidence interface separates schedule lifecycle facts,
187
+ current material, historical snapshot consistency and invoice correlation. Its
188
+ `apiVersion` names the analyzer's supported `2026-09-30.endive` profile. It does
189
+ not authenticate the supplied resource bodies.
190
+
191
+ The private analyzer admits the complete bounded input and reconstructs the
192
+ original V2 configuration before reporting owned lifecycle facts. Canceled and
193
+ released facts do not imply natural completion. Completion requires the complete
194
+ owned phase history and defaults, a valid terminal timestamp and a proven target
195
+ end. Supplied configure receipts are reconstructed and checked against the
196
+ complete original configuration and the maintained full historical baseline.
197
+ That baseline alone can agree on an arbitrary future end, so this profile also
198
+ requires the existing narrow UTC weekly requested-duration predicate. Unproven
199
+ calendar-duration profiles remain `unknown`; no month arithmetic is invented.
200
+ The same weekly predicate remains required when the configure receipt is null.
201
+ It has no public SDK export or provider transport. Existing observation methods
202
+ retain their documented behavior.
203
+
204
+ The input keeps complete raw resources and distinguishes absent fields from
205
+ own `null` values. Current material reuses the maintained full attached, pending
206
+ and active comparison, including settings, unique item identity and native
207
+ period. If `latest_invoice` advances, the analyzer first recomputes the complete
208
+ paired invoice proof. Only then may a separate comparison copy replace that
209
+ single pointer with its retained original value; the actual input, original C1
210
+ source and all request hashes remain unchanged. Full material drift still
211
+ refuses a match. A valid billing line alone cannot establish full effectiveness.
212
+
213
+ Invoice correlation uses the pinned Endive parent/pricing paths, the original
214
+ Subscription and its actual item identities, and exact native `(start, end)`
215
+ pairs. Original invoice reasons are `subscription_create` or `subscription_cycle`;
216
+ renewal reason is `subscription_cycle`. The first profile checks every supplied
217
+ page, at most two pages of 100 rows, and requires one eligible line. Incomplete,
218
+ duplicate or nonprogressing inventories remain unknown. Decimal strings are
219
+ compared exactly without floating-point conversion and retain their wire text.
220
+ No `end - 1` or calendar approximation is applied. Invoice status, including
221
+ `paid`, provides no payment, settlement, entitlement or exclusive-cause authority.
222
+
223
+ A supplied historical snapshot is checked as complete unsigned material for the
224
+ same original operation. It can match while live terminal or settings data
225
+ conflicts; the axes remain separate. Terminal-only reads do not stand in for a
226
+ full historical active snapshot. These comparisons do not prove that a snapshot
227
+ was observed at an actual past time or supply a durable acquisition channel.
228
+
229
+ The analyzer is private and performs no provider calls. Existing public and
230
+ owned observation methods retain their output layouts and read profile. Actual
231
+ Endive provider qualification, historical acquisition and operational Source
232
+ binding remain separate requirements.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fantastic.dev/better-stripe",
3
- "version": "0.95.0",
3
+ "version": "0.96.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",
@@ -9,7 +9,6 @@ const method = Object.getOwnPropertyDescriptor(
9
9
  "rawRequest",
10
10
  )?.value;
11
11
  const u64 = 18446744073709551615n;
12
- const timerLimit = 2147483647;
13
12
  function stop(): never {
14
13
  throw Error("INITIAL_LINEAGE_UNBOUND");
15
14
  }
@@ -94,9 +93,7 @@ export function mintInitialLineage(
94
93
  lo < 0n ||
95
94
  hi < lo ||
96
95
  hi > u64 ||
97
- hi - lo > 1000000n ||
98
- startWallMs >= policy.workEndWallMs ||
99
- policy.endWallMs - startWallMs > timerLimit
96
+ startWallMs >= policy.workEndWallMs
100
97
  )
101
98
  stop();
102
99
  const basis = Object.freeze({
@@ -108,7 +105,7 @@ export function mintInitialLineage(
108
105
  endWallMs: policy.endWallMs,
109
106
  endNs: lo + (BigInt(policy.endWallMs) - BigInt(startWallMs)) * 1000000n,
110
107
  });
111
- if (basis.endNs > u64) stop();
108
+ if (basis.endNs > u64 || hi >= basis.workEndNs || hi >= basis.endNs) stop();
112
109
  const rawBasisJSON = JSON.stringify({
113
110
  startWallMs,
114
111
  startNsDecimal: lo.toString(),
@@ -107,14 +107,26 @@ export function ownerForInitialLineage(token: object): InitialOwner {
107
107
  },
108
108
  });
109
109
  owners.set(token, owner);
110
- try {
111
- check();
112
- // Absolute original cutoff, never a new budget when a continuation resumes.
110
+ function schedule() {
111
+ const sample = check();
112
+ const monotonicMs = Number(
113
+ (basis.workEndNs - sample.ns + 999999n) / 1000000n,
114
+ );
115
+ // Bound each timer chunk, retaining both original absolute cutoffs.
113
116
  timer = setTimeout(
114
- retire,
115
- Math.max(0, basis.workEndWallMs - lineage.wall()),
117
+ () => {
118
+ try {
119
+ schedule();
120
+ } catch {
121
+ retire();
122
+ }
123
+ },
124
+ Math.min(2147483647, basis.workEndWallMs - sample.wallMs, monotonicMs),
116
125
  );
117
126
  timer.unref?.();
127
+ }
128
+ try {
129
+ schedule();
118
130
  check();
119
131
  return owner;
120
132
  } catch (error) {