@liminalfunctions/framework 1.0.61 → 1.0.63

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 (39) 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 +8 -36
  4. package/dist/code_generation/templates/main.mustache +1 -1
  5. package/dist/code_generation/templates/root_types.ts.mustache +69 -0
  6. package/dist/code_generation/utils/type_from_zod.js +7 -1
  7. package/dist/code_generation/utils/type_from_zod.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/code_generation/generate_client_library.ts +1 -0
  10. package/src/code_generation/templates/collection.mustache +8 -36
  11. package/src/code_generation/templates/main.mustache +1 -1
  12. package/src/code_generation/templates/root_types.ts.mustache +69 -0
  13. package/src/code_generation/utils/type_from_zod.ts +10 -1
  14. package/test/2_0_client_library_basic_type_generation.test.ts +22 -0
  15. package/test/2_1_client_library_generation.test.ts +1 -1
  16. package/test/tmp/dist/Brief_News_Category.d.ts +4 -12
  17. package/test/tmp/dist/Brief_News_Category.js +6 -21
  18. package/test/tmp/dist/Brief_News_Category.js.map +1 -1
  19. package/test/tmp/dist/Client.d.ts +4 -12
  20. package/test/tmp/dist/Client.js +6 -21
  21. package/test/tmp/dist/Client.js.map +1 -1
  22. package/test/tmp/dist/Institution.d.ts +4 -12
  23. package/test/tmp/dist/Institution.js +6 -21
  24. package/test/tmp/dist/Institution.js.map +1 -1
  25. package/test/tmp/dist/Project.d.ts +5 -18
  26. package/test/tmp/dist/Project.js +8 -32
  27. package/test/tmp/dist/Project.js.map +1 -1
  28. package/test/tmp/dist/index.d.ts +1 -2
  29. package/test/tmp/dist/index.js +1 -1
  30. package/test/tmp/dist/index.js.map +1 -1
  31. package/test/tmp/dist/root_types.d.ts +41 -0
  32. package/test/tmp/dist/root_types.js +41 -0
  33. package/test/tmp/dist/root_types.js.map +1 -0
  34. package/test/tmp/src/Brief_News_Category.ts +6 -25
  35. package/test/tmp/src/Client.ts +6 -25
  36. package/test/tmp/src/Institution.ts +6 -25
  37. package/test/tmp/src/Project.ts +8 -36
  38. package/test/tmp/src/index.ts +1 -1
  39. package/test/tmp/src/root_types.ts +69 -0
@@ -1,17 +1,11 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params } from "./utils/utils.js";
3
+ import { Collection, Bare_Document } from "./root_types.js";
3
4
  import { Collection_Project } from "./Project.js";
4
5
  import { Collection_Brief_News_Category } from "./Brief_News_Category.js";
5
- export class Collection_Client {
6
- path;
7
- get_auth;
8
- collection_id;
9
- collection_name_plural;
6
+ export class Collection_Client extends Collection {
10
7
  constructor(path, get_auth) {
11
- this.path = path;
12
- this.get_auth = get_auth;
13
- this.collection_id = "client";
14
- this.collection_name_plural = "clients";
8
+ super(path, get_auth, "client", "clients");
15
9
  }
16
10
  async query(query) {
17
11
  try {
@@ -46,21 +40,12 @@ export class Collection_Client {
46
40
  let get_auth = this.get_auth;
47
41
  let collection_id = this.collection_id;
48
42
  let collection_name_plural = this.collection_name_plural;
49
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
43
+ return new Document_Client(path, collection_id, document_id, collection_name_plural, get_auth);
50
44
  }
51
45
  }
52
- class Document {
53
- path;
54
- collection_id;
55
- document_id;
56
- collection_name_plural;
57
- get_auth;
46
+ class Document_Client extends Bare_Document {
58
47
  constructor(path, collection_id, document_id, collection_name_plural, get_auth) {
59
- this.path = path;
60
- this.collection_id = collection_id;
61
- this.document_id = document_id;
62
- this.collection_name_plural = collection_name_plural;
63
- this.get_auth = get_auth;
48
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
64
49
  }
65
50
  async get() {
66
51
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAA+B,MAAM,kBAAkB,CAAC;A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B,CAAC;IACL,CAAC;IAID,UAAU,CAAC,aAAqB;QAC5B,QAAO,aAAa,EAAE,CAAC;YACnB,KAAK,SAAS;gBACV,OAAO,IAAI,kBAAkB,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9F,KAAK,qBAAqB;gBACtB,OAAO,IAAI,8BAA8B,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,qBAAqB,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtH;gBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;CAEJ"}
@@ -1,24 +1,16 @@
1
+ import { Collection, Bare_Document, _Base_Document, _With_Children } from "./root_types.js";
1
2
  import { Collection_Client } from "./Client.js";
2
3
  import { institution } from "./types/institution.js";
3
4
  import { institution_query } from "./types/institution_query.js";
4
5
  import { institution_put } from "./types/institution_put.js";
5
6
  import { institution_post } from "./types/institution_post.js";
6
- export declare class Collection_Institution {
7
- path: string[];
8
- get_auth: () => Promise<any>;
9
- collection_id: string;
10
- collection_name_plural: string;
7
+ export declare class Collection_Institution extends Collection {
11
8
  constructor(path: string[], get_auth: () => Promise<any>);
12
9
  query(query: institution_query): Promise<institution[]>;
13
10
  post(document: institution_post): Promise<institution>;
14
- document(document_id: string): Document;
11
+ document(document_id: string): Document_Institution;
15
12
  }
16
- declare class Document {
17
- path: string[];
18
- collection_id: string;
19
- document_id: string;
20
- collection_name_plural: string;
21
- get_auth: () => Promise<any>;
13
+ declare class Document_Institution extends Bare_Document implements _Base_Document, _With_Children {
22
14
  constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
23
15
  get(): Promise<institution>;
24
16
  put(update: institution_put): Promise<institution>;
@@ -1,16 +1,10 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params } from "./utils/utils.js";
3
+ import { Collection, Bare_Document } from "./root_types.js";
3
4
  import { Collection_Client } from "./Client.js";
4
- export class Collection_Institution {
5
- path;
6
- get_auth;
7
- collection_id;
8
- collection_name_plural;
5
+ export class Collection_Institution extends Collection {
9
6
  constructor(path, get_auth) {
10
- this.path = path;
11
- this.get_auth = get_auth;
12
- this.collection_id = "institution";
13
- this.collection_name_plural = "institutions";
7
+ super(path, get_auth, "institution", "institutions");
14
8
  }
15
9
  async query(query) {
16
10
  try {
@@ -45,21 +39,12 @@ export class Collection_Institution {
45
39
  let get_auth = this.get_auth;
46
40
  let collection_id = this.collection_id;
47
41
  let collection_name_plural = this.collection_name_plural;
48
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
42
+ return new Document_Institution(path, collection_id, document_id, collection_name_plural, get_auth);
49
43
  }
50
44
  }
51
- class Document {
52
- path;
53
- collection_id;
54
- document_id;
55
- collection_name_plural;
56
- get_auth;
45
+ class Document_Institution extends Bare_Document {
57
46
  constructor(path, collection_id, document_id, collection_name_plural, get_auth) {
58
- this.path = path;
59
- this.collection_id = collection_id;
60
- this.document_id = document_id;
61
- this.collection_name_plural = collection_name_plural;
62
- this.get_auth = get_auth;
47
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
63
48
  }
64
49
  async get() {
65
50
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"Institution.js","sourceRoot":"","sources":["../src/Institution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAA+B,MAAM,kBAAkB,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAO/C,MAAM,OAAO,sBAAsB;IAC/B,IAAI,CAAU;IACd,QAAQ,CAAoB;IAC5B,aAAa,CAAQ;IACrB,sBAAsB,CAAQ;IAE9B,YAAY,IAAc,EAAE,QAA4B;QACpD,IAAI,CAAC,IAAI,GAA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,EAAE;gBAClE,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;gBACD,IAAI,EAAE,MAAM;aACf,CAAC,CAAC,IAAI,EAA2B,CAAC;YACnC,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAM,GAAG,EAAC,CAAC;YACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9B,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM;QACR,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACrE,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;aACJ,CAAC,CAAC,IAAI,EAA2B,CAAC;YACnC,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAM,GAAG,EAAC,CAAC;YACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9B,CAAC;IACL,CAAC;IAGD,UAAU,CAAC,aAAqB;QAC5B,QAAO,aAAa,EAAE,CAAC;YACnB,KAAK,QAAQ;gBACT,OAAO,IAAI,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5F;gBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;CAEJ"}
@@ -1,23 +1,15 @@
1
+ import { Collection, Bare_Document, Document_Array, _Base_Document, _With_Array } from "./root_types.js";
1
2
  import { project } from "./types/project.js";
2
3
  import { project_query } from "./types/project_query.js";
3
4
  import { project_put } from "./types/project_put.js";
4
5
  import { project_post } from "./types/project_post.js";
5
- export declare class Collection_Project {
6
- path: string[];
7
- get_auth: () => Promise<any>;
8
- collection_id: string;
9
- collection_name_plural: string;
6
+ export declare class Collection_Project extends Collection {
10
7
  constructor(path: string[], get_auth: () => Promise<any>);
11
8
  query(query: project_query): Promise<project[]>;
12
9
  post(document: project_post): Promise<project>;
13
- document(document_id: string): Document;
10
+ document(document_id: string): Document_Project;
14
11
  }
15
- declare class Document {
16
- path: string[];
17
- collection_id: string;
18
- document_id: string;
19
- collection_name_plural: string;
20
- get_auth: () => Promise<any>;
12
+ declare class Document_Project extends Bare_Document implements _Base_Document, _With_Array {
21
13
  constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
22
14
  get(): Promise<project>;
23
15
  put(update: project_put): Promise<project>;
@@ -32,12 +24,7 @@ export type project_steps_post = {
32
24
  "_id"?: string;
33
25
  "name": string;
34
26
  };
35
- export declare class Collection_Project_Array_steps {
36
- path: string[];
37
- get_auth: () => Promise<any>;
38
- collection_id: string;
39
- collection_name_plural: string;
40
- array_key: string;
27
+ export declare class Collection_Project_Array_steps extends Document_Array {
41
28
  constructor(path: string[], get_auth: () => Promise<any>);
42
29
  push(document: project_steps_post): Promise<project>;
43
30
  replace(document: project_steps_put): Promise<project>;
@@ -1,15 +1,9 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params } from "./utils/utils.js";
3
- export class Collection_Project {
4
- path;
5
- get_auth;
6
- collection_id;
7
- collection_name_plural;
3
+ import { Collection, Bare_Document, Document_Array } from "./root_types.js";
4
+ export class Collection_Project extends Collection {
8
5
  constructor(path, get_auth) {
9
- this.path = path;
10
- this.get_auth = get_auth;
11
- this.collection_id = "project";
12
- this.collection_name_plural = "projects";
6
+ super(path, get_auth, "project", "projects");
13
7
  }
14
8
  async query(query) {
15
9
  try {
@@ -44,21 +38,12 @@ export class Collection_Project {
44
38
  let get_auth = this.get_auth;
45
39
  let collection_id = this.collection_id;
46
40
  let collection_name_plural = this.collection_name_plural;
47
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
41
+ return new Document_Project(path, collection_id, document_id, collection_name_plural, get_auth);
48
42
  }
49
43
  }
50
- class Document {
51
- path;
52
- collection_id;
53
- document_id;
54
- collection_name_plural;
55
- get_auth;
44
+ class Document_Project extends Bare_Document {
56
45
  constructor(path, collection_id, document_id, collection_name_plural, get_auth) {
57
- this.path = path;
58
- this.collection_id = collection_id;
59
- this.document_id = document_id;
60
- this.collection_name_plural = collection_name_plural;
61
- this.get_auth = get_auth;
46
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
62
47
  }
63
48
  async get() {
64
49
  try {
@@ -109,18 +94,9 @@ class Document {
109
94
  }
110
95
  }
111
96
  }
112
- export class Collection_Project_Array_steps {
113
- path;
114
- get_auth;
115
- collection_id;
116
- collection_name_plural;
117
- array_key;
97
+ export class Collection_Project_Array_steps extends Document_Array {
118
98
  constructor(path, get_auth) {
119
- this.path = path;
120
- this.get_auth = get_auth;
121
- this.collection_id = "project";
122
- this.collection_name_plural = "projects";
123
- this.array_key = "steps";
99
+ super(path, get_auth, "project", "projects", "steps");
124
100
  }
125
101
  async push(document) {
126
102
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"Project.js","sourceRoot":"","sources":["../src/Project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAA+B,MAAM,kBAAkB,CAAC;AAQrF,MAAM,OAAO,kBAAkB;IAC3B,IAAI,CAAU;IACd,QAAQ,CAAoB;IAC5B,aAAa,CAAQ;IACrB,sBAAsB,CAAQ;IAE9B,YAAY,IAAc,EAAE,QAA4B;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,sBAAsB,GAAG,UAAU,CAAA;IAC5C,CA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AC;YAC/B,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAM,GAAG,EAAC,CAAC;YACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9B,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC5B,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAChE,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;aACJ,CAAC,CAAC,IAAI,EAAuB,CAAC;YAC/B,OAAO,MAAM,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAM,GAAG,EAAC,CAAC;YACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9B,CAAC;IACL,CAAC;CACJ"}
@@ -14,11 +14,10 @@ export type Auth_Data = {
14
14
  metadata?: any;
15
15
  };
16
16
  export declare function api(base_url: string, get_auth: () => Promise<any>): Api;
17
- declare class Api {
17
+ export declare class Api {
18
18
  base_url: string;
19
19
  get_auth: () => Promise<any>;
20
20
  constructor(base_url: string, get_auth: () => Promise<any>);
21
21
  collection(collection_id: "institution"): Collection_Institution;
22
22
  me(): Promise<Auth_Data>;
23
23
  }
24
- export {};
@@ -3,7 +3,7 @@ import { Collection_Institution } from "./Institution.js";
3
3
  export function api(base_url, get_auth) {
4
4
  return new Api(base_url, get_auth);
5
5
  }
6
- class Api {
6
+ export class Api {
7
7
  base_url;
8
8
  get_auth;
9
9
  constructor(base_url, get_auth) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAk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EAAE,QAA4B;IAC9D,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACtC,CAAC;AAED,MAAM,OAAO,GAAG;IACZ,QAAQ,CAAS;IACjB,QAAQ,CAAoB;IAE5B,YAAY,QAAgB,EAAE,QAA4B;QACtD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;IAGD,UAAU,CAAC,aAAqB;QAC5B,QAAO,aAAa,EAAE,CAAC;YACnB,KAAK,aAAa;gBACd,OAAO,IAAI,sBAAsB,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrF;gBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;IAED,KAAK,CAAC,EAAE;QACJ,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACvD,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;aACJ,CAAC,CAAC,IAAI,EAAe,CAAC;YACvB,OAAO,MAAM,CAAC;QAClB,CAAC;QAAC,OAAM,GAAG,EAAC,CAAC;YACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9B,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,41 @@
1
+ export declare abstract class Collection {
2
+ path: string[];
3
+ get_auth: () => Promise<any>;
4
+ collection_id: string;
5
+ collection_name_plural: string;
6
+ constructor(path: string[], get_auth: () => Promise<any>, collection_id: string, collection_name_plural: string);
7
+ abstract query(query: any): Promise<any[]>;
8
+ abstract post(document: any): Promise<any>;
9
+ abstract document(document_id: string): Document;
10
+ }
11
+ 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);
12
+ export declare abstract class Bare_Document {
13
+ path: string[];
14
+ collection_id: string;
15
+ document_id: string;
16
+ collection_name_plural: string;
17
+ get_auth: () => Promise<any>;
18
+ constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
19
+ }
20
+ export interface _Base_Document {
21
+ get(): any;
22
+ put(update: any): Promise<any>;
23
+ remove(): Promise<any>;
24
+ }
25
+ export interface _With_Children {
26
+ collection(collection_id: string): Collection;
27
+ }
28
+ export interface _With_Array {
29
+ array(key: string): Document_Array;
30
+ }
31
+ export declare abstract class Document_Array {
32
+ path: string[];
33
+ collection_id: string;
34
+ collection_name_plural: string;
35
+ array_key: string;
36
+ get_auth: () => Promise<any>;
37
+ constructor(path: string[], get_auth: () => Promise<any>, collection_id: string, collection_name_plural: string, array_key: string);
38
+ abstract push(document: any): Promise<any>;
39
+ abstract replace(document: any): Promise<any>;
40
+ abstract delete(document_id: string): Promise<any>;
41
+ }
@@ -0,0 +1,41 @@
1
+ export class Collection {
2
+ path;
3
+ get_auth;
4
+ collection_id;
5
+ collection_name_plural;
6
+ constructor(path, get_auth, collection_id, collection_name_plural) {
7
+ this.path = path;
8
+ this.get_auth = get_auth;
9
+ this.collection_id = collection_id;
10
+ this.collection_name_plural = collection_name_plural;
11
+ }
12
+ }
13
+ export class Bare_Document {
14
+ path;
15
+ collection_id;
16
+ document_id;
17
+ collection_name_plural;
18
+ get_auth;
19
+ constructor(path, collection_id, document_id, collection_name_plural, get_auth) {
20
+ this.path = path;
21
+ this.collection_id = collection_id;
22
+ this.document_id = document_id;
23
+ this.collection_name_plural = collection_name_plural;
24
+ this.get_auth = get_auth;
25
+ }
26
+ }
27
+ export class Document_Array {
28
+ path;
29
+ collection_id;
30
+ collection_name_plural;
31
+ array_key;
32
+ get_auth;
33
+ constructor(path, get_auth, collection_id, collection_name_plural, array_key) {
34
+ this.path = path;
35
+ this.get_auth = get_auth;
36
+ this.collection_id = collection_id;
37
+ this.collection_name_plural = collection_name_plural;
38
+ this.array_key = array_key;
39
+ }
40
+ }
41
+ //# sourceMappingURL=root_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root_types.js","sourceRoot":"","sources":["../src/root_types.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,UAAU;IAC5B,IAAI,CAAU;IACd,QAAQ,CAAoB;IAC5B,aAAa,CAAQ;IACrB,sBAAsB,CAAQ;IAE9B,YAAY,IAAc,EAAE,QAA4B,EAAE,aAAqB,EAAE,sBAA8B;QAC3G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IACzD,CAAC;CAKJ;AAID,MAAM,OAAgB,aAAa;IAC/B,IAAI,CAAW;IACf,aAAa,CAAS;IACtB,WAAW,CAAS;IACpB,sBAAsB,CAAS;IAC/B,QAAQ,CAAqB;IAE7B,YAAY,IAAc,EAAE,aAAqB,EAAE,WAAmB,EAAE,sBAA8B,EAAE,QAA4B;QAChI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QACrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CACJ;AAgBD,MAAM,OAAgB,cAAc;IAChC,IAAI,CAAU;IACd,aAAa,CAAQ;IACrB,sBAAsB,CAAQ;IAC9B,SAAS,CAAQ;IACjB,QAAQ,CAAoB;IAE5B,YAAY,IAAc,EAAE,QAA4B,EAAE,aAAqB,EAAE,sBAA8B,EAAE,SAAiB;QAC9H,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;QACpD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC9B,CAAC;CAKJ"}
@@ -1,5 +1,6 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params, Response, Response_Multiple } from "./utils/utils.js";
3
+ import { Collection, Bare_Document, Document_Array, _Base_Document, _With_Children, _With_Array } from "./root_types.js"
3
4
 
4
5
 
5
6
  import { brief_news_category } from "./types/brief_news_category.js";
@@ -7,17 +8,9 @@ import { brief_news_category_query } from "./types/brief_news_category_query.js"
7
8
  import { brief_news_category_put } from "./types/brief_news_category_put.js";
8
9
  import { brief_news_category_post } from "./types/brief_news_category_post.js";
9
10
 
10
- export class Collection_Brief_News_Category {
11
- path: string[]
12
- get_auth: () => Promise<any>
13
- collection_id: string
14
- collection_name_plural: string
15
-
11
+ export class Collection_Brief_News_Category extends Collection {
16
12
  constructor(path: string[], get_auth: () => Promise<any>) {
17
- this.path = path;
18
- this.get_auth = get_auth;
19
- this.collection_id = "brief_news_category";
20
- this.collection_name_plural = "brief_news_categories"
13
+ super(path, get_auth, "brief_news_category", "brief_news_categories");
21
14
  }
22
15
 
23
16
 
@@ -54,25 +47,13 @@ export class Collection_Brief_News_Category {
54
47
  let get_auth = this.get_auth;
55
48
  let collection_id = this.collection_id;
56
49
  let collection_name_plural = this.collection_name_plural;
57
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
50
+ return new Document_Brief_News_Category(path, collection_id, document_id, collection_name_plural, get_auth);
58
51
  }
59
52
  }
60
53
 
61
-
62
-
63
- class Document {
64
- path: string[];
65
- collection_id: string;
66
- document_id: string;
67
- collection_name_plural: string;
68
- get_auth: () => Promise<any>;
69
-
54
+ class Document_Brief_News_Category extends Bare_Document implements _Base_Document {
70
55
  constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>) {
71
- this.path = path;
72
- this.collection_id = collection_id;
73
- this.document_id = document_id;
74
- this.collection_name_plural = collection_name_plural;
75
- this.get_auth = get_auth;
56
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
76
57
  }
77
58
 
78
59
  async get(): Promise<brief_news_category>{
@@ -1,5 +1,6 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params, Response, Response_Multiple } from "./utils/utils.js";
3
+ import { Collection, Bare_Document, Document_Array, _Base_Document, _With_Children, _With_Array } from "./root_types.js"
3
4
 
4
5
  import { Collection_Project } from "./Project.js"
5
6
  import { Collection_Brief_News_Category } from "./Brief_News_Category.js"
@@ -9,17 +10,9 @@ import { client_query } from "./types/client_query.js";
9
10
  import { client_put } from "./types/client_put.js";
10
11
  import { client_post } from "./types/client_post.js";
11
12
 
12
- export class Collection_Client {
13
- path: string[]
14
- get_auth: () => Promise<any>
15
- collection_id: string
16
- collection_name_plural: string
17
-
13
+ export class Collection_Client extends Collection {
18
14
  constructor(path: string[], get_auth: () => Promise<any>) {
19
- this.path = path;
20
- this.get_auth = get_auth;
21
- this.collection_id = "client";
22
- this.collection_name_plural = "clients"
15
+ super(path, get_auth, "client", "clients");
23
16
  }
24
17
 
25
18
 
@@ -56,25 +49,13 @@ export class Collection_Client {
56
49
  let get_auth = this.get_auth;
57
50
  let collection_id = this.collection_id;
58
51
  let collection_name_plural = this.collection_name_plural;
59
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
52
+ return new Document_Client(path, collection_id, document_id, collection_name_plural, get_auth);
60
53
  }
61
54
  }
62
55
 
63
-
64
-
65
- class Document {
66
- path: string[];
67
- collection_id: string;
68
- document_id: string;
69
- collection_name_plural: string;
70
- get_auth: () => Promise<any>;
71
-
56
+ class Document_Client extends Bare_Document implements _Base_Document, _With_Children {
72
57
  constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>) {
73
- this.path = path;
74
- this.collection_id = collection_id;
75
- this.document_id = document_id;
76
- this.collection_name_plural = collection_name_plural;
77
- this.get_auth = get_auth;
58
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
78
59
  }
79
60
 
80
61
  async get(): Promise<client>{
@@ -1,5 +1,6 @@
1
1
  import ky from "ky";
2
2
  import { encode_search_params, Response, Response_Multiple } from "./utils/utils.js";
3
+ import { Collection, Bare_Document, Document_Array, _Base_Document, _With_Children, _With_Array } from "./root_types.js"
3
4
 
4
5
  import { Collection_Client } from "./Client.js"
5
6
 
@@ -8,17 +9,9 @@ import { institution_query } from "./types/institution_query.js";
8
9
  import { institution_put } from "./types/institution_put.js";
9
10
  import { institution_post } from "./types/institution_post.js";
10
11
 
11
- export class Collection_Institution {
12
- path: string[]
13
- get_auth: () => Promise<any>
14
- collection_id: string
15
- collection_name_plural: string
16
-
12
+ export class Collection_Institution extends Collection {
17
13
  constructor(path: string[], get_auth: () => Promise<any>) {
18
- this.path = path;
19
- this.get_auth = get_auth;
20
- this.collection_id = "institution";
21
- this.collection_name_plural = "institutions"
14
+ super(path, get_auth, "institution", "institutions");
22
15
  }
23
16
 
24
17
 
@@ -55,25 +48,13 @@ export class Collection_Institution {
55
48
  let get_auth = this.get_auth;
56
49
  let collection_id = this.collection_id;
57
50
  let collection_name_plural = this.collection_name_plural;
58
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
51
+ return new Document_Institution(path, collection_id, document_id, collection_name_plural, get_auth);
59
52
  }
60
53
  }
61
54
 
62
-
63
-
64
- class Document {
65
- path: string[];
66
- collection_id: string;
67
- document_id: string;
68
- collection_name_plural: string;
69
- get_auth: () => Promise<any>;
70
-
55
+ class Document_Institution extends Bare_Document implements _Base_Document, _With_Children {
71
56
  constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>) {
72
- this.path = path;
73
- this.collection_id = collection_id;
74
- this.document_id = document_id;
75
- this.collection_name_plural = collection_name_plural;
76
- this.get_auth = get_auth;
57
+ super(path, collection_id, document_id, collection_name_plural, get_auth);
77
58
  }
78
59
 
79
60
  async get(): Promise<institution>{