@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 2.61 kB
Source Map (JSON)
{"version":3,"file":"options.mjs","names":[],"sources":["../../src/schemas/options.ts"],"sourcesContent":["import z from \"zod\";\n\nexport type LicenseOptionName = z.infer<typeof licenseOptionNameSchema>;\nexport type TenantScopedLicenseOptionName = `${LicenseOptionName}:t:${string}`;\nexport type MediaStorageOptionName = \"media_storage_used\";\nexport type TenantScopedMediaStorageOptionName =\n\t`${MediaStorageOptionName}:t:${string}`;\n\nexport const licenseOptionNameSchema = z.union([\n\tz.literal(\"license_key\"),\n\tz.literal(\"license_key_display\"),\n\tz.literal(\"license_valid\"),\n\tz.literal(\"license_last_checked\"),\n\tz.literal(\"license_error_message\"),\n\tz.literal(\"license_ai_enabled\"),\n]);\n\nexport const tenantScopedLicenseOptionNameSchema =\n\tz.custom<TenantScopedLicenseOptionName>((value) => {\n\t\tif (typeof value !== \"string\") return false;\n\n\t\tconst [name, tenantKey] = value.split(\":t:\");\n\t\tif (name === undefined || tenantKey === undefined) return false;\n\n\t\treturn (\n\t\t\tlicenseOptionNameSchema.safeParse(name).success && tenantKey.length > 0\n\t\t);\n\t});\n\nexport const mediaStorageOptionNameSchema = z.literal(\"media_storage_used\");\n\nexport const tenantScopedMediaStorageOptionNameSchema =\n\tz.custom<TenantScopedMediaStorageOptionName>((value) => {\n\t\tif (typeof value !== \"string\") return false;\n\n\t\tconst [name, tenantKey] = value.split(\":t:\");\n\t\tif (name === undefined || tenantKey === undefined) return false;\n\n\t\treturn (\n\t\t\tmediaStorageOptionNameSchema.safeParse(name).success &&\n\t\t\ttenantKey.length > 0\n\t\t);\n\t});\n\nexport const optionsNameSchema = z.union([\n\tmediaStorageOptionNameSchema,\n\ttenantScopedMediaStorageOptionNameSchema,\n\tz.literal(\"system_alert_email\"),\n\tlicenseOptionNameSchema,\n\ttenantScopedLicenseOptionNameSchema,\n]);\n\nexport type OptionsName = z.infer<typeof optionsNameSchema>;\n"],"mappings":"mBAQA,MAAa,EAA0B,EAAE,MAAM,CAC9C,EAAE,QAAQ,aAAa,EACvB,EAAE,QAAQ,qBAAqB,EAC/B,EAAE,QAAQ,eAAe,EACzB,EAAE,QAAQ,sBAAsB,EAChC,EAAE,QAAQ,uBAAuB,EACjC,EAAE,QAAQ,oBAAoB,CAC/B,CAAC,EAEY,EACZ,EAAE,OAAuC,GAAU,CAClD,GAAI,OAAO,GAAU,SAAU,MAAO,GAEtC,GAAM,CAAC,EAAM,GAAa,EAAM,MAAM,KAAK,EAG3C,OAFI,IAAS,IAAA,IAAa,IAAc,IAAA,GAAkB,GAGzD,EAAwB,UAAU,CAAI,CAAC,CAAC,SAAW,EAAU,OAAS,CAExE,CAAC,EAEW,EAA+B,EAAE,QAAQ,oBAAoB,EAE7D,EACZ,EAAE,OAA4C,GAAU,CACvD,GAAI,OAAO,GAAU,SAAU,MAAO,GAEtC,GAAM,CAAC,EAAM,GAAa,EAAM,MAAM,KAAK,EAG3C,OAFI,IAAS,IAAA,IAAa,IAAc,IAAA,GAAkB,GAGzD,EAA6B,UAAU,CAAI,CAAC,CAAC,SAC7C,EAAU,OAAS,CAErB,CAAC,EAEW,EAAoB,EAAE,MAAM,CACxC,EACA,EACA,EAAE,QAAQ,oBAAoB,EAC9B,EACA,CACD,CAAC"}