diff --git a/keyserver/src/responders/relationship-responders.js b/keyserver/src/responders/relationship-responders.js --- a/keyserver/src/responders/relationship-responders.js +++ b/keyserver/src/responders/relationship-responders.js @@ -6,18 +6,24 @@ type TraditionalRelationshipRequest, type RelationshipErrors, relationshipActionsList, + updateFarcasterRelationshipInputValidator, } from 'lib/types/relationship-types.js'; import { tShape } from 'lib/utils/validation-utils.js'; import type { Viewer } from '../session/viewer.js'; import { updateRelationships } from '../updaters/relationship-updaters.js'; -export const updateRelationshipInputValidator: TInterface<TraditionalRelationshipRequest> = +export const traditionalRelationshipRequestInputValidator: TInterface<TraditionalRelationshipRequest> = tShape<TraditionalRelationshipRequest>({ action: t.enums.of(relationshipActionsList, 'relationship action'), userIDs: t.list(t.String), }); +export const updateRelationshipInputValidator = t.union([ + traditionalRelationshipRequestInputValidator, + updateFarcasterRelationshipInputValidator, +]); + export const relationshipErrorsValidator: TInterface<RelationshipErrors> = tShape<RelationshipErrors>({ invalid_user: t.maybe(t.list(t.String)),