@dnax/core 0.69.8 → 0.69.10
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/app/ctrl.ts +1 -0
- package/driver/mongo/rest.ts +3 -3
- package/package.json +1 -1
- package/types/index.ts +1 -1
package/app/ctrl.ts
CHANGED
package/driver/mongo/rest.ts
CHANGED
|
@@ -836,7 +836,7 @@ class useRest {
|
|
|
836
836
|
return new Promise(async (resolve, reject) => {
|
|
837
837
|
try {
|
|
838
838
|
let meta = {
|
|
839
|
-
|
|
839
|
+
ms: 0, // time duration
|
|
840
840
|
};
|
|
841
841
|
let start = Date.now();
|
|
842
842
|
|
|
@@ -899,7 +899,7 @@ class useRest {
|
|
|
899
899
|
}),
|
|
900
900
|
})) as any;
|
|
901
901
|
// Temp dexecution en ms
|
|
902
|
-
meta.
|
|
902
|
+
meta.ms = Date.now() - start;
|
|
903
903
|
return resolve({
|
|
904
904
|
meta: meta,
|
|
905
905
|
data: result,
|
|
@@ -915,7 +915,7 @@ class useRest {
|
|
|
915
915
|
.toArray()) || [];
|
|
916
916
|
|
|
917
917
|
result.docs = toJson(result.docs);
|
|
918
|
-
meta.
|
|
918
|
+
meta.ms = Date.now() - start;
|
|
919
919
|
if (col?.hooks?.afterFindWithMeta && useHook) {
|
|
920
920
|
await col.hooks.afterFindWithMeta({
|
|
921
921
|
sharedData: sharedData,
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -237,7 +237,7 @@ export type hooksCtx = (ctx: {
|
|
|
237
237
|
sharedData?: any;
|
|
238
238
|
action?: Actions;
|
|
239
239
|
c?: Context;
|
|
240
|
-
meta?: {
|
|
240
|
+
meta?: { ms:number; [key: string]: any };
|
|
241
241
|
rest: InstanceType<typeof useRest>;
|
|
242
242
|
session?: sessionCtx;
|
|
243
243
|
io: socketIoType;
|