MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / migrateMcpSourceConfig

Function migrateMcpSourceConfig

packages/core/sdk/src/migration-spec.ts:989–1008  ·  view source on GitHub ↗
(v1: V1McpSourceConfig)

Source from the content-addressed store, hash-verified

987};
988
989export const migrateMcpSourceConfig = (v1: V1McpSourceConfig): MigratedSourceConfig => {
990 const apikey = migrateOpenApiAuthTemplate({ headers: v1.headers, queryParams: v1.queryParams });
991 const slotToTemplateSlug = { ...apikey.slotToTemplateSlug };
992 const slotToVariable = { ...apikey.slotToVariable };
993 withSourceAuthOauth(v1.auth, slotToTemplateSlug, slotToVariable);
994 const config = {
995 ...(v1.endpoint !== undefined ? { endpoint: v1.endpoint } : {}),
996 ...(v1.transport !== undefined ? { transport: v1.transport } : {}),
997 ...(v1.remoteTransport !== undefined ? { remoteTransport: v1.remoteTransport } : {}),
998 ...(Object.keys(apikey.staticHeaders).length > 0 ? { headers: apikey.staticHeaders } : {}),
999 ...(Object.keys(apikey.staticQueryParams).length > 0
1000 ? { queryParams: apikey.staticQueryParams }
1001 : {}),
1002 auth: migrateSourceAuth(v1.auth),
1003 ...(apikey.authenticationTemplate.length > 0
1004 ? { authenticationTemplate: apikey.authenticationTemplate }
1005 : {}),
1006 };
1007 return { config, slotToTemplateSlug, slotToVariable, warnings: apikey.warnings };
1008};
1009
1010export const migrateGraphqlSourceConfig = (v1: V1GraphqlSourceConfig): MigratedSourceConfig => {
1011 const apikey = migrateOpenApiAuthTemplate({ headers: v1.headers, queryParams: v1.queryParams });

Callers 2

buildConfigFunction · 0.90

Calls 3

withSourceAuthOauthFunction · 0.85
migrateSourceAuthFunction · 0.85

Tested by

no test coverage detected