55
66/* eslint-disable */
77
8- import { type SchemaDef , ExpressionUtils } from "@zenstackhq/schema" ;
8+ import { type SchemaDef , type AttributeApplication , type FieldDefault , ExpressionUtils } from "@zenstackhq/schema" ;
99export class SchemaType implements SchemaDef {
1010 provider = {
1111 type : "sqlite"
@@ -18,14 +18,14 @@ export class SchemaType implements SchemaDef {
1818 name : "id" ,
1919 type : "String" ,
2020 id : true ,
21- attributes : [ { name : "@id" } , { name : "@default" , args : [ { name : "value" , value : ExpressionUtils . call ( "cuid" ) } ] } ] ,
22- default : ExpressionUtils . call ( "cuid" )
21+ attributes : [ { name : "@id" } , { name : "@default" , args : [ { name : "value" , value : ExpressionUtils . call ( "cuid" ) } ] } ] as readonly AttributeApplication [ ] ,
22+ default : ExpressionUtils . call ( "cuid" ) as FieldDefault
2323 } ,
2424 email : {
2525 name : "email" ,
2626 type : "String" ,
2727 unique : true ,
28- attributes : [ { name : "@unique" } ]
28+ attributes : [ { name : "@unique" } ] as readonly AttributeApplication [ ]
2929 } ,
3030 name : {
3131 name : "name" ,
@@ -40,7 +40,7 @@ export class SchemaType implements SchemaDef {
4040 name : "address" ,
4141 type : "Address" ,
4242 optional : true ,
43- attributes : [ { name : "@json" } ]
43+ attributes : [ { name : "@json" } ] as readonly AttributeApplication [ ]
4444 } ,
4545 posts : {
4646 name : "posts" ,
@@ -62,8 +62,8 @@ export class SchemaType implements SchemaDef {
6262 name : "id" ,
6363 type : "String" ,
6464 id : true ,
65- attributes : [ { name : "@id" } , { name : "@default" , args : [ { name : "value" , value : ExpressionUtils . call ( "cuid" ) } ] } ] ,
66- default : ExpressionUtils . call ( "cuid" )
65+ attributes : [ { name : "@id" } , { name : "@default" , args : [ { name : "value" , value : ExpressionUtils . call ( "cuid" ) } ] } ] as readonly AttributeApplication [ ] ,
66+ default : ExpressionUtils . call ( "cuid" ) as FieldDefault
6767 } ,
6868 title : {
6969 name : "title" ,
@@ -73,7 +73,7 @@ export class SchemaType implements SchemaDef {
7373 name : "owner" ,
7474 type : "User" ,
7575 optional : true ,
76- attributes : [ { name : "@relation" , args : [ { name : "fields" , value : ExpressionUtils . array ( "String" , [ ExpressionUtils . field ( "ownerId" ) ] ) } , { name : "references" , value : ExpressionUtils . array ( "String" , [ ExpressionUtils . field ( "id" ) ] ) } ] } ] ,
76+ attributes : [ { name : "@relation" , args : [ { name : "fields" , value : ExpressionUtils . array ( "String" , [ ExpressionUtils . field ( "ownerId" ) ] ) } , { name : "references" , value : ExpressionUtils . array ( "String" , [ ExpressionUtils . field ( "id" ) ] ) } ] } ] as readonly AttributeApplication [ ] ,
7777 relation : { opposite : "posts" , fields : [ "ownerId" ] , references : [ "id" ] }
7878 } ,
7979 ownerId : {
@@ -82,7 +82,7 @@ export class SchemaType implements SchemaDef {
8282 optional : true ,
8383 foreignKeyFor : [
8484 "owner"
85- ]
85+ ] as readonly string [ ]
8686 }
8787 } ,
8888 idFields : [ "id" ] ,
0 commit comments