@wxn0brp/vql 0.1.12 → 0.1.13
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/falconFrame.d.ts +9 -0
- package/dist/falconFrame.js +18 -0
- package/dist/falconFrame.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +1 -1
- package/package.json +11 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VQLProcessor } from "./processor.js";
|
|
2
|
+
import type { FalconFrame, FFRequest } from "@wxn0brp/falcon-frame";
|
|
3
|
+
type ContextFn = (req: FFRequest) => Promise<any> | any;
|
|
4
|
+
interface FF_VQL_Options {
|
|
5
|
+
path?: string;
|
|
6
|
+
getUser?: ContextFn;
|
|
7
|
+
}
|
|
8
|
+
export declare function FF_VQL(app: FalconFrame, processor: VQLProcessor, options?: FF_VQL_Options): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function FF_VQL(app, processor, options = {}) {
|
|
2
|
+
const path = options.path || "/VQL";
|
|
3
|
+
const getContext = options.getUser || (() => ({}));
|
|
4
|
+
app.post(path, async (req, res) => {
|
|
5
|
+
try {
|
|
6
|
+
const ctx = await getContext(req);
|
|
7
|
+
const result = await processor.execute(req.body.query, ctx);
|
|
8
|
+
if (result && result.err)
|
|
9
|
+
return result;
|
|
10
|
+
return { err: false, result };
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
res.status(500);
|
|
14
|
+
return { err: true, msg: e.message };
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=falconFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"falconFrame.js","sourceRoot":"","sources":["../src/falconFrame.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,MAAM,CAAC,GAAgB,EAAE,SAAuB,EAAE,UAA0B,EAAE;IAC1F,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC;IACpC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnD,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;QAC9B,IAAI,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;YAClC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC5D,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG;gBAAE,OAAO,MAAM,CAAC;YACxC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAChB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QACzC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { VQLProcessor } from "./processor.js";
|
|
|
2
2
|
import { VQLConfig } from "./config.js";
|
|
3
3
|
import { createValtheraAdapter } from "./apiAbstract.js";
|
|
4
4
|
import logger from "./logger.js";
|
|
5
|
-
import { LogLevel } from "@wxn0brp/
|
|
5
|
+
import { LogLevel } from "@wxn0brp/lucerna-log";
|
|
6
6
|
export default VQLProcessor;
|
|
7
7
|
export { createValtheraAdapter, VQLConfig, logger as VQLLogger, LogLevel as VQLLogLevel };
|
|
8
8
|
export * as VQLSheet from "./sheet/load.js";
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { VQLProcessor } from "./processor.js";
|
|
|
2
2
|
import { VQLConfig } from "./config.js";
|
|
3
3
|
import { createValtheraAdapter } from "./apiAbstract.js";
|
|
4
4
|
import logger from "./logger.js";
|
|
5
|
-
import { LogLevel } from "@wxn0brp/
|
|
5
|
+
import { LogLevel } from "@wxn0brp/lucerna-log";
|
|
6
6
|
export default VQLProcessor;
|
|
7
7
|
export { createValtheraAdapter, VQLConfig, logger as VQLLogger, LogLevel as VQLLogLevel };
|
|
8
8
|
export * as VQLSheet from "./sheet/load.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,eAAe,YAAY,CAAC;AAC5B,OAAO,EACH,qBAAqB,EACrB,SAAS,EACT,MAAM,IAAI,SAAS,EACnB,QAAQ,IAAI,WAAW,EAC1B,CAAA;AACD,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC"}
|
package/dist/logger.d.ts
CHANGED
package/dist/logger.js
CHANGED
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC;IACtB,UAAU,EAAE,KAAK;CACpB,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxn0brp/vql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"author": "wxn0brP",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,8 +14,17 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@wxn0brp/falcon-frame": ">=0.0.1"
|
|
19
|
+
},
|
|
20
|
+
"peerDependenciesMeta": {
|
|
21
|
+
"@wxn0brp/falcon-frame": {
|
|
22
|
+
"optional": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
17
25
|
"devDependencies": {
|
|
18
26
|
"@types/node": "^22.15.17",
|
|
27
|
+
"@wxn0brp/falcon-frame": ">=0.0.1",
|
|
19
28
|
"dotenv": "^16.5.0",
|
|
20
29
|
"source-map-support": "^0.5.21",
|
|
21
30
|
"tsc-alias": "^1.8.10",
|
|
@@ -25,8 +34,8 @@
|
|
|
25
34
|
"dependencies": {
|
|
26
35
|
"@wxn0brp/db": "^0.7.5",
|
|
27
36
|
"@wxn0brp/gate-warden": "^0.1.0",
|
|
37
|
+
"@wxn0brp/lucerna-log": "^0.1.1",
|
|
28
38
|
"@wxn0brp/wts-deep-merge": "github:wxn0brp/ts-shared#dist-deep-merge",
|
|
29
|
-
"@wxn0brp/wts-logger": "github:wxn0brp/ts-shared#dist-logger",
|
|
30
39
|
"ajv": "^8.17.1",
|
|
31
40
|
"ajv-formats": "^3.0.1",
|
|
32
41
|
"js-yaml": "^4.1.0",
|