History

remove legacy compatibility codepaths

Rhys Sullivan committed 7 months ago

Commit ddd3aaa1 parent e2977a021 files · +111 −1158Browse files

Showing the changes to plugins/graphql (1 of 21 files). Show all

Unified · Split

plugins/graphql/sdk/index.ts+0−43
@@ -24,7 +24,6 @@ import { · 23 unmodified lines
2424 import {
2525 SecretMaterialResolverService,
2626 createPluginLocalConfigEntrySchema,
27− decodeCurrentOrLegacyLocalConfigAuth,
2827 pluginLocalConfigSourceFromConfig,
2928 provideExecutorRuntime,
3029 runtimeEffectError,
@@ -158,25 +157,6 @@ const decodeGraphqlCurrentLocalConfigOption = Schema.decodeUnknownOption( · 127 unmodified lines
158157 }),
159158 );
160159
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−
180160 const withoutUndefinedEntries = (
181161 record: Readonly<Record<string, unknown>>,
182162 ): Record<string, unknown> =>
@@ -363,29 +343,6 @@ const graphqlStoredSourceDataFromLocalConfig = (input: { · 180 unmodified lines
363343 return normalizeStoredSourceData(current.value.config);
364344 }
365345
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−
389346 throw new Error("Unsupported GraphQL local source config.");
390347 };
391348