codehooks-js 1.1.11 → 1.2.0

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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ *
3
+ * @param {object} app - Codehooks app ( npm package codehooks-js)
4
+ * @param {object} schema - Yup schema object
5
+ * @param {object} options - Options
6
+ * @returns {EventHooks} Hooks for REST operations
7
+ */
8
+ export default function crudlify(app: object, schema?: object, options?: object): EventHooks;
9
+ import { EventHooks } from "./lib/eventhooks.mjs";
10
+ export function setDatastore(ds: any): void;
11
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../crudlify/index.mjs"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,sCALW,MAAM,WACN,MAAM,YACN,MAAM,GACJ,UAAU,CA0EtB;2BAhG0B,sBAAsB;AAoGjD,4CAEC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Middleware to add function hooks pre/post CRUD database operations
3
+ */
4
+ export class EventHooks {
5
+ listeners: {};
6
+ /**
7
+ * Before hook
8
+ * @param {*} coll
9
+ * @param {*} verb
10
+ * @param {*} data
11
+ */
12
+ fireBefore(coll: any, verb: any, data: any): Promise<void>;
13
+ /**
14
+ * After hook
15
+ * @param {*} coll
16
+ * @param {*} verb
17
+ * @param {*} data
18
+ */
19
+ fireAfter(coll: any, verb: any, data: any): Promise<void>;
20
+ /**
21
+ * Codehook called before data is updated in database
22
+ * @param {*} coll
23
+ * @param {*} func
24
+ * @returns
25
+ */
26
+ beforePUT(coll: any, func: any): this;
27
+ /**
28
+ * Codehook called before data is inserted into database
29
+ * @param {*} coll
30
+ * @param {*} func
31
+ * @returns
32
+ */
33
+ beforePOST(coll: any, func: any): this;
34
+ /**
35
+ *
36
+ * @param {*} coll
37
+ * @param {*} func
38
+ * @returns
39
+ */
40
+ afterPOST(coll: any, func: any): this;
41
+ /**
42
+ *
43
+ * @param {*} coll
44
+ * @param {*} func
45
+ * @returns
46
+ */
47
+ beforePATCH(coll: any, func: any): this;
48
+ /**
49
+ *
50
+ * @param {*} coll
51
+ * @param {*} func
52
+ * @returns
53
+ */
54
+ beforeDELETE(coll: any, func: any): this;
55
+ }
56
+ //# sourceMappingURL=eventhooks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventhooks.d.mts","sourceRoot":"","sources":["../../../crudlify/lib/eventhooks.mjs"],"names":[],"mappings":"AACA;;GAEG;AACH;IAEQ,cAAmB;IAGvB;;;;;OAKG;IACH,2DAOC;IAED;;;;;OAKG;IACH,0DAQC;IACD;;;;;OAKG;IACH,sCAIC;IAED;;;;;OAKG;IACH,uCAIC;IACD;;;;;OAKG;IACH,sCAIC;IAED;;;;;OAKG;IACH,wCAIC;IACD;;;;;OAKG;IACH,yCAIC;CACJ"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Convert request query to mongoDB query by query-to-mongo lib
3
+ * @param {*} query
4
+ * @param {*} headers
5
+ * @returns Object
6
+ */
7
+ export function getMongoQuery(query: any, headers: any): {
8
+ filter: any;
9
+ hints: any;
10
+ aggregate: any;
11
+ limit: any;
12
+ offset: any;
13
+ fields: any;
14
+ };
15
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../crudlify/lib/query/q2m/index.mjs"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH;;;;;;;EAsCC"}
@@ -0,0 +1,11 @@
1
+ export default function _default(query: any, options: any): {
2
+ criteria: {};
3
+ options: {
4
+ fields: {} | {};
5
+ sort: {};
6
+ skip: number;
7
+ limit: any;
8
+ };
9
+ links: (url: any, totalCount: any) => {};
10
+ };
11
+ //# sourceMappingURL=q2m.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"q2m.d.mts","sourceRoot":"","sources":["../../../../../crudlify/lib/query/q2m/q2m.mjs"],"names":[],"mappings":"AA+MA;;;;;;;;;EAyDC"}
@@ -0,0 +1,4 @@
1
+ export function validate(schema: any, document: any, options: any): Promise<any>;
2
+ export function cast(schema: any, document: any): any;
3
+ export function prepare(schemas: any, options: any): any;
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../crudlify/lib/schema/json-schema/index.mjs"],"names":[],"mappings":"AAUO,iFAWN;AAUM,sDAGN;AAEM,yDAIN"}
@@ -0,0 +1,4 @@
1
+ export function validate(schema: any, document: any): any;
2
+ export function cast(schema: any, document: any): any;
3
+ export function prepare(schemas: any): any;
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../crudlify/lib/schema/yup/index.mjs"],"names":[],"mappings":"AAQO,0DAIN;AAEM,sDAGN;AAEM,2CAGN"}
@@ -0,0 +1,4 @@
1
+ export function validate(schema: any, document: any): Promise<any>;
2
+ export function cast(schema: any, document: any): any;
3
+ export function prepare(schemas: any): any;
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../../crudlify/lib/schema/zod/index.mjs"],"names":[],"mappings":"AAQO,mEASN;AAEM,sDAGN;AAEM,2CAGN"}