Skip to content

Commit

Permalink
fix(sdk): [nan-1474] type sdk and remove return coercion (#2553)
Browse files Browse the repository at this point in the history
## Describe your changes
Follow up to make sure we type the node-client as well

## Issue ticket number and link
NAN-1474

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is:
  • Loading branch information
khaliqgant authored Jul 26, 2024
1 parent 9cf180a commit 3b9f2c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/node-client/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ export class Nango {
* @param input - An optional input data for the action
* @returns A promise that resolves with an object containing the response data from the triggered action
*/
public async triggerAction(providerConfigKey: string, connectionId: string, actionName: string, input?: unknown): Promise<object> {
public async triggerAction<In = unknown, Out = object>(providerConfigKey: string, connectionId: string, actionName: string, input?: In): Promise<Out> {
const url = `${this.serverUrl}/action/trigger`;

const headers = {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/sdk/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ export class NangoAction {
}

public async triggerAction<In = unknown, Out = object>(providerConfigKey: string, connectionId: string, actionName: string, input?: In): Promise<Out> {
return (await this.nango.triggerAction(providerConfigKey, connectionId, actionName, input)) as Out;
return await this.nango.triggerAction(providerConfigKey, connectionId, actionName, input);
}

public async triggerSync(providerConfigKey: string, connectionId: string, syncName: string, fullResync?: boolean): Promise<void | string> {
Expand Down

0 comments on commit 3b9f2c9

Please sign in to comment.