@wxn0brp/vql 0.3.3 → 0.3.5
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/processor.d.ts +3 -3
- package/dist/processor.js.map +1 -1
- package/dist/types/vql.d.ts +6 -0
- package/dist/valid.d.ts +3 -13
- package/dist/vql.d.ts +9 -3
- package/package.json +6 -6
package/dist/processor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Relation, ValtheraCompatible } from "@wxn0brp/db";
|
|
2
2
|
import { GateWarden } from "@wxn0brp/gate-warden";
|
|
3
|
-
import { VQL, VQLR, VQLRef } from "./types/vql.js";
|
|
3
|
+
import { VQL, VQLError, VQLR, VQLRef } from "./types/vql.js";
|
|
4
4
|
import { VQLConfig } from "./config.js";
|
|
5
5
|
export declare class VQLProcessor<GW = any> {
|
|
6
6
|
dbInstances: Record<string, ValtheraCompatible>;
|
|
@@ -9,7 +9,7 @@ export declare class VQLProcessor<GW = any> {
|
|
|
9
9
|
relation: Relation;
|
|
10
10
|
preDefinedSheets: Map<string, VQL>;
|
|
11
11
|
constructor(dbInstances: Record<string, ValtheraCompatible>, gw?: GateWarden<GW>, config?: VQLConfig);
|
|
12
|
-
execute(queryRaw: VQLR | string | {
|
|
12
|
+
execute<T = any>(queryRaw: VQLR | string | {
|
|
13
13
|
query: string;
|
|
14
|
-
} & VQLRef, user: any): Promise<
|
|
14
|
+
} & VQLRef, user: any): Promise<T | VQLError>;
|
|
15
15
|
}
|
package/dist/processor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.js","sourceRoot":"","sources":["../src/processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,E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CAAC;QACjD,CAAC;aAAM,CAAC;YACJ,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;QACvD,CAAC;IACL,CAAC;CACJ"}
|
package/dist/types/vql.d.ts
CHANGED
|
@@ -123,4 +123,10 @@ type DeepPartial<T> = {
|
|
|
123
123
|
};
|
|
124
124
|
export type VQL = (VQLRequest | RelationQuery) & VQLRef;
|
|
125
125
|
export type VQLR = VQL | (DeepPartial<VQL> & VQLRefRequired) | VQLRefRequired;
|
|
126
|
+
export interface VQLError {
|
|
127
|
+
err: true;
|
|
128
|
+
msg: string;
|
|
129
|
+
c: number;
|
|
130
|
+
why?: string;
|
|
131
|
+
}
|
|
126
132
|
export {};
|
package/dist/valid.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import Ajv from "ajv";
|
|
2
2
|
import { VQLConfig } from "./config.js";
|
|
3
|
-
import { VQL, VQLR } from "./types/vql.js";
|
|
3
|
+
import { VQL, VQLError, VQLR } from "./types/vql.js";
|
|
4
4
|
export declare const ajv: Ajv;
|
|
5
|
-
export declare function validateRaw(config: VQLConfig, query: VQLR): true |
|
|
6
|
-
|
|
7
|
-
msg: string;
|
|
8
|
-
c: number;
|
|
9
|
-
why: any;
|
|
10
|
-
};
|
|
11
|
-
export declare function validateVql(config: VQLConfig, query: VQL): true | {
|
|
12
|
-
err: boolean;
|
|
13
|
-
msg: string;
|
|
14
|
-
c: number;
|
|
15
|
-
why: any;
|
|
16
|
-
};
|
|
5
|
+
export declare function validateRaw(config: VQLConfig, query: VQLR): true | VQLError;
|
|
6
|
+
export declare function validateVql(config: VQLConfig, query: VQL): true | VQLError;
|
package/dist/vql.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
export interface Data {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
3
6
|
export interface Context {
|
|
4
7
|
[key: string]: any;
|
|
5
8
|
}
|
|
@@ -96,9 +99,6 @@ export type SearchFunc<T = any> = (data: T, context: Context) => boolean;
|
|
|
96
99
|
export type UpdaterFunc<T = any> = (data: T, context: Context) => boolean;
|
|
97
100
|
export type Search<T = any> = SearchOptions | SearchFunc<T>;
|
|
98
101
|
export type Updater<T = any> = UpdaterArg | UpdaterArg[] | UpdaterFunc<T>;
|
|
99
|
-
export interface Data {
|
|
100
|
-
[key: string]: any;
|
|
101
|
-
}
|
|
102
102
|
export interface DbFindOpts {
|
|
103
103
|
reverse?: boolean;
|
|
104
104
|
max?: number;
|
|
@@ -324,5 +324,11 @@ export type DeepPartial<T> = {
|
|
|
324
324
|
};
|
|
325
325
|
export type VQL = (VQLRequest | RelationQuery) & VQLRef;
|
|
326
326
|
export type VQLR = VQL | (DeepPartial<VQL> & VQLRefRequired) | VQLRefRequired;
|
|
327
|
+
export interface VQLError {
|
|
328
|
+
err: true;
|
|
329
|
+
msg: string;
|
|
330
|
+
c: number;
|
|
331
|
+
why?: string;
|
|
332
|
+
}
|
|
327
333
|
|
|
328
334
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxn0brp/vql",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"author": "wxn0brP",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@wxn0brp/
|
|
19
|
-
"@wxn0brp/
|
|
18
|
+
"@wxn0brp/db": ">=0.8.1",
|
|
19
|
+
"@wxn0brp/falcon-frame": ">=0.0.6"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"@wxn0brp/falcon-frame": {
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@wxn0brp/falcon-frame": "
|
|
30
|
+
"@types/node": "^22.15.30",
|
|
31
|
+
"@wxn0brp/db": "^0.8.1",
|
|
32
|
+
"@wxn0brp/falcon-frame": "0.0.6",
|
|
33
33
|
"dotenv": "^16.5.0",
|
|
34
34
|
"source-map-support": "^0.5.21",
|
|
35
35
|
"tsc-alias": "^1.8.10",
|