codehooks-js 1.3.6 → 1.3.8
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/package.json +2 -4
- package/types/aggregation/index.d.mts +38 -1
- package/types/crudlify/index.d.mts +9 -5
- package/types/crudlify/lib/eventhooks.d.mts +1 -0
- package/types/crudlify/lib/query/q2m/index.d.mts +7 -0
- package/types/crudlify/lib/query/q2m/q2m.d.mts +1 -0
- package/types/crudlify/lib/schema/json-schema/index.d.mts +1 -0
- package/types/crudlify/lib/schema/yup/index.d.mts +2 -1
- package/types/crudlify/lib/schema/zod/index.d.mts +1 -0
- package/types/index.d.ts +1254 -126
- package/types/webserver.d.mts +2 -1
- package/types/workflow/engine.d.mts +5 -40
- package/types/workflow/index.d.mts +1 -5
- package/workflow/engine.mjs +100 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codehooks-js",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Codehooks.io official library - provides express.JS like syntax",
|
|
6
6
|
"main": "index.js",
|
|
@@ -22,9 +22,7 @@
|
|
|
22
22
|
"tsconfig.json"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"test": "echo \"Warning: no tests specified\""
|
|
26
|
-
"build": "tsc",
|
|
27
|
-
"prepublishOnly": "npm run build"
|
|
25
|
+
"test": "echo \"Warning: no tests specified\""
|
|
28
26
|
},
|
|
29
27
|
"author": "Codehooks",
|
|
30
28
|
"license": "ISC",
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { httpResponse } from '..';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {DataStream} readable - JSON stream
|
|
6
|
+
* @param {Object} spec - JSON aggregation spec
|
|
7
|
+
* @returns {Promise} with aggregation result
|
|
8
|
+
* @example
|
|
9
|
+
* Spec JSON example:
|
|
10
|
+
* {
|
|
11
|
+
* "$max": {$field: "open", $label: "Open"},
|
|
12
|
+
"$group": {
|
|
13
|
+
"$field": "Ticker",
|
|
14
|
+
$label: "Symbol",
|
|
15
|
+
"$max": "high",
|
|
16
|
+
"$min": {$field: "close", $label: "Low"}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
*/
|
|
20
|
+
export function agg(readable: DataStream, spec: any): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* Persistent NoSql and Kev-Value datastore
|
|
23
|
+
*/
|
|
24
|
+
export type DataStream = {
|
|
25
|
+
/**
|
|
26
|
+
* - Emits data, stream.on('data', (data) => //console.debug(data))
|
|
27
|
+
*/
|
|
28
|
+
on: (arg0: string, arg1: (arg0: any) => any) => void;
|
|
29
|
+
/**
|
|
30
|
+
* - Pipe datastream to JSON output
|
|
31
|
+
*/
|
|
32
|
+
json: (response: httpResponse) => void;
|
|
33
|
+
/**
|
|
34
|
+
* - Return an array of objects
|
|
35
|
+
*/
|
|
36
|
+
toArray: () => Promise<object[]>;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
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 {Promise} EventHooks for REST operations
|
|
7
|
+
*/
|
|
8
|
+
export default function crudlify(app: object, schema?: object, options?: object): Promise<EventHooks>;
|
|
6
9
|
import { EventHooks } from "./lib/eventhooks.mjs";
|
|
7
10
|
export function setDatastore(ds: any): void;
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert request query to mongoDB query by query-to-mongo lib
|
|
3
|
+
* @param {*} query
|
|
4
|
+
* @param {*} headers
|
|
5
|
+
* @returns Object
|
|
6
|
+
*/
|
|
1
7
|
export function getMongoQuery(query: any, headers: any): {
|
|
2
8
|
filter: any;
|
|
3
9
|
hints: any;
|
|
@@ -6,3 +12,4 @@ export function getMongoQuery(query: any, headers: any): {
|
|
|
6
12
|
offset: any;
|
|
7
13
|
fields: any;
|
|
8
14
|
};
|
|
15
|
+
//# sourceMappingURL=index.d.mts.map
|