-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Twitter integration to the new framework #1744
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included some nitpicks and comments
services/libs/integrations/src/integrations/twitter/generateStreams.ts
Outdated
Show resolved
Hide resolved
services/libs/integrations/src/integrations/twitter/generateStreams.ts
Outdated
Show resolved
Hide resolved
await processPaginated<ReachSelection>( | ||
async (page) => { | ||
const result = await db.any( | ||
` | ||
SELECT | ||
m."memberId" as id, | ||
m.username as username | ||
FROM | ||
"memberIdentities" m | ||
WHERE | ||
m."tenantId"= (select "tenantId" from integrations where id = $(integrationId) ) | ||
and m.platform = $(platform) | ||
ORDER BY | ||
m."memberId" | ||
LIMIT $(perPage) | ||
OFFSET $(offset) | ||
`, | ||
{ | ||
integrationId: ctx.integration.id, | ||
platform: PlatformType.TWITTER, | ||
perPage, | ||
offset: (page - 1) * perPage, | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's keep the queries in repo layer - what do u think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but there is no repo layer in integrations folder - I can put this query just in a separate file inside integration if it makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we at least keep the query in a separate function with a name to what it does it'll be cleaner. Not a strong opinion tho
Changes proposed ✍️
What
🤖 Generated by Copilot at 39a2c88
This pull request adds support for the integration with Twitter as a new platform type. It modifies the integration data, run, and stream services and repos to handle the token and refresh token for the integrations. It also adds the platform settings and the integration library files for the Twitter platform, using the existing interface and types.
🤖 Generated by Copilot at 39a2c88
Why
How
🤖 Generated by Copilot at 39a2c88
TwitterPlatformSettings
interface (link, link, link, link)index.ts
file (link)Checklist ✅
Feature
,Improvement
, orBug
.