@payloadcms/plugin-mcp 4.0.0-canary.3 → 4.0.0-canary.31
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/LICENSE.md +1 -1
- package/bin.js +7 -0
- package/dist/defaultAccess.d.ts +3 -0
- package/dist/defaultAccess.d.ts.map +1 -0
- package/dist/defaultAccess.js +3 -0
- package/dist/defaultAccess.js.map +1 -0
- package/dist/defineTool.d.ts +8 -8
- package/dist/defineTool.d.ts.map +1 -1
- package/dist/endpoint/access.d.ts +12 -5
- package/dist/endpoint/access.d.ts.map +1 -1
- package/dist/endpoint/access.js +74 -103
- package/dist/endpoint/access.js.map +1 -1
- package/dist/endpoint/index.d.ts +1 -1
- package/dist/endpoint/index.d.ts.map +1 -1
- package/dist/endpoint/index.js +68 -17
- package/dist/endpoint/index.js.map +1 -1
- package/dist/exports/client.d.ts +1 -4
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +1 -4
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/internal.d.ts +2 -0
- package/dist/exports/internal.d.ts.map +1 -0
- package/dist/exports/internal.js +3 -0
- package/dist/exports/internal.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -56
- package/dist/index.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts +5 -5
- package/dist/mcp/buildMcpServer.d.ts.map +1 -1
- package/dist/mcp/buildMcpServer.js +67 -33
- 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 +2 -0
- package/dist/mcp/builtin/collections/countTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/countTool.js +63 -0
- package/dist/mcp/builtin/collections/countTool.js.map +1 -0
- package/dist/mcp/builtin/collections/countVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/countVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/countVersionsTool.js +60 -0
- package/dist/mcp/builtin/collections/countVersionsTool.js.map +1 -0
- 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 +105 -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 +46 -44
- package/dist/mcp/builtin/collections/deleteTool.js.map +1 -1
- package/dist/mcp/builtin/collections/duplicateTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/duplicateTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/duplicateTool.js +90 -0
- package/dist/mcp/builtin/collections/duplicateTool.js.map +1 -0
- 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 +2 -0
- package/dist/mcp/builtin/collections/findDistinctTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findDistinctTool.js +77 -0
- package/dist/mcp/builtin/collections/findDistinctTool.js.map +1 -0
- package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findTool.js +30 -47
- package/dist/mcp/builtin/collections/findTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.js +74 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.js.map +1 -0
- package/dist/mcp/builtin/collections/findVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findVersionsTool.js +84 -0
- package/dist/mcp/builtin/collections/findVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +54 -9
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -1
- package/dist/mcp/builtin/collections/restoreVersionTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.js +69 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.js.map +1 -0
- package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/updateTool.js +68 -86
- 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 +23 -10
- package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -1
- package/dist/mcp/builtin/globals/countVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/countVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/countVersionsTool.js +60 -0
- package/dist/mcp/builtin/globals/countVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/findTool.js +13 -17
- package/dist/mcp/builtin/globals/findTool.js.map +1 -1
- package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.js +68 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/findVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/findVersionsTool.js +78 -0
- package/dist/mcp/builtin/globals/findVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +31 -8
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -1
- package/dist/mcp/builtin/globals/restoreVersionTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.js +70 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.js.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/updateTool.js +29 -36
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -1
- package/dist/mcp/builtinTools.d.ts +73 -2
- package/dist/mcp/builtinTools.d.ts.map +1 -1
- package/dist/mcp/builtinTools.js +73 -3
- package/dist/mcp/builtinTools.js.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts +0 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.js +48 -17
- package/dist/mcp/sanitizeMCPConfig.js.map +1 -1
- package/dist/stdio.d.ts +3 -3
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +84 -46
- package/dist/stdio.js.map +1 -1
- package/dist/types.d.ts +95 -89
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -4
- package/dist/types.js.map +1 -1
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/getPluginConfig.d.ts +1 -1
- package/dist/utils/getPluginConfig.js +1 -1
- package/dist/utils/getPluginConfig.js.map +1 -1
- package/dist/utils/resolveProjectRoot.d.ts.map +1 -1
- package/dist/utils/toStandardSchema.d.ts.map +1 -1
- package/package.json +10 -18
- package/src/defaultAccess.ts +3 -0
- package/src/endpoint/access.ts +79 -112
- package/src/endpoint/index.ts +58 -16
- package/src/exports/client.ts +2 -4
- package/src/exports/internal.ts +1 -0
- package/src/index.ts +5 -62
- package/src/mcp/buildMcpServer.ts +85 -50
- package/src/mcp/builtin/collections/authTools.ts +77 -69
- package/src/mcp/builtin/collections/countTool.ts +61 -0
- package/src/mcp/builtin/collections/countVersionsTool.ts +60 -0
- package/src/mcp/builtin/collections/createTool.ts +112 -76
- package/src/mcp/builtin/collections/deleteTool.ts +38 -64
- package/src/mcp/builtin/collections/duplicateTool.ts +84 -0
- 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 +67 -0
- package/src/mcp/builtin/collections/findTool.ts +27 -107
- package/src/mcp/builtin/collections/findVersionByIDTool.ts +66 -0
- package/src/mcp/builtin/collections/findVersionsTool.ts +83 -0
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +51 -6
- package/src/mcp/builtin/collections/restoreVersionTool.ts +65 -0
- package/src/mcp/builtin/collections/updateTool.ts +65 -100
- package/src/mcp/builtin/collections/uploadInstructionsTool.ts +64 -0
- package/src/mcp/builtin/formatEntityError.ts +77 -0
- package/src/mcp/builtin/getConfigInfoTool.ts +22 -5
- package/src/mcp/builtin/globals/countVersionsTool.ts +60 -0
- package/src/mcp/builtin/globals/findTool.ts +15 -51
- package/src/mcp/builtin/globals/findVersionByIDTool.ts +64 -0
- package/src/mcp/builtin/globals/findVersionsTool.ts +69 -0
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +34 -6
- package/src/mcp/builtin/globals/restoreVersionTool.ts +68 -0
- package/src/mcp/builtin/globals/updateTool.ts +40 -60
- package/src/mcp/builtinTools.ts +72 -6
- package/src/mcp/sanitizeMCPConfig.ts +36 -19
- package/src/stdio.ts +79 -46
- package/src/types.ts +103 -93
- package/src/utils/getPluginConfig.ts +1 -1
- package/dist/collection/getAccessField.d.ts +0 -12
- package/dist/collection/getAccessField.d.ts.map +0 -1
- package/dist/collection/getAccessField.js +0 -72
- package/dist/collection/getAccessField.js.map +0 -1
- package/dist/collection/index.d.ts +0 -6
- package/dist/collection/index.d.ts.map +0 -1
- package/dist/collection/index.js +0 -105
- package/dist/collection/index.js.map +0 -1
- package/dist/components/APIKeyField/index.client.d.ts +0 -9
- package/dist/components/APIKeyField/index.client.d.ts.map +0 -1
- package/dist/components/APIKeyField/index.client.js +0 -85
- package/dist/components/APIKeyField/index.client.js.map +0 -1
- package/dist/components/APIKeyField/index.css +0 -105
- package/dist/components/APIKeysEmptyState/index.client.d.ts +0 -4
- package/dist/components/APIKeysEmptyState/index.client.d.ts.map +0 -1
- package/dist/components/APIKeysEmptyState/index.client.js +0 -21
- package/dist/components/APIKeysEmptyState/index.client.js.map +0 -1
- package/dist/components/AccessField/index.client.d.ts +0 -10
- package/dist/components/AccessField/index.client.d.ts.map +0 -1
- package/dist/components/AccessField/index.client.js +0 -247
- package/dist/components/AccessField/index.client.js.map +0 -1
- package/dist/components/AccessField/index.css +0 -99
- package/dist/components/SettingsMenu/index.client.d.ts +0 -8
- package/dist/components/SettingsMenu/index.client.d.ts.map +0 -1
- package/dist/components/SettingsMenu/index.client.js +0 -24
- package/dist/components/SettingsMenu/index.client.js.map +0 -1
- 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/translations/index.d.ts +0 -11
- package/dist/translations/index.d.ts.map +0 -1
- package/dist/translations/index.js +0 -92
- package/dist/translations/index.js.map +0 -1
- package/dist/translations/languages/ar.d.ts +0 -31
- package/dist/translations/languages/ar.d.ts.map +0 -1
- package/dist/translations/languages/ar.js +0 -34
- package/dist/translations/languages/ar.js.map +0 -1
- package/dist/translations/languages/az.d.ts +0 -31
- package/dist/translations/languages/az.d.ts.map +0 -1
- package/dist/translations/languages/az.js +0 -34
- package/dist/translations/languages/az.js.map +0 -1
- package/dist/translations/languages/bg.d.ts +0 -31
- package/dist/translations/languages/bg.d.ts.map +0 -1
- package/dist/translations/languages/bg.js +0 -34
- package/dist/translations/languages/bg.js.map +0 -1
- package/dist/translations/languages/bnBd.d.ts +0 -31
- package/dist/translations/languages/bnBd.d.ts.map +0 -1
- package/dist/translations/languages/bnBd.js +0 -34
- package/dist/translations/languages/bnBd.js.map +0 -1
- package/dist/translations/languages/bnIn.d.ts +0 -31
- package/dist/translations/languages/bnIn.d.ts.map +0 -1
- package/dist/translations/languages/bnIn.js +0 -34
- package/dist/translations/languages/bnIn.js.map +0 -1
- package/dist/translations/languages/ca.d.ts +0 -31
- package/dist/translations/languages/ca.d.ts.map +0 -1
- package/dist/translations/languages/ca.js +0 -34
- package/dist/translations/languages/ca.js.map +0 -1
- package/dist/translations/languages/cs.d.ts +0 -31
- package/dist/translations/languages/cs.d.ts.map +0 -1
- package/dist/translations/languages/cs.js +0 -34
- package/dist/translations/languages/cs.js.map +0 -1
- package/dist/translations/languages/da.d.ts +0 -31
- package/dist/translations/languages/da.d.ts.map +0 -1
- package/dist/translations/languages/da.js +0 -34
- package/dist/translations/languages/da.js.map +0 -1
- package/dist/translations/languages/de.d.ts +0 -31
- package/dist/translations/languages/de.d.ts.map +0 -1
- package/dist/translations/languages/de.js +0 -34
- package/dist/translations/languages/de.js.map +0 -1
- package/dist/translations/languages/en.d.ts +0 -31
- package/dist/translations/languages/en.d.ts.map +0 -1
- package/dist/translations/languages/en.js +0 -34
- package/dist/translations/languages/en.js.map +0 -1
- package/dist/translations/languages/es.d.ts +0 -31
- package/dist/translations/languages/es.d.ts.map +0 -1
- package/dist/translations/languages/es.js +0 -34
- package/dist/translations/languages/es.js.map +0 -1
- package/dist/translations/languages/et.d.ts +0 -31
- package/dist/translations/languages/et.d.ts.map +0 -1
- package/dist/translations/languages/et.js +0 -34
- package/dist/translations/languages/et.js.map +0 -1
- package/dist/translations/languages/fa.d.ts +0 -31
- package/dist/translations/languages/fa.d.ts.map +0 -1
- package/dist/translations/languages/fa.js +0 -34
- package/dist/translations/languages/fa.js.map +0 -1
- package/dist/translations/languages/fr.d.ts +0 -31
- package/dist/translations/languages/fr.d.ts.map +0 -1
- package/dist/translations/languages/fr.js +0 -34
- package/dist/translations/languages/fr.js.map +0 -1
- package/dist/translations/languages/he.d.ts +0 -31
- package/dist/translations/languages/he.d.ts.map +0 -1
- package/dist/translations/languages/he.js +0 -34
- package/dist/translations/languages/he.js.map +0 -1
- package/dist/translations/languages/hr.d.ts +0 -31
- package/dist/translations/languages/hr.d.ts.map +0 -1
- package/dist/translations/languages/hr.js +0 -34
- package/dist/translations/languages/hr.js.map +0 -1
- package/dist/translations/languages/hu.d.ts +0 -31
- package/dist/translations/languages/hu.d.ts.map +0 -1
- package/dist/translations/languages/hu.js +0 -34
- package/dist/translations/languages/hu.js.map +0 -1
- package/dist/translations/languages/hy.d.ts +0 -31
- package/dist/translations/languages/hy.d.ts.map +0 -1
- package/dist/translations/languages/hy.js +0 -34
- package/dist/translations/languages/hy.js.map +0 -1
- package/dist/translations/languages/id.d.ts +0 -31
- package/dist/translations/languages/id.d.ts.map +0 -1
- package/dist/translations/languages/id.js +0 -34
- package/dist/translations/languages/id.js.map +0 -1
- package/dist/translations/languages/is.d.ts +0 -31
- package/dist/translations/languages/is.d.ts.map +0 -1
- package/dist/translations/languages/is.js +0 -34
- package/dist/translations/languages/is.js.map +0 -1
- package/dist/translations/languages/it.d.ts +0 -31
- package/dist/translations/languages/it.d.ts.map +0 -1
- package/dist/translations/languages/it.js +0 -34
- package/dist/translations/languages/it.js.map +0 -1
- package/dist/translations/languages/ja.d.ts +0 -31
- package/dist/translations/languages/ja.d.ts.map +0 -1
- package/dist/translations/languages/ja.js +0 -34
- package/dist/translations/languages/ja.js.map +0 -1
- package/dist/translations/languages/ko.d.ts +0 -31
- package/dist/translations/languages/ko.d.ts.map +0 -1
- package/dist/translations/languages/ko.js +0 -34
- package/dist/translations/languages/ko.js.map +0 -1
- package/dist/translations/languages/lt.d.ts +0 -31
- package/dist/translations/languages/lt.d.ts.map +0 -1
- package/dist/translations/languages/lt.js +0 -34
- package/dist/translations/languages/lt.js.map +0 -1
- package/dist/translations/languages/lv.d.ts +0 -31
- package/dist/translations/languages/lv.d.ts.map +0 -1
- package/dist/translations/languages/lv.js +0 -34
- package/dist/translations/languages/lv.js.map +0 -1
- package/dist/translations/languages/my.d.ts +0 -31
- package/dist/translations/languages/my.d.ts.map +0 -1
- package/dist/translations/languages/my.js +0 -34
- package/dist/translations/languages/my.js.map +0 -1
- package/dist/translations/languages/nb.d.ts +0 -31
- package/dist/translations/languages/nb.d.ts.map +0 -1
- package/dist/translations/languages/nb.js +0 -34
- package/dist/translations/languages/nb.js.map +0 -1
- package/dist/translations/languages/nl.d.ts +0 -31
- package/dist/translations/languages/nl.d.ts.map +0 -1
- package/dist/translations/languages/nl.js +0 -34
- package/dist/translations/languages/nl.js.map +0 -1
- package/dist/translations/languages/pl.d.ts +0 -31
- package/dist/translations/languages/pl.d.ts.map +0 -1
- package/dist/translations/languages/pl.js +0 -34
- package/dist/translations/languages/pl.js.map +0 -1
- package/dist/translations/languages/pt.d.ts +0 -31
- package/dist/translations/languages/pt.d.ts.map +0 -1
- package/dist/translations/languages/pt.js +0 -34
- package/dist/translations/languages/pt.js.map +0 -1
- package/dist/translations/languages/ro.d.ts +0 -31
- package/dist/translations/languages/ro.d.ts.map +0 -1
- package/dist/translations/languages/ro.js +0 -34
- package/dist/translations/languages/ro.js.map +0 -1
- package/dist/translations/languages/rs.d.ts +0 -31
- package/dist/translations/languages/rs.d.ts.map +0 -1
- package/dist/translations/languages/rs.js +0 -34
- package/dist/translations/languages/rs.js.map +0 -1
- package/dist/translations/languages/rsLatin.d.ts +0 -31
- package/dist/translations/languages/rsLatin.d.ts.map +0 -1
- package/dist/translations/languages/rsLatin.js +0 -34
- package/dist/translations/languages/rsLatin.js.map +0 -1
- package/dist/translations/languages/ru.d.ts +0 -31
- package/dist/translations/languages/ru.d.ts.map +0 -1
- package/dist/translations/languages/ru.js +0 -34
- package/dist/translations/languages/ru.js.map +0 -1
- package/dist/translations/languages/sk.d.ts +0 -31
- package/dist/translations/languages/sk.d.ts.map +0 -1
- package/dist/translations/languages/sk.js +0 -34
- package/dist/translations/languages/sk.js.map +0 -1
- package/dist/translations/languages/sl.d.ts +0 -31
- package/dist/translations/languages/sl.d.ts.map +0 -1
- package/dist/translations/languages/sl.js +0 -34
- package/dist/translations/languages/sl.js.map +0 -1
- package/dist/translations/languages/sv.d.ts +0 -31
- package/dist/translations/languages/sv.d.ts.map +0 -1
- package/dist/translations/languages/sv.js +0 -34
- package/dist/translations/languages/sv.js.map +0 -1
- package/dist/translations/languages/ta.d.ts +0 -31
- package/dist/translations/languages/ta.d.ts.map +0 -1
- package/dist/translations/languages/ta.js +0 -34
- package/dist/translations/languages/ta.js.map +0 -1
- package/dist/translations/languages/th.d.ts +0 -31
- package/dist/translations/languages/th.d.ts.map +0 -1
- package/dist/translations/languages/th.js +0 -34
- package/dist/translations/languages/th.js.map +0 -1
- package/dist/translations/languages/tr.d.ts +0 -31
- package/dist/translations/languages/tr.d.ts.map +0 -1
- package/dist/translations/languages/tr.js +0 -34
- package/dist/translations/languages/tr.js.map +0 -1
- package/dist/translations/languages/uk.d.ts +0 -31
- package/dist/translations/languages/uk.d.ts.map +0 -1
- package/dist/translations/languages/uk.js +0 -34
- package/dist/translations/languages/uk.js.map +0 -1
- package/dist/translations/languages/vi.d.ts +0 -31
- package/dist/translations/languages/vi.d.ts.map +0 -1
- package/dist/translations/languages/vi.js +0 -34
- package/dist/translations/languages/vi.js.map +0 -1
- package/dist/translations/languages/zh.d.ts +0 -31
- package/dist/translations/languages/zh.d.ts.map +0 -1
- package/dist/translations/languages/zh.js +0 -34
- package/dist/translations/languages/zh.js.map +0 -1
- package/dist/translations/languages/zhTw.d.ts +0 -31
- package/dist/translations/languages/zhTw.d.ts.map +0 -1
- package/dist/translations/languages/zhTw.js +0 -34
- package/dist/translations/languages/zhTw.js.map +0 -1
- package/dist/translations/types.d.ts +0 -32
- package/dist/translations/types.d.ts.map +0 -1
- package/dist/translations/types.js +0 -3
- package/dist/translations/types.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/localAPIDefaults.d.ts +0 -20
- package/dist/utils/localAPIDefaults.d.ts.map +0 -1
- package/dist/utils/localAPIDefaults.js +0 -19
- package/dist/utils/localAPIDefaults.js.map +0 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +0 -11
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.js +0 -34
- package/dist/utils/schemaConversion/getEntityInputSchema.js.map +0 -1
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts +0 -7
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js +0 -20
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +0 -15
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +0 -464
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +0 -158
- 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/collection/getAccessField.ts +0 -84
- package/src/collection/index.ts +0 -105
- package/src/components/APIKeyField/index.client.tsx +0 -68
- package/src/components/APIKeyField/index.css +0 -105
- package/src/components/APIKeysEmptyState/index.client.tsx +0 -33
- package/src/components/AccessField/index.client.tsx +0 -296
- package/src/components/AccessField/index.css +0 -99
- package/src/components/SettingsMenu/index.client.tsx +0 -30
- package/src/mcp/builtin/collections/formatCollectionError.ts +0 -84
- package/src/mcp/builtin/validateEntityData.ts +0 -132
- package/src/translations/index.ts +0 -105
- package/src/translations/languages/ar.ts +0 -38
- package/src/translations/languages/az.ts +0 -38
- package/src/translations/languages/bg.ts +0 -39
- package/src/translations/languages/bnBd.ts +0 -39
- package/src/translations/languages/bnIn.ts +0 -39
- package/src/translations/languages/ca.ts +0 -39
- package/src/translations/languages/cs.ts +0 -39
- package/src/translations/languages/da.ts +0 -38
- package/src/translations/languages/de.ts +0 -39
- package/src/translations/languages/en.ts +0 -39
- package/src/translations/languages/es.ts +0 -39
- package/src/translations/languages/et.ts +0 -38
- package/src/translations/languages/fa.ts +0 -39
- package/src/translations/languages/fr.ts +0 -39
- package/src/translations/languages/he.ts +0 -37
- package/src/translations/languages/hr.ts +0 -39
- package/src/translations/languages/hu.ts +0 -39
- package/src/translations/languages/hy.ts +0 -39
- package/src/translations/languages/id.ts +0 -39
- package/src/translations/languages/is.ts +0 -39
- package/src/translations/languages/it.ts +0 -39
- package/src/translations/languages/ja.ts +0 -39
- package/src/translations/languages/ko.ts +0 -39
- package/src/translations/languages/lt.ts +0 -39
- package/src/translations/languages/lv.ts +0 -38
- package/src/translations/languages/my.ts +0 -39
- package/src/translations/languages/nb.ts +0 -39
- package/src/translations/languages/nl.ts +0 -39
- package/src/translations/languages/pl.ts +0 -38
- package/src/translations/languages/pt.ts +0 -39
- package/src/translations/languages/ro.ts +0 -39
- package/src/translations/languages/rs.ts +0 -38
- package/src/translations/languages/rsLatin.ts +0 -38
- package/src/translations/languages/ru.ts +0 -39
- package/src/translations/languages/sk.ts +0 -39
- package/src/translations/languages/sl.ts +0 -38
- package/src/translations/languages/sv.ts +0 -39
- package/src/translations/languages/ta.ts +0 -39
- package/src/translations/languages/th.ts +0 -38
- package/src/translations/languages/tr.ts +0 -38
- package/src/translations/languages/uk.ts +0 -39
- package/src/translations/languages/vi.ts +0 -39
- package/src/translations/languages/zh.ts +0 -36
- package/src/translations/languages/zhTw.ts +0 -36
- package/src/translations/types.ts +0 -34
- package/src/utils/getVirtualFieldNames.ts +0 -53
- package/src/utils/localAPIDefaults.ts +0 -22
- package/src/utils/schemaConversion/getEntityInputSchema.ts +0 -78
- package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +0 -27
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +0 -103
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +0 -529
- package/src/utils/transformPointDataToPayload.ts +0 -40
- package/src/utils/whereSchema.ts +0 -24
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { sanitizeEntitySchema } from './sanitizeEntitySchema.js';
|
|
3
|
-
describe('sanitizeEntitySchema', ()=>{
|
|
4
|
-
it('keeps a Lexical node union strict (oneOf) while simplifying relationship values to IDs', ()=>{
|
|
5
|
-
// Shaped like the schema the MCP server prepares for a collection with a Lexical richText field:
|
|
6
|
-
// a `$defs` node union (a `oneOf` of node shapes) where a relationship node's `value` is either
|
|
7
|
-
// an ID or a `$ref` to the populated related collection.
|
|
8
|
-
const standalone = {
|
|
9
|
-
type: 'object',
|
|
10
|
-
$defs: {
|
|
11
|
-
LexicalNodes_ABCDEF12: {
|
|
12
|
-
oneOf: [
|
|
13
|
-
{
|
|
14
|
-
type: 'object',
|
|
15
|
-
additionalProperties: false,
|
|
16
|
-
properties: {
|
|
17
|
-
type: {
|
|
18
|
-
const: 'paragraph'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
required: [
|
|
22
|
-
'type'
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'object',
|
|
27
|
-
additionalProperties: false,
|
|
28
|
-
properties: {
|
|
29
|
-
type: {
|
|
30
|
-
const: 'relationship'
|
|
31
|
-
},
|
|
32
|
-
value: {
|
|
33
|
-
oneOf: [
|
|
34
|
-
{
|
|
35
|
-
type: 'string'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
$ref: '#/$defs/posts'
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
required: [
|
|
44
|
-
'type'
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
posts: {
|
|
50
|
-
type: 'object',
|
|
51
|
-
additionalProperties: false,
|
|
52
|
-
properties: {
|
|
53
|
-
id: {
|
|
54
|
-
type: 'string'
|
|
55
|
-
},
|
|
56
|
-
title: {
|
|
57
|
-
type: 'string'
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
properties: {
|
|
63
|
-
id: {
|
|
64
|
-
type: 'string'
|
|
65
|
-
},
|
|
66
|
-
content: {
|
|
67
|
-
type: 'object',
|
|
68
|
-
properties: {
|
|
69
|
-
root: {
|
|
70
|
-
type: 'object',
|
|
71
|
-
properties: {
|
|
72
|
-
children: {
|
|
73
|
-
type: 'array',
|
|
74
|
-
items: {
|
|
75
|
-
$ref: '#/$defs/LexicalNodes_ABCDEF12'
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
expect(sanitizeEntitySchema(standalone)).toStrictEqual({
|
|
85
|
-
type: 'object',
|
|
86
|
-
$defs: {
|
|
87
|
-
// The node union is renamed to a short, readable `node`, and stays a strict discriminated
|
|
88
|
-
// `oneOf` - not loosened to `anyOf`...
|
|
89
|
-
node: {
|
|
90
|
-
oneOf: [
|
|
91
|
-
{
|
|
92
|
-
type: 'object',
|
|
93
|
-
additionalProperties: false,
|
|
94
|
-
properties: {
|
|
95
|
-
type: {
|
|
96
|
-
const: 'paragraph'
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
required: [
|
|
100
|
-
'type'
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
type: 'object',
|
|
105
|
-
additionalProperties: false,
|
|
106
|
-
properties: {
|
|
107
|
-
type: {
|
|
108
|
-
const: 'relationship'
|
|
109
|
-
},
|
|
110
|
-
// ...while the relationship `value` is simplified to a bare ID (the populated-doc `$ref` is dropped).
|
|
111
|
-
value: {
|
|
112
|
-
type: 'string',
|
|
113
|
-
description: 'The ID of the related "posts" document.'
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
required: [
|
|
117
|
-
'type'
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
},
|
|
122
|
-
posts: {
|
|
123
|
-
type: 'object',
|
|
124
|
-
additionalProperties: false,
|
|
125
|
-
properties: {
|
|
126
|
-
id: {
|
|
127
|
-
type: 'string'
|
|
128
|
-
},
|
|
129
|
-
title: {
|
|
130
|
-
type: 'string'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
properties: {
|
|
136
|
-
// `id` is dropped - it's a Payload-managed field MCP clients never set.
|
|
137
|
-
content: {
|
|
138
|
-
type: 'object',
|
|
139
|
-
properties: {
|
|
140
|
-
root: {
|
|
141
|
-
type: 'object',
|
|
142
|
-
properties: {
|
|
143
|
-
children: {
|
|
144
|
-
type: 'array',
|
|
145
|
-
items: {
|
|
146
|
-
$ref: '#/$defs/node'
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
//# sourceMappingURL=sanitizeEntitySchema.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/schemaConversion/sanitizeEntitySchema.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport type { JsonSchemaType } from '../../types.js'\n\nimport { sanitizeEntitySchema } from './sanitizeEntitySchema.js'\n\ndescribe('sanitizeEntitySchema', () => {\n it('keeps a Lexical node union strict (oneOf) while simplifying relationship values to IDs', () => {\n // Shaped like the schema the MCP server prepares for a collection with a Lexical richText field:\n // a `$defs` node union (a `oneOf` of node shapes) where a relationship node's `value` is either\n // an ID or a `$ref` to the populated related collection.\n const standalone: JsonSchemaType = {\n type: 'object',\n $defs: {\n LexicalNodes_ABCDEF12: {\n oneOf: [\n {\n type: 'object',\n additionalProperties: false,\n properties: { type: { const: 'paragraph' } },\n required: ['type'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { const: 'relationship' },\n value: { oneOf: [{ type: 'string' }, { $ref: '#/$defs/posts' }] },\n },\n required: ['type'],\n },\n ],\n },\n posts: {\n type: 'object',\n additionalProperties: false,\n properties: { id: { type: 'string' }, title: { type: 'string' } },\n },\n },\n properties: {\n id: { type: 'string' },\n content: {\n type: 'object',\n properties: {\n root: {\n type: 'object',\n properties: {\n children: { type: 'array', items: { $ref: '#/$defs/LexicalNodes_ABCDEF12' } },\n },\n },\n },\n },\n },\n }\n\n expect(sanitizeEntitySchema(standalone)).toStrictEqual({\n type: 'object',\n $defs: {\n // The node union is renamed to a short, readable `node`, and stays a strict discriminated\n // `oneOf` - not loosened to `anyOf`...\n node: {\n oneOf: [\n {\n type: 'object',\n additionalProperties: false,\n properties: { type: { const: 'paragraph' } },\n required: ['type'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { const: 'relationship' },\n // ...while the relationship `value` is simplified to a bare ID (the populated-doc `$ref` is dropped).\n value: { type: 'string', description: 'The ID of the related \"posts\" document.' },\n },\n required: ['type'],\n },\n ],\n },\n posts: {\n type: 'object',\n additionalProperties: false,\n properties: { id: { type: 'string' }, title: { type: 'string' } },\n },\n },\n properties: {\n // `id` is dropped - it's a Payload-managed field MCP clients never set.\n content: {\n type: 'object',\n properties: {\n root: {\n type: 'object',\n properties: {\n children: { type: 'array', items: { $ref: '#/$defs/node' } },\n },\n },\n },\n },\n },\n })\n })\n})\n"],"names":["describe","expect","it","sanitizeEntitySchema","standalone","type","$defs","LexicalNodes_ABCDEF12","oneOf","additionalProperties","properties","const","required","value","$ref","posts","id","title","content","root","children","items","toStrictEqual","node","description"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAI7C,SAASC,oBAAoB,QAAQ,4BAA2B;AAEhEH,SAAS,wBAAwB;IAC/BE,GAAG,0FAA0F;QAC3F,iGAAiG;QACjG,gGAAgG;QAChG,yDAAyD;QACzD,MAAME,aAA6B;YACjCC,MAAM;YACNC,OAAO;gBACLC,uBAAuB;oBACrBC,OAAO;wBACL;4BACEH,MAAM;4BACNI,sBAAsB;4BACtBC,YAAY;gCAAEL,MAAM;oCAAEM,OAAO;gCAAY;4BAAE;4BAC3CC,UAAU;gCAAC;6BAAO;wBACpB;wBACA;4BACEP,MAAM;4BACNI,sBAAsB;4BACtBC,YAAY;gCACVL,MAAM;oCAAEM,OAAO;gCAAe;gCAC9BE,OAAO;oCAAEL,OAAO;wCAAC;4CAAEH,MAAM;wCAAS;wCAAG;4CAAES,MAAM;wCAAgB;qCAAE;gCAAC;4BAClE;4BACAF,UAAU;gCAAC;6BAAO;wBACpB;qBACD;gBACH;gBACAG,OAAO;oBACLV,MAAM;oBACNI,sBAAsB;oBACtBC,YAAY;wBAAEM,IAAI;4BAAEX,MAAM;wBAAS;wBAAGY,OAAO;4BAAEZ,MAAM;wBAAS;oBAAE;gBAClE;YACF;YACAK,YAAY;gBACVM,IAAI;oBAAEX,MAAM;gBAAS;gBACrBa,SAAS;oBACPb,MAAM;oBACNK,YAAY;wBACVS,MAAM;4BACJd,MAAM;4BACNK,YAAY;gCACVU,UAAU;oCAAEf,MAAM;oCAASgB,OAAO;wCAAEP,MAAM;oCAAgC;gCAAE;4BAC9E;wBACF;oBACF;gBACF;YACF;QACF;QAEAb,OAAOE,qBAAqBC,aAAakB,aAAa,CAAC;YACrDjB,MAAM;YACNC,OAAO;gBACL,0FAA0F;gBAC1F,uCAAuC;gBACvCiB,MAAM;oBACJf,OAAO;wBACL;4BACEH,MAAM;4BACNI,sBAAsB;4BACtBC,YAAY;gCAAEL,MAAM;oCAAEM,OAAO;gCAAY;4BAAE;4BAC3CC,UAAU;gCAAC;6BAAO;wBACpB;wBACA;4BACEP,MAAM;4BACNI,sBAAsB;4BACtBC,YAAY;gCACVL,MAAM;oCAAEM,OAAO;gCAAe;gCAC9B,sGAAsG;gCACtGE,OAAO;oCAAER,MAAM;oCAAUmB,aAAa;gCAA0C;4BAClF;4BACAZ,UAAU;gCAAC;6BAAO;wBACpB;qBACD;gBACH;gBACAG,OAAO;oBACLV,MAAM;oBACNI,sBAAsB;oBACtBC,YAAY;wBAAEM,IAAI;4BAAEX,MAAM;wBAAS;wBAAGY,OAAO;4BAAEZ,MAAM;wBAAS;oBAAE;gBAClE;YACF;YACAK,YAAY;gBACV,wEAAwE;gBACxEQ,SAAS;oBACPb,MAAM;oBACNK,YAAY;wBACVS,MAAM;4BACJd,MAAM;4BACNK,YAAY;gCACVU,UAAU;oCAAEf,MAAM;oCAASgB,OAAO;wCAAEP,MAAM;oCAAe;gCAAE;4BAC7D;wBACF;oBACF;gBACF;YACF;QACF;IACF;AACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transforms incoming MCP tool data from object format to tuple array format.
|
|
3
|
-
* Converts { longitude: number, latitude: number } back to [longitude, latitude]
|
|
4
|
-
* for Payload's internal point field representation.
|
|
5
|
-
*/
|
|
6
|
-
export declare function transformPointDataToPayload(data: Record<string, unknown>): Record<string, unknown>;
|
|
7
|
-
//# sourceMappingURL=transformPointDataToPayload.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformPointDataToPayload.d.ts","sourceRoot":"","sources":["../../src/utils/transformPointDataToPayload.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgCzB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transforms incoming MCP tool data from object format to tuple array format.
|
|
3
|
-
* Converts { longitude: number, latitude: number } back to [longitude, latitude]
|
|
4
|
-
* for Payload's internal point field representation.
|
|
5
|
-
*/ export function transformPointDataToPayload(data) {
|
|
6
|
-
if (!data || typeof data !== 'object') {
|
|
7
|
-
return data;
|
|
8
|
-
}
|
|
9
|
-
const transformed = {};
|
|
10
|
-
for (const [key, value] of Object.entries(data)){
|
|
11
|
-
if (value && typeof value === 'object' && 'longitude' in value && 'latitude' in value && typeof value.longitude === 'number' && typeof value.latitude === 'number') {
|
|
12
|
-
// Transform to tuple array [longitude, latitude]
|
|
13
|
-
transformed[key] = [
|
|
14
|
-
value.longitude,
|
|
15
|
-
value.latitude
|
|
16
|
-
];
|
|
17
|
-
} else if (Array.isArray(value)) {
|
|
18
|
-
transformed[key] = value.map((item)=>typeof item === 'object' ? transformPointDataToPayload(item) : item);
|
|
19
|
-
} else if (value && typeof value === 'object') {
|
|
20
|
-
transformed[key] = transformPointDataToPayload(value);
|
|
21
|
-
} else {
|
|
22
|
-
transformed[key] = value;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return transformed;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=transformPointDataToPayload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/transformPointDataToPayload.ts"],"sourcesContent":["/**\n * Transforms incoming MCP tool data from object format to tuple array format.\n * Converts { longitude: number, latitude: number } back to [longitude, latitude]\n * for Payload's internal point field representation.\n */\nexport function transformPointDataToPayload(\n data: Record<string, unknown>,\n): Record<string, unknown> {\n if (!data || typeof data !== 'object') {\n return data\n }\n\n const transformed: Record<string, unknown> = {}\n\n for (const [key, value] of Object.entries(data)) {\n if (\n value &&\n typeof value === 'object' &&\n 'longitude' in value &&\n 'latitude' in value &&\n typeof value.longitude === 'number' &&\n typeof value.latitude === 'number'\n ) {\n // Transform to tuple array [longitude, latitude]\n transformed[key] = [value.longitude, value.latitude]\n } else if (Array.isArray(value)) {\n transformed[key] = value.map((item) =>\n typeof item === 'object'\n ? transformPointDataToPayload(item as Record<string, unknown>)\n : item,\n )\n } else if (value && typeof value === 'object') {\n transformed[key] = transformPointDataToPayload(value as Record<string, unknown>)\n } else {\n transformed[key] = value\n }\n }\n\n return transformed\n}\n"],"names":["transformPointDataToPayload","data","transformed","key","value","Object","entries","longitude","latitude","Array","isArray","map","item"],"mappings":"AAAA;;;;CAIC,GACD,OAAO,SAASA,4BACdC,IAA6B;IAE7B,IAAI,CAACA,QAAQ,OAAOA,SAAS,UAAU;QACrC,OAAOA;IACT;IAEA,MAAMC,cAAuC,CAAC;IAE9C,KAAK,MAAM,CAACC,KAAKC,MAAM,IAAIC,OAAOC,OAAO,CAACL,MAAO;QAC/C,IACEG,SACA,OAAOA,UAAU,YACjB,eAAeA,SACf,cAAcA,SACd,OAAOA,MAAMG,SAAS,KAAK,YAC3B,OAAOH,MAAMI,QAAQ,KAAK,UAC1B;YACA,iDAAiD;YACjDN,WAAW,CAACC,IAAI,GAAG;gBAACC,MAAMG,SAAS;gBAAEH,MAAMI,QAAQ;aAAC;QACtD,OAAO,IAAIC,MAAMC,OAAO,CAACN,QAAQ;YAC/BF,WAAW,CAACC,IAAI,GAAGC,MAAMO,GAAG,CAAC,CAACC,OAC5B,OAAOA,SAAS,WACZZ,4BAA4BY,QAC5BA;QAER,OAAO,IAAIR,SAAS,OAAOA,UAAU,UAAU;YAC7CF,WAAW,CAACC,IAAI,GAAGH,4BAA4BI;QACjD,OAAO;YACLF,WAAW,CAACC,IAAI,GAAGC;QACrB;IACF;IAEA,OAAOF;AACT"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Where } from 'payload';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
/**
|
|
4
|
-
* - Validates the `where` input of collection tools against Payload's `Where` shape
|
|
5
|
-
* - Field keys map to operator objects restricted to `validOperators`
|
|
6
|
-
* - `and` / `or` nest recursively
|
|
7
|
-
*/
|
|
8
|
-
export declare const whereSchema: z.ZodType<Where>;
|
|
9
|
-
//# sourceMappingURL=whereSchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"whereSchema.d.ts","sourceRoot":"","sources":["../../src/utils/whereSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CASqD,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { validOperators } from 'payload/shared';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
const whereFieldSchema = z.partialRecord(z.enum(validOperators), z.unknown()).describe('Field query operators');
|
|
4
|
-
/**
|
|
5
|
-
* - Validates the `where` input of collection tools against Payload's `Where` shape
|
|
6
|
-
* - Field keys map to operator objects restricted to `validOperators`
|
|
7
|
-
* - `and` / `or` nest recursively
|
|
8
|
-
*/ export const whereSchema = z.lazy(()=>z.object({
|
|
9
|
-
and: z.array(whereSchema).optional(),
|
|
10
|
-
or: z.array(whereSchema).optional()
|
|
11
|
-
}).catchall(whereFieldSchema)).describe('Where clause using field names with Payload query operators, plus and/or groups');
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=whereSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/whereSchema.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport { validOperators } from 'payload/shared'\nimport { z } from 'zod'\n\nconst whereFieldSchema = z\n .partialRecord(z.enum(validOperators), z.unknown())\n .describe('Field query operators')\n\n/**\n * - Validates the `where` input of collection tools against Payload's `Where` shape\n * - Field keys map to operator objects restricted to `validOperators`\n * - `and` / `or` nest recursively\n */\nexport const whereSchema: z.ZodType<Where> = z\n .lazy(() =>\n z\n .object({\n and: z.array(whereSchema).optional(),\n or: z.array(whereSchema).optional(),\n })\n .catchall(whereFieldSchema),\n )\n .describe('Where clause using field names with Payload query operators, plus and/or groups')\n"],"names":["validOperators","z","whereFieldSchema","partialRecord","enum","unknown","describe","whereSchema","lazy","object","and","array","optional","or","catchall"],"mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAC/C,SAASC,CAAC,QAAQ,MAAK;AAEvB,MAAMC,mBAAmBD,EACtBE,aAAa,CAACF,EAAEG,IAAI,CAACJ,iBAAiBC,EAAEI,OAAO,IAC/CC,QAAQ,CAAC;AAEZ;;;;CAIC,GACD,OAAO,MAAMC,cAAgCN,EAC1CO,IAAI,CAAC,IACJP,EACGQ,MAAM,CAAC;QACNC,KAAKT,EAAEU,KAAK,CAACJ,aAAaK,QAAQ;QAClCC,IAAIZ,EAAEU,KAAK,CAACJ,aAAaK,QAAQ;IACnC,GACCE,QAAQ,CAACZ,mBAEbI,QAAQ,CAAC,mFAAkF"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { JSONField } from 'payload'
|
|
2
|
-
|
|
3
|
-
import type { ClientMCPPluginConfig, MCPItem, SanitizedMCPPluginConfig } from '../types.js'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
COLLECTION_AUTH_BUILTINS,
|
|
7
|
-
COLLECTION_BUILTINS,
|
|
8
|
-
GLOBAL_BUILTINS,
|
|
9
|
-
} from '../mcp/builtinTools.js'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Returns the API key collection's `access` field — a JSON field whose value
|
|
13
|
-
* is the `MCPAPIKeysDocAccessTree` the endpoint consults. The actual UI is
|
|
14
|
-
* a custom client component (`AccessField`) which renders a permissions
|
|
15
|
-
* matrix; the field's stored shape is just the runtime access tree.
|
|
16
|
-
*/
|
|
17
|
-
export const getAccessField = ({
|
|
18
|
-
pluginConfig,
|
|
19
|
-
}: {
|
|
20
|
-
pluginConfig: SanitizedMCPPluginConfig
|
|
21
|
-
}): JSONField => {
|
|
22
|
-
const clientPluginConfig = sanitizeClientPluginConfig(pluginConfig)
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
name: 'access',
|
|
26
|
-
type: 'json',
|
|
27
|
-
admin: {
|
|
28
|
-
components: {
|
|
29
|
-
Field: {
|
|
30
|
-
clientProps: { pluginConfig: clientPluginConfig },
|
|
31
|
-
path: '@payloadcms/plugin-mcp/client#AccessField',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultValue: {},
|
|
36
|
-
label: false,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Strips the non-serializable parts of `SanitizedMCPPluginConfig` (handlers,
|
|
42
|
-
* input/argsSchema functions, etc.) so the result is safe to thread to a
|
|
43
|
-
* client component via `clientProps`.
|
|
44
|
-
*/
|
|
45
|
-
const sanitizeClientPluginConfig = (
|
|
46
|
-
pluginConfig: SanitizedMCPPluginConfig,
|
|
47
|
-
): ClientMCPPluginConfig => ({
|
|
48
|
-
items: pluginConfig.items.map((item) => {
|
|
49
|
-
const group = itemGroup(item)
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
...(item.type === 'collectionTool' ? { collectionSlug: item.collectionSlug } : {}),
|
|
53
|
-
...(item.type === 'globalTool' ? { globalSlug: item.globalSlug } : {}),
|
|
54
|
-
type: item.type,
|
|
55
|
-
configKey: item.configKey,
|
|
56
|
-
...(group === 'operations' ? {} : { description: itemDescription(item) }),
|
|
57
|
-
group,
|
|
58
|
-
label: item.label,
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
const itemDescription = (item: MCPItem): string => {
|
|
64
|
-
if (item.type === 'prompt') {
|
|
65
|
-
return item.prompt.description
|
|
66
|
-
}
|
|
67
|
-
if (item.type === 'resource') {
|
|
68
|
-
return item.resource.description
|
|
69
|
-
}
|
|
70
|
-
return item.tool.description
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const itemGroup = (item: MCPItem): 'auth' | 'custom' | 'operations' | undefined => {
|
|
74
|
-
if (item.type === 'collectionTool') {
|
|
75
|
-
if (item.configKey in COLLECTION_BUILTINS) {
|
|
76
|
-
return 'operations'
|
|
77
|
-
}
|
|
78
|
-
return item.configKey in COLLECTION_AUTH_BUILTINS ? 'auth' : 'custom'
|
|
79
|
-
}
|
|
80
|
-
if (item.type === 'globalTool') {
|
|
81
|
-
return item.configKey in GLOBAL_BUILTINS ? 'operations' : 'custom'
|
|
82
|
-
}
|
|
83
|
-
return undefined
|
|
84
|
-
}
|
package/src/collection/index.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { CollectionConfig } from 'payload'
|
|
2
|
-
|
|
3
|
-
import { createAPIKeyFields } from 'payload'
|
|
4
|
-
|
|
5
|
-
import type { SanitizedMCPPluginConfig } from '../types.js'
|
|
6
|
-
|
|
7
|
-
import { getAccessField } from './getAccessField.js'
|
|
8
|
-
|
|
9
|
-
const apiKeyStorageFields = createAPIKeyFields({
|
|
10
|
-
apiKeyField: {
|
|
11
|
-
admin: {
|
|
12
|
-
components: { Field: '@payloadcms/plugin-mcp/client#APIKeyField' },
|
|
13
|
-
},
|
|
14
|
-
required: true,
|
|
15
|
-
},
|
|
16
|
-
apiKeyIndexField: {
|
|
17
|
-
index: true,
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
includeEnableAPIKey: false,
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export const getAPIKeysCollection = ({
|
|
24
|
-
pluginConfig,
|
|
25
|
-
}: {
|
|
26
|
-
pluginConfig: SanitizedMCPPluginConfig
|
|
27
|
-
}): CollectionConfig => {
|
|
28
|
-
const collection: CollectionConfig = {
|
|
29
|
-
slug: 'payload-mcp-api-keys',
|
|
30
|
-
admin: {
|
|
31
|
-
components: {
|
|
32
|
-
views: {
|
|
33
|
-
list: {
|
|
34
|
-
NoResults: '@payloadcms/plugin-mcp/client#APIKeysEmptyState',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultColumns: ['label', 'lastUsed', 'user'],
|
|
39
|
-
// Kept out of the main nav — reachable through the user menu's settings instead.
|
|
40
|
-
group: false,
|
|
41
|
-
useAsTitle: 'label',
|
|
42
|
-
},
|
|
43
|
-
fields: [
|
|
44
|
-
...apiKeyStorageFields,
|
|
45
|
-
getAccessField({ pluginConfig }),
|
|
46
|
-
{
|
|
47
|
-
name: 'label',
|
|
48
|
-
type: 'text',
|
|
49
|
-
admin: {
|
|
50
|
-
description: ({ t }) => t('plugin-mcp:titleDescription'),
|
|
51
|
-
position: 'sidebar',
|
|
52
|
-
},
|
|
53
|
-
label: ({ t }) => t('plugin-mcp:title'),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'description',
|
|
57
|
-
type: 'text',
|
|
58
|
-
admin: {
|
|
59
|
-
description: ({ t }) => t('plugin-mcp:descriptionDescription'),
|
|
60
|
-
position: 'sidebar',
|
|
61
|
-
},
|
|
62
|
-
label: ({ t }) => t('plugin-mcp:description'),
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'lastUsed',
|
|
66
|
-
type: 'date',
|
|
67
|
-
admin: {
|
|
68
|
-
date: { pickerAppearance: 'dayAndTime' },
|
|
69
|
-
disabled: { field: true },
|
|
70
|
-
},
|
|
71
|
-
label: ({ t }) => t('plugin-mcp:lastUsed'),
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'user',
|
|
75
|
-
type: 'relationship',
|
|
76
|
-
admin: {
|
|
77
|
-
description: ({ t }) => t('plugin-mcp:userDescription'),
|
|
78
|
-
position: 'sidebar',
|
|
79
|
-
},
|
|
80
|
-
label: ({ t }) => t('general:user'),
|
|
81
|
-
relationTo: pluginConfig.userCollection,
|
|
82
|
-
required: true,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'overrideAccess',
|
|
86
|
-
type: 'checkbox',
|
|
87
|
-
admin: {
|
|
88
|
-
description: ({ t }) => t('plugin-mcp:overrideAccessDescription'),
|
|
89
|
-
position: 'sidebar',
|
|
90
|
-
},
|
|
91
|
-
defaultValue: false,
|
|
92
|
-
label: ({ t }) => t('plugin-mcp:overrideAccess'),
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
labels: {
|
|
96
|
-
plural: ({ t }) => `${t('plugin-mcp:mcp')} ${t('plugin-mcp:apiKeys')}`,
|
|
97
|
-
singular: ({ t }) => `${t('plugin-mcp:mcp')} ${t('authentication:apiKey')}`,
|
|
98
|
-
},
|
|
99
|
-
versions: false,
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return pluginConfig.overrideApiKeyCollection
|
|
103
|
-
? pluginConfig.overrideApiKeyCollection(collection)
|
|
104
|
-
: collection
|
|
105
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { APIKeyInput, Button, useField, useTranslation, WarningTriangleIcon } from '@payloadcms/ui'
|
|
4
|
-
import React, { useState } from 'react'
|
|
5
|
-
|
|
6
|
-
import type { PluginMCPTranslationKeys, PluginMCPTranslations } from '../../translations/index.js'
|
|
7
|
-
|
|
8
|
-
import './index.css'
|
|
9
|
-
|
|
10
|
-
const baseClass = 'mcp-api-key-field'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Custom component for the MCP API-keys collection's `apiKey` field:
|
|
14
|
-
* - no key yet: a "Generate new key" button
|
|
15
|
-
* - key set: a dismissible privacy warning + the shared masked-key input
|
|
16
|
-
*/
|
|
17
|
-
export const APIKeyField: React.FC = () => {
|
|
18
|
-
const { setValue: setApiKey, value: apiKey } = useField<string>({ path: 'apiKey' })
|
|
19
|
-
const { t } = useTranslation<PluginMCPTranslations, PluginMCPTranslationKeys>()
|
|
20
|
-
const [isWarningDismissed, setIsWarningDismissed] = useState(false)
|
|
21
|
-
|
|
22
|
-
const generateKey = () => {
|
|
23
|
-
setApiKey(crypto.randomUUID())
|
|
24
|
-
setIsWarningDismissed(false)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div className={baseClass}>
|
|
29
|
-
<p className={`${baseClass}__description`}>{t('plugin-mcp:apiKeyDescription')}</p>
|
|
30
|
-
<div className={`${baseClass}__panel`}>
|
|
31
|
-
<div className={`${baseClass}__header`}>
|
|
32
|
-
<span className={`${baseClass}__title`}>{t('authentication:apiKey')}</span>
|
|
33
|
-
{!apiKey && (
|
|
34
|
-
<Button
|
|
35
|
-
buttonStyle="primary"
|
|
36
|
-
className={`${baseClass}__generate`}
|
|
37
|
-
onClick={generateKey}
|
|
38
|
-
>
|
|
39
|
-
{t('authentication:generateNewAPIKey')}
|
|
40
|
-
</Button>
|
|
41
|
-
)}
|
|
42
|
-
</div>
|
|
43
|
-
{Boolean(apiKey) && (
|
|
44
|
-
<div className={`${baseClass}__body`}>
|
|
45
|
-
{!isWarningDismissed && (
|
|
46
|
-
<div className={`${baseClass}__warning`}>
|
|
47
|
-
<WarningTriangleIcon className={`${baseClass}__warning-icon`} />
|
|
48
|
-
<p className={`${baseClass}__warning-text`}>
|
|
49
|
-
<strong>{t('plugin-mcp:keepKeyPrivate')}</strong>
|
|
50
|
-
{` ${t('plugin-mcp:keyPrivateDescription')}`}
|
|
51
|
-
</p>
|
|
52
|
-
<button
|
|
53
|
-
aria-label={t('plugin-mcp:dismiss')}
|
|
54
|
-
className={`${baseClass}__warning-dismiss`}
|
|
55
|
-
onClick={() => setIsWarningDismissed(true)}
|
|
56
|
-
type="button"
|
|
57
|
-
>
|
|
58
|
-
×
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
<APIKeyInput aria-label={t('authentication:apiKey')} value={apiKey} />
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
@layer payload-default {
|
|
2
|
-
/* Section wrapper: description + panel, closed off by a full-bleed divider
|
|
3
|
-
that spans the fields column past its horizontal gutter. */
|
|
4
|
-
.mcp-api-key-field {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: var(--base);
|
|
8
|
-
margin-inline: calc(-1 * var(--gutter-h));
|
|
9
|
-
padding-inline: var(--gutter-h);
|
|
10
|
-
padding-block-end: var(--spacer-4);
|
|
11
|
-
border-block-end: var(--stroke-width-small) solid var(--color-border);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.mcp-api-key-field__description {
|
|
15
|
-
margin: 0;
|
|
16
|
-
color: var(--color-text);
|
|
17
|
-
font-family: var(--text-body-medium-font-family);
|
|
18
|
-
font-size: var(--text-body-medium-font-size);
|
|
19
|
-
font-weight: var(--text-body-medium-font-weight);
|
|
20
|
-
line-height: var(--text-body-medium-line-height);
|
|
21
|
-
letter-spacing: var(--text-body-medium-letter-spacing);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.mcp-api-key-field__panel {
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
background: var(--color-bg);
|
|
27
|
-
border: var(--stroke-width-small) solid var(--color-border);
|
|
28
|
-
border-radius: var(--button-radius);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.mcp-api-key-field__header {
|
|
32
|
-
display: flex;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: space-between;
|
|
35
|
-
gap: var(--spacer-2);
|
|
36
|
-
min-height: var(--spacer-5);
|
|
37
|
-
padding: var(--spacer-2) var(--spacer-3);
|
|
38
|
-
background: var(--color-bg-secondary);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* Holds the warning + key row; its top border is the full-width divider
|
|
42
|
-
under the header. Only rendered once a key exists. */
|
|
43
|
-
.mcp-api-key-field__body {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
gap: var(--spacer-2);
|
|
47
|
-
padding: var(--spacer-3);
|
|
48
|
-
border-block-start: var(--stroke-width-small) solid var(--color-border);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.mcp-api-key-field__title {
|
|
52
|
-
color: var(--color-text);
|
|
53
|
-
font-family: var(--text-body-medium-strong-font-family);
|
|
54
|
-
font-size: var(--text-body-medium-strong-font-size);
|
|
55
|
-
font-weight: var(--text-body-medium-strong-font-weight);
|
|
56
|
-
line-height: var(--text-body-medium-strong-line-height);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.mcp-api-key-field__generate {
|
|
60
|
-
margin: 0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* Matches the core Banner's warning treatment: theme-adaptive warning-tertiary
|
|
64
|
-
bg with regular --color-text (NOT --color-text-onwarning, which is only
|
|
65
|
-
defined for light mode and reads as muddy dark-on-dark in dark mode). */
|
|
66
|
-
.mcp-api-key-field__warning {
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
gap: calc(var(--base) / 2);
|
|
70
|
-
padding: calc(var(--spacer-2) + (var(--spacer-1) / 2)) calc(var(--base) / 2);
|
|
71
|
-
background: var(--color-bg-warning-tertiary);
|
|
72
|
-
border: none;
|
|
73
|
-
border-radius: var(--radius-medium);
|
|
74
|
-
color: var(--color-text);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.mcp-api-key-field__warning-icon {
|
|
78
|
-
flex-shrink: 0;
|
|
79
|
-
width: 15px;
|
|
80
|
-
height: 13px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.mcp-api-key-field__warning-text {
|
|
84
|
-
flex-grow: 1;
|
|
85
|
-
margin: 0;
|
|
86
|
-
font-family: var(--text-body-medium-font-family);
|
|
87
|
-
font-size: var(--text-body-medium-font-size);
|
|
88
|
-
line-height: var(--text-body-medium-line-height);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.mcp-api-key-field__warning-text strong {
|
|
92
|
-
font-weight: var(--text-body-medium-strong-font-weight);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.mcp-api-key-field__warning-dismiss {
|
|
96
|
-
appearance: none;
|
|
97
|
-
background: none;
|
|
98
|
-
border: none;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
color: inherit;
|
|
101
|
-
font-size: 1rem;
|
|
102
|
-
line-height: 1;
|
|
103
|
-
padding: 0;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type { NoResultsClientProps } from 'payload'
|
|
4
|
-
|
|
5
|
-
import { Button, NoListResults, useTranslation } from '@payloadcms/ui'
|
|
6
|
-
import React from 'react'
|
|
7
|
-
|
|
8
|
-
import type { PluginMCPTranslationKeys, PluginMCPTranslations } from '../../translations/index.js'
|
|
9
|
-
|
|
10
|
-
export const APIKeysEmptyState: React.FC<NoResultsClientProps> = ({
|
|
11
|
-
hasCreatePermission,
|
|
12
|
-
newDocumentURL,
|
|
13
|
-
viewType,
|
|
14
|
-
}) => {
|
|
15
|
-
const { t } = useTranslation<PluginMCPTranslations, PluginMCPTranslationKeys>()
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<NoListResults
|
|
19
|
-
Actions={
|
|
20
|
-
hasCreatePermission && newDocumentURL && viewType !== 'trash'
|
|
21
|
-
? [
|
|
22
|
-
<Button el="link" key="create" to={newDocumentURL}>
|
|
23
|
-
{t('authentication:generateNewAPIKey')}
|
|
24
|
-
</Button>,
|
|
25
|
-
]
|
|
26
|
-
: []
|
|
27
|
-
}
|
|
28
|
-
description={t('plugin-mcp:apiKeyDescription')}
|
|
29
|
-
title={t('plugin-mcp:noAPIKeys')}
|
|
30
|
-
withMargin
|
|
31
|
-
/>
|
|
32
|
-
)
|
|
33
|
-
}
|