Showing the changes to plugins/graphql (1 of 21 files). Show all
Unified · Split
| @@ -24,7 +24,6 @@ import { · 23 unmodified lines | ||
| 24 | 24 | import { |
| 25 | 25 | SecretMaterialResolverService, |
| 26 | 26 | createPluginLocalConfigEntrySchema, |
| 27 | − decodeCurrentOrLegacyLocalConfigAuth, | |
| 28 | 27 | pluginLocalConfigSourceFromConfig, |
| 29 | 28 | provideExecutorRuntime, |
| 30 | 29 | runtimeEffectError, |
| @@ -158,25 +157,6 @@ const decodeGraphqlCurrentLocalConfigOption = Schema.decodeUnknownOption( · 127 unmodified lines | ||
| 158 | 157 | }), |
| 159 | 158 | ); |
| 160 | 159 | |
| 161 | −const decodeGraphqlLegacyLocalConfigOption = Schema.decodeUnknownOption( | |
| 162 | − Schema.Struct({ | |
| 163 | − kind: Schema.Literal("graphql"), | |
| 164 | − name: Schema.optional(Schema.String), | |
| 165 | − namespace: Schema.optional(Schema.String), | |
| 166 | − enabled: Schema.optional(Schema.Boolean), | |
| 167 | − connection: Schema.Struct({ | |
| 168 | − endpoint: Schema.String, | |
| 169 | − auth: Schema.optional(Schema.Unknown), | |
| 170 | − }), | |
| 171 | − binding: Schema.Struct({ | |
| 172 | − defaultHeaders: Schema.optional( | |
| 173 | − Schema.NullOr(Schema.Record({ key: Schema.String, value: Schema.String })), | |
| 174 | − ), | |
| 175 | − }), | |
| 176 | − config: Schema.optional(Schema.Unknown), | |
| 177 | − }), | |
| 178 | −); | |
| 179 | − | |
| 180 | 160 | const withoutUndefinedEntries = ( |
| 181 | 161 | record: Readonly<Record<string, unknown>>, |
| 182 | 162 | ): Record<string, unknown> => |
| @@ -363,29 +343,6 @@ const graphqlStoredSourceDataFromLocalConfig = (input: { · 180 unmodified lines | ||
| 363 | 343 | return normalizeStoredSourceData(current.value.config); |
| 364 | 344 | } |
| 365 | 345 | |
| 366 | − const legacy = decodeGraphqlLegacyLocalConfigOption(input.config); | |
| 367 | − if (Option.isSome(legacy)) { | |
| 368 | − return storedSourceDataFromInput({ | |
| 369 | − name: legacy.value.name ?? "GraphQL", | |
| 370 | − endpoint: legacy.value.connection.endpoint, | |
| 371 | − defaultHeaders: legacy.value.binding.defaultHeaders ?? null, | |
| 372 | − auth: decodeCurrentOrLegacyLocalConfigAuth({ | |
| 373 | − auth: legacy.value.connection.auth, | |
| 374 | − authSchema: GraphqlConnectionAuthSchema, | |
| 375 | − loadedConfig: input.loadedConfig, | |
| 376 | − onLegacySecretRef: (tokenSecretRef) => ({ | |
| 377 | − kind: "bearer", | |
| 378 | − tokenSecretRef, | |
| 379 | − headerName: null, | |
| 380 | − prefix: null, | |
| 381 | − }), | |
| 382 | − fallback: { | |
| 383 | − kind: "none", | |
| 384 | − }, | |
| 385 | − }), | |
| 386 | − }); | |
| 387 | − } | |
| 388 | − | |
| 389 | 346 | throw new Error("Unsupported GraphQL local source config."); |
| 390 | 347 | }; |
| 391 | 348 | |