Capital/content/.keystone/config.js.map

8 lines
23 KiB
Plaintext
Raw Normal View History

2024-01-21 16:28:49 +00:00
{
"version": 3,
"sources": ["../keystone.ts", "../schema/index.ts", "../limit.ts", "../schema/assets.ts", "../schema/moments.ts", "../schema/categories.ts", "../schema/projects.ts", "../schema/posts.ts", "../schema/events.ts", "../auth.ts"],
"sourcesContent": ["import { config } from \"@keystone-6/core\";\n\nimport { lists } from \"./schema\";\n\nimport { withAuth, session } from \"./auth\";\nimport { DatabaseProvider } from \"@keystone-6/core/types\";\n\nconst baseUrl = process.env.BASE_URL ?? \"http://localhost:3000\";\nconst databaseUrl =\n process.env.DATABASE_URL ??\n \"postgresql://postgres:password@127.0.0.1:5432/capital\";\nconst databaseProvider = process.env.DATABASE_PROVIDER ?? \"postgresql\";\n\nexport default withAuth(\n config({\n ui: {\n basePath: \"/cms\"\n },\n db: {\n provider: databaseProvider as DatabaseProvider,\n url: databaseUrl,\n },\n server: {\n cors: {\n origin: \"*\",\n methods: \"GET,HEAD,PUT,PATCH,POST,DELETE\",\n },\n },\n storage: {\n localImages: {\n kind: \"local\",\n type: \"image\",\n generateUrl: (path) => `${baseUrl}/images${path}`,\n serverRoute: {\n path: \"/images\",\n },\n storagePath: \"public/images\",\n },\n },\n lists,\n session,\n })\n);\n", "import { list } from \"@keystone-6/core\";\n\nimport {\n text,\n relationship,\n password,\n timestamp,\n checkbox,\n} from \"@keystone-6/core/fields\";\n\nimport { allowAdmin } from \"../limit\";\n\nimport { Image, Asset } from \"./assets\";\nimport { Moment } from \"./moments\";\nimport { Category, Tag } from \"./categories\";\nimport { Project } from \"./projects\";\nimport { Post } from \"./posts\";\nimport { Event } from \"./events\";\n\nexport const lists = {\n User: list({\n access: allowAdmin,\n\n fields: {\n name: text({ validation: { isRequired: true } }),\n email: text({\n validation: { isRequired: true },\n isIndexed: \"unique\",\n }),\n\n password: password({ validation: { isRequired: true } }),\n posts: relationship({ ref: \"Post.author\", many: true }),\n moments: relationship({ ref: \"Moment.author\", many: true }),\n events: relationship({ ref: \"Event.author\", many: true }),\n\n isAdmin: checkbox(),\n isEditor: checkbox(),\n\n createdAt: timestamp({\n defaultValue: { kind: \"now\" },\n }),\n },\n }),\n\n Image,\n Asset,\n\n Post,\n Moment,\n Project,\n Event,\n\n Category,\n Tag,\n};\n", "const isUser = ({ session }: { session: any }) => session?.data.id != null;\nconst allowUser: any = {\n operation: {\n create: isUser,\n update: isUser,\n delete: isUser,\n },\n};\n\nconst isEditor = ({ session }: { session: any }) =>\n session?.data.isEditor || session?.data.isAdmin;\nconst allowEditor: any = {\n operation: {\n create: isEditor,\n update: isEditor,\n delete: isEditor,\n },\n};\n\nconst isAdmin = ({ session }: { session: any }) => session?.data.isAdmin;\nconst allowAdmin: any = {\n operation: {\n create: isAdmin,\n update: isAdmin,\n delete: isAdmin,\n },\n};\n\nexport { isUser, isAdmin, isEditor, allowUser, allowAdmin, allowEditor };\n", "import { image, select, text, timestamp } from \"@keystone-6/core/fields\";\nimport { list } from \"@keystone-6/core\";\n\nimport { allowEditor } from \"../limit\";\n\nexport const Image = list({\n access: allowEditor,\n\n fields: {\n caption: text(),\n image: image({ storage: \"localImages\" }),\n\n createdAt: timestamp({\n defaultValue: { kind: \"now\" },\n }),\n },\n});\n\nexport const Asset = list({\n access: allowEditor,\n\n fields: {\n caption: text(),\n url: text({ validation: { isRequired: true } }),\n type: select({\n type: \"enum\",\n options: [\n { label: \"Video\", value: \"video\" },\n { label: \"Audio\", value: \"audio\" },\n ],\n defaultValue: \"video\",\n db: { map: \"media_type\" },\n validation: { isRequired: true },\n ui: { displayMode: \"select\" },\n }),\n\n createdAt: timestamp({\n defaultValue: { kind: \"now\" },\n }),\n },\n});\n", "import { list } from \"@keystone-6/core\";\nimport { allowUser } from \"../limit\";\nimport { document }
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAAuB;;;ACAvB,IAAAC,eAAqB;AAErB,IAAAC,iBAMO;;;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AAC,iBAAgE;AAChE,IAAAC,eAAqB;AAId,IAAM,cAAU,mBAAK;AAAA,EAC1B,QAAQ;AAAA,IACN,GAAG;AAAA,IAEH,QAAQ;AAAA,MACN,OAAO,CAAC,EAAE,SAAAC,SAAQ,MAA4B;AAC5C,YAAIA,UAAS,KAAK,YAAYA,UAAS,KAAK;AAAS,iBAAO;AAC5D,eAAO,EAAE,aAAa,EAAE,QAAQ,KAAK,EAAE;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,UAAM,6BAAa,EAAE,KAAK,QAAQ,CAAC;AAAA,IACnC,UAAM,qBAAK,EAAE,YAAY,EAAE,YAAY,KAAK,EAAE,CAAC;AAAA,IAC/C,iBAAa,qBAAK;AAAA,IAClB,UAAM,qBAAK;AAAA,IAEX,iBAAa,yBAAS;AAAA,IAEtB,YAAQ,uBAAO;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,QACP,EAAE,OAAO,WAAW,OAAO,UAAU;AAAA,QACrC,EAAE,OAAO,gBAAgB,OAAO,eAAe;AAAA,QAC/C,EAAE,OAAO,aAAa,OAAO,YAAY;AAAA,QACzC,EAAE,OAAO,aAAa,OAAO,YAAY;AAAA,MAC3C;AAAA,MACA,cAAc;AAAA,MACd,IAAI,EAAE,KAAK,iBAAiB;AAAA,MAC5B,YAAY,EAAE,YAAY,KAAK;AAAA,MAC/B,IAAI,EAAE,aAAa,SAAS;AAAA,IAC9B,CAAC;AAAA,IAED,UAAM,6BAAa,EAAE,KAAK,OAAO,CAAC;AAAA,IAElC,eAAW
"names": ["import_core", "import_core", "import_fields", "session", "import_core", "import_fields", "import_core", "import_fields", "import_fields", "import_core", "session", "import_fields", "import_fields_document", "import_core", "session", "import_fields", "import_fields_document", "import_core", "session"]
}