@zenstackhq/runtime 3.0.0-alpha.4 → 3.0.0-alpha.6

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.
@@ -1,9 +1,7 @@
1
1
  import * as kysely from 'kysely';
2
- import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-BBUC-uVq.cjs';
2
+ import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-DW8XGrtV.cjs';
3
3
  import { SchemaDef } from '@zenstackhq/sdk/schema';
4
4
  import 'decimal.js';
5
- import 'utility-types';
6
- import '@zenstackhq/language/ast';
7
5
 
8
6
  /**
9
7
  * Error thrown when an operation is rejected by access policy.
@@ -18,7 +16,7 @@ declare class PolicyPlugin<Schema extends SchemaDef> implements RuntimePlugin<Sc
18
16
  get id(): string;
19
17
  get name(): string;
20
18
  get description(): string;
21
- onKyselyQuery({ query, client, proceed, transaction, }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
19
+ onKyselyQuery({ query, client, proceed, transaction }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
22
20
  }
23
21
 
24
22
  export { PolicyPlugin, RejectedByPolicyError };
@@ -1,9 +1,7 @@
1
1
  import * as kysely from 'kysely';
2
- import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-BBUC-uVq.js';
2
+ import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-DW8XGrtV.js';
3
3
  import { SchemaDef } from '@zenstackhq/sdk/schema';
4
4
  import 'decimal.js';
5
- import 'utility-types';
6
- import '@zenstackhq/language/ast';
7
5
 
8
6
  /**
9
7
  * Error thrown when an operation is rejected by access policy.
@@ -18,7 +16,7 @@ declare class PolicyPlugin<Schema extends SchemaDef> implements RuntimePlugin<Sc
18
16
  get id(): string;
19
17
  get name(): string;
20
18
  get description(): string;
21
- onKyselyQuery({ query, client, proceed, transaction, }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
19
+ onKyselyQuery({ query, client, proceed, transaction }: OnKyselyQueryArgs<Schema>): Promise<kysely.QueryResult<any>>;
22
20
  }
23
21
 
24
22
  export { PolicyPlugin, RejectedByPolicyError };
@@ -14,16 +14,16 @@ var RejectedByPolicyError = class extends Error {
14
14
  };
15
15
 
16
16
  // src/plugins/policy/policy-handler.ts
17
+ import { invariant as invariant6 } from "@zenstackhq/common-helpers";
17
18
  import { AliasNode as AliasNode3, BinaryOperationNode as BinaryOperationNode3, ColumnNode as ColumnNode2, DeleteQueryNode, FromNode as FromNode2, IdentifierNode as IdentifierNode2, InsertQueryNode, OperationNodeTransformer, OperatorNode as OperatorNode3, PrimitiveValueListNode, RawNode, ReturningNode, SelectionNode as SelectionNode2, SelectQueryNode as SelectQueryNode2, TableNode as TableNode3, UpdateQueryNode, ValueNode as ValueNode3, ValuesNode, WhereNode as WhereNode2 } from "kysely";
18
- import invariant6 from "tiny-invariant";
19
19
  import { match as match7 } from "ts-pattern";
20
20
 
21
21
  // src/client/crud/dialects/index.ts
22
22
  import { match as match4 } from "ts-pattern";
23
23
 
24
24
  // src/client/crud/dialects/postgresql.ts
25
+ import { invariant as invariant2 } from "@zenstackhq/common-helpers";
25
26
  import { sql as sql2 } from "kysely";
26
- import invariant2 from "tiny-invariant";
27
27
  import { match as match2 } from "ts-pattern";
28
28
 
29
29
  // src/client/errors.ts
@@ -230,8 +230,8 @@ function flattenCompoundUniqueFilters(schema, model, filter) {
230
230
  __name(flattenCompoundUniqueFilters, "flattenCompoundUniqueFilters");
231
231
 
232
232
  // src/client/crud/dialects/base.ts
233
+ import { invariant, isPlainObject } from "@zenstackhq/common-helpers";
233
234
  import { sql } from "kysely";
234
- import invariant from "tiny-invariant";
235
235
  import { match, P } from "ts-pattern";
236
236
 
237
237
  // src/utils/enumerate.ts
@@ -249,7 +249,6 @@ function enumerate(x) {
249
249
  __name(enumerate, "enumerate");
250
250
 
251
251
  // src/client/crud/dialects/base.ts
252
- import { isPlainObject } from "is-plain-object";
253
252
  var BaseCrudDialect = class {
254
253
  static {
255
254
  __name(this, "BaseCrudDialect");
@@ -832,8 +831,8 @@ var PostgresCrudDialect = class extends BaseCrudDialect {
832
831
  };
833
832
 
834
833
  // src/client/crud/dialects/sqlite.ts
834
+ import { invariant as invariant3 } from "@zenstackhq/common-helpers";
835
835
  import { sql as sql3 } from "kysely";
836
- import invariant3 from "tiny-invariant";
837
836
  import { match as match3 } from "ts-pattern";
838
837
  var SqliteCrudDialect = class extends BaseCrudDialect {
839
838
  static {
@@ -1377,12 +1376,12 @@ var ColumnCollector = class extends DefaultOperationNodeVisitor {
1377
1376
  };
1378
1377
 
1379
1378
  // src/plugins/policy/expression-transformer.ts
1379
+ import { invariant as invariant5 } from "@zenstackhq/common-helpers";
1380
1380
  import { AliasNode as AliasNode2, BinaryOperationNode as BinaryOperationNode2, ColumnNode, expressionBuilder, FromNode, FunctionNode as FunctionNode2, IdentifierNode, OperatorNode as OperatorNode2, ReferenceNode as ReferenceNode2, SelectionNode, SelectQueryNode, TableNode as TableNode2, ValueListNode, ValueNode as ValueNode2, WhereNode } from "kysely";
1381
- import invariant5 from "tiny-invariant";
1382
1381
  import { match as match6 } from "ts-pattern";
1383
1382
 
1384
1383
  // src/plugins/policy/expression-evaluator.ts
1385
- import invariant4 from "tiny-invariant";
1384
+ import { invariant as invariant4 } from "@zenstackhq/common-helpers";
1386
1385
  import { match as match5 } from "ts-pattern";
1387
1386
  var ExpressionEvaluator = class {
1388
1387
  static {