-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpayload.config.ts
130 lines (126 loc) · 3.77 KB
/
payload.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { s3Storage } from "@payloadcms/storage-s3";
import { vercelBlobStorage } from "@payloadcms/storage-vercel-blob";
import { postgresAdapter } from "@payloadcms/db-postgres";
import { lexicalEditor } from "@payloadcms/richtext-lexical";
import path from "path";
import { buildConfig } from "payload";
import { fileURLToPath } from "url";
import { resendAdapter } from '@payloadcms/email-resend';
import sharp from "sharp";
import { Users } from "./collections/Users";
import { Media } from "./collections/Media";
import { Person } from "./collections/Person";
import { Material } from "./collections/Material";
import { SportsTeam } from "./collections/SportsTeam";
import { Space } from "./collections/Space";
import { Sponsor } from "./collections/Sponsor";
import { Association } from "./collections/Association";
import { StudentGuide } from "./collections/StudentGuide";
import { Link } from "./collections/Link";
import { Position } from "./collections/Position";
import { BoardSection } from "./collections/BoardSection";
import { Product } from "./collections/Product";
import { President } from "./collections/President";
import { Order } from "./collections/Order";
import { Event } from "./collections/Event";
import { DocumentFolder } from "./collections/DocumentFolder";
import { DocFile } from "./collections/DocFile";
import { Video } from "./collections/Video";
//import { Faq } from "./collections/Faq";
import { Place } from "./collections/Place";
import { Testimonal } from "./collections/Testimonial";
import { en } from "@payloadcms/translations/languages/en";
import { pt } from "@payloadcms/translations/languages/pt";
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export default buildConfig({
admin: {
user: Users.slug,
dateFormat: "dd MMMM yyyy",
},
collections: [
Users,
Media,
Person,
Material,
Space,
SportsTeam,
Sponsor,
Association,
StudentGuide,
Link,
Position,
BoardSection,
Product,
President,
Order,
Event,
DocumentFolder,
DocFile,
Video,
//Faq,
Place,
Testimonal,
],
editor: lexicalEditor(),
secret: process.env.PAYLOAD_SECRET || "",
typescript: {
outputFile: path.resolve(dirname, "payload-types.ts"),
},
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URL || "",
},
}),
sharp,
email: resendAdapter({
defaultFromAddress: process.env.RESEND_EMAIL || '',
defaultFromName: 'Payload CMS',
apiKey: process.env.RESEND_API_KEY || '',
}),
plugins: [
s3Storage({
enabled: process.env.STORAGE_METHOD === "r2",
collections: {
media: true,
docfile: true,
studentGuide: true,
video: true
},
bucket: process.env.R2_BUCKET || "",
config: {
endpoint: process.env.R2_ENDPOINT || "",
credentials: {
accessKeyId: process.env.R2_ACCESS_KEY_ID || "",
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY || "",
},
region: "auto",
},
}),
// storage-adapter-placeholder
vercelBlobStorage({
enabled: process.env.STORAGE_METHOD === "blob", // Optional, defaults to true
// Specify which collections should use Vercel Blob
collections: {
media: true,
docfile: true,
studentGuide: true,
video: true
},
// Token provided by Vercel once Blob storage is added to your Vercel project
token: process.env.BLOB_READ_WRITE_TOKEN || "",
}),
],
i18n: {
fallbackLanguage: "pt",
translations: { pt, en },
//@ts-ignore
supportedLanguages: { pt, en },
},
upload: {
limits : {
fileSize: 50000000 // 50 mb
}
}
//livePreview: false, // Lets set it to true if we use pages collection (Globals)
});