@zenstackhq/schema 3.5.6 → 3.6.1

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/index.d.cts CHANGED
@@ -1,182 +1,170 @@
1
- import Decimal from 'decimal.js';
1
+ import Decimal from "decimal.js";
2
2
 
3
+ //#region src/expression.d.ts
3
4
  type Expression = LiteralExpression | ArrayExpression | FieldExpression | MemberExpression | CallExpression | UnaryExpression | BinaryExpression | BindingExpression | ThisExpression | NullExpression;
4
5
  type LiteralExpression = {
5
- kind: 'literal';
6
- value: string | number | boolean;
6
+ kind: 'literal';
7
+ value: string | number | boolean;
7
8
  };
8
9
  type ArrayExpression = {
9
- kind: 'array';
10
- type: string;
11
- items: Expression[];
10
+ kind: 'array';
11
+ type: string;
12
+ items: Expression[];
12
13
  };
13
14
  type FieldExpression = {
14
- kind: 'field';
15
- field: string;
15
+ kind: 'field';
16
+ field: string;
16
17
  };
17
18
  type MemberExpression = {
18
- kind: 'member';
19
- receiver: Expression;
20
- members: string[];
19
+ kind: 'member';
20
+ receiver: Expression;
21
+ members: string[];
21
22
  };
22
23
  type BindingExpression = {
23
- kind: 'binding';
24
- name: string;
24
+ kind: 'binding';
25
+ name: string;
25
26
  };
26
27
  type UnaryExpression = {
27
- kind: 'unary';
28
- op: UnaryOperator;
29
- operand: Expression;
28
+ kind: 'unary';
29
+ op: UnaryOperator;
30
+ operand: Expression;
30
31
  };
31
32
  type BinaryExpression = {
32
- kind: 'binary';
33
- op: BinaryOperator;
34
- left: Expression;
35
- right: Expression;
36
- binding?: string;
33
+ kind: 'binary';
34
+ op: BinaryOperator;
35
+ left: Expression;
36
+ right: Expression;
37
+ binding?: string;
37
38
  };
38
39
  type CallExpression = {
39
- kind: 'call';
40
- function: string;
41
- args?: Expression[];
40
+ kind: 'call';
41
+ function: string;
42
+ args?: Expression[];
42
43
  };
43
44
  type ThisExpression = {
44
- kind: 'this';
45
+ kind: 'this';
45
46
  };
46
47
  type NullExpression = {
47
- kind: 'null';
48
+ kind: 'null';
48
49
  };
49
50
  type UnaryOperator = '!';
50
51
  type BinaryOperator = '&&' | '||' | '==' | '!=' | '<' | '<=' | '>' | '>=' | '?' | '!' | '^' | 'in';
51
-
52
+ //#endregion
53
+ //#region src/schema.d.ts
52
54
  type DataSourceProviderType = 'sqlite' | 'postgresql' | 'mysql';
53
55
  type DataSourceProvider = {
54
- type: DataSourceProviderType;
55
- defaultSchema?: string;
56
+ type: DataSourceProviderType;
57
+ defaultSchema?: string;
56
58
  };
57
59
  type SchemaDef = {
58
- provider: DataSourceProvider;
59
- models: Record<string, ModelDef>;
60
- enums?: Record<string, EnumDef>;
61
- typeDefs?: Record<string, TypeDefDef>;
62
- plugins: Record<string, unknown>;
63
- procedures?: Record<string, ProcedureDef>;
64
- authType?: GetModels<SchemaDef> | GetTypeDefs<SchemaDef>;
60
+ provider: DataSourceProvider;
61
+ models: Record<string, ModelDef>;
62
+ enums?: Record<string, EnumDef>;
63
+ typeDefs?: Record<string, TypeDefDef>;
64
+ plugins: Record<string, unknown>;
65
+ procedures?: Record<string, ProcedureDef>;
66
+ authType?: GetModels<SchemaDef> | GetTypeDefs<SchemaDef>;
65
67
  };
66
68
  type UniqueFieldsInfo = Pick<FieldDef, 'type'> | Record<string, Pick<FieldDef, 'type'>>;
67
69
  type ModelDef = {
68
- name: string;
69
- baseModel?: string;
70
- fields: Record<string, FieldDef>;
71
- attributes?: readonly AttributeApplication[];
72
- uniqueFields: Record<string, UniqueFieldsInfo>;
73
- idFields: readonly string[];
74
- computedFields?: Record<string, Function>;
75
- isDelegate?: boolean;
76
- subModels?: readonly string[];
77
- isView?: boolean;
70
+ name: string;
71
+ baseModel?: string;
72
+ fields: Record<string, FieldDef>;
73
+ attributes?: readonly AttributeApplication[];
74
+ uniqueFields: Record<string, UniqueFieldsInfo>;
75
+ idFields: readonly string[];
76
+ computedFields?: Record<string, Function>;
77
+ isDelegate?: boolean;
78
+ subModels?: readonly string[];
79
+ isView?: boolean;
78
80
  };
79
81
  type AttributeApplication = {
80
- name: string;
81
- args?: readonly AttributeArg[];
82
+ name: string;
83
+ args?: readonly AttributeArg[];
82
84
  };
83
85
  type AttributeArg = {
84
- name?: string;
85
- value: Expression;
86
+ name?: string;
87
+ value: Expression;
86
88
  };
87
89
  type CascadeAction = 'SetNull' | 'Cascade' | 'Restrict' | 'NoAction' | 'SetDefault';
88
90
  type RelationInfo = {
89
- name?: string;
90
- fields?: readonly string[];
91
- references?: readonly string[];
92
- hasDefault?: boolean;
93
- opposite?: string;
94
- onDelete?: CascadeAction;
95
- onUpdate?: CascadeAction;
91
+ name?: string;
92
+ fields?: readonly string[];
93
+ references?: readonly string[];
94
+ hasDefault?: boolean;
95
+ opposite?: string;
96
+ onDelete?: CascadeAction;
97
+ onUpdate?: CascadeAction;
96
98
  };
97
99
  type UpdatedAtInfo = {
98
- ignore?: readonly string[];
100
+ ignore?: readonly string[];
99
101
  };
100
102
  type FieldDefault = MappedBuiltinType | Expression | readonly unknown[];
101
103
  type FieldDef = {
102
- name: string;
103
- type: string;
104
- id?: boolean;
105
- array?: boolean;
106
- optional?: boolean;
107
- unique?: boolean;
108
- updatedAt?: boolean | UpdatedAtInfo;
109
- attributes?: readonly AttributeApplication[];
110
- default?: FieldDefault;
111
- omit?: boolean;
112
- relation?: RelationInfo;
113
- foreignKeyFor?: readonly string[];
114
- computed?: boolean;
115
- originModel?: string;
116
- isDiscriminator?: boolean;
104
+ name: string;
105
+ type: string;
106
+ id?: boolean;
107
+ array?: boolean;
108
+ optional?: boolean;
109
+ unique?: boolean;
110
+ updatedAt?: boolean | UpdatedAtInfo;
111
+ attributes?: readonly AttributeApplication[];
112
+ default?: FieldDefault;
113
+ omit?: boolean;
114
+ relation?: RelationInfo;
115
+ foreignKeyFor?: readonly string[];
116
+ computed?: boolean;
117
+ originModel?: string;
118
+ isDiscriminator?: boolean;
117
119
  };
118
120
  type ProcedureParam = {
119
- name: string;
120
- type: string;
121
- array?: boolean;
122
- optional?: boolean;
121
+ name: string;
122
+ type: string;
123
+ array?: boolean;
124
+ optional?: boolean;
123
125
  };
124
126
  type ProcedureDef = {
125
- params: Record<string, ProcedureParam>;
126
- returnType: string;
127
- returnArray?: boolean;
128
- mutation?: boolean;
127
+ params: Record<string, ProcedureParam>;
128
+ returnType: string;
129
+ returnArray?: boolean;
130
+ mutation?: boolean;
129
131
  };
130
132
  type BuiltinType = 'String' | 'Boolean' | 'Int' | 'Float' | 'BigInt' | 'Decimal' | 'DateTime' | 'Bytes' | 'Json' | 'Unsupported';
131
133
  type MappedBuiltinType = string | boolean | number | bigint | Decimal | Date;
132
134
  type EnumField = {
133
- name: string;
134
- attributes?: readonly AttributeApplication[];
135
+ name: string;
136
+ attributes?: readonly AttributeApplication[];
135
137
  };
136
138
  type EnumDef = {
137
- name: string;
138
- fields?: Record<string, EnumField>;
139
- values: Record<string, string>;
140
- attributes?: readonly AttributeApplication[];
139
+ name: string;
140
+ fields?: Record<string, EnumField>;
141
+ values: Record<string, string>;
142
+ attributes?: readonly AttributeApplication[];
141
143
  };
142
144
  type TypeDefDef = {
143
- name: string;
144
- fields: Record<string, FieldDef>;
145
- attributes?: readonly AttributeApplication[];
145
+ name: string;
146
+ fields: Record<string, FieldDef>;
147
+ attributes?: readonly AttributeApplication[];
146
148
  };
147
149
  type GetModels<Schema extends SchemaDef> = Extract<keyof Schema['models'], string>;
148
- type GetDelegateModels<Schema extends SchemaDef> = keyof {
149
- [Key in GetModels<Schema> as Schema['models'][Key]['isDelegate'] extends true ? Key : never]: true;
150
- };
150
+ type GetDelegateModels<Schema extends SchemaDef> = keyof { [Key in GetModels<Schema> as Schema['models'][Key]['isDelegate'] extends true ? Key : never]: true };
151
151
  type GetSubModels<Schema extends SchemaDef, Model extends GetModels<Schema>> = GetModel<Schema, Model>['subModels'] extends readonly string[] ? Extract<GetModel<Schema, Model>['subModels'][number], GetModels<Schema>> : never;
152
152
  type GetModel<Schema extends SchemaDef, Model extends GetModels<Schema>> = Schema['models'][Model];
153
153
  type GetEnums<Schema extends SchemaDef> = Extract<keyof Schema['enums'], string>;
154
154
  type GetEnum<Schema extends SchemaDef, Enum extends GetEnums<Schema>> = Schema['enums'][Enum] extends EnumDef ? Schema['enums'][Enum]['values'] : never;
155
155
  type GetTypeDefs<Schema extends SchemaDef> = Extract<keyof Schema['typeDefs'], string>;
156
156
  type GetTypeDef<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = Schema['typeDefs'] extends Record<string, unknown> ? Schema['typeDefs'][TypeDef] : never;
157
- type GetModelFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
158
- [Key in Extract<keyof GetModel<Schema, Model>['fields'], string> as FieldIsUnsupported<Schema, Model, Key> extends true ? never : Key]: never;
159
- };
157
+ type GetModelFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in Extract<keyof GetModel<Schema, Model>['fields'], string> as FieldIsUnsupported<Schema, Model, Key> extends true ? never : Key]: never };
160
158
  type GetModelField<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModel<Schema, Model>['fields'][Field];
161
- type GetModelDiscriminator<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
162
- [Key in GetModelFields<Schema, Model> as FieldIsDelegateDiscriminator<Schema, Model, Key> extends true ? GetModelField<Schema, Model, Key>['originModel'] extends string ? never : Key : never]: true;
163
- };
159
+ type GetModelDiscriminator<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in GetModelFields<Schema, Model> as FieldIsDelegateDiscriminator<Schema, Model, Key> extends true ? GetModelField<Schema, Model, Key>['originModel'] extends string ? never : Key : never]: true };
164
160
  type GetModelFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = Schema['models'][Model]['fields'][Field]['type'];
165
161
  type GetTypeDefFields<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = Extract<keyof GetTypeDef<Schema, TypeDef>['fields'], string>;
166
162
  type GetTypeDefField<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDef<Schema, TypeDef>['fields'][Field];
167
163
  type GetTypeDefFieldType<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDef<Schema, TypeDef>['fields'][Field]['type'];
168
- type ScalarFields<Schema extends SchemaDef, Model extends GetModels<Schema>, IncludeComputed extends boolean = true> = keyof {
169
- [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? never : GetModelField<Schema, Model, Key>['foreignKeyFor'] extends readonly string[] ? never : IncludeComputed extends true ? Key : FieldIsComputed<Schema, Model, Key> extends true ? never : Key]: Key;
170
- };
171
- type ForeignKeyFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
172
- [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['foreignKeyFor'] extends readonly string[] ? Key : never]: Key;
173
- };
174
- type NonRelationFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
175
- [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? never : Key]: Key;
176
- };
177
- type RelationFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof {
178
- [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? Key : never]: Key;
179
- };
164
+ type ScalarFields<Schema extends SchemaDef, Model extends GetModels<Schema>, IncludeComputed extends boolean = true> = keyof { [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? never : GetModelField<Schema, Model, Key>['foreignKeyFor'] extends readonly string[] ? never : IncludeComputed extends true ? Key : FieldIsComputed<Schema, Model, Key> extends true ? never : Key]: Key };
165
+ type ForeignKeyFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['foreignKeyFor'] extends readonly string[] ? Key : never]: Key };
166
+ type NonRelationFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? never : Key]: Key };
167
+ type RelationFields<Schema extends SchemaDef, Model extends GetModels<Schema>> = keyof { [Key in GetModelFields<Schema, Model> as GetModelField<Schema, Model, Key>['relation'] extends object ? Key : never]: Key };
180
168
  type FieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['type'];
181
169
  type RelationFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends RelationFields<Schema, Model>> = GetModelField<Schema, Model, Field>['type'] extends GetModels<Schema> ? GetModelField<Schema, Model, Field>['type'] : never;
182
170
  type ModelFieldIsOptional<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['optional'] extends true ? true : false;
@@ -187,112 +175,115 @@ type FieldIsArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Fie
187
175
  type FieldIsComputed<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['computed'] extends true ? true : false;
188
176
  type FieldIsUnsupported<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends string> = Field extends keyof GetModel<Schema, Model>['fields'] ? GetModel<Schema, Model>['fields'][Field]['type'] extends 'Unsupported' ? true : false : never;
189
177
  type FieldHasDefault<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = 'default' extends keyof GetModelField<Schema, Model, Field> ? true : GetModelField<Schema, Model, Field>['updatedAt'] extends true | UpdatedAtInfo ? true : GetModelField<Schema, Model, Field>['relation'] extends {
190
- hasDefault: true;
178
+ hasDefault: true;
191
179
  } ? true : false;
192
180
  type FieldIsRelationArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = FieldIsRelation<Schema, Model, Field> extends true ? FieldIsArray<Schema, Model, Field> : false;
193
181
  type IsDelegateModel<Schema extends SchemaDef, Model extends GetModels<Schema>> = Schema['models'][Model]['isDelegate'] extends true ? true : false;
194
182
  type FieldIsDelegateRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends RelationFields<Schema, Model>> = GetModelFieldType<Schema, Model, Field> extends GetModels<Schema> ? IsDelegateModel<Schema, GetModelFieldType<Schema, Model, Field>> : false;
195
183
  type FieldIsDelegateDiscriminator<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['isDiscriminator'] extends true ? true : false;
196
-
184
+ //#endregion
185
+ //#region src/accessor.d.ts
197
186
  type Accessors = {
198
- /**
199
- * The data source provider type of the schema, e.g. "sqlite", "postgresql", etc.
200
- */
201
- get providerType(): DataSourceProviderType;
202
- /**
203
- * Gets a model definition by name. Returns `undefined` if the model is not found.
204
- */
205
- getModel(name: string): ModelDef | undefined;
206
- /**
207
- * Gets a model definition by name. Throws an error if the model is not found.
208
- */
209
- requireModel(name: string): ModelDef;
210
- /**
211
- * Gets a field definition by model/type and field name. Returns `undefined` if the field is not found.
212
- */
213
- getField(modelOrType: string, field: string): FieldDef | undefined;
214
- /**
215
- * Gets a field definition by model/type and field name. Throws an error if the field is not found.
216
- */
217
- requireField(modelOrType: string, field: string): FieldDef;
218
- /***
219
- * Gets an enum definition by name. Returns `undefined` if the enum is not found.
220
- */
221
- getEnum(name: string): EnumDef | undefined;
222
- /**
223
- * Gets an enum definition by name. Throws an error if the enum is not found.
224
- */
225
- requireEnum(name: string): EnumDef;
226
- /**
227
- * Gets a type definition by name. Returns `undefined` if the type definition is not found.
228
- * @param name
229
- */
230
- getTypeDef(name: string): TypeDefDef | undefined;
231
- /**
232
- * Gets a type definition by name. Throws an error if the type definition is not found.
233
- */
234
- requireTypeDef(name: string): TypeDefDef;
235
- /**
236
- * Gets a procedure definition by name. Returns `undefined` if the procedure is not found.
237
- */
238
- getProcedure(name: string): ProcedureDef | undefined;
239
- /**
240
- * Gets a procedure definition by name. Throws an error if the procedure is not found.
241
- */
242
- requireProcedure(name: string): ProcedureDef;
243
- /**
244
- * Gets the unique fields of a model, including both singular and compound unique fields.
245
- */
246
- getUniqueFields(model: string): Array<{
247
- name: string;
248
- def: FieldDef;
249
- } | {
250
- name: string;
251
- defs: Record<string, FieldDef>;
252
- }>;
253
- /**
254
- * Gets the delegate discriminator field for a model, if defined via `@@delegate` attribute. Returns `undefined` if not available.
255
- */
256
- getDelegateDiscriminator(model: string): string | undefined;
187
+ /**
188
+ * The data source provider type of the schema, e.g. "sqlite", "postgresql", etc.
189
+ */
190
+ get providerType(): DataSourceProviderType;
191
+ /**
192
+ * Gets a model definition by name. Returns `undefined` if the model is not found.
193
+ */
194
+ getModel(name: string): ModelDef | undefined;
195
+ /**
196
+ * Gets a model definition by name. Throws an error if the model is not found.
197
+ */
198
+ requireModel(name: string): ModelDef;
199
+ /**
200
+ * Gets a field definition by model/type and field name. Returns `undefined` if the field is not found.
201
+ */
202
+ getField(modelOrType: string, field: string): FieldDef | undefined;
203
+ /**
204
+ * Gets a field definition by model/type and field name. Throws an error if the field is not found.
205
+ */
206
+ requireField(modelOrType: string, field: string): FieldDef;
207
+ /***
208
+ * Gets an enum definition by name. Returns `undefined` if the enum is not found.
209
+ */
210
+ getEnum(name: string): EnumDef | undefined;
211
+ /**
212
+ * Gets an enum definition by name. Throws an error if the enum is not found.
213
+ */
214
+ requireEnum(name: string): EnumDef;
215
+ /**
216
+ * Gets a type definition by name. Returns `undefined` if the type definition is not found.
217
+ * @param name
218
+ */
219
+ getTypeDef(name: string): TypeDefDef | undefined;
220
+ /**
221
+ * Gets a type definition by name. Throws an error if the type definition is not found.
222
+ */
223
+ requireTypeDef(name: string): TypeDefDef;
224
+ /**
225
+ * Gets a procedure definition by name. Returns `undefined` if the procedure is not found.
226
+ */
227
+ getProcedure(name: string): ProcedureDef | undefined;
228
+ /**
229
+ * Gets a procedure definition by name. Throws an error if the procedure is not found.
230
+ */
231
+ requireProcedure(name: string): ProcedureDef;
232
+ /**
233
+ * Gets the unique fields of a model, including both singular and compound unique fields.
234
+ */
235
+ getUniqueFields(model: string): Array<{
236
+ name: string;
237
+ def: FieldDef;
238
+ } | {
239
+ name: string;
240
+ defs: Record<string, FieldDef>;
241
+ }>;
242
+ /**
243
+ * Gets the delegate discriminator field for a model, if defined via `@@delegate` attribute. Returns `undefined` if not available.
244
+ */
245
+ getDelegateDiscriminator(model: string): string | undefined;
257
246
  };
258
247
  declare class InvalidSchemaError extends Error {
259
- constructor(message: string);
248
+ constructor(message: string);
260
249
  }
250
+ type SchemaAccessor<Schema extends SchemaDef> = Schema & Accessors;
261
251
  interface SchemaAccessorConstructor {
262
- new <Schema extends SchemaDef>(schema: Schema): SchemaAccessor<Schema>;
252
+ new <Schema extends SchemaDef>(schema: Schema): SchemaAccessor<Schema>;
263
253
  }
264
- type SchemaAccessor<Schema extends SchemaDef> = Schema & Accessors;
265
254
  declare const SchemaAccessor: SchemaAccessorConstructor;
266
-
255
+ //#endregion
256
+ //#region src/expression-utils.d.ts
267
257
  /**
268
258
  * Utility functions to create and work with Expression objects
269
259
  */
270
260
  declare const ExpressionUtils: {
271
- literal: (value: string | number | boolean) => LiteralExpression;
272
- array: (type: string, items: Expression[]) => ArrayExpression;
273
- call: (functionName: string, args?: Expression[]) => CallExpression;
274
- binary: (left: Expression, op: BinaryOperator, right: Expression, binding?: string) => BinaryExpression;
275
- unary: (op: UnaryOperator, operand: Expression) => UnaryExpression;
276
- field: (field: string) => FieldExpression;
277
- member: (receiver: Expression, members: string[]) => MemberExpression;
278
- binding: (name: string) => BindingExpression;
279
- _this: () => ThisExpression;
280
- _null: () => NullExpression;
281
- and: (expr: Expression, ...expressions: Expression[]) => Expression;
282
- or: (expr: Expression, ...expressions: Expression[]) => Expression;
283
- not: (expr: Expression) => UnaryExpression;
284
- is: (value: unknown, kind: Expression["kind"]) => value is Expression;
285
- isLiteral: (value: unknown) => value is LiteralExpression;
286
- isArray: (value: unknown) => value is ArrayExpression;
287
- isCall: (value: unknown) => value is CallExpression;
288
- isNull: (value: unknown) => value is NullExpression;
289
- isThis: (value: unknown) => value is ThisExpression;
290
- isUnary: (value: unknown) => value is UnaryExpression;
291
- isBinary: (value: unknown) => value is BinaryExpression;
292
- isField: (value: unknown) => value is FieldExpression;
293
- isMember: (value: unknown) => value is MemberExpression;
294
- isBinding: (value: unknown) => value is BindingExpression;
295
- getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
296
- };
297
-
298
- export { type ArrayExpression, type AttributeApplication, type AttributeArg, type BinaryExpression, type BinaryOperator, type BindingExpression, type BuiltinType, type CallExpression, type CascadeAction, type DataSourceProvider, type DataSourceProviderType, type EnumDef, type EnumField, type Expression, ExpressionUtils, type FieldDef, type FieldDefault, type FieldExpression, type FieldHasDefault, type FieldIsArray, type FieldIsComputed, type FieldIsDelegateDiscriminator, type FieldIsDelegateRelation, type FieldIsRelation, type FieldIsRelationArray, type FieldIsUnsupported, type FieldType, type ForeignKeyFields, type GetDelegateModels, type GetEnum, type GetEnums, type GetModel, type GetModelDiscriminator, type GetModelField, type GetModelFieldType, type GetModelFields, type GetModels, type GetSubModels, type GetTypeDef, type GetTypeDefField, type GetTypeDefFieldType, type GetTypeDefFields, type GetTypeDefs, InvalidSchemaError, type IsDelegateModel, type LiteralExpression, type MappedBuiltinType, type MemberExpression, type ModelDef, type ModelFieldIsOptional, type NonRelationFields, type NullExpression, type ProcedureDef, type ProcedureParam, type RelationFieldType, type RelationFields, type RelationInfo, type ScalarFields, SchemaAccessor, type SchemaDef, type ThisExpression, type TypeDefDef, type TypeDefFieldIsArray, type TypeDefFieldIsOptional, type UnaryExpression, type UnaryOperator, type UniqueFieldsInfo, type UpdatedAtInfo };
261
+ literal: (value: string | number | boolean) => LiteralExpression;
262
+ array: (type: string, items: Expression[]) => ArrayExpression;
263
+ call: (functionName: string, args?: Expression[]) => CallExpression;
264
+ binary: (left: Expression, op: BinaryOperator, right: Expression, binding?: string) => BinaryExpression;
265
+ unary: (op: UnaryOperator, operand: Expression) => UnaryExpression;
266
+ field: (field: string) => FieldExpression;
267
+ member: (receiver: Expression, members: string[]) => MemberExpression;
268
+ binding: (name: string) => BindingExpression;
269
+ _this: () => ThisExpression;
270
+ _null: () => NullExpression;
271
+ and: (expr: Expression, ...expressions: Expression[]) => Expression;
272
+ or: (expr: Expression, ...expressions: Expression[]) => Expression;
273
+ not: (expr: Expression) => UnaryExpression;
274
+ is: (value: unknown, kind: Expression["kind"]) => value is Expression;
275
+ isLiteral: (value: unknown) => value is LiteralExpression;
276
+ isArray: (value: unknown) => value is ArrayExpression;
277
+ isCall: (value: unknown) => value is CallExpression;
278
+ isNull: (value: unknown) => value is NullExpression;
279
+ isThis: (value: unknown) => value is ThisExpression;
280
+ isUnary: (value: unknown) => value is UnaryExpression;
281
+ isBinary: (value: unknown) => value is BinaryExpression;
282
+ isField: (value: unknown) => value is FieldExpression;
283
+ isMember: (value: unknown) => value is MemberExpression;
284
+ isBinding: (value: unknown) => value is BindingExpression;
285
+ getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
286
+ };
287
+ //#endregion
288
+ export { ArrayExpression, AttributeApplication, AttributeArg, BinaryExpression, BinaryOperator, BindingExpression, BuiltinType, CallExpression, CascadeAction, DataSourceProvider, DataSourceProviderType, EnumDef, EnumField, Expression, ExpressionUtils, FieldDef, FieldDefault, FieldExpression, FieldHasDefault, FieldIsArray, FieldIsComputed, FieldIsDelegateDiscriminator, FieldIsDelegateRelation, FieldIsRelation, FieldIsRelationArray, FieldIsUnsupported, FieldType, ForeignKeyFields, GetDelegateModels, GetEnum, GetEnums, GetModel, GetModelDiscriminator, GetModelField, GetModelFieldType, GetModelFields, GetModels, GetSubModels, GetTypeDef, GetTypeDefField, GetTypeDefFieldType, GetTypeDefFields, GetTypeDefs, InvalidSchemaError, IsDelegateModel, LiteralExpression, MappedBuiltinType, MemberExpression, ModelDef, ModelFieldIsOptional, NonRelationFields, NullExpression, ProcedureDef, ProcedureParam, RelationFieldType, RelationFields, RelationInfo, ScalarFields, SchemaAccessor, SchemaDef, ThisExpression, TypeDefDef, TypeDefFieldIsArray, TypeDefFieldIsOptional, UnaryExpression, UnaryOperator, UniqueFieldsInfo, UpdatedAtInfo };
289
+ //# sourceMappingURL=index.d.cts.map