-
Notifications
You must be signed in to change notification settings - Fork 443
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
fix(sdk): expose getIntegration() #3080
fix(sdk): expose getIntegration() #3080
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.
Looks good!
>(); | ||
private memoizedIntegration: GetPublicIntegration['Success']['data'] | undefined; | ||
private memoizedConnections = new Map<string, { connection: Connection; timestamp: number }>(); | ||
private memoizedIntegration = new Map<string, { integration: GetPublicIntegration['Success']['data']; timestamp: number }>(); |
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.
Just curious here - what's the use case around needing to access any multiple integrations?
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.
It's not the case here, the key is the sum of query params which can change the shape so it's going to store different shape of the same integration depending on the params. Not ideal (cf PR desc)
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.
maybe this explaination should be in a comment. I am sure in 3 months I am gonna have forgotten why
/** | ||
* Get current integration | ||
*/ | ||
public async getIntegration(queries?: GetPublicIntegration['Querystring']): Promise<GetPublicIntegration['Success']['data']> { |
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.
This is just an aside: rather than sync providers.yaml it feels like we could just pull this data at runtime for each job and not have to load the whole providers file that way.
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.
yep agreed, there is a lot to improve regarding the task payload
@TBonnin Haven't had the chance to get a review, I'll go ahead and merge but feel free to add comments after |
## Changes - Automatically log http calls to API While doing #3080 I noticed we don't log calls to our own API which can lead to confusion when you expect something to happen but don't manually log the result. Thanks to recent change, we now have a way to plug into axios and just listen to requests. It will log everything (i.e: triggerAction, getConnection, getIntegration, etc.), except proxy which doesn't go through node-client. NB: This will for sure increase the log amount but just slightly since we do cache a lot. ![Screenshot 2024-11-28 at 16 11 02](https://github.com/user-attachments/assets/208e2ae2-fa4b-4c8e-97e7-1f924a38f5ce)
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.
Sorry. I reviewed it yesterday but forgot to submit it. :(
>(); | ||
private memoizedIntegration: GetPublicIntegration['Success']['data'] | undefined; | ||
private memoizedConnections = new Map<string, { connection: Connection; timestamp: number }>(); | ||
private memoizedIntegration = new Map<string, { integration: GetPublicIntegration['Success']['data']; timestamp: number }>(); |
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.
maybe this explaination should be in a comment. I am sure in 3 months I am gonna have forgotten why
Changes
getIntegration()
in the SDKThe shape of the response is determined by the include, which is maybe a bad idea I never know. On one hand it's pretty standard, on the other it makes caching and types hard :\