@zenstackhq/runtime 1.0.0-alpha.70 → 1.0.0-alpha.73
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/enhancements/preset.d.ts +2 -2
- package/enhancements/preset.js +2 -2
- package/package.json +2 -2
- package/version.js +6 -1
- package/version.js.map +1 -1
- package/zod.d.ts +10 -0
- package/zod.js +17 -0
- package/zod.js.map +1 -0
package/enhancements/preset.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { ModelMeta, PolicyDef } from './types';
|
|
|
8
8
|
*
|
|
9
9
|
* @param prisma The Prisma client to enhance.
|
|
10
10
|
* @param context The context to for evaluating access policies.
|
|
11
|
-
* @param policy The access policy data, generated by @
|
|
11
|
+
* @param policy The access policy data, generated by @core/access-policy plugin.
|
|
12
12
|
* You only need to pass it if you configured the plugin to generate into custom location.
|
|
13
|
-
* @param modelMeta The model metadata, generated by @
|
|
13
|
+
* @param modelMeta The model metadata, generated by @core/model-meta plugin.
|
|
14
14
|
* You only need to pass it if you configured the plugin to generate into custom location.
|
|
15
15
|
*/
|
|
16
16
|
export declare function withPresets<DbClient extends object>(prisma: DbClient, context?: WithPolicyContext, policy?: PolicyDef, modelMeta?: ModelMeta): DbClient;
|
package/enhancements/preset.js
CHANGED
|
@@ -12,9 +12,9 @@ const policy_1 = require("./policy");
|
|
|
12
12
|
*
|
|
13
13
|
* @param prisma The Prisma client to enhance.
|
|
14
14
|
* @param context The context to for evaluating access policies.
|
|
15
|
-
* @param policy The access policy data, generated by @
|
|
15
|
+
* @param policy The access policy data, generated by @core/access-policy plugin.
|
|
16
16
|
* You only need to pass it if you configured the plugin to generate into custom location.
|
|
17
|
-
* @param modelMeta The model metadata, generated by @
|
|
17
|
+
* @param modelMeta The model metadata, generated by @core/model-meta plugin.
|
|
18
18
|
* You only need to pass it if you configured the plugin to generate into custom location.
|
|
19
19
|
*/
|
|
20
20
|
function withPresets(prisma, context, policy, modelMeta) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/runtime",
|
|
3
3
|
"displayName": "ZenStack Runtime Library",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.73",
|
|
5
5
|
"description": "Runtime of ZenStack for both client-side and server-side environments.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"tslib": "^2.4.1",
|
|
24
24
|
"zod": "^3.19.1",
|
|
25
25
|
"zod-validation-error": "^0.2.1",
|
|
26
|
-
"@zenstackhq/sdk": "1.0.0-alpha.
|
|
26
|
+
"@zenstackhq/sdk": "1.0.0-alpha.73"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@prisma/client": "^4.0.0"
|
package/version.js
CHANGED
|
@@ -7,7 +7,12 @@ function getVersion() {
|
|
|
7
7
|
return require('./package.json').version;
|
|
8
8
|
}
|
|
9
9
|
catch (_a) {
|
|
10
|
-
|
|
10
|
+
try {
|
|
11
|
+
return require('../package.json').version;
|
|
12
|
+
}
|
|
13
|
+
catch (_b) {
|
|
14
|
+
return 'unknown';
|
|
15
|
+
}
|
|
11
16
|
}
|
|
12
17
|
}
|
|
13
18
|
exports.getVersion = getVersion;
|
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,SAAgB,UAAU;IACtB,IAAI;QACA,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC;KAC5C;IAAC,WAAM;QACJ,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,SAAgB,UAAU;IACtB,IAAI;QACA,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC;KAC5C;IAAC,WAAM;QACJ,IAAI;YACA,OAAO,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;SAC7C;QAAC,WAAM;YACJ,OAAO,SAAS,CAAC;SACpB;KACJ;AACL,CAAC;AAVD,gCAUC"}
|
package/zod.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { DbOperations } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Mapping from model type name to zod schema for Prisma operations
|
|
5
|
+
*/
|
|
6
|
+
export type ModelZodSchema = Record<string, Record<keyof DbOperations, z.ZodType>>;
|
|
7
|
+
/**
|
|
8
|
+
* Load zod schema from standard location.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getModelZodSchemas(): ModelZodSchema;
|
package/zod.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getModelZodSchemas = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Load zod schema from standard location.
|
|
6
|
+
*/
|
|
7
|
+
function getModelZodSchemas() {
|
|
8
|
+
try {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
10
|
+
return require('.zenstack/zod').default;
|
|
11
|
+
}
|
|
12
|
+
catch (_a) {
|
|
13
|
+
throw new Error('Model meta cannot be loaded');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.getModelZodSchemas = getModelZodSchemas;
|
|
17
|
+
//# sourceMappingURL=zod.js.map
|
package/zod.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.js","sourceRoot":"","sources":["../src/zod.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACH,SAAgB,kBAAkB;IAC9B,IAAI;QACA,8DAA8D;QAC9D,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC;KAC3C;IAAC,WAAM;QACJ,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAClD;AACL,CAAC;AAPD,gDAOC"}
|