( auth: V1SourceAuth | undefined, slotToTemplateSlug: Record<string, string>, slotToVariable: Record<string, string>, )
| 976 | /** Fold a v1 `auth:{kind:oauth2, connectionSlot}` into the slot maps so the |
| 977 | * connection that binds that slot resolves to the conventional oauth method. */ |
| 978 | const withSourceAuthOauth = ( |
| 979 | auth: V1SourceAuth | undefined, |
| 980 | slotToTemplateSlug: Record<string, string>, |
| 981 | slotToVariable: Record<string, string>, |
| 982 | ): void => { |
| 983 | if (auth?.kind === "oauth2" && auth.connectionSlot) { |
| 984 | slotToTemplateSlug[auth.connectionSlot] = OAUTH_TEMPLATE_SLUG; |
| 985 | slotToVariable[auth.connectionSlot] = PRIMARY_INPUT_VARIABLE; |
| 986 | } |
| 987 | }; |
| 988 | |
| 989 | export const migrateMcpSourceConfig = (v1: V1McpSourceConfig): MigratedSourceConfig => { |
| 990 | const apikey = migrateOpenApiAuthTemplate({ headers: v1.headers, queryParams: v1.queryParams }); |
no outgoing calls
no test coverage detected