Compare commits

...

1 Commits

Author SHA1 Message Date
Vikhyath Mondreti
7e4997b278 feat(oauth): pass through option for token in advanced mode 2025-12-13 14:28:09 -08:00
36 changed files with 547 additions and 112 deletions

View File

@@ -41,6 +41,16 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
], ],
placeholder: 'Select Airtable account', placeholder: 'Select Airtable account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'baseId', id: 'baseId',
@@ -124,7 +134,8 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, records, fields, ...rest } = params const { credential, accessToken, records, fields, ...rest } = params
const authParam = credential ? { credential } : { accessToken }
let parsedRecords: any | undefined let parsedRecords: any | undefined
let parsedFields: any | undefined let parsedFields: any | undefined
@@ -142,7 +153,7 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
// Construct parameters based on operation // Construct parameters based on operation
const baseParams = { const baseParams = {
credential, ...authParam,
...rest, ...rest,
} }

View File

@@ -32,11 +32,20 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
id: 'credential', id: 'credential',
title: 'Asana Account', title: 'Asana Account',
type: 'oauth-input', type: 'oauth-input',
required: true, required: true,
serviceId: 'asana', serviceId: 'asana',
requiredScopes: ['default'], requiredScopes: ['default'],
placeholder: 'Select Asana account', placeholder: 'Select Asana account',
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'workspace', id: 'workspace',
@@ -202,7 +211,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation } = params const { credential, accessToken, operation } = params
const projectsArray = params.projects const projectsArray = params.projects
? params.projects ? params.projects
@@ -211,14 +220,12 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
.filter((p: string) => p.length > 0) .filter((p: string) => p.length > 0)
: undefined : undefined
const baseParams = { const authParam = credential ? { credential } : { accessToken }
accessToken: credential?.accessToken,
}
switch (operation) { switch (operation) {
case 'get_task': case 'get_task':
return { return {
...baseParams, ...authParam,
taskGid: params.taskGid, taskGid: params.taskGid,
workspace: params.getTasks_workspace, workspace: params.getTasks_workspace,
project: params.getTasks_project, project: params.getTasks_project,
@@ -226,7 +233,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
} }
case 'create_task': case 'create_task':
return { return {
...baseParams, ...authParam,
workspace: params.workspace, workspace: params.workspace,
name: params.name, name: params.name,
notes: params.notes, notes: params.notes,
@@ -235,7 +242,7 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
} }
case 'update_task': case 'update_task':
return { return {
...baseParams, ...authParam,
taskGid: params.taskGid, taskGid: params.taskGid,
name: params.name, name: params.name,
notes: params.notes, notes: params.notes,
@@ -245,12 +252,12 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
} }
case 'get_projects': case 'get_projects':
return { return {
...baseParams, ...authParam,
workspace: params.workspace, workspace: params.workspace,
} }
case 'search_tasks': case 'search_tasks':
return { return {
...baseParams, ...authParam,
workspace: params.workspace, workspace: params.workspace,
text: params.searchText, text: params.searchText,
assignee: params.assignee, assignee: params.assignee,
@@ -259,12 +266,12 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
} }
case 'add_comment': case 'add_comment':
return { return {
...baseParams, ...authParam,
taskGid: params.taskGid, taskGid: params.taskGid,
text: params.commentText, text: params.commentText,
} }
default: default:
return baseParams return authParam
} }
}, },
}, },

View File

@@ -76,6 +76,16 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
], ],
placeholder: 'Select Confluence account', placeholder: 'Select Confluence account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'pageId', id: 'pageId',
@@ -255,6 +265,7 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
pageId, pageId,
manualPageId, manualPageId,
operation, operation,
@@ -264,6 +275,7 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
...rest ...rest
} = params } = params
const authParam = credential ? { credential } : { accessToken }
const effectivePageId = (pageId || manualPageId || '').trim() const effectivePageId = (pageId || manualPageId || '').trim()
const requiresPageId = [ const requiresPageId = [
@@ -289,7 +301,7 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
if (operation === 'upload_attachment') { if (operation === 'upload_attachment') {
return { return {
credential, ...authParam,
pageId: effectivePageId, pageId: effectivePageId,
operation, operation,
file: attachmentFile, file: attachmentFile,
@@ -300,7 +312,7 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
} }
return { return {
credential, ...authParam,
pageId: effectivePageId || undefined, pageId: effectivePageId || undefined,
operation, operation,
...rest, ...rest,

View File

@@ -49,6 +49,16 @@ export const DropboxBlock: BlockConfig<DropboxResponse> = {
], ],
placeholder: 'Select Dropbox account', placeholder: 'Select Dropbox account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Upload operation inputs // Upload operation inputs
{ {

View File

@@ -38,7 +38,7 @@ export const GmailBlock: BlockConfig<GmailToolResponse> = {
], ],
value: () => 'send_gmail', value: () => 'send_gmail',
}, },
// Gmail Credentials // Gmail Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Gmail Account', title: 'Gmail Account',
@@ -51,6 +51,17 @@ export const GmailBlock: BlockConfig<GmailToolResponse> = {
], ],
placeholder: 'Select Gmail account', placeholder: 'Select Gmail account',
required: true, required: true,
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Send Email Fields // Send Email Fields
{ {
@@ -377,6 +388,7 @@ export const GmailBlock: BlockConfig<GmailToolResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
folder, folder,
manualFolder, manualFolder,
destinationLabel, destinationLabel,
@@ -437,7 +449,7 @@ export const GmailBlock: BlockConfig<GmailToolResponse> = {
return { return {
...rest, ...rest,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -28,6 +28,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
], ],
value: () => 'create', value: () => 'create',
}, },
// Google Calendar Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Calendar Account', title: 'Google Calendar Account',
@@ -36,6 +37,17 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
serviceId: 'google-calendar', serviceId: 'google-calendar',
requiredScopes: ['https://www.googleapis.com/auth/calendar'], requiredScopes: ['https://www.googleapis.com/auth/calendar'],
placeholder: 'Select Google Calendar account', placeholder: 'Select Google Calendar account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Calendar selector (basic mode) // Calendar selector (basic mode)
{ {
@@ -49,7 +61,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
dependsOn: ['credential'], dependsOn: ['credential'],
mode: 'basic', mode: 'basic',
}, },
// Manual calendar ID input (advanced mode) // Manual calendar ID input (advanced mode) - no dependsOn needed for text input
{ {
id: 'manualCalendarId', id: 'manualCalendarId',
title: 'Calendar ID', title: 'Calendar ID',
@@ -213,6 +225,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
operation, operation,
attendees, attendees,
replaceExisting, replaceExisting,
@@ -253,7 +266,7 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
} }
return { return {
credential, ...(credential ? { credential } : { accessToken }),
...processedParams, ...processedParams,
} }
}, },

View File

@@ -27,7 +27,7 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
], ],
value: () => 'read', value: () => 'read',
}, },
// Google Docs Credentials // Google Docs Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Account', title: 'Google Account',
@@ -39,6 +39,17 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive',
], ],
placeholder: 'Select Google account', placeholder: 'Select Google account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Document selector (basic mode) // Document selector (basic mode)
{ {
@@ -61,7 +72,6 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'documentId', canonicalParamId: 'documentId',
placeholder: 'Enter document ID', placeholder: 'Enter document ID',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: ['read', 'write'] }, condition: { field: 'operation', value: ['read', 'write'] },
}, },
@@ -95,7 +105,6 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'folderId', canonicalParamId: 'folderId',
placeholder: 'Enter parent folder ID (leave empty for root folder)', placeholder: 'Enter parent folder ID (leave empty for root folder)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: 'create' }, condition: { field: 'operation', value: 'create' },
}, },
@@ -133,8 +142,15 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, documentId, manualDocumentId, folderSelector, folderId, ...rest } = const {
params credential,
accessToken,
documentId,
manualDocumentId,
folderSelector,
folderId,
...rest
} = params
const effectiveDocumentId = (documentId || manualDocumentId || '').trim() const effectiveDocumentId = (documentId || manualDocumentId || '').trim()
const effectiveFolderId = (folderSelector || folderId || '').trim() const effectiveFolderId = (folderSelector || folderId || '').trim()
@@ -143,7 +159,7 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
...rest, ...rest,
documentId: effectiveDocumentId || undefined, documentId: effectiveDocumentId || undefined,
folderId: effectiveFolderId || undefined, folderId: effectiveFolderId || undefined,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -28,7 +28,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
], ],
value: () => 'create_folder', value: () => 'create_folder',
}, },
// Google Drive Credentials // Google Drive Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Drive Account', title: 'Google Drive Account',
@@ -40,6 +40,17 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive',
], ],
placeholder: 'Select Google Drive account', placeholder: 'Select Google Drive account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Create/Upload File Fields // Create/Upload File Fields
{ {
@@ -324,6 +335,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
folderSelector, folderSelector,
manualFolderId, manualFolderId,
fileSelector, fileSelector,
@@ -339,7 +351,7 @@ export const GoogleDriveBlock: BlockConfig<GoogleDriveResponse> = {
const effectiveFileId = (fileSelector || manualFileId || '').trim() const effectiveFileId = (fileSelector || manualFileId || '').trim()
return { return {
credential, ...(credential ? { credential } : { accessToken }),
folderId: effectiveFolderId || undefined, folderId: effectiveFolderId || undefined,
fileId: effectiveFileId || undefined, fileId: effectiveFileId || undefined,
pageSize: rest.pageSize ? Number.parseInt(rest.pageSize as string, 10) : undefined, pageSize: rest.pageSize ? Number.parseInt(rest.pageSize as string, 10) : undefined,

View File

@@ -13,6 +13,7 @@ export const GoogleFormsBlock: BlockConfig = {
bgColor: '#E0E0E0', bgColor: '#E0E0E0',
icon: GoogleFormsIcon, icon: GoogleFormsIcon,
subBlocks: [ subBlocks: [
// Google Forms Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Account', title: 'Google Account',
@@ -25,6 +26,17 @@ export const GoogleFormsBlock: BlockConfig = {
'https://www.googleapis.com/auth/forms.responses.readonly', 'https://www.googleapis.com/auth/forms.responses.readonly',
], ],
placeholder: 'Select Google account', placeholder: 'Select Google account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'formId', id: 'formId',
@@ -32,7 +44,6 @@ export const GoogleFormsBlock: BlockConfig = {
type: 'short-input', type: 'short-input',
required: true, required: true,
placeholder: 'Enter the Google Form ID', placeholder: 'Enter the Google Form ID',
dependsOn: ['credential'],
}, },
{ {
id: 'responseId', id: 'responseId',
@@ -53,7 +64,7 @@ export const GoogleFormsBlock: BlockConfig = {
config: { config: {
tool: () => 'google_forms_get_responses', tool: () => 'google_forms_get_responses',
params: (params) => { params: (params) => {
const { credential, formId, responseId, pageSize, ...rest } = params const { credential, accessToken, formId, responseId, pageSize, ...rest } = params
const effectiveFormId = String(formId || '').trim() const effectiveFormId = String(formId || '').trim()
if (!effectiveFormId) { if (!effectiveFormId) {
@@ -65,7 +76,7 @@ export const GoogleFormsBlock: BlockConfig = {
formId: effectiveFormId, formId: effectiveFormId,
responseId: responseId ? String(responseId).trim() : undefined, responseId: responseId ? String(responseId).trim() : undefined,
pageSize: pageSize ? Number(pageSize) : undefined, pageSize: pageSize ? Number(pageSize) : undefined,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -33,6 +33,7 @@ export const GoogleGroupsBlock: BlockConfig = {
], ],
value: () => 'list_groups', value: () => 'list_groups',
}, },
// Google Groups Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Groups Account', title: 'Google Groups Account',
@@ -44,6 +45,17 @@ export const GoogleGroupsBlock: BlockConfig = {
'https://www.googleapis.com/auth/admin.directory.group.member', 'https://www.googleapis.com/auth/admin.directory.group.member',
], ],
placeholder: 'Select Google Workspace account', placeholder: 'Select Google Workspace account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
@@ -221,12 +233,13 @@ export const GoogleGroupsBlock: BlockConfig = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation, ...rest } = params const { credential, accessToken, operation, ...rest } = params
const authParam = credential ? { credential } : { accessToken }
switch (operation) { switch (operation) {
case 'list_groups': case 'list_groups':
return { return {
credential, ...authParam,
customer: rest.customer, customer: rest.customer,
domain: rest.domain, domain: rest.domain,
query: rest.query, query: rest.query,
@@ -235,19 +248,19 @@ export const GoogleGroupsBlock: BlockConfig = {
case 'get_group': case 'get_group':
case 'delete_group': case 'delete_group':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
} }
case 'create_group': case 'create_group':
return { return {
credential, ...authParam,
email: rest.email, email: rest.email,
name: rest.name, name: rest.name,
description: rest.description, description: rest.description,
} }
case 'update_group': case 'update_group':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
name: rest.newName, name: rest.newName,
email: rest.newEmail, email: rest.newEmail,
@@ -255,7 +268,7 @@ export const GoogleGroupsBlock: BlockConfig = {
} }
case 'list_members': case 'list_members':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
maxResults: rest.maxResults ? Number(rest.maxResults) : undefined, maxResults: rest.maxResults ? Number(rest.maxResults) : undefined,
roles: rest.roles, roles: rest.roles,
@@ -263,32 +276,32 @@ export const GoogleGroupsBlock: BlockConfig = {
case 'get_member': case 'get_member':
case 'remove_member': case 'remove_member':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
memberKey: rest.memberKey, memberKey: rest.memberKey,
} }
case 'add_member': case 'add_member':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
email: rest.memberEmail, email: rest.memberEmail,
role: rest.role, role: rest.role,
} }
case 'update_member': case 'update_member':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
memberKey: rest.memberKey, memberKey: rest.memberKey,
role: rest.role, role: rest.role,
} }
case 'has_member': case 'has_member':
return { return {
credential, ...authParam,
groupKey: rest.groupKey, groupKey: rest.groupKey,
memberKey: rest.memberKey, memberKey: rest.memberKey,
} }
default: default:
return { credential, ...rest } return { ...(credential ? { credential } : { accessToken }), ...rest }
} }
}, },
}, },

View File

@@ -28,7 +28,7 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
], ],
value: () => 'read', value: () => 'read',
}, },
// Google Sheets Credentials // Google Sheets Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Account', title: 'Google Account',
@@ -40,6 +40,17 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive',
], ],
placeholder: 'Select Google account', placeholder: 'Select Google account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Spreadsheet Selector // Spreadsheet Selector
{ {
@@ -64,7 +75,6 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'spreadsheetId', canonicalParamId: 'spreadsheetId',
placeholder: 'ID of the spreadsheet (from URL)', placeholder: 'ID of the spreadsheet (from URL)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
}, },
// Range // Range
@@ -168,7 +178,8 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, values, spreadsheetId, manualSpreadsheetId, ...rest } = params const { credential, accessToken, values, spreadsheetId, manualSpreadsheetId, ...rest } =
params
const parsedValues = values ? JSON.parse(values as string) : undefined const parsedValues = values ? JSON.parse(values as string) : undefined
@@ -182,7 +193,7 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
...rest, ...rest,
spreadsheetId: effectiveSpreadsheetId, spreadsheetId: effectiveSpreadsheetId,
values: parsedValues, values: parsedValues,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -31,7 +31,7 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
], ],
value: () => 'read', value: () => 'read',
}, },
// Google Slides Credentials // Google Slides Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Account', title: 'Google Account',
@@ -43,6 +43,17 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive',
], ],
placeholder: 'Select Google account', placeholder: 'Select Google account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Presentation selector (basic mode) - for operations that need an existing presentation // Presentation selector (basic mode) - for operations that need an existing presentation
{ {
@@ -68,7 +79,6 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'presentationId', canonicalParamId: 'presentationId',
placeholder: 'Enter presentation ID', placeholder: 'Enter presentation ID',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { condition: {
field: 'operation', field: 'operation',
@@ -123,7 +133,6 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'folderId', canonicalParamId: 'folderId',
placeholder: 'Enter parent folder ID (leave empty for root folder)', placeholder: 'Enter parent folder ID (leave empty for root folder)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: 'create' }, condition: { field: 'operation', value: 'create' },
}, },
@@ -316,6 +325,7 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
presentationId, presentationId,
manualPresentationId, manualPresentationId,
folderSelector, folderSelector,
@@ -334,7 +344,7 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
const result: Record<string, any> = { const result: Record<string, any> = {
...rest, ...rest,
presentationId: effectivePresentationId || undefined, presentationId: effectivePresentationId || undefined,
credential, ...(credential ? { credential } : { accessToken }),
} }
// Handle operation-specific params // Handle operation-specific params

View File

@@ -30,6 +30,7 @@ export const GoogleVaultBlock: BlockConfig = {
value: () => 'list_matters_export', value: () => 'list_matters_export',
}, },
// Google Vault Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Google Vault Account', title: 'Google Vault Account',
@@ -41,6 +42,17 @@ export const GoogleVaultBlock: BlockConfig = {
'https://www.googleapis.com/auth/devstorage.read_only', 'https://www.googleapis.com/auth/devstorage.read_only',
], ],
placeholder: 'Select Google Vault account', placeholder: 'Select Google Vault account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Create Hold inputs // Create Hold inputs
{ {
@@ -218,10 +230,10 @@ export const GoogleVaultBlock: BlockConfig = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, ...rest } = params const { credential, accessToken, ...rest } = params
return { return {
...rest, ...rest,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -67,6 +67,16 @@ export const HubSpotBlock: BlockConfig<HubSpotResponse> = {
], ],
placeholder: 'Select HubSpot account', placeholder: 'Select HubSpot account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'contactId', id: 'contactId',
@@ -824,6 +834,7 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
operation, operation,
propertiesToSet, propertiesToSet,
properties, properties,
@@ -834,8 +845,9 @@ Return ONLY the JSON array of property names - no explanations, no markdown, no
...rest ...rest
} = params } = params
const authParam = credential ? { credential } : { accessToken }
const cleanParams: Record<string, any> = { const cleanParams: Record<string, any> = {
credential, ...authParam,
} }
const createUpdateOps = [ const createUpdateOps = [

View File

@@ -92,6 +92,16 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
'delete:issue-link:jira', 'delete:issue-link:jira',
], ],
placeholder: 'Select Jira account', placeholder: 'Select Jira account',
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Project selector (basic mode) // Project selector (basic mode)
{ {
@@ -443,14 +453,23 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, projectId, manualProjectId, issueKey, manualIssueKey, ...rest } = params const {
credential,
accessToken,
projectId,
manualProjectId,
issueKey,
manualIssueKey,
...rest
} = params
// Use the selected IDs or the manually entered ones // Use the selected IDs or the manually entered ones
const effectiveProjectId = (projectId || manualProjectId || '').trim() const effectiveProjectId = (projectId || manualProjectId || '').trim()
const effectiveIssueKey = (issueKey || manualIssueKey || '').trim() const effectiveIssueKey = (issueKey || manualIssueKey || '').trim()
const authParam = credential ? { credential } : { accessToken }
const baseParams = { const baseParams = {
credential, ...authParam,
domain: params.domain, domain: params.domain,
} }

View File

@@ -133,6 +133,16 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
requiredScopes: ['read', 'write'], requiredScopes: ['read', 'write'],
placeholder: 'Select Linear account', placeholder: 'Select Linear account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Team selector (for most operations) // Team selector (for most operations)
{ {
@@ -1261,9 +1271,14 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
const effectiveTeamId = (params.teamId || params.manualTeamId || '').trim() const effectiveTeamId = (params.teamId || params.manualTeamId || '').trim()
const effectiveProjectId = (params.projectId || params.manualProjectId || '').trim() const effectiveProjectId = (params.projectId || params.manualProjectId || '').trim()
// Auth param handling
const authParam = params.credential
? { credential: params.credential }
: { accessToken: params.accessToken }
// Base params that most operations need // Base params that most operations need
const baseParams: Record<string, any> = { const baseParams: Record<string, any> = {
credential: params.credential, ...authParam,
} }
// Operation-specific param mapping // Operation-specific param mapping

View File

@@ -27,7 +27,7 @@ export const LinkedInBlock: BlockConfig<LinkedInResponse> = {
value: () => 'share_post', value: () => 'share_post',
}, },
// LinkedIn OAuth Authentication // LinkedIn OAuth Authentication (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'LinkedIn Account', title: 'LinkedIn Account',
@@ -35,6 +35,17 @@ export const LinkedInBlock: BlockConfig<LinkedInResponse> = {
serviceId: 'linkedin', serviceId: 'linkedin',
requiredScopes: ['profile', 'openid', 'email', 'w_member_social'], requiredScopes: ['profile', 'openid', 'email', 'w_member_social'],
placeholder: 'Select LinkedIn account', placeholder: 'Select LinkedIn account',
mode: 'basic',
required: true,
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true, required: true,
}, },
@@ -80,18 +91,18 @@ export const LinkedInBlock: BlockConfig<LinkedInResponse> = {
}, },
params: (inputs) => { params: (inputs) => {
const operation = inputs.operation || 'share_post' const operation = inputs.operation || 'share_post'
const { credential, ...rest } = inputs const { credential, accessToken, ...rest } = inputs
const authParam = credential ? { credential } : { accessToken }
if (operation === 'get_profile') { if (operation === 'get_profile') {
return { return authParam
accessToken: credential,
}
} }
return { return {
text: rest.text, text: rest.text,
visibility: rest.visibility || 'PUBLIC', visibility: rest.visibility || 'PUBLIC',
accessToken: credential, ...authParam,
} }
}, },
}, },

View File

@@ -27,6 +27,7 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
], ],
value: () => 'read', value: () => 'read',
}, },
// Microsoft Excel Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -42,6 +43,17 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
required: true, required: true,
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'spreadsheetId', id: 'spreadsheetId',
@@ -61,7 +73,6 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'spreadsheetId', canonicalParamId: 'spreadsheetId',
placeholder: 'Enter spreadsheet ID', placeholder: 'Enter spreadsheet ID',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
}, },
{ {
@@ -160,6 +171,7 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
values, values,
spreadsheetId, spreadsheetId,
manualSpreadsheetId, manualSpreadsheetId,
@@ -193,7 +205,7 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
...rest, ...rest,
spreadsheetId: effectiveSpreadsheetId, spreadsheetId: effectiveSpreadsheetId,
values: parsedValues, values: parsedValues,
credential, ...(credential ? { credential } : { accessToken }),
} }
if (params.operation === 'table_add') { if (params.operation === 'table_add') {

View File

@@ -57,6 +57,7 @@ export const MicrosoftPlannerBlock: BlockConfig<MicrosoftPlannerResponse> = {
{ label: 'Update Task Details', id: 'update_task_details' }, { label: 'Update Task Details', id: 'update_task_details' },
], ],
}, },
// Microsoft Planner Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -72,6 +73,17 @@ export const MicrosoftPlannerBlock: BlockConfig<MicrosoftPlannerResponse> = {
'offline_access', 'offline_access',
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Plan ID - for various operations // Plan ID - for various operations
@@ -342,7 +354,7 @@ export const MicrosoftPlannerBlock: BlockConfig<MicrosoftPlannerResponse> = {
const baseParams: MicrosoftPlannerBlockParams = { const baseParams: MicrosoftPlannerBlockParams = {
...rest, ...rest,
credential, ...(credential ? { credential } : { accessToken }),
} }
// Handle different task ID fields // Handle different task ID fields

View File

@@ -39,6 +39,7 @@ export const MicrosoftTeamsBlock: BlockConfig<MicrosoftTeamsResponse> = {
], ],
value: () => 'read_chat', value: () => 'read_chat',
}, },
// Microsoft Teams Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -68,6 +69,17 @@ export const MicrosoftTeamsBlock: BlockConfig<MicrosoftTeamsResponse> = {
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
required: true, required: true,
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'teamId', id: 'teamId',
@@ -315,6 +327,7 @@ export const MicrosoftTeamsBlock: BlockConfig<MicrosoftTeamsResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
operation, operation,
teamId, teamId,
manualTeamId, manualTeamId,
@@ -336,7 +349,7 @@ export const MicrosoftTeamsBlock: BlockConfig<MicrosoftTeamsResponse> = {
const baseParams: Record<string, any> = { const baseParams: Record<string, any> = {
...rest, ...rest,
credential, ...(credential ? { credential } : { accessToken }),
} }
if ((operation === 'read_chat' || operation === 'read_channel') && includeAttachments) { if ((operation === 'read_chat' || operation === 'read_channel') && includeAttachments) {

View File

@@ -38,6 +38,16 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
requiredScopes: ['workspace.content', 'workspace.name', 'page.read', 'page.write'], requiredScopes: ['workspace.content', 'workspace.name', 'page.read', 'page.write'],
placeholder: 'Select Notion account', placeholder: 'Select Notion account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Read/Write operation - Page ID // Read/Write operation - Page ID
{ {
@@ -222,7 +232,8 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation, properties, filter, sorts, ...rest } = params const { credential, accessToken, operation, properties, filter, sorts, ...rest } = params
const authParam = credential ? { credential } : { accessToken }
// Parse properties from JSON string for create operations // Parse properties from JSON string for create operations
let parsedProperties let parsedProperties
@@ -265,7 +276,7 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
return { return {
...rest, ...rest,
credential, ...authParam,
...(parsedProperties ? { properties: parsedProperties } : {}), ...(parsedProperties ? { properties: parsedProperties } : {}),
...(parsedFilter ? { filter: JSON.stringify(parsedFilter) } : {}), ...(parsedFilter ? { filter: JSON.stringify(parsedFilter) } : {}),
...(parsedSorts ? { sorts: JSON.stringify(parsedSorts) } : {}), ...(parsedSorts ? { sorts: JSON.stringify(parsedSorts) } : {}),

View File

@@ -33,7 +33,7 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
{ label: 'Delete File', id: 'delete' }, { label: 'Delete File', id: 'delete' },
], ],
}, },
// One Drive Credentials // OneDrive Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -48,6 +48,17 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
'offline_access', 'offline_access',
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Create File Fields // Create File Fields
{ {
@@ -164,7 +175,6 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'folderId', canonicalParamId: 'folderId',
placeholder: 'Enter parent folder ID (leave empty for root folder)', placeholder: 'Enter parent folder ID (leave empty for root folder)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: ['create_file', 'upload'] }, condition: { field: 'operation', value: ['create_file', 'upload'] },
}, },
@@ -202,7 +212,6 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'folderId', canonicalParamId: 'folderId',
placeholder: 'Enter parent folder ID (leave empty for root folder)', placeholder: 'Enter parent folder ID (leave empty for root folder)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: 'create_folder' }, condition: { field: 'operation', value: 'create_folder' },
}, },
@@ -234,7 +243,6 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'folderId', canonicalParamId: 'folderId',
placeholder: 'Enter folder ID (leave empty for root folder)', placeholder: 'Enter folder ID (leave empty for root folder)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: 'list' }, condition: { field: 'operation', value: 'list' },
}, },
@@ -352,7 +360,16 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, folderId, fileId, mimeType, values, downloadFileName, ...rest } = params const {
credential,
accessToken,
folderId,
fileId,
mimeType,
values,
downloadFileName,
...rest
} = params
let normalizedValues: ReturnType<typeof normalizeExcelValuesForToolParams> let normalizedValues: ReturnType<typeof normalizeExcelValuesForToolParams>
if (values !== undefined) { if (values !== undefined) {
@@ -360,7 +377,7 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
} }
return { return {
credential, ...(credential ? { credential } : { accessToken }),
...rest, ...rest,
values: normalizedValues, values: normalizedValues,
folderId: folderId || undefined, folderId: folderId || undefined,

View File

@@ -34,6 +34,7 @@ export const OutlookBlock: BlockConfig<OutlookResponse> = {
], ],
value: () => 'send_outlook', value: () => 'send_outlook',
}, },
// Microsoft Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -51,6 +52,17 @@ export const OutlookBlock: BlockConfig<OutlookResponse> = {
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
required: true, required: true,
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'to', id: 'to',
@@ -326,6 +338,7 @@ export const OutlookBlock: BlockConfig<OutlookResponse> = {
params: (params) => { params: (params) => {
const { const {
credential, credential,
accessToken,
folder, folder,
manualFolder, manualFolder,
destinationFolder, destinationFolder,
@@ -378,7 +391,7 @@ export const OutlookBlock: BlockConfig<OutlookResponse> = {
return { return {
...rest, ...rest,
credential, ...(credential ? { credential } : { accessToken }),
} }
}, },
}, },

View File

@@ -57,6 +57,16 @@ export const PipedriveBlock: BlockConfig<PipedriveResponse> = {
], ],
placeholder: 'Select Pipedrive account', placeholder: 'Select Pipedrive account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'status', id: 'status',
@@ -660,10 +670,11 @@ export const PipedriveBlock: BlockConfig<PipedriveResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation, ...rest } = params const { credential, accessToken, operation, ...rest } = params
const authParam = credential ? { credential } : { accessToken }
const cleanParams: Record<string, any> = { const cleanParams: Record<string, any> = {
credential, ...authParam,
} }
Object.entries(rest).forEach(([key, value]) => { Object.entries(rest).forEach(([key, value]) => {

View File

@@ -37,7 +37,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
value: () => 'get_posts', value: () => 'get_posts',
}, },
// Reddit OAuth Authentication // Reddit OAuth Authentication (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Reddit Account', title: 'Reddit Account',
@@ -63,6 +63,17 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
], ],
placeholder: 'Select Reddit account', placeholder: 'Select Reddit account',
required: true, required: true,
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Common fields - appear for all actions // Common fields - appear for all actions
@@ -555,7 +566,9 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
}, },
params: (inputs) => { params: (inputs) => {
const operation = inputs.operation || 'get_posts' const operation = inputs.operation || 'get_posts'
const { credential, ...rest } = inputs const { credential, accessToken, ...rest } = inputs
const authParam = credential ? { credential } : { accessToken }
if (operation === 'get_comments') { if (operation === 'get_comments') {
return { return {
@@ -563,7 +576,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
subreddit: rest.subreddit, subreddit: rest.subreddit,
sort: rest.commentSort, sort: rest.commentSort,
limit: rest.commentLimit ? Number.parseInt(rest.commentLimit) : undefined, limit: rest.commentLimit ? Number.parseInt(rest.commentLimit) : undefined,
credential: credential, ...authParam,
} }
} }
@@ -572,7 +585,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
subreddit: rest.subreddit, subreddit: rest.subreddit,
time: rest.controversialTime, time: rest.controversialTime,
limit: rest.controversialLimit ? Number.parseInt(rest.controversialLimit) : undefined, limit: rest.controversialLimit ? Number.parseInt(rest.controversialLimit) : undefined,
credential: credential, ...authParam,
} }
} }
@@ -583,7 +596,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
sort: rest.searchSort, sort: rest.searchSort,
time: rest.searchTime, time: rest.searchTime,
limit: rest.searchLimit ? Number.parseInt(rest.searchLimit) : undefined, limit: rest.searchLimit ? Number.parseInt(rest.searchLimit) : undefined,
credential: credential, ...authParam,
} }
} }
@@ -595,7 +608,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
url: rest.postType === 'link' ? rest.url : undefined, url: rest.postType === 'link' ? rest.url : undefined,
nsfw: rest.nsfw === 'true', nsfw: rest.nsfw === 'true',
spoiler: rest.spoiler === 'true', spoiler: rest.spoiler === 'true',
credential: credential, ...authParam,
} }
} }
@@ -603,7 +616,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
return { return {
id: rest.voteId, id: rest.voteId,
dir: Number.parseInt(rest.voteDirection), dir: Number.parseInt(rest.voteDirection),
credential: credential, ...authParam,
} }
} }
@@ -611,14 +624,14 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
return { return {
id: rest.saveId, id: rest.saveId,
category: rest.saveCategory, category: rest.saveCategory,
credential: credential, ...authParam,
} }
} }
if (operation === 'unsave') { if (operation === 'unsave') {
return { return {
id: rest.saveId, id: rest.saveId,
credential: credential, ...authParam,
} }
} }
@@ -626,7 +639,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
return { return {
parent_id: rest.replyParentId, parent_id: rest.replyParentId,
text: rest.replyText, text: rest.replyText,
credential: credential, ...authParam,
} }
} }
@@ -634,14 +647,14 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
return { return {
thing_id: rest.editThingId, thing_id: rest.editThingId,
text: rest.editText, text: rest.editText,
credential: credential, ...authParam,
} }
} }
if (operation === 'delete') { if (operation === 'delete') {
return { return {
id: rest.deleteId, id: rest.deleteId,
credential: credential, ...authParam,
} }
} }
@@ -649,7 +662,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
return { return {
subreddit: rest.subscribeSubreddit, subreddit: rest.subscribeSubreddit,
action: rest.subscribeAction, action: rest.subscribeAction,
credential: credential, ...authParam,
} }
} }
@@ -658,7 +671,7 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
sort: rest.sort, sort: rest.sort,
limit: rest.limit ? Number.parseInt(rest.limit) : undefined, limit: rest.limit ? Number.parseInt(rest.limit) : undefined,
time: rest.sort === 'top' ? rest.time : undefined, time: rest.sort === 'top' ? rest.time : undefined,
credential: credential, ...authParam,
} }
}, },
}, },

View File

@@ -66,6 +66,16 @@ export const SalesforceBlock: BlockConfig<SalesforceResponse> = {
requiredScopes: ['api', 'refresh_token', 'openid', 'offline_access'], requiredScopes: ['api', 'refresh_token', 'openid', 'offline_access'],
placeholder: 'Select Salesforce account', placeholder: 'Select Salesforce account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Common fields for GET operations // Common fields for GET operations
{ {
@@ -590,8 +600,9 @@ export const SalesforceBlock: BlockConfig<SalesforceResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation, ...rest } = params const { credential, accessToken, operation, ...rest } = params
const cleanParams: Record<string, any> = { credential } const authParam = credential ? { credential } : { accessToken }
const cleanParams: Record<string, any> = { ...authParam }
Object.entries(rest).forEach(([key, value]) => { Object.entries(rest).forEach(([key, value]) => {
if (value !== undefined && value !== null && value !== '') { if (value !== undefined && value !== null && value !== '') {
cleanParams[key] = value cleanParams[key] = value

View File

@@ -33,6 +33,7 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
{ label: 'Upload File', id: 'upload_file' }, { label: 'Upload File', id: 'upload_file' },
], ],
}, },
// SharePoint Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'Microsoft Account', title: 'Microsoft Account',
@@ -48,6 +49,17 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
'offline_access', 'offline_access',
], ],
placeholder: 'Select Microsoft account', placeholder: 'Select Microsoft account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
@@ -155,7 +167,6 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
type: 'short-input', type: 'short-input',
canonicalParamId: 'siteId', canonicalParamId: 'siteId',
placeholder: 'Enter site ID (leave empty for root site)', placeholder: 'Enter site ID (leave empty for root site)',
dependsOn: ['credential'],
mode: 'advanced', mode: 'advanced',
condition: { field: 'operation', value: 'create_page' }, condition: { field: 'operation', value: 'create_page' },
}, },
@@ -255,7 +266,7 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, siteSelector, manualSiteId, mimeType, ...rest } = params const { credential, accessToken, siteSelector, manualSiteId, mimeType, ...rest } = params
const effectiveSiteId = (siteSelector || manualSiteId || '').trim() const effectiveSiteId = (siteSelector || manualSiteId || '').trim()
@@ -315,7 +326,7 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
// Handle file upload files parameter // Handle file upload files parameter
const fileParam = uploadFiles || files const fileParam = uploadFiles || files
const baseParams = { const baseParams = {
credential, ...(credential ? { credential } : { accessToken }),
siteId: effectiveSiteId || undefined, siteId: effectiveSiteId || undefined,
pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined, pageSize: others.pageSize ? Number.parseInt(others.pageSize as string, 10) : undefined,
mimeType: mimeType, mimeType: mimeType,

View File

@@ -71,6 +71,16 @@ export const ShopifyBlock: BlockConfig<ShopifyResponse> = {
], ],
placeholder: 'Select Shopify account', placeholder: 'Select Shopify account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'shopDomain', id: 'shopDomain',
@@ -526,8 +536,11 @@ export const ShopifyBlock: BlockConfig<ShopifyResponse> = {
return params.operation || 'shopify_list_products' return params.operation || 'shopify_list_products'
}, },
params: (params) => { params: (params) => {
const authParam = params.credential
? { credential: params.credential }
: { accessToken: params.accessToken }
const baseParams: Record<string, unknown> = { const baseParams: Record<string, unknown> = {
credential: params.credential, ...authParam,
shopDomain: params.shopDomain?.trim(), shopDomain: params.shopDomain?.trim(),
} }

View File

@@ -159,6 +159,16 @@ export const SpotifyBlock: BlockConfig<ToolResponse> = {
type: 'oauth-input', type: 'oauth-input',
serviceId: 'spotify', serviceId: 'spotify',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// === SEARCH === // === SEARCH ===

View File

@@ -45,6 +45,16 @@ export const TrelloBlock: BlockConfig<ToolResponse> = {
requiredScopes: ['read', 'write'], requiredScopes: ['read', 'write'],
placeholder: 'Select Trello account', placeholder: 'Select Trello account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
@@ -330,9 +340,10 @@ export const TrelloBlock: BlockConfig<ToolResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { operation, limit, closed, dueComplete, ...rest } = params const { credential, accessToken, operation, limit, closed, dueComplete, ...rest } = params
const result: Record<string, any> = { ...rest } const authParam = credential ? { credential } : { accessToken }
const result: Record<string, any> = { ...rest, ...authParam }
if (limit && operation === 'trello_get_actions') { if (limit && operation === 'trello_get_actions') {
result.limit = Number.parseInt(limit, 10) result.limit = Number.parseInt(limit, 10)

View File

@@ -37,6 +37,16 @@ export const WealthboxBlock: BlockConfig<WealthboxResponse> = {
requiredScopes: ['login', 'data'], requiredScopes: ['login', 'data'],
placeholder: 'Select Wealthbox account', placeholder: 'Select Wealthbox account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'noteId', id: 'noteId',
@@ -167,16 +177,25 @@ export const WealthboxBlock: BlockConfig<WealthboxResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, operation, contactId, manualContactId, taskId, manualTaskId, ...rest } = const {
params credential,
accessToken,
operation,
contactId,
manualContactId,
taskId,
manualTaskId,
...rest
} = params
const authParam = credential ? { credential } : { accessToken }
// Handle both selector and manual inputs // Handle both selector and manual inputs
const effectiveContactId = (contactId || manualContactId || '').trim() const effectiveContactId = (contactId || manualContactId || '').trim()
const effectiveTaskId = (taskId || manualTaskId || '').trim() const effectiveTaskId = (taskId || manualTaskId || '').trim()
const baseParams = { const baseParams = {
...rest, ...rest,
credential, ...authParam,
} }
if (operation === 'read_note' || operation === 'write_note') { if (operation === 'read_note' || operation === 'write_note') {

View File

@@ -38,6 +38,16 @@ export const WebflowBlock: BlockConfig<WebflowResponse> = {
requiredScopes: ['sites:read', 'sites:write', 'cms:read', 'cms:write'], requiredScopes: ['sites:read', 'sites:write', 'cms:read', 'cms:write'],
placeholder: 'Select Webflow account', placeholder: 'Select Webflow account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'collectionId', id: 'collectionId',
@@ -108,7 +118,8 @@ export const WebflowBlock: BlockConfig<WebflowResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, fieldData, ...rest } = params const { credential, accessToken, fieldData, ...rest } = params
const authParam = credential ? { credential } : { accessToken }
let parsedFieldData: any | undefined let parsedFieldData: any | undefined
try { try {
@@ -120,7 +131,7 @@ export const WebflowBlock: BlockConfig<WebflowResponse> = {
} }
const baseParams = { const baseParams = {
credential, ...authParam,
...rest, ...rest,
} }

View File

@@ -59,7 +59,7 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
value: () => 'wordpress_create_post', value: () => 'wordpress_create_post',
}, },
// Credential selector for OAuth // Credential selector for OAuth (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'WordPress Account', title: 'WordPress Account',
@@ -68,6 +68,16 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
requiredScopes: ['global'], requiredScopes: ['global'],
placeholder: 'Select WordPress account', placeholder: 'Select WordPress account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// Site ID for WordPress.com (required for OAuth) // Site ID for WordPress.com (required for OAuth)
@@ -665,8 +675,11 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
tool: (params) => params.operation || 'wordpress_create_post', tool: (params) => params.operation || 'wordpress_create_post',
params: (params) => { params: (params) => {
// OAuth authentication for WordPress.com // OAuth authentication for WordPress.com
const authParam = params.credential
? { credential: params.credential }
: { accessToken: params.accessToken }
const baseParams: Record<string, any> = { const baseParams: Record<string, any> = {
credential: params.credential, ...authParam,
siteId: params.siteId, siteId: params.siteId,
} }

View File

@@ -27,6 +27,7 @@ export const XBlock: BlockConfig<XResponse> = {
], ],
value: () => 'x_write', value: () => 'x_write',
}, },
// X Credentials (basic mode)
{ {
id: 'credential', id: 'credential',
title: 'X Account', title: 'X Account',
@@ -34,6 +35,17 @@ export const XBlock: BlockConfig<XResponse> = {
serviceId: 'x', serviceId: 'x',
requiredScopes: ['tweet.read', 'tweet.write', 'users.read', 'offline.access'], requiredScopes: ['tweet.read', 'tweet.write', 'users.read', 'offline.access'],
placeholder: 'Select X account', placeholder: 'Select X account',
mode: 'basic',
},
// Direct access token (advanced mode)
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
{ {
id: 'text', id: 'text',
@@ -143,11 +155,9 @@ export const XBlock: BlockConfig<XResponse> = {
} }
}, },
params: (params) => { params: (params) => {
const { credential, ...rest } = params const { credential, accessToken, ...rest } = params
const parsedParams: Record<string, any> = { const parsedParams: Record<string, any> = credential ? { credential } : { accessToken }
credential: credential,
}
Object.keys(rest).forEach((key) => { Object.keys(rest).forEach((key) => {
const value = rest[key] const value = rest[key]

View File

@@ -53,6 +53,16 @@ export const ZoomBlock: BlockConfig<ZoomResponse> = {
], ],
placeholder: 'Select Zoom account', placeholder: 'Select Zoom account',
required: true, required: true,
mode: 'basic',
},
{
id: 'accessToken',
title: 'Access Token',
type: 'short-input',
password: true,
placeholder: 'Enter OAuth access token',
mode: 'advanced',
required: true,
}, },
// User ID for create/list operations // User ID for create/list operations
{ {
@@ -366,8 +376,11 @@ export const ZoomBlock: BlockConfig<ZoomResponse> = {
return params.operation || 'zoom_create_meeting' return params.operation || 'zoom_create_meeting'
}, },
params: (params) => { params: (params) => {
const authParam = params.credential
? { credential: params.credential }
: { accessToken: params.accessToken }
const baseParams: Record<string, any> = { const baseParams: Record<string, any> = {
credential: params.credential, ...authParam,
} }
switch (params.operation) { switch (params.operation) {

View File

@@ -32,7 +32,11 @@ function shouldIncludeField(subBlockConfig: SubBlockConfig, isAdvancedMode: bool
const fieldMode = subBlockConfig.mode const fieldMode = subBlockConfig.mode
if (fieldMode === 'advanced' && !isAdvancedMode) { if (fieldMode === 'advanced' && !isAdvancedMode) {
return false // Skip advanced-only fields when in basic mode return false
}
if (fieldMode === 'basic' && isAdvancedMode) {
return false
} }
return true return true