@fantastic.dev/better-stripe 0.80.0 → 0.82.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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/client/billing/renewalAggregate/configure.d.ts +35 -0
- package/dist/client/billing/renewalAggregate/configure.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/configure.js +96 -0
- package/dist/client/billing/renewalAggregate/configure.js.map +1 -0
- package/dist/client/billing/renewalAggregate/index.d.ts +3 -0
- package/dist/client/billing/renewalAggregate/index.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/index.js +3 -0
- package/dist/client/billing/renewalAggregate/index.js.map +1 -0
- package/dist/client/billing/renewalAggregate/phaseContext.d.ts +176 -0
- package/dist/client/billing/renewalAggregate/phaseContext.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/phaseContext.js +112 -0
- package/dist/client/billing/renewalAggregate/phaseContext.js.map +1 -0
- package/dist/client/billing/renewalAggregate/phases.d.ts +7 -0
- package/dist/client/billing/renewalAggregate/phases.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/phases.js +192 -0
- package/dist/client/billing/renewalAggregate/phases.js.map +1 -0
- package/dist/client/billing/renewalAggregate/preflight.d.ts +594 -0
- package/dist/client/billing/renewalAggregate/preflight.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/preflight.js +164 -0
- package/dist/client/billing/renewalAggregate/preflight.js.map +1 -0
- package/dist/client/billing/renewalAggregate/profile.d.ts +8 -0
- package/dist/client/billing/renewalAggregate/profile.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/profile.js +60 -0
- package/dist/client/billing/renewalAggregate/profile.js.map +1 -0
- package/dist/client/billing/renewalAggregate/receipt.d.ts +40 -0
- package/dist/client/billing/renewalAggregate/receipt.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/receipt.js +62 -0
- package/dist/client/billing/renewalAggregate/receipt.js.map +1 -0
- package/dist/client/billing/renewalAggregate/shared.d.ts +51 -0
- package/dist/client/billing/renewalAggregate/shared.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/shared.js +87 -0
- package/dist/client/billing/renewalAggregate/shared.js.map +1 -0
- package/dist/client/billing/renewalAggregate/sourceDiscounts.d.ts +42 -0
- package/dist/client/billing/renewalAggregate/sourceDiscounts.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/sourceDiscounts.js +90 -0
- package/dist/client/billing/renewalAggregate/sourceDiscounts.js.map +1 -0
- package/dist/client/billing/renewalAggregate/sourceSettings.d.ts +136 -0
- package/dist/client/billing/renewalAggregate/sourceSettings.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/sourceSettings.js +82 -0
- package/dist/client/billing/renewalAggregate/sourceSettings.js.map +1 -0
- package/dist/client/billing/renewalAggregate/taxRetention.d.ts +8 -0
- package/dist/client/billing/renewalAggregate/taxRetention.d.ts.map +1 -0
- package/dist/client/billing/renewalAggregate/taxRetention.js +23 -0
- package/dist/client/billing/renewalAggregate/taxRetention.js.map +1 -0
- package/dist/client/billing/renewalPriceReplacement.d.ts +2 -0
- package/dist/client/billing/renewalPriceReplacement.d.ts.map +1 -1
- package/dist/client/billing/renewalProjection/discounts.d.ts +20 -0
- package/dist/client/billing/renewalProjection/discounts.d.ts.map +1 -0
- package/dist/client/billing/renewalProjection/discounts.js +121 -0
- package/dist/client/billing/renewalProjection/discounts.js.map +1 -0
- package/dist/client/billing/renewalProjection/itemSettings.d.ts +14 -0
- package/dist/client/billing/renewalProjection/itemSettings.d.ts.map +1 -0
- package/dist/client/billing/renewalProjection/itemSettings.js +41 -0
- package/dist/client/billing/renewalProjection/itemSettings.js.map +1 -0
- package/dist/client/billing/renewalProjection/settings.d.ts +18 -0
- package/dist/client/billing/renewalProjection/settings.d.ts.map +1 -0
- package/dist/client/billing/renewalProjection/settings.js +132 -0
- package/dist/client/billing/renewalProjection/settings.js.map +1 -0
- package/dist/client/billing/renewalProjection/settingsSchema.d.ts +200 -0
- package/dist/client/billing/renewalProjection/settingsSchema.d.ts.map +1 -0
- package/dist/client/billing/renewalProjection/settingsSchema.js +150 -0
- package/dist/client/billing/renewalProjection/settingsSchema.js.map +1 -0
- package/dist/client/billing/renewalReplacementSchema.d.ts +2 -0
- package/dist/client/billing/renewalReplacementSchema.d.ts.map +1 -1
- package/dist/client/billing/renewalReplacementSchema.js +10 -4
- package/dist/client/billing/renewalReplacementSchema.js.map +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +32 -32
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +16 -16
- package/dist/component/balanceFunding/mutations.d.ts +43 -43
- package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
- package/dist/component/usage/allowance.fixtures.d.ts +16 -16
- package/docs/renewal-phase-assembly.md +180 -0
- package/docs/renewal-preservation-mappings.md +94 -0
- package/docs/renewal-price-replacements.md +7 -0
- package/package.json +1 -1
- package/src/client/billing/renewal-discount-projection.test.ts +207 -0
- package/src/client/billing/renewal-item-settings-projection.test.ts +79 -0
- package/src/client/billing/renewal-price-replacement.test.ts +46 -0
- package/src/client/billing/renewal-settings-projection.test.ts +300 -0
- package/src/client/billing/renewalAggregate/configure.test.ts +372 -0
- package/src/client/billing/renewalAggregate/configure.ts +164 -0
- package/src/client/billing/renewalAggregate/index.ts +2 -0
- package/src/client/billing/renewalAggregate/phaseContext.ts +144 -0
- package/src/client/billing/renewalAggregate/phases.ts +247 -0
- package/src/client/billing/renewalAggregate/preflight.test.ts +233 -0
- package/src/client/billing/renewalAggregate/preflight.ts +211 -0
- package/src/client/billing/renewalAggregate/profile.ts +76 -0
- package/src/client/billing/renewalAggregate/receipt.ts +76 -0
- package/src/client/billing/renewalAggregate/shared.ts +106 -0
- package/src/client/billing/renewalAggregate/sourceAndTaxRetention.test.ts +247 -0
- package/src/client/billing/renewalAggregate/sourceDiscounts.ts +112 -0
- package/src/client/billing/renewalAggregate/sourceSettings.ts +88 -0
- package/src/client/billing/renewalAggregate/taxRetention.ts +28 -0
- package/src/client/billing/renewalProjection/discounts.ts +152 -0
- package/src/client/billing/renewalProjection/itemSettings.ts +55 -0
- package/src/client/billing/renewalProjection/settings.ts +163 -0
- package/src/client/billing/renewalProjection/settingsSchema.ts +154 -0
- package/src/client/billing/renewalReplacementSchema.ts +10 -4
|
@@ -2360,14 +2360,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2360
2360
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2361
2361
|
requestKey: string;
|
|
2362
2362
|
result?: {
|
|
2363
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2364
|
-
retryable: false;
|
|
2365
|
-
status: "conflict";
|
|
2366
|
-
} | {
|
|
2367
|
-
reason: "policy_invalid";
|
|
2368
|
-
retryable: false;
|
|
2369
|
-
status: "rejected";
|
|
2370
|
-
} | {
|
|
2371
2363
|
operation: {
|
|
2372
2364
|
accountId: string;
|
|
2373
2365
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2378,6 +2370,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2378
2370
|
} | {
|
|
2379
2371
|
enabled: boolean;
|
|
2380
2372
|
status: "unchanged";
|
|
2373
|
+
} | {
|
|
2374
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2375
|
+
retryable: false;
|
|
2376
|
+
status: "conflict";
|
|
2377
|
+
} | {
|
|
2378
|
+
reason: "policy_invalid";
|
|
2379
|
+
retryable: false;
|
|
2380
|
+
status: "rejected";
|
|
2381
2381
|
} | {
|
|
2382
2382
|
reason: "provider_pending";
|
|
2383
2383
|
retryable: true;
|
|
@@ -2388,14 +2388,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2388
2388
|
payload: import("convex/values").VString<string, "required">;
|
|
2389
2389
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2390
2390
|
result: import("convex/values").VUnion<{
|
|
2391
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2392
|
-
retryable: false;
|
|
2393
|
-
status: "conflict";
|
|
2394
|
-
} | {
|
|
2395
|
-
reason: "policy_invalid";
|
|
2396
|
-
retryable: false;
|
|
2397
|
-
status: "rejected";
|
|
2398
|
-
} | {
|
|
2399
2391
|
operation: {
|
|
2400
2392
|
accountId: string;
|
|
2401
2393
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2406,6 +2398,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2406
2398
|
} | {
|
|
2407
2399
|
enabled: boolean;
|
|
2408
2400
|
status: "unchanged";
|
|
2401
|
+
} | {
|
|
2402
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2403
|
+
retryable: false;
|
|
2404
|
+
status: "conflict";
|
|
2405
|
+
} | {
|
|
2406
|
+
reason: "policy_invalid";
|
|
2407
|
+
retryable: false;
|
|
2408
|
+
status: "rejected";
|
|
2409
2409
|
} | {
|
|
2410
2410
|
reason: "provider_pending";
|
|
2411
2411
|
retryable: true;
|
|
@@ -7215,14 +7215,6 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7215
7215
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
7216
7216
|
requestKey: string;
|
|
7217
7217
|
result?: {
|
|
7218
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7219
|
-
retryable: false;
|
|
7220
|
-
status: "conflict";
|
|
7221
|
-
} | {
|
|
7222
|
-
reason: "policy_invalid";
|
|
7223
|
-
retryable: false;
|
|
7224
|
-
status: "rejected";
|
|
7225
|
-
} | {
|
|
7226
7218
|
operation: {
|
|
7227
7219
|
accountId: string;
|
|
7228
7220
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -7233,6 +7225,14 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7233
7225
|
} | {
|
|
7234
7226
|
enabled: boolean;
|
|
7235
7227
|
status: "unchanged";
|
|
7228
|
+
} | {
|
|
7229
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7230
|
+
retryable: false;
|
|
7231
|
+
status: "conflict";
|
|
7232
|
+
} | {
|
|
7233
|
+
reason: "policy_invalid";
|
|
7234
|
+
retryable: false;
|
|
7235
|
+
status: "rejected";
|
|
7236
7236
|
} | {
|
|
7237
7237
|
reason: "provider_pending";
|
|
7238
7238
|
retryable: true;
|
|
@@ -7243,14 +7243,6 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7243
7243
|
payload: import("convex/values").VString<string, "required">;
|
|
7244
7244
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
7245
7245
|
result: import("convex/values").VUnion<{
|
|
7246
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7247
|
-
retryable: false;
|
|
7248
|
-
status: "conflict";
|
|
7249
|
-
} | {
|
|
7250
|
-
reason: "policy_invalid";
|
|
7251
|
-
retryable: false;
|
|
7252
|
-
status: "rejected";
|
|
7253
|
-
} | {
|
|
7254
7246
|
operation: {
|
|
7255
7247
|
accountId: string;
|
|
7256
7248
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -7261,6 +7253,14 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7261
7253
|
} | {
|
|
7262
7254
|
enabled: boolean;
|
|
7263
7255
|
status: "unchanged";
|
|
7256
|
+
} | {
|
|
7257
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7258
|
+
retryable: false;
|
|
7259
|
+
status: "conflict";
|
|
7260
|
+
} | {
|
|
7261
|
+
reason: "policy_invalid";
|
|
7262
|
+
retryable: false;
|
|
7263
|
+
status: "rejected";
|
|
7264
7264
|
} | {
|
|
7265
7265
|
reason: "provider_pending";
|
|
7266
7266
|
retryable: true;
|
|
@@ -2361,6 +2361,14 @@ export declare function setup(amounts?: number[]): Promise<{
|
|
|
2361
2361
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2362
2362
|
requestKey: string;
|
|
2363
2363
|
result?: {
|
|
2364
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2365
|
+
retryable: false;
|
|
2366
|
+
status: "conflict";
|
|
2367
|
+
} | {
|
|
2368
|
+
reason: "policy_invalid";
|
|
2369
|
+
retryable: false;
|
|
2370
|
+
status: "rejected";
|
|
2371
|
+
} | {
|
|
2364
2372
|
operation: {
|
|
2365
2373
|
accountId: string;
|
|
2366
2374
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2371,14 +2379,6 @@ export declare function setup(amounts?: number[]): Promise<{
|
|
|
2371
2379
|
} | {
|
|
2372
2380
|
enabled: boolean;
|
|
2373
2381
|
status: "unchanged";
|
|
2374
|
-
} | {
|
|
2375
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2376
|
-
retryable: false;
|
|
2377
|
-
status: "conflict";
|
|
2378
|
-
} | {
|
|
2379
|
-
reason: "policy_invalid";
|
|
2380
|
-
retryable: false;
|
|
2381
|
-
status: "rejected";
|
|
2382
2382
|
} | {
|
|
2383
2383
|
reason: "provider_pending";
|
|
2384
2384
|
retryable: true;
|
|
@@ -2389,6 +2389,14 @@ export declare function setup(amounts?: number[]): Promise<{
|
|
|
2389
2389
|
payload: import("convex/values").VString<string, "required">;
|
|
2390
2390
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2391
2391
|
result: import("convex/values").VUnion<{
|
|
2392
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2393
|
+
retryable: false;
|
|
2394
|
+
status: "conflict";
|
|
2395
|
+
} | {
|
|
2396
|
+
reason: "policy_invalid";
|
|
2397
|
+
retryable: false;
|
|
2398
|
+
status: "rejected";
|
|
2399
|
+
} | {
|
|
2392
2400
|
operation: {
|
|
2393
2401
|
accountId: string;
|
|
2394
2402
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2399,14 +2407,6 @@ export declare function setup(amounts?: number[]): Promise<{
|
|
|
2399
2407
|
} | {
|
|
2400
2408
|
enabled: boolean;
|
|
2401
2409
|
status: "unchanged";
|
|
2402
|
-
} | {
|
|
2403
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2404
|
-
retryable: false;
|
|
2405
|
-
status: "conflict";
|
|
2406
|
-
} | {
|
|
2407
|
-
reason: "policy_invalid";
|
|
2408
|
-
retryable: false;
|
|
2409
|
-
status: "rejected";
|
|
2410
2410
|
} | {
|
|
2411
2411
|
reason: "provider_pending";
|
|
2412
2412
|
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,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;
|
|
@@ -2,14 +2,6 @@ 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
|
-
} | {
|
|
13
5
|
operation: {
|
|
14
6
|
accountId: string;
|
|
15
7
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -20,6 +12,14 @@ export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prep
|
|
|
20
12
|
} | {
|
|
21
13
|
enabled: boolean;
|
|
22
14
|
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;
|
|
@@ -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
|
|
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
|
-
|
|
17
|
+
retryable?: undefined;
|
|
18
18
|
readonly status: "ready";
|
|
19
19
|
readonly bindFunding: boolean;
|
|
20
20
|
}>;
|
|
@@ -2351,6 +2351,14 @@ export declare function setupAllowance(): Promise<{
|
|
|
2351
2351
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2352
2352
|
requestKey: string;
|
|
2353
2353
|
result?: {
|
|
2354
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2355
|
+
retryable: false;
|
|
2356
|
+
status: "conflict";
|
|
2357
|
+
} | {
|
|
2358
|
+
reason: "policy_invalid";
|
|
2359
|
+
retryable: false;
|
|
2360
|
+
status: "rejected";
|
|
2361
|
+
} | {
|
|
2354
2362
|
operation: {
|
|
2355
2363
|
accountId: string;
|
|
2356
2364
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2361,14 +2369,6 @@ export declare function setupAllowance(): Promise<{
|
|
|
2361
2369
|
} | {
|
|
2362
2370
|
enabled: boolean;
|
|
2363
2371
|
status: "unchanged";
|
|
2364
|
-
} | {
|
|
2365
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2366
|
-
retryable: false;
|
|
2367
|
-
status: "conflict";
|
|
2368
|
-
} | {
|
|
2369
|
-
reason: "policy_invalid";
|
|
2370
|
-
retryable: false;
|
|
2371
|
-
status: "rejected";
|
|
2372
2372
|
} | {
|
|
2373
2373
|
reason: "provider_pending";
|
|
2374
2374
|
retryable: true;
|
|
@@ -2379,6 +2379,14 @@ export declare function setupAllowance(): Promise<{
|
|
|
2379
2379
|
payload: import("convex/values").VString<string, "required">;
|
|
2380
2380
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2381
2381
|
result: import("convex/values").VUnion<{
|
|
2382
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2383
|
+
retryable: false;
|
|
2384
|
+
status: "conflict";
|
|
2385
|
+
} | {
|
|
2386
|
+
reason: "policy_invalid";
|
|
2387
|
+
retryable: false;
|
|
2388
|
+
status: "rejected";
|
|
2389
|
+
} | {
|
|
2382
2390
|
operation: {
|
|
2383
2391
|
accountId: string;
|
|
2384
2392
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2389,14 +2397,6 @@ export declare function setupAllowance(): Promise<{
|
|
|
2389
2397
|
} | {
|
|
2390
2398
|
enabled: boolean;
|
|
2391
2399
|
status: "unchanged";
|
|
2392
|
-
} | {
|
|
2393
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2394
|
-
retryable: false;
|
|
2395
|
-
status: "conflict";
|
|
2396
|
-
} | {
|
|
2397
|
-
reason: "policy_invalid";
|
|
2398
|
-
retryable: false;
|
|
2399
|
-
status: "rejected";
|
|
2400
2400
|
} | {
|
|
2401
2401
|
reason: "provider_pending";
|
|
2402
2402
|
retryable: true;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Renewal phase assembly
|
|
2
|
+
|
|
3
|
+
The internal `renewalAggregate` module classifies an original subscription and
|
|
4
|
+
builds a bound two-phase configure candidate. It makes no provider call and is
|
|
5
|
+
not a public package entrypoint. It complements the public
|
|
6
|
+
[preparation contract](renewal-price-replacements.md) and internal
|
|
7
|
+
[preservation mappings](renewal-preservation-mappings.md).
|
|
8
|
+
|
|
9
|
+
A candidate always has `providerQualification: "required"`. This describes a
|
|
10
|
+
remaining requirement, not authorization to dispatch. Host-supplied flags cannot
|
|
11
|
+
prove provider behavior, ownership, original configuration or historical intent.
|
|
12
|
+
The HTTP executor must reject unqualified required contexts before a write.
|
|
13
|
+
|
|
14
|
+
## Original-source preflight
|
|
15
|
+
|
|
16
|
+
`preflightRenewalReplacement` accepts:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
{
|
|
20
|
+
prepared,
|
|
21
|
+
freshSubscription,
|
|
22
|
+
targetPrice,
|
|
23
|
+
billingCustomer,
|
|
24
|
+
apiVersion,
|
|
25
|
+
observedAt,
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`prepared` is the privately retained `PreparedRenewalPriceReplacement`, including
|
|
30
|
+
its original snapshots and logical key. The function reconstructs that binding
|
|
31
|
+
instead of trusting its string. Source, target and correlated billing Customer
|
|
32
|
+
reads must agree with the retained snapshots. A missing retained billing Customer
|
|
33
|
+
is unsupported by this aggregate profile.
|
|
34
|
+
|
|
35
|
+
The host obtains fresh provider reads, authorizes the original buyer and target,
|
|
36
|
+
and retains consent and exclusive operation ownership. `observedAt` is a bounded
|
|
37
|
+
Unix timestamp within the original paid item period. It neither proves freshness
|
|
38
|
+
nor changes the expected renewal boundary. Use the actual configured
|
|
39
|
+
`BetterStripe.stripeApiVersion`; this profile supports `2026-09-30.endive` and
|
|
40
|
+
rejects an explicit preview version instead of silently replacing it.
|
|
41
|
+
|
|
42
|
+
Preflight checks exact customer account, customer, subscription, item, current
|
|
43
|
+
price/product, quantity, current period, target and currency. It rejects known
|
|
44
|
+
unsupported original cancellation, trial, pending, threshold, managed and special
|
|
45
|
+
billing state. Legacy source and explicit payment-setting restrictions from
|
|
46
|
+
preparation continue to apply. Valid product IDs may be custom nonblank IDs.
|
|
47
|
+
|
|
48
|
+
The paid-item profile requires an explicitly read `current_trial: null`. A
|
|
49
|
+
nonnull current or future item trial rejects even when the overall subscription
|
|
50
|
+
status is `active`. Missing item-trial evidence is unsupported, not replaced with
|
|
51
|
+
an invented null. Historical subscription trial fields remain in the snapshot.
|
|
52
|
+
|
|
53
|
+
Known financial settings are classified before attachment, including actual
|
|
54
|
+
subscription automatic tax and liability, collection method, invoice settings,
|
|
55
|
+
default payment method, routing and item settings. Invoice `days_until_due` is
|
|
56
|
+
read from the top-level Subscription field in Stripe 23, not from an invented
|
|
57
|
+
Subscription invoice-settings field. Available expanded payment-method customer,
|
|
58
|
+
account and mode facts must correlate with the original buyer.
|
|
59
|
+
|
|
60
|
+
Disabled automatic-tax reasons, unknown liability/collection/issuer enums,
|
|
61
|
+
malformed invoice settings, deleted routing references, invalid transfer
|
|
62
|
+
percentages and incompatible automatic/manual tax combinations reject at this
|
|
63
|
+
stage. A mapping that is knowably unsupported must not be deferred until after a
|
|
64
|
+
mutating attach. Fields available only on the acknowledged schedule are checked
|
|
65
|
+
later, without inventing a phase or acknowledgement during source preflight.
|
|
66
|
+
|
|
67
|
+
Success is `preflighted_for_projection`, with the exact selectors, quantity and
|
|
68
|
+
computed profile. Unsupported source settings return `unsupported`; observed
|
|
69
|
+
binding or source drift returns `conflict`. Success is not pending or effective.
|
|
70
|
+
|
|
71
|
+
## Acknowledged configure candidate
|
|
72
|
+
|
|
73
|
+
`projectRenewalConfiguration` takes the same source inputs plus:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
{
|
|
77
|
+
attachReceipt,
|
|
78
|
+
schedule,
|
|
79
|
+
configureKey,
|
|
80
|
+
firstDispatchedAt,
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The host retains an immutable attach request and its successful provider
|
|
85
|
+
acknowledgement. The attach request binds version, stage, platform scope, actual
|
|
86
|
+
API version, logical identity, POST path, exact `from_subscription` payload,
|
|
87
|
+
explicit key and retained first-dispatch time. Its receipt binds that request,
|
|
88
|
+
the exact acknowledged schedule, subscription, customer account and mode, and the
|
|
89
|
+
complete bounded provider schedule snapshot. These records are unsigned server
|
|
90
|
+
data, not signatures or a provider history service. A schedule found by GET or a
|
|
91
|
+
nonnull subscription association does not establish this operation's ownership.
|
|
92
|
+
|
|
93
|
+
Supply the actual post-attach subscription association. The aggregate validator
|
|
94
|
+
requires the exact acknowledged schedule ID and explicitly permits that known
|
|
95
|
+
transition from the retained original `schedule: null`. It does not replace a
|
|
96
|
+
fresh schedule field with null to reuse the preparation validator.
|
|
97
|
+
|
|
98
|
+
The fresh schedule must still match the complete acknowledged baseline and
|
|
99
|
+
defaults. It must be active, platform scoped, linked to the original buyer and
|
|
100
|
+
subscription, and contain the one expected current phase. Current schedule and
|
|
101
|
+
phase boundaries must agree with the retained paid item period. Unrelated future
|
|
102
|
+
phases, drift, cancellation/release state, active pause configuration and unknown
|
|
103
|
+
mapping fields reject. Unchanged defaults are validated even though the configure
|
|
104
|
+
payload leaves them untouched.
|
|
105
|
+
|
|
106
|
+
Effective collection method, automatic tax and invoice issuer are derived from
|
|
107
|
+
actual phase/default/subscription reads and checked against the already-qualified
|
|
108
|
+
original source context. Metadata actions must already match current original
|
|
109
|
+
subscription/item values. Flattened subscription metadata is not converted into
|
|
110
|
+
new phase actions.
|
|
111
|
+
|
|
112
|
+
An unsupported mapping discovered after a valid acknowledgement returns
|
|
113
|
+
`attached_unconfigured` with the owned schedule ID and reason. The host retains
|
|
114
|
+
the receipt. The SDK does not conceal the gap by releasing/canceling the schedule,
|
|
115
|
+
rolling back, using another subscription POST or claiming success. Receipt,
|
|
116
|
+
association and baseline drift remain conflicts.
|
|
117
|
+
|
|
118
|
+
## Tax values and override levels
|
|
119
|
+
|
|
120
|
+
This finite profile requires explicit tax-rate arrays on original subscription
|
|
121
|
+
and item reads and on acknowledged phase and item reads. Null or absent
|
|
122
|
+
hierarchies are unsupported, not converted into empty arrays. Such cases require
|
|
123
|
+
a separately established inheritance mapping before they can become eligible.
|
|
124
|
+
|
|
125
|
+
Ordered original subscription `default_tax_rates` IDs must match the current
|
|
126
|
+
phase's ordered default IDs. Ordered original item IDs must match the phase
|
|
127
|
+
item's IDs. An empty item array means no explicit item override, so the
|
|
128
|
+
subscription or phase default applies. The renderer uses the supported Emptyable
|
|
129
|
+
clear representation for an acknowledged explicit empty item array.
|
|
130
|
+
|
|
131
|
+
The comparison preserves override level as well as IDs. Introducing an item
|
|
132
|
+
override equal to current phase defaults is rejected, as is removing an original
|
|
133
|
+
item override while its current effective IDs happen to remain the same. Current
|
|
134
|
+
effective equality cannot authorize changing future inheritance behavior.
|
|
135
|
+
Automatic tax cannot coexist with nonempty manual phase or item rates.
|
|
136
|
+
|
|
137
|
+
## Phases, profile and request identity
|
|
138
|
+
|
|
139
|
+
The current phase keeps the provider's exact original start/end, original price,
|
|
140
|
+
quantity, currency, accepted settings and existing discount IDs. Its existing
|
|
141
|
+
known `proration_behavior` is preserved. Top-level update proration is `none`.
|
|
142
|
+
The future phase starts at that verified end, selects the exact target price and
|
|
143
|
+
same quantity, preserves accepted settings/redemptions, and has transition
|
|
144
|
+
proration `none`. It uses the target price's recurring interval/count as a
|
|
145
|
+
duration instead of a locally calculated future end date. End behavior is
|
|
146
|
+
`release`; defaults and arbitrary schedule metadata are not rewritten.
|
|
147
|
+
|
|
148
|
+
The computed profile records actual API version, known classic/flexible billing
|
|
149
|
+
mode, same/changed cadence and ordinary/calendar-edge anchor class. Cadence is the
|
|
150
|
+
exact interval and count, not an amount comparison or an assumed month/year
|
|
151
|
+
conversion. Same cadence uses automatic future anchoring; changed cadence uses
|
|
152
|
+
`phase_start` at the verified renewal only for the supported configuration class.
|
|
153
|
+
Changed cadence with an explicit anchor configuration is unsupported. Reapplying
|
|
154
|
+
a current `phase_start` anchor is rejected unless it agrees with the retained
|
|
155
|
+
numeric original anchor and current phase start.
|
|
156
|
+
|
|
157
|
+
Known monthly/yearly anchors on days 29–31 are classified as calendar edges.
|
|
158
|
+
Unknown modes/configurations, invalid numeric anchors and unqualified profiles
|
|
159
|
+
reject. Classification and synthetic dates do not prove month-end, leap-year,
|
|
160
|
+
invoice, proration, computed phase-end or release behavior on Stripe.
|
|
161
|
+
|
|
162
|
+
Success is `projected_configure_request`. Its complete normalized POST payload is
|
|
163
|
+
bound with stage, platform scope, actual API version, path, explicit configure
|
|
164
|
+
key, logical identity, full attach-receipt identity, full acknowledged baseline,
|
|
165
|
+
unchanged defaults fingerprint and retained first-dispatch time. The configure
|
|
166
|
+
key must differ from the attach key. Keys and times are not silently generated,
|
|
167
|
+
rotated or reset. Bindings and snapshots can contain private billing data; retain
|
|
168
|
+
them only on the trusted server, not in browser responses or logs.
|
|
169
|
+
|
|
170
|
+
The original item ID is bound for authorization. A future price transition is
|
|
171
|
+
not assumed to preserve that ID. Effectiveness requires an observer to correlate
|
|
172
|
+
the owned configured provider phase with the unique target successor item on the
|
|
173
|
+
original subscription. A POST acknowledgement, matching price, elapsed time,
|
|
174
|
+
clock advance, manual release or browser redirect alone is insufficient.
|
|
175
|
+
|
|
176
|
+
Provider qualification, single-attempt HTTP dispatch, retained-key lost-response
|
|
177
|
+
recovery and observation remain separate gates. Snapshot equality is not atomic
|
|
178
|
+
provider compare-and-swap; host serialization cannot exclude Dashboard or other
|
|
179
|
+
provider writers. Required consumer contexts outside this finite profile remain
|
|
180
|
+
open instead of being replaced by a provenance flag or hidden fallback.
|