(v1: V1McpSourceConfig)
| 987 | }; |
| 988 | |
| 989 | export 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 | |
| 1010 | export const migrateGraphqlSourceConfig = (v1: V1GraphqlSourceConfig): MigratedSourceConfig => { |
| 1011 | const apikey = migrateOpenApiAuthTemplate({ headers: v1.headers, queryParams: v1.queryParams }); |
no test coverage detected