@fabricorg/platform 0.1.0 → 0.1.2
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/dist/actions/index.d.ts +3 -1
- package/dist/actions/index.js +1 -57
- package/dist/actions/index.js.map +1 -1
- package/dist/adapters/index.js +1 -99
- package/dist/adapters/index.js.map +1 -1
- package/dist/chunk-3A6FU3KV.js +67 -0
- package/dist/chunk-3A6FU3KV.js.map +1 -0
- package/dist/chunk-3F6FKQZA.js +89 -0
- package/dist/chunk-3F6FKQZA.js.map +1 -0
- package/dist/chunk-3ZW5USXF.js +101 -0
- package/dist/chunk-3ZW5USXF.js.map +1 -0
- package/dist/chunk-4YQOGV7H.js +55 -0
- package/dist/chunk-4YQOGV7H.js.map +1 -0
- package/dist/chunk-6FMW4NF6.js +59 -0
- package/dist/chunk-6FMW4NF6.js.map +1 -0
- package/dist/chunk-I35B576X.js +30 -0
- package/dist/chunk-I35B576X.js.map +1 -0
- package/dist/chunk-IFMZPLM4.js +27 -0
- package/dist/chunk-IFMZPLM4.js.map +1 -0
- package/dist/chunk-JSTGOT6P.js +181 -0
- package/dist/chunk-JSTGOT6P.js.map +1 -0
- package/dist/chunk-KOC4A7A4.js +544 -0
- package/dist/chunk-KOC4A7A4.js.map +1 -0
- package/dist/chunk-N24NLCZ6.js +6 -0
- package/dist/chunk-N24NLCZ6.js.map +1 -0
- package/dist/chunk-OZLZHISS.js +3 -0
- package/dist/chunk-OZLZHISS.js.map +1 -0
- package/dist/chunk-PXMKCAQI.js +187 -0
- package/dist/chunk-PXMKCAQI.js.map +1 -0
- package/dist/chunk-RALMUSOX.js +55 -0
- package/dist/chunk-RALMUSOX.js.map +1 -0
- package/dist/displays/index.js +1 -87
- package/dist/displays/index.js.map +1 -1
- package/dist/events/index.js +1 -53
- package/dist/events/index.js.map +1 -1
- package/dist/evidence/index.js +1 -1
- package/dist/ids/index.js +1 -53
- package/dist/ids/index.js.map +1 -1
- package/dist/index.js +13 -1355
- package/dist/index.js.map +1 -1
- package/dist/modules/index.js +7 -373
- package/dist/modules/index.js.map +1 -1
- package/dist/objects/index.js +1 -28
- package/dist/objects/index.js.map +1 -1
- package/dist/policies/index.js +1 -542
- package/dist/policies/index.js.map +1 -1
- package/dist/privacy/index.js +1 -4
- package/dist/privacy/index.js.map +1 -1
- package/dist/projections/index.js +1 -179
- package/dist/projections/index.js.map +1 -1
- package/dist/state-machines/index.js +1 -65
- package/dist/state-machines/index.js.map +1 -1
- package/dist/testing/index.js +2 -56
- package/dist/testing/index.js.map +1 -1
- package/package.json +111 -112
|
@@ -1,181 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
async function replayEvents({
|
|
3
|
-
events,
|
|
4
|
-
scope,
|
|
5
|
-
initialState,
|
|
6
|
-
snapshot,
|
|
7
|
-
applyEvent
|
|
8
|
-
}) {
|
|
9
|
-
const warnings = [];
|
|
10
|
-
const scopedEvents = filterEventsByScope(await collectEvents(events), scope, warnings);
|
|
11
|
-
const orderedEvents = sortEvents(scopedEvents, isSubjectScoped(scope));
|
|
12
|
-
const uniqueEvents = removeDuplicateEvents(orderedEvents, warnings);
|
|
13
|
-
const resumableEvents = applyCursor(uniqueEvents, snapshot, isSubjectScoped(scope), warnings);
|
|
14
|
-
let state = snapshot?.snapshotData ?? initialState;
|
|
15
|
-
const appliedEvents = [];
|
|
16
|
-
let eventCursor = snapshot?.eventCursor ?? null;
|
|
17
|
-
let eventSequence = snapshot?.eventSequence ?? 0;
|
|
18
|
-
for (const event of resumableEvents) {
|
|
19
|
-
state = await applyEvent(state, event);
|
|
20
|
-
appliedEvents.push(event);
|
|
21
|
-
eventCursor = event.id;
|
|
22
|
-
eventSequence = event.sequence;
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
state,
|
|
26
|
-
appliedEvents,
|
|
27
|
-
warnings,
|
|
28
|
-
eventCursor,
|
|
29
|
-
eventSequence
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
async function collectEvents(events) {
|
|
33
|
-
const collected = [];
|
|
34
|
-
if (Symbol.asyncIterator in events) {
|
|
35
|
-
for await (const event of events) {
|
|
36
|
-
collected.push(event);
|
|
37
|
-
}
|
|
38
|
-
return collected;
|
|
39
|
-
}
|
|
40
|
-
for (const event of events) {
|
|
41
|
-
collected.push(event);
|
|
42
|
-
}
|
|
43
|
-
return collected;
|
|
44
|
-
}
|
|
45
|
-
function filterEventsByScope(events, scope, warnings) {
|
|
46
|
-
if (scope.subjectType && !scope.subjectId || !scope.subjectType && scope.subjectId) {
|
|
47
|
-
warnings.push({
|
|
48
|
-
code: "subject_scope_incomplete",
|
|
49
|
-
message: "Both subjectType and subjectId are required for subject-scoped replay.",
|
|
50
|
-
subjectType: scope.subjectType,
|
|
51
|
-
subjectId: scope.subjectId
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return events.filter((event) => {
|
|
55
|
-
if (event.tenantId !== scope.tenantId || event.spaceId !== scope.spaceId) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
if (scope.subjectType && event.subjectType !== scope.subjectType) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
if (scope.subjectId && event.subjectId !== scope.subjectId) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
return true;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function removeDuplicateEvents(events, warnings) {
|
|
68
|
-
const seenEventIds = /* @__PURE__ */ new Set();
|
|
69
|
-
const uniqueEvents = [];
|
|
70
|
-
for (const event of events) {
|
|
71
|
-
if (seenEventIds.has(event.id)) {
|
|
72
|
-
warnings.push({
|
|
73
|
-
code: "duplicate_event",
|
|
74
|
-
message: `Duplicate event ${event.id} ignored during replay.`,
|
|
75
|
-
eventId: event.id,
|
|
76
|
-
subjectType: event.subjectType,
|
|
77
|
-
subjectId: event.subjectId
|
|
78
|
-
});
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
seenEventIds.add(event.id);
|
|
82
|
-
uniqueEvents.push(event);
|
|
83
|
-
}
|
|
84
|
-
recordMissingSequenceWarnings(uniqueEvents, warnings);
|
|
85
|
-
return uniqueEvents;
|
|
86
|
-
}
|
|
87
|
-
function recordMissingSequenceWarnings(events, warnings) {
|
|
88
|
-
const lastSequenceBySubject = /* @__PURE__ */ new Map();
|
|
89
|
-
for (const event of events) {
|
|
90
|
-
const subjectKey = `${event.subjectType}:${event.subjectId}`;
|
|
91
|
-
const previousSequence = lastSequenceBySubject.get(subjectKey);
|
|
92
|
-
const expectedSequence = previousSequence === void 0 ? event.sequence : previousSequence + 1;
|
|
93
|
-
if (previousSequence !== void 0 && event.sequence > expectedSequence) {
|
|
94
|
-
warnings.push({
|
|
95
|
-
code: "missing_sequence",
|
|
96
|
-
message: `Missing event sequence for ${subjectKey}: expected ${expectedSequence}, received ${event.sequence}.`,
|
|
97
|
-
eventId: event.id,
|
|
98
|
-
subjectType: event.subjectType,
|
|
99
|
-
subjectId: event.subjectId,
|
|
100
|
-
expectedSequence,
|
|
101
|
-
actualSequence: event.sequence
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
lastSequenceBySubject.set(subjectKey, Math.max(previousSequence ?? event.sequence, event.sequence));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function applyCursor(events, snapshot, subjectScoped, warnings) {
|
|
108
|
-
const eventCursor = snapshot?.eventCursor;
|
|
109
|
-
if (eventCursor) {
|
|
110
|
-
const cursorIndex = events.findIndex((event) => event.id === eventCursor);
|
|
111
|
-
if (cursorIndex >= 0) {
|
|
112
|
-
return events.slice(cursorIndex + 1);
|
|
113
|
-
}
|
|
114
|
-
warnings.push({
|
|
115
|
-
code: "cursor_not_found",
|
|
116
|
-
message: `Snapshot cursor ${eventCursor} was not found in the scoped event stream.`,
|
|
117
|
-
eventId: eventCursor
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (subjectScoped && snapshot?.eventSequence !== void 0 && snapshot.eventSequence !== null) {
|
|
121
|
-
return events.filter((event) => event.sequence > snapshot.eventSequence);
|
|
122
|
-
}
|
|
123
|
-
return events;
|
|
124
|
-
}
|
|
125
|
-
function sortEvents(events, subjectScoped) {
|
|
126
|
-
return [...events].sort(
|
|
127
|
-
(first, second) => subjectScoped ? compareSubjectEvents(first, second) : compareGlobalEvents(first, second)
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
function compareSubjectEvents(first, second) {
|
|
131
|
-
return compareValues(
|
|
132
|
-
[first.sequence, toTimestamp(first.recordedAt), toTimestamp(first.occurredAt), first.id],
|
|
133
|
-
[second.sequence, toTimestamp(second.recordedAt), toTimestamp(second.occurredAt), second.id]
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
function compareGlobalEvents(first, second) {
|
|
137
|
-
return compareValues(
|
|
138
|
-
[
|
|
139
|
-
toTimestamp(first.recordedAt),
|
|
140
|
-
toTimestamp(first.occurredAt),
|
|
141
|
-
first.actionInvocationId,
|
|
142
|
-
first.correlationId,
|
|
143
|
-
first.subjectType,
|
|
144
|
-
first.subjectId,
|
|
145
|
-
first.sequence,
|
|
146
|
-
first.id
|
|
147
|
-
],
|
|
148
|
-
[
|
|
149
|
-
toTimestamp(second.recordedAt),
|
|
150
|
-
toTimestamp(second.occurredAt),
|
|
151
|
-
second.actionInvocationId,
|
|
152
|
-
second.correlationId,
|
|
153
|
-
second.subjectType,
|
|
154
|
-
second.subjectId,
|
|
155
|
-
second.sequence,
|
|
156
|
-
second.id
|
|
157
|
-
]
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
function compareValues(firstValues, secondValues) {
|
|
161
|
-
for (const [index, firstValue] of firstValues.entries()) {
|
|
162
|
-
const secondValue = secondValues[index];
|
|
163
|
-
if (firstValue < secondValue) {
|
|
164
|
-
return -1;
|
|
165
|
-
}
|
|
166
|
-
if (firstValue > secondValue) {
|
|
167
|
-
return 1;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return 0;
|
|
171
|
-
}
|
|
172
|
-
function isSubjectScoped(scope) {
|
|
173
|
-
return Boolean(scope.subjectType && scope.subjectId);
|
|
174
|
-
}
|
|
175
|
-
function toTimestamp(value) {
|
|
176
|
-
return value instanceof Date ? value.getTime() : new Date(value).getTime();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export { replayEvents };
|
|
1
|
+
export { replayEvents } from '../chunk-JSTGOT6P.js';
|
|
180
2
|
//# sourceMappingURL=index.js.map
|
|
181
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../projections/index.ts"],"names":[],"mappings":";AA4DA,eAAsB,YAAA,CAA+E;AAAA,EACpG,MAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA;AACD,CAAA,EAAiF;AAChF,EAAA,MAAM,WAA4B,EAAC;AACnC,EAAA,MAAM,eAAe,mBAAA,CAAoB,MAAM,cAAc,MAAM,CAAA,EAAG,OAAO,QAAQ,CAAA;AACrF,EAAA,MAAM,aAAA,GAAgB,UAAA,CAAW,YAAA,EAAc,eAAA,CAAgB,KAAK,CAAC,CAAA;AACrE,EAAA,MAAM,YAAA,GAAe,qBAAA,CAAsB,aAAA,EAAe,QAAQ,CAAA;AAClE,EAAA,MAAM,kBAAkB,WAAA,CAAY,YAAA,EAAc,UAAU,eAAA,CAAgB,KAAK,GAAG,QAAQ,CAAA;AAE5F,EAAA,IAAI,KAAA,GAAQ,UAAU,YAAA,IAAgB,YAAA;AACtC,EAAA,MAAM,gBAAyB,EAAC;AAChC,EAAA,IAAI,WAAA,GAAc,UAAU,WAAA,IAAe,IAAA;AAC3C,EAAA,IAAI,aAAA,GAAgB,UAAU,aAAA,IAAiB,CAAA;AAE/C,EAAA,KAAA,MAAW,SAAS,eAAA,EAAiB;AACpC,IAAA,KAAA,GAAQ,MAAM,UAAA,CAAW,KAAA,EAAO,KAAK,CAAA;AACrC,IAAA,aAAA,CA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AAA,MAC7B,WAAA,CAAY,OAAO,UAAU,CAAA;AAAA,MAC7B,MAAA,CAAO,kBAAA;AAAA,MACP,MAAA,CAAO,aAAA;AAAA,MACP,MAAA,CAAO,WAAA;AAAA,MACP,MAAA,CAAO,SAAA;AAAA,MACP,MAAA,CAAO,QAAA;AAAA,MACP,MAAA,CAAO;AAAA;AACR,GACD;AACD;AAEA,SAAS,aAAA,CAAc,aAAqC,YAAA,EAA8C;AACzG,EAAA,KAAA,MAAW,CAAC,KAAA,EAAO,UAAU,CAAA,IAAK,WAAA,CAAY,SAAQ,EAAG;AACxD,IAAA,MAAM,WAAA,GAAc,aAAa,KAAK,CAAA;AAEtC,IAAA,IAAI,aAAa,WAAA,EAAa;AAC7B,MAAA,OAAO,EAAA;AAAA,IACR;AAEA,IAAA,IAAI,aAAa,WAAA,EAAa;AAC7B,MAAA,OAAO,CAAA;AAAA,IACR;AAAA,EACD;AAEA,EAAA,OAAO,CAAA;AACR;AAEA,SAAS,gBAAgB,KAAA,EAA6B;AACrD,EAAA,OAAO,OAAA,CAAQ,KAAA,CAAM,WAAA,IAAe,KAAA,CAAM,SAAS,CAAA;AACpD;AAEA,SAAS,YAAY,KAAA,EAA8B;AAClD,EAAA,OAAO,KAAA,YAAiB,OAAO,KAAA,CAAM,OAAA,KAAY,IAAI,IAAA,CAAK,KAAK,CAAA,CAAE,OAAA,EAAQ;AAC1E","file":"index.js","sourcesContent":["export interface ReplayableAssetEvent<Payload = unknown> {\n\tid: string;\n\ttenantId: string;\n\tspaceId: string;\n\teventType: string;\n\tsubjectType: string;\n\tsubjectId: string;\n\tpayload: Payload;\n\tsequence: number;\n\toccurredAt: Date | string;\n\trecordedAt: Date | string;\n\tactionInvocationId: string;\n\tcorrelationId: string;\n}\n\nexport interface ReplayScope {\n\ttenantId: string;\n\tspaceId: string;\n\tsubjectType?: string;\n\tsubjectId?: string;\n}\n\nexport interface ReplaySnapshot<State = unknown> {\n\tsnapshotData: State;\n\teventCursor?: string | null;\n\teventSequence?: number | null;\n}\n\nexport type ReplayWarningCode =\n\t| \"cursor_not_found\"\n\t| \"duplicate_event\"\n\t| \"missing_sequence\"\n\t| \"subject_scope_incomplete\";\n\nexport interface ReplayWarning {\n\tcode: ReplayWarningCode;\n\tmessage: string;\n\teventId?: string;\n\tsubjectType?: string;\n\tsubjectId?: string;\n\texpectedSequence?: number;\n\tactualSequence?: number;\n}\n\nexport interface ReplayEventsOptions<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent> {\n\tevents: Iterable<Event> | AsyncIterable<Event>;\n\tscope: ReplayScope;\n\tinitialState: State;\n\tsnapshot?: ReplaySnapshot<State> | null;\n\tapplyEvent: (state: State, event: Event) => State | Promise<State>;\n}\n\nexport interface ReplayEventsResult<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent> {\n\tstate: State;\n\tappliedEvents: Event[];\n\twarnings: ReplayWarning[];\n\teventCursor: string | null;\n\teventSequence: number;\n}\n\nexport async function replayEvents<State, Event extends ReplayableAssetEvent = ReplayableAssetEvent>({\n\tevents,\n\tscope,\n\tinitialState,\n\tsnapshot,\n\tapplyEvent,\n}: ReplayEventsOptions<State, Event>): Promise<ReplayEventsResult<State, Event>> {\n\tconst warnings: ReplayWarning[] = [];\n\tconst scopedEvents = filterEventsByScope(await collectEvents(events), scope, warnings);\n\tconst orderedEvents = sortEvents(scopedEvents, isSubjectScoped(scope));\n\tconst uniqueEvents = removeDuplicateEvents(orderedEvents, warnings);\n\tconst resumableEvents = applyCursor(uniqueEvents, snapshot, isSubjectScoped(scope), warnings);\n\n\tlet state = snapshot?.snapshotData ?? initialState;\n\tconst appliedEvents: Event[] = [];\n\tlet eventCursor = snapshot?.eventCursor ?? null;\n\tlet eventSequence = snapshot?.eventSequence ?? 0;\n\n\tfor (const event of resumableEvents) {\n\t\tstate = await applyEvent(state, event);\n\t\tappliedEvents.push(event);\n\t\teventCursor = event.id;\n\t\teventSequence = event.sequence;\n\t}\n\n\treturn {\n\t\tstate,\n\t\tappliedEvents,\n\t\twarnings,\n\t\teventCursor,\n\t\teventSequence,\n\t};\n}\n\nasync function collectEvents<Event extends ReplayableAssetEvent>(\n\tevents: Iterable<Event> | AsyncIterable<Event>,\n): Promise<Event[]> {\n\tconst collected: Event[] = [];\n\n\tif (Symbol.asyncIterator in events) {\n\t\tfor await (const event of events) {\n\t\t\tcollected.push(event);\n\t\t}\n\n\t\treturn collected;\n\t}\n\n\tfor (const event of events) {\n\t\tcollected.push(event);\n\t}\n\n\treturn collected;\n}\n\nfunction filterEventsByScope<Event extends ReplayableAssetEvent>(\n\tevents: Event[],\n\tscope: ReplayScope,\n\twarnings: ReplayWarning[],\n): Event[] {\n\tif ((scope.subjectType && !scope.subjectId) || (!scope.subjectType && scope.subjectId)) {\n\t\twarnings.push({\n\t\t\tcode: \"subject_scope_incomplete\",\n\t\t\tmessage: \"Both subjectType and subjectId are required for subject-scoped replay.\",\n\t\t\tsubjectType: scope.subjectType,\n\t\t\tsubjectId: scope.subjectId,\n\t\t});\n\t}\n\n\treturn events.filter((event) => {\n\t\tif (event.tenantId !== scope.tenantId || event.spaceId !== scope.spaceId) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (scope.subjectType && event.subjectType !== scope.subjectType) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (scope.subjectId && event.subjectId !== scope.subjectId) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t});\n}\n\nfunction removeDuplicateEvents<Event extends ReplayableAssetEvent>(\n\tevents: Event[],\n\twarnings: ReplayWarning[],\n): Event[] {\n\tconst seenEventIds = new Set<string>();\n\tconst uniqueEvents: Event[] = [];\n\n\tfor (const event of events) {\n\t\tif (seenEventIds.has(event.id)) {\n\t\t\twarnings.push({\n\t\t\t\tcode: \"duplicate_event\",\n\t\t\t\tmessage: `Duplicate event ${event.id} ignored during replay.`,\n\t\t\t\teventId: event.id,\n\t\t\t\tsubjectType: event.subjectType,\n\t\t\t\tsubjectId: event.subjectId,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tseenEventIds.add(event.id);\n\t\tuniqueEvents.push(event);\n\t}\n\n\trecordMissingSequenceWarnings(uniqueEvents, warnings);\n\n\treturn uniqueEvents;\n}\n\nfunction recordMissingSequenceWarnings<Event extends ReplayableAssetEvent>(\n\tevents: Event[],\n\twarnings: ReplayWarning[],\n): void {\n\tconst lastSequenceBySubject = new Map<string, number>();\n\n\tfor (const event of events) {\n\t\tconst subjectKey = `${event.subjectType}:${event.subjectId}`;\n\t\tconst previousSequence = lastSequenceBySubject.get(subjectKey);\n\t\tconst expectedSequence = previousSequence === undefined ? event.sequence : previousSequence + 1;\n\n\t\tif (previousSequence !== undefined && event.sequence > expectedSequence) {\n\t\t\twarnings.push({\n\t\t\t\tcode: \"missing_sequence\",\n\t\t\t\tmessage: `Missing event sequence for ${subjectKey}: expected ${expectedSequence}, received ${event.sequence}.`,\n\t\t\t\teventId: event.id,\n\t\t\t\tsubjectType: event.subjectType,\n\t\t\t\tsubjectId: event.subjectId,\n\t\t\t\texpectedSequence,\n\t\t\t\tactualSequence: event.sequence,\n\t\t\t});\n\t\t}\n\n\t\tlastSequenceBySubject.set(subjectKey, Math.max(previousSequence ?? event.sequence, event.sequence));\n\t}\n}\n\nfunction applyCursor<Event extends ReplayableAssetEvent>(\n\tevents: Event[],\n\tsnapshot: ReplaySnapshot | null | undefined,\n\tsubjectScoped: boolean,\n\twarnings: ReplayWarning[],\n): Event[] {\n\tconst eventCursor = snapshot?.eventCursor;\n\n\tif (eventCursor) {\n\t\tconst cursorIndex = events.findIndex((event) => event.id === eventCursor);\n\n\t\tif (cursorIndex >= 0) {\n\t\t\treturn events.slice(cursorIndex + 1);\n\t\t}\n\n\t\twarnings.push({\n\t\t\tcode: \"cursor_not_found\",\n\t\t\tmessage: `Snapshot cursor ${eventCursor} was not found in the scoped event stream.`,\n\t\t\teventId: eventCursor,\n\t\t});\n\t}\n\n\tif (subjectScoped && snapshot?.eventSequence !== undefined && snapshot.eventSequence !== null) {\n\t\treturn events.filter((event) => event.sequence > snapshot.eventSequence!);\n\t}\n\n\treturn events;\n}\n\nfunction sortEvents<Event extends ReplayableAssetEvent>(events: Event[], subjectScoped: boolean): Event[] {\n\treturn [...events].sort((first, second) =>\n\t\tsubjectScoped ? compareSubjectEvents(first, second) : compareGlobalEvents(first, second),\n\t);\n}\n\nfunction compareSubjectEvents(first: ReplayableAssetEvent, second: ReplayableAssetEvent): number {\n\treturn compareValues(\n\t\t[first.sequence, toTimestamp(first.recordedAt), toTimestamp(first.occurredAt), first.id],\n\t\t[second.sequence, toTimestamp(second.recordedAt), toTimestamp(second.occurredAt), second.id],\n\t);\n}\n\nfunction compareGlobalEvents(first: ReplayableAssetEvent, second: ReplayableAssetEvent): number {\n\treturn compareValues(\n\t\t[\n\t\t\ttoTimestamp(first.recordedAt),\n\t\t\ttoTimestamp(first.occurredAt),\n\t\t\tfirst.actionInvocationId,\n\t\t\tfirst.correlationId,\n\t\t\tfirst.subjectType,\n\t\t\tfirst.subjectId,\n\t\t\tfirst.sequence,\n\t\t\tfirst.id,\n\t\t],\n\t\t[\n\t\t\ttoTimestamp(second.recordedAt),\n\t\t\ttoTimestamp(second.occurredAt),\n\t\t\tsecond.actionInvocationId,\n\t\t\tsecond.correlationId,\n\t\t\tsecond.subjectType,\n\t\t\tsecond.subjectId,\n\t\t\tsecond.sequence,\n\t\t\tsecond.id,\n\t\t],\n\t);\n}\n\nfunction compareValues(firstValues: Array<number | string>, secondValues: Array<number | string>): number {\n\tfor (const [index, firstValue] of firstValues.entries()) {\n\t\tconst secondValue = secondValues[index];\n\n\t\tif (firstValue < secondValue) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif (firstValue > secondValue) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\nfunction isSubjectScoped(scope: ReplayScope): boolean {\n\treturn Boolean(scope.subjectType && scope.subjectId);\n}\n\nfunction toTimestamp(value: Date | string): number {\n\treturn value instanceof Date ? value.getTime() : new Date(value).getTime();\n}\n"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,67 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
var registry = /* @__PURE__ */ new Map();
|
|
3
|
-
function registerStateMachine(def) {
|
|
4
|
-
if (registry.has(def.entityType)) {
|
|
5
|
-
throw new Error(`State machine for entity type "${def.entityType}" is already registered.`);
|
|
6
|
-
}
|
|
7
|
-
registry.set(def.entityType, def);
|
|
8
|
-
}
|
|
9
|
-
function registerStateMachineIfMissing(def) {
|
|
10
|
-
if (!registry.has(def.entityType)) {
|
|
11
|
-
registerStateMachine(def);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function resolveStateMachine(entityType) {
|
|
15
|
-
return registry.get(entityType);
|
|
16
|
-
}
|
|
17
|
-
function validateTransition(entityType, from, to, actionId) {
|
|
18
|
-
const sm = registry.get(entityType);
|
|
19
|
-
if (!sm) {
|
|
20
|
-
return {
|
|
21
|
-
valid: false,
|
|
22
|
-
error: `No state machine registered for entity type "${entityType}".`
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const fromDef = sm.states[from];
|
|
26
|
-
if (!fromDef) {
|
|
27
|
-
return {
|
|
28
|
-
valid: false,
|
|
29
|
-
error: `State "${from}" does not exist in state machine for entity type "${entityType}".`
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const toDef = sm.states[to];
|
|
33
|
-
if (!toDef) {
|
|
34
|
-
return {
|
|
35
|
-
valid: false,
|
|
36
|
-
error: `State "${to}" does not exist in state machine for entity type "${entityType}".`
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const transitionExists = sm.transitions.some(
|
|
40
|
-
(t) => t.from === from && t.to === to && t.causedByAction === actionId
|
|
41
|
-
);
|
|
42
|
-
if (!transitionExists) {
|
|
43
|
-
return {
|
|
44
|
-
valid: false,
|
|
45
|
-
error: `Transition from "${from}" to "${to}" via action "${actionId}" is not defined for entity type "${entityType}".`
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return { valid: true };
|
|
49
|
-
}
|
|
50
|
-
function getAllowedTransitions(entityType, from) {
|
|
51
|
-
const sm = registry.get(entityType);
|
|
52
|
-
if (!sm) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
return sm.transitions.filter((t) => t.from === from).map((t) => ({ to: t.to, causedByAction: t.causedByAction }));
|
|
56
|
-
}
|
|
57
|
-
function getEntityStateClass(entityType, state) {
|
|
58
|
-
const sm = registry.get(entityType);
|
|
59
|
-
if (!sm) {
|
|
60
|
-
return void 0;
|
|
61
|
-
}
|
|
62
|
-
return sm.states[state]?.stateClass;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition };
|
|
1
|
+
export { getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition } from '../chunk-3A6FU3KV.js';
|
|
66
2
|
//# sourceMappingURL=index.js.map
|
|
67
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,58 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return `${adapterType}:${operation}`;
|
|
4
|
-
}
|
|
5
|
-
var MissingAdapterRegistrationError = class extends Error {
|
|
6
|
-
constructor(adapterType, operation) {
|
|
7
|
-
super(`No adapter registered for adapterType "${adapterType}" and operation "${operation}"`);
|
|
8
|
-
this.name = "MissingAdapterRegistrationError";
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
var AdapterRegistry = class {
|
|
12
|
-
adapters = /* @__PURE__ */ new Map();
|
|
13
|
-
register(adapter) {
|
|
14
|
-
const key = adapterKey(adapter.adapterType, adapter.operation);
|
|
15
|
-
if (this.adapters.has(key)) {
|
|
16
|
-
throw new Error(
|
|
17
|
-
`Adapter already registered for adapterType "${adapter.adapterType}" and operation "${adapter.operation}"`
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
this.adapters.set(key, adapter);
|
|
21
|
-
}
|
|
22
|
-
resolve(adapterType, operation) {
|
|
23
|
-
return this.adapters.get(adapterKey(adapterType, operation));
|
|
24
|
-
}
|
|
25
|
-
require(adapterType, operation) {
|
|
26
|
-
const adapter = this.resolve(adapterType, operation);
|
|
27
|
-
if (!adapter) {
|
|
28
|
-
throw new MissingAdapterRegistrationError(adapterType, operation);
|
|
29
|
-
}
|
|
30
|
-
return adapter;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// testing/index.ts
|
|
35
|
-
function createFakeActionContext(options = {}) {
|
|
36
|
-
return {
|
|
37
|
-
actionInvocationId: options.actionInvocationId ?? "act_test",
|
|
38
|
-
tenantId: options.tenantId ?? "tenant-test",
|
|
39
|
-
spaceId: options.spaceId ?? "space-test",
|
|
40
|
-
actorId: options.actorId ?? "actor-test",
|
|
41
|
-
actorType: options.actorType ?? "system",
|
|
42
|
-
correlationId: options.correlationId ?? "corr-test",
|
|
43
|
-
causationId: options.causationId,
|
|
44
|
-
db: options.db ?? {},
|
|
45
|
-
services: options.services ?? {}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function createInMemoryAdapterRegistry() {
|
|
49
|
-
return new AdapterRegistry();
|
|
50
|
-
}
|
|
51
|
-
function createDeterministicIdFactory(prefix = "test") {
|
|
52
|
-
let sequence = 0;
|
|
53
|
-
return () => `${prefix}_${String(++sequence).padStart(6, "0")}`;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry };
|
|
1
|
+
export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from '../chunk-IFMZPLM4.js';
|
|
2
|
+
import '../chunk-3ZW5USXF.js';
|
|
57
3
|
//# sourceMappingURL=index.js.map
|
|
58
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/package.json
CHANGED
|
@@ -1,113 +1,112 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
2
|
+
"name": "@fabricorg/platform",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Generic, vertical-agnostic runtime for ontology-based business applications. Provides actions, modules, events, policies, state machines, adapters, displays, projections, privacy, and evidence contracts. Zero runtime dependencies; portable across any database client and any vertical (lending, insurance, healthcare, legal, etc.).",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"fabric",
|
|
7
|
+
"ontology",
|
|
8
|
+
"action-runtime",
|
|
9
|
+
"event-sourcing",
|
|
10
|
+
"saga",
|
|
11
|
+
"state-machine",
|
|
12
|
+
"policy-engine",
|
|
13
|
+
"adapter-registry"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Fabric",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/Fabric-Pro/fabric-platform.git",
|
|
20
|
+
"directory": "packages/platform"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/Fabric-Pro/fabric-platform#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/Fabric-Pro/fabric-platform/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./actions": {
|
|
36
|
+
"types": "./dist/actions/index.d.ts",
|
|
37
|
+
"import": "./dist/actions/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./adapters": {
|
|
40
|
+
"types": "./dist/adapters/index.d.ts",
|
|
41
|
+
"import": "./dist/adapters/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./displays": {
|
|
44
|
+
"types": "./dist/displays/index.d.ts",
|
|
45
|
+
"import": "./dist/displays/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./events": {
|
|
48
|
+
"types": "./dist/events/index.d.ts",
|
|
49
|
+
"import": "./dist/events/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./evidence": {
|
|
52
|
+
"types": "./dist/evidence/index.d.ts",
|
|
53
|
+
"import": "./dist/evidence/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./ids": {
|
|
56
|
+
"types": "./dist/ids/index.d.ts",
|
|
57
|
+
"import": "./dist/ids/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./modules": {
|
|
60
|
+
"types": "./dist/modules/index.d.ts",
|
|
61
|
+
"import": "./dist/modules/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./objects": {
|
|
64
|
+
"types": "./dist/objects/index.d.ts",
|
|
65
|
+
"import": "./dist/objects/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./policies": {
|
|
68
|
+
"types": "./dist/policies/index.d.ts",
|
|
69
|
+
"import": "./dist/policies/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./privacy": {
|
|
72
|
+
"types": "./dist/privacy/index.d.ts",
|
|
73
|
+
"import": "./dist/privacy/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./projections": {
|
|
76
|
+
"types": "./dist/projections/index.d.ts",
|
|
77
|
+
"import": "./dist/projections/index.js"
|
|
78
|
+
},
|
|
79
|
+
"./state-machines": {
|
|
80
|
+
"types": "./dist/state-machines/index.d.ts",
|
|
81
|
+
"import": "./dist/state-machines/index.js"
|
|
82
|
+
},
|
|
83
|
+
"./testing": {
|
|
84
|
+
"types": "./dist/testing/index.d.ts",
|
|
85
|
+
"import": "./dist/testing/index.js"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"dist",
|
|
90
|
+
"README.md",
|
|
91
|
+
"LICENSE"
|
|
92
|
+
],
|
|
93
|
+
"dependencies": {},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@types/node": "^22.10.0",
|
|
96
|
+
"tsup": "^8.5.0",
|
|
97
|
+
"typescript": "^5.7.3",
|
|
98
|
+
"vitest": "^4.1.5"
|
|
99
|
+
},
|
|
100
|
+
"engines": {
|
|
101
|
+
"node": ">=20"
|
|
102
|
+
},
|
|
103
|
+
"publishConfig": {
|
|
104
|
+
"access": "public"
|
|
105
|
+
},
|
|
106
|
+
"scripts": {
|
|
107
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
108
|
+
"build": "tsup",
|
|
109
|
+
"type-check": "tsc --noEmit",
|
|
110
|
+
"test": "vitest run --passWithNoTests"
|
|
111
|
+
}
|
|
112
|
+
}
|