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.86 kB
{"version":3,"file":"schema.mjs","names":["constants"],"sources":["../../../../../src/libs/collection/builders/brick-builder/schema.ts"],"sourcesContent":["import z from \"zod\";\nimport constants from \"../../../../constants/constants.js\";\nimport { adminCopyInputSchema } from \"../../../i18n/index.js\";\nimport { collectionTableParts } from \"../../helpers/table-parts.js\";\n\n// TODO: merge with brickConfigSchema from schemas/collection-bricks\nconst BrickConfigSchema = z.object({\n\tkey: z\n\t\t.string()\n\t\t.max(constants.db.maxBuilderKeyLength)\n\t\t.refine((val) => !val.includes(constants.db.nameSeparator), {\n\t\t\tmessage: `Brick key cannot contain '${constants.db.nameSeparator}'`,\n\t\t})\n\t\t//* these keys are reserved due to them being used in the table name generation on the same level as the brick key\n\t\t.refine((val) => val !== collectionTableParts.versions, {\n\t\t\tmessage: `Brick key cannot be '${collectionTableParts.versions}'`,\n\t\t})\n\t\t.refine((val) => val !== collectionTableParts.fields, {\n\t\t\tmessage: `Brick key cannot be '${collectionTableParts.fields}'`,\n\t\t}),\n\tdetails: z\n\t\t.object({\n\t\t\tname: adminCopyInputSchema,\n\t\t\tsummary: adminCopyInputSchema.optional(),\n\t\t})\n\t\t.optional(),\n\ttenants: z.array(z.string().min(1)).optional(),\n});\n\nexport default BrickConfigSchema;\n"],"mappings":"yMAMA,MAAM,EAAoB,EAAE,OAAO,CAClC,IAAK,EACH,OAAO,CAAC,CACR,IAAIA,EAAU,GAAG,mBAAmB,CAAC,CACrC,OAAQ,GAAQ,CAAC,EAAI,SAASA,EAAU,GAAG,aAAa,EAAG,CAC3D,QAAS,6BAA6BA,EAAU,GAAG,cAAc,EAClE,CAAC,CAAC,CAED,OAAQ,GAAQ,IAAQ,EAAqB,SAAU,CACvD,QAAS,wBAAwB,EAAqB,SAAS,EAChE,CAAC,CAAC,CACD,OAAQ,GAAQ,IAAQ,EAAqB,OAAQ,CACrD,QAAS,wBAAwB,EAAqB,OAAO,EAC9D,CAAC,EACF,QAAS,EACP,OAAO,CACP,KAAM,EACN,QAAS,EAAqB,SAAS,CACxC,CAAC,CAAC,CACD,SAAS,EACX,QAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAC9C,CAAC"}