Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33318545
D14197.1768836080.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D14197.1768836080.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14197: [keyserver][script] update script to return tuple of community ID and farcaster channel ID
Attached
Detach File
Event Timeline
Log In to Comment