Page MenuHomePhabricator

D11773.diff
No OneTemporary

D11773.diff

diff --git a/keyserver/src/endpoints.js b/keyserver/src/endpoints.js
--- a/keyserver/src/endpoints.js
+++ b/keyserver/src/endpoints.js
@@ -45,6 +45,11 @@
restoreEntryResponseValidator,
saveEntryRequestInputValidator,
} from './responders/entry-responders.js';
+import {
+ createOrUpdateFarcasterChannelTagResponder,
+ createOrUpdateFarcasterChannelTagInputValidator,
+ createOrUpdateFarcasterChannelTagResponseValidator,
+} from './responders/farcaster-channel-tag-responders.js';
import type { JSONResponder } from './responders/handlers.js';
import { createJSONResponder } from './responders/handlers.js';
import { getOlmSessionInitializationDataResponder } from './responders/keys-responders.js';
@@ -575,6 +580,12 @@
versionResponseValidator,
[],
),
+ create_or_update_farcaster_channel_tag: createJSONResponder(
+ createOrUpdateFarcasterChannelTagResponder,
+ createOrUpdateFarcasterChannelTagInputValidator,
+ createOrUpdateFarcasterChannelTagResponseValidator,
+ baseLegalPolicies,
+ ),
};
export { jsonEndpoints };
diff --git a/keyserver/src/responders/farcaster-channel-tag-responders.js b/keyserver/src/responders/farcaster-channel-tag-responders.js
new file mode 100644
--- /dev/null
+++ b/keyserver/src/responders/farcaster-channel-tag-responders.js
@@ -0,0 +1,33 @@
+// @flow
+
+import t, { type TInterface } from 'tcomb';
+
+import type {
+ CreateOrUpdateFarcasterChannelTagRequest,
+ CreateOrUpdateFarcasterChannelTagResponse,
+} from 'lib/types/community-types';
+import { tShape, tID } from 'lib/utils/validation-utils.js';
+
+import { createOrUpdateFarcasterChannelTag } from '../creators/farcaster-channel-tag-creator.js';
+import type { Viewer } from '../session/viewer';
+
+export const createOrUpdateFarcasterChannelTagInputValidator: TInterface<CreateOrUpdateFarcasterChannelTagRequest> =
+ tShape<CreateOrUpdateFarcasterChannelTagRequest>({
+ commCommunityID: tID,
+ farcasterChannelID: t.String,
+ });
+
+export const createOrUpdateFarcasterChannelTagResponseValidator: TInterface<CreateOrUpdateFarcasterChannelTagResponse> =
+ tShape<CreateOrUpdateFarcasterChannelTagResponse>({
+ commCommunityID: tID,
+ blobHolder: t.String,
+ });
+
+async function createOrUpdateFarcasterChannelTagResponder(
+ viewer: Viewer,
+ request: CreateOrUpdateFarcasterChannelTagRequest,
+): Promise<CreateOrUpdateFarcasterChannelTagResponse> {
+ return await createOrUpdateFarcasterChannelTag(viewer, request);
+}
+
+export { createOrUpdateFarcasterChannelTagResponder };
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -112,6 +112,8 @@
SEARCH_MESSAGES: 'search_messages',
GET_OLM_SESSION_INITIALIZATION_DATA: 'get_olm_session_initialization_data',
VERSION: 'version',
+ CREATE_OR_UPDATE_FARCASTER_CHANNEL_TAG:
+ 'create_or_update_farcaster_channel_tag',
});
type HTTPPreferredEndpoint = $Values<typeof httpPreferredEndpoints>;

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 8, 2:53 PM (3 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2818881
Default Alt Text
D11773.diff (2 KB)

Event Timeline