Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299741
D13440.id44514.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13440.id44514.diff
View Options
diff --git a/keyserver/src/endpoints.js b/keyserver/src/endpoints.js
--- a/keyserver/src/endpoints.js
+++ b/keyserver/src/endpoints.js
@@ -85,6 +85,8 @@
import {
legacyUpdateRelationshipsResponder,
legacyUpdateRelationshipInputValidator,
+ updateRelationshipsResponder,
+ updateRelationshipInputValidator,
} from './responders/relationship-responders.js';
import {
reportCreationResponder,
@@ -434,6 +436,11 @@
inputValidator: legacyUpdateRelationshipInputValidator,
policies: baseLegalPolicies,
},
+ update_relationships2: {
+ responder: updateRelationshipsResponder,
+ inputValidator: updateRelationshipInputValidator,
+ policies: baseLegalPolicies,
+ },
update_role: {
responder: roleUpdateResponder,
inputValidator: roleChangeRequestInputValidator,
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
@@ -10,6 +10,8 @@
legacyFarcasterRelationshipRequestValidator,
relationshipActions,
type RelationshipRequestUserInfo,
+ type RelationshipRequest,
+ relationshipActionsList,
} from 'lib/types/relationship-types.js';
import { tShape, tUserID } from 'lib/utils/validation-utils.js';
@@ -59,4 +61,22 @@
return await updateRelationships(viewer, request);
}
-export { legacyUpdateRelationshipsResponder };
+export const updateRelationshipInputValidator: TInterface<RelationshipRequest> =
+ tShape<RelationshipRequest>({
+ action: t.enums.of(relationshipActionsList, 'relationship action'),
+ users: t.dict(
+ tUserID,
+ tShape<RelationshipRequestUserInfo>({
+ createRobotextInThinThread: t.Boolean,
+ }),
+ ),
+ });
+
+async function updateRelationshipsResponder(
+ viewer: Viewer,
+ request: RelationshipRequest,
+): Promise<RelationshipErrors> {
+ return await updateRelationships(viewer, request);
+}
+
+export { legacyUpdateRelationshipsResponder, updateRelationshipsResponder };
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -99,6 +99,7 @@
UPDATE_DEVICE_TOKEN: 'update_device_token',
UPDATE_ENTRY: 'update_entry',
LEGACY_UPDATE_RELATIONSHIPS: 'update_relationships',
+ UPDATE_RELATIONSHIPS: 'update_relationships2',
UPDATE_ROLE: 'update_role',
UPDATE_THREAD: 'update_thread',
UPDATE_USER_SUBSCRIPTION: 'update_user_subscription',
diff --git a/lib/types/validators/endpoint-validators.js b/lib/types/validators/endpoint-validators.js
--- a/lib/types/validators/endpoint-validators.js
+++ b/lib/types/validators/endpoint-validators.js
@@ -161,6 +161,7 @@
update_device_token: { validator: t.Nil },
update_entry: { validator: saveEntryResponseValidator },
update_relationships: { validator: relationshipErrorsValidator },
+ update_relationships2: { validator: relationshipErrorsValidator },
update_role: { validator: changeThreadSettingsResultValidator },
update_thread: { validator: changeThreadSettingsResultValidator },
update_user_subscription: { validator: subscriptionUpdateResponseValidator },
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:11 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535128
Default Alt Text
D13440.id44514.diff (3 KB)
Attached To
Mode
D13440: [keyserver][lib] Introduce update_relationships2 keyserver endpoint
Attached
Detach File
Event Timeline
Log In to Comment