@dnax/core 0.47.0 → 0.47.1
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/driver/mongo/rest.ts +5 -1
- package/package.json +1 -1
- package/types/index.ts +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -813,10 +813,11 @@ class useRest {
|
|
|
813
813
|
collection: string,
|
|
814
814
|
id: string,
|
|
815
815
|
params?: findOneParam,
|
|
816
|
-
options?: Omit<optionCb, "elementAt"
|
|
816
|
+
options?: Omit<optionCb, "elementAt">
|
|
817
817
|
): Promise<object | null> {
|
|
818
818
|
return new Promise(async (resolve, reject) => {
|
|
819
819
|
try {
|
|
820
|
+
let meta = {};
|
|
820
821
|
let sharedData = {};
|
|
821
822
|
let docs: Array<any> | any = [];
|
|
822
823
|
let useHook = options?.useHook ?? this.#useHook;
|
|
@@ -907,6 +908,7 @@ class useRest {
|
|
|
907
908
|
params: params,
|
|
908
909
|
session: sessionStorage(),
|
|
909
910
|
result: docs,
|
|
911
|
+
meta: meta,
|
|
910
912
|
rest: new useRest({
|
|
911
913
|
useHook: false,
|
|
912
914
|
tenant_id: this.#tenant_id,
|
|
@@ -932,6 +934,7 @@ class useRest {
|
|
|
932
934
|
let result = {
|
|
933
935
|
doc: null,
|
|
934
936
|
};
|
|
937
|
+
let meta = {};
|
|
935
938
|
let sharedData = {};
|
|
936
939
|
let useHook = options?.useHook ?? this.#useHook;
|
|
937
940
|
let useCustomApi = options?.useCustomApi ?? this.#useCustomApi;
|
|
@@ -951,6 +954,7 @@ class useRest {
|
|
|
951
954
|
driver: "mongodb",
|
|
952
955
|
action: "updateOne",
|
|
953
956
|
update: update,
|
|
957
|
+
|
|
954
958
|
session: sessionStorage(),
|
|
955
959
|
rest: new useRest({
|
|
956
960
|
useHook: false,
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -211,7 +211,7 @@ export type hooksCtx = (ctx: {
|
|
|
211
211
|
sharedData?: any;
|
|
212
212
|
action?: Actions;
|
|
213
213
|
c?: Context;
|
|
214
|
-
meta?: { total
|
|
214
|
+
meta?: { total?: number; count?: number; [key: string]: any };
|
|
215
215
|
rest: InstanceType<typeof useRest>;
|
|
216
216
|
session?: sessionCtx;
|
|
217
217
|
io: socketIoType;
|