cojson 0.0.23 → 0.1.0

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.
@@ -17,8 +17,8 @@ import {
17
17
  } from "./account.js";
18
18
 
19
19
  export type PermissionsDef =
20
- | { type: "team"; initialAdmin: AccountIDOrAgentID }
21
- | { type: "ownedByTeam"; team: RawCoID }
20
+ | { type: "group"; initialAdmin: AccountIDOrAgentID }
21
+ | { type: "ownedByGroup"; group: RawCoID }
22
22
  | { type: "unsafeAllowAll" };
23
23
 
24
24
  export type Role =
@@ -33,7 +33,7 @@ export type Role =
33
33
  export function determineValidTransactions(
34
34
  coValue: CoValue
35
35
  ): { txID: TransactionID; tx: Transaction }[] {
36
- if (coValue.header.ruleset.type === "team") {
36
+ if (coValue.header.ruleset.type === "group") {
37
37
  const allTrustingTransactionsSorted = Object.entries(
38
38
  coValue.sessions
39
39
  ).flatMap(([sessionID, sessionLog]) => {
@@ -43,7 +43,7 @@ export function determineValidTransactions(
43
43
  if (tx.privacy === "trusting") {
44
44
  return true;
45
45
  } else {
46
- console.warn("Unexpected private transaction in Team");
46
+ console.warn("Unexpected private transaction in Group");
47
47
  return false;
48
48
  }
49
49
  }) as {
@@ -60,7 +60,7 @@ export function determineValidTransactions(
60
60
  const initialAdmin = coValue.header.ruleset.initialAdmin;
61
61
 
62
62
  if (!initialAdmin) {
63
- throw new Error("Team must have initialAdmin");
63
+ throw new Error("Group must have initialAdmin");
64
64
  }
65
65
 
66
66
  const memberState: { [agent: AccountIDOrAgentID]: Role } = {};
@@ -81,12 +81,12 @@ export function determineValidTransactions(
81
81
  | MapOpPayload<"readKey", JsonValue>
82
82
  | MapOpPayload<"profile", CoID<Profile>>;
83
83
  if (tx.changes.length !== 1) {
84
- console.warn("Team transaction must have exactly one change");
84
+ console.warn("Group transaction must have exactly one change");
85
85
  continue;
86
86
  }
87
87
 
88
88
  if (change.op !== "set") {
89
- console.warn("Team transaction must set a role or readKey");
89
+ console.warn("Group transaction must set a role or readKey");
90
90
  continue;
91
91
  }
92
92
 
@@ -138,7 +138,7 @@ export function determineValidTransactions(
138
138
  change.value !== "writerInvite" &&
139
139
  change.value !== "readerInvite"
140
140
  ) {
141
- console.warn("Team transaction must set a valid role");
141
+ console.warn("Group transaction must set a valid role");
142
142
  continue;
143
143
  }
144
144
 
@@ -176,7 +176,7 @@ export function determineValidTransactions(
176
176
  }
177
177
  } else {
178
178
  console.warn(
179
- "Team transaction must be made by current admin or invite"
179
+ "Group transaction must be made by current admin or invite"
180
180
  );
181
181
  continue;
182
182
  }
@@ -189,16 +189,16 @@ export function determineValidTransactions(
189
189
  }
190
190
 
191
191
  return validTransactions;
192
- } else if (coValue.header.ruleset.type === "ownedByTeam") {
193
- const teamContent = coValue.node
192
+ } else if (coValue.header.ruleset.type === "ownedByGroup") {
193
+ const groupContent = coValue.node
194
194
  .expectCoValueLoaded(
195
- coValue.header.ruleset.team,
196
- "Determining valid transaction in owned object but its team wasn't loaded"
195
+ coValue.header.ruleset.group,
196
+ "Determining valid transaction in owned object but its group wasn't loaded"
197
197
  )
198
198
  .getCurrentContent();
199
199
 
200
- if (teamContent.type !== "comap") {
201
- throw new Error("Team must be a map");
200
+ if (groupContent.type !== "comap") {
201
+ throw new Error("Group must be a map");
202
202
  }
203
203
 
204
204
  return Object.entries(coValue.sessions).flatMap(
@@ -208,7 +208,7 @@ export function determineValidTransactions(
208
208
  );
209
209
  return sessionLog.transactions
210
210
  .filter((tx) => {
211
- const transactorRoleAtTxTime = teamContent.getAtTime(
211
+ const transactorRoleAtTxTime = groupContent.getAtTime(
212
212
  transactor,
213
213
  tx.madeAt
214
214
  );
package/src/sync.test.ts CHANGED
@@ -3,7 +3,7 @@ import { LocalNode } from "./node.js";
3
3
  import { Peer, PeerID, SyncMessage } from "./sync.js";
4
4
  import { expectMap } from "./contentType.js";
5
5
  import { MapOpPayload } from "./contentTypes/coMap.js";
6
- import { Team } from "./team.js";
6
+ import { Group } from "./group.js";
7
7
  import {
8
8
  ReadableStream,
9
9
  WritableStream,
@@ -23,9 +23,9 @@ test("Node replies with initial tx and header to empty subscribe", async () => {
23
23
  const [admin, session] = randomAnonymousAccountAndSessionID();
24
24
  const node = new LocalNode(admin, session);
25
25
 
26
- const team = node.createTeam();
26
+ const group = node.createGroup();
27
27
 
28
- const map = team.createMap();
28
+ const map = group.createMap();
29
29
 
30
30
  map.edit((editable) => {
31
31
  editable.set("hello", "world", "trusting");
@@ -53,7 +53,7 @@ test("Node replies with initial tx and header to empty subscribe", async () => {
53
53
  const reader = outRx.getReader();
54
54
 
55
55
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
56
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
56
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
57
57
 
58
58
  const mapTellKnownStateMsg = await reader.read();
59
59
  expect(mapTellKnownStateMsg.value).toEqual({
@@ -62,7 +62,7 @@ test("Node replies with initial tx and header to empty subscribe", async () => {
62
62
  } satisfies SyncMessage);
63
63
 
64
64
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
65
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
65
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
66
66
 
67
67
  const newContentMsg = await reader.read();
68
68
 
@@ -71,7 +71,7 @@ test("Node replies with initial tx and header to empty subscribe", async () => {
71
71
  id: map.coValue.id,
72
72
  header: {
73
73
  type: "comap",
74
- ruleset: { type: "ownedByTeam", team: team.id },
74
+ ruleset: { type: "ownedByGroup", group: group.id },
75
75
  meta: null,
76
76
  createdAt: map.coValue.header.createdAt,
77
77
  uniqueness: map.coValue.header.uniqueness,
@@ -104,9 +104,9 @@ test("Node replies with only new tx to subscribe with some known state", async (
104
104
  const [admin, session] = randomAnonymousAccountAndSessionID();
105
105
  const node = new LocalNode(admin, session);
106
106
 
107
- const team = node.createTeam();
107
+ const group = node.createGroup();
108
108
 
109
- const map = team.createMap();
109
+ const map = group.createMap();
110
110
 
111
111
  map.edit((editable) => {
112
112
  editable.set("hello", "world", "trusting");
@@ -137,7 +137,7 @@ test("Node replies with only new tx to subscribe with some known state", async (
137
137
  const reader = outRx.getReader();
138
138
 
139
139
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
140
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
140
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
141
141
 
142
142
  const mapTellKnownStateMsg = await reader.read();
143
143
  expect(mapTellKnownStateMsg.value).toEqual({
@@ -146,7 +146,7 @@ test("Node replies with only new tx to subscribe with some known state", async (
146
146
  } satisfies SyncMessage);
147
147
 
148
148
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
149
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
149
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
150
150
 
151
151
  const mapNewContentMsg = await reader.read();
152
152
 
@@ -186,9 +186,9 @@ test("After subscribing, node sends own known state and new txs to peer", async
186
186
  const [admin, session] = randomAnonymousAccountAndSessionID();
187
187
  const node = new LocalNode(admin, session);
188
188
 
189
- const team = node.createTeam();
189
+ const group = node.createGroup();
190
190
 
191
- const map = team.createMap();
191
+ const map = group.createMap();
192
192
 
193
193
  const [inRx, inTx] = newStreamPair<SyncMessage>();
194
194
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -214,7 +214,7 @@ test("After subscribing, node sends own known state and new txs to peer", async
214
214
  const reader = outRx.getReader();
215
215
 
216
216
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
217
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
217
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
218
218
 
219
219
  const mapTellKnownStateMsg = await reader.read();
220
220
  expect(mapTellKnownStateMsg.value).toEqual({
@@ -223,7 +223,7 @@ test("After subscribing, node sends own known state and new txs to peer", async
223
223
  } satisfies SyncMessage);
224
224
 
225
225
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
226
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
226
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
227
227
 
228
228
  const mapNewContentHeaderOnlyMsg = await reader.read();
229
229
 
@@ -303,9 +303,9 @@ test("Client replies with known new content to tellKnownState from server", asyn
303
303
  const [admin, session] = randomAnonymousAccountAndSessionID();
304
304
  const node = new LocalNode(admin, session);
305
305
 
306
- const team = node.createTeam();
306
+ const group = node.createGroup();
307
307
 
308
- const map = team.createMap();
308
+ const map = group.createMap();
309
309
 
310
310
  map.edit((editable) => {
311
311
  editable.set("hello", "world", "trusting");
@@ -323,7 +323,7 @@ test("Client replies with known new content to tellKnownState from server", asyn
323
323
 
324
324
  const reader = outRx.getReader();
325
325
 
326
- // expect((await reader.read()).value).toMatchObject(teamStateEx(team));
326
+ // expect((await reader.read()).value).toMatchObject(groupStateEx(group));
327
327
 
328
328
  const writer = inTx.getWriter();
329
329
 
@@ -337,7 +337,7 @@ test("Client replies with known new content to tellKnownState from server", asyn
337
337
  });
338
338
 
339
339
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
340
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
340
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
341
341
 
342
342
  const mapTellKnownStateMsg = await reader.read();
343
343
  expect(mapTellKnownStateMsg.value).toEqual({
@@ -346,7 +346,7 @@ test("Client replies with known new content to tellKnownState from server", asyn
346
346
  } satisfies SyncMessage);
347
347
 
348
348
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
349
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
349
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
350
350
 
351
351
  const mapNewContentMsg = await reader.read();
352
352
 
@@ -382,9 +382,9 @@ test("No matter the optimistic known state, node respects invalid known state me
382
382
  const [admin, session] = randomAnonymousAccountAndSessionID();
383
383
  const node = new LocalNode(admin, session);
384
384
 
385
- const team = node.createTeam();
385
+ const group = node.createGroup();
386
386
 
387
- const map = team.createMap();
387
+ const map = group.createMap();
388
388
 
389
389
  const [inRx, inTx] = newStreamPair<SyncMessage>();
390
390
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -410,7 +410,7 @@ test("No matter the optimistic known state, node respects invalid known state me
410
410
  const reader = outRx.getReader();
411
411
 
412
412
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
413
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
413
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
414
414
 
415
415
  const mapTellKnownStateMsg = await reader.read();
416
416
  expect(mapTellKnownStateMsg.value).toEqual({
@@ -419,7 +419,7 @@ test("No matter the optimistic known state, node respects invalid known state me
419
419
  } satisfies SyncMessage);
420
420
 
421
421
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
422
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
422
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
423
423
 
424
424
  const mapNewContentHeaderOnlyMsg = await reader.read();
425
425
 
@@ -485,9 +485,9 @@ test("If we add a peer, but it never subscribes to a coValue, it won't get any m
485
485
  const [admin, session] = randomAnonymousAccountAndSessionID();
486
486
  const node = new LocalNode(admin, session);
487
487
 
488
- const team = node.createTeam();
488
+ const group = node.createGroup();
489
489
 
490
- const map = team.createMap();
490
+ const map = group.createMap();
491
491
 
492
492
  const [inRx, _inTx] = newStreamPair<SyncMessage>();
493
493
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -514,9 +514,9 @@ test("If we add a server peer, all updates to all coValues are sent to it, even
514
514
  const [admin, session] = randomAnonymousAccountAndSessionID();
515
515
  const node = new LocalNode(admin, session);
516
516
 
517
- const team = node.createTeam();
517
+ const group = node.createGroup();
518
518
 
519
- const map = team.createMap();
519
+ const map = group.createMap();
520
520
 
521
521
  const [inRx, _inTx] = newStreamPair<SyncMessage>();
522
522
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -535,7 +535,7 @@ test("If we add a server peer, all updates to all coValues are sent to it, even
535
535
  // });
536
536
  expect((await reader.read()).value).toMatchObject({
537
537
  action: "load",
538
- id: team.teamMap.coValue.id,
538
+ id: group.groupMap.coValue.id,
539
539
  });
540
540
 
541
541
  const mapSubscribeMsg = await reader.read();
@@ -552,7 +552,7 @@ test("If we add a server peer, all updates to all coValues are sent to it, even
552
552
  });
553
553
 
554
554
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
555
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
555
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
556
556
 
557
557
  const mapNewContentMsg = await reader.read();
558
558
 
@@ -588,7 +588,7 @@ test("If we add a server peer, newly created coValues are auto-subscribed to", a
588
588
  const [admin, session] = randomAnonymousAccountAndSessionID();
589
589
  const node = new LocalNode(admin, session);
590
590
 
591
- const team = node.createTeam();
591
+ const group = node.createGroup();
592
592
 
593
593
  const [inRx, _inTx] = newStreamPair<SyncMessage>();
594
594
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -607,10 +607,10 @@ test("If we add a server peer, newly created coValues are auto-subscribed to", a
607
607
  // });
608
608
  expect((await reader.read()).value).toMatchObject({
609
609
  action: "load",
610
- id: team.teamMap.coValue.id,
610
+ id: group.groupMap.coValue.id,
611
611
  });
612
612
 
613
- const map = team.createMap();
613
+ const map = group.createMap();
614
614
 
615
615
  const mapSubscribeMsg = await reader.read();
616
616
 
@@ -620,7 +620,7 @@ test("If we add a server peer, newly created coValues are auto-subscribed to", a
620
620
  } satisfies SyncMessage);
621
621
 
622
622
  // expect((await reader.read()).value).toMatchObject(admContEx(adminID));
623
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
623
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
624
624
 
625
625
  const mapContentMsg = await reader.read();
626
626
 
@@ -640,9 +640,9 @@ test("When we connect a new server peer, we try to sync all existing coValues to
640
640
  const [admin, session] = randomAnonymousAccountAndSessionID();
641
641
  const node = new LocalNode(admin, session);
642
642
 
643
- const team = node.createTeam();
643
+ const group = node.createGroup();
644
644
 
645
- const map = team.createMap();
645
+ const map = group.createMap();
646
646
 
647
647
  const [inRx, _inTx] = newStreamPair<SyncMessage>();
648
648
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -657,11 +657,11 @@ test("When we connect a new server peer, we try to sync all existing coValues to
657
657
  const reader = outRx.getReader();
658
658
 
659
659
  // const _adminSubscribeMessage = await reader.read();
660
- const teamSubscribeMessage = await reader.read();
660
+ const groupSubscribeMessage = await reader.read();
661
661
 
662
- expect(teamSubscribeMessage.value).toEqual({
662
+ expect(groupSubscribeMessage.value).toEqual({
663
663
  action: "load",
664
- ...team.teamMap.coValue.knownState(),
664
+ ...group.groupMap.coValue.knownState(),
665
665
  } satisfies SyncMessage);
666
666
 
667
667
  const secondMessage = await reader.read();
@@ -676,9 +676,9 @@ test("When receiving a subscribe with a known state that is ahead of our own, pe
676
676
  const [admin, session] = randomAnonymousAccountAndSessionID();
677
677
  const node = new LocalNode(admin, session);
678
678
 
679
- const team = node.createTeam();
679
+ const group = node.createGroup();
680
680
 
681
- const map = team.createMap();
681
+ const map = group.createMap();
682
682
 
683
683
  const [inRx, inTx] = newStreamPair<SyncMessage>();
684
684
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -704,7 +704,7 @@ test("When receiving a subscribe with a known state that is ahead of our own, pe
704
704
  const reader = outRx.getReader();
705
705
 
706
706
  // expect((await reader.read()).value).toMatchObject(admStateEx(admin.id));
707
- expect((await reader.read()).value).toMatchObject(teamStateEx(team));
707
+ expect((await reader.read()).value).toMatchObject(groupStateEx(group));
708
708
  const mapTellKnownState = await reader.read();
709
709
 
710
710
  expect(mapTellKnownState.value).toEqual({
@@ -719,7 +719,7 @@ test.skip("When replaying creation and transactions of a coValue as new content,
719
719
 
720
720
  const node1 = new LocalNode(admin, session);
721
721
 
722
- const team = node1.createTeam();
722
+ const group = node1.createGroup();
723
723
 
724
724
  const [inRx1, inTx1] = newStreamPair<SyncMessage>();
725
725
  const [outRx1, outTx1] = newStreamPair<SyncMessage>();
@@ -754,40 +754,40 @@ test.skip("When replaying creation and transactions of a coValue as new content,
754
754
  action: "load",
755
755
  id: admin.id,
756
756
  });
757
- const teamSubscribeMsg = await from1.read();
758
- expect(teamSubscribeMsg.value).toMatchObject({
757
+ const groupSubscribeMsg = await from1.read();
758
+ expect(groupSubscribeMsg.value).toMatchObject({
759
759
  action: "load",
760
- id: team.teamMap.coValue.id,
760
+ id: group.groupMap.coValue.id,
761
761
  });
762
762
 
763
763
  await to2.write(adminSubscribeMessage.value!);
764
- await to2.write(teamSubscribeMsg.value!);
764
+ await to2.write(groupSubscribeMsg.value!);
765
765
 
766
766
  // const adminTellKnownStateMsg = await from2.read();
767
767
  // expect(adminTellKnownStateMsg.value).toMatchObject(admStateEx(admin.id));
768
768
 
769
- const teamTellKnownStateMsg = await from2.read();
770
- expect(teamTellKnownStateMsg.value).toMatchObject(teamStateEx(team));
769
+ const groupTellKnownStateMsg = await from2.read();
770
+ expect(groupTellKnownStateMsg.value).toMatchObject(groupStateEx(group));
771
771
 
772
772
  expect(
773
773
  node2.sync.peers["test1"]!.optimisticKnownStates[
774
- team.teamMap.coValue.id
774
+ group.groupMap.coValue.id
775
775
  ]
776
776
  ).toBeDefined();
777
777
 
778
778
  // await to1.write(adminTellKnownStateMsg.value!);
779
- await to1.write(teamTellKnownStateMsg.value!);
779
+ await to1.write(groupTellKnownStateMsg.value!);
780
780
 
781
781
  // const adminContentMsg = await from1.read();
782
782
  // expect(adminContentMsg.value).toMatchObject(admContEx(admin.id));
783
783
 
784
- const teamContentMsg = await from1.read();
785
- expect(teamContentMsg.value).toMatchObject(teamContentEx(team));
784
+ const groupContentMsg = await from1.read();
785
+ expect(groupContentMsg.value).toMatchObject(groupContentEx(group));
786
786
 
787
787
  // await to2.write(adminContentMsg.value!);
788
- await to2.write(teamContentMsg.value!);
788
+ await to2.write(groupContentMsg.value!);
789
789
 
790
- const map = team.createMap();
790
+ const map = group.createMap();
791
791
 
792
792
  const mapSubscriptionMsg = await from1.read();
793
793
  expect(mapSubscriptionMsg.value).toMatchObject({
@@ -840,9 +840,9 @@ test.skip("When loading a coValue on one node, the server node it is requested f
840
840
 
841
841
  const node1 = new LocalNode(admin, session);
842
842
 
843
- const team = node1.createTeam();
843
+ const group = node1.createGroup();
844
844
 
845
- const map = team.createMap();
845
+ const map = group.createMap();
846
846
  map.edit((editable) => {
847
847
  editable.set("hello", "world", "trusting");
848
848
  });
@@ -868,9 +868,9 @@ test("Can sync a coValue through a server to another client", async () => {
868
868
 
869
869
  const client1 = new LocalNode(admin, session);
870
870
 
871
- const team = client1.createTeam();
871
+ const group = client1.createGroup();
872
872
 
873
- const map = team.createMap();
873
+ const map = group.createMap();
874
874
  map.edit((editable) => {
875
875
  editable.set("hello", "world", "trusting");
876
876
  });
@@ -910,9 +910,9 @@ test("Can sync a coValue with private transactions through a server to another c
910
910
 
911
911
  const client1 = new LocalNode(admin, session);
912
912
 
913
- const team = client1.createTeam();
913
+ const group = client1.createGroup();
914
914
 
915
- const map = team.createMap();
915
+ const map = group.createMap();
916
916
  map.edit((editable) => {
917
917
  editable.set("hello", "world", "private");
918
918
  });
@@ -952,7 +952,7 @@ test("When a peer's incoming/readable stream closes, we remove the peer", async
952
952
  const [admin, session] = randomAnonymousAccountAndSessionID();
953
953
  const node = new LocalNode(admin, session);
954
954
 
955
- const team = node.createTeam();
955
+ const group = node.createGroup();
956
956
 
957
957
  const [inRx, inTx] = newStreamPair<SyncMessage>();
958
958
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -971,10 +971,10 @@ test("When a peer's incoming/readable stream closes, we remove the peer", async
971
971
  // });
972
972
  expect((await reader.read()).value).toMatchObject({
973
973
  action: "load",
974
- id: team.teamMap.coValue.id,
974
+ id: group.groupMap.coValue.id,
975
975
  });
976
976
 
977
- const map = team.createMap();
977
+ const map = group.createMap();
978
978
 
979
979
  const mapSubscribeMsg = await reader.read();
980
980
 
@@ -984,7 +984,7 @@ test("When a peer's incoming/readable stream closes, we remove the peer", async
984
984
  } satisfies SyncMessage);
985
985
 
986
986
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
987
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
987
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
988
988
 
989
989
  const mapContentMsg = await reader.read();
990
990
 
@@ -1006,7 +1006,7 @@ test("When a peer's outgoing/writable stream closes, we remove the peer", async
1006
1006
  const [admin, session] = randomAnonymousAccountAndSessionID();
1007
1007
  const node = new LocalNode(admin, session);
1008
1008
 
1009
- const team = node.createTeam();
1009
+ const group = node.createGroup();
1010
1010
 
1011
1011
  const [inRx, inTx] = newStreamPair<SyncMessage>();
1012
1012
  const [outRx, outTx] = newStreamPair<SyncMessage>();
@@ -1025,10 +1025,10 @@ test("When a peer's outgoing/writable stream closes, we remove the peer", async
1025
1025
  // });
1026
1026
  expect((await reader.read()).value).toMatchObject({
1027
1027
  action: "load",
1028
- id: team.teamMap.coValue.id,
1028
+ id: group.groupMap.coValue.id,
1029
1029
  });
1030
1030
 
1031
- const map = team.createMap();
1031
+ const map = group.createMap();
1032
1032
 
1033
1033
  const mapSubscribeMsg = await reader.read();
1034
1034
 
@@ -1038,7 +1038,7 @@ test("When a peer's outgoing/writable stream closes, we remove the peer", async
1038
1038
  } satisfies SyncMessage);
1039
1039
 
1040
1040
  // expect((await reader.read()).value).toMatchObject(admContEx(admin.id));
1041
- expect((await reader.read()).value).toMatchObject(teamContentEx(team));
1041
+ expect((await reader.read()).value).toMatchObject(groupContentEx(group));
1042
1042
 
1043
1043
  const mapContentMsg = await reader.read();
1044
1044
 
@@ -1066,9 +1066,9 @@ test("If we start loading a coValue before connecting to a peer that has it, it
1066
1066
 
1067
1067
  const node1 = new LocalNode(admin, session);
1068
1068
 
1069
- const team = node1.createTeam();
1069
+ const group = node1.createGroup();
1070
1070
 
1071
- const map = team.createMap();
1071
+ const map = group.createMap();
1072
1072
  map.edit((editable) => {
1073
1073
  editable.set("hello", "world", "trusting");
1074
1074
  });
@@ -1096,10 +1096,10 @@ test("If we start loading a coValue before connecting to a peer that has it, it
1096
1096
  );
1097
1097
  });
1098
1098
 
1099
- function teamContentEx(team: Team) {
1099
+ function groupContentEx(group: Group) {
1100
1100
  return {
1101
1101
  action: "content",
1102
- id: team.teamMap.coValue.id,
1102
+ id: group.groupMap.coValue.id,
1103
1103
  };
1104
1104
  }
1105
1105
 
@@ -1110,10 +1110,10 @@ function admContEx(adminID: AccountID) {
1110
1110
  };
1111
1111
  }
1112
1112
 
1113
- function teamStateEx(team: Team) {
1113
+ function groupStateEx(group: Group) {
1114
1114
  return {
1115
1115
  action: "known",
1116
- id: team.teamMap.coValue.id,
1116
+ id: group.groupMap.coValue.id,
1117
1117
  };
1118
1118
  }
1119
1119