@zenstackhq/runtime 3.0.0-alpha.29 → 3.0.0-alpha.30
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/dist/{contract-B8DJmviN.d.cts → contract-DUtKB39c.d.cts} +16 -15
- package/dist/{contract-B8DJmviN.d.ts → contract-DUtKB39c.d.ts} +16 -15
- package/dist/index.cjs +17 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/plugins/policy/index.d.cts +1 -1
- package/dist/plugins/policy/index.d.ts +1 -1
- package/package.json +10 -9
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientConstructor } from './contract-
|
|
2
|
-
export { K as AggregateArgs, L as AggregateResult, B as BatchResult, i as BooleanFilter, h as BytesFilter, c as ClientContract, d as ClientOptions, G as CountArgs, H as CountResult, u as CreateArgs, w as CreateManyAndReturnArgs, v as CreateManyArgs, D as DateTimeFilter, A as DeleteArgs, E as DeleteManyArgs, F as FindArgs, s as FindFirstArgs, r as FindManyArgs, t as FindUniqueArgs, P as GroupByArgs, Q as GroupByResult, I as IncludeInput, J as JsonArray, a as JsonObject, b as JsonValue, M as ModelResult, k as NullsOrder, N as NumberFilter, m as OmitInput, O as OrderBy, n as SelectIncludeOmit, o as SelectInput, q as SelectSubset, S as SimplifiedModelResult, j as SortOrder, g as StringFilter, p as Subset, T as ToKysely, f as TypeDefResult, U as UpdateArgs, y as UpdateManyAndReturnArgs, x as UpdateManyArgs, z as UpsertArgs, W as WhereInput, l as WhereUniqueInput, e as definePlugin } from './contract-
|
|
1
|
+
import { C as ClientConstructor } from './contract-DUtKB39c.cjs';
|
|
2
|
+
export { K as AggregateArgs, L as AggregateResult, B as BatchResult, i as BooleanFilter, h as BytesFilter, c as ClientContract, d as ClientOptions, G as CountArgs, H as CountResult, u as CreateArgs, w as CreateManyAndReturnArgs, v as CreateManyArgs, D as DateTimeFilter, A as DeleteArgs, E as DeleteManyArgs, F as FindArgs, s as FindFirstArgs, r as FindManyArgs, t as FindUniqueArgs, P as GroupByArgs, Q as GroupByResult, I as IncludeInput, J as JsonArray, a as JsonObject, b as JsonValue, M as ModelResult, k as NullsOrder, N as NumberFilter, m as OmitInput, O as OrderBy, n as SelectIncludeOmit, o as SelectInput, q as SelectSubset, S as SimplifiedModelResult, j as SortOrder, g as StringFilter, p as Subset, T as ToKysely, f as TypeDefResult, U as UpdateArgs, y as UpdateManyAndReturnArgs, x as UpdateManyArgs, z as UpsertArgs, W as WhereInput, l as WhereUniqueInput, Z as ZenStackPromise, e as definePlugin } from './contract-DUtKB39c.cjs';
|
|
3
|
+
export { sql } from 'kysely';
|
|
3
4
|
import 'decimal.js';
|
|
4
5
|
import '@zenstackhq/sdk/schema';
|
|
5
|
-
import 'kysely';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ZenStack ORM client.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as ClientConstructor } from './contract-
|
|
2
|
-
export { K as AggregateArgs, L as AggregateResult, B as BatchResult, i as BooleanFilter, h as BytesFilter, c as ClientContract, d as ClientOptions, G as CountArgs, H as CountResult, u as CreateArgs, w as CreateManyAndReturnArgs, v as CreateManyArgs, D as DateTimeFilter, A as DeleteArgs, E as DeleteManyArgs, F as FindArgs, s as FindFirstArgs, r as FindManyArgs, t as FindUniqueArgs, P as GroupByArgs, Q as GroupByResult, I as IncludeInput, J as JsonArray, a as JsonObject, b as JsonValue, M as ModelResult, k as NullsOrder, N as NumberFilter, m as OmitInput, O as OrderBy, n as SelectIncludeOmit, o as SelectInput, q as SelectSubset, S as SimplifiedModelResult, j as SortOrder, g as StringFilter, p as Subset, T as ToKysely, f as TypeDefResult, U as UpdateArgs, y as UpdateManyAndReturnArgs, x as UpdateManyArgs, z as UpsertArgs, W as WhereInput, l as WhereUniqueInput, e as definePlugin } from './contract-
|
|
1
|
+
import { C as ClientConstructor } from './contract-DUtKB39c.js';
|
|
2
|
+
export { K as AggregateArgs, L as AggregateResult, B as BatchResult, i as BooleanFilter, h as BytesFilter, c as ClientContract, d as ClientOptions, G as CountArgs, H as CountResult, u as CreateArgs, w as CreateManyAndReturnArgs, v as CreateManyArgs, D as DateTimeFilter, A as DeleteArgs, E as DeleteManyArgs, F as FindArgs, s as FindFirstArgs, r as FindManyArgs, t as FindUniqueArgs, P as GroupByArgs, Q as GroupByResult, I as IncludeInput, J as JsonArray, a as JsonObject, b as JsonValue, M as ModelResult, k as NullsOrder, N as NumberFilter, m as OmitInput, O as OrderBy, n as SelectIncludeOmit, o as SelectInput, q as SelectSubset, S as SimplifiedModelResult, j as SortOrder, g as StringFilter, p as Subset, T as ToKysely, f as TypeDefResult, U as UpdateArgs, y as UpdateManyAndReturnArgs, x as UpdateManyArgs, z as UpsertArgs, W as WhereInput, l as WhereUniqueInput, Z as ZenStackPromise, e as definePlugin } from './contract-DUtKB39c.js';
|
|
3
|
+
export { sql } from 'kysely';
|
|
3
4
|
import 'decimal.js';
|
|
4
5
|
import '@zenstackhq/sdk/schema';
|
|
5
|
-
import 'kysely';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ZenStack ORM client.
|
package/dist/index.js
CHANGED
|
@@ -4543,8 +4543,8 @@ var InputValidator = class {
|
|
|
4543
4543
|
if (this.schema.typeDefs && type in this.schema.typeDefs) {
|
|
4544
4544
|
return this.makeTypeDefSchema(type);
|
|
4545
4545
|
} else {
|
|
4546
|
-
return match15(type).with("String", () => z.string()).with("Int", () => z.int()).with("Float", () => z.number()).with("Boolean", () => z.boolean()).with("BigInt", () => z.union([
|
|
4547
|
-
z.int(),
|
|
4546
|
+
return match15(type).with("String", () => z.string()).with("Int", () => z.number().int()).with("Float", () => z.number()).with("Boolean", () => z.boolean()).with("BigInt", () => z.union([
|
|
4547
|
+
z.number().int(),
|
|
4548
4548
|
z.bigint()
|
|
4549
4549
|
])).with("Decimal", () => z.union([
|
|
4550
4550
|
z.number(),
|
|
@@ -4564,7 +4564,7 @@ var InputValidator = class {
|
|
|
4564
4564
|
}
|
|
4565
4565
|
const typeDef = this.schema.typeDefs?.[type];
|
|
4566
4566
|
invariant8(typeDef, `Type definition "${type}" not found in schema`);
|
|
4567
|
-
schema = z.
|
|
4567
|
+
schema = z.object(Object.fromEntries(Object.entries(typeDef.fields).map(([field, def]) => {
|
|
4568
4568
|
let fieldSchema = this.makePrimitiveSchema(def.type);
|
|
4569
4569
|
if (def.array) {
|
|
4570
4570
|
fieldSchema = fieldSchema.array();
|
|
@@ -4576,7 +4576,7 @@ var InputValidator = class {
|
|
|
4576
4576
|
field,
|
|
4577
4577
|
fieldSchema
|
|
4578
4578
|
];
|
|
4579
|
-
})));
|
|
4579
|
+
}))).passthrough();
|
|
4580
4580
|
this.schemaCache.set(key, schema);
|
|
4581
4581
|
return schema;
|
|
4582
4582
|
}
|
|
@@ -4714,7 +4714,7 @@ var InputValidator = class {
|
|
|
4714
4714
|
}
|
|
4715
4715
|
makeDateTimeFilterSchema(optional, withAggregations) {
|
|
4716
4716
|
return this.makeCommonPrimitiveFilterSchema(z.union([
|
|
4717
|
-
z.
|
|
4717
|
+
z.string().datetime(),
|
|
4718
4718
|
z.date()
|
|
4719
4719
|
]), optional, () => z.lazy(() => this.makeDateTimeFilterSchema(optional, withAggregations)), withAggregations ? [
|
|
4720
4720
|
"_count",
|
|
@@ -4766,7 +4766,7 @@ var InputValidator = class {
|
|
|
4766
4766
|
gte: baseSchema.optional(),
|
|
4767
4767
|
not: makeThis().optional(),
|
|
4768
4768
|
...withAggregations?.includes("_count") ? {
|
|
4769
|
-
_count: this.makeNumberFilterSchema(z.int(), false, false).optional()
|
|
4769
|
+
_count: this.makeNumberFilterSchema(z.number().int(), false, false).optional()
|
|
4770
4770
|
} : {},
|
|
4771
4771
|
...withAggregations?.includes("_avg") ? {
|
|
4772
4772
|
_avg: commonAggSchema()
|
|
@@ -5178,7 +5178,7 @@ var InputValidator = class {
|
|
|
5178
5178
|
return z.strictObject({
|
|
5179
5179
|
where: this.makeWhereSchema(model, false).optional(),
|
|
5180
5180
|
data: this.makeUpdateDataSchema(model, [], true),
|
|
5181
|
-
limit: z.int().nonnegative().optional()
|
|
5181
|
+
limit: z.number().int().nonnegative().optional()
|
|
5182
5182
|
});
|
|
5183
5183
|
}
|
|
5184
5184
|
makeUpdateManyAndReturnSchema(model) {
|
|
@@ -5285,7 +5285,7 @@ var InputValidator = class {
|
|
|
5285
5285
|
makeDeleteManySchema(model) {
|
|
5286
5286
|
return z.object({
|
|
5287
5287
|
where: this.makeWhereSchema(model, false).optional(),
|
|
5288
|
-
limit: z.int().nonnegative().optional()
|
|
5288
|
+
limit: z.number().int().nonnegative().optional()
|
|
5289
5289
|
}).optional();
|
|
5290
5290
|
}
|
|
5291
5291
|
// #endregion
|
|
@@ -5417,10 +5417,10 @@ var InputValidator = class {
|
|
|
5417
5417
|
// #endregion
|
|
5418
5418
|
// #region Helpers
|
|
5419
5419
|
makeSkipSchema() {
|
|
5420
|
-
return z.int().nonnegative();
|
|
5420
|
+
return z.number().int().nonnegative();
|
|
5421
5421
|
}
|
|
5422
5422
|
makeTakeSchema() {
|
|
5423
|
-
return z.int();
|
|
5423
|
+
return z.number().int();
|
|
5424
5424
|
}
|
|
5425
5425
|
refineForSelectIncludeMutuallyExclusive(schema) {
|
|
5426
5426
|
return schema.refine((value) => !(value["select"] && value["include"]), '"select" and "include" cannot be used together');
|
|
@@ -6955,12 +6955,16 @@ function definePlugin(plugin) {
|
|
|
6955
6955
|
return plugin;
|
|
6956
6956
|
}
|
|
6957
6957
|
__name(definePlugin, "definePlugin");
|
|
6958
|
+
|
|
6959
|
+
// src/client/index.ts
|
|
6960
|
+
import { sql as sql10 } from "kysely";
|
|
6958
6961
|
export {
|
|
6959
6962
|
InputValidationError,
|
|
6960
6963
|
InternalError,
|
|
6961
6964
|
NotFoundError,
|
|
6962
6965
|
QueryError,
|
|
6963
6966
|
ZenStackClient,
|
|
6964
|
-
definePlugin
|
|
6967
|
+
definePlugin,
|
|
6968
|
+
sql10 as sql
|
|
6965
6969
|
};
|
|
6966
6970
|
//# sourceMappingURL=index.js.map
|