@bubblelab/shared-schemas 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/agent-memory.d.ts +21 -0
  2. package/dist/agent-memory.d.ts.map +1 -0
  3. package/dist/agent-memory.js +11 -0
  4. package/dist/agent-memory.js.map +1 -0
  5. package/dist/ai-models.d.ts +1 -1
  6. package/dist/ai-models.d.ts.map +1 -1
  7. package/dist/ai-models.js +12 -0
  8. package/dist/ai-models.js.map +1 -1
  9. package/dist/api-schema.d.ts +2 -2
  10. package/dist/bubble-definition-schema.d.ts +559 -75
  11. package/dist/bubble-definition-schema.d.ts.map +1 -1
  12. package/dist/bubble-definition-schema.js +186 -0
  13. package/dist/bubble-definition-schema.js.map +1 -1
  14. package/dist/bubbleflow-execution-schema.d.ts +594 -147
  15. package/dist/bubbleflow-execution-schema.d.ts.map +1 -1
  16. package/dist/bubbleflow-execution-schema.js +46 -26
  17. package/dist/bubbleflow-execution-schema.js.map +1 -1
  18. package/dist/bubbleflow-generation-prompts.d.ts +5 -16
  19. package/dist/bubbleflow-generation-prompts.d.ts.map +1 -1
  20. package/dist/bubbleflow-generation-prompts.js +14 -54
  21. package/dist/bubbleflow-generation-prompts.js.map +1 -1
  22. package/dist/bubbleflow-schema.d.ts +1081 -92
  23. package/dist/bubbleflow-schema.d.ts.map +1 -1
  24. package/dist/bubbleflow-schema.js +94 -4
  25. package/dist/bubbleflow-schema.js.map +1 -1
  26. package/dist/coffee.d.ts +2201 -0
  27. package/dist/coffee.d.ts.map +1 -0
  28. package/dist/coffee.js +257 -0
  29. package/dist/coffee.js.map +1 -0
  30. package/dist/credential-schema.d.ts +172 -3
  31. package/dist/credential-schema.d.ts.map +1 -1
  32. package/dist/credential-schema.js +509 -5
  33. package/dist/credential-schema.js.map +1 -1
  34. package/dist/database-definition-schema.d.ts +8 -8
  35. package/dist/error-enhancer.d.ts +6 -0
  36. package/dist/error-enhancer.d.ts.map +1 -0
  37. package/dist/error-enhancer.js +88 -0
  38. package/dist/error-enhancer.js.map +1 -0
  39. package/dist/generate-bubbleflow-schema.d.ts +974 -52
  40. package/dist/generate-bubbleflow-schema.d.ts.map +1 -1
  41. package/dist/generate-bubbleflow-schema.js +23 -7
  42. package/dist/generate-bubbleflow-schema.js.map +1 -1
  43. package/dist/hash-utils.d.ts +26 -0
  44. package/dist/hash-utils.d.ts.map +1 -0
  45. package/dist/hash-utils.js +37 -0
  46. package/dist/hash-utils.js.map +1 -0
  47. package/dist/index.d.ts +7 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +7 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/milk-tea.d.ts +22 -24
  52. package/dist/milk-tea.d.ts.map +1 -1
  53. package/dist/milk-tea.js +1 -4
  54. package/dist/milk-tea.js.map +1 -1
  55. package/dist/oauth-schema.d.ts +2 -2
  56. package/dist/param-utils.d.ts +10 -0
  57. package/dist/param-utils.d.ts.map +1 -0
  58. package/dist/param-utils.js +13 -0
  59. package/dist/param-utils.js.map +1 -0
  60. package/dist/pearl.d.ts +96 -29
  61. package/dist/pearl.d.ts.map +1 -1
  62. package/dist/pearl.js +20 -9
  63. package/dist/pearl.js.map +1 -1
  64. package/dist/rice.d.ts +100 -0
  65. package/dist/rice.d.ts.map +1 -0
  66. package/dist/rice.js +65 -0
  67. package/dist/rice.js.map +1 -0
  68. package/dist/storage-utils.d.ts +19 -0
  69. package/dist/storage-utils.d.ts.map +1 -0
  70. package/dist/storage-utils.js +54 -0
  71. package/dist/storage-utils.js.map +1 -0
  72. package/dist/streaming-events.d.ts +36 -2
  73. package/dist/streaming-events.d.ts.map +1 -1
  74. package/dist/subscription-status-schema.d.ts +192 -32
  75. package/dist/subscription-status-schema.d.ts.map +1 -1
  76. package/dist/subscription-status-schema.js +85 -7
  77. package/dist/subscription-status-schema.js.map +1 -1
  78. package/dist/trigger.d.ts +45 -51
  79. package/dist/trigger.d.ts.map +1 -1
  80. package/dist/trigger.js +0 -2
  81. package/dist/trigger.js.map +1 -1
  82. package/dist/types.d.ts +13 -2
  83. package/dist/types.d.ts.map +1 -1
  84. package/dist/types.js +18 -0
  85. package/dist/types.js.map +1 -1
  86. package/package.json +1 -1
  87. package/dist/general-chat.d.ts +0 -81
  88. package/dist/general-chat.d.ts.map +0 -1
  89. package/dist/general-chat.js +0 -58
  90. package/dist/general-chat.js.map +0 -1
  91. package/dist/generation-result-schema.d.ts +0 -73
  92. package/dist/generation-result-schema.d.ts.map +0 -1
  93. package/dist/generation-result-schema.js +0 -55
  94. package/dist/generation-result-schema.js.map +0 -1
  95. package/dist/mock-data-generator.test.d.ts +0 -2
  96. package/dist/mock-data-generator.test.d.ts.map +0 -1
  97. package/dist/mock-data-generator.test.js +0 -176
  98. package/dist/mock-data-generator.test.js.map +0 -1
@@ -1,6 +1,238 @@
1
1
  import { CredentialType } from './types.js';
2
2
  import { z } from '@hono/zod-openapi';
3
3
  import { databaseMetadataSchema } from './database-definition-schema.js';
4
+ /**
5
+ * Configuration for all credential types - used by Credentials page and AI agents
6
+ */
7
+ export const CREDENTIAL_TYPE_CONFIG = {
8
+ [CredentialType.OPENAI_CRED]: {
9
+ label: 'OpenAI',
10
+ description: 'API key for OpenAI services (GPT models, embeddings, etc.)',
11
+ placeholder: 'sk-...',
12
+ namePlaceholder: 'My OpenAI API Key',
13
+ credentialConfigurations: {},
14
+ },
15
+ [CredentialType.GOOGLE_GEMINI_CRED]: {
16
+ label: 'Google Gemini',
17
+ description: 'API key for Google Gemini AI models',
18
+ placeholder: 'AIza...',
19
+ namePlaceholder: 'My Google Gemini Key',
20
+ credentialConfigurations: {
21
+ ignoreSSL: false,
22
+ },
23
+ },
24
+ [CredentialType.ANTHROPIC_CRED]: {
25
+ label: 'Anthropic',
26
+ description: 'API key for Anthropic Claude models',
27
+ placeholder: 'sk-ant-...',
28
+ namePlaceholder: 'My Anthropic API Key',
29
+ credentialConfigurations: {
30
+ ignoreSSL: false,
31
+ },
32
+ },
33
+ [CredentialType.DATABASE_CRED]: {
34
+ label: 'Database (PostgreSQL)',
35
+ description: 'Database connection string for PostgreSQL',
36
+ placeholder: 'postgresql://user:pass@host:port/dbname',
37
+ namePlaceholder: 'My PostgreSQL Database',
38
+ credentialConfigurations: {
39
+ ignoreSSL: false,
40
+ },
41
+ },
42
+ [CredentialType.FIRECRAWL_API_KEY]: {
43
+ label: 'Firecrawl',
44
+ description: 'API key for Firecrawl web scraping and search services',
45
+ placeholder: 'fc-...',
46
+ namePlaceholder: 'My Firecrawl API Key',
47
+ credentialConfigurations: {
48
+ ignoreSSL: false,
49
+ },
50
+ },
51
+ [CredentialType.SLACK_CRED]: {
52
+ label: 'Slack',
53
+ description: 'Slack Bot token (xoxb-) or User token (xoxp-) from api.slack.com/apps. Configure scopes in OAuth & Permissions.',
54
+ placeholder: 'xoxb-... or xoxp-...',
55
+ namePlaceholder: 'My Slack Token',
56
+ credentialConfigurations: {
57
+ ignoreSSL: false,
58
+ },
59
+ },
60
+ [CredentialType.RESEND_CRED]: {
61
+ label: 'Resend',
62
+ description: 'Your Resend API key for email services',
63
+ placeholder: 're_...',
64
+ namePlaceholder: 'My Resend API Key',
65
+ credentialConfigurations: {
66
+ ignoreSSL: false,
67
+ },
68
+ },
69
+ [CredentialType.OPENROUTER_CRED]: {
70
+ label: 'OpenRouter',
71
+ description: 'API key for OpenRouter services',
72
+ placeholder: 'sk-or-...',
73
+ namePlaceholder: 'My OpenRouter API Key',
74
+ credentialConfigurations: {
75
+ ignoreSSL: false,
76
+ },
77
+ },
78
+ [CredentialType.CLOUDFLARE_R2_ACCESS_KEY]: {
79
+ label: 'Cloudflare R2 Access Key',
80
+ description: 'Access key for Cloudflare R2 storage',
81
+ placeholder: 'Enter your access key',
82
+ namePlaceholder: 'My R2 Access Key',
83
+ credentialConfigurations: {
84
+ ignoreSSL: false,
85
+ },
86
+ },
87
+ [CredentialType.CLOUDFLARE_R2_SECRET_KEY]: {
88
+ label: 'Cloudflare R2 Secret Key',
89
+ description: 'Secret key for Cloudflare R2 storage',
90
+ placeholder: 'Enter your secret key',
91
+ namePlaceholder: 'My R2 Secret Key',
92
+ credentialConfigurations: {
93
+ ignoreSSL: false,
94
+ },
95
+ },
96
+ [CredentialType.CLOUDFLARE_R2_ACCOUNT_ID]: {
97
+ label: 'Cloudflare R2 Account ID',
98
+ description: 'Account ID for Cloudflare R2 storage',
99
+ placeholder: 'Enter your account ID',
100
+ namePlaceholder: 'My R2 Account ID',
101
+ credentialConfigurations: {
102
+ ignoreSSL: false,
103
+ },
104
+ },
105
+ [CredentialType.APIFY_CRED]: {
106
+ label: 'Apify',
107
+ description: 'API token for Apify platform (web scraping, automation)',
108
+ placeholder: 'apify_api_...',
109
+ namePlaceholder: 'My Apify API Token',
110
+ credentialConfigurations: {},
111
+ },
112
+ [CredentialType.GOOGLE_DRIVE_CRED]: {
113
+ label: 'Google Drive',
114
+ description: 'OAuth connection to Google Drive for file access',
115
+ placeholder: '', // Not used for OAuth
116
+ namePlaceholder: 'My Google Drive Connection',
117
+ credentialConfigurations: {
118
+ ignoreSSL: false,
119
+ },
120
+ },
121
+ [CredentialType.GMAIL_CRED]: {
122
+ label: 'Gmail',
123
+ description: 'OAuth connection to Gmail for email management',
124
+ placeholder: '', // Not used for OAuth
125
+ namePlaceholder: 'My Gmail Connection',
126
+ credentialConfigurations: {
127
+ ignoreSSL: false,
128
+ },
129
+ },
130
+ [CredentialType.GOOGLE_SHEETS_CRED]: {
131
+ label: 'Google Sheets',
132
+ description: 'OAuth connection to Google Sheets for spreadsheet management',
133
+ placeholder: '', // Not used for OAuth
134
+ namePlaceholder: 'My Google Sheets Connection',
135
+ credentialConfigurations: {
136
+ ignoreSSL: false,
137
+ },
138
+ },
139
+ [CredentialType.GOOGLE_CALENDAR_CRED]: {
140
+ label: 'Google Calendar',
141
+ description: 'OAuth connection to Google Calendar for events and schedules',
142
+ placeholder: '', // Not used for OAuth
143
+ namePlaceholder: 'My Google Calendar Connection',
144
+ credentialConfigurations: {
145
+ ignoreSSL: false,
146
+ },
147
+ },
148
+ [CredentialType.FUB_CRED]: {
149
+ label: 'Follow Up Boss',
150
+ description: 'OAuth connection to Follow Up Boss CRM for contacts, tasks, and deals',
151
+ placeholder: '', // Not used for OAuth
152
+ namePlaceholder: 'My Follow Up Boss Connection',
153
+ credentialConfigurations: {},
154
+ },
155
+ [CredentialType.NOTION_OAUTH_TOKEN]: {
156
+ label: 'Notion',
157
+ description: 'OAuth connection to your Notion workspace (pages, databases, search)',
158
+ placeholder: '', // Not used for OAuth
159
+ namePlaceholder: 'My Notion Connection',
160
+ credentialConfigurations: {},
161
+ },
162
+ [CredentialType.GITHUB_TOKEN]: {
163
+ label: 'GitHub',
164
+ description: 'Personal Access Token for GitHub API (read repos, PRs, issues)',
165
+ placeholder: 'github_pat...',
166
+ namePlaceholder: 'My GitHub Token',
167
+ credentialConfigurations: {},
168
+ },
169
+ [CredentialType.ELEVENLABS_API_KEY]: {
170
+ label: 'Eleven Labs API Key',
171
+ description: 'Your API key from Eleven Labs',
172
+ placeholder: 'agent_...',
173
+ namePlaceholder: 'My Eleven Labs Key',
174
+ credentialConfigurations: {},
175
+ },
176
+ [CredentialType.AGI_API_KEY]: {
177
+ label: 'AGI Inc API Key',
178
+ description: 'Your API key from AGI Inc',
179
+ placeholder: 'api_...',
180
+ namePlaceholder: 'My AGI Inc Key',
181
+ credentialConfigurations: {},
182
+ },
183
+ [CredentialType.TELEGRAM_BOT_TOKEN]: {
184
+ label: 'Telegram Bot Token',
185
+ description: 'Your Telegram bot token',
186
+ placeholder: 'bot_...',
187
+ namePlaceholder: 'My Telegram Bot Token',
188
+ credentialConfigurations: {},
189
+ },
190
+ [CredentialType.AIRTABLE_CRED]: {
191
+ label: 'Airtable',
192
+ description: 'Personal Access Token for Airtable API (manage bases, tables, records)',
193
+ placeholder: 'pat...',
194
+ namePlaceholder: 'My Airtable Token',
195
+ credentialConfigurations: {},
196
+ },
197
+ [CredentialType.INSFORGE_BASE_URL]: {
198
+ label: 'InsForge Base URL',
199
+ description: 'Base URL for your InsForge backend (e.g., https://your-app.region.insforge.app)',
200
+ placeholder: 'https://your-app.region.insforge.app',
201
+ namePlaceholder: 'My InsForge Backend URL',
202
+ credentialConfigurations: {},
203
+ },
204
+ [CredentialType.INSFORGE_API_KEY]: {
205
+ label: 'InsForge API Key',
206
+ description: 'API key for your InsForge backend',
207
+ placeholder: 'ik_...',
208
+ namePlaceholder: 'My InsForge API Key',
209
+ credentialConfigurations: {},
210
+ },
211
+ [CredentialType.CUSTOM_AUTH_KEY]: {
212
+ label: 'Custom Authentication Key',
213
+ description: 'Custom API key or authentication token for HTTP requests (Bearer, Basic, X-API-Key, etc.)',
214
+ placeholder: 'Enter your API key or token...',
215
+ namePlaceholder: 'My Custom Auth Key',
216
+ credentialConfigurations: {},
217
+ },
218
+ [CredentialType.AMAZON_CRED]: {
219
+ label: 'Amazon',
220
+ description: 'Browser session authentication for Amazon shopping (cart, orders, purchases). Authenticate by logging into your Amazon account in a secure browser session.',
221
+ placeholder: '', // Not used for browser session auth
222
+ namePlaceholder: 'My Amazon Account',
223
+ credentialConfigurations: {},
224
+ },
225
+ };
226
+ /**
227
+ * Generate a human-readable summary of available credentials for AI agents
228
+ */
229
+ export function generateCredentialsSummary() {
230
+ const lines = ['Available credentials that users can configure:'];
231
+ for (const [credType, config] of Object.entries(CREDENTIAL_TYPE_CONFIG)) {
232
+ lines.push(`- ${config.label} (${credType}): ${config.description}`);
233
+ }
234
+ return lines.join('\n');
235
+ }
4
236
  /**
5
237
  * Maps credential types to their environment variable names (for backend only!!!!)
6
238
  */
@@ -11,16 +243,27 @@ export const CREDENTIAL_ENV_MAP = {
11
243
  [CredentialType.FIRECRAWL_API_KEY]: 'FIRE_CRAWL_API_KEY',
12
244
  [CredentialType.DATABASE_CRED]: 'BUBBLE_CONNECTING_STRING_URL',
13
245
  [CredentialType.SLACK_CRED]: 'SLACK_TOKEN',
246
+ [CredentialType.TELEGRAM_BOT_TOKEN]: 'TELEGRAM_BOT_TOKEN',
14
247
  [CredentialType.RESEND_CRED]: 'RESEND_API_KEY',
15
248
  [CredentialType.OPENROUTER_CRED]: 'OPENROUTER_API_KEY',
16
249
  [CredentialType.CLOUDFLARE_R2_ACCESS_KEY]: 'CLOUDFLARE_R2_ACCESS_KEY',
17
250
  [CredentialType.CLOUDFLARE_R2_SECRET_KEY]: 'CLOUDFLARE_R2_SECRET_KEY',
18
251
  [CredentialType.CLOUDFLARE_R2_ACCOUNT_ID]: 'CLOUDFLARE_R2_ACCOUNT_ID',
19
252
  [CredentialType.APIFY_CRED]: 'APIFY_API_TOKEN',
253
+ [CredentialType.ELEVENLABS_API_KEY]: 'ELEVENLABS_API_KEY',
20
254
  [CredentialType.GOOGLE_DRIVE_CRED]: '',
21
255
  [CredentialType.GMAIL_CRED]: '',
22
256
  [CredentialType.GOOGLE_SHEETS_CRED]: '',
23
257
  [CredentialType.GOOGLE_CALENDAR_CRED]: '',
258
+ [CredentialType.FUB_CRED]: '',
259
+ [CredentialType.GITHUB_TOKEN]: 'GITHUB_TOKEN',
260
+ [CredentialType.AGI_API_KEY]: 'AGI_API_KEY',
261
+ [CredentialType.AIRTABLE_CRED]: 'AIRTABLE_API_KEY',
262
+ [CredentialType.NOTION_OAUTH_TOKEN]: '',
263
+ [CredentialType.INSFORGE_BASE_URL]: 'INSFORGE_BASE_URL',
264
+ [CredentialType.INSFORGE_API_KEY]: 'INSFORGE_API_KEY',
265
+ [CredentialType.CUSTOM_AUTH_KEY]: '', // User-provided, no env var
266
+ [CredentialType.AMAZON_CRED]: '', // Browser session credential, no env var
24
267
  };
25
268
  /** Used by bubblelab studio */
26
269
  export const SYSTEM_CREDENTIALS = new Set([
@@ -37,6 +280,13 @@ export const SYSTEM_CREDENTIALS = new Set([
37
280
  // Scraping credentials
38
281
  CredentialType.APIFY_CRED,
39
282
  ]);
283
+ /**
284
+ * Credentials that are optional (not required) for their associated bubbles.
285
+ * These will not show as "missing" in the UI when not selected.
286
+ */
287
+ export const OPTIONAL_CREDENTIALS = new Set([
288
+ CredentialType.CUSTOM_AUTH_KEY,
289
+ ]);
40
290
  /**
41
291
  * OAuth provider configurations - single source of truth for OAuth providers
42
292
  * Contains all information needed by frontend and backend
@@ -50,24 +300,77 @@ export const OAUTH_PROVIDERS = {
50
300
  displayName: 'Google Drive',
51
301
  defaultScopes: [
52
302
  'https://www.googleapis.com/auth/drive.file',
303
+ 'https://www.googleapis.com/auth/documents',
304
+ 'https://www.googleapis.com/auth/spreadsheets',
53
305
  'https://www.googleapis.com/auth/drive',
54
306
  ],
55
307
  description: 'Access Google Drive files and folders',
308
+ scopeDescriptions: [
309
+ {
310
+ scope: 'https://www.googleapis.com/auth/drive.file',
311
+ description: 'View and manage Google Drive files and folders that you have created with Bubble Lab',
312
+ defaultEnabled: true,
313
+ },
314
+ {
315
+ scope: 'https://www.googleapis.com/auth/documents',
316
+ description: 'View and manage your Google Docs documents',
317
+ defaultEnabled: true,
318
+ },
319
+ {
320
+ scope: 'https://www.googleapis.com/auth/spreadsheets',
321
+ description: 'View and manage your Google Sheets spreadsheets',
322
+ defaultEnabled: true,
323
+ },
324
+ {
325
+ scope: 'https://www.googleapis.com/auth/drive',
326
+ description: 'View and manage all ofyour Google Drive files and folders (will see a warning about an "untrusted app" during authentication. Choose only if you need extra permissions)',
327
+ defaultEnabled: false,
328
+ },
329
+ ],
56
330
  },
57
331
  [CredentialType.GMAIL_CRED]: {
58
332
  displayName: 'Gmail',
59
- defaultScopes: ['https://mail.google.com/'],
60
- description: 'Access Gmail for reading, sending, and managing emails',
333
+ defaultScopes: [
334
+ 'https://www.googleapis.com/auth/gmail.send',
335
+ 'https://www.googleapis.com/auth/gmail.modify',
336
+ ],
337
+ description: 'Access Gmail for sending emails',
338
+ scopeDescriptions: [
339
+ {
340
+ scope: 'https://www.googleapis.com/auth/gmail.send',
341
+ description: 'Send email on your behalf',
342
+ defaultEnabled: true,
343
+ },
344
+ {
345
+ scope: 'https://www.googleapis.com/auth/gmail.modify',
346
+ description: 'View and manage all of your Gmail emails and labels (might see a warning about an "untrusted app" during authentication. Choose only if you need extra permissions)',
347
+ defaultEnabled: false,
348
+ },
349
+ ],
61
350
  },
62
351
  [CredentialType.GOOGLE_SHEETS_CRED]: {
63
352
  displayName: 'Google Sheets',
64
353
  defaultScopes: ['https://www.googleapis.com/auth/spreadsheets'],
65
354
  description: 'Access Google Sheets for reading and writing spreadsheet data',
355
+ scopeDescriptions: [
356
+ {
357
+ scope: 'https://www.googleapis.com/auth/spreadsheets',
358
+ description: 'View and manage your Google Sheets spreadsheets',
359
+ defaultEnabled: true,
360
+ },
361
+ ],
66
362
  },
67
363
  [CredentialType.GOOGLE_CALENDAR_CRED]: {
68
364
  displayName: 'Google Calendar',
69
365
  defaultScopes: ['https://www.googleapis.com/auth/calendar'],
70
366
  description: 'Access Google Calendar for reading and managing events',
367
+ scopeDescriptions: [
368
+ {
369
+ scope: 'https://www.googleapis.com/auth/calendar',
370
+ description: 'View and manage events on all your calendars',
371
+ defaultEnabled: true,
372
+ },
373
+ ],
71
374
  },
72
375
  },
73
376
  authorizationParams: {
@@ -75,6 +378,32 @@ export const OAUTH_PROVIDERS = {
75
378
  prompt: 'consent', // Force consent screen to ensure refresh token is issued
76
379
  },
77
380
  },
381
+ followupboss: {
382
+ name: 'followupboss',
383
+ displayName: 'Follow Up Boss',
384
+ credentialTypes: {
385
+ [CredentialType.FUB_CRED]: {
386
+ displayName: 'Follow Up Boss',
387
+ defaultScopes: [], // FUB doesn't use granular scopes
388
+ description: 'Access Follow Up Boss CRM for managing contacts, tasks, deals, and more',
389
+ },
390
+ },
391
+ authorizationParams: {
392
+ response_type: 'auth_code', // FUB uses 'auth_code' instead of standard 'code'
393
+ prompt: 'login', // FUB supports 'login' to force re-authentication
394
+ },
395
+ },
396
+ notion: {
397
+ name: 'notion',
398
+ displayName: 'Notion',
399
+ credentialTypes: {
400
+ [CredentialType.NOTION_OAUTH_TOKEN]: {
401
+ displayName: 'Notion Workspace',
402
+ defaultScopes: [], // Notion scopes are managed in the integration capabilities
403
+ description: 'Authorize access to your Notion workspace for searching and reading pages/databases',
404
+ },
405
+ },
406
+ },
78
407
  };
79
408
  /**
80
409
  * Get the OAuth provider for a specific credential type
@@ -94,6 +423,62 @@ export function getOAuthProvider(credentialType) {
94
423
  export function isOAuthCredential(credentialType) {
95
424
  return getOAuthProvider(credentialType) !== null;
96
425
  }
426
+ /**
427
+ * Get scope descriptions for a specific credential type
428
+ * Returns an array of scope descriptions that will be requested during OAuth
429
+ */
430
+ export function getScopeDescriptions(credentialType) {
431
+ const provider = getOAuthProvider(credentialType);
432
+ if (!provider) {
433
+ return [];
434
+ }
435
+ const providerConfig = OAUTH_PROVIDERS[provider];
436
+ const credentialConfig = providerConfig?.credentialTypes[credentialType];
437
+ if (!credentialConfig?.scopeDescriptions) {
438
+ // Fallback: create descriptions from scope URLs if not explicitly defined
439
+ return (credentialConfig?.defaultScopes.map((scope) => ({
440
+ scope,
441
+ description: `Access: ${scope}`,
442
+ defaultEnabled: true, // Default to enabled if in defaultScopes
443
+ })) || []);
444
+ }
445
+ return credentialConfig.scopeDescriptions;
446
+ }
447
+ /**
448
+ * Browser session provider configurations - for credentials that use BrowserBase
449
+ * browser sessions instead of OAuth or API keys
450
+ */
451
+ export const BROWSER_SESSION_PROVIDERS = {
452
+ browserbase: {
453
+ name: 'browserbase',
454
+ displayName: 'BrowserBase',
455
+ credentialTypes: {
456
+ [CredentialType.AMAZON_CRED]: {
457
+ displayName: 'Amazon Account',
458
+ description: 'Log into Amazon to enable cart, order, and purchase automation',
459
+ targetUrl: 'https://www.amazon.com',
460
+ cookieDomain: 'amazon',
461
+ },
462
+ },
463
+ },
464
+ };
465
+ /**
466
+ * Get the browser session provider for a specific credential type
467
+ */
468
+ export function getBrowserSessionProvider(credentialType) {
469
+ for (const [providerName, config] of Object.entries(BROWSER_SESSION_PROVIDERS)) {
470
+ if (config.credentialTypes[credentialType]) {
471
+ return providerName;
472
+ }
473
+ }
474
+ return null;
475
+ }
476
+ /**
477
+ * Check if a credential type uses browser session authentication (BrowserBase)
478
+ */
479
+ export function isBrowserSessionCredential(credentialType) {
480
+ return getBrowserSessionProvider(credentialType) !== null;
481
+ }
97
482
  /**
98
483
  * Collection of credential options for all bubbles
99
484
  */
@@ -107,6 +492,7 @@ export const BUBBLE_CREDENTIAL_OPTIONS = {
107
492
  ],
108
493
  postgresql: [CredentialType.DATABASE_CRED],
109
494
  slack: [CredentialType.SLACK_CRED],
495
+ telegram: [CredentialType.TELEGRAM_BOT_TOKEN],
110
496
  resend: [CredentialType.RESEND_CRED],
111
497
  'database-analyzer': [CredentialType.DATABASE_CRED],
112
498
  'slack-notifier': [
@@ -128,19 +514,24 @@ export const BUBBLE_CREDENTIAL_OPTIONS = {
128
514
  CredentialType.ANTHROPIC_CRED,
129
515
  ],
130
516
  'hello-world': [],
131
- http: [],
517
+ http: [CredentialType.CUSTOM_AUTH_KEY],
132
518
  'get-bubble-details-tool': [],
133
519
  'list-bubbles-tool': [],
134
520
  'sql-query-tool': [CredentialType.DATABASE_CRED],
135
521
  'chart-js-tool': [],
136
522
  'bubbleflow-validation-tool': [],
523
+ 'code-edit-tool': [CredentialType.OPENROUTER_CRED],
137
524
  'web-search-tool': [CredentialType.FIRECRAWL_API_KEY],
138
525
  'web-scrape-tool': [CredentialType.FIRECRAWL_API_KEY],
139
- 'web-crawl-tool': [CredentialType.FIRECRAWL_API_KEY],
526
+ 'web-crawl-tool': [
527
+ CredentialType.FIRECRAWL_API_KEY,
528
+ CredentialType.GOOGLE_GEMINI_CRED,
529
+ ],
140
530
  'web-extract-tool': [CredentialType.FIRECRAWL_API_KEY],
141
531
  'research-agent-tool': [
142
532
  CredentialType.FIRECRAWL_API_KEY,
143
533
  CredentialType.GOOGLE_GEMINI_CRED,
534
+ CredentialType.APIFY_CRED,
144
535
  ],
145
536
  'reddit-scrape-tool': [],
146
537
  'bubbleflow-code-generator': [],
@@ -148,7 +539,12 @@ export const BUBBLE_CREDENTIAL_OPTIONS = {
148
539
  CredentialType.GOOGLE_GEMINI_CRED,
149
540
  CredentialType.OPENROUTER_CRED,
150
541
  ],
151
- 'pdf-form-operations': [],
542
+ 'pdf-form-operations': [
543
+ CredentialType.GOOGLE_GEMINI_CRED,
544
+ CredentialType.OPENAI_CRED,
545
+ CredentialType.ANTHROPIC_CRED,
546
+ CredentialType.OPENROUTER_CRED,
547
+ ],
152
548
  'pdf-ocr-workflow': [
153
549
  CredentialType.GOOGLE_GEMINI_CRED,
154
550
  CredentialType.OPENAI_CRED,
@@ -182,7 +578,33 @@ export const BUBBLE_CREDENTIAL_OPTIONS = {
182
578
  apify: [CredentialType.APIFY_CRED],
183
579
  'instagram-tool': [CredentialType.APIFY_CRED],
184
580
  'linkedin-tool': [CredentialType.APIFY_CRED],
581
+ 'tiktok-tool': [CredentialType.APIFY_CRED],
582
+ 'twitter-tool': [CredentialType.APIFY_CRED],
583
+ 'google-maps-tool': [CredentialType.APIFY_CRED],
185
584
  'youtube-tool': [CredentialType.APIFY_CRED],
585
+ github: [CredentialType.GITHUB_TOKEN],
586
+ 'eleven-labs': [CredentialType.ELEVENLABS_API_KEY],
587
+ followupboss: [CredentialType.FUB_CRED],
588
+ 'agi-inc': [CredentialType.AGI_API_KEY],
589
+ airtable: [CredentialType.AIRTABLE_CRED],
590
+ notion: [CredentialType.NOTION_OAUTH_TOKEN],
591
+ firecrawl: [CredentialType.FIRECRAWL_API_KEY],
592
+ 'insforge-db': [
593
+ CredentialType.INSFORGE_BASE_URL,
594
+ CredentialType.INSFORGE_API_KEY,
595
+ ],
596
+ browserbase: [
597
+ CredentialType.AMAZON_CRED,
598
+ CredentialType.CLOUDFLARE_R2_ACCESS_KEY,
599
+ CredentialType.CLOUDFLARE_R2_SECRET_KEY,
600
+ CredentialType.CLOUDFLARE_R2_ACCOUNT_ID,
601
+ ],
602
+ 'amazon-shopping-tool': [
603
+ CredentialType.AMAZON_CRED,
604
+ CredentialType.CLOUDFLARE_R2_ACCESS_KEY,
605
+ CredentialType.CLOUDFLARE_R2_SECRET_KEY,
606
+ CredentialType.CLOUDFLARE_R2_ACCOUNT_ID,
607
+ ],
186
608
  };
187
609
  // POST /credentials - Create credential schema
188
610
  export const createCredentialSchema = z
@@ -300,6 +722,19 @@ export const credentialResponseSchema = z
300
722
  .enum(['active', 'expired', 'needs_refresh'])
301
723
  .optional()
302
724
  .openapi({ description: 'OAuth token status' }),
725
+ // Browser session-specific fields
726
+ isBrowserSession: z
727
+ .boolean()
728
+ .optional()
729
+ .openapi({ description: 'Whether this is a browser session credential' }),
730
+ browserbaseSessionData: z
731
+ .object({
732
+ capturedAt: z.string(),
733
+ cookieCount: z.number(),
734
+ domain: z.string(),
735
+ })
736
+ .optional()
737
+ .openapi({ description: 'Browser session metadata' }),
303
738
  })
304
739
  .openapi('CredentialResponse');
305
740
  // POST /credentials - Create credential response
@@ -322,4 +757,73 @@ export const successMessageResponseSchema = z
322
757
  message: z.string().openapi({ description: 'Success message' }),
323
758
  })
324
759
  .openapi('SuccessMessageResponse');
760
+ // BrowserBase session schemas
761
+ export const browserbaseSessionCreateRequestSchema = z
762
+ .object({
763
+ credentialType: z.nativeEnum(CredentialType).openapi({
764
+ description: 'Type of credential requiring browser authentication',
765
+ example: CredentialType.AMAZON_CRED,
766
+ }),
767
+ name: z.string().optional().openapi({
768
+ description: 'User-friendly name for the credential',
769
+ example: 'My Amazon Account',
770
+ }),
771
+ })
772
+ .openapi('BrowserbaseSessionCreateRequest');
773
+ export const browserbaseSessionCreateResponseSchema = z
774
+ .object({
775
+ sessionId: z.string().openapi({
776
+ description: 'BrowserBase session ID',
777
+ }),
778
+ debugUrl: z.string().openapi({
779
+ description: 'URL to open for manual browser interaction',
780
+ }),
781
+ contextId: z.string().openapi({
782
+ description: 'BrowserBase context ID for session persistence',
783
+ }),
784
+ state: z.string().openapi({
785
+ description: 'State token for CSRF protection',
786
+ }),
787
+ })
788
+ .openapi('BrowserbaseSessionCreateResponse');
789
+ export const browserbaseSessionCompleteRequestSchema = z
790
+ .object({
791
+ sessionId: z.string().openapi({
792
+ description: 'BrowserBase session ID to complete',
793
+ }),
794
+ state: z.string().openapi({
795
+ description: 'State token for verification',
796
+ }),
797
+ name: z.string().optional().openapi({
798
+ description: 'User-friendly name for the credential',
799
+ }),
800
+ })
801
+ .openapi('BrowserbaseSessionCompleteRequest');
802
+ export const browserbaseSessionCompleteResponseSchema = z
803
+ .object({
804
+ id: z.number().openapi({
805
+ description: 'Created credential ID',
806
+ }),
807
+ message: z.string().openapi({
808
+ description: 'Success message',
809
+ }),
810
+ })
811
+ .openapi('BrowserbaseSessionCompleteResponse');
812
+ export const browserbaseSessionReopenRequestSchema = z
813
+ .object({
814
+ credentialId: z.number().openapi({
815
+ description: 'ID of the credential to reopen session for',
816
+ }),
817
+ })
818
+ .openapi('BrowserbaseSessionReopenRequest');
819
+ export const browserbaseSessionReopenResponseSchema = z
820
+ .object({
821
+ sessionId: z.string().openapi({
822
+ description: 'BrowserBase session ID',
823
+ }),
824
+ debugUrl: z.string().openapi({
825
+ description: 'URL to open for manual browser interaction',
826
+ }),
827
+ })
828
+ .openapi('BrowserbaseSessionReopenResponse');
325
829
  //# sourceMappingURL=credential-schema.js.map