Skip to content

Commit 88cfe0c

Browse files
waleedlatif1claude
andcommitted
fix(google-ads): use centralized scope utilities and add type re-export
- Replace hardcoded scopes in auth.ts with getCanonicalScopesForProvider('google-ads') - Replace hardcoded requiredScopes in block with getScopesForService('google-ads') - Add type re-export from index.ts barrel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dc21bfe commit 88cfe0c

File tree

4 files changed

+43
-12
lines changed

4 files changed

+43
-12
lines changed

apps/docs/components/ui/icon-mapping.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ import {
99
AirtableIcon,
1010
AirweaveIcon,
1111
AlgoliaIcon,
12+
AmplitudeIcon,
1213
ApifyIcon,
1314
ApolloIcon,
1415
ArxivIcon,
1516
AsanaIcon,
17+
AshbyIcon,
1618
AttioIcon,
1719
BrainIcon,
20+
BrandfetchIcon,
1821
BrowserUseIcon,
1922
CalComIcon,
2023
CalendlyIcon,
@@ -24,42 +27,51 @@ import {
2427
CloudflareIcon,
2528
ConfluenceIcon,
2629
CursorIcon,
30+
DatabricksIcon,
2731
DatadogIcon,
2832
DevinIcon,
2933
DiscordIcon,
3034
DocumentIcon,
3135
DropboxIcon,
3236
DsPyIcon,
37+
DubIcon,
3338
DuckDuckGoIcon,
3439
DynamoDBIcon,
3540
ElasticsearchIcon,
3641
ElevenLabsIcon,
3742
EnrichSoIcon,
43+
EvernoteIcon,
3844
ExaAIIcon,
3945
EyeIcon,
46+
FathomIcon,
4047
FirecrawlIcon,
4148
FirefliesIcon,
42-
GitLabIcon,
49+
GammaIcon,
4350
GithubIcon,
51+
GitLabIcon,
4452
GmailIcon,
4553
GongIcon,
4654
GoogleAdsIcon,
4755
GoogleBigQueryIcon,
4856
GoogleBooksIcon,
4957
GoogleCalendarIcon,
58+
GoogleContactsIcon,
5059
GoogleDocsIcon,
5160
GoogleDriveIcon,
5261
GoogleFormsIcon,
5362
GoogleGroupsIcon,
5463
GoogleIcon,
5564
GoogleMapsIcon,
65+
GoogleMeetIcon,
66+
GooglePagespeedIcon,
5667
GoogleSheetsIcon,
5768
GoogleSlidesIcon,
5869
GoogleTasksIcon,
5970
GoogleTranslateIcon,
6071
GoogleVaultIcon,
6172
GrafanaIcon,
6273
GrainIcon,
74+
GreenhouseIcon,
6375
GreptileIcon,
6476
HexIcon,
6577
HubspotIcon,
@@ -77,9 +89,11 @@ import {
7789
LinearIcon,
7890
LinkedInIcon,
7991
LinkupIcon,
80-
MailServerIcon,
92+
LoopsIcon,
93+
LumaIcon,
8194
MailchimpIcon,
8295
MailgunIcon,
96+
MailServerIcon,
8397
Mem0Icon,
8498
MicrosoftDataverseIcon,
8599
MicrosoftExcelIcon,
@@ -92,10 +106,12 @@ import {
92106
MySQLIcon,
93107
Neo4jIcon,
94108
NotionIcon,
109+
ObsidianIcon,
95110
OnePasswordIcon,
96111
OpenAIIcon,
97112
OutlookIcon,
98113
PackageSearchIcon,
114+
PagerDutyIcon,
99115
ParallelIcon,
100116
PerplexityIcon,
101117
PineconeIcon,
@@ -112,8 +128,6 @@ import {
112128
ResendIcon,
113129
RevenueCatIcon,
114130
S3Icon,
115-
SQSIcon,
116-
STTIcon,
117131
SalesforceIcon,
118132
SearchIcon,
119133
SendgridIcon,
@@ -125,17 +139,19 @@ import {
125139
SimilarwebIcon,
126140
SlackIcon,
127141
SmtpIcon,
142+
SQSIcon,
128143
SshIcon,
144+
STTIcon,
129145
StagehandIcon,
130146
StripeIcon,
131147
SupabaseIcon,
132-
TTSIcon,
133148
TavilyIcon,
134149
TelegramIcon,
135150
TextractIcon,
136151
TinybirdIcon,
137152
TranslateIcon,
138153
TrelloIcon,
154+
TTSIcon,
139155
TwilioIcon,
140156
TypeformIcon,
141157
UpstashIcon,
@@ -146,11 +162,11 @@ import {
146162
WhatsAppIcon,
147163
WikipediaIcon,
148164
WordpressIcon,
165+
xIcon,
149166
YouTubeIcon,
150167
ZendeskIcon,
151168
ZepIcon,
152169
ZoomIcon,
153-
xIcon,
154170
} from '@/components/icons'
155171

156172
type IconComponent = ComponentType<SVGProps<SVGSVGElement>>
@@ -161,11 +177,14 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
161177
airtable: AirtableIcon,
162178
airweave: AirweaveIcon,
163179
algolia: AlgoliaIcon,
180+
amplitude: AmplitudeIcon,
164181
apify: ApifyIcon,
165182
apollo: ApolloIcon,
166183
arxiv: ArxivIcon,
167184
asana: AsanaIcon,
185+
ashby: AshbyIcon,
168186
attio: AttioIcon,
187+
brandfetch: BrandfetchIcon,
169188
browser_use: BrowserUseIcon,
170189
calcom: CalComIcon,
171190
calendly: CalendlyIcon,
@@ -175,20 +194,25 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
175194
cloudflare: CloudflareIcon,
176195
confluence_v2: ConfluenceIcon,
177196
cursor_v2: CursorIcon,
197+
databricks: DatabricksIcon,
178198
datadog: DatadogIcon,
179199
devin: DevinIcon,
180200
discord: DiscordIcon,
181201
dropbox: DropboxIcon,
182202
dspy: DsPyIcon,
203+
dub: DubIcon,
183204
duckduckgo: DuckDuckGoIcon,
184205
dynamodb: DynamoDBIcon,
185206
elasticsearch: ElasticsearchIcon,
186207
elevenlabs: ElevenLabsIcon,
187208
enrich: EnrichSoIcon,
209+
evernote: EvernoteIcon,
188210
exa: ExaAIIcon,
211+
fathom: FathomIcon,
189212
file_v3: DocumentIcon,
190213
firecrawl: FirecrawlIcon,
191214
fireflies_v2: FirefliesIcon,
215+
gamma: GammaIcon,
192216
github_v2: GithubIcon,
193217
gitlab: GitLabIcon,
194218
gmail_v2: GmailIcon,
@@ -197,11 +221,14 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
197221
google_bigquery: GoogleBigQueryIcon,
198222
google_books: GoogleBooksIcon,
199223
google_calendar_v2: GoogleCalendarIcon,
224+
google_contacts: GoogleContactsIcon,
200225
google_docs: GoogleDocsIcon,
201226
google_drive: GoogleDriveIcon,
202227
google_forms: GoogleFormsIcon,
203228
google_groups: GoogleGroupsIcon,
204229
google_maps: GoogleMapsIcon,
230+
google_meet: GoogleMeetIcon,
231+
google_pagespeed: GooglePagespeedIcon,
205232
google_search: GoogleIcon,
206233
google_sheets_v2: GoogleSheetsIcon,
207234
google_slides_v2: GoogleSlidesIcon,
@@ -210,6 +237,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
210237
google_vault: GoogleVaultIcon,
211238
grafana: GrafanaIcon,
212239
grain: GrainIcon,
240+
greenhouse: GreenhouseIcon,
213241
greptile: GreptileIcon,
214242
hex: HexIcon,
215243
hubspot: HubspotIcon,
@@ -229,6 +257,8 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
229257
linear: LinearIcon,
230258
linkedin: LinkedInIcon,
231259
linkup: LinkupIcon,
260+
loops: LoopsIcon,
261+
luma: LumaIcon,
232262
mailchimp: MailchimpIcon,
233263
mailgun: MailgunIcon,
234264
mem0: Mem0Icon,
@@ -242,10 +272,12 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
242272
mysql: MySQLIcon,
243273
neo4j: Neo4jIcon,
244274
notion_v2: NotionIcon,
275+
obsidian: ObsidianIcon,
245276
onedrive: MicrosoftOneDriveIcon,
246277
onepassword: OnePasswordIcon,
247278
openai: OpenAIIcon,
248279
outlook: OutlookIcon,
280+
pagerduty: PagerDutyIcon,
249281
parallel_ai: ParallelIcon,
250282
perplexity: PerplexityIcon,
251283
pinecone: PineconeIcon,

apps/sim/blocks/blocks/google_ads.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { GoogleAdsIcon } from '@/components/icons'
2+
import { getScopesForService } from '@/lib/oauth/utils'
23
import type { BlockConfig } from '@/blocks/types'
34
import { AuthMode } from '@/blocks/types'
45

@@ -37,7 +38,7 @@ export const GoogleAdsBlock: BlockConfig = {
3738
mode: 'basic',
3839
required: true,
3940
serviceId: 'google-ads',
40-
requiredScopes: ['https://www.googleapis.com/auth/adwords'],
41+
requiredScopes: getScopesForService('google-ads'),
4142
placeholder: 'Select Google Ads account',
4243
},
4344
{

apps/sim/lib/auth/auth.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,7 @@ export const auth = betterAuth({
10151015
clientSecret: env.GOOGLE_CLIENT_SECRET as string,
10161016
discoveryUrl: 'https://accounts.google.com/.well-known/openid-configuration',
10171017
accessType: 'offline',
1018-
scopes: [
1019-
'https://www.googleapis.com/auth/userinfo.email',
1020-
'https://www.googleapis.com/auth/userinfo.profile',
1021-
'https://www.googleapis.com/auth/adwords',
1022-
],
1018+
scopes: getCanonicalScopesForProvider('google-ads'),
10231019
prompt: 'consent',
10241020
redirectURI: `${getBaseUrl()}/api/auth/oauth2/callback/google-ads`,
10251021
getUserInfo: async (tokens) => {

apps/sim/tools/google_ads/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ export {
1313
googleAdsListCustomersTool,
1414
googleAdsSearchTool,
1515
}
16+
17+
export * from './types'

0 commit comments

Comments
 (0)