@zenstackhq/schema 3.3.0-beta.4 → 3.3.0

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
@@ -124,6 +124,9 @@ type RelationInfo = {
124
124
  onDelete?: CascadeAction;
125
125
  onUpdate?: CascadeAction;
126
126
  };
127
+ type UpdatedAtInfo = {
128
+ ignore?: readonly string[];
129
+ };
127
130
  type FieldDef = {
128
131
  name: string;
129
132
  type: string;
@@ -131,7 +134,7 @@ type FieldDef = {
131
134
  array?: boolean;
132
135
  optional?: boolean;
133
136
  unique?: boolean;
134
- updatedAt?: boolean;
137
+ updatedAt?: boolean | UpdatedAtInfo;
135
138
  attributes?: readonly AttributeApplication[];
136
139
  default?: MappedBuiltinType | Expression | readonly unknown[];
137
140
  omit?: boolean;
@@ -209,7 +212,7 @@ type TypeDefFieldIsArray<Schema extends SchemaDef, TypeDef extends GetTypeDefs<S
209
212
  type FieldIsRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['relation'] extends object ? true : false;
210
213
  type FieldIsArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['array'] extends true ? true : false;
211
214
  type FieldIsComputed<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['computed'] extends true ? true : false;
212
- type FieldHasDefault<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['default'] extends object | number | string | boolean ? true : GetModelField<Schema, Model, Field>['updatedAt'] extends true ? true : GetModelField<Schema, Model, Field>['relation'] extends {
215
+ type FieldHasDefault<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['default'] extends object | number | string | boolean ? true : GetModelField<Schema, Model, Field>['updatedAt'] extends (true | UpdatedAtInfo) ? true : GetModelField<Schema, Model, Field>['relation'] extends {
213
216
  hasDefault: true;
214
217
  } ? true : false;
215
218
  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;
@@ -217,4 +220,4 @@ type IsDelegateModel<Schema extends SchemaDef, Model extends GetModels<Schema>>
217
220
  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;
218
221
  type FieldIsDelegateDiscriminator<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['isDiscriminator'] extends true ? true : false;
219
222
 
220
- 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 FieldExpression, type FieldHasDefault, type FieldIsArray, type FieldIsComputed, type FieldIsDelegateDiscriminator, type FieldIsDelegateRelation, type FieldIsRelation, type FieldIsRelationArray, 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, 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, type SchemaDef, type ThisExpression, type TypeDefDef, type TypeDefFieldIsArray, type TypeDefFieldIsOptional, type UnaryExpression, type UnaryOperator };
223
+ 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 FieldExpression, type FieldHasDefault, type FieldIsArray, type FieldIsComputed, type FieldIsDelegateDiscriminator, type FieldIsDelegateRelation, type FieldIsRelation, type FieldIsRelationArray, 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, 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, type SchemaDef, type ThisExpression, type TypeDefDef, type TypeDefFieldIsArray, type TypeDefFieldIsOptional, type UnaryExpression, type UnaryOperator, type UpdatedAtInfo };
package/dist/index.d.ts CHANGED
@@ -124,6 +124,9 @@ type RelationInfo = {
124
124
  onDelete?: CascadeAction;
125
125
  onUpdate?: CascadeAction;
126
126
  };
127
+ type UpdatedAtInfo = {
128
+ ignore?: readonly string[];
129
+ };
127
130
  type FieldDef = {
128
131
  name: string;
129
132
  type: string;
@@ -131,7 +134,7 @@ type FieldDef = {
131
134
  array?: boolean;
132
135
  optional?: boolean;
133
136
  unique?: boolean;
134
- updatedAt?: boolean;
137
+ updatedAt?: boolean | UpdatedAtInfo;
135
138
  attributes?: readonly AttributeApplication[];
136
139
  default?: MappedBuiltinType | Expression | readonly unknown[];
137
140
  omit?: boolean;
@@ -209,7 +212,7 @@ type TypeDefFieldIsArray<Schema extends SchemaDef, TypeDef extends GetTypeDefs<S
209
212
  type FieldIsRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['relation'] extends object ? true : false;
210
213
  type FieldIsArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['array'] extends true ? true : false;
211
214
  type FieldIsComputed<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['computed'] extends true ? true : false;
212
- type FieldHasDefault<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['default'] extends object | number | string | boolean ? true : GetModelField<Schema, Model, Field>['updatedAt'] extends true ? true : GetModelField<Schema, Model, Field>['relation'] extends {
215
+ type FieldHasDefault<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['default'] extends object | number | string | boolean ? true : GetModelField<Schema, Model, Field>['updatedAt'] extends (true | UpdatedAtInfo) ? true : GetModelField<Schema, Model, Field>['relation'] extends {
213
216
  hasDefault: true;
214
217
  } ? true : false;
215
218
  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;
@@ -217,4 +220,4 @@ type IsDelegateModel<Schema extends SchemaDef, Model extends GetModels<Schema>>
217
220
  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;
218
221
  type FieldIsDelegateDiscriminator<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['isDiscriminator'] extends true ? true : false;
219
222
 
220
- 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 FieldExpression, type FieldHasDefault, type FieldIsArray, type FieldIsComputed, type FieldIsDelegateDiscriminator, type FieldIsDelegateRelation, type FieldIsRelation, type FieldIsRelationArray, 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, 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, type SchemaDef, type ThisExpression, type TypeDefDef, type TypeDefFieldIsArray, type TypeDefFieldIsOptional, type UnaryExpression, type UnaryOperator };
223
+ 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 FieldExpression, type FieldHasDefault, type FieldIsArray, type FieldIsComputed, type FieldIsDelegateDiscriminator, type FieldIsDelegateRelation, type FieldIsRelation, type FieldIsRelationArray, 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, 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, type SchemaDef, type ThisExpression, type TypeDefDef, type TypeDefFieldIsArray, type TypeDefFieldIsOptional, type UnaryExpression, type UnaryOperator, type UpdatedAtInfo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenstackhq/schema",
3
- "version": "3.3.0-beta.4",
3
+ "version": "3.3.0",
4
4
  "description": "ZenStack Runtime Schema",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -25,8 +25,8 @@
25
25
  "decimal.js": "^10.4.3"
26
26
  },
27
27
  "devDependencies": {
28
- "@zenstackhq/eslint-config": "3.3.0-beta.4",
29
- "@zenstackhq/typescript-config": "3.3.0-beta.4"
28
+ "@zenstackhq/eslint-config": "3.3.0",
29
+ "@zenstackhq/typescript-config": "3.3.0"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc --noEmit && tsup-node",