From 3b9f2c9155164f6ef452a8376b62d82f04306a36 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Fri, 26 Jul 2024 12:52:20 -0400 Subject: [PATCH] fix(sdk): [nan-1474] type sdk and remove return coercion (#2553) ## 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: --- packages/node-client/lib/index.ts | 2 +- packages/shared/lib/sdk/sync.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node-client/lib/index.ts b/packages/node-client/lib/index.ts index 448041da426..840d947b6c6 100644 --- a/packages/node-client/lib/index.ts +++ b/packages/node-client/lib/index.ts @@ -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 { + public async triggerAction(providerConfigKey: string, connectionId: string, actionName: string, input?: In): Promise { const url = `${this.serverUrl}/action/trigger`; const headers = { diff --git a/packages/shared/lib/sdk/sync.ts b/packages/shared/lib/sdk/sync.ts index e365dab46d7..70771f607a4 100644 --- a/packages/shared/lib/sdk/sync.ts +++ b/packages/shared/lib/sdk/sync.ts @@ -740,7 +740,7 @@ export class NangoAction { } public async triggerAction(providerConfigKey: string, connectionId: string, actionName: string, input?: In): Promise { - 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 {