From 447ba3d05179e16349be3ed375ea12fae74c2358 Mon Sep 17 00:00:00 2001 From: Krish Parekh Date: Mon, 28 Oct 2024 20:51:28 +0530 Subject: [PATCH] feat: Make payload optional (#41) --- packages/connections/package.json | 2 +- packages/connections/src/apis/link.api.ts | 4 ++-- packages/connections/src/client/index.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/connections/package.json b/packages/connections/package.json index 3404a34..2078230 100644 --- a/packages/connections/package.json +++ b/packages/connections/package.json @@ -1,6 +1,6 @@ { "name": "@integrationos/authkit-node", - "version": "1.2.0", + "version": "1.2.2", "description": "Secure token generation for IntegrationOS AuthKit", "main": "dist/index.js", "scripts": { diff --git a/packages/connections/src/apis/link.api.ts b/packages/connections/src/apis/link.api.ts index 42bd241..54ec76f 100644 --- a/packages/connections/src/apis/link.api.ts +++ b/packages/connections/src/apis/link.api.ts @@ -28,8 +28,8 @@ export const generateId = async (prefix: string) => { export const createEventLinkTokenApi = async ( headers: Record, url: string, - payload: CreateEventLinkPayload, - secret: string + secret: string, + payload?: CreateEventLinkPayload, ) => { try { const settings = await axios.post( diff --git a/packages/connections/src/client/index.ts b/packages/connections/src/client/index.ts index 140052a..47030b0 100644 --- a/packages/connections/src/client/index.ts +++ b/packages/connections/src/client/index.ts @@ -32,7 +32,7 @@ export class AuthKitToken { return 'https://api.integrationos.com/internal'; } - async create(payload: { + async create(payload?: { ttl?: number; /** * Unique identifier for the token. @@ -49,7 +49,7 @@ export class AuthKitToken { const url = this._url; const headers = getHeaders(secret); - const result = await createEventLinkTokenApi(headers, url, payload, secret); + const result = await createEventLinkTokenApi(headers, url, secret, payload); return result; } }