@payloadcms/plugin-mcp 4.0.0-internal.8ba6b5b → 4.0.0-internal.9496957
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/bin.js +7 -0
- package/dist/defaultAccess.d.ts.map +1 -1
- package/dist/defineTool.d.ts +8 -8
- package/dist/defineTool.d.ts.map +1 -1
- package/dist/endpoint/access.d.ts.map +1 -1
- package/dist/endpoint/access.js +2 -2
- package/dist/endpoint/access.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts +1 -1
- package/dist/mcp/buildMcpServer.d.ts.map +1 -1
- package/dist/mcp/buildMcpServer.js +35 -23
- package/dist/mcp/buildMcpServer.js.map +1 -1
- package/dist/mcp/builtin/collections/authTools.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/authTools.js +79 -56
- package/dist/mcp/builtin/collections/authTools.js.map +1 -1
- package/dist/mcp/builtin/collections/countTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/countTool.js +9 -14
- package/dist/mcp/builtin/collections/countTool.js.map +1 -1
- package/dist/mcp/builtin/collections/countVersionsTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/countVersionsTool.js +9 -13
- package/dist/mcp/builtin/collections/countVersionsTool.js.map +1 -1
- package/dist/mcp/builtin/collections/createTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/createTool.js +98 -53
- package/dist/mcp/builtin/collections/createTool.js.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.js +40 -43
- package/dist/mcp/builtin/collections/deleteTool.js.map +1 -1
- package/dist/mcp/builtin/collections/duplicateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/duplicateTool.js +26 -36
- package/dist/mcp/builtin/collections/duplicateTool.js.map +1 -1
- package/dist/mcp/builtin/collections/fileInput.d.ts +28 -0
- package/dist/mcp/builtin/collections/fileInput.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/fileInput.js +123 -0
- package/dist/mcp/builtin/collections/fileInput.js.map +1 -0
- package/dist/mcp/builtin/collections/fileInput.spec.js +86 -0
- package/dist/mcp/builtin/collections/fileInput.spec.js.map +1 -0
- package/dist/mcp/builtin/collections/findDistinctTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findDistinctTool.js +11 -26
- package/dist/mcp/builtin/collections/findDistinctTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findTool.js +21 -43
- package/dist/mcp/builtin/collections/findTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findVersionByIDTool.js +17 -26
- package/dist/mcp/builtin/collections/findVersionByIDTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findVersionsTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findVersionsTool.js +16 -30
- package/dist/mcp/builtin/collections/findVersionsTool.js.map +1 -1
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +34 -12
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -1
- package/dist/mcp/builtin/collections/restoreVersionTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/restoreVersionTool.js +14 -26
- package/dist/mcp/builtin/collections/restoreVersionTool.js.map +1 -1
- package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/updateTool.js +49 -81
- package/dist/mcp/builtin/collections/updateTool.js.map +1 -1
- package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.js +55 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.js.map +1 -0
- package/dist/mcp/builtin/formatEntityError.d.ts +16 -0
- package/dist/mcp/builtin/formatEntityError.d.ts.map +1 -0
- package/dist/mcp/builtin/formatEntityError.js +55 -0
- package/dist/mcp/builtin/formatEntityError.js.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -1
- package/dist/mcp/builtin/getConfigInfoTool.js +3 -2
- package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -1
- package/dist/mcp/builtin/globals/countVersionsTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/countVersionsTool.js +9 -13
- package/dist/mcp/builtin/globals/countVersionsTool.js.map +1 -1
- package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/findTool.js +10 -16
- package/dist/mcp/builtin/globals/findTool.js.map +1 -1
- package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/findVersionByIDTool.js +13 -24
- package/dist/mcp/builtin/globals/findVersionByIDTool.js.map +1 -1
- package/dist/mcp/builtin/globals/findVersionsTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/findVersionsTool.js +13 -29
- package/dist/mcp/builtin/globals/findVersionsTool.js.map +1 -1
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +11 -11
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -1
- package/dist/mcp/builtin/globals/restoreVersionTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/restoreVersionTool.js +15 -22
- package/dist/mcp/builtin/globals/restoreVersionTool.js.map +1 -1
- package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/updateTool.js +27 -36
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -1
- package/dist/mcp/builtinTools.d.ts +6 -0
- package/dist/mcp/builtinTools.d.ts.map +1 -1
- package/dist/mcp/builtinTools.js +9 -3
- package/dist/mcp/builtinTools.js.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.js +4 -1
- package/dist/mcp/sanitizeMCPConfig.js.map +1 -1
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +2 -1
- package/dist/stdio.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/resolveProjectRoot.d.ts.map +1 -1
- package/dist/utils/toStandardSchema.d.ts.map +1 -1
- package/package.json +5 -7
- package/src/endpoint/access.ts +2 -3
- package/src/mcp/buildMcpServer.ts +39 -29
- package/src/mcp/builtin/collections/authTools.ts +77 -69
- package/src/mcp/builtin/collections/countTool.ts +9 -21
- package/src/mcp/builtin/collections/countVersionsTool.ts +9 -18
- package/src/mcp/builtin/collections/createTool.ts +88 -76
- package/src/mcp/builtin/collections/deleteTool.ts +36 -64
- package/src/mcp/builtin/collections/duplicateTool.ts +33 -84
- package/src/mcp/builtin/collections/fileInput.spec.ts +93 -0
- package/src/mcp/builtin/collections/fileInput.ts +169 -0
- package/src/mcp/builtin/collections/findDistinctTool.ts +11 -63
- package/src/mcp/builtin/collections/findTool.ts +21 -103
- package/src/mcp/builtin/collections/findVersionByIDTool.ts +15 -58
- package/src/mcp/builtin/collections/findVersionsTool.ts +14 -85
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +27 -10
- package/src/mcp/builtin/collections/restoreVersionTool.ts +14 -56
- package/src/mcp/builtin/collections/updateTool.ts +54 -95
- package/src/mcp/builtin/collections/uploadInstructionsTool.ts +64 -0
- package/src/mcp/builtin/formatEntityError.ts +77 -0
- package/src/mcp/builtin/getConfigInfoTool.ts +2 -1
- package/src/mcp/builtin/globals/countVersionsTool.ts +9 -17
- package/src/mcp/builtin/globals/findTool.ts +12 -51
- package/src/mcp/builtin/globals/findVersionByIDTool.ts +13 -52
- package/src/mcp/builtin/globals/findVersionsTool.ts +14 -92
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +10 -10
- package/src/mcp/builtin/globals/restoreVersionTool.ts +14 -45
- package/src/mcp/builtin/globals/updateTool.ts +37 -60
- package/src/mcp/builtinTools.ts +9 -2
- package/src/mcp/sanitizeMCPConfig.ts +4 -1
- package/src/stdio.ts +2 -1
- package/src/types.ts +4 -4
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts +0 -9
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts.map +0 -1
- package/dist/mcp/builtin/collections/formatCollectionError.js +0 -60
- package/dist/mcp/builtin/collections/formatCollectionError.js.map +0 -1
- package/dist/mcp/builtin/validateEntityData.d.ts +0 -14
- package/dist/mcp/builtin/validateEntityData.d.ts.map +0 -1
- package/dist/mcp/builtin/validateEntityData.js +0 -82
- package/dist/mcp/builtin/validateEntityData.js.map +0 -1
- package/dist/utils/getVirtualFieldNames.d.ts +0 -14
- package/dist/utils/getVirtualFieldNames.d.ts.map +0 -1
- package/dist/utils/getVirtualFieldNames.js +0 -35
- package/dist/utils/getVirtualFieldNames.js.map +0 -1
- package/dist/utils/schemaConversion/filterFieldsByAccess.d.ts +0 -28
- package/dist/utils/schemaConversion/filterFieldsByAccess.d.ts.map +0 -1
- package/dist/utils/schemaConversion/filterFieldsByAccess.js +0 -71
- package/dist/utils/schemaConversion/filterFieldsByAccess.js.map +0 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +0 -13
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.js +0 -66
- package/dist/utils/schemaConversion/getEntityInputSchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +0 -10
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +0 -384
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +0 -133
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +0 -1
- package/dist/utils/transformPointDataToPayload.d.ts +0 -7
- package/dist/utils/transformPointDataToPayload.d.ts.map +0 -1
- package/dist/utils/transformPointDataToPayload.js +0 -28
- package/dist/utils/transformPointDataToPayload.js.map +0 -1
- package/dist/utils/whereSchema.d.ts +0 -9
- package/dist/utils/whereSchema.d.ts.map +0 -1
- package/dist/utils/whereSchema.js +0 -13
- package/dist/utils/whereSchema.js.map +0 -1
- package/src/mcp/builtin/collections/formatCollectionError.ts +0 -84
- package/src/mcp/builtin/validateEntityData.ts +0 -132
- package/src/utils/getVirtualFieldNames.ts +0 -53
- package/src/utils/schemaConversion/filterFieldsByAccess.ts +0 -123
- package/src/utils/schemaConversion/getEntityInputSchema.ts +0 -96
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +0 -96
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +0 -432
- package/src/utils/transformPointDataToPayload.ts +0 -40
- package/src/utils/whereSchema.ts +0 -24
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod'
|
|
1
|
+
import { findVersionsInputSchema } from 'payload'
|
|
4
2
|
|
|
5
3
|
import { defaultAccess } from '../../../defaultAccess.js'
|
|
6
4
|
import { defineCollectionTool } from '../../../defineTool.js'
|
|
7
5
|
import { getLogger } from '../../../utils/getLogger.js'
|
|
8
|
-
import { whereSchema } from '../../../utils/whereSchema.js'
|
|
9
6
|
|
|
10
7
|
const DEFAULT_DESCRIPTION =
|
|
11
8
|
'Find document versions in any version-enabled collection by passing the collection slug and optional where clause.'
|
|
12
9
|
|
|
13
10
|
export const findVersionsTool = defineCollectionTool({
|
|
14
11
|
access: (args) =>
|
|
15
|
-
defaultAccess(args) &&
|
|
16
|
-
Boolean(args.permissions?.collections?.[args.collectionSlug]?.readVersions),
|
|
12
|
+
defaultAccess(args) && Boolean(args.permissions?.collections?.[args.slug]?.readVersions),
|
|
17
13
|
annotations: {
|
|
18
14
|
destructiveHint: false,
|
|
19
15
|
idempotentHint: true,
|
|
@@ -22,79 +18,13 @@ export const findVersionsTool = defineCollectionTool({
|
|
|
22
18
|
title: 'Find Versions',
|
|
23
19
|
},
|
|
24
20
|
description: DEFAULT_DESCRIPTION,
|
|
25
|
-
input:
|
|
26
|
-
|
|
27
|
-
.number()
|
|
28
|
-
.int()
|
|
29
|
-
.min(0)
|
|
30
|
-
.max(10)
|
|
31
|
-
.describe('How many levels deep to populate relationships in version documents')
|
|
32
|
-
.optional()
|
|
33
|
-
.default(0),
|
|
34
|
-
fallbackLocale: z
|
|
35
|
-
.string()
|
|
36
|
-
.describe('Optional: fallback locale code to use when requested locale is not available')
|
|
37
|
-
.optional(),
|
|
38
|
-
limit: z
|
|
39
|
-
.number()
|
|
40
|
-
.int()
|
|
41
|
-
.min(1)
|
|
42
|
-
.max(100)
|
|
43
|
-
.describe('Maximum number of versions to return (default: 10, max: 100)')
|
|
44
|
-
.optional()
|
|
45
|
-
.default(10),
|
|
46
|
-
locale: z
|
|
47
|
-
.string()
|
|
48
|
-
.describe(
|
|
49
|
-
'Optional: locale code to retrieve data in (e.g., "en", "es"). Use "all" to retrieve all locales for localized fields',
|
|
50
|
-
)
|
|
51
|
-
.optional(),
|
|
52
|
-
page: z
|
|
53
|
-
.number()
|
|
54
|
-
.int()
|
|
55
|
-
.min(1)
|
|
56
|
-
.describe('Page number for pagination (default: 1)')
|
|
57
|
-
.optional()
|
|
58
|
-
.default(1),
|
|
59
|
-
pagination: z
|
|
60
|
-
.boolean()
|
|
61
|
-
.describe('Optional: set to false to skip the count query overhead')
|
|
62
|
-
.optional(),
|
|
63
|
-
populate: z
|
|
64
|
-
.record(z.string(), z.unknown())
|
|
65
|
-
.describe(
|
|
66
|
-
'Optional: control which fields to include from populated relationship or upload documents.',
|
|
67
|
-
)
|
|
68
|
-
.optional(),
|
|
69
|
-
select: z
|
|
70
|
-
.record(z.string(), z.unknown())
|
|
71
|
-
.describe(
|
|
72
|
-
'Optional: define exactly which fields you\'d like to return in the response, e.g., {"version.title": true}',
|
|
73
|
-
)
|
|
74
|
-
.optional(),
|
|
75
|
-
showHiddenFields: z
|
|
76
|
-
.boolean()
|
|
77
|
-
.describe('Optional: include hidden fields in returned version documents')
|
|
78
|
-
.optional(),
|
|
79
|
-
sort: z
|
|
80
|
-
.string()
|
|
81
|
-
.describe('Field to sort by (e.g., "-updatedAt", "-version.updatedAt" for descending)')
|
|
82
|
-
.optional(),
|
|
83
|
-
trash: z
|
|
84
|
-
.boolean()
|
|
85
|
-
.describe('Optional: include versions for soft-deleted documents when trash is enabled')
|
|
86
|
-
.optional(),
|
|
87
|
-
where: whereSchema
|
|
88
|
-
.describe(
|
|
89
|
-
'Optional: where clause for filtering versions. Version document fields are usually under "version". Example: {"version.title":{"contains":"test"}}',
|
|
90
|
-
)
|
|
91
|
-
.optional(),
|
|
92
|
-
}),
|
|
93
|
-
}).handler(async ({ authorizedMCP, collectionSlug, input, req }) => {
|
|
21
|
+
input: findVersionsInputSchema,
|
|
22
|
+
}).handler(async ({ slug, authorizedMCP, input, req }) => {
|
|
94
23
|
const payload = req.payload
|
|
95
24
|
const logger = getLogger({ payload })
|
|
96
25
|
const {
|
|
97
26
|
depth,
|
|
27
|
+
draft,
|
|
98
28
|
fallbackLocale,
|
|
99
29
|
limit,
|
|
100
30
|
locale,
|
|
@@ -102,28 +32,27 @@ export const findVersionsTool = defineCollectionTool({
|
|
|
102
32
|
pagination,
|
|
103
33
|
populate,
|
|
104
34
|
select,
|
|
105
|
-
showHiddenFields,
|
|
106
35
|
sort,
|
|
107
36
|
trash,
|
|
108
37
|
where,
|
|
109
38
|
} = input
|
|
110
39
|
|
|
111
|
-
logger.info(`Finding versions in collection: ${
|
|
40
|
+
logger.info(`Finding versions in collection: ${slug}, limit: ${limit}, page: ${page}`)
|
|
112
41
|
|
|
113
42
|
try {
|
|
114
43
|
const result = await payload.findVersions({
|
|
115
|
-
collection:
|
|
44
|
+
collection: slug,
|
|
116
45
|
depth,
|
|
117
46
|
limit,
|
|
118
47
|
overrideAccess: authorizedMCP.overrideAccess,
|
|
119
48
|
page,
|
|
120
49
|
req,
|
|
121
|
-
...(
|
|
50
|
+
...(draft !== undefined ? { draft } : {}),
|
|
51
|
+
...(fallbackLocale !== undefined ? { fallbackLocale } : {}),
|
|
122
52
|
...(locale ? { locale } : {}),
|
|
123
53
|
...(pagination !== undefined ? { pagination } : {}),
|
|
124
|
-
...(populate ? { populate
|
|
125
|
-
...(select ? { select
|
|
126
|
-
...(showHiddenFields !== undefined ? { showHiddenFields } : {}),
|
|
54
|
+
...(populate ? { populate } : {}),
|
|
55
|
+
...(select ? { select } : {}),
|
|
127
56
|
...(sort ? { sort } : {}),
|
|
128
57
|
...(trash !== undefined ? { trash } : {}),
|
|
129
58
|
...(where ? { where } : {}),
|
|
@@ -133,19 +62,19 @@ export const findVersionsTool = defineCollectionTool({
|
|
|
133
62
|
content: [
|
|
134
63
|
{
|
|
135
64
|
type: 'text',
|
|
136
|
-
text: `Versions for collection "${
|
|
65
|
+
text: `Versions for collection "${slug}":\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``,
|
|
137
66
|
},
|
|
138
67
|
],
|
|
139
68
|
doc: result as unknown as Record<string, unknown>,
|
|
140
69
|
}
|
|
141
70
|
} catch (error) {
|
|
142
71
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
|
|
143
|
-
logger.error(`Error finding versions in ${
|
|
72
|
+
logger.error(`Error finding versions in ${slug}: ${errorMessage}`)
|
|
144
73
|
return {
|
|
145
74
|
content: [
|
|
146
75
|
{
|
|
147
76
|
type: 'text',
|
|
148
|
-
text: `❌ **Error finding versions in collection "${
|
|
77
|
+
text: `❌ **Error finding versions in collection "${slug}":** ${errorMessage}`,
|
|
149
78
|
},
|
|
150
79
|
],
|
|
151
80
|
isError: true,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { getAccessResults } from 'payload'
|
|
1
|
+
import { getAccessResults, getCollectionInputSchema, getCollectionSchemaInputSchema } from 'payload'
|
|
2
2
|
|
|
3
3
|
import { defaultAccess } from '../../../defaultAccess.js'
|
|
4
4
|
import { defineCollectionTool } from '../../../defineTool.js'
|
|
5
|
-
import { getCollectionInputSchema } from '../../../utils/schemaConversion/getEntityInputSchema.js'
|
|
6
5
|
|
|
7
6
|
export const getCollectionSchemaTool = defineCollectionTool({
|
|
8
7
|
access: (args) => {
|
|
9
|
-
const permissions = args.permissions?.collections?.[args.
|
|
8
|
+
const permissions = args.permissions?.collections?.[args.slug]
|
|
10
9
|
|
|
11
10
|
return defaultAccess(args) && Boolean(permissions?.create || permissions?.update)
|
|
12
11
|
},
|
|
@@ -18,17 +17,18 @@ export const getCollectionSchemaTool = defineCollectionTool({
|
|
|
18
17
|
title: 'Get Collection Schema',
|
|
19
18
|
},
|
|
20
19
|
description: 'Get the input schema for creating or updating documents in a collection.',
|
|
21
|
-
|
|
20
|
+
input: getCollectionSchemaInputSchema,
|
|
21
|
+
}).handler(async ({ slug, authorizedMCP, req }) => {
|
|
22
22
|
const permissions = authorizedMCP.overrideAccess
|
|
23
23
|
? null
|
|
24
|
-
: (await getAccessResults({ req })).collections?.[
|
|
24
|
+
: (await getAccessResults({ req })).collections?.[slug]
|
|
25
25
|
|
|
26
26
|
if (!authorizedMCP.overrideAccess && !permissions?.create && !permissions?.update) {
|
|
27
27
|
return {
|
|
28
28
|
content: [
|
|
29
29
|
{
|
|
30
30
|
type: 'text',
|
|
31
|
-
text: `Error: MCP access to "getCollectionSchema" is not enabled for collection "${
|
|
31
|
+
text: `Error: MCP access to "getCollectionSchema" is not enabled for collection "${slug}"`,
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
34
|
isError: true,
|
|
@@ -36,28 +36,45 @@ export const getCollectionSchemaTool = defineCollectionTool({
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const inputSchema = getCollectionInputSchema({
|
|
39
|
-
collectionSlug,
|
|
39
|
+
collectionSlug: slug,
|
|
40
40
|
req,
|
|
41
41
|
...(permissions ? { permissions } : {}),
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
if (!inputSchema) {
|
|
45
45
|
return {
|
|
46
|
-
content: [{ type: 'text', text: `Error: Collection "${
|
|
46
|
+
content: [{ type: 'text', text: `Error: Collection "${slug}" not found` }],
|
|
47
47
|
isError: true,
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const uploadConfig = req.payload.collections[slug]?.config.upload
|
|
52
|
+
const maxFileSize = req.payload.config.upload.limits?.fileSize
|
|
53
|
+
const upload = uploadConfig
|
|
54
|
+
? {
|
|
55
|
+
enabled: true,
|
|
56
|
+
filesRequiredOnCreate: uploadConfig.filesRequiredOnCreate !== false,
|
|
57
|
+
mimeTypes: uploadConfig.mimeTypes ?? ['*/*'],
|
|
58
|
+
sources: [
|
|
59
|
+
...(uploadConfig.pasteURL !== false ? ['externalURL'] : []),
|
|
60
|
+
'base64',
|
|
61
|
+
'uploadReference',
|
|
62
|
+
],
|
|
63
|
+
...(typeof maxFileSize === 'number' && Number.isFinite(maxFileSize) ? { maxFileSize } : {}),
|
|
64
|
+
}
|
|
65
|
+
: { enabled: false }
|
|
66
|
+
|
|
51
67
|
return {
|
|
52
68
|
content: [
|
|
53
69
|
{
|
|
54
70
|
type: 'text',
|
|
55
|
-
text: `Schema for collection "${
|
|
71
|
+
text: `Schema for collection "${slug}":\n\`\`\`json\n${JSON.stringify(inputSchema)}\n\`\`\`\nUpload configuration:\n\`\`\`json\n${JSON.stringify(upload)}\n\`\`\``,
|
|
56
72
|
},
|
|
57
73
|
],
|
|
58
74
|
structuredContent: {
|
|
59
|
-
|
|
75
|
+
slug,
|
|
60
76
|
schema: inputSchema,
|
|
77
|
+
upload,
|
|
61
78
|
},
|
|
62
79
|
}
|
|
63
80
|
})
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod'
|
|
1
|
+
import { restoreVersionInputSchema } from 'payload'
|
|
4
2
|
|
|
5
3
|
import { defaultAccess } from '../../../defaultAccess.js'
|
|
6
4
|
import { defineCollectionTool } from '../../../defineTool.js'
|
|
@@ -11,7 +9,7 @@ const DEFAULT_DESCRIPTION =
|
|
|
11
9
|
|
|
12
10
|
export const restoreVersionTool = defineCollectionTool({
|
|
13
11
|
access: (args) =>
|
|
14
|
-
defaultAccess(args) && Boolean(args.permissions?.collections?.[args.
|
|
12
|
+
defaultAccess(args) && Boolean(args.permissions?.collections?.[args.slug]?.update),
|
|
15
13
|
annotations: {
|
|
16
14
|
destructiveHint: true,
|
|
17
15
|
idempotentHint: false,
|
|
@@ -20,85 +18,45 @@ export const restoreVersionTool = defineCollectionTool({
|
|
|
20
18
|
title: 'Restore Version',
|
|
21
19
|
},
|
|
22
20
|
description: DEFAULT_DESCRIPTION,
|
|
23
|
-
input:
|
|
24
|
-
|
|
25
|
-
depth: z
|
|
26
|
-
.number()
|
|
27
|
-
.int()
|
|
28
|
-
.min(0)
|
|
29
|
-
.max(10)
|
|
30
|
-
.describe('How many levels deep to populate relationships in response')
|
|
31
|
-
.optional()
|
|
32
|
-
.default(0),
|
|
33
|
-
draft: z
|
|
34
|
-
.boolean()
|
|
35
|
-
.describe('Whether to restore the version as a draft')
|
|
36
|
-
.optional()
|
|
37
|
-
.default(false),
|
|
38
|
-
fallbackLocale: z
|
|
39
|
-
.string()
|
|
40
|
-
.describe('Optional: fallback locale code to use when requested locale is not available')
|
|
41
|
-
.optional(),
|
|
42
|
-
locale: z
|
|
43
|
-
.string()
|
|
44
|
-
.describe('Optional: locale code to restore in (e.g., "en", "es")')
|
|
45
|
-
.optional(),
|
|
46
|
-
populate: z
|
|
47
|
-
.record(z.string(), z.unknown())
|
|
48
|
-
.describe(
|
|
49
|
-
'Optional: control which fields to include from populated relationship or upload documents.',
|
|
50
|
-
)
|
|
51
|
-
.optional(),
|
|
52
|
-
select: z
|
|
53
|
-
.record(z.string(), z.unknown())
|
|
54
|
-
.describe(
|
|
55
|
-
'Optional: define exactly which fields you\'d like to return in the response, e.g., {"title": true}',
|
|
56
|
-
)
|
|
57
|
-
.optional(),
|
|
58
|
-
showHiddenFields: z
|
|
59
|
-
.boolean()
|
|
60
|
-
.describe('Optional: include hidden fields in the restored document response')
|
|
61
|
-
.optional(),
|
|
62
|
-
}),
|
|
63
|
-
}).handler(async ({ authorizedMCP, collectionSlug, input, req }) => {
|
|
21
|
+
input: restoreVersionInputSchema,
|
|
22
|
+
}).handler(async ({ slug, authorizedMCP, input, req }) => {
|
|
64
23
|
const payload = req.payload
|
|
65
24
|
const logger = getLogger({ payload })
|
|
66
|
-
const { id, depth, draft, fallbackLocale, locale, populate, select
|
|
25
|
+
const { id, depth, draft, fallbackLocale, locale, populate, select } = input
|
|
67
26
|
|
|
68
|
-
logger.info(`Restoring version in collection: ${
|
|
27
|
+
logger.info(`Restoring version in collection: ${slug} with ID: ${id}`)
|
|
69
28
|
|
|
70
29
|
try {
|
|
71
30
|
const result = await payload.restoreVersion({
|
|
72
|
-
id,
|
|
73
|
-
collection:
|
|
31
|
+
id: String(id),
|
|
32
|
+
collection: slug,
|
|
74
33
|
depth,
|
|
75
34
|
draft,
|
|
76
35
|
overrideAccess: authorizedMCP.overrideAccess,
|
|
77
36
|
req,
|
|
78
|
-
...(fallbackLocale ? { fallbackLocale } : {}),
|
|
37
|
+
...(fallbackLocale !== undefined ? { fallbackLocale } : {}),
|
|
79
38
|
...(locale ? { locale } : {}),
|
|
80
|
-
...(populate ? { populate
|
|
81
|
-
...(select ? { select
|
|
82
|
-
...(showHiddenFields !== undefined ? { showHiddenFields } : {}),
|
|
39
|
+
...(populate ? { populate } : {}),
|
|
40
|
+
...(select ? { select } : {}),
|
|
83
41
|
})
|
|
84
42
|
|
|
85
43
|
return {
|
|
86
44
|
content: [
|
|
87
45
|
{
|
|
88
46
|
type: 'text',
|
|
89
|
-
text: `Version "${id}" restored successfully in collection "${
|
|
47
|
+
text: `Version "${id}" restored successfully in collection "${slug}"!\nRestored document:\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``,
|
|
90
48
|
},
|
|
91
49
|
],
|
|
92
50
|
doc: result as Record<string, unknown>,
|
|
93
51
|
}
|
|
94
52
|
} catch (error) {
|
|
95
53
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
|
|
96
|
-
logger.error(`Error restoring version ${id} in ${
|
|
54
|
+
logger.error(`Error restoring version ${id} in ${slug}: ${errorMessage}`)
|
|
97
55
|
return {
|
|
98
56
|
content: [
|
|
99
57
|
{
|
|
100
58
|
type: 'text',
|
|
101
|
-
text: `❌ **Error restoring version "${id}" in collection "${
|
|
59
|
+
text: `❌ **Error restoring version "${id}" in collection "${slug}":** ${errorMessage}`,
|
|
102
60
|
},
|
|
103
61
|
],
|
|
104
62
|
isError: true,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Where } from 'payload'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
getCollectionInputSchema,
|
|
5
|
+
getCollectionVirtualFieldNames,
|
|
6
|
+
stripVirtualFields,
|
|
7
|
+
transformPointDataToPayload,
|
|
8
|
+
updateDocumentInputSchema,
|
|
9
|
+
validateCollectionData,
|
|
10
|
+
} from 'payload'
|
|
4
11
|
|
|
5
12
|
import { defaultAccess } from '../../../defaultAccess.js'
|
|
6
13
|
import { defineCollectionTool } from '../../../defineTool.js'
|
|
7
14
|
import { getLogger } from '../../../utils/getLogger.js'
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
stripVirtualFields,
|
|
11
|
-
} from '../../../utils/getVirtualFieldNames.js'
|
|
12
|
-
import { getCollectionInputSchema } from '../../../utils/schemaConversion/getEntityInputSchema.js'
|
|
13
|
-
import { transformPointDataToPayload } from '../../../utils/transformPointDataToPayload.js'
|
|
14
|
-
import { whereSchema } from '../../../utils/whereSchema.js'
|
|
15
|
-
import { validateCollectionData } from '../validateEntityData.js'
|
|
16
|
-
import { formatCollectionError } from './formatCollectionError.js'
|
|
15
|
+
import { formatEntityError } from '../formatEntityError.js'
|
|
16
|
+
import { fileInputSchema, resolveFile } from './fileInput.js'
|
|
17
17
|
|
|
18
18
|
const DEFAULT_DESCRIPTION =
|
|
19
|
-
'Update documents
|
|
19
|
+
'Update documents. Prefer uploadReference after upload, externalURL for URLs, or base64 for small local files.'
|
|
20
20
|
|
|
21
21
|
export const updateDocumentTool = defineCollectionTool({
|
|
22
22
|
access: (args) =>
|
|
23
|
-
defaultAccess(args) && Boolean(args.permissions?.collections?.[args.
|
|
23
|
+
defaultAccess(args) && Boolean(args.permissions?.collections?.[args.slug]?.update),
|
|
24
24
|
annotations: {
|
|
25
25
|
destructiveHint: true,
|
|
26
26
|
idempotentHint: false,
|
|
@@ -29,53 +29,8 @@ export const updateDocumentTool = defineCollectionTool({
|
|
|
29
29
|
title: 'Update Document',
|
|
30
30
|
},
|
|
31
31
|
description: DEFAULT_DESCRIPTION,
|
|
32
|
-
input:
|
|
33
|
-
|
|
34
|
-
data: z.record(z.string(), z.unknown()).describe('The fields to update'),
|
|
35
|
-
depth: z
|
|
36
|
-
.number()
|
|
37
|
-
.describe('How many levels deep to populate relationships')
|
|
38
|
-
.optional()
|
|
39
|
-
.default(0),
|
|
40
|
-
draft: z
|
|
41
|
-
.boolean()
|
|
42
|
-
.describe('Whether to update the document as a draft')
|
|
43
|
-
.optional()
|
|
44
|
-
.default(false),
|
|
45
|
-
fallbackLocale: z
|
|
46
|
-
.string()
|
|
47
|
-
.describe('Optional: fallback locale code to use when requested locale is not available')
|
|
48
|
-
.optional(),
|
|
49
|
-
filePath: z.string().describe('File path for file uploads').optional(),
|
|
50
|
-
locale: z
|
|
51
|
-
.string()
|
|
52
|
-
.describe(
|
|
53
|
-
'Optional: locale code to update the document in (e.g., "en", "es"). Defaults to the default locale',
|
|
54
|
-
)
|
|
55
|
-
.optional(),
|
|
56
|
-
overrideLock: z
|
|
57
|
-
.boolean()
|
|
58
|
-
.describe('Whether to override document locks')
|
|
59
|
-
.optional()
|
|
60
|
-
.default(true),
|
|
61
|
-
overwriteExistingFiles: z
|
|
62
|
-
.boolean()
|
|
63
|
-
.describe('Whether to overwrite existing files')
|
|
64
|
-
.optional()
|
|
65
|
-
.default(false),
|
|
66
|
-
select: z
|
|
67
|
-
.record(z.string(), z.unknown())
|
|
68
|
-
.describe(
|
|
69
|
-
'Optional: define exactly which fields you\'d like to return in the response, e.g., {"title": true}',
|
|
70
|
-
)
|
|
71
|
-
.optional(),
|
|
72
|
-
where: whereSchema
|
|
73
|
-
.describe(
|
|
74
|
-
'Where clause to update multiple documents. Use field names with Payload operators, and/or arrays for grouping. Example: {"title":{"contains":"test"}}',
|
|
75
|
-
)
|
|
76
|
-
.optional(),
|
|
77
|
-
}),
|
|
78
|
-
}).handler(async ({ authorizedMCP, collectionSlug, input, req }) => {
|
|
32
|
+
input: updateDocumentInputSchema({ file: fileInputSchema }),
|
|
33
|
+
}).handler(async ({ slug, authorizedMCP, input, req }) => {
|
|
79
34
|
const payload = req.payload
|
|
80
35
|
const logger = getLogger({ payload })
|
|
81
36
|
|
|
@@ -85,64 +40,63 @@ export const updateDocumentTool = defineCollectionTool({
|
|
|
85
40
|
depth,
|
|
86
41
|
draft,
|
|
87
42
|
fallbackLocale,
|
|
88
|
-
|
|
43
|
+
file: fileInput,
|
|
44
|
+
limit,
|
|
89
45
|
locale,
|
|
90
46
|
overrideLock,
|
|
91
|
-
|
|
47
|
+
populate,
|
|
48
|
+
publishAllLocales,
|
|
92
49
|
select,
|
|
50
|
+
sort,
|
|
51
|
+
trash,
|
|
52
|
+
unpublishAllLocales,
|
|
93
53
|
where,
|
|
94
54
|
} = input
|
|
95
55
|
|
|
96
56
|
logger.info(
|
|
97
|
-
`Updating document in collection: ${
|
|
57
|
+
`Updating document in collection: ${slug}${id ? ` with ID: ${id}` : ' with where clause'}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`,
|
|
98
58
|
)
|
|
99
59
|
|
|
100
60
|
try {
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
content: [{ type: 'text', text: 'Error: Either id or where clause must be provided' }],
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const virtualFieldNames = getCollectionVirtualFieldNames(payload.config, collectionSlug)
|
|
61
|
+
const virtualFieldNames = getCollectionVirtualFieldNames(payload.config, slug)
|
|
108
62
|
const inputData = stripVirtualFields(data, virtualFieldNames)
|
|
109
|
-
|
|
110
|
-
|
|
63
|
+
validateCollectionData({
|
|
64
|
+
slug,
|
|
111
65
|
data: inputData,
|
|
112
66
|
partial: true,
|
|
113
67
|
req,
|
|
114
68
|
})
|
|
115
69
|
|
|
116
|
-
if (validationError) {
|
|
117
|
-
return validationError
|
|
118
|
-
}
|
|
119
|
-
|
|
120
70
|
const parsedData = transformPointDataToPayload(inputData)
|
|
71
|
+
const file = await resolveFile({ slug, input: fileInput, req })
|
|
121
72
|
|
|
122
73
|
const whereClause: Where = where ?? {}
|
|
123
74
|
|
|
124
|
-
if (id) {
|
|
75
|
+
if (id !== undefined) {
|
|
125
76
|
const result = await payload.update({
|
|
126
77
|
id,
|
|
127
|
-
collection:
|
|
78
|
+
collection: slug,
|
|
128
79
|
data: parsedData,
|
|
129
80
|
depth,
|
|
130
81
|
draft,
|
|
82
|
+
fallbackLocale,
|
|
83
|
+
locale,
|
|
131
84
|
overrideAccess: authorizedMCP.overrideAccess,
|
|
132
85
|
overrideLock,
|
|
86
|
+
populate,
|
|
87
|
+
publishAllLocales,
|
|
133
88
|
req,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
...(
|
|
138
|
-
...(select ? { select: select as SelectType } : {}),
|
|
89
|
+
select,
|
|
90
|
+
trash,
|
|
91
|
+
unpublishAllLocales,
|
|
92
|
+
...(file ? { file } : {}),
|
|
139
93
|
})
|
|
140
94
|
|
|
141
95
|
return {
|
|
142
96
|
content: [
|
|
143
97
|
{
|
|
144
98
|
type: 'text',
|
|
145
|
-
text: `Document updated successfully in collection "${
|
|
99
|
+
text: `Document updated successfully in collection "${slug}"!\nUpdated document:\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``,
|
|
146
100
|
},
|
|
147
101
|
],
|
|
148
102
|
doc: result as Record<string, unknown>,
|
|
@@ -150,32 +104,37 @@ export const updateDocumentTool = defineCollectionTool({
|
|
|
150
104
|
}
|
|
151
105
|
|
|
152
106
|
const result = await payload.update({
|
|
153
|
-
collection:
|
|
107
|
+
collection: slug,
|
|
154
108
|
data: parsedData,
|
|
155
109
|
depth,
|
|
156
110
|
draft,
|
|
111
|
+
fallbackLocale,
|
|
112
|
+
limit,
|
|
113
|
+
locale,
|
|
157
114
|
overrideAccess: authorizedMCP.overrideAccess,
|
|
158
115
|
overrideLock,
|
|
116
|
+
populate,
|
|
117
|
+
publishAllLocales,
|
|
159
118
|
req,
|
|
119
|
+
select,
|
|
120
|
+
sort,
|
|
121
|
+
trash,
|
|
122
|
+
unpublishAllLocales,
|
|
160
123
|
where: whereClause,
|
|
161
|
-
...(
|
|
162
|
-
...(overwriteExistingFiles ? { overwriteExistingFiles } : {}),
|
|
163
|
-
...(locale ? { locale } : {}),
|
|
164
|
-
...(fallbackLocale ? { fallbackLocale } : {}),
|
|
165
|
-
...(select ? { select: select as SelectType } : {}),
|
|
124
|
+
...(file ? { file } : {}),
|
|
166
125
|
})
|
|
167
126
|
|
|
168
127
|
const docs = result.docs || []
|
|
169
128
|
const errors = result.errors || []
|
|
170
129
|
|
|
171
|
-
let responseText = `Multiple documents updated in collection "${
|
|
130
|
+
let responseText = `Multiple documents updated in collection "${slug}"!\nUpdated: ${docs.length} documents\nErrors: ${errors.length}\n---`
|
|
172
131
|
if (docs.length > 0) {
|
|
173
132
|
responseText += `\n\nUpdated documents:\n\`\`\`json\n${JSON.stringify(docs)}\n\`\`\``
|
|
174
133
|
}
|
|
175
134
|
if (errors.length > 0) {
|
|
176
135
|
responseText += `\n\nErrors:\n\`\`\`json\n${JSON.stringify(errors)}\n\`\`\``
|
|
177
136
|
|
|
178
|
-
const errorSchema = getCollectionInputSchema({ collectionSlug, req })
|
|
137
|
+
const errorSchema = getCollectionInputSchema({ collectionSlug: slug, req })
|
|
179
138
|
|
|
180
139
|
if (errorSchema) {
|
|
181
140
|
responseText += `\n\nUse this schema for data:\n\`\`\`json\n${JSON.stringify(errorSchema)}\n\`\`\``
|
|
@@ -188,7 +147,7 @@ export const updateDocumentTool = defineCollectionTool({
|
|
|
188
147
|
...(errorSchema
|
|
189
148
|
? {
|
|
190
149
|
structuredContent: {
|
|
191
|
-
|
|
150
|
+
slug,
|
|
192
151
|
docs,
|
|
193
152
|
errors,
|
|
194
153
|
schema: errorSchema,
|
|
@@ -204,7 +163,7 @@ export const updateDocumentTool = defineCollectionTool({
|
|
|
204
163
|
}
|
|
205
164
|
} catch (error) {
|
|
206
165
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
|
|
207
|
-
logger.error(`Error updating document in ${
|
|
208
|
-
return
|
|
166
|
+
logger.error(`Error updating document in ${slug}: ${errorMessage}`)
|
|
167
|
+
return formatEntityError({ slug, action: 'updating', entity: 'collection', error, req })
|
|
209
168
|
}
|
|
210
169
|
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { strictObject, z } from 'payload'
|
|
2
|
+
import { getUploadInstructions as getPayloadUploadInstructions } from 'payload/internal'
|
|
3
|
+
|
|
4
|
+
import { defaultAccess } from '../../../defaultAccess.js'
|
|
5
|
+
import { defineCollectionTool } from '../../../defineTool.js'
|
|
6
|
+
|
|
7
|
+
export const getUploadInstructionsTool = defineCollectionTool({
|
|
8
|
+
access: (args) =>
|
|
9
|
+
defaultAccess(args) &&
|
|
10
|
+
Boolean(
|
|
11
|
+
args.permissions?.collections?.[args.slug]?.create ||
|
|
12
|
+
args.permissions?.collections?.[args.slug]?.update,
|
|
13
|
+
),
|
|
14
|
+
annotations: {
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
readOnlyHint: false,
|
|
19
|
+
title: 'Get Upload Instructions',
|
|
20
|
+
},
|
|
21
|
+
description:
|
|
22
|
+
'Prepare uploads for createDocuments or updateDocument. This does not upload bytes; finish the returned action before use.',
|
|
23
|
+
input: strictObject({
|
|
24
|
+
docPrefix: z.optional(z.string()).check(z.describe('Document folder or prefix.')),
|
|
25
|
+
filename: z.string().check(z.describe('The original file name.')),
|
|
26
|
+
filesize: z.int().check(z.nonnegative(), z.describe('The file size in bytes.')),
|
|
27
|
+
mimeType: z.string().check(z.describe('The file MIME type.')),
|
|
28
|
+
}),
|
|
29
|
+
}).handler(async ({ slug, authorizedMCP, input, req }) => {
|
|
30
|
+
try {
|
|
31
|
+
const instructions = await getPayloadUploadInstructions({
|
|
32
|
+
...input,
|
|
33
|
+
collectionSlug: slug,
|
|
34
|
+
overrideAccess: authorizedMCP.overrideAccess,
|
|
35
|
+
req,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const nextStep =
|
|
39
|
+
instructions.type === 'http'
|
|
40
|
+
? 'Upload bytes with instructions.request. After success, pass { source: "uploadReference", file: instructions.file }.'
|
|
41
|
+
: `Call "${instructions.name}" with file and data. After success, pass { source: "uploadReference", file: instructions.file }.`
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: `Upload instructions for collection "${slug}":\n\`\`\`json\n${JSON.stringify(instructions)}\n\`\`\`\n${nextStep}`,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
structuredContent: { instructions },
|
|
51
|
+
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : 'Unknown error'
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{
|
|
57
|
+
type: 'text',
|
|
58
|
+
text: `Error getting upload instructions for collection "${slug}": ${message}`,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
isError: true,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
})
|