UNPKG

@lucidcms/core

Version:

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

1 lines 2.22 kB
{"version":3,"file":"alerts.mjs","names":[],"sources":["../../../src/libs/repositories/alerts.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 AlertsRepository extends StaticRepository<\"lucid_alerts\"> {\n\tconstructor(db: KyselyDB, dbAdapter: DatabaseAdapter) {\n\t\tsuper(db, dbAdapter, \"lucid_alerts\");\n\t}\n\ttableSchema = z.object({\n\t\tid: z.number(),\n\t\ttype: z.enum([\"storage\", \"publish-request\"]),\n\t\tlevel: z.enum([\"info\", \"warning\", \"error\", \"critical\"]),\n\t\tdedupe_key: z.string(),\n\t\ttitle: z.string(),\n\t\tmessage: z.string(),\n\t\tmetadata: z.record(z.string(), z.unknown()),\n\t\temail_id: z.number().nullable(),\n\t\tcreated_at: z.union([z.string(), z.date()]),\n\t});\n\tcolumnFormats = {\n\t\tid: this.dbAdapter.getDataType(\"primary\"),\n\t\ttype: this.dbAdapter.getDataType(\"text\"),\n\t\tlevel: this.dbAdapter.getDataType(\"text\"),\n\t\tdedupe_key: this.dbAdapter.getDataType(\"text\"),\n\t\ttitle: this.dbAdapter.getDataType(\"text\"),\n\t\tmessage: this.dbAdapter.getDataType(\"text\"),\n\t\tmetadata: this.dbAdapter.getDataType(\"json\"),\n\t\temail_id: this.dbAdapter.getDataType(\"integer\"),\n\t\tcreated_at: this.dbAdapter.getDataType(\"timestamp\"),\n\t};\n\tqueryConfig = undefined;\n}\n"],"mappings":"kEAKA,IAAqB,EAArB,cAA8C,CAAiC,CAC9E,YAAY,EAAc,EAA4B,CACrD,MAAM,EAAI,EAAW,cAAc,CACpC,CACA,YAAc,EAAE,OAAO,CACtB,GAAI,EAAE,OAAO,EACb,KAAM,EAAE,KAAK,CAAC,UAAW,iBAAiB,CAAC,EAC3C,MAAO,EAAE,KAAK,CAAC,OAAQ,UAAW,QAAS,UAAU,CAAC,EACtD,WAAY,EAAE,OAAO,EACrB,MAAO,EAAE,OAAO,EAChB,QAAS,EAAE,OAAO,EAClB,SAAU,EAAE,OAAO,EAAE,OAAO,EAAG,EAAE,QAAQ,CAAC,EAC1C,SAAU,EAAE,OAAO,CAAC,CAAC,SAAS,EAC9B,WAAY,EAAE,MAAM,CAAC,EAAE,OAAO,EAAG,EAAE,KAAK,CAAC,CAAC,CAC3C,CAAC,EACD,cAAgB,CACf,GAAI,KAAK,UAAU,YAAY,SAAS,EACxC,KAAM,KAAK,UAAU,YAAY,MAAM,EACvC,MAAO,KAAK,UAAU,YAAY,MAAM,EACxC,WAAY,KAAK,UAAU,YAAY,MAAM,EAC7C,MAAO,KAAK,UAAU,YAAY,MAAM,EACxC,QAAS,KAAK,UAAU,YAAY,MAAM,EAC1C,SAAU,KAAK,UAAU,YAAY,MAAM,EAC3C,SAAU,KAAK,UAAU,YAAY,SAAS,EAC9C,WAAY,KAAK,UAAU,YAAY,WAAW,CACnD,EACA,YAAc,IAAA,EACf"}