@fantastic.dev/better-stripe 0.17.1 → 0.18.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 +6 -0
- package/README.md +7 -1
- package/dist/client/connect/payouts.d.ts +3 -2
- package/dist/client/connect/payouts.d.ts.map +1 -1
- package/dist/client/connect/payouts.js.map +1 -1
- package/dist/client/index.d.ts +4 -8
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +5 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/payoutPolicy.d.ts +81 -0
- package/dist/client/payoutPolicy.d.ts.map +1 -0
- package/dist/client/payoutPolicy.js +262 -0
- package/dist/client/payoutPolicy.js.map +1 -0
- package/dist/component/_generated/component.d.ts +273 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/earnings/triggers.d.ts +150 -0
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/payoutPolicy/helpers.d.ts +51 -0
- package/dist/component/payoutPolicy/helpers.d.ts.map +1 -0
- package/dist/component/payoutPolicy/helpers.js +68 -0
- package/dist/component/payoutPolicy/helpers.js.map +1 -0
- package/dist/component/payoutPolicy/mutations.d.ts +172 -0
- package/dist/component/payoutPolicy/mutations.d.ts.map +1 -0
- package/dist/component/payoutPolicy/mutations.js +191 -0
- package/dist/component/payoutPolicy/mutations.js.map +1 -0
- package/dist/component/payoutPolicy/queries.d.ts +97 -0
- package/dist/component/payoutPolicy/queries.d.ts.map +1 -0
- package/dist/component/payoutPolicy/queries.js +51 -0
- package/dist/component/payoutPolicy/queries.js.map +1 -0
- package/dist/component/payoutPolicy/schema.d.ts +396 -0
- package/dist/component/payoutPolicy/schema.d.ts.map +1 -0
- package/dist/component/payoutPolicy/schema.js +54 -0
- package/dist/component/payoutPolicy/schema.js.map +1 -0
- package/dist/component/schema.d.ts +131 -0
- package/dist/component/schema.js +3 -0
- package/dist/component/schema.js.map +1 -1
- package/docs/settlement.md +62 -0
- package/package.json +1 -1
- package/src/client/connect/payouts.ts +10 -8
- package/src/client/index.ts +7 -11
- package/src/client/payoutPolicy.test.ts +320 -0
- package/src/client/payoutPolicy.ts +409 -0
- package/src/component/_generated/api.ts +6 -0
- package/src/component/_generated/component.ts +280 -0
- package/src/component/payout-policy.test.ts +248 -0
- package/src/component/payoutPolicy/helpers.ts +88 -0
- package/src/component/payoutPolicy/mutations.ts +225 -0
- package/src/component/payoutPolicy/queries.ts +56 -0
- package/src/component/payoutPolicy/schema.ts +67 -0
- package/src/component/schema.ts +3 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { runMutationOrThrow } from "./helpers.js";
|
|
2
|
+
import { componentRef } from "./webhooks/helpers.js";
|
|
3
|
+
import { canonicalSchedule, canonicalThresholds, validateScope, } from "../component/payoutPolicy/helpers.js";
|
|
4
|
+
function readSchedule(settings) {
|
|
5
|
+
const s = settings.payments.payouts?.schedule;
|
|
6
|
+
if (!s?.interval ||
|
|
7
|
+
!["daily", "weekly", "monthly", "manual"].includes(s.interval))
|
|
8
|
+
throw new Error("Provider payout schedule is unavailable.");
|
|
9
|
+
return canonicalSchedule({
|
|
10
|
+
interval: s.interval,
|
|
11
|
+
weeklyDays: s.weekly_payout_days,
|
|
12
|
+
monthlyDays: s.monthly_payout_days,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function permissionDenied(error) {
|
|
16
|
+
return error instanceof Error &&
|
|
17
|
+
"type" in error &&
|
|
18
|
+
error.type === "StripePermissionError"
|
|
19
|
+
? { status: "unsupported", reason: "provider_permission_denied" }
|
|
20
|
+
: null;
|
|
21
|
+
}
|
|
22
|
+
const equal = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
23
|
+
const toProvider = (s) => ({
|
|
24
|
+
interval: s.interval,
|
|
25
|
+
...(s.weeklyDays ? { weekly_payout_days: s.weeklyDays } : {}),
|
|
26
|
+
...(s.monthlyDays ? { monthly_payout_days: s.monthlyDays } : {}),
|
|
27
|
+
});
|
|
28
|
+
/** Host authenticates owner/policy/consent. Provider I/O stays in this package. */
|
|
29
|
+
export class PayoutPolicyClient {
|
|
30
|
+
component;
|
|
31
|
+
provider;
|
|
32
|
+
constructor(component, provider) {
|
|
33
|
+
this.component = component;
|
|
34
|
+
this.provider = provider;
|
|
35
|
+
}
|
|
36
|
+
async get(ctx, scope) {
|
|
37
|
+
validateScope(scope);
|
|
38
|
+
return ctx.runQuery(componentRef(this.component, "payoutPolicy/queries/get"), { accountId: scope.accountId, ownerKey: scope.ownerKey });
|
|
39
|
+
}
|
|
40
|
+
async operation(ctx, args) {
|
|
41
|
+
validateScope(args);
|
|
42
|
+
return ctx.runQuery(componentRef(this.component, "payoutPolicy/queries/operation"), {
|
|
43
|
+
accountId: args.accountId,
|
|
44
|
+
ownerKey: args.ownerKey,
|
|
45
|
+
operationKey: args.operationKey,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async due(ctx, paginationOpts) {
|
|
49
|
+
return ctx.runQuery(componentRef(this.component, "payoutPolicy/queries/due"), { now: Date.now(), paginationOpts });
|
|
50
|
+
}
|
|
51
|
+
async readControls(scope, requireExclusive = true, previousCountry) {
|
|
52
|
+
const stripe = this.provider();
|
|
53
|
+
const account = await stripe.v2.core.accounts.retrieve(scope.accountId, {
|
|
54
|
+
include: ["identity"],
|
|
55
|
+
});
|
|
56
|
+
if (account.id !== scope.accountId)
|
|
57
|
+
throw new Error("Provider payout account identity does not match.");
|
|
58
|
+
if (account.closed || (requireExclusive && account.dashboard !== "none"))
|
|
59
|
+
return { status: "unsupported", reason: "payout_control_unverified" };
|
|
60
|
+
const country = account.identity?.country ?? previousCountry;
|
|
61
|
+
if (!country || !/^[A-Z]{2}$/.test(country))
|
|
62
|
+
return { status: "unsupported", reason: "country_unavailable" };
|
|
63
|
+
const settings = await stripe.balanceSettings.retrieve(undefined, {
|
|
64
|
+
stripeAccount: scope.accountId,
|
|
65
|
+
});
|
|
66
|
+
if (requireExclusive && settings.payments.payouts?.status !== "enabled")
|
|
67
|
+
return { status: "unsupported", reason: "payouts_unavailable" };
|
|
68
|
+
return {
|
|
69
|
+
country,
|
|
70
|
+
schedule: readSchedule(settings),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async controls(scope, requireExclusive = true, previousCountry) {
|
|
74
|
+
try {
|
|
75
|
+
return await this.readControls(scope, requireExclusive, previousCountry);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const denied = permissionDenied(error);
|
|
79
|
+
if (denied)
|
|
80
|
+
return denied;
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async migrationPreflight(scope) {
|
|
85
|
+
const stripe = this.provider();
|
|
86
|
+
const balance = await stripe.balance.retrieve(undefined, {
|
|
87
|
+
stripeAccount: scope.accountId,
|
|
88
|
+
});
|
|
89
|
+
if ([...balance.available, ...balance.pending].some((value) => value.amount !== 0))
|
|
90
|
+
return { status: "migration_required", reason: "existing_balance" };
|
|
91
|
+
for (const status of ["pending", "in_transit"]) {
|
|
92
|
+
const payouts = await stripe.payouts.list({ status, limit: 1 }, { stripeAccount: scope.accountId });
|
|
93
|
+
if (payouts.has_more || payouts.data.length)
|
|
94
|
+
return { status: "migration_required", reason: "in_flight_payouts" };
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
/** Persist restoration intent first. Existing mixed funds require explicit adoption; never infer ownership. */
|
|
99
|
+
async prepare(ctx, opts) {
|
|
100
|
+
const observedAt = Date.now();
|
|
101
|
+
validateScope(opts);
|
|
102
|
+
if (opts.mode !== "custom" && opts.mode !== "stripe_managed")
|
|
103
|
+
throw new Error("Invalid payout policy mode.");
|
|
104
|
+
if (!Number.isSafeInteger(opts.expectedRevision) ||
|
|
105
|
+
opts.expectedRevision < -1)
|
|
106
|
+
throw new Error("Invalid payout policy revision.");
|
|
107
|
+
if (!opts.operationKey?.trim() ||
|
|
108
|
+
opts.operationKey.length > 180 ||
|
|
109
|
+
/[\r\n]/.test(opts.operationKey))
|
|
110
|
+
throw new Error("Invalid payout policy operation identity.");
|
|
111
|
+
if (opts.mode === "custom" && opts.consent !== true)
|
|
112
|
+
throw new Error("Explicit consent is required for custom payout scheduling.");
|
|
113
|
+
const thresholds = canonicalThresholds(opts.thresholds, opts.mode === "custom");
|
|
114
|
+
const prior = await this.operation(ctx, opts);
|
|
115
|
+
if (prior) {
|
|
116
|
+
if (prior.mode !== opts.mode ||
|
|
117
|
+
prior.expectedRevision !== opts.expectedRevision ||
|
|
118
|
+
!equal(prior.thresholds, thresholds))
|
|
119
|
+
throw new Error("Payout policy operation identity cannot be reused.");
|
|
120
|
+
return { status: "prepared", operation: prior };
|
|
121
|
+
}
|
|
122
|
+
const policy = await this.get(ctx, opts);
|
|
123
|
+
if (policy?.status === "changing")
|
|
124
|
+
throw new Error("A payout policy operation is pending.");
|
|
125
|
+
if ((policy?.revision ?? -1) !== opts.expectedRevision)
|
|
126
|
+
throw new Error("Payout policy revision changed.");
|
|
127
|
+
const controls = await this.controls(opts, opts.mode === "custom", policy?.country);
|
|
128
|
+
if ("status" in controls)
|
|
129
|
+
return controls;
|
|
130
|
+
if (opts.mode === "custom" && policy?.mode !== "custom") {
|
|
131
|
+
if (controls.schedule.interval === "manual")
|
|
132
|
+
return {
|
|
133
|
+
status: "migration_required",
|
|
134
|
+
reason: "existing_manual_schedule",
|
|
135
|
+
};
|
|
136
|
+
const migration = await this.migrationPreflight(opts);
|
|
137
|
+
if (migration)
|
|
138
|
+
return migration;
|
|
139
|
+
}
|
|
140
|
+
const operation = (await runMutationOrThrow(ctx, componentRef(this.component, "payoutPolicy/mutations/prepare"), {
|
|
141
|
+
accountId: opts.accountId,
|
|
142
|
+
ownerKey: opts.ownerKey,
|
|
143
|
+
operationKey: opts.operationKey,
|
|
144
|
+
expectedRevision: opts.expectedRevision,
|
|
145
|
+
mode: opts.mode,
|
|
146
|
+
thresholds,
|
|
147
|
+
country: controls.country,
|
|
148
|
+
observedSchedule: controls.schedule,
|
|
149
|
+
observedAt,
|
|
150
|
+
}));
|
|
151
|
+
return { status: "prepared", operation };
|
|
152
|
+
}
|
|
153
|
+
/** Unknown provider outcomes remain pending; retry uses the persisted target and request identity. */
|
|
154
|
+
async apply(ctx, args) {
|
|
155
|
+
const operation = await this.operation(ctx, args);
|
|
156
|
+
if (!operation)
|
|
157
|
+
throw new Error("Payout policy operation is unavailable.");
|
|
158
|
+
if (operation.status === "complete")
|
|
159
|
+
return { status: "ready", operation };
|
|
160
|
+
if (operation.status === "canceled")
|
|
161
|
+
return { status: "canceled", operation };
|
|
162
|
+
const controls = await this.controls(args, operation.mode === "custom", operation.country);
|
|
163
|
+
const policy = await this.get(ctx, args);
|
|
164
|
+
if (operation.mode === "custom" &&
|
|
165
|
+
!operation.attempted &&
|
|
166
|
+
policy?.holdDeadline &&
|
|
167
|
+
policy.holdDeadline <= Date.now() &&
|
|
168
|
+
!("status" in controls) &&
|
|
169
|
+
equal(controls.schedule, operation.observedSchedule)) {
|
|
170
|
+
const canceled = (await runMutationOrThrow(ctx, componentRef(this.component, "payoutPolicy/mutations/cancelUnattempted"), { ...args, observedSchedule: controls.schedule }));
|
|
171
|
+
return { status: "canceled", operation: canceled };
|
|
172
|
+
}
|
|
173
|
+
if ("status" in controls)
|
|
174
|
+
return controls;
|
|
175
|
+
if (operation.mode === "custom" && controls.country !== operation.country)
|
|
176
|
+
return { status: "schedule_drift" };
|
|
177
|
+
if (!equal(controls.schedule, operation.targetSchedule)) {
|
|
178
|
+
if (!equal(controls.schedule, operation.observedSchedule))
|
|
179
|
+
return { status: "schedule_drift" };
|
|
180
|
+
if (operation.mode === "custom" &&
|
|
181
|
+
!operation.attempted &&
|
|
182
|
+
policy?.mode === "stripe_managed") {
|
|
183
|
+
const migration = await this.migrationPreflight(args);
|
|
184
|
+
if (migration) {
|
|
185
|
+
await runMutationOrThrow(ctx, componentRef(this.component, "payoutPolicy/mutations/cancelUnattempted"), { ...args, observedSchedule: controls.schedule });
|
|
186
|
+
return migration;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
await runMutationOrThrow(ctx, componentRef(this.component, "payoutPolicy/mutations/beginAttempt"), args);
|
|
190
|
+
try {
|
|
191
|
+
await this.provider().balanceSettings.update({
|
|
192
|
+
payments: {
|
|
193
|
+
payouts: { schedule: toProvider(operation.targetSchedule) },
|
|
194
|
+
},
|
|
195
|
+
}, {
|
|
196
|
+
stripeAccount: args.accountId,
|
|
197
|
+
idempotencyKey: `bs:payout-policy:${operation.operationKey}`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
const denied = permissionDenied(error);
|
|
202
|
+
if (denied)
|
|
203
|
+
return denied;
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const verified = await this.controls(args, operation.mode === "custom", operation.country);
|
|
208
|
+
if ("status" in verified)
|
|
209
|
+
return verified;
|
|
210
|
+
if ((operation.mode === "custom" && verified.country !== operation.country) ||
|
|
211
|
+
!equal(verified.schedule, operation.targetSchedule))
|
|
212
|
+
return { status: "schedule_drift" };
|
|
213
|
+
const confirmed = (await runMutationOrThrow(ctx, componentRef(this.component, "payoutPolicy/mutations/confirm"), { ...args, observedSchedule: verified.schedule }));
|
|
214
|
+
return { status: "ready", operation: confirmed };
|
|
215
|
+
}
|
|
216
|
+
/** Call before every scheduled payout; stored ready state alone is not proof of live controls. */
|
|
217
|
+
async verify(ctx, scope) {
|
|
218
|
+
const policy = await this.get(ctx, scope);
|
|
219
|
+
if (policy?.status === "changing")
|
|
220
|
+
return { status: "pending_operation" };
|
|
221
|
+
if (!policy || policy.mode !== "custom")
|
|
222
|
+
return { status: "not_configured" };
|
|
223
|
+
if (!policy.holdDeadline || policy.holdDeadline <= Date.now())
|
|
224
|
+
return { status: "expired" };
|
|
225
|
+
const controls = await this.controls(scope);
|
|
226
|
+
if ("status" in controls)
|
|
227
|
+
return controls;
|
|
228
|
+
if (controls.country !== policy.country ||
|
|
229
|
+
controls.schedule.interval !== "manual")
|
|
230
|
+
return { status: "schedule_drift" };
|
|
231
|
+
return { status: "verified", policy, providerMinimum: null };
|
|
232
|
+
}
|
|
233
|
+
/** A host cron must page due() and call expire(); payout execution is a separate boundary. */
|
|
234
|
+
async expire(ctx, scope) {
|
|
235
|
+
let policy = await this.get(ctx, scope);
|
|
236
|
+
if (!policy?.holdDeadline || policy.holdDeadline > Date.now())
|
|
237
|
+
return { status: "not_due" };
|
|
238
|
+
if (policy.status === "changing") {
|
|
239
|
+
const result = await this.apply(ctx, {
|
|
240
|
+
...scope,
|
|
241
|
+
operationKey: policy.operationKey,
|
|
242
|
+
});
|
|
243
|
+
if (result.status !== "ready")
|
|
244
|
+
return result;
|
|
245
|
+
policy = await this.get(ctx, scope);
|
|
246
|
+
}
|
|
247
|
+
if (!policy || policy.mode !== "custom")
|
|
248
|
+
return { status: "not_due" };
|
|
249
|
+
const operationKey = `bs:payout-expiry:${scope.accountId}:${policy.revision}`;
|
|
250
|
+
const prepared = await this.prepare(ctx, {
|
|
251
|
+
...scope,
|
|
252
|
+
operationKey,
|
|
253
|
+
expectedRevision: policy.revision,
|
|
254
|
+
mode: "stripe_managed",
|
|
255
|
+
thresholds: [],
|
|
256
|
+
});
|
|
257
|
+
if (prepared.status !== "prepared")
|
|
258
|
+
return prepared;
|
|
259
|
+
return this.apply(ctx, { ...scope, operationKey });
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=payoutPolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payoutPolicy.js","sourceRoot":"","sources":["../../src/client/payoutPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACd,MAAM,s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MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;YACrC,OAAO,EAAE,MAAM,EAAE,SAAkB,EAAE,CAAC;QACxC,MAAM,YAAY,GAAG,oBAAoB,KAAK,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC9E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YACvC,GAAG,KAAK;YACR,YAAY;YACZ,gBAAgB,EAAE,MAAM,CAAC,QAAQ;YACjC,IAAI,EAAE,gBAAgB;YACtB,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,UAAU;YAAE,OAAO,QAAQ,CAAC;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1652,6 +1652,279 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1652
1652
|
}, Name>;
|
|
1653
1653
|
};
|
|
1654
1654
|
};
|
|
1655
|
+
payoutPolicy: {
|
|
1656
|
+
mutations: {
|
|
1657
|
+
beginAttempt: FunctionReference<"mutation", "internal", {
|
|
1658
|
+
accountId: string;
|
|
1659
|
+
operationKey: string;
|
|
1660
|
+
ownerKey: string;
|
|
1661
|
+
}, {
|
|
1662
|
+
_creationTime: number;
|
|
1663
|
+
_id: string;
|
|
1664
|
+
accountId: string;
|
|
1665
|
+
attempted?: boolean;
|
|
1666
|
+
country: string;
|
|
1667
|
+
expectedRevision: number;
|
|
1668
|
+
mode: "stripe_managed" | "custom";
|
|
1669
|
+
observedAt?: number;
|
|
1670
|
+
observedSchedule: {
|
|
1671
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1672
|
+
monthlyDays?: Array<number>;
|
|
1673
|
+
weeklyDays?: Array<string>;
|
|
1674
|
+
};
|
|
1675
|
+
operationKey: string;
|
|
1676
|
+
ownerKey: string;
|
|
1677
|
+
previousSchedule: {
|
|
1678
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1679
|
+
monthlyDays?: Array<number>;
|
|
1680
|
+
weeklyDays?: Array<string>;
|
|
1681
|
+
};
|
|
1682
|
+
revision: number;
|
|
1683
|
+
status: "pending" | "complete" | "canceled";
|
|
1684
|
+
targetSchedule: {
|
|
1685
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1686
|
+
monthlyDays?: Array<number>;
|
|
1687
|
+
weeklyDays?: Array<string>;
|
|
1688
|
+
};
|
|
1689
|
+
thresholds: Array<{
|
|
1690
|
+
amount: number;
|
|
1691
|
+
currency: string;
|
|
1692
|
+
}>;
|
|
1693
|
+
}, Name>;
|
|
1694
|
+
cancelUnattempted: FunctionReference<"mutation", "internal", {
|
|
1695
|
+
accountId: string;
|
|
1696
|
+
observedSchedule: {
|
|
1697
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1698
|
+
monthlyDays?: Array<number>;
|
|
1699
|
+
weeklyDays?: Array<string>;
|
|
1700
|
+
};
|
|
1701
|
+
operationKey: string;
|
|
1702
|
+
ownerKey: string;
|
|
1703
|
+
}, {
|
|
1704
|
+
_creationTime: number;
|
|
1705
|
+
_id: string;
|
|
1706
|
+
accountId: string;
|
|
1707
|
+
attempted?: boolean;
|
|
1708
|
+
country: string;
|
|
1709
|
+
expectedRevision: number;
|
|
1710
|
+
mode: "stripe_managed" | "custom";
|
|
1711
|
+
observedAt?: number;
|
|
1712
|
+
observedSchedule: {
|
|
1713
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1714
|
+
monthlyDays?: Array<number>;
|
|
1715
|
+
weeklyDays?: Array<string>;
|
|
1716
|
+
};
|
|
1717
|
+
operationKey: string;
|
|
1718
|
+
ownerKey: string;
|
|
1719
|
+
previousSchedule: {
|
|
1720
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1721
|
+
monthlyDays?: Array<number>;
|
|
1722
|
+
weeklyDays?: Array<string>;
|
|
1723
|
+
};
|
|
1724
|
+
revision: number;
|
|
1725
|
+
status: "pending" | "complete" | "canceled";
|
|
1726
|
+
targetSchedule: {
|
|
1727
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1728
|
+
monthlyDays?: Array<number>;
|
|
1729
|
+
weeklyDays?: Array<string>;
|
|
1730
|
+
};
|
|
1731
|
+
thresholds: Array<{
|
|
1732
|
+
amount: number;
|
|
1733
|
+
currency: string;
|
|
1734
|
+
}>;
|
|
1735
|
+
}, Name>;
|
|
1736
|
+
confirm: FunctionReference<"mutation", "internal", {
|
|
1737
|
+
accountId: string;
|
|
1738
|
+
observedSchedule: {
|
|
1739
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1740
|
+
monthlyDays?: Array<number>;
|
|
1741
|
+
weeklyDays?: Array<string>;
|
|
1742
|
+
};
|
|
1743
|
+
operationKey: string;
|
|
1744
|
+
ownerKey: string;
|
|
1745
|
+
}, {
|
|
1746
|
+
_creationTime: number;
|
|
1747
|
+
_id: string;
|
|
1748
|
+
accountId: string;
|
|
1749
|
+
attempted?: boolean;
|
|
1750
|
+
country: string;
|
|
1751
|
+
expectedRevision: number;
|
|
1752
|
+
mode: "stripe_managed" | "custom";
|
|
1753
|
+
observedAt?: number;
|
|
1754
|
+
observedSchedule: {
|
|
1755
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1756
|
+
monthlyDays?: Array<number>;
|
|
1757
|
+
weeklyDays?: Array<string>;
|
|
1758
|
+
};
|
|
1759
|
+
operationKey: string;
|
|
1760
|
+
ownerKey: string;
|
|
1761
|
+
previousSchedule: {
|
|
1762
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1763
|
+
monthlyDays?: Array<number>;
|
|
1764
|
+
weeklyDays?: Array<string>;
|
|
1765
|
+
};
|
|
1766
|
+
revision: number;
|
|
1767
|
+
status: "pending" | "complete" | "canceled";
|
|
1768
|
+
targetSchedule: {
|
|
1769
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1770
|
+
monthlyDays?: Array<number>;
|
|
1771
|
+
weeklyDays?: Array<string>;
|
|
1772
|
+
};
|
|
1773
|
+
thresholds: Array<{
|
|
1774
|
+
amount: number;
|
|
1775
|
+
currency: string;
|
|
1776
|
+
}>;
|
|
1777
|
+
}, Name>;
|
|
1778
|
+
prepare: FunctionReference<"mutation", "internal", {
|
|
1779
|
+
accountId: string;
|
|
1780
|
+
country: string;
|
|
1781
|
+
expectedRevision: number;
|
|
1782
|
+
mode: "stripe_managed" | "custom";
|
|
1783
|
+
observedAt?: number;
|
|
1784
|
+
observedSchedule: {
|
|
1785
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1786
|
+
monthlyDays?: Array<number>;
|
|
1787
|
+
weeklyDays?: Array<string>;
|
|
1788
|
+
};
|
|
1789
|
+
operationKey: string;
|
|
1790
|
+
ownerKey: string;
|
|
1791
|
+
thresholds: Array<{
|
|
1792
|
+
amount: number;
|
|
1793
|
+
currency: string;
|
|
1794
|
+
}>;
|
|
1795
|
+
}, {
|
|
1796
|
+
_creationTime: number;
|
|
1797
|
+
_id: string;
|
|
1798
|
+
accountId: string;
|
|
1799
|
+
attempted?: boolean;
|
|
1800
|
+
country: string;
|
|
1801
|
+
expectedRevision: number;
|
|
1802
|
+
mode: "stripe_managed" | "custom";
|
|
1803
|
+
observedAt?: number;
|
|
1804
|
+
observedSchedule: {
|
|
1805
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1806
|
+
monthlyDays?: Array<number>;
|
|
1807
|
+
weeklyDays?: Array<string>;
|
|
1808
|
+
};
|
|
1809
|
+
operationKey: string;
|
|
1810
|
+
ownerKey: string;
|
|
1811
|
+
previousSchedule: {
|
|
1812
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1813
|
+
monthlyDays?: Array<number>;
|
|
1814
|
+
weeklyDays?: Array<string>;
|
|
1815
|
+
};
|
|
1816
|
+
revision: number;
|
|
1817
|
+
status: "pending" | "complete" | "canceled";
|
|
1818
|
+
targetSchedule: {
|
|
1819
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1820
|
+
monthlyDays?: Array<number>;
|
|
1821
|
+
weeklyDays?: Array<string>;
|
|
1822
|
+
};
|
|
1823
|
+
thresholds: Array<{
|
|
1824
|
+
amount: number;
|
|
1825
|
+
currency: string;
|
|
1826
|
+
}>;
|
|
1827
|
+
}, Name>;
|
|
1828
|
+
};
|
|
1829
|
+
queries: {
|
|
1830
|
+
due: FunctionReference<"query", "internal", {
|
|
1831
|
+
now: number;
|
|
1832
|
+
paginationOpts: {
|
|
1833
|
+
cursor: string | null;
|
|
1834
|
+
endCursor?: string | null;
|
|
1835
|
+
id?: number;
|
|
1836
|
+
maximumBytesRead?: number;
|
|
1837
|
+
maximumRowsRead?: number;
|
|
1838
|
+
numItems: number;
|
|
1839
|
+
};
|
|
1840
|
+
}, {
|
|
1841
|
+
continueCursor: string;
|
|
1842
|
+
isDone: boolean;
|
|
1843
|
+
page: Array<{
|
|
1844
|
+
_creationTime: number;
|
|
1845
|
+
_id: string;
|
|
1846
|
+
accountId: string;
|
|
1847
|
+
country: string;
|
|
1848
|
+
holdDeadline?: number;
|
|
1849
|
+
mode: "stripe_managed" | "custom";
|
|
1850
|
+
operationKey: string;
|
|
1851
|
+
ownerKey: string;
|
|
1852
|
+
previousSchedule?: {
|
|
1853
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1854
|
+
monthlyDays?: Array<number>;
|
|
1855
|
+
weeklyDays?: Array<string>;
|
|
1856
|
+
};
|
|
1857
|
+
revision: number;
|
|
1858
|
+
status: "changing" | "ready";
|
|
1859
|
+
thresholds: Array<{
|
|
1860
|
+
amount: number;
|
|
1861
|
+
currency: string;
|
|
1862
|
+
}>;
|
|
1863
|
+
}>;
|
|
1864
|
+
}, Name>;
|
|
1865
|
+
get: FunctionReference<"query", "internal", {
|
|
1866
|
+
accountId: string;
|
|
1867
|
+
ownerKey: string;
|
|
1868
|
+
}, {
|
|
1869
|
+
_creationTime: number;
|
|
1870
|
+
_id: string;
|
|
1871
|
+
accountId: string;
|
|
1872
|
+
country: string;
|
|
1873
|
+
holdDeadline?: number;
|
|
1874
|
+
mode: "stripe_managed" | "custom";
|
|
1875
|
+
operationKey: string;
|
|
1876
|
+
ownerKey: string;
|
|
1877
|
+
previousSchedule?: {
|
|
1878
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1879
|
+
monthlyDays?: Array<number>;
|
|
1880
|
+
weeklyDays?: Array<string>;
|
|
1881
|
+
};
|
|
1882
|
+
revision: number;
|
|
1883
|
+
status: "changing" | "ready";
|
|
1884
|
+
thresholds: Array<{
|
|
1885
|
+
amount: number;
|
|
1886
|
+
currency: string;
|
|
1887
|
+
}>;
|
|
1888
|
+
} | null, Name>;
|
|
1889
|
+
operation: FunctionReference<"query", "internal", {
|
|
1890
|
+
accountId: string;
|
|
1891
|
+
operationKey: string;
|
|
1892
|
+
ownerKey: string;
|
|
1893
|
+
}, {
|
|
1894
|
+
_creationTime: number;
|
|
1895
|
+
_id: string;
|
|
1896
|
+
accountId: string;
|
|
1897
|
+
attempted?: boolean;
|
|
1898
|
+
country: string;
|
|
1899
|
+
expectedRevision: number;
|
|
1900
|
+
mode: "stripe_managed" | "custom";
|
|
1901
|
+
observedAt?: number;
|
|
1902
|
+
observedSchedule: {
|
|
1903
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1904
|
+
monthlyDays?: Array<number>;
|
|
1905
|
+
weeklyDays?: Array<string>;
|
|
1906
|
+
};
|
|
1907
|
+
operationKey: string;
|
|
1908
|
+
ownerKey: string;
|
|
1909
|
+
previousSchedule: {
|
|
1910
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1911
|
+
monthlyDays?: Array<number>;
|
|
1912
|
+
weeklyDays?: Array<string>;
|
|
1913
|
+
};
|
|
1914
|
+
revision: number;
|
|
1915
|
+
status: "pending" | "complete" | "canceled";
|
|
1916
|
+
targetSchedule: {
|
|
1917
|
+
interval: "daily" | "weekly" | "monthly" | "manual";
|
|
1918
|
+
monthlyDays?: Array<number>;
|
|
1919
|
+
weeklyDays?: Array<string>;
|
|
1920
|
+
};
|
|
1921
|
+
thresholds: Array<{
|
|
1922
|
+
amount: number;
|
|
1923
|
+
currency: string;
|
|
1924
|
+
}>;
|
|
1925
|
+
} | null, Name>;
|
|
1926
|
+
};
|
|
1927
|
+
};
|
|
1655
1928
|
products: {
|
|
1656
1929
|
mutations: {
|
|
1657
1930
|
upsertPrice: FunctionReference<"mutation", "internal", {
|