@fantastic.dev/better-stripe 0.97.0 → 0.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts +5 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js +38 -0
- package/dist/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts +11 -0
- package/dist/client/billing/renewalAttach/internal/material/classifiers.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/material/classifiers.js +57 -22
- package/dist/client/billing/renewalAttach/internal/material/classifiers.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts +54 -0
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js +44 -37
- package/dist/client/billing/renewalAttach/internal/operations/fixedTransport.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/initialActorData.d.ts +21 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialActorData.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialActorData.js +36 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialActorData.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts +3 -0
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js +71 -46
- package/dist/client/billing/renewalAttach/internal/operations/initialAttach.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js +17 -5
- package/dist/client/billing/renewalAttach/internal/operations/ownedAwait.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operations/transportCapture.d.ts +35 -0
- package/dist/client/billing/renewalAttach/internal/operations/transportCapture.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/operations/transportCapture.js +46 -0
- package/dist/client/billing/renewalAttach/internal/operations/transportCapture.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts +8 -0
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js +21 -0
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.d.ts +1 -0
- package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.js +3 -0
- package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/operationFactory.d.ts +65 -0
- package/dist/client/billing/renewalAttach/internal/producer/operationFactory.d.ts.map +1 -0
- package/dist/client/billing/renewalAttach/internal/producer/operationFactory.js +161 -0
- package/dist/client/billing/renewalAttach/internal/producer/operationFactory.js.map +1 -0
- package/dist/client/billing/renewalAttach/internal/producer/stockDelegateFactory.d.ts +4 -0
- package/dist/client/billing/renewalAttach/internal/producer/stockDelegateFactory.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/stockDelegateFactory.js +24 -3
- package/dist/client/billing/renewalAttach/internal/producer/stockDelegateFactory.js.map +1 -1
- package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +32 -32
- package/dist/client/connect/payoutSyncTestHelpers.d.ts +16 -16
- package/dist/component/balanceFunding/mutations.d.ts +16 -16
- package/dist/component/balanceFunding/preparationHandlers.d.ts +8 -8
- package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
- package/dist/component/earnings/triggers.d.ts +16 -16
- package/dist/component/payoutRelease/queries.d.ts +2 -2
- package/dist/component/payoutRelease/queries.d.ts.map +1 -1
- package/dist/component/processingCostReconciliation/rollback.d.ts +1 -1
- package/dist/component/usage/allowance.fixtures.d.ts +16 -16
- package/docs/renewal-context-reads.md +35 -4
- package/package.json +1 -1
- package/src/client/billing/renewalAttach/internal/acquisition/ownedAcquisition.ts +42 -0
- package/src/client/billing/renewalAttach/internal/material/classifiers.ts +64 -22
- package/src/client/billing/renewalAttach/internal/operations/fixedTransport.ts +55 -48
- package/src/client/billing/renewalAttach/internal/operations/initialActorData.ts +41 -0
- package/src/client/billing/renewalAttach/internal/operations/initialAttach.ts +91 -55
- package/src/client/billing/renewalAttach/internal/operations/ownedAwait.ts +23 -5
- package/src/client/billing/renewalAttach/internal/operations/transportCapture.ts +60 -0
- package/src/client/billing/renewalAttach/internal/producer/invocationProducer.ts +25 -0
- package/src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts +3 -0
- package/src/client/billing/renewalAttach/internal/producer/operationFactory.ts +175 -0
- package/src/client/billing/renewalAttach/internal/producer/producerAcquisition.integration.test.ts +240 -0
- package/src/client/billing/renewalAttach/internal/producer/producerActor.integration.test.ts +526 -0
- package/src/client/billing/renewalAttach/internal/producer/producerMaterial.integration.test.ts +251 -0
- package/src/client/billing/renewalAttach/internal/producer/producerTransport.integration.test.ts +440 -0
- package/src/client/billing/renewalAttach/internal/producer/stockDelegateFactory.ts +29 -5
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +100 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageAuthority.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"lineageAuthority.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAgB3E,KAAK,OAAO,GAAG,QAAQ,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,SAAS,CAAC,CAAC;IACtE,WAAW,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9E,SAAS,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,QAAQ,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,QAAQ,CAAC;QACf,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,MAAM,CAAC;CACzB,CAAC,CAAC;AAGH,iFAAiF;AACjF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACZ,MAAM,CAiGR;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAYzD"}
|
|
@@ -12,6 +12,8 @@ const ms = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
|
12
12
|
// Only this module mints identities. Retained journal DATA cannot construct one.
|
|
13
13
|
class InitialLineage {
|
|
14
14
|
}
|
|
15
|
+
class InitialOrigin {
|
|
16
|
+
}
|
|
15
17
|
const lineages = new WeakMap();
|
|
16
18
|
/** Consumes original CAS custody before any selector, runtime clock or Owner. */
|
|
17
19
|
export function mintInitialLineage(call, journal, arity) {
|
|
@@ -69,6 +71,7 @@ export function mintInitialLineage(call, journal, arity) {
|
|
|
69
71
|
selection.check();
|
|
70
72
|
const token = Object.freeze(new InitialLineage());
|
|
71
73
|
lineages.set(token, Object.freeze({
|
|
74
|
+
originAssociation: Object.freeze(new InitialOrigin()),
|
|
72
75
|
journal: originalJournal,
|
|
73
76
|
reservation,
|
|
74
77
|
selection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineageAuthority.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AAEzF,MAAM,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAC5C,MAAM,CAAC,SAAS,EAChB,YAAY,CACb,EAAE,KAAK,CAAC;AACT,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAClC,SAAS,IAAI;IACX,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAExE,iFAAiF;AACjF,MAAM,cAAc;CAAG;
|
|
1
|
+
{"version":3,"file":"lineageAuthority.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AAEzF,MAAM,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAC5C,MAAM,CAAC,SAAS,EAChB,YAAY,CACb,EAAE,KAAK,CAAC;AACT,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAClC,SAAS,IAAI;IACX,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAExE,iFAAiF;AACjF,MAAM,cAAc;CAAG;AACvB,MAAM,aAAa;CAAG;AA0BtB,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmB,CAAC;AAEhD,iFAAiF;AACjF,MAAM,UAAU,kBAAkB,CAChC,IAAa,EACb,OAAgB,EAChB,KAAa;IAEb,MAAM,EACJ,WAAW,EACX,OAAO,EACP,OAAO,EAAE,eAAe,GACzB,GAAG,8BAA8B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD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IAAI,aAAa,EAAE,CAAC;QACrD,OAAO,EAAE,eAAe;QACxB,WAAW;QACX,SAAS;QACT,MAAM,EAAE,MAAgB;QACxB,MAAM,EAAE,MAA8B;QACtC,KAAK;QACL,SAAS;QACT,aAAa,EAAE,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;QACF,IAAI;QACJ,SAAS;KACV,CAAC,CACH,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,IAAI,EAAE,CAAC;IACrB,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAC1B,IACE,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,KAAK;QACpE,OAAO,CAAC,MAAM;QAChB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC;QAClE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,SAAS;QAE1D,IAAI,EAAE,CAAC;IACT,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** One construction and origin per original winning call; failures cannot remint. */
|
|
2
|
+
export declare function operationForInitialLineage(token: object): Promise<Readonly<{
|
|
3
|
+
request: import("../../../renewalV2/index.js").PreparedRenewalScheduleAttachmentV2;
|
|
4
|
+
expected: {
|
|
5
|
+
customerAccountId: string;
|
|
6
|
+
subscriptionId: string;
|
|
7
|
+
itemId: string;
|
|
8
|
+
currentPriceId: string;
|
|
9
|
+
currentProductId: string;
|
|
10
|
+
targetPriceId: string;
|
|
11
|
+
targetProductId: string;
|
|
12
|
+
periodStart: number;
|
|
13
|
+
periodEnd: number;
|
|
14
|
+
livemode: boolean;
|
|
15
|
+
};
|
|
16
|
+
operation: Readonly<{
|
|
17
|
+
owner: Readonly<{
|
|
18
|
+
basis: Readonly<import("../originalOwner.js").OriginalBasis>;
|
|
19
|
+
check(): Readonly<import("../originalOwner.js").OriginalSample>;
|
|
20
|
+
sample(): Readonly<import("../originalOwner.js").OriginalSample>;
|
|
21
|
+
subscribe(fn: () => void): () => void;
|
|
22
|
+
retire(): void;
|
|
23
|
+
}>;
|
|
24
|
+
originAssociation: object;
|
|
25
|
+
slot: Readonly<{
|
|
26
|
+
takeOnce(...args: unknown[]): Readonly<{
|
|
27
|
+
rawAttachRequest: import("../material/capture.js").AttachRaw;
|
|
28
|
+
originalBundle: import("../material/capture.js").Bundle;
|
|
29
|
+
}> | null;
|
|
30
|
+
}>;
|
|
31
|
+
readPlan: readonly Readonly<{
|
|
32
|
+
resource: string;
|
|
33
|
+
path: string;
|
|
34
|
+
ordinal: number;
|
|
35
|
+
method: "GET";
|
|
36
|
+
body: undefined;
|
|
37
|
+
options: Readonly<{
|
|
38
|
+
apiVersion: string;
|
|
39
|
+
maxNetworkRetries: 0;
|
|
40
|
+
}>;
|
|
41
|
+
}>[];
|
|
42
|
+
delegate: Readonly<{
|
|
43
|
+
rawRequest: import("stripe").Stripe["rawRequest"];
|
|
44
|
+
}>;
|
|
45
|
+
sink: Readonly<{
|
|
46
|
+
send(record: Parameters<(record: Readonly<import("../c10/ownData.js").EventRecord>, ack: (value: unknown) => void) => Promise<void>>[0], ack: Parameters<(record: Readonly<import("../c10/ownData.js").EventRecord>, ack: (value: unknown) => void) => Promise<void>>[1]): Promise<void>;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
}>>;
|
|
50
|
+
/** Persist the fully captured C3 DATA before receipt3 or a returned ACK. */
|
|
51
|
+
export declare function retainInitialReceiptForLineage(token: object, receipt: unknown): Promise<{
|
|
52
|
+
attemptId: string;
|
|
53
|
+
dispatchEventId: string;
|
|
54
|
+
dispatchPayloadId: string;
|
|
55
|
+
operationId: string;
|
|
56
|
+
receiptBinding: string;
|
|
57
|
+
receiptPayloadId: string;
|
|
58
|
+
responseEventId: string;
|
|
59
|
+
responsePayloadId: string;
|
|
60
|
+
schemaVersion: 1;
|
|
61
|
+
sourcePayloadId: string;
|
|
62
|
+
stage: "attach";
|
|
63
|
+
status: "retained";
|
|
64
|
+
}>;
|
|
65
|
+
//# sourceMappingURL=operationFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operationFactory.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/operationFactory.ts"],"names":[],"mappings":"AA+GA,qFAAqF;AACrF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;8BAtClC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;yBAYd,UAAU,6GAAa,CAAC,CAAC,CAAC,OAAO,UAAU,6GAAa,CAAC,CAAC,CAAC;;;IA6C3E;AAED,4EAA4E;AAC5E,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO;;;;;;;;;;;;;GAsCjB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { readInitialLineage } from "./lineageAuthority.js";
|
|
2
|
+
import { ownerForInitialLineage } from "./ownerFactory.js";
|
|
3
|
+
import { ownedAwaitForInitialLineage } from "./ownedAwaitFactory.js";
|
|
4
|
+
import { captureInitialStockRawDelegate } from "./stockDelegateFactory.js";
|
|
5
|
+
import { createInitialMaterialClassifiers } from "../material/classifiers.js";
|
|
6
|
+
import { captureRetainedInput } from "../material/capture.js";
|
|
7
|
+
import { captureAttachReceipt } from "../c10/eventCapture.js";
|
|
8
|
+
import { field, scalar } from "../c10/ownData.js";
|
|
9
|
+
import { materialize } from "../c10/eventCodec.js";
|
|
10
|
+
function stop() {
|
|
11
|
+
throw Error("INITIAL_OPERATION_UNBOUND");
|
|
12
|
+
}
|
|
13
|
+
const operations = new WeakMap();
|
|
14
|
+
async function construct(token) {
|
|
15
|
+
const lineage = readInitialLineage(token);
|
|
16
|
+
const owner = ownerForInitialLineage(token);
|
|
17
|
+
const owned = ownedAwaitForInitialLineage(token);
|
|
18
|
+
const classified = await createInitialMaterialClassifiers(token).retained();
|
|
19
|
+
owner.check();
|
|
20
|
+
if (classified.status !== "classified")
|
|
21
|
+
stop();
|
|
22
|
+
const retained = JSON.parse(lineage.reservation.recordJSON);
|
|
23
|
+
const original = captureRetainedInput({
|
|
24
|
+
attachRequest: retained.attachRequest,
|
|
25
|
+
originalBundle: retained.originalBundle,
|
|
26
|
+
});
|
|
27
|
+
const request = classified.material.completeRequest;
|
|
28
|
+
const customer = classified.material.billingCustomer;
|
|
29
|
+
if (!customer || typeof customer.id !== "string")
|
|
30
|
+
stop();
|
|
31
|
+
const query = String(new URLSearchParams(["discounts", "items.data.discounts", "items.data.price"].map((value, index) => ["expand[" + index + "]", value])));
|
|
32
|
+
const rows = [
|
|
33
|
+
{
|
|
34
|
+
resource: "subscription",
|
|
35
|
+
path: "/v1/subscriptions/" + request.payload.from_subscription + "?" + query,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
resource: "price",
|
|
39
|
+
path: "/v1/prices/" + classified.material.targetPrice.id,
|
|
40
|
+
},
|
|
41
|
+
{ resource: "customer", path: "/v1/customers/" + customer.id },
|
|
42
|
+
...original.originalBundle.couponReads.map((row) => {
|
|
43
|
+
if (typeof row.couponId !== "string")
|
|
44
|
+
stop();
|
|
45
|
+
return {
|
|
46
|
+
resource: "coupon",
|
|
47
|
+
path: "/v1/coupons/" + encodeURIComponent(row.couponId),
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
];
|
|
51
|
+
const readPlan = Object.freeze(rows.map((row, index) => Object.freeze({
|
|
52
|
+
...row,
|
|
53
|
+
ordinal: index + 1,
|
|
54
|
+
method: "GET",
|
|
55
|
+
body: undefined,
|
|
56
|
+
options: Object.freeze({
|
|
57
|
+
apiVersion: request.apiVersion,
|
|
58
|
+
maxNetworkRetries: 0,
|
|
59
|
+
}),
|
|
60
|
+
})));
|
|
61
|
+
const delegate = captureInitialStockRawDelegate(token);
|
|
62
|
+
const send = lineage.journal.createC10Send(lineage.reservation);
|
|
63
|
+
let spent = false;
|
|
64
|
+
const slot = Object.freeze({
|
|
65
|
+
takeOnce(...args) {
|
|
66
|
+
if (spent)
|
|
67
|
+
return null;
|
|
68
|
+
spent = true;
|
|
69
|
+
if (args.length !== 1 || args[0] !== owner)
|
|
70
|
+
return null;
|
|
71
|
+
owner.check();
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
rawAttachRequest: original.attachRequest,
|
|
74
|
+
originalBundle: original.originalBundle,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const sink = Object.freeze({
|
|
79
|
+
send(record, ack) {
|
|
80
|
+
return owned(() => send(record, (value) => {
|
|
81
|
+
owner.check();
|
|
82
|
+
ack(value);
|
|
83
|
+
owner.check();
|
|
84
|
+
}));
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
owner.check();
|
|
88
|
+
return Object.freeze({
|
|
89
|
+
request,
|
|
90
|
+
expected: classified.material.originalPrepared.expected,
|
|
91
|
+
operation: Object.freeze({
|
|
92
|
+
owner,
|
|
93
|
+
originAssociation: lineage.originAssociation,
|
|
94
|
+
slot,
|
|
95
|
+
readPlan,
|
|
96
|
+
delegate,
|
|
97
|
+
sink,
|
|
98
|
+
}),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/** One construction and origin per original winning call; failures cannot remint. */
|
|
102
|
+
export function operationForInitialLineage(token) {
|
|
103
|
+
if (arguments.length !== 1)
|
|
104
|
+
stop();
|
|
105
|
+
const owner = ownerForInitialLineage(token);
|
|
106
|
+
owner.check();
|
|
107
|
+
const owned = ownedAwaitForInitialLineage(token);
|
|
108
|
+
let pending = operations.get(token);
|
|
109
|
+
if (!pending) {
|
|
110
|
+
pending = owned(async () => {
|
|
111
|
+
try {
|
|
112
|
+
return await construct(token);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
owner.retire();
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
operations.set(token, pending);
|
|
120
|
+
}
|
|
121
|
+
const captured = pending;
|
|
122
|
+
return owned(() => captured);
|
|
123
|
+
}
|
|
124
|
+
/** Persist the fully captured C3 DATA before receipt3 or a returned ACK. */
|
|
125
|
+
export async function retainInitialReceiptForLineage(token, receipt) {
|
|
126
|
+
if (arguments.length !== 2)
|
|
127
|
+
stop();
|
|
128
|
+
const owner = ownerForInitialLineage(token);
|
|
129
|
+
owner.check();
|
|
130
|
+
const lineage = readInitialLineage(token);
|
|
131
|
+
const owned = ownedAwaitForInitialLineage(token);
|
|
132
|
+
const frame = await owned(() => operationForInitialLineage(token));
|
|
133
|
+
const captured = captureAttachReceipt({
|
|
134
|
+
event: "receipt",
|
|
135
|
+
stage: "attach",
|
|
136
|
+
request: frame.request,
|
|
137
|
+
receipt,
|
|
138
|
+
});
|
|
139
|
+
owner.check();
|
|
140
|
+
const receiptNode = field(captured, "receipt");
|
|
141
|
+
const binding = scalar(field(receiptNode, "binding"));
|
|
142
|
+
if (typeof binding !== "string")
|
|
143
|
+
stop();
|
|
144
|
+
const receiptJSON = JSON.stringify(materialize(receiptNode));
|
|
145
|
+
const retained = await owned(() => lineage.journal.retainProviderAcknowledgement({
|
|
146
|
+
attemptId: lineage.reservation.attemptId,
|
|
147
|
+
expectedSequence: 2,
|
|
148
|
+
receiptJSON,
|
|
149
|
+
}));
|
|
150
|
+
owner.check();
|
|
151
|
+
if (retained.status !== "retained" ||
|
|
152
|
+
retained.schemaVersion !== 1 ||
|
|
153
|
+
retained.stage !== "attach" ||
|
|
154
|
+
retained.operationId !== lineage.reservation.operationId ||
|
|
155
|
+
retained.attemptId !== lineage.reservation.attemptId ||
|
|
156
|
+
retained.sourcePayloadId !== lineage.reservation.payloadId ||
|
|
157
|
+
retained.receiptBinding !== binding)
|
|
158
|
+
stop();
|
|
159
|
+
return retained;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=operationFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operationFactory.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/operationFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,SAAS,IAAI;IACX,MAAM,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC3C,CAAC;AACD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAwC,CAAC;AAEvE,KAAK,UAAU,SAAS,CAAC,KAAa;IACpC,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,2BAA2B,CAAC,KAAK,CAAC,C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C,WAAW,CAAC,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAChC,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC;QAC5C,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS;QACxC,gBAAgB,EAAE,CAAC;QACnB,WAAW;KACZ,CAAC,CACH,CAAC;IACF,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,IACE,QAAQ,CAAC,MAAM,KAAK,UAAU;QAC9B,QAAQ,CAAC,aAAa,KAAK,CAAC;QAC5B,QAAQ,CAAC,KAAK,KAAK,QAAQ;QAC3B,QAAQ,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,WAAW;QACxD,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC,WAAW,CAAC,SAAS;QACpD,QAAQ,CAAC,eAAe,KAAK,OAAO,CAAC,WAAW,CAAC,SAAS;QAC1D,QAAQ,CAAC,cAAc,KAAK,OAAO;QAEnC,IAAI,EAAE,CAAC;IACT,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type Stripe from "stripe";
|
|
2
|
+
/** Transport kernels keep the original SDK promise and guard their continuation. */
|
|
3
|
+
export declare function captureInitialStockRawDelegate(token: object): Readonly<{
|
|
4
|
+
rawRequest: Stripe["rawRequest"];
|
|
5
|
+
}>;
|
|
2
6
|
/** Fixed selected client and original receiver; no replacement-client parameter. */
|
|
3
7
|
export declare function stockDelegateForInitialLineage(token: object): Readonly<{
|
|
4
8
|
rawRequest: Stripe["rawRequest"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stockDelegateFactory.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/stockDelegateFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"stockDelegateFactory.d.ts","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/stockDelegateFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAkBjC,oFAAoF;AACpF,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,GACZ,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC,CAShD;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IACtE,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;CAClC,CAAC,CAWD"}
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
import { readInitialLineage } from "./lineageAuthority.js";
|
|
2
2
|
import { ownerForInitialLineage } from "./ownerFactory.js";
|
|
3
3
|
import { ownedAwaitForInitialLineage } from "./ownedAwaitFactory.js";
|
|
4
|
-
|
|
5
|
-
export function stockDelegateForInitialLineage(token) {
|
|
4
|
+
function stockCall(token) {
|
|
6
5
|
const lineage = readInitialLineage(token);
|
|
7
6
|
const owner = ownerForInitialLineage(token);
|
|
7
|
+
return Object.freeze({
|
|
8
|
+
owner,
|
|
9
|
+
call(args) {
|
|
10
|
+
return Reflect.apply(lineage.method, lineage.client, args);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** Transport kernels keep the original SDK promise and guard their continuation. */
|
|
15
|
+
export function captureInitialStockRawDelegate(token) {
|
|
16
|
+
if (arguments.length !== 1)
|
|
17
|
+
throw Error("INITIAL_OPERATION_UNBOUND");
|
|
18
|
+
const binding = stockCall(token);
|
|
19
|
+
return Object.freeze({
|
|
20
|
+
rawRequest(...args) {
|
|
21
|
+
binding.owner.check();
|
|
22
|
+
return binding.call(args);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Fixed selected client and original receiver; no replacement-client parameter. */
|
|
27
|
+
export function stockDelegateForInitialLineage(token) {
|
|
28
|
+
const { owner, call } = stockCall(token);
|
|
8
29
|
const owned = ownedAwaitForInitialLineage(token);
|
|
9
30
|
return Object.freeze({
|
|
10
31
|
rawRequest(...args) {
|
|
11
32
|
owner.check();
|
|
12
|
-
return owned(() =>
|
|
33
|
+
return owned(() => call(args));
|
|
13
34
|
},
|
|
14
35
|
});
|
|
15
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stockDelegateFactory.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/stockDelegateFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,
|
|
1
|
+
{"version":3,"file":"stockDelegateFactory.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/stockDelegateFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,KAAK;QACL,IAAI,CAAC,IAAsC;YACzC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAExD,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,8BAA8B,CAC5C,KAAa;IAEb,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU,CAAC,GAAG,IAAsC;YAClD,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACtB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,8BAA8B,CAAC,KAAa;IAG1D,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,UAAU,CACR,GAAG,IAAsC;YAEzC,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAqC,CAAC;QACrE,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2641,6 +2641,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2641
2641
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2642
2642
|
requestKey: string;
|
|
2643
2643
|
result?: {
|
|
2644
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2645
|
+
retryable: false;
|
|
2646
|
+
status: "conflict";
|
|
2647
|
+
} | {
|
|
2648
|
+
reason: "policy_invalid";
|
|
2649
|
+
retryable: false;
|
|
2650
|
+
status: "rejected";
|
|
2651
|
+
} | {
|
|
2644
2652
|
operation: {
|
|
2645
2653
|
accountId: string;
|
|
2646
2654
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2651,14 +2659,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2651
2659
|
} | {
|
|
2652
2660
|
enabled: boolean;
|
|
2653
2661
|
status: "unchanged";
|
|
2654
|
-
} | {
|
|
2655
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2656
|
-
retryable: false;
|
|
2657
|
-
status: "conflict";
|
|
2658
|
-
} | {
|
|
2659
|
-
reason: "policy_invalid";
|
|
2660
|
-
retryable: false;
|
|
2661
|
-
status: "rejected";
|
|
2662
2662
|
} | {
|
|
2663
2663
|
reason: "provider_pending";
|
|
2664
2664
|
retryable: true;
|
|
@@ -2669,6 +2669,14 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2669
2669
|
payload: import("convex/values").VString<string, "required">;
|
|
2670
2670
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2671
2671
|
result: import("convex/values").VUnion<{
|
|
2672
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2673
|
+
retryable: false;
|
|
2674
|
+
status: "conflict";
|
|
2675
|
+
} | {
|
|
2676
|
+
reason: "policy_invalid";
|
|
2677
|
+
retryable: false;
|
|
2678
|
+
status: "rejected";
|
|
2679
|
+
} | {
|
|
2672
2680
|
operation: {
|
|
2673
2681
|
accountId: string;
|
|
2674
2682
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2679,14 +2687,6 @@ export declare function setup(amounts?: number[], currency?: string): Promise<{
|
|
|
2679
2687
|
} | {
|
|
2680
2688
|
enabled: boolean;
|
|
2681
2689
|
status: "unchanged";
|
|
2682
|
-
} | {
|
|
2683
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2684
|
-
retryable: false;
|
|
2685
|
-
status: "conflict";
|
|
2686
|
-
} | {
|
|
2687
|
-
reason: "policy_invalid";
|
|
2688
|
-
retryable: false;
|
|
2689
|
-
status: "rejected";
|
|
2690
2690
|
} | {
|
|
2691
2691
|
reason: "provider_pending";
|
|
2692
2692
|
retryable: true;
|
|
@@ -7777,6 +7777,14 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7777
7777
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
7778
7778
|
requestKey: string;
|
|
7779
7779
|
result?: {
|
|
7780
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7781
|
+
retryable: false;
|
|
7782
|
+
status: "conflict";
|
|
7783
|
+
} | {
|
|
7784
|
+
reason: "policy_invalid";
|
|
7785
|
+
retryable: false;
|
|
7786
|
+
status: "rejected";
|
|
7787
|
+
} | {
|
|
7780
7788
|
operation: {
|
|
7781
7789
|
accountId: string;
|
|
7782
7790
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -7787,14 +7795,6 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7787
7795
|
} | {
|
|
7788
7796
|
enabled: boolean;
|
|
7789
7797
|
status: "unchanged";
|
|
7790
|
-
} | {
|
|
7791
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7792
|
-
retryable: false;
|
|
7793
|
-
status: "conflict";
|
|
7794
|
-
} | {
|
|
7795
|
-
reason: "policy_invalid";
|
|
7796
|
-
retryable: false;
|
|
7797
|
-
status: "rejected";
|
|
7798
7798
|
} | {
|
|
7799
7799
|
reason: "provider_pending";
|
|
7800
7800
|
retryable: true;
|
|
@@ -7805,6 +7805,14 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7805
7805
|
payload: import("convex/values").VString<string, "required">;
|
|
7806
7806
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
7807
7807
|
result: import("convex/values").VUnion<{
|
|
7808
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7809
|
+
retryable: false;
|
|
7810
|
+
status: "conflict";
|
|
7811
|
+
} | {
|
|
7812
|
+
reason: "policy_invalid";
|
|
7813
|
+
retryable: false;
|
|
7814
|
+
status: "rejected";
|
|
7815
|
+
} | {
|
|
7808
7816
|
operation: {
|
|
7809
7817
|
accountId: string;
|
|
7810
7818
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -7815,14 +7823,6 @@ export declare function historical(currency?: string): Promise<{
|
|
|
7815
7823
|
} | {
|
|
7816
7824
|
enabled: boolean;
|
|
7817
7825
|
status: "unchanged";
|
|
7818
|
-
} | {
|
|
7819
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
7820
|
-
retryable: false;
|
|
7821
|
-
status: "conflict";
|
|
7822
|
-
} | {
|
|
7823
|
-
reason: "policy_invalid";
|
|
7824
|
-
retryable: false;
|
|
7825
|
-
status: "rejected";
|
|
7826
7826
|
} | {
|
|
7827
7827
|
reason: "provider_pending";
|
|
7828
7828
|
retryable: true;
|
|
@@ -2646,14 +2646,6 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
2646
2646
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
2647
2647
|
requestKey: string;
|
|
2648
2648
|
result?: {
|
|
2649
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2650
|
-
retryable: false;
|
|
2651
|
-
status: "conflict";
|
|
2652
|
-
} | {
|
|
2653
|
-
reason: "policy_invalid";
|
|
2654
|
-
retryable: false;
|
|
2655
|
-
status: "rejected";
|
|
2656
|
-
} | {
|
|
2657
2649
|
operation: {
|
|
2658
2650
|
accountId: string;
|
|
2659
2651
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2664,6 +2656,14 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
2664
2656
|
} | {
|
|
2665
2657
|
enabled: boolean;
|
|
2666
2658
|
status: "unchanged";
|
|
2659
|
+
} | {
|
|
2660
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2661
|
+
retryable: false;
|
|
2662
|
+
status: "conflict";
|
|
2663
|
+
} | {
|
|
2664
|
+
reason: "policy_invalid";
|
|
2665
|
+
retryable: false;
|
|
2666
|
+
status: "rejected";
|
|
2667
2667
|
} | {
|
|
2668
2668
|
reason: "provider_pending";
|
|
2669
2669
|
retryable: true;
|
|
@@ -2674,14 +2674,6 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
2674
2674
|
payload: import("convex/values").VString<string, "required">;
|
|
2675
2675
|
preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
|
|
2676
2676
|
result: import("convex/values").VUnion<{
|
|
2677
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2678
|
-
retryable: false;
|
|
2679
|
-
status: "conflict";
|
|
2680
|
-
} | {
|
|
2681
|
-
reason: "policy_invalid";
|
|
2682
|
-
retryable: false;
|
|
2683
|
-
status: "rejected";
|
|
2684
|
-
} | {
|
|
2685
2677
|
operation: {
|
|
2686
2678
|
accountId: string;
|
|
2687
2679
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -2692,6 +2684,14 @@ export declare function setup(scope?: Scope): Promise<{
|
|
|
2692
2684
|
} | {
|
|
2693
2685
|
enabled: boolean;
|
|
2694
2686
|
status: "unchanged";
|
|
2687
|
+
} | {
|
|
2688
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
2689
|
+
retryable: false;
|
|
2690
|
+
status: "conflict";
|
|
2691
|
+
} | {
|
|
2692
|
+
reason: "policy_invalid";
|
|
2693
|
+
retryable: false;
|
|
2694
|
+
status: "rejected";
|
|
2695
2695
|
} | {
|
|
2696
2696
|
reason: "provider_pending";
|
|
2697
2697
|
retryable: true;
|
|
@@ -22,14 +22,6 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
|
|
|
22
22
|
requestKey: string;
|
|
23
23
|
scopeKey: string;
|
|
24
24
|
}, Promise<{
|
|
25
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
26
|
-
retryable: false;
|
|
27
|
-
status: "conflict";
|
|
28
|
-
} | {
|
|
29
|
-
reason: "policy_invalid";
|
|
30
|
-
retryable: false;
|
|
31
|
-
status: "rejected";
|
|
32
|
-
} | {
|
|
33
25
|
operation: {
|
|
34
26
|
accountId: string;
|
|
35
27
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -40,6 +32,14 @@ export declare const begin: import("convex/server").RegisteredMutation<"public",
|
|
|
40
32
|
} | {
|
|
41
33
|
enabled: boolean;
|
|
42
34
|
status: "unchanged";
|
|
35
|
+
} | {
|
|
36
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
37
|
+
retryable: false;
|
|
38
|
+
status: "conflict";
|
|
39
|
+
} | {
|
|
40
|
+
reason: "policy_invalid";
|
|
41
|
+
retryable: false;
|
|
42
|
+
status: "rejected";
|
|
43
43
|
} | {
|
|
44
44
|
reason: "provider_pending";
|
|
45
45
|
retryable: true;
|
|
@@ -395,14 +395,6 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
|
|
|
395
395
|
requestKey: string;
|
|
396
396
|
scopeKey: string;
|
|
397
397
|
}, Promise<{
|
|
398
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
399
|
-
retryable: false;
|
|
400
|
-
status: "conflict";
|
|
401
|
-
} | {
|
|
402
|
-
reason: "policy_invalid";
|
|
403
|
-
retryable: false;
|
|
404
|
-
status: "rejected";
|
|
405
|
-
} | {
|
|
406
398
|
operation: {
|
|
407
399
|
accountId: string;
|
|
408
400
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -413,6 +405,14 @@ export declare const prepare: import("convex/server").RegisteredMutation<"public
|
|
|
413
405
|
} | {
|
|
414
406
|
enabled: boolean;
|
|
415
407
|
status: "unchanged";
|
|
408
|
+
} | {
|
|
409
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
410
|
+
retryable: false;
|
|
411
|
+
status: "conflict";
|
|
412
|
+
} | {
|
|
413
|
+
reason: "policy_invalid";
|
|
414
|
+
retryable: false;
|
|
415
|
+
status: "rejected";
|
|
416
416
|
} | {
|
|
417
417
|
reason: "provider_pending";
|
|
418
418
|
retryable: true;
|
|
@@ -2,6 +2,14 @@ import type { Infer } from "convex/values";
|
|
|
2
2
|
import type { MutationCtx } from "../_generated/server.js";
|
|
3
3
|
import { prepareArgs, finishPreparationArgs } from "./mutationValidators.js";
|
|
4
4
|
export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prepareArgs>): Promise<{
|
|
5
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
6
|
+
retryable: false;
|
|
7
|
+
status: "conflict";
|
|
8
|
+
} | {
|
|
9
|
+
reason: "policy_invalid";
|
|
10
|
+
retryable: false;
|
|
11
|
+
status: "rejected";
|
|
12
|
+
} | {
|
|
5
13
|
operation: {
|
|
6
14
|
accountId: string;
|
|
7
15
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -12,14 +20,6 @@ export declare function prepareHandler(ctx: MutationCtx, args: Infer<typeof prep
|
|
|
12
20
|
} | {
|
|
13
21
|
enabled: boolean;
|
|
14
22
|
status: "unchanged";
|
|
15
|
-
} | {
|
|
16
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
17
|
-
retryable: false;
|
|
18
|
-
status: "conflict";
|
|
19
|
-
} | {
|
|
20
|
-
reason: "policy_invalid";
|
|
21
|
-
retryable: false;
|
|
22
|
-
status: "rejected";
|
|
23
23
|
} | {
|
|
24
24
|
reason: "provider_pending";
|
|
25
25
|
retryable: true;
|
|
@@ -5,14 +5,6 @@ export declare function savePreparationHandler(ctx: MutationCtx, args: Infer<typ
|
|
|
5
5
|
preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
|
|
6
6
|
}>;
|
|
7
7
|
export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginArgs>): Promise<{
|
|
8
|
-
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
9
|
-
retryable: false;
|
|
10
|
-
status: "conflict";
|
|
11
|
-
} | {
|
|
12
|
-
reason: "policy_invalid";
|
|
13
|
-
retryable: false;
|
|
14
|
-
status: "rejected";
|
|
15
|
-
} | {
|
|
16
8
|
operation: {
|
|
17
9
|
accountId: string;
|
|
18
10
|
operationId: import("convex/values").GenericId<"balanceFundingOperations">;
|
|
@@ -23,6 +15,14 @@ export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginA
|
|
|
23
15
|
} | {
|
|
24
16
|
enabled: boolean;
|
|
25
17
|
status: "unchanged";
|
|
18
|
+
} | {
|
|
19
|
+
reason: "identity_changed" | "revision_changed" | "scope_busy";
|
|
20
|
+
retryable: false;
|
|
21
|
+
status: "conflict";
|
|
22
|
+
} | {
|
|
23
|
+
reason: "policy_invalid";
|
|
24
|
+
retryable: false;
|
|
25
|
+
status: "rejected";
|
|
26
26
|
} | {
|
|
27
27
|
reason: "provider_pending";
|
|
28
28
|
retryable: true;
|