Skip to content

Commit 8d1f07b

Browse files
authored
improvement(integrations): consolidate generated metadata (#7887)
1 parent 04aae63 commit 8d1f07b

19 files changed

Lines changed: 242 additions & 160 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/message-sources/message-sources.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ vi.mock('@/lib/browser-agent/open-in-panel', () => ({
99
shouldOpenInBrowserPanel: () => false,
1010
openInBrowserPanel: vi.fn(),
1111
}))
12-
vi.mock('@/lib/integrations', () => ({
12+
vi.mock('@/lib/integrations/icon-mapping', () => ({
1313
blockTypeToIconMap: { confluence_v2: () => <svg data-brand='confluence' /> },
1414
}))
1515

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/source-chip/source-chip.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ vi.mock('@/lib/browser-agent/open-in-panel', () => ({
77
shouldOpenInBrowserPanel: () => false,
88
openInBrowserPanel: vi.fn(),
99
}))
10-
vi.mock('@/lib/integrations', () => ({ blockTypeToIconMap: {} }))
10+
vi.mock('@/lib/integrations/icon-mapping', () => ({ blockTypeToIconMap: {} }))
1111

1212
import { SourceCard } from '@/app/workspace/[workspaceId]/home/components/message-content/components/source-card'
1313
import { SourceChip } from '@/app/workspace/[workspaceId]/home/components/message-content/components/source-chip'

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/source-chip/source-chip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { chipFilledFillTokens, chipHoverSurfaceClass, cn, OverflowText, Tooltip } from '@sim/emcn'
44
import { stripVersionSuffix } from '@sim/utils/string'
55
import { faviconUrl } from '@/lib/core/utils/favicon'
6-
import { blockTypeToIconMap } from '@/lib/integrations'
6+
import { blockTypeToIconMap } from '@/lib/integrations/icon-mapping'
77
import {
88
externalLinkHostname,
99
handleExternalLinkClick,

apps/sim/app/workspace/[workspaceId]/home/components/suggested-actions/suggested-actions.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use client'
22

33
import { useMemo, useState } from 'react'
4+
import { INTEGRATION_METADATA } from '@sim/deployment-config/integration-metadata'
45
import { ArrowRight, ChevronDown, cn, Expandable, ExpandableContent, OverflowText } from '@sim/emcn'
56
import { Table } from '@sim/emcn/icons'
67
import { stripVersionSuffix } from '@sim/utils/string'
78
import { useParams } from 'next/navigation'
89
import { usePostHog } from 'posthog-js/react'
910
import { GmailIcon, SlackIcon } from '@/components/icons'
1011
import {
11-
INTEGRATIONS,
1212
resolveOAuthServiceForIntegration,
1313
resolveOAuthServiceForSlug,
14-
} from '@/lib/integrations'
14+
} from '@/lib/integrations/oauth-service'
1515
import { captureEvent } from '@/lib/posthog/client'
1616
import { ConnectOAuthModal } from '@/app/workspace/[workspaceId]/components/connect-oauth-modal'
1717
import type {
@@ -30,12 +30,12 @@ import { useTablesList } from '@/hooks/queries/tables'
3030

3131
/** Lookup integration slug by OAuth service display name (case-insensitive). */
3232
const SLUG_BY_LOWER_NAME: ReadonlyMap<string, string> = new Map(
33-
INTEGRATIONS.map((i) => [i.name.toLowerCase(), i.slug])
33+
INTEGRATION_METADATA.map((i) => [i.name.toLowerCase(), i.slug])
3434
)
3535

3636
/** Lookup base block type by catalog slug, for the connect-row popularity weight. */
3737
const TYPE_BY_SLUG: ReadonlyMap<string, string> = new Map(
38-
INTEGRATIONS.map((i) => [i.slug, stripVersionSuffix(i.type)])
38+
INTEGRATION_METADATA.map((i) => [i.slug, stripVersionSuffix(i.type)])
3939
)
4040

4141
/**
@@ -86,7 +86,10 @@ const TABLE_STARTERS: readonly Candidate[] = [
8686
*/
8787
const CANDIDATES: readonly Candidate[] = (() => {
8888
const integrationByType = new Map(
89-
INTEGRATIONS.flatMap((i) => [[i.type, i] as const, [stripVersionSuffix(i.type), i] as const])
89+
INTEGRATION_METADATA.flatMap((i) => [
90+
[i.type, i] as const,
91+
[stripVersionSuffix(i.type), i] as const,
92+
])
9093
)
9194
const out: Candidate[] = [...TABLE_STARTERS]
9295
for (const [blockType, meta] of Object.entries(getAllBlockMeta())) {

apps/sim/app/workspace/[workspaceId]/integrations/connected/[credentialId]/connected-credential-detail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { getErrorMessage } from '@sim/utils/errors'
1818
import { useRouter } from 'next/navigation'
1919
import { SaveDiscardChips } from '@/components/settings/save-discard-actions'
2020
import { writeOAuthReturnContext } from '@/lib/credentials/client-state'
21-
import { resolveCredentialDisplay } from '@/lib/integrations'
21+
import { resolveCredentialDisplay } from '@/lib/integrations/credential-display'
2222
import { ConnectOAuthModal } from '@/app/workspace/[workspaceId]/components/connect-oauth-modal'
2323
import {
2424
AddPeopleModal,

apps/sim/components/access-requests/policy-changes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
AccessRequestPreviewResponse,
88
AccessRequestTarget,
99
} from '@/lib/api/contracts/access-requests'
10-
import { BLOCK_NAMES } from '@/lib/permission-groups/block-names.generated'
10+
import { BLOCK_NAMES } from '@/lib/block-metadata/names.generated'
1111
import { PERMISSION_GROUP_FIELDS } from '@/lib/permission-groups/fields'
1212
import { resolveAccessControlBlockType } from '@/lib/permission-groups/integration-allowlist'
1313

apps/sim/lib/permission-groups/block-names.generated.ts renamed to apps/sim/lib/block-metadata/names.generated.ts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
1515
algolia: 'Algolia',
1616
amplitude: 'Amplitude',
1717
api: 'API',
18-
api_trigger: 'API (Legacy)',
1918
apify: 'Apify',
2019
apollo: 'Apollo',
2120
appconfig: 'AWS AppConfig',
@@ -27,7 +26,6 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
2726
azure_data_explorer: 'Azure Data Explorer',
2827
azure_devops: 'Azure DevOps',
2928
bitbucket: 'Bitbucket',
30-
box: 'Box (Legacy)',
3129
box_v2: 'Box',
3230
brandfetch: 'Brandfetch',
3331
brex: 'Brex',
@@ -37,7 +35,6 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
3735
calcom: 'Cal.com',
3836
calendly: 'Calendly',
3937
cbinsights: 'CB Insights',
40-
chat_trigger: 'Chat',
4138
circleback: 'Circleback',
4239
clay: 'Clay',
4340
clerk: 'Clerk',
@@ -49,15 +46,13 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
4946
cloudwatch: 'CloudWatch',
5047
codepipeline: 'CodePipeline',
5148
condition: 'Condition',
52-
confluence: 'Confluence (Legacy)',
5349
confluence_v2: 'Confluence',
5450
context_dev: 'Context.dev',
5551
convex: 'Convex',
5652
credential: 'Credential',
5753
credential_group: 'Connected Accounts (Legacy)',
5854
crowdstrike: 'CrowdStrike',
5955
crunchbase: 'Crunchbase',
60-
cursor: 'Cursor (Legacy)',
6156
cursor_v2: 'Cursor',
6257
dagster: 'Dagster',
6358
databricks: 'Databricks',
@@ -69,11 +64,9 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
6964
discord: 'Discord',
7065
docusign: 'DocuSign',
7166
downdetector: 'Downdetector',
72-
dropbox: 'Dropbox (Legacy)',
7367
dropbox_v2: 'Dropbox',
7468
dropcontact: 'Dropcontact',
7569
dspy: 'DSPy',
76-
dub: 'Dub (Legacy)',
7770
dub_v2: 'Dub',
7871
duckduckgo: 'DuckDuckGo',
7972
dynamodb: 'Amazon DynamoDB',
@@ -87,33 +80,24 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
8780
enrow: 'Enrow',
8881
evaluator: 'Evaluator',
8982
exa: 'Exa',
90-
extend: 'Extend',
9183
extend_v2: 'Extend',
9284
fathom: 'Fathom',
93-
file: 'File (Legacy)',
94-
file_v2: 'File (Legacy)',
95-
file_v3: 'File',
96-
file_v4: 'File (Legacy)',
9785
file_v5: 'File',
9886
findymail: 'Findymail',
9987
firecrawl: 'Firecrawl',
100-
fireflies: 'Fireflies (Legacy)',
10188
fireflies_v2: 'Fireflies',
10289
flint: 'Flint',
10390
function: 'Function',
10491
gamma: 'Gamma',
10592
generic_webhook: 'Webhook Trigger',
106-
github: 'GitHub (Legacy)',
10793
github_v2: 'GitHub',
10894
gitlab: 'GitLab',
109-
gmail: 'Gmail (Legacy)',
11095
gmail_v2: 'Gmail',
11196
gong: 'Gong',
11297
google_ads: 'Google Ads',
11398
google_appsheet: 'Google AppSheet',
11499
google_bigquery: 'Google BigQuery',
115100
google_books: 'Google Books',
116-
google_calendar: 'Google Calendar (Legacy)',
117101
google_calendar_v2: 'Google Calendar',
118102
google_contacts: 'Google Contacts',
119103
google_docs: 'Google Docs',
@@ -124,15 +108,12 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
124108
google_meet: 'Google Meet',
125109
google_pagespeed: 'Google PageSpeed',
126110
google_search: 'Google Search',
127-
google_sheets: 'Google Sheets (Legacy)',
128111
google_sheets_v2: 'Google Sheets',
129-
google_slides: 'Google Slides (Legacy)',
130112
google_slides_v2: 'Google Slides',
131113
google_tasks: 'Google Tasks',
132114
google_translate: 'Google Translate',
133115
google_vault: 'Google Vault',
134116
grafana: 'Grafana',
135-
grain: 'Grain',
136117
grain_v2: 'Grain',
137118
granola: 'Granola',
138119
greenhouse: 'Greenhouse',
@@ -142,29 +123,23 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
142123
hex: 'Hex',
143124
hubspot: 'HubSpot',
144125
huggingface: 'Hugging Face',
145-
human_in_the_loop: 'Human',
146126
human_in_the_loop_v2: 'Human',
147127
hunter: 'Hunter.io',
148128
iam: 'AWS IAM',
149129
icypeas: 'Icypeas',
150130
identity_center: 'AWS Identity Center',
151-
image_generator: 'Image Generator',
152131
image_generator_v2: 'Image Generator',
153132
imap: 'IMAP Email',
154133
incidentio: 'incident.io',
155134
infisical: 'Infisical',
156-
input_trigger: 'Input Form (Legacy)',
157135
instagram: 'Instagram',
158136
instantly: 'Instantly',
159-
intercom: 'Intercom (Legacy)',
160137
intercom_v2: 'Intercom',
161138
jina: 'Jina',
162139
jira: 'Jira',
163140
jira_service_management: 'Jira Service Management',
164141
jotform: 'Jotform',
165-
jupyter: 'Jupyter (Legacy)',
166142
jupyter_v2: 'Jupyter',
167-
kalshi: 'Kalshi (Legacy)',
168143
kalshi_v2: 'Kalshi',
169144
ketch: 'Ketch',
170145
knowledge: 'Knowledge',
@@ -174,14 +149,12 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
174149
launchdarkly: 'LaunchDarkly',
175150
leadmagic: 'LeadMagic',
176151
lemlist: 'Lemlist',
177-
linear: 'Linear (Legacy)',
178152
linear_v2: 'Linear',
179153
linkedin: 'LinkedIn',
180154
linkup: 'Linkup',
181155
linq: 'Linq',
182156
logfire: 'Logfire',
183157
logrocket: 'LogRocket',
184-
logs: 'Logs',
185158
logs_v2: 'Logs',
186159
loop: 'Loop',
187160
loops: 'Loops',
@@ -190,23 +163,18 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
190163
mailgun: 'Mailgun',
191164
managed_agent: 'Claude Managed Agents',
192165
manageengine_sdp: 'ManageEngine ServiceDesk Plus',
193-
manual_trigger: 'Manual (Legacy)',
194166
mcp: 'MCP',
195167
mem0: 'Mem0',
196168
memory: 'Memory',
197169
microsoft_ad: 'Azure AD',
198-
microsoft_dataverse: 'Microsoft Dataverse (Legacy)',
199170
microsoft_dataverse_v2: 'Microsoft Dataverse',
200171
microsoft_dynamics_365: 'Microsoft Dynamics 365 CRM',
201-
microsoft_excel: 'Microsoft Excel (Legacy)',
202172
microsoft_excel_v2: 'Microsoft Excel',
203173
microsoft_planner: 'Microsoft Planner',
204174
microsoft_teams: 'Microsoft Teams',
205175
microsoft_word: 'Microsoft Word',
206176
millionverifier: 'MillionVerifier',
207177
mintlify: 'Mintlify',
208-
mistral_parse: 'Mistral Parser (Legacy)',
209-
mistral_parse_v2: 'Mistral Parser',
210178
mistral_parse_v3: 'Mistral Parser',
211179
modal: 'Modal',
212180
monday: 'Monday',
@@ -219,13 +187,11 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
219187
neverbounce: 'NeverBounce',
220188
new_relic: 'New Relic',
221189
note: 'Note',
222-
notion: 'Notion (Legacy)',
223190
notion_v2: 'Notion',
224191
obsidian: 'Obsidian',
225192
okta: 'Okta',
226193
onedrive: 'OneDrive',
227194
onepassword: '1Password',
228-
openai: 'Embeddings',
229195
outlook: 'Outlook',
230196
pagerduty: 'PagerDuty',
231197
parallel: 'Parallel',
@@ -242,28 +208,24 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
242208
posthog: 'PostHog',
243209
profound: 'Profound',
244210
prospeo: 'Prospeo',
245-
pulse: 'Pulse',
246211
pulse_v2: 'Pulse',
247212
qdrant: 'Qdrant',
248213
quartr: 'Quartr',
249214
quickbooks: 'QuickBooks',
250-
quiver: 'Quiver (Legacy)',
251215
quiver_v2: 'Quiver',
252216
rabbitmq: 'RabbitMQ',
253217
railway: 'Railway',
254218
rb2b: 'RB2B',
255219
rds: 'Amazon RDS',
256220
reddit: 'Reddit',
257221
redis: 'Redis',
258-
reducto: 'Reducto',
259222
reducto_v2: 'Reducto',
260223
resend: 'Resend',
261224
response: 'Response',
262225
revenuecat: 'RevenueCat',
263226
rippling: 'Rippling',
264227
rocketlane: 'Rocketlane',
265228
rootly: 'Rootly',
266-
router: 'Router (Legacy)',
267229
router_v2: 'Router',
268230
rss: 'RSS Feed',
269231
s3: 'S3',
@@ -279,18 +241,14 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
279241
sendgrid: 'SendGrid',
280242
sentry: 'Sentry',
281243
serper: 'Serper',
282-
servicenow: 'ServiceNow (Legacy)',
283244
servicenow_v2: 'ServiceNow',
284245
ses: 'AWS SES',
285-
sftp: 'SFTP (Legacy)',
286246
sftp_v2: 'SFTP',
287-
sharepoint: 'Sharepoint',
288247
sharepoint_v2: 'SharePoint',
289248
shopify: 'Shopify',
290249
sim_workspace_event: 'Sim Workspace Events',
291250
similarweb: 'Similarweb',
292251
sixtyfour: 'Sixtyfour AI',
293-
slack: 'Slack',
294252
slack_v2: 'Slack',
295253
smartlead: 'Smartlead',
296254
smtp: 'SMTP',
@@ -300,24 +258,19 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
300258
spotify: 'Spotify',
301259
sqs: 'Amazon SQS',
302260
square: 'Square',
303-
ssh: 'SSH (Legacy)',
304261
ssh_v2: 'SSH',
305262
ssm: 'AWS Systems Manager',
306263
stagehand: 'Stagehand',
307264
start_trigger: 'Start',
308-
starter: 'Starter',
309265
stripe: 'Stripe',
310266
sts: 'AWS STS',
311-
stt: 'Speech-to-Text',
312267
stt_v2: 'Speech-to-Text',
313268
supabase: 'Supabase',
314-
table: 'Table',
315269
table_v2: 'Table',
316270
tailscale: 'Tailscale',
317271
tavily: 'Tavily',
318272
telegram: 'Telegram',
319273
temporal: 'Temporal',
320-
textract: 'AWS Textract',
321274
textract_v2: 'AWS Textract',
322275
thinking: 'Thinking',
323276
thrive: 'Thrive',
@@ -336,8 +289,6 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
336289
vanta: 'Vanta',
337290
variables: 'Variables',
338291
vercel: 'Vercel',
339-
video_generator: 'Video Generator (Legacy)',
340-
video_generator_v2: 'Video Generator',
341292
video_generator_v3: 'Video Generator',
342293
vision: 'Vision (Legacy)',
343294
vision_v2: 'Vision',
@@ -351,7 +302,6 @@ export const BLOCK_NAMES: Readonly<Record<string, string>> = {
351302
wiza: 'Wiza',
352303
wordpress: 'WordPress',
353304
workday: 'Workday',
354-
workflow: 'Workflow',
355305
workflow_input: 'Workflow',
356306
x: 'X',
357307
youtube: 'YouTube',

0 commit comments

Comments
 (0)