@liminalfunctions/framework-vitamins 1.0.0 → 1.0.2

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.
@@ -4,12 +4,14 @@ export type result = {
4
4
  export type generated_collection_interface<T extends result> = {
5
5
  path: string[];
6
6
  collection_id: string;
7
+ collection_name_plural: string;
7
8
  query: (query: any) => Promise<T[]>;
8
9
  document: (document_id: string) => generated_document_interface<T>;
9
10
  };
10
11
  export type generated_document_interface<T extends result> = {
11
12
  path: string[];
12
13
  collection_id: string;
14
+ collection_name_plural: string;
13
15
  document_id: string;
14
16
  get: () => Promise<T>;
15
17
  };
@@ -42,6 +42,7 @@ export declare class Vitamins {
42
42
  queries_by_collection: Map<string, Set<Query>>;
43
43
  debug_on: boolean;
44
44
  constructor(vue: App);
45
+ document<Collection extends generated_collection_interface<result>>(collection: Collection, ...generators: child_generator<Infer_Collection_Returntype<Collection>>[]): Query;
45
46
  query<Collection extends generated_collection_interface<result>>(collection: Collection, query_parameters: any, ...generators: child_generator<Infer_Collection_Returntype<Collection>>[]): Query;
46
47
  delete_document_from_external(document_id: string): void;
47
48
  update_document_from_external(document_id: string, data: result): void;
package/dist/vitamins.js CHANGED
@@ -212,6 +212,13 @@ export class Vitamins {
212
212
  this.all_queries = new Map();
213
213
  this.debug_on = false;
214
214
  }
215
+ document(collection, ...generators) {
216
+ if (!this.queries_by_collection.has(collection.collection_id)) {
217
+ this.queries_by_collection.set(collection.collection_id, new Set());
218
+ }
219
+ let generated_query = new Query(this, collection, undefined, generators);
220
+ return generated_query;
221
+ }
215
222
  query(collection, query_parameters, ...generators) {
216
223
  if (!this.queries_by_collection.has(collection.collection_id)) {
217
224
  this.queries_by_collection.set(collection.collection_id, new Set());
@@ -292,13 +299,13 @@ export class Vitamins {
292
299
  }
293
300
  this._cleanup(test_queries_for_deletion, []);
294
301
  let cloned_data = structuredClone(data);
295
- if (!this.vue[document.reference.collection_id]) {
296
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app does not have a ${document.reference.collection_id} key`);
302
+ if (!this.vue[document.reference.collection_name_plural]) {
303
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app does not have a ${document.reference.collection_name_plural} key`);
297
304
  }
298
- if (!(this.vue[document.reference.collection_id] instanceof Map)) {
299
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app key ${document.reference.collection_id} is not a map. It should be a Map<string, ${document.reference.collection_id}>`);
305
+ if (!(this.vue[document.reference.collection_name_plural] instanceof Map)) {
306
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app key ${document.reference.collection_name_plural} is not a map. It should be a Map<string, ${document.reference.collection_name_plural}>`);
300
307
  }
301
- this.vue[document.reference.collection_id].set(document_id, cloned_data);
308
+ this.vue[document.reference.collection_name_plural].set(document_id, cloned_data);
302
309
  }
303
310
  _generate_child_queries(document) {
304
311
  let all_generated_child_queries = [];
@@ -344,15 +351,15 @@ export class Vitamins {
344
351
  child.unlink_parent(document.id);
345
352
  }
346
353
  this.documents.delete(document.id);
347
- if (!this.vue[document.reference.collection_id]) {
348
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app does not have a ${document.reference.collection_id} key`);
354
+ if (!this.vue[document.reference.collection_name_plural]) {
355
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app does not have a ${document.reference.collection_name_plural} key`);
349
356
  }
350
357
  ;
351
- if (!this.vue[document.reference.collection_id] instanceof Map) {
352
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app key ${document.reference.collection_id} is not a map. It should be a Map<string, ${document.reference.collection_id}>`);
358
+ if (!this.vue[document.reference.collection_name_plural] instanceof Map) {
359
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app key ${document.reference.collection_name_plural} is not a map. It should be a Map<string, ${document.reference.collection_name_plural}>`);
353
360
  }
354
361
  ;
355
- this.vue[document.reference.collection_id].delete(document.id);
362
+ this.vue[document.reference.collection_name_plural].delete(document.id);
356
363
  }
357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,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACrC,CAAC;gBAED,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBAEnC,IAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAC,CAAC;oBACrD,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,CAAC,SAAS,CAAC,sBAAsB,4CAA4C,QAAQ,CAAC,SAAS,CAAC,sBAAsB,MAAM,CAAC,CAAA;gBAC1K,CAAC;gBAAA,CAAC;gBAGF,IAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAAC,YAAY,GAAG,EAAC,CAAC;oBACpE,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,CAAC,SAAS,CAAC,sBAAsB,gCAAgC,QAAQ,CAAC,SAAS,CAAC,sBAAsB,6CAA6C,QAAQ,CAAC,SAAS,CAAC,sBAAsB,GAAG,CAAC,CAAA;gBACjP,CAAC;gBAAA,CAAC;gBAEF,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC5E,CAAC;QACL,CAAC;IACL,CAAC;CAGJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liminalfunctions/framework-vitamins",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -2,6 +2,7 @@ export type result = { _id: string };
2
2
  export type generated_collection_interface<T extends result> = {
3
3
  path: string[]
4
4
  collection_id: string
5
+ collection_name_plural: string
5
6
 
6
7
  query: (query: any) => Promise<T[]>;
7
8
  document: (document_id: string) => generated_document_interface<T>
@@ -9,7 +10,8 @@ export type generated_collection_interface<T extends result> = {
9
10
 
10
11
  export type generated_document_interface<T extends result> = {
11
12
  path: string[]
12
- collection_id: string,
13
+ collection_id: string
14
+ collection_name_plural: string
13
15
  document_id: string
14
16
  get: () => Promise<T>;
15
17
  }
package/src/vitamins.ts CHANGED
@@ -223,6 +223,17 @@ export class Vitamins {
223
223
  this.debug_on = false;
224
224
  }
225
225
 
226
+ document<Collection extends generated_collection_interface<result>>(collection: Collection, ...generators: child_generator<Infer_Collection_Returntype<Collection>>[]): Query {
227
+ // if queries_by_collection does not yet have a key for the relevant collection, create one.
228
+ if(!this.queries_by_collection.has(collection.collection_id)){ this.queries_by_collection.set(collection.collection_id, new Set()); }
229
+
230
+ // if the created query already exists within the system, set up to return the existing query instead
231
+ let generated_query = new Query(this, collection, undefined, generators);
232
+
233
+ //return query;
234
+ return generated_query;
235
+ }
236
+
226
237
  query<Collection extends generated_collection_interface<result>>(collection: Collection, query_parameters: any, ...generators: child_generator<Infer_Collection_Returntype<Collection>>[]): Query {
227
238
  // if queries_by_collection does not yet have a key for the relevant collection, create one.
228
239
  if(!this.queries_by_collection.has(collection.collection_id)){ this.queries_by_collection.set(collection.collection_id, new Set()); }
@@ -336,17 +347,17 @@ export class Vitamins {
336
347
  let cloned_data = structuredClone(data);
337
348
 
338
349
  //@ts-expect-error
339
- if(!this.vue[document.reference.collection_id]){
340
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app does not have a ${document.reference.collection_id} key`);
350
+ if(!this.vue[document.reference.collection_name_plural]){
351
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app does not have a ${document.reference.collection_name_plural} key`);
341
352
  }
342
353
 
343
354
  //@ts-expect-error
344
- if(!(this.vue[document.reference.collection_id] instanceof Map)){
345
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app key ${document.reference.collection_id} is not a map. It should be a Map<string, ${document.reference.collection_id}>`);
355
+ if(!(this.vue[document.reference.collection_name_plural] instanceof Map)){
356
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app key ${document.reference.collection_name_plural} is not a map. It should be a Map<string, ${document.reference.collection_name_plural}>`);
346
357
  }
347
358
 
348
359
  //@ts-expect-error
349
- (this.vue[document.reference.collection_id] as Map).set(document_id, cloned_data);
360
+ (this.vue[document.reference.collection_name_plural] as Map).set(document_id, cloned_data);
350
361
  }
351
362
 
352
363
  _generate_child_queries(document: Document): Query[] {
@@ -408,16 +419,16 @@ export class Vitamins {
408
419
 
409
420
  this.documents.delete(document.id);
410
421
  //@ts-expect-error
411
- if(!this.vue[document.reference.collection_id]){
412
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app does not have a ${document.reference.collection_id} key`)
422
+ if(!this.vue[document.reference.collection_name_plural]){
423
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app does not have a ${document.reference.collection_name_plural} key`)
413
424
  };
414
425
 
415
426
  //@ts-expect-error
416
- if(!this.vue[document.reference.collection_id] instanceof Map){
417
- throw new Error(`when updating ${document.reference.collection_id}, found that the vue app key ${document.reference.collection_id} is not a map. It should be a Map<string, ${document.reference.collection_id}>`)
427
+ if(!this.vue[document.reference.collection_name_plural] instanceof Map){
428
+ throw new Error(`when updating ${document.reference.collection_name_plural}, found that the vue app key ${document.reference.collection_name_plural} is not a map. It should be a Map<string, ${document.reference.collection_name_plural}>`)
418
429
  };
419
430
  //@ts-expect-error
420
- this.vue[document.reference.collection_id].delete(document.id);
431
+ this.vue[document.reference.collection_name_plural].delete(document.id);
421
432
  }
422
433
  }
423
434
  }
@@ -16,26 +16,22 @@ describe('Client Library Generation: Library Generation', function () {
16
16
 
17
17
  let collection_mutualism = new Mutualism(
18
18
  ['institution', 'client', 'mutualism'],
19
- 'mutualism',
20
19
  mutualsm_database
21
20
  )
22
21
 
23
22
  let collection_project = new Project(
24
23
  ['institution', 'project'],
25
- 'project',
26
24
  project_database
27
25
  )
28
26
 
29
27
  let collection_client = new Client(
30
28
  ['institution', 'client'],
31
- 'client',
32
29
  client_database,
33
30
  collection_mutualism
34
31
  )
35
32
 
36
33
  let collection_institution = new Institution(
37
34
  ['institution'],
38
- 'institution',
39
35
  institution_database,
40
36
  collection_client,
41
37
  collection_project
@@ -64,10 +60,10 @@ describe('Client Library Generation: Library Generation', function () {
64
60
 
65
61
  function gen_vue() {
66
62
  return {
67
- institution: new Map<string, any>(),
68
- client: new Map<string, any>(),
69
- project: new Map<string, any>(),
70
- mutualism: new Map<string, any>(),
63
+ institutions: new Map<string, any>(),
64
+ clients: new Map<string, any>(),
65
+ projects: new Map<string, any>(),
66
+ mutualisms: new Map<string, any>(),
71
67
  }
72
68
  }
73
69
 
@@ -99,9 +95,9 @@ describe('Client Library Generation: Library Generation', function () {
99
95
  await sleep(20);
100
96
 
101
97
  let test_against = gen_vue();
102
- test_against.institution.set(institution._id, structuredClone(institution));
98
+ test_against.institutions.set(institution._id, structuredClone(institution));
103
99
 
104
- assert.deepEqual(vue.institution.get(institution._id), institution)
100
+ assert.deepEqual(vue.institutions.get(institution._id), institution)
105
101
  assert.deepEqual(vue, test_against)
106
102
  });
107
103
 
@@ -121,11 +117,11 @@ describe('Client Library Generation: Library Generation', function () {
121
117
  await sleep(20);
122
118
 
123
119
  let test_against = gen_vue();
124
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
125
- test_against.institution.set(institution_2._id, structuredClone(institution_2));
126
- test_against.institution.set(institution_3._id, structuredClone(institution_3));
120
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
121
+ test_against.institutions.set(institution_2._id, structuredClone(institution_2));
122
+ test_against.institutions.set(institution_3._id, structuredClone(institution_3));
127
123
 
128
- assert.deepEqual(vue.institution.get(institution_3._id), institution_3)
124
+ assert.deepEqual(vue.institutions.get(institution_3._id), institution_3)
129
125
  assert.deepEqual(vue, test_against)
130
126
  });
131
127
 
@@ -140,13 +136,13 @@ describe('Client Library Generation: Library Generation', function () {
140
136
  //@ts-expect-error
141
137
  let vitamins = new Vitamins(vue);
142
138
  //@ts-expect-error
143
- await vitamins.query(api.collection('institution')?.document(institution._id), {}).run()
139
+ await vitamins.document(api.collection('institution')?.document(institution._id)).run()
144
140
  await sleep(20);
145
141
 
146
142
  let test_against = gen_vue();
147
- test_against.institution.set(institution._id, structuredClone(institution));
143
+ test_against.institutions.set(institution._id, structuredClone(institution));
148
144
 
149
- assert.deepEqual(vue.institution.get(institution._id), institution)
145
+ assert.deepEqual(vue.institutions.get(institution._id), institution)
150
146
  assert.deepEqual(vue, test_against)
151
147
  });
152
148
 
@@ -168,11 +164,11 @@ describe('Client Library Generation: Library Generation', function () {
168
164
  await sleep(20);
169
165
 
170
166
  let test_against = gen_vue();
171
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
172
- test_against.client.set(client_1._id, structuredClone(client_1));
167
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
168
+ test_against.clients.set(client_1._id, structuredClone(client_1));
173
169
 
174
- assert.deepEqual(vue.institution.get(institution_1._id), institution_1)
175
- assert.deepEqual(vue.client.get(client_1._id), client_1)
170
+ assert.deepEqual(vue.institutions.get(institution_1._id), institution_1)
171
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
176
172
  assert.deepEqual(vue, test_against)
177
173
  });
178
174
 
@@ -195,11 +191,11 @@ describe('Client Library Generation: Library Generation', function () {
195
191
  await sleep(20);
196
192
 
197
193
  let test_against = gen_vue();
198
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
199
- test_against.client.set(client_1._id, structuredClone(client_1));
194
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
195
+ test_against.clients.set(client_1._id, structuredClone(client_1));
200
196
 
201
- assert.deepEqual(vue.institution.get(institution_1._id), institution_1)
202
- assert.deepEqual(vue.client.get(client_1._id), client_1)
197
+ assert.deepEqual(vue.institutions.get(institution_1._id), institution_1)
198
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
203
199
  assert.deepEqual(vue, test_against)
204
200
  });
205
201
 
@@ -231,17 +227,17 @@ describe('Client Library Generation: Library Generation', function () {
231
227
  await sleep(20);
232
228
 
233
229
  let test_against = gen_vue();
234
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
235
- test_against.project.set(project_1._id, structuredClone(project_1));
236
- test_against.project.set(project_2._id, structuredClone(project_2));
237
- test_against.project.set(project_3._id, structuredClone(project_3));
238
- test_against.project.set(project_4._id, structuredClone(project_4));
239
-
240
- assert.deepEqual(vue.institution.get(institution_1._id), institution_1)
241
- assert.deepEqual(vue.project.get(project_1._id), project_1)
242
- assert.deepEqual(vue.project.get(project_2._id), project_2)
243
- assert.deepEqual(vue.project.get(project_3._id), project_3)
244
- assert.deepEqual(vue.project.get(project_4._id), project_4)
230
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
231
+ test_against.projects.set(project_1._id, structuredClone(project_1));
232
+ test_against.projects.set(project_2._id, structuredClone(project_2));
233
+ test_against.projects.set(project_3._id, structuredClone(project_3));
234
+ test_against.projects.set(project_4._id, structuredClone(project_4));
235
+
236
+ assert.deepEqual(vue.institutions.get(institution_1._id), institution_1)
237
+ assert.deepEqual(vue.projects.get(project_1._id), project_1)
238
+ assert.deepEqual(vue.projects.get(project_2._id), project_2)
239
+ assert.deepEqual(vue.projects.get(project_3._id), project_3)
240
+ assert.deepEqual(vue.projects.get(project_4._id), project_4)
245
241
  assert.deepEqual(vue, test_against)
246
242
 
247
243
  // make sure that extra queries aren't happening
@@ -274,13 +270,13 @@ describe('Client Library Generation: Library Generation', function () {
274
270
  await sleep(20);
275
271
 
276
272
  let test_against = gen_vue();
277
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
278
- test_against.institution.set(institution_2._id, structuredClone(institution_2));
279
- test_against.institution.set(institution_3._id, structuredClone(institution_3));
280
- test_against.client.set(client_1._id, structuredClone(client_1));
273
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
274
+ test_against.institutions.set(institution_2._id, structuredClone(institution_2));
275
+ test_against.institutions.set(institution_3._id, structuredClone(institution_3));
276
+ test_against.clients.set(client_1._id, structuredClone(client_1));
281
277
 
282
- assert.deepEqual(vue.client.get(client_1._id), client_1)
283
- assert.deepEqual(vue.institution.get(institution_3._id), institution_3)
278
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
279
+ assert.deepEqual(vue.institutions.get(institution_3._id), institution_3)
284
280
  assert.deepEqual(vue, test_against)
285
281
 
286
282
  assert.equal(api.collection('institution')?.document('*').collection('client').meta_counter.get(client_1._id), 1)
@@ -313,14 +309,14 @@ describe('Client Library Generation: Library Generation', function () {
313
309
  await sleep(20);
314
310
 
315
311
  let test_against = gen_vue();
316
- test_against.institution.set(institution_1._id, structuredClone(institution_1));
317
- test_against.client.set(client_1._id, structuredClone(client_1));
318
- test_against.client.set(client_2._id, structuredClone(client_2));
319
- test_against.client.set(client_3._id, structuredClone(client_3));
320
-
321
- assert.deepEqual(vue.client.get(client_1._id), client_1)
322
- assert.deepEqual(vue.client.get(client_2._id), client_2)
323
- assert.deepEqual(vue.client.get(client_3._id), client_3)
312
+ test_against.institutions.set(institution_1._id, structuredClone(institution_1));
313
+ test_against.clients.set(client_1._id, structuredClone(client_1));
314
+ test_against.clients.set(client_2._id, structuredClone(client_2));
315
+ test_against.clients.set(client_3._id, structuredClone(client_3));
316
+
317
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
318
+ assert.deepEqual(vue.clients.get(client_2._id), client_2)
319
+ assert.deepEqual(vue.clients.get(client_3._id), client_3)
324
320
  assert.deepEqual(vue, test_against)
325
321
 
326
322
  assert.equal(api.collection('institution')?.meta_counter.get(institution_1._id), 1)
@@ -343,18 +339,18 @@ describe('Client Library Generation: Library Generation', function () {
343
339
  //@ts-expect-error
344
340
  let vitamins = new Vitamins(vue);
345
341
  //@ts-expect-error
346
- let query = await vitamins.query(api.collection('institution')?.document('*').collection('client').document(client_1._id) as Collection, undefined,
342
+ let query = await vitamins.document(api.collection('institution')?.document('*').collection('client').document(client_1._id) as Collection,
347
343
  //@ts-expect-error
348
344
  (result) => vitamins.query(api.collection('institution'), {_id: result.institution_id }),
349
345
  ).run()
350
346
  await sleep(20);
351
347
 
352
348
  let test_against_phase_1 = gen_vue();
353
- test_against_phase_1.institution.set(institution_1._id, structuredClone(institution_1));
354
- test_against_phase_1.client.set(client_1._id, structuredClone(client_1));
349
+ test_against_phase_1.institutions.set(institution_1._id, structuredClone(institution_1));
350
+ test_against_phase_1.clients.set(client_1._id, structuredClone(client_1));
355
351
 
356
- assert.deepEqual(vue.client.get(client_1._id), client_1)
357
- assert.deepEqual(vue.institution.get(institution_1._id), institution_1)
352
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
353
+ assert.deepEqual(vue.institutions.get(institution_1._id), institution_1)
358
354
  assert.deepEqual(vue, test_against_phase_1)
359
355
 
360
356
  client_1.institution_id = institution_2._id;
@@ -362,11 +358,11 @@ describe('Client Library Generation: Library Generation', function () {
362
358
  await sleep(20);
363
359
 
364
360
  let test_against_phase_2 = gen_vue();
365
- test_against_phase_2.institution.set(institution_2._id, structuredClone(institution_2));
366
- test_against_phase_2.client.set(client_1._id, structuredClone(client_1));
361
+ test_against_phase_2.institutions.set(institution_2._id, structuredClone(institution_2));
362
+ test_against_phase_2.clients.set(client_1._id, structuredClone(client_1));
367
363
 
368
- assert.deepEqual(vue.client.get(client_1._id), client_1);
369
- assert.deepEqual(vue.institution.get(institution_2._id), institution_2);
364
+ assert.deepEqual(vue.clients.get(client_1._id), client_1);
365
+ assert.deepEqual(vue.institutions.get(institution_2._id), institution_2);
370
366
  assert.deepEqual(vue, test_against_phase_2);
371
367
  });
372
368
 
@@ -384,29 +380,29 @@ describe('Client Library Generation: Library Generation', function () {
384
380
  //@ts-expect-error
385
381
  let vitamins = new Vitamins(vue);
386
382
  //@ts-expect-error
387
- let query = await vitamins.query(api.collection('institution')?.document('*').collection('client').document(client_1._id) as Collection, undefined,
383
+ let query = await vitamins.document(api.collection('institution')?.document('*').collection('client').document(client_1._id) as Collection,
388
384
  //@ts-expect-error
389
385
  (result) => vitamins.query(api.collection('institution'), {_id: result.institution_id }),
390
386
  ).run()
391
387
  await sleep(20);
392
388
 
393
389
  let test_against_phase_1 = gen_vue();
394
- test_against_phase_1.institution.set(institution_1._id, structuredClone(institution_1));
395
- test_against_phase_1.client.set(client_1._id, structuredClone(client_1));
390
+ test_against_phase_1.institutions.set(institution_1._id, structuredClone(institution_1));
391
+ test_against_phase_1.clients.set(client_1._id, structuredClone(client_1));
396
392
 
397
- assert.deepEqual(vue.client.get(client_1._id), client_1)
398
- assert.deepEqual(vue.institution.get(institution_1._id), institution_1)
393
+ assert.deepEqual(vue.clients.get(client_1._id), client_1)
394
+ assert.deepEqual(vue.institutions.get(institution_1._id), institution_1)
399
395
  assert.deepEqual(vue, test_against_phase_1)
400
396
 
401
397
  vitamins.update_document_from_external(client_1._id, Object.assign(client_1, {institution_id: institution_2._id}))
402
398
  await sleep(20);
403
399
 
404
400
  let test_against_phase_2 = gen_vue();
405
- test_against_phase_2.institution.set(institution_2._id, structuredClone(institution_2));
406
- test_against_phase_2.client.set(client_1._id, structuredClone(client_1));
401
+ test_against_phase_2.institutions.set(institution_2._id, structuredClone(institution_2));
402
+ test_against_phase_2.clients.set(client_1._id, structuredClone(client_1));
407
403
 
408
- assert.deepEqual(vue.client.get(client_1._id), client_1);
409
- assert.deepEqual(vue.institution.get(institution_2._id), institution_2);
404
+ assert.deepEqual(vue.clients.get(client_1._id), client_1);
405
+ assert.deepEqual(vue.institutions.get(institution_2._id), institution_2);
410
406
  assert.deepEqual(vue, test_against_phase_2);
411
407
  });
412
408
 
@@ -432,9 +428,9 @@ describe('Client Library Generation: Library Generation', function () {
432
428
  await sleep(20);
433
429
 
434
430
  let test_against_phase_1 = gen_vue();
435
- test_against_phase_1.institution.set(institution_1._id, structuredClone(institution_1));
436
- test_against_phase_1.client.set(client_1._id, structuredClone(client_1));
437
- test_against_phase_1.project.set(project_1._id, structuredClone(project_1));
431
+ test_against_phase_1.institutions.set(institution_1._id, structuredClone(institution_1));
432
+ test_against_phase_1.clients.set(client_1._id, structuredClone(client_1));
433
+ test_against_phase_1.projects.set(project_1._id, structuredClone(project_1));
438
434
 
439
435
  assert.deepEqual(vue, test_against_phase_1)
440
436
 
@@ -442,7 +438,7 @@ describe('Client Library Generation: Library Generation', function () {
442
438
  await sleep(20);
443
439
 
444
440
  let test_against_phase_2 = gen_vue();
445
- test_against_phase_2.institution.set(institution_1._id, structuredClone(institution_1));
441
+ test_against_phase_2.institutions.set(institution_1._id, structuredClone(institution_1));
446
442
 
447
443
  assert.deepEqual(vue, test_against_phase_2)
448
444
  });
@@ -499,7 +495,7 @@ describe('Client Library Generation: Library Generation', function () {
499
495
  //@ts-expect-error
500
496
  let vitamins = new Vitamins(vue);
501
497
  //@ts-expect-error
502
- await vitamins.query(api.collection('institution').document(institution_1._id), undefined,
498
+ await vitamins.document(api.collection('institution').document(institution_1._id),
503
499
  (result) => vitamins.query(api.collection('institution')?.document(result._id).collection('client'), {})
504
500
  ).run()
505
501
  }, 'Error: arbitrary error');
@@ -533,4 +529,7 @@ describe('Client Library Generation: Library Generation', function () {
533
529
  ).run();
534
530
  }, 'Error: arbitrary error');
535
531
  });
532
+
533
+ // TODO: vue needs the ability to have a different name for the collection.
534
+ // for example, the collection ID may be "user", but on vue it needs to be "users".
536
535
  });
@@ -96,6 +96,7 @@ export function gen_mutualism(institution: result, clients: result[], name: stri
96
96
  export class Institution {
97
97
  path: string[]
98
98
  collection_id: string;
99
+ collection_name_plural: string
99
100
  database: Map<string, any>
100
101
  meta_counter: Map<string, any>
101
102
  errors: boolean
@@ -104,9 +105,10 @@ export class Institution {
104
105
  client: Client
105
106
 
106
107
 
107
- constructor(path: string[], collection_id: string, project_database: Map<string, any>, client: Client, project: Project) {
108
+ constructor(path: string[], project_database: Map<string, any>, client: Client, project: Project) {
108
109
  this.path = path;
109
- this.collection_id = collection_id;
110
+ this.collection_id = 'institution';
111
+ this.collection_name_plural = 'institutions'
110
112
  this.database = project_database;
111
113
  this.meta_counter = new Map();
112
114
  this.project = project;
@@ -124,6 +126,7 @@ export class Institution {
124
126
  return {
125
127
  path: [...self.path, document_id],
126
128
  collection_id: self.collection_id,
129
+ collection_name_plural: self.collection_name_plural,
127
130
  document_id: document_id,
128
131
  async get(): Promise<institution_result>{
129
132
  if(self.errors){ throw new Error('arbitrary error')};
@@ -144,15 +147,17 @@ export class Institution {
144
147
  export class Client {
145
148
  path: string[]
146
149
  collection_id: string;
150
+ collection_name_plural: string;
147
151
  database: Map<string, any>
148
152
  meta_counter: Map<string, any>
149
153
  errors: boolean
150
154
 
151
155
  mutualism: Mutualism
152
156
 
153
- constructor(path: string[], collection_id: string, client_database: Map<string, any>, mutualism: Mutualism) {
157
+ constructor(path: string[], client_database: Map<string, any>, mutualism: Mutualism) {
154
158
  this.path = path;
155
- this.collection_id = collection_id;
159
+ this.collection_id = 'client';
160
+ this.collection_name_plural = 'clients';
156
161
  this.database = client_database;
157
162
  this.meta_counter = new Map();
158
163
  this.mutualism = mutualism;
@@ -169,6 +174,7 @@ export class Client {
169
174
  return {
170
175
  path: [...self.path, document_id],
171
176
  collection_id: self.collection_id,
177
+ collection_name_plural: self.collection_name_plural,
172
178
  document_id: document_id,
173
179
  async get(): Promise<client_result> {
174
180
  if(self.errors){ throw new Error('arbitrary error')};
@@ -187,13 +193,15 @@ export class Client {
187
193
  export class Project {
188
194
  path: string[]
189
195
  collection_id: string;
196
+ collection_name_plural: string
190
197
  database: Map<string, any>
191
198
  meta_counter: Map<string, any>
192
199
  errors: boolean
193
200
 
194
- constructor(path: string[], collection_id: string, project_database: Map<string, any>) {
201
+ constructor(path: string[], project_database: Map<string, any>) {
195
202
  this.path = path;
196
- this.collection_id = collection_id;
203
+ this.collection_id = 'project';
204
+ this.collection_name_plural = 'projects'
197
205
  this.database = project_database;
198
206
  this.meta_counter = new Map();
199
207
  this.errors = false;
@@ -209,6 +217,7 @@ export class Project {
209
217
  return {
210
218
  path: [...self.path, document_id],
211
219
  collection_id: self.collection_id,
220
+ collection_name_plural: self.collection_name_plural,
212
221
  document_id: document_id,
213
222
  async get(): Promise<project_result> {
214
223
  if(self.errors){ throw new Error('arbitrary error')};
@@ -222,13 +231,15 @@ export class Project {
222
231
  export class Mutualism {
223
232
  path: string[]
224
233
  collection_id: string;
234
+ collection_name_plural: string
225
235
  database: Map<string, any>
226
236
  meta_counter: Map<string, any>
227
237
  errors: boolean
228
238
 
229
- constructor(path: string[], collection_id: string, mutualism_database: Map<string, any>) {
239
+ constructor(path: string[], mutualism_database: Map<string, any>) {
230
240
  this.path = path;
231
- this.collection_id = collection_id;
241
+ this.collection_id = 'mutualism';
242
+ this.collection_name_plural = 'mutualisms'
232
243
  this.database = mutualism_database;
233
244
  this.meta_counter = new Map();
234
245
  this.errors = false;
@@ -244,6 +255,7 @@ export class Mutualism {
244
255
  return {
245
256
  path: [...self.path, document_id],
246
257
  collection_id: self.collection_id,
258
+ collection_name_plural: self.collection_name_plural,
247
259
  document_id: document_id,
248
260
  async get(): Promise<mutualism_result> {
249
261
  if(self.errors){ throw new Error('arbitrary error')};