@ibgib/core-gib 0.1.21 → 0.1.23
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/common/other/graph-helper.d.mts +8 -0
- package/dist/common/other/graph-helper.d.mts.map +1 -1
- package/dist/common/other/graph-helper.mjs +31 -1
- package/dist/common/other/graph-helper.mjs.map +1 -1
- package/dist/sync/sync-conflict.respec.mjs +31 -28
- package/dist/sync/sync-conflict.respec.mjs.map +1 -1
- package/dist/sync/sync-constants.d.mts +21 -11
- package/dist/sync/sync-constants.d.mts.map +1 -1
- package/dist/sync/sync-constants.mjs +18 -6
- package/dist/sync/sync-constants.mjs.map +1 -1
- package/dist/sync/sync-helpers.d.mts +24 -15
- package/dist/sync/sync-helpers.d.mts.map +1 -1
- package/dist/sync/sync-helpers.mjs +163 -92
- package/dist/sync/sync-helpers.mjs.map +1 -1
- package/dist/sync/sync-innerspace-constants.respec.mjs +12 -7
- package/dist/sync/sync-innerspace-constants.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs +12 -7
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs +15 -10
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs +13 -7
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-partial-update.respec.mjs +15 -7
- package/dist/sync/sync-innerspace-partial-update.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace.respec.mjs +13 -7
- package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-constants.d.mts +2 -0
- package/dist/sync/sync-peer/sync-peer-constants.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-constants.mjs +2 -0
- package/dist/sync/sync-peer/sync-peer-constants.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-helpers.d.mts +2 -0
- package/dist/sync/sync-peer/sync-peer-helpers.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-helpers.mjs +2 -0
- package/dist/sync/sync-peer/sync-peer-helpers.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.d.mts +8 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mjs +8 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-helpers.d.mts +18 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-helpers.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-helpers.mjs +54 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-helpers.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts +65 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.mjs +5 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts +44 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +183 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts +28 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +51 -9
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +244 -26
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +26 -10
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +119 -30
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts +31 -22
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-types.mjs +1 -9
- package/dist/sync/sync-saga-context/sync-saga-context-types.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +81 -87
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +627 -571
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts +105 -22
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts.map +1 -1
- package/dist/sync/sync-types.d.mts +56 -76
- package/dist/sync/sync-types.d.mts.map +1 -1
- package/dist/sync/sync-types.mjs +5 -0
- package/dist/sync/sync-types.mjs.map +1 -1
- package/dist/timeline/timeline-api.d.mts.map +1 -1
- package/dist/timeline/timeline-api.mjs +15 -8
- package/dist/timeline/timeline-api.mjs.map +1 -1
- package/dist/witness/light-witness-base-v1.d.mts.map +1 -1
- package/dist/witness/light-witness-base-v1.mjs +2 -0
- package/dist/witness/light-witness-base-v1.mjs.map +1 -1
- package/dist/witness/space/inner-space/inner-space-v1.mjs +1 -1
- package/dist/witness/space/inner-space/inner-space-v1.mjs.map +1 -1
- package/package.json +1 -1
- package/src/common/other/graph-helper.mts +26 -1
- package/src/sync/README.md +31 -22
- package/src/sync/sync-conflict.respec.mts +31 -26
- package/src/sync/sync-constants.mts +19 -9
- package/src/sync/sync-helpers.mts +173 -97
- package/src/sync/sync-innerspace-constants.respec.mts +12 -7
- package/src/sync/sync-innerspace-deep-updates.respec.mts +12 -7
- package/src/sync/sync-innerspace-dest-ahead.respec.mts +14 -9
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +13 -7
- package/src/sync/sync-innerspace-partial-update.respec.mts +15 -7
- package/src/sync/sync-innerspace.respec.mts +13 -7
- package/src/sync/sync-peer/sync-peer-constants.mts +0 -0
- package/src/sync/sync-peer/sync-peer-helpers.mts +0 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-constants.mts +8 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-helpers.mts +72 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.mts +72 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +193 -0
- package/src/sync/sync-peer/sync-peer-types.mts +30 -1
- package/src/sync/sync-peer/sync-peer-v1.mts +229 -30
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +140 -43
- package/src/sync/sync-saga-context/sync-saga-context-types.mts +34 -30
- package/src/sync/sync-saga-coordinator.mts +678 -660
- package/src/sync/sync-saga-message/sync-saga-message-types.mts +106 -22
- package/src/sync/sync-types.mts +59 -87
- package/src/timeline/timeline-api.mts +17 -10
- package/src/witness/light-witness-base-v1.mts +2 -1
- package/src/witness/space/inner-space/inner-space-v1.mts +1 -1
- package/test_output.log +0 -0
- package/tmp.md +62 -44
- package/dist/sync/sync-local-spaces.respec.d.mts +0 -2
- package/dist/sync/sync-local-spaces.respec.d.mts.map +0 -1
- package/dist/sync/sync-local-spaces.respec.mjs +0 -159
- package/dist/sync/sync-local-spaces.respec.mjs.map +0 -1
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.d.mts +0 -42
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.d.mts.map +0 -1
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.mjs +0 -194
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.mjs.map +0 -1
- package/dist/sync/sync-saga-coordinator.respec.d.mts +0 -2
- package/dist/sync/sync-saga-coordinator.respec.d.mts.map +0 -1
- package/dist/sync/sync-saga-coordinator.respec.mjs +0 -40
- package/dist/sync/sync-saga-coordinator.respec.mjs.map +0 -1
- package/src/sync/sync-local-spaces.respec.mts +0 -200
- package/src/sync/sync-peer/sync-peer-innerspace-v1.mts +0 -240
- package/src/sync/sync-saga-coordinator.respec.mts +0 -52
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module sync saga context helpers
|
|
3
3
|
*/
|
|
4
|
-
import { extractErrorMsg } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
4
|
+
import { extractErrorMsg, getTimestamp } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
5
5
|
import { Factory_V1 } from '@ibgib/ts-gib/dist/V1/factory.mjs';
|
|
6
6
|
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
7
|
+
import { validateIbGibIntrinsically } from '@ibgib/ts-gib/dist/V1/validate-helper.mjs';
|
|
8
|
+
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
|
|
7
9
|
import { SYNC_SAGA_CONTEXT_ATOM } from './sync-saga-context-constants.mjs';
|
|
8
|
-
import {
|
|
10
|
+
import { SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN } from '../sync-constants.mjs';
|
|
11
|
+
import { putInSpace, registerNewIbGib } from '../../witness/space/space-helper.mjs';
|
|
12
|
+
const logalot = GLOBAL_LOG_A_LOT;
|
|
9
13
|
/**
|
|
10
14
|
* Constructs the standard 'ib' string for a Sync Saga Context stone.
|
|
11
15
|
*/
|
|
@@ -15,11 +19,11 @@ export async function getSyncSagaContextIb({ data, }) {
|
|
|
15
19
|
if (!data) {
|
|
16
20
|
throw new Error(`data required (E: 839d82138c234b3e89582855594191fe)`);
|
|
17
21
|
}
|
|
18
|
-
const
|
|
22
|
+
const payloadCount = data['@payloadAddrsDomain'] ? data['@payloadAddrsDomain'].length : 0;
|
|
19
23
|
// sync_sagacontext cmd
|
|
20
24
|
const ib = [
|
|
21
25
|
SYNC_SAGA_CONTEXT_ATOM,
|
|
22
|
-
|
|
26
|
+
payloadCount,
|
|
23
27
|
].join(' ');
|
|
24
28
|
return ib;
|
|
25
29
|
}
|
|
@@ -35,15 +39,21 @@ export async function parseSyncSagaContextIb({ ib, }) {
|
|
|
35
39
|
const lc = `[${parseSyncSagaContextIb.name}]`;
|
|
36
40
|
try {
|
|
37
41
|
const parts = ib.split(' ');
|
|
38
|
-
if (parts.length
|
|
39
|
-
throw new Error(`Invalid sync saga context ib. Expected at least 2 parts [atom
|
|
42
|
+
if (parts.length !== 2) {
|
|
43
|
+
throw new Error(`Invalid sync saga context ib. Expected at least 2 parts [atom, payloadCount]. Got ${parts.length}. (E: 8b06c88820c74f5fb9f21f148459422a)`);
|
|
40
44
|
}
|
|
41
|
-
const [atom,
|
|
42
|
-
const cmd = rest.join(' '); // cmd might have spaces if it's not a strict enum? but usually single word key.
|
|
45
|
+
const [atom, payloadCountStr,] = parts;
|
|
43
46
|
if (atom !== SYNC_SAGA_CONTEXT_ATOM) {
|
|
44
47
|
throw new Error(`Atom mismatch. Expected ${SYNC_SAGA_CONTEXT_ATOM}. Got ${atom}. (E: 67d71fc0f8d04840b178652309f471f5)`);
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
if (!payloadCountStr) {
|
|
50
|
+
throw new Error(`invalid ib. second piece should be payloadCount but is falsy (E: 0bb7580793d800ca02227828a7294826)`);
|
|
51
|
+
}
|
|
52
|
+
const payloadCount = parseInt(payloadCountStr);
|
|
53
|
+
if (isNaN(payloadCount)) {
|
|
54
|
+
throw new Error(`payloadCountStr is not a number. (E: 49457814282a44069871630987588722)`);
|
|
55
|
+
}
|
|
56
|
+
return { atom, payloadCount };
|
|
47
57
|
}
|
|
48
58
|
catch (error) {
|
|
49
59
|
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
@@ -51,32 +61,111 @@ export async function parseSyncSagaContextIb({ ib, }) {
|
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
63
|
/**
|
|
54
|
-
* Creates
|
|
64
|
+
* Creates new SyncSagaContext stone. Puts/registers in {@link localSpace}
|
|
65
|
+
* immediately after creation.
|
|
55
66
|
*
|
|
56
67
|
* @returns The context ibGib.
|
|
68
|
+
*
|
|
69
|
+
* ## notes
|
|
70
|
+
*
|
|
71
|
+
* the other ibgibs that are related to this context stone should already be
|
|
72
|
+
* put/registered in {@link localSpace}.
|
|
73
|
+
*/
|
|
74
|
+
export async function createSyncSagaContext({ sagaFrame, sessionKeystones, payloadIbGibsDomain, localSpace, }) {
|
|
75
|
+
const lc = `[${createSyncSagaContext.name}]`;
|
|
76
|
+
try {
|
|
77
|
+
if (logalot) {
|
|
78
|
+
console.log(`${lc} starting... (I: 6b87bee313e811d1d2fc90e87fbec826)`);
|
|
79
|
+
}
|
|
80
|
+
const date = new Date();
|
|
81
|
+
const timestamp = getTimestamp(date);
|
|
82
|
+
const timestampMs = date.getMilliseconds();
|
|
83
|
+
const data = {
|
|
84
|
+
timestamp,
|
|
85
|
+
timestampMs,
|
|
86
|
+
};
|
|
87
|
+
// Domain Payloads
|
|
88
|
+
const payloadAddrsDomain = payloadIbGibsDomain ?
|
|
89
|
+
payloadIbGibsDomain?.map(x => getIbGibAddr({ ibGib: x })) :
|
|
90
|
+
undefined;
|
|
91
|
+
if (payloadAddrsDomain && payloadAddrsDomain.length > 0) {
|
|
92
|
+
data[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN] = payloadAddrsDomain;
|
|
93
|
+
}
|
|
94
|
+
// rel8ns should always have saga frame, sometimes have keystone
|
|
95
|
+
const rel8ns = {
|
|
96
|
+
sagaFrame: [getIbGibAddr({ ibGib: sagaFrame })],
|
|
97
|
+
};
|
|
98
|
+
if (sessionKeystones && sessionKeystones.length > 0) {
|
|
99
|
+
rel8ns.sessionKeystone = sessionKeystones.map(x => getIbGibAddr({ ibGib: x }));
|
|
100
|
+
}
|
|
101
|
+
// Generate standard ib
|
|
102
|
+
const ib = await getSyncSagaContextIb({ data });
|
|
103
|
+
const contextIbGib = await Factory_V1.stone({
|
|
104
|
+
parentPrimitiveIb: SYNC_SAGA_CONTEXT_ATOM,
|
|
105
|
+
ib,
|
|
106
|
+
data,
|
|
107
|
+
rel8ns,
|
|
108
|
+
});
|
|
109
|
+
// put/register immediately. Note that contextIbGib at this point is
|
|
110
|
+
// pure DTO, i.e., only ib, gib, data, rel8ns props.
|
|
111
|
+
await putInSpace({ ibGib: contextIbGib, space: localSpace, });
|
|
112
|
+
await registerNewIbGib({
|
|
113
|
+
ibGib: contextIbGib,
|
|
114
|
+
space: localSpace,
|
|
115
|
+
fnBroadcast: undefined,
|
|
116
|
+
});
|
|
117
|
+
// Attach actual ibgibs for transport (not pure DTO now)
|
|
118
|
+
contextIbGib.sagaFrame = sagaFrame;
|
|
119
|
+
if (payloadIbGibsDomain && payloadIbGibsDomain.length > 0) {
|
|
120
|
+
contextIbGib.payloadIbGibsDomain = payloadIbGibsDomain;
|
|
121
|
+
}
|
|
122
|
+
return contextIbGib;
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
if (logalot) {
|
|
130
|
+
console.log(`${lc} complete.`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* move to sync-peer-helpers.mts as a pure function?
|
|
57
136
|
*/
|
|
58
|
-
export async function
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
137
|
+
export async function validateContext({ context }) {
|
|
138
|
+
const lc = `[${validateContext.name}]`;
|
|
139
|
+
try {
|
|
140
|
+
if (logalot) {
|
|
141
|
+
console.log(`${lc} starting... (I: 7797f8294bd8f7e5089cb722ad468226)`);
|
|
142
|
+
}
|
|
143
|
+
const errors = [];
|
|
144
|
+
// validate just the context first. if this fails we return early.
|
|
145
|
+
const intrinsicErrors = await validateIbGibIntrinsically({ ibGib: context });
|
|
146
|
+
if (intrinsicErrors && intrinsicErrors.length > 0) {
|
|
147
|
+
intrinsicErrors.forEach(x => errors.push(x));
|
|
148
|
+
return errors; /* <<<< returns early */
|
|
149
|
+
}
|
|
150
|
+
if (context.sagaFrame) {
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
errors.push(`context.sagaFrame is falsy. (E: b4edd88f4963f493789f83b29ba2df26)`);
|
|
154
|
+
}
|
|
155
|
+
// validate the entire context graph intrinsically, including saga frame, stones, identity(s) (if applicable but not authentication, that will be done in a separate step)
|
|
156
|
+
// ensure the non-dto properties on the context object (i.e. props
|
|
157
|
+
// that are not ib, gib, data, or rel8ns) match the data in the
|
|
158
|
+
// context object
|
|
159
|
+
throw new Error(`not implemented (E: cb639658e1183fa6c8a4ebca023ba926)`);
|
|
64
160
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
161
|
+
catch (error) {
|
|
162
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
163
|
+
throw error;
|
|
68
164
|
}
|
|
69
|
-
|
|
70
|
-
|
|
165
|
+
finally {
|
|
166
|
+
if (logalot) {
|
|
167
|
+
console.log(`${lc} complete.`);
|
|
168
|
+
}
|
|
71
169
|
}
|
|
72
|
-
// Generate standard ib
|
|
73
|
-
const ib = await getSyncSagaContextIb({ data });
|
|
74
|
-
const contextIbGib = await Factory_V1.stone({
|
|
75
|
-
parentPrimitiveIb: SYNC_SAGA_CONTEXT_ATOM,
|
|
76
|
-
ib,
|
|
77
|
-
data,
|
|
78
|
-
rel8ns,
|
|
79
|
-
});
|
|
80
|
-
return contextIbGib;
|
|
81
170
|
}
|
|
82
171
|
//# sourceMappingURL=sync-saga-context-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-saga-context-helpers.mjs","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-helpers.mts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-saga-context-helpers.mjs","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-helpers.mts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAMvE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGpF,MAAM,OAAO,GAAG,gBAAgB,CAAC;AA0BjC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACvC,IAAI,GAGP;IACG,MAAM,EAAE,GAAG,IAAI,oBAAoB,CAAC,IAAI,GAAG,CAAC;IAC5C,IAAI,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QAAC,CAAC;QAEtF,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB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dist/V1/types.mjs';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
export type SyncSagaContextCmd = 'process' | 'ping';
|
|
11
|
-
export declare const SyncSagaContextCmd: {
|
|
12
|
-
process: SyncSagaContextCmd;
|
|
13
|
-
ping: SyncSagaContextCmd;
|
|
14
|
-
};
|
|
15
|
-
export declare const SYNC_SAGA_CONTEXT_CMD_VALID_VALUES: SyncSagaContextCmd[];
|
|
16
|
-
export declare function isValidSyncSagaContextCmd(cmd: string): cmd is SyncSagaContextCmd;
|
|
6
|
+
import { SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN } from '../sync-constants.mjs';
|
|
7
|
+
import { SyncIbGib_V1 } from '../sync-types.mjs';
|
|
8
|
+
import { SYNC_SAGA_CONTEXT_ATOM } from './sync-saga-context-constants.mjs';
|
|
17
9
|
export interface SyncSagaContextIb_V1 {
|
|
18
|
-
atom:
|
|
19
|
-
|
|
10
|
+
atom: typeof SYNC_SAGA_CONTEXT_ATOM;
|
|
11
|
+
/**
|
|
12
|
+
* simple metadata count of data["@payloadAddrsDomain"]
|
|
13
|
+
*/
|
|
14
|
+
payloadCount: number;
|
|
20
15
|
}
|
|
21
16
|
/**
|
|
22
17
|
* Data payload for the Sync Saga Context.
|
|
23
18
|
*/
|
|
24
19
|
export interface SyncSagaContextData_V1 extends IbGibData_V1 {
|
|
25
20
|
/**
|
|
26
|
-
*
|
|
27
|
-
* e.g. "process", "ping".
|
|
28
|
-
*/
|
|
29
|
-
cmd?: SyncSagaContextCmd | string;
|
|
30
|
-
/**
|
|
31
|
-
* Payload data (ibGibs) being transported in this context (e.g. for Delta stage).
|
|
21
|
+
* Payload data addresses for DOMAIN ibGibs (Timeline frames, user content).
|
|
32
22
|
* Soft-linked via data property to avoid hard-linking graph dependencies.
|
|
33
23
|
*/
|
|
34
|
-
[
|
|
24
|
+
[SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN]?: IbGibAddr[];
|
|
35
25
|
}
|
|
36
26
|
/**
|
|
37
27
|
* Relationships for the Sync Saga Context.
|
|
@@ -40,12 +30,18 @@ export interface SyncSagaContextData_V1 extends IbGibData_V1 {
|
|
|
40
30
|
export interface SyncSagaContextRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
41
31
|
/**
|
|
42
32
|
* The primary Saga Frame being transported (Init, Ack, Delta, etc.).
|
|
43
|
-
*
|
|
33
|
+
*
|
|
34
|
+
* Should be a single addr.
|
|
44
35
|
*/
|
|
45
|
-
sagaFrame
|
|
36
|
+
sagaFrame: IbGibAddr[];
|
|
46
37
|
/**
|
|
47
38
|
* The Ephemeral Session Keystone Identity used for this saga.
|
|
48
39
|
* Required for validating the saga frame signature.
|
|
40
|
+
*
|
|
41
|
+
* ## notes
|
|
42
|
+
*
|
|
43
|
+
* This will be different for the sender and receiver, yes? hmm...
|
|
44
|
+
* I think I need to put "sender" or "receiver" in the session keystone ib.
|
|
49
45
|
*/
|
|
50
46
|
sessionKeystone?: IbGibAddr[];
|
|
51
47
|
}
|
|
@@ -54,5 +50,18 @@ export interface SyncSagaContextRel8ns_V1 extends IbGibRel8ns_V1 {
|
|
|
54
50
|
* between Sync Peers.
|
|
55
51
|
*/
|
|
56
52
|
export interface SyncSagaContextIbGib_V1 extends IbGib_V1<SyncSagaContextData_V1, SyncSagaContextRel8ns_V1> {
|
|
53
|
+
/**
|
|
54
|
+
* Domain ibgibs - OUTBOUND only.
|
|
55
|
+
*
|
|
56
|
+
* For inbound, the domain payload ibgibs are streamed via observable in the
|
|
57
|
+
* peer.
|
|
58
|
+
*/
|
|
59
|
+
payloadIbGibsDomain?: IbGib_V1[];
|
|
60
|
+
/**
|
|
61
|
+
* Reference to the actual sync saga frame that this context conveys.
|
|
62
|
+
*
|
|
63
|
+
* This frame's addr should be {@link SyncSagaContextRel8ns_V1.sagaFrame}.
|
|
64
|
+
*/
|
|
65
|
+
sagaFrame: SyncIbGib_V1;
|
|
57
66
|
}
|
|
58
67
|
//# sourceMappingURL=sync-saga-context-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-saga-context-types.d.mts","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-types.mts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-saga-context-types.d.mts","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-types.mts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,sBAAsB,CAAC;IACpC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IACxD;;;OAGG;IACH,CAAC,8BAA8B,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC5D;;;;OAIG;IACH,SAAS,EAAE,SAAS,EAAE,CAAC;IAEvB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,SAAS,EAAE,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,QAAQ,CAAC,sBAAsB,EAAE,wBAAwB,CAAC;IACvG;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEjC;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;CAC3B"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module sync saga context types
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
export const SyncSagaContextCmd = {
|
|
6
|
-
process: 'process',
|
|
7
|
-
ping: 'ping',
|
|
8
|
-
};
|
|
9
|
-
export const SYNC_SAGA_CONTEXT_CMD_VALID_VALUES = Object.values(SyncSagaContextCmd);
|
|
10
|
-
export function isValidSyncSagaContextCmd(cmd) {
|
|
11
|
-
return SYNC_SAGA_CONTEXT_CMD_VALID_VALUES.includes(cmd);
|
|
12
|
-
}
|
|
4
|
+
import { SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN } from '../sync-constants.mjs';
|
|
13
5
|
//# sourceMappingURL=sync-saga-context-types.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-saga-context-types.mjs","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-types.mts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"sync-saga-context-types.mjs","sourceRoot":"","sources":["../../../src/sync/sync-saga-context/sync-saga-context-types.mts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -4,12 +4,13 @@ import { KeystoneIbGib_V1 } from "../keystone/keystone-types.mjs";
|
|
|
4
4
|
import { KeystoneService_V1 } from "../keystone/keystone-service-v1.mjs";
|
|
5
5
|
import { MetaspaceService } from "../witness/space/metaspace/metaspace-types.mjs";
|
|
6
6
|
import { SyncStage } from "./sync-constants.mjs";
|
|
7
|
-
import { SyncIbGib_V1, SyncConflictStrategy, SyncOptions } from "./sync-types.mjs";
|
|
8
|
-
import { SyncSagaMessageData_V1 } from "./sync-saga-message/sync-saga-message-types.mjs";
|
|
7
|
+
import { SyncIbGib_V1, SyncConflictStrategy, SyncOptions, DomainIbGibAnalysisInfo, HandleSagaFrameResult } from "./sync-types.mjs";
|
|
8
|
+
import { SyncSagaMessageData_V1, SyncSagaMessageInitData_V1 } from "./sync-saga-message/sync-saga-message-types.mjs";
|
|
9
9
|
import { SyncSagaInfo } from "./sync-types.mjs";
|
|
10
10
|
import { SyncPeerWitness } from "./sync-peer/sync-peer-types.mjs";
|
|
11
11
|
import { SyncSagaContextIbGib_V1 } from "./sync-saga-context/sync-saga-context-types.mjs";
|
|
12
12
|
import { SubjectWitness } from "../common/pubsub/subject/subject-types.mjs";
|
|
13
|
+
import { FlatIbGibGraph } from "../common/other/graph-types.mjs";
|
|
13
14
|
/**
|
|
14
15
|
* Orchestrates the synchronization process between two spaces (Source and Destination).
|
|
15
16
|
*
|
|
@@ -40,7 +41,7 @@ export declare class SyncSagaCoordinator {
|
|
|
40
41
|
* @param opts.domainIbGibs - The root ibgibs defining the scope of the sync.
|
|
41
42
|
* @param opts.useSessionIdentity - (Optional) Whether to create an ephemeral session identity. Default: true.
|
|
42
43
|
*/
|
|
43
|
-
sync({ peer,
|
|
44
|
+
sync({ peer, domainIbGibs, conflictStrategy, useSessionIdentity, metaspace, localSpace, }: SyncOptions): Promise<SyncSagaInfo>;
|
|
44
45
|
protected getSessionIdentity({ sagaId, metaspace, tempSpace, }: {
|
|
45
46
|
sagaId: string;
|
|
46
47
|
metaspace: MetaspaceService;
|
|
@@ -53,26 +54,24 @@ export declare class SyncSagaCoordinator {
|
|
|
53
54
|
* **Execution Context**: **Sender (Local)**.
|
|
54
55
|
*
|
|
55
56
|
* This method manages the "Ping Pong" request-response cycle on the Sender.
|
|
56
|
-
* It sends frames via the Peer Witness and processes the responses using `
|
|
57
|
+
* It sends frames via the Peer Witness and processes the responses using `handleSagaResponseContext`.
|
|
57
58
|
*
|
|
58
59
|
* **Data Transport Note**:
|
|
59
60
|
* Actual ibGib data (payloads) are transported via `SyncSagaContext.rel8ns.payload`.
|
|
60
|
-
* When `
|
|
61
|
+
* When `handleSagaResponseContext` returns a `nextPayloadIbGibs` (data to send), this loop injects it into
|
|
61
62
|
* the NEXT request context.
|
|
62
63
|
* When the Peer responds with data (in the response context), it is resolved and put into `tempSpace`.
|
|
63
64
|
*/
|
|
64
|
-
protected executeSagaLoop({ initialFrame,
|
|
65
|
+
protected executeSagaLoop({ initialFrame, initialDomainGraph, peer, sessionIdentity, updates$, localSpace, tempSpace, metaspace }: {
|
|
65
66
|
initialFrame: SyncIbGib_V1;
|
|
66
|
-
|
|
67
|
-
[addr: string]: IbGib_V1;
|
|
68
|
-
};
|
|
67
|
+
initialDomainGraph: FlatIbGibGraph;
|
|
69
68
|
peer: SyncPeerWitness;
|
|
70
69
|
sessionIdentity?: KeystoneIbGib_V1;
|
|
71
70
|
updates$: SubjectWitness<SyncSagaContextIbGib_V1>;
|
|
71
|
+
metaspace: MetaspaceService;
|
|
72
72
|
localSpace: IbGibSpaceAny;
|
|
73
73
|
tempSpace: IbGibSpaceAny;
|
|
74
|
-
|
|
75
|
-
}): Promise<IbGib_V1[]>;
|
|
74
|
+
}): Promise<void>;
|
|
76
75
|
/**
|
|
77
76
|
* Helper to get Knowledge Vector for specific domain ibGibs or TJPs.
|
|
78
77
|
* Useful for testing and external validation.
|
|
@@ -85,19 +84,10 @@ export declare class SyncSagaCoordinator {
|
|
|
85
84
|
}): Promise<{
|
|
86
85
|
[tjp: string]: string | null;
|
|
87
86
|
}>;
|
|
88
|
-
protected
|
|
87
|
+
protected analyzeDomainIbGibs({ domainIbGibs, space, }: {
|
|
89
88
|
domainIbGibs: IbGib_V1[];
|
|
90
89
|
space: IbGibSpaceAny;
|
|
91
|
-
}): Promise<
|
|
92
|
-
srcStones: IbGib_V1[];
|
|
93
|
-
srcTimelinesMap: {
|
|
94
|
-
[tjp: string]: IbGib_V1[];
|
|
95
|
-
};
|
|
96
|
-
srcSortedTjps: string[];
|
|
97
|
-
srcGraph: {
|
|
98
|
-
[addr: string]: IbGib_V1;
|
|
99
|
-
};
|
|
100
|
-
}>;
|
|
90
|
+
}): Promise<DomainIbGibAnalysisInfo>;
|
|
101
91
|
/**
|
|
102
92
|
* Creates the Initial Saga Frame (Init Stage).
|
|
103
93
|
*
|
|
@@ -107,48 +97,66 @@ export declare class SyncSagaCoordinator {
|
|
|
107
97
|
* Generates the first frame containing the Knowledge Vector of the Local Space.
|
|
108
98
|
* This is sent to the Receiver to begin Gap Analysis.
|
|
109
99
|
*/
|
|
110
|
-
protected createInitFrame({ sagaId, sessionIdentity,
|
|
100
|
+
protected createInitFrame({ sagaId, sessionIdentity, domainIbGibs, conflictStrategy, metaspace, localSpace, tempSpace, }: {
|
|
111
101
|
sagaId: string;
|
|
112
102
|
sessionIdentity?: KeystoneIbGib_V1;
|
|
113
|
-
localSpace: IbGibSpaceAny;
|
|
114
103
|
domainIbGibs: IbGib_V1[];
|
|
115
|
-
tempSpace: IbGibSpaceAny;
|
|
116
|
-
metaspace: MetaspaceService;
|
|
117
104
|
conflictStrategy: SyncConflictStrategy;
|
|
105
|
+
metaspace: MetaspaceService;
|
|
106
|
+
localSpace: IbGibSpaceAny;
|
|
107
|
+
tempSpace: IbGibSpaceAny;
|
|
118
108
|
}): Promise<{
|
|
119
109
|
sagaFrame: SyncIbGib_V1;
|
|
120
|
-
|
|
110
|
+
initialDomainGraph: {
|
|
121
111
|
[addr: string]: IbGib_V1;
|
|
122
112
|
};
|
|
123
113
|
}>;
|
|
124
114
|
/**
|
|
125
|
-
*
|
|
115
|
+
* Helper to poll for streaming domain payloads and put them in the
|
|
116
|
+
* local {@link tempSpace}.
|
|
126
117
|
*
|
|
127
|
-
* @
|
|
128
|
-
|
|
118
|
+
* @returns when all {@link expectedAddrs} are done being transmitted.
|
|
119
|
+
*/
|
|
120
|
+
protected pollForDomainPayloads({ expectedAddrs, pollIntervalMs, domainPayloadsMap, tempSpace, }: {
|
|
121
|
+
expectedAddrs: string[];
|
|
122
|
+
pollIntervalMs: number;
|
|
123
|
+
domainPayloadsMap: Map<string, IbGib_V1>;
|
|
124
|
+
tempSpace: IbGibSpaceAny;
|
|
125
|
+
}): Promise<IbGib_V1[]>;
|
|
126
|
+
/**
|
|
127
|
+
* This is the heart of the "ping pong" transaction, where we send a context
|
|
128
|
+
* and receive a context. IOW, this drives the FSM of the sync saga ibgib as
|
|
129
|
+
* a whole.
|
|
130
|
+
*
|
|
131
|
+
* This is called in two places:
|
|
132
|
+
*
|
|
133
|
+
* ## 1. Sender
|
|
134
|
+
*
|
|
135
|
+
* On the sender, this is called within the {@link executeSagaLoop} which
|
|
136
|
+
* initiates and drives the sync.
|
|
129
137
|
*
|
|
130
|
-
*
|
|
131
|
-
* based on the incoming frame and delegates to the appropriate handler.
|
|
138
|
+
* ## 2. Receiver
|
|
132
139
|
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
140
|
+
* On the receiver, this is called directly by the receiving endpoint. That
|
|
141
|
+
* endpoint's job is basically to get these things collocated and prepared
|
|
142
|
+
* to make this call.
|
|
143
|
+
*
|
|
144
|
+
* This is a one-off on the receiver.
|
|
136
145
|
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
handleSagaContext({ sagaContext, mySpace, myTempSpace, identity, identitySecret, metaspace, }: {
|
|
147
|
+
sagaContext: SyncSagaContextIbGib_V1;
|
|
148
|
+
/**
|
|
149
|
+
* Local space relative to the execution context's POV
|
|
150
|
+
*/
|
|
151
|
+
mySpace: IbGibSpaceAny;
|
|
152
|
+
/**
|
|
153
|
+
* Local temp space relative to the execution context's POV
|
|
154
|
+
*/
|
|
155
|
+
myTempSpace: IbGibSpaceAny;
|
|
144
156
|
identity?: KeystoneIbGib_V1;
|
|
145
157
|
identitySecret?: string;
|
|
146
158
|
metaspace: MetaspaceService;
|
|
147
|
-
}): Promise<
|
|
148
|
-
frame: SyncIbGib_V1;
|
|
149
|
-
payloadIbGibs?: IbGib_V1[];
|
|
150
|
-
receivedPayloadIbGibs?: IbGib_V1[];
|
|
151
|
-
} | null>;
|
|
159
|
+
}): Promise<HandleSagaFrameResult | null>;
|
|
152
160
|
/**
|
|
153
161
|
* Handles the `Init` frame.
|
|
154
162
|
*
|
|
@@ -161,18 +169,24 @@ export declare class SyncSagaCoordinator {
|
|
|
161
169
|
* 3. Identifies what Receiver needs (`deltaReqAddrs`).
|
|
162
170
|
* 4. Returns an `Ack` frame containing these lists.
|
|
163
171
|
*/
|
|
164
|
-
protected handleInitFrame({ sagaIbGib, messageData,
|
|
172
|
+
protected handleInitFrame({ sagaIbGib, messageData, mySpace, myTempSpace, metaspace, identity, }: {
|
|
165
173
|
sagaIbGib: SyncIbGib_V1;
|
|
166
|
-
messageData:
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
messageData: SyncSagaMessageInitData_V1;
|
|
175
|
+
/**
|
|
176
|
+
* Local space relative to the execution context's POV
|
|
177
|
+
*/
|
|
178
|
+
mySpace: IbGibSpaceAny;
|
|
179
|
+
/**
|
|
180
|
+
* Local temp space relative to the execution context's POV.
|
|
181
|
+
*
|
|
182
|
+
* NOTE: Since this always executes on the receiver's end, this should
|
|
183
|
+
* be the receiver's temp space.
|
|
184
|
+
*/
|
|
185
|
+
myTempSpace: IbGibSpaceAny;
|
|
169
186
|
metaspace: MetaspaceService;
|
|
170
187
|
identity?: KeystoneIbGib_V1;
|
|
171
188
|
identitySecret?: string;
|
|
172
|
-
}): Promise<
|
|
173
|
-
frame: SyncIbGib_V1;
|
|
174
|
-
payloadIbGibs?: IbGib_V1[];
|
|
175
|
-
} | null>;
|
|
189
|
+
}): Promise<HandleSagaFrameResult | null>;
|
|
176
190
|
/**
|
|
177
191
|
* Handles the `Ack` frame.
|
|
178
192
|
*
|
|
@@ -194,10 +208,7 @@ export declare class SyncSagaCoordinator {
|
|
|
194
208
|
tempSpace: IbGibSpaceAny;
|
|
195
209
|
metaspace: MetaspaceService;
|
|
196
210
|
identity?: KeystoneIbGib_V1;
|
|
197
|
-
}): Promise<
|
|
198
|
-
frame: SyncIbGib_V1;
|
|
199
|
-
payloadIbGibs?: IbGib_V1[];
|
|
200
|
-
} | null>;
|
|
211
|
+
}): Promise<HandleSagaFrameResult | null>;
|
|
201
212
|
/**
|
|
202
213
|
* Handles the `Delta` frame.
|
|
203
214
|
*
|
|
@@ -217,53 +228,36 @@ export declare class SyncSagaCoordinator {
|
|
|
217
228
|
tempSpace: IbGibSpaceAny;
|
|
218
229
|
metaspace: MetaspaceService;
|
|
219
230
|
identity?: KeystoneIbGib_V1;
|
|
220
|
-
}): Promise<
|
|
221
|
-
frame: SyncIbGib_V1;
|
|
222
|
-
payloadIbGibs?: IbGib_V1[];
|
|
223
|
-
receivedPayloadIbGibs?: IbGib_V1[];
|
|
224
|
-
} | null>;
|
|
231
|
+
}): Promise<HandleSagaFrameResult | null>;
|
|
225
232
|
protected handleCommitFrame({ sagaIbGib, destSpace, tempSpace, metaspace, identity, }: {
|
|
226
233
|
sagaIbGib: SyncIbGib_V1;
|
|
227
234
|
destSpace: IbGibSpaceAny;
|
|
228
235
|
tempSpace: IbGibSpaceAny;
|
|
229
236
|
metaspace: MetaspaceService;
|
|
230
237
|
identity?: KeystoneIbGib_V1;
|
|
231
|
-
}): Promise<
|
|
232
|
-
|
|
233
|
-
payloadIbGibs?: IbGib_V1[];
|
|
234
|
-
} | null>;
|
|
235
|
-
protected createSyncMsgStone<TStoneData extends SyncSagaMessageData_V1>({ data, space, metaspace, }: {
|
|
238
|
+
}): Promise<HandleSagaFrameResult | null>;
|
|
239
|
+
protected createSyncMsgStone<TStoneData extends SyncSagaMessageData_V1>({ data, localSpace, metaspace, }: {
|
|
236
240
|
data: TStoneData;
|
|
237
|
-
|
|
241
|
+
localSpace: IbGibSpaceAny;
|
|
238
242
|
metaspace: MetaspaceService;
|
|
239
243
|
}): Promise<IbGib_V1<TStoneData>>;
|
|
240
|
-
/**
|
|
241
|
-
* Ensures saga frame and its msg stone(s) are in BOTH spaces for audit trail.
|
|
242
|
-
* Control ibgibs (saga frames, msg stones, identity) must be in both destSpace and tempSpace.
|
|
243
|
-
*/
|
|
244
|
-
protected ensureSagaFrameInBothSpaces({ frame, destSpace, tempSpace, metaspace, }: {
|
|
245
|
-
frame: SyncIbGib_V1;
|
|
246
|
-
destSpace: IbGibSpaceAny;
|
|
247
|
-
tempSpace: IbGibSpaceAny;
|
|
248
|
-
metaspace: MetaspaceService;
|
|
249
|
-
}): Promise<void>;
|
|
250
244
|
/**
|
|
251
245
|
* Evolves the saga timeline with a new frame.
|
|
252
246
|
*/
|
|
253
|
-
protected evolveSyncSagaIbGib({ prevSagaIbGib, msgStones,
|
|
247
|
+
protected evolveSyncSagaIbGib({ prevSagaIbGib, conflictStrategy, msgStones, sessionIdentity, localSpace, metaspace, }: {
|
|
254
248
|
prevSagaIbGib?: SyncIbGib_V1;
|
|
249
|
+
conflictStrategy?: SyncConflictStrategy;
|
|
255
250
|
msgStones: IbGib_V1[];
|
|
256
|
-
|
|
257
|
-
space: IbGibSpaceAny;
|
|
251
|
+
localSpace: IbGibSpaceAny;
|
|
258
252
|
metaspace: MetaspaceService;
|
|
259
|
-
|
|
253
|
+
sessionIdentity?: KeystoneIbGib_V1;
|
|
260
254
|
}): Promise<SyncIbGib_V1>;
|
|
261
|
-
protected getStageAndPayloadFromFrame({
|
|
262
|
-
|
|
255
|
+
protected getStageAndPayloadFromFrame({ sagaFrame, space }: {
|
|
256
|
+
sagaFrame: IbGib_V1;
|
|
263
257
|
space: IbGibSpaceAny;
|
|
264
258
|
}): Promise<{
|
|
265
259
|
stage: SyncStage;
|
|
266
|
-
messageData:
|
|
260
|
+
messageData: unknown;
|
|
267
261
|
}>;
|
|
268
262
|
protected sortTimelinesTopologically(timelines: {
|
|
269
263
|
[tjp: string]: IbGib_V1[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-saga-coordinator.d.mts","sourceRoot":"","sources":["../../src/sync/sync-saga-coordinator.mts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-saga-coordinator.d.mts","sourceRoot":"","sources":["../../src/sync/sync-saga-coordinator.mts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAG,MAAM,iCAAiC,CAAC;AAI5D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,SAAS,EAAkE,MAAM,sBAAsB,CAAC;AAEjH,OAAO,EACU,YAAY,EAAE,oBAAoB,EAAY,WAAW,EACvD,uBAAuB,EAAE,qBAAqB,EAChE,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACH,sBAAsB,EAAE,0BAA0B,EAGrD,MAAM,iDAAiD,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAG,MAAM,iDAAiD,CAAC;AAG3F,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAQ5E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQjE;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAmB;IAIxB,SAAS,CAAC,QAAQ,EAAE,kBAAkB;IAH1C,SAAS,CAAC,EAAE,EAAE,MAAM,CAAmC;gBAGzC,QAAQ,EAAE,kBAAkB;IAK1C;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,EACP,IAAI,EACJ,YAAY,EACZ,gBAA6C,EAC7C,kBAAyB,EACzB,SAAS,EACT,UAAU,GACb,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;cA0FtB,kBAAkB,CAAC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