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.
@@ -1,6 +1,6 @@
1
1
  import { newRandomSessionID } from "./coValue.js";
2
2
  import { expectMap } from "./contentType.js";
3
- import { Team, expectTeamContent } from "./team.js";
3
+ import { Group, expectGroupContent } from "./group.js";
4
4
  import {
5
5
  createdNowUnique,
6
6
  newRandomKeySecret,
@@ -12,30 +12,30 @@ import {
12
12
  getAgentSealerID,
13
13
  } from "./crypto.js";
14
14
  import {
15
- newTeam,
16
- newTeamHighLevel,
17
- teamWithTwoAdmins,
18
- teamWithTwoAdminsHighLevel,
15
+ newGroup,
16
+ newGroupHighLevel,
17
+ groupWithTwoAdmins,
18
+ groupWithTwoAdminsHighLevel,
19
19
  } from "./testUtils.js";
20
20
  import { AnonymousControlledAccount } from "./index.js";
21
21
 
22
- test("Initial admin can add another admin to a team", () => {
23
- teamWithTwoAdmins();
22
+ test("Initial admin can add another admin to a group", () => {
23
+ groupWithTwoAdmins();
24
24
  });
25
25
 
26
- test("Initial admin can add another admin to a team (high level)", () => {
27
- teamWithTwoAdminsHighLevel();
26
+ test("Initial admin can add another admin to a group (high level)", () => {
27
+ groupWithTwoAdminsHighLevel();
28
28
  });
29
29
 
30
- test("Added admin can add a third admin to a team", () => {
31
- const { team, otherAdmin, node } = teamWithTwoAdmins();
30
+ test("Added admin can add a third admin to a group", () => {
31
+ const { group, otherAdmin, node } = groupWithTwoAdmins();
32
32
 
33
- const teamAsOtherAdmin = team.testWithDifferentAccount(
33
+ const groupAsOtherAdmin = group.testWithDifferentAccount(
34
34
  otherAdmin,
35
35
  newRandomSessionID(otherAdmin.id)
36
36
  );
37
37
 
38
- let otherContent = expectTeamContent(teamAsOtherAdmin.getCurrentContent());
38
+ let otherContent = expectGroupContent(groupAsOtherAdmin.getCurrentContent());
39
39
 
40
40
  expect(otherContent.get(otherAdmin.id)).toEqual("admin");
41
41
 
@@ -46,103 +46,103 @@ test("Added admin can add a third admin to a team", () => {
46
46
  expect(editable.get(thirdAdmin.id)).toEqual("admin");
47
47
  });
48
48
 
49
- otherContent = expectTeamContent(teamAsOtherAdmin.getCurrentContent());
49
+ otherContent = expectGroupContent(groupAsOtherAdmin.getCurrentContent());
50
50
 
51
51
  expect(otherContent.get(thirdAdmin.id)).toEqual("admin");
52
52
  });
53
53
 
54
- test("Added adming can add a third admin to a team (high level)", () => {
55
- const { team, otherAdmin, node } = teamWithTwoAdminsHighLevel();
54
+ test("Added adming can add a third admin to a group (high level)", () => {
55
+ const { group, otherAdmin, node } = groupWithTwoAdminsHighLevel();
56
56
 
57
- const teamAsOtherAdmin = team.testWithDifferentAccount(
57
+ const groupAsOtherAdmin = group.testWithDifferentAccount(
58
58
  otherAdmin,
59
59
  newRandomSessionID(otherAdmin.id)
60
60
  );
61
61
 
62
62
  const thirdAdmin = node.createAccount("thirdAdmin");
63
63
 
64
- teamAsOtherAdmin.addMember(thirdAdmin.id, "admin");
64
+ groupAsOtherAdmin.addMember(thirdAdmin.id, "admin");
65
65
 
66
- expect(teamAsOtherAdmin.teamMap.get(thirdAdmin.id)).toEqual("admin");
66
+ expect(groupAsOtherAdmin.groupMap.get(thirdAdmin.id)).toEqual("admin");
67
67
  });
68
68
 
69
- test("Admins can't demote other admins in a team", () => {
70
- const { team, admin, otherAdmin } = teamWithTwoAdmins();
69
+ test("Admins can't demote other admins in a group", () => {
70
+ const { group, admin, otherAdmin } = groupWithTwoAdmins();
71
71
 
72
- let teamContent = expectTeamContent(team.getCurrentContent());
72
+ let groupContent = expectGroupContent(group.getCurrentContent());
73
73
 
74
- teamContent.edit((editable) => {
74
+ groupContent.edit((editable) => {
75
75
  editable.set(otherAdmin.id, "writer", "trusting");
76
76
  expect(editable.get(otherAdmin.id)).toEqual("admin");
77
77
  });
78
78
 
79
- teamContent = expectTeamContent(team.getCurrentContent());
80
- expect(teamContent.get(otherAdmin.id)).toEqual("admin");
79
+ groupContent = expectGroupContent(group.getCurrentContent());
80
+ expect(groupContent.get(otherAdmin.id)).toEqual("admin");
81
81
 
82
- const teamAsOtherAdmin = team.testWithDifferentAccount(
82
+ const groupAsOtherAdmin = group.testWithDifferentAccount(
83
83
  otherAdmin,
84
84
  newRandomSessionID(otherAdmin.id)
85
85
  );
86
86
 
87
- let teamContentAsOtherAdmin = expectTeamContent(
88
- teamAsOtherAdmin.getCurrentContent()
87
+ let groupContentAsOtherAdmin = expectGroupContent(
88
+ groupAsOtherAdmin.getCurrentContent()
89
89
  );
90
90
 
91
- teamContentAsOtherAdmin.edit((editable) => {
91
+ groupContentAsOtherAdmin.edit((editable) => {
92
92
  editable.set(admin.id, "writer", "trusting");
93
93
  expect(editable.get(admin.id)).toEqual("admin");
94
94
  });
95
95
 
96
- teamContentAsOtherAdmin = expectTeamContent(
97
- teamAsOtherAdmin.getCurrentContent()
96
+ groupContentAsOtherAdmin = expectGroupContent(
97
+ groupAsOtherAdmin.getCurrentContent()
98
98
  );
99
99
 
100
- expect(teamContentAsOtherAdmin.get(admin.id)).toEqual("admin");
100
+ expect(groupContentAsOtherAdmin.get(admin.id)).toEqual("admin");
101
101
  });
102
102
 
103
- test("Admins can't demote other admins in a team (high level)", () => {
104
- const { team, admin, otherAdmin } = teamWithTwoAdminsHighLevel();
103
+ test("Admins can't demote other admins in a group (high level)", () => {
104
+ const { group, admin, otherAdmin } = groupWithTwoAdminsHighLevel();
105
105
 
106
- const teamAsOtherAdmin = team.testWithDifferentAccount(
106
+ const groupAsOtherAdmin = group.testWithDifferentAccount(
107
107
  otherAdmin,
108
108
  newRandomSessionID(otherAdmin.id)
109
109
  );
110
110
 
111
- expect(() => teamAsOtherAdmin.addMember(admin.id, "writer")).toThrow(
111
+ expect(() => groupAsOtherAdmin.addMember(admin.id, "writer")).toThrow(
112
112
  "Failed to set role"
113
113
  );
114
114
 
115
- expect(teamAsOtherAdmin.teamMap.get(admin.id)).toEqual("admin");
115
+ expect(groupAsOtherAdmin.groupMap.get(admin.id)).toEqual("admin");
116
116
  });
117
117
 
118
- test("Admins an add writers to a team, who can't add admins, writers, or readers", () => {
119
- const { team, node } = newTeam();
118
+ test("Admins an add writers to a group, who can't add admins, writers, or readers", () => {
119
+ const { group, node } = newGroup();
120
120
  const writer = node.createAccount("writer");
121
121
 
122
- let teamContent = expectTeamContent(team.getCurrentContent());
122
+ let groupContent = expectGroupContent(group.getCurrentContent());
123
123
 
124
- teamContent.edit((editable) => {
124
+ groupContent.edit((editable) => {
125
125
  editable.set(writer.id, "writer", "trusting");
126
126
  expect(editable.get(writer.id)).toEqual("writer");
127
127
  });
128
128
 
129
- teamContent = expectTeamContent(team.getCurrentContent());
130
- expect(teamContent.get(writer.id)).toEqual("writer");
129
+ groupContent = expectGroupContent(group.getCurrentContent());
130
+ expect(groupContent.get(writer.id)).toEqual("writer");
131
131
 
132
- const teamAsWriter = team.testWithDifferentAccount(
132
+ const groupAsWriter = group.testWithDifferentAccount(
133
133
  writer,
134
134
  newRandomSessionID(writer.id)
135
135
  );
136
136
 
137
- let teamContentAsWriter = expectTeamContent(
138
- teamAsWriter.getCurrentContent()
137
+ let groupContentAsWriter = expectGroupContent(
138
+ groupAsWriter.getCurrentContent()
139
139
  );
140
140
 
141
- expect(teamContentAsWriter.get(writer.id)).toEqual("writer");
141
+ expect(groupContentAsWriter.get(writer.id)).toEqual("writer");
142
142
 
143
143
  const otherAgent = node.createAccount("otherAgent");
144
144
 
145
- teamContentAsWriter.edit((editable) => {
145
+ groupContentAsWriter.edit((editable) => {
146
146
  editable.set(otherAgent.id, "admin", "trusting");
147
147
  expect(editable.get(otherAgent.id)).toBeUndefined();
148
148
 
@@ -153,69 +153,69 @@ test("Admins an add writers to a team, who can't add admins, writers, or readers
153
153
  expect(editable.get(otherAgent.id)).toBeUndefined();
154
154
  });
155
155
 
156
- teamContentAsWriter = expectTeamContent(teamAsWriter.getCurrentContent());
156
+ groupContentAsWriter = expectGroupContent(groupAsWriter.getCurrentContent());
157
157
 
158
- expect(teamContentAsWriter.get(otherAgent.id)).toBeUndefined();
158
+ expect(groupContentAsWriter.get(otherAgent.id)).toBeUndefined();
159
159
  });
160
160
 
161
- test("Admins an add writers to a team, who can't add admins, writers, or readers (high level)", () => {
162
- const { team, node } = newTeamHighLevel();
161
+ test("Admins an add writers to a group, who can't add admins, writers, or readers (high level)", () => {
162
+ const { group, node } = newGroupHighLevel();
163
163
 
164
164
  const writer = node.createAccount("writer");
165
165
 
166
- team.addMember(writer.id, "writer");
167
- expect(team.teamMap.get(writer.id)).toEqual("writer");
166
+ group.addMember(writer.id, "writer");
167
+ expect(group.groupMap.get(writer.id)).toEqual("writer");
168
168
 
169
- const teamAsWriter = team.testWithDifferentAccount(
169
+ const groupAsWriter = group.testWithDifferentAccount(
170
170
  writer,
171
171
  newRandomSessionID(writer.id)
172
172
  );
173
173
 
174
- expect(teamAsWriter.teamMap.get(writer.id)).toEqual("writer");
174
+ expect(groupAsWriter.groupMap.get(writer.id)).toEqual("writer");
175
175
 
176
176
  const otherAgent = node.createAccount("otherAgent");
177
177
 
178
- expect(() => teamAsWriter.addMember(otherAgent.id, "admin")).toThrow(
178
+ expect(() => groupAsWriter.addMember(otherAgent.id, "admin")).toThrow(
179
179
  "Failed to set role"
180
180
  );
181
- expect(() => teamAsWriter.addMember(otherAgent.id, "writer")).toThrow(
181
+ expect(() => groupAsWriter.addMember(otherAgent.id, "writer")).toThrow(
182
182
  "Failed to set role"
183
183
  );
184
- expect(() => teamAsWriter.addMember(otherAgent.id, "reader")).toThrow(
184
+ expect(() => groupAsWriter.addMember(otherAgent.id, "reader")).toThrow(
185
185
  "Failed to set role"
186
186
  );
187
187
 
188
- expect(teamAsWriter.teamMap.get(otherAgent.id)).toBeUndefined();
188
+ expect(groupAsWriter.groupMap.get(otherAgent.id)).toBeUndefined();
189
189
  });
190
190
 
191
- test("Admins can add readers to a team, who can't add admins, writers, or readers", () => {
192
- const { team, node } = newTeam();
191
+ test("Admins can add readers to a group, who can't add admins, writers, or readers", () => {
192
+ const { group, node } = newGroup();
193
193
  const reader = node.createAccount("reader");
194
194
 
195
- let teamContent = expectTeamContent(team.getCurrentContent());
195
+ let groupContent = expectGroupContent(group.getCurrentContent());
196
196
 
197
- teamContent.edit((editable) => {
197
+ groupContent.edit((editable) => {
198
198
  editable.set(reader.id, "reader", "trusting");
199
199
  expect(editable.get(reader.id)).toEqual("reader");
200
200
  });
201
201
 
202
- teamContent = expectTeamContent(team.getCurrentContent());
203
- expect(teamContent.get(reader.id)).toEqual("reader");
202
+ groupContent = expectGroupContent(group.getCurrentContent());
203
+ expect(groupContent.get(reader.id)).toEqual("reader");
204
204
 
205
- const teamAsReader = team.testWithDifferentAccount(
205
+ const groupAsReader = group.testWithDifferentAccount(
206
206
  reader,
207
207
  newRandomSessionID(reader.id)
208
208
  );
209
209
 
210
- let teamContentAsReader = expectTeamContent(
211
- teamAsReader.getCurrentContent()
210
+ let groupContentAsReader = expectGroupContent(
211
+ groupAsReader.getCurrentContent()
212
212
  );
213
213
 
214
- expect(teamContentAsReader.get(reader.id)).toEqual("reader");
214
+ expect(groupContentAsReader.get(reader.id)).toEqual("reader");
215
215
 
216
216
  const otherAgent = node.createAccount("otherAgent");
217
217
 
218
- teamContentAsReader.edit((editable) => {
218
+ groupContentAsReader.edit((editable) => {
219
219
  editable.set(otherAgent.id, "admin", "trusting");
220
220
  expect(editable.get(otherAgent.id)).toBeUndefined();
221
221
 
@@ -226,47 +226,47 @@ test("Admins can add readers to a team, who can't add admins, writers, or reader
226
226
  expect(editable.get(otherAgent.id)).toBeUndefined();
227
227
  });
228
228
 
229
- teamContentAsReader = expectTeamContent(teamAsReader.getCurrentContent());
229
+ groupContentAsReader = expectGroupContent(groupAsReader.getCurrentContent());
230
230
 
231
- expect(teamContentAsReader.get(otherAgent.id)).toBeUndefined();
231
+ expect(groupContentAsReader.get(otherAgent.id)).toBeUndefined();
232
232
  });
233
233
 
234
- test("Admins can add readers to a team, who can't add admins, writers, or readers (high level)", () => {
235
- const { team, node } = newTeamHighLevel();
234
+ test("Admins can add readers to a group, who can't add admins, writers, or readers (high level)", () => {
235
+ const { group, node } = newGroupHighLevel();
236
236
 
237
237
  const reader = node.createAccount("reader");
238
238
 
239
- team.addMember(reader.id, "reader");
240
- expect(team.teamMap.get(reader.id)).toEqual("reader");
239
+ group.addMember(reader.id, "reader");
240
+ expect(group.groupMap.get(reader.id)).toEqual("reader");
241
241
 
242
- const teamAsReader = team.testWithDifferentAccount(
242
+ const groupAsReader = group.testWithDifferentAccount(
243
243
  reader,
244
244
  newRandomSessionID(reader.id)
245
245
  );
246
246
 
247
- expect(teamAsReader.teamMap.get(reader.id)).toEqual("reader");
247
+ expect(groupAsReader.groupMap.get(reader.id)).toEqual("reader");
248
248
 
249
249
  const otherAgent = node.createAccount("otherAgent");
250
250
 
251
- expect(() => teamAsReader.addMember(otherAgent.id, "admin")).toThrow(
251
+ expect(() => groupAsReader.addMember(otherAgent.id, "admin")).toThrow(
252
252
  "Failed to set role"
253
253
  );
254
- expect(() => teamAsReader.addMember(otherAgent.id, "writer")).toThrow(
254
+ expect(() => groupAsReader.addMember(otherAgent.id, "writer")).toThrow(
255
255
  "Failed to set role"
256
256
  );
257
- expect(() => teamAsReader.addMember(otherAgent.id, "reader")).toThrow(
257
+ expect(() => groupAsReader.addMember(otherAgent.id, "reader")).toThrow(
258
258
  "Failed to set role"
259
259
  );
260
260
 
261
- expect(teamAsReader.teamMap.get(otherAgent.id)).toBeUndefined();
261
+ expect(groupAsReader.groupMap.get(otherAgent.id)).toBeUndefined();
262
262
  });
263
263
 
264
- test("Admins can write to an object that is owned by their team", () => {
265
- const { node, team } = newTeam();
264
+ test("Admins can write to an object that is owned by their group", () => {
265
+ const { node, group } = newGroup();
266
266
 
267
267
  const childObject = node.createCoValue({
268
268
  type: "comap",
269
- ruleset: { type: "ownedByTeam", team: team.id },
269
+ ruleset: { type: "ownedByGroup", group: group.id },
270
270
  meta: null,
271
271
  ...createdNowUnique(),
272
272
  });
@@ -283,10 +283,10 @@ test("Admins can write to an object that is owned by their team", () => {
283
283
  expect(childContent.get("foo")).toEqual("bar");
284
284
  });
285
285
 
286
- test("Admins can write to an object that is owned by their team (high level)", () => {
287
- const { node, team } = newTeamHighLevel();
286
+ test("Admins can write to an object that is owned by their group (high level)", () => {
287
+ const { node, group } = newGroupHighLevel();
288
288
 
289
- let childObject = team.createMap();
289
+ let childObject = group.createMap();
290
290
 
291
291
  childObject = childObject.edit((editable) => {
292
292
  editable.set("foo", "bar", "trusting");
@@ -296,19 +296,19 @@ test("Admins can write to an object that is owned by their team (high level)", (
296
296
  expect(childObject.get("foo")).toEqual("bar");
297
297
  });
298
298
 
299
- test("Writers can write to an object that is owned by their team", () => {
300
- const { node, team } = newTeam();
299
+ test("Writers can write to an object that is owned by their group", () => {
300
+ const { node, group } = newGroup();
301
301
 
302
302
  const writer = node.createAccount("writer");
303
303
 
304
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
304
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
305
305
  editable.set(writer.id, "writer", "trusting");
306
306
  expect(editable.get(writer.id)).toEqual("writer");
307
307
  });
308
308
 
309
309
  const childObject = node.createCoValue({
310
310
  type: "comap",
311
- ruleset: { type: "ownedByTeam", team: team.id },
311
+ ruleset: { type: "ownedByGroup", group: group.id },
312
312
  meta: null,
313
313
  ...createdNowUnique(),
314
314
  });
@@ -332,14 +332,14 @@ test("Writers can write to an object that is owned by their team", () => {
332
332
  expect(childContentAsWriter.get("foo")).toEqual("bar");
333
333
  });
334
334
 
335
- test("Writers can write to an object that is owned by their team (high level)", () => {
336
- const { node, team } = newTeamHighLevel();
335
+ test("Writers can write to an object that is owned by their group (high level)", () => {
336
+ const { node, group } = newGroupHighLevel();
337
337
 
338
338
  const writer = node.createAccount("writer");
339
339
 
340
- team.addMember(writer.id, "writer");
340
+ group.addMember(writer.id, "writer");
341
341
 
342
- const childObject = team.createMap();
342
+ const childObject = group.createMap();
343
343
 
344
344
  let childObjectAsWriter = expectMap(
345
345
  childObject.coValue
@@ -355,19 +355,19 @@ test("Writers can write to an object that is owned by their team (high level)",
355
355
  expect(childObjectAsWriter.get("foo")).toEqual("bar");
356
356
  });
357
357
 
358
- test("Readers can not write to an object that is owned by their team", () => {
359
- const { node, team } = newTeam();
358
+ test("Readers can not write to an object that is owned by their group", () => {
359
+ const { node, group } = newGroup();
360
360
 
361
361
  const reader = node.createAccount("reader");
362
362
 
363
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
363
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
364
364
  editable.set(reader.id, "reader", "trusting");
365
365
  expect(editable.get(reader.id)).toEqual("reader");
366
366
  });
367
367
 
368
368
  const childObject = node.createCoValue({
369
369
  type: "comap",
370
- ruleset: { type: "ownedByTeam", team: team.id },
370
+ ruleset: { type: "ownedByGroup", group: group.id },
371
371
  meta: null,
372
372
  ...createdNowUnique(),
373
373
  });
@@ -391,14 +391,14 @@ test("Readers can not write to an object that is owned by their team", () => {
391
391
  expect(childContentAsReader.get("foo")).toBeUndefined();
392
392
  });
393
393
 
394
- test("Readers can not write to an object that is owned by their team (high level)", () => {
395
- const { node, team } = newTeamHighLevel();
394
+ test("Readers can not write to an object that is owned by their group (high level)", () => {
395
+ const { node, group } = newGroupHighLevel();
396
396
 
397
397
  const reader = node.createAccount("reader");
398
398
 
399
- team.addMember(reader.id, "reader");
399
+ group.addMember(reader.id, "reader");
400
400
 
401
- const childObject = team.createMap();
401
+ const childObject = group.createMap();
402
402
 
403
403
  let childObjectAsReader = expectMap(
404
404
  childObject.coValue
@@ -414,20 +414,20 @@ test("Readers can not write to an object that is owned by their team (high level
414
414
  expect(childObjectAsReader.get("foo")).toBeUndefined();
415
415
  });
416
416
 
417
- test("Admins can set team read key and then use it to create and read private transactions in owned objects", () => {
418
- const { node, team, admin } = newTeam();
417
+ test("Admins can set group read key and then use it to create and read private transactions in owned objects", () => {
418
+ const { node, group, admin } = newGroup();
419
419
 
420
- const teamContent = expectTeamContent(team.getCurrentContent());
420
+ const groupContent = expectGroupContent(group.getCurrentContent());
421
421
 
422
- teamContent.edit((editable) => {
422
+ groupContent.edit((editable) => {
423
423
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
424
424
  const revelation = seal(
425
425
  readKey,
426
426
  admin.currentSealerSecret(),
427
427
  admin.currentSealerID(),
428
428
  {
429
- in: team.id,
430
- tx: team.nextTransactionID(),
429
+ in: group.id,
430
+ tx: group.nextTransactionID(),
431
431
  }
432
432
  );
433
433
 
@@ -441,12 +441,12 @@ test("Admins can set team read key and then use it to create and read private tr
441
441
 
442
442
  expect(editable.get("readKey")).toEqual(readKeyID);
443
443
 
444
- expect(team.getCurrentReadKey().secret).toEqual(readKey);
444
+ expect(group.getCurrentReadKey().secret).toEqual(readKey);
445
445
  });
446
446
 
447
447
  const childObject = node.createCoValue({
448
448
  type: "comap",
449
- ruleset: { type: "ownedByTeam", team: team.id },
449
+ ruleset: { type: "ownedByGroup", group: group.id },
450
450
  meta: null,
451
451
  ...createdNowUnique(),
452
452
  });
@@ -462,10 +462,10 @@ test("Admins can set team read key and then use it to create and read private tr
462
462
  expect(childContent.get("foo")).toEqual("bar");
463
463
  });
464
464
 
465
- test("Admins can set team read key and then use it to create and read private transactions in owned objects (high level)", () => {
466
- const { node, team, admin } = newTeamHighLevel();
465
+ test("Admins can set group read key and then use it to create and read private transactions in owned objects (high level)", () => {
466
+ const { node, group, admin } = newGroupHighLevel();
467
467
 
468
- let childObject = team.createMap();
468
+ let childObject = group.createMap();
469
469
 
470
470
  childObject = childObject.edit((editable) => {
471
471
  editable.set("foo", "bar", "private");
@@ -475,16 +475,16 @@ test("Admins can set team read key and then use it to create and read private tr
475
475
  expect(childObject.get("foo")).toEqual("bar");
476
476
  });
477
477
 
478
- test("Admins can set team read key and then writers can use it to create and read private transactions in owned objects", () => {
479
- const { node, team, admin } = newTeam();
478
+ test("Admins can set group read key and then writers can use it to create and read private transactions in owned objects", () => {
479
+ const { node, group, admin } = newGroup();
480
480
 
481
481
  const writer = node.createAccount("writer");
482
482
 
483
483
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
484
484
 
485
- const teamContent = expectTeamContent(team.getCurrentContent());
485
+ const groupContent = expectGroupContent(group.getCurrentContent());
486
486
 
487
- teamContent.edit((editable) => {
487
+ groupContent.edit((editable) => {
488
488
  editable.set(writer.id, "writer", "trusting");
489
489
  expect(editable.get(writer.id)).toEqual("writer");
490
490
 
@@ -493,8 +493,8 @@ test("Admins can set team read key and then writers can use it to create and rea
493
493
  admin.currentSealerSecret(),
494
494
  admin.currentSealerID(),
495
495
  {
496
- in: team.id,
497
- tx: team.nextTransactionID(),
496
+ in: group.id,
497
+ tx: group.nextTransactionID(),
498
498
  }
499
499
  );
500
500
 
@@ -505,8 +505,8 @@ test("Admins can set team read key and then writers can use it to create and rea
505
505
  admin.currentSealerSecret(),
506
506
  writer.currentSealerID(),
507
507
  {
508
- in: team.id,
509
- tx: team.nextTransactionID(),
508
+ in: group.id,
509
+ tx: group.nextTransactionID(),
510
510
  }
511
511
  );
512
512
 
@@ -517,7 +517,7 @@ test("Admins can set team read key and then writers can use it to create and rea
517
517
 
518
518
  const childObject = node.createCoValue({
519
519
  type: "comap",
520
- ruleset: { type: "ownedByTeam", team: team.id },
520
+ ruleset: { type: "ownedByGroup", group: group.id },
521
521
  meta: null,
522
522
  ...createdNowUnique(),
523
523
  });
@@ -543,14 +543,14 @@ test("Admins can set team read key and then writers can use it to create and rea
543
543
  expect(childContentAsWriter.get("foo")).toEqual("bar");
544
544
  });
545
545
 
546
- test("Admins can set team read key and then writers can use it to create and read private transactions in owned objects (high level)", () => {
547
- const { node, team, admin } = newTeamHighLevel();
546
+ test("Admins can set group read key and then writers can use it to create and read private transactions in owned objects (high level)", () => {
547
+ const { node, group, admin } = newGroupHighLevel();
548
548
 
549
549
  const writer = node.createAccount("writer");
550
550
 
551
- team.addMember(writer.id, "writer");
551
+ group.addMember(writer.id, "writer");
552
552
 
553
- const childObject = team.createMap();
553
+ const childObject = group.createMap();
554
554
 
555
555
  let childObjectAsWriter = expectMap(
556
556
  childObject.coValue
@@ -566,16 +566,16 @@ test("Admins can set team read key and then writers can use it to create and rea
566
566
  expect(childObjectAsWriter.get("foo")).toEqual("bar");
567
567
  });
568
568
 
569
- test("Admins can set team read key and then use it to create private transactions in owned objects, which readers can read", () => {
570
- const { node, team, admin } = newTeam();
569
+ test("Admins can set group read key and then use it to create private transactions in owned objects, which readers can read", () => {
570
+ const { node, group, admin } = newGroup();
571
571
 
572
572
  const reader = node.createAccount("reader");
573
573
 
574
574
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
575
575
 
576
- const teamContent = expectTeamContent(team.getCurrentContent());
576
+ const groupContent = expectGroupContent(group.getCurrentContent());
577
577
 
578
- teamContent.edit((editable) => {
578
+ groupContent.edit((editable) => {
579
579
  editable.set(reader.id, "reader", "trusting");
580
580
  expect(editable.get(reader.id)).toEqual("reader");
581
581
 
@@ -584,8 +584,8 @@ test("Admins can set team read key and then use it to create private transaction
584
584
  admin.currentSealerSecret(),
585
585
  admin.currentSealerID(),
586
586
  {
587
- in: team.id,
588
- tx: team.nextTransactionID(),
587
+ in: group.id,
588
+ tx: group.nextTransactionID(),
589
589
  }
590
590
  );
591
591
 
@@ -596,8 +596,8 @@ test("Admins can set team read key and then use it to create private transaction
596
596
  admin.currentSealerSecret(),
597
597
  reader.currentSealerID(),
598
598
  {
599
- in: team.id,
600
- tx: team.nextTransactionID(),
599
+ in: group.id,
600
+ tx: group.nextTransactionID(),
601
601
  }
602
602
  );
603
603
 
@@ -608,7 +608,7 @@ test("Admins can set team read key and then use it to create private transaction
608
608
 
609
609
  const childObject = node.createCoValue({
610
610
  type: "comap",
611
- ruleset: { type: "ownedByTeam", team: team.id },
611
+ ruleset: { type: "ownedByGroup", group: group.id },
612
612
  meta: null,
613
613
  ...createdNowUnique(),
614
614
  });
@@ -632,14 +632,14 @@ test("Admins can set team read key and then use it to create private transaction
632
632
  expect(childContentAsReader.get("foo")).toEqual("bar");
633
633
  });
634
634
 
635
- test("Admins can set team read key and then use it to create private transactions in owned objects, which readers can read (high level)", () => {
636
- const { node, team, admin } = newTeamHighLevel();
635
+ test("Admins can set group read key and then use it to create private transactions in owned objects, which readers can read (high level)", () => {
636
+ const { node, group, admin } = newGroupHighLevel();
637
637
 
638
638
  const reader = node.createAccount("reader");
639
639
 
640
- team.addMember(reader.id, "reader");
640
+ group.addMember(reader.id, "reader");
641
641
 
642
- let childObject = team.createMap();
642
+ let childObject = group.createMap();
643
643
 
644
644
  childObject = childObject.edit((editable) => {
645
645
  editable.set("foo", "bar", "private");
@@ -655,8 +655,8 @@ test("Admins can set team read key and then use it to create private transaction
655
655
  expect(childContentAsReader.get("foo")).toEqual("bar");
656
656
  });
657
657
 
658
- test("Admins can set team read key and then use it to create private transactions in owned objects, which readers can read, even with a separate later revelation for the same read key", () => {
659
- const { node, team, admin } = newTeam();
658
+ test("Admins can set group read key and then use it to create private transactions in owned objects, which readers can read, even with a separate later revelation for the same read key", () => {
659
+ const { node, group, admin } = newGroup();
660
660
 
661
661
  const reader1 = node.createAccount("reader1");
662
662
 
@@ -664,9 +664,9 @@ test("Admins can set team read key and then use it to create private transaction
664
664
 
665
665
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
666
666
 
667
- const teamContent = expectTeamContent(team.getCurrentContent());
667
+ const groupContent = expectGroupContent(group.getCurrentContent());
668
668
 
669
- teamContent.edit((editable) => {
669
+ groupContent.edit((editable) => {
670
670
  editable.set(reader1.id, "reader", "trusting");
671
671
  expect(editable.get(reader1.id)).toEqual("reader");
672
672
 
@@ -675,8 +675,8 @@ test("Admins can set team read key and then use it to create private transaction
675
675
  admin.currentSealerSecret(),
676
676
  admin.currentSealerID(),
677
677
  {
678
- in: team.id,
679
- tx: team.nextTransactionID(),
678
+ in: group.id,
679
+ tx: group.nextTransactionID(),
680
680
  }
681
681
  );
682
682
 
@@ -687,8 +687,8 @@ test("Admins can set team read key and then use it to create private transaction
687
687
  admin.currentSealerSecret(),
688
688
  reader1.currentSealerID(),
689
689
  {
690
- in: team.id,
691
- tx: team.nextTransactionID(),
690
+ in: group.id,
691
+ tx: group.nextTransactionID(),
692
692
  }
693
693
  );
694
694
 
@@ -699,7 +699,7 @@ test("Admins can set team read key and then use it to create private transaction
699
699
 
700
700
  const childObject = node.createCoValue({
701
701
  type: "comap",
702
- ruleset: { type: "ownedByTeam", team: team.id },
702
+ ruleset: { type: "ownedByGroup", group: group.id },
703
703
  meta: null,
704
704
  ...createdNowUnique(),
705
705
  });
@@ -722,14 +722,14 @@ test("Admins can set team read key and then use it to create private transaction
722
722
 
723
723
  expect(childContentAsReader1.get("foo")).toEqual("bar");
724
724
 
725
- teamContent.edit((editable) => {
725
+ groupContent.edit((editable) => {
726
726
  const revelation3 = seal(
727
727
  readKey,
728
728
  admin.currentSealerSecret(),
729
729
  reader2.currentSealerID(),
730
730
  {
731
- in: team.id,
732
- tx: team.nextTransactionID(),
731
+ in: group.id,
732
+ tx: group.nextTransactionID(),
733
733
  }
734
734
  );
735
735
 
@@ -750,16 +750,16 @@ test("Admins can set team read key and then use it to create private transaction
750
750
  expect(childContentAsReader2.get("foo")).toEqual("bar");
751
751
  });
752
752
 
753
- test("Admins can set team read key and then use it to create private transactions in owned objects, which readers can read, even with a separate later revelation for the same read key (high level)", () => {
754
- const { node, team, admin } = newTeamHighLevel();
753
+ test("Admins can set group read key and then use it to create private transactions in owned objects, which readers can read, even with a separate later revelation for the same read key (high level)", () => {
754
+ const { node, group, admin } = newGroupHighLevel();
755
755
 
756
756
  const reader1 = node.createAccount("reader1");
757
757
 
758
758
  const reader2 = node.createAccount("reader2");
759
759
 
760
- team.addMember(reader1.id, "reader");
760
+ group.addMember(reader1.id, "reader");
761
761
 
762
- let childObject = team.createMap();
762
+ let childObject = group.createMap();
763
763
 
764
764
  childObject = childObject.edit((editable) => {
765
765
  editable.set("foo", "bar", "private");
@@ -774,7 +774,7 @@ test("Admins can set team read key and then use it to create private transaction
774
774
 
775
775
  expect(childContentAsReader1.get("foo")).toEqual("bar");
776
776
 
777
- team.addMember(reader2.id, "reader");
777
+ group.addMember(reader2.id, "reader");
778
778
 
779
779
  const childContentAsReader2 = expectMap(
780
780
  childObject.coValue
@@ -785,20 +785,20 @@ test("Admins can set team read key and then use it to create private transaction
785
785
  expect(childContentAsReader2.get("foo")).toEqual("bar");
786
786
  });
787
787
 
788
- test("Admins can set team read key, make a private transaction in an owned object, rotate the read key, make another private transaction, and both can be read by the admin", () => {
789
- const { node, team, admin } = newTeam();
788
+ test("Admins can set group read key, make a private transaction in an owned object, rotate the read key, make another private transaction, and both can be read by the admin", () => {
789
+ const { node, group, admin } = newGroup();
790
790
 
791
- const teamContent = expectTeamContent(team.getCurrentContent());
791
+ const groupContent = expectGroupContent(group.getCurrentContent());
792
792
 
793
- teamContent.edit((editable) => {
793
+ groupContent.edit((editable) => {
794
794
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
795
795
  const revelation = seal(
796
796
  readKey,
797
797
  admin.currentSealerSecret(),
798
798
  admin.currentSealerID(),
799
799
  {
800
- in: team.id,
801
- tx: team.nextTransactionID(),
800
+ in: group.id,
801
+ tx: group.nextTransactionID(),
802
802
  }
803
803
  );
804
804
 
@@ -806,12 +806,12 @@ test("Admins can set team read key, make a private transaction in an owned objec
806
806
 
807
807
  editable.set("readKey", readKeyID, "trusting");
808
808
  expect(editable.get("readKey")).toEqual(readKeyID);
809
- expect(team.getCurrentReadKey().secret).toEqual(readKey);
809
+ expect(group.getCurrentReadKey().secret).toEqual(readKey);
810
810
  });
811
811
 
812
812
  const childObject = node.createCoValue({
813
813
  type: "comap",
814
- ruleset: { type: "ownedByTeam", team: team.id },
814
+ ruleset: { type: "ownedByGroup", group: group.id },
815
815
  meta: null,
816
816
  ...createdNowUnique(),
817
817
  });
@@ -826,7 +826,7 @@ test("Admins can set team read key, make a private transaction in an owned objec
826
826
  childContent = expectMap(childObject.getCurrentContent());
827
827
  expect(childContent.get("foo")).toEqual("bar");
828
828
 
829
- teamContent.edit((editable) => {
829
+ groupContent.edit((editable) => {
830
830
  const { secret: readKey2, id: readKeyID2 } = newRandomKeySecret();
831
831
 
832
832
  const revelation = seal(
@@ -834,8 +834,8 @@ test("Admins can set team read key, make a private transaction in an owned objec
834
834
  admin.currentSealerSecret(),
835
835
  admin.currentSealerID(),
836
836
  {
837
- in: team.id,
838
- tx: team.nextTransactionID(),
837
+ in: group.id,
838
+ tx: group.nextTransactionID(),
839
839
  }
840
840
  );
841
841
 
@@ -843,7 +843,7 @@ test("Admins can set team read key, make a private transaction in an owned objec
843
843
 
844
844
  editable.set("readKey", readKeyID2, "trusting");
845
845
  expect(editable.get("readKey")).toEqual(readKeyID2);
846
- expect(team.getCurrentReadKey().secret).toEqual(readKey2);
846
+ expect(group.getCurrentReadKey().secret).toEqual(readKey2);
847
847
  });
848
848
 
849
849
  childContent = expectMap(childObject.getCurrentContent());
@@ -858,10 +858,10 @@ test("Admins can set team read key, make a private transaction in an owned objec
858
858
  expect(childContent.get("foo2")).toEqual("bar2");
859
859
  });
860
860
 
861
- test("Admins can set team read key, make a private transaction in an owned object, rotate the read key, make another private transaction, and both can be read by the admin (high level)", () => {
862
- const { team } = newTeamHighLevel();
861
+ test("Admins can set group read key, make a private transaction in an owned object, rotate the read key, make another private transaction, and both can be read by the admin (high level)", () => {
862
+ const { group } = newGroupHighLevel();
863
863
 
864
- let childObject = team.createMap();
864
+ let childObject = group.createMap();
865
865
 
866
866
  const firstReadKey = childObject.coValue.getCurrentReadKey();
867
867
 
@@ -872,7 +872,7 @@ test("Admins can set team read key, make a private transaction in an owned objec
872
872
 
873
873
  expect(childObject.get("foo")).toEqual("bar");
874
874
 
875
- team.rotateReadKey();
875
+ group.rotateReadKey();
876
876
 
877
877
  expect(childObject.coValue.getCurrentReadKey()).not.toEqual(firstReadKey);
878
878
 
@@ -885,27 +885,27 @@ test("Admins can set team read key, make a private transaction in an owned objec
885
885
  expect(childObject.get("foo2")).toEqual("bar2");
886
886
  });
887
887
 
888
- test("Admins can set team read key, make a private transaction in an owned object, rotate the read key, add a reader, make another private transaction in the owned object, and both can be read by the reader", () => {
889
- const { node, team, admin } = newTeam();
888
+ test("Admins can set group read key, make a private transaction in an owned object, rotate the read key, add a reader, make another private transaction in the owned object, and both can be read by the reader", () => {
889
+ const { node, group, admin } = newGroup();
890
890
 
891
891
  const childObject = node.createCoValue({
892
892
  type: "comap",
893
- ruleset: { type: "ownedByTeam", team: team.id },
893
+ ruleset: { type: "ownedByGroup", group: group.id },
894
894
  meta: null,
895
895
  ...createdNowUnique(),
896
896
  });
897
897
 
898
- const teamContent = expectTeamContent(team.getCurrentContent());
898
+ const groupContent = expectGroupContent(group.getCurrentContent());
899
899
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
900
900
 
901
- teamContent.edit((editable) => {
901
+ groupContent.edit((editable) => {
902
902
  const revelation = seal(
903
903
  readKey,
904
904
  admin.currentSealerSecret(),
905
905
  admin.currentSealerID(),
906
906
  {
907
- in: team.id,
908
- tx: team.nextTransactionID(),
907
+ in: group.id,
908
+ tx: group.nextTransactionID(),
909
909
  }
910
910
  );
911
911
 
@@ -913,7 +913,7 @@ test("Admins can set team read key, make a private transaction in an owned objec
913
913
 
914
914
  editable.set("readKey", readKeyID, "trusting");
915
915
  expect(editable.get("readKey")).toEqual(readKeyID);
916
- expect(team.getCurrentReadKey().secret).toEqual(readKey);
916
+ expect(group.getCurrentReadKey().secret).toEqual(readKey);
917
917
  });
918
918
 
919
919
  let childContent = expectMap(childObject.getCurrentContent());
@@ -930,14 +930,14 @@ test("Admins can set team read key, make a private transaction in an owned objec
930
930
 
931
931
  const { secret: readKey2, id: readKeyID2 } = newRandomKeySecret();
932
932
 
933
- teamContent.edit((editable) => {
933
+ groupContent.edit((editable) => {
934
934
  const revelation2 = seal(
935
935
  readKey2,
936
936
  admin.currentSealerSecret(),
937
937
  admin.currentSealerID(),
938
938
  {
939
- in: team.id,
940
- tx: team.nextTransactionID(),
939
+ in: group.id,
940
+ tx: group.nextTransactionID(),
941
941
  }
942
942
  );
943
943
 
@@ -948,8 +948,8 @@ test("Admins can set team read key, make a private transaction in an owned objec
948
948
  admin.currentSealerSecret(),
949
949
  reader.currentSealerID(),
950
950
  {
951
- in: team.id,
952
- tx: team.nextTransactionID(),
951
+ in: group.id,
952
+ tx: group.nextTransactionID(),
953
953
  }
954
954
  );
955
955
 
@@ -967,7 +967,7 @@ test("Admins can set team read key, make a private transaction in an owned objec
967
967
  editable.set("readKey", readKeyID2, "trusting");
968
968
 
969
969
  expect(editable.get("readKey")).toEqual(readKeyID2);
970
- expect(team.getCurrentReadKey().secret).toEqual(readKey2);
970
+ expect(group.getCurrentReadKey().secret).toEqual(readKey2);
971
971
 
972
972
  editable.set(reader.id, "reader", "trusting");
973
973
  expect(editable.get(reader.id)).toEqual("reader");
@@ -993,10 +993,10 @@ test("Admins can set team read key, make a private transaction in an owned objec
993
993
  expect(childContentAsReader.get("foo2")).toEqual("bar2");
994
994
  });
995
995
 
996
- test("Admins can set team read key, make a private transaction in an owned object, rotate the read key, add a reader, make another private transaction in the owned object, and both can be read by the reader (high level)", () => {
997
- const { node, team } = newTeamHighLevel();
996
+ test("Admins can set group read key, make a private transaction in an owned object, rotate the read key, add a reader, make another private transaction in the owned object, and both can be read by the reader (high level)", () => {
997
+ const { node, group } = newGroupHighLevel();
998
998
 
999
- let childObject = team.createMap();
999
+ let childObject = group.createMap();
1000
1000
 
1001
1001
  const firstReadKey = childObject.coValue.getCurrentReadKey();
1002
1002
 
@@ -1007,13 +1007,13 @@ test("Admins can set team read key, make a private transaction in an owned objec
1007
1007
 
1008
1008
  expect(childObject.get("foo")).toEqual("bar");
1009
1009
 
1010
- team.rotateReadKey();
1010
+ group.rotateReadKey();
1011
1011
 
1012
1012
  expect(childObject.coValue.getCurrentReadKey()).not.toEqual(firstReadKey);
1013
1013
 
1014
1014
  const reader = node.createAccount("reader");
1015
1015
 
1016
- team.addMember(reader.id, "reader");
1016
+ group.addMember(reader.id, "reader");
1017
1017
 
1018
1018
  childObject = childObject.edit((editable) => {
1019
1019
  editable.set("foo2", "bar2", "private");
@@ -1030,30 +1030,30 @@ test("Admins can set team read key, make a private transaction in an owned objec
1030
1030
  expect(childContentAsReader.get("foo2")).toEqual("bar2");
1031
1031
  });
1032
1032
 
1033
- test("Admins can set team read rey, make a private transaction in an owned object, rotate the read key, add two readers, rotate the read key again to kick out one reader, make another private transaction in the owned object, and only the remaining reader can read both transactions", () => {
1034
- const { node, team, admin } = newTeam();
1033
+ test("Admins can set group read rey, make a private transaction in an owned object, rotate the read key, add two readers, rotate the read key again to kick out one reader, make another private transaction in the owned object, and only the remaining reader can read both transactions", () => {
1034
+ const { node, group, admin } = newGroup();
1035
1035
 
1036
1036
  const childObject = node.createCoValue({
1037
1037
  type: "comap",
1038
- ruleset: { type: "ownedByTeam", team: team.id },
1038
+ ruleset: { type: "ownedByGroup", group: group.id },
1039
1039
  meta: null,
1040
1040
  ...createdNowUnique(),
1041
1041
  });
1042
1042
 
1043
- const teamContent = expectTeamContent(team.getCurrentContent());
1043
+ const groupContent = expectGroupContent(group.getCurrentContent());
1044
1044
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1045
1045
  const reader = node.createAccount("reader");
1046
1046
 
1047
1047
  const reader2 = node.createAccount("reader2");
1048
1048
 
1049
- teamContent.edit((editable) => {
1049
+ groupContent.edit((editable) => {
1050
1050
  const revelation1 = seal(
1051
1051
  readKey,
1052
1052
  admin.currentSealerSecret(),
1053
1053
  admin.currentSealerID(),
1054
1054
  {
1055
- in: team.id,
1056
- tx: team.nextTransactionID(),
1055
+ in: group.id,
1056
+ tx: group.nextTransactionID(),
1057
1057
  }
1058
1058
  );
1059
1059
 
@@ -1064,8 +1064,8 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1064
1064
  admin.currentSealerSecret(),
1065
1065
  reader.currentSealerID(),
1066
1066
  {
1067
- in: team.id,
1068
- tx: team.nextTransactionID(),
1067
+ in: group.id,
1068
+ tx: group.nextTransactionID(),
1069
1069
  }
1070
1070
  );
1071
1071
 
@@ -1076,8 +1076,8 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1076
1076
  admin.currentSealerSecret(),
1077
1077
  reader2.currentSealerID(),
1078
1078
  {
1079
- in: team.id,
1080
- tx: team.nextTransactionID(),
1079
+ in: group.id,
1080
+ tx: group.nextTransactionID(),
1081
1081
  }
1082
1082
  );
1083
1083
 
@@ -1085,7 +1085,7 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1085
1085
 
1086
1086
  editable.set("readKey", readKeyID, "trusting");
1087
1087
  expect(editable.get("readKey")).toEqual(readKeyID);
1088
- expect(team.getCurrentReadKey().secret).toEqual(readKey);
1088
+ expect(group.getCurrentReadKey().secret).toEqual(readKey);
1089
1089
 
1090
1090
  editable.set(reader.id, "reader", "trusting");
1091
1091
  expect(editable.get(reader.id)).toEqual("reader");
@@ -1123,14 +1123,14 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1123
1123
 
1124
1124
  const { secret: readKey2, id: readKeyID2 } = newRandomKeySecret();
1125
1125
 
1126
- teamContent.edit((editable) => {
1126
+ groupContent.edit((editable) => {
1127
1127
  const newRevelation1 = seal(
1128
1128
  readKey2,
1129
1129
  admin.currentSealerSecret(),
1130
1130
  admin.currentSealerID(),
1131
1131
  {
1132
- in: team.id,
1133
- tx: team.nextTransactionID(),
1132
+ in: group.id,
1133
+ tx: group.nextTransactionID(),
1134
1134
  }
1135
1135
  );
1136
1136
 
@@ -1145,8 +1145,8 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1145
1145
  admin.currentSealerSecret(),
1146
1146
  reader2.currentSealerID(),
1147
1147
  {
1148
- in: team.id,
1149
- tx: team.nextTransactionID(),
1148
+ in: group.id,
1149
+ tx: group.nextTransactionID(),
1150
1150
  }
1151
1151
  );
1152
1152
 
@@ -1158,7 +1158,7 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1158
1158
 
1159
1159
  editable.set("readKey", readKeyID2, "trusting");
1160
1160
  expect(editable.get("readKey")).toEqual(readKeyID2);
1161
- expect(team.getCurrentReadKey().secret).toEqual(readKey2);
1161
+ expect(group.getCurrentReadKey().secret).toEqual(readKey2);
1162
1162
 
1163
1163
  editable.set(reader.id, "revoked", "trusting");
1164
1164
  // expect(editable.get(reader.id)).toEqual("revoked");
@@ -1190,10 +1190,10 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1190
1190
  ).toEqual("bar2");
1191
1191
  });
1192
1192
 
1193
- test("Admins can set team read rey, make a private transaction in an owned object, rotate the read key, add two readers, rotate the read key again to kick out one reader, make another private transaction in the owned object, and only the remaining reader can read both transactions (high level)", () => {
1194
- const { node, team } = newTeamHighLevel();
1193
+ test("Admins can set group read rey, make a private transaction in an owned object, rotate the read key, add two readers, rotate the read key again to kick out one reader, make another private transaction in the owned object, and only the remaining reader can read both transactions (high level)", () => {
1194
+ const { node, group } = newGroupHighLevel();
1195
1195
 
1196
- let childObject = team.createMap();
1196
+ let childObject = group.createMap();
1197
1197
 
1198
1198
  childObject = childObject.edit((editable) => {
1199
1199
  editable.set("foo", "bar", "private");
@@ -1202,7 +1202,7 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1202
1202
 
1203
1203
  expect(childObject.get("foo")).toEqual("bar");
1204
1204
 
1205
- team.rotateReadKey();
1205
+ group.rotateReadKey();
1206
1206
 
1207
1207
  const secondReadKey = childObject.coValue.getCurrentReadKey();
1208
1208
 
@@ -1210,8 +1210,8 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1210
1210
 
1211
1211
  const reader2 = node.createAccount("reader2");
1212
1212
 
1213
- team.addMember(reader.id, "reader");
1214
- team.addMember(reader2.id, "reader");
1213
+ group.addMember(reader.id, "reader");
1214
+ group.addMember(reader2.id, "reader");
1215
1215
 
1216
1216
  childObject = childObject.edit((editable) => {
1217
1217
  editable.set("foo2", "bar2", "private");
@@ -1221,7 +1221,7 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1221
1221
  expect(childObject.get("foo")).toEqual("bar");
1222
1222
  expect(childObject.get("foo2")).toEqual("bar2");
1223
1223
 
1224
- team.removeMember(reader.id);
1224
+ group.removeMember(reader.id);
1225
1225
 
1226
1226
  expect(childObject.coValue.getCurrentReadKey()).not.toEqual(secondReadKey);
1227
1227
 
@@ -1249,19 +1249,19 @@ test("Admins can set team read rey, make a private transaction in an owned objec
1249
1249
  ).toBeUndefined();
1250
1250
  });
1251
1251
 
1252
- test("Can create two owned objects in the same team and they will have different ids", () => {
1253
- const { node, team } = newTeam();
1252
+ test("Can create two owned objects in the same group and they will have different ids", () => {
1253
+ const { node, group } = newGroup();
1254
1254
 
1255
1255
  const childObject1 = node.createCoValue({
1256
1256
  type: "comap",
1257
- ruleset: { type: "ownedByTeam", team: team.id },
1257
+ ruleset: { type: "ownedByGroup", group: group.id },
1258
1258
  meta: null,
1259
1259
  ...createdNowUnique(),
1260
1260
  });
1261
1261
 
1262
1262
  const childObject2 = node.createCoValue({
1263
1263
  type: "comap",
1264
- ruleset: { type: "ownedByTeam", team: team.id },
1264
+ ruleset: { type: "ownedByGroup", group: group.id },
1265
1265
  meta: null,
1266
1266
  ...createdNowUnique(),
1267
1267
  });
@@ -1270,20 +1270,20 @@ test("Can create two owned objects in the same team and they will have different
1270
1270
  });
1271
1271
 
1272
1272
  test("Admins can create an adminInvite, which can add an admin", () => {
1273
- const { node, team, admin } = newTeam();
1273
+ const { node, group, admin } = newGroup();
1274
1274
 
1275
1275
  const inviteSecret = newRandomAgentSecret();
1276
1276
  const inviteID = getAgentID(inviteSecret);
1277
1277
 
1278
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1278
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1279
1279
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1280
1280
  const revelation = seal(
1281
1281
  readKey,
1282
1282
  admin.currentSealerSecret(),
1283
1283
  admin.currentSealerID(),
1284
1284
  {
1285
- in: team.id,
1286
- tx: team.nextTransactionID(),
1285
+ in: group.id,
1286
+ tx: group.nextTransactionID(),
1287
1287
  }
1288
1288
  );
1289
1289
 
@@ -1299,8 +1299,8 @@ test("Admins can create an adminInvite, which can add an admin", () => {
1299
1299
  admin.currentSealerSecret(),
1300
1300
  getAgentSealerID(inviteID),
1301
1301
  {
1302
- in: team.id,
1303
- tx: team.nextTransactionID(),
1302
+ in: group.id,
1303
+ tx: group.nextTransactionID(),
1304
1304
  }
1305
1305
  );
1306
1306
 
@@ -1311,7 +1311,7 @@ test("Admins can create an adminInvite, which can add an admin", () => {
1311
1311
  );
1312
1312
  });
1313
1313
 
1314
- const teamAsInvite = team.testWithDifferentAccount(
1314
+ const groupAsInvite = group.testWithDifferentAccount(
1315
1315
  new AnonymousControlledAccount(inviteSecret),
1316
1316
  newRandomSessionID(inviteID)
1317
1317
  );
@@ -1319,12 +1319,12 @@ test("Admins can create an adminInvite, which can add an admin", () => {
1319
1319
  const invitedAdminSecret = newRandomAgentSecret();
1320
1320
  const invitedAdminID = getAgentID(invitedAdminSecret);
1321
1321
 
1322
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1322
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1323
1323
  editable.set(invitedAdminID, "admin", "trusting");
1324
1324
 
1325
1325
  expect(editable.get(invitedAdminID)).toEqual("admin");
1326
1326
 
1327
- const readKey = teamAsInvite.getCurrentReadKey();
1327
+ const readKey = groupAsInvite.getCurrentReadKey();
1328
1328
 
1329
1329
  expect(readKey.secret).toBeDefined();
1330
1330
 
@@ -1333,8 +1333,8 @@ test("Admins can create an adminInvite, which can add an admin", () => {
1333
1333
  getAgentSealerSecret(invitedAdminSecret),
1334
1334
  getAgentSealerID(invitedAdminID),
1335
1335
  {
1336
- in: team.id,
1337
- tx: team.nextTransactionID(),
1336
+ in: group.id,
1337
+ tx: group.nextTransactionID(),
1338
1338
  }
1339
1339
  );
1340
1340
 
@@ -1351,9 +1351,9 @@ test("Admins can create an adminInvite, which can add an admin", () => {
1351
1351
  });
1352
1352
 
1353
1353
  test("Admins can create an adminInvite, which can add an admin (high-level)", async () => {
1354
- const { node, team, admin } = newTeamHighLevel();
1354
+ const { node, group, admin } = newGroupHighLevel();
1355
1355
 
1356
- const inviteSecret = team.createInvite("admin");
1356
+ const inviteSecret = group.createInvite("admin");
1357
1357
 
1358
1358
  const invitedAdminSecret = newRandomAgentSecret();
1359
1359
  const invitedAdminID = getAgentID(invitedAdminSecret);
@@ -1363,41 +1363,41 @@ test("Admins can create an adminInvite, which can add an admin (high-level)", as
1363
1363
  newRandomSessionID(invitedAdminID)
1364
1364
  );
1365
1365
 
1366
- await nodeAsInvitedAdmin.acceptInvite(team.id, inviteSecret);
1366
+ await nodeAsInvitedAdmin.acceptInvite(group.id, inviteSecret);
1367
1367
 
1368
1368
  const thirdAdmin = newRandomAgentSecret();
1369
1369
  const thirdAdminID = getAgentID(thirdAdmin);
1370
1370
 
1371
- const teamAsInvitedAdmin = new Team(
1372
- await nodeAsInvitedAdmin.load(team.id),
1371
+ const groupAsInvitedAdmin = new Group(
1372
+ await nodeAsInvitedAdmin.load(group.id),
1373
1373
  nodeAsInvitedAdmin
1374
1374
  );
1375
1375
 
1376
- expect(teamAsInvitedAdmin.teamMap.get(invitedAdminID)).toEqual("admin");
1376
+ expect(groupAsInvitedAdmin.groupMap.get(invitedAdminID)).toEqual("admin");
1377
1377
  expect(
1378
- teamAsInvitedAdmin.teamMap.coValue.getCurrentReadKey().secret
1378
+ groupAsInvitedAdmin.groupMap.coValue.getCurrentReadKey().secret
1379
1379
  ).toBeDefined();
1380
1380
 
1381
- teamAsInvitedAdmin.addMember(thirdAdminID, "admin");
1381
+ groupAsInvitedAdmin.addMember(thirdAdminID, "admin");
1382
1382
 
1383
- expect(teamAsInvitedAdmin.teamMap.get(thirdAdminID)).toEqual("admin");
1383
+ expect(groupAsInvitedAdmin.groupMap.get(thirdAdminID)).toEqual("admin");
1384
1384
  });
1385
1385
 
1386
1386
  test("Admins can create a writerInvite, which can add a writer", () => {
1387
- const { node, team, admin } = newTeam();
1387
+ const { node, group, admin } = newGroup();
1388
1388
 
1389
1389
  const inviteSecret = newRandomAgentSecret();
1390
1390
  const inviteID = getAgentID(inviteSecret);
1391
1391
 
1392
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1392
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1393
1393
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1394
1394
  const revelation = seal(
1395
1395
  readKey,
1396
1396
  admin.currentSealerSecret(),
1397
1397
  admin.currentSealerID(),
1398
1398
  {
1399
- in: team.id,
1400
- tx: team.nextTransactionID(),
1399
+ in: group.id,
1400
+ tx: group.nextTransactionID(),
1401
1401
  }
1402
1402
  );
1403
1403
 
@@ -1413,8 +1413,8 @@ test("Admins can create a writerInvite, which can add a writer", () => {
1413
1413
  admin.currentSealerSecret(),
1414
1414
  getAgentSealerID(inviteID),
1415
1415
  {
1416
- in: team.id,
1417
- tx: team.nextTransactionID(),
1416
+ in: group.id,
1417
+ tx: group.nextTransactionID(),
1418
1418
  }
1419
1419
  );
1420
1420
 
@@ -1425,7 +1425,7 @@ test("Admins can create a writerInvite, which can add a writer", () => {
1425
1425
  );
1426
1426
  });
1427
1427
 
1428
- const teamAsInvite = team.testWithDifferentAccount(
1428
+ const groupAsInvite = group.testWithDifferentAccount(
1429
1429
  new AnonymousControlledAccount(inviteSecret),
1430
1430
  newRandomSessionID(inviteID)
1431
1431
  );
@@ -1433,12 +1433,12 @@ test("Admins can create a writerInvite, which can add a writer", () => {
1433
1433
  const invitedWriterSecret = newRandomAgentSecret();
1434
1434
  const invitedWriterID = getAgentID(invitedWriterSecret);
1435
1435
 
1436
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1436
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1437
1437
  editable.set(invitedWriterID, "writer", "trusting");
1438
1438
 
1439
1439
  expect(editable.get(invitedWriterID)).toEqual("writer");
1440
1440
 
1441
- const readKey = teamAsInvite.getCurrentReadKey();
1441
+ const readKey = groupAsInvite.getCurrentReadKey();
1442
1442
 
1443
1443
  expect(readKey.secret).toBeDefined();
1444
1444
 
@@ -1447,8 +1447,8 @@ test("Admins can create a writerInvite, which can add a writer", () => {
1447
1447
  getAgentSealerSecret(invitedWriterSecret),
1448
1448
  getAgentSealerID(invitedWriterID),
1449
1449
  {
1450
- in: team.id,
1451
- tx: team.nextTransactionID(),
1450
+ in: group.id,
1451
+ tx: group.nextTransactionID(),
1452
1452
  }
1453
1453
  );
1454
1454
 
@@ -1465,9 +1465,9 @@ test("Admins can create a writerInvite, which can add a writer", () => {
1465
1465
  });
1466
1466
 
1467
1467
  test("Admins can create a writerInvite, which can add a writer (high-level)", async () => {
1468
- const { node, team, admin } = newTeamHighLevel();
1468
+ const { node, group, admin } = newGroupHighLevel();
1469
1469
 
1470
- const inviteSecret = team.createInvite("writer");
1470
+ const inviteSecret = group.createInvite("writer");
1471
1471
 
1472
1472
  const invitedWriterSecret = newRandomAgentSecret();
1473
1473
  const invitedWriterID = getAgentID(invitedWriterSecret);
@@ -1477,35 +1477,35 @@ test("Admins can create a writerInvite, which can add a writer (high-level)", as
1477
1477
  newRandomSessionID(invitedWriterID)
1478
1478
  );
1479
1479
 
1480
- await nodeAsInvitedWriter.acceptInvite(team.id, inviteSecret);
1480
+ await nodeAsInvitedWriter.acceptInvite(group.id, inviteSecret);
1481
1481
 
1482
- const teamAsInvitedWriter = new Team(
1483
- await nodeAsInvitedWriter.load(team.id),
1482
+ const groupAsInvitedWriter = new Group(
1483
+ await nodeAsInvitedWriter.load(group.id),
1484
1484
  nodeAsInvitedWriter
1485
1485
  );
1486
1486
 
1487
- expect(teamAsInvitedWriter.teamMap.get(invitedWriterID)).toEqual("writer");
1487
+ expect(groupAsInvitedWriter.groupMap.get(invitedWriterID)).toEqual("writer");
1488
1488
  expect(
1489
- teamAsInvitedWriter.teamMap.coValue.getCurrentReadKey().secret
1489
+ groupAsInvitedWriter.groupMap.coValue.getCurrentReadKey().secret
1490
1490
  ).toBeDefined();
1491
1491
  });
1492
1492
 
1493
1493
 
1494
1494
  test("Admins can create a readerInvite, which can add a reader", () => {
1495
- const { node, team, admin } = newTeam();
1495
+ const { node, group, admin } = newGroup();
1496
1496
 
1497
1497
  const inviteSecret = newRandomAgentSecret();
1498
1498
  const inviteID = getAgentID(inviteSecret);
1499
1499
 
1500
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1500
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1501
1501
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1502
1502
  const revelation = seal(
1503
1503
  readKey,
1504
1504
  admin.currentSealerSecret(),
1505
1505
  admin.currentSealerID(),
1506
1506
  {
1507
- in: team.id,
1508
- tx: team.nextTransactionID(),
1507
+ in: group.id,
1508
+ tx: group.nextTransactionID(),
1509
1509
  }
1510
1510
  );
1511
1511
 
@@ -1521,8 +1521,8 @@ test("Admins can create a readerInvite, which can add a reader", () => {
1521
1521
  admin.currentSealerSecret(),
1522
1522
  getAgentSealerID(inviteID),
1523
1523
  {
1524
- in: team.id,
1525
- tx: team.nextTransactionID(),
1524
+ in: group.id,
1525
+ tx: group.nextTransactionID(),
1526
1526
  }
1527
1527
  );
1528
1528
 
@@ -1533,7 +1533,7 @@ test("Admins can create a readerInvite, which can add a reader", () => {
1533
1533
  );
1534
1534
  });
1535
1535
 
1536
- const teamAsInvite = team.testWithDifferentAccount(
1536
+ const groupAsInvite = group.testWithDifferentAccount(
1537
1537
  new AnonymousControlledAccount(inviteSecret),
1538
1538
  newRandomSessionID(inviteID)
1539
1539
  );
@@ -1541,12 +1541,12 @@ test("Admins can create a readerInvite, which can add a reader", () => {
1541
1541
  const invitedReaderSecret = newRandomAgentSecret();
1542
1542
  const invitedReaderID = getAgentID(invitedReaderSecret);
1543
1543
 
1544
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1544
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1545
1545
  editable.set(invitedReaderID, "reader", "trusting");
1546
1546
 
1547
1547
  expect(editable.get(invitedReaderID)).toEqual("reader");
1548
1548
 
1549
- const readKey = teamAsInvite.getCurrentReadKey();
1549
+ const readKey = groupAsInvite.getCurrentReadKey();
1550
1550
 
1551
1551
  expect(readKey.secret).toBeDefined();
1552
1552
 
@@ -1555,8 +1555,8 @@ test("Admins can create a readerInvite, which can add a reader", () => {
1555
1555
  getAgentSealerSecret(invitedReaderSecret),
1556
1556
  getAgentSealerID(invitedReaderID),
1557
1557
  {
1558
- in: team.id,
1559
- tx: team.nextTransactionID(),
1558
+ in: group.id,
1559
+ tx: group.nextTransactionID(),
1560
1560
  }
1561
1561
  );
1562
1562
 
@@ -1573,9 +1573,9 @@ test("Admins can create a readerInvite, which can add a reader", () => {
1573
1573
  });
1574
1574
 
1575
1575
  test("Admins can create a readerInvite, which can add a reader (high-level)", async () => {
1576
- const { node, team, admin } = newTeamHighLevel();
1576
+ const { node, group, admin } = newGroupHighLevel();
1577
1577
 
1578
- const inviteSecret = team.createInvite("reader");
1578
+ const inviteSecret = group.createInvite("reader");
1579
1579
 
1580
1580
  const invitedReaderSecret = newRandomAgentSecret();
1581
1581
  const invitedReaderID = getAgentID(invitedReaderSecret);
@@ -1585,34 +1585,34 @@ test("Admins can create a readerInvite, which can add a reader (high-level)", as
1585
1585
  newRandomSessionID(invitedReaderID)
1586
1586
  );
1587
1587
 
1588
- await nodeAsInvitedReader.acceptInvite(team.id, inviteSecret);
1588
+ await nodeAsInvitedReader.acceptInvite(group.id, inviteSecret);
1589
1589
 
1590
- const teamAsInvitedReader = new Team(
1591
- await nodeAsInvitedReader.load(team.id),
1590
+ const groupAsInvitedReader = new Group(
1591
+ await nodeAsInvitedReader.load(group.id),
1592
1592
  nodeAsInvitedReader
1593
1593
  );
1594
1594
 
1595
- expect(teamAsInvitedReader.teamMap.get(invitedReaderID)).toEqual("reader");
1595
+ expect(groupAsInvitedReader.groupMap.get(invitedReaderID)).toEqual("reader");
1596
1596
  expect(
1597
- teamAsInvitedReader.teamMap.coValue.getCurrentReadKey().secret
1597
+ groupAsInvitedReader.groupMap.coValue.getCurrentReadKey().secret
1598
1598
  ).toBeDefined();
1599
1599
  });
1600
1600
 
1601
1601
  test("WriterInvites can not invite admins", () => {
1602
- const { node, team, admin } = newTeam();
1602
+ const { node, group, admin } = newGroup();
1603
1603
 
1604
1604
  const inviteSecret = newRandomAgentSecret();
1605
1605
  const inviteID = getAgentID(inviteSecret);
1606
1606
 
1607
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1607
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1608
1608
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1609
1609
  const revelation = seal(
1610
1610
  readKey,
1611
1611
  admin.currentSealerSecret(),
1612
1612
  admin.currentSealerID(),
1613
1613
  {
1614
- in: team.id,
1615
- tx: team.nextTransactionID(),
1614
+ in: group.id,
1615
+ tx: group.nextTransactionID(),
1616
1616
  }
1617
1617
  );
1618
1618
 
@@ -1628,8 +1628,8 @@ test("WriterInvites can not invite admins", () => {
1628
1628
  admin.currentSealerSecret(),
1629
1629
  getAgentSealerID(inviteID),
1630
1630
  {
1631
- in: team.id,
1632
- tx: team.nextTransactionID(),
1631
+ in: group.id,
1632
+ tx: group.nextTransactionID(),
1633
1633
  }
1634
1634
  );
1635
1635
 
@@ -1640,7 +1640,7 @@ test("WriterInvites can not invite admins", () => {
1640
1640
  );
1641
1641
  });
1642
1642
 
1643
- const teamAsInvite = team.testWithDifferentAccount(
1643
+ const groupAsInvite = group.testWithDifferentAccount(
1644
1644
  new AnonymousControlledAccount(inviteSecret),
1645
1645
  newRandomSessionID(inviteID)
1646
1646
  );
@@ -1648,27 +1648,27 @@ test("WriterInvites can not invite admins", () => {
1648
1648
  const invitedAdminSecret = newRandomAgentSecret();
1649
1649
  const invitedAdminID = getAgentID(invitedAdminSecret);
1650
1650
 
1651
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1651
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1652
1652
  editable.set(invitedAdminID, "admin", "trusting");
1653
1653
  expect(editable.get(invitedAdminID)).toBeUndefined();
1654
1654
  });
1655
1655
  });
1656
1656
 
1657
1657
  test("ReaderInvites can not invite admins", () => {
1658
- const { node, team, admin } = newTeam();
1658
+ const { node, group, admin } = newGroup();
1659
1659
 
1660
1660
  const inviteSecret = newRandomAgentSecret();
1661
1661
  const inviteID = getAgentID(inviteSecret);
1662
1662
 
1663
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1663
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1664
1664
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1665
1665
  const revelation = seal(
1666
1666
  readKey,
1667
1667
  admin.currentSealerSecret(),
1668
1668
  admin.currentSealerID(),
1669
1669
  {
1670
- in: team.id,
1671
- tx: team.nextTransactionID(),
1670
+ in: group.id,
1671
+ tx: group.nextTransactionID(),
1672
1672
  }
1673
1673
  );
1674
1674
 
@@ -1684,8 +1684,8 @@ test("ReaderInvites can not invite admins", () => {
1684
1684
  admin.currentSealerSecret(),
1685
1685
  getAgentSealerID(inviteID),
1686
1686
  {
1687
- in: team.id,
1688
- tx: team.nextTransactionID(),
1687
+ in: group.id,
1688
+ tx: group.nextTransactionID(),
1689
1689
  }
1690
1690
  );
1691
1691
 
@@ -1696,7 +1696,7 @@ test("ReaderInvites can not invite admins", () => {
1696
1696
  );
1697
1697
  });
1698
1698
 
1699
- const teamAsInvite = team.testWithDifferentAccount(
1699
+ const groupAsInvite = group.testWithDifferentAccount(
1700
1700
  new AnonymousControlledAccount(inviteSecret),
1701
1701
  newRandomSessionID(inviteID)
1702
1702
  );
@@ -1704,27 +1704,27 @@ test("ReaderInvites can not invite admins", () => {
1704
1704
  const invitedAdminSecret = newRandomAgentSecret();
1705
1705
  const invitedAdminID = getAgentID(invitedAdminSecret);
1706
1706
 
1707
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1707
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1708
1708
  editable.set(invitedAdminID, "admin", "trusting");
1709
1709
  expect(editable.get(invitedAdminID)).toBeUndefined();
1710
1710
  });
1711
1711
  });
1712
1712
 
1713
1713
  test("ReaderInvites can not invite writers", () => {
1714
- const { node, team, admin } = newTeam();
1714
+ const { node, group, admin } = newGroup();
1715
1715
 
1716
1716
  const inviteSecret = newRandomAgentSecret();
1717
1717
  const inviteID = getAgentID(inviteSecret);
1718
1718
 
1719
- expectTeamContent(team.getCurrentContent()).edit((editable) => {
1719
+ expectGroupContent(group.getCurrentContent()).edit((editable) => {
1720
1720
  const { secret: readKey, id: readKeyID } = newRandomKeySecret();
1721
1721
  const revelation = seal(
1722
1722
  readKey,
1723
1723
  admin.currentSealerSecret(),
1724
1724
  admin.currentSealerID(),
1725
1725
  {
1726
- in: team.id,
1727
- tx: team.nextTransactionID(),
1726
+ in: group.id,
1727
+ tx: group.nextTransactionID(),
1728
1728
  }
1729
1729
  );
1730
1730
 
@@ -1740,8 +1740,8 @@ test("ReaderInvites can not invite writers", () => {
1740
1740
  admin.currentSealerSecret(),
1741
1741
  getAgentSealerID(inviteID),
1742
1742
  {
1743
- in: team.id,
1744
- tx: team.nextTransactionID(),
1743
+ in: group.id,
1744
+ tx: group.nextTransactionID(),
1745
1745
  }
1746
1746
  );
1747
1747
 
@@ -1752,7 +1752,7 @@ test("ReaderInvites can not invite writers", () => {
1752
1752
  );
1753
1753
  });
1754
1754
 
1755
- const teamAsInvite = team.testWithDifferentAccount(
1755
+ const groupAsInvite = group.testWithDifferentAccount(
1756
1756
  new AnonymousControlledAccount(inviteSecret),
1757
1757
  newRandomSessionID(inviteID)
1758
1758
  );
@@ -1760,7 +1760,7 @@ test("ReaderInvites can not invite writers", () => {
1760
1760
  const invitedWriterSecret = newRandomAgentSecret();
1761
1761
  const invitedWriterID = getAgentID(invitedWriterSecret);
1762
1762
 
1763
- expectTeamContent(teamAsInvite.getCurrentContent()).edit((editable) => {
1763
+ expectGroupContent(groupAsInvite.getCurrentContent()).edit((editable) => {
1764
1764
  editable.set(invitedWriterID, "writer", "trusting");
1765
1765
  expect(editable.get(invitedWriterID)).toBeUndefined();
1766
1766
  });