@zenstackhq/runtime 2.15.1 → 2.16.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/cross/index.js +32 -12
- package/cross/index.js.map +1 -1
- package/cross/index.mjs +28 -8
- package/cross/index.mjs.map +1 -1
- package/enhancements/edge/delegate.js +8 -11
- package/enhancements/edge/delegate.js.map +1 -1
- package/enhancements/edge/policy/handler.js +5 -7
- package/enhancements/edge/policy/handler.js.map +1 -1
- package/enhancements/edge/policy/policy-utils.d.ts +1 -1
- package/enhancements/edge/policy/policy-utils.js +23 -28
- package/enhancements/edge/policy/policy-utils.js.map +1 -1
- package/enhancements/node/delegate.js +8 -11
- package/enhancements/node/delegate.js.map +1 -1
- package/enhancements/node/policy/handler.js +5 -7
- package/enhancements/node/policy/handler.js.map +1 -1
- package/enhancements/node/policy/policy-utils.d.ts +1 -1
- package/enhancements/node/policy/policy-utils.js +23 -28
- package/enhancements/node/policy/policy-utils.js.map +1 -1
- package/local-helpers/index.d.ts +7 -0
- package/local-helpers/index.js +24 -0
- package/local-helpers/index.js.map +1 -0
- package/local-helpers/is-plain-object.d.ts +1 -0
- package/local-helpers/is-plain-object.js +25 -0
- package/local-helpers/is-plain-object.js.map +1 -0
- package/local-helpers/lower-case-first.d.ts +1 -0
- package/local-helpers/lower-case-first.js +7 -0
- package/local-helpers/lower-case-first.js.map +1 -0
- package/local-helpers/param-case.d.ts +1 -0
- package/local-helpers/param-case.js +20 -0
- package/local-helpers/param-case.js.map +1 -0
- package/local-helpers/simple-traverse.d.ts +8 -0
- package/local-helpers/simple-traverse.js +42 -0
- package/local-helpers/simple-traverse.js.map +1 -0
- package/local-helpers/sleep.d.ts +1 -0
- package/local-helpers/sleep.js +9 -0
- package/local-helpers/sleep.js.map +1 -0
- package/local-helpers/tiny-invariant.d.ts +1 -0
- package/local-helpers/tiny-invariant.js +15 -0
- package/local-helpers/tiny-invariant.js.map +1 -0
- package/local-helpers/upper-case-first.d.ts +1 -0
- package/local-helpers/upper-case-first.js +7 -0
- package/local-helpers/upper-case-first.js.map +1 -0
- package/package.json +10 -10
- package/types.d.ts +20 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upper-case-first.js","sourceRoot":"","sources":["../../src/local-helpers/upper-case-first.ts"],"names":[],"mappings":";;AAAA,wCAEC;AAFD,SAAgB,cAAc,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/runtime",
|
|
3
3
|
"displayName": "ZenStack Runtime Library",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.16.1",
|
|
5
5
|
"description": "Runtime of ZenStack for both client-side and server-side environments.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./index.d.ts",
|
|
15
15
|
"default": "./index.js"
|
|
16
16
|
},
|
|
17
|
+
"./local-helpers": {
|
|
18
|
+
"types": "./local-helpers/index.d.ts",
|
|
19
|
+
"default": "./local-helpers/index.js"
|
|
20
|
+
},
|
|
17
21
|
"./edge": {
|
|
18
22
|
"types": "./edge.d.ts",
|
|
19
23
|
"default": "./edge.js"
|
|
@@ -89,27 +93,21 @@
|
|
|
89
93
|
"dependencies": {
|
|
90
94
|
"bcryptjs": "^2.4.3",
|
|
91
95
|
"buffer": "^6.0.3",
|
|
92
|
-
"change-case": "^4.1.2",
|
|
93
96
|
"decimal.js-light": "^2.5.1",
|
|
94
97
|
"deepmerge": "^4.3.1",
|
|
95
|
-
"is-plain-object": "^5.0.0",
|
|
96
98
|
"logic-solver": "^2.0.1",
|
|
97
|
-
"lower-case-first": "^2.0.2",
|
|
98
99
|
"pluralize": "^8.0.0",
|
|
99
100
|
"safe-json-stringify": "^1.2.0",
|
|
100
101
|
"semver": "^7.5.2",
|
|
101
102
|
"superjson": "^1.13.0",
|
|
102
|
-
"tiny-invariant": "^1.3.1",
|
|
103
|
-
"traverse": "^0.6.10",
|
|
104
103
|
"ts-pattern": "^4.3.0",
|
|
105
104
|
"tslib": "^2.4.1",
|
|
106
|
-
"upper-case-first": "^2.0.2",
|
|
107
105
|
"uuid": "^9.0.0",
|
|
108
106
|
"zod": "^3.22.4",
|
|
109
107
|
"zod-validation-error": "^1.5.0"
|
|
110
108
|
},
|
|
111
109
|
"peerDependencies": {
|
|
112
|
-
"@prisma/client": "5.0.0 - 6.
|
|
110
|
+
"@prisma/client": "5.0.0 - 6.10.x"
|
|
113
111
|
},
|
|
114
112
|
"author": {
|
|
115
113
|
"name": "ZenStack Team"
|
|
@@ -121,8 +119,10 @@
|
|
|
121
119
|
"@types/pluralize": "^0.0.29",
|
|
122
120
|
"@types/safe-json-stringify": "^1.1.5",
|
|
123
121
|
"@types/semver": "^7.3.13",
|
|
124
|
-
"@types/
|
|
125
|
-
"
|
|
122
|
+
"@types/uuid": "^8.3.4",
|
|
123
|
+
"decimal.js-light": "^2.5.1",
|
|
124
|
+
"superjson": "^1.13.0",
|
|
125
|
+
"uuid": "^9.0.0"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"clean": "rimraf dist",
|
package/types.d.ts
CHANGED
|
@@ -118,6 +118,10 @@ export type EnhancementOptions = {
|
|
|
118
118
|
* The encryption options for using the `encrypted` enhancement.
|
|
119
119
|
*/
|
|
120
120
|
encryption?: SimpleEncryption | CustomEncryption;
|
|
121
|
+
/**
|
|
122
|
+
* Options for data validation.
|
|
123
|
+
*/
|
|
124
|
+
validation?: ValidationOptions;
|
|
121
125
|
};
|
|
122
126
|
/**
|
|
123
127
|
* Context for creating enhanced `PrismaClient`
|
|
@@ -178,3 +182,19 @@ export type CustomEncryption = {
|
|
|
178
182
|
*/
|
|
179
183
|
decrypt: (model: string, field: FieldInfo, cipher: string) => Promise<string>;
|
|
180
184
|
};
|
|
185
|
+
/**
|
|
186
|
+
* Options for data validation.
|
|
187
|
+
*/
|
|
188
|
+
export type ValidationOptions = {
|
|
189
|
+
/**
|
|
190
|
+
* Whether to validate "update" operations based only on the input data. By default, ZenStack
|
|
191
|
+
* validates the entity after a update operation completes (inside a transaction), and rejects
|
|
192
|
+
* the operation if validation fails. This implies the entire entity needs to satisfy the
|
|
193
|
+
* validation rules, even for fields that are not part of the update input data.
|
|
194
|
+
*
|
|
195
|
+
* You can use this option to toggle the behavior to only validate the input data.
|
|
196
|
+
*
|
|
197
|
+
* Default is `false`.
|
|
198
|
+
*/
|
|
199
|
+
inputOnlyValidationForUpdate?: boolean;
|
|
200
|
+
};
|