jazz-tools 0.9.10-jazz-bridge-preview.0 → 0.9.11

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.
@@ -26,7 +26,7 @@ import {
26
26
  loadCoValue,
27
27
  randomSessionProvider,
28
28
  subscribeToCoValue
29
- } from "./chunk-YWGGIF2U.js";
29
+ } from "./chunk-ICWP2U63.js";
30
30
 
31
31
  // src/index.native.ts
32
32
  import {
package/dist/index.web.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  loadCoValue,
27
27
  randomSessionProvider,
28
28
  subscribeToCoValue
29
- } from "./chunk-YWGGIF2U.js";
29
+ } from "./chunk-ICWP2U63.js";
30
30
 
31
31
  // src/index.web.ts
32
32
  import { cojsonInternals, MAX_RECOMMENDED_TX_SIZE, WasmCrypto } from "cojson";
package/dist/testing.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  Account,
3
3
  activeAccountContext,
4
4
  createAnonymousJazzContext
5
- } from "./chunk-YWGGIF2U.js";
5
+ } from "./chunk-ICWP2U63.js";
6
6
 
7
7
  // src/testing.ts
8
8
  import { cojsonInternals } from "cojson";
package/package.json CHANGED
@@ -23,10 +23,9 @@
23
23
  },
24
24
  "type": "module",
25
25
  "license": "MIT",
26
- "version": "0.9.10-jazz-bridge-preview.0",
26
+ "version": "0.9.11",
27
27
  "dependencies": {
28
- "fast-myers-diff": "^3.2.0",
29
- "cojson": "0.9.9"
28
+ "cojson": "0.9.11"
30
29
  },
31
30
  "devDependencies": {
32
31
  "tsup": "8.3.5",
@@ -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;
@@ -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
  *
@@ -372,6 +372,7 @@ export class CoRichText extends CoMap {
372
372
  end + 1,
373
373
  mark.endBefore,
374
374
  RangeClass,
375
+ // @ts-ignore Some Typescript versions flag this as an error
375
376
  {},
376
377
  {
377
378
  markOwner: mark.sourceMark._owner || this._owner,
@@ -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
- // eslint-disable-next-line no-constant-condition
133
- while (true) {
134
- if (!("auth" in options)) {
135
- return createAnonymousJazzContext({
136
- peersToLoadFrom: options.peersToLoadFrom,
137
- crypto: options.crypto,
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
- const { auth, sessionProvider, peersToLoadFrom, crypto } = options;
142
- const AccountSchema =
143
- options.AccountSchema ??
144
- (RegisteredSchemas["Account"] as unknown as AccountClass<Acc>);
145
- let authResult: AuthResult;
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
- if (authResult.type === "existing") {
154
- try {
155
- const { sessionID, sessionDone } = await sessionProvider(
156
- authResult.credentials.accountID,
157
- crypto,
158
- );
145
+ if (authResult.type === "existing") {
146
+ const { sessionID, sessionDone } = await sessionProvider(
147
+ authResult.credentials.accountID,
148
+ crypto,
149
+ );
159
150
 
160
- try {
161
- const node = await LocalNode.withLoadedAccount({
162
- accountID: authResult.credentials
163
- .accountID as unknown as CoID<RawAccount>,
164
- accountSecret: authResult.credentials.secret,
165
- sessionID: sessionID,
166
- peersToLoadFrom: peersToLoadFrom,
167
- crypto: crypto,
168
- migration: async (rawAccount, _node, creationProps) => {
169
- const account = new AccountSchema({
170
- fromRaw: rawAccount,
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
- activeAccountContext.set(account);
163
+ activeAccountContext.set(account);
174
164
 
175
- await account.applyMigration(creationProps);
176
- },
177
- });
165
+ await account.applyMigration(creationProps);
166
+ },
167
+ });
178
168
 
179
- const account = AccountSchema.fromNode(node);
180
- activeAccountContext.set(account);
169
+ const account = AccountSchema.fromNode(node);
170
+ activeAccountContext.set(account);
181
171
 
182
- if (authResult.saveCredentials) {
183
- await authResult.saveCredentials({
184
- accountID: node.account.id as unknown as ID<Account>,
185
- secret: node.account.agentSecret,
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
- authResult.onSuccess();
179
+ authResult.onSuccess();
190
180
 
191
- return {
192
- account,
193
- done: () => {
194
- node.gracefulShutdown();
195
- sessionDone();
196
- },
197
- logOut: () => {
198
- node.gracefulShutdown();
199
- sessionDone();
200
- authResult.logOut();
201
- },
202
- };
203
- } catch (e) {
204
- authResult.onError(new Error("Error loading account", { cause: e }));
205
- sessionDone();
206
- }
207
- } catch (e) {
208
- authResult.onError(
209
- new Error("Error acquiring sessionID", { cause: e }),
210
- );
211
- }
212
- } else if (authResult.type === "new") {
213
- try {
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
- await account.applyMigration(creationProps);
227
- },
228
- });
205
+ await account.applyMigration(creationProps);
206
+ },
207
+ });
229
208
 
230
- const account = AccountSchema.fromNode(node);
231
- activeAccountContext.set(account);
209
+ const account = AccountSchema.fromNode(node);
210
+ activeAccountContext.set(account);
232
211
 
233
- await authResult.saveCredentials({
234
- accountID: node.account.id as unknown as ID<Account>,
235
- secret: node.account.agentSecret,
236
- });
212
+ await authResult.saveCredentials({
213
+ accountID: node.account.id as unknown as ID<Account>,
214
+ secret: node.account.agentSecret,
215
+ });
237
216
 
238
- authResult.onSuccess();
239
- return {
240
- account,
241
- done: () => {
242
- node.gracefulShutdown();
243
- },
244
- logOut: () => {
245
- node.gracefulShutdown();
246
- authResult.logOut();
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({
@@ -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
 
@@ -13,11 +13,29 @@ class BaseWidget extends CoMap {
13
13
  type = co.string;
14
14
  }
15
15
 
16
- class ButtonWidget extends BaseWidget {
16
+ class RedButtonWidget extends BaseWidget {
17
17
  type = co.literal("button");
18
+ color = co.literal("red");
18
19
  label = co.string;
19
20
  }
20
21
 
22
+ class BlueButtonWidget extends BaseWidget {
23
+ type = co.literal("button");
24
+ color = co.literal("blue");
25
+ label = co.string;
26
+ }
27
+
28
+ const ButtonWidget = SchemaUnion.Of<BaseWidget>((raw) => {
29
+ switch (raw.get("color")) {
30
+ case "red":
31
+ return RedButtonWidget;
32
+ case "blue":
33
+ return BlueButtonWidget;
34
+ default:
35
+ throw new Error(`Unknown button color: ${raw.get("color")}`);
36
+ }
37
+ });
38
+
21
39
  class SliderWidget extends BaseWidget {
22
40
  type = co.literal("slider");
23
41
  min = co.number;
@@ -57,8 +75,8 @@ describe("SchemaUnion", () => {
57
75
  });
58
76
 
59
77
  it("should instantiate the correct subclass based on schema and provided data", async () => {
60
- const buttonWidget = ButtonWidget.create(
61
- { type: "button", label: "Submit" },
78
+ const buttonWidget = RedButtonWidget.create(
79
+ { type: "button", color: "red", label: "Submit" },
62
80
  { owner: me },
63
81
  );
64
82
  const sliderWidget = SliderWidget.create(
@@ -89,14 +107,14 @@ describe("SchemaUnion", () => {
89
107
  {},
90
108
  );
91
109
 
92
- expect(loadedButtonWidget).toBeInstanceOf(ButtonWidget);
110
+ expect(loadedButtonWidget).toBeInstanceOf(RedButtonWidget);
93
111
  expect(loadedSliderWidget).toBeInstanceOf(SliderWidget);
94
112
  expect(loadedCheckboxWidget).toBeInstanceOf(CheckboxWidget);
95
113
  });
96
114
 
97
115
  it("should integrate with subscribeToCoValue correctly", async () => {
98
- const buttonWidget = ButtonWidget.create(
99
- { type: "button", label: "Submit" },
116
+ const buttonWidget = BlueButtonWidget.create(
117
+ { type: "button", color: "blue", label: "Submit" },
100
118
  { owner: me },
101
119
  );
102
120
  let currentValue = "Submit";
@@ -106,7 +124,7 @@ describe("SchemaUnion", () => {
106
124
  me,
107
125
  {},
108
126
  (value: BaseWidget) => {
109
- if (value instanceof ButtonWidget) {
127
+ if (value instanceof BlueButtonWidget) {
110
128
  expect(value.label).toBe(currentValue);
111
129
  } else {
112
130
  throw new Error("Unexpected widget type");
@@ -1,4 +0,0 @@
1
-
2
- > jazz-tools@0.7.35-guest-auth.5 lint /Users/anselm/jazz/jazz/packages/jazz-tools
3
- > eslint . --ext ts,tsx
4
-
@@ -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 undefined
11
-
12
- ✓ src/tests/deepLoading.test.ts (3 tests) 83ms
13
- stdout | src/tests/coList.test.ts > Simple CoList operations > Mutation > splice
14
- [ 'bread', 'onion' ] 0
15
- [ 'bread', 'salt', 'onion' ] 1
16
-
17
- stdout | src/tests/coList.test.ts > CoList resolution > Subscription & auto-resolution
18
- subscribedList?.[0]?.[0]?.[0] undefined
19
- subscribedList?.[0]?.[0]?.[0] undefined
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: [Getter],
29
- ref: [Getter],
30
- by: [Getter],
31
- madeAt: 2024-09-05T17:35:38.414Z,
32
- tx: {
33
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF',
34
- txIndex: 0
35
- }
36
- }
37
- subscribedStream[me.id]?.value?.[me.id]?.value undefined
38
- subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value undefined
39
- subscribedStream[me.id] {
40
- value: [Getter],
41
- ref: [Getter],
42
- by: [Getter],
43
- madeAt: 2024-09-05T17:35:38.414Z,
44
- tx: {
45
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF',
46
- txIndex: 0
47
- }
48
- }
49
- subscribedStream[me.id]?.value?.[me.id]?.value null
50
- subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value undefined
51
- subscribedStream[me.id] {
52
- value: [Getter],
53
- ref: [Getter],
54
- by: [Getter],
55
- madeAt: 2024-09-05T17:35:38.414Z,
56
- tx: {
57
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF',
58
- txIndex: 0
59
- }
60
- }
61
- subscribedStream[me.id]?.value?.[me.id]?.value {
62
- id: 'co_zHELVqRmAN6YuGDpKqVrSXJ5qe1',
63
- _type: 'CoStream',
64
- perSession: undefined,
65
- co_zURWEpvoH1e35FGHVxadgXKU8Ri: 'milk',
66
- in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF: 'milk' }
67
- }
68
- subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value milk
69
- subscribedStream[me.id] {
70
- value: [Getter],
71
- ref: [Getter],
72
- by: [Getter],
73
- madeAt: 2024-09-05T17:35:38.414Z,
74
- tx: {
75
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF',
76
- txIndex: 0
77
- }
78
- }
79
- subscribedStream[me.id]?.value?.[me.id]?.value {
80
- id: 'co_zHELVqRmAN6YuGDpKqVrSXJ5qe1',
81
- _type: 'CoStream',
82
- perSession: undefined,
83
- co_zURWEpvoH1e35FGHVxadgXKU8Ri: 'bread',
84
- in: {
85
- co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_ziAMdGVstAxF: 'milk',
86
- co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: 'bread'
87
- }
88
- }
89
- subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value bread
90
- subscribedStream[me.id] {
91
- value: [Getter],
92
- ref: [Getter],
93
- by: [Getter],
94
- madeAt: 2024-09-05T17:35:38.424Z,
95
- tx: {
96
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa',
97
- txIndex: 0
98
- }
99
- }
100
- subscribedStream[me.id]?.value?.[me.id]?.value {
101
- id: 'co_zJmdvJY15XJkWF3n3rwPgGfebxa',
102
- _type: 'CoStream',
103
- perSession: undefined,
104
- co_zURWEpvoH1e35FGHVxadgXKU8Ri: 'butter',
105
- in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: 'butter' }
106
- }
107
- subscribedStream[me.id]?.value?.[me.id]?.value?.[me.id]?.value butter
108
- subscribedStream[me.id] {
109
- value: [Getter],
110
- ref: [Getter],
111
- by: [Getter],
112
- madeAt: 2024-09-05T17:35:38.424Z,
113
- tx: {
114
- sessionID: 'co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa',
115
- txIndex: 0
116
- }
117
- }
118
- subscribedStream[me.id]?.value?.[me.id]?.value {
119
- id: 'co_zJmdvJY15XJkWF3n3rwPgGfebxa',
120
- _type: 'CoStream',
121
- perSession: undefined,
122
- co_zURWEpvoH1e35FGHVxadgXKU8Ri: 'jam',
123
- in: { co_zURWEpvoH1e35FGHVxadgXKU8Ri_session_zgik2JjD86Qa: 'jam' }
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 undefined
130
- subscribedMap.nested?.twiceNested?.taste undefined
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
-