@wxn0brp/vql 0.10.1 → 0.10.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 wxn0brP
3
+ Copyright (c) 2026 wxn0brP
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- import CollectionManager from "@wxn0brp/db-core/helpers/CollectionManager";
1
+ import { CollectionManager } from "@wxn0brp/db-core/helpers/collectionManager";
2
2
  import updateFindObject from "@wxn0brp/db-core/utils/updateFindObject";
3
3
  const list = [
4
4
  "ensureCollection", "issetCollection", "getCollections", "removeCollection",
package/dist/vql.d.ts CHANGED
@@ -17,6 +17,7 @@ export type NestedValue<T, V, C = V> = {
17
17
  export type DeepPartial<T> = {
18
18
  [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
19
19
  };
20
+ export type JSPrimitiveType = "string" | "number" | "boolean" | "bigint" | "symbol" | "undefined" | "function" | "object";
20
21
  /** Logical Operators */
21
22
  export type LogicalOperators<T = any> = {
22
23
  /**
@@ -70,9 +71,9 @@ export type ComparisonOperators<T = any> = {
70
71
  /** Type and Existence Operators with nested support */
71
72
  export type TypeAndExistenceOperators<T = any> = {
72
73
  /** "name" in { name: "John" } */
73
- $exists?: NestedValue<T, boolean>;
74
+ $exists?: NestedValue<T, boolean, any>;
74
75
  /** "name" == "string" in { name: "John" } */
75
- $type?: NestedValue<T, string>;
76
+ $type?: NestedValue<T, JSPrimitiveType, any>;
76
77
  };
77
78
  /** Array Operators with nested support */
78
79
  export type ArrayOperators<T = any> = {
@@ -165,39 +166,39 @@ declare class CollectionManager<D = Data> {
165
166
  /**
166
167
  * Add data to a database.
167
168
  */
168
- add<T = Data>(data: Arg<T & D>, id_gen?: boolean): Promise<T>;
169
+ add(data: Arg<D>, id_gen?: boolean): Promise<D>;
169
170
  /**
170
171
  * Find data in a database.
171
172
  */
172
- find<T = Data>(search?: Search<T & D>, options?: DbFindOpts<T & D>, findOpts?: FindOpts<T & D>, context?: VContext): Promise<T[]>;
173
+ find(search?: Search<D>, options?: DbFindOpts<D>, findOpts?: FindOpts<D>, context?: VContext): Promise<D[]>;
173
174
  /**
174
175
  * Find one data entry in a database.
175
176
  */
176
- findOne<T = Data>(search?: Search<T & D>, findOpts?: FindOpts<T & D>, context?: VContext): Promise<T>;
177
+ findOne(search?: Search<D>, findOpts?: FindOpts<D>, context?: VContext): Promise<D>;
177
178
  /**
178
179
  * Update data in a database.
179
180
  */
180
- update<T = Data>(search: Search<T & D>, updater: Updater<T & D>, context?: VContext): Promise<boolean>;
181
+ update(search: Search<D>, updater: Updater<D>, context?: VContext): Promise<boolean>;
181
182
  /**
182
183
  * Update one data entry in a database.
183
184
  */
184
- updateOne<T = Data>(search: Search<T & D>, updater: Updater<T & D>, context?: VContext): Promise<boolean>;
185
+ updateOne(search: Search<D>, updater: Updater<D>, context?: VContext): Promise<boolean>;
185
186
  /**
186
187
  * Remove data from a database.
187
188
  */
188
- remove<T = Data>(search: Search<T & D>, context?: VContext): Promise<boolean>;
189
+ remove(search: Search<D>, context?: VContext): Promise<boolean>;
189
190
  /**
190
191
  * Remove one data entry from a database.
191
192
  */
192
- removeOne<T = Data>(search: Search<T & D>, context?: VContext): Promise<boolean>;
193
+ removeOne(search: Search<D>, context?: VContext): Promise<boolean>;
193
194
  /**
194
195
  * Asynchronously updates one entry in a database or adds a new one if it doesn't exist.
195
196
  */
196
- updateOneOrAdd<T = Data>(search: Search<T & D>, updater: Updater<T & D>, { add_arg, context, id_gen }: UpdateOneOrAdd<T & D>): Promise<boolean>;
197
+ updateOneOrAdd(search: Search<D>, updater: Updater<D>, { add_arg, context, id_gen }?: UpdateOneOrAdd<D>): Promise<boolean>;
197
198
  /**
198
199
  * Asynchronously removes one entry in a database or adds a new one if it doesn't exist. Usage e.g. for toggling a flag.
199
200
  */
200
- toggleOne<T = Data>(search: Search<T & D>, data?: Arg<T & D>, context?: VContext): Promise<boolean>;
201
+ toggleOne(search: Search<D>, data?: Arg<D>, context?: VContext): Promise<boolean>;
201
202
  }
202
203
  export interface ValtheraCompatible {
203
204
  c(collection: string): CollectionManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/vql",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "main": "dist/index.js",
5
5
  "author": "wxn0brP",
6
6
  "license": "MIT",
@@ -27,9 +27,9 @@
27
27
  "query-language"
28
28
  ],
29
29
  "peerDependencies": {
30
- "@wxn0brp/db-core": ">=0.3.0",
31
- "@wxn0brp/falcon-frame": ">=0.5.3",
32
- "@wxn0brp/gate-warden": ">=0.5.0"
30
+ "@wxn0brp/db-core": ">=0.4.0",
31
+ "@wxn0brp/falcon-frame": ">=0.5.9",
32
+ "@wxn0brp/gate-warden": ">=0.5.3"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "@wxn0brp/falcon-frame": {
@@ -45,10 +45,10 @@
45
45
  "devDependencies": {
46
46
  "@types/bun": "*",
47
47
  "@types/node": "*",
48
- "@wxn0brp/db": "^0.41.0",
49
- "@wxn0brp/db-core": "^0.3.0",
50
- "@wxn0brp/falcon-frame": "^0.5.3",
51
- "@wxn0brp/gate-warden": "^0.5.0",
48
+ "@wxn0brp/db": "^0.41.1",
49
+ "@wxn0brp/db-core": "^0.4.0",
50
+ "@wxn0brp/falcon-frame": "^0.5.9",
51
+ "@wxn0brp/gate-warden": "^0.5.3",
52
52
  "esbuild": "*",
53
53
  "tsc-alias": "*",
54
54
  "typescript": "*"