@dnax/core 0.12.2 → 0.12.3
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 +3 -3
- package/package.json +3 -1
- package/utils/index.ts +2 -0
package/driver/mongo/rest.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { getTenant } from "../../lib/tenant";
|
|
|
5
5
|
import type { Actions, Collection, Tenant } from "./../../types/index";
|
|
6
6
|
import { isArray, omit } from "radash";
|
|
7
7
|
import { ClientSession, MongoClient, ObjectId } from "mongodb";
|
|
8
|
-
import { contextError, fn, toJson } from "../../utils";
|
|
8
|
+
import { contextError, fn, toJson, dotJson } from "../../utils";
|
|
9
9
|
import v, { type Schema } from "joi";
|
|
10
10
|
import type { Context } from "hono";
|
|
11
11
|
|
|
@@ -773,7 +773,7 @@ class useRest {
|
|
|
773
773
|
//update.$set = deepSetId(col, update.$set);
|
|
774
774
|
var { valid, output, error } = this.validator(
|
|
775
775
|
collection,
|
|
776
|
-
update
|
|
776
|
+
dotJson.object(update?.$set),
|
|
777
777
|
{
|
|
778
778
|
partial: true,
|
|
779
779
|
}
|
|
@@ -1023,7 +1023,7 @@ class useRest {
|
|
|
1023
1023
|
update.$set = await hashPasswordAuto(update.$set, col);
|
|
1024
1024
|
var { valid, output, error } = this.validator(
|
|
1025
1025
|
collection,
|
|
1026
|
-
update
|
|
1026
|
+
dotJson.object(update?.$set),
|
|
1027
1027
|
{
|
|
1028
1028
|
partial: true,
|
|
1029
1029
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnax/core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@colors/colors": "^1.6.0",
|
|
22
22
|
"@lukeed/ms": "^2.0.2",
|
|
23
23
|
"@orama/orama": "^2.0.23",
|
|
24
|
+
"@types/dot-object": "^2.1.6",
|
|
24
25
|
"@types/jsonwebtoken": "^9.0.6",
|
|
25
26
|
"bentocache": "^1.0.0-beta.9",
|
|
26
27
|
"boxen": "^7.1.1",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"consola": "^3.2.3",
|
|
31
32
|
"cookie": "^0.6.0",
|
|
32
33
|
"croner": "^8.1.1",
|
|
34
|
+
"dot-object": "^2.1.5",
|
|
33
35
|
"find-open-port": "^2.0.3",
|
|
34
36
|
"fs-extra": "^11.2.0",
|
|
35
37
|
"generate-unique-id": "^2.0.3",
|
package/utils/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { Otp } from "../lib/opt";
|
|
|
11
11
|
import collect from "collect.js";
|
|
12
12
|
import * as uuid from "uuid";
|
|
13
13
|
import * as urlencode from "urlencode";
|
|
14
|
+
import dotJson from "dot-object";
|
|
14
15
|
|
|
15
16
|
const JWT_SECRET = process?.env?.JWT_SECRET || "secret-libv";
|
|
16
17
|
import * as _ from "radash";
|
|
@@ -316,6 +317,7 @@ const password = {
|
|
|
316
317
|
};
|
|
317
318
|
|
|
318
319
|
export {
|
|
320
|
+
dotJson,
|
|
319
321
|
uuid,
|
|
320
322
|
pick,
|
|
321
323
|
password, // Hash and verify Password utils
|