@zenstackhq/schema 3.9.7 → 3.10.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 +3 -1
- package/dist/index.d.mts +3 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -152,6 +152,7 @@ type EnumDef = {
|
|
|
152
152
|
type TypeDefDef = {
|
|
153
153
|
name: string;
|
|
154
154
|
strict?: boolean;
|
|
155
|
+
base?: BuiltinType;
|
|
155
156
|
fields: Record<string, FieldDef>;
|
|
156
157
|
attributes?: readonly AttributeApplication[];
|
|
157
158
|
};
|
|
@@ -180,6 +181,7 @@ type RelationFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>
|
|
|
180
181
|
type ModelFieldIsOptional<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['optional'] extends true ? true : false;
|
|
181
182
|
type TypeDefFieldIsOptional<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDefField<Schema, TypeDef, Field>['optional'] extends true ? true : false;
|
|
182
183
|
type TypeDefFieldIsArray<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDefField<Schema, TypeDef, Field>['array'] extends true ? true : false;
|
|
184
|
+
type TypeDefIsPrimitive<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = GetTypeDef<Schema, TypeDef>['base'] extends string ? true : false;
|
|
183
185
|
type FieldIsRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['relation'] extends object ? true : false;
|
|
184
186
|
type FieldIsArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['array'] extends true ? true : false;
|
|
185
187
|
type FieldIsComputed<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['computed'] extends true ? true : false;
|
|
@@ -295,5 +297,5 @@ declare const ExpressionUtils: {
|
|
|
295
297
|
getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
|
|
296
298
|
};
|
|
297
299
|
//#endregion
|
|
298
|
-
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, GetModelDelegateMapValue, 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 };
|
|
300
|
+
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, GetModelDelegateMapValue, 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, TypeDefIsPrimitive, UnaryExpression, UnaryOperator, UniqueFieldsInfo, UpdatedAtInfo };
|
|
299
301
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -152,6 +152,7 @@ type EnumDef = {
|
|
|
152
152
|
type TypeDefDef = {
|
|
153
153
|
name: string;
|
|
154
154
|
strict?: boolean;
|
|
155
|
+
base?: BuiltinType;
|
|
155
156
|
fields: Record<string, FieldDef>;
|
|
156
157
|
attributes?: readonly AttributeApplication[];
|
|
157
158
|
};
|
|
@@ -180,6 +181,7 @@ type RelationFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>
|
|
|
180
181
|
type ModelFieldIsOptional<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['optional'] extends true ? true : false;
|
|
181
182
|
type TypeDefFieldIsOptional<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDefField<Schema, TypeDef, Field>['optional'] extends true ? true : false;
|
|
182
183
|
type TypeDefFieldIsArray<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDefField<Schema, TypeDef, Field>['array'] extends true ? true : false;
|
|
184
|
+
type TypeDefIsPrimitive<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = GetTypeDef<Schema, TypeDef>['base'] extends string ? true : false;
|
|
183
185
|
type FieldIsRelation<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['relation'] extends object ? true : false;
|
|
184
186
|
type FieldIsArray<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['array'] extends true ? true : false;
|
|
185
187
|
type FieldIsComputed<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModelField<Schema, Model, Field>['computed'] extends true ? true : false;
|
|
@@ -295,5 +297,5 @@ declare const ExpressionUtils: {
|
|
|
295
297
|
getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
|
|
296
298
|
};
|
|
297
299
|
//#endregion
|
|
298
|
-
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, GetModelDelegateMapValue, 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 };
|
|
300
|
+
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, GetModelDelegateMapValue, 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, TypeDefIsPrimitive, UnaryExpression, UnaryOperator, UniqueFieldsInfo, UpdatedAtInfo };
|
|
299
301
|
//# sourceMappingURL=index.d.mts.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@zenstackhq/schema",
|
|
3
3
|
"displayName": "ZenStack Schema Object Model",
|
|
4
4
|
"description": "TypeScript representation of ZModel schema",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.10.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "ZenStack Team",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"decimal.js": "^10.4.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@zenstackhq/
|
|
42
|
-
"@zenstackhq/
|
|
43
|
-
"@zenstackhq/
|
|
44
|
-
"@zenstackhq/
|
|
41
|
+
"@zenstackhq/eslint-config": "3.10.0",
|
|
42
|
+
"@zenstackhq/tsdown-config": "3.10.0",
|
|
43
|
+
"@zenstackhq/typescript-config": "3.10.0",
|
|
44
|
+
"@zenstackhq/vitest-config": "3.10.0"
|
|
45
45
|
},
|
|
46
46
|
"funding": "https://github.com/sponsors/zenstackhq",
|
|
47
47
|
"scripts": {
|