@fantastic.dev/better-stripe 0.41.0 → 0.42.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 +10 -0
- package/README.md +1 -1
- package/dist/client/balanceFundingWorkflow/client.d.ts +172 -0
- package/dist/client/balanceFundingWorkflow/client.d.ts.map +1 -0
- package/dist/client/balanceFundingWorkflow/client.js +289 -0
- package/dist/client/balanceFundingWorkflow/client.js.map +1 -0
- package/dist/client/billing/balanceFunding.d.ts +5 -0
- package/dist/client/billing/balanceFunding.d.ts.map +1 -1
- package/dist/client/billing/balanceFunding.js +30 -0
- package/dist/client/billing/balanceFunding.js.map +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +366 -2
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +199 -17
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +366 -2
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +199 -17
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +18 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +473 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/balanceFunding/helpers.d.ts +42 -0
- package/dist/component/balanceFunding/helpers.d.ts.map +1 -1
- package/dist/component/balanceFunding/internal/actions.d.ts +39 -0
- package/dist/component/balanceFunding/internal/actions.d.ts.map +1 -0
- package/dist/component/balanceFunding/internal/actions.js +80 -0
- package/dist/component/balanceFunding/internal/actions.js.map +1 -0
- package/dist/component/balanceFunding/internal/mutations.d.ts +55 -0
- package/dist/component/balanceFunding/internal/mutations.d.ts.map +1 -0
- package/dist/component/balanceFunding/internal/mutations.js +54 -0
- package/dist/component/balanceFunding/internal/mutations.js.map +1 -0
- package/dist/component/balanceFunding/internal/queries.d.ts +116 -0
- package/dist/component/balanceFunding/internal/queries.d.ts.map +1 -0
- package/dist/component/balanceFunding/internal/queries.js +35 -0
- package/dist/component/balanceFunding/internal/queries.js.map +1 -0
- package/dist/component/balanceFunding/internal/workflow.d.ts +10 -0
- package/dist/component/balanceFunding/internal/workflow.d.ts.map +1 -0
- package/dist/component/balanceFunding/internal/workflow.js +31 -0
- package/dist/component/balanceFunding/internal/workflow.js.map +1 -0
- package/dist/component/balanceFunding/lifecycleHandlers.d.ts +126 -0
- package/dist/component/balanceFunding/lifecycleHandlers.d.ts.map +1 -1
- package/dist/component/balanceFunding/mutations.d.ts +403 -0
- package/dist/component/balanceFunding/mutations.d.ts.map +1 -1
- package/dist/component/balanceFunding/mutations.js +24 -0
- package/dist/component/balanceFunding/mutations.js.map +1 -1
- package/dist/component/balanceFunding/preparationHandlers.d.ts +42 -0
- package/dist/component/balanceFunding/preparationHandlers.d.ts.map +1 -1
- package/dist/component/balanceFunding/queries.d.ts +78 -0
- package/dist/component/balanceFunding/queries.d.ts.map +1 -1
- package/dist/component/balanceFunding/queries.js +35 -0
- package/dist/component/balanceFunding/queries.js.map +1 -1
- package/dist/component/balanceFunding/receipt.d.ts +5 -0
- package/dist/component/balanceFunding/receipt.d.ts.map +1 -0
- package/dist/component/balanceFunding/receipt.js +37 -0
- package/dist/component/balanceFunding/receipt.js.map +1 -0
- package/dist/component/balanceFunding/schema.d.ts +506 -2
- package/dist/component/balanceFunding/schema.d.ts.map +1 -1
- package/dist/component/balanceFunding/schema.js +2 -0
- package/dist/component/balanceFunding/schema.js.map +1 -1
- package/dist/component/balanceFunding/stateHandlers.d.ts +50 -8
- package/dist/component/balanceFunding/stateHandlers.d.ts.map +1 -1
- package/dist/component/balanceFunding/workflowControl.d.ts +19 -0
- package/dist/component/balanceFunding/workflowControl.d.ts.map +1 -0
- package/dist/component/balanceFunding/workflowControl.js +149 -0
- package/dist/component/balanceFunding/workflowControl.js.map +1 -0
- package/dist/component/balanceFunding/workflowSchema.d.ts +356 -0
- package/dist/component/balanceFunding/workflowSchema.d.ts.map +1 -0
- package/dist/component/balanceFunding/workflowSchema.js +48 -0
- package/dist/component/balanceFunding/workflowSchema.js.map +1 -0
- package/dist/component/balanceFunding/workflowState.d.ts +157 -0
- package/dist/component/balanceFunding/workflowState.d.ts.map +1 -0
- package/dist/component/balanceFunding/workflowState.js +194 -0
- package/dist/component/balanceFunding/workflowState.js.map +1 -0
- package/dist/component/balanceFunding/workflowValidators.d.ts +306 -0
- package/dist/component/balanceFunding/workflowValidators.d.ts.map +1 -0
- package/dist/component/balanceFunding/workflowValidators.js +27 -0
- package/dist/component/balanceFunding/workflowValidators.js.map +1 -0
- package/dist/component/earnings/triggers.d.ts +102 -18
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/schema.d.ts +183 -1
- package/package.json +1 -1
- package/src/client/balanceFundingWorkflow/capture.test.ts +144 -0
- package/src/client/balanceFundingWorkflow/client.ts +419 -0
- package/src/client/billing/balanceFunding.ts +50 -0
- package/src/client/index.ts +15 -0
- package/src/component/_generated/api.ts +18 -0
- package/src/component/_generated/component.ts +524 -0
- package/src/component/balanceFunding/internal/actions.ts +107 -0
- package/src/component/balanceFunding/internal/mutations.ts +66 -0
- package/src/component/balanceFunding/internal/queries.ts +34 -0
- package/src/component/balanceFunding/internal/workflow.ts +49 -0
- package/src/component/balanceFunding/mutations.ts +34 -0
- package/src/component/balanceFunding/queries.ts +38 -0
- package/src/component/balanceFunding/receipt.ts +48 -0
- package/src/component/balanceFunding/schema.ts +2 -0
- package/src/component/balanceFunding/scopeLookup.test.ts +94 -0
- package/src/component/balanceFunding/workflow.fixtures.ts +366 -0
- package/src/component/balanceFunding/workflow.test.ts +552 -0
- package/src/component/balanceFunding/workflowControl.ts +198 -0
- package/src/component/balanceFunding/workflowSchema.ts +78 -0
- package/src/component/balanceFunding/workflowState.ts +285 -0
- package/src/component/balanceFunding/workflowValidators.ts +40 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
export declare const FUNDING_WORKFLOW_VERSION = "balance-funding/v1";
|
|
3
|
+
export declare const providerPhase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
4
|
+
export type ProviderPhase = Infer<typeof providerPhase>;
|
|
5
|
+
export declare const provisioningReceipt: import("convex/values").VObject<{
|
|
6
|
+
customerAccount: string;
|
|
7
|
+
enabled?: boolean | undefined;
|
|
8
|
+
paymentMethodId: string | null;
|
|
9
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
10
|
+
phase: "apply" | "attach" | "create";
|
|
11
|
+
providerApiVersion: string;
|
|
12
|
+
stripeSubscriptionId: string;
|
|
13
|
+
}, {
|
|
14
|
+
phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
15
|
+
customerAccount: import("convex/values").VString<string, "required">;
|
|
16
|
+
stripeSubscriptionId: import("convex/values").VString<string, "required">;
|
|
17
|
+
paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
18
|
+
paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
19
|
+
enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
20
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
21
|
+
}, "required", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
|
|
22
|
+
export type ProvisioningReceipt = Infer<typeof provisioningReceipt>;
|
|
23
|
+
export declare const workflowBinding: import("convex/values").VObject<{
|
|
24
|
+
apply?: {
|
|
25
|
+
receipt?: {
|
|
26
|
+
customerAccount: string;
|
|
27
|
+
enabled?: boolean | undefined;
|
|
28
|
+
paymentMethodId: string | null;
|
|
29
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
30
|
+
phase: "apply" | "attach" | "create";
|
|
31
|
+
providerApiVersion: string;
|
|
32
|
+
stripeSubscriptionId: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
state: "running" | "succeeded" | "unknown";
|
|
35
|
+
} | undefined;
|
|
36
|
+
attach?: {
|
|
37
|
+
receipt?: {
|
|
38
|
+
customerAccount: string;
|
|
39
|
+
enabled?: boolean | undefined;
|
|
40
|
+
paymentMethodId: string | null;
|
|
41
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
42
|
+
phase: "apply" | "attach" | "create";
|
|
43
|
+
providerApiVersion: string;
|
|
44
|
+
stripeSubscriptionId: string;
|
|
45
|
+
} | undefined;
|
|
46
|
+
state: "running" | "succeeded" | "unknown";
|
|
47
|
+
} | undefined;
|
|
48
|
+
create?: {
|
|
49
|
+
receipt?: {
|
|
50
|
+
customerAccount: string;
|
|
51
|
+
enabled?: boolean | undefined;
|
|
52
|
+
paymentMethodId: string | null;
|
|
53
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
54
|
+
phase: "apply" | "attach" | "create";
|
|
55
|
+
providerApiVersion: string;
|
|
56
|
+
stripeSubscriptionId: string;
|
|
57
|
+
} | undefined;
|
|
58
|
+
state: "running" | "succeeded" | "unknown";
|
|
59
|
+
} | undefined;
|
|
60
|
+
definitionVersion: string;
|
|
61
|
+
providerAction: string;
|
|
62
|
+
providerApiVersion: string;
|
|
63
|
+
workflowId?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
workflowId: import("convex/values").VString<string | undefined, "optional">;
|
|
66
|
+
definitionVersion: import("convex/values").VString<string, "required">;
|
|
67
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
68
|
+
providerAction: import("convex/values").VString<string, "required">;
|
|
69
|
+
create: import("convex/values").VObject<{
|
|
70
|
+
receipt?: {
|
|
71
|
+
customerAccount: string;
|
|
72
|
+
enabled?: boolean | undefined;
|
|
73
|
+
paymentMethodId: string | null;
|
|
74
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
75
|
+
phase: "apply" | "attach" | "create";
|
|
76
|
+
providerApiVersion: string;
|
|
77
|
+
stripeSubscriptionId: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
state: "running" | "succeeded" | "unknown";
|
|
80
|
+
} | undefined, {
|
|
81
|
+
state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
|
|
82
|
+
receipt: import("convex/values").VObject<{
|
|
83
|
+
customerAccount: string;
|
|
84
|
+
enabled?: boolean | undefined;
|
|
85
|
+
paymentMethodId: string | null;
|
|
86
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
87
|
+
phase: "apply" | "attach" | "create";
|
|
88
|
+
providerApiVersion: string;
|
|
89
|
+
stripeSubscriptionId: string;
|
|
90
|
+
} | undefined, {
|
|
91
|
+
phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
92
|
+
customerAccount: import("convex/values").VString<string, "required">;
|
|
93
|
+
stripeSubscriptionId: import("convex/values").VString<string, "required">;
|
|
94
|
+
paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
95
|
+
paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
96
|
+
enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
97
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
98
|
+
}, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
|
|
99
|
+
}, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
|
|
100
|
+
attach: import("convex/values").VObject<{
|
|
101
|
+
receipt?: {
|
|
102
|
+
customerAccount: string;
|
|
103
|
+
enabled?: boolean | undefined;
|
|
104
|
+
paymentMethodId: string | null;
|
|
105
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
106
|
+
phase: "apply" | "attach" | "create";
|
|
107
|
+
providerApiVersion: string;
|
|
108
|
+
stripeSubscriptionId: string;
|
|
109
|
+
} | undefined;
|
|
110
|
+
state: "running" | "succeeded" | "unknown";
|
|
111
|
+
} | undefined, {
|
|
112
|
+
state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
|
|
113
|
+
receipt: import("convex/values").VObject<{
|
|
114
|
+
customerAccount: string;
|
|
115
|
+
enabled?: boolean | undefined;
|
|
116
|
+
paymentMethodId: string | null;
|
|
117
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
118
|
+
phase: "apply" | "attach" | "create";
|
|
119
|
+
providerApiVersion: string;
|
|
120
|
+
stripeSubscriptionId: string;
|
|
121
|
+
} | undefined, {
|
|
122
|
+
phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
123
|
+
customerAccount: import("convex/values").VString<string, "required">;
|
|
124
|
+
stripeSubscriptionId: import("convex/values").VString<string, "required">;
|
|
125
|
+
paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
126
|
+
paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
127
|
+
enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
128
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
129
|
+
}, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
|
|
130
|
+
}, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
|
|
131
|
+
apply: import("convex/values").VObject<{
|
|
132
|
+
receipt?: {
|
|
133
|
+
customerAccount: string;
|
|
134
|
+
enabled?: boolean | undefined;
|
|
135
|
+
paymentMethodId: string | null;
|
|
136
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
137
|
+
phase: "apply" | "attach" | "create";
|
|
138
|
+
providerApiVersion: string;
|
|
139
|
+
stripeSubscriptionId: string;
|
|
140
|
+
} | undefined;
|
|
141
|
+
state: "running" | "succeeded" | "unknown";
|
|
142
|
+
} | undefined, {
|
|
143
|
+
state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
|
|
144
|
+
receipt: import("convex/values").VObject<{
|
|
145
|
+
customerAccount: string;
|
|
146
|
+
enabled?: boolean | undefined;
|
|
147
|
+
paymentMethodId: string | null;
|
|
148
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
149
|
+
phase: "apply" | "attach" | "create";
|
|
150
|
+
providerApiVersion: string;
|
|
151
|
+
stripeSubscriptionId: string;
|
|
152
|
+
} | undefined, {
|
|
153
|
+
phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
154
|
+
customerAccount: import("convex/values").VString<string, "required">;
|
|
155
|
+
stripeSubscriptionId: import("convex/values").VString<string, "required">;
|
|
156
|
+
paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
157
|
+
paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
158
|
+
enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
159
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
160
|
+
}, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
|
|
161
|
+
}, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
|
|
162
|
+
}, "required", "apply" | "apply.receipt" | "apply.receipt.customerAccount" | "apply.receipt.enabled" | "apply.receipt.paymentMethodId" | "apply.receipt.paymentMethodTypes" | "apply.receipt.phase" | "apply.receipt.providerApiVersion" | "apply.receipt.stripeSubscriptionId" | "apply.state" | "attach" | "attach.receipt" | "attach.receipt.customerAccount" | "attach.receipt.enabled" | "attach.receipt.paymentMethodId" | "attach.receipt.paymentMethodTypes" | "attach.receipt.phase" | "attach.receipt.providerApiVersion" | "attach.receipt.stripeSubscriptionId" | "attach.state" | "create" | "create.receipt" | "create.receipt.customerAccount" | "create.receipt.enabled" | "create.receipt.paymentMethodId" | "create.receipt.paymentMethodTypes" | "create.receipt.phase" | "create.receipt.providerApiVersion" | "create.receipt.stripeSubscriptionId" | "create.state" | "definitionVersion" | "providerAction" | "providerApiVersion" | "workflowId">;
|
|
163
|
+
export declare const providerUnknown: import("convex/values").VObject<{
|
|
164
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
165
|
+
retryable: false;
|
|
166
|
+
status: "unknown";
|
|
167
|
+
}, {
|
|
168
|
+
status: import("convex/values").VLiteral<"unknown", "required">;
|
|
169
|
+
reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
|
|
170
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
171
|
+
}, "required", "reason" | "retryable" | "status">;
|
|
172
|
+
export declare const providerConflict: import("convex/values").VObject<{
|
|
173
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
174
|
+
retryable: false;
|
|
175
|
+
status: "conflict";
|
|
176
|
+
}, {
|
|
177
|
+
status: import("convex/values").VLiteral<"conflict", "required">;
|
|
178
|
+
reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"identity_changed", "required">, import("convex/values").VLiteral<"revision_changed", "required">], "required", never>;
|
|
179
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
180
|
+
}, "required", "reason" | "retryable" | "status">;
|
|
181
|
+
export declare const providerRejected: import("convex/values").VObject<{
|
|
182
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
183
|
+
retryable: false;
|
|
184
|
+
status: "rejected";
|
|
185
|
+
}, {
|
|
186
|
+
status: import("convex/values").VLiteral<"rejected", "required">;
|
|
187
|
+
reason: import("convex/values").VUnion<"invalid_scope" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">], "required", never>;
|
|
188
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
189
|
+
}, "required", "reason" | "retryable" | "status">;
|
|
190
|
+
export declare const providerNotReady: import("convex/values").VObject<{
|
|
191
|
+
reason: "provider_pending";
|
|
192
|
+
retryable: true;
|
|
193
|
+
status: "not_ready";
|
|
194
|
+
}, {
|
|
195
|
+
status: import("convex/values").VLiteral<"not_ready", "required">;
|
|
196
|
+
reason: import("convex/values").VLiteral<"provider_pending", "required">;
|
|
197
|
+
retryable: import("convex/values").VLiteral<true, "required">;
|
|
198
|
+
}, "required", "reason" | "retryable" | "status">;
|
|
199
|
+
export declare const workflowUnavailable: import("convex/values").VUnion<{
|
|
200
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
201
|
+
retryable: false;
|
|
202
|
+
status: "unknown";
|
|
203
|
+
} | {
|
|
204
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
205
|
+
retryable: false;
|
|
206
|
+
status: "conflict";
|
|
207
|
+
} | {
|
|
208
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
209
|
+
retryable: false;
|
|
210
|
+
status: "rejected";
|
|
211
|
+
} | {
|
|
212
|
+
reason: "provider_pending";
|
|
213
|
+
retryable: true;
|
|
214
|
+
status: "not_ready";
|
|
215
|
+
}, [import("convex/values").VObject<{
|
|
216
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
217
|
+
retryable: false;
|
|
218
|
+
status: "unknown";
|
|
219
|
+
}, {
|
|
220
|
+
status: import("convex/values").VLiteral<"unknown", "required">;
|
|
221
|
+
reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
|
|
222
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
223
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
224
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
225
|
+
retryable: false;
|
|
226
|
+
status: "conflict";
|
|
227
|
+
}, {
|
|
228
|
+
status: import("convex/values").VLiteral<"conflict", "required">;
|
|
229
|
+
reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"identity_changed", "required">, import("convex/values").VLiteral<"revision_changed", "required">], "required", never>;
|
|
230
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
231
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
232
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
233
|
+
retryable: false;
|
|
234
|
+
status: "rejected";
|
|
235
|
+
}, {
|
|
236
|
+
status: import("convex/values").VLiteral<"rejected", "required">;
|
|
237
|
+
reason: import("convex/values").VUnion<"invalid_scope" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">], "required", never>;
|
|
238
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
239
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
240
|
+
reason: "provider_pending";
|
|
241
|
+
retryable: true;
|
|
242
|
+
status: "not_ready";
|
|
243
|
+
}, {
|
|
244
|
+
status: import("convex/values").VLiteral<"not_ready", "required">;
|
|
245
|
+
reason: import("convex/values").VLiteral<"provider_pending", "required">;
|
|
246
|
+
retryable: import("convex/values").VLiteral<true, "required">;
|
|
247
|
+
}, "required", "reason" | "retryable" | "status">], "required", "reason" | "retryable" | "status">;
|
|
248
|
+
export type WorkflowUnavailable = Infer<typeof workflowUnavailable>;
|
|
249
|
+
export declare const providerResult: import("convex/values").VUnion<{
|
|
250
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
251
|
+
retryable: false;
|
|
252
|
+
status: "unknown";
|
|
253
|
+
} | {
|
|
254
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
255
|
+
retryable: false;
|
|
256
|
+
status: "conflict";
|
|
257
|
+
} | {
|
|
258
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
259
|
+
retryable: false;
|
|
260
|
+
status: "rejected";
|
|
261
|
+
} | {
|
|
262
|
+
reason: "provider_pending";
|
|
263
|
+
retryable: true;
|
|
264
|
+
status: "not_ready";
|
|
265
|
+
} | {
|
|
266
|
+
status: "ready";
|
|
267
|
+
value: {
|
|
268
|
+
customerAccount: string;
|
|
269
|
+
enabled?: boolean | undefined;
|
|
270
|
+
paymentMethodId: string | null;
|
|
271
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
272
|
+
phase: "apply" | "attach" | "create";
|
|
273
|
+
providerApiVersion: string;
|
|
274
|
+
stripeSubscriptionId: string;
|
|
275
|
+
};
|
|
276
|
+
}, [import("convex/values").VObject<{
|
|
277
|
+
status: "ready";
|
|
278
|
+
value: {
|
|
279
|
+
customerAccount: string;
|
|
280
|
+
enabled?: boolean | undefined;
|
|
281
|
+
paymentMethodId: string | null;
|
|
282
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
283
|
+
phase: "apply" | "attach" | "create";
|
|
284
|
+
providerApiVersion: string;
|
|
285
|
+
stripeSubscriptionId: string;
|
|
286
|
+
};
|
|
287
|
+
}, {
|
|
288
|
+
status: import("convex/values").VLiteral<"ready", "required">;
|
|
289
|
+
value: import("convex/values").VObject<{
|
|
290
|
+
customerAccount: string;
|
|
291
|
+
enabled?: boolean | undefined;
|
|
292
|
+
paymentMethodId: string | null;
|
|
293
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
294
|
+
phase: "apply" | "attach" | "create";
|
|
295
|
+
providerApiVersion: string;
|
|
296
|
+
stripeSubscriptionId: string;
|
|
297
|
+
}, {
|
|
298
|
+
phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
|
|
299
|
+
customerAccount: import("convex/values").VString<string, "required">;
|
|
300
|
+
stripeSubscriptionId: import("convex/values").VString<string, "required">;
|
|
301
|
+
paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
302
|
+
paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
303
|
+
enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
304
|
+
providerApiVersion: import("convex/values").VString<string, "required">;
|
|
305
|
+
}, "required", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
|
|
306
|
+
}, "required", "status" | "value" | "value.customerAccount" | "value.enabled" | "value.paymentMethodId" | "value.paymentMethodTypes" | "value.phase" | "value.providerApiVersion" | "value.stripeSubscriptionId">, import("convex/values").VUnion<{
|
|
307
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
308
|
+
retryable: false;
|
|
309
|
+
status: "unknown";
|
|
310
|
+
} | {
|
|
311
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
312
|
+
retryable: false;
|
|
313
|
+
status: "conflict";
|
|
314
|
+
} | {
|
|
315
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
316
|
+
retryable: false;
|
|
317
|
+
status: "rejected";
|
|
318
|
+
} | {
|
|
319
|
+
reason: "provider_pending";
|
|
320
|
+
retryable: true;
|
|
321
|
+
status: "not_ready";
|
|
322
|
+
}, [import("convex/values").VObject<{
|
|
323
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
324
|
+
retryable: false;
|
|
325
|
+
status: "unknown";
|
|
326
|
+
}, {
|
|
327
|
+
status: import("convex/values").VLiteral<"unknown", "required">;
|
|
328
|
+
reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
|
|
329
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
330
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
331
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
332
|
+
retryable: false;
|
|
333
|
+
status: "conflict";
|
|
334
|
+
}, {
|
|
335
|
+
status: import("convex/values").VLiteral<"conflict", "required">;
|
|
336
|
+
reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"identity_changed", "required">, import("convex/values").VLiteral<"revision_changed", "required">], "required", never>;
|
|
337
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
338
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
339
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
340
|
+
retryable: false;
|
|
341
|
+
status: "rejected";
|
|
342
|
+
}, {
|
|
343
|
+
status: import("convex/values").VLiteral<"rejected", "required">;
|
|
344
|
+
reason: import("convex/values").VUnion<"invalid_scope" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">], "required", never>;
|
|
345
|
+
retryable: import("convex/values").VLiteral<false, "required">;
|
|
346
|
+
}, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
|
|
347
|
+
reason: "provider_pending";
|
|
348
|
+
retryable: true;
|
|
349
|
+
status: "not_ready";
|
|
350
|
+
}, {
|
|
351
|
+
status: import("convex/values").VLiteral<"not_ready", "required">;
|
|
352
|
+
reason: import("convex/values").VLiteral<"provider_pending", "required">;
|
|
353
|
+
retryable: import("convex/values").VLiteral<true, "required">;
|
|
354
|
+
}, "required", "reason" | "retryable" | "status">], "required", "reason" | "retryable" | "status">], "required", "reason" | "retryable" | "status" | "value" | "value.customerAccount" | "value.enabled" | "value.paymentMethodId" | "value.paymentMethodTypes" | "value.phase" | "value.providerApiVersion" | "value.stripeSubscriptionId">;
|
|
355
|
+
export type ProviderResult = Infer<typeof providerResult>;
|
|
356
|
+
//# sourceMappingURL=workflowSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowSchema.d.ts","sourceRoot":"","sources":["../../../src/component/balanceFunding/workflowSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,eAAO,MAAM,aAAa,2PAIzB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACxD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;kJAQ9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AASpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y6BAQ1B,CAAC;AACH,eAAO,MAAM,eAAe;;;;;;;;iDAO1B,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;iDAQ3B,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;iDAQ3B,CAAC;AACH,eAAO,MAAM,gBAAgB;;;;;;;;iDAI3B,CAAC;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kGAK/B,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4UAG1B,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
export const FUNDING_WORKFLOW_VERSION = "balance-funding/v1";
|
|
3
|
+
export const providerPhase = v.union(v.literal("create"), v.literal("attach"), v.literal("apply"));
|
|
4
|
+
export const provisioningReceipt = v.object({
|
|
5
|
+
phase: providerPhase,
|
|
6
|
+
customerAccount: v.string(),
|
|
7
|
+
stripeSubscriptionId: v.string(),
|
|
8
|
+
paymentMethodId: v.union(v.string(), v.null()),
|
|
9
|
+
paymentMethodTypes: v.optional(v.union(v.array(v.string()), v.null())),
|
|
10
|
+
enabled: v.optional(v.boolean()),
|
|
11
|
+
providerApiVersion: v.string(),
|
|
12
|
+
});
|
|
13
|
+
const phaseState = v.object({
|
|
14
|
+
state: v.union(v.literal("running"), v.literal("unknown"), v.literal("succeeded")),
|
|
15
|
+
receipt: v.optional(provisioningReceipt),
|
|
16
|
+
});
|
|
17
|
+
export const workflowBinding = v.object({
|
|
18
|
+
workflowId: v.optional(v.string()),
|
|
19
|
+
definitionVersion: v.string(),
|
|
20
|
+
providerApiVersion: v.string(),
|
|
21
|
+
providerAction: v.string(),
|
|
22
|
+
create: v.optional(phaseState),
|
|
23
|
+
attach: v.optional(phaseState),
|
|
24
|
+
apply: v.optional(phaseState),
|
|
25
|
+
});
|
|
26
|
+
export const providerUnknown = v.object({
|
|
27
|
+
status: v.literal("unknown"),
|
|
28
|
+
reason: v.union(v.literal("provider_outcome_unknown"), v.literal("history_incomplete")),
|
|
29
|
+
retryable: v.literal(false),
|
|
30
|
+
});
|
|
31
|
+
export const providerConflict = v.object({
|
|
32
|
+
status: v.literal("conflict"),
|
|
33
|
+
reason: v.union(v.literal("scope_busy"), v.literal("identity_changed"), v.literal("revision_changed")),
|
|
34
|
+
retryable: v.literal(false),
|
|
35
|
+
});
|
|
36
|
+
export const providerRejected = v.object({
|
|
37
|
+
status: v.literal("rejected"),
|
|
38
|
+
reason: v.union(v.literal("invalid_scope"), v.literal("unsupported_source"), v.literal("policy_invalid")),
|
|
39
|
+
retryable: v.literal(false),
|
|
40
|
+
});
|
|
41
|
+
export const providerNotReady = v.object({
|
|
42
|
+
status: v.literal("not_ready"),
|
|
43
|
+
reason: v.literal("provider_pending"),
|
|
44
|
+
retryable: v.literal(true),
|
|
45
|
+
});
|
|
46
|
+
export const workflowUnavailable = v.union(providerUnknown, providerConflict, providerRejected, providerNotReady);
|
|
47
|
+
export const providerResult = v.union(v.object({ status: v.literal("ready"), value: provisioningReceipt }), workflowUnavailable);
|
|
48
|
+
//# sourceMappingURL=workflowSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowSchema.js","sourceRoot":"","sources":["../../../src/component/balanceFunding/workflowSchema.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { QueryCtx, MutationCtx } from "../_generated/server.js";
|
|
2
|
+
import type { FundingWorkflowRef, FundingPhaseRef } from "./workflowValidators.js";
|
|
3
|
+
import { type WorkflowUnavailable, type ProvisioningReceipt } from "./workflowSchema.js";
|
|
4
|
+
export declare const unknown: (reason?: "provider_outcome_unknown" | "history_incomplete") => WorkflowUnavailable;
|
|
5
|
+
export declare const conflict: (reason: "identity_changed" | "revision_changed" | "scope_busy") => WorkflowUnavailable;
|
|
6
|
+
export declare class FundingWorkflowError extends Error {
|
|
7
|
+
readonly outcome: WorkflowUnavailable;
|
|
8
|
+
constructor(outcome: WorkflowUnavailable);
|
|
9
|
+
}
|
|
10
|
+
export declare function requireWorkflow(value: unknown, outcome: WorkflowUnavailable): asserts value;
|
|
11
|
+
export declare function readWorkflowContext(ctx: QueryCtx | MutationCtx, args: FundingWorkflowRef, binding?: boolean): Promise<{
|
|
12
|
+
operation: {
|
|
13
|
+
_creationTime: number;
|
|
14
|
+
_id: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
15
|
+
accountId: string;
|
|
16
|
+
cancelRequested: boolean;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
execution?: {
|
|
19
|
+
apply?: {
|
|
20
|
+
receipt?: {
|
|
21
|
+
customerAccount: string;
|
|
22
|
+
enabled?: boolean | undefined;
|
|
23
|
+
paymentMethodId: string | null;
|
|
24
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
25
|
+
phase: "apply" | "attach" | "create";
|
|
26
|
+
providerApiVersion: string;
|
|
27
|
+
stripeSubscriptionId: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
state: "running" | "succeeded" | "unknown";
|
|
30
|
+
} | undefined;
|
|
31
|
+
attach?: {
|
|
32
|
+
receipt?: {
|
|
33
|
+
customerAccount: string;
|
|
34
|
+
enabled?: boolean | undefined;
|
|
35
|
+
paymentMethodId: string | null;
|
|
36
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
37
|
+
phase: "apply" | "attach" | "create";
|
|
38
|
+
providerApiVersion: string;
|
|
39
|
+
stripeSubscriptionId: string;
|
|
40
|
+
} | undefined;
|
|
41
|
+
state: "running" | "succeeded" | "unknown";
|
|
42
|
+
} | undefined;
|
|
43
|
+
create?: {
|
|
44
|
+
receipt?: {
|
|
45
|
+
customerAccount: string;
|
|
46
|
+
enabled?: boolean | undefined;
|
|
47
|
+
paymentMethodId: string | null;
|
|
48
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
49
|
+
phase: "apply" | "attach" | "create";
|
|
50
|
+
providerApiVersion: string;
|
|
51
|
+
stripeSubscriptionId: string;
|
|
52
|
+
} | undefined;
|
|
53
|
+
state: "running" | "succeeded" | "unknown";
|
|
54
|
+
} | undefined;
|
|
55
|
+
definitionVersion: string;
|
|
56
|
+
providerAction: string;
|
|
57
|
+
providerApiVersion: string;
|
|
58
|
+
workflowId?: string | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
failureCode?: "invalid_scope" | "policy_invalid" | "unsupported_source" | undefined;
|
|
61
|
+
kind: "apply" | "prepare";
|
|
62
|
+
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
63
|
+
providerKey: string;
|
|
64
|
+
providerKeys: {
|
|
65
|
+
attach?: string | undefined;
|
|
66
|
+
create?: string | undefined;
|
|
67
|
+
disable: string;
|
|
68
|
+
enable: string;
|
|
69
|
+
};
|
|
70
|
+
receipt?: {
|
|
71
|
+
customerAccount: string;
|
|
72
|
+
paymentMethodId: string | null;
|
|
73
|
+
paymentMethodTypes: string[] | null;
|
|
74
|
+
providerApiVersion: string;
|
|
75
|
+
stripeSubscriptionId: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
scopeKey: string;
|
|
78
|
+
state: "canceled" | "failed" | "pending" | "running" | "succeeded" | "unknown";
|
|
79
|
+
version: number;
|
|
80
|
+
};
|
|
81
|
+
preparation: {
|
|
82
|
+
_creationTime: number;
|
|
83
|
+
_id: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
84
|
+
accountId: string;
|
|
85
|
+
activeOperationId?: import("convex/values").GenericId<"balanceFundingOperations"> | undefined;
|
|
86
|
+
consentAt: number;
|
|
87
|
+
consentReference: string;
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
operationVersion: number;
|
|
90
|
+
preparation: {
|
|
91
|
+
customerAccount: string;
|
|
92
|
+
paymentMethodId?: string | undefined;
|
|
93
|
+
previousPaymentMethodId: string | null;
|
|
94
|
+
previousPaymentMethodTypes: string[] | null;
|
|
95
|
+
stripeSubscriptionId: string;
|
|
96
|
+
};
|
|
97
|
+
preparationOperationId?: import("convex/values").GenericId<"balanceFundingOperations"> | undefined;
|
|
98
|
+
providerApiVersion: string;
|
|
99
|
+
scopeKey: string;
|
|
100
|
+
startsPaused: boolean;
|
|
101
|
+
verified: boolean;
|
|
102
|
+
};
|
|
103
|
+
}>;
|
|
104
|
+
export declare function claimProviderPhaseHandler(ctx: MutationCtx, args: FundingPhaseRef): Promise<{
|
|
105
|
+
reason: "history_incomplete" | "provider_outcome_unknown";
|
|
106
|
+
retryable: false;
|
|
107
|
+
status: "unknown";
|
|
108
|
+
} | {
|
|
109
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
110
|
+
retryable: false;
|
|
111
|
+
status: "conflict";
|
|
112
|
+
} | {
|
|
113
|
+
reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
|
|
114
|
+
retryable: false;
|
|
115
|
+
status: "rejected";
|
|
116
|
+
} | {
|
|
117
|
+
reason: "provider_pending";
|
|
118
|
+
retryable: true;
|
|
119
|
+
status: "not_ready";
|
|
120
|
+
} | {
|
|
121
|
+
status: "ready";
|
|
122
|
+
value: {
|
|
123
|
+
customerAccount: string;
|
|
124
|
+
enabled?: boolean | undefined;
|
|
125
|
+
paymentMethodId: string | null;
|
|
126
|
+
paymentMethodTypes?: string[] | null | undefined;
|
|
127
|
+
phase: "apply" | "attach" | "create";
|
|
128
|
+
providerApiVersion: string;
|
|
129
|
+
stripeSubscriptionId: string;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
value?: undefined;
|
|
133
|
+
status: "claimed";
|
|
134
|
+
mode: "reconcile";
|
|
135
|
+
paymentMethodId?: string | undefined;
|
|
136
|
+
} | {
|
|
137
|
+
value?: undefined;
|
|
138
|
+
status: "claimed";
|
|
139
|
+
mode: "execute";
|
|
140
|
+
paymentMethodId?: string | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
export declare function recordProviderReceiptHandler(ctx: MutationCtx, args: FundingPhaseRef & {
|
|
143
|
+
receipt: ProvisioningReceipt;
|
|
144
|
+
}): Promise<null>;
|
|
145
|
+
export declare function markProviderUnknownHandler(ctx: MutationCtx, args: FundingPhaseRef): Promise<null>;
|
|
146
|
+
export declare function finishFromReceiptsHandler(ctx: MutationCtx, args: FundingWorkflowRef): Promise<null>;
|
|
147
|
+
export declare function phaseKey(op: {
|
|
148
|
+
providerKey: string;
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
providerKeys: {
|
|
151
|
+
create?: string;
|
|
152
|
+
attach?: string;
|
|
153
|
+
enable: string;
|
|
154
|
+
disable: string;
|
|
155
|
+
};
|
|
156
|
+
}, phase: "create" | "attach" | "apply"): string | undefined;
|
|
157
|
+
//# sourceMappingURL=workflowState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowState.d.ts","sourceRoot":"","sources":["../../../src/component/balanceFunding/workflowState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAK7B,eAAO,MAAM,OAAO,YAEd,0BAA0B,GAC1B,oBAAoB,KACvB,mBAAwE,CAAC;AAC5E,eAAO,MAAM,QAAQ,WACX,kBAAkB,GAAG,kBAAkB,GAAG,YAAY,KAC7D,mBAAyE,CAAC;AAC7E,qBAAa,oBAAqB,SAAQ,KAAK;IACjC,QAAQ,CAAC,OAAO,EAAE,mBAAmB;IAAjD,YAAqB,OAAO,EAAE,mBAAmB,EAEhD;CACF;AACD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,KAAK,CAEf;AACD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,QAAQ,GAAG,WAAW,EAC3B,IAAI,EAAE,kBAAkB,EACxB,OAAO,UAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCf;AAQD,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,eAAe;;;;;;;;;;;;;;;;;YAmBF,OAAO;;;;;;;;;;;;YAQd,SAAS;UACX,WAAW;;;;YAeX,SAAS;UACX,SAAS;;GAGlB;AACD,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,eAAe,GAAG;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,iBA0DzD;AACD,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,eAAe,iBAoBtB;AACD,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,kBAAkB,iBA8CzB;AAED,wBAAgB,QAAQ,CACtB,EAAE,EAAE;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,EACD,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,sBAOrC"}
|