@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # VQL (Valthera Query Language)
2
2
 
3
- VQL is a query language and processing framework designed for managing and interacting with databases using ValtheraDB. It provides a robust permission system, query execution, and a GUI for managing ACL rules and database structures.
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
  [![npm version](https://img.shields.io/npm/v/@wxn0brp/vql)](https://www.npmjs.com/package/@wxn0brp/vql)
6
6
  [![License](https://img.shields.io/npm/l/@wxn0brp/vql)](./LICENSE)
@@ -8,11 +8,16 @@ VQL is a query language and processing framework designed for managing and inter
8
8
  ![CI](https://img.shields.io/github/actions/workflow/status/wxn0brP/VQL/build.yml?branch=master)
9
9
  ![bundle size](https://img.shields.io/bundlephobia/minzip/@wxn0brp/vql)
10
10
 
11
- ## Features
11
+ ## Key Features
12
12
 
13
- - **Query Execution**: Supports CRUD operations and advanced query capabilities.
14
- - **Permission Management**: Fine-grained access control using Gate Warden.
15
- - **Extensibility**: Easily extendable with pre-defined sheets and custom configurations.
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)
@@ -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,4 +1,4 @@
1
- import { type VQLProcessor } from "./processor.js";
1
+ import { type VQLProcessor } from "../processor.js";
2
2
  import type { FalconFrame, FFRequest } from "@wxn0brp/falcon-frame";
3
3
  type ContextFn = (req: FFRequest) => Promise<any> | any;
4
4
  interface FF_VQL_Options {
@@ -1,4 +1,4 @@
1
- import { parseVQLS } from "./cpu/string/index.js";
1
+ import { parseVQLS } from "../cpu/string/index.js";
2
2
  export function FF_VQL(app, processor, options = {}) {
3
3
  const path = options.path || "/VQL";
4
4
  const getContext = options.getUser || (() => ({}));
@@ -1,3 +1,3 @@
1
1
  import { GateWarden } from "@wxn0brp/gate-warden";
2
- import { PermValidFn } from "./types/perm.js";
2
+ import { PermValidFn } from "../types/perm.js";
3
3
  export declare function createGwValidFn(gw: GateWarden): PermValidFn;
@@ -1,10 +1,10 @@
1
1
  export function deepMerge(target, source) {
2
- if (typeof target !== 'object' || target === null) {
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] === 'object' && source[key] !== null && !Array.isArray(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 "./types/vql.js";
1
+ import { VQL_Query } from "../types/vql.js";
2
2
  export declare function replaceVars(query: VQL_Query, user: any): VQL_Query;
@@ -1,3 +1,3 @@
1
- import { VQL_Query, VQLError } from "./types/vql.js";
1
+ import { VQL_Query, VQLError } from "../types/vql.js";
2
2
  export declare function validateRaw(query: VQL_Query): true | VQLError;
3
3
  export declare function validateVql(query: VQL_Query): true | VQLError;
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[]): {
@@ -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.7.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.2",
19
- "@wxn0brp/falcon-frame": ">=0.1.0",
20
- "@wxn0brp/gate-warden": ">=0.4.0"
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.0",
36
- "@wxn0brp/falcon-frame": "0.1.0",
37
- "@wxn0brp/gate-warden": "^0.4.0",
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.0"
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