@liminalfunctions/framework 1.0.62 → 1.0.64

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.
Files changed (35) hide show
  1. package/dist/code_generation/generate_client_library.js +1 -0
  2. package/dist/code_generation/generate_client_library.js.map +1 -1
  3. package/dist/code_generation/templates/collection.mustache +10 -38
  4. package/dist/code_generation/templates/main.mustache +1 -1
  5. package/dist/code_generation/templates/root_types.ts.mustache +71 -0
  6. package/package.json +1 -1
  7. package/src/code_generation/generate_client_library.ts +1 -0
  8. package/src/code_generation/templates/collection.mustache +10 -38
  9. package/src/code_generation/templates/main.mustache +1 -1
  10. package/src/code_generation/templates/root_types.ts.mustache +71 -0
  11. package/test/2_1_client_library_generation.test.ts +1 -1
  12. package/test/tmp/dist/Brief_News_Category.d.ts +4 -12
  13. package/test/tmp/dist/Brief_News_Category.js +6 -21
  14. package/test/tmp/dist/Brief_News_Category.js.map +1 -1
  15. package/test/tmp/dist/Client.d.ts +4 -12
  16. package/test/tmp/dist/Client.js +6 -21
  17. package/test/tmp/dist/Client.js.map +1 -1
  18. package/test/tmp/dist/Institution.d.ts +4 -12
  19. package/test/tmp/dist/Institution.js +6 -21
  20. package/test/tmp/dist/Institution.js.map +1 -1
  21. package/test/tmp/dist/Project.d.ts +6 -19
  22. package/test/tmp/dist/Project.js +10 -34
  23. package/test/tmp/dist/Project.js.map +1 -1
  24. package/test/tmp/dist/index.d.ts +1 -2
  25. package/test/tmp/dist/index.js +1 -1
  26. package/test/tmp/dist/index.js.map +1 -1
  27. package/test/tmp/dist/root_types.d.ts +42 -0
  28. package/test/tmp/dist/root_types.js +43 -0
  29. package/test/tmp/dist/root_types.js.map +1 -0
  30. package/test/tmp/src/Brief_News_Category.ts +6 -25
  31. package/test/tmp/src/Client.ts +6 -25
  32. package/test/tmp/src/Institution.ts +6 -25
  33. package/test/tmp/src/Project.ts +10 -38
  34. package/test/tmp/src/index.ts +1 -1
  35. package/test/tmp/src/root_types.ts +71 -0
@@ -0,0 +1,71 @@
1
+ export abstract class Collection {
2
+ path: string[]
3
+ get_auth: () => Promise<any>
4
+ collection_id: string
5
+ collection_name_plural: string
6
+
7
+ constructor(path: string[], get_auth: () => Promise<any>, collection_id: string, collection_name_plural: string) {
8
+ this.path = path;
9
+ this.get_auth = get_auth;
10
+ this.collection_id = collection_id;
11
+ this.collection_name_plural = collection_name_plural;
12
+ }
13
+
14
+ abstract query(query: any): Promise<any[]>;
15
+ abstract post(document: any): Promise<any>;
16
+ abstract document(document_id: string): Document
17
+ }
18
+
19
+ export type Document = (Bare_Document & _Base_Document) | (Bare_Document & _Base_Document & _With_Children) | (Bare_Document & _Base_Document & _With_Array) | (Bare_Document & _Base_Document & _With_Array & _With_Children);
20
+
21
+ export abstract class Bare_Document {
22
+ path: string[];
23
+ collection_id: string;
24
+ document_id: string;
25
+ collection_name_plural: string;
26
+ get_auth: () => Promise<any>;
27
+
28
+ constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>) {
29
+ this.path = path;
30
+ this.collection_id = collection_id;
31
+ this.document_id = document_id;
32
+ this.collection_name_plural = collection_name_plural;
33
+ this.get_auth = get_auth;
34
+ }
35
+ }
36
+
37
+ export interface _Base_Document {
38
+ get(): any
39
+ put(update: any): Promise<any>
40
+ remove(): Promise<any>
41
+ }
42
+
43
+ export interface _With_Children {
44
+ collection(collection_id: string): Collection
45
+ }
46
+
47
+ export interface _With_Array {
48
+ array(key: string): Document_Array
49
+ }
50
+
51
+ export abstract class Document_Array {
52
+ path: string[]
53
+ collection_id: string
54
+ collection_name_plural: string
55
+ document_id: string;
56
+ array_key: string
57
+ get_auth: () => Promise<any>
58
+
59
+ constructor(path: string[], get_auth: () => Promise<any>, collection_id: string, collection_name_plural: string, document_id: string, array_key: string) {
60
+ this.path = path;
61
+ this.get_auth = get_auth;
62
+ this.collection_id = collection_id;
63
+ this.collection_name_plural = collection_name_plural;
64
+ this.document_id = document_id;
65
+ this.array_key = array_key;
66
+ }
67
+
68
+ abstract push(document: any): Promise<any>
69
+ abstract replace(document: any): Promise<any>
70
+ abstract delete(document_id: string): Promise<any>
71
+ }