@liminalfunctions/framework 1.0.58 → 1.0.60

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 (102) hide show
  1. package/dist/F_Collection.js.map +1 -1
  2. package/dist/F_Compile.js.map +1 -1
  3. package/dist/code_generation/generate_client_library.js +3 -2
  4. package/dist/code_generation/generate_client_library.js.map +1 -1
  5. package/dist/code_generation/templates/main.mustache +3 -4
  6. package/dist/utils/mongoose_from_zod.d.ts +2 -4
  7. package/package.json +1 -1
  8. package/src/F_Collection.ts +2 -3
  9. package/src/F_Compile.ts +0 -2
  10. package/src/code_generation/generate_client_library.ts +3 -2
  11. package/src/code_generation/templates/main.mustache +1 -1
  12. package/test/tmp/src/{Project.ts → Test_Collection.ts} +46 -34
  13. package/test/tmp/src/index.ts +7 -8
  14. package/test/tmp/src/types/test_collection.ts +9 -0
  15. package/test/tmp/src/types/test_collection_post.ts +9 -0
  16. package/test/tmp/src/types/test_collection_put.ts +9 -0
  17. package/test/tmp/src/types/{institution_query.ts → test_collection_query.ts} +2 -6
  18. package/test/tmp/dist/Brief_News_Category.d.ts +0 -26
  19. package/test/tmp/dist/Brief_News_Category.js +0 -104
  20. package/test/tmp/dist/Brief_News_Category.js.map +0 -1
  21. package/test/tmp/dist/Client.d.ts +0 -30
  22. package/test/tmp/dist/Client.js +0 -116
  23. package/test/tmp/dist/Client.js.map +0 -1
  24. package/test/tmp/dist/Institution.d.ts +0 -28
  25. package/test/tmp/dist/Institution.js +0 -113
  26. package/test/tmp/dist/Institution.js.map +0 -1
  27. package/test/tmp/dist/Project.d.ts +0 -46
  28. package/test/tmp/dist/Project.js +0 -167
  29. package/test/tmp/dist/Project.js.map +0 -1
  30. package/test/tmp/dist/index.d.ts +0 -24
  31. package/test/tmp/dist/index.js +0 -36
  32. package/test/tmp/dist/index.js.map +0 -1
  33. package/test/tmp/dist/types/brief_news_category.d.ts +0 -7
  34. package/test/tmp/dist/types/brief_news_category.js +0 -2
  35. package/test/tmp/dist/types/brief_news_category.js.map +0 -1
  36. package/test/tmp/dist/types/brief_news_category_post.d.ts +0 -7
  37. package/test/tmp/dist/types/brief_news_category_post.js +0 -2
  38. package/test/tmp/dist/types/brief_news_category_post.js.map +0 -1
  39. package/test/tmp/dist/types/brief_news_category_put.d.ts +0 -7
  40. package/test/tmp/dist/types/brief_news_category_put.js +0 -2
  41. package/test/tmp/dist/types/brief_news_category_put.js.map +0 -1
  42. package/test/tmp/dist/types/brief_news_category_query.d.ts +0 -26
  43. package/test/tmp/dist/types/brief_news_category_query.js +0 -2
  44. package/test/tmp/dist/types/brief_news_category_query.js.map +0 -1
  45. package/test/tmp/dist/types/client.d.ts +0 -5
  46. package/test/tmp/dist/types/client.js +0 -2
  47. package/test/tmp/dist/types/client.js.map +0 -1
  48. package/test/tmp/dist/types/client_post.d.ts +0 -5
  49. package/test/tmp/dist/types/client_post.js +0 -2
  50. package/test/tmp/dist/types/client_post.js.map +0 -1
  51. package/test/tmp/dist/types/client_put.d.ts +0 -5
  52. package/test/tmp/dist/types/client_put.js +0 -2
  53. package/test/tmp/dist/types/client_put.js.map +0 -1
  54. package/test/tmp/dist/types/client_query.d.ts +0 -18
  55. package/test/tmp/dist/types/client_query.js +0 -2
  56. package/test/tmp/dist/types/client_query.js.map +0 -1
  57. package/test/tmp/dist/types/institution.d.ts +0 -4
  58. package/test/tmp/dist/types/institution.js +0 -2
  59. package/test/tmp/dist/types/institution.js.map +0 -1
  60. package/test/tmp/dist/types/institution_post.d.ts +0 -4
  61. package/test/tmp/dist/types/institution_post.js +0 -2
  62. package/test/tmp/dist/types/institution_post.js.map +0 -1
  63. package/test/tmp/dist/types/institution_put.d.ts +0 -4
  64. package/test/tmp/dist/types/institution_put.js +0 -2
  65. package/test/tmp/dist/types/institution_put.js.map +0 -1
  66. package/test/tmp/dist/types/institution_query.d.ts +0 -14
  67. package/test/tmp/dist/types/institution_query.js +0 -2
  68. package/test/tmp/dist/types/institution_query.js.map +0 -1
  69. package/test/tmp/dist/types/project.d.ts +0 -11
  70. package/test/tmp/dist/types/project.js +0 -2
  71. package/test/tmp/dist/types/project.js.map +0 -1
  72. package/test/tmp/dist/types/project_post.d.ts +0 -11
  73. package/test/tmp/dist/types/project_post.js +0 -2
  74. package/test/tmp/dist/types/project_post.js.map +0 -1
  75. package/test/tmp/dist/types/project_put.d.ts +0 -11
  76. package/test/tmp/dist/types/project_put.js +0 -2
  77. package/test/tmp/dist/types/project_put.js.map +0 -1
  78. package/test/tmp/dist/types/project_query.d.ts +0 -27
  79. package/test/tmp/dist/types/project_query.js +0 -2
  80. package/test/tmp/dist/types/project_query.js.map +0 -1
  81. package/test/tmp/dist/utils/utils.d.ts +0 -11
  82. package/test/tmp/dist/utils/utils.js +0 -16
  83. package/test/tmp/dist/utils/utils.js.map +0 -1
  84. package/test/tmp/package-lock.json +0 -573
  85. package/test/tmp/src/Brief_News_Category.ts +0 -120
  86. package/test/tmp/src/Client.ts +0 -134
  87. package/test/tmp/src/Institution.ts +0 -130
  88. package/test/tmp/src/types/brief_news_category.ts +0 -7
  89. package/test/tmp/src/types/brief_news_category_post.ts +0 -7
  90. package/test/tmp/src/types/brief_news_category_put.ts +0 -7
  91. package/test/tmp/src/types/brief_news_category_query.ts +0 -26
  92. package/test/tmp/src/types/client.ts +0 -5
  93. package/test/tmp/src/types/client_post.ts +0 -5
  94. package/test/tmp/src/types/client_put.ts +0 -5
  95. package/test/tmp/src/types/client_query.ts +0 -18
  96. package/test/tmp/src/types/institution.ts +0 -4
  97. package/test/tmp/src/types/institution_post.ts +0 -4
  98. package/test/tmp/src/types/institution_put.ts +0 -4
  99. package/test/tmp/src/types/project.ts +0 -11
  100. package/test/tmp/src/types/project_post.ts +0 -11
  101. package/test/tmp/src/types/project_put.ts +0 -11
  102. package/test/tmp/src/types/project_query.ts +0 -27
@@ -1,4 +1,4 @@
1
- export type institution_query = {
1
+ export type test_collection_query = {
2
2
  "limit"?: number
3
3
  "cursor"?: string
4
4
  "sort_order"?: ("ascending" | "descending")
@@ -6,9 +6,5 @@ export type institution_query = {
6
6
  "_id_gt"?: string
7
7
  "_id_lt"?: string
8
8
  "_id_in"?: string[]
9
- "name"?: string
10
- "name_gt"?: string
11
- "name_lt"?: string
12
- "name_in"?: string[]
13
- "sort"?: ("_id" | "name")
9
+ "sort"?: ("_id")
14
10
  }
@@ -1,26 +0,0 @@
1
- import { brief_news_category } from "./types/brief_news_category.js";
2
- import { brief_news_category_query } from "./types/brief_news_category_query.js";
3
- import { brief_news_category_put } from "./types/brief_news_category_put.js";
4
- import { brief_news_category_post } from "./types/brief_news_category_post.js";
5
- export declare class Collection_Brief_News_Category {
6
- path: string[];
7
- get_auth: () => Promise<any>;
8
- collection_id: string;
9
- collection_name_plural: string;
10
- constructor(path: string[], get_auth: () => Promise<any>);
11
- query(query: brief_news_category_query): Promise<brief_news_category[]>;
12
- post(document: brief_news_category_post): Promise<brief_news_category>;
13
- document(document_id: string): Document;
14
- }
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>;
21
- constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
22
- get(): Promise<brief_news_category>;
23
- put(update: brief_news_category_put): Promise<brief_news_category>;
24
- remove(): Promise<brief_news_category>;
25
- }
26
- export {};
@@ -1,104 +0,0 @@
1
- import ky from "ky";
2
- import { encode_search_params } from "./utils/utils.js";
3
- export class Collection_Brief_News_Category {
4
- path;
5
- get_auth;
6
- collection_id;
7
- collection_name_plural;
8
- constructor(path, get_auth) {
9
- this.path = path;
10
- this.get_auth = get_auth;
11
- this.collection_id = "brief_news_category";
12
- this.collection_name_plural = "brief_news_categories";
13
- }
14
- async query(query) {
15
- try {
16
- let result = await ky.get(this.path.join('/'), {
17
- headers: {
18
- authorization: await this.get_auth()
19
- },
20
- searchParams: encode_search_params(query)
21
- }).json();
22
- return result.data;
23
- }
24
- catch (err) {
25
- return Promise.reject(err);
26
- }
27
- }
28
- async post(document) {
29
- try {
30
- let result = await ky.post(this.path.join('/'), {
31
- headers: {
32
- authorization: await this.get_auth()
33
- },
34
- json: document
35
- }).json();
36
- return result.data;
37
- }
38
- catch (err) {
39
- return Promise.reject(err);
40
- }
41
- }
42
- document(document_id) {
43
- let path = this.path;
44
- let get_auth = this.get_auth;
45
- let collection_id = this.collection_id;
46
- let collection_name_plural = this.collection_name_plural;
47
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
48
- }
49
- }
50
- class Document {
51
- path;
52
- collection_id;
53
- document_id;
54
- collection_name_plural;
55
- get_auth;
56
- 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;
62
- }
63
- async get() {
64
- try {
65
- let result = await ky.get([...this.path, this.document_id].join('/'), {
66
- headers: {
67
- authorization: await this.get_auth()
68
- },
69
- }).json();
70
- return result.data;
71
- }
72
- catch (err) {
73
- return Promise.reject(err);
74
- }
75
- }
76
- async put(update) {
77
- try {
78
- let result = await ky.put([...this.path, this.document_id].join('/'), {
79
- headers: {
80
- authorization: await this.get_auth()
81
- },
82
- json: update
83
- }).json();
84
- return result.data;
85
- }
86
- catch (err) {
87
- return Promise.reject(err);
88
- }
89
- }
90
- async remove() {
91
- try {
92
- let result = await ky.delete([...this.path, this.document_id].join('/'), {
93
- headers: {
94
- authorization: await this.get_auth()
95
- },
96
- }).json();
97
- return result.data;
98
- }
99
- catch (err) {
100
- return Promise.reject(err);
101
- }
102
- }
103
- }
104
- //# sourceMappingURL=Brief_News_Category.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Brief_News_Category.js","sourceRoot":"","sources":["../src/Brief_News_Category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAA+B,MAAM,kBAAkB,CAAC;AA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C9B,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAA+B;QACrC,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAClE,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;gBACD,IAAI,EAAE,MAAM;aACf,CAAC,CAAC,IAAI,EAAmC,CAAC;YAC3C,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,EAAmC,CAAC;YAC3C,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;CAGJ"}
@@ -1,30 +0,0 @@
1
- import { Collection_Project } from "./Project.js";
2
- import { Collection_Brief_News_Category } from "./Brief_News_Category.js";
3
- import { client } from "./types/client.js";
4
- import { client_query } from "./types/client_query.js";
5
- import { client_put } from "./types/client_put.js";
6
- import { client_post } from "./types/client_post.js";
7
- export declare class Collection_Client {
8
- path: string[];
9
- get_auth: () => Promise<any>;
10
- collection_id: string;
11
- collection_name_plural: string;
12
- constructor(path: string[], get_auth: () => Promise<any>);
13
- query(query: client_query): Promise<client[]>;
14
- post(document: client_post): Promise<client>;
15
- document(document_id: string): Document;
16
- }
17
- declare class Document {
18
- path: string[];
19
- collection_id: string;
20
- document_id: string;
21
- collection_name_plural: string;
22
- get_auth: () => Promise<any>;
23
- constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
24
- get(): Promise<client>;
25
- put(update: client_put): Promise<client>;
26
- remove(): Promise<client>;
27
- collection(collection_id: "project"): Collection_Project;
28
- collection(collection_id: "brief_news_category"): Collection_Brief_News_Category;
29
- }
30
- export {};
@@ -1,116 +0,0 @@
1
- import ky from "ky";
2
- import { encode_search_params } from "./utils/utils.js";
3
- import { Collection_Project } from "./Project.js";
4
- 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;
10
- 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";
15
- }
16
- async query(query) {
17
- try {
18
- let result = await ky.get(this.path.join('/'), {
19
- headers: {
20
- authorization: await this.get_auth()
21
- },
22
- searchParams: encode_search_params(query)
23
- }).json();
24
- return result.data;
25
- }
26
- catch (err) {
27
- return Promise.reject(err);
28
- }
29
- }
30
- async post(document) {
31
- try {
32
- let result = await ky.post(this.path.join('/'), {
33
- headers: {
34
- authorization: await this.get_auth()
35
- },
36
- json: document
37
- }).json();
38
- return result.data;
39
- }
40
- catch (err) {
41
- return Promise.reject(err);
42
- }
43
- }
44
- document(document_id) {
45
- let path = this.path;
46
- let get_auth = this.get_auth;
47
- let collection_id = this.collection_id;
48
- let collection_name_plural = this.collection_name_plural;
49
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
50
- }
51
- }
52
- class Document {
53
- path;
54
- collection_id;
55
- document_id;
56
- collection_name_plural;
57
- get_auth;
58
- 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;
64
- }
65
- async get() {
66
- try {
67
- let result = await ky.get([...this.path, this.document_id].join('/'), {
68
- headers: {
69
- authorization: await this.get_auth()
70
- },
71
- }).json();
72
- return result.data;
73
- }
74
- catch (err) {
75
- return Promise.reject(err);
76
- }
77
- }
78
- async put(update) {
79
- try {
80
- let result = await ky.put([...this.path, this.document_id].join('/'), {
81
- headers: {
82
- authorization: await this.get_auth()
83
- },
84
- json: update
85
- }).json();
86
- return result.data;
87
- }
88
- catch (err) {
89
- return Promise.reject(err);
90
- }
91
- }
92
- async remove() {
93
- try {
94
- let result = await ky.delete([...this.path, this.document_id].join('/'), {
95
- headers: {
96
- authorization: await this.get_auth()
97
- },
98
- }).json();
99
- return result.data;
100
- }
101
- catch (err) {
102
- return Promise.reject(err);
103
- }
104
- }
105
- collection(collection_id) {
106
- switch (collection_id) {
107
- case "project":
108
- return new Collection_Project([...this.path, this.document_id, "project"], this.get_auth);
109
- case "brief_news_category":
110
- return new Collection_Brief_News_Category([...this.path, this.document_id, "brief_news_category"], this.get_auth);
111
- default:
112
- throw new Error(`Api does not have the collection ${collection_id}`);
113
- }
114
- }
115
- }
116
- //# sourceMappingURL=Client.js.map
@@ -1 +0,0 @@
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;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AAOzE,MAAM,OAAO,iBAAiB;IAC1B,IAAI,CAAU;IACd,QAAQ,CAAoB;IAC5B,aAAa,CAAQ;IACrB,sBAAsB,CAAQ;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C,QAAQ,CAAC,CAAC;YACtH;gBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;CAEJ"}
@@ -1,28 +0,0 @@
1
- import { Collection_Client } from "./Client.js";
2
- import { institution } from "./types/institution.js";
3
- import { institution_query } from "./types/institution_query.js";
4
- import { institution_put } from "./types/institution_put.js";
5
- 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;
11
- constructor(path: string[], get_auth: () => Promise<any>);
12
- query(query: institution_query): Promise<institution[]>;
13
- post(document: institution_post): Promise<institution>;
14
- document(document_id: string): Document;
15
- }
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>;
22
- constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
23
- get(): Promise<institution>;
24
- put(update: institution_put): Promise<institution>;
25
- remove(): Promise<institution>;
26
- collection(collection_id: "client"): Collection_Client;
27
- }
28
- export {};
@@ -1,113 +0,0 @@
1
- import ky from "ky";
2
- import { encode_search_params } from "./utils/utils.js";
3
- import { Collection_Client } from "./Client.js";
4
- export class Collection_Institution {
5
- path;
6
- get_auth;
7
- collection_id;
8
- collection_name_plural;
9
- 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";
14
- }
15
- async query(query) {
16
- try {
17
- let result = await ky.get(this.path.join('/'), {
18
- headers: {
19
- authorization: await this.get_auth()
20
- },
21
- searchParams: encode_search_params(query)
22
- }).json();
23
- return result.data;
24
- }
25
- catch (err) {
26
- return Promise.reject(err);
27
- }
28
- }
29
- async post(document) {
30
- try {
31
- let result = await ky.post(this.path.join('/'), {
32
- headers: {
33
- authorization: await this.get_auth()
34
- },
35
- json: document
36
- }).json();
37
- return result.data;
38
- }
39
- catch (err) {
40
- return Promise.reject(err);
41
- }
42
- }
43
- document(document_id) {
44
- let path = this.path;
45
- let get_auth = this.get_auth;
46
- let collection_id = this.collection_id;
47
- let collection_name_plural = this.collection_name_plural;
48
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
49
- }
50
- }
51
- class Document {
52
- path;
53
- collection_id;
54
- document_id;
55
- collection_name_plural;
56
- get_auth;
57
- 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;
63
- }
64
- async get() {
65
- try {
66
- let result = await ky.get([...this.path, this.document_id].join('/'), {
67
- headers: {
68
- authorization: await this.get_auth()
69
- },
70
- }).json();
71
- return result.data;
72
- }
73
- catch (err) {
74
- return Promise.reject(err);
75
- }
76
- }
77
- async put(update) {
78
- try {
79
- let result = await ky.put([...this.path, this.document_id].join('/'), {
80
- headers: {
81
- authorization: await this.get_auth()
82
- },
83
- json: update
84
- }).json();
85
- return result.data;
86
- }
87
- catch (err) {
88
- return Promise.reject(err);
89
- }
90
- }
91
- async remove() {
92
- try {
93
- let result = await ky.delete([...this.path, this.document_id].join('/'), {
94
- headers: {
95
- authorization: await this.get_auth()
96
- },
97
- }).json();
98
- return result.data;
99
- }
100
- catch (err) {
101
- return Promise.reject(err);
102
- }
103
- }
104
- collection(collection_id) {
105
- switch (collection_id) {
106
- case "client":
107
- return new Collection_Client([...this.path, this.document_id, "client"], this.get_auth);
108
- default:
109
- throw new Error(`Api does not have the collection ${collection_id}`);
110
- }
111
- }
112
- }
113
- //# sourceMappingURL=Institution.js.map
@@ -1 +0,0 @@
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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AC;YAC5F;gBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;QAC5E,CAAC;IACL,CAAC;CAEJ"}
@@ -1,46 +0,0 @@
1
- import { project } from "./types/project.js";
2
- import { project_query } from "./types/project_query.js";
3
- import { project_put } from "./types/project_put.js";
4
- 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;
10
- constructor(path: string[], get_auth: () => Promise<any>);
11
- query(query: project_query): Promise<project[]>;
12
- post(document: project_post): Promise<project>;
13
- document(document_id: string): Document;
14
- }
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>;
21
- constructor(path: string[], collection_id: string, document_id: string, collection_name_plural: string, get_auth: () => Promise<any>);
22
- get(): Promise<project>;
23
- put(update: project_put): Promise<project>;
24
- remove(): Promise<project>;
25
- array(key: "steps"): Collection_Project_Array_steps;
26
- }
27
- export type project_steps_put = {
28
- "_id": string;
29
- "name": string;
30
- };
31
- export type project_steps_post = {
32
- "_id"?: string;
33
- "name": string;
34
- };
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;
41
- constructor(path: string[], get_auth: () => Promise<any>);
42
- push(document: project_steps_post): Promise<project>;
43
- replace(document: project_steps_put): Promise<project>;
44
- delete(document_id: string): Promise<project>;
45
- }
46
- export {};
@@ -1,167 +0,0 @@
1
- import ky from "ky";
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;
8
- 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";
13
- }
14
- async query(query) {
15
- try {
16
- let result = await ky.get(this.path.join('/'), {
17
- headers: {
18
- authorization: await this.get_auth()
19
- },
20
- searchParams: encode_search_params(query)
21
- }).json();
22
- return result.data;
23
- }
24
- catch (err) {
25
- return Promise.reject(err);
26
- }
27
- }
28
- async post(document) {
29
- try {
30
- let result = await ky.post(this.path.join('/'), {
31
- headers: {
32
- authorization: await this.get_auth()
33
- },
34
- json: document
35
- }).json();
36
- return result.data;
37
- }
38
- catch (err) {
39
- return Promise.reject(err);
40
- }
41
- }
42
- document(document_id) {
43
- let path = this.path;
44
- let get_auth = this.get_auth;
45
- let collection_id = this.collection_id;
46
- let collection_name_plural = this.collection_name_plural;
47
- return new Document(path, collection_id, document_id, collection_name_plural, get_auth);
48
- }
49
- }
50
- class Document {
51
- path;
52
- collection_id;
53
- document_id;
54
- collection_name_plural;
55
- get_auth;
56
- 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;
62
- }
63
- async get() {
64
- try {
65
- let result = await ky.get([...this.path, this.document_id].join('/'), {
66
- headers: {
67
- authorization: await this.get_auth()
68
- },
69
- }).json();
70
- return result.data;
71
- }
72
- catch (err) {
73
- return Promise.reject(err);
74
- }
75
- }
76
- async put(update) {
77
- try {
78
- let result = await ky.put([...this.path, this.document_id].join('/'), {
79
- headers: {
80
- authorization: await this.get_auth()
81
- },
82
- json: update
83
- }).json();
84
- return result.data;
85
- }
86
- catch (err) {
87
- return Promise.reject(err);
88
- }
89
- }
90
- async remove() {
91
- try {
92
- let result = await ky.delete([...this.path, this.document_id].join('/'), {
93
- headers: {
94
- authorization: await this.get_auth()
95
- },
96
- }).json();
97
- return result.data;
98
- }
99
- catch (err) {
100
- return Promise.reject(err);
101
- }
102
- }
103
- array(key) {
104
- switch (key) {
105
- case "steps":
106
- return new Collection_Project_Array_steps([...this.path, this.document_id, "steps"], this.get_auth);
107
- default:
108
- throw new Error(`Collection ${this.collection_id} does not have an array at the key ${key}`);
109
- }
110
- }
111
- }
112
- export class Collection_Project_Array_steps {
113
- path;
114
- get_auth;
115
- collection_id;
116
- collection_name_plural;
117
- array_key;
118
- 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";
124
- }
125
- async push(document) {
126
- try {
127
- let result = await ky.post(this.path.join('/'), {
128
- headers: {
129
- authorization: await this.get_auth()
130
- },
131
- json: document
132
- }).json();
133
- return result.data;
134
- }
135
- catch (err) {
136
- return Promise.reject(err);
137
- }
138
- }
139
- async replace(document) {
140
- try {
141
- let result = await ky.put([...this.path, document._id].join('/'), {
142
- headers: {
143
- authorization: await this.get_auth()
144
- },
145
- json: document
146
- }).json();
147
- return result.data;
148
- }
149
- catch (err) {
150
- return Promise.reject(err);
151
- }
152
- }
153
- async delete(document_id) {
154
- try {
155
- let result = await ky.delete([...this.path, document_id].join('/'), {
156
- headers: {
157
- authorization: await this.get_auth()
158
- }
159
- }).json();
160
- return result.data;
161
- }
162
- catch (err) {
163
- return Promise.reject(err);
164
- }
165
- }
166
- }
167
- //# sourceMappingURL=Project.js.map