UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 1.65 kB
{"version":3,"file":"user-tenants.mjs","names":[],"sources":["../../../src/libs/repositories/user-tenants.ts"],"sourcesContent":["import z from \"zod\";\nimport type DatabaseAdapter from \"../db/adapter-base.js\";\nimport type { KyselyDB } from \"../db/types.js\";\nimport StaticRepository from \"./parents/static-repository.js\";\n\nexport default class UserTenantsRepository extends StaticRepository<\"lucid_user_tenants\"> {\n\tconstructor(db: KyselyDB, dbAdapter: DatabaseAdapter) {\n\t\tsuper(db, dbAdapter, \"lucid_user_tenants\");\n\t}\n\ttableSchema = z.object({\n\t\tid: z.number(),\n\t\tuser_id: z.number(),\n\t\ttenant_key: z.string(),\n\t\tupdated_at: z.union([z.string(), z.date()]).nullable(),\n\t\tcreated_at: z.union([z.string(), z.date()]).nullable(),\n\t});\n\tcolumnFormats = {\n\t\tid: this.dbAdapter.getDataType(\"primary\"),\n\t\tuser_id: this.dbAdapter.getDataType(\"integer\"),\n\t\ttenant_key: this.dbAdapter.getDataType(\"text\"),\n\t\tupdated_at: this.dbAdapter.getDataType(\"timestamp\"),\n\t\tcreated_at: this.dbAdapter.getDataType(\"timestamp\"),\n\t};\n\tqueryConfig = undefined;\n}\n"],"mappings":"kEAKA,IAAqB,EAArB,cAAmD,CAAuC,CACzF,YAAY,EAAc,EAA4B,CACrD,MAAM,EAAI,EAAW,oBAAoB,CAC1C,CACA,YAAc,EAAE,OAAO,CACtB,GAAI,EAAE,OAAO,EACb,QAAS,EAAE,OAAO,EAClB,WAAY,EAAE,OAAO,EACrB,WAAY,EAAE,MAAM,CAAC,EAAE,OAAO,EAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EACrD,WAAY,EAAE,MAAM,CAAC,EAAE,OAAO,EAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CACtD,CAAC,EACD,cAAgB,CACf,GAAI,KAAK,UAAU,YAAY,SAAS,EACxC,QAAS,KAAK,UAAU,YAAY,SAAS,EAC7C,WAAY,KAAK,UAAU,YAAY,MAAM,EAC7C,WAAY,KAAK,UAAU,YAAY,WAAW,EAClD,WAAY,KAAK,UAAU,YAAY,WAAW,CACnD,EACA,YAAc,IAAA,EACf"}