@wxn0brp/vql 0.7.0 → 0.8.2
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/README.md +14 -5
- package/dist/cpu/utils.d.ts +1 -1
- package/dist/{falconFrame.d.ts → helpers/falconFrame.d.ts} +1 -1
- package/dist/{falconFrame.js → helpers/falconFrame.js} +1 -1
- package/dist/{gw.d.ts → helpers/gw.d.ts} +1 -1
- package/dist/{merge.js → helpers/merge.js} +2 -2
- package/dist/{sheet.d.ts → helpers/sheet.d.ts} +1 -1
- package/dist/{valid.d.ts → helpers/valid.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/permissions/relation.d.ts +1 -1
- package/dist/permissions/request.d.ts +1 -1
- package/dist/permissions/utils.d.ts +1 -1
- package/dist/processor.d.ts +1 -1
- package/dist/processor.js +3 -3
- package/dist/vql.d.ts +1 -1
- package/package.json +22 -9
- /package/dist/{apiAbstract.d.ts → helpers/apiAbstract.d.ts} +0 -0
- /package/dist/{apiAbstract.js → helpers/apiAbstract.js} +0 -0
- /package/dist/{config.d.ts → helpers/config.d.ts} +0 -0
- /package/dist/{config.js → helpers/config.js} +0 -0
- /package/dist/{gw.js → helpers/gw.js} +0 -0
- /package/dist/{merge.d.ts → helpers/merge.d.ts} +0 -0
- /package/dist/{sheet.js → helpers/sheet.js} +0 -0
- /package/dist/{valid.js → helpers/valid.js} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# VQL (Valthera Query Language)
|
|
2
2
|
|
|
3
|
-
VQL
|
|
3
|
+
VQL (Valthera Query Language) is a comprehensive framework for interacting with ValtheraDB. It combines a flexible query language, a powerful permission management system, and a suite of tools to build secure and efficient data-driven applications.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@wxn0brp/vql)
|
|
6
6
|
[](./LICENSE)
|
|
@@ -8,11 +8,16 @@ VQL is a query language and processing framework designed for managing and inter
|
|
|
8
8
|

|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
## Features
|
|
11
|
+
## Key Features
|
|
12
12
|
|
|
13
|
-
- **Query
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
13
|
+
- **Dual Query Syntax**: Choose between VQLR (a JSON-based object query language for programmatic use) and VQLS (a human-readable string-based language for simpler queries and scripts).
|
|
14
|
+
- **Multi-Database Support**: Process queries across multiple ValtheraDB instances seamlessly.
|
|
15
|
+
- **Cross-Platform**: Run VQL in both Node.js and modern web browsers.
|
|
16
|
+
- **Extensible by Design**: Customize and extend functionality with sheets and custom configurations.
|
|
17
|
+
- **Advanced Relation Queries**: Natively handle complex relationships not just between collections, but also across entire databases.
|
|
18
|
+
- **Permission System**: Built-in, granular access control powered by Gate Warden. It's disabled by default and can be enabled when needed to enforce complex security rules.
|
|
19
|
+
- **Falcon Frame Integration**: Integrates with Falcon Frame for extended capabilities.
|
|
20
|
+
- **Variable Support**: Use predefined or custom variables in your queries, allowing for more dynamic and reusable logic.
|
|
16
21
|
|
|
17
22
|
## Example Usage
|
|
18
23
|
|
|
@@ -62,6 +67,10 @@ f.age = 1
|
|
|
62
67
|
})();
|
|
63
68
|
```
|
|
64
69
|
|
|
70
|
+
## Development Tools
|
|
71
|
+
|
|
72
|
+
For an enhanced development and debugging experience, you can use [VQL-dev](https://github.com/wxn0brP/VQL-dev), a dedicated tool for debugging VQL queries.
|
|
73
|
+
|
|
65
74
|
## Documentation
|
|
66
75
|
|
|
67
76
|
- [Base/Map](./docs/lang/base.md)
|
package/dist/cpu/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VQLConfig } from "../config.js";
|
|
1
|
+
import { VQLConfig } from "../helpers/config.js";
|
|
2
2
|
export declare function parseSelect(config: VQLConfig, select: object | object[]): any[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export function deepMerge(target, source) {
|
|
2
|
-
if (typeof target !==
|
|
2
|
+
if (typeof target !== "object" || target === null) {
|
|
3
3
|
target = {};
|
|
4
4
|
}
|
|
5
5
|
for (const key in source) {
|
|
6
6
|
if (source.hasOwnProperty(key)) {
|
|
7
|
-
if (typeof source[key] ===
|
|
7
|
+
if (typeof source[key] === "object" && source[key] !== null && !Array.isArray(source[key])) {
|
|
8
8
|
if (!target[key]) {
|
|
9
9
|
target[key] = {};
|
|
10
10
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { VQL_Query } from "
|
|
1
|
+
import { VQL_Query } from "../types/vql.js";
|
|
2
2
|
export declare function replaceVars(query: VQL_Query, user: any): VQL_Query;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VQLProcessor } from "./processor.js";
|
|
2
|
-
import { VQLConfig } from "./config.js";
|
|
3
|
-
import { createValtheraAdapter } from "./apiAbstract.js";
|
|
2
|
+
import { VQLConfig } from "./helpers/config.js";
|
|
3
|
+
import { createValtheraAdapter } from "./helpers/apiAbstract.js";
|
|
4
4
|
import logger from "./logger.js";
|
|
5
5
|
import { LogLevel } from "@wxn0brp/lucerna-log";
|
|
6
|
-
import { FF_VQL } from "./falconFrame.js";
|
|
7
|
-
import { createGwValidFn } from "./gw.js";
|
|
6
|
+
import { FF_VQL } from "./helpers/falconFrame.js";
|
|
7
|
+
import { createGwValidFn } from "./helpers/gw.js";
|
|
8
8
|
export default VQLProcessor;
|
|
9
9
|
export { VQLProcessor, createValtheraAdapter, VQLConfig, logger as VQLLogger, LogLevel as VQLLogLevel, FF_VQL, createGwValidFn };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VQLProcessor } from "./processor.js";
|
|
2
|
-
import { VQLConfig } from "./config.js";
|
|
3
|
-
import { createValtheraAdapter } from "./apiAbstract.js";
|
|
2
|
+
import { VQLConfig } from "./helpers/config.js";
|
|
3
|
+
import { createValtheraAdapter } from "./helpers/apiAbstract.js";
|
|
4
4
|
import logger from "./logger.js";
|
|
5
5
|
import { LogLevel } from "@wxn0brp/lucerna-log";
|
|
6
|
-
import { FF_VQL } from "./falconFrame.js";
|
|
7
|
-
import { createGwValidFn } from "./gw.js";
|
|
6
|
+
import { FF_VQL } from "./helpers/falconFrame.js";
|
|
7
|
+
import { createGwValidFn } from "./helpers/gw.js";
|
|
8
8
|
export default VQLProcessor;
|
|
9
9
|
export { VQLProcessor, createValtheraAdapter, VQLConfig, logger as VQLLogger, LogLevel as VQLLogLevel, FF_VQL, createGwValidFn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PermValidFn } from "../types/perm.js";
|
|
2
2
|
import { VQL_Query_Relation } from "../types/vql.js";
|
|
3
|
-
import { VQLConfig } from "../config.js";
|
|
3
|
+
import { VQLConfig } from "../helpers/config.js";
|
|
4
4
|
export declare function checkRelationPermission(config: VQLConfig, permValidFn: PermValidFn, user: any, query: VQL_Query_Relation): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VQLConfig } from "../config.js";
|
|
1
|
+
import { VQLConfig } from "../helpers/config.js";
|
|
2
2
|
import { PermCRUD, PermValidFn } from "../types/perm.js";
|
|
3
3
|
import { VQL_Query_CRUD } from "../types/vql.js";
|
|
4
4
|
export declare function extractPaths(config: VQLConfig, query: VQL_Query_CRUD): Promise<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VQLConfig } from "../config.js";
|
|
1
|
+
import { VQLConfig } from "../helpers/config.js";
|
|
2
2
|
export declare function getHash(json: string): Promise<string>;
|
|
3
3
|
export declare function hashKey(config: VQLConfig, path: any): Promise<string>;
|
|
4
4
|
export declare function extractPathsFromData(data: any, stack?: string[]): {
|
package/dist/processor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Relation, ValtheraCompatible } from "@wxn0brp/db-core";
|
|
2
|
-
import { VQLConfig, VQLConfigInterface } from "./config.js";
|
|
2
|
+
import { VQLConfig, VQLConfigInterface } from "./helpers/config.js";
|
|
3
3
|
import { VQL_Query, VQLError, VQLUQ } from "./types/vql.js";
|
|
4
4
|
import { PermValidFn } from "./types/perm.js";
|
|
5
5
|
export declare class VQLProcessor {
|
package/dist/processor.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Relation } from "@wxn0brp/db-core";
|
|
2
|
-
import { VQLConfig } from "./config.js";
|
|
2
|
+
import { VQLConfig } from "./helpers/config.js";
|
|
3
3
|
import { executeRelation } from "./cpu/relation.js";
|
|
4
4
|
import { executeQuery } from "./cpu/request.js";
|
|
5
5
|
import logger from "./logger.js";
|
|
6
|
-
import { replaceVars } from "./sheet.js";
|
|
7
|
-
import { validateRaw, validateVql } from "./valid.js";
|
|
6
|
+
import { replaceVars } from "./helpers/sheet.js";
|
|
7
|
+
import { validateRaw, validateVql } from "./helpers/valid.js";
|
|
8
8
|
import { parseVQLS } from "./cpu/string/index.js";
|
|
9
9
|
export class VQLProcessor {
|
|
10
10
|
dbInstances;
|
package/dist/vql.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export type ArrayOperators<T = any> = {
|
|
|
55
55
|
};
|
|
56
56
|
/** String Operators */
|
|
57
57
|
export type StringOperators<T = any> = {
|
|
58
|
-
$regex?: PartialOfType<T, RegExp, string>;
|
|
58
|
+
$regex?: PartialOfType<T, RegExp | string, string>;
|
|
59
59
|
$startsWith?: PartialOfType<T, string>;
|
|
60
60
|
$endsWith?: PartialOfType<T, string>;
|
|
61
61
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxn0brp/vql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"author": "wxn0brP",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,10 +14,22 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"vql",
|
|
19
|
+
"valthera",
|
|
20
|
+
"database",
|
|
21
|
+
"orm",
|
|
22
|
+
"api",
|
|
23
|
+
"crud",
|
|
24
|
+
"nosql",
|
|
25
|
+
"query",
|
|
26
|
+
"db",
|
|
27
|
+
"query-language"
|
|
28
|
+
],
|
|
17
29
|
"peerDependencies": {
|
|
18
|
-
"@wxn0brp/db-core": ">=0.2.
|
|
19
|
-
"@wxn0brp/falcon-frame": ">=0.
|
|
20
|
-
"@wxn0brp/gate-warden": ">=0.4.
|
|
30
|
+
"@wxn0brp/db-core": ">=0.2.3",
|
|
31
|
+
"@wxn0brp/falcon-frame": ">=0.4.0",
|
|
32
|
+
"@wxn0brp/gate-warden": ">=0.4.1"
|
|
21
33
|
},
|
|
22
34
|
"peerDependenciesMeta": {
|
|
23
35
|
"@wxn0brp/falcon-frame": {
|
|
@@ -32,15 +44,16 @@
|
|
|
32
44
|
},
|
|
33
45
|
"devDependencies": {
|
|
34
46
|
"@types/node": "*",
|
|
35
|
-
"@wxn0brp/db": "^0.40.
|
|
36
|
-
"@wxn0brp/
|
|
37
|
-
"@wxn0brp/
|
|
47
|
+
"@wxn0brp/db": "^0.40.1",
|
|
48
|
+
"@wxn0brp/db-core": "^0.2.3",
|
|
49
|
+
"@wxn0brp/falcon-frame": "0.4.0",
|
|
50
|
+
"@wxn0brp/gate-warden": "^0.4.1",
|
|
38
51
|
"esbuild": "^0.25.10",
|
|
39
52
|
"tsc-alias": "*",
|
|
40
53
|
"typescript": "*"
|
|
41
54
|
},
|
|
42
55
|
"dependencies": {
|
|
43
|
-
"@wxn0brp/lucerna-log": "^0.2.
|
|
56
|
+
"@wxn0brp/lucerna-log": "^0.2.1"
|
|
44
57
|
},
|
|
45
58
|
"exports": {
|
|
46
59
|
".": {
|
|
@@ -54,4 +67,4 @@
|
|
|
54
67
|
"default": "./dist/*.js"
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
|
-
}
|
|
70
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|