@wxn0brp/vql-client 0.0.10 → 0.0.11
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/vql.d.ts +3 -11
- package/package.json +1 -1
package/dist/vql.d.ts
CHANGED
|
@@ -71,20 +71,15 @@ export type Updater<T = any> = UpdaterArg | UpdaterArg[] | UpdaterFunc<T>;
|
|
|
71
71
|
export interface DbFindOpts {
|
|
72
72
|
reverse?: boolean;
|
|
73
73
|
max?: number;
|
|
74
|
+
offset?: number;
|
|
75
|
+
sortBy?: string;
|
|
76
|
+
sortAsc?: boolean;
|
|
74
77
|
}
|
|
75
78
|
export interface FindOpts {
|
|
76
79
|
select?: string[];
|
|
77
80
|
exclude?: string[];
|
|
78
81
|
transform?: Function;
|
|
79
82
|
}
|
|
80
|
-
export interface Transaction {
|
|
81
|
-
type: "update" | "updateOne" | "updateOneOrAdd" | "remove" | "removeOne";
|
|
82
|
-
search: Search;
|
|
83
|
-
updater?: Updater;
|
|
84
|
-
addArg?: Arg;
|
|
85
|
-
idGen?: boolean;
|
|
86
|
-
context?: Context;
|
|
87
|
-
}
|
|
88
83
|
export interface ValtheraCompatible {
|
|
89
84
|
c(collection: string): CollectionManager;
|
|
90
85
|
getCollections(): Promise<string[]>;
|
|
@@ -93,13 +88,11 @@ export interface ValtheraCompatible {
|
|
|
93
88
|
add<T = Data>(collection: string, data: Arg, id_gen?: boolean): Promise<T>;
|
|
94
89
|
find<T = Data>(collection: string, search: Search, context?: Context, options?: DbFindOpts, findOpts?: FindOpts): Promise<T[]>;
|
|
95
90
|
findOne<T = Data>(collection: string, search: Search, context?: Context, findOpts?: FindOpts): Promise<T | null>;
|
|
96
|
-
findStream<T = Data>(collection: string, search: Search, context?: Context, findOpts?: FindOpts, limit?: number): Promise<AsyncGenerator<T>>;
|
|
97
91
|
update(collection: string, search: Search, updater: Updater, context?: Context): Promise<boolean>;
|
|
98
92
|
updateOne(collection: string, search: Search, updater: Updater, context?: Context): Promise<boolean>;
|
|
99
93
|
remove(collection: string, search: Search, context?: Context): Promise<boolean>;
|
|
100
94
|
removeOne(collection: string, search: Search, context?: Context): Promise<boolean>;
|
|
101
95
|
removeCollection(collection: string): Promise<boolean>;
|
|
102
|
-
transaction(collection: string, transaction: Transaction[]): Promise<boolean>;
|
|
103
96
|
updateOneOrAdd(collection: string, search: Search, updater: Updater, add_arg?: Arg, context?: Context, id_gen?: boolean): Promise<boolean>;
|
|
104
97
|
}
|
|
105
98
|
declare class CollectionManager {
|
|
@@ -109,7 +102,6 @@ declare class CollectionManager {
|
|
|
109
102
|
add<T = Data>(data: Arg, id_gen?: boolean): Promise<T>;
|
|
110
103
|
find<T = Data>(search: Search, context?: Context, options?: DbFindOpts, findOpts?: FindOpts): Promise<T[]>;
|
|
111
104
|
findOne<T = Data>(search: Search, context?: Context, findOpts?: FindOpts): Promise<T>;
|
|
112
|
-
findStream<T = Data>(search: Search, context?: Context, findOpts?: FindOpts, limit?: number): AsyncGenerator<T>;
|
|
113
105
|
update(search: Search, updater: Updater, context?: Context): Promise<boolean>;
|
|
114
106
|
updateOne(search: Search, updater: Updater, context?: Context): Promise<boolean>;
|
|
115
107
|
remove(search: Search, context?: Context): Promise<boolean>;
|