@zenstackhq/runtime 3.0.0-alpha.15 → 3.0.0-alpha.17
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-BYc34jr_.d.cts → contract-C6xcEG6Q.d.cts} +4 -5
- package/dist/{contract-BYc34jr_.d.ts → contract-C6xcEG6Q.d.ts} +4 -5
- package/dist/index.cjs +5 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -17
- 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 +9 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-C6xcEG6Q.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, e as definePlugin } from './contract-C6xcEG6Q.cjs';
|
|
3
3
|
import 'decimal.js';
|
|
4
4
|
import '@zenstackhq/sdk/schema';
|
|
5
5
|
import 'kysely';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-C6xcEG6Q.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, e as definePlugin } from './contract-C6xcEG6Q.js';
|
|
3
3
|
import 'decimal.js';
|
|
4
4
|
import '@zenstackhq/sdk/schema';
|
|
5
5
|
import 'kysely';
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
|
|
8
8
|
// src/client/client-impl.ts
|
|
9
9
|
import { invariant as invariant12, lowerCaseFirst as lowerCaseFirst2 } from "@zenstackhq/common-helpers";
|
|
10
|
-
import { CompiledQuery, DefaultConnectionProvider, DefaultQueryExecutor as DefaultQueryExecutor2, Kysely, Log,
|
|
11
|
-
import { match as match19 } from "ts-pattern";
|
|
10
|
+
import { CompiledQuery, DefaultConnectionProvider, DefaultQueryExecutor as DefaultQueryExecutor2, Kysely, Log, sql as sql10 } from "kysely";
|
|
12
11
|
|
|
13
12
|
// src/client/crud/operations/aggregate.ts
|
|
14
13
|
import { sql as sql5 } from "kysely";
|
|
@@ -6425,17 +6424,16 @@ var ClientImpl = class _ClientImpl {
|
|
|
6425
6424
|
this.kyselyRaw = baseClient.kyselyRaw;
|
|
6426
6425
|
this.auth = baseClient.auth;
|
|
6427
6426
|
} else {
|
|
6428
|
-
const
|
|
6429
|
-
const
|
|
6430
|
-
const
|
|
6431
|
-
const adapter = dialect.createAdapter();
|
|
6427
|
+
const driver = new ZenStackDriver(options.dialect.createDriver(), new Log(this.$options.log ?? []));
|
|
6428
|
+
const compiler = options.dialect.createQueryCompiler();
|
|
6429
|
+
const adapter = options.dialect.createAdapter();
|
|
6432
6430
|
const connectionProvider = new DefaultConnectionProvider(driver);
|
|
6433
6431
|
this.kyselyProps = {
|
|
6434
6432
|
config: {
|
|
6435
|
-
dialect,
|
|
6433
|
+
dialect: options.dialect,
|
|
6436
6434
|
log: this.$options.log
|
|
6437
6435
|
},
|
|
6438
|
-
dialect,
|
|
6436
|
+
dialect: options.dialect,
|
|
6439
6437
|
driver,
|
|
6440
6438
|
executor: executor ?? new ZenStackQueryExecutor(this, driver, compiler, adapter, connectionProvider)
|
|
6441
6439
|
};
|
|
@@ -6462,15 +6460,6 @@ var ClientImpl = class _ClientImpl {
|
|
|
6462
6460
|
withExecutor(executor) {
|
|
6463
6461
|
return new _ClientImpl(this.schema, this.$options, this, executor);
|
|
6464
6462
|
}
|
|
6465
|
-
getKyselyDialect() {
|
|
6466
|
-
return match19(this.schema.provider.type).with("sqlite", () => this.makeSqliteKyselyDialect()).with("postgresql", () => this.makePostgresKyselyDialect()).exhaustive();
|
|
6467
|
-
}
|
|
6468
|
-
makePostgresKyselyDialect() {
|
|
6469
|
-
return new PostgresDialect(this.options.dialectConfig);
|
|
6470
|
-
}
|
|
6471
|
-
makeSqliteKyselyDialect() {
|
|
6472
|
-
return new SqliteDialect(this.options.dialectConfig);
|
|
6473
|
-
}
|
|
6474
6463
|
// implementation
|
|
6475
6464
|
async $transaction(input, options) {
|
|
6476
6465
|
invariant12(typeof input === "function" || Array.isArray(input) && input.every((p) => p.then && p.cb), "Invalid transaction input, expected a function or an array of ZenStackPromise");
|