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
24import {24import {
25 SecretMaterialResolverService,25 SecretMaterialResolverService,
26 createPluginLocalConfigEntrySchema,26 createPluginLocalConfigEntrySchema,
27 decodeCurrentOrLegacyLocalConfigAuth,
28 pluginLocalConfigSourceFromConfig,27 pluginLocalConfigSourceFromConfig,
29 provideExecutorRuntime,28 provideExecutorRuntime,
30 runtimeEffectError,29 runtimeEffectError,
@@ -158,25 +157,6 @@ const decodeGraphqlCurrentLocalConfigOption = Schema.decodeUnknownOption( · 127 unmodified lines
158 }),157 }),
159);158);
160 159
161const 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
180const withoutUndefinedEntries = (160const withoutUndefinedEntries = (
181 record: Readonly<Record<string, unknown>>,161 record: Readonly<Record<string, unknown>>,
182): Record<string, unknown> =>162): Record<string, unknown> =>
@@ -363,29 +343,6 @@ const graphqlStoredSourceDataFromLocalConfig = (input: { · 180 unmodified lines
363 return normalizeStoredSourceData(current.value.config);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 throw new Error("Unsupported GraphQL local source config.");346 throw new Error("Unsupported GraphQL local source config.");
390};347};
391 348