@bubblelab/shared-schemas 0.1.12 → 0.1.13
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.
- package/dist/index.d.ts +10076 -29
- package/dist/index.js +3328 -30
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/agent-memory.d.ts +0 -21
- package/dist/agent-memory.d.ts.map +0 -1
- package/dist/agent-memory.js +0 -11
- package/dist/agent-memory.js.map +0 -1
- package/dist/ai-models.d.ts +0 -4
- package/dist/ai-models.d.ts.map +0 -1
- package/dist/ai-models.js +0 -31
- package/dist/ai-models.js.map +0 -1
- package/dist/api-schema.d.ts +0 -38
- package/dist/api-schema.d.ts.map +0 -1
- package/dist/api-schema.js +0 -26
- package/dist/api-schema.js.map +0 -1
- package/dist/bubble-definition-schema.d.ts +0 -840
- package/dist/bubble-definition-schema.d.ts.map +0 -1
- package/dist/bubble-definition-schema.js +0 -299
- package/dist/bubble-definition-schema.js.map +0 -1
- package/dist/bubbleflow-execution-schema.d.ts +0 -1297
- package/dist/bubbleflow-execution-schema.d.ts.map +0 -1
- package/dist/bubbleflow-execution-schema.js +0 -360
- package/dist/bubbleflow-execution-schema.js.map +0 -1
- package/dist/bubbleflow-generation-prompts.d.ts +0 -8
- package/dist/bubbleflow-generation-prompts.d.ts.map +0 -1
- package/dist/bubbleflow-generation-prompts.js +0 -17
- package/dist/bubbleflow-generation-prompts.js.map +0 -1
- package/dist/bubbleflow-schema.d.ts +0 -2071
- package/dist/bubbleflow-schema.d.ts.map +0 -1
- package/dist/bubbleflow-schema.js +0 -336
- package/dist/bubbleflow-schema.js.map +0 -1
- package/dist/coffee.d.ts +0 -2201
- package/dist/coffee.d.ts.map +0 -1
- package/dist/coffee.js +0 -257
- package/dist/coffee.js.map +0 -1
- package/dist/credential-schema.d.ts +0 -574
- package/dist/credential-schema.d.ts.map +0 -1
- package/dist/credential-schema.js +0 -829
- package/dist/credential-schema.js.map +0 -1
- package/dist/cron-utils.d.ts +0 -47
- package/dist/cron-utils.d.ts.map +0 -1
- package/dist/cron-utils.js +0 -228
- package/dist/cron-utils.js.map +0 -1
- package/dist/database-definition-schema.d.ts +0 -97
- package/dist/database-definition-schema.d.ts.map +0 -1
- package/dist/database-definition-schema.js +0 -36
- package/dist/database-definition-schema.js.map +0 -1
- package/dist/error-enhancer.d.ts +0 -6
- package/dist/error-enhancer.d.ts.map +0 -1
- package/dist/error-enhancer.js +0 -88
- package/dist/error-enhancer.js.map +0 -1
- package/dist/generate-bubbleflow-schema.d.ts +0 -1525
- package/dist/generate-bubbleflow-schema.d.ts.map +0 -1
- package/dist/generate-bubbleflow-schema.js +0 -304
- package/dist/generate-bubbleflow-schema.js.map +0 -1
- package/dist/hash-utils.d.ts +0 -26
- package/dist/hash-utils.d.ts.map +0 -1
- package/dist/hash-utils.js +0 -37
- package/dist/hash-utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/milk-tea.d.ts +0 -106
- package/dist/milk-tea.d.ts.map +0 -1
- package/dist/milk-tea.js +0 -71
- package/dist/milk-tea.js.map +0 -1
- package/dist/mock-data-generator.d.ts +0 -51
- package/dist/mock-data-generator.d.ts.map +0 -1
- package/dist/mock-data-generator.js +0 -335
- package/dist/mock-data-generator.js.map +0 -1
- package/dist/oauth-schema.d.ts +0 -61
- package/dist/oauth-schema.d.ts.map +0 -1
- package/dist/oauth-schema.js +0 -75
- package/dist/oauth-schema.js.map +0 -1
- package/dist/param-utils.d.ts +0 -10
- package/dist/param-utils.d.ts.map +0 -1
- package/dist/param-utils.js +0 -13
- package/dist/param-utils.js.map +0 -1
- package/dist/pearl.d.ts +0 -346
- package/dist/pearl.d.ts.map +0 -1
- package/dist/pearl.js +0 -90
- package/dist/pearl.js.map +0 -1
- package/dist/rice.d.ts +0 -100
- package/dist/rice.d.ts.map +0 -1
- package/dist/rice.js +0 -65
- package/dist/rice.js.map +0 -1
- package/dist/storage-utils.d.ts +0 -19
- package/dist/storage-utils.d.ts.map +0 -1
- package/dist/storage-utils.js +0 -54
- package/dist/storage-utils.js.map +0 -1
- package/dist/streaming-events.d.ts +0 -140
- package/dist/streaming-events.d.ts.map +0 -1
- package/dist/streaming-events.js +0 -5
- package/dist/streaming-events.js.map +0 -1
- package/dist/subscription-status-schema.d.ts +0 -250
- package/dist/subscription-status-schema.d.ts.map +0 -1
- package/dist/subscription-status-schema.js +0 -144
- package/dist/subscription-status-schema.js.map +0 -1
- package/dist/trigger.d.ts +0 -113
- package/dist/trigger.d.ts.map +0 -1
- package/dist/trigger.js +0 -12
- package/dist/trigger.js.map +0 -1
- package/dist/types.d.ts +0 -31
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -47
- package/dist/types.js.map +0 -1
- package/dist/waitlist-schema.d.ts +0 -30
- package/dist/waitlist-schema.d.ts.map +0 -1
- package/dist/waitlist-schema.js +0 -39
- package/dist/waitlist-schema.js.map +0 -1
- package/dist/webhook-schema.d.ts +0 -95
- package/dist/webhook-schema.d.ts.map +0 -1
- package/dist/webhook-schema.js +0 -50
- package/dist/webhook-schema.js.map +0 -1
|
@@ -1,829 +0,0 @@
|
|
|
1
|
-
import { CredentialType } from './types.js';
|
|
2
|
-
import { z } from '@hono/zod-openapi';
|
|
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
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Maps credential types to their environment variable names (for backend only!!!!)
|
|
238
|
-
*/
|
|
239
|
-
export const CREDENTIAL_ENV_MAP = {
|
|
240
|
-
[CredentialType.OPENAI_CRED]: 'OPENAI_API_KEY',
|
|
241
|
-
[CredentialType.GOOGLE_GEMINI_CRED]: 'GOOGLE_API_KEY',
|
|
242
|
-
[CredentialType.ANTHROPIC_CRED]: 'ANTHROPIC_API_KEY',
|
|
243
|
-
[CredentialType.FIRECRAWL_API_KEY]: 'FIRE_CRAWL_API_KEY',
|
|
244
|
-
[CredentialType.DATABASE_CRED]: 'BUBBLE_CONNECTING_STRING_URL',
|
|
245
|
-
[CredentialType.SLACK_CRED]: 'SLACK_TOKEN',
|
|
246
|
-
[CredentialType.TELEGRAM_BOT_TOKEN]: 'TELEGRAM_BOT_TOKEN',
|
|
247
|
-
[CredentialType.RESEND_CRED]: 'RESEND_API_KEY',
|
|
248
|
-
[CredentialType.OPENROUTER_CRED]: 'OPENROUTER_API_KEY',
|
|
249
|
-
[CredentialType.CLOUDFLARE_R2_ACCESS_KEY]: 'CLOUDFLARE_R2_ACCESS_KEY',
|
|
250
|
-
[CredentialType.CLOUDFLARE_R2_SECRET_KEY]: 'CLOUDFLARE_R2_SECRET_KEY',
|
|
251
|
-
[CredentialType.CLOUDFLARE_R2_ACCOUNT_ID]: 'CLOUDFLARE_R2_ACCOUNT_ID',
|
|
252
|
-
[CredentialType.APIFY_CRED]: 'APIFY_API_TOKEN',
|
|
253
|
-
[CredentialType.ELEVENLABS_API_KEY]: 'ELEVENLABS_API_KEY',
|
|
254
|
-
[CredentialType.GOOGLE_DRIVE_CRED]: '',
|
|
255
|
-
[CredentialType.GMAIL_CRED]: '',
|
|
256
|
-
[CredentialType.GOOGLE_SHEETS_CRED]: '',
|
|
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
|
|
267
|
-
};
|
|
268
|
-
/** Used by bubblelab studio */
|
|
269
|
-
export const SYSTEM_CREDENTIALS = new Set([
|
|
270
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
271
|
-
CredentialType.FIRECRAWL_API_KEY,
|
|
272
|
-
CredentialType.OPENAI_CRED,
|
|
273
|
-
CredentialType.ANTHROPIC_CRED,
|
|
274
|
-
CredentialType.RESEND_CRED,
|
|
275
|
-
CredentialType.OPENROUTER_CRED,
|
|
276
|
-
// Cloudflare R2 Storage credentials
|
|
277
|
-
CredentialType.CLOUDFLARE_R2_ACCESS_KEY,
|
|
278
|
-
CredentialType.CLOUDFLARE_R2_SECRET_KEY,
|
|
279
|
-
CredentialType.CLOUDFLARE_R2_ACCOUNT_ID,
|
|
280
|
-
// Scraping credentials
|
|
281
|
-
CredentialType.APIFY_CRED,
|
|
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
|
-
]);
|
|
290
|
-
/**
|
|
291
|
-
* OAuth provider configurations - single source of truth for OAuth providers
|
|
292
|
-
* Contains all information needed by frontend and backend
|
|
293
|
-
*/
|
|
294
|
-
export const OAUTH_PROVIDERS = {
|
|
295
|
-
google: {
|
|
296
|
-
name: 'google',
|
|
297
|
-
displayName: 'Google',
|
|
298
|
-
credentialTypes: {
|
|
299
|
-
[CredentialType.GOOGLE_DRIVE_CRED]: {
|
|
300
|
-
displayName: 'Google Drive',
|
|
301
|
-
defaultScopes: [
|
|
302
|
-
'https://www.googleapis.com/auth/drive.file',
|
|
303
|
-
'https://www.googleapis.com/auth/documents',
|
|
304
|
-
'https://www.googleapis.com/auth/spreadsheets',
|
|
305
|
-
'https://www.googleapis.com/auth/drive',
|
|
306
|
-
],
|
|
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
|
-
],
|
|
330
|
-
},
|
|
331
|
-
[CredentialType.GMAIL_CRED]: {
|
|
332
|
-
displayName: 'Gmail',
|
|
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
|
-
],
|
|
350
|
-
},
|
|
351
|
-
[CredentialType.GOOGLE_SHEETS_CRED]: {
|
|
352
|
-
displayName: 'Google Sheets',
|
|
353
|
-
defaultScopes: ['https://www.googleapis.com/auth/spreadsheets'],
|
|
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
|
-
],
|
|
362
|
-
},
|
|
363
|
-
[CredentialType.GOOGLE_CALENDAR_CRED]: {
|
|
364
|
-
displayName: 'Google Calendar',
|
|
365
|
-
defaultScopes: ['https://www.googleapis.com/auth/calendar'],
|
|
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
|
-
],
|
|
374
|
-
},
|
|
375
|
-
},
|
|
376
|
-
authorizationParams: {
|
|
377
|
-
access_type: 'offline', // Required for refresh tokens
|
|
378
|
-
prompt: 'consent', // Force consent screen to ensure refresh token is issued
|
|
379
|
-
},
|
|
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
|
-
},
|
|
407
|
-
};
|
|
408
|
-
/**
|
|
409
|
-
* Get the OAuth provider for a specific credential type
|
|
410
|
-
* Safely maps credential types to their OAuth providers
|
|
411
|
-
*/
|
|
412
|
-
export function getOAuthProvider(credentialType) {
|
|
413
|
-
for (const [providerName, config] of Object.entries(OAUTH_PROVIDERS)) {
|
|
414
|
-
if (config.credentialTypes[credentialType]) {
|
|
415
|
-
return providerName;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
return null;
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Check if a credential type is OAuth-based
|
|
422
|
-
*/
|
|
423
|
-
export function isOAuthCredential(credentialType) {
|
|
424
|
-
return getOAuthProvider(credentialType) !== null;
|
|
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
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Collection of credential options for all bubbles
|
|
484
|
-
*/
|
|
485
|
-
export const BUBBLE_CREDENTIAL_OPTIONS = {
|
|
486
|
-
'ai-agent': [
|
|
487
|
-
CredentialType.OPENAI_CRED,
|
|
488
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
489
|
-
CredentialType.ANTHROPIC_CRED,
|
|
490
|
-
CredentialType.FIRECRAWL_API_KEY,
|
|
491
|
-
CredentialType.OPENROUTER_CRED,
|
|
492
|
-
],
|
|
493
|
-
postgresql: [CredentialType.DATABASE_CRED],
|
|
494
|
-
slack: [CredentialType.SLACK_CRED],
|
|
495
|
-
telegram: [CredentialType.TELEGRAM_BOT_TOKEN],
|
|
496
|
-
resend: [CredentialType.RESEND_CRED],
|
|
497
|
-
'database-analyzer': [CredentialType.DATABASE_CRED],
|
|
498
|
-
'slack-notifier': [
|
|
499
|
-
CredentialType.SLACK_CRED,
|
|
500
|
-
CredentialType.OPENAI_CRED,
|
|
501
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
502
|
-
CredentialType.ANTHROPIC_CRED,
|
|
503
|
-
],
|
|
504
|
-
'slack-formatter-agent': [
|
|
505
|
-
CredentialType.OPENAI_CRED,
|
|
506
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
507
|
-
CredentialType.ANTHROPIC_CRED,
|
|
508
|
-
],
|
|
509
|
-
'slack-data-assistant': [
|
|
510
|
-
CredentialType.DATABASE_CRED,
|
|
511
|
-
CredentialType.SLACK_CRED,
|
|
512
|
-
CredentialType.OPENAI_CRED,
|
|
513
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
514
|
-
CredentialType.ANTHROPIC_CRED,
|
|
515
|
-
],
|
|
516
|
-
'hello-world': [],
|
|
517
|
-
http: [CredentialType.CUSTOM_AUTH_KEY],
|
|
518
|
-
'get-bubble-details-tool': [],
|
|
519
|
-
'list-bubbles-tool': [],
|
|
520
|
-
'sql-query-tool': [CredentialType.DATABASE_CRED],
|
|
521
|
-
'chart-js-tool': [],
|
|
522
|
-
'bubbleflow-validation-tool': [],
|
|
523
|
-
'code-edit-tool': [CredentialType.OPENROUTER_CRED],
|
|
524
|
-
'web-search-tool': [CredentialType.FIRECRAWL_API_KEY],
|
|
525
|
-
'web-scrape-tool': [CredentialType.FIRECRAWL_API_KEY],
|
|
526
|
-
'web-crawl-tool': [
|
|
527
|
-
CredentialType.FIRECRAWL_API_KEY,
|
|
528
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
529
|
-
],
|
|
530
|
-
'web-extract-tool': [CredentialType.FIRECRAWL_API_KEY],
|
|
531
|
-
'research-agent-tool': [
|
|
532
|
-
CredentialType.FIRECRAWL_API_KEY,
|
|
533
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
534
|
-
CredentialType.APIFY_CRED,
|
|
535
|
-
],
|
|
536
|
-
'reddit-scrape-tool': [],
|
|
537
|
-
'bubbleflow-code-generator': [],
|
|
538
|
-
'bubbleflow-generator': [
|
|
539
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
540
|
-
CredentialType.OPENROUTER_CRED,
|
|
541
|
-
],
|
|
542
|
-
'pdf-form-operations': [
|
|
543
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
544
|
-
CredentialType.OPENAI_CRED,
|
|
545
|
-
CredentialType.ANTHROPIC_CRED,
|
|
546
|
-
CredentialType.OPENROUTER_CRED,
|
|
547
|
-
],
|
|
548
|
-
'pdf-ocr-workflow': [
|
|
549
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
550
|
-
CredentialType.OPENAI_CRED,
|
|
551
|
-
CredentialType.ANTHROPIC_CRED,
|
|
552
|
-
CredentialType.OPENROUTER_CRED,
|
|
553
|
-
],
|
|
554
|
-
'generate-document-workflow': [
|
|
555
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
556
|
-
CredentialType.OPENAI_CRED,
|
|
557
|
-
CredentialType.ANTHROPIC_CRED,
|
|
558
|
-
CredentialType.OPENROUTER_CRED,
|
|
559
|
-
],
|
|
560
|
-
'parse-document-workflow': [
|
|
561
|
-
CredentialType.GOOGLE_GEMINI_CRED,
|
|
562
|
-
CredentialType.OPENAI_CRED,
|
|
563
|
-
CredentialType.ANTHROPIC_CRED,
|
|
564
|
-
CredentialType.OPENROUTER_CRED,
|
|
565
|
-
CredentialType.CLOUDFLARE_R2_ACCESS_KEY,
|
|
566
|
-
CredentialType.CLOUDFLARE_R2_SECRET_KEY,
|
|
567
|
-
CredentialType.CLOUDFLARE_R2_ACCOUNT_ID,
|
|
568
|
-
],
|
|
569
|
-
storage: [
|
|
570
|
-
CredentialType.CLOUDFLARE_R2_ACCESS_KEY,
|
|
571
|
-
CredentialType.CLOUDFLARE_R2_SECRET_KEY,
|
|
572
|
-
CredentialType.CLOUDFLARE_R2_ACCOUNT_ID,
|
|
573
|
-
],
|
|
574
|
-
'google-drive': [CredentialType.GOOGLE_DRIVE_CRED],
|
|
575
|
-
gmail: [CredentialType.GMAIL_CRED],
|
|
576
|
-
'google-sheets': [CredentialType.GOOGLE_SHEETS_CRED],
|
|
577
|
-
'google-calendar': [CredentialType.GOOGLE_CALENDAR_CRED],
|
|
578
|
-
apify: [CredentialType.APIFY_CRED],
|
|
579
|
-
'instagram-tool': [CredentialType.APIFY_CRED],
|
|
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],
|
|
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
|
-
],
|
|
608
|
-
};
|
|
609
|
-
// POST /credentials - Create credential schema
|
|
610
|
-
export const createCredentialSchema = z
|
|
611
|
-
.object({
|
|
612
|
-
credentialType: z.nativeEnum(CredentialType).openapi({
|
|
613
|
-
description: 'Type of credential to store',
|
|
614
|
-
example: CredentialType.OPENAI_CRED,
|
|
615
|
-
}),
|
|
616
|
-
value: z.string().min(1).openapi({
|
|
617
|
-
description: 'The credential value (will be encrypted)',
|
|
618
|
-
example: 'sk-1234567890abcdef',
|
|
619
|
-
}),
|
|
620
|
-
name: z.string().optional().openapi({
|
|
621
|
-
description: 'Optional user-friendly name for the credential',
|
|
622
|
-
example: 'My OpenAI Key',
|
|
623
|
-
}),
|
|
624
|
-
skipValidation: z.boolean().optional().openapi({
|
|
625
|
-
description: 'Skip credential validation before storing (for testing/admin use)',
|
|
626
|
-
example: false,
|
|
627
|
-
}),
|
|
628
|
-
credentialConfigurations: z
|
|
629
|
-
.record(z.string(), z.unknown())
|
|
630
|
-
.optional()
|
|
631
|
-
.openapi({
|
|
632
|
-
description: 'Optional configurations for credential validation (e.g., ignoreSSL for PostgreSQL)',
|
|
633
|
-
example: { ignoreSSL: true },
|
|
634
|
-
}),
|
|
635
|
-
metadata: databaseMetadataSchema.optional().openapi({
|
|
636
|
-
description: 'Optional metadata for the credential (e.g., database schema for DATABASE_CRED)',
|
|
637
|
-
example: {
|
|
638
|
-
tables: {
|
|
639
|
-
users: {
|
|
640
|
-
id: 'integer',
|
|
641
|
-
email: 'character varying',
|
|
642
|
-
created_at: 'timestamp with time zone',
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
rules: [
|
|
646
|
-
{
|
|
647
|
-
id: 'rule-1',
|
|
648
|
-
text: 'No direct DELETE on users table',
|
|
649
|
-
enabled: true,
|
|
650
|
-
createdAt: '2024-01-01T00:00:00Z',
|
|
651
|
-
updatedAt: '2024-01-01T00:00:00Z',
|
|
652
|
-
},
|
|
653
|
-
],
|
|
654
|
-
},
|
|
655
|
-
}),
|
|
656
|
-
})
|
|
657
|
-
.openapi('CreateCredentialRequest');
|
|
658
|
-
// PUT /credentials/:id - Update credential schema
|
|
659
|
-
export const updateCredentialSchema = z
|
|
660
|
-
.object({
|
|
661
|
-
value: z.string().optional().openapi({
|
|
662
|
-
description: 'The credential value (will be encrypted). Leave empty to keep current value.',
|
|
663
|
-
example: 'sk-1234567890abcdef',
|
|
664
|
-
}),
|
|
665
|
-
name: z.string().optional().openapi({
|
|
666
|
-
description: 'Optional user-friendly name for the credential',
|
|
667
|
-
example: 'My OpenAI Key',
|
|
668
|
-
}),
|
|
669
|
-
skipValidation: z.boolean().optional().openapi({
|
|
670
|
-
description: 'Skip credential validation before storing (for testing/admin use)',
|
|
671
|
-
example: false,
|
|
672
|
-
}),
|
|
673
|
-
credentialConfigurations: z
|
|
674
|
-
.record(z.string(), z.unknown())
|
|
675
|
-
.optional()
|
|
676
|
-
.openapi({
|
|
677
|
-
description: 'Optional configurations for credential validation (e.g., ignoreSSL for PostgreSQL)',
|
|
678
|
-
example: { ignoreSSL: true },
|
|
679
|
-
}),
|
|
680
|
-
metadata: databaseMetadataSchema.optional().openapi({
|
|
681
|
-
description: 'Optional metadata for the credential (e.g., database schema for DATABASE_CRED)',
|
|
682
|
-
example: {
|
|
683
|
-
tables: {
|
|
684
|
-
users: {
|
|
685
|
-
id: 'integer',
|
|
686
|
-
email: 'character varying',
|
|
687
|
-
created_at: 'timestamp with time zone',
|
|
688
|
-
},
|
|
689
|
-
},
|
|
690
|
-
},
|
|
691
|
-
}),
|
|
692
|
-
})
|
|
693
|
-
.openapi('UpdateCredentialRequest');
|
|
694
|
-
// GET /credentials - List credentials response
|
|
695
|
-
export const credentialResponseSchema = z
|
|
696
|
-
.object({
|
|
697
|
-
id: z.number().openapi({ description: 'Credential ID' }),
|
|
698
|
-
credentialType: z.string().openapi({ description: 'Type of credential' }),
|
|
699
|
-
name: z.string().optional().openapi({ description: 'Credential name' }),
|
|
700
|
-
metadata: databaseMetadataSchema
|
|
701
|
-
.optional()
|
|
702
|
-
.openapi({ description: 'Credential metadata' }),
|
|
703
|
-
createdAt: z.string().openapi({ description: 'Creation timestamp' }),
|
|
704
|
-
// OAuth-specific fields
|
|
705
|
-
isOauth: z
|
|
706
|
-
.boolean()
|
|
707
|
-
.optional()
|
|
708
|
-
.openapi({ description: 'Whether this is an OAuth credential' }),
|
|
709
|
-
oauthProvider: z
|
|
710
|
-
.string()
|
|
711
|
-
.optional()
|
|
712
|
-
.openapi({ description: 'OAuth provider name' }),
|
|
713
|
-
oauthExpiresAt: z
|
|
714
|
-
.string()
|
|
715
|
-
.optional()
|
|
716
|
-
.openapi({ description: 'OAuth token expiration timestamp' }),
|
|
717
|
-
oauthScopes: z
|
|
718
|
-
.array(z.string())
|
|
719
|
-
.optional()
|
|
720
|
-
.openapi({ description: 'OAuth scopes granted' }),
|
|
721
|
-
oauthStatus: z
|
|
722
|
-
.enum(['active', 'expired', 'needs_refresh'])
|
|
723
|
-
.optional()
|
|
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' }),
|
|
738
|
-
})
|
|
739
|
-
.openapi('CredentialResponse');
|
|
740
|
-
// POST /credentials - Create credential response
|
|
741
|
-
export const createCredentialResponseSchema = z
|
|
742
|
-
.object({
|
|
743
|
-
id: z.number().openapi({ description: 'Credential ID' }),
|
|
744
|
-
message: z.string().openapi({ description: 'Success message' }),
|
|
745
|
-
})
|
|
746
|
-
.openapi('CreateCredentialResponse');
|
|
747
|
-
// PUT /credentials/:id - Update credential response
|
|
748
|
-
export const updateCredentialResponseSchema = z
|
|
749
|
-
.object({
|
|
750
|
-
id: z.number().openapi({ description: 'Credential ID' }),
|
|
751
|
-
message: z.string().openapi({ description: 'Success message' }),
|
|
752
|
-
})
|
|
753
|
-
.openapi('UpdateCredentialResponse');
|
|
754
|
-
// General success message response (used by DELETE /credentials/:id, DELETE /bubble-flow/:id, PUT /bubble-flow/:id)
|
|
755
|
-
export const successMessageResponseSchema = z
|
|
756
|
-
.object({
|
|
757
|
-
message: z.string().openapi({ description: 'Success message' }),
|
|
758
|
-
})
|
|
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');
|
|
829
|
-
//# sourceMappingURL=credential-schema.js.map
|