@fantastic.dev/better-stripe 0.33.0 → 0.35.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 +42 -0
- package/README.md +30 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +522 -2
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts +261 -1
- package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +522 -2
- package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +261 -1
- package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
- package/dist/client/connect/refundCommandEvidence.d.ts +14 -0
- package/dist/client/connect/refundCommandEvidence.d.ts.map +1 -0
- package/dist/client/connect/refundCommandEvidence.js +20 -0
- package/dist/client/connect/refundCommandEvidence.js.map +1 -0
- package/dist/client/connect/refundCommandNormalization.d.ts +11 -0
- package/dist/client/connect/refundCommandNormalization.d.ts.map +1 -0
- package/dist/client/connect/refundCommandNormalization.js +12 -0
- package/dist/client/connect/refundCommandNormalization.js.map +1 -0
- package/dist/client/core/accountClosures.d.ts +15 -0
- package/dist/client/core/accountClosures.d.ts.map +1 -0
- package/dist/client/core/accountClosures.js +10 -0
- package/dist/client/core/accountClosures.js.map +1 -0
- package/dist/client/core/accounts.d.ts.map +1 -1
- package/dist/client/core/accounts.js +15 -23
- package/dist/client/core/accounts.js.map +1 -1
- package/dist/client/core/personalAccountMapping.d.ts +8 -0
- package/dist/client/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/client/core/personalAccountMapping.js +11 -0
- package/dist/client/core/personalAccountMapping.js.map +1 -0
- package/dist/client/financialObservations.d.ts +42 -0
- package/dist/client/financialObservations.d.ts.map +1 -0
- package/dist/client/financialObservations.js +58 -0
- package/dist/client/financialObservations.js.map +1 -0
- package/dist/client/financialOwnership.d.ts +52 -0
- package/dist/client/financialOwnership.d.ts.map +1 -0
- package/dist/client/financialOwnership.js +72 -0
- package/dist/client/financialOwnership.js.map +1 -0
- package/dist/client/index.d.ts +57 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +15 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/observationPagination.d.ts +10 -0
- package/dist/client/observationPagination.d.ts.map +1 -0
- package/dist/client/observationPagination.js +12 -0
- package/dist/client/observationPagination.js.map +1 -0
- package/dist/client/publicTypes.d.ts +10 -0
- package/dist/client/publicTypes.d.ts.map +1 -0
- package/dist/client/publicTypes.js +2 -0
- package/dist/client/publicTypes.js.map +1 -0
- package/dist/client/readContracts.d.ts +29 -0
- package/dist/client/readContracts.d.ts.map +1 -1
- package/dist/client/readContracts.js +10 -0
- package/dist/client/readContracts.js.map +1 -1
- package/dist/client/transferObservations.d.ts +59 -0
- package/dist/client/transferObservations.d.ts.map +1 -0
- package/dist/client/transferObservations.js +82 -0
- package/dist/client/transferObservations.js.map +1 -0
- package/dist/component/_generated/component.d.ts +594 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/accountClosure/helpers.d.ts +18 -0
- package/dist/component/accountClosure/helpers.d.ts.map +1 -0
- package/dist/component/accountClosure/helpers.js +18 -0
- package/dist/component/accountClosure/helpers.js.map +1 -0
- package/dist/component/accountClosure/mutations.d.ts +20 -0
- package/dist/component/accountClosure/mutations.d.ts.map +1 -0
- package/dist/component/accountClosure/mutations.js +55 -0
- package/dist/component/accountClosure/mutations.js.map +1 -0
- package/dist/component/accountClosure/queries.d.ts +34 -0
- package/dist/component/accountClosure/queries.d.ts.map +1 -0
- package/dist/component/accountClosure/queries.js +36 -0
- package/dist/component/accountClosure/queries.js.map +1 -0
- package/dist/component/accountClosure/schema.d.ts +46 -0
- package/dist/component/accountClosure/schema.d.ts.map +1 -0
- package/dist/component/accountClosure/schema.js +20 -0
- package/dist/component/accountClosure/schema.js.map +1 -0
- package/dist/component/affiliateRecovery/mutations.d.ts.map +1 -1
- package/dist/component/affiliateRecovery/mutations.js +4 -1
- package/dist/component/affiliateRecovery/mutations.js.map +1 -1
- package/dist/component/connect/mutations.d.ts.map +1 -1
- package/dist/component/connect/mutations.js +18 -2
- package/dist/component/connect/mutations.js.map +1 -1
- package/dist/component/connect/queries.d.ts +8 -0
- package/dist/component/connect/queries.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.d.ts.map +1 -1
- package/dist/component/connect/reversalClaims.js +7 -1
- package/dist/component/connect/reversalClaims.js.map +1 -1
- package/dist/component/connect/reversalReceipts.d.ts.map +1 -1
- package/dist/component/connect/reversalReceipts.js +2 -0
- package/dist/component/connect/reversalReceipts.js.map +1 -1
- package/dist/component/connect/schema.d.ts +11 -1
- package/dist/component/connect/schema.d.ts.map +1 -1
- package/dist/component/connect/schema.js +9 -1
- package/dist/component/connect/schema.js.map +1 -1
- package/dist/component/connect/validators.d.ts +9 -1
- package/dist/component/connect/validators.d.ts.map +1 -1
- package/dist/component/connect/validators.js +2 -0
- package/dist/component/connect/validators.js.map +1 -1
- package/dist/component/core/mutations.d.ts.map +1 -1
- package/dist/component/core/mutations.js +5 -0
- package/dist/component/core/mutations.js.map +1 -1
- package/dist/component/core/personalAccountMapping.d.ts +95 -0
- package/dist/component/core/personalAccountMapping.d.ts.map +1 -0
- package/dist/component/core/personalAccountMapping.js +54 -0
- package/dist/component/core/personalAccountMapping.js.map +1 -0
- package/dist/component/core/queries.d.ts +27 -0
- package/dist/component/core/queries.d.ts.map +1 -1
- package/dist/component/core/queries.js +7 -0
- package/dist/component/core/queries.js.map +1 -1
- package/dist/component/earnings/triggers.d.ts +468 -2
- package/dist/component/earnings/triggers.d.ts.map +1 -1
- package/dist/component/earnings/triggers.js +7 -1
- package/dist/component/earnings/triggers.js.map +1 -1
- package/dist/component/financialObservations/continuation.d.ts +7 -0
- package/dist/component/financialObservations/continuation.d.ts.map +1 -0
- package/dist/component/financialObservations/continuation.js +131 -0
- package/dist/component/financialObservations/continuation.js.map +1 -0
- package/dist/component/financialObservations/generations.d.ts +6 -0
- package/dist/component/financialObservations/generations.d.ts.map +1 -0
- package/dist/component/financialObservations/generations.js +46 -0
- package/dist/component/financialObservations/generations.js.map +1 -0
- package/dist/component/financialObservations/mutations.d.ts +62 -0
- package/dist/component/financialObservations/mutations.d.ts.map +1 -0
- package/dist/component/financialObservations/mutations.js +69 -0
- package/dist/component/financialObservations/mutations.js.map +1 -0
- package/dist/component/financialObservations/queries.d.ts +307 -0
- package/dist/component/financialObservations/queries.d.ts.map +1 -0
- package/dist/component/financialObservations/queries.js +219 -0
- package/dist/component/financialObservations/queries.js.map +1 -0
- package/dist/component/financialObservations/schema.d.ts +182 -0
- package/dist/component/financialObservations/schema.d.ts.map +1 -0
- package/dist/component/financialObservations/schema.js +53 -0
- package/dist/component/financialObservations/schema.js.map +1 -0
- package/dist/component/financialObservations/settlement.d.ts +7 -0
- package/dist/component/financialObservations/settlement.d.ts.map +1 -0
- package/dist/component/financialObservations/settlement.js +118 -0
- package/dist/component/financialObservations/settlement.js.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts +46 -0
- package/dist/component/financialObservations/settlementHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/settlementHelpers.js +70 -0
- package/dist/component/financialObservations/settlementHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferBatches.d.ts +12 -0
- package/dist/component/financialObservations/transferBatches.d.ts.map +1 -0
- package/dist/component/financialObservations/transferBatches.js +76 -0
- package/dist/component/financialObservations/transferBatches.js.map +1 -0
- package/dist/component/financialObservations/transferContinuation.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuation.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuation.js +35 -0
- package/dist/component/financialObservations/transferContinuation.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts +8 -0
- package/dist/component/financialObservations/transferContinuationState.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationState.js +69 -0
- package/dist/component/financialObservations/transferContinuationState.js.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts +5 -0
- package/dist/component/financialObservations/transferContinuationSteps.d.ts.map +1 -0
- package/dist/component/financialObservations/transferContinuationSteps.js +174 -0
- package/dist/component/financialObservations/transferContinuationSteps.js.map +1 -0
- package/dist/component/financialObservations/transferHelpers.d.ts +18 -0
- package/dist/component/financialObservations/transferHelpers.d.ts.map +1 -0
- package/dist/component/financialObservations/transferHelpers.js +37 -0
- package/dist/component/financialObservations/transferHelpers.js.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts +56 -0
- package/dist/component/financialObservations/transferReferenceSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferReferenceSchema.js +21 -0
- package/dist/component/financialObservations/transferReferenceSchema.js.map +1 -0
- package/dist/component/financialObservations/transferSchema.d.ts +237 -0
- package/dist/component/financialObservations/transferSchema.d.ts.map +1 -0
- package/dist/component/financialObservations/transferSchema.js +65 -0
- package/dist/component/financialObservations/transferSchema.js.map +1 -0
- package/dist/component/financialObservations/transfers.d.ts +7 -0
- package/dist/component/financialObservations/transfers.d.ts.map +1 -0
- package/dist/component/financialObservations/transfers.js +79 -0
- package/dist/component/financialObservations/transfers.js.map +1 -0
- package/dist/component/financialOwnership/helpers.d.ts +37 -0
- package/dist/component/financialOwnership/helpers.d.ts.map +1 -0
- package/dist/component/financialOwnership/helpers.js +76 -0
- package/dist/component/financialOwnership/helpers.js.map +1 -0
- package/dist/component/financialOwnership/mutations.d.ts +28 -0
- package/dist/component/financialOwnership/mutations.d.ts.map +1 -0
- package/dist/component/financialOwnership/mutations.js +74 -0
- package/dist/component/financialOwnership/mutations.js.map +1 -0
- package/dist/component/financialOwnership/queries.d.ts +57 -0
- package/dist/component/financialOwnership/queries.d.ts.map +1 -0
- package/dist/component/financialOwnership/queries.js +50 -0
- package/dist/component/financialOwnership/queries.js.map +1 -0
- package/dist/component/financialOwnership/schema.d.ts +140 -0
- package/dist/component/financialOwnership/schema.d.ts.map +1 -0
- package/dist/component/financialOwnership/schema.js +35 -0
- package/dist/component/financialOwnership/schema.js.map +1 -0
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/commandBinding.d.ts +17 -0
- package/dist/component/refundHistory/commandBinding.d.ts.map +1 -0
- package/dist/component/refundHistory/commandBinding.js +41 -0
- package/dist/component/refundHistory/commandBinding.js.map +1 -0
- package/dist/component/refundHistory/commandEvidence.d.ts +50 -0
- package/dist/component/refundHistory/commandEvidence.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidence.js +54 -0
- package/dist/component/refundHistory/commandEvidence.js.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts +89 -0
- package/dist/component/refundHistory/commandEvidenceValidator.d.ts.map +1 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js +8 -0
- package/dist/component/refundHistory/commandEvidenceValidator.js.map +1 -0
- package/dist/component/refundHistory/commandFields.d.ts +8 -0
- package/dist/component/refundHistory/commandFields.d.ts.map +1 -0
- package/dist/component/refundHistory/commandFields.js +9 -0
- package/dist/component/refundHistory/commandFields.js.map +1 -0
- package/dist/component/refundHistory/mutations.d.ts +8 -0
- package/dist/component/refundHistory/mutations.d.ts.map +1 -0
- package/dist/component/refundHistory/mutations.js +25 -0
- package/dist/component/refundHistory/mutations.js.map +1 -0
- package/dist/component/refundHistory/queries.d.ts +51 -0
- package/dist/component/refundHistory/queries.d.ts.map +1 -1
- package/dist/component/refundHistory/queries.js +14 -0
- package/dist/component/refundHistory/queries.js.map +1 -1
- package/dist/component/schema.d.ts +261 -1
- package/dist/component/schema.js +14 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/component/settlement/mutations.d.ts.map +1 -1
- package/dist/component/settlement/mutations.js +5 -1
- package/dist/component/settlement/mutations.js.map +1 -1
- package/dist/shared/refundCommandScope.d.ts +10 -0
- package/dist/shared/refundCommandScope.d.ts.map +1 -0
- package/dist/shared/refundCommandScope.js +9 -0
- package/dist/shared/refundCommandScope.js.map +1 -0
- package/docs/financial-observations.md +159 -0
- package/docs/financial-ownership.md +54 -0
- package/docs/personal-account-mapping.md +54 -0
- package/docs/refund-command-evidence.md +49 -0
- package/package.json +6 -2
- package/src/client/connect/refundCommandEvidence.ts +41 -0
- package/src/client/connect/refundCommandNormalization.ts +28 -0
- package/src/client/core/account-close-orchestration.test.ts +131 -0
- package/src/client/core/account-closure.test.ts +317 -0
- package/src/client/core/accountClosures.ts +37 -0
- package/src/client/core/accounts.test.ts +0 -111
- package/src/client/core/accounts.ts +24 -29
- package/src/client/core/personal-account-mapping.test.ts +71 -0
- package/src/client/core/personalAccountMapping.ts +23 -0
- package/src/client/financialObservations.test.ts +109 -0
- package/src/client/financialObservations.ts +106 -0
- package/src/client/financialOwnership.test.ts +80 -0
- package/src/client/financialOwnership.ts +116 -0
- package/src/client/index.ts +38 -35
- package/src/client/observationPagination.ts +11 -0
- package/src/client/publicTypes.ts +72 -0
- package/src/client/readContracts.ts +21 -0
- package/src/client/refund-command-evidence.test.ts +68 -0
- package/src/client/refund-command-normalization.test.ts +61 -0
- package/src/client/transferContinuation.test.ts +94 -0
- package/src/client/transferObservations.test.ts +98 -0
- package/src/client/transferObservations.ts +180 -0
- package/src/component/_generated/api.ts +52 -0
- package/src/component/_generated/component.ts +716 -0
- package/src/component/accountClosure/helpers.ts +21 -0
- package/src/component/accountClosure/mutations.ts +56 -0
- package/src/component/accountClosure/queries.ts +43 -0
- package/src/component/accountClosure/schema.ts +20 -0
- package/src/component/affiliateRecovery/mutations.ts +10 -1
- package/src/component/connect/mutations.ts +29 -2
- package/src/component/connect/reversalClaims.ts +19 -1
- package/src/component/connect/reversalReceipts.ts +2 -0
- package/src/component/connect/schema.ts +9 -1
- package/src/component/connect/validators.ts +2 -0
- package/src/component/core/mutations.ts +3 -0
- package/src/component/core/personal-account-mapping.test.ts +173 -0
- package/src/component/core/personalAccountMapping.ts +81 -0
- package/src/component/core/queries.ts +11 -0
- package/src/component/core/reset.test.ts +8 -1
- package/src/component/earnings/earnings-totals.test.ts +14 -10
- package/src/component/earnings/triggers.ts +9 -1
- package/src/component/financialObservations/continuation.test.ts +445 -0
- package/src/component/financialObservations/continuation.ts +159 -0
- package/src/component/financialObservations/generations.ts +53 -0
- package/src/component/financialObservations/mutations.ts +75 -0
- package/src/component/financialObservations/observation-boundaries.test.ts +466 -0
- package/src/component/financialObservations/queries.ts +246 -0
- package/src/component/financialObservations/schema.ts +68 -0
- package/src/component/financialObservations/settlement-observations.test.ts +86 -0
- package/src/component/financialObservations/settlement.ts +142 -0
- package/src/component/financialObservations/settlementHelpers.ts +92 -0
- package/src/component/financialObservations/transfer-batches.test.ts +61 -0
- package/src/component/financialObservations/transfer-boundaries.test.ts +116 -0
- package/src/component/financialObservations/transfer-continuation-guards.test.ts +428 -0
- package/src/component/financialObservations/transfer-continuation.test.ts +154 -0
- package/src/component/financialObservations/transfer-observations.test.ts +212 -0
- package/src/component/financialObservations/transfer-overflow.test.ts +181 -0
- package/src/component/financialObservations/transfer-writers.test.ts +162 -0
- package/src/component/financialObservations/transferBatches.ts +96 -0
- package/src/component/financialObservations/transferContinuation.ts +53 -0
- package/src/component/financialObservations/transferContinuationState.ts +85 -0
- package/src/component/financialObservations/transferContinuationSteps.ts +232 -0
- package/src/component/financialObservations/transferHelpers.ts +38 -0
- package/src/component/financialObservations/transferReferenceSchema.ts +20 -0
- package/src/component/financialObservations/transferSchema.ts +74 -0
- package/src/component/financialObservations/transfers.ts +99 -0
- package/src/component/financialOwnership/financial-ownership.test.ts +102 -0
- package/src/component/financialOwnership/helpers.ts +98 -0
- package/src/component/financialOwnership/mutations.ts +83 -0
- package/src/component/financialOwnership/ownership-boundaries.test.ts +308 -0
- package/src/component/financialOwnership/queries.ts +65 -0
- package/src/component/financialOwnership/schema.ts +35 -0
- package/src/component/refundHistory/command-evidence.test.ts +288 -0
- package/src/component/refundHistory/command-normalization-resource.test.ts +77 -0
- package/src/component/refundHistory/command-normalization.test.ts +229 -0
- package/src/component/refundHistory/command-provenance.test.ts +59 -0
- package/src/component/refundHistory/commandBinding.ts +54 -0
- package/src/component/refundHistory/commandEvidence.ts +71 -0
- package/src/component/refundHistory/commandEvidenceValidator.ts +18 -0
- package/src/component/refundHistory/commandFields.ts +9 -0
- package/src/component/refundHistory/mutations.ts +33 -0
- package/src/component/refundHistory/queries.ts +15 -0
- package/src/component/schema.ts +24 -0
- package/src/component/settlement/mutations.ts +5 -1
- package/src/shared/refundCommandScope.ts +19 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { expect, it, vi } from "vitest";
|
|
3
|
+
|
|
4
|
+
import schema from "../component/schema.js";
|
|
5
|
+
import { BetterStripe, type RefundCommandEvidenceOptions } from "./index.js";
|
|
6
|
+
import type { RunCtx } from "./helpers.js";
|
|
7
|
+
import { components, initConvexTest } from "./setup.test.js";
|
|
8
|
+
|
|
9
|
+
const modules = import.meta.glob("../component/**/*.ts");
|
|
10
|
+
const opts: RefundCommandEvidenceOptions = {
|
|
11
|
+
commandKey: "dojo-refund:original_command:v1",
|
|
12
|
+
stripeAccountId: "acct_original",
|
|
13
|
+
stripePaymentIntentId: "pi_original",
|
|
14
|
+
stripeChargeId: "ch_original",
|
|
15
|
+
currency: "jpy",
|
|
16
|
+
};
|
|
17
|
+
function fixture() {
|
|
18
|
+
const t = initConvexTest();
|
|
19
|
+
t.registerComponent("betterStripe", schema, modules);
|
|
20
|
+
const ctx = { runQuery: t.query, runMutation: t.mutation } as RunCtx;
|
|
21
|
+
const client = new BetterStripe(components.betterStripe, {});
|
|
22
|
+
return { t, ctx, client };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
it("exposes actual component correlation through public BetterStripe without Stripe credentials", async () => {
|
|
26
|
+
const f = fixture();
|
|
27
|
+
await f.t.mutation(components.betterStripe.connect.mutations.upsertRefund, {
|
|
28
|
+
stripeRefundId: "re_original",
|
|
29
|
+
accountId: opts.stripeAccountId,
|
|
30
|
+
stripePaymentIntentId: opts.stripePaymentIntentId,
|
|
31
|
+
stripeChargeId: opts.stripeChargeId,
|
|
32
|
+
amount: 500,
|
|
33
|
+
currency: "jpy",
|
|
34
|
+
status: "succeeded",
|
|
35
|
+
metadata: { betterStripeRefundCommand: opts.commandKey },
|
|
36
|
+
});
|
|
37
|
+
expect(await f.client.getRefundCommandEvidence(f.ctx, opts)).toMatchObject({
|
|
38
|
+
status: "observed",
|
|
39
|
+
refund: { stripeRefundId: "re_original", amount: 500, currency: "jpy" },
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it.each([
|
|
44
|
+
undefined,
|
|
45
|
+
null,
|
|
46
|
+
{},
|
|
47
|
+
{ ...opts, commandKey: "" },
|
|
48
|
+
{ ...opts, commandKey: " x".repeat(100) },
|
|
49
|
+
{ ...opts, commandKey: "x".repeat(201) },
|
|
50
|
+
{ ...opts, commandKey: 123 },
|
|
51
|
+
{ ...opts, stripeAccountId: "cus_wrong" },
|
|
52
|
+
{ ...opts, stripePaymentIntentId: "pi_" },
|
|
53
|
+
{ ...opts, stripeChargeId: "ch_wrong space" },
|
|
54
|
+
{ ...opts, currency: "USD" },
|
|
55
|
+
{ ...opts, actor: { type: "admin" } },
|
|
56
|
+
])(
|
|
57
|
+
"rejects malformed public selectors %# before component reads",
|
|
58
|
+
async (options) => {
|
|
59
|
+
const f = fixture();
|
|
60
|
+
const runQuery = vi.fn();
|
|
61
|
+
const read = f.client.getRefundCommandEvidence.bind(f.client) as (
|
|
62
|
+
ctx: RunCtx,
|
|
63
|
+
opts: unknown,
|
|
64
|
+
) => Promise<unknown>;
|
|
65
|
+
await expect(read({ runQuery } as RunCtx, options)).rejects.toThrow();
|
|
66
|
+
expect(runQuery).not.toHaveBeenCalled();
|
|
67
|
+
},
|
|
68
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { expect, it, vi } from "vitest";
|
|
2
|
+
import { BetterStripe } from "./index.js";
|
|
3
|
+
import type { RunCtx } from "./helpers.js";
|
|
4
|
+
import { components } from "./setup.test.js";
|
|
5
|
+
|
|
6
|
+
function fixture() {
|
|
7
|
+
const result = { normalized: 2, hasMore: true };
|
|
8
|
+
const ctx = {
|
|
9
|
+
runQuery: vi.fn(),
|
|
10
|
+
runMutation: vi.fn().mockResolvedValue(result),
|
|
11
|
+
} as RunCtx;
|
|
12
|
+
return { result, ctx, client: new BetterStripe(components.betterStripe, {}) };
|
|
13
|
+
}
|
|
14
|
+
it("forwards a validated bounded batch through the public inherited method without provider credentials", async () => {
|
|
15
|
+
const f = fixture();
|
|
16
|
+
expect(
|
|
17
|
+
await f.client.normalizeRefundCommandBindings(f.ctx, { limit: 2 }),
|
|
18
|
+
).toEqual(f.result);
|
|
19
|
+
expect(f.ctx.runMutation).toHaveBeenCalledExactlyOnceWith(expect.anything(), {
|
|
20
|
+
limit: 2,
|
|
21
|
+
});
|
|
22
|
+
expect(f.ctx.runQuery).not.toHaveBeenCalled();
|
|
23
|
+
});
|
|
24
|
+
it.each([
|
|
25
|
+
undefined,
|
|
26
|
+
null,
|
|
27
|
+
{},
|
|
28
|
+
{ limit: 0 },
|
|
29
|
+
{ limit: 101 },
|
|
30
|
+
{ limit: 1.5 },
|
|
31
|
+
{ limit: "2" },
|
|
32
|
+
{ limit: 2, actor: "admin" },
|
|
33
|
+
])(
|
|
34
|
+
"rejects malformed options %# before any component operation",
|
|
35
|
+
async (opts) => {
|
|
36
|
+
const f = fixture();
|
|
37
|
+
const run = f.client.normalizeRefundCommandBindings.bind(f.client) as (
|
|
38
|
+
ctx: RunCtx,
|
|
39
|
+
opts: unknown,
|
|
40
|
+
) => Promise<unknown>;
|
|
41
|
+
await expect(run(f.ctx, opts)).rejects.toThrow();
|
|
42
|
+
expect(f.ctx.runMutation).not.toHaveBeenCalled();
|
|
43
|
+
expect(f.ctx.runQuery).not.toHaveBeenCalled();
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
it("requires mutation context and propagates the original component error", async () => {
|
|
47
|
+
const f = fixture();
|
|
48
|
+
await expect(
|
|
49
|
+
f.client.normalizeRefundCommandBindings(
|
|
50
|
+
{ runQuery: vi.fn() },
|
|
51
|
+
{ limit: 1 },
|
|
52
|
+
),
|
|
53
|
+
).rejects.toThrow("runMutation");
|
|
54
|
+
const error = new Error("component unavailable");
|
|
55
|
+
await expect(
|
|
56
|
+
f.client.normalizeRefundCommandBindings(
|
|
57
|
+
{ runQuery: vi.fn(), runMutation: vi.fn().mockRejectedValue(error) },
|
|
58
|
+
{ limit: 1 },
|
|
59
|
+
),
|
|
60
|
+
).rejects.toBe(error);
|
|
61
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { expect, it, vi } from "vitest";
|
|
3
|
+
import schema from "../component/schema.js";
|
|
4
|
+
import { BetterStripe } from "./index.js";
|
|
5
|
+
import type { RunCtx } from "./helpers.js";
|
|
6
|
+
import { components, initConvexTest } from "./setup.test.js";
|
|
7
|
+
import { componentRef } from "./webhooks/helpers.js";
|
|
8
|
+
it("drains every original reference through the actual public SDK and component", async () => {
|
|
9
|
+
const t = initConvexTest();
|
|
10
|
+
t.registerComponent(
|
|
11
|
+
"betterStripe",
|
|
12
|
+
schema,
|
|
13
|
+
import.meta.glob("../component/**/*.ts"),
|
|
14
|
+
);
|
|
15
|
+
const client = new BetterStripe(components.betterStripe);
|
|
16
|
+
const ctx = { runQuery: t.query, runMutation: t.mutation } as RunCtx;
|
|
17
|
+
for (let i = 0; i < 101; i++)
|
|
18
|
+
await t.mutation(
|
|
19
|
+
componentRef(components.betterStripe, "connect/mutations/upsertTransfer"),
|
|
20
|
+
{
|
|
21
|
+
stripeTransferId: `tr_sdk_${i}`,
|
|
22
|
+
sourceChargeId: "ch_sdk",
|
|
23
|
+
destinationAccountId: "opaque",
|
|
24
|
+
amount: 1,
|
|
25
|
+
currency: "usd",
|
|
26
|
+
status: "paid",
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
await t.mutation(
|
|
30
|
+
componentRef(
|
|
31
|
+
components.betterStripe,
|
|
32
|
+
"connect/mutations/claimReversalSlices",
|
|
33
|
+
),
|
|
34
|
+
{ operationId: "op_sdk", sourceChargeId: "ch_sdk", mode: { kind: "full" } },
|
|
35
|
+
);
|
|
36
|
+
const page = await client.financialObservations.transferBatches(ctx, {
|
|
37
|
+
operationId: "op_sdk",
|
|
38
|
+
paginationOpts: { numItems: 25, cursor: null },
|
|
39
|
+
});
|
|
40
|
+
const batchId = page.page[0]._id;
|
|
41
|
+
let r = await client.financialObservations.transferBatch(ctx, { batchId });
|
|
42
|
+
let calls = 0;
|
|
43
|
+
while (r.batch?.state !== "complete") {
|
|
44
|
+
r = await client.financialObservations.resumeTransferBatch(ctx, {
|
|
45
|
+
batchId,
|
|
46
|
+
expectedGeneration: r.batch!.generation,
|
|
47
|
+
});
|
|
48
|
+
calls++;
|
|
49
|
+
expect(calls).toBeLessThan(10);
|
|
50
|
+
}
|
|
51
|
+
expect(r).toMatchObject({
|
|
52
|
+
coverage: "unknown",
|
|
53
|
+
hasDeferredWork: false,
|
|
54
|
+
batch: { continuation: { nextReference: 101, validatedReferences: 101 } },
|
|
55
|
+
});
|
|
56
|
+
const refs = await client.financialObservations.transferReferences(ctx, {
|
|
57
|
+
batchId,
|
|
58
|
+
paginationOpts: { numItems: 100, cursor: null, id: 7 },
|
|
59
|
+
});
|
|
60
|
+
const last = await client.financialObservations.transferReferences(ctx, {
|
|
61
|
+
batchId,
|
|
62
|
+
paginationOpts: { numItems: 100, cursor: refs.continueCursor, id: 7 },
|
|
63
|
+
});
|
|
64
|
+
expect([...refs.page, ...last.page]).toHaveLength(101);
|
|
65
|
+
expect(last.isDone).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
it("rejects caller continuation state and invalid generations before trusted dispatch", async () => {
|
|
68
|
+
const client = new BetterStripe(components.betterStripe);
|
|
69
|
+
const ctx = { runQuery: vi.fn(), runMutation: vi.fn() };
|
|
70
|
+
await expect(
|
|
71
|
+
client.financialObservations.resumeTransferBatch(ctx, {
|
|
72
|
+
batchId: "synthetic",
|
|
73
|
+
expectedGeneration: 0,
|
|
74
|
+
}),
|
|
75
|
+
).rejects.toThrow();
|
|
76
|
+
await expect(
|
|
77
|
+
client.financialObservations.resumeTransferBatch(ctx, {
|
|
78
|
+
batchId: "synthetic",
|
|
79
|
+
expectedGeneration: 1,
|
|
80
|
+
complete: true,
|
|
81
|
+
} as never),
|
|
82
|
+
).rejects.toThrow();
|
|
83
|
+
await expect(
|
|
84
|
+
client.financialObservations.transferBatch(ctx, { batchId: "" }),
|
|
85
|
+
).rejects.toThrow();
|
|
86
|
+
await expect(
|
|
87
|
+
client.financialObservations.transferReferences(ctx, {
|
|
88
|
+
batchId: "synthetic",
|
|
89
|
+
paginationOpts: { numItems: 101, cursor: null },
|
|
90
|
+
}),
|
|
91
|
+
).rejects.toThrow();
|
|
92
|
+
expect(ctx.runMutation).not.toHaveBeenCalled();
|
|
93
|
+
expect(ctx.runQuery).not.toHaveBeenCalled();
|
|
94
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// @vitest-environment edge-runtime
|
|
2
|
+
import { expect, it, vi } from "vitest";
|
|
3
|
+
import schema from "../component/schema.js";
|
|
4
|
+
import { BetterStripe } from "./index.js";
|
|
5
|
+
import type { RunCtx } from "./helpers.js";
|
|
6
|
+
import { components, initConvexTest } from "./setup.test.js";
|
|
7
|
+
import { componentRef } from "./webhooks/helpers.js";
|
|
8
|
+
it("reads actual transfer diagnostics through the public SDK with exact scope isolation", async () => {
|
|
9
|
+
const t = initConvexTest();
|
|
10
|
+
t.registerComponent(
|
|
11
|
+
"betterStripe",
|
|
12
|
+
schema,
|
|
13
|
+
import.meta.glob("../component/**/*.ts"),
|
|
14
|
+
);
|
|
15
|
+
const client = new BetterStripe(components.betterStripe);
|
|
16
|
+
const ctx = { runQuery: t.query, runMutation: t.mutation } as RunCtx;
|
|
17
|
+
await client.financialOwnership.register(ctx, {
|
|
18
|
+
bucketKey: "opaque",
|
|
19
|
+
kind: "logical",
|
|
20
|
+
userId: "user",
|
|
21
|
+
source: { integration: "host", recordId: "record" },
|
|
22
|
+
});
|
|
23
|
+
await t.mutation(
|
|
24
|
+
componentRef(components.betterStripe, "connect/mutations/upsertTransfer"),
|
|
25
|
+
{
|
|
26
|
+
stripeTransferId: "tr_sdk",
|
|
27
|
+
sourceChargeId: "ch_sdk",
|
|
28
|
+
destinationAccountId: "opaque",
|
|
29
|
+
amount: 1,
|
|
30
|
+
currency: "usd",
|
|
31
|
+
status: "paid",
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
const row = await t.query(
|
|
35
|
+
componentRef(
|
|
36
|
+
components.betterStripe,
|
|
37
|
+
"connect/queries/getTransferByStripeId",
|
|
38
|
+
),
|
|
39
|
+
{ stripeTransferId: "tr_sdk" },
|
|
40
|
+
);
|
|
41
|
+
expect(
|
|
42
|
+
await client.financialObservations.transfer(ctx, { transferId: row._id }),
|
|
43
|
+
).toMatchObject({
|
|
44
|
+
coverage: "unknown",
|
|
45
|
+
hasDeferredWork: false,
|
|
46
|
+
observation: { userId: "user", generation: 1 },
|
|
47
|
+
});
|
|
48
|
+
const paginationOpts = { numItems: 25, cursor: null, id: 9 };
|
|
49
|
+
expect(
|
|
50
|
+
await client.financialObservations.transferBucket(ctx, {
|
|
51
|
+
bucketKey: "opaque",
|
|
52
|
+
paginationOpts,
|
|
53
|
+
}),
|
|
54
|
+
).toMatchObject({
|
|
55
|
+
coverage: "unknown",
|
|
56
|
+
page: [expect.objectContaining({ transferId: row._id })],
|
|
57
|
+
});
|
|
58
|
+
expect(
|
|
59
|
+
await client.financialObservations.transferOwner(ctx, {
|
|
60
|
+
userId: "other",
|
|
61
|
+
paginationOpts,
|
|
62
|
+
}),
|
|
63
|
+
).toMatchObject({ coverage: "unknown", page: [] });
|
|
64
|
+
expect(
|
|
65
|
+
await client.financialObservations.transferBatches(ctx, {
|
|
66
|
+
operationId: "absent",
|
|
67
|
+
paginationOpts,
|
|
68
|
+
}),
|
|
69
|
+
).toMatchObject({ coverage: "unknown", page: [], hasDeferredWork: false });
|
|
70
|
+
});
|
|
71
|
+
it("rejects invalid transfer read selectors and caller cursor-state before dispatch", async () => {
|
|
72
|
+
const client = new BetterStripe(components.betterStripe);
|
|
73
|
+
const ctx = { runQuery: vi.fn() };
|
|
74
|
+
await expect(
|
|
75
|
+
client.financialObservations.transfer(ctx, { transferId: "" }),
|
|
76
|
+
).rejects.toThrow();
|
|
77
|
+
await expect(
|
|
78
|
+
client.financialObservations.transferOwner(ctx, {
|
|
79
|
+
userId: "user",
|
|
80
|
+
orgId: "",
|
|
81
|
+
paginationOpts: { numItems: 25, cursor: null },
|
|
82
|
+
}),
|
|
83
|
+
).rejects.toThrow();
|
|
84
|
+
await expect(
|
|
85
|
+
client.financialObservations.transferBucket(ctx, {
|
|
86
|
+
bucketKey: "opaque",
|
|
87
|
+
paginationOpts: { numItems: 101, cursor: null },
|
|
88
|
+
}),
|
|
89
|
+
).rejects.toThrow();
|
|
90
|
+
await expect(
|
|
91
|
+
client.financialObservations.transferBatches(ctx, {
|
|
92
|
+
operationId: "op",
|
|
93
|
+
paginationOpts: { numItems: 25, cursor: null },
|
|
94
|
+
complete: true,
|
|
95
|
+
} as never),
|
|
96
|
+
).rejects.toThrow();
|
|
97
|
+
expect(ctx.runQuery).not.toHaveBeenCalled();
|
|
98
|
+
});
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { transferReferenceDoc } from "../component/financialObservations/transferReferenceSchema.js";
|
|
2
|
+
import { runMutationOrThrow } from "./helpers.js";
|
|
3
|
+
import type { PaginationOptions, PaginationResult } from "convex/server";
|
|
4
|
+
import type { Infer } from "convex/values";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import {
|
|
7
|
+
assertOwner,
|
|
8
|
+
assertSelector,
|
|
9
|
+
} from "../component/financialOwnership/helpers.js";
|
|
10
|
+
import type {
|
|
11
|
+
transferObservationDoc,
|
|
12
|
+
transferBatchDoc,
|
|
13
|
+
} from "../component/financialObservations/transferSchema.js";
|
|
14
|
+
import type { Component, RunCtx } from "./helpers.js";
|
|
15
|
+
import { observationPagination } from "./observationPagination.js";
|
|
16
|
+
import { componentRef } from "./webhooks/helpers.js";
|
|
17
|
+
|
|
18
|
+
export type FinancialTransferObservation = Infer<typeof transferObservationDoc>;
|
|
19
|
+
export type FinancialTransferBatch = Infer<typeof transferBatchDoc>;
|
|
20
|
+
export type FinancialTransferReadState = {
|
|
21
|
+
coverage: "unknown";
|
|
22
|
+
producerGeneration: number | null;
|
|
23
|
+
hasDeferredWork: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type FinancialTransferResult = FinancialTransferReadState & {
|
|
26
|
+
observation: FinancialTransferObservation | null;
|
|
27
|
+
};
|
|
28
|
+
export type FinancialTransferPage = FinancialTransferReadState &
|
|
29
|
+
PaginationResult<FinancialTransferObservation> & {
|
|
30
|
+
generation: number | null;
|
|
31
|
+
};
|
|
32
|
+
export type FinancialTransferBatchPage = FinancialTransferReadState &
|
|
33
|
+
PaginationResult<FinancialTransferBatch>;
|
|
34
|
+
export type FinancialTransferReference = Infer<typeof transferReferenceDoc>;
|
|
35
|
+
export type FinancialTransferBatchResult = FinancialTransferReadState & {
|
|
36
|
+
batch: FinancialTransferBatch | null;
|
|
37
|
+
};
|
|
38
|
+
export type FinancialTransferReferencePage = FinancialTransferReadState &
|
|
39
|
+
PaginationResult<FinancialTransferReference>;
|
|
40
|
+
/** Trusted host diagnostics. Pending batches invalidate historical pages, never financial state. */
|
|
41
|
+
export class TransferObservationsClient {
|
|
42
|
+
constructor(protected component: Component) {}
|
|
43
|
+
async transferBatch(
|
|
44
|
+
ctx: RunCtx,
|
|
45
|
+
input: { batchId: string },
|
|
46
|
+
): Promise<FinancialTransferBatchResult> {
|
|
47
|
+
const args = z
|
|
48
|
+
.object({ batchId: z.string().min(1).max(256) })
|
|
49
|
+
.strict()
|
|
50
|
+
.parse(input);
|
|
51
|
+
return ctx.runQuery(
|
|
52
|
+
componentRef(
|
|
53
|
+
this.component,
|
|
54
|
+
"financialObservations/queries/transferBatch",
|
|
55
|
+
),
|
|
56
|
+
args,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
async resumeTransferBatch(
|
|
60
|
+
ctx: RunCtx,
|
|
61
|
+
input: { batchId: string; expectedGeneration: number },
|
|
62
|
+
): Promise<FinancialTransferBatchResult> {
|
|
63
|
+
const args = z
|
|
64
|
+
.object({
|
|
65
|
+
batchId: z.string().min(1).max(256),
|
|
66
|
+
expectedGeneration: z
|
|
67
|
+
.number()
|
|
68
|
+
.int()
|
|
69
|
+
.min(1)
|
|
70
|
+
.max(Number.MAX_SAFE_INTEGER),
|
|
71
|
+
})
|
|
72
|
+
.strict()
|
|
73
|
+
.parse(input);
|
|
74
|
+
return runMutationOrThrow(
|
|
75
|
+
ctx,
|
|
76
|
+
componentRef(
|
|
77
|
+
this.component,
|
|
78
|
+
"financialObservations/mutations/resumeTransferBatch",
|
|
79
|
+
),
|
|
80
|
+
args,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
async transferReferences(
|
|
84
|
+
ctx: RunCtx,
|
|
85
|
+
input: {
|
|
86
|
+
batchId: string;
|
|
87
|
+
paginationOpts: PaginationOptions & { id?: number };
|
|
88
|
+
},
|
|
89
|
+
): Promise<FinancialTransferReferencePage> {
|
|
90
|
+
const args = z
|
|
91
|
+
.object({
|
|
92
|
+
batchId: z.string().min(1).max(256),
|
|
93
|
+
paginationOpts: observationPagination,
|
|
94
|
+
})
|
|
95
|
+
.strict()
|
|
96
|
+
.parse(input);
|
|
97
|
+
return ctx.runQuery(
|
|
98
|
+
componentRef(
|
|
99
|
+
this.component,
|
|
100
|
+
"financialObservations/queries/transferReferences",
|
|
101
|
+
),
|
|
102
|
+
args,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
async transfer(
|
|
106
|
+
ctx: RunCtx,
|
|
107
|
+
input: { transferId: string },
|
|
108
|
+
): Promise<FinancialTransferResult> {
|
|
109
|
+
const args = z
|
|
110
|
+
.object({ transferId: z.string().min(1).max(256) })
|
|
111
|
+
.strict()
|
|
112
|
+
.parse(input);
|
|
113
|
+
return ctx.runQuery(
|
|
114
|
+
componentRef(this.component, "financialObservations/queries/transfer"),
|
|
115
|
+
args,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
async transferBucket(
|
|
119
|
+
ctx: RunCtx,
|
|
120
|
+
input: { bucketKey: string; paginationOpts: PaginationOptions },
|
|
121
|
+
): Promise<FinancialTransferPage> {
|
|
122
|
+
const args = z
|
|
123
|
+
.object({ bucketKey: z.string(), paginationOpts: observationPagination })
|
|
124
|
+
.strict()
|
|
125
|
+
.parse(input);
|
|
126
|
+
assertSelector(args.bucketKey);
|
|
127
|
+
return ctx.runQuery(
|
|
128
|
+
componentRef(
|
|
129
|
+
this.component,
|
|
130
|
+
"financialObservations/queries/transferBucket",
|
|
131
|
+
),
|
|
132
|
+
args,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
async transferOwner(
|
|
136
|
+
ctx: RunCtx,
|
|
137
|
+
input: {
|
|
138
|
+
userId: string;
|
|
139
|
+
orgId?: string;
|
|
140
|
+
paginationOpts: PaginationOptions;
|
|
141
|
+
},
|
|
142
|
+
): Promise<FinancialTransferPage> {
|
|
143
|
+
const args = z
|
|
144
|
+
.object({
|
|
145
|
+
userId: z.string(),
|
|
146
|
+
orgId: z.string().optional(),
|
|
147
|
+
paginationOpts: observationPagination,
|
|
148
|
+
})
|
|
149
|
+
.strict()
|
|
150
|
+
.parse(input);
|
|
151
|
+
assertOwner(args);
|
|
152
|
+
return ctx.runQuery(
|
|
153
|
+
componentRef(
|
|
154
|
+
this.component,
|
|
155
|
+
"financialObservations/queries/transferOwner",
|
|
156
|
+
),
|
|
157
|
+
args,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
async transferBatches(
|
|
161
|
+
ctx: RunCtx,
|
|
162
|
+
input: { operationId: string; paginationOpts: PaginationOptions },
|
|
163
|
+
): Promise<FinancialTransferBatchPage> {
|
|
164
|
+
const args = z
|
|
165
|
+
.object({
|
|
166
|
+
operationId: z.string(),
|
|
167
|
+
paginationOpts: observationPagination,
|
|
168
|
+
})
|
|
169
|
+
.strict()
|
|
170
|
+
.parse(input);
|
|
171
|
+
assertSelector(args.operationId);
|
|
172
|
+
return ctx.runQuery(
|
|
173
|
+
componentRef(
|
|
174
|
+
this.component,
|
|
175
|
+
"financialObservations/queries/transferBatches",
|
|
176
|
+
),
|
|
177
|
+
args,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type * as accountClosure_helpers from "../accountClosure/helpers.js";
|
|
12
|
+
import type * as accountClosure_mutations from "../accountClosure/mutations.js";
|
|
13
|
+
import type * as accountClosure_queries from "../accountClosure/queries.js";
|
|
11
14
|
import type * as affiliateEarnings_mutations from "../affiliateEarnings/mutations.js";
|
|
12
15
|
import type * as affiliatePayouts_mutations from "../affiliatePayouts/mutations.js";
|
|
13
16
|
import type * as affiliatePayouts_queries from "../affiliatePayouts/queries.js";
|
|
@@ -26,6 +29,7 @@ import type * as connect_reversalDiagnostics from "../connect/reversalDiagnostic
|
|
|
26
29
|
import type * as connect_reversalReceipts from "../connect/reversalReceipts.js";
|
|
27
30
|
import type * as connect_validators from "../connect/validators.js";
|
|
28
31
|
import type * as core_mutations from "../core/mutations.js";
|
|
32
|
+
import type * as core_personalAccountMapping from "../core/personalAccountMapping.js";
|
|
29
33
|
import type * as core_queries from "../core/queries.js";
|
|
30
34
|
import type * as core_resetSafety from "../core/resetSafety.js";
|
|
31
35
|
import type * as core_validators from "../core/validators.js";
|
|
@@ -41,6 +45,23 @@ import type * as earnings_legacyReads from "../earnings/legacyReads.js";
|
|
|
41
45
|
import type * as earnings_mutations from "../earnings/mutations.js";
|
|
42
46
|
import type * as earnings_reads from "../earnings/reads.js";
|
|
43
47
|
import type * as earnings_triggers from "../earnings/triggers.js";
|
|
48
|
+
import type * as financialObservations_continuation from "../financialObservations/continuation.js";
|
|
49
|
+
import type * as financialObservations_generations from "../financialObservations/generations.js";
|
|
50
|
+
import type * as financialObservations_mutations from "../financialObservations/mutations.js";
|
|
51
|
+
import type * as financialObservations_queries from "../financialObservations/queries.js";
|
|
52
|
+
import type * as financialObservations_settlement from "../financialObservations/settlement.js";
|
|
53
|
+
import type * as financialObservations_settlementHelpers from "../financialObservations/settlementHelpers.js";
|
|
54
|
+
import type * as financialObservations_transferBatches from "../financialObservations/transferBatches.js";
|
|
55
|
+
import type * as financialObservations_transferContinuation from "../financialObservations/transferContinuation.js";
|
|
56
|
+
import type * as financialObservations_transferContinuationState from "../financialObservations/transferContinuationState.js";
|
|
57
|
+
import type * as financialObservations_transferContinuationSteps from "../financialObservations/transferContinuationSteps.js";
|
|
58
|
+
import type * as financialObservations_transferHelpers from "../financialObservations/transferHelpers.js";
|
|
59
|
+
import type * as financialObservations_transferReferenceSchema from "../financialObservations/transferReferenceSchema.js";
|
|
60
|
+
import type * as financialObservations_transferSchema from "../financialObservations/transferSchema.js";
|
|
61
|
+
import type * as financialObservations_transfers from "../financialObservations/transfers.js";
|
|
62
|
+
import type * as financialOwnership_helpers from "../financialOwnership/helpers.js";
|
|
63
|
+
import type * as financialOwnership_mutations from "../financialOwnership/mutations.js";
|
|
64
|
+
import type * as financialOwnership_queries from "../financialOwnership/queries.js";
|
|
44
65
|
import type * as lib_fees from "../lib/fees.js";
|
|
45
66
|
import type * as lib_idempotency from "../lib/idempotency.js";
|
|
46
67
|
import type * as lib_paymentSeller from "../lib/paymentSeller.js";
|
|
@@ -82,6 +103,11 @@ import type * as payoutWorker_queries from "../payoutWorker/queries.js";
|
|
|
82
103
|
import type * as products_mutations from "../products/mutations.js";
|
|
83
104
|
import type * as products_queries from "../products/queries.js";
|
|
84
105
|
import type * as products_validators from "../products/validators.js";
|
|
106
|
+
import type * as refundHistory_commandBinding from "../refundHistory/commandBinding.js";
|
|
107
|
+
import type * as refundHistory_commandEvidence from "../refundHistory/commandEvidence.js";
|
|
108
|
+
import type * as refundHistory_commandEvidenceValidator from "../refundHistory/commandEvidenceValidator.js";
|
|
109
|
+
import type * as refundHistory_commandFields from "../refundHistory/commandFields.js";
|
|
110
|
+
import type * as refundHistory_mutations from "../refundHistory/mutations.js";
|
|
85
111
|
import type * as refundHistory_queries from "../refundHistory/queries.js";
|
|
86
112
|
import type * as settlement_clawbackSchema from "../settlement/clawbackSchema.js";
|
|
87
113
|
import type * as settlement_clawbacks from "../settlement/clawbacks.js";
|
|
@@ -99,6 +125,9 @@ import type {
|
|
|
99
125
|
import { anyApi, componentsGeneric } from "convex/server";
|
|
100
126
|
|
|
101
127
|
const fullApi: ApiFromModules<{
|
|
128
|
+
"accountClosure/helpers": typeof accountClosure_helpers;
|
|
129
|
+
"accountClosure/mutations": typeof accountClosure_mutations;
|
|
130
|
+
"accountClosure/queries": typeof accountClosure_queries;
|
|
102
131
|
"affiliateEarnings/mutations": typeof affiliateEarnings_mutations;
|
|
103
132
|
"affiliatePayouts/mutations": typeof affiliatePayouts_mutations;
|
|
104
133
|
"affiliatePayouts/queries": typeof affiliatePayouts_queries;
|
|
@@ -117,6 +146,7 @@ const fullApi: ApiFromModules<{
|
|
|
117
146
|
"connect/reversalReceipts": typeof connect_reversalReceipts;
|
|
118
147
|
"connect/validators": typeof connect_validators;
|
|
119
148
|
"core/mutations": typeof core_mutations;
|
|
149
|
+
"core/personalAccountMapping": typeof core_personalAccountMapping;
|
|
120
150
|
"core/queries": typeof core_queries;
|
|
121
151
|
"core/resetSafety": typeof core_resetSafety;
|
|
122
152
|
"core/validators": typeof core_validators;
|
|
@@ -132,6 +162,23 @@ const fullApi: ApiFromModules<{
|
|
|
132
162
|
"earnings/mutations": typeof earnings_mutations;
|
|
133
163
|
"earnings/reads": typeof earnings_reads;
|
|
134
164
|
"earnings/triggers": typeof earnings_triggers;
|
|
165
|
+
"financialObservations/continuation": typeof financialObservations_continuation;
|
|
166
|
+
"financialObservations/generations": typeof financialObservations_generations;
|
|
167
|
+
"financialObservations/mutations": typeof financialObservations_mutations;
|
|
168
|
+
"financialObservations/queries": typeof financialObservations_queries;
|
|
169
|
+
"financialObservations/settlement": typeof financialObservations_settlement;
|
|
170
|
+
"financialObservations/settlementHelpers": typeof financialObservations_settlementHelpers;
|
|
171
|
+
"financialObservations/transferBatches": typeof financialObservations_transferBatches;
|
|
172
|
+
"financialObservations/transferContinuation": typeof financialObservations_transferContinuation;
|
|
173
|
+
"financialObservations/transferContinuationState": typeof financialObservations_transferContinuationState;
|
|
174
|
+
"financialObservations/transferContinuationSteps": typeof financialObservations_transferContinuationSteps;
|
|
175
|
+
"financialObservations/transferHelpers": typeof financialObservations_transferHelpers;
|
|
176
|
+
"financialObservations/transferReferenceSchema": typeof financialObservations_transferReferenceSchema;
|
|
177
|
+
"financialObservations/transferSchema": typeof financialObservations_transferSchema;
|
|
178
|
+
"financialObservations/transfers": typeof financialObservations_transfers;
|
|
179
|
+
"financialOwnership/helpers": typeof financialOwnership_helpers;
|
|
180
|
+
"financialOwnership/mutations": typeof financialOwnership_mutations;
|
|
181
|
+
"financialOwnership/queries": typeof financialOwnership_queries;
|
|
135
182
|
"lib/fees": typeof lib_fees;
|
|
136
183
|
"lib/idempotency": typeof lib_idempotency;
|
|
137
184
|
"lib/paymentSeller": typeof lib_paymentSeller;
|
|
@@ -173,6 +220,11 @@ const fullApi: ApiFromModules<{
|
|
|
173
220
|
"products/mutations": typeof products_mutations;
|
|
174
221
|
"products/queries": typeof products_queries;
|
|
175
222
|
"products/validators": typeof products_validators;
|
|
223
|
+
"refundHistory/commandBinding": typeof refundHistory_commandBinding;
|
|
224
|
+
"refundHistory/commandEvidence": typeof refundHistory_commandEvidence;
|
|
225
|
+
"refundHistory/commandEvidenceValidator": typeof refundHistory_commandEvidenceValidator;
|
|
226
|
+
"refundHistory/commandFields": typeof refundHistory_commandFields;
|
|
227
|
+
"refundHistory/mutations": typeof refundHistory_mutations;
|
|
176
228
|
"refundHistory/queries": typeof refundHistory_queries;
|
|
177
229
|
"settlement/clawbackSchema": typeof settlement_clawbackSchema;
|
|
178
230
|
"settlement/clawbacks": typeof settlement_clawbacks;
|