@fantastic.dev/better-stripe 0.56.0 → 0.58.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 +18 -0
- package/README.md +5 -1
- package/dist/client/billing/setup-intent-read.d.ts +12 -1
- package/dist/client/billing/setup-intent-read.d.ts.map +1 -1
- package/dist/client/billing/setup-intent-read.js +13 -8
- package/dist/client/billing/setup-intent-read.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 +183 -1
- 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 +183 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -12
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -20
- package/dist/client/index.js.map +1 -1
- package/dist/client/types/triggers.d.ts +3 -1
- package/dist/client/types/triggers.d.ts.map +1 -1
- package/dist/client/usage/allowanceClient.d.ts +51 -0
- package/dist/client/usage/allowanceClient.d.ts.map +1 -0
- package/dist/client/usage/allowanceClient.js +64 -0
- package/dist/client/usage/allowanceClient.js.map +1 -0
- package/dist/client/usage/allowanceTerms.d.ts +64 -0
- package/dist/client/usage/allowanceTerms.d.ts.map +1 -0
- package/dist/client/usage/allowanceTerms.js +101 -0
- package/dist/client/usage/allowanceTerms.js.map +1 -0
- package/dist/client/usage/client.d.ts +2 -2
- package/dist/client/usage/client.d.ts.map +1 -1
- package/dist/client/usage/client.js +4 -4
- package/dist/client/usage/client.js.map +1 -1
- package/dist/client/usage/creditCapacity.d.ts +5 -0
- package/dist/client/usage/creditCapacity.d.ts.map +1 -0
- package/dist/client/usage/creditCapacity.js +47 -0
- package/dist/client/usage/creditCapacity.js.map +1 -0
- package/dist/client/usage/creditClient.d.ts +104 -0
- package/dist/client/usage/creditClient.d.ts.map +1 -0
- package/dist/client/usage/creditClient.js +111 -0
- package/dist/client/usage/creditClient.js.map +1 -0
- package/dist/client/usage/creditDelivery.d.ts +6 -0
- package/dist/client/usage/creditDelivery.d.ts.map +1 -0
- package/dist/client/usage/creditDelivery.js +71 -0
- package/dist/client/usage/creditDelivery.js.map +1 -0
- package/dist/client/usage/creditInvoice.d.ts +6 -0
- package/dist/client/usage/creditInvoice.d.ts.map +1 -0
- package/dist/client/usage/creditInvoice.js +63 -0
- package/dist/client/usage/creditInvoice.js.map +1 -0
- package/dist/client/usage/creditLifecycle.d.ts +14 -0
- package/dist/client/usage/creditLifecycle.d.ts.map +1 -0
- package/dist/client/usage/creditLifecycle.js +90 -0
- package/dist/client/usage/creditLifecycle.js.map +1 -0
- package/dist/client/usage/creditNative.d.ts +20 -0
- package/dist/client/usage/creditNative.d.ts.map +1 -0
- package/dist/client/usage/creditNative.js +100 -0
- package/dist/client/usage/creditNative.js.map +1 -0
- package/dist/client/usage/creditObservation.d.ts +23 -0
- package/dist/client/usage/creditObservation.d.ts.map +1 -0
- package/dist/client/usage/creditObservation.js +54 -0
- package/dist/client/usage/creditObservation.js.map +1 -0
- package/dist/client/usage/creditProofs.d.ts +50 -0
- package/dist/client/usage/creditProofs.d.ts.map +1 -0
- package/dist/client/usage/creditProofs.js +58 -0
- package/dist/client/usage/creditProofs.js.map +1 -0
- package/dist/client/usage/creditProvider.d.ts +11 -0
- package/dist/client/usage/creditProvider.d.ts.map +1 -0
- package/dist/client/usage/creditProvider.js +195 -0
- package/dist/client/usage/creditProvider.js.map +1 -0
- package/dist/client/usage/creditRead.d.ts +47 -0
- package/dist/client/usage/creditRead.d.ts.map +1 -0
- package/dist/client/usage/creditRead.js +18 -0
- package/dist/client/usage/creditRead.js.map +1 -0
- package/dist/client/usage/creditReconciliation.d.ts +20 -0
- package/dist/client/usage/creditReconciliation.d.ts.map +1 -0
- package/dist/client/usage/creditReconciliation.js +157 -0
- package/dist/client/usage/creditReconciliation.js.map +1 -0
- package/dist/client/usage/creditTerms.d.ts +89 -0
- package/dist/client/usage/creditTerms.d.ts.map +1 -0
- package/dist/client/usage/creditTerms.js +76 -0
- package/dist/client/usage/creditTerms.js.map +1 -0
- package/dist/client/usage/creditTransport.fixtures.d.ts +101 -0
- package/dist/client/usage/creditTransport.fixtures.d.ts.map +1 -0
- package/dist/client/usage/creditTransport.fixtures.js +271 -0
- package/dist/client/usage/creditTransport.fixtures.js.map +1 -0
- package/dist/client/usage/deliveryProvider.d.ts.map +1 -1
- package/dist/client/usage/deliveryProvider.js +2 -0
- package/dist/client/usage/deliveryProvider.js.map +1 -1
- package/dist/client/usage/index.d.ts +4 -0
- package/dist/client/usage/index.d.ts.map +1 -1
- package/dist/client/usage/index.js +1 -0
- package/dist/client/usage/index.js.map +1 -1
- package/dist/client/usage/records.d.ts +2 -0
- package/dist/client/usage/records.d.ts.map +1 -1
- package/dist/client/usage/records.js +22 -0
- package/dist/client/usage/records.js.map +1 -1
- package/dist/client/usage/subscriptionTransport.fixtures.d.ts +1 -1
- package/dist/client/usage/subscriptionTransport.fixtures.d.ts.map +1 -1
- package/dist/client/usage/subscriptionTransport.fixtures.js +4 -1
- package/dist/client/usage/subscriptionTransport.fixtures.js.map +1 -1
- package/dist/client/usage/summary.js +2 -2
- package/dist/client/usage/summary.js.map +1 -1
- package/dist/client/usageExports.d.ts +16 -0
- package/dist/client/usageExports.d.ts.map +1 -0
- package/dist/client/usageExports.js +3 -0
- package/dist/client/usageExports.js.map +1 -0
- package/dist/client/webhooks/subscriptionDeleted.d.ts +5 -0
- package/dist/client/webhooks/subscriptionDeleted.d.ts.map +1 -0
- package/dist/client/webhooks/subscriptionDeleted.js +34 -0
- package/dist/client/webhooks/subscriptionDeleted.js.map +1 -0
- 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 +360 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/accountClosure/mutations.d.ts.map +1 -1
- package/dist/component/accountClosure/mutations.js +10 -0
- package/dist/component/accountClosure/mutations.js.map +1 -1
- package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
- package/dist/component/balanceFunding/mutations.d.ts +16 -16
- package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/queries.d.ts +1 -1
- package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
- package/dist/component/earnings/triggers.d.ts +352 -18
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/schema.d.ts +183 -1
- package/dist/component/schema.js +8 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/usage/mutations.d.ts.map +1 -1
- package/dist/component/usage/mutations.js +7 -0
- package/dist/component/usage/mutations.js.map +1 -1
- package/dist/component/usage/schema.d.ts +15 -1
- package/dist/component/usage/schema.d.ts.map +1 -1
- package/dist/component/usage/schema.js +12 -0
- package/dist/component/usage/schema.js.map +1 -1
- package/dist/component/usageAllowance/helpers.d.ts +78 -0
- package/dist/component/usageAllowance/helpers.d.ts.map +1 -0
- package/dist/component/usageAllowance/helpers.js +99 -0
- package/dist/component/usageAllowance/helpers.js.map +1 -0
- package/dist/component/usageAllowance/mutations.d.ts +37 -0
- package/dist/component/usageAllowance/mutations.d.ts.map +1 -0
- package/dist/component/usageAllowance/mutations.js +99 -0
- package/dist/component/usageAllowance/mutations.js.map +1 -0
- package/dist/component/usageAllowance/queries.d.ts +36 -0
- package/dist/component/usageAllowance/queries.d.ts.map +1 -0
- package/dist/component/usageAllowance/queries.js +113 -0
- package/dist/component/usageAllowance/queries.js.map +1 -0
- package/dist/component/usageAllowance/reservations.d.ts +25 -0
- package/dist/component/usageAllowance/reservations.d.ts.map +1 -0
- package/dist/component/usageAllowance/reservations.js +150 -0
- package/dist/component/usageAllowance/reservations.js.map +1 -0
- package/dist/component/usageAllowance/schema.d.ts +77 -0
- package/dist/component/usageAllowance/schema.d.ts.map +1 -0
- package/dist/component/usageAllowance/schema.js +32 -0
- package/dist/component/usageAllowance/schema.js.map +1 -0
- package/dist/component/usageCredits/helpers.d.ts +205 -0
- package/dist/component/usageCredits/helpers.d.ts.map +1 -0
- package/dist/component/usageCredits/helpers.js +129 -0
- package/dist/component/usageCredits/helpers.js.map +1 -0
- package/dist/component/usageCredits/mutations.d.ts +80 -0
- package/dist/component/usageCredits/mutations.d.ts.map +1 -0
- package/dist/component/usageCredits/mutations.js +344 -0
- package/dist/component/usageCredits/mutations.js.map +1 -0
- package/dist/component/usageCredits/purchase.d.ts +23 -0
- package/dist/component/usageCredits/purchase.d.ts.map +1 -0
- package/dist/component/usageCredits/purchase.js +166 -0
- package/dist/component/usageCredits/purchase.js.map +1 -0
- package/dist/component/usageCredits/queries.d.ts +184 -0
- package/dist/component/usageCredits/queries.d.ts.map +1 -0
- package/dist/component/usageCredits/queries.js +243 -0
- package/dist/component/usageCredits/queries.js.map +1 -0
- package/dist/component/usageCredits/reservations.d.ts +16 -0
- package/dist/component/usageCredits/reservations.d.ts.map +1 -0
- package/dist/component/usageCredits/reservations.js +161 -0
- package/dist/component/usageCredits/reservations.js.map +1 -0
- package/dist/component/usageCredits/schema.d.ts +282 -0
- package/dist/component/usageCredits/schema.d.ts.map +1 -0
- package/dist/component/usageCredits/schema.js +92 -0
- package/dist/component/usageCredits/schema.js.map +1 -0
- package/docs/README.md +4 -0
- package/docs/setup-intent-recovery.md +7 -0
- package/docs/usage-credits.md +255 -0
- package/docs/usage-ledger.md +7 -0
- package/docs/usage-limits.md +217 -0
- package/docs/webhooks.md +15 -1
- package/package.json +3 -1
- package/src/client/billing/setup-intent-read.test.ts +40 -0
- package/src/client/billing/setup-intent-read.ts +23 -9
- package/src/client/index.ts +9 -67
- package/src/client/types/triggers.ts +2 -0
- package/src/client/usage/allowanceClient.test.ts +93 -0
- package/src/client/usage/allowanceClient.ts +134 -0
- package/src/client/usage/allowanceTerms.test.ts +131 -0
- package/src/client/usage/allowanceTerms.ts +172 -0
- package/src/client/usage/client.ts +4 -4
- package/src/client/usage/creditCapacity.test.ts +83 -0
- package/src/client/usage/creditCapacity.ts +76 -0
- package/src/client/usage/creditClient.test.ts +221 -0
- package/src/client/usage/creditClient.ts +246 -0
- package/src/client/usage/creditDelivery.ts +105 -0
- package/src/client/usage/creditInvoice.test.ts +149 -0
- package/src/client/usage/creditInvoice.ts +87 -0
- package/src/client/usage/creditLifecycle.ts +175 -0
- package/src/client/usage/creditNative.ts +148 -0
- package/src/client/usage/creditObservation.test.ts +150 -0
- package/src/client/usage/creditObservation.ts +82 -0
- package/src/client/usage/creditProofs.ts +61 -0
- package/src/client/usage/creditProvider.test.ts +202 -0
- package/src/client/usage/creditProvider.ts +304 -0
- package/src/client/usage/creditRead.ts +32 -0
- package/src/client/usage/creditReconciliation.ts +213 -0
- package/src/client/usage/creditTerms.test.ts +48 -0
- package/src/client/usage/creditTerms.ts +140 -0
- package/src/client/usage/creditTransport.fixtures.ts +282 -0
- package/src/client/usage/deliveryProvider.ts +2 -0
- package/src/client/usage/index.ts +16 -0
- package/src/client/usage/record-composition.test.ts +195 -0
- package/src/client/usage/records.ts +26 -0
- package/src/client/usage/subscriptionTransport.fixtures.ts +6 -0
- package/src/client/usage/summary.test.ts +1 -1
- package/src/client/usage/summary.ts +2 -2
- package/src/client/usageExports.ts +56 -0
- package/src/client/webhook-handlers.test.ts +0 -34
- package/src/client/webhooks/subscription-deleted-dispatch.test.ts +61 -0
- package/src/client/webhooks/subscription-deleted.integration.test.ts +313 -0
- package/src/client/webhooks/subscriptionDeleted.ts +56 -0
- package/src/component/_generated/api.ts +18 -0
- package/src/component/_generated/component.ts +486 -0
- package/src/component/accountClosure/mutations.ts +14 -0
- package/src/component/schema.ts +16 -0
- package/src/component/usage/allowance.test.ts +435 -0
- package/src/component/usage/ledger.test.ts +8 -15
- package/src/component/usage/mutations.ts +22 -0
- package/src/component/usage/schema.ts +14 -0
- package/src/component/usageAllowance/helpers.ts +137 -0
- package/src/component/usageAllowance/mutations.ts +139 -0
- package/src/component/usageAllowance/queries.ts +133 -0
- package/src/component/usageAllowance/reservations.ts +220 -0
- package/src/component/usageAllowance/schema.ts +36 -0
- package/src/component/usageCredits/accounting.test.ts +389 -0
- package/src/component/usageCredits/helpers.ts +160 -0
- package/src/component/usageCredits/mutations.ts +451 -0
- package/src/component/usageCredits/purchase.ts +219 -0
- package/src/component/usageCredits/queries.ts +300 -0
- package/src/component/usageCredits/reservations.ts +214 -0
- package/src/component/usageCredits/schema.ts +106 -0
|
@@ -132,7 +132,7 @@ it("does not fabricate prepaid balances or complete estimates from incomplete hi
|
|
|
132
132
|
{
|
|
133
133
|
credits: {
|
|
134
134
|
status: "unavailable",
|
|
135
|
-
reason: "
|
|
135
|
+
reason: "credit_balance_requires_scoped_reader",
|
|
136
136
|
},
|
|
137
137
|
estimate: { status: "unavailable" },
|
|
138
138
|
},
|
|
@@ -151,7 +151,7 @@ export function summarizeUsageRecords(
|
|
|
151
151
|
estimate: !options.complete
|
|
152
152
|
? unavailable("local_history_incomplete")
|
|
153
153
|
: plan.model === "prepaid"
|
|
154
|
-
? unavailable("
|
|
154
|
+
? unavailable("credit_balance_requires_scoped_reader")
|
|
155
155
|
: !eligible
|
|
156
156
|
? unavailable("partial_billing_period")
|
|
157
157
|
: {
|
|
@@ -164,7 +164,7 @@ export function summarizeUsageRecords(
|
|
|
164
164
|
},
|
|
165
165
|
credits: unavailable(
|
|
166
166
|
plan.model === "prepaid"
|
|
167
|
-
? "
|
|
167
|
+
? "credit_balance_requires_scoped_reader"
|
|
168
168
|
: "not_prepaid_model",
|
|
169
169
|
),
|
|
170
170
|
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
UsageDeliveryRequest,
|
|
3
|
+
UsageDeliveryOutcome,
|
|
4
|
+
UsageDeliveryProviderOptions,
|
|
5
|
+
} from "./usage/deliveryProvider.js";
|
|
6
|
+
export type {
|
|
7
|
+
UsageDeliveryRef,
|
|
8
|
+
UsageDeliveryStatus,
|
|
9
|
+
UsageDeliveryStartOptions,
|
|
10
|
+
} from "./usage/deliveryClient.js";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
usageDeliveryArgs,
|
|
14
|
+
usageDeliveryResult,
|
|
15
|
+
} from "./usage/deliveryProtocol.js";
|
|
16
|
+
|
|
17
|
+
export type {
|
|
18
|
+
UsageObservationOptions,
|
|
19
|
+
UsageAggregateValue,
|
|
20
|
+
UsageAggregateObservation,
|
|
21
|
+
} from "./usage/observationTypes.js";
|
|
22
|
+
export type {
|
|
23
|
+
UsageLocalSummary,
|
|
24
|
+
UsageLocalGroup,
|
|
25
|
+
UsageCreditSummary,
|
|
26
|
+
} from "./usage/summary.js";
|
|
27
|
+
export type { UsageComparison } from "./usage/reconciliation.js";
|
|
28
|
+
export type { UsageReconciliationOptions } from "./usage/observationClient.js";
|
|
29
|
+
|
|
30
|
+
export type {
|
|
31
|
+
UsageInvoiceObservation,
|
|
32
|
+
UsageInvoiceLine,
|
|
33
|
+
} from "./usage/invoiceObservation.js";
|
|
34
|
+
|
|
35
|
+
export type {
|
|
36
|
+
UsageSubscriptionOptions,
|
|
37
|
+
UsageSubscriptionView,
|
|
38
|
+
} from "./usage/subscriptionTerms.js";
|
|
39
|
+
export type { UsageSubscriptionRef } from "./usage/subscriptionLifecycle.js";
|
|
40
|
+
export type { UsageSubscriptionInvoice } from "./usage/subscriptionInvoiceSchema.js";
|
|
41
|
+
|
|
42
|
+
export { UsageCreditError } from "./usage/creditTerms.js";
|
|
43
|
+
export type {
|
|
44
|
+
UsageCreditBinding,
|
|
45
|
+
UsageCreditPurchaseOptions,
|
|
46
|
+
UsageCreditPurchase,
|
|
47
|
+
UsageCreditBalance,
|
|
48
|
+
} from "./usage/creditTerms.js";
|
|
49
|
+
|
|
50
|
+
export type {
|
|
51
|
+
UsageAllowanceBinding,
|
|
52
|
+
UsageAllowanceStatus,
|
|
53
|
+
UsageAllowanceReconciliation,
|
|
54
|
+
UsageLimitPolicy,
|
|
55
|
+
} from "./usage/allowanceTerms.js";
|
|
56
|
+
export type { UsageAllowanceReservation } from "./usage/allowanceClient.js";
|
|
@@ -435,40 +435,6 @@ describe("webhookHandlers()", () => {
|
|
|
435
435
|
expect(onCompleted).not.toHaveBeenCalled();
|
|
436
436
|
});
|
|
437
437
|
|
|
438
|
-
it("subscriptionDeleted upserts and fires subscription.onDelete with the fetched doc", async () => {
|
|
439
|
-
const onDelete = vi.fn().mockResolvedValue(undefined);
|
|
440
|
-
const bs = new BetterStripe(components.betterStripe, {
|
|
441
|
-
STRIPE_SECRET_KEY: "sk_test_xxx",
|
|
442
|
-
triggers: { subscription: { onDelete } },
|
|
443
|
-
});
|
|
444
|
-
const { syncWebhook } = bs.webhookHandlers();
|
|
445
|
-
|
|
446
|
-
const doc = { stripeSubscriptionId: "sub_1", status: "canceled" };
|
|
447
|
-
mockCtx.runQuery.mockResolvedValueOnce(doc);
|
|
448
|
-
|
|
449
|
-
await invokeHandler(syncWebhook, mockCtx, {
|
|
450
|
-
dispatcher: "subscriptionDeleted",
|
|
451
|
-
data: { stripeSubscriptionId: "sub_1", status: "canceled" },
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
expect(mockCtx.runMutation).toHaveBeenCalledTimes(1);
|
|
455
|
-
const [upsertRef, upsertArgs] = mockCtx.runMutation.mock.calls[0];
|
|
456
|
-
expect(refPath(upsertRef)).toMatch(
|
|
457
|
-
/\/billing\/mutations\/upsertSubscription$/,
|
|
458
|
-
);
|
|
459
|
-
expect(upsertArgs).toEqual({
|
|
460
|
-
stripeSubscriptionId: "sub_1",
|
|
461
|
-
status: "canceled",
|
|
462
|
-
});
|
|
463
|
-
const [getterRef, getterArgs] = mockCtx.runQuery.mock.calls[0];
|
|
464
|
-
expect(refPath(getterRef)).toMatch(
|
|
465
|
-
/\/billing\/queries\/getSubscriptionByStripeId$/,
|
|
466
|
-
);
|
|
467
|
-
expect(getterArgs).toEqual({ stripeSubscriptionId: "sub_1" });
|
|
468
|
-
expect(onDelete).toHaveBeenCalledTimes(1);
|
|
469
|
-
expect(onDelete).toHaveBeenCalledWith(mockCtx, doc);
|
|
470
|
-
});
|
|
471
|
-
|
|
472
438
|
it("rejects with a clear error when the Stripe id field is missing from data", async () => {
|
|
473
439
|
const bs = new BetterStripe(components.betterStripe, {
|
|
474
440
|
STRIPE_SECRET_KEY: "sk_test_xxx",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { componentsGeneric } from "convex/server";
|
|
3
|
+
import { expect, it, vi } from "vitest";
|
|
4
|
+
|
|
5
|
+
import type { Component } from "../helpers.js";
|
|
6
|
+
import { BetterStripe } from "../index.js";
|
|
7
|
+
|
|
8
|
+
const invokeHandler = (fn: unknown, ctx: unknown, args: unknown) =>
|
|
9
|
+
(fn as { _handler: (ctx: unknown, args: unknown) => Promise<null> })._handler(
|
|
10
|
+
ctx,
|
|
11
|
+
args,
|
|
12
|
+
);
|
|
13
|
+
const refPath = (ref: unknown): string =>
|
|
14
|
+
(ref as Record<symbol, string>)[Symbol.for("toReferencePath")];
|
|
15
|
+
|
|
16
|
+
it("subscriptionDeleted captures the exact previous identity and resulting cancellation", async () => {
|
|
17
|
+
const mockCtx = {
|
|
18
|
+
runQuery: vi.fn(),
|
|
19
|
+
runMutation: vi.fn(),
|
|
20
|
+
runAction: vi.fn(),
|
|
21
|
+
};
|
|
22
|
+
const components = componentsGeneric() as unknown as {
|
|
23
|
+
betterStripe: Component;
|
|
24
|
+
};
|
|
25
|
+
const onDelete = vi.fn().mockResolvedValue(undefined);
|
|
26
|
+
const bs = new BetterStripe(components.betterStripe, {
|
|
27
|
+
STRIPE_SECRET_KEY: "sk_test_xxx",
|
|
28
|
+
triggers: { subscription: { onDelete } },
|
|
29
|
+
});
|
|
30
|
+
const { syncWebhook } = bs.webhookHandlers();
|
|
31
|
+
|
|
32
|
+
const doc = { stripeSubscriptionId: "sub_1", status: "canceled" };
|
|
33
|
+
const previous = { stripeSubscriptionId: "sub_1", status: "active" };
|
|
34
|
+
mockCtx.runQuery.mockResolvedValueOnce(previous).mockResolvedValueOnce(doc);
|
|
35
|
+
|
|
36
|
+
await invokeHandler(syncWebhook, mockCtx, {
|
|
37
|
+
dispatcher: "subscriptionDeleted",
|
|
38
|
+
data: { stripeSubscriptionId: "sub_1", status: "canceled" },
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
expect(mockCtx.runMutation).toHaveBeenCalledTimes(1);
|
|
42
|
+
const [upsertRef, upsertArgs] = mockCtx.runMutation.mock.calls[0];
|
|
43
|
+
expect(refPath(upsertRef)).toMatch(
|
|
44
|
+
/\/billing\/mutations\/upsertSubscription$/,
|
|
45
|
+
);
|
|
46
|
+
expect(upsertArgs).toEqual({
|
|
47
|
+
stripeSubscriptionId: "sub_1",
|
|
48
|
+
status: "canceled",
|
|
49
|
+
});
|
|
50
|
+
const [getterRef, getterArgs] = mockCtx.runQuery.mock.calls[0];
|
|
51
|
+
expect(refPath(getterRef)).toMatch(
|
|
52
|
+
/\/billing\/queries\/getSubscriptionByStripeId$/,
|
|
53
|
+
);
|
|
54
|
+
expect(getterArgs).toEqual({
|
|
55
|
+
stripeSubscriptionId: "sub_1",
|
|
56
|
+
requireUnique: true,
|
|
57
|
+
});
|
|
58
|
+
expect(mockCtx.runQuery).toHaveBeenCalledTimes(2);
|
|
59
|
+
expect(onDelete).toHaveBeenCalledTimes(1);
|
|
60
|
+
expect(onDelete).toHaveBeenCalledWith(mockCtx, doc, previous);
|
|
61
|
+
});
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { convexTest } from "convex-test";
|
|
3
|
+
import {
|
|
4
|
+
componentsGeneric,
|
|
5
|
+
defineSchema,
|
|
6
|
+
defineTable,
|
|
7
|
+
httpRouter,
|
|
8
|
+
internalMutationGeneric,
|
|
9
|
+
makeFunctionReference,
|
|
10
|
+
} from "convex/server";
|
|
11
|
+
import { v } from "convex/values";
|
|
12
|
+
import Stripe from "stripe";
|
|
13
|
+
import { expect, it } from "vitest";
|
|
14
|
+
|
|
15
|
+
import { mutation } from "../../component/_generated/server.js";
|
|
16
|
+
import schema from "../../component/schema.js";
|
|
17
|
+
import { BetterStripe, registerRoutes } from "../index.js";
|
|
18
|
+
import type { Component } from "../helpers.js";
|
|
19
|
+
import type {
|
|
20
|
+
StripeComponentSubscription,
|
|
21
|
+
SyncTriggerCtx,
|
|
22
|
+
WebhookHandlerRefs,
|
|
23
|
+
} from "../types.js";
|
|
24
|
+
|
|
25
|
+
const component = componentsGeneric().betterStripe as unknown as Component;
|
|
26
|
+
const modules = import.meta.glob("../../component/**/*.*s");
|
|
27
|
+
const secret = "whsec_synthetic_previous_subscription";
|
|
28
|
+
const observeRef = makeFunctionReference<
|
|
29
|
+
"mutation",
|
|
30
|
+
{
|
|
31
|
+
current: StripeComponentSubscription;
|
|
32
|
+
previous?: StripeComponentSubscription | null;
|
|
33
|
+
},
|
|
34
|
+
string[]
|
|
35
|
+
>("subscriptionHost:observe");
|
|
36
|
+
const duplicate = mutation({
|
|
37
|
+
args: { stripeSubscriptionId: v.string() },
|
|
38
|
+
returns: v.null(),
|
|
39
|
+
handler: async (ctx, args) => {
|
|
40
|
+
const row = await ctx.db
|
|
41
|
+
.query("subscriptions")
|
|
42
|
+
.withIndex("by_stripe_subscription_id", (q) =>
|
|
43
|
+
q.eq("stripeSubscriptionId", args.stripeSubscriptionId),
|
|
44
|
+
)
|
|
45
|
+
.first();
|
|
46
|
+
if (!row) throw new Error("Missing original subscription");
|
|
47
|
+
const { _id, _creationTime, ...fields } = row;
|
|
48
|
+
await ctx.db.insert("subscriptions", fields);
|
|
49
|
+
return null;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
async function fixture(
|
|
54
|
+
options: {
|
|
55
|
+
isLegacy?: boolean;
|
|
56
|
+
isRegistered?: boolean;
|
|
57
|
+
hasOriginal?: boolean;
|
|
58
|
+
hasCallback?: boolean;
|
|
59
|
+
} = {},
|
|
60
|
+
) {
|
|
61
|
+
let hasCallbackFailure = false;
|
|
62
|
+
const attemptedScopes: string[] = [];
|
|
63
|
+
const observe = async (
|
|
64
|
+
ctx: SyncTriggerCtx,
|
|
65
|
+
doc: StripeComponentSubscription,
|
|
66
|
+
...previous: unknown[]
|
|
67
|
+
) => {
|
|
68
|
+
const oldDoc = previous[0] as
|
|
69
|
+
StripeComponentSubscription | null | undefined;
|
|
70
|
+
attemptedScopes.push(
|
|
71
|
+
...(await ctx.runMutation(observeRef, {
|
|
72
|
+
current: doc,
|
|
73
|
+
...(oldDoc === undefined ? {} : { previous: oldDoc }),
|
|
74
|
+
})),
|
|
75
|
+
);
|
|
76
|
+
if (hasCallbackFailure) throw new Error("Later host transaction failure");
|
|
77
|
+
};
|
|
78
|
+
// A two-argument callback remains a valid supported consumer.
|
|
79
|
+
const legacy = async (
|
|
80
|
+
ctx: SyncTriggerCtx,
|
|
81
|
+
doc: StripeComponentSubscription,
|
|
82
|
+
) => observe(ctx, doc);
|
|
83
|
+
const sdk = new BetterStripe(component, {
|
|
84
|
+
STRIPE_SECRET_KEY: "sk_test_previous_subscription",
|
|
85
|
+
triggers:
|
|
86
|
+
options.hasCallback === false
|
|
87
|
+
? {}
|
|
88
|
+
: {
|
|
89
|
+
subscription: { onDelete: options.isLegacy ? legacy : observe },
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
const http = httpRouter();
|
|
93
|
+
registerRoutes(http, component, {
|
|
94
|
+
stripeSecretKey: "sk_test_previous_subscription",
|
|
95
|
+
webhookSecret: secret,
|
|
96
|
+
...(options.isRegistered === false
|
|
97
|
+
? {}
|
|
98
|
+
: {
|
|
99
|
+
webhooks: {
|
|
100
|
+
syncWebhook: makeFunctionReference("subscriptionHost:syncWebhook"),
|
|
101
|
+
asyncWebhook: makeFunctionReference(
|
|
102
|
+
"subscriptionHost:asyncWebhook",
|
|
103
|
+
),
|
|
104
|
+
} as unknown as WebhookHandlerRefs,
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
107
|
+
const t = convexTest(
|
|
108
|
+
defineSchema({
|
|
109
|
+
observations: defineTable({
|
|
110
|
+
current: v.any(),
|
|
111
|
+
previous: v.optional(v.any()),
|
|
112
|
+
}),
|
|
113
|
+
holds: defineTable({ scope: v.string() }),
|
|
114
|
+
}),
|
|
115
|
+
{
|
|
116
|
+
"./_generated/server.ts": () =>
|
|
117
|
+
import("../../component/_generated/server.js"),
|
|
118
|
+
"./http.ts": async () => ({ default: http }),
|
|
119
|
+
"./subscriptionHost.ts": async () => ({
|
|
120
|
+
...sdk.webhookHandlers(),
|
|
121
|
+
observe: internalMutationGeneric({
|
|
122
|
+
args: { current: v.any(), previous: v.optional(v.any()) },
|
|
123
|
+
returns: v.array(v.string()),
|
|
124
|
+
handler: async (ctx, args) => {
|
|
125
|
+
await ctx.db.insert("observations", args);
|
|
126
|
+
const scopes: string[] = [];
|
|
127
|
+
for (const doc of [args.previous, args.current]) {
|
|
128
|
+
const scope: unknown = doc?.metadata?.communityId;
|
|
129
|
+
if (typeof scope === "string") {
|
|
130
|
+
await ctx.db.insert("holds", { scope });
|
|
131
|
+
scopes.push(scope);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return scopes;
|
|
135
|
+
},
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
138
|
+
},
|
|
139
|
+
);
|
|
140
|
+
t.registerComponent("betterStripe", schema, {
|
|
141
|
+
...Object.fromEntries(
|
|
142
|
+
Object.entries(modules).map(([path, loader]) => [
|
|
143
|
+
path.split("/component/")[1]!,
|
|
144
|
+
loader,
|
|
145
|
+
]),
|
|
146
|
+
),
|
|
147
|
+
"qa/subscriptionDuplicates.ts": async () => ({ duplicate }),
|
|
148
|
+
});
|
|
149
|
+
const original = {
|
|
150
|
+
stripeSubscriptionId: "sub_previous_identity",
|
|
151
|
+
accountId: "acct_previous",
|
|
152
|
+
userId: "original-buyer",
|
|
153
|
+
orgId: "original-org",
|
|
154
|
+
priceId: "price_original",
|
|
155
|
+
status: "active" as const,
|
|
156
|
+
cancelAtPeriodEnd: false,
|
|
157
|
+
isTrialing: false,
|
|
158
|
+
metadata: {
|
|
159
|
+
communityId: "old-metadata-only-community",
|
|
160
|
+
userId: "original-buyer",
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
if (options.hasOriginal !== false)
|
|
164
|
+
await t.mutation(component.billing.mutations.upsertSubscription, original);
|
|
165
|
+
const row = () =>
|
|
166
|
+
t.query(component.billing.queries.getSubscriptionByStripeId, {
|
|
167
|
+
stripeSubscriptionId: original.stripeSubscriptionId,
|
|
168
|
+
requireUnique: true,
|
|
169
|
+
});
|
|
170
|
+
const send = async (isValid = true) => {
|
|
171
|
+
const body = JSON.stringify({
|
|
172
|
+
id: "evt_previous_subscription_deleted",
|
|
173
|
+
object: "event",
|
|
174
|
+
type: "customer.subscription.deleted",
|
|
175
|
+
livemode: false,
|
|
176
|
+
created: Math.floor(Date.now() / 1000),
|
|
177
|
+
data: {
|
|
178
|
+
object: {
|
|
179
|
+
id: original.stripeSubscriptionId,
|
|
180
|
+
object: "subscription",
|
|
181
|
+
customer_account: "acct_replacement",
|
|
182
|
+
status: "canceled",
|
|
183
|
+
cancel_at_period_end: false,
|
|
184
|
+
canceled_at: 1700000000,
|
|
185
|
+
metadata: {
|
|
186
|
+
communityId: "new-metadata-only-community",
|
|
187
|
+
userId: "new-buyer",
|
|
188
|
+
},
|
|
189
|
+
items: {
|
|
190
|
+
data: [{ price: { id: "price_replacement" }, quantity: 1 }],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
const signature = await Stripe.webhooks.generateTestHeaderStringAsync({
|
|
196
|
+
payload: body,
|
|
197
|
+
secret,
|
|
198
|
+
});
|
|
199
|
+
return t.fetch("/stripe/webhook", {
|
|
200
|
+
method: "POST",
|
|
201
|
+
body,
|
|
202
|
+
headers: { "stripe-signature": isValid ? signature : "t=0,v1=invalid" },
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
t,
|
|
207
|
+
sdk,
|
|
208
|
+
original,
|
|
209
|
+
row,
|
|
210
|
+
send,
|
|
211
|
+
attemptedScopes,
|
|
212
|
+
observations: () => t.run((ctx) => ctx.db.query("observations").collect()),
|
|
213
|
+
holds: () => t.run((ctx) => ctx.db.query("holds").collect()),
|
|
214
|
+
failCallback: () => {
|
|
215
|
+
hasCallbackFailure = true;
|
|
216
|
+
},
|
|
217
|
+
duplicate: () =>
|
|
218
|
+
t.mutation(
|
|
219
|
+
componentsGeneric().betterStripe.qa.subscriptionDuplicates.duplicate,
|
|
220
|
+
{
|
|
221
|
+
stripeSubscriptionId: original.stripeSubscriptionId,
|
|
222
|
+
},
|
|
223
|
+
),
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
it("passes exact previous and resulting documents through the signed registered delete endpoint", async () => {
|
|
228
|
+
const f = await fixture();
|
|
229
|
+
const previous = await f.row();
|
|
230
|
+
expect(previous).not.toBeNull();
|
|
231
|
+
expect((await f.send()).status).toBe(200);
|
|
232
|
+
const current = await f.row();
|
|
233
|
+
expect(current).toMatchObject({
|
|
234
|
+
status: "canceled",
|
|
235
|
+
userId: "new-buyer",
|
|
236
|
+
accountId: "acct_replacement",
|
|
237
|
+
priceId: "price_replacement",
|
|
238
|
+
});
|
|
239
|
+
expect(await f.observations()).toMatchObject([{ previous, current }]);
|
|
240
|
+
expect((await f.holds()).map((hold) => hold.scope).sort()).toEqual([
|
|
241
|
+
"new-metadata-only-community",
|
|
242
|
+
"old-metadata-only-community",
|
|
243
|
+
]);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it("rolls back the mirror and both host holds when a later synchronous callback fails", async () => {
|
|
247
|
+
const f = await fixture();
|
|
248
|
+
const previous = await f.row();
|
|
249
|
+
f.failCallback();
|
|
250
|
+
expect((await f.send()).status).toBe(500);
|
|
251
|
+
expect(f.attemptedScopes.sort()).toEqual([
|
|
252
|
+
"new-metadata-only-community",
|
|
253
|
+
"old-metadata-only-community",
|
|
254
|
+
]);
|
|
255
|
+
expect(await f.row()).toEqual(previous);
|
|
256
|
+
expect(await f.observations()).toEqual([]);
|
|
257
|
+
expect(await f.holds()).toEqual([]);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
it("rejects actual duplicate cached identities before destructive upsert or a callback", async () => {
|
|
261
|
+
const f = await fixture();
|
|
262
|
+
await f.duplicate();
|
|
263
|
+
expect(await f.row()).toBeNull();
|
|
264
|
+
const before = await f.t.query(
|
|
265
|
+
component.billing.queries.listSubscriptions,
|
|
266
|
+
{},
|
|
267
|
+
);
|
|
268
|
+
expect(before).toHaveLength(2);
|
|
269
|
+
expect((await f.send()).status).toBe(500);
|
|
270
|
+
expect(
|
|
271
|
+
await f.t.query(component.billing.queries.listSubscriptions, {}),
|
|
272
|
+
).toEqual(before);
|
|
273
|
+
expect(await f.observations()).toEqual([]);
|
|
274
|
+
expect(await f.holds()).toEqual([]);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("supplies explicit null for an absent previous identity", async () => {
|
|
278
|
+
const f = await fixture({ hasOriginal: false });
|
|
279
|
+
expect((await f.send()).status).toBe(200);
|
|
280
|
+
expect(await f.observations()).toMatchObject([
|
|
281
|
+
{ previous: null, current: { status: "canceled" } },
|
|
282
|
+
]);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("retains a two-argument synchronous delete callback", async () => {
|
|
286
|
+
const f = await fixture({ isLegacy: true });
|
|
287
|
+
expect((await f.send()).status).toBe(200);
|
|
288
|
+
expect(await f.observations()).toMatchObject([
|
|
289
|
+
{ current: { status: "canceled" } },
|
|
290
|
+
]);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("retains ordinary cancellation mirror writes without a registered host dispatcher", async () => {
|
|
294
|
+
const f = await fixture({ isRegistered: false });
|
|
295
|
+
expect((await f.send()).status).toBe(200);
|
|
296
|
+
expect(await f.row()).toMatchObject({ status: "canceled" });
|
|
297
|
+
expect(await f.observations()).toEqual([]);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it("retains the registered dispatcher mirror when no delete callback is configured", async () => {
|
|
301
|
+
const f = await fixture({ hasCallback: false });
|
|
302
|
+
expect((await f.send()).status).toBe(200);
|
|
303
|
+
expect(await f.row()).toMatchObject({ status: "canceled" });
|
|
304
|
+
expect(await f.observations()).toEqual([]);
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
it("rejects an invalid signature before mirror or host writes", async () => {
|
|
308
|
+
const f = await fixture();
|
|
309
|
+
const before = await f.row();
|
|
310
|
+
expect((await f.send(false)).status).toBe(400);
|
|
311
|
+
expect(await f.row()).toEqual(before);
|
|
312
|
+
expect(await f.observations()).toEqual([]);
|
|
313
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Component } from "../helpers.js";
|
|
2
|
+
import type {
|
|
3
|
+
SyncTriggerCtx,
|
|
4
|
+
SyncTriggers,
|
|
5
|
+
StripeComponentSubscription,
|
|
6
|
+
} from "../types.js";
|
|
7
|
+
import { componentRef, DISPATCHER_UPSERT_PATHS } from "./helpers.js";
|
|
8
|
+
|
|
9
|
+
/** Keep the exact original identity before the cancellation payload can replace it. */
|
|
10
|
+
export async function upsertDeletedSubscriptionAndTrigger(
|
|
11
|
+
component: Component,
|
|
12
|
+
ctx: SyncTriggerCtx,
|
|
13
|
+
record: Record<string, unknown>,
|
|
14
|
+
onSubscriptionDeleted: NonNullable<SyncTriggers["subscription"]>["onDelete"],
|
|
15
|
+
): Promise<void> {
|
|
16
|
+
const id = record.stripeSubscriptionId;
|
|
17
|
+
if (typeof id !== "string") {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"[better-stripe] subscriptionDeleted: missing stripeSubscriptionId in data",
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const lookup = { stripeSubscriptionId: id };
|
|
23
|
+
const getter = componentRef(
|
|
24
|
+
component,
|
|
25
|
+
"billing/queries/getSubscriptionByStripeId",
|
|
26
|
+
);
|
|
27
|
+
let oldDoc: StripeComponentSubscription | null = null;
|
|
28
|
+
if (onSubscriptionDeleted) {
|
|
29
|
+
oldDoc = (await ctx.runQuery(getter, {
|
|
30
|
+
...lookup,
|
|
31
|
+
requireUnique: true,
|
|
32
|
+
})) as StripeComponentSubscription | null;
|
|
33
|
+
// A non-unique existence check distinguishes absence from ambiguity;
|
|
34
|
+
// its first row is never used as the original identity.
|
|
35
|
+
if (oldDoc === null && (await ctx.runQuery(getter, lookup)))
|
|
36
|
+
throw new Error(
|
|
37
|
+
`[better-stripe] subscriptionDeleted: ambiguous previous identity (stripeSubscriptionId=${id})`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
await ctx.runMutation(
|
|
41
|
+
componentRef(component, DISPATCHER_UPSERT_PATHS.subscriptionDeleted),
|
|
42
|
+
record,
|
|
43
|
+
);
|
|
44
|
+
if (!onSubscriptionDeleted) return;
|
|
45
|
+
const doc = (await ctx.runQuery(getter, {
|
|
46
|
+
...lookup,
|
|
47
|
+
requireUnique: true,
|
|
48
|
+
})) as StripeComponentSubscription | null;
|
|
49
|
+
if (doc === null) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
"[better-stripe] subscriptionDeleted: unique doc not found after " +
|
|
52
|
+
`upsert (stripeSubscriptionId=${id})`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
await onSubscriptionDeleted(ctx, doc, oldDoc);
|
|
56
|
+
}
|
|
@@ -165,8 +165,17 @@ import type * as settlement_queries from "../settlement/queries.js";
|
|
|
165
165
|
import type * as usage_helpers from "../usage/helpers.js";
|
|
166
166
|
import type * as usage_mutations from "../usage/mutations.js";
|
|
167
167
|
import type * as usage_queries from "../usage/queries.js";
|
|
168
|
+
import type * as usageAllowance_helpers from "../usageAllowance/helpers.js";
|
|
169
|
+
import type * as usageAllowance_mutations from "../usageAllowance/mutations.js";
|
|
170
|
+
import type * as usageAllowance_queries from "../usageAllowance/queries.js";
|
|
171
|
+
import type * as usageAllowance_reservations from "../usageAllowance/reservations.js";
|
|
168
172
|
import type * as usageCatalog_mutations from "../usageCatalog/mutations.js";
|
|
169
173
|
import type * as usageCatalog_queries from "../usageCatalog/queries.js";
|
|
174
|
+
import type * as usageCredits_helpers from "../usageCredits/helpers.js";
|
|
175
|
+
import type * as usageCredits_mutations from "../usageCredits/mutations.js";
|
|
176
|
+
import type * as usageCredits_purchase from "../usageCredits/purchase.js";
|
|
177
|
+
import type * as usageCredits_queries from "../usageCredits/queries.js";
|
|
178
|
+
import type * as usageCredits_reservations from "../usageCredits/reservations.js";
|
|
170
179
|
import type * as usageDelivery_bridge from "../usageDelivery/bridge.js";
|
|
171
180
|
import type * as usageDelivery_fields from "../usageDelivery/fields.js";
|
|
172
181
|
import type * as usageDelivery_helpers from "../usageDelivery/helpers.js";
|
|
@@ -354,8 +363,17 @@ const fullApi: ApiFromModules<{
|
|
|
354
363
|
"usage/helpers": typeof usage_helpers;
|
|
355
364
|
"usage/mutations": typeof usage_mutations;
|
|
356
365
|
"usage/queries": typeof usage_queries;
|
|
366
|
+
"usageAllowance/helpers": typeof usageAllowance_helpers;
|
|
367
|
+
"usageAllowance/mutations": typeof usageAllowance_mutations;
|
|
368
|
+
"usageAllowance/queries": typeof usageAllowance_queries;
|
|
369
|
+
"usageAllowance/reservations": typeof usageAllowance_reservations;
|
|
357
370
|
"usageCatalog/mutations": typeof usageCatalog_mutations;
|
|
358
371
|
"usageCatalog/queries": typeof usageCatalog_queries;
|
|
372
|
+
"usageCredits/helpers": typeof usageCredits_helpers;
|
|
373
|
+
"usageCredits/mutations": typeof usageCredits_mutations;
|
|
374
|
+
"usageCredits/purchase": typeof usageCredits_purchase;
|
|
375
|
+
"usageCredits/queries": typeof usageCredits_queries;
|
|
376
|
+
"usageCredits/reservations": typeof usageCredits_reservations;
|
|
359
377
|
"usageDelivery/bridge": typeof usageDelivery_bridge;
|
|
360
378
|
"usageDelivery/fields": typeof usageDelivery_fields;
|
|
361
379
|
"usageDelivery/helpers": typeof usageDelivery_helpers;
|