diff --git a/src/plugins/plugin-registry-contributions.ts b/src/plugins/plugin-registry-contributions.ts index cc69d56da8dc..e5a28bb89132 100644 --- a/src/plugins/plugin-registry-contributions.ts +++ b/src/plugins/plugin-registry-contributions.ts @@ -70,18 +70,6 @@ export type ResolveProviderOwnersParams = PluginRegistryContributionOptions & { providerId: string; }; -export type ResolveChannelOwnersParams = PluginRegistryContributionOptions & { - channelId: string; -}; - -export type ResolveCliBackendOwnersParams = PluginRegistryContributionOptions & { - cliBackendId: string; -}; - -export type ResolveSetupProviderOwnersParams = PluginRegistryContributionOptions & { - setupProviderId: string; -}; - export type ResolveManifestContractPluginIdsParams = LoadPluginRegistryParams & { contract: PluginManifestContractListKey; origin?: PluginOrigin; @@ -412,44 +400,6 @@ export function resolveProviderOwners(params: ResolveProviderOwnersParams): read }); } -export function resolveChannelOwners(params: ResolveChannelOwnersParams): readonly string[] { - const channelId = normalizeContributionId(params.channelId); - if (!channelId) { - return []; - } - return resolvePluginContributionOwners({ - ...params, - contribution: "channels", - matches: channelId, - }); -} - -export function resolveCliBackendOwners(params: ResolveCliBackendOwnersParams): readonly string[] { - const cliBackendId = normalizeContributionId(params.cliBackendId); - if (!cliBackendId) { - return []; - } - return resolvePluginContributionOwners({ - ...params, - contribution: "cliBackends", - matches: cliBackendId, - }); -} - -export function resolveSetupProviderOwners( - params: ResolveSetupProviderOwnersParams, -): readonly string[] { - const setupProviderId = normalizeContributionId(params.setupProviderId); - if (!setupProviderId) { - return []; - } - return resolvePluginContributionOwners({ - ...params, - contribution: "setupProviders", - matches: setupProviderId, - }); -} - export function resolveManifestContractPluginIds( params: ResolveManifestContractPluginIdsParams, ): string[] { diff --git a/src/plugins/plugin-registry.test.ts b/src/plugins/plugin-registry.test.ts index 96169eac3366..bb698dcde800 100644 --- a/src/plugins/plugin-registry.test.ts +++ b/src/plugins/plugin-registry.test.ts @@ -30,14 +30,11 @@ import { loadPluginRegistrySnapshotWithMetadata, normalizePluginsConfigWithRegistry, refreshPluginRegistry, - resolveChannelOwners, - resolveCliBackendOwners, resolveManifestContractOwnerPluginId, resolveManifestContractPluginIds, resolveManifestContractPluginIdsByCompatibilityRuntimePath, resolvePluginContributionOwners, resolveProviderOwners, - resolveSetupProviderOwners, } from "./plugin-registry.js"; import { resolvePluginPath } from "./registry.js"; import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js"; @@ -261,8 +258,20 @@ describe("plugin registry facade", () => { matches: "demo-alias", }), ).toEqual(["demo"]); - expect(resolveChannelOwners({ index, channelId: "demo-chat" })).toEqual(["demo"]); - expect(resolveCliBackendOwners({ index, cliBackendId: "demo-cli" })).toEqual(["demo"]); + expect( + resolvePluginContributionOwners({ + index, + contribution: "channels", + matches: "demo-chat", + }), + ).toEqual(["demo"]); + expect( + resolvePluginContributionOwners({ + index, + contribution: "cliBackends", + matches: "demo-cli", + }), + ).toEqual(["demo"]); expect( resolvePluginContributionOwners({ index, @@ -270,7 +279,13 @@ describe("plugin registry facade", () => { matches: (contributionId) => contributionId === "demo-cli", }), ).toEqual(["demo"]); - expect(resolveSetupProviderOwners({ index, setupProviderId: "demo-setup" })).toEqual(["demo"]); + expect( + resolvePluginContributionOwners({ + index, + contribution: "setupProviders", + matches: "demo-setup", + }), + ).toEqual(["demo"]); expect(resolveManifestContractPluginIds({ index, contract: "webSearchProviders" })).toEqual([ "demo", ]); @@ -346,14 +361,27 @@ describe("plugin registry facade", () => { expect(listPluginContributionIds({ lookUpTable, contribution: "providers" })).toEqual(["demo"]); expect(resolveProviderOwners({ lookUpTable, providerId: "DEMO" })).toEqual(["demo"]); - expect(resolveChannelOwners({ lookUpTable, channelId: "demo-chat" })).toEqual(["demo"]); - expect(resolveCliBackendOwners({ lookUpTable, cliBackendId: "demo-cli" })).toEqual(["demo"]); - expect(resolveCliBackendOwners({ lookUpTable, cliBackendId: "demo-setup-cli" })).toEqual([ - "demo", - ]); - expect(resolveSetupProviderOwners({ lookUpTable, setupProviderId: "demo-setup" })).toEqual([ - "demo", - ]); + expect( + resolvePluginContributionOwners({ + lookUpTable, + contribution: "channels", + matches: "demo-chat", + }), + ).toEqual(["demo"]); + expect( + resolvePluginContributionOwners({ + lookUpTable, + contribution: "cliBackends", + matches: "demo-cli", + }), + ).toEqual(["demo"]); + expect( + resolvePluginContributionOwners({ + lookUpTable, + contribution: "setupProviders", + matches: "demo-setup", + }), + ).toEqual(["demo"]); expect( resolvePluginContributionOwners({ lookUpTable,