@fantastic.dev/better-stripe 0.96.0 → 0.97.1
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/c10/appendAck.d.ts +7 -0
- package/dist/client/billing/renewalAttach/internal/c10/appendAck.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/c10/appendAck.js +11 -3
- package/dist/client/billing/renewalAttach/internal/c10/appendAck.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/c10/attachEvents.d.ts +23 -0
- package/dist/client/billing/renewalAttach/internal/c10/attachEvents.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/c10/attachEvents.js +32 -2
- package/dist/client/billing/renewalAttach/internal/c10/attachEvents.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/operationJournal.d.ts +1 -0
- package/dist/client/billing/renewalAttach/internal/operationJournal.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/operationJournal.js +5 -1
- package/dist/client/billing/renewalAttach/internal/operationJournal.js.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts +4 -0
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.d.ts.map +1 -1
- package/dist/client/billing/renewalAttach/internal/producer/invocationProducer.js +13 -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 +2 -1
- package/dist/client/billing/renewalAttach/internal/producer/lineageAuthority.js.map +1 -1
- package/docs/renewal-context-reads.md +25 -0
- package/package.json +1 -1
- package/src/client/billing/renewalAttach/internal/c10/appendAck.ts +14 -3
- package/src/client/billing/renewalAttach/internal/c10/attachEvents.ts +39 -2
- package/src/client/billing/renewalAttach/internal/material/classifiers.ts +64 -22
- package/src/client/billing/renewalAttach/internal/operationJournal.ts +6 -2
- package/src/client/billing/renewalAttach/internal/producer/invocationProducer.ts +13 -0
- package/src/client/billing/renewalAttach/internal/producer/lineageAuthority.ts +7 -4
- package/src/client/billing/renewalAttach/internal/producer/producerChannels.integration.test.ts +350 -0
- package/src/client/billing/renewalAttach/internal/producer/producerMaterial.integration.test.ts +251 -0
- package/src/client/billing/renewalAttach/internal/test-fixtures/producerInitialOperation.ts +45 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invocationProducer.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/invocationProducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAqB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"invocationProducer.js","sourceRoot":"","sources":["../../../../../../src/client/billing/renewalAttach/internal/producer/invocationProducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAqB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAE,gCAAgC,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,CAAC;YAEhC,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,eAAe,GAAG,KAAK,CAAC;QAC5B,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,KAAK;YACL,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,KAAK;YACL,QAAQ,EAAE,8BAA8B,CAAC,KAAK,CAAC;YAC/C,YAAY;gBACV,KAAK,CAAC,KAAK,EAAE,CAAC;gBACd,IAAI,eAAe;oBAAE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7D,eAAe,GAAG,IAAI,CAAC;gBACvB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;oBAAE,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;gBACnE,OAAO,gCAAgC,CAAC,KAAK,CAAC,CAAC;YACjD,CAAC;YACD,QAAQ,EAAE,gCAAgC,CAAC,KAAK,CAAC;YACjD,oBAAoB,EAAE,KAAK;SAC5B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,7 @@ import Stripe from "stripe";
|
|
|
2
2
|
import { consumeInitialClassReservation } from "../operationJournal.js";
|
|
3
3
|
import { captureInitialJournalSelection } from "./classOwnedActionRoot.js";
|
|
4
4
|
type Lineage = Readonly<{
|
|
5
|
+
journal: ReturnType<typeof consumeInitialClassReservation>["journal"];
|
|
5
6
|
reservation: ReturnType<typeof consumeInitialClassReservation>["reservation"];
|
|
6
7
|
selection: ReturnType<typeof captureInitialJournalSelection>;
|
|
7
8
|
client: Stripe;
|
|
@@ -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;AAe3E,KAAK,OAAO,GAAG,QAAQ,CAAC;IACtB,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,
|
|
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;AAe3E,KAAK,OAAO,GAAG,QAAQ,CAAC;IACtB,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,CAgGR;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAYzD"}
|
|
@@ -15,7 +15,7 @@ class InitialLineage {
|
|
|
15
15
|
const lineages = new WeakMap();
|
|
16
16
|
/** Consumes original CAS custody before any selector, runtime clock or Owner. */
|
|
17
17
|
export function mintInitialLineage(call, journal, arity) {
|
|
18
|
-
const { reservation, binding } = consumeInitialClassReservation(call, journal);
|
|
18
|
+
const { reservation, binding, journal: originalJournal, } = consumeInitialClassReservation(call, journal);
|
|
19
19
|
if (arity !== 2)
|
|
20
20
|
stop();
|
|
21
21
|
if (!("recordVersion" in reservation) ||
|
|
@@ -69,6 +69,7 @@ export function mintInitialLineage(call, journal, arity) {
|
|
|
69
69
|
selection.check();
|
|
70
70
|
const token = Object.freeze(new InitialLineage());
|
|
71
71
|
lineages.set(token, Object.freeze({
|
|
72
|
+
journal: originalJournal,
|
|
72
73
|
reservation,
|
|
73
74
|
selection,
|
|
74
75
|
client: client,
|
|
@@ -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":["../../../../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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"}
|
|
@@ -116,6 +116,31 @@ returning a value. Retirement is irreversible and never extends either original
|
|
|
116
116
|
cutoff. Legacy actors still use their separate dormant identity; extracting and
|
|
117
117
|
wiring their per-invocation kernels remains required before runtime activation.
|
|
118
118
|
|
|
119
|
+
The private initial core can capture one attach-stage C10 compiler for its own
|
|
120
|
+
lineage. This compiler takes the original raw source and actual acquired
|
|
121
|
+
reservation from that lineage, and binds its sender to the same captured class
|
|
122
|
+
journal. Its dispatch, response and receipt events use the existing compiler
|
|
123
|
+
checks and actual component append transactions. C10 acknowledgement follows
|
|
124
|
+
the matching committed append and checks the original Owner again. Callers
|
|
125
|
+
cannot replace the source, sender, Owner or append timeout through this capture.
|
|
126
|
+
Retiring one invocation rejects its pending channel without retiring another
|
|
127
|
+
invocation's channel or removing already committed DATA. Stored events and C10
|
|
128
|
+
append acknowledgements do not establish provider custody or a returned public
|
|
129
|
+
operation acknowledgement. Legacy stage-channel facades retain their existing
|
|
130
|
+
lazy Owner and behavior. Initial actor, acquisition and transport factory wiring
|
|
131
|
+
remains required.
|
|
132
|
+
|
|
133
|
+
The core's private material classifiers also retain the original journal source
|
|
134
|
+
and canonical Owner. Retained classification accepts no replacement source.
|
|
135
|
+
Fresh classification accepts read DATA and its observed timestamp, then uses the
|
|
136
|
+
existing raw Coupon join checks and actual C1/C2 reconstruction against the
|
|
137
|
+
original source. Both paths keep the existing DATA-consistency-only result and
|
|
138
|
+
bounded snapshots. They do not qualify acquisition or provider custody. Pending
|
|
139
|
+
reconstruction is owned by that invocation; retirement rejects its continuation
|
|
140
|
+
without closing another invocation's classifier. Legacy classifier exports keep
|
|
141
|
+
their lazy Owner and existing refusal behavior. The initial actor still needs
|
|
142
|
+
to wire these classifiers to its per-invocation acquisition and transport.
|
|
143
|
+
|
|
119
144
|
## Component operation journal
|
|
120
145
|
|
|
121
146
|
The component's `renewalOperations` functions retain host-authorized operation
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Stage and append share one irreversible latch and the same original owner. */
|
|
2
2
|
import { SOURCE_OWNER } from "./ownerBinding.js";
|
|
3
|
+
import { ownerForInitialLineage } from "../producer/ownerFactory.js";
|
|
3
4
|
import {
|
|
4
5
|
options as checkedOptions,
|
|
5
6
|
closed,
|
|
@@ -17,6 +18,16 @@ import {
|
|
|
17
18
|
type Time = { wallMs: number; ns: bigint };
|
|
18
19
|
type Reject = (reason: Error) => void;
|
|
19
20
|
export function createStageChannel(raw: unknown) {
|
|
21
|
+
return stageChannel(raw, SOURCE_OWNER);
|
|
22
|
+
}
|
|
23
|
+
/** Opaque original lineage only; no caller-supplied Owner or clock. */
|
|
24
|
+
export function createInitialStageChannel(token: object, raw: unknown) {
|
|
25
|
+
return stageChannel(raw, ownerForInitialLineage(token));
|
|
26
|
+
}
|
|
27
|
+
function stageChannel(
|
|
28
|
+
raw: unknown,
|
|
29
|
+
owner: Pick<typeof SOURCE_OWNER, "basis" | "check" | "subscribe">,
|
|
30
|
+
) {
|
|
20
31
|
let closedChannel = false,
|
|
21
32
|
unsubscribe = () => {},
|
|
22
33
|
rejectStage: Reject | null = null,
|
|
@@ -29,11 +40,11 @@ export function createStageChannel(raw: unknown) {
|
|
|
29
40
|
rejectStage?.(Error("C10_SOURCE_STOP"));
|
|
30
41
|
rejectAppend?.(Error("C10_SOURCE_STOP"));
|
|
31
42
|
};
|
|
32
|
-
const basis =
|
|
43
|
+
const basis = owner.basis;
|
|
33
44
|
const gate = (): Time => {
|
|
34
45
|
try {
|
|
35
46
|
need(!closedChannel);
|
|
36
|
-
const t =
|
|
47
|
+
const t = owner.check();
|
|
37
48
|
need(
|
|
38
49
|
basis &&
|
|
39
50
|
Number.isSafeInteger(basis.startWallMs) &&
|
|
@@ -67,7 +78,7 @@ export function createStageChannel(raw: unknown) {
|
|
|
67
78
|
}
|
|
68
79
|
};
|
|
69
80
|
gate();
|
|
70
|
-
const detach =
|
|
81
|
+
const detach = owner.subscribe(close);
|
|
71
82
|
need(typeof detach === "function");
|
|
72
83
|
unsubscribe = detach;
|
|
73
84
|
if (closedChannel) unsubscribe();
|
|
@@ -9,14 +9,51 @@ import {
|
|
|
9
9
|
captureAttachReceipt,
|
|
10
10
|
} from "./eventCapture.js";
|
|
11
11
|
import { materialize } from "./eventCodec.js";
|
|
12
|
-
import { createStageChannel } from "./appendAck.js";
|
|
12
|
+
import { createStageChannel, createInitialStageChannel } from "./appendAck.js";
|
|
13
|
+
import { readInitialLineage } from "../producer/lineageAuthority.js";
|
|
14
|
+
import { ownerForInitialLineage } from "../producer/ownerFactory.js";
|
|
15
|
+
import { ownedAwaitForInitialLineage } from "../producer/ownedAwaitFactory.js";
|
|
13
16
|
import {
|
|
14
17
|
prepareRenewalPriceReplacementV2,
|
|
15
18
|
prepareRenewalScheduleAttachmentV2,
|
|
16
19
|
constructRenewalScheduleAttachmentReceiptV2,
|
|
17
20
|
} from "./publicApi.js";
|
|
18
21
|
export function createAttachEventCompiler(raw: unknown, options: unknown) {
|
|
19
|
-
|
|
22
|
+
return attachEventCompiler(raw, createStageChannel(options));
|
|
23
|
+
}
|
|
24
|
+
const initialChannels = new WeakSet<object>();
|
|
25
|
+
/** Exact original call, source and journal; no replacement sink or Owner input. */
|
|
26
|
+
export function createInitialAttachEventCompiler(token: object) {
|
|
27
|
+
const owner = ownerForInitialLineage(token);
|
|
28
|
+
owner.check();
|
|
29
|
+
if (initialChannels.has(token)) throw Error("INITIAL_CHANNEL_CONSUMED");
|
|
30
|
+
initialChannels.add(token);
|
|
31
|
+
if (arguments.length !== 1) throw Error("INITIAL_CHANNEL_UNBOUND");
|
|
32
|
+
const { reservation, journal } = readInitialLineage(token);
|
|
33
|
+
const source = JSON.parse(reservation.recordJSON);
|
|
34
|
+
const send = journal.createC10Send(reservation);
|
|
35
|
+
const owned = ownedAwaitForInitialLineage(token);
|
|
36
|
+
owner.check();
|
|
37
|
+
const channel = createInitialStageChannel(token, {
|
|
38
|
+
timeoutMs: 5000,
|
|
39
|
+
send: (
|
|
40
|
+
record: Parameters<typeof send>[0],
|
|
41
|
+
ack: Parameters<typeof send>[1],
|
|
42
|
+
) =>
|
|
43
|
+
owned(() =>
|
|
44
|
+
send(record, (value) => {
|
|
45
|
+
owner.check();
|
|
46
|
+
ack(value);
|
|
47
|
+
owner.check();
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
});
|
|
51
|
+
return attachEventCompiler(source.attachRequest, channel);
|
|
52
|
+
}
|
|
53
|
+
function attachEventCompiler(
|
|
54
|
+
raw: unknown,
|
|
55
|
+
channel: ReturnType<typeof createStageChannel>,
|
|
56
|
+
) {
|
|
20
57
|
let source: ReturnType<typeof captureAttachSource>;
|
|
21
58
|
try {
|
|
22
59
|
channel.gate();
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { OWNER } from "../originalOwner.js";
|
|
2
|
+
import { ownerForInitialLineage } from "../producer/ownerFactory.js";
|
|
3
|
+
import { readInitialLineage } from "../producer/lineageAuthority.js";
|
|
4
|
+
import { ownedAwaitForInitialLineage } from "../producer/ownedAwaitFactory.js";
|
|
5
|
+
type MaterialOwner = Pick<typeof OWNER, "check">;
|
|
2
6
|
import {
|
|
3
7
|
prepareRenewalPriceReplacementV2 as c1,
|
|
4
8
|
prepareRenewalScheduleAttachmentV2 as c2,
|
|
@@ -190,19 +194,19 @@ function release(
|
|
|
190
194
|
encode(node);
|
|
191
195
|
return freeze(materialize(node)) as Classified;
|
|
192
196
|
}
|
|
193
|
-
async function retained(value: RetainedInput) {
|
|
197
|
+
async function retained(owner: MaterialOwner, value: RetainedInput) {
|
|
194
198
|
const raw = value.attachRequest;
|
|
195
|
-
|
|
199
|
+
owner.check();
|
|
196
200
|
const prepared = await c1(raw.preparation);
|
|
197
|
-
|
|
198
|
-
|
|
201
|
+
owner.check();
|
|
202
|
+
owner.check();
|
|
199
203
|
const request = await c2({
|
|
200
204
|
prepared,
|
|
201
205
|
apiVersion: raw.apiVersion,
|
|
202
206
|
attachKey: raw.attachKey,
|
|
203
207
|
firstDispatchedAt: raw.firstDispatchedAt,
|
|
204
208
|
});
|
|
205
|
-
|
|
209
|
+
owner.check();
|
|
206
210
|
const discounts = ownedRetainedEligibility(value),
|
|
207
211
|
args = { attachRequest: raw, intent: "initial" as const };
|
|
208
212
|
const reads = validateOwnedReadMaterial(
|
|
@@ -217,7 +221,7 @@ async function retained(value: RetainedInput) {
|
|
|
217
221
|
undefined,
|
|
218
222
|
discounts,
|
|
219
223
|
);
|
|
220
|
-
|
|
224
|
+
owner.check();
|
|
221
225
|
const result = release(
|
|
222
226
|
material(args, false, prepared, request, reads, {
|
|
223
227
|
actualFreshSubscription: raw.preparation.subscription,
|
|
@@ -225,22 +229,22 @@ async function retained(value: RetainedInput) {
|
|
|
225
229
|
prepared,
|
|
226
230
|
request,
|
|
227
231
|
);
|
|
228
|
-
|
|
232
|
+
owner.check();
|
|
229
233
|
return result;
|
|
230
234
|
}
|
|
231
|
-
async function fresh(value: FreshInput) {
|
|
235
|
+
async function fresh(owner: MaterialOwner, value: FreshInput) {
|
|
232
236
|
const raw = value.attachRequest;
|
|
233
|
-
|
|
237
|
+
owner.check();
|
|
234
238
|
const prepared = await c1(raw.preparation);
|
|
235
|
-
|
|
236
|
-
|
|
239
|
+
owner.check();
|
|
240
|
+
owner.check();
|
|
237
241
|
const request = await c2({
|
|
238
242
|
prepared,
|
|
239
243
|
apiVersion: raw.apiVersion,
|
|
240
244
|
attachKey: raw.attachKey,
|
|
241
245
|
firstDispatchedAt: raw.firstDispatchedAt,
|
|
242
246
|
});
|
|
243
|
-
|
|
247
|
+
owner.check();
|
|
244
248
|
const discounts = ownedCouponEligibility(value),
|
|
245
249
|
b = value.currentBundle;
|
|
246
250
|
const args = {
|
|
@@ -263,7 +267,7 @@ async function fresh(value: FreshInput) {
|
|
|
263
267
|
undefined,
|
|
264
268
|
discounts,
|
|
265
269
|
);
|
|
266
|
-
|
|
270
|
+
owner.check();
|
|
267
271
|
const result = release(
|
|
268
272
|
material(args, true, prepared, request, reads, {
|
|
269
273
|
actualFreshSubscription: b.wireSubscription,
|
|
@@ -271,43 +275,81 @@ async function fresh(value: FreshInput) {
|
|
|
271
275
|
prepared,
|
|
272
276
|
request,
|
|
273
277
|
);
|
|
274
|
-
|
|
278
|
+
owner.check();
|
|
275
279
|
return result;
|
|
276
280
|
}
|
|
277
281
|
/** Internal DATA consistency only; Source owner and acquisition provenance remain unbound. */
|
|
278
282
|
export function classifyOwnedRetainedInitialAttachment(
|
|
279
283
|
raw: unknown,
|
|
284
|
+
): Promise<Classified | typeof RETAINED_STOP> {
|
|
285
|
+
return classifyRetained(OWNER, raw);
|
|
286
|
+
}
|
|
287
|
+
function classifyRetained(
|
|
288
|
+
owner: MaterialOwner,
|
|
289
|
+
raw: unknown,
|
|
280
290
|
): Promise<Classified | typeof RETAINED_STOP> {
|
|
281
291
|
let value;
|
|
282
292
|
try {
|
|
283
|
-
|
|
293
|
+
owner.check();
|
|
284
294
|
value = captureRetainedInput(raw);
|
|
285
|
-
|
|
295
|
+
owner.check();
|
|
286
296
|
} catch {
|
|
287
297
|
return Promise.resolve(RETAINED_STOP);
|
|
288
298
|
}
|
|
289
|
-
return retained(value).catch(() => {
|
|
299
|
+
return retained(owner, value).catch(() => {
|
|
290
300
|
try {
|
|
291
|
-
|
|
301
|
+
owner.check();
|
|
292
302
|
} catch {}
|
|
293
303
|
return RETAINED_STOP;
|
|
294
304
|
});
|
|
295
305
|
}
|
|
296
306
|
export function classifyOwnedInitialAttachment(
|
|
297
307
|
raw: unknown,
|
|
308
|
+
): Promise<Classified | typeof FRESH_STOP> {
|
|
309
|
+
return classifyFresh(OWNER, raw);
|
|
310
|
+
}
|
|
311
|
+
function classifyFresh(
|
|
312
|
+
owner: MaterialOwner,
|
|
313
|
+
raw: unknown,
|
|
298
314
|
): Promise<Classified | typeof FRESH_STOP> {
|
|
299
315
|
let value;
|
|
300
316
|
try {
|
|
301
|
-
|
|
317
|
+
owner.check();
|
|
302
318
|
value = captureOwnedInput(raw);
|
|
303
|
-
|
|
319
|
+
owner.check();
|
|
304
320
|
} catch {
|
|
305
321
|
return Promise.resolve(FRESH_STOP);
|
|
306
322
|
}
|
|
307
|
-
return fresh(value).catch(() => {
|
|
323
|
+
return fresh(owner, value).catch(() => {
|
|
308
324
|
try {
|
|
309
|
-
|
|
325
|
+
owner.check();
|
|
310
326
|
} catch {}
|
|
311
327
|
return FRESH_STOP;
|
|
312
328
|
});
|
|
313
329
|
}
|
|
330
|
+
|
|
331
|
+
/** Private original-call classifier factory. Inputs and outputs remain unsigned DATA. */
|
|
332
|
+
export function createInitialMaterialClassifiers(token: object) {
|
|
333
|
+
if (arguments.length !== 1) throw Error("INITIAL_MATERIAL_UNBOUND");
|
|
334
|
+
const owner = ownerForInitialLineage(token);
|
|
335
|
+
owner.check();
|
|
336
|
+
const lineage = readInitialLineage(token);
|
|
337
|
+
const source = JSON.parse(lineage.reservation.recordJSON);
|
|
338
|
+
const original = {
|
|
339
|
+
attachRequest: source.attachRequest,
|
|
340
|
+
originalBundle: source.originalBundle,
|
|
341
|
+
};
|
|
342
|
+
const owned = ownedAwaitForInitialLineage(token);
|
|
343
|
+
return Object.freeze({
|
|
344
|
+
retained() {
|
|
345
|
+
if (arguments.length !== 0) throw Error("INITIAL_MATERIAL_UNBOUND");
|
|
346
|
+
return owned(() => classifyRetained(owner, original));
|
|
347
|
+
},
|
|
348
|
+
fresh(currentBundle: unknown, observedAt: unknown) {
|
|
349
|
+
if (arguments.length !== 2) throw Error("INITIAL_MATERIAL_UNBOUND");
|
|
350
|
+
return owned(() =>
|
|
351
|
+
classifyFresh(owner, { ...original, currentBundle, observedAt }),
|
|
352
|
+
);
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
}
|
|
@@ -43,7 +43,7 @@ type ClassJournal = Awaited<ReturnType<typeof createActionOperationJournal>> &
|
|
|
43
43
|
type ReserveReply = FunctionReturnType<Journal["mutations"]["reserveAttempt"]>;
|
|
44
44
|
type WinningCallState = {
|
|
45
45
|
spent: boolean;
|
|
46
|
-
readonly journal:
|
|
46
|
+
readonly journal: ClassJournal;
|
|
47
47
|
readonly binding: object;
|
|
48
48
|
readonly rpc: ReturnType<typeof readCheckedJournalActionRPC>;
|
|
49
49
|
readonly source: Awaited<ReturnType<typeof createActionOperationJournal>>;
|
|
@@ -569,5 +569,9 @@ export function consumeInitialClassReservation(
|
|
|
569
569
|
if (typeof call !== "object" || call === null) callUnbound();
|
|
570
570
|
const state = winningCalls.get(call);
|
|
571
571
|
if (!state) callUnbound();
|
|
572
|
-
return Object.freeze({
|
|
572
|
+
return Object.freeze({
|
|
573
|
+
...consumed,
|
|
574
|
+
binding: state.binding,
|
|
575
|
+
journal: state.journal,
|
|
576
|
+
});
|
|
573
577
|
}
|
|
@@ -3,12 +3,16 @@ import { ownerForInitialLineage, type InitialOwner } from "./ownerFactory.js";
|
|
|
3
3
|
import { ownedAwaitForInitialLineage } from "./ownedAwaitFactory.js";
|
|
4
4
|
import { stockDelegateForInitialLineage } from "./stockDelegateFactory.js";
|
|
5
5
|
import type { createClassActionOperationJournal } from "../operationJournal.js";
|
|
6
|
+
import { createInitialAttachEventCompiler } from "../c10/attachEvents.js";
|
|
7
|
+
import { createInitialMaterialClassifiers } from "../material/classifiers.js";
|
|
6
8
|
|
|
7
9
|
export type InitialInvocationCore = Readonly<{
|
|
8
10
|
owner: InitialOwner;
|
|
9
11
|
basisJSON: string;
|
|
10
12
|
delegate: ReturnType<typeof stockDelegateForInitialLineage>;
|
|
11
13
|
owned<T>(work: () => T | PromiseLike<T>): Promise<T>;
|
|
14
|
+
attachEvents(): ReturnType<typeof createInitialAttachEventCompiler>;
|
|
15
|
+
material: ReturnType<typeof createInitialMaterialClassifiers>;
|
|
12
16
|
operationalAuthority: false;
|
|
13
17
|
}>;
|
|
14
18
|
|
|
@@ -44,11 +48,20 @@ export async function captureInitialInvocationCore(
|
|
|
44
48
|
)
|
|
45
49
|
throw Error("INITIAL_LINEAGE_UNBOUND");
|
|
46
50
|
owner.check();
|
|
51
|
+
let channelCaptured = false;
|
|
47
52
|
return Object.freeze({
|
|
48
53
|
owner,
|
|
49
54
|
basisJSON: lineage.basisJSON,
|
|
50
55
|
owned,
|
|
51
56
|
delegate: stockDelegateForInitialLineage(token),
|
|
57
|
+
attachEvents() {
|
|
58
|
+
owner.check();
|
|
59
|
+
if (channelCaptured) throw Error("INITIAL_CHANNEL_CONSUMED");
|
|
60
|
+
channelCaptured = true;
|
|
61
|
+
if (arguments.length !== 0) throw Error("INITIAL_CHANNEL_UNBOUND");
|
|
62
|
+
return createInitialAttachEventCompiler(token);
|
|
63
|
+
},
|
|
64
|
+
material: createInitialMaterialClassifiers(token),
|
|
52
65
|
operationalAuthority: false,
|
|
53
66
|
});
|
|
54
67
|
} catch (error) {
|
|
@@ -17,6 +17,7 @@ const ms = (value: number) => Number.isSafeInteger(value) && value >= 0;
|
|
|
17
17
|
// Only this module mints identities. Retained journal DATA cannot construct one.
|
|
18
18
|
class InitialLineage {}
|
|
19
19
|
type Lineage = Readonly<{
|
|
20
|
+
journal: ReturnType<typeof consumeInitialClassReservation>["journal"];
|
|
20
21
|
reservation: ReturnType<typeof consumeInitialClassReservation>["reservation"];
|
|
21
22
|
selection: ReturnType<typeof captureInitialJournalSelection>;
|
|
22
23
|
client: Stripe;
|
|
@@ -47,10 +48,11 @@ export function mintInitialLineage(
|
|
|
47
48
|
journal: unknown,
|
|
48
49
|
arity: number,
|
|
49
50
|
): object {
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const {
|
|
52
|
+
reservation,
|
|
53
|
+
binding,
|
|
54
|
+
journal: originalJournal,
|
|
55
|
+
} = consumeInitialClassReservation(call, journal);
|
|
54
56
|
if (arity !== 2) stop();
|
|
55
57
|
if (
|
|
56
58
|
!("recordVersion" in reservation) ||
|
|
@@ -123,6 +125,7 @@ export function mintInitialLineage(
|
|
|
123
125
|
lineages.set(
|
|
124
126
|
token,
|
|
125
127
|
Object.freeze({
|
|
128
|
+
journal: originalJournal,
|
|
126
129
|
reservation,
|
|
127
130
|
selection,
|
|
128
131
|
client: client as Stripe,
|