-
Notifications
You must be signed in to change notification settings - Fork 3.5k
v0.5.108: workflow input params in agent tools, bun upgrade, dropdown selectors for 14 blocks #3445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
06c8844
fix(tool-input): restore workflow input mapper visibility (#3438)
waleedlatif1 ae88718
fix(memory): upgrade bun from 1.3.9 to 1.3.10 (#3441)
waleedlatif1 244cf4f
feat(selectors): add dropdown selectors for 14 integrations (#3433)
waleedlatif1 f1efc59
fix(selectors): resolve env var references at design time for selecto…
waleedlatif1 a4d581c
improvement(canonical): backfill for canonical modes on config change…
icecrasher321 a713042
improvement(oauth): centralize scopes and remove dead scope evaluatio…
waleedlatif1 e6a5e7f
improvement(selectors): simplify selector context + add tests (#3453)
icecrasher321 1d36b80
improvement(selectors): remove dead semantic fallback code (#3454)
icecrasher321 0a52b09
feat(jira): add search_users tool for user lookup by email (#3451)
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import { createLogger } from '@sim/logger' | ||
| import { NextResponse } from 'next/server' | ||
| import { authorizeCredentialUse } from '@/lib/auth/credential-access' | ||
| import { generateRequestId } from '@/lib/core/utils/request' | ||
| import { refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/utils' | ||
|
|
||
| const logger = createLogger('AirtableBasesAPI') | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| export async function POST(request: Request) { | ||
| const requestId = generateRequestId() | ||
| try { | ||
| const body = await request.json() | ||
| const { credential, workflowId } = body | ||
|
|
||
| if (!credential) { | ||
| logger.error('Missing credential in request') | ||
| return NextResponse.json({ error: 'Credential is required' }, { status: 400 }) | ||
| } | ||
|
|
||
| const authz = await authorizeCredentialUse(request as any, { | ||
| credentialId: credential, | ||
| workflowId, | ||
| }) | ||
| if (!authz.ok || !authz.credentialOwnerUserId) { | ||
| return NextResponse.json({ error: authz.error || 'Unauthorized' }, { status: 403 }) | ||
| } | ||
|
|
||
| const accessToken = await refreshAccessTokenIfNeeded( | ||
| credential, | ||
| authz.credentialOwnerUserId, | ||
| requestId | ||
| ) | ||
| if (!accessToken) { | ||
| logger.error('Failed to get access token', { | ||
| credentialId: credential, | ||
| userId: authz.credentialOwnerUserId, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Could not retrieve access token', authRequired: true }, | ||
| { status: 401 } | ||
| ) | ||
| } | ||
|
|
||
| const response = await fetch('https://api.airtable.com/v0/meta/bases', { | ||
| headers: { | ||
| Authorization: `Bearer ${accessToken}`, | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| }) | ||
|
|
||
| if (!response.ok) { | ||
| const errorData = await response.json().catch(() => ({})) | ||
| logger.error('Failed to fetch Airtable bases', { | ||
| status: response.status, | ||
| error: errorData, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Failed to fetch Airtable bases', details: errorData }, | ||
| { status: response.status } | ||
| ) | ||
| } | ||
|
|
||
| const data = await response.json() | ||
| const bases = (data.bases || []).map((base: { id: string; name: string }) => ({ | ||
| id: base.id, | ||
| name: base.name, | ||
| })) | ||
|
|
||
| return NextResponse.json({ bases }) | ||
| } catch (error) { | ||
| logger.error('Error processing Airtable bases request:', error) | ||
| return NextResponse.json( | ||
| { error: 'Failed to retrieve Airtable bases', details: (error as Error).message }, | ||
| { status: 500 } | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import { createLogger } from '@sim/logger' | ||
| import { NextResponse } from 'next/server' | ||
| import { authorizeCredentialUse } from '@/lib/auth/credential-access' | ||
| import { validateAirtableId } from '@/lib/core/security/input-validation' | ||
| import { generateRequestId } from '@/lib/core/utils/request' | ||
| import { refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/utils' | ||
|
|
||
| const logger = createLogger('AirtableTablesAPI') | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| export async function POST(request: Request) { | ||
| const requestId = generateRequestId() | ||
| try { | ||
| const body = await request.json() | ||
| const { credential, workflowId, baseId } = body | ||
|
|
||
| if (!credential) { | ||
| logger.error('Missing credential in request') | ||
| return NextResponse.json({ error: 'Credential is required' }, { status: 400 }) | ||
| } | ||
|
|
||
| if (!baseId) { | ||
| logger.error('Missing baseId in request') | ||
| return NextResponse.json({ error: 'Base ID is required' }, { status: 400 }) | ||
| } | ||
|
|
||
| const baseIdValidation = validateAirtableId(baseId, 'app', 'baseId') | ||
| if (!baseIdValidation.isValid) { | ||
| logger.error('Invalid baseId', { error: baseIdValidation.error }) | ||
| return NextResponse.json({ error: baseIdValidation.error }, { status: 400 }) | ||
| } | ||
|
|
||
| const authz = await authorizeCredentialUse(request as any, { | ||
| credentialId: credential, | ||
| workflowId, | ||
| }) | ||
| if (!authz.ok || !authz.credentialOwnerUserId) { | ||
| return NextResponse.json({ error: authz.error || 'Unauthorized' }, { status: 403 }) | ||
| } | ||
|
|
||
| const accessToken = await refreshAccessTokenIfNeeded( | ||
| credential, | ||
| authz.credentialOwnerUserId, | ||
| requestId | ||
| ) | ||
| if (!accessToken) { | ||
| logger.error('Failed to get access token', { | ||
| credentialId: credential, | ||
| userId: authz.credentialOwnerUserId, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Could not retrieve access token', authRequired: true }, | ||
| { status: 401 } | ||
| ) | ||
| } | ||
|
|
||
| const response = await fetch( | ||
| `https://api.airtable.com/v0/meta/bases/${baseIdValidation.sanitized}/tables`, | ||
| { | ||
| headers: { | ||
| Authorization: `Bearer ${accessToken}`, | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| } | ||
| ) | ||
|
|
||
| if (!response.ok) { | ||
| const errorData = await response.json().catch(() => ({})) | ||
| logger.error('Failed to fetch Airtable tables', { | ||
| status: response.status, | ||
| error: errorData, | ||
| baseId, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Failed to fetch Airtable tables', details: errorData }, | ||
| { status: response.status } | ||
| ) | ||
| } | ||
|
|
||
| const data = await response.json() | ||
| const tables = (data.tables || []).map((table: { id: string; name: string }) => ({ | ||
| id: table.id, | ||
| name: table.name, | ||
| })) | ||
|
|
||
| return NextResponse.json({ tables }) | ||
| } catch (error) { | ||
| logger.error('Error processing Airtable tables request:', error) | ||
| return NextResponse.json( | ||
| { error: 'Failed to retrieve Airtable tables', details: (error as Error).message }, | ||
| { status: 500 } | ||
| ) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import { createLogger } from '@sim/logger' | ||
| import { NextResponse } from 'next/server' | ||
| import { authorizeCredentialUse } from '@/lib/auth/credential-access' | ||
| import { generateRequestId } from '@/lib/core/utils/request' | ||
| import { refreshAccessTokenIfNeeded } from '@/app/api/auth/oauth/utils' | ||
|
|
||
| const logger = createLogger('AsanaWorkspacesAPI') | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| export async function POST(request: Request) { | ||
| const requestId = generateRequestId() | ||
| try { | ||
| const body = await request.json() | ||
| const { credential, workflowId } = body | ||
|
|
||
| if (!credential) { | ||
| logger.error('Missing credential in request') | ||
| return NextResponse.json({ error: 'Credential is required' }, { status: 400 }) | ||
| } | ||
|
|
||
| const authz = await authorizeCredentialUse(request as any, { | ||
| credentialId: credential, | ||
| workflowId, | ||
| }) | ||
| if (!authz.ok || !authz.credentialOwnerUserId) { | ||
| return NextResponse.json({ error: authz.error || 'Unauthorized' }, { status: 403 }) | ||
| } | ||
|
|
||
| const accessToken = await refreshAccessTokenIfNeeded( | ||
| credential, | ||
| authz.credentialOwnerUserId, | ||
| requestId | ||
| ) | ||
| if (!accessToken) { | ||
| logger.error('Failed to get access token', { | ||
| credentialId: credential, | ||
| userId: authz.credentialOwnerUserId, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Could not retrieve access token', authRequired: true }, | ||
| { status: 401 } | ||
| ) | ||
| } | ||
|
|
||
| const response = await fetch('https://app.asana.com/api/1.0/workspaces', { | ||
| headers: { | ||
| Authorization: `Bearer ${accessToken}`, | ||
| Accept: 'application/json', | ||
| }, | ||
| }) | ||
|
|
||
| if (!response.ok) { | ||
| const errorData = await response.json().catch(() => ({})) | ||
| logger.error('Failed to fetch Asana workspaces', { | ||
| status: response.status, | ||
| error: errorData, | ||
| }) | ||
| return NextResponse.json( | ||
| { error: 'Failed to fetch Asana workspaces', details: errorData }, | ||
| { status: response.status } | ||
| ) | ||
| } | ||
|
|
||
| const data = await response.json() | ||
| const workspaces = (data.data || []).map((workspace: { gid: string; name: string }) => ({ | ||
| id: workspace.gid, | ||
| name: workspace.name, | ||
| })) | ||
|
|
||
| return NextResponse.json({ workspaces }) | ||
| } catch (error) { | ||
| logger.error('Error processing Asana workspaces request:', error) | ||
| return NextResponse.json( | ||
| { error: 'Failed to retrieve Asana workspaces', details: (error as Error).message }, | ||
| { status: 500 } | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.