@payloadcms/plugin-mcp 4.0.0-internal.688c4d0 → 4.0.0-internal.697830c
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/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/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 -51
- package/dist/index.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts +4 -4
- package/dist/mcp/buildMcpServer.d.ts.map +1 -1
- package/dist/mcp/buildMcpServer.js +34 -10
- 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 +44 -6
- 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 +68 -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 +64 -0
- package/dist/mcp/builtin/collections/countVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/createTool.js +13 -21
- 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 +10 -2
- 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 +96 -0
- package/dist/mcp/builtin/collections/duplicateTool.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 +92 -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 +45 -25
- 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 +83 -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 +98 -0
- package/dist/mcp/builtin/collections/findVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts +1 -1
- package/dist/mcp/builtin/collections/formatCollectionError.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/formatCollectionError.js.map +1 -1
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +32 -2
- 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 +81 -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 +16 -24
- package/dist/mcp/builtin/collections/updateTool.js.map +1 -1
- package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -1
- package/dist/mcp/builtin/getConfigInfoTool.js +27 -8
- 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 +64 -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 +19 -22
- 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 +79 -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 +94 -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 +32 -2
- 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 +77 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.js.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.js +14 -21
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -1
- package/dist/mcp/builtin/validateEntityData.js +1 -1
- package/dist/mcp/builtin/validateEntityData.js.map +1 -1
- package/dist/mcp/builtinTools.d.ts +69 -12
- package/dist/mcp/builtinTools.d.ts.map +1 -1
- package/dist/mcp/builtinTools.js +66 -10
- 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 +69 -27
- 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 +82 -45
- package/dist/stdio.js.map +1 -1
- package/dist/types.d.ts +100 -92
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -4
- package/dist/types.js.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/schemaConversion/filterFieldsByAccess.d.ts +28 -0
- package/dist/utils/schemaConversion/filterFieldsByAccess.d.ts.map +1 -0
- package/dist/utils/schemaConversion/filterFieldsByAccess.js +71 -0
- package/dist/utils/schemaConversion/filterFieldsByAccess.js.map +1 -0
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +5 -3
- package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +1 -1
- package/dist/utils/schemaConversion/getEntityInputSchema.js +44 -12
- package/dist/utils/schemaConversion/getEntityInputSchema.js.map +1 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +5 -10
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +1 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +15 -95
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +1 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +15 -40
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +1 -1
- package/package.json +10 -16
- package/src/defaultAccess.ts +3 -0
- package/src/endpoint/access.ts +80 -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 -59
- package/src/mcp/buildMcpServer.ts +48 -21
- package/src/mcp/builtin/collections/authTools.ts +45 -9
- package/src/mcp/builtin/collections/countTool.ts +73 -0
- package/src/mcp/builtin/collections/countVersionsTool.ts +69 -0
- package/src/mcp/builtin/collections/createTool.ts +14 -15
- package/src/mcp/builtin/collections/deleteTool.ts +11 -2
- package/src/mcp/builtin/collections/duplicateTool.ts +134 -0
- package/src/mcp/builtin/collections/findDistinctTool.ts +119 -0
- package/src/mcp/builtin/collections/findTool.ts +58 -19
- package/src/mcp/builtin/collections/findVersionByIDTool.ts +109 -0
- package/src/mcp/builtin/collections/findVersionsTool.ts +154 -0
- package/src/mcp/builtin/collections/formatCollectionError.ts +1 -1
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +37 -2
- package/src/mcp/builtin/collections/restoreVersionTool.ts +107 -0
- package/src/mcp/builtin/collections/updateTool.ts +16 -17
- package/src/mcp/builtin/getConfigInfoTool.ts +27 -4
- package/src/mcp/builtin/globals/countVersionsTool.ts +68 -0
- package/src/mcp/builtin/globals/findTool.ts +27 -18
- package/src/mcp/builtin/globals/findVersionByIDTool.ts +103 -0
- package/src/mcp/builtin/globals/findVersionsTool.ts +147 -0
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +37 -2
- package/src/mcp/builtin/globals/restoreVersionTool.ts +99 -0
- package/src/mcp/builtin/globals/updateTool.ts +16 -16
- package/src/mcp/builtin/validateEntityData.ts +1 -1
- package/src/mcp/builtinTools.ts +72 -16
- package/src/mcp/sanitizeMCPConfig.ts +48 -30
- package/src/stdio.ts +77 -45
- package/src/types.ts +108 -95
- package/src/utils/getPluginConfig.ts +1 -1
- package/src/utils/schemaConversion/filterFieldsByAccess.ts +123 -0
- package/src/utils/schemaConversion/getEntityInputSchema.ts +45 -27
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +12 -19
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +17 -114
- package/dist/@types/assets.d.js +0 -2
- package/dist/@types/assets.d.js.map +0 -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 -29
- package/dist/components/SettingsMenu/index.client.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/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/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/src/@types/assets.d.ts +0 -3
- package/src/collection/getAccessField.ts +0 -84
- package/src/collection/index.ts +0 -105
- package/src/components/APIKeyField/index.client.tsx +0 -73
- package/src/components/APIKeyField/index.css +0 -105
- package/src/components/APIKeysEmptyState/index.client.tsx +0 -36
- package/src/components/AccessField/index.client.tsx +0 -299
- package/src/components/AccessField/index.css +0 -99
- package/src/components/SettingsMenu/index.client.tsx +0 -34
- package/src/translations/index.ts +0 -108
- package/src/translations/languages/ar.ts +0 -35
- package/src/translations/languages/az.ts +0 -35
- package/src/translations/languages/bg.ts +0 -35
- package/src/translations/languages/bnBd.ts +0 -35
- package/src/translations/languages/bnIn.ts +0 -35
- package/src/translations/languages/ca.ts +0 -35
- package/src/translations/languages/cs.ts +0 -35
- package/src/translations/languages/da.ts +0 -35
- package/src/translations/languages/de.ts +0 -35
- package/src/translations/languages/en.ts +0 -35
- package/src/translations/languages/es.ts +0 -35
- package/src/translations/languages/et.ts +0 -35
- package/src/translations/languages/fa.ts +0 -35
- package/src/translations/languages/fr.ts +0 -35
- package/src/translations/languages/he.ts +0 -35
- package/src/translations/languages/hr.ts +0 -35
- package/src/translations/languages/hu.ts +0 -35
- package/src/translations/languages/hy.ts +0 -35
- package/src/translations/languages/id.ts +0 -35
- package/src/translations/languages/is.ts +0 -35
- package/src/translations/languages/it.ts +0 -35
- package/src/translations/languages/ja.ts +0 -35
- package/src/translations/languages/ko.ts +0 -35
- package/src/translations/languages/lt.ts +0 -35
- package/src/translations/languages/lv.ts +0 -35
- package/src/translations/languages/my.ts +0 -35
- package/src/translations/languages/nb.ts +0 -35
- package/src/translations/languages/nl.ts +0 -35
- package/src/translations/languages/pl.ts +0 -35
- package/src/translations/languages/pt.ts +0 -35
- package/src/translations/languages/ro.ts +0 -35
- package/src/translations/languages/rs.ts +0 -35
- package/src/translations/languages/rsLatin.ts +0 -35
- package/src/translations/languages/ru.ts +0 -35
- package/src/translations/languages/sk.ts +0 -35
- package/src/translations/languages/sl.ts +0 -35
- package/src/translations/languages/sv.ts +0 -35
- package/src/translations/languages/ta.ts +0 -35
- package/src/translations/languages/th.ts +0 -35
- package/src/translations/languages/tr.ts +0 -35
- package/src/translations/languages/uk.ts +0 -35
- package/src/translations/languages/vi.ts +0 -35
- package/src/translations/languages/zh.ts +0 -35
- package/src/translations/languages/zhTw.ts +0 -35
- package/src/translations/types.ts +0 -34
- package/src/utils/localAPIDefaults.ts +0 -22
- package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +0 -27
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import type { JsonSchemaType } from '../../types.js'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - and shrinks the result so it's cheaper for the model to read,
|
|
10
|
-
*
|
|
11
|
-
* while keeping every node valid JSON Schema draft 2020-12. Each step below is tagged with why it runs -
|
|
12
|
-
* **Correctness** (valid input the API accepts), **Size** (equivalence-preserving shrink), or **LLM
|
|
13
|
-
* ergonomics** (easier for the model to read/fill) - and carries a before/after example on its definition.
|
|
4
|
+
* Refines Payload's `input`-variant JSON Schema into an MCP create/update tool's input schema. The
|
|
5
|
+
* variant already covers correctness (ID-only relationships, no managed/virtual/join fields); the
|
|
6
|
+
* passes here are MCP-specific - reshaping fields for the model and shrinking the result - and keep
|
|
7
|
+
* every node valid JSON Schema draft 2020-12. Each is tagged **Correctness**, **Size**, or **LLM
|
|
8
|
+
* ergonomics**, with a before/after example on its definition.
|
|
14
9
|
*/
|
|
15
10
|
export const sanitizeEntitySchema = (schema: JsonSchemaType): JsonSchemaType => {
|
|
16
11
|
// Work on a copy — the caller reuses the original schema elsewhere (e.g. when listing tools).
|
|
17
12
|
let result = structuredClone(schema)
|
|
18
13
|
|
|
19
|
-
//
|
|
20
|
-
result =
|
|
14
|
+
// LLM ergonomics — drop the redundant `'null'` from optional arrays/objects (`['array','null']` → `'array'`).
|
|
15
|
+
result = collapseOptionalContainerTypes(result)
|
|
21
16
|
|
|
22
17
|
// LLM ergonomics — rewrite point fields from a `[number, number]` tuple into a `{ longitude, latitude }` object.
|
|
23
18
|
result = pointFieldsToObjects(result)
|
|
24
19
|
|
|
25
|
-
// Correctness — a relationship value can be an ID or a populated doc; on input only the ID is valid, so keep that.
|
|
26
|
-
result = relationshipsToIds(result)
|
|
27
|
-
|
|
28
20
|
// Size — strip inert type-gen leftovers that only bloat the schema (`tsType`, block-collision notes).
|
|
29
21
|
result = removeTypeGenArtifacts(result)
|
|
30
22
|
|
|
@@ -58,26 +50,20 @@ const mapNodes = (node: unknown, visit: (node: JsonSchemaType) => JsonSchemaType
|
|
|
58
50
|
for (const [key, value] of Object.entries(node)) {
|
|
59
51
|
out[key] = mapNodes(value, visit)
|
|
60
52
|
}
|
|
61
|
-
return visit(out
|
|
53
|
+
return visit(out)
|
|
62
54
|
}
|
|
63
55
|
|
|
64
|
-
// Payload sets these on every document, so an MCP client never provides them when creating/updating.
|
|
65
|
-
const PAYLOAD_MANAGED_FIELDS = new Set(['_status', 'createdAt', 'id', 'updatedAt'])
|
|
66
|
-
|
|
67
56
|
/**
|
|
68
|
-
* **
|
|
69
|
-
*
|
|
70
|
-
*
|
|
57
|
+
* **LLM ergonomics.** Collapses optional array/object types (`['array', 'null']` → `'array'`) via
|
|
58
|
+
* {@link collapseNullableType}, recursing through `properties` and array items. The `required` list
|
|
59
|
+
* already conveys optionality, so the `'null'` is redundant noise for the model.
|
|
71
60
|
*
|
|
72
61
|
* @example
|
|
73
|
-
* { properties: {
|
|
74
|
-
* → { properties: { tags: { type: 'array', items: {} } }, required: [
|
|
62
|
+
* { properties: { tags: { type: ['array', 'null'], items: {} } }, required: [] }
|
|
63
|
+
* → { properties: { tags: { type: 'array', items: {} } }, required: [] }
|
|
75
64
|
*/
|
|
76
|
-
const
|
|
65
|
+
const collapseOptionalContainerTypes = (schema: JsonSchemaType): JsonSchemaType => {
|
|
77
66
|
if (schema.properties && typeof schema.properties === 'object') {
|
|
78
|
-
for (const field of PAYLOAD_MANAGED_FIELDS) {
|
|
79
|
-
delete schema.properties[field]
|
|
80
|
-
}
|
|
81
67
|
for (const key of Object.keys(schema.properties)) {
|
|
82
68
|
const prop = schema.properties[key] as JsonSchemaType
|
|
83
69
|
if (!prop || typeof prop !== 'object') {
|
|
@@ -86,21 +72,14 @@ const removeManagedFields = (schema: JsonSchemaType): JsonSchemaType => {
|
|
|
86
72
|
const isRequired = Array.isArray(schema.required) && schema.required.includes(key)
|
|
87
73
|
collapseNullableType(prop, isRequired)
|
|
88
74
|
if (prop.properties) {
|
|
89
|
-
|
|
75
|
+
collapseOptionalContainerTypes(prop)
|
|
90
76
|
}
|
|
91
77
|
if (prop.items && typeof prop.items === 'object' && !Array.isArray(prop.items)) {
|
|
92
|
-
|
|
78
|
+
collapseOptionalContainerTypes(prop.items)
|
|
93
79
|
}
|
|
94
80
|
}
|
|
95
81
|
}
|
|
96
82
|
|
|
97
|
-
if (Array.isArray(schema.required)) {
|
|
98
|
-
schema.required = schema.required.filter((name) => !PAYLOAD_MANAGED_FIELDS.has(name))
|
|
99
|
-
if (schema.required.length === 0) {
|
|
100
|
-
delete schema.required
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
83
|
return schema
|
|
105
84
|
}
|
|
106
85
|
|
|
@@ -193,82 +172,6 @@ const pointFieldsToObjects = (schema: JsonSchemaType): JsonSchemaType => {
|
|
|
193
172
|
return transformed
|
|
194
173
|
}
|
|
195
174
|
|
|
196
|
-
/**
|
|
197
|
-
* **Correctness.** Reduces relationship/upload fields to the IDs a client actually sends. Payload types the value as
|
|
198
|
-
* "an ID or the full related document" - but the populated-document form only appears in read responses;
|
|
199
|
-
* on create/update you always reference a relationship by its ID. So we drop that `$ref` option, leaving
|
|
200
|
-
* the bare ID. A single remaining target collapses inline (with a description naming the target
|
|
201
|
-
* collection); several targets become an `anyOf` of IDs.
|
|
202
|
-
*
|
|
203
|
-
* @example
|
|
204
|
-
* { oneOf: [{ type: 'string' }, { $ref: '#/$defs/posts' }] }
|
|
205
|
-
* → { type: 'string', description: 'The ID of the related "posts" document.' }
|
|
206
|
-
*/
|
|
207
|
-
const relationshipsToIds = (schema: JsonSchemaType): JsonSchemaType => {
|
|
208
|
-
if (!schema || typeof schema !== 'object') {
|
|
209
|
-
return schema
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const processed = { ...schema }
|
|
213
|
-
|
|
214
|
-
if (Array.isArray(processed.oneOf)) {
|
|
215
|
-
const isRelatedDocRef = (option: unknown): option is { $ref: string } =>
|
|
216
|
-
!!option && typeof option === 'object' && '$ref' in option
|
|
217
|
-
|
|
218
|
-
if (processed.oneOf.some(isRelatedDocRef)) {
|
|
219
|
-
// A relationship value is "an ID, or the populated related document". Keep the ID option(s) and
|
|
220
|
-
// drop the `$ref`s to the related collections, since a client only ever sends the ID.
|
|
221
|
-
const idOptions = processed.oneOf
|
|
222
|
-
.filter((option) => !isRelatedDocRef(option))
|
|
223
|
-
.map((option) => (typeof option === 'object' ? relationshipsToIds(option) : option))
|
|
224
|
-
const targetCollections = processed.oneOf
|
|
225
|
-
.filter(isRelatedDocRef)
|
|
226
|
-
.map((option) => option.$ref.replace('#/$defs/', ''))
|
|
227
|
-
|
|
228
|
-
if (idOptions.length === 1) {
|
|
229
|
-
delete processed.oneOf
|
|
230
|
-
Object.assign(processed, idOptions[0])
|
|
231
|
-
if (targetCollections.length > 0 && !processed.description) {
|
|
232
|
-
processed.description = `The ID of the related "${targetCollections.join('" or "')}" document.`
|
|
233
|
-
}
|
|
234
|
-
} else if (idOptions.length > 1) {
|
|
235
|
-
delete processed.oneOf
|
|
236
|
-
processed.anyOf = idOptions
|
|
237
|
-
}
|
|
238
|
-
} else {
|
|
239
|
-
processed.oneOf = processed.oneOf.map((option) =>
|
|
240
|
-
typeof option === 'object' ? relationshipsToIds(option) : option,
|
|
241
|
-
)
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (processed.properties && typeof processed.properties === 'object') {
|
|
246
|
-
processed.properties = Object.fromEntries(
|
|
247
|
-
Object.entries(processed.properties).map(([key, value]) => [
|
|
248
|
-
key,
|
|
249
|
-
typeof value === 'object' ? relationshipsToIds(value) : value,
|
|
250
|
-
]),
|
|
251
|
-
)
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (processed.items && typeof processed.items === 'object' && !Array.isArray(processed.items)) {
|
|
255
|
-
processed.items = relationshipsToIds(processed.items)
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Lexical node unions and blocks live under `$defs` and have their own relationship fields, so walk
|
|
259
|
-
// those too — otherwise their `$ref`s would dangle once we don't bundle the related collections.
|
|
260
|
-
if (processed.$defs && typeof processed.$defs === 'object') {
|
|
261
|
-
processed.$defs = Object.fromEntries(
|
|
262
|
-
Object.entries(processed.$defs).map(([key, value]) => [
|
|
263
|
-
key,
|
|
264
|
-
typeof value === 'object' ? relationshipsToIds(value) : value,
|
|
265
|
-
]),
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return processed
|
|
270
|
-
}
|
|
271
|
-
|
|
272
175
|
/**
|
|
273
176
|
* **Size.** Strips type-generation leftovers that bloat the schema without helping the model: the `tsType`
|
|
274
177
|
* hint (a `json-schema-to-typescript` extension; JSON Schema validators just ignore it, they don't reject it)
|
|
@@ -448,7 +351,7 @@ const deduplicateIntoDefinitions = (schema: JsonSchemaType): JsonSchemaType => {
|
|
|
448
351
|
if (!name) {
|
|
449
352
|
name = `shared_${nameByKey.size}`
|
|
450
353
|
nameByKey.set(key, name)
|
|
451
|
-
sharedEntries[name] = node
|
|
354
|
+
sharedEntries[name] = node
|
|
452
355
|
}
|
|
453
356
|
return { $ref: `#/$defs/${name}` }
|
|
454
357
|
}
|
package/dist/@types/assets.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/@types/assets.d.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { JSONField } from 'payload';
|
|
2
|
-
import type { SanitizedMCPPluginConfig } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the API key collection's `access` field — a JSON field whose value
|
|
5
|
-
* is the `MCPAPIKeysDocAccessTree` the endpoint consults. The actual UI is
|
|
6
|
-
* a custom client component (`AccessField`) which renders a permissions
|
|
7
|
-
* matrix; the field's stored shape is just the runtime access tree.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getAccessField: ({ pluginConfig, }: {
|
|
10
|
-
pluginConfig: SanitizedMCPPluginConfig;
|
|
11
|
-
}) => JSONField;
|
|
12
|
-
//# sourceMappingURL=getAccessField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAccessField.d.ts","sourceRoot":"","sources":["../../src/collection/getAccessField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAkC,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAQ3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,mBAE5B;IACD,YAAY,EAAE,wBAAwB,CAAA;CACvC,KAAG,SAiBH,CAAA"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { COLLECTION_AUTH_BUILTINS, COLLECTION_BUILTINS, GLOBAL_BUILTINS } from '../mcp/builtinTools.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns the API key collection's `access` field — a JSON field whose value
|
|
4
|
-
* is the `MCPAPIKeysDocAccessTree` the endpoint consults. The actual UI is
|
|
5
|
-
* a custom client component (`AccessField`) which renders a permissions
|
|
6
|
-
* matrix; the field's stored shape is just the runtime access tree.
|
|
7
|
-
*/ export const getAccessField = ({ pluginConfig })=>{
|
|
8
|
-
const clientPluginConfig = sanitizeClientPluginConfig(pluginConfig);
|
|
9
|
-
return {
|
|
10
|
-
name: 'access',
|
|
11
|
-
type: 'json',
|
|
12
|
-
admin: {
|
|
13
|
-
components: {
|
|
14
|
-
Field: {
|
|
15
|
-
clientProps: {
|
|
16
|
-
pluginConfig: clientPluginConfig
|
|
17
|
-
},
|
|
18
|
-
path: '@payloadcms/plugin-mcp/client#AccessField'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
defaultValue: {},
|
|
23
|
-
label: false
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Strips the non-serializable parts of `SanitizedMCPPluginConfig` (handlers,
|
|
28
|
-
* input/argsSchema functions, etc.) so the result is safe to thread to a
|
|
29
|
-
* client component via `clientProps`.
|
|
30
|
-
*/ const sanitizeClientPluginConfig = (pluginConfig)=>({
|
|
31
|
-
items: pluginConfig.items.map((item)=>{
|
|
32
|
-
const group = itemGroup(item);
|
|
33
|
-
return {
|
|
34
|
-
...item.type === 'collectionTool' ? {
|
|
35
|
-
collectionSlug: item.collectionSlug
|
|
36
|
-
} : {},
|
|
37
|
-
...item.type === 'globalTool' ? {
|
|
38
|
-
globalSlug: item.globalSlug
|
|
39
|
-
} : {},
|
|
40
|
-
type: item.type,
|
|
41
|
-
configKey: item.configKey,
|
|
42
|
-
...group === 'operations' ? {} : {
|
|
43
|
-
description: itemDescription(item)
|
|
44
|
-
},
|
|
45
|
-
group,
|
|
46
|
-
label: item.label
|
|
47
|
-
};
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
const itemDescription = (item)=>{
|
|
51
|
-
if (item.type === 'prompt') {
|
|
52
|
-
return item.prompt.description;
|
|
53
|
-
}
|
|
54
|
-
if (item.type === 'resource') {
|
|
55
|
-
return item.resource.description;
|
|
56
|
-
}
|
|
57
|
-
return item.tool.description;
|
|
58
|
-
};
|
|
59
|
-
const itemGroup = (item)=>{
|
|
60
|
-
if (item.type === 'collectionTool') {
|
|
61
|
-
if (item.configKey in COLLECTION_BUILTINS) {
|
|
62
|
-
return 'operations';
|
|
63
|
-
}
|
|
64
|
-
return item.configKey in COLLECTION_AUTH_BUILTINS ? 'auth' : 'custom';
|
|
65
|
-
}
|
|
66
|
-
if (item.type === 'globalTool') {
|
|
67
|
-
return item.configKey in GLOBAL_BUILTINS ? 'operations' : 'custom';
|
|
68
|
-
}
|
|
69
|
-
return undefined;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=getAccessField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collection/getAccessField.ts"],"sourcesContent":["import type { JSONField } from 'payload'\n\nimport type { ClientMCPPluginConfig, MCPItem, SanitizedMCPPluginConfig } from '../types.js'\n\nimport {\n COLLECTION_AUTH_BUILTINS,\n COLLECTION_BUILTINS,\n GLOBAL_BUILTINS,\n} from '../mcp/builtinTools.js'\n\n/**\n * Returns the API key collection's `access` field — a JSON field whose value\n * is the `MCPAPIKeysDocAccessTree` the endpoint consults. The actual UI is\n * a custom client component (`AccessField`) which renders a permissions\n * matrix; the field's stored shape is just the runtime access tree.\n */\nexport const getAccessField = ({\n pluginConfig,\n}: {\n pluginConfig: SanitizedMCPPluginConfig\n}): JSONField => {\n const clientPluginConfig = sanitizeClientPluginConfig(pluginConfig)\n\n return {\n name: 'access',\n type: 'json',\n admin: {\n components: {\n Field: {\n clientProps: { pluginConfig: clientPluginConfig },\n path: '@payloadcms/plugin-mcp/client#AccessField',\n },\n },\n },\n defaultValue: {},\n label: false,\n }\n}\n\n/**\n * Strips the non-serializable parts of `SanitizedMCPPluginConfig` (handlers,\n * input/argsSchema functions, etc.) so the result is safe to thread to a\n * client component via `clientProps`.\n */\nconst sanitizeClientPluginConfig = (\n pluginConfig: SanitizedMCPPluginConfig,\n): ClientMCPPluginConfig => ({\n items: pluginConfig.items.map((item) => {\n const group = itemGroup(item)\n\n return {\n ...(item.type === 'collectionTool' ? { collectionSlug: item.collectionSlug } : {}),\n ...(item.type === 'globalTool' ? { globalSlug: item.globalSlug } : {}),\n type: item.type,\n configKey: item.configKey,\n ...(group === 'operations' ? {} : { description: itemDescription(item) }),\n group,\n label: item.label,\n }\n }),\n})\n\nconst itemDescription = (item: MCPItem): string => {\n if (item.type === 'prompt') {\n return item.prompt.description\n }\n if (item.type === 'resource') {\n return item.resource.description\n }\n return item.tool.description\n}\n\nconst itemGroup = (item: MCPItem): 'auth' | 'custom' | 'operations' | undefined => {\n if (item.type === 'collectionTool') {\n if (item.configKey in COLLECTION_BUILTINS) {\n return 'operations'\n }\n return item.configKey in COLLECTION_AUTH_BUILTINS ? 'auth' : 'custom'\n }\n if (item.type === 'globalTool') {\n return item.configKey in GLOBAL_BUILTINS ? 'operations' : 'custom'\n }\n return undefined\n}\n"],"names":["COLLECTION_AUTH_BUILTINS","COLLECTION_BUILTINS","GLOBAL_BUILTINS","getAccessField","pluginConfig","clientPluginConfig","sanitizeClientPluginConfig","name","type","admin","components","Field","clientProps","path","defaultValue","label","items","map","item","group","itemGroup","collectionSlug","globalSlug","configKey","description","itemDescription","prompt","resource","tool","undefined"],"mappings":"AAIA,SACEA,wBAAwB,EACxBC,mBAAmB,EACnBC,eAAe,QACV,yBAAwB;AAE/B;;;;;CAKC,GACD,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,YAAY,EAGb;IACC,MAAMC,qBAAqBC,2BAA2BF;IAEtD,OAAO;QACLG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,OAAO;oBACLC,aAAa;wBAAER,cAAcC;oBAAmB;oBAChDQ,MAAM;gBACR;YACF;QACF;QACAC,cAAc,CAAC;QACfC,OAAO;IACT;AACF,EAAC;AAED;;;;CAIC,GACD,MAAMT,6BAA6B,CACjCF,eAC2B,CAAA;QAC3BY,OAAOZ,aAAaY,KAAK,CAACC,GAAG,CAAC,CAACC;YAC7B,MAAMC,QAAQC,UAAUF;YAExB,OAAO;gBACL,GAAIA,KAAKV,IAAI,KAAK,mBAAmB;oBAAEa,gBAAgBH,KAAKG,cAAc;gBAAC,IAAI,CAAC,CAAC;gBACjF,GAAIH,KAAKV,IAAI,KAAK,eAAe;oBAAEc,YAAYJ,KAAKI,UAAU;gBAAC,IAAI,CAAC,CAAC;gBACrEd,MAAMU,KAAKV,IAAI;gBACfe,WAAWL,KAAKK,SAAS;gBACzB,GAAIJ,UAAU,eAAe,CAAC,IAAI;oBAAEK,aAAaC,gBAAgBP;gBAAM,CAAC;gBACxEC;gBACAJ,OAAOG,KAAKH,KAAK;YACnB;QACF;IACF,CAAA;AAEA,MAAMU,kBAAkB,CAACP;IACvB,IAAIA,KAAKV,IAAI,KAAK,UAAU;QAC1B,OAAOU,KAAKQ,MAAM,CAACF,WAAW;IAChC;IACA,IAAIN,KAAKV,IAAI,KAAK,YAAY;QAC5B,OAAOU,KAAKS,QAAQ,CAACH,WAAW;IAClC;IACA,OAAON,KAAKU,IAAI,CAACJ,WAAW;AAC9B;AAEA,MAAMJ,YAAY,CAACF;IACjB,IAAIA,KAAKV,IAAI,KAAK,kBAAkB;QAClC,IAAIU,KAAKK,SAAS,IAAItB,qBAAqB;YACzC,OAAO;QACT;QACA,OAAOiB,KAAKK,SAAS,IAAIvB,2BAA2B,SAAS;IAC/D;IACA,IAAIkB,KAAKV,IAAI,KAAK,cAAc;QAC9B,OAAOU,KAAKK,SAAS,IAAIrB,kBAAkB,eAAe;IAC5D;IACA,OAAO2B;AACT"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CollectionConfig } from 'payload';
|
|
2
|
-
import type { SanitizedMCPPluginConfig } from '../types.js';
|
|
3
|
-
export declare const getAPIKeysCollection: ({ pluginConfig, }: {
|
|
4
|
-
pluginConfig: SanitizedMCPPluginConfig;
|
|
5
|
-
}) => CollectionConfig;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAkB3D,eAAO,MAAM,oBAAoB,GAAI,mBAElC;IACD,YAAY,EAAE,wBAAwB,CAAA;CACvC,KAAG,gBA8EH,CAAA"}
|
package/dist/collection/index.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { createAPIKeyFields } from 'payload';
|
|
2
|
-
import { getAccessField } from './getAccessField.js';
|
|
3
|
-
const apiKeyStorageFields = createAPIKeyFields({
|
|
4
|
-
apiKeyField: {
|
|
5
|
-
admin: {
|
|
6
|
-
components: {
|
|
7
|
-
Field: '@payloadcms/plugin-mcp/client#APIKeyField'
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
apiKeyIndexField: {
|
|
13
|
-
index: true,
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
includeEnableAPIKey: false
|
|
17
|
-
});
|
|
18
|
-
export const getAPIKeysCollection = ({ pluginConfig })=>{
|
|
19
|
-
const collection = {
|
|
20
|
-
slug: 'payload-mcp-api-keys',
|
|
21
|
-
admin: {
|
|
22
|
-
components: {
|
|
23
|
-
views: {
|
|
24
|
-
list: {
|
|
25
|
-
NoResults: '@payloadcms/plugin-mcp/client#APIKeysEmptyState'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
defaultColumns: [
|
|
30
|
-
'label',
|
|
31
|
-
'lastUsed',
|
|
32
|
-
'user'
|
|
33
|
-
],
|
|
34
|
-
// Kept out of the main nav — reachable through the user menu's settings instead.
|
|
35
|
-
group: false,
|
|
36
|
-
useAsTitle: 'label'
|
|
37
|
-
},
|
|
38
|
-
fields: [
|
|
39
|
-
...apiKeyStorageFields,
|
|
40
|
-
getAccessField({
|
|
41
|
-
pluginConfig
|
|
42
|
-
}),
|
|
43
|
-
{
|
|
44
|
-
name: 'label',
|
|
45
|
-
type: 'text',
|
|
46
|
-
admin: {
|
|
47
|
-
description: ({ t })=>t('plugin-mcp:titleDescription'),
|
|
48
|
-
position: 'sidebar'
|
|
49
|
-
},
|
|
50
|
-
label: ({ t })=>t('plugin-mcp:title')
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: 'description',
|
|
54
|
-
type: 'text',
|
|
55
|
-
admin: {
|
|
56
|
-
description: ({ t })=>t('plugin-mcp:descriptionDescription'),
|
|
57
|
-
position: 'sidebar'
|
|
58
|
-
},
|
|
59
|
-
label: ({ t })=>t('plugin-mcp:description')
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'lastUsed',
|
|
63
|
-
type: 'date',
|
|
64
|
-
admin: {
|
|
65
|
-
date: {
|
|
66
|
-
pickerAppearance: 'dayAndTime'
|
|
67
|
-
},
|
|
68
|
-
disabled: {
|
|
69
|
-
field: true
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
label: ({ t })=>t('plugin-mcp:lastUsed')
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'user',
|
|
76
|
-
type: 'relationship',
|
|
77
|
-
admin: {
|
|
78
|
-
description: ({ t })=>t('plugin-mcp:userDescription'),
|
|
79
|
-
position: 'sidebar'
|
|
80
|
-
},
|
|
81
|
-
label: ({ t })=>t('general:user'),
|
|
82
|
-
relationTo: pluginConfig.userCollection,
|
|
83
|
-
required: true
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'overrideAccess',
|
|
87
|
-
type: 'checkbox',
|
|
88
|
-
admin: {
|
|
89
|
-
description: ({ t })=>t('plugin-mcp:overrideAccessDescription'),
|
|
90
|
-
position: 'sidebar'
|
|
91
|
-
},
|
|
92
|
-
defaultValue: false,
|
|
93
|
-
label: ({ t })=>t('plugin-mcp:overrideAccess')
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
labels: {
|
|
97
|
-
plural: ({ t })=>`${t('plugin-mcp:mcp')} ${t('plugin-mcp:apiKeys')}`,
|
|
98
|
-
singular: ({ t })=>`${t('plugin-mcp:mcp')} ${t('authentication:apiKey')}`
|
|
99
|
-
},
|
|
100
|
-
versions: false
|
|
101
|
-
};
|
|
102
|
-
return pluginConfig.overrideApiKeyCollection ? pluginConfig.overrideApiKeyCollection(collection) : collection;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collection/index.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { createAPIKeyFields } from 'payload'\n\nimport type { SanitizedMCPPluginConfig } from '../types.js'\n\nimport { getAccessField } from './getAccessField.js'\n\nconst apiKeyStorageFields = createAPIKeyFields({\n apiKeyField: {\n admin: {\n components: { Field: '@payloadcms/plugin-mcp/client#APIKeyField' },\n },\n required: true,\n },\n apiKeyIndexField: {\n index: true,\n required: true,\n },\n includeEnableAPIKey: false,\n})\n\nexport const getAPIKeysCollection = ({\n pluginConfig,\n}: {\n pluginConfig: SanitizedMCPPluginConfig\n}): CollectionConfig => {\n const collection: CollectionConfig = {\n slug: 'payload-mcp-api-keys',\n admin: {\n components: {\n views: {\n list: {\n NoResults: '@payloadcms/plugin-mcp/client#APIKeysEmptyState',\n },\n },\n },\n defaultColumns: ['label', 'lastUsed', 'user'],\n // Kept out of the main nav — reachable through the user menu's settings instead.\n group: false,\n useAsTitle: 'label',\n },\n fields: [\n ...apiKeyStorageFields,\n getAccessField({ pluginConfig }),\n {\n name: 'label',\n type: 'text',\n admin: {\n description: ({ t }) => t('plugin-mcp:titleDescription'),\n position: 'sidebar',\n },\n label: ({ t }) => t('plugin-mcp:title'),\n },\n {\n name: 'description',\n type: 'text',\n admin: {\n description: ({ t }) => t('plugin-mcp:descriptionDescription'),\n position: 'sidebar',\n },\n label: ({ t }) => t('plugin-mcp:description'),\n },\n {\n name: 'lastUsed',\n type: 'date',\n admin: {\n date: { pickerAppearance: 'dayAndTime' },\n disabled: { field: true },\n },\n label: ({ t }) => t('plugin-mcp:lastUsed'),\n },\n {\n name: 'user',\n type: 'relationship',\n admin: {\n description: ({ t }) => t('plugin-mcp:userDescription'),\n position: 'sidebar',\n },\n label: ({ t }) => t('general:user'),\n relationTo: pluginConfig.userCollection,\n required: true,\n },\n {\n name: 'overrideAccess',\n type: 'checkbox',\n admin: {\n description: ({ t }) => t('plugin-mcp:overrideAccessDescription'),\n position: 'sidebar',\n },\n defaultValue: false,\n label: ({ t }) => t('plugin-mcp:overrideAccess'),\n },\n ],\n labels: {\n plural: ({ t }) => `${t('plugin-mcp:mcp')} ${t('plugin-mcp:apiKeys')}`,\n singular: ({ t }) => `${t('plugin-mcp:mcp')} ${t('authentication:apiKey')}`,\n },\n versions: false,\n }\n\n return pluginConfig.overrideApiKeyCollection\n ? pluginConfig.overrideApiKeyCollection(collection)\n : collection\n}\n"],"names":["createAPIKeyFields","getAccessField","apiKeyStorageFields","apiKeyField","admin","components","Field","required","apiKeyIndexField","index","includeEnableAPIKey","getAPIKeysCollection","pluginConfig","collection","slug","views","list","NoResults","defaultColumns","group","useAsTitle","fields","name","type","description","t","position","label","date","pickerAppearance","disabled","field","relationTo","userCollection","defaultValue","labels","plural","singular","versions","overrideApiKeyCollection"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,UAAS;AAI5C,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,MAAMC,sBAAsBF,mBAAmB;IAC7CG,aAAa;QACXC,OAAO;YACLC,YAAY;gBAAEC,OAAO;YAA4C;QACnE;QACAC,UAAU;IACZ;IACAC,kBAAkB;QAChBC,OAAO;QACPF,UAAU;IACZ;IACAG,qBAAqB;AACvB;AAEA,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,YAAY,EAGb;IACC,MAAMC,aAA+B;QACnCC,MAAM;QACNV,OAAO;YACLC,YAAY;gBACVU,OAAO;oBACLC,MAAM;wBACJC,WAAW;oBACb;gBACF;YACF;YACAC,gBAAgB;gBAAC;gBAAS;gBAAY;aAAO;YAC7C,iFAAiF;YACjFC,OAAO;YACPC,YAAY;QACd;QACAC,QAAQ;eACHnB;YACHD,eAAe;gBAAEW;YAAa;YAC9B;gBACEU,MAAM;gBACNC,MAAM;gBACNnB,OAAO;oBACLoB,aAAa,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBAC1BC,UAAU;gBACZ;gBACAC,OAAO,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YACtB;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNnB,OAAO;oBACLoB,aAAa,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBAC1BC,UAAU;gBACZ;gBACAC,OAAO,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YACtB;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNnB,OAAO;oBACLwB,MAAM;wBAAEC,kBAAkB;oBAAa;oBACvCC,UAAU;wBAAEC,OAAO;oBAAK;gBAC1B;gBACAJ,OAAO,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YACtB;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNnB,OAAO;oBACLoB,aAAa,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBAC1BC,UAAU;gBACZ;gBACAC,OAAO,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;gBACpBO,YAAYpB,aAAaqB,cAAc;gBACvC1B,UAAU;YACZ;YACA;gBACEe,MAAM;gBACNC,MAAM;gBACNnB,OAAO;oBACLoB,aAAa,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;oBAC1BC,UAAU;gBACZ;gBACAQ,cAAc;gBACdP,OAAO,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YACtB;SACD;QACDU,QAAQ;YACNC,QAAQ,CAAC,EAAEX,CAAC,EAAE,GAAK,GAAGA,EAAE,kBAAkB,CAAC,EAAEA,EAAE,uBAAuB;YACtEY,UAAU,CAAC,EAAEZ,CAAC,EAAE,GAAK,GAAGA,EAAE,kBAAkB,CAAC,EAAEA,EAAE,0BAA0B;QAC7E;QACAa,UAAU;IACZ;IAEA,OAAO1B,aAAa2B,wBAAwB,GACxC3B,aAAa2B,wBAAwB,CAAC1B,cACtCA;AACN,EAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.css';
|
|
3
|
-
/**
|
|
4
|
-
* Custom component for the MCP API-keys collection's `apiKey` field:
|
|
5
|
-
* - no key yet: a "Generate new key" button
|
|
6
|
-
* - key set: a dismissible privacy warning + the shared masked-key input
|
|
7
|
-
*/
|
|
8
|
-
export declare const APIKeyField: React.FC;
|
|
9
|
-
//# sourceMappingURL=index.client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/components/APIKeyField/index.client.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAOvC,OAAO,aAAa,CAAA;AAIpB;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAqD/B,CAAA"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { APIKeyInput, Button, useField, useTranslation, WarningTriangleIcon } from '@payloadcms/ui';
|
|
4
|
-
import React, { useState } from 'react';
|
|
5
|
-
import './index.css';
|
|
6
|
-
const baseClass = 'mcp-api-key-field';
|
|
7
|
-
/**
|
|
8
|
-
* Custom component for the MCP API-keys collection's `apiKey` field:
|
|
9
|
-
* - no key yet: a "Generate new key" button
|
|
10
|
-
* - key set: a dismissible privacy warning + the shared masked-key input
|
|
11
|
-
*/ export const APIKeyField = ()=>{
|
|
12
|
-
const { setValue: setApiKey, value: apiKey } = useField({
|
|
13
|
-
path: 'apiKey'
|
|
14
|
-
});
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
const [isWarningDismissed, setIsWarningDismissed] = useState(false);
|
|
17
|
-
const generateKey = ()=>{
|
|
18
|
-
setApiKey(crypto.randomUUID());
|
|
19
|
-
setIsWarningDismissed(false);
|
|
20
|
-
};
|
|
21
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
22
|
-
className: baseClass,
|
|
23
|
-
children: [
|
|
24
|
-
/*#__PURE__*/ _jsx("p", {
|
|
25
|
-
className: `${baseClass}__description`,
|
|
26
|
-
children: t('plugin-mcp:apiKeyDescription')
|
|
27
|
-
}),
|
|
28
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
29
|
-
className: `${baseClass}__panel`,
|
|
30
|
-
children: [
|
|
31
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
32
|
-
className: `${baseClass}__header`,
|
|
33
|
-
children: [
|
|
34
|
-
/*#__PURE__*/ _jsx("span", {
|
|
35
|
-
className: `${baseClass}__title`,
|
|
36
|
-
children: t('authentication:apiKey')
|
|
37
|
-
}),
|
|
38
|
-
!apiKey && /*#__PURE__*/ _jsx(Button, {
|
|
39
|
-
buttonStyle: "primary",
|
|
40
|
-
className: `${baseClass}__generate`,
|
|
41
|
-
onClick: generateKey,
|
|
42
|
-
children: t('authentication:generateNewAPIKey')
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
}),
|
|
46
|
-
Boolean(apiKey) && /*#__PURE__*/ _jsxs("div", {
|
|
47
|
-
className: `${baseClass}__body`,
|
|
48
|
-
children: [
|
|
49
|
-
!isWarningDismissed && /*#__PURE__*/ _jsxs("div", {
|
|
50
|
-
className: `${baseClass}__warning`,
|
|
51
|
-
children: [
|
|
52
|
-
/*#__PURE__*/ _jsx(WarningTriangleIcon, {
|
|
53
|
-
className: `${baseClass}__warning-icon`
|
|
54
|
-
}),
|
|
55
|
-
/*#__PURE__*/ _jsxs("p", {
|
|
56
|
-
className: `${baseClass}__warning-text`,
|
|
57
|
-
children: [
|
|
58
|
-
/*#__PURE__*/ _jsx("strong", {
|
|
59
|
-
children: t('plugin-mcp:keepKeyPrivate')
|
|
60
|
-
}),
|
|
61
|
-
` ${t('plugin-mcp:keyPrivateDescription')}`
|
|
62
|
-
]
|
|
63
|
-
}),
|
|
64
|
-
/*#__PURE__*/ _jsx("button", {
|
|
65
|
-
"aria-label": t('plugin-mcp:dismiss'),
|
|
66
|
-
className: `${baseClass}__warning-dismiss`,
|
|
67
|
-
onClick: ()=>setIsWarningDismissed(true),
|
|
68
|
-
type: "button",
|
|
69
|
-
children: "×"
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
}),
|
|
73
|
-
/*#__PURE__*/ _jsx(APIKeyInput, {
|
|
74
|
-
"aria-label": t('authentication:apiKey'),
|
|
75
|
-
value: apiKey
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
})
|
|
81
|
-
]
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=index.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/APIKeyField/index.client.tsx"],"sourcesContent":["'use client'\n\nimport { APIKeyInput, Button, useField, useTranslation, WarningTriangleIcon } from '@payloadcms/ui'\nimport React, { useState } from 'react'\n\nimport type {\n PluginMCPTranslationKeys,\n PluginMCPTranslations,\n} from '../../translations/index.js'\n\nimport './index.css'\n\nconst baseClass = 'mcp-api-key-field'\n\n/**\n * Custom component for the MCP API-keys collection's `apiKey` field:\n * - no key yet: a \"Generate new key\" button\n * - key set: a dismissible privacy warning + the shared masked-key input\n */\nexport const APIKeyField: React.FC = () => {\n const { setValue: setApiKey, value: apiKey } = useField<string>({ path: 'apiKey' })\n const { t } = useTranslation<PluginMCPTranslations, PluginMCPTranslationKeys>()\n const [isWarningDismissed, setIsWarningDismissed] = useState(false)\n\n const generateKey = () => {\n setApiKey(crypto.randomUUID())\n setIsWarningDismissed(false)\n }\n\n return (\n <div className={baseClass}>\n <p className={`${baseClass}__description`}>\n {t('plugin-mcp:apiKeyDescription')}\n </p>\n <div className={`${baseClass}__panel`}>\n <div className={`${baseClass}__header`}>\n <span className={`${baseClass}__title`}>{t('authentication:apiKey')}</span>\n {!apiKey && (\n <Button\n buttonStyle=\"primary\"\n className={`${baseClass}__generate`}\n onClick={generateKey}\n >\n {t('authentication:generateNewAPIKey')}\n </Button>\n )}\n </div>\n {Boolean(apiKey) && (\n <div className={`${baseClass}__body`}>\n {!isWarningDismissed && (\n <div className={`${baseClass}__warning`}>\n <WarningTriangleIcon className={`${baseClass}__warning-icon`} />\n <p className={`${baseClass}__warning-text`}>\n <strong>{t('plugin-mcp:keepKeyPrivate')}</strong>\n {` ${t('plugin-mcp:keyPrivateDescription')}`}\n </p>\n <button\n aria-label={t('plugin-mcp:dismiss')}\n className={`${baseClass}__warning-dismiss`}\n onClick={() => setIsWarningDismissed(true)}\n type=\"button\"\n >\n ×\n </button>\n </div>\n )}\n <APIKeyInput aria-label={t('authentication:apiKey')} value={apiKey} />\n </div>\n )}\n </div>\n </div>\n )\n}\n"],"names":["APIKeyInput","Button","useField","useTranslation","WarningTriangleIcon","React","useState","baseClass","APIKeyField","setValue","setApiKey","value","apiKey","path","t","isWarningDismissed","setIsWarningDismissed","generateKey","crypto","randomUUID","div","className","p","span","buttonStyle","onClick","Boolean","strong","button","aria-label","type"],"mappings":"AAAA;;AAEA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,iBAAgB;AACnG,OAAOC,SAASC,QAAQ,QAAQ,QAAO;AAOvC,OAAO,cAAa;AAEpB,MAAMC,YAAY;AAElB;;;;CAIC,GACD,OAAO,MAAMC,cAAwB;IACnC,MAAM,EAAEC,UAAUC,SAAS,EAAEC,OAAOC,MAAM,EAAE,GAAGV,SAAiB;QAAEW,MAAM;IAAS;IACjF,MAAM,EAAEC,CAAC,EAAE,GAAGX;IACd,MAAM,CAACY,oBAAoBC,sBAAsB,GAAGV,SAAS;IAE7D,MAAMW,cAAc;QAClBP,UAAUQ,OAAOC,UAAU;QAC3BH,sBAAsB;IACxB;IAEA,qBACE,MAACI;QAAIC,WAAWd;;0BACd,KAACe;gBAAED,WAAW,GAAGd,UAAU,aAAa,CAAC;0BACtCO,EAAE;;0BAEL,MAACM;gBAAIC,WAAW,GAAGd,UAAU,OAAO,CAAC;;kCACnC,MAACa;wBAAIC,WAAW,GAAGd,UAAU,QAAQ,CAAC;;0CACpC,KAACgB;gCAAKF,WAAW,GAAGd,UAAU,OAAO,CAAC;0CAAGO,EAAE;;4BAC1C,CAACF,wBACA,KAACX;gCACCuB,aAAY;gCACZH,WAAW,GAAGd,UAAU,UAAU,CAAC;gCACnCkB,SAASR;0CAERH,EAAE;;;;oBAIRY,QAAQd,yBACP,MAACQ;wBAAIC,WAAW,GAAGd,UAAU,MAAM,CAAC;;4BACjC,CAACQ,oCACA,MAACK;gCAAIC,WAAW,GAAGd,UAAU,SAAS,CAAC;;kDACrC,KAACH;wCAAoBiB,WAAW,GAAGd,UAAU,cAAc,CAAC;;kDAC5D,MAACe;wCAAED,WAAW,GAAGd,UAAU,cAAc,CAAC;;0DACxC,KAACoB;0DAAQb,EAAE;;4CACV,CAAC,CAAC,EAAEA,EAAE,qCAAqC;;;kDAE9C,KAACc;wCACCC,cAAYf,EAAE;wCACdO,WAAW,GAAGd,UAAU,iBAAiB,CAAC;wCAC1CkB,SAAS,IAAMT,sBAAsB;wCACrCc,MAAK;kDACN;;;;0CAKL,KAAC9B;gCAAY6B,cAAYf,EAAE;gCAA0BH,OAAOC;;;;;;;;AAMxE,EAAC"}
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/components/APIKeysEmptyState/index.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuB5D,CAAA"}
|