Page MenuHomePhorge

D14197.1768836080.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D14197.1768836080.diff

diff --git a/keyserver/src/scripts/get-community-ids.js b/keyserver/src/scripts/get-community-ids.js
--- a/keyserver/src/scripts/get-community-ids.js
+++ b/keyserver/src/scripts/get-community-ids.js
@@ -6,11 +6,11 @@
async function fetchCommCommunityIDsByFarcasterChannelIDs(
farcasterChannelIDs: $ReadOnlyArray<string>,
): Promise<{
- communityIDs: $ReadOnlyArray<string>,
+ communityMappings: $ReadOnlyArray<[string, string]>,
unresolvedFarcasterChannelIDs: $ReadOnlyArray<string>,
}> {
if (farcasterChannelIDs.length === 0) {
- return { communityIDs: [], unresolvedFarcasterChannelIDs: [] };
+ return { communityMappings: [], unresolvedFarcasterChannelIDs: [] };
}
const query = SQL`
@@ -24,21 +24,28 @@
const resolvedFarcasterChannelIDs = result.map(
row => row.farcaster_channel_id,
);
- const communityIDs = result.map(row => row.id.toString());
+ const communityMappings = result.map(row => [
+ row.farcaster_channel_id,
+ row.id.toString(),
+ ]);
const unresolvedFarcasterChannelIDs = farcasterChannelIDs.filter(
farcasterChannelID =>
!resolvedFarcasterChannelIDs.includes(farcasterChannelID),
);
- return { communityIDs, unresolvedFarcasterChannelIDs };
+ return { communityMappings, unresolvedFarcasterChannelIDs };
}
async function fetchCommunityIDsByFarcasterChannelIDsScript() {
- // Replace with actual community names
+ // Replace with actual Farcaster channel IDs
const farcasterChannelIDs: $ReadOnlyArray<string> = [];
- const { communityIDs, unresolvedFarcasterChannelIDs } =
+ const { communityMappings, unresolvedFarcasterChannelIDs } =
await fetchCommCommunityIDsByFarcasterChannelIDs(farcasterChannelIDs);
- console.log('Comm community IDs:', communityIDs);
+
+ console.log('Comm community ID mappings (FarcasterChannelID, CommunityID):');
+ communityMappings.forEach(([farcasterChannelID, communityID]) =>
+ console.log(`(${farcasterChannelID}, ${communityID})`),
+ );
if (unresolvedFarcasterChannelIDs.length > 0) {
console.log(

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 3:21 PM (17 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5956730
Default Alt Text
D14197.1768836080.diff (2 KB)

Event Timeline