@zenstackhq/runtime 3.0.0-beta.7 → 3.0.0-beta.8

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.
@@ -787,7 +787,7 @@ type ZModelFunctionContext<Schema extends SchemaDef> = {
787
787
  /**
788
788
  * The CRUD operation being performed
789
789
  */
790
- operation: CRUD;
790
+ operation: CRUD_EXT;
791
791
  };
792
792
  type ZModelFunction<Schema extends SchemaDef> = (eb: ExpressionBuilder<ToKyselySchema<Schema>, keyof ToKyselySchema<Schema>>, args: Expression<any>[], context: ZModelFunctionContext<Schema>) => Expression<unknown>;
793
793
  /**
@@ -999,6 +999,14 @@ type CRUD = 'create' | 'read' | 'update' | 'delete';
999
999
  * CRUD operations.
1000
1000
  */
1001
1001
  declare const CRUD: readonly ["create", "read", "update", "delete"];
1002
+ /**
1003
+ * Extended CRUD operations including 'post-update'.
1004
+ */
1005
+ type CRUD_EXT = CRUD | 'post-update';
1006
+ /**
1007
+ * Extended CRUD operations including 'post-update'.
1008
+ */
1009
+ declare const CRUD_EXT: readonly ["create", "read", "update", "delete", "post-update"];
1002
1010
  type AllModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema>> = {
1003
1011
  /**
1004
1012
  * Returns a list of entities.
@@ -1505,4 +1513,33 @@ type AllModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema
1505
1513
  };
1506
1514
  type ModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema>> = Omit<AllModelOperations<Schema, Model>, IsDelegateModel<Schema, Model> extends true ? 'create' | 'createMany' | 'createManyAndReturn' | 'upsert' : never>;
1507
1515
 
1508
- export { type DeleteArgs as A, type BatchResult as B, type ClientConstructor as C, type DateTimeFilter as D, type DeleteManyArgs as E, type FindArgs as F, type CountArgs as G, type CountResult as H, type IncludeInput as I, type JsonArray as J, type AggregateArgs as K, type AggregateResult as L, type ModelResult as M, type NumberFilter as N, type OrderBy as O, type GroupByArgs as P, type GroupByResult as Q, type RuntimePlugin as R, type SimplifiedModelResult as S, type ToKysely as T, type UpdateArgs as U, type ZModelFunction as V, type WhereInput as W, type OnKyselyQueryArgs as X, type ZenStackPromise as Z, type JsonObject as a, type JsonValue as b, type ClientContract as c, type ClientOptions as d, definePlugin as e, type TypeDefResult as f, type StringFilter as g, type BytesFilter as h, type BooleanFilter as i, type SortOrder as j, type NullsOrder as k, type WhereUniqueInput as l, type OmitInput as m, type SelectIncludeOmit as n, type SelectInput as o, type Subset as p, type SelectSubset as q, type FindManyArgs as r, type FindFirstArgs as s, type FindUniqueArgs as t, type CreateArgs as u, type CreateManyArgs as v, type CreateManyAndReturnArgs as w, type UpdateManyArgs as x, type UpdateManyAndReturnArgs as y, type UpsertArgs as z };
1516
+ /**
1517
+ * Base for all ZenStack runtime errors.
1518
+ */
1519
+ declare class ZenStackError extends Error {
1520
+ }
1521
+ /**
1522
+ * Error thrown when input validation fails.
1523
+ */
1524
+ declare class InputValidationError extends ZenStackError {
1525
+ constructor(message: string, cause?: unknown);
1526
+ }
1527
+ /**
1528
+ * Error thrown when a query fails.
1529
+ */
1530
+ declare class QueryError extends ZenStackError {
1531
+ constructor(message: string, cause?: unknown);
1532
+ }
1533
+ /**
1534
+ * Error thrown when an internal error occurs.
1535
+ */
1536
+ declare class InternalError extends ZenStackError {
1537
+ }
1538
+ /**
1539
+ * Error thrown when an entity is not found.
1540
+ */
1541
+ declare class NotFoundError extends ZenStackError {
1542
+ constructor(model: string, details?: string);
1543
+ }
1544
+
1545
+ export { type RuntimePlugin as $, type DeleteArgs as A, type BatchResult as B, type ClientConstructor as C, type DateTimeFilter as D, type DeleteManyArgs as E, type FindArgs as F, type CountArgs as G, type CountResult as H, type IncludeInput as I, type JsonArray as J, type AggregateArgs as K, type AggregateResult as L, type ModelResult as M, type NumberFilter as N, type OrderBy as O, type GroupByArgs as P, type GroupByResult as Q, ZenStackError as R, type SimplifiedModelResult as S, type ToKysely as T, type UpdateArgs as U, InputValidationError as V, type WhereInput as W, QueryError as X, InternalError as Y, type ZenStackPromise as Z, NotFoundError as _, type JsonObject as a, type ZModelFunction as a0, type OnKyselyQueryArgs as a1, type JsonValue as b, type ClientContract as c, type ClientOptions as d, definePlugin as e, type TypeDefResult as f, type StringFilter as g, type BytesFilter as h, type BooleanFilter as i, type SortOrder as j, type NullsOrder as k, type WhereUniqueInput as l, type OmitInput as m, type SelectIncludeOmit as n, type SelectInput as o, type Subset as p, type SelectSubset as q, type FindManyArgs as r, type FindFirstArgs as s, type FindUniqueArgs as t, type CreateArgs as u, type CreateManyArgs as v, type CreateManyAndReturnArgs as w, type UpdateManyArgs as x, type UpdateManyAndReturnArgs as y, type UpsertArgs as z };
@@ -787,7 +787,7 @@ type ZModelFunctionContext<Schema extends SchemaDef> = {
787
787
  /**
788
788
  * The CRUD operation being performed
789
789
  */
790
- operation: CRUD;
790
+ operation: CRUD_EXT;
791
791
  };
792
792
  type ZModelFunction<Schema extends SchemaDef> = (eb: ExpressionBuilder<ToKyselySchema<Schema>, keyof ToKyselySchema<Schema>>, args: Expression<any>[], context: ZModelFunctionContext<Schema>) => Expression<unknown>;
793
793
  /**
@@ -999,6 +999,14 @@ type CRUD = 'create' | 'read' | 'update' | 'delete';
999
999
  * CRUD operations.
1000
1000
  */
1001
1001
  declare const CRUD: readonly ["create", "read", "update", "delete"];
1002
+ /**
1003
+ * Extended CRUD operations including 'post-update'.
1004
+ */
1005
+ type CRUD_EXT = CRUD | 'post-update';
1006
+ /**
1007
+ * Extended CRUD operations including 'post-update'.
1008
+ */
1009
+ declare const CRUD_EXT: readonly ["create", "read", "update", "delete", "post-update"];
1002
1010
  type AllModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema>> = {
1003
1011
  /**
1004
1012
  * Returns a list of entities.
@@ -1505,4 +1513,33 @@ type AllModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema
1505
1513
  };
1506
1514
  type ModelOperations<Schema extends SchemaDef, Model extends GetModels<Schema>> = Omit<AllModelOperations<Schema, Model>, IsDelegateModel<Schema, Model> extends true ? 'create' | 'createMany' | 'createManyAndReturn' | 'upsert' : never>;
1507
1515
 
1508
- export { type DeleteArgs as A, type BatchResult as B, type ClientConstructor as C, type DateTimeFilter as D, type DeleteManyArgs as E, type FindArgs as F, type CountArgs as G, type CountResult as H, type IncludeInput as I, type JsonArray as J, type AggregateArgs as K, type AggregateResult as L, type ModelResult as M, type NumberFilter as N, type OrderBy as O, type GroupByArgs as P, type GroupByResult as Q, type RuntimePlugin as R, type SimplifiedModelResult as S, type ToKysely as T, type UpdateArgs as U, type ZModelFunction as V, type WhereInput as W, type OnKyselyQueryArgs as X, type ZenStackPromise as Z, type JsonObject as a, type JsonValue as b, type ClientContract as c, type ClientOptions as d, definePlugin as e, type TypeDefResult as f, type StringFilter as g, type BytesFilter as h, type BooleanFilter as i, type SortOrder as j, type NullsOrder as k, type WhereUniqueInput as l, type OmitInput as m, type SelectIncludeOmit as n, type SelectInput as o, type Subset as p, type SelectSubset as q, type FindManyArgs as r, type FindFirstArgs as s, type FindUniqueArgs as t, type CreateArgs as u, type CreateManyArgs as v, type CreateManyAndReturnArgs as w, type UpdateManyArgs as x, type UpdateManyAndReturnArgs as y, type UpsertArgs as z };
1516
+ /**
1517
+ * Base for all ZenStack runtime errors.
1518
+ */
1519
+ declare class ZenStackError extends Error {
1520
+ }
1521
+ /**
1522
+ * Error thrown when input validation fails.
1523
+ */
1524
+ declare class InputValidationError extends ZenStackError {
1525
+ constructor(message: string, cause?: unknown);
1526
+ }
1527
+ /**
1528
+ * Error thrown when a query fails.
1529
+ */
1530
+ declare class QueryError extends ZenStackError {
1531
+ constructor(message: string, cause?: unknown);
1532
+ }
1533
+ /**
1534
+ * Error thrown when an internal error occurs.
1535
+ */
1536
+ declare class InternalError extends ZenStackError {
1537
+ }
1538
+ /**
1539
+ * Error thrown when an entity is not found.
1540
+ */
1541
+ declare class NotFoundError extends ZenStackError {
1542
+ constructor(model: string, details?: string);
1543
+ }
1544
+
1545
+ export { type RuntimePlugin as $, type DeleteArgs as A, type BatchResult as B, type ClientConstructor as C, type DateTimeFilter as D, type DeleteManyArgs as E, type FindArgs as F, type CountArgs as G, type CountResult as H, type IncludeInput as I, type JsonArray as J, type AggregateArgs as K, type AggregateResult as L, type ModelResult as M, type NumberFilter as N, type OrderBy as O, type GroupByArgs as P, type GroupByResult as Q, ZenStackError as R, type SimplifiedModelResult as S, type ToKysely as T, type UpdateArgs as U, InputValidationError as V, type WhereInput as W, QueryError as X, InternalError as Y, type ZenStackPromise as Z, NotFoundError as _, type JsonObject as a, type ZModelFunction as a0, type OnKyselyQueryArgs as a1, type JsonValue as b, type ClientContract as c, type ClientOptions as d, definePlugin as e, type TypeDefResult as f, type StringFilter as g, type BytesFilter as h, type BooleanFilter as i, type SortOrder as j, type NullsOrder as k, type WhereUniqueInput as l, type OmitInput as m, type SelectIncludeOmit as n, type SelectInput as o, type Subset as p, type SelectSubset as q, type FindManyArgs as r, type FindFirstArgs as s, type FindUniqueArgs as t, type CreateArgs as u, type CreateManyArgs as v, type CreateManyAndReturnArgs as w, type UpdateManyArgs as x, type UpdateManyAndReturnArgs as y, type UpsertArgs as z };