@liminalfunctions/framework 1.0.2 → 1.0.6
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.
- package/dist/F_Compile.js +35 -28
- package/dist/F_Compile.js.map +1 -1
- package/dist/code_generation/utils/type_from_zod.js +3 -3
- package/dist/code_generation/utils/type_from_zod.js.map +1 -1
- package/dist/utils/mongoose_from_zod.js +10 -4
- package/dist/utils/mongoose_from_zod.js.map +1 -1
- package/package.json +15 -2
- package/src/F_Compile.ts +52 -40
- package/src/code_generation/utils/type_from_zod.ts +3 -3
- package/src/utils/mongoose_from_zod.ts +9 -4
- package/test/0_0_mongoose_from_zod.test.ts +8 -6
- package/test/1_0_basic_server.test.ts +5 -0
- package/test/1_1_security_ownership.test.ts +5 -0
- package/test/1_2_role_membership.test.ts +33 -12
- package/test/2_0_client_library_basic_type_generation.test.ts +6 -6
- package/test/tmp/package-lock.json +3 -3
- package/test/tmp/dist/Brief_News_Category.d.ts +0 -16
- package/test/tmp/dist/Brief_News_Category.js +0 -85
- package/test/tmp/dist/Brief_News_Category.js.map +0 -1
- package/test/tmp/dist/Client.d.ts +0 -19
- package/test/tmp/dist/Client.js +0 -97
- package/test/tmp/dist/Client.js.map +0 -1
- package/test/tmp/dist/Institution.d.ts +0 -18
- package/test/tmp/dist/Institution.js +0 -94
- package/test/tmp/dist/Institution.js.map +0 -1
- package/test/tmp/dist/Project.d.ts +0 -16
- package/test/tmp/dist/Project.js +0 -85
- package/test/tmp/dist/Project.js.map +0 -1
- package/test/tmp/dist/index.d.ts +0 -4
- package/test/tmp/dist/index.js +0 -14
- package/test/tmp/dist/index.js.map +0 -1
- package/test/tmp/dist/types/brief_news_category.d.ts +0 -7
- package/test/tmp/dist/types/brief_news_category.js +0 -2
- package/test/tmp/dist/types/brief_news_category.js.map +0 -1
- package/test/tmp/dist/types/brief_news_category_post.d.ts +0 -7
- package/test/tmp/dist/types/brief_news_category_post.js +0 -2
- package/test/tmp/dist/types/brief_news_category_post.js.map +0 -1
- package/test/tmp/dist/types/brief_news_category_put.d.ts +0 -7
- package/test/tmp/dist/types/brief_news_category_put.js +0 -2
- package/test/tmp/dist/types/brief_news_category_put.js.map +0 -1
- package/test/tmp/dist/types/brief_news_category_query.d.ts +0 -26
- package/test/tmp/dist/types/brief_news_category_query.js +0 -2
- package/test/tmp/dist/types/brief_news_category_query.js.map +0 -1
- package/test/tmp/dist/types/client.d.ts +0 -5
- package/test/tmp/dist/types/client.js +0 -2
- package/test/tmp/dist/types/client.js.map +0 -1
- package/test/tmp/dist/types/client_post.d.ts +0 -5
- package/test/tmp/dist/types/client_post.js +0 -2
- package/test/tmp/dist/types/client_post.js.map +0 -1
- package/test/tmp/dist/types/client_put.d.ts +0 -5
- package/test/tmp/dist/types/client_put.js +0 -2
- package/test/tmp/dist/types/client_put.js.map +0 -1
- package/test/tmp/dist/types/client_query.d.ts +0 -18
- package/test/tmp/dist/types/client_query.js +0 -2
- package/test/tmp/dist/types/client_query.js.map +0 -1
- package/test/tmp/dist/types/institution.d.ts +0 -4
- package/test/tmp/dist/types/institution.js +0 -2
- package/test/tmp/dist/types/institution.js.map +0 -1
- package/test/tmp/dist/types/institution_post.d.ts +0 -4
- package/test/tmp/dist/types/institution_post.js +0 -2
- package/test/tmp/dist/types/institution_post.js.map +0 -1
- package/test/tmp/dist/types/institution_put.d.ts +0 -4
- package/test/tmp/dist/types/institution_put.js +0 -2
- package/test/tmp/dist/types/institution_put.js.map +0 -1
- package/test/tmp/dist/types/institution_query.d.ts +0 -14
- package/test/tmp/dist/types/institution_query.js +0 -2
- package/test/tmp/dist/types/institution_query.js.map +0 -1
- package/test/tmp/dist/types/project.d.ts +0 -7
- package/test/tmp/dist/types/project.js +0 -2
- package/test/tmp/dist/types/project.js.map +0 -1
- package/test/tmp/dist/types/project_post.d.ts +0 -7
- package/test/tmp/dist/types/project_post.js +0 -2
- package/test/tmp/dist/types/project_post.js.map +0 -1
- package/test/tmp/dist/types/project_put.d.ts +0 -7
- package/test/tmp/dist/types/project_put.js +0 -2
- package/test/tmp/dist/types/project_put.js.map +0 -1
- package/test/tmp/dist/types/project_query.d.ts +0 -27
- package/test/tmp/dist/types/project_query.js +0 -2
- package/test/tmp/dist/types/project_query.js.map +0 -1
- package/test/tmp/dist/utils/utils.d.ts +0 -11
- package/test/tmp/dist/utils/utils.js +0 -13
- package/test/tmp/dist/utils/utils.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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;IAE5B,YAAY,IAAc,EAAE,QAA4B;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAGD,KAAK,CAAC,KAAK,CAAC,KAAoB;QAC5B,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAC3C,OAAO,EAAE;oBACL,aAAa,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE;iBACvC;gBACD,YAAY,EAAE,oBAAoB,CAAC,KAAK,CAAC;aAC5C,CAAC,CAAC,IAAI,EAAgC,CAAC;YACxC,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,IAAI,CAAC,QAAsB;QAC7B,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,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B,OAAO,MAAM,CAAC,IAAI,CAAC;gBACvB,CAAC;gBAAC,OAAM,GAAG,EAAC,CAAC;oBACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBAC9B,CAAC;YACL,CAAC;YAED,KAAK,CAAC,MAAM;gBACR,IAAI,CAAC;oBACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;wBAC3D,OAAO,EAAE;4BACL,aAAa,EAAE,MAAM,QAAQ,EAAE;yBAClC;qBACJ,CAAC,CAAC,IAAI,EAAuB,CAAC;oBAC/B,OAAO,MAAM,CAAC,IAAI,CAAC;gBACvB,CAAC;gBAAC,OAAM,GAAG,EAAC,CAAC;oBACT,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBAC9B,CAAC;YACL,CAAC;SAEJ,CAAA;IACL,CAAC;CACJ"}
|
package/test/tmp/dist/index.d.ts
DELETED
package/test/tmp/dist/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Collection_Institution } from "./Institution.js";
|
|
2
|
-
export function api(base_url, get_auth) {
|
|
3
|
-
return {
|
|
4
|
-
collection(collection_id) {
|
|
5
|
-
switch (collection_id) {
|
|
6
|
-
case "institution":
|
|
7
|
-
return new Collection_Institution([base_url, "institution"], get_auth);
|
|
8
|
-
default:
|
|
9
|
-
throw new Error(`Api does not have the collection ${collection_id}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAGzD,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,QAA4B;IAC9D,OAAO;QACH,UAAU,CAAC,aAA4B;YACnC,QAAO,aAAa,EAAE,CAAC;gBACnB,KAAK,aAAa;oBACd,OAAO,IAAI,sBAAsB,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC3E;oBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;YAC5E,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"brief_news_category.js","sourceRoot":"","sources":["../../src/types/brief_news_category.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"brief_news_category_post.js","sourceRoot":"","sources":["../../src/types/brief_news_category_post.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"brief_news_category_put.js","sourceRoot":"","sources":["../../src/types/brief_news_category_put.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export type brief_news_category_query = {
|
|
2
|
-
"limit"?: number;
|
|
3
|
-
"cursor"?: string;
|
|
4
|
-
"sort_order"?: ("ascending" | "descending");
|
|
5
|
-
"_id"?: string;
|
|
6
|
-
"_id_gt"?: string;
|
|
7
|
-
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
9
|
-
"name"?: string;
|
|
10
|
-
"name_gt"?: string;
|
|
11
|
-
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
13
|
-
"slug"?: string;
|
|
14
|
-
"slug_gt"?: string;
|
|
15
|
-
"slug_lt"?: string;
|
|
16
|
-
"slug_in"?: string[];
|
|
17
|
-
"institution_id"?: string;
|
|
18
|
-
"institution_id_gt"?: string;
|
|
19
|
-
"institution_id_lt"?: string;
|
|
20
|
-
"institution_id_in"?: string[];
|
|
21
|
-
"client_id"?: string;
|
|
22
|
-
"client_id_gt"?: string;
|
|
23
|
-
"client_id_lt"?: string;
|
|
24
|
-
"client_id_in"?: string[];
|
|
25
|
-
"sort"?: ("_id" | "name" | "slug" | "institution_id" | "client_id");
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"brief_news_category_query.js","sourceRoot":"","sources":["../../src/types/brief_news_category_query.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/types/client.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client_post.js","sourceRoot":"","sources":["../../src/types/client_post.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client_put.js","sourceRoot":"","sources":["../../src/types/client_put.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type client_query = {
|
|
2
|
-
"limit"?: number;
|
|
3
|
-
"cursor"?: string;
|
|
4
|
-
"sort_order"?: ("ascending" | "descending");
|
|
5
|
-
"_id"?: string;
|
|
6
|
-
"_id_gt"?: string;
|
|
7
|
-
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
9
|
-
"name"?: string;
|
|
10
|
-
"name_gt"?: string;
|
|
11
|
-
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
13
|
-
"institution_id"?: string;
|
|
14
|
-
"institution_id_gt"?: string;
|
|
15
|
-
"institution_id_lt"?: string;
|
|
16
|
-
"institution_id_in"?: string[];
|
|
17
|
-
"sort"?: ("_id" | "name" | "institution_id");
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client_query.js","sourceRoot":"","sources":["../../src/types/client_query.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"institution.js","sourceRoot":"","sources":["../../src/types/institution.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"institution_post.js","sourceRoot":"","sources":["../../src/types/institution_post.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"institution_put.js","sourceRoot":"","sources":["../../src/types/institution_put.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type institution_query = {
|
|
2
|
-
"limit"?: number;
|
|
3
|
-
"cursor"?: string;
|
|
4
|
-
"sort_order"?: ("ascending" | "descending");
|
|
5
|
-
"_id"?: string;
|
|
6
|
-
"_id_gt"?: string;
|
|
7
|
-
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
9
|
-
"name"?: string;
|
|
10
|
-
"name_gt"?: string;
|
|
11
|
-
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
13
|
-
"sort"?: ("_id" | "name");
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"institution_query.js","sourceRoot":"","sources":["../../src/types/institution_query.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/types/project.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_post.js","sourceRoot":"","sources":["../../src/types/project_post.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_put.js","sourceRoot":"","sources":["../../src/types/project_put.ts"],"names":[],"mappings":""}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type project_query = {
|
|
2
|
-
"limit"?: number;
|
|
3
|
-
"cursor"?: string;
|
|
4
|
-
"sort_order"?: ("ascending" | "descending");
|
|
5
|
-
"_id"?: string;
|
|
6
|
-
"_id_gt"?: string;
|
|
7
|
-
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
9
|
-
"name"?: string;
|
|
10
|
-
"name_gt"?: string;
|
|
11
|
-
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
13
|
-
"institution_id"?: string;
|
|
14
|
-
"institution_id_gt"?: string;
|
|
15
|
-
"institution_id_lt"?: string;
|
|
16
|
-
"institution_id_in"?: string[];
|
|
17
|
-
"client_id"?: string;
|
|
18
|
-
"client_id_gt"?: string;
|
|
19
|
-
"client_id_lt"?: string;
|
|
20
|
-
"client_id_in"?: string[];
|
|
21
|
-
"project_number"?: number;
|
|
22
|
-
"project_number_gt"?: number;
|
|
23
|
-
"project_number_gte"?: number;
|
|
24
|
-
"project_number_lt"?: number;
|
|
25
|
-
"project_number_lte"?: number;
|
|
26
|
-
"sort"?: ("_id" | "name" | "institution_id" | "client_id" | "project_number");
|
|
27
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_query.js","sourceRoot":"","sources":["../../src/types/project_query.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function encode_search_params(params: {
|
|
2
|
-
[key: string]: string | number | boolean | string[];
|
|
3
|
-
}): {
|
|
4
|
-
[key: string]: string | number | boolean;
|
|
5
|
-
};
|
|
6
|
-
export type Response<Q> = {
|
|
7
|
-
data: Q;
|
|
8
|
-
};
|
|
9
|
-
export type Response_Multiple<Q> = {
|
|
10
|
-
data: Q[];
|
|
11
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function encode_search_params(params) {
|
|
2
|
-
let retval = {};
|
|
3
|
-
for (let [key, value] of Object.entries(params)) {
|
|
4
|
-
if (Array.isArray(value)) {
|
|
5
|
-
retval[key] = value.join(',');
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
retval[key] = value;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return retval;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAAC,MAA6D;IAC9F,IAAI,MAAM,GAAgD,EAAE,CAAA;IAC5D,KAAI,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAC,CAAC;QAC5C,IAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|