Skip to content

Commit 5f2dc37

Browse files
rchlfrynclaude
andcommitted
Bump Payload group 3.83.0 → 3.84.1
Both project-maintained patches needed updates against 3.84.1: - plugin-mcp: shrunk from 116 to 37 lines. The `instructions` support added in PR #1022 is now upstream (`MCPServerOptions.instructions`), and the runtime already reads `pluginOptions.authDepth ?? 1`. Only the `authDepth?: number` type declaration remains. - storage-vercel-blob: reworked against the restructured 3.84.1 layout (handleUpload.js → uploadFile.js, new adapter.js indirection). The upstream PR for `allowOverwrite` (payloadcms/payload#16078) was closed without merging, so this patch is still required to keep the seeding workflow working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7adfc48 commit 5f2dc37

4 files changed

Lines changed: 240 additions & 290 deletions

File tree

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@
5353
"@libsql/client": "^0.17.2",
5454
"@open-iframe-resizer/core": "^2.1.0",
5555
"@open-iframe-resizer/react": "^2.1.0",
56-
"@payloadcms/admin-bar": "3.83.0",
57-
"@payloadcms/db-sqlite": "3.83.0",
58-
"@payloadcms/email-nodemailer": "3.83.0",
59-
"@payloadcms/email-resend": "3.83.0",
60-
"@payloadcms/next": "3.83.0",
61-
"@payloadcms/plugin-form-builder": "3.83.0",
62-
"@payloadcms/plugin-mcp": "3.83.0",
63-
"@payloadcms/plugin-sentry": "3.83.0",
64-
"@payloadcms/plugin-seo": "3.83.0",
65-
"@payloadcms/richtext-lexical": "3.83.0",
66-
"@payloadcms/storage-vercel-blob": "3.83.0",
67-
"@payloadcms/ui": "3.83.0",
56+
"@payloadcms/admin-bar": "3.84.1",
57+
"@payloadcms/db-sqlite": "3.84.1",
58+
"@payloadcms/email-nodemailer": "3.84.1",
59+
"@payloadcms/email-resend": "3.84.1",
60+
"@payloadcms/next": "3.84.1",
61+
"@payloadcms/plugin-form-builder": "3.84.1",
62+
"@payloadcms/plugin-mcp": "3.84.1",
63+
"@payloadcms/plugin-sentry": "3.84.1",
64+
"@payloadcms/plugin-seo": "3.84.1",
65+
"@payloadcms/richtext-lexical": "3.84.1",
66+
"@payloadcms/storage-vercel-blob": "3.84.1",
67+
"@payloadcms/ui": "3.84.1",
6868
"@radix-ui/react-accordion": "^1.2.4",
6969
"@radix-ui/react-avatar": "^1.1.7",
7070
"@radix-ui/react-checkbox": "^1.1.3",
@@ -106,7 +106,7 @@
106106
"nextjs-toploader": "^3.9.17",
107107
"nuqs": "^2.7.3",
108108
"path-to-regexp": "^8.4.2",
109-
"payload": "3.83.0",
109+
"payload": "3.84.1",
110110
"pino": "9.14.0",
111111
"pino-pretty": "13.1.3",
112112
"pluralize": "^8.0.0",
Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
1-
diff --git a/dist/endpoints/mcp.js b/dist/endpoints/mcp.js
2-
index 7b6b62d82ed708d679e329d43c424595c39b81b1..764f6ab9c63d1cbea0e5a0c54f44396120c0261e 100644
3-
--- a/dist/endpoints/mcp.js
4-
+++ b/dist/endpoints/mcp.js
5-
@@ -22,7 +22,7 @@ export const initializeMCPHandler = (pluginOptions)=>{
6-
};
7-
const { docs } = await payload.find({
8-
collection: 'payload-mcp-api-keys',
9-
- depth: 1,
10-
+ depth: pluginOptions.authDepth ?? 1,
11-
limit: 1,
12-
pagination: false,
13-
where
14-
diff --git a/dist/mcp/getMcpHandler.js b/dist/mcp/getMcpHandler.js
15-
index d69079472a3d58d6d1fb5958de20437de7863c4c..c321ae4d10f45d03204221e8bbac0b3503faa0a4 100644
16-
--- a/dist/mcp/getMcpHandler.js
17-
+++ b/dist/mcp/getMcpHandler.js
18-
@@ -213,7 +213,8 @@ export const getMCPHandler = (pluginOptions, mcpAccessSettings, req)=>{
19-
payload.logger.info('[payload-mcp] 🚀 MCP Server Ready.');
20-
}
21-
}, {
22-
- serverInfo: serverOptions.serverInfo
23-
+ serverInfo: serverOptions.serverInfo,
24-
+ instructions: serverOptions.instructions
25-
}, {
26-
basePath: MCPHandlerOptions.basePath || payload.config.routes?.api || '/api',
27-
disableSse: MCPHandlerOptions.disableSse ?? true,
281
diff --git a/dist/types.d.ts b/dist/types.d.ts
29-
index 09019905cdd448c0235dab94d36c13f85f6b9e2d..a96817d7b2dd2908563c0cd3b9cede5692418ac9 100644
2+
index 4d71adff1756e5bbdc880ac0edc6b6ad9fee1d4a..07f8ed3c93bc4362bec35d3d9355176c1443c697 100644
303
--- a/dist/types.d.ts
314
+++ b/dist/types.d.ts
32-
@@ -260,6 +260,13 @@ export type PluginMCPServerConfig = {
5+
@@ -260,6 +260,13 @@ export type MCPPluginConfig = {
336
parameters: z.ZodRawShape;
347
}[];
358
};
@@ -43,49 +16,11 @@ index 09019905cdd448c0235dab94d36c13f85f6b9e2d..a96817d7b2dd2908563c0cd3b9cede56
4316
/**
4417
* Override the API key collection.
4518
* This allows you to add fields to the API key collection or modify the collection in any way you want.
46-
@@ -333,6 +340,12 @@ export type MCPServerOptions = {
47-
*/
48-
version: string;
49-
};
50-
+ /**
51-
+ * Optional instructions describing how to use the server and its features.
52-
+ * These are returned to MCP clients during initialization and may be added
53-
+ * to the LLM's system prompt.
54-
+ */
55-
+ instructions?: string;
56-
};
57-
export type MCPAccessSettings = {
58-
auth?: {
59-
diff --git a/src/endpoints/mcp.ts b/src/endpoints/mcp.ts
60-
index ee9d484fcb20784894bb0e5b7d910f9bf084e36b..d1ba435b3f5742b44b6ac3c41c9fb4e83b9fc982 100644
61-
--- a/src/endpoints/mcp.ts
62-
+++ b/src/endpoints/mcp.ts
63-
@@ -38,7 +38,7 @@ export const initializeMCPHandler = (pluginOptions: PluginMCPServerConfig) => {
64-
65-
const { docs } = await payload.find({
66-
collection: 'payload-mcp-api-keys',
67-
- depth: 1,
68-
+ depth: pluginOptions.authDepth ?? 1,
69-
limit: 1,
70-
pagination: false,
71-
where,
72-
diff --git a/src/mcp/getMcpHandler.ts b/src/mcp/getMcpHandler.ts
73-
index 5e9ac74e7c553489810ec2ad01dac1f626b4270d..01eb665872547e0926d323d29ec829cac22cc4db 100644
74-
--- a/src/mcp/getMcpHandler.ts
75-
+++ b/src/mcp/getMcpHandler.ts
76-
@@ -528,6 +528,7 @@ export const getMCPHandler = (
77-
},
78-
{
79-
serverInfo: serverOptions.serverInfo,
80-
+ instructions: serverOptions.instructions,
81-
},
82-
{
83-
basePath: MCPHandlerOptions.basePath || payload.config.routes?.api || '/api',
8419
diff --git a/src/types.ts b/src/types.ts
85-
index fcea1a2c1863bdf7d02c09a176bdf64c1507ad4f..9f217edcb9b251b38dfea26e0c813ea5e55b8a62 100644
20+
index 356c7271a0b850138801225700ffeb5ffd658c3e..3df7326cd17d3d3556fa1d749ea12713e53a5b9a 100644
8621
--- a/src/types.ts
8722
+++ b/src/types.ts
88-
@@ -308,6 +308,14 @@ export type PluginMCPServerConfig = {
23+
@@ -308,6 +308,14 @@ export type MCPPluginConfig = {
8924
}[]
9025
}
9126

@@ -100,17 +35,3 @@ index fcea1a2c1863bdf7d02c09a176bdf64c1507ad4f..9f217edcb9b251b38dfea26e0c813ea5
10035
/**
10136
* Override the API key collection.
10237
* This allows you to add fields to the API key collection or modify the collection in any way you want.
103-
@@ -388,6 +396,13 @@ export type MCPServerOptions = {
104-
*/
105-
version: string
106-
}
107-
+
108-
+ /**
109-
+ * Optional instructions describing how to use the server and its features.
110-
+ * These are returned to MCP clients during initialization and may be added
111-
+ * to the LLM's system prompt.
112-
+ */
113-
+ instructions?: string
114-
}
115-
116-
export type MCPAccessSettings = {
Lines changed: 100 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,55 @@
1+
diff --git a/dist/adapter.d.ts b/dist/adapter.d.ts
2+
index e4921574d152b98a79bc5319634e36af4fb1ab39..4e45a6b1d6a3b1a4dbb6cf192882a50d55048323 100644
3+
--- a/dist/adapter.d.ts
4+
+++ b/dist/adapter.d.ts
5+
@@ -2,12 +2,13 @@ import type { Adapter, ClientUploadsConfig } from '@payloadcms/plugin-cloud-stor
6+
interface CreateVercelBlobAdapterArgs {
7+
access: 'public';
8+
addRandomSuffix?: boolean;
9+
+ allowOverwrite?: boolean;
10+
baseUrl: string;
11+
cacheControlMaxAge: number;
12+
clientUploads?: ClientUploadsConfig;
13+
token: string;
14+
useCompositePrefixes?: boolean;
15+
}
16+
-export declare function createVercelBlobAdapter({ access, addRandomSuffix, baseUrl, cacheControlMaxAge, clientUploads, token, useCompositePrefixes, }: CreateVercelBlobAdapterArgs): Adapter;
17+
+export declare function createVercelBlobAdapter({ access, addRandomSuffix, allowOverwrite, baseUrl, cacheControlMaxAge, clientUploads, token, useCompositePrefixes, }: CreateVercelBlobAdapterArgs): Adapter;
18+
export {};
19+
//# sourceMappingURL=adapter.d.ts.map
20+
\ No newline at end of file
21+
diff --git a/dist/adapter.js b/dist/adapter.js
22+
index 7c08de8d0b581327114f868ae69858cccef120ec..2790699d38440430e6d0e0a463e967edd150aa3a 100644
23+
--- a/dist/adapter.js
24+
+++ b/dist/adapter.js
25+
@@ -2,7 +2,7 @@ import { deleteFile } from './deleteFile.js';
26+
import { generateURL } from './generateURL.js';
27+
import { getFile } from './getFile.js';
28+
import { uploadFile } from './uploadFile.js';
29+
-export function createVercelBlobAdapter({ access, addRandomSuffix, baseUrl, cacheControlMaxAge, clientUploads, token, useCompositePrefixes = false }) {
30+
+export function createVercelBlobAdapter({ access, addRandomSuffix, allowOverwrite, baseUrl, cacheControlMaxAge, clientUploads, token, useCompositePrefixes = false }) {
31+
return ({ collection, prefix = '' })=>({
32+
name: 'vercel-blob',
33+
clientUploads,
34+
@@ -25,6 +25,7 @@ export function createVercelBlobAdapter({ access, addRandomSuffix, baseUrl, cach
35+
const result = await uploadFile({
36+
access,
37+
addRandomSuffix,
38+
+ allowOverwrite,
39+
buffer,
40+
cacheControlMaxAge,
41+
collectionPrefix: prefix,
142
diff --git a/dist/client/VercelBlobClientUploadHandler.d.ts b/dist/client/VercelBlobClientUploadHandler.d.ts
2-
index 984feebe49e7bfaabd0294eebaa9415e09e0e5cd..18285f61580c050750d6312d12a8cdfb5d4ba6c8 100644
43+
index b3b021ebd932ab8c6bb0b5abf829dae0f91a2396..3269e5bd16056ec46f57809166b3e7cc28a78e3e 100644
344
--- a/dist/client/VercelBlobClientUploadHandler.d.ts
445
+++ b/dist/client/VercelBlobClientUploadHandler.d.ts
546
@@ -1,5 +1,6 @@
647
export type VercelBlobClientUploadHandlerExtra = {
748
addRandomSuffix: boolean;
849
+ allowOverwrite: boolean;
9-
baseURL: string;
10-
prefix: string;
50+
useCompositePrefixes: boolean;
1151
};
12-
diff --git a/dist/client/VercelBlobClientUploadHandler.js b/dist/client/VercelBlobClientUploadHandler.js
13-
index 94a3512c0436805acba26910adb595cf970f4961..cda0b0aea5769c0522b7e9d609d9b919f89a43aa 100644
14-
--- a/dist/client/VercelBlobClientUploadHandler.js
15-
+++ b/dist/client/VercelBlobClientUploadHandler.js
16-
@@ -3,7 +3,7 @@ import { createClientUploadHandler } from '@payloadcms/plugin-cloud-storage/clie
17-
import { upload } from '@vercel/blob/client';
18-
import { formatAdminURL } from 'payload/shared';
19-
export const VercelBlobClientUploadHandler = createClientUploadHandler({
20-
- handler: async ({ apiRoute, collectionSlug, extra: { addRandomSuffix, baseURL, prefix = '' }, file, serverHandlerPath, serverURL, updateFilename })=>{
21-
+ handler: async ({ apiRoute, collectionSlug, extra: { addRandomSuffix, allowOverwrite, baseURL, prefix = '' }, file, serverHandlerPath, serverURL, updateFilename })=>{
22-
const endpointRoute = formatAdminURL({
23-
apiRoute,
24-
path: serverHandlerPath,
52+
export declare const VercelBlobClientUploadHandler: ({ children, collectionSlug, enabled, extra, prefix, serverHandlerPath, }: {
2553
diff --git a/dist/getClientUploadRoute.d.ts b/dist/getClientUploadRoute.d.ts
2654
index b0d9157554801e9a873ad09c1ace7c6c5db43a90..519f19e05145f5aaabd7afe8571149b529019b50 100644
2755
--- a/dist/getClientUploadRoute.d.ts
@@ -60,39 +88,8 @@ index e11cf568867309efcb243fab490a33c6b01c46a8..bfeeee12b5180db867576f1a33738ebd
6088
cacheControlMaxAge
6189
});
6290
},
63-
diff --git a/dist/handleUpload.d.ts b/dist/handleUpload.d.ts
64-
index 74b7b972fc9dbeffb7a2c79c8b472c831e61a670..404b4e4f2adc0d8f0180fae9428444232a2e4d6f 100644
65-
--- a/dist/handleUpload.d.ts
66-
+++ b/dist/handleUpload.d.ts
67-
@@ -4,6 +4,6 @@ type HandleUploadArgs = {
68-
baseUrl: string;
69-
prefix?: string;
70-
} & Omit<VercelBlobStorageOptions, 'collections'>;
71-
-export declare const getHandleUpload: ({ access, addRandomSuffix, baseUrl, cacheControlMaxAge, prefix, token, }: HandleUploadArgs) => HandleUpload;
72-
+export declare const getHandleUpload: ({ access, addRandomSuffix, allowOverwrite, baseUrl, cacheControlMaxAge, prefix, token, }: HandleUploadArgs) => HandleUpload;
73-
export {};
74-
//# sourceMappingURL=handleUpload.d.ts.map
75-
\ No newline at end of file
76-
diff --git a/dist/handleUpload.js b/dist/handleUpload.js
77-
index db797445156822d2a2a0024b303df940b446e4c2..eedefda709bf53e7f0b4bd2f1b0cdc81e5267c52 100644
78-
--- a/dist/handleUpload.js
79-
+++ b/dist/handleUpload.js
80-
@@ -1,11 +1,12 @@
81-
import { put } from '@vercel/blob';
82-
import path from 'path';
83-
-export const getHandleUpload = ({ access = 'public', addRandomSuffix, baseUrl, cacheControlMaxAge, prefix = '', token })=>{
84-
+export const getHandleUpload = ({ access = 'public', addRandomSuffix, allowOverwrite, baseUrl, cacheControlMaxAge, prefix = '', token })=>{
85-
return async ({ data, file: { buffer, filename, mimeType } })=>{
86-
const fileKey = path.posix.join(data.prefix || prefix, filename);
87-
const result = await put(fileKey, buffer, {
88-
access,
89-
addRandomSuffix,
90-
+ allowOverwrite,
91-
cacheControlMaxAge,
92-
contentType: mimeType,
93-
token
9491
diff --git a/dist/index.d.ts b/dist/index.d.ts
95-
index 8949c2db42d2657bdd7a72e1476420ce9766ea23..1edaf94546ad7876d4577a7150ed3b85f14f1585 100644
92+
index 42bc409877a795be084492014f7818286c4f92ff..987f1a5c59a936dd0b938d601ddeeaa2f3aef6fb 100644
9693
--- a/dist/index.d.ts
9794
+++ b/dist/index.d.ts
9895
@@ -14,6 +14,13 @@ export type VercelBlobStorageOptions = {
@@ -110,24 +107,23 @@ index 8949c2db42d2657bdd7a72e1476420ce9766ea23..1edaf94546ad7876d4577a7150ed3b85
110107
* When enabled, fields (like the prefix field) will always be inserted into
111108
* the collection schema regardless of whether the plugin is enabled. This
112109
diff --git a/dist/index.js b/dist/index.js
113-
index 7c56ee05908afb9dfb3bfa20f2a5b9ed3e4cca69..7ca12e268e986d595c86840cce40dd1ae5949021 100644
110+
index 90888ac80eda32c21fae7f511296dbff1f93c9f8..3680d809ce6e4d4776cf2c173c251145c32bd7c2 100644
114111
--- a/dist/index.js
115112
+++ b/dist/index.js
116-
@@ -8,6 +8,7 @@ import { getStaticHandler } from './staticHandler.js';
113+
@@ -5,6 +5,7 @@ import { getClientUploadRoute } from './getClientUploadRoute.js';
117114
const defaultUploadOptions = {
118115
access: 'public',
119116
addRandomSuffix: false,
120117
+ allowOverwrite: false,
121118
cacheControlMaxAge: 60 * 60 * 24 * 365,
122119
enabled: true
123120
};
124-
@@ -32,12 +33,14 @@ export const vercelBlobStorage = (options)=>(incomingConfig)=>{
121+
@@ -29,11 +30,13 @@ export const vercelBlobStorage = (options)=>(incomingConfig)=>{
125122
enabled: !isPluginDisabled && Boolean(options.clientUploads),
126-
extraClientHandlerProps: (collection)=>({
123+
extraClientHandlerProps: ()=>({
127124
addRandomSuffix: !!optionsWithDefaults.addRandomSuffix,
128125
+ allowOverwrite: !!optionsWithDefaults.allowOverwrite,
129-
baseURL: baseUrl,
130-
prefix: typeof collection === 'object' && collection.prefix && `${collection.prefix}/` || ''
126+
useCompositePrefixes: !!options.useCompositePrefixes
131127
}),
132128
serverHandler: getClientUploadRoute({
133129
access: typeof options.clientUploads === 'object' ? options.clientUploads.access : undefined,
@@ -136,20 +132,53 @@ index 7c56ee05908afb9dfb3bfa20f2a5b9ed3e4cca69..7ca12e268e986d595c86840cce40dd1a
136132
cacheControlMaxAge: options.cacheControlMaxAge,
137133
token: options.token ?? ''
138134
}),
139-
@@ -96,7 +99,7 @@ export const vercelBlobStorage = (options)=>(incomingConfig)=>{
140-
};
141-
function vercelBlobStorageInternal(options) {
142-
return ({ collection, prefix })=>{
143-
- const { access, addRandomSuffix, baseUrl, cacheControlMaxAge, clientUploads, token } = options;
144-
+ const { access, addRandomSuffix, allowOverwrite, baseUrl, cacheControlMaxAge, clientUploads, token } = options;
145-
if (!token) {
146-
throw new Error('Vercel Blob storage token is required');
147-
}
148-
@@ -115,6 +118,7 @@ function vercelBlobStorageInternal(options) {
149-
handleUpload: getHandleUpload({
150-
access,
151-
addRandomSuffix,
152-
+ allowOverwrite,
153-
baseUrl,
154-
cacheControlMaxAge,
155-
prefix,
135+
@@ -61,6 +64,7 @@ export const vercelBlobStorage = (options)=>(incomingConfig)=>{
136+
const adapter = createVercelBlobAdapter({
137+
access: optionsWithDefaults.access ?? 'public',
138+
addRandomSuffix: optionsWithDefaults.addRandomSuffix,
139+
+ allowOverwrite: optionsWithDefaults.allowOverwrite,
140+
baseUrl,
141+
cacheControlMaxAge: optionsWithDefaults.cacheControlMaxAge ?? 60 * 60 * 24 * 365,
142+
clientUploads: optionsWithDefaults.clientUploads,
143+
diff --git a/dist/uploadFile.d.ts b/dist/uploadFile.d.ts
144+
index 4edd33ec221160cd21cd70bdcc073a8f9de726dc..ede921dc06cbf0085d19a03771c93066d3bbf469 100644
145+
--- a/dist/uploadFile.d.ts
146+
+++ b/dist/uploadFile.d.ts
147+
@@ -1,6 +1,7 @@
148+
interface UploadFileArgs {
149+
access: 'public';
150+
addRandomSuffix?: boolean;
151+
+ allowOverwrite?: boolean;
152+
buffer: Buffer;
153+
cacheControlMaxAge?: number;
154+
collectionPrefix?: string;
155+
@@ -13,6 +14,6 @@ interface UploadFileArgs {
156+
interface UploadFileResult {
157+
filename?: string;
158+
}
159+
-export declare function uploadFile({ access, addRandomSuffix, buffer, cacheControlMaxAge, collectionPrefix, docPrefix, filename, mimeType, token, useCompositePrefixes, }: UploadFileArgs): Promise<UploadFileResult>;
160+
+export declare function uploadFile({ access, addRandomSuffix, allowOverwrite, buffer, cacheControlMaxAge, collectionPrefix, docPrefix, filename, mimeType, token, useCompositePrefixes, }: UploadFileArgs): Promise<UploadFileResult>;
161+
export {};
162+
//# sourceMappingURL=uploadFile.d.ts.map
163+
\ No newline at end of file
164+
diff --git a/dist/uploadFile.js b/dist/uploadFile.js
165+
index b3b6bf4b5d407cd5cf44a84c071a282d00959819..8a7d5e7dbe067f05a5ab53b2104cec731543c5a7 100644
166+
--- a/dist/uploadFile.js
167+
+++ b/dist/uploadFile.js
168+
@@ -1,7 +1,7 @@
169+
import { getFileKey } from '@payloadcms/plugin-cloud-storage/utilities';
170+
import { put } from '@vercel/blob';
171+
import path from 'path';
172+
-export async function uploadFile({ access, addRandomSuffix, buffer, cacheControlMaxAge, collectionPrefix = '', docPrefix, filename, mimeType, token, useCompositePrefixes = false }) {
173+
+export async function uploadFile({ access, addRandomSuffix, allowOverwrite, buffer, cacheControlMaxAge, collectionPrefix = '', docPrefix, filename, mimeType, token, useCompositePrefixes = false }) {
174+
const { fileKey } = getFileKey({
175+
collectionPrefix,
176+
docPrefix,
177+
@@ -11,6 +11,7 @@ export async function uploadFile({ access, addRandomSuffix, buffer, cacheControl
178+
const result = await put(fileKey, buffer, {
179+
access,
180+
addRandomSuffix,
181+
+ allowOverwrite,
182+
cacheControlMaxAge,
183+
contentType: mimeType,
184+
token

0 commit comments

Comments
 (0)