Skip to content

Commit 8c1de48

Browse files
committed
chore: remove dead integration-registry exports
PR-review cleanup: getDescriptor, descriptorsByKind, zCreateIntegration and ICreateIntegration in validation/src/integrations.ts had zero callers (the client derives the catalog from INTEGRATION_DESCRIPTORS directly, isKind uses the type map directly, and the tRPC create procedure inlines its own config-required input). The type-safety guards and isKind are unaffected. Claude-Session: https://claude.ai/code/session_01AWucrxmRqWqgWBvr8cC5cj
1 parent e3ccf88 commit 8c1de48

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

packages/validation/src/integrations.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -253,22 +253,6 @@ const descriptorByType = new Map(
253253
INTEGRATION_DESCRIPTORS.map((d) => [d.type, d] as const),
254254
);
255255

256-
export function getDescriptor(type: IIntegrationType): IIntegrationDescriptor {
257-
const descriptor = descriptorByType.get(type);
258-
if (!descriptor) {
259-
throw new Error(`Unknown integration type: ${type}`);
260-
}
261-
return descriptor;
262-
}
263-
264-
export function descriptorsByKind(kind: IIntegrationKind) {
265-
// kinds is a readonly literal tuple per descriptor; widen for `.includes`
266-
// (the union of literal tuples otherwise narrows the arg type to never).
267-
return INTEGRATION_DESCRIPTORS.filter((d) =>
268-
(d.kinds as readonly IIntegrationKind[]).includes(kind),
269-
);
270-
}
271-
272256
export function isKind(
273257
config: Pick<IIntegrationConfig, 'type'> | { type?: string },
274258
kind: IIntegrationKind,
@@ -305,14 +289,6 @@ const zCreateIntegrationBase = z.object({
305289
projectId: z.string().min(1),
306290
});
307291

308-
// Generic create input used by the registry-driven tRPC procedure. oauth
309-
// integrations (slack) create with no config (filled by the callback), so
310-
// config is optional here and narrowed/validated per-plugin server-side.
311-
export const zCreateIntegration = zCreateIntegrationBase.extend({
312-
config: zIntegrationConfig.optional(),
313-
});
314-
export type ICreateIntegration = z.infer<typeof zCreateIntegration>;
315-
316292
export const zCreateSlackIntegration = zCreateIntegrationBase;
317293

318294
export const zCreateWebhookIntegration = zCreateIntegrationBase.extend({

0 commit comments

Comments
 (0)