Skip to content

Commit 7164580

Browse files
committed
make selector keys declarative
1 parent 77633a7 commit 7164580

22 files changed

+85
-204
lines changed

apps/sim/blocks/blocks/confluence.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
103103
type: 'file-selector',
104104
canonicalParamId: 'pageId',
105105
serviceId: 'confluence',
106+
selectorKey: 'confluence.pages',
106107
placeholder: 'Select Confluence page',
107108
dependsOn: ['credential', 'domain'],
108109
mode: 'basic',
@@ -498,6 +499,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
498499
type: 'file-selector',
499500
canonicalParamId: 'pageId',
500501
serviceId: 'confluence',
502+
selectorKey: 'confluence.pages',
501503
placeholder: 'Select Confluence page',
502504
dependsOn: ['credential', 'domain'],
503505
mode: 'basic',

apps/sim/blocks/blocks/gmail.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ Return ONLY the email body - no explanations, no extra text.`,
221221
type: 'folder-selector',
222222
canonicalParamId: 'folder',
223223
serviceId: 'gmail',
224+
selectorKey: 'gmail.labels',
224225
requiredScopes: ['https://www.googleapis.com/auth/gmail.labels'],
225226
placeholder: 'Select Gmail label/folder',
226227
dependsOn: ['credential'],
@@ -301,6 +302,7 @@ Return ONLY the search query - no explanations, no extra text.`,
301302
type: 'folder-selector',
302303
canonicalParamId: 'addLabelIds',
303304
serviceId: 'gmail',
305+
selectorKey: 'gmail.labels',
304306
requiredScopes: ['https://www.googleapis.com/auth/gmail.labels'],
305307
placeholder: 'Select destination label',
306308
dependsOn: ['credential'],
@@ -326,6 +328,7 @@ Return ONLY the search query - no explanations, no extra text.`,
326328
type: 'folder-selector',
327329
canonicalParamId: 'removeLabelIds',
328330
serviceId: 'gmail',
331+
selectorKey: 'gmail.labels',
329332
requiredScopes: ['https://www.googleapis.com/auth/gmail.labels'],
330333
placeholder: 'Select label to remove',
331334
dependsOn: ['credential'],
@@ -378,6 +381,7 @@ Return ONLY the search query - no explanations, no extra text.`,
378381
type: 'folder-selector',
379382
canonicalParamId: 'manageLabelId',
380383
serviceId: 'gmail',
384+
selectorKey: 'gmail.labels',
381385
requiredScopes: ['https://www.googleapis.com/auth/gmail.labels'],
382386
placeholder: 'Select label',
383387
dependsOn: ['credential'],

apps/sim/blocks/blocks/google_calendar.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
6262
type: 'file-selector',
6363
canonicalParamId: 'calendarId',
6464
serviceId: 'google-calendar',
65+
selectorKey: 'google.calendar',
66+
selectorAllowSearch: false,
6567
requiredScopes: ['https://www.googleapis.com/auth/calendar'],
6668
placeholder: 'Select calendar',
6769
dependsOn: ['credential'],
@@ -326,6 +328,8 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
326328
type: 'file-selector',
327329
canonicalParamId: 'destinationCalendarId',
328330
serviceId: 'google-calendar',
331+
selectorKey: 'google.calendar',
332+
selectorAllowSearch: false,
329333
requiredScopes: ['https://www.googleapis.com/auth/calendar'],
330334
placeholder: 'Select destination calendar',
331335
dependsOn: ['credential'],

apps/sim/blocks/blocks/google_docs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
5858
type: 'file-selector',
5959
canonicalParamId: 'documentId',
6060
serviceId: 'google-docs',
61+
selectorKey: 'google.drive',
6162
requiredScopes: [],
6263
mimeType: 'application/vnd.google-apps.document',
6364
placeholder: 'Select a document',
@@ -100,6 +101,7 @@ Return ONLY the document title - no explanations, no extra text.`,
100101
type: 'file-selector',
101102
canonicalParamId: 'folderId',
102103
serviceId: 'google-docs',
104+
selectorKey: 'google.drive',
103105
requiredScopes: [],
104106
mimeType: 'application/vnd.google-apps.folder',
105107
placeholder: 'Select a parent folder',

apps/sim/blocks/blocks/google_drive.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr
137137
type: 'file-selector',
138138
canonicalParamId: 'uploadFolderId',
139139
serviceId: 'google-drive',
140+
selectorKey: 'google.drive',
140141
requiredScopes: [
141142
'https://www.googleapis.com/auth/drive.file',
142143
'https://www.googleapis.com/auth/drive',
@@ -209,6 +210,7 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr
209210
type: 'file-selector',
210211
canonicalParamId: 'createFolderParentId',
211212
serviceId: 'google-drive',
213+
selectorKey: 'google.drive',
212214
requiredScopes: [
213215
'https://www.googleapis.com/auth/drive.file',
214216
'https://www.googleapis.com/auth/drive',
@@ -236,6 +238,7 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr
236238
type: 'file-selector',
237239
canonicalParamId: 'listFolderId',
238240
serviceId: 'google-drive',
241+
selectorKey: 'google.drive',
239242
requiredScopes: [
240243
'https://www.googleapis.com/auth/drive.file',
241244
'https://www.googleapis.com/auth/drive',
@@ -295,6 +298,7 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
295298
type: 'file-selector',
296299
canonicalParamId: 'downloadFileId',
297300
serviceId: 'google-drive',
301+
selectorKey: 'google.drive',
298302
requiredScopes: [
299303
'https://www.googleapis.com/auth/drive.file',
300304
'https://www.googleapis.com/auth/drive',
@@ -356,6 +360,7 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
356360
type: 'file-selector',
357361
canonicalParamId: 'getFileId',
358362
serviceId: 'google-drive',
363+
selectorKey: 'google.drive',
359364
requiredScopes: [
360365
'https://www.googleapis.com/auth/drive.file',
361366
'https://www.googleapis.com/auth/drive',
@@ -383,6 +388,7 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
383388
type: 'file-selector',
384389
canonicalParamId: 'copyFileId',
385390
serviceId: 'google-drive',
391+
selectorKey: 'google.drive',
386392
requiredScopes: [
387393
'https://www.googleapis.com/auth/drive.file',
388394
'https://www.googleapis.com/auth/drive',
@@ -416,6 +422,7 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
416422
type: 'file-selector',
417423
canonicalParamId: 'copyDestFolderId',
418424
serviceId: 'google-drive',
425+
selectorKey: 'google.drive',
419426
requiredScopes: [
420427
'https://www.googleapis.com/auth/drive.file',
421428
'https://www.googleapis.com/auth/drive',
@@ -442,6 +449,7 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
442449
type: 'file-selector',
443450
canonicalParamId: 'updateFileId',
444451
serviceId: 'google-drive',
452+
selectorKey: 'google.drive',
445453
requiredScopes: [
446454
'https://www.googleapis.com/auth/drive.file',
447455
'https://www.googleapis.com/auth/drive',
@@ -520,6 +528,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
520528
type: 'file-selector',
521529
canonicalParamId: 'trashFileId',
522530
serviceId: 'google-drive',
531+
selectorKey: 'google.drive',
523532
requiredScopes: [
524533
'https://www.googleapis.com/auth/drive.file',
525534
'https://www.googleapis.com/auth/drive',
@@ -547,6 +556,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
547556
type: 'file-selector',
548557
canonicalParamId: 'deleteFileId',
549558
serviceId: 'google-drive',
559+
selectorKey: 'google.drive',
550560
requiredScopes: [
551561
'https://www.googleapis.com/auth/drive.file',
552562
'https://www.googleapis.com/auth/drive',
@@ -574,6 +584,7 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`,
574584
type: 'file-selector',
575585
canonicalParamId: 'shareFileId',
576586
serviceId: 'google-drive',
587+
selectorKey: 'google.drive',
577588
requiredScopes: [
578589
'https://www.googleapis.com/auth/drive.file',
579590
'https://www.googleapis.com/auth/drive',
@@ -688,6 +699,7 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr
688699
type: 'file-selector',
689700
canonicalParamId: 'unshareFileId',
690701
serviceId: 'google-drive',
702+
selectorKey: 'google.drive',
691703
requiredScopes: [
692704
'https://www.googleapis.com/auth/drive.file',
693705
'https://www.googleapis.com/auth/drive',
@@ -723,6 +735,7 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr
723735
type: 'file-selector',
724736
canonicalParamId: 'listPermissionsFileId',
725737
serviceId: 'google-drive',
738+
selectorKey: 'google.drive',
726739
requiredScopes: [
727740
'https://www.googleapis.com/auth/drive.file',
728741
'https://www.googleapis.com/auth/drive',

apps/sim/blocks/blocks/google_forms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const GoogleFormsBlock: BlockConfig = {
6464
canonicalParamId: 'formId',
6565
required: true,
6666
serviceId: 'google-forms',
67+
selectorKey: 'google.drive',
6768
requiredScopes: [],
6869
mimeType: 'application/vnd.google-apps.form',
6970
placeholder: 'Select a form',

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
6262
type: 'file-selector',
6363
canonicalParamId: 'spreadsheetId',
6464
serviceId: 'google-sheets',
65+
selectorKey: 'google.drive',
6566
requiredScopes: [
6667
'https://www.googleapis.com/auth/drive.file',
6768
'https://www.googleapis.com/auth/drive',
@@ -360,6 +361,7 @@ export const GoogleSheetsV2Block: BlockConfig<GoogleSheetsV2Response> = {
360361
type: 'file-selector',
361362
canonicalParamId: 'spreadsheetId',
362363
serviceId: 'google-sheets',
364+
selectorKey: 'google.drive',
363365
requiredScopes: [
364366
'https://www.googleapis.com/auth/drive.file',
365367
'https://www.googleapis.com/auth/drive',
@@ -388,6 +390,8 @@ export const GoogleSheetsV2Block: BlockConfig<GoogleSheetsV2Response> = {
388390
type: 'sheet-selector',
389391
canonicalParamId: 'sheetName',
390392
serviceId: 'google-sheets',
393+
selectorKey: 'google.sheets',
394+
selectorAllowSearch: false,
391395
placeholder: 'Select a sheet',
392396
required: true,
393397
dependsOn: { all: ['credential'], any: ['spreadsheetId', 'manualSpreadsheetId'] },

apps/sim/blocks/blocks/google_slides.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
7272
type: 'file-selector',
7373
canonicalParamId: 'presentationId',
7474
serviceId: 'google-drive',
75+
selectorKey: 'google.drive',
7576
requiredScopes: [],
7677
mimeType: 'application/vnd.google-apps.presentation',
7778
placeholder: 'Select a presentation',
@@ -185,6 +186,7 @@ Return ONLY the title - no explanations, no quotes, no extra text.`,
185186
type: 'file-selector',
186187
canonicalParamId: 'folderId',
187188
serviceId: 'google-drive',
189+
selectorKey: 'google.drive',
188190
requiredScopes: [],
189191
mimeType: 'application/vnd.google-apps.folder',
190192
placeholder: 'Select a parent folder',

apps/sim/blocks/blocks/jira.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
114114
type: 'project-selector',
115115
canonicalParamId: 'projectId',
116116
serviceId: 'jira',
117+
selectorKey: 'jira.projects',
117118
placeholder: 'Select Jira project',
118119
dependsOn: ['credential', 'domain'],
119120
mode: 'basic',
@@ -137,6 +138,7 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
137138
type: 'file-selector',
138139
canonicalParamId: 'issueKey',
139140
serviceId: 'jira',
141+
selectorKey: 'jira.issues',
140142
placeholder: 'Select Jira issue',
141143
dependsOn: ['credential', 'domain', 'projectId'],
142144
condition: {

apps/sim/blocks/blocks/knowledge.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const KnowledgeBlock: BlockConfig = {
7575
id: 'documentId',
7676
title: 'Document',
7777
type: 'document-selector',
78+
selectorKey: 'knowledge.documents',
7879
placeholder: 'Select document',
7980
dependsOn: ['knowledgeBaseId'],
8081
required: true,

0 commit comments

Comments
 (0)