@payloadcms/plugin-mcp 4.0.0-internal.5b1e7cd → 4.0.0-internal.688c4d0
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 +39 -0
- package/dist/@types/assets.d.js +2 -0
- package/dist/@types/assets.d.js.map +1 -0
- package/dist/collection/getAccessField.d.ts +12 -0
- package/dist/collection/getAccessField.d.ts.map +1 -0
- package/dist/collection/getAccessField.js +72 -0
- package/dist/collection/getAccessField.js.map +1 -0
- package/dist/collection/index.d.ts +6 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +105 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/components/APIKeyField/index.client.d.ts +9 -0
- package/dist/components/APIKeyField/index.client.d.ts.map +1 -0
- package/dist/components/APIKeyField/index.client.js +85 -0
- package/dist/components/APIKeyField/index.client.js.map +1 -0
- package/dist/components/APIKeyField/index.css +105 -0
- package/dist/components/APIKeysEmptyState/index.client.d.ts +4 -0
- package/dist/components/APIKeysEmptyState/index.client.d.ts.map +1 -0
- package/dist/components/APIKeysEmptyState/index.client.js +21 -0
- package/dist/components/APIKeysEmptyState/index.client.js.map +1 -0
- package/dist/components/AccessField/index.client.d.ts +10 -0
- package/dist/components/AccessField/index.client.d.ts.map +1 -0
- package/dist/components/AccessField/index.client.js +247 -0
- package/dist/components/AccessField/index.client.js.map +1 -0
- package/dist/components/AccessField/index.css +99 -0
- package/dist/components/SettingsMenu/index.client.d.ts +8 -0
- package/dist/components/SettingsMenu/index.client.d.ts.map +1 -0
- package/dist/components/SettingsMenu/index.client.js +29 -0
- package/dist/components/SettingsMenu/index.client.js.map +1 -0
- package/dist/defineTool.d.ts +26 -0
- package/dist/defineTool.d.ts.map +1 -0
- package/dist/defineTool.js +37 -0
- package/dist/defineTool.js.map +1 -0
- package/dist/endpoint/access.d.ts +10 -0
- package/dist/endpoint/access.d.ts.map +1 -0
- package/dist/endpoint/access.js +122 -0
- package/dist/endpoint/access.js.map +1 -0
- package/dist/endpoint/index.d.ts +3 -0
- package/dist/endpoint/index.d.ts.map +1 -0
- package/dist/endpoint/index.js +36 -0
- package/dist/endpoint/index.js.map +1 -0
- package/dist/exports/client.d.ts +5 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +7 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +87 -67
- package/dist/index.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts +19 -0
- package/dist/mcp/buildMcpServer.d.ts.map +1 -0
- package/dist/mcp/buildMcpServer.js +199 -0
- package/dist/mcp/buildMcpServer.js.map +1 -0
- package/dist/mcp/builtin/collections/authTools.d.ts +7 -0
- package/dist/mcp/builtin/collections/authTools.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/authTools.js +250 -0
- package/dist/mcp/builtin/collections/authTools.js.map +1 -0
- package/dist/mcp/builtin/collections/createTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/createTool.js +94 -0
- package/dist/mcp/builtin/collections/createTool.js.map +1 -0
- package/dist/mcp/builtin/collections/deleteTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/deleteTool.js +102 -0
- package/dist/mcp/builtin/collections/deleteTool.js.map +1 -0
- package/dist/mcp/builtin/collections/findTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findTool.js +144 -0
- package/dist/mcp/builtin/collections/findTool.js.map +1 -0
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts +9 -0
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/formatCollectionError.js +60 -0
- package/dist/mcp/builtin/collections/formatCollectionError.js.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +35 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/collections/updateTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/updateTool.js +199 -0
- package/dist/mcp/builtin/collections/updateTool.js.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts +2 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.js +49 -0
- package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/findTool.js +76 -0
- package/dist/mcp/builtin/globals/findTool.js.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +35 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.js +94 -0
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -0
- package/dist/mcp/builtin/validateEntityData.d.ts +14 -0
- package/dist/mcp/builtin/validateEntityData.d.ts.map +1 -0
- package/dist/mcp/builtin/validateEntityData.js +82 -0
- package/dist/mcp/builtin/validateEntityData.js.map +1 -0
- package/dist/mcp/builtinTools.d.ts +105 -0
- package/dist/mcp/builtinTools.d.ts.map +1 -0
- package/dist/mcp/builtinTools.js +107 -0
- package/dist/mcp/builtinTools.js.map +1 -0
- package/dist/mcp/sanitizeMCPConfig.d.ts +17 -0
- package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -0
- package/dist/mcp/sanitizeMCPConfig.js +188 -0
- package/dist/mcp/sanitizeMCPConfig.js.map +1 -0
- package/dist/stdio.d.ts +8 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +89 -0
- package/dist/stdio.js.map +1 -0
- package/dist/translations/index.d.ts +11 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +92 -0
- package/dist/translations/index.js.map +1 -0
- package/dist/translations/languages/ar.d.ts +31 -0
- package/dist/translations/languages/ar.d.ts.map +1 -0
- package/dist/translations/languages/ar.js +34 -0
- package/dist/translations/languages/ar.js.map +1 -0
- package/dist/translations/languages/az.d.ts +31 -0
- package/dist/translations/languages/az.d.ts.map +1 -0
- package/dist/translations/languages/az.js +34 -0
- package/dist/translations/languages/az.js.map +1 -0
- package/dist/translations/languages/bg.d.ts +31 -0
- package/dist/translations/languages/bg.d.ts.map +1 -0
- package/dist/translations/languages/bg.js +34 -0
- package/dist/translations/languages/bg.js.map +1 -0
- package/dist/translations/languages/bnBd.d.ts +31 -0
- package/dist/translations/languages/bnBd.d.ts.map +1 -0
- package/dist/translations/languages/bnBd.js +34 -0
- package/dist/translations/languages/bnBd.js.map +1 -0
- package/dist/translations/languages/bnIn.d.ts +31 -0
- package/dist/translations/languages/bnIn.d.ts.map +1 -0
- package/dist/translations/languages/bnIn.js +34 -0
- package/dist/translations/languages/bnIn.js.map +1 -0
- package/dist/translations/languages/ca.d.ts +31 -0
- package/dist/translations/languages/ca.d.ts.map +1 -0
- package/dist/translations/languages/ca.js +34 -0
- package/dist/translations/languages/ca.js.map +1 -0
- package/dist/translations/languages/cs.d.ts +31 -0
- package/dist/translations/languages/cs.d.ts.map +1 -0
- package/dist/translations/languages/cs.js +34 -0
- package/dist/translations/languages/cs.js.map +1 -0
- package/dist/translations/languages/da.d.ts +31 -0
- package/dist/translations/languages/da.d.ts.map +1 -0
- package/dist/translations/languages/da.js +34 -0
- package/dist/translations/languages/da.js.map +1 -0
- package/dist/translations/languages/de.d.ts +31 -0
- package/dist/translations/languages/de.d.ts.map +1 -0
- package/dist/translations/languages/de.js +34 -0
- package/dist/translations/languages/de.js.map +1 -0
- package/dist/translations/languages/en.d.ts +31 -0
- package/dist/translations/languages/en.d.ts.map +1 -0
- package/dist/translations/languages/en.js +34 -0
- package/dist/translations/languages/en.js.map +1 -0
- package/dist/translations/languages/es.d.ts +31 -0
- package/dist/translations/languages/es.d.ts.map +1 -0
- package/dist/translations/languages/es.js +34 -0
- package/dist/translations/languages/es.js.map +1 -0
- package/dist/translations/languages/et.d.ts +31 -0
- package/dist/translations/languages/et.d.ts.map +1 -0
- package/dist/translations/languages/et.js +34 -0
- package/dist/translations/languages/et.js.map +1 -0
- package/dist/translations/languages/fa.d.ts +31 -0
- package/dist/translations/languages/fa.d.ts.map +1 -0
- package/dist/translations/languages/fa.js +34 -0
- package/dist/translations/languages/fa.js.map +1 -0
- package/dist/translations/languages/fr.d.ts +31 -0
- package/dist/translations/languages/fr.d.ts.map +1 -0
- package/dist/translations/languages/fr.js +34 -0
- package/dist/translations/languages/fr.js.map +1 -0
- package/dist/translations/languages/he.d.ts +31 -0
- package/dist/translations/languages/he.d.ts.map +1 -0
- package/dist/translations/languages/he.js +34 -0
- package/dist/translations/languages/he.js.map +1 -0
- package/dist/translations/languages/hr.d.ts +31 -0
- package/dist/translations/languages/hr.d.ts.map +1 -0
- package/dist/translations/languages/hr.js +34 -0
- package/dist/translations/languages/hr.js.map +1 -0
- package/dist/translations/languages/hu.d.ts +31 -0
- package/dist/translations/languages/hu.d.ts.map +1 -0
- package/dist/translations/languages/hu.js +34 -0
- package/dist/translations/languages/hu.js.map +1 -0
- package/dist/translations/languages/hy.d.ts +31 -0
- package/dist/translations/languages/hy.d.ts.map +1 -0
- package/dist/translations/languages/hy.js +34 -0
- package/dist/translations/languages/hy.js.map +1 -0
- package/dist/translations/languages/id.d.ts +31 -0
- package/dist/translations/languages/id.d.ts.map +1 -0
- package/dist/translations/languages/id.js +34 -0
- package/dist/translations/languages/id.js.map +1 -0
- package/dist/translations/languages/is.d.ts +31 -0
- package/dist/translations/languages/is.d.ts.map +1 -0
- package/dist/translations/languages/is.js +34 -0
- package/dist/translations/languages/is.js.map +1 -0
- package/dist/translations/languages/it.d.ts +31 -0
- package/dist/translations/languages/it.d.ts.map +1 -0
- package/dist/translations/languages/it.js +34 -0
- package/dist/translations/languages/it.js.map +1 -0
- package/dist/translations/languages/ja.d.ts +31 -0
- package/dist/translations/languages/ja.d.ts.map +1 -0
- package/dist/translations/languages/ja.js +34 -0
- package/dist/translations/languages/ja.js.map +1 -0
- package/dist/translations/languages/ko.d.ts +31 -0
- package/dist/translations/languages/ko.d.ts.map +1 -0
- package/dist/translations/languages/ko.js +34 -0
- package/dist/translations/languages/ko.js.map +1 -0
- package/dist/translations/languages/lt.d.ts +31 -0
- package/dist/translations/languages/lt.d.ts.map +1 -0
- package/dist/translations/languages/lt.js +34 -0
- package/dist/translations/languages/lt.js.map +1 -0
- package/dist/translations/languages/lv.d.ts +31 -0
- package/dist/translations/languages/lv.d.ts.map +1 -0
- package/dist/translations/languages/lv.js +34 -0
- package/dist/translations/languages/lv.js.map +1 -0
- package/dist/translations/languages/my.d.ts +31 -0
- package/dist/translations/languages/my.d.ts.map +1 -0
- package/dist/translations/languages/my.js +34 -0
- package/dist/translations/languages/my.js.map +1 -0
- package/dist/translations/languages/nb.d.ts +31 -0
- package/dist/translations/languages/nb.d.ts.map +1 -0
- package/dist/translations/languages/nb.js +34 -0
- package/dist/translations/languages/nb.js.map +1 -0
- package/dist/translations/languages/nl.d.ts +31 -0
- package/dist/translations/languages/nl.d.ts.map +1 -0
- package/dist/translations/languages/nl.js +34 -0
- package/dist/translations/languages/nl.js.map +1 -0
- package/dist/translations/languages/pl.d.ts +31 -0
- package/dist/translations/languages/pl.d.ts.map +1 -0
- package/dist/translations/languages/pl.js +34 -0
- package/dist/translations/languages/pl.js.map +1 -0
- package/dist/translations/languages/pt.d.ts +31 -0
- package/dist/translations/languages/pt.d.ts.map +1 -0
- package/dist/translations/languages/pt.js +34 -0
- package/dist/translations/languages/pt.js.map +1 -0
- package/dist/translations/languages/ro.d.ts +31 -0
- package/dist/translations/languages/ro.d.ts.map +1 -0
- package/dist/translations/languages/ro.js +34 -0
- package/dist/translations/languages/ro.js.map +1 -0
- package/dist/translations/languages/rs.d.ts +31 -0
- package/dist/translations/languages/rs.d.ts.map +1 -0
- package/dist/translations/languages/rs.js +34 -0
- package/dist/translations/languages/rs.js.map +1 -0
- package/dist/translations/languages/rsLatin.d.ts +31 -0
- package/dist/translations/languages/rsLatin.d.ts.map +1 -0
- package/dist/translations/languages/rsLatin.js +34 -0
- package/dist/translations/languages/rsLatin.js.map +1 -0
- package/dist/translations/languages/ru.d.ts +31 -0
- package/dist/translations/languages/ru.d.ts.map +1 -0
- package/dist/translations/languages/ru.js +34 -0
- package/dist/translations/languages/ru.js.map +1 -0
- package/dist/translations/languages/sk.d.ts +31 -0
- package/dist/translations/languages/sk.d.ts.map +1 -0
- package/dist/translations/languages/sk.js +34 -0
- package/dist/translations/languages/sk.js.map +1 -0
- package/dist/translations/languages/sl.d.ts +31 -0
- package/dist/translations/languages/sl.d.ts.map +1 -0
- package/dist/translations/languages/sl.js +34 -0
- package/dist/translations/languages/sl.js.map +1 -0
- package/dist/translations/languages/sv.d.ts +31 -0
- package/dist/translations/languages/sv.d.ts.map +1 -0
- package/dist/translations/languages/sv.js +34 -0
- package/dist/translations/languages/sv.js.map +1 -0
- package/dist/translations/languages/ta.d.ts +31 -0
- package/dist/translations/languages/ta.d.ts.map +1 -0
- package/dist/translations/languages/ta.js +34 -0
- package/dist/translations/languages/ta.js.map +1 -0
- package/dist/translations/languages/th.d.ts +31 -0
- package/dist/translations/languages/th.d.ts.map +1 -0
- package/dist/translations/languages/th.js +34 -0
- package/dist/translations/languages/th.js.map +1 -0
- package/dist/translations/languages/tr.d.ts +31 -0
- package/dist/translations/languages/tr.d.ts.map +1 -0
- package/dist/translations/languages/tr.js +34 -0
- package/dist/translations/languages/tr.js.map +1 -0
- package/dist/translations/languages/uk.d.ts +31 -0
- package/dist/translations/languages/uk.d.ts.map +1 -0
- package/dist/translations/languages/uk.js +34 -0
- package/dist/translations/languages/uk.js.map +1 -0
- package/dist/translations/languages/vi.d.ts +31 -0
- package/dist/translations/languages/vi.d.ts.map +1 -0
- package/dist/translations/languages/vi.js +34 -0
- package/dist/translations/languages/vi.js.map +1 -0
- package/dist/translations/languages/zh.d.ts +31 -0
- package/dist/translations/languages/zh.d.ts.map +1 -0
- package/dist/translations/languages/zh.js +34 -0
- package/dist/translations/languages/zh.js.map +1 -0
- package/dist/translations/languages/zhTw.d.ts +31 -0
- package/dist/translations/languages/zhTw.d.ts.map +1 -0
- package/dist/translations/languages/zhTw.js +34 -0
- package/dist/translations/languages/zhTw.js.map +1 -0
- package/dist/translations/types.d.ts +32 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/dist/translations/types.js +3 -0
- package/dist/translations/types.js.map +1 -0
- package/dist/types.d.ts +255 -454
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +6 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/getLogger.d.ts +10 -0
- package/dist/utils/getLogger.d.ts.map +1 -0
- package/dist/utils/getLogger.js +22 -0
- package/dist/utils/getLogger.js.map +1 -0
- package/dist/utils/getPluginConfig.d.ts +12 -0
- package/dist/utils/getPluginConfig.d.ts.map +1 -0
- package/dist/utils/getPluginConfig.js +15 -0
- package/dist/utils/getPluginConfig.js.map +1 -0
- package/dist/utils/localAPIDefaults.d.ts +20 -0
- package/dist/utils/localAPIDefaults.d.ts.map +1 -0
- package/dist/utils/localAPIDefaults.js +19 -0
- package/dist/utils/localAPIDefaults.js.map +1 -0
- package/dist/utils/resolveProjectRoot.d.ts +7 -0
- package/dist/utils/resolveProjectRoot.d.ts.map +1 -0
- package/dist/utils/resolveProjectRoot.js +15 -0
- package/dist/utils/resolveProjectRoot.js.map +1 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +11 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +1 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.js +34 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.js.map +1 -0
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts +2 -2
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts.map +1 -1
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js.map +1 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +15 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +1 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +464 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +1 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +158 -0
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +1 -0
- package/dist/utils/toStandardSchema.d.ts +5 -0
- package/dist/utils/toStandardSchema.d.ts.map +1 -0
- package/dist/utils/toStandardSchema.js +4 -0
- package/dist/utils/toStandardSchema.js.map +1 -0
- package/dist/utils/whereSchema.d.ts +9 -0
- package/dist/utils/whereSchema.d.ts.map +1 -0
- package/dist/utils/whereSchema.js +13 -0
- package/dist/utils/whereSchema.js.map +1 -0
- package/package.json +36 -10
- package/src/@types/assets.d.ts +3 -0
- package/src/collection/getAccessField.ts +84 -0
- package/src/collection/index.ts +105 -0
- package/src/components/APIKeyField/index.client.tsx +73 -0
- package/src/components/APIKeyField/index.css +105 -0
- package/src/components/APIKeysEmptyState/index.client.tsx +36 -0
- package/src/components/AccessField/index.client.tsx +299 -0
- package/src/components/AccessField/index.css +99 -0
- package/src/components/SettingsMenu/index.client.tsx +34 -0
- package/src/defineTool.ts +44 -0
- package/src/endpoint/access.ts +144 -0
- package/src/endpoint/index.ts +35 -0
- package/src/exports/client.ts +5 -0
- package/src/index.ts +82 -86
- package/src/mcp/buildMcpServer.ts +257 -0
- package/src/mcp/builtin/collections/authTools.ts +233 -0
- package/src/mcp/builtin/collections/createTool.ts +112 -0
- package/src/mcp/builtin/collections/deleteTool.ts +116 -0
- package/src/mcp/builtin/collections/findTool.ts +177 -0
- package/src/mcp/builtin/collections/formatCollectionError.ts +84 -0
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +28 -0
- package/src/mcp/builtin/collections/updateTool.ts +211 -0
- package/src/mcp/builtin/getConfigInfoTool.ts +44 -0
- package/src/mcp/builtin/globals/findTool.ts +96 -0
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +28 -0
- package/src/mcp/builtin/globals/updateTool.ts +115 -0
- package/src/mcp/builtin/validateEntityData.ts +132 -0
- package/src/mcp/builtinTools.ts +98 -0
- package/src/mcp/sanitizeMCPConfig.ts +260 -0
- package/src/stdio.ts +98 -0
- package/src/translations/index.ts +108 -0
- package/src/translations/languages/ar.ts +35 -0
- package/src/translations/languages/az.ts +35 -0
- package/src/translations/languages/bg.ts +35 -0
- package/src/translations/languages/bnBd.ts +35 -0
- package/src/translations/languages/bnIn.ts +35 -0
- package/src/translations/languages/ca.ts +35 -0
- package/src/translations/languages/cs.ts +35 -0
- package/src/translations/languages/da.ts +35 -0
- package/src/translations/languages/de.ts +35 -0
- package/src/translations/languages/en.ts +35 -0
- package/src/translations/languages/es.ts +35 -0
- package/src/translations/languages/et.ts +35 -0
- package/src/translations/languages/fa.ts +35 -0
- package/src/translations/languages/fr.ts +35 -0
- package/src/translations/languages/he.ts +35 -0
- package/src/translations/languages/hr.ts +35 -0
- package/src/translations/languages/hu.ts +35 -0
- package/src/translations/languages/hy.ts +35 -0
- package/src/translations/languages/id.ts +35 -0
- package/src/translations/languages/is.ts +35 -0
- package/src/translations/languages/it.ts +35 -0
- package/src/translations/languages/ja.ts +35 -0
- package/src/translations/languages/ko.ts +35 -0
- package/src/translations/languages/lt.ts +35 -0
- package/src/translations/languages/lv.ts +35 -0
- package/src/translations/languages/my.ts +35 -0
- package/src/translations/languages/nb.ts +35 -0
- package/src/translations/languages/nl.ts +35 -0
- package/src/translations/languages/pl.ts +35 -0
- package/src/translations/languages/pt.ts +35 -0
- package/src/translations/languages/ro.ts +35 -0
- package/src/translations/languages/rs.ts +35 -0
- package/src/translations/languages/rsLatin.ts +35 -0
- package/src/translations/languages/ru.ts +35 -0
- package/src/translations/languages/sk.ts +35 -0
- package/src/translations/languages/sl.ts +35 -0
- package/src/translations/languages/sv.ts +35 -0
- package/src/translations/languages/ta.ts +35 -0
- package/src/translations/languages/th.ts +35 -0
- package/src/translations/languages/tr.ts +35 -0
- package/src/translations/languages/uk.ts +35 -0
- package/src/translations/languages/vi.ts +35 -0
- package/src/translations/languages/zh.ts +35 -0
- package/src/translations/languages/zhTw.ts +35 -0
- package/src/translations/types.ts +34 -0
- package/src/types.ts +295 -490
- package/src/utils/getLogger.ts +22 -0
- package/src/utils/getPluginConfig.ts +24 -0
- package/src/utils/localAPIDefaults.ts +22 -0
- package/src/utils/resolveProjectRoot.ts +17 -0
- package/src/utils/schemaConversion/getEntityInputSchema.ts +78 -0
- package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +3 -3
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +103 -0
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +529 -0
- package/src/utils/toStandardSchema.ts +9 -0
- package/src/utils/whereSchema.ts +24 -0
- package/dist/collections/createApiKeysCollection.d.ts +0 -7
- package/dist/collections/createApiKeysCollection.d.ts.map +0 -1
- package/dist/collections/createApiKeysCollection.js +0 -317
- package/dist/collections/createApiKeysCollection.js.map +0 -1
- package/dist/defaults.d.ts +0 -4
- package/dist/defaults.d.ts.map +0 -1
- package/dist/defaults.js +0 -5
- package/dist/defaults.js.map +0 -1
- package/dist/endpoints/mcp.d.ts +0 -4
- package/dist/endpoints/mcp.d.ts.map +0 -1
- package/dist/endpoints/mcp.js +0 -71
- package/dist/endpoints/mcp.js.map +0 -1
- package/dist/mcp/createRequest.d.ts +0 -3
- package/dist/mcp/createRequest.d.ts.map +0 -1
- package/dist/mcp/createRequest.js +0 -14
- package/dist/mcp/createRequest.js.map +0 -1
- package/dist/mcp/getMcpHandler.d.ts +0 -4
- package/dist/mcp/getMcpHandler.d.ts.map +0 -1
- package/dist/mcp/getMcpHandler.js +0 -231
- package/dist/mcp/getMcpHandler.js.map +0 -1
- package/dist/mcp/helpers/config.d.ts +0 -22
- package/dist/mcp/helpers/config.d.ts.map +0 -1
- package/dist/mcp/helpers/config.js +0 -153
- package/dist/mcp/helpers/config.js.map +0 -1
- package/dist/mcp/helpers/fields.d.ts +0 -19
- package/dist/mcp/helpers/fields.d.ts.map +0 -1
- package/dist/mcp/helpers/fields.js +0 -102
- package/dist/mcp/helpers/fields.js.map +0 -1
- package/dist/mcp/helpers/fileValidation.d.ts +0 -67
- package/dist/mcp/helpers/fileValidation.d.ts.map +0 -1
- package/dist/mcp/helpers/fileValidation.js +0 -267
- package/dist/mcp/helpers/fileValidation.js.map +0 -1
- package/dist/mcp/registerTool.d.ts +0 -6
- package/dist/mcp/registerTool.d.ts.map +0 -1
- package/dist/mcp/registerTool.js +0 -18
- package/dist/mcp/registerTool.js.map +0 -1
- package/dist/mcp/tools/auth/auth.d.ts +0 -4
- package/dist/mcp/tools/auth/auth.d.ts.map +0 -1
- package/dist/mcp/tools/auth/auth.js +0 -57
- package/dist/mcp/tools/auth/auth.js.map +0 -1
- package/dist/mcp/tools/auth/forgotPassword.d.ts +0 -4
- package/dist/mcp/tools/auth/forgotPassword.d.ts.map +0 -1
- package/dist/mcp/tools/auth/forgotPassword.js +0 -48
- package/dist/mcp/tools/auth/forgotPassword.js.map +0 -1
- package/dist/mcp/tools/auth/login.d.ts +0 -4
- package/dist/mcp/tools/auth/login.d.ts.map +0 -1
- package/dist/mcp/tools/auth/login.js +0 -51
- package/dist/mcp/tools/auth/login.js.map +0 -1
- package/dist/mcp/tools/auth/resetPassword.d.ts +0 -4
- package/dist/mcp/tools/auth/resetPassword.d.ts.map +0 -1
- package/dist/mcp/tools/auth/resetPassword.js +0 -49
- package/dist/mcp/tools/auth/resetPassword.js.map +0 -1
- package/dist/mcp/tools/auth/unlock.d.ts +0 -4
- package/dist/mcp/tools/auth/unlock.d.ts.map +0 -1
- package/dist/mcp/tools/auth/unlock.js +0 -48
- package/dist/mcp/tools/auth/unlock.js.map +0 -1
- package/dist/mcp/tools/auth/verify.d.ts +0 -4
- package/dist/mcp/tools/auth/verify.d.ts.map +0 -1
- package/dist/mcp/tools/auth/verify.js +0 -45
- package/dist/mcp/tools/auth/verify.js.map +0 -1
- package/dist/mcp/tools/collection/create.d.ts +0 -10
- package/dist/mcp/tools/collection/create.d.ts.map +0 -1
- package/dist/mcp/tools/collection/create.js +0 -139
- package/dist/mcp/tools/collection/create.js.map +0 -1
- package/dist/mcp/tools/collection/delete.d.ts +0 -10
- package/dist/mcp/tools/collection/delete.d.ts.map +0 -1
- package/dist/mcp/tools/collection/delete.js +0 -154
- package/dist/mcp/tools/collection/delete.js.map +0 -1
- package/dist/mcp/tools/collection/find.d.ts +0 -10
- package/dist/mcp/tools/collection/find.d.ts.map +0 -1
- package/dist/mcp/tools/collection/find.js +0 -165
- package/dist/mcp/tools/collection/find.js.map +0 -1
- package/dist/mcp/tools/collection/update.d.ts +0 -10
- package/dist/mcp/tools/collection/update.d.ts.map +0 -1
- package/dist/mcp/tools/collection/update.js +0 -209
- package/dist/mcp/tools/collection/update.js.map +0 -1
- package/dist/mcp/tools/config/find.d.ts +0 -10
- package/dist/mcp/tools/config/find.d.ts.map +0 -1
- package/dist/mcp/tools/config/find.js +0 -97
- package/dist/mcp/tools/config/find.js.map +0 -1
- package/dist/mcp/tools/config/update.d.ts +0 -10
- package/dist/mcp/tools/config/update.d.ts.map +0 -1
- package/dist/mcp/tools/config/update.js +0 -215
- package/dist/mcp/tools/config/update.js.map +0 -1
- package/dist/mcp/tools/global/find.d.ts +0 -5
- package/dist/mcp/tools/global/find.d.ts.map +0 -1
- package/dist/mcp/tools/global/find.js +0 -82
- package/dist/mcp/tools/global/find.js.map +0 -1
- package/dist/mcp/tools/global/update.d.ts +0 -6
- package/dist/mcp/tools/global/update.d.ts.map +0 -1
- package/dist/mcp/tools/global/update.js +0 -124
- package/dist/mcp/tools/global/update.js.map +0 -1
- package/dist/mcp/tools/job/create.d.ts +0 -10
- package/dist/mcp/tools/job/create.d.ts.map +0 -1
- package/dist/mcp/tools/job/create.js +0 -293
- package/dist/mcp/tools/job/create.js.map +0 -1
- package/dist/mcp/tools/job/run.d.ts +0 -10
- package/dist/mcp/tools/job/run.d.ts.map +0 -1
- package/dist/mcp/tools/job/run.js +0 -129
- package/dist/mcp/tools/job/run.js.map +0 -1
- package/dist/mcp/tools/job/update.d.ts +0 -11
- package/dist/mcp/tools/job/update.d.ts.map +0 -1
- package/dist/mcp/tools/job/update.js +0 -186
- package/dist/mcp/tools/job/update.js.map +0 -1
- package/dist/mcp/tools/resource/create.d.ts +0 -6
- package/dist/mcp/tools/resource/create.d.ts.map +0 -1
- package/dist/mcp/tools/resource/create.js +0 -124
- package/dist/mcp/tools/resource/create.js.map +0 -1
- package/dist/mcp/tools/resource/delete.d.ts +0 -5
- package/dist/mcp/tools/resource/delete.d.ts.map +0 -1
- package/dist/mcp/tools/resource/delete.js +0 -151
- package/dist/mcp/tools/resource/delete.js.map +0 -1
- package/dist/mcp/tools/resource/find.d.ts +0 -5
- package/dist/mcp/tools/resource/find.d.ts.map +0 -1
- package/dist/mcp/tools/resource/find.js +0 -170
- package/dist/mcp/tools/resource/find.js.map +0 -1
- package/dist/mcp/tools/resource/update.d.ts +0 -6
- package/dist/mcp/tools/resource/update.d.ts.map +0 -1
- package/dist/mcp/tools/resource/update.js +0 -256
- package/dist/mcp/tools/resource/update.js.map +0 -1
- package/dist/mcp/tools/schemas.d.ts +0 -457
- package/dist/mcp/tools/schemas.d.ts.map +0 -1
- package/dist/mcp/tools/schemas.js +0 -243
- package/dist/mcp/tools/schemas.js.map +0 -1
- package/dist/utils/adminEntitySettings.d.ts +0 -17
- package/dist/utils/adminEntitySettings.d.ts.map +0 -1
- package/dist/utils/adminEntitySettings.js +0 -41
- package/dist/utils/adminEntitySettings.js.map +0 -1
- package/dist/utils/createApiKeyFields.d.ts +0 -15
- package/dist/utils/createApiKeyFields.d.ts.map +0 -1
- package/dist/utils/createApiKeyFields.js +0 -57
- package/dist/utils/createApiKeyFields.js.map +0 -1
- package/dist/utils/getEnabledSlugs.d.ts +0 -13
- package/dist/utils/getEnabledSlugs.d.ts.map +0 -1
- package/dist/utils/getEnabledSlugs.js +0 -32
- package/dist/utils/getEnabledSlugs.js.map +0 -1
- package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts +0 -3
- package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts.map +0 -1
- package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js +0 -43
- package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts +0 -13
- package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/sanitizeJsonSchema.js +0 -56
- package/dist/utils/schemaConversion/sanitizeJsonSchema.js.map +0 -1
- package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts +0 -20
- package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts.map +0 -1
- package/dist/utils/schemaConversion/simplifyRelationshipFields.js +0 -53
- package/dist/utils/schemaConversion/simplifyRelationshipFields.js.map +0 -1
- package/dist/utils/schemaConversion/transformPointFields.d.ts +0 -3
- package/dist/utils/schemaConversion/transformPointFields.d.ts.map +0 -1
- package/dist/utils/schemaConversion/transformPointFields.js +0 -51
- package/dist/utils/schemaConversion/transformPointFields.js.map +0 -1
- package/src/collections/createApiKeysCollection.ts +0 -373
- package/src/defaults.ts +0 -3
- package/src/endpoints/mcp.ts +0 -91
- package/src/mcp/createRequest.ts +0 -13
- package/src/mcp/getMcpHandler.ts +0 -545
- package/src/mcp/helpers/config.ts +0 -213
- package/src/mcp/helpers/fields.ts +0 -154
- package/src/mcp/helpers/fileValidation.ts +0 -362
- package/src/mcp/registerTool.ts +0 -22
- package/src/mcp/tools/auth/auth.ts +0 -71
- package/src/mcp/tools/auth/forgotPassword.ts +0 -70
- package/src/mcp/tools/auth/login.ts +0 -72
- package/src/mcp/tools/auth/resetPassword.ts +0 -61
- package/src/mcp/tools/auth/unlock.ts +0 -64
- package/src/mcp/tools/auth/verify.ts +0 -57
- package/src/mcp/tools/collection/create.ts +0 -210
- package/src/mcp/tools/collection/delete.ts +0 -211
- package/src/mcp/tools/collection/find.ts +0 -224
- package/src/mcp/tools/collection/update.ts +0 -290
- package/src/mcp/tools/config/find.ts +0 -128
- package/src/mcp/tools/config/update.ts +0 -280
- package/src/mcp/tools/global/find.ts +0 -128
- package/src/mcp/tools/global/update.ts +0 -207
- package/src/mcp/tools/job/create.ts +0 -416
- package/src/mcp/tools/job/run.ts +0 -167
- package/src/mcp/tools/job/update.ts +0 -274
- package/src/mcp/tools/resource/create.ts +0 -211
- package/src/mcp/tools/resource/delete.ts +0 -218
- package/src/mcp/tools/resource/find.ts +0 -246
- package/src/mcp/tools/resource/update.ts +0 -383
- package/src/mcp/tools/schemas.ts +0 -520
- package/src/utils/adminEntitySettings.ts +0 -40
- package/src/utils/createApiKeyFields.ts +0 -72
- package/src/utils/getEnabledSlugs.ts +0 -42
- package/src/utils/schemaConversion/convertCollectionSchemaToZod.ts +0 -52
- package/src/utils/schemaConversion/sanitizeJsonSchema.ts +0 -62
- package/src/utils/schemaConversion/simplifyRelationshipFields.ts +0 -65
- package/src/utils/schemaConversion/transformPointFields.ts +0 -55
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { CollectionSlug, GlobalSlug, PayloadRequest, SanitizedConfig } from 'payload'
|
|
2
|
+
|
|
3
|
+
import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server'
|
|
4
|
+
|
|
5
|
+
import type { JsonSchemaType, MCPToolResponse } from '../../types.js'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
getCollectionInputSchema,
|
|
9
|
+
getGlobalInputSchema,
|
|
10
|
+
} from '../../utils/schemaConversion/getEntityInputSchema.js'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Keep the default `shortcircuit: true` - `false` makes validating nested rich text exponentially slow.
|
|
14
|
+
*/
|
|
15
|
+
const validator = new CfWorkerJsonSchemaValidator({ shortcircuit: true })
|
|
16
|
+
|
|
17
|
+
type EntityValidator = {
|
|
18
|
+
schema: JsonSchemaType
|
|
19
|
+
validate: ReturnType<(typeof validator)['getValidator']>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* - Caches each entity's schema and validator, so both are only built on the first request.
|
|
24
|
+
* - Keyed by payload config, then by entity type, slug, partial and language.
|
|
25
|
+
*/
|
|
26
|
+
const validatorCache = new WeakMap<SanitizedConfig, Map<string, EntityValidator>>()
|
|
27
|
+
|
|
28
|
+
export const validateCollectionData = ({
|
|
29
|
+
collectionSlug,
|
|
30
|
+
data,
|
|
31
|
+
partial,
|
|
32
|
+
req,
|
|
33
|
+
}: {
|
|
34
|
+
collectionSlug: CollectionSlug
|
|
35
|
+
data: Record<string, unknown>
|
|
36
|
+
partial?: boolean
|
|
37
|
+
req: PayloadRequest
|
|
38
|
+
}): MCPToolResponse | null =>
|
|
39
|
+
validateData({
|
|
40
|
+
slug: collectionSlug,
|
|
41
|
+
buildSchema: () => getCollectionInputSchema({ collectionSlug, req }),
|
|
42
|
+
data,
|
|
43
|
+
entity: 'collection',
|
|
44
|
+
partial,
|
|
45
|
+
req,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export const validateGlobalData = ({
|
|
49
|
+
data,
|
|
50
|
+
globalSlug,
|
|
51
|
+
req,
|
|
52
|
+
}: {
|
|
53
|
+
data: Record<string, unknown>
|
|
54
|
+
globalSlug: GlobalSlug
|
|
55
|
+
req: PayloadRequest
|
|
56
|
+
}): MCPToolResponse | null =>
|
|
57
|
+
validateData({
|
|
58
|
+
slug: globalSlug,
|
|
59
|
+
buildSchema: () => getGlobalInputSchema({ globalSlug, req }),
|
|
60
|
+
data,
|
|
61
|
+
entity: 'global',
|
|
62
|
+
partial: true,
|
|
63
|
+
req,
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const validateData = ({
|
|
67
|
+
slug,
|
|
68
|
+
buildSchema,
|
|
69
|
+
data,
|
|
70
|
+
entity,
|
|
71
|
+
partial,
|
|
72
|
+
req,
|
|
73
|
+
}: {
|
|
74
|
+
buildSchema: () => JsonSchemaType | null
|
|
75
|
+
data: Record<string, unknown>
|
|
76
|
+
entity: 'collection' | 'global'
|
|
77
|
+
partial?: boolean
|
|
78
|
+
req: PayloadRequest
|
|
79
|
+
slug: string
|
|
80
|
+
}): MCPToolResponse | null => {
|
|
81
|
+
let cache = validatorCache.get(req.payload.config)
|
|
82
|
+
if (!cache) {
|
|
83
|
+
cache = new Map()
|
|
84
|
+
validatorCache.set(req.payload.config, cache)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const cacheKey = `${entity}:${slug}:${partial ? 'partial' : 'full'}:${req.i18n.language}`
|
|
88
|
+
let entityValidator = cache.get(cacheKey)
|
|
89
|
+
|
|
90
|
+
if (!entityValidator) {
|
|
91
|
+
const schema = buildSchema()
|
|
92
|
+
|
|
93
|
+
if (!schema) {
|
|
94
|
+
return null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
entityValidator = {
|
|
98
|
+
schema,
|
|
99
|
+
validate: validator.getValidator(partial ? withoutRequired(schema) : schema),
|
|
100
|
+
}
|
|
101
|
+
cache.set(cacheKey, entityValidator)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const result = entityValidator.validate(data)
|
|
105
|
+
|
|
106
|
+
if (result.valid) {
|
|
107
|
+
return null
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const { schema } = entityValidator
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: `Invalid data for ${entity} "${slug}": ${result.errorMessage}\n\nUse this schema for data:\n\`\`\`json\n${JSON.stringify(schema)}\n\`\`\``,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
isError: true,
|
|
120
|
+
structuredContent: {
|
|
121
|
+
[`${entity}Slug`]: slug,
|
|
122
|
+
errors: [{ message: result.errorMessage }],
|
|
123
|
+
schema,
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Updates are partial — drop the schema's top-level `required` before validating. */
|
|
129
|
+
const withoutRequired = (schema: JsonSchemaType): JsonSchemaType => {
|
|
130
|
+
const { required: _required, ...rest } = schema
|
|
131
|
+
return rest
|
|
132
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { CollectionTool, GlobalTool, Tool } from '../types.js'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
authCollectionTool,
|
|
5
|
+
forgotPasswordCollectionTool,
|
|
6
|
+
loginCollectionTool,
|
|
7
|
+
resetPasswordCollectionTool,
|
|
8
|
+
unlockCollectionTool,
|
|
9
|
+
verifyCollectionTool,
|
|
10
|
+
} from './builtin/collections/authTools.js'
|
|
11
|
+
import { createDocumentTool } from './builtin/collections/createTool.js'
|
|
12
|
+
import { deleteDocumentsTool } from './builtin/collections/deleteTool.js'
|
|
13
|
+
import { findDocumentsTool } from './builtin/collections/findTool.js'
|
|
14
|
+
import { getCollectionSchemaTool } from './builtin/collections/getCollectionSchemaTool.js'
|
|
15
|
+
import { updateDocumentTool } from './builtin/collections/updateTool.js'
|
|
16
|
+
import { getConfigInfoTool } from './builtin/getConfigInfoTool.js'
|
|
17
|
+
import { findGlobalTool } from './builtin/globals/findTool.js'
|
|
18
|
+
import { getGlobalSchemaTool } from './builtin/globals/getGlobalSchemaTool.js'
|
|
19
|
+
import { updateGlobalTool } from './builtin/globals/updateTool.js'
|
|
20
|
+
|
|
21
|
+
export const TOOL_BUILTINS = {
|
|
22
|
+
getConfigInfo: { label: 'Config Info', mcpName: 'getConfigInfo', tool: getConfigInfoTool },
|
|
23
|
+
} satisfies Record<string, { label: string; mcpName: string; tool: Tool }>
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The static built-in collection CRUD tools. Keys here are the source of truth
|
|
27
|
+
* for `MCPCollectionBuiltinName` — adding/removing an entry updates the type
|
|
28
|
+
* automatically.
|
|
29
|
+
*/
|
|
30
|
+
export const COLLECTION_BUILTINS = {
|
|
31
|
+
create: { mcpName: 'createDocument', tool: createDocumentTool },
|
|
32
|
+
delete: { mcpName: 'deleteDocuments', tool: deleteDocumentsTool },
|
|
33
|
+
find: { mcpName: 'findDocuments', tool: findDocumentsTool },
|
|
34
|
+
getCollectionSchema: { mcpName: 'getCollectionSchema', tool: getCollectionSchemaTool },
|
|
35
|
+
update: { mcpName: 'updateDocument', tool: updateDocumentTool },
|
|
36
|
+
} satisfies Record<string, { mcpName: string; tool: CollectionTool }>
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The static auth tools surfaced under auth-enabled collections. Each entry
|
|
40
|
+
* carries the admin-UI label alongside the tool. Keys are the source of truth
|
|
41
|
+
* for `MCPCollectionAuthToolName`.
|
|
42
|
+
*/
|
|
43
|
+
export const COLLECTION_AUTH_BUILTINS = {
|
|
44
|
+
auth: { label: 'Check Auth Status', mcpName: 'auth', tool: authCollectionTool },
|
|
45
|
+
forgotPassword: {
|
|
46
|
+
label: 'Forgot Password',
|
|
47
|
+
mcpName: 'forgotPassword',
|
|
48
|
+
tool: forgotPasswordCollectionTool,
|
|
49
|
+
},
|
|
50
|
+
login: { label: 'User Login', mcpName: 'login', tool: loginCollectionTool },
|
|
51
|
+
resetPassword: {
|
|
52
|
+
label: 'Reset Password',
|
|
53
|
+
mcpName: 'resetPassword',
|
|
54
|
+
tool: resetPasswordCollectionTool,
|
|
55
|
+
},
|
|
56
|
+
unlock: { label: 'Unlock Account', mcpName: 'unlock', tool: unlockCollectionTool },
|
|
57
|
+
verify: { label: 'Email Verification', mcpName: 'verify', tool: verifyCollectionTool },
|
|
58
|
+
} satisfies Record<string, { label: string; mcpName: string; tool: CollectionTool }>
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The static built-in global tools. Keys are the source of truth for
|
|
62
|
+
* `MCPGlobalBuiltinName`.
|
|
63
|
+
*/
|
|
64
|
+
export const GLOBAL_BUILTINS = {
|
|
65
|
+
find: { mcpName: 'findGlobal', tool: findGlobalTool },
|
|
66
|
+
getGlobalSchema: { mcpName: 'getGlobalSchema', tool: getGlobalSchemaTool },
|
|
67
|
+
update: { mcpName: 'updateGlobal', tool: updateGlobalTool },
|
|
68
|
+
} satisfies Record<string, { mcpName: string; tool: GlobalTool }>
|
|
69
|
+
|
|
70
|
+
export type MCPCollectionBuiltinName = keyof typeof COLLECTION_BUILTINS
|
|
71
|
+
|
|
72
|
+
export type MCPCollectionAuthToolName = keyof typeof COLLECTION_AUTH_BUILTINS
|
|
73
|
+
|
|
74
|
+
export type MCPGlobalBuiltinName = keyof typeof GLOBAL_BUILTINS
|
|
75
|
+
|
|
76
|
+
export type MCPTopLevelBuiltinName = keyof typeof TOOL_BUILTINS
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Pre-typed `Object.entries` for each registry. The cast from `string` to the
|
|
80
|
+
* literal key union lives here once so consumers can iterate without their own
|
|
81
|
+
* cast — TypeScript's `Object.entries` always widens keys to `string`, which
|
|
82
|
+
* defeats the narrow type lookups on `MCPCollectionToolsMap`.
|
|
83
|
+
*/
|
|
84
|
+
export const TOOL_BUILTIN_ENTRIES = Object.entries(TOOL_BUILTINS) as Array<
|
|
85
|
+
[MCPTopLevelBuiltinName, (typeof TOOL_BUILTINS)[MCPTopLevelBuiltinName]]
|
|
86
|
+
>
|
|
87
|
+
|
|
88
|
+
export const COLLECTION_BUILTIN_ENTRIES = Object.entries(COLLECTION_BUILTINS) as Array<
|
|
89
|
+
[MCPCollectionBuiltinName, (typeof COLLECTION_BUILTINS)[MCPCollectionBuiltinName]]
|
|
90
|
+
>
|
|
91
|
+
|
|
92
|
+
export const COLLECTION_AUTH_BUILTIN_ENTRIES = Object.entries(COLLECTION_AUTH_BUILTINS) as Array<
|
|
93
|
+
[MCPCollectionAuthToolName, (typeof COLLECTION_AUTH_BUILTINS)[MCPCollectionAuthToolName]]
|
|
94
|
+
>
|
|
95
|
+
|
|
96
|
+
export const GLOBAL_BUILTIN_ENTRIES = Object.entries(GLOBAL_BUILTINS) as Array<
|
|
97
|
+
[MCPGlobalBuiltinName, (typeof GLOBAL_BUILTINS)[MCPGlobalBuiltinName]]
|
|
98
|
+
>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CollectionConfig,
|
|
3
|
+
Config,
|
|
4
|
+
GlobalConfig,
|
|
5
|
+
SanitizedCollectionConfig,
|
|
6
|
+
SanitizedConfig,
|
|
7
|
+
SanitizedGlobalConfig,
|
|
8
|
+
} from 'payload'
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
CollectionMCPItem,
|
|
12
|
+
CollectionTool,
|
|
13
|
+
GlobalMCPItem,
|
|
14
|
+
GlobalTool,
|
|
15
|
+
MCPItem,
|
|
16
|
+
MCPPluginConfig,
|
|
17
|
+
SanitizedMCPPluginConfig,
|
|
18
|
+
} from '../types.js'
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
COLLECTION_AUTH_BUILTIN_ENTRIES,
|
|
22
|
+
COLLECTION_AUTH_BUILTINS,
|
|
23
|
+
COLLECTION_BUILTIN_ENTRIES,
|
|
24
|
+
COLLECTION_BUILTINS,
|
|
25
|
+
GLOBAL_BUILTIN_ENTRIES,
|
|
26
|
+
GLOBAL_BUILTINS,
|
|
27
|
+
TOOL_BUILTIN_ENTRIES,
|
|
28
|
+
TOOL_BUILTINS,
|
|
29
|
+
} from './builtinTools.js'
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Converts the user-configured `MCPPluginConfig` into a `SanitizedMCPPluginConfig`:
|
|
33
|
+
* - Flattens `tools` / `prompts` / `resources` / per-collection / per-global
|
|
34
|
+
* tool maps into a single `items` array.
|
|
35
|
+
* - Applies built-in tools for collections and globals, respecting opt-out user overrides.
|
|
36
|
+
* - Applies the `userCollection` default
|
|
37
|
+
*
|
|
38
|
+
* Called once during plugin init. After that, `plugins['@payloadcms/plugin-mcp']
|
|
39
|
+
* ?.options` holds the sanitized result
|
|
40
|
+
*/
|
|
41
|
+
export const sanitizeMCPConfig = ({
|
|
42
|
+
config,
|
|
43
|
+
pluginConfig,
|
|
44
|
+
}: {
|
|
45
|
+
config: Config | SanitizedConfig
|
|
46
|
+
pluginConfig: MCPPluginConfig
|
|
47
|
+
}): SanitizedMCPPluginConfig => {
|
|
48
|
+
const items: MCPItem[] = []
|
|
49
|
+
|
|
50
|
+
for (const collection of config.collections ?? []) {
|
|
51
|
+
items.push(...sanitizeCollectionConfig({ collection, pluginConfig }))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for (const global of config.globals ?? []) {
|
|
55
|
+
items.push(...sanitizeGlobalConfig({ global, pluginConfig }))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
for (const [configKey, { label, mcpName, tool }] of TOOL_BUILTIN_ENTRIES) {
|
|
59
|
+
items.push({
|
|
60
|
+
type: 'tool',
|
|
61
|
+
configKey,
|
|
62
|
+
label,
|
|
63
|
+
mcpName,
|
|
64
|
+
tool,
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
for (const [configKey, tool] of Object.entries(pluginConfig.tools ?? {})) {
|
|
69
|
+
if (configKey in TOOL_BUILTINS) {
|
|
70
|
+
continue
|
|
71
|
+
}
|
|
72
|
+
items.push({
|
|
73
|
+
type: 'tool',
|
|
74
|
+
configKey,
|
|
75
|
+
label: configKey,
|
|
76
|
+
mcpName: configKey,
|
|
77
|
+
tool,
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
for (const [configKey, prompt] of Object.entries(pluginConfig.prompts ?? {})) {
|
|
82
|
+
items.push({
|
|
83
|
+
type: 'prompt',
|
|
84
|
+
configKey,
|
|
85
|
+
label: prompt.title ?? configKey,
|
|
86
|
+
mcpName: configKey,
|
|
87
|
+
prompt,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
for (const [configKey, resource] of Object.entries(pluginConfig.resources ?? {})) {
|
|
92
|
+
items.push({
|
|
93
|
+
type: 'resource',
|
|
94
|
+
configKey,
|
|
95
|
+
label: resource.title ?? configKey,
|
|
96
|
+
mcpName: configKey,
|
|
97
|
+
resource,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Mirror Payload's own admin.user detection (sanitize.ts) since plugins run first.
|
|
102
|
+
const firstCollectionWithAuth = config.collections!.find(({ auth }) => Boolean(auth))
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
disabled: pluginConfig.disabled,
|
|
106
|
+
items,
|
|
107
|
+
mcp: pluginConfig.mcp,
|
|
108
|
+
overrideApiKeyCollection: pluginConfig.overrideApiKeyCollection,
|
|
109
|
+
overrideAuth: pluginConfig.overrideAuth,
|
|
110
|
+
userCollection:
|
|
111
|
+
pluginConfig.userCollection ?? config.admin?.user ?? firstCollectionWithAuth?.slug ?? 'users',
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const sanitizeCollectionConfig = ({
|
|
116
|
+
collection,
|
|
117
|
+
pluginConfig,
|
|
118
|
+
}: {
|
|
119
|
+
collection: CollectionConfig | SanitizedCollectionConfig
|
|
120
|
+
pluginConfig: MCPPluginConfig
|
|
121
|
+
}): CollectionMCPItem[] => {
|
|
122
|
+
if (collection.slug === 'payload-mcp-api-keys') {
|
|
123
|
+
return []
|
|
124
|
+
}
|
|
125
|
+
const slug = collection.slug
|
|
126
|
+
const collectionPluginConfig = pluginConfig.collections?.[slug]
|
|
127
|
+
const items: CollectionMCPItem[] = []
|
|
128
|
+
|
|
129
|
+
for (const [toolKey, { mcpName, tool }] of COLLECTION_BUILTIN_ENTRIES) {
|
|
130
|
+
const matchedConfigEntry = collectionPluginConfig?.tools?.[toolKey]
|
|
131
|
+
if (matchedConfigEntry === false) {
|
|
132
|
+
continue
|
|
133
|
+
}
|
|
134
|
+
const override = typeof matchedConfigEntry === 'object' ? matchedConfigEntry : undefined
|
|
135
|
+
items.push({
|
|
136
|
+
type: 'collectionTool',
|
|
137
|
+
collectionSlug: slug,
|
|
138
|
+
configKey: toolKey,
|
|
139
|
+
label: capitalize(toolKey),
|
|
140
|
+
mcpName,
|
|
141
|
+
tool: {
|
|
142
|
+
...tool,
|
|
143
|
+
description: override?.description ?? tool.description,
|
|
144
|
+
overrideResponse:
|
|
145
|
+
override?.overrideResponse ??
|
|
146
|
+
collectionPluginConfig?.overrideResponse ??
|
|
147
|
+
tool.overrideResponse,
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (collection.auth) {
|
|
153
|
+
for (const [authToolKey, { label, mcpName, tool }] of COLLECTION_AUTH_BUILTIN_ENTRIES) {
|
|
154
|
+
const matchedConfigEntry = collectionPluginConfig?.tools?.[authToolKey]
|
|
155
|
+
if (!matchedConfigEntry) {
|
|
156
|
+
continue
|
|
157
|
+
}
|
|
158
|
+
// `true` means "enable, no override"; only the object form carries fields.
|
|
159
|
+
const override = typeof matchedConfigEntry === 'object' ? matchedConfigEntry : undefined
|
|
160
|
+
items.push({
|
|
161
|
+
type: 'collectionTool',
|
|
162
|
+
collectionSlug: slug,
|
|
163
|
+
configKey: authToolKey,
|
|
164
|
+
label,
|
|
165
|
+
mcpName,
|
|
166
|
+
tool: {
|
|
167
|
+
...tool,
|
|
168
|
+
description: override?.description ?? tool.description,
|
|
169
|
+
overrideResponse:
|
|
170
|
+
override?.overrideResponse ??
|
|
171
|
+
collectionPluginConfig?.overrideResponse ??
|
|
172
|
+
tool.overrideResponse,
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Cast: builtin keys are filtered out below, so the remaining values are
|
|
179
|
+
// always custom tools (`CollectionTool`) or undefined
|
|
180
|
+
const customEntries = Object.entries(collectionPluginConfig?.tools ?? {}) as Array<
|
|
181
|
+
[string, CollectionTool | undefined]
|
|
182
|
+
>
|
|
183
|
+
for (const [configKey, customTool] of customEntries) {
|
|
184
|
+
if (configKey in COLLECTION_BUILTINS || configKey in COLLECTION_AUTH_BUILTINS) {
|
|
185
|
+
continue
|
|
186
|
+
}
|
|
187
|
+
if (!customTool) {
|
|
188
|
+
continue
|
|
189
|
+
}
|
|
190
|
+
items.push({
|
|
191
|
+
type: 'collectionTool',
|
|
192
|
+
collectionSlug: slug,
|
|
193
|
+
configKey,
|
|
194
|
+
label: configKey,
|
|
195
|
+
mcpName: configKey,
|
|
196
|
+
tool: customTool,
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return items
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const sanitizeGlobalConfig = ({
|
|
204
|
+
global,
|
|
205
|
+
pluginConfig,
|
|
206
|
+
}: {
|
|
207
|
+
global: GlobalConfig | SanitizedGlobalConfig
|
|
208
|
+
pluginConfig: MCPPluginConfig
|
|
209
|
+
}): GlobalMCPItem[] => {
|
|
210
|
+
const slug = global.slug
|
|
211
|
+
const globalPluginConfig = pluginConfig.globals?.[slug]
|
|
212
|
+
const items: GlobalMCPItem[] = []
|
|
213
|
+
|
|
214
|
+
for (const [toolKey, { mcpName, tool }] of GLOBAL_BUILTIN_ENTRIES) {
|
|
215
|
+
const matchedConfigEntry = globalPluginConfig?.tools?.[toolKey]
|
|
216
|
+
if (matchedConfigEntry === false) {
|
|
217
|
+
continue
|
|
218
|
+
}
|
|
219
|
+
const override = typeof matchedConfigEntry === 'object' ? matchedConfigEntry : undefined
|
|
220
|
+
items.push({
|
|
221
|
+
type: 'globalTool',
|
|
222
|
+
configKey: toolKey,
|
|
223
|
+
globalSlug: slug,
|
|
224
|
+
label: capitalize(toolKey),
|
|
225
|
+
mcpName,
|
|
226
|
+
tool: {
|
|
227
|
+
...tool,
|
|
228
|
+
description: override?.description ?? tool.description,
|
|
229
|
+
overrideResponse:
|
|
230
|
+
override?.overrideResponse ??
|
|
231
|
+
globalPluginConfig?.overrideResponse ??
|
|
232
|
+
tool.overrideResponse,
|
|
233
|
+
},
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const customEntries = Object.entries(globalPluginConfig?.tools ?? {}) as Array<
|
|
238
|
+
[string, GlobalTool | undefined]
|
|
239
|
+
>
|
|
240
|
+
for (const [configKey, customTool] of customEntries) {
|
|
241
|
+
if (configKey in GLOBAL_BUILTINS) {
|
|
242
|
+
continue
|
|
243
|
+
}
|
|
244
|
+
if (!customTool) {
|
|
245
|
+
continue
|
|
246
|
+
}
|
|
247
|
+
items.push({
|
|
248
|
+
type: 'globalTool',
|
|
249
|
+
configKey,
|
|
250
|
+
globalSlug: slug,
|
|
251
|
+
label: configKey,
|
|
252
|
+
mcpName: configKey,
|
|
253
|
+
tool: customTool,
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return items
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const capitalize = (s: string): string => s.charAt(0).toUpperCase() + s.slice(1)
|
package/src/stdio.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { MaybePromise, Plugin, SanitizedConfig } from 'payload'
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-console */
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/server'
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
6
|
+
import { createLocalReq, getPayload } from 'payload'
|
|
7
|
+
import { findConfig } from 'payload/node'
|
|
8
|
+
|
|
9
|
+
import type { AuthorizedMCP, SanitizedMCPPluginConfig } from './types.js'
|
|
10
|
+
|
|
11
|
+
import { buildMcpServer } from './mcp/buildMcpServer.js'
|
|
12
|
+
import { sanitizeMCPConfig } from './mcp/sanitizeMCPConfig.js'
|
|
13
|
+
import { getPluginConfig } from './utils/getPluginConfig.js'
|
|
14
|
+
import { resolveProjectRoot } from './utils/resolveProjectRoot.js'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Stdio adapter for the Payload MCP server.
|
|
18
|
+
*
|
|
19
|
+
* Do not use in production. There's no auth; whoever can spawn the process gets
|
|
20
|
+
* full access to your local data.
|
|
21
|
+
*/
|
|
22
|
+
export const runMcpStdio = async (): Promise<void> => {
|
|
23
|
+
/**
|
|
24
|
+
* If MCP clients spawn stdio servers from an arbitrary working directory,
|
|
25
|
+
* Payload's cwd-anchored `findConfig()` can't locate the project on
|
|
26
|
+
* its own. This module always lives inside the project's `node_modules`, so
|
|
27
|
+
* we derive the project root from its own path and `chdir` into it.
|
|
28
|
+
*
|
|
29
|
+
* An absolute `PAYLOAD_CONFIG_PATH` still overrides everything; unusual
|
|
30
|
+
* layouts (e.g. a monorepo where the package is hoisted above the app) can
|
|
31
|
+
* fall back to it. See the implementation of findConfig for details.
|
|
32
|
+
*/
|
|
33
|
+
const projectRoot = resolveProjectRoot(fileURLToPath(import.meta.url))
|
|
34
|
+
if (projectRoot) {
|
|
35
|
+
process.chdir(projectRoot)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const configPath = findConfig()
|
|
39
|
+
const configModule = await import(pathToFileURL(configPath).toString())
|
|
40
|
+
const config = (await (configModule.default ?? configModule)) as MaybePromise<SanitizedConfig>
|
|
41
|
+
|
|
42
|
+
const payload = await getPayload({ config })
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* If the user added `mcpPlugin({...})` to their `plugins` array, read the
|
|
46
|
+
* sanitized config they registered. Otherwise fall back to the defaults. That way,
|
|
47
|
+
* the mcp works on any project that has `@payloadcms/plugin-mcp` installed,
|
|
48
|
+
* even if the plugin is not added to the plugins array.
|
|
49
|
+
*/
|
|
50
|
+
let pluginConfig: SanitizedMCPPluginConfig
|
|
51
|
+
try {
|
|
52
|
+
pluginConfig = getPluginConfig({ config: payload.config })
|
|
53
|
+
} catch {
|
|
54
|
+
pluginConfig = sanitizeMCPConfig({ config: payload.config, pluginConfig: {} })
|
|
55
|
+
|
|
56
|
+
const fakePluginFn: Plugin = (config) => config
|
|
57
|
+
fakePluginFn.slug = '@payloadcms/plugin-mcp'
|
|
58
|
+
// @ts-expect-error
|
|
59
|
+
fakePluginFn.sanitizedOptions = pluginConfig
|
|
60
|
+
|
|
61
|
+
// Push to payload config, to ensure consecutive calls to `getPluginConfig()` work
|
|
62
|
+
;(payload.config.plugins ??= []).push(fakePluginFn)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const authorizedMCP: AuthorizedMCP = {
|
|
66
|
+
items: pluginConfig.items,
|
|
67
|
+
overrideAccess: true,
|
|
68
|
+
user: null,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const req = await createLocalReq({}, payload)
|
|
72
|
+
req.payloadAPI = 'MCP' as const
|
|
73
|
+
|
|
74
|
+
const server = buildMcpServer({ authorizedMCP, pluginConfig, req })
|
|
75
|
+
|
|
76
|
+
const transport = new StdioServerTransport()
|
|
77
|
+
await server.connect(transport)
|
|
78
|
+
|
|
79
|
+
// Process now lives until stdin closes. Wire graceful shutdown so DB
|
|
80
|
+
// connections (and any other Payload-managed resources) get released.
|
|
81
|
+
const shutdown = async (code = 0) => {
|
|
82
|
+
try {
|
|
83
|
+
await server.close()
|
|
84
|
+
} catch (err) {
|
|
85
|
+
console.error('[payload-mcp] error closing server:', err)
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
await payload.destroy()
|
|
89
|
+
} catch (err) {
|
|
90
|
+
console.error('[payload-mcp] error destroying payload:', err)
|
|
91
|
+
}
|
|
92
|
+
process.exit(code)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
process.on('SIGINT', () => void shutdown(0))
|
|
96
|
+
process.on('SIGTERM', () => void shutdown(0))
|
|
97
|
+
process.stdin.on('close', () => void shutdown(0))
|
|
98
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NestedKeysStripped,
|
|
3
|
+
SupportedLanguages,
|
|
4
|
+
} from '@payloadcms/translations'
|
|
5
|
+
|
|
6
|
+
import type { PluginDefaultTranslationsObject } from './types.js'
|
|
7
|
+
|
|
8
|
+
import { ar } from './languages/ar.js'
|
|
9
|
+
import { az } from './languages/az.js'
|
|
10
|
+
import { bg } from './languages/bg.js'
|
|
11
|
+
import { bnBd } from './languages/bnBd.js'
|
|
12
|
+
import { bnIn } from './languages/bnIn.js'
|
|
13
|
+
import { ca } from './languages/ca.js'
|
|
14
|
+
import { cs } from './languages/cs.js'
|
|
15
|
+
import { da } from './languages/da.js'
|
|
16
|
+
import { de } from './languages/de.js'
|
|
17
|
+
import { en } from './languages/en.js'
|
|
18
|
+
import { es } from './languages/es.js'
|
|
19
|
+
import { et } from './languages/et.js'
|
|
20
|
+
import { fa } from './languages/fa.js'
|
|
21
|
+
import { fr } from './languages/fr.js'
|
|
22
|
+
import { he } from './languages/he.js'
|
|
23
|
+
import { hr } from './languages/hr.js'
|
|
24
|
+
import { hu } from './languages/hu.js'
|
|
25
|
+
import { hy } from './languages/hy.js'
|
|
26
|
+
import { id } from './languages/id.js'
|
|
27
|
+
import { is } from './languages/is.js'
|
|
28
|
+
import { it } from './languages/it.js'
|
|
29
|
+
import { ja } from './languages/ja.js'
|
|
30
|
+
import { ko } from './languages/ko.js'
|
|
31
|
+
import { lt } from './languages/lt.js'
|
|
32
|
+
import { lv } from './languages/lv.js'
|
|
33
|
+
import { my } from './languages/my.js'
|
|
34
|
+
import { nb } from './languages/nb.js'
|
|
35
|
+
import { nl } from './languages/nl.js'
|
|
36
|
+
import { pl } from './languages/pl.js'
|
|
37
|
+
import { pt } from './languages/pt.js'
|
|
38
|
+
import { ro } from './languages/ro.js'
|
|
39
|
+
import { rs } from './languages/rs.js'
|
|
40
|
+
import { rsLatin } from './languages/rsLatin.js'
|
|
41
|
+
import { ru } from './languages/ru.js'
|
|
42
|
+
import { sk } from './languages/sk.js'
|
|
43
|
+
import { sl } from './languages/sl.js'
|
|
44
|
+
import { sv } from './languages/sv.js'
|
|
45
|
+
import { ta } from './languages/ta.js'
|
|
46
|
+
import { th } from './languages/th.js'
|
|
47
|
+
import { tr } from './languages/tr.js'
|
|
48
|
+
import { uk } from './languages/uk.js'
|
|
49
|
+
import { vi } from './languages/vi.js'
|
|
50
|
+
import { zh } from './languages/zh.js'
|
|
51
|
+
import { zhTw } from './languages/zhTw.js'
|
|
52
|
+
|
|
53
|
+
export const translations = {
|
|
54
|
+
id,
|
|
55
|
+
ar,
|
|
56
|
+
az,
|
|
57
|
+
bg,
|
|
58
|
+
'bn-BD': bnBd,
|
|
59
|
+
'bn-IN': bnIn,
|
|
60
|
+
ca,
|
|
61
|
+
cs,
|
|
62
|
+
da,
|
|
63
|
+
de,
|
|
64
|
+
en,
|
|
65
|
+
es,
|
|
66
|
+
et,
|
|
67
|
+
fa,
|
|
68
|
+
fr,
|
|
69
|
+
he,
|
|
70
|
+
hr,
|
|
71
|
+
hu,
|
|
72
|
+
hy,
|
|
73
|
+
is,
|
|
74
|
+
it,
|
|
75
|
+
ja,
|
|
76
|
+
ko,
|
|
77
|
+
lt,
|
|
78
|
+
lv,
|
|
79
|
+
my,
|
|
80
|
+
nb,
|
|
81
|
+
nl,
|
|
82
|
+
pl,
|
|
83
|
+
pt,
|
|
84
|
+
ro,
|
|
85
|
+
rs,
|
|
86
|
+
'rs-latin': rsLatin,
|
|
87
|
+
ru,
|
|
88
|
+
sk,
|
|
89
|
+
sl,
|
|
90
|
+
sv,
|
|
91
|
+
ta,
|
|
92
|
+
th,
|
|
93
|
+
tr,
|
|
94
|
+
uk,
|
|
95
|
+
vi,
|
|
96
|
+
zh,
|
|
97
|
+
'zh-TW': zhTw,
|
|
98
|
+
} as SupportedLanguages<PluginDefaultTranslationsObject>
|
|
99
|
+
|
|
100
|
+
export type PluginMCPTranslations = PluginDefaultTranslationsObject
|
|
101
|
+
|
|
102
|
+
export type PluginMCPTranslationKeys = NestedKeysStripped<PluginMCPTranslations>
|
|
103
|
+
|
|
104
|
+
declare module '@payloadcms/translations' {
|
|
105
|
+
interface CustomTranslationKeys {
|
|
106
|
+
'plugin-mcp': PluginMCPTranslationKeys
|
|
107
|
+
}
|
|
108
|
+
}
|