@liminalfunctions/framework 1.0.3 → 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 +3 -3
- 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 +3 -3
- 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
|
@@ -379,9 +379,9 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
379
379
|
)
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
-
it(`should be able to generate a plain object containing a
|
|
382
|
+
it(`should be able to generate a plain object containing a record`, async function () {
|
|
383
383
|
const validate_test_collection = z.object({
|
|
384
|
-
test: z.
|
|
384
|
+
test: z.record(z.string(), z.string())
|
|
385
385
|
});
|
|
386
386
|
|
|
387
387
|
let test_collection = new F_Collection('test_collection', validate_test_collection);
|
|
@@ -400,9 +400,9 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
400
400
|
});
|
|
401
401
|
|
|
402
402
|
|
|
403
|
-
it(`should be able to generate a plain object containing an object
|
|
403
|
+
it(`should be able to generate a plain object containing an object record`, async function () {
|
|
404
404
|
const validate_test_collection = z.object({
|
|
405
|
-
test: z.
|
|
405
|
+
test: z.record(z.string(), z.object({
|
|
406
406
|
test_2: z.string()
|
|
407
407
|
}))
|
|
408
408
|
});
|
|
@@ -422,9 +422,9 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
422
422
|
)
|
|
423
423
|
});
|
|
424
424
|
|
|
425
|
-
it(`should be able to generate a plain object containing an array
|
|
425
|
+
it(`should be able to generate a plain object containing an array record`, async function () {
|
|
426
426
|
const validate_test_collection = z.object({
|
|
427
|
-
test: z.
|
|
427
|
+
test: z.record(z.string(), z.array(z.string()))
|
|
428
428
|
});
|
|
429
429
|
|
|
430
430
|
let test_collection = new F_Collection('test_collection', validate_test_collection);
|
|
@@ -528,9 +528,9 @@
|
|
|
528
528
|
}
|
|
529
529
|
},
|
|
530
530
|
"node_modules/ky": {
|
|
531
|
-
"version": "1.9.
|
|
532
|
-
"resolved": "https://registry.npmjs.org/ky/-/ky-1.9.
|
|
533
|
-
"integrity": "sha512-
|
|
531
|
+
"version": "1.9.1",
|
|
532
|
+
"resolved": "https://registry.npmjs.org/ky/-/ky-1.9.1.tgz",
|
|
533
|
+
"integrity": "sha512-WGzpBn57klhxsqRTEABAqF4tqTtqCuxoTIv9m6nIZtMMFTVcrHp7bRDWblzFIfqkb47+OhTztOgHn6A4xItmqg==",
|
|
534
534
|
"license": "MIT",
|
|
535
535
|
"engines": {
|
|
536
536
|
"node": ">=18"
|
|
@@ -1,16 +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
|
-
constructor(path: string[], get_auth: () => Promise<any>);
|
|
9
|
-
query(query: brief_news_category_query): Promise<brief_news_category[]>;
|
|
10
|
-
post(document: brief_news_category_post): Promise<brief_news_category>;
|
|
11
|
-
document(document_id: string): {
|
|
12
|
-
get(): Promise<brief_news_category>;
|
|
13
|
-
put(update: brief_news_category_put): Promise<brief_news_category>;
|
|
14
|
-
remove(): Promise<brief_news_category>;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,85 +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
|
-
constructor(path, get_auth) {
|
|
7
|
-
this.path = path;
|
|
8
|
-
this.get_auth = get_auth;
|
|
9
|
-
}
|
|
10
|
-
async query(query) {
|
|
11
|
-
try {
|
|
12
|
-
let result = await ky.get(this.path.join('/'), {
|
|
13
|
-
headers: {
|
|
14
|
-
authorization: await this.get_auth()
|
|
15
|
-
},
|
|
16
|
-
searchParams: encode_search_params(query)
|
|
17
|
-
}).json();
|
|
18
|
-
return result.data;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
return Promise.reject(err);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async post(document) {
|
|
25
|
-
try {
|
|
26
|
-
let result = await ky.post(this.path.join('/'), {
|
|
27
|
-
headers: {
|
|
28
|
-
authorization: await this.get_auth()
|
|
29
|
-
},
|
|
30
|
-
json: document
|
|
31
|
-
}).json();
|
|
32
|
-
return result.data;
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
return Promise.reject(err);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
document(document_id) {
|
|
39
|
-
let path = this.path;
|
|
40
|
-
let get_auth = this.get_auth;
|
|
41
|
-
return {
|
|
42
|
-
async get() {
|
|
43
|
-
try {
|
|
44
|
-
let result = await ky.get([...path, document_id].join('/'), {
|
|
45
|
-
headers: {
|
|
46
|
-
authorization: await get_auth()
|
|
47
|
-
},
|
|
48
|
-
}).json();
|
|
49
|
-
return result.data;
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
return Promise.reject(err);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async put(update) {
|
|
56
|
-
try {
|
|
57
|
-
let result = await ky.put([...path, document_id].join('/'), {
|
|
58
|
-
headers: {
|
|
59
|
-
authorization: await get_auth()
|
|
60
|
-
},
|
|
61
|
-
json: update
|
|
62
|
-
}).json();
|
|
63
|
-
return result.data;
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
return Promise.reject(err);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
async remove() {
|
|
70
|
-
try {
|
|
71
|
-
let result = await ky.delete([...path, document_id].join('/'), {
|
|
72
|
-
headers: {
|
|
73
|
-
authorization: await get_auth()
|
|
74
|
-
},
|
|
75
|
-
}).json();
|
|
76
|
-
return result.data;
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
return Promise.reject(err);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# 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;AAQrF,MAAM,OAAO,8BAA8B;IACvC,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,KAAgC;QACxC,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,EAA4C,CAAC;YACpD,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,QAAkC;QACzC,IAAI,CAAC;YACD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MAAM;qBACf,CAAC,CAAC,IAAI,EAAmC,CAAC;oBAC3C,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,EAAmC,CAAC;oBAC3C,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"}
|
|
@@ -1,19 +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
|
-
constructor(path: string[], get_auth: () => Promise<any>);
|
|
11
|
-
query(query: client_query): Promise<client[]>;
|
|
12
|
-
post(document: client_post): Promise<client>;
|
|
13
|
-
document(document_id: string): {
|
|
14
|
-
get(): Promise<client>;
|
|
15
|
-
put(update: client_put): Promise<client>;
|
|
16
|
-
remove(): Promise<client>;
|
|
17
|
-
collection(collection_id: "project" | "brief_news_category"): Collection_Brief_News_Category | Collection_Project;
|
|
18
|
-
};
|
|
19
|
-
}
|
package/test/tmp/dist/Client.js
DELETED
|
@@ -1,97 +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
|
-
constructor(path, get_auth) {
|
|
9
|
-
this.path = path;
|
|
10
|
-
this.get_auth = get_auth;
|
|
11
|
-
}
|
|
12
|
-
async query(query) {
|
|
13
|
-
try {
|
|
14
|
-
let result = await ky.get(this.path.join('/'), {
|
|
15
|
-
headers: {
|
|
16
|
-
authorization: await this.get_auth()
|
|
17
|
-
},
|
|
18
|
-
searchParams: encode_search_params(query)
|
|
19
|
-
}).json();
|
|
20
|
-
return result.data;
|
|
21
|
-
}
|
|
22
|
-
catch (err) {
|
|
23
|
-
return Promise.reject(err);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
async post(document) {
|
|
27
|
-
try {
|
|
28
|
-
let result = await ky.post(this.path.join('/'), {
|
|
29
|
-
headers: {
|
|
30
|
-
authorization: await this.get_auth()
|
|
31
|
-
},
|
|
32
|
-
json: document
|
|
33
|
-
}).json();
|
|
34
|
-
return result.data;
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
return Promise.reject(err);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
document(document_id) {
|
|
41
|
-
let path = this.path;
|
|
42
|
-
let get_auth = this.get_auth;
|
|
43
|
-
return {
|
|
44
|
-
async get() {
|
|
45
|
-
try {
|
|
46
|
-
let result = await ky.get([...path, document_id].join('/'), {
|
|
47
|
-
headers: {
|
|
48
|
-
authorization: await get_auth()
|
|
49
|
-
},
|
|
50
|
-
}).json();
|
|
51
|
-
return result.data;
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
return Promise.reject(err);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
async put(update) {
|
|
58
|
-
try {
|
|
59
|
-
let result = await ky.put([...path, document_id].join('/'), {
|
|
60
|
-
headers: {
|
|
61
|
-
authorization: await get_auth()
|
|
62
|
-
},
|
|
63
|
-
json: update
|
|
64
|
-
}).json();
|
|
65
|
-
return result.data;
|
|
66
|
-
}
|
|
67
|
-
catch (err) {
|
|
68
|
-
return Promise.reject(err);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
async remove() {
|
|
72
|
-
try {
|
|
73
|
-
let result = await ky.delete([...path, document_id].join('/'), {
|
|
74
|
-
headers: {
|
|
75
|
-
authorization: await get_auth()
|
|
76
|
-
},
|
|
77
|
-
}).json();
|
|
78
|
-
return result.data;
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
return Promise.reject(err);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
collection(collection_id) {
|
|
85
|
-
switch (collection_id) {
|
|
86
|
-
case "project":
|
|
87
|
-
return new Collection_Project([...path, document_id, "project"], get_auth);
|
|
88
|
-
case "brief_news_category":
|
|
89
|
-
return new Collection_Brief_News_Category([...path, document_id, "brief_news_category"], get_auth);
|
|
90
|
-
default:
|
|
91
|
-
throw new Error(`Api does not have the collection ${collection_id}`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# 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,E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CAAC;oBAC9B,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,UAAU,CAAC,aAAgD;gBACvD,QAAO,aAAa,EAAE,CAAC;oBACnB,KAAK,SAAS;wBACV,OAAO,IAAI,kBAAkB,CAAC,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;oBAC/E,KAAK,qBAAqB;wBACtB,OAAO,IAAI,8BAA8B,CAAC,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,qBAAqB,CAAC,EAAE,QAAQ,CAAC,CAAC;oBACvG;wBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;gBAC5E,CAAC;YACL,CAAC;SACJ,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -1,18 +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
|
-
constructor(path: string[], get_auth: () => Promise<any>);
|
|
10
|
-
query(query: institution_query): Promise<institution[]>;
|
|
11
|
-
post(document: institution_post): Promise<institution>;
|
|
12
|
-
document(document_id: string): {
|
|
13
|
-
get(): Promise<institution>;
|
|
14
|
-
put(update: institution_put): Promise<institution>;
|
|
15
|
-
remove(): Promise<institution>;
|
|
16
|
-
collection(collection_id: "client"): Collection_Client;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
@@ -1,94 +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
|
-
constructor(path, get_auth) {
|
|
8
|
-
this.path = path;
|
|
9
|
-
this.get_auth = get_auth;
|
|
10
|
-
}
|
|
11
|
-
async query(query) {
|
|
12
|
-
try {
|
|
13
|
-
let result = await ky.get(this.path.join('/'), {
|
|
14
|
-
headers: {
|
|
15
|
-
authorization: await this.get_auth()
|
|
16
|
-
},
|
|
17
|
-
searchParams: encode_search_params(query)
|
|
18
|
-
}).json();
|
|
19
|
-
return result.data;
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
return Promise.reject(err);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async post(document) {
|
|
26
|
-
try {
|
|
27
|
-
let result = await ky.post(this.path.join('/'), {
|
|
28
|
-
headers: {
|
|
29
|
-
authorization: await this.get_auth()
|
|
30
|
-
},
|
|
31
|
-
json: document
|
|
32
|
-
}).json();
|
|
33
|
-
return result.data;
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
return Promise.reject(err);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
document(document_id) {
|
|
40
|
-
let path = this.path;
|
|
41
|
-
let get_auth = this.get_auth;
|
|
42
|
-
return {
|
|
43
|
-
async get() {
|
|
44
|
-
try {
|
|
45
|
-
let result = await ky.get([...path, document_id].join('/'), {
|
|
46
|
-
headers: {
|
|
47
|
-
authorization: await get_auth()
|
|
48
|
-
},
|
|
49
|
-
}).json();
|
|
50
|
-
return result.data;
|
|
51
|
-
}
|
|
52
|
-
catch (err) {
|
|
53
|
-
return Promise.reject(err);
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
async put(update) {
|
|
57
|
-
try {
|
|
58
|
-
let result = await ky.put([...path, document_id].join('/'), {
|
|
59
|
-
headers: {
|
|
60
|
-
authorization: await get_auth()
|
|
61
|
-
},
|
|
62
|
-
json: update
|
|
63
|
-
}).json();
|
|
64
|
-
return result.data;
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
return Promise.reject(err);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
async remove() {
|
|
71
|
-
try {
|
|
72
|
-
let result = await ky.delete([...path, document_id].join('/'), {
|
|
73
|
-
headers: {
|
|
74
|
-
authorization: await get_auth()
|
|
75
|
-
},
|
|
76
|
-
}).json();
|
|
77
|
-
return result.data;
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
return Promise.reject(err);
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
collection(collection_id) {
|
|
84
|
-
switch (collection_id) {
|
|
85
|
-
case "client":
|
|
86
|
-
return new Collection_Client([...path, document_id, "client"], get_auth);
|
|
87
|
-
default:
|
|
88
|
-
throw new Error(`Api does not have the collection ${collection_id}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
//# 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAO/C,MAAM,OAAO,sBAAsB;IAC/B,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,KAAwB;QAChC,IAAI,CAAC;YACD,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,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C,EAAE,QAAQ,CAAC,CAAC;oBAC7E;wBACI,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,EAAE,CAAC,CAAA;gBAC5E,CAAC;YACL,CAAC;SACJ,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -1,16 +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
|
-
constructor(path: string[], get_auth: () => Promise<any>);
|
|
9
|
-
query(query: project_query): Promise<project[]>;
|
|
10
|
-
post(document: project_post): Promise<project>;
|
|
11
|
-
document(document_id: string): {
|
|
12
|
-
get(): Promise<project>;
|
|
13
|
-
put(update: project_put): Promise<project>;
|
|
14
|
-
remove(): Promise<project>;
|
|
15
|
-
};
|
|
16
|
-
}
|
package/test/tmp/dist/Project.js
DELETED
|
@@ -1,85 +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
|
-
constructor(path, get_auth) {
|
|
7
|
-
this.path = path;
|
|
8
|
-
this.get_auth = get_auth;
|
|
9
|
-
}
|
|
10
|
-
async query(query) {
|
|
11
|
-
try {
|
|
12
|
-
let result = await ky.get(this.path.join('/'), {
|
|
13
|
-
headers: {
|
|
14
|
-
authorization: await this.get_auth()
|
|
15
|
-
},
|
|
16
|
-
searchParams: encode_search_params(query)
|
|
17
|
-
}).json();
|
|
18
|
-
return result.data;
|
|
19
|
-
}
|
|
20
|
-
catch (err) {
|
|
21
|
-
return Promise.reject(err);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async post(document) {
|
|
25
|
-
try {
|
|
26
|
-
let result = await ky.post(this.path.join('/'), {
|
|
27
|
-
headers: {
|
|
28
|
-
authorization: await this.get_auth()
|
|
29
|
-
},
|
|
30
|
-
json: document
|
|
31
|
-
}).json();
|
|
32
|
-
return result.data;
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
return Promise.reject(err);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
document(document_id) {
|
|
39
|
-
let path = this.path;
|
|
40
|
-
let get_auth = this.get_auth;
|
|
41
|
-
return {
|
|
42
|
-
async get() {
|
|
43
|
-
try {
|
|
44
|
-
let result = await ky.get([...path, document_id].join('/'), {
|
|
45
|
-
headers: {
|
|
46
|
-
authorization: await get_auth()
|
|
47
|
-
},
|
|
48
|
-
}).json();
|
|
49
|
-
return result.data;
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
return Promise.reject(err);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async put(update) {
|
|
56
|
-
try {
|
|
57
|
-
let result = await ky.put([...path, document_id].join('/'), {
|
|
58
|
-
headers: {
|
|
59
|
-
authorization: await get_auth()
|
|
60
|
-
},
|
|
61
|
-
json: update
|
|
62
|
-
}).json();
|
|
63
|
-
return result.data;
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
return Promise.reject(err);
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
async remove() {
|
|
70
|
-
try {
|
|
71
|
-
let result = await ky.delete([...path, document_id].join('/'), {
|
|
72
|
-
headers: {
|
|
73
|
-
authorization: await get_auth()
|
|
74
|
-
},
|
|
75
|
-
}).json();
|
|
76
|
-
return result.data;
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
return Promise.reject(err);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=Project.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Project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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":""}
|