@wxn0brp/vql-client 0.0.12 → 0.0.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.
Files changed (2) hide show
  1. package/dist/vql.d.ts +12 -12
  2. package/package.json +1 -1
package/dist/vql.d.ts CHANGED
@@ -80,23 +80,23 @@ export interface FindOpts<T = any> {
80
80
  exclude?: KeysMatching<T, any>[];
81
81
  transform?: Function;
82
82
  }
83
- declare class CollectionManager {
83
+ declare class CollectionManager<D = Data> {
84
84
  private db;
85
85
  private collection;
86
86
  constructor(db: ValtheraCompatible, collection: string);
87
- add<T = Data>(data: Arg, id_gen?: boolean): Promise<T>;
88
- find<T = Data>(search: Search, context?: VContext, options?: DbFindOpts, findOpts?: FindOpts): Promise<T[]>;
89
- findOne<T = Data>(search: Search, context?: VContext, findOpts?: FindOpts): Promise<T>;
90
- update(search: Search, updater: Updater, context?: VContext): Promise<boolean>;
91
- updateOne(search: Search, updater: Updater, context?: VContext): Promise<boolean>;
92
- remove(search: Search, context?: VContext): Promise<boolean>;
93
- removeOne(search: Search, context?: VContext): Promise<boolean>;
94
- updateOneOrAdd(search: Search, updater: Updater, add_arg?: Arg, context?: VContext, id_gen?: boolean): Promise<boolean>;
87
+ add<T = Data>(data: Arg<T & D>, id_gen?: boolean): Promise<T>;
88
+ find<T = Data>(search?: Search<T & D>, context?: VContext, options?: DbFindOpts<T & Data>, findOpts?: FindOpts<T & Data>): Promise<T[]>;
89
+ findOne<T = Data>(search?: Search<T & Data>, context?: VContext, findOpts?: FindOpts<T & Data>): Promise<T>;
90
+ update<T = Data>(search: Search<T & Data>, updater: Updater<T & Data>, context?: VContext): Promise<boolean>;
91
+ updateOne<T = Data>(search: Search<T & Data>, updater: Updater<T & Data>, context?: VContext): Promise<boolean>;
92
+ remove<T = Data>(search: Search<T & Data>, context?: VContext): Promise<boolean>;
93
+ removeOne<T = Data>(search: Search<T & Data>, context?: VContext): Promise<boolean>;
94
+ updateOneOrAdd<T = Data>(search: Search<T & Data>, updater: Updater<T & Data>, add_arg?: Arg<T & Data>, context?: VContext, id_gen?: boolean): Promise<boolean>;
95
95
  }
96
96
  export interface ValtheraCompatible {
97
97
  c(collection: string): CollectionManager;
98
98
  getCollections(): Promise<string[]>;
99
- checkCollection(collection: string): Promise<boolean>;
99
+ ensureCollection(collection: string): Promise<boolean>;
100
100
  issetCollection(collection: string): Promise<boolean>;
101
101
  add<T = Data>(collection: string, data: Arg<T>, id_gen?: boolean): Promise<T>;
102
102
  find<T = Data>(collection: string, search: Search<T>, context?: VContext, options?: DbFindOpts<T>, findOpts?: FindOpts<T>): Promise<T[]>;
@@ -148,7 +148,7 @@ export interface VQLQuery<T = any> {
148
148
  removeOne: VQLRemoveOne<T>;
149
149
  updateOneOrAdd: VQLUpdateOneOrAdd<T>;
150
150
  removeCollection: VQLCollectionOperation;
151
- checkCollection: VQLCollectionOperation;
151
+ ensureCollection: VQLCollectionOperation;
152
152
  issetCollection: VQLCollectionOperation;
153
153
  getCollections: {};
154
154
  }
@@ -173,7 +173,7 @@ export type VQLQueryData<T = any> = {
173
173
  } | {
174
174
  removeCollection: VQLCollectionOperation;
175
175
  } | {
176
- checkCollection: VQLCollectionOperation;
176
+ ensureCollection: VQLCollectionOperation;
177
177
  } | {
178
178
  issetCollection: VQLCollectionOperation;
179
179
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/vql-client",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "wxn0brP",