From 08b908fdce4fa83dd331a82761f63eeb3fb5af76 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Sat, 14 Feb 2026 00:00:03 -0800 Subject: [PATCH] fix tests --- .../app/api/auth/oauth/token/route.test.ts | 38 +++++++++-------- apps/sim/app/api/auth/oauth/utils.test.ts | 42 +++++++++++-------- .../invitations/[invitationId]/route.test.ts | 40 ++++++++++++++---- apps/sim/blocks/blocks/agent.ts | 1 + apps/sim/blocks/blocks/airtable.ts | 6 +-- apps/sim/blocks/blocks/asana.ts | 5 ++- apps/sim/blocks/blocks/calcom.ts | 4 +- apps/sim/blocks/blocks/confluence.ts | 34 +++++++-------- apps/sim/blocks/blocks/dropbox.ts | 2 +- apps/sim/blocks/blocks/gmail.ts | 4 +- apps/sim/blocks/blocks/google_calendar.ts | 6 +-- apps/sim/blocks/blocks/google_docs.ts | 4 +- apps/sim/blocks/blocks/google_drive.ts | 4 +- apps/sim/blocks/blocks/google_forms.ts | 4 +- apps/sim/blocks/blocks/google_groups.ts | 12 +++--- apps/sim/blocks/blocks/google_sheets.ts | 20 ++++----- apps/sim/blocks/blocks/google_slides.ts | 6 +-- apps/sim/blocks/blocks/google_vault.ts | 4 +- apps/sim/blocks/blocks/hubspot.ts | 6 +-- apps/sim/blocks/blocks/jira.ts | 6 +-- .../blocks/blocks/jira_service_management.ts | 4 +- apps/sim/blocks/blocks/linear.ts | 4 +- apps/sim/blocks/blocks/linkedin.ts | 8 ++-- apps/sim/blocks/blocks/microsoft_excel.ts | 12 +++--- apps/sim/blocks/blocks/microsoft_planner.ts | 8 ++-- apps/sim/blocks/blocks/microsoft_teams.ts | 6 +-- apps/sim/blocks/blocks/notion.ts | 6 +-- apps/sim/blocks/blocks/onedrive.ts | 6 +-- apps/sim/blocks/blocks/outlook.ts | 6 +-- apps/sim/blocks/blocks/pipedrive.ts | 6 +-- apps/sim/blocks/blocks/reddit.ts | 28 ++++++------- apps/sim/blocks/blocks/salesforce.ts | 6 +-- apps/sim/blocks/blocks/sharepoint.ts | 6 +-- apps/sim/blocks/blocks/shopify.ts | 4 +- apps/sim/blocks/blocks/slack.ts | 2 +- apps/sim/blocks/blocks/spotify.ts | 2 +- apps/sim/blocks/blocks/trello.ts | 2 +- apps/sim/blocks/blocks/wealthbox.ts | 6 +-- apps/sim/blocks/blocks/webflow.ts | 6 +-- apps/sim/blocks/blocks/wordpress.ts | 3 +- apps/sim/blocks/blocks/x.ts | 6 +-- apps/sim/blocks/blocks/zoom.ts | 4 +- 42 files changed, 213 insertions(+), 176 deletions(-) diff --git a/apps/sim/app/api/auth/oauth/token/route.test.ts b/apps/sim/app/api/auth/oauth/token/route.test.ts index 325f4d6c2..7363578af 100644 --- a/apps/sim/app/api/auth/oauth/token/route.test.ts +++ b/apps/sim/app/api/auth/oauth/token/route.test.ts @@ -351,10 +351,11 @@ describe('OAuth Token API Routes', () => { */ describe('GET handler', () => { it('should return access token successfully', async () => { - mockCheckSessionOrInternalAuth.mockResolvedValueOnce({ - success: true, + mockAuthorizeCredentialUse.mockResolvedValueOnce({ + ok: true, authType: 'session', - userId: 'test-user-id', + requesterUserId: 'test-user-id', + credentialOwnerUserId: 'test-user-id', }) mockGetCredential.mockResolvedValueOnce({ id: 'credential-id', @@ -380,8 +381,8 @@ describe('OAuth Token API Routes', () => { expect(response.status).toBe(200) expect(data).toHaveProperty('accessToken', 'fresh-token') - expect(mockCheckSessionOrInternalAuth).toHaveBeenCalled() - expect(mockGetCredential).toHaveBeenCalledWith(mockRequestId, 'credential-id', 'test-user-id') + expect(mockAuthorizeCredentialUse).toHaveBeenCalled() + expect(mockGetCredential).toHaveBeenCalled() expect(mockRefreshTokenIfNeeded).toHaveBeenCalled() }) @@ -399,8 +400,8 @@ describe('OAuth Token API Routes', () => { }) it('should handle authentication failure', async () => { - mockCheckSessionOrInternalAuth.mockResolvedValueOnce({ - success: false, + mockAuthorizeCredentialUse.mockResolvedValueOnce({ + ok: false, error: 'Authentication required', }) @@ -413,15 +414,16 @@ describe('OAuth Token API Routes', () => { const response = await GET(req as any) const data = await response.json() - expect(response.status).toBe(401) + expect(response.status).toBe(403) expect(data).toHaveProperty('error') }) it('should handle credential not found', async () => { - mockCheckSessionOrInternalAuth.mockResolvedValueOnce({ - success: true, + mockAuthorizeCredentialUse.mockResolvedValueOnce({ + ok: true, authType: 'session', - userId: 'test-user-id', + requesterUserId: 'test-user-id', + credentialOwnerUserId: 'test-user-id', }) mockGetCredential.mockResolvedValueOnce(undefined) @@ -439,10 +441,11 @@ describe('OAuth Token API Routes', () => { }) it('should handle missing access token', async () => { - mockCheckSessionOrInternalAuth.mockResolvedValueOnce({ - success: true, + mockAuthorizeCredentialUse.mockResolvedValueOnce({ + ok: true, authType: 'session', - userId: 'test-user-id', + requesterUserId: 'test-user-id', + credentialOwnerUserId: 'test-user-id', }) mockGetCredential.mockResolvedValueOnce({ id: 'credential-id', @@ -465,10 +468,11 @@ describe('OAuth Token API Routes', () => { }) it('should handle token refresh failure', async () => { - mockCheckSessionOrInternalAuth.mockResolvedValueOnce({ - success: true, + mockAuthorizeCredentialUse.mockResolvedValueOnce({ + ok: true, authType: 'session', - userId: 'test-user-id', + requesterUserId: 'test-user-id', + credentialOwnerUserId: 'test-user-id', }) mockGetCredential.mockResolvedValueOnce({ id: 'credential-id', diff --git a/apps/sim/app/api/auth/oauth/utils.test.ts b/apps/sim/app/api/auth/oauth/utils.test.ts index a1ebe567c..7320a7bb9 100644 --- a/apps/sim/app/api/auth/oauth/utils.test.ts +++ b/apps/sim/app/api/auth/oauth/utils.test.ts @@ -62,22 +62,23 @@ describe('OAuth Utils', () => { describe('getCredential', () => { it('should return credential when found', async () => { - const mockCredential = { id: 'credential-id', userId: 'test-user-id' } - const { mockFrom, mockWhere, mockLimit } = mockSelectChain([mockCredential]) + const mockCredentialRow = { type: 'oauth', accountId: 'resolved-account-id' } + const mockAccountRow = { id: 'resolved-account-id', userId: 'test-user-id' } + + mockSelectChain([mockCredentialRow]) + mockSelectChain([mockAccountRow]) const credential = await getCredential('request-id', 'credential-id', 'test-user-id') - expect(mockDb.select).toHaveBeenCalled() - expect(mockFrom).toHaveBeenCalled() - expect(mockWhere).toHaveBeenCalled() - expect(mockLimit).toHaveBeenCalledWith(1) + expect(mockDb.select).toHaveBeenCalledTimes(2) - expect(credential).toMatchObject(mockCredential) - expect(credential).toMatchObject({ resolvedCredentialId: 'credential-id' }) + expect(credential).toMatchObject(mockAccountRow) + expect(credential).toMatchObject({ resolvedCredentialId: 'resolved-account-id' }) }) it('should return undefined when credential is not found', async () => { mockSelectChain([]) + mockSelectChain([]) const credential = await getCredential('request-id', 'nonexistent-id', 'test-user-id') @@ -159,15 +160,17 @@ describe('OAuth Utils', () => { describe('refreshAccessTokenIfNeeded', () => { it('should return valid access token without refresh if not expired', async () => { - const mockCredential = { - id: 'credential-id', + const mockCredentialRow = { type: 'oauth', accountId: 'account-id' } + const mockAccountRow = { + id: 'account-id', accessToken: 'valid-token', refreshToken: 'refresh-token', accessTokenExpiresAt: new Date(Date.now() + 3600 * 1000), providerId: 'google', userId: 'test-user-id', } - mockSelectChain([mockCredential]) + mockSelectChain([mockCredentialRow]) + mockSelectChain([mockAccountRow]) const token = await refreshAccessTokenIfNeeded('credential-id', 'test-user-id', 'request-id') @@ -176,15 +179,17 @@ describe('OAuth Utils', () => { }) it('should refresh token when expired', async () => { - const mockCredential = { - id: 'credential-id', + const mockCredentialRow = { type: 'oauth', accountId: 'account-id' } + const mockAccountRow = { + id: 'account-id', accessToken: 'expired-token', refreshToken: 'refresh-token', accessTokenExpiresAt: new Date(Date.now() - 3600 * 1000), providerId: 'google', userId: 'test-user-id', } - mockSelectChain([mockCredential]) + mockSelectChain([mockCredentialRow]) + mockSelectChain([mockAccountRow]) mockUpdateChain() mockRefreshOAuthToken.mockResolvedValueOnce({ @@ -202,6 +207,7 @@ describe('OAuth Utils', () => { it('should return null if credential not found', async () => { mockSelectChain([]) + mockSelectChain([]) const token = await refreshAccessTokenIfNeeded('nonexistent-id', 'test-user-id', 'request-id') @@ -209,15 +215,17 @@ describe('OAuth Utils', () => { }) it('should return null if refresh fails', async () => { - const mockCredential = { - id: 'credential-id', + const mockCredentialRow = { type: 'oauth', accountId: 'account-id' } + const mockAccountRow = { + id: 'account-id', accessToken: 'expired-token', refreshToken: 'refresh-token', accessTokenExpiresAt: new Date(Date.now() - 3600 * 1000), providerId: 'google', userId: 'test-user-id', } - mockSelectChain([mockCredential]) + mockSelectChain([mockCredentialRow]) + mockSelectChain([mockAccountRow]) mockRefreshOAuthToken.mockResolvedValueOnce(null) diff --git a/apps/sim/app/api/workspaces/invitations/[invitationId]/route.test.ts b/apps/sim/app/api/workspaces/invitations/[invitationId]/route.test.ts index 389de676c..c1238a6b0 100644 --- a/apps/sim/app/api/workspaces/invitations/[invitationId]/route.test.ts +++ b/apps/sim/app/api/workspaces/invitations/[invitationId]/route.test.ts @@ -8,15 +8,27 @@ const mockHasWorkspaceAdminAccess = vi.fn() let dbSelectResults: any[] = [] let dbSelectCallIndex = 0 -const mockDbSelect = vi.fn().mockImplementation(() => ({ - from: vi.fn().mockReturnThis(), - where: vi.fn().mockReturnThis(), - then: vi.fn().mockImplementation((callback: (rows: any[]) => any) => { - const result = dbSelectResults[dbSelectCallIndex] || [] - dbSelectCallIndex++ - return Promise.resolve(callback ? callback(result) : result) - }), -})) +const mockDbSelect = vi.fn().mockImplementation(() => { + const makeThen = () => + vi.fn().mockImplementation((callback: (rows: any[]) => any) => { + const result = dbSelectResults[dbSelectCallIndex] || [] + dbSelectCallIndex++ + return Promise.resolve(callback ? callback(result) : result) + }) + const makeLimit = () => + vi.fn().mockImplementation(() => { + const result = dbSelectResults[dbSelectCallIndex] || [] + dbSelectCallIndex++ + return Promise.resolve(result) + }) + + const chain: any = {} + chain.from = vi.fn().mockReturnValue(chain) + chain.where = vi.fn().mockReturnValue(chain) + chain.limit = makeLimit() + chain.then = makeThen() + return chain +}) const mockDbInsert = vi.fn().mockImplementation(() => ({ values: vi.fn().mockResolvedValue(undefined), @@ -53,6 +65,10 @@ vi.mock('@/lib/workspaces/permissions/utils', () => ({ mockHasWorkspaceAdminAccess(userId, workspaceId), })) +vi.mock('@/lib/credentials/environment', () => ({ + syncWorkspaceEnvCredentials: vi.fn().mockResolvedValue(undefined), +})) + vi.mock('@sim/logger', () => loggerMock) vi.mock('@/lib/core/utils/urls', () => ({ @@ -95,6 +111,10 @@ vi.mock('@sim/db/schema', () => ({ userId: 'userId', permissionType: 'permissionType', }, + workspaceEnvironment: { + workspaceId: 'workspaceId', + variables: 'variables', + }, })) vi.mock('drizzle-orm', () => ({ @@ -207,6 +227,7 @@ describe('Workspace Invitation [invitationId] API Route', () => { [mockWorkspace], [{ ...mockUser, email: 'invited@example.com' }], [], + [], ] const request = new NextRequest( @@ -460,6 +481,7 @@ describe('Workspace Invitation [invitationId] API Route', () => { [mockWorkspace], [{ ...mockUser, email: 'invited@example.com' }], [], + [], ] const request2 = new NextRequest( diff --git a/apps/sim/blocks/blocks/agent.ts b/apps/sim/blocks/blocks/agent.ts index 2054762c8..fc1c3d052 100644 --- a/apps/sim/blocks/blocks/agent.ts +++ b/apps/sim/blocks/blocks/agent.ts @@ -763,6 +763,7 @@ Example 3 (Array Input): apiKey: { type: 'string', description: 'Provider API key' }, azureEndpoint: { type: 'string', description: 'Azure endpoint URL' }, azureApiVersion: { type: 'string', description: 'Azure API version' }, + oauthCredential: { type: 'string', description: 'OAuth credential for Vertex AI' }, vertexProject: { type: 'string', description: 'Google Cloud project ID for Vertex AI' }, vertexLocation: { type: 'string', description: 'Google Cloud location for Vertex AI' }, bedrockAccessKeyId: { type: 'string', description: 'AWS Access Key ID for Bedrock' }, diff --git a/apps/sim/blocks/blocks/airtable.ts b/apps/sim/blocks/blocks/airtable.ts index 913416255..03a4a6f7b 100644 --- a/apps/sim/blocks/blocks/airtable.ts +++ b/apps/sim/blocks/blocks/airtable.ts @@ -230,7 +230,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, } }, params: (params) => { - const { credential, records, fields, ...rest } = params + const { oauthCredential, records, fields, ...rest } = params let parsedRecords: any | undefined let parsedFields: any | undefined @@ -248,7 +248,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, // Construct parameters based on operation const baseParams = { - credential, + credential: oauthCredential, ...rest, } @@ -266,7 +266,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Airtable access token' }, + oauthCredential: { type: 'string', description: 'Airtable access token' }, baseId: { type: 'string', description: 'Airtable base identifier' }, tableId: { type: 'string', description: 'Airtable table identifier' }, // Conditional inputs diff --git a/apps/sim/blocks/blocks/asana.ts b/apps/sim/blocks/blocks/asana.ts index de8f8794c..1276e8d57 100644 --- a/apps/sim/blocks/blocks/asana.ts +++ b/apps/sim/blocks/blocks/asana.ts @@ -225,7 +225,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n } }, params: (params) => { - const { credential, operation } = params + const { oauthCredential, operation } = params const projectsArray = params.projects ? params.projects @@ -235,7 +235,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n : undefined const baseParams = { - accessToken: credential?.accessToken, + accessToken: oauthCredential?.accessToken, } switch (operation) { @@ -294,6 +294,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, + oauthCredential: { type: 'string', description: 'Asana OAuth credential' }, workspace: { type: 'string', description: 'Workspace GID' }, taskGid: { type: 'string', description: 'Task GID' }, getTasks_workspace: { type: 'string', description: 'Workspace GID for getting tasks' }, diff --git a/apps/sim/blocks/blocks/calcom.ts b/apps/sim/blocks/blocks/calcom.ts index 2697ccd37..a294c40b6 100644 --- a/apps/sim/blocks/blocks/calcom.ts +++ b/apps/sim/blocks/blocks/calcom.ts @@ -566,7 +566,7 @@ Return ONLY valid JSON - no explanations.`, params: (params) => { const { operation, - credential, + oauthCredential, attendeeName, attendeeEmail, attendeeTimeZone, @@ -756,7 +756,7 @@ Return ONLY valid JSON - no explanations.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Cal.com OAuth credential' }, + oauthCredential: { type: 'string', description: 'Cal.com OAuth credential' }, eventTypeId: { type: 'number', description: 'Event type ID' }, start: { type: 'string', description: 'Start time (ISO 8601)' }, end: { type: 'string', description: 'End time (ISO 8601)' }, diff --git a/apps/sim/blocks/blocks/confluence.ts b/apps/sim/blocks/blocks/confluence.ts index efe874824..4ab5c690c 100644 --- a/apps/sim/blocks/blocks/confluence.ts +++ b/apps/sim/blocks/blocks/confluence.ts @@ -298,7 +298,7 @@ export const ConfluenceBlock: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, pageId, operation, attachmentFile, @@ -311,7 +311,7 @@ export const ConfluenceBlock: BlockConfig = { if (operation === 'upload_attachment') { return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, file: attachmentFile, @@ -322,7 +322,7 @@ export const ConfluenceBlock: BlockConfig = { } return { - credential, + credential: oauthCredential, pageId: effectivePageId || undefined, operation, ...rest, @@ -333,7 +333,7 @@ export const ConfluenceBlock: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, domain: { type: 'string', description: 'Confluence domain' }, - credential: { type: 'string', description: 'Confluence access token' }, + oauthCredential: { type: 'string', description: 'Confluence access token' }, pageId: { type: 'string', description: 'Page identifier (canonical param)' }, spaceId: { type: 'string', description: 'Space identifier' }, title: { type: 'string', description: 'Page title' }, @@ -965,7 +965,7 @@ export const ConfluenceV2Block: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, pageId, operation, attachmentFile, @@ -990,7 +990,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'add_label') { return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, prefix: labelPrefix || 'global', @@ -1000,7 +1000,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'create_blogpost') { return { - credential, + credential: oauthCredential, operation, status: blogPostStatus || 'current', ...rest, @@ -1009,7 +1009,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'delete') { return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, purge: purge || false, @@ -1019,7 +1019,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'list_comments') { return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, bodyFormat: bodyFormat || 'storage', @@ -1045,7 +1045,7 @@ export const ConfluenceV2Block: BlockConfig = { if (supportsCursor.includes(operation) && cursor) { return { - credential, + credential: oauthCredential, pageId: effectivePageId || undefined, operation, cursor, @@ -1058,7 +1058,7 @@ export const ConfluenceV2Block: BlockConfig = { throw new Error('Property key is required for this operation.') } return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, key: propertyKey, @@ -1069,7 +1069,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'delete_page_property') { return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, propertyId, @@ -1079,7 +1079,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'get_pages_by_label') { return { - credential, + credential: oauthCredential, operation, labelId, cursor: cursor || undefined, @@ -1089,7 +1089,7 @@ export const ConfluenceV2Block: BlockConfig = { if (operation === 'list_space_labels') { return { - credential, + credential: oauthCredential, operation, cursor: cursor || undefined, ...rest, @@ -1102,7 +1102,7 @@ export const ConfluenceV2Block: BlockConfig = { throw new Error('File is required for upload attachment operation.') } return { - credential, + credential: oauthCredential, pageId: effectivePageId, operation, file: normalizedFile, @@ -1113,7 +1113,7 @@ export const ConfluenceV2Block: BlockConfig = { } return { - credential, + credential: oauthCredential, pageId: effectivePageId || undefined, blogPostId: blogPostId || undefined, versionNumber: versionNumber ? Number.parseInt(String(versionNumber), 10) : undefined, @@ -1126,7 +1126,7 @@ export const ConfluenceV2Block: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, domain: { type: 'string', description: 'Confluence domain' }, - credential: { type: 'string', description: 'Confluence access token' }, + oauthCredential: { type: 'string', description: 'Confluence access token' }, pageId: { type: 'string', description: 'Page identifier (canonical param)' }, spaceId: { type: 'string', description: 'Space identifier' }, blogPostId: { type: 'string', description: 'Blog post identifier' }, diff --git a/apps/sim/blocks/blocks/dropbox.ts b/apps/sim/blocks/blocks/dropbox.ts index 5a6da8c1b..da64165c9 100644 --- a/apps/sim/blocks/blocks/dropbox.ts +++ b/apps/sim/blocks/blocks/dropbox.ts @@ -363,7 +363,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Dropbox OAuth credential' }, + oauthCredential: { type: 'string', description: 'Dropbox OAuth credential' }, // Common inputs path: { type: 'string', description: 'Path in Dropbox' }, autorename: { type: 'boolean', description: 'Auto-rename on conflict' }, diff --git a/apps/sim/blocks/blocks/gmail.ts b/apps/sim/blocks/blocks/gmail.ts index 53f10d46c..d0ab76a8e 100644 --- a/apps/sim/blocks/blocks/gmail.ts +++ b/apps/sim/blocks/blocks/gmail.ts @@ -478,7 +478,7 @@ Return ONLY the search query - no explanations, no extra text.`, return { ...rest, - credential: oauthCredential, + oauthCredential, ...(normalizedAttachments && { attachments: normalizedAttachments }), } }, @@ -486,7 +486,7 @@ Return ONLY the search query - no explanations, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Gmail access token' }, + oauthCredential: { type: 'string', description: 'Gmail access token' }, // Send operation inputs to: { type: 'string', description: 'Recipient email address' }, subject: { type: 'string', description: 'Email subject' }, diff --git a/apps/sim/blocks/blocks/google_calendar.ts b/apps/sim/blocks/blocks/google_calendar.ts index b06a796d9..abbce2f18 100644 --- a/apps/sim/blocks/blocks/google_calendar.ts +++ b/apps/sim/blocks/blocks/google_calendar.ts @@ -523,7 +523,7 @@ Return ONLY the natural language event text - no explanations.`, }, params: (params) => { const { - credential, + oauthCredential, operation, attendees, replaceExisting, @@ -587,7 +587,7 @@ Return ONLY the natural language event text - no explanations.`, } return { - credential: oauthCredential, + oauthCredential, ...processedParams, } }, @@ -595,7 +595,7 @@ Return ONLY the natural language event text - no explanations.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Calendar access token' }, + oauthCredential: { type: 'string', description: 'Google Calendar access token' }, calendarId: { type: 'string', description: 'Calendar identifier (canonical param)' }, // Create/Update operation inputs diff --git a/apps/sim/blocks/blocks/google_docs.ts b/apps/sim/blocks/blocks/google_docs.ts index d20332a53..83449a252 100644 --- a/apps/sim/blocks/blocks/google_docs.ts +++ b/apps/sim/blocks/blocks/google_docs.ts @@ -177,14 +177,14 @@ Return ONLY the document content - no explanations, no extra text.`, ...rest, documentId: effectiveDocumentId || undefined, folderId: effectiveFolderId || undefined, - credential: oauthCredential, + oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Docs access token' }, + oauthCredential: { type: 'string', description: 'Google Docs access token' }, documentId: { type: 'string', description: 'Document identifier (canonical param)' }, title: { type: 'string', description: 'Document title' }, folderId: { type: 'string', description: 'Parent folder identifier (canonical param)' }, diff --git a/apps/sim/blocks/blocks/google_drive.ts b/apps/sim/blocks/blocks/google_drive.ts index 64edf3747..182246bc3 100644 --- a/apps/sim/blocks/blocks/google_drive.ts +++ b/apps/sim/blocks/blocks/google_drive.ts @@ -884,7 +884,7 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr sendNotification === 'true' ? true : sendNotification === 'false' ? false : undefined return { - credential: oauthCredential, + oauthCredential, folderId: effectiveFolderId, fileId: effectiveFileId, destinationFolderId: effectiveDestinationFolderId, @@ -902,7 +902,7 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Drive access token' }, + oauthCredential: { type: 'string', description: 'Google Drive access token' }, // Folder canonical params (per-operation) uploadFolderId: { type: 'string', description: 'Parent folder for upload/create' }, createFolderParentId: { type: 'string', description: 'Parent folder for create folder' }, diff --git a/apps/sim/blocks/blocks/google_forms.ts b/apps/sim/blocks/blocks/google_forms.ts index 9eba01913..840dbe2eb 100644 --- a/apps/sim/blocks/blocks/google_forms.ts +++ b/apps/sim/blocks/blocks/google_forms.ts @@ -262,7 +262,7 @@ Example for "Add a required multiple choice question about favorite color": ...rest } = params - const baseParams = { ...rest, credential: oauthCredential } + const baseParams = { ...rest, oauthCredential } const effectiveFormId = formId ? String(formId).trim() : undefined switch (operation) { @@ -320,7 +320,7 @@ Example for "Add a required multiple choice question about favorite color": }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google OAuth credential' }, + oauthCredential: { type: 'string', description: 'Google OAuth credential' }, formId: { type: 'string', description: 'Google Form ID' }, responseId: { type: 'string', description: 'Specific response ID' }, pageSize: { type: 'string', description: 'Max responses to retrieve' }, diff --git a/apps/sim/blocks/blocks/google_groups.ts b/apps/sim/blocks/blocks/google_groups.ts index 5c3f6fa04..b72a48e56 100644 --- a/apps/sim/blocks/blocks/google_groups.ts +++ b/apps/sim/blocks/blocks/google_groups.ts @@ -327,7 +327,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, switch (operation) { case 'list_groups': return { - credential: oauthCredential, + oauthCredential, customer: rest.customer, domain: rest.domain, query: rest.query, @@ -401,29 +401,29 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, } case 'remove_alias': return { - credential: oauthCredential, + oauthCredential, groupKey: rest.groupKey, alias: rest.alias, } case 'get_settings': return { - credential: oauthCredential, + oauthCredential, groupEmail: rest.groupEmail, } case 'update_settings': return { - credential: oauthCredential, + oauthCredential, groupEmail: rest.groupEmail, } default: - return { credential: oauthCredential, ...rest } + return { oauthCredential, ...rest } } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Workspace OAuth credential' }, + oauthCredential: { type: 'string', description: 'Google Workspace OAuth credential' }, customer: { type: 'string', description: 'Customer ID for listing groups' }, domain: { type: 'string', description: 'Domain filter for listing groups' }, query: { type: 'string', description: 'Search query for filtering groups' }, diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index dedc77fa3..bde2bec45 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -271,14 +271,14 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ...rest, spreadsheetId: effectiveSpreadsheetId, values: parsedValues, - credential: oauthCredential, + oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Sheets access token' }, + oauthCredential: { type: 'string', description: 'Google Sheets access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier (canonical param)' }, range: { type: 'string', description: 'Cell range' }, values: { type: 'string', description: 'Cell values data' }, @@ -761,7 +761,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, return { title: (title as string)?.trim(), sheetTitles: sheetTitlesArray, - credential: oauthCredential, + oauthCredential, } } @@ -775,7 +775,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, if (operation === 'get_info') { return { spreadsheetId: effectiveSpreadsheetId, - credential: oauthCredential, + oauthCredential, } } @@ -785,7 +785,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, return { spreadsheetId: effectiveSpreadsheetId, ranges: parsedRanges, - credential: oauthCredential, + oauthCredential, } } @@ -796,7 +796,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ...rest, spreadsheetId: effectiveSpreadsheetId, data: parsedData, - credential: oauthCredential, + oauthCredential, } } @@ -806,7 +806,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, return { spreadsheetId: effectiveSpreadsheetId, ranges: parsedRanges, - credential: oauthCredential, + oauthCredential, } } @@ -816,7 +816,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sourceSpreadsheetId: effectiveSpreadsheetId, sheetId: Number.parseInt(sheetId as string, 10), destinationSpreadsheetId: (destinationSpreadsheetId as string)?.trim(), - credential: oauthCredential, + oauthCredential, } } @@ -835,14 +835,14 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: effectiveSheetName, cellRange: cellRange ? (cellRange as string).trim() : undefined, values: parsedValues, - credential: oauthCredential, + oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Sheets access token' }, + oauthCredential: { type: 'string', description: 'Google Sheets access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier (canonical param)' }, sheetName: { type: 'string', description: 'Name of the sheet/tab (canonical param)' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, diff --git a/apps/sim/blocks/blocks/google_slides.ts b/apps/sim/blocks/blocks/google_slides.ts index 9116017c7..b341d2cfb 100644 --- a/apps/sim/blocks/blocks/google_slides.ts +++ b/apps/sim/blocks/blocks/google_slides.ts @@ -673,7 +673,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, }, params: (params) => { const { - credential, + oauthCredential, presentationId, folderId, slideIndex, @@ -690,7 +690,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, const result: Record = { ...rest, presentationId: effectivePresentationId || undefined, - credential: oauthCredential, + oauthCredential, } // Handle operation-specific params @@ -810,7 +810,7 @@ Return ONLY the text content - no explanations, no markdown formatting markers, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Slides access token' }, + oauthCredential: { type: 'string', description: 'Google Slides access token' }, presentationId: { type: 'string', description: 'Presentation identifier (canonical param)' }, // Write operation slideIndex: { type: 'number', description: 'Slide index to write to' }, diff --git a/apps/sim/blocks/blocks/google_vault.ts b/apps/sim/blocks/blocks/google_vault.ts index c636bce55..4f5183133 100644 --- a/apps/sim/blocks/blocks/google_vault.ts +++ b/apps/sim/blocks/blocks/google_vault.ts @@ -452,7 +452,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, const { oauthCredential, holdStartTime, holdEndTime, holdTerms, ...rest } = params return { ...rest, - credential: oauthCredential, + oauthCredential, // Map hold-specific fields to their tool parameter names ...(holdStartTime && { startTime: holdStartTime }), ...(holdEndTime && { endTime: holdEndTime }), @@ -464,7 +464,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, inputs: { // Core inputs operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Google Vault OAuth credential' }, + oauthCredential: { type: 'string', description: 'Google Vault OAuth credential' }, matterId: { type: 'string', description: 'Matter ID' }, // Create export inputs diff --git a/apps/sim/blocks/blocks/hubspot.ts b/apps/sim/blocks/blocks/hubspot.ts index 15d8e3dd7..706a4b9bb 100644 --- a/apps/sim/blocks/blocks/hubspot.ts +++ b/apps/sim/blocks/blocks/hubspot.ts @@ -834,7 +834,7 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no }, params: (params) => { const { - credential, + oauthCredential, operation, propertiesToSet, properties, @@ -846,7 +846,7 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no } = params const cleanParams: Record = { - credential, + oauthCredential, } const createUpdateOps = [ @@ -901,7 +901,7 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'HubSpot access token' }, + oauthCredential: { type: 'string', description: 'HubSpot access token' }, contactId: { type: 'string', description: 'Contact ID or email' }, companyId: { type: 'string', description: 'Company ID or domain' }, idProperty: { type: 'string', description: 'Property name to use as unique identifier' }, diff --git a/apps/sim/blocks/blocks/jira.ts b/apps/sim/blocks/blocks/jira.ts index c67315b82..96eb7eebb 100644 --- a/apps/sim/blocks/blocks/jira.ts +++ b/apps/sim/blocks/blocks/jira.ts @@ -800,14 +800,14 @@ Return ONLY the comment text - no explanations.`, } }, params: (params) => { - const { credential, projectId, issueKey, ...rest } = params + const { oauthCredential, projectId, issueKey, ...rest } = params // Use canonical param IDs (raw subBlock IDs are deleted after serialization) const effectiveProjectId = projectId ? String(projectId).trim() : '' const effectiveIssueKey = issueKey ? String(issueKey).trim() : '' const baseParams = { - credential, + oauthCredential, domain: params.domain, } @@ -1060,7 +1060,7 @@ Return ONLY the comment text - no explanations.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, domain: { type: 'string', description: 'Jira domain' }, - credential: { type: 'string', description: 'Jira access token' }, + oauthCredential: { type: 'string', description: 'Jira access token' }, issueKey: { type: 'string', description: 'Issue key identifier (canonical param)' }, projectId: { type: 'string', description: 'Project identifier (canonical param)' }, // Update/Write operation inputs diff --git a/apps/sim/blocks/blocks/jira_service_management.ts b/apps/sim/blocks/blocks/jira_service_management.ts index 957676f93..7baec43a6 100644 --- a/apps/sim/blocks/blocks/jira_service_management.ts +++ b/apps/sim/blocks/blocks/jira_service_management.ts @@ -504,7 +504,7 @@ Return ONLY the comment text - no explanations.`, }, params: (params) => { const baseParams = { - credential: params.credential, + oauthCredential: params.oauthCredential, domain: params.domain, } @@ -751,7 +751,7 @@ Return ONLY the comment text - no explanations.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, domain: { type: 'string', description: 'Jira domain' }, - credential: { type: 'string', description: 'Jira Service Management access token' }, + oauthCredential: { type: 'string', description: 'Jira Service Management access token' }, serviceDeskId: { type: 'string', description: 'Service desk ID' }, requestTypeId: { type: 'string', description: 'Request type ID' }, issueIdOrKey: { type: 'string', description: 'Issue ID or key' }, diff --git a/apps/sim/blocks/blocks/linear.ts b/apps/sim/blocks/blocks/linear.ts index 8cece59da..2f50d70db 100644 --- a/apps/sim/blocks/blocks/linear.ts +++ b/apps/sim/blocks/blocks/linear.ts @@ -1515,7 +1515,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n // Base params that most operations need const baseParams: Record = { - credential: params.credential, + oauthCredential: params.oauthCredential, } // Operation-specific param mapping @@ -2334,7 +2334,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Linear access token' }, + oauthCredential: { type: 'string', description: 'Linear access token' }, teamId: { type: 'string', description: 'Linear team identifier (canonical param)' }, projectId: { type: 'string', description: 'Linear project identifier (canonical param)' }, issueId: { type: 'string', description: 'Issue identifier' }, diff --git a/apps/sim/blocks/blocks/linkedin.ts b/apps/sim/blocks/blocks/linkedin.ts index 281970a91..2440cd009 100644 --- a/apps/sim/blocks/blocks/linkedin.ts +++ b/apps/sim/blocks/blocks/linkedin.ts @@ -91,25 +91,25 @@ export const LinkedInBlock: BlockConfig = { }, params: (inputs) => { const operation = inputs.operation || 'share_post' - const { credential, ...rest } = inputs + const { oauthCredential, ...rest } = inputs if (operation === 'get_profile') { return { - accessToken: credential, + accessToken: oauthCredential, } } return { text: rest.text, visibility: rest.visibility || 'PUBLIC', - accessToken: credential, + accessToken: oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'LinkedIn access token' }, + oauthCredential: { type: 'string', description: 'LinkedIn access token' }, text: { type: 'string', description: 'Post text content' }, visibility: { type: 'string', description: 'Post visibility (PUBLIC or CONNECTIONS)' }, }, diff --git a/apps/sim/blocks/blocks/microsoft_excel.ts b/apps/sim/blocks/blocks/microsoft_excel.ts index 1acef517b..6d8a7c301 100644 --- a/apps/sim/blocks/blocks/microsoft_excel.ts +++ b/apps/sim/blocks/blocks/microsoft_excel.ts @@ -252,7 +252,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } }, params: (params) => { - const { credential, values, spreadsheetId, tableName, worksheetName, ...rest } = params + const { oauthCredential, values, spreadsheetId, tableName, worksheetName, ...rest } = params // Use canonical param ID (raw subBlock IDs are deleted after serialization) const effectiveSpreadsheetId = spreadsheetId ? String(spreadsheetId).trim() : '' @@ -280,7 +280,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ...rest, spreadsheetId: effectiveSpreadsheetId, values: parsedValues, - credential, + oauthCredential, } if (params.operation === 'table_add') { @@ -303,7 +303,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft Excel access token' }, + oauthCredential: { type: 'string', description: 'Microsoft Excel access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier (canonical param)' }, range: { type: 'string', description: 'Cell range' }, tableName: { type: 'string', description: 'Table name' }, @@ -519,7 +519,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, fallbackToolId: 'microsoft_excel_read_v2', }), params: (params) => { - const { credential, values, spreadsheetId, sheetName, cellRange, ...rest } = params + const { oauthCredential, values, spreadsheetId, sheetName, cellRange, ...rest } = params const parsedValues = values ? JSON.parse(values as string) : undefined @@ -541,14 +541,14 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, sheetName: effectiveSheetName, cellRange: cellRange ? (cellRange as string).trim() : undefined, values: parsedValues, - credential, + oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft Excel access token' }, + oauthCredential: { type: 'string', description: 'Microsoft Excel access token' }, spreadsheetId: { type: 'string', description: 'Spreadsheet identifier (canonical param)' }, sheetName: { type: 'string', description: 'Name of the sheet/tab (canonical param)' }, cellRange: { type: 'string', description: 'Cell range (e.g., A1:D10)' }, diff --git a/apps/sim/blocks/blocks/microsoft_planner.ts b/apps/sim/blocks/blocks/microsoft_planner.ts index 7d3867e57..48771c3b6 100644 --- a/apps/sim/blocks/blocks/microsoft_planner.ts +++ b/apps/sim/blocks/blocks/microsoft_planner.ts @@ -4,7 +4,7 @@ import { AuthMode } from '@/blocks/types' import type { MicrosoftPlannerResponse } from '@/tools/microsoft_planner/types' interface MicrosoftPlannerBlockParams { - credential: string + oauthCredential: string accessToken?: string planId?: string taskId?: string @@ -360,7 +360,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, params: (params) => { const { - credential, + oauthCredential, operation, groupId, planId, @@ -385,7 +385,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, const baseParams: MicrosoftPlannerBlockParams = { ...rest, - credential, + oauthCredential, } // Handle different task ID fields based on operation @@ -570,7 +570,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft account credential' }, + oauthCredential: { type: 'string', description: 'Microsoft account credential' }, groupId: { type: 'string', description: 'Microsoft 365 group ID' }, planId: { type: 'string', description: 'Plan ID' }, readTaskId: { type: 'string', description: 'Task ID for read operation' }, diff --git a/apps/sim/blocks/blocks/microsoft_teams.ts b/apps/sim/blocks/blocks/microsoft_teams.ts index da287ba63..5f6481f70 100644 --- a/apps/sim/blocks/blocks/microsoft_teams.ts +++ b/apps/sim/blocks/blocks/microsoft_teams.ts @@ -332,7 +332,7 @@ export const MicrosoftTeamsBlock: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, operation, teamId, // Canonical param from teamSelector (basic) or manualTeamId (advanced) chatId, // Canonical param from chatSelector (basic) or manualChatId (advanced) @@ -350,7 +350,7 @@ export const MicrosoftTeamsBlock: BlockConfig = { const baseParams: Record = { ...rest, - credential, + oauthCredential, } if ((operation === 'read_chat' || operation === 'read_channel') && includeAttachments) { @@ -430,7 +430,7 @@ export const MicrosoftTeamsBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft Teams access token' }, + oauthCredential: { type: 'string', description: 'Microsoft Teams access token' }, messageId: { type: 'string', description: 'Message identifier for update/delete/reply/reaction operations', diff --git a/apps/sim/blocks/blocks/notion.ts b/apps/sim/blocks/blocks/notion.ts index f0ac80786..92727444d 100644 --- a/apps/sim/blocks/blocks/notion.ts +++ b/apps/sim/blocks/blocks/notion.ts @@ -313,7 +313,7 @@ export const NotionBlock: BlockConfig = { } }, params: (params) => { - const { credential, operation, properties, filter, sorts, ...rest } = params + const { oauthCredential, operation, properties, filter, sorts, ...rest } = params // Parse properties from JSON string for create/add operations let parsedProperties @@ -362,7 +362,7 @@ export const NotionBlock: BlockConfig = { return { ...rest, - credential, + oauthCredential, ...(parsedProperties ? { properties: parsedProperties } : {}), ...(parsedFilter ? { filter: JSON.stringify(parsedFilter) } : {}), ...(parsedSorts ? { sorts: JSON.stringify(parsedSorts) } : {}), @@ -372,7 +372,7 @@ export const NotionBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Notion access token' }, + oauthCredential: { type: 'string', description: 'Notion access token' }, pageId: { type: 'string', description: 'Page identifier' }, content: { type: 'string', description: 'Page content' }, // Create page inputs diff --git a/apps/sim/blocks/blocks/onedrive.ts b/apps/sim/blocks/blocks/onedrive.ts index 6ddcc4e07..e2e145107 100644 --- a/apps/sim/blocks/blocks/onedrive.ts +++ b/apps/sim/blocks/blocks/onedrive.ts @@ -365,7 +365,7 @@ export const OneDriveBlock: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, // Folder canonical params (per-operation) uploadFolderId, createFolderParentId, @@ -415,7 +415,7 @@ export const OneDriveBlock: BlockConfig = { } return { - credential, + oauthCredential, ...rest, values: normalizedValues, file: normalizedFile, @@ -430,7 +430,7 @@ export const OneDriveBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft account credential' }, + oauthCredential: { type: 'string', description: 'Microsoft account credential' }, // Upload and Create operation inputs fileName: { type: 'string', description: 'File name' }, file: { type: 'json', description: 'File to upload (UserFile object)' }, diff --git a/apps/sim/blocks/blocks/outlook.ts b/apps/sim/blocks/blocks/outlook.ts index 5bc98bea2..8c1b5372b 100644 --- a/apps/sim/blocks/blocks/outlook.ts +++ b/apps/sim/blocks/blocks/outlook.ts @@ -337,7 +337,7 @@ export const OutlookBlock: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, folder, destinationId, copyDestinationId, @@ -396,14 +396,14 @@ export const OutlookBlock: BlockConfig = { return { ...rest, - credential, + oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Outlook access token' }, + oauthCredential: { type: 'string', description: 'Outlook access token' }, // Send operation inputs to: { type: 'string', description: 'Recipient email address' }, subject: { type: 'string', description: 'Email subject' }, diff --git a/apps/sim/blocks/blocks/pipedrive.ts b/apps/sim/blocks/blocks/pipedrive.ts index 68f4e940f..ecaf62dcc 100644 --- a/apps/sim/blocks/blocks/pipedrive.ts +++ b/apps/sim/blocks/blocks/pipedrive.ts @@ -757,10 +757,10 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n } }, params: (params) => { - const { credential, operation, ...rest } = params + const { oauthCredential, operation, ...rest } = params const cleanParams: Record = { - credential, + oauthCredential, } Object.entries(rest).forEach(([key, value]) => { @@ -775,7 +775,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Pipedrive access token' }, + oauthCredential: { type: 'string', description: 'Pipedrive access token' }, deal_id: { type: 'string', description: 'Deal ID' }, title: { type: 'string', description: 'Title' }, value: { type: 'string', description: 'Monetary value' }, diff --git a/apps/sim/blocks/blocks/reddit.ts b/apps/sim/blocks/blocks/reddit.ts index 0ef54f740..828d4e338 100644 --- a/apps/sim/blocks/blocks/reddit.ts +++ b/apps/sim/blocks/blocks/reddit.ts @@ -566,7 +566,7 @@ export const RedditBlock: BlockConfig = { }, params: (inputs) => { const operation = inputs.operation || 'get_posts' - const { credential, ...rest } = inputs + const { oauthCredential, ...rest } = inputs if (operation === 'get_comments') { return { @@ -574,7 +574,7 @@ export const RedditBlock: BlockConfig = { subreddit: rest.subreddit, sort: rest.commentSort, limit: rest.commentLimit ? Number.parseInt(rest.commentLimit) : undefined, - credential: credential, + oauthCredential: oauthCredential, } } @@ -583,7 +583,7 @@ export const RedditBlock: BlockConfig = { subreddit: rest.subreddit, time: rest.controversialTime, limit: rest.controversialLimit ? Number.parseInt(rest.controversialLimit) : undefined, - credential: credential, + oauthCredential: oauthCredential, } } @@ -594,7 +594,7 @@ export const RedditBlock: BlockConfig = { sort: rest.searchSort, time: rest.searchTime, limit: rest.searchLimit ? Number.parseInt(rest.searchLimit) : undefined, - credential: credential, + oauthCredential: oauthCredential, } } @@ -606,7 +606,7 @@ export const RedditBlock: BlockConfig = { url: rest.postType === 'link' ? rest.url : undefined, nsfw: rest.nsfw === 'true', spoiler: rest.spoiler === 'true', - credential: credential, + oauthCredential: oauthCredential, } } @@ -614,7 +614,7 @@ export const RedditBlock: BlockConfig = { return { id: rest.voteId, dir: Number.parseInt(rest.voteDirection), - credential: credential, + oauthCredential: oauthCredential, } } @@ -622,14 +622,14 @@ export const RedditBlock: BlockConfig = { return { id: rest.saveId, category: rest.saveCategory, - credential: credential, + oauthCredential: oauthCredential, } } if (operation === 'unsave') { return { id: rest.saveId, - credential: credential, + oauthCredential: oauthCredential, } } @@ -637,7 +637,7 @@ export const RedditBlock: BlockConfig = { return { parent_id: rest.replyParentId, text: rest.replyText, - credential: credential, + oauthCredential: oauthCredential, } } @@ -645,14 +645,14 @@ export const RedditBlock: BlockConfig = { return { thing_id: rest.editThingId, text: rest.editText, - credential: credential, + oauthCredential: oauthCredential, } } if (operation === 'delete') { return { id: rest.deleteId, - credential: credential, + oauthCredential: oauthCredential, } } @@ -660,7 +660,7 @@ export const RedditBlock: BlockConfig = { return { subreddit: rest.subscribeSubreddit, action: rest.subscribeAction, - credential: credential, + oauthCredential: oauthCredential, } } @@ -669,14 +669,14 @@ export const RedditBlock: BlockConfig = { sort: rest.sort, limit: rest.limit ? Number.parseInt(rest.limit) : undefined, time: rest.sort === 'top' ? rest.time : undefined, - credential: credential, + oauthCredential: oauthCredential, } }, }, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Reddit access token' }, + oauthCredential: { type: 'string', description: 'Reddit access token' }, subreddit: { type: 'string', description: 'Subreddit name' }, sort: { type: 'string', description: 'Sort order' }, time: { type: 'string', description: 'Time filter' }, diff --git a/apps/sim/blocks/blocks/salesforce.ts b/apps/sim/blocks/blocks/salesforce.ts index 77549ca84..bbfa8616e 100644 --- a/apps/sim/blocks/blocks/salesforce.ts +++ b/apps/sim/blocks/blocks/salesforce.ts @@ -625,8 +625,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n } }, params: (params) => { - const { credential, operation, ...rest } = params - const cleanParams: Record = { credential } + const { oauthCredential, operation, ...rest } = params + const cleanParams: Record = { oauthCredential } Object.entries(rest).forEach(([key, value]) => { if (value !== undefined && value !== null && value !== '') { cleanParams[key] = value @@ -638,7 +638,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Salesforce credential' }, + oauthCredential: { type: 'string', description: 'Salesforce credential' }, }, outputs: { success: { type: 'boolean', description: 'Operation success status' }, diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index f85f3fd40..9863dce34 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -413,7 +413,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, } }, params: (params) => { - const { credential, siteId, mimeType, ...rest } = params + const { oauthCredential, siteId, mimeType, ...rest } = params // siteId is the canonical param from siteSelector (basic) or manualSiteId (advanced) const effectiveSiteId = siteId ? String(siteId).trim() : '' @@ -471,7 +471,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, // Handle file upload files parameter using canonical param const normalizedFiles = normalizeFileInput(files) const baseParams: Record = { - credential, + oauthCredential, siteId: effectiveSiteId || undefined, pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined, mimeType: mimeType, @@ -497,7 +497,7 @@ Return ONLY the JSON object - no explanations, no markdown, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Microsoft account credential' }, + oauthCredential: { type: 'string', description: 'Microsoft account credential' }, pageName: { type: 'string', description: 'Page name' }, columnDefinitions: { type: 'string', diff --git a/apps/sim/blocks/blocks/shopify.ts b/apps/sim/blocks/blocks/shopify.ts index dbd3a0471..dc3f3cae6 100644 --- a/apps/sim/blocks/blocks/shopify.ts +++ b/apps/sim/blocks/blocks/shopify.ts @@ -538,7 +538,7 @@ export const ShopifyBlock: BlockConfig = { }, params: (params) => { const baseParams: Record = { - credential: params.credential, + oauthCredential: params.oauthCredential, shopDomain: params.shopDomain?.trim(), } @@ -785,7 +785,7 @@ export const ShopifyBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Shopify access token' }, + oauthCredential: { type: 'string', description: 'Shopify access token' }, shopDomain: { type: 'string', description: 'Shopify store domain' }, // Product inputs productId: { type: 'string', description: 'Product ID' }, diff --git a/apps/sim/blocks/blocks/slack.ts b/apps/sim/blocks/blocks/slack.ts index b7b91a792..9606191eb 100644 --- a/apps/sim/blocks/blocks/slack.ts +++ b/apps/sim/blocks/blocks/slack.ts @@ -717,7 +717,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, operation: { type: 'string', description: 'Operation to perform' }, authMethod: { type: 'string', description: 'Authentication method' }, destinationType: { type: 'string', description: 'Destination type (channel or dm)' }, - credential: { type: 'string', description: 'Slack access token' }, + oauthCredential: { type: 'string', description: 'Slack access token' }, botToken: { type: 'string', description: 'Bot token' }, channel: { type: 'string', description: 'Channel identifier (canonical param)' }, dmUserId: { type: 'string', description: 'User ID for DM recipient (canonical param)' }, diff --git a/apps/sim/blocks/blocks/spotify.ts b/apps/sim/blocks/blocks/spotify.ts index 8a80846e1..fb63d0fa1 100644 --- a/apps/sim/blocks/blocks/spotify.ts +++ b/apps/sim/blocks/blocks/spotify.ts @@ -807,7 +807,7 @@ export const SpotifyBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Spotify OAuth credential' }, + oauthCredential: { type: 'string', description: 'Spotify OAuth credential' }, // Search query: { type: 'string', description: 'Search query' }, type: { type: 'string', description: 'Search type' }, diff --git a/apps/sim/blocks/blocks/trello.ts b/apps/sim/blocks/blocks/trello.ts index 9cfd4d15b..777e060fe 100644 --- a/apps/sim/blocks/blocks/trello.ts +++ b/apps/sim/blocks/blocks/trello.ts @@ -405,7 +405,7 @@ Return ONLY the date/timestamp string - no explanations, no quotes, no extra tex }, inputs: { operation: { type: 'string', description: 'Trello operation to perform' }, - credential: { type: 'string', description: 'Trello OAuth credential' }, + oauthCredential: { type: 'string', description: 'Trello OAuth credential' }, boardId: { type: 'string', description: 'Board ID' }, listId: { type: 'string', description: 'List ID' }, cardId: { type: 'string', description: 'Card ID' }, diff --git a/apps/sim/blocks/blocks/wealthbox.ts b/apps/sim/blocks/blocks/wealthbox.ts index d4810e22d..29acc0f1b 100644 --- a/apps/sim/blocks/blocks/wealthbox.ts +++ b/apps/sim/blocks/blocks/wealthbox.ts @@ -180,14 +180,14 @@ Return ONLY the date/time string - no explanations, no quotes, no extra text.`, } }, params: (params) => { - const { credential, operation, contactId, taskId, ...rest } = params + const { oauthCredential, operation, contactId, taskId, ...rest } = params // contactId is the canonical param for both basic (file-selector) and advanced (manualContactId) modes const effectiveContactId = contactId ? String(contactId).trim() : '' const baseParams = { ...rest, - credential, + credential: oauthCredential, } if (operation === 'read_note' || operation === 'write_note') { @@ -231,7 +231,7 @@ Return ONLY the date/time string - no explanations, no quotes, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Wealthbox access token' }, + oauthCredential: { type: 'string', description: 'Wealthbox access token' }, noteId: { type: 'string', description: 'Note identifier' }, contactId: { type: 'string', description: 'Contact identifier' }, taskId: { type: 'string', description: 'Task identifier' }, diff --git a/apps/sim/blocks/blocks/webflow.ts b/apps/sim/blocks/blocks/webflow.ts index 734f62635..4cb3aa26c 100644 --- a/apps/sim/blocks/blocks/webflow.ts +++ b/apps/sim/blocks/blocks/webflow.ts @@ -167,7 +167,7 @@ export const WebflowBlock: BlockConfig = { }, params: (params) => { const { - credential, + oauthCredential, fieldData, siteId, // Canonical param from siteSelector (basic) or manualSiteId (advanced) collectionId, // Canonical param from collectionSelector (basic) or manualCollectionId (advanced) @@ -189,7 +189,7 @@ export const WebflowBlock: BlockConfig = { const effectiveItemId = itemId ? String(itemId).trim() : '' const baseParams = { - credential, + credential: oauthCredential, siteId: effectiveSiteId, collectionId: effectiveCollectionId, ...rest, @@ -214,7 +214,7 @@ export const WebflowBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Webflow OAuth access token' }, + oauthCredential: { type: 'string', description: 'Webflow OAuth access token' }, siteId: { type: 'string', description: 'Webflow site identifier' }, collectionId: { type: 'string', description: 'Webflow collection identifier' }, itemId: { type: 'string', description: 'Item identifier' }, diff --git a/apps/sim/blocks/blocks/wordpress.ts b/apps/sim/blocks/blocks/wordpress.ts index 1e53f6e4f..9ddfbbf40 100644 --- a/apps/sim/blocks/blocks/wordpress.ts +++ b/apps/sim/blocks/blocks/wordpress.ts @@ -678,7 +678,7 @@ export const WordPressBlock: BlockConfig = { params: (params) => { // OAuth authentication for WordPress.com const baseParams: Record = { - credential: params.credential, + credential: params.oauthCredential, siteId: params.siteId, } @@ -901,6 +901,7 @@ export const WordPressBlock: BlockConfig = { }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, + oauthCredential: { type: 'string', description: 'WordPress OAuth credential' }, siteId: { type: 'string', description: 'WordPress.com site ID or domain' }, // Post inputs postId: { type: 'number', description: 'Post ID' }, diff --git a/apps/sim/blocks/blocks/x.ts b/apps/sim/blocks/blocks/x.ts index 971f59af9..9b297a064 100644 --- a/apps/sim/blocks/blocks/x.ts +++ b/apps/sim/blocks/blocks/x.ts @@ -181,10 +181,10 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, } }, params: (params) => { - const { credential, ...rest } = params + const { oauthCredential, ...rest } = params const parsedParams: Record = { - credential: credential, + credential: oauthCredential, } Object.keys(rest).forEach((key) => { @@ -210,7 +210,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'X account credential' }, + oauthCredential: { type: 'string', description: 'X account credential' }, text: { type: 'string', description: 'Tweet text content' }, replyTo: { type: 'string', description: 'Reply to tweet ID' }, mediaIds: { type: 'string', description: 'Media identifiers' }, diff --git a/apps/sim/blocks/blocks/zoom.ts b/apps/sim/blocks/blocks/zoom.ts index d76c01916..88f7fd044 100644 --- a/apps/sim/blocks/blocks/zoom.ts +++ b/apps/sim/blocks/blocks/zoom.ts @@ -424,7 +424,7 @@ Return ONLY the date string - no explanations, no quotes, no extra text.`, }, params: (params) => { const baseParams: Record = { - credential: params.credential, + credential: params.oauthCredential, } switch (params.operation) { @@ -569,7 +569,7 @@ Return ONLY the date string - no explanations, no quotes, no extra text.`, }, inputs: { operation: { type: 'string', description: 'Operation to perform' }, - credential: { type: 'string', description: 'Zoom access token' }, + oauthCredential: { type: 'string', description: 'Zoom access token' }, userId: { type: 'string', description: 'User ID or email (use "me" for authenticated user)' }, meetingId: { type: 'string', description: 'Meeting ID' }, topic: { type: 'string', description: 'Meeting topic' },