create-payload-app 4.0.0-internal.5f0cd13 → 4.0.0-internal.a0ef1b8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/template/src/app/(frontend)/page.tsx +5 -2
- package/dist/template/src/app/(payload)/admin/importMap.js +17 -2
- package/dist/template/src/collections/Folders.ts +16 -0
- package/dist/template/src/collections/Media.ts +4 -0
- package/dist/template/src/collections/Tags.ts +16 -0
- package/dist/template/src/collections/Users.ts +1 -0
- package/dist/template/src/payload-types.ts +171 -11
- package/dist/template/src/payload.config.ts +10 -2
- package/package.json +1 -1
|
@@ -27,8 +27,11 @@ export default async function HomePage() {
|
|
|
27
27
|
width={65}
|
|
28
28
|
/>
|
|
29
29
|
</picture>
|
|
30
|
-
{!user
|
|
31
|
-
|
|
30
|
+
{!user || !('email' in user) ? (
|
|
31
|
+
<h1>Welcome to your new project.</h1>
|
|
32
|
+
) : (
|
|
33
|
+
<h1>Welcome back, {user.email}</h1>
|
|
34
|
+
)}
|
|
32
35
|
<div className="links">
|
|
33
36
|
<a
|
|
34
37
|
className="admin"
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NullField as NullField_3817bf644402e67bfe6577f60ef982de } from '@payloadcms/ui'
|
|
2
|
+
import { HierarchyField as HierarchyField_ab83ff7e88da8d3530831f296ec4756a } from '@payloadcms/ui/rsc'
|
|
3
|
+
import { HierarchyButton as HierarchyButton_ab83ff7e88da8d3530831f296ec4756a } from '@payloadcms/ui/rsc'
|
|
4
|
+
import { AccessField as AccessField_210e1789eef737e0b4d9f054258f19bb } from '@payloadcms/plugin-mcp/client'
|
|
5
|
+
import { FolderIcon as FolderIcon_3817bf644402e67bfe6577f60ef982de } from '@payloadcms/ui'
|
|
6
|
+
import { HierarchySidebarTabServer as HierarchySidebarTabServer_ab83ff7e88da8d3530831f296ec4756a } from '@payloadcms/ui/rsc'
|
|
7
|
+
import { TagIcon as TagIcon_3817bf644402e67bfe6577f60ef982de } from '@payloadcms/ui'
|
|
8
|
+
import { CollectionCards as CollectionCards_ab83ff7e88da8d3530831f296ec4756a } from '@payloadcms/ui/rsc'
|
|
2
9
|
|
|
3
10
|
/** @type import('payload').ImportMap */
|
|
4
11
|
export const importMap = {
|
|
5
|
-
'@payloadcms/
|
|
12
|
+
'@payloadcms/ui#NullField': NullField_3817bf644402e67bfe6577f60ef982de,
|
|
13
|
+
'@payloadcms/ui/rsc#HierarchyField': HierarchyField_ab83ff7e88da8d3530831f296ec4756a,
|
|
14
|
+
'@payloadcms/ui/rsc#HierarchyButton': HierarchyButton_ab83ff7e88da8d3530831f296ec4756a,
|
|
15
|
+
'@payloadcms/plugin-mcp/client#AccessField': AccessField_210e1789eef737e0b4d9f054258f19bb,
|
|
16
|
+
'@payloadcms/ui#FolderIcon': FolderIcon_3817bf644402e67bfe6577f60ef982de,
|
|
17
|
+
'@payloadcms/ui/rsc#HierarchySidebarTabServer':
|
|
18
|
+
HierarchySidebarTabServer_ab83ff7e88da8d3530831f296ec4756a,
|
|
19
|
+
'@payloadcms/ui#TagIcon': TagIcon_3817bf644402e67bfe6577f60ef982de,
|
|
20
|
+
'@payloadcms/ui/rsc#CollectionCards': CollectionCards_ab83ff7e88da8d3530831f296ec4756a,
|
|
6
21
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CollectionConfig } from 'payload'
|
|
2
|
+
|
|
3
|
+
export const Folders: CollectionConfig = {
|
|
4
|
+
slug: 'folders',
|
|
5
|
+
admin: {
|
|
6
|
+
useAsTitle: 'name',
|
|
7
|
+
},
|
|
8
|
+
folders: true,
|
|
9
|
+
fields: [
|
|
10
|
+
{
|
|
11
|
+
name: 'name',
|
|
12
|
+
type: 'text',
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CollectionConfig } from 'payload'
|
|
2
2
|
|
|
3
|
+
import { createFolderField, createTagField } from 'payload'
|
|
4
|
+
|
|
3
5
|
export const Media: CollectionConfig = {
|
|
4
6
|
slug: 'media',
|
|
5
7
|
access: {
|
|
@@ -11,6 +13,8 @@ export const Media: CollectionConfig = {
|
|
|
11
13
|
type: 'text',
|
|
12
14
|
required: true,
|
|
13
15
|
},
|
|
16
|
+
createFolderField({ relationTo: 'folders' }),
|
|
17
|
+
createTagField({ relationTo: 'tags' }),
|
|
14
18
|
],
|
|
15
19
|
upload: true,
|
|
16
20
|
}
|
|
@@ -64,11 +64,15 @@ export type SupportedTimezones =
|
|
|
64
64
|
export interface Config {
|
|
65
65
|
auth: {
|
|
66
66
|
users: UserAuthOperations;
|
|
67
|
+
'payload-mcp-api-keys': PayloadMcpApiKeyAuthOperations;
|
|
67
68
|
};
|
|
68
69
|
blocks: {};
|
|
69
70
|
collections: {
|
|
70
71
|
users: User;
|
|
71
72
|
media: Media;
|
|
73
|
+
folders: Folder;
|
|
74
|
+
tags: Tag;
|
|
75
|
+
'payload-mcp-api-keys': PayloadMcpApiKey;
|
|
72
76
|
'payload-kv': PayloadKv;
|
|
73
77
|
'payload-locked-documents': PayloadLockedDocument;
|
|
74
78
|
'payload-preferences': PayloadPreference;
|
|
@@ -78,6 +82,9 @@ export interface Config {
|
|
|
78
82
|
collectionsSelect: {
|
|
79
83
|
users: UsersSelect<false> | UsersSelect<true>;
|
|
80
84
|
media: MediaSelect<false> | MediaSelect<true>;
|
|
85
|
+
folders: FoldersSelect<false> | FoldersSelect<true>;
|
|
86
|
+
tags: TagsSelect<false> | TagsSelect<true>;
|
|
87
|
+
'payload-mcp-api-keys': PayloadMcpApiKeysSelect<false> | PayloadMcpApiKeysSelect<true>;
|
|
81
88
|
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
|
|
82
89
|
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
|
|
83
90
|
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
|
|
@@ -86,14 +93,14 @@ export interface Config {
|
|
|
86
93
|
db: {
|
|
87
94
|
defaultIDType: string;
|
|
88
95
|
};
|
|
89
|
-
fallbackLocale: null;
|
|
96
|
+
fallbackLocale: ('false' | 'none' | 'null') | false | null | 'en' | 'en'[];
|
|
90
97
|
globals: {};
|
|
91
98
|
globalsSelect: {};
|
|
92
|
-
locale:
|
|
99
|
+
locale: 'en';
|
|
93
100
|
widgets: {
|
|
94
101
|
collections: CollectionsWidget;
|
|
95
102
|
};
|
|
96
|
-
user: User;
|
|
103
|
+
user: User | PayloadMcpApiKey;
|
|
97
104
|
jobs: {
|
|
98
105
|
tasks: unknown;
|
|
99
106
|
workflows: unknown;
|
|
@@ -117,6 +124,24 @@ export interface UserAuthOperations {
|
|
|
117
124
|
password: string;
|
|
118
125
|
};
|
|
119
126
|
}
|
|
127
|
+
export interface PayloadMcpApiKeyAuthOperations {
|
|
128
|
+
forgotPassword: {
|
|
129
|
+
email: string;
|
|
130
|
+
password: string;
|
|
131
|
+
};
|
|
132
|
+
login: {
|
|
133
|
+
email: string;
|
|
134
|
+
password: string;
|
|
135
|
+
};
|
|
136
|
+
registerFirstUser: {
|
|
137
|
+
email: string;
|
|
138
|
+
password: string;
|
|
139
|
+
};
|
|
140
|
+
unlock: {
|
|
141
|
+
email: string;
|
|
142
|
+
password: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
120
145
|
/**
|
|
121
146
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
122
147
|
* via the `definition` "users".
|
|
@@ -149,6 +174,8 @@ export interface User {
|
|
|
149
174
|
export interface Media {
|
|
150
175
|
id: string;
|
|
151
176
|
alt: string;
|
|
177
|
+
_h_folders?: (string | null) | Folder;
|
|
178
|
+
_h_tags?: (string | Tag)[] | null;
|
|
152
179
|
updatedAt: string;
|
|
153
180
|
createdAt: string;
|
|
154
181
|
url?: string | null;
|
|
@@ -161,6 +188,75 @@ export interface Media {
|
|
|
161
188
|
focalX?: number | null;
|
|
162
189
|
focalY?: number | null;
|
|
163
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
193
|
+
* via the `definition` "folders".
|
|
194
|
+
*/
|
|
195
|
+
export interface Folder {
|
|
196
|
+
id: string;
|
|
197
|
+
_h_folders?: (string | null) | Folder;
|
|
198
|
+
name: string;
|
|
199
|
+
updatedAt: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
_h_slugPath?: string | null;
|
|
202
|
+
_h_titlePath?: string | null;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
206
|
+
* via the `definition` "tags".
|
|
207
|
+
*/
|
|
208
|
+
export interface Tag {
|
|
209
|
+
id: string;
|
|
210
|
+
_h_tags?: (string | null) | Tag;
|
|
211
|
+
name: string;
|
|
212
|
+
updatedAt: string;
|
|
213
|
+
createdAt: string;
|
|
214
|
+
_h_slugPath?: string | null;
|
|
215
|
+
_h_titlePath?: string | null;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* API keys control which collections, resources, tools, and prompts MCP clients can access
|
|
219
|
+
*
|
|
220
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
221
|
+
* via the `definition` "payload-mcp-api-keys".
|
|
222
|
+
*/
|
|
223
|
+
export interface PayloadMcpApiKey {
|
|
224
|
+
id: string;
|
|
225
|
+
/**
|
|
226
|
+
* The user that the API key is associated with.
|
|
227
|
+
*/
|
|
228
|
+
user: string | User;
|
|
229
|
+
/**
|
|
230
|
+
* A useful label for the API key.
|
|
231
|
+
*/
|
|
232
|
+
label?: string | null;
|
|
233
|
+
/**
|
|
234
|
+
* The purpose of the API key.
|
|
235
|
+
*/
|
|
236
|
+
description?: string | null;
|
|
237
|
+
/**
|
|
238
|
+
* When checked, this key bypasses Payload access control on every operation it performs. Leave unchecked unless you have a specific reason.
|
|
239
|
+
*/
|
|
240
|
+
overrideAccess?: boolean | null;
|
|
241
|
+
/**
|
|
242
|
+
* Access for this API key — uncheck to revoke individual tools.
|
|
243
|
+
*/
|
|
244
|
+
access?:
|
|
245
|
+
| {
|
|
246
|
+
[k: string]: unknown;
|
|
247
|
+
}
|
|
248
|
+
| unknown[]
|
|
249
|
+
| string
|
|
250
|
+
| number
|
|
251
|
+
| boolean
|
|
252
|
+
| null;
|
|
253
|
+
updatedAt: string;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
enableAPIKey?: boolean | null;
|
|
256
|
+
apiKey?: string | null;
|
|
257
|
+
apiKeyIndex?: string | null;
|
|
258
|
+
collection: 'payload-mcp-api-keys';
|
|
259
|
+
}
|
|
164
260
|
/**
|
|
165
261
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
166
262
|
* via the `definition` "payload-kv".
|
|
@@ -192,12 +288,29 @@ export interface PayloadLockedDocument {
|
|
|
192
288
|
| ({
|
|
193
289
|
relationTo: 'media';
|
|
194
290
|
value: string | Media;
|
|
291
|
+
} | null)
|
|
292
|
+
| ({
|
|
293
|
+
relationTo: 'folders';
|
|
294
|
+
value: string | Folder;
|
|
295
|
+
} | null)
|
|
296
|
+
| ({
|
|
297
|
+
relationTo: 'tags';
|
|
298
|
+
value: string | Tag;
|
|
299
|
+
} | null)
|
|
300
|
+
| ({
|
|
301
|
+
relationTo: 'payload-mcp-api-keys';
|
|
302
|
+
value: string | PayloadMcpApiKey;
|
|
195
303
|
} | null);
|
|
196
304
|
globalSlug?: string | null;
|
|
197
|
-
user:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
305
|
+
user:
|
|
306
|
+
| {
|
|
307
|
+
relationTo: 'users';
|
|
308
|
+
value: string | User;
|
|
309
|
+
}
|
|
310
|
+
| {
|
|
311
|
+
relationTo: 'payload-mcp-api-keys';
|
|
312
|
+
value: string | PayloadMcpApiKey;
|
|
313
|
+
};
|
|
201
314
|
updatedAt: string;
|
|
202
315
|
createdAt: string;
|
|
203
316
|
}
|
|
@@ -207,10 +320,15 @@ export interface PayloadLockedDocument {
|
|
|
207
320
|
*/
|
|
208
321
|
export interface PayloadPreference {
|
|
209
322
|
id: string;
|
|
210
|
-
user:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
323
|
+
user:
|
|
324
|
+
| {
|
|
325
|
+
relationTo: 'users';
|
|
326
|
+
value: string | User;
|
|
327
|
+
}
|
|
328
|
+
| {
|
|
329
|
+
relationTo: 'payload-mcp-api-keys';
|
|
330
|
+
value: string | PayloadMcpApiKey;
|
|
331
|
+
};
|
|
214
332
|
key?: string | null;
|
|
215
333
|
value?:
|
|
216
334
|
| {
|
|
@@ -263,6 +381,8 @@ export interface UsersSelect<T extends boolean = true> {
|
|
|
263
381
|
*/
|
|
264
382
|
export interface MediaSelect<T extends boolean = true> {
|
|
265
383
|
alt?: T;
|
|
384
|
+
_h_folders?: T;
|
|
385
|
+
_h_tags?: T;
|
|
266
386
|
updatedAt?: T;
|
|
267
387
|
createdAt?: T;
|
|
268
388
|
url?: T;
|
|
@@ -275,6 +395,46 @@ export interface MediaSelect<T extends boolean = true> {
|
|
|
275
395
|
focalX?: T;
|
|
276
396
|
focalY?: T;
|
|
277
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
400
|
+
* via the `definition` "folders_select".
|
|
401
|
+
*/
|
|
402
|
+
export interface FoldersSelect<T extends boolean = true> {
|
|
403
|
+
_h_folders?: T;
|
|
404
|
+
name?: T;
|
|
405
|
+
updatedAt?: T;
|
|
406
|
+
createdAt?: T;
|
|
407
|
+
_h_slugPath?: T;
|
|
408
|
+
_h_titlePath?: T;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
412
|
+
* via the `definition` "tags_select".
|
|
413
|
+
*/
|
|
414
|
+
export interface TagsSelect<T extends boolean = true> {
|
|
415
|
+
_h_tags?: T;
|
|
416
|
+
name?: T;
|
|
417
|
+
updatedAt?: T;
|
|
418
|
+
createdAt?: T;
|
|
419
|
+
_h_slugPath?: T;
|
|
420
|
+
_h_titlePath?: T;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* This interface was referenced by `Config`'s JSON-Schema
|
|
424
|
+
* via the `definition` "payload-mcp-api-keys_select".
|
|
425
|
+
*/
|
|
426
|
+
export interface PayloadMcpApiKeysSelect<T extends boolean = true> {
|
|
427
|
+
user?: T;
|
|
428
|
+
label?: T;
|
|
429
|
+
description?: T;
|
|
430
|
+
overrideAccess?: T;
|
|
431
|
+
access?: T;
|
|
432
|
+
updatedAt?: T;
|
|
433
|
+
createdAt?: T;
|
|
434
|
+
enableAPIKey?: T;
|
|
435
|
+
apiKey?: T;
|
|
436
|
+
apiKeyIndex?: T;
|
|
437
|
+
}
|
|
278
438
|
/**
|
|
279
439
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
280
440
|
* via the `definition` "payload-kv_select".
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
2
|
+
import { mcpPlugin } from '@payloadcms/plugin-mcp'
|
|
2
3
|
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
|
3
4
|
import path from 'path'
|
|
4
5
|
import { buildConfig } from 'payload'
|
|
@@ -7,6 +8,8 @@ import sharp from 'sharp'
|
|
|
7
8
|
|
|
8
9
|
import { Users } from './collections/Users'
|
|
9
10
|
import { Media } from './collections/Media'
|
|
11
|
+
import { Folders } from './collections/Folders'
|
|
12
|
+
import { Tags } from './collections/Tags'
|
|
10
13
|
|
|
11
14
|
const filename = fileURLToPath(import.meta.url)
|
|
12
15
|
const dirname = path.dirname(filename)
|
|
@@ -18,7 +21,7 @@ export default buildConfig({
|
|
|
18
21
|
baseDir: path.resolve(dirname),
|
|
19
22
|
},
|
|
20
23
|
},
|
|
21
|
-
collections: [Users, Media],
|
|
24
|
+
collections: [Users, Media, Folders, Tags],
|
|
22
25
|
editor: lexicalEditor(),
|
|
23
26
|
secret: process.env.PAYLOAD_SECRET || '',
|
|
24
27
|
typescript: {
|
|
@@ -28,5 +31,10 @@ export default buildConfig({
|
|
|
28
31
|
url: process.env.DATABASE_URL || '',
|
|
29
32
|
}),
|
|
30
33
|
sharp,
|
|
31
|
-
|
|
34
|
+
localization: {
|
|
35
|
+
locales: ['en'],
|
|
36
|
+
fallback: true,
|
|
37
|
+
defaultLocale: 'en',
|
|
38
|
+
},
|
|
39
|
+
plugins: [mcpPlugin({})],
|
|
32
40
|
})
|