jazz-tools 0.9.10-jazz-bridge-preview.0 → 0.9.10
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +4 -2
- package/dist/{chunk-YWGGIF2U.js → chunk-ICWP2U63.js} +79 -147
- package/dist/chunk-ICWP2U63.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.web.js +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -3
- package/src/coValues/coList.ts +1 -14
- package/src/coValues/coMap.ts +0 -54
- package/src/coValues/coRichText.ts +1 -0
- package/src/coValues/interfaces.ts +0 -10
- package/src/exports.ts +1 -6
- package/src/implementation/createContext.ts +86 -109
- package/src/tests/coList.test.ts +0 -20
- package/.turbo/turbo-lint.log +0 -4
- package/.turbo/turbo-test.log +0 -144
- package/dist/chunk-YWGGIF2U.js.map +0 -1
package/dist/index.native.js
CHANGED
package/dist/index.web.js
CHANGED
package/dist/testing.js
CHANGED
package/package.json
CHANGED
@@ -23,10 +23,9 @@
|
|
23
23
|
},
|
24
24
|
"type": "module",
|
25
25
|
"license": "MIT",
|
26
|
-
"version": "0.9.10
|
26
|
+
"version": "0.9.10",
|
27
27
|
"dependencies": {
|
28
|
-
"
|
29
|
-
"cojson": "0.9.9"
|
28
|
+
"cojson": "0.9.10"
|
30
29
|
},
|
31
30
|
"devDependencies": {
|
32
31
|
"tsup": "8.3.5",
|
package/src/coValues/coList.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { JsonValue, RawCoList } from "cojson";
|
2
2
|
import { RawAccount } from "cojson";
|
3
|
-
import { calcPatch } from "fast-myers-diff";
|
4
3
|
import type {
|
5
4
|
CoValue,
|
6
5
|
CoValueClass,
|
@@ -288,6 +287,7 @@ export class CoList<Item = any> extends Array<Item> implements CoValue {
|
|
288
287
|
|
289
288
|
let appendAfter = Math.max(start - 1, 0);
|
290
289
|
for (const item of toRawItems(items as Item[], this._schema[ItemsSym])) {
|
290
|
+
console.log(this._raw.asArray(), appendAfter);
|
291
291
|
this._raw.append(item, appendAfter);
|
292
292
|
appendAfter++;
|
293
293
|
}
|
@@ -295,19 +295,6 @@ export class CoList<Item = any> extends Array<Item> implements CoValue {
|
|
295
295
|
return deleted;
|
296
296
|
}
|
297
297
|
|
298
|
-
applyDiff(other: Item[]) {
|
299
|
-
const current = this._raw.asArray() as Item[];
|
300
|
-
const cmp = isRefEncoded(this._schema[ItemsSym])
|
301
|
-
? (aIdx: number, bIdx: number) =>
|
302
|
-
(current[aIdx] as CoValue).id === (other[bIdx] as CoValue).id
|
303
|
-
: undefined;
|
304
|
-
for (const [from, to, insert] of [
|
305
|
-
...calcPatch(current, other, cmp),
|
306
|
-
].reverse()) {
|
307
|
-
this.splice(from, to - from, ...insert);
|
308
|
-
}
|
309
|
-
}
|
310
|
-
|
311
298
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
312
299
|
toJSON(_key?: string, seenAbove?: ID<CoValue>[]): any[] {
|
313
300
|
const itemDescriptor = this._schema[ItemsSym] as Schema;
|
package/src/coValues/coMap.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import {
|
2
2
|
AgentID,
|
3
|
-
CoValueCore,
|
4
3
|
type CoValueUniqueness,
|
5
4
|
CojsonInternalTypes,
|
6
5
|
type JsonValue,
|
@@ -533,59 +532,6 @@ export class CoMap extends CoValueBase implements CoValue {
|
|
533
532
|
return cojsonInternals.idforHeader(header, crypto) as ID<M>;
|
534
533
|
}
|
535
534
|
|
536
|
-
static async getUnique<M extends CoMap>(
|
537
|
-
this: CoValueClass<M>,
|
538
|
-
unique: CoValueUniqueness["uniqueness"],
|
539
|
-
ownerID: ID<Account> | ID<Group>,
|
540
|
-
as: Account,
|
541
|
-
): Promise<M> {
|
542
|
-
// TODO: this is broken and won't load the CoMap even if it already exists on peers!!
|
543
|
-
|
544
|
-
as ||= activeAccountContext.get();
|
545
|
-
|
546
|
-
const header = {
|
547
|
-
type: "comap" as const,
|
548
|
-
ruleset: {
|
549
|
-
type: "ownedByGroup" as const,
|
550
|
-
group: ownerID,
|
551
|
-
},
|
552
|
-
meta: null,
|
553
|
-
uniqueness: unique,
|
554
|
-
};
|
555
|
-
|
556
|
-
const crypto = as._raw.core.crypto;
|
557
|
-
const id = cojsonInternals.idforHeader(header, crypto) as ID<M>;
|
558
|
-
|
559
|
-
const existingEntry = as._raw.core.node.coValuesStore.get(id);
|
560
|
-
|
561
|
-
if (existingEntry) {
|
562
|
-
if (existingEntry.state.type === "available") {
|
563
|
-
return (this as CoValueClass<M> & typeof CoMap).fromRaw(
|
564
|
-
existingEntry.state.coValue.getCurrentContent(),
|
565
|
-
);
|
566
|
-
} else if (existingEntry.state.type !== "unknown") {
|
567
|
-
throw new Error(
|
568
|
-
`Can't handle intermediate state for unique CoMap: ${existingEntry.state.type}`,
|
569
|
-
);
|
570
|
-
}
|
571
|
-
}
|
572
|
-
|
573
|
-
as._raw.core.node.coValuesStore.setAsAvailable(
|
574
|
-
id,
|
575
|
-
new CoValueCore(header, as._raw.core.node),
|
576
|
-
);
|
577
|
-
|
578
|
-
const entry = as._raw.core.node.coValuesStore.get(id);
|
579
|
-
|
580
|
-
if (entry.state.type !== "available") {
|
581
|
-
throw new Error("CoValue not found");
|
582
|
-
}
|
583
|
-
|
584
|
-
return (this as CoValueClass<M> & typeof CoMap).fromRaw(
|
585
|
-
entry.state.coValue.getCurrentContent(),
|
586
|
-
);
|
587
|
-
}
|
588
|
-
|
589
535
|
/**
|
590
536
|
* Given an already loaded `CoMap`, ensure that the specified fields are loaded to the specified depth.
|
591
537
|
*
|
@@ -27,16 +27,6 @@ export interface CoValueClass<Value extends CoValue = CoValue> {
|
|
27
27
|
new (...args: any[]): Value;
|
28
28
|
}
|
29
29
|
|
30
|
-
export interface CoValueClassWithLoad<V extends CoValue>
|
31
|
-
extends CoValueClass<V> {
|
32
|
-
load<D extends DepthsIn<V>>(id: ID<V>, depth: D): Promise<DeeplyLoaded<V, D>>;
|
33
|
-
load<D extends DepthsIn<V>>(
|
34
|
-
id: ID<V>,
|
35
|
-
as: Account,
|
36
|
-
depth: D,
|
37
|
-
): Promise<DeeplyLoaded<V, D>>;
|
38
|
-
}
|
39
|
-
|
40
30
|
export interface CoValueFromRaw<V extends CoValue> {
|
41
31
|
fromRaw(raw: V["_raw"]): V;
|
42
32
|
}
|
package/src/exports.ts
CHANGED
@@ -41,12 +41,7 @@ export { CoValueBase } from "./coValues/interfaces.js";
|
|
41
41
|
export { Profile } from "./coValues/profile.js";
|
42
42
|
export { SchemaUnion } from "./coValues/schemaUnion.js";
|
43
43
|
|
44
|
-
export type {
|
45
|
-
CoValueClass,
|
46
|
-
CoValueClassWithLoad,
|
47
|
-
DeeplyLoaded,
|
48
|
-
DepthsIn,
|
49
|
-
} from "./internal.js";
|
44
|
+
export type { CoValueClass, DeeplyLoaded, DepthsIn } from "./internal.js";
|
50
45
|
|
51
46
|
export {
|
52
47
|
createCoValueObservable,
|
@@ -128,129 +128,106 @@ export async function createJazzContext<Acc extends Account>(
|
|
128
128
|
): Promise<JazzContext<Acc>>;
|
129
129
|
export async function createJazzContext<Acc extends Account>(
|
130
130
|
options: ContextParamsWithAuth<Acc> | BaseContextParams,
|
131
|
-
): Promise<JazzContext<Acc
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
});
|
139
|
-
}
|
131
|
+
): Promise<JazzContext<Acc> | JazzContextWithAgent> {
|
132
|
+
if (!("auth" in options)) {
|
133
|
+
return createAnonymousJazzContext({
|
134
|
+
peersToLoadFrom: options.peersToLoadFrom,
|
135
|
+
crypto: options.crypto,
|
136
|
+
});
|
137
|
+
}
|
140
138
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
try {
|
147
|
-
authResult = await auth.start(crypto);
|
148
|
-
} catch (e) {
|
149
|
-
console.error("error", e);
|
150
|
-
throw e;
|
151
|
-
}
|
139
|
+
const { auth, sessionProvider, peersToLoadFrom, crypto } = options;
|
140
|
+
const AccountSchema =
|
141
|
+
options.AccountSchema ??
|
142
|
+
(RegisteredSchemas["Account"] as unknown as AccountClass<Acc>);
|
143
|
+
const authResult = await auth.start(crypto);
|
152
144
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
);
|
145
|
+
if (authResult.type === "existing") {
|
146
|
+
const { sessionID, sessionDone } = await sessionProvider(
|
147
|
+
authResult.credentials.accountID,
|
148
|
+
crypto,
|
149
|
+
);
|
159
150
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
}) as Acc;
|
151
|
+
const node = await LocalNode.withLoadedAccount({
|
152
|
+
accountID: authResult.credentials
|
153
|
+
.accountID as unknown as CoID<RawAccount>,
|
154
|
+
accountSecret: authResult.credentials.secret,
|
155
|
+
sessionID: sessionID,
|
156
|
+
peersToLoadFrom: peersToLoadFrom,
|
157
|
+
crypto: crypto,
|
158
|
+
migration: async (rawAccount, _node, creationProps) => {
|
159
|
+
const account = new AccountSchema({
|
160
|
+
fromRaw: rawAccount,
|
161
|
+
}) as Acc;
|
172
162
|
|
173
|
-
|
163
|
+
activeAccountContext.set(account);
|
174
164
|
|
175
|
-
|
176
|
-
|
177
|
-
|
165
|
+
await account.applyMigration(creationProps);
|
166
|
+
},
|
167
|
+
});
|
178
168
|
|
179
|
-
|
180
|
-
|
169
|
+
const account = AccountSchema.fromNode(node);
|
170
|
+
activeAccountContext.set(account);
|
181
171
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
172
|
+
if (authResult.saveCredentials) {
|
173
|
+
await authResult.saveCredentials({
|
174
|
+
accountID: node.account.id as unknown as ID<Account>,
|
175
|
+
secret: node.account.agentSecret,
|
176
|
+
});
|
177
|
+
}
|
188
178
|
|
189
|
-
|
179
|
+
authResult.onSuccess();
|
190
180
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
// TODO: figure out a way to not "waste" the first SessionID
|
215
|
-
const { node } = await LocalNode.withNewlyCreatedAccount({
|
216
|
-
creationProps: authResult.creationProps,
|
217
|
-
peersToLoadFrom: peersToLoadFrom,
|
218
|
-
crypto: crypto,
|
219
|
-
initialAgentSecret: authResult.initialSecret,
|
220
|
-
migration: async (rawAccount, _node, creationProps) => {
|
221
|
-
const account = new AccountSchema({
|
222
|
-
fromRaw: rawAccount,
|
223
|
-
}) as Acc;
|
224
|
-
activeAccountContext.set(account);
|
181
|
+
return {
|
182
|
+
account,
|
183
|
+
done: () => {
|
184
|
+
node.gracefulShutdown();
|
185
|
+
sessionDone();
|
186
|
+
},
|
187
|
+
logOut: () => {
|
188
|
+
node.gracefulShutdown();
|
189
|
+
sessionDone();
|
190
|
+
authResult.logOut();
|
191
|
+
},
|
192
|
+
};
|
193
|
+
} else if (authResult.type === "new") {
|
194
|
+
const { node } = await LocalNode.withNewlyCreatedAccount({
|
195
|
+
creationProps: authResult.creationProps,
|
196
|
+
peersToLoadFrom: peersToLoadFrom,
|
197
|
+
crypto: crypto,
|
198
|
+
initialAgentSecret: authResult.initialSecret,
|
199
|
+
migration: async (rawAccount, _node, creationProps) => {
|
200
|
+
const account = new AccountSchema({
|
201
|
+
fromRaw: rawAccount,
|
202
|
+
}) as Acc;
|
203
|
+
activeAccountContext.set(account);
|
225
204
|
|
226
|
-
|
227
|
-
|
228
|
-
|
205
|
+
await account.applyMigration(creationProps);
|
206
|
+
},
|
207
|
+
});
|
229
208
|
|
230
|
-
|
231
|
-
|
209
|
+
const account = AccountSchema.fromNode(node);
|
210
|
+
activeAccountContext.set(account);
|
232
211
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
212
|
+
await authResult.saveCredentials({
|
213
|
+
accountID: node.account.id as unknown as ID<Account>,
|
214
|
+
secret: node.account.agentSecret,
|
215
|
+
});
|
237
216
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
} catch (e) {
|
250
|
-
authResult.onError(new Error("Error creating account", { cause: e }));
|
251
|
-
}
|
252
|
-
}
|
217
|
+
authResult.onSuccess();
|
218
|
+
return {
|
219
|
+
account,
|
220
|
+
done: () => {
|
221
|
+
node.gracefulShutdown();
|
222
|
+
},
|
223
|
+
logOut: () => {
|
224
|
+
node.gracefulShutdown();
|
225
|
+
authResult.logOut();
|
226
|
+
},
|
227
|
+
};
|
253
228
|
}
|
229
|
+
|
230
|
+
throw new Error("Invalid auth result");
|
254
231
|
}
|
255
232
|
|
256
233
|
export async function createAnonymousJazzContext({
|
package/src/tests/coList.test.ts
CHANGED
@@ -115,26 +115,6 @@ describe("Simple CoList operations", async () => {
|
|
115
115
|
expect(list.length).toBe(4);
|
116
116
|
expect(list._raw.asArray()).toEqual(["bread", "salt", "pepper", "onion"]);
|
117
117
|
});
|
118
|
-
|
119
|
-
test("applyDiff", () => {
|
120
|
-
const list = TestList.create(["bread", "butter", "onion"], {
|
121
|
-
owner: me,
|
122
|
-
});
|
123
|
-
// replace
|
124
|
-
list.applyDiff(["bread", "margarine", "onion"]);
|
125
|
-
expect(list._raw.asArray()).toEqual(["bread", "margarine", "onion"]);
|
126
|
-
// delete
|
127
|
-
list.applyDiff(["bread", "onion"]);
|
128
|
-
expect(list._raw.asArray()).toEqual(["bread", "onion"]);
|
129
|
-
// insert multiple
|
130
|
-
list.applyDiff(["bread", "margarine", "onion", "cheese"]);
|
131
|
-
expect(list._raw.asArray()).toEqual([
|
132
|
-
"bread",
|
133
|
-
"margarine",
|
134
|
-
"onion",
|
135
|
-
"cheese",
|
136
|
-
]);
|
137
|
-
});
|
138
118
|
});
|
139
119
|
});
|
140
120
|
|
package/.turbo/turbo-lint.log
DELETED
package/.turbo/turbo-test.log
DELETED
@@ -1,144 +0,0 @@
|
|
1
|
-
|
2
|
-
> jazz-tools@0.7.35-unique.2 test /Users/anselm/jazz/jazz/packages/jazz-tools
|
3
|
-
> vitest --run
|
4
|
-
|
5
|
-
|
6
|
-
RUN v0.34.6 /Users/anselm/jazz/jazz/packages/jazz-tools
|
7
|
-
|
8
|
-
✓ src/tests/groupsAndAccounts.test.ts (1 test) 64ms
|
9
|
-
stdout | unknown test
|
10
|
-
TestMap schema [90mundefined[39m
|
11
|
-
|
12
|
-
✓ src/tests/deepLoading.test.ts (3 tests) 83ms
|
13
|
-
stdout | src/tests/coList.test.ts > Simple CoList operations > Mutation > splice
|
14
|
-
[ [32m'bread'[39m, [32m'onion'[39m ] [33m0[39m
|
15
|
-
[ [32m'bread'[39m, [32m'salt'[39m, [32m'onion'[39m ] [33m1[39m
|
16
|
-
|
17
|
-
stdout | src/tests/coList.test.ts > CoList resolution > Subscription & auto-resolution
|
18
|
-
subscribedList?.[0]?.[0]?.[0] [90mundefined[39m
|
19
|
-
subscribedList?.[0]?.[0]?.[0] [90mundefined[39m
|
20
|
-
subscribedList?.[0]?.[0]?.[0] a
|
21
|
-
subscribedList?.[0]?.[0]?.[0] x
|
22
|
-
subscribedList?.[0]?.[0]?.[0] y
|
23
|
-
subscribedList?.[0]?.[0]?.[0] w
|
24
|
-
|
25
|
-
✓ src/tests/coList.test.ts (10 tests) 190ms
|
26
|
-
stdout | src/tests/coStream.test.ts > CoStream resolution > Subscription & auto-resolution
|
27
|
-
subscribedStream[me.id] {
|
28
|
-
value: [36m[Getter][39m,
|
29
|
-
ref: [36m[Getter][39m,
|
30
|
-
by: [36m[Getter][39m,
|
31
|
-
madeAt: [35m2024-09-05T17:35:38.414Z[39m,
|
32
|
-
tx: {
|
33
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF'[39m,
|
34
|
-
txIndex: [33m0[39m
|
35
|
-
}
|
36
|
-
}
|
37
|
-
subscribedStream[me.id]?.value?.[me.id]?.value [90mundefined[39m
|
38
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value [90mundefined[39m
|
39
|
-
subscribedStream[me.id] {
|
40
|
-
value: [36m[Getter][39m,
|
41
|
-
ref: [36m[Getter][39m,
|
42
|
-
by: [36m[Getter][39m,
|
43
|
-
madeAt: [35m2024-09-05T17:35:38.414Z[39m,
|
44
|
-
tx: {
|
45
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF'[39m,
|
46
|
-
txIndex: [33m0[39m
|
47
|
-
}
|
48
|
-
}
|
49
|
-
subscribedStream[me.id]?.value?.[me.id]?.value [1mnull[22m
|
50
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value [90mundefined[39m
|
51
|
-
subscribedStream[me.id] {
|
52
|
-
value: [36m[Getter][39m,
|
53
|
-
ref: [36m[Getter][39m,
|
54
|
-
by: [36m[Getter][39m,
|
55
|
-
madeAt: [35m2024-09-05T17:35:38.414Z[39m,
|
56
|
-
tx: {
|
57
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF'[39m,
|
58
|
-
txIndex: [33m0[39m
|
59
|
-
}
|
60
|
-
}
|
61
|
-
subscribedStream[me.id]?.value?.[me.id]?.value {
|
62
|
-
id: [32m'co_zHELVqRmAN6YuGDpKqVrSXJ5qe1'[39m,
|
63
|
-
_type: [32m'CoStream'[39m,
|
64
|
-
perSession: [90mundefined[39m,
|
65
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri: [32m'milk'[39m,
|
66
|
-
in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF: [32m'milk'[39m }
|
67
|
-
}
|
68
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value milk
|
69
|
-
subscribedStream[me.id] {
|
70
|
-
value: [36m[Getter][39m,
|
71
|
-
ref: [36m[Getter][39m,
|
72
|
-
by: [36m[Getter][39m,
|
73
|
-
madeAt: [35m2024-09-05T17:35:38.414Z[39m,
|
74
|
-
tx: {
|
75
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF'[39m,
|
76
|
-
txIndex: [33m0[39m
|
77
|
-
}
|
78
|
-
}
|
79
|
-
subscribedStream[me.id]?.value?.[me.id]?.value {
|
80
|
-
id: [32m'co_zHELVqRmAN6YuGDpKqVrSXJ5qe1'[39m,
|
81
|
-
_type: [32m'CoStream'[39m,
|
82
|
-
perSession: [90mundefined[39m,
|
83
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri: [32m'bread'[39m,
|
84
|
-
in: {
|
85
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF: [32m'milk'[39m,
|
86
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: [32m'bread'[39m
|
87
|
-
}
|
88
|
-
}
|
89
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value bread
|
90
|
-
subscribedStream[me.id] {
|
91
|
-
value: [36m[Getter][39m,
|
92
|
-
ref: [36m[Getter][39m,
|
93
|
-
by: [36m[Getter][39m,
|
94
|
-
madeAt: [35m2024-09-05T17:35:38.424Z[39m,
|
95
|
-
tx: {
|
96
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa'[39m,
|
97
|
-
txIndex: [33m0[39m
|
98
|
-
}
|
99
|
-
}
|
100
|
-
subscribedStream[me.id]?.value?.[me.id]?.value {
|
101
|
-
id: [32m'co_zJmdvJY15XJkWF3n3rwPgGfebxa'[39m,
|
102
|
-
_type: [32m'CoStream'[39m,
|
103
|
-
perSession: [90mundefined[39m,
|
104
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri: [32m'butter'[39m,
|
105
|
-
in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: [32m'butter'[39m }
|
106
|
-
}
|
107
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value butter
|
108
|
-
subscribedStream[me.id] {
|
109
|
-
value: [36m[Getter][39m,
|
110
|
-
ref: [36m[Getter][39m,
|
111
|
-
by: [36m[Getter][39m,
|
112
|
-
madeAt: [35m2024-09-05T17:35:38.424Z[39m,
|
113
|
-
tx: {
|
114
|
-
sessionID: [32m'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa'[39m,
|
115
|
-
txIndex: [33m0[39m
|
116
|
-
}
|
117
|
-
}
|
118
|
-
subscribedStream[me.id]?.value?.[me.id]?.value {
|
119
|
-
id: [32m'co_zJmdvJY15XJkWF3n3rwPgGfebxa'[39m,
|
120
|
-
_type: [32m'CoStream'[39m,
|
121
|
-
perSession: [90mundefined[39m,
|
122
|
-
co_zURWEpvoH1e35FGHVxadgXKU8Ri: [32m'jam'[39m,
|
123
|
-
in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: [32m'jam'[39m }
|
124
|
-
}
|
125
|
-
subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value jam
|
126
|
-
|
127
|
-
✓ src/tests/coStream.test.ts (10 tests) 205ms
|
128
|
-
stdout | src/tests/coMap.test.ts > CoMap resolution > Subscription & auto-resolution
|
129
|
-
subscribedMap.nested?.twiceNested?.taste [90mundefined[39m
|
130
|
-
subscribedMap.nested?.twiceNested?.taste [90mundefined[39m
|
131
|
-
subscribedMap.nested?.twiceNested?.taste sour
|
132
|
-
subscribedMap.nested?.twiceNested?.taste sour
|
133
|
-
subscribedMap.nested?.twiceNested?.taste sweet
|
134
|
-
subscribedMap.nested?.twiceNested?.taste sweet
|
135
|
-
subscribedMap.nested?.twiceNested?.taste salty
|
136
|
-
subscribedMap.nested?.twiceNested?.taste umami
|
137
|
-
|
138
|
-
✓ src/tests/coMap.test.ts (20 tests) 257ms
|
139
|
-
|
140
|
-
Test Files 5 passed (5)
|
141
|
-
Tests 44 passed (44)
|
142
|
-
Start at 18:35:37
|
143
|
-
Duration 929ms (transform 419ms, setup 0ms, collect 2.29s, tests 799ms, environment 0ms, prepare 298ms)
|
144
|
-
|