@zenstackhq/schema 3.7.0-beta.1 → 3.7.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 +5 -1
- package/dist/index.d.mts +5 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -77,6 +77,7 @@ type ModelDef = {
|
|
|
77
77
|
isDelegate?: boolean;
|
|
78
78
|
subModels?: readonly string[];
|
|
79
79
|
isView?: boolean;
|
|
80
|
+
delegateMap?: string;
|
|
80
81
|
};
|
|
81
82
|
type AttributeApplication = {
|
|
82
83
|
name: string;
|
|
@@ -111,6 +112,8 @@ type FieldDef = {
|
|
|
111
112
|
attributes?: readonly AttributeApplication[];
|
|
112
113
|
default?: FieldDefault;
|
|
113
114
|
omit?: boolean;
|
|
115
|
+
fuzzy?: boolean;
|
|
116
|
+
fullText?: boolean;
|
|
114
117
|
relation?: RelationInfo;
|
|
115
118
|
foreignKeyFor?: readonly string[];
|
|
116
119
|
computed?: boolean;
|
|
@@ -157,6 +160,7 @@ type GetTypeDef<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> =
|
|
|
157
160
|
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 };
|
|
158
161
|
type GetModelField<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModel<Schema, Model>['fields'][Field];
|
|
159
162
|
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 };
|
|
163
|
+
type GetModelDelegateMapValue<Schema extends SchemaDef, Model extends GetModels<Schema>> = Exclude<GetModel<Schema, Model>['delegateMap'], undefined> extends never ? Model : Exclude<GetModel<Schema, Model>['delegateMap'], undefined>;
|
|
160
164
|
type GetModelFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = Schema['models'][Model]['fields'][Field]['type'];
|
|
161
165
|
type GetTypeDefFields<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = Extract<keyof GetTypeDef<Schema, TypeDef>['fields'], string>;
|
|
162
166
|
type GetTypeDefField<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDef<Schema, TypeDef>['fields'][Field];
|
|
@@ -285,5 +289,5 @@ declare const ExpressionUtils: {
|
|
|
285
289
|
getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
|
|
286
290
|
};
|
|
287
291
|
//#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 };
|
|
292
|
+
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 };
|
|
289
293
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,7 @@ type ModelDef = {
|
|
|
77
77
|
isDelegate?: boolean;
|
|
78
78
|
subModels?: readonly string[];
|
|
79
79
|
isView?: boolean;
|
|
80
|
+
delegateMap?: string;
|
|
80
81
|
};
|
|
81
82
|
type AttributeApplication = {
|
|
82
83
|
name: string;
|
|
@@ -111,6 +112,8 @@ type FieldDef = {
|
|
|
111
112
|
attributes?: readonly AttributeApplication[];
|
|
112
113
|
default?: FieldDefault;
|
|
113
114
|
omit?: boolean;
|
|
115
|
+
fuzzy?: boolean;
|
|
116
|
+
fullText?: boolean;
|
|
114
117
|
relation?: RelationInfo;
|
|
115
118
|
foreignKeyFor?: readonly string[];
|
|
116
119
|
computed?: boolean;
|
|
@@ -157,6 +160,7 @@ type GetTypeDef<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> =
|
|
|
157
160
|
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 };
|
|
158
161
|
type GetModelField<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = GetModel<Schema, Model>['fields'][Field];
|
|
159
162
|
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 };
|
|
163
|
+
type GetModelDelegateMapValue<Schema extends SchemaDef, Model extends GetModels<Schema>> = Exclude<GetModel<Schema, Model>['delegateMap'], undefined> extends never ? Model : Exclude<GetModel<Schema, Model>['delegateMap'], undefined>;
|
|
160
164
|
type GetModelFieldType<Schema extends SchemaDef, Model extends GetModels<Schema>, Field extends GetModelFields<Schema, Model>> = Schema['models'][Model]['fields'][Field]['type'];
|
|
161
165
|
type GetTypeDefFields<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>> = Extract<keyof GetTypeDef<Schema, TypeDef>['fields'], string>;
|
|
162
166
|
type GetTypeDefField<Schema extends SchemaDef, TypeDef extends GetTypeDefs<Schema>, Field extends GetTypeDefFields<Schema, TypeDef>> = GetTypeDef<Schema, TypeDef>['fields'][Field];
|
|
@@ -285,5 +289,5 @@ declare const ExpressionUtils: {
|
|
|
285
289
|
getLiteralValue: (expr: Expression) => string | number | boolean | undefined;
|
|
286
290
|
};
|
|
287
291
|
//#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 };
|
|
292
|
+
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 };
|
|
289
293
|
//# 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.7.
|
|
5
|
+
"version": "3.7.1",
|
|
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/eslint-config": "3.7.
|
|
42
|
-
"@zenstackhq/
|
|
43
|
-
"@zenstackhq/
|
|
44
|
-
"@zenstackhq/vitest-config": "3.7.
|
|
41
|
+
"@zenstackhq/eslint-config": "3.7.1",
|
|
42
|
+
"@zenstackhq/tsdown-config": "3.7.1",
|
|
43
|
+
"@zenstackhq/typescript-config": "3.7.1",
|
|
44
|
+
"@zenstackhq/vitest-config": "3.7.1"
|
|
45
45
|
},
|
|
46
46
|
"funding": "https://github.com/sponsors/zenstackhq",
|
|
47
47
|
"scripts": {
|