@bubblelab/shared-schemas 0.1.13 → 0.1.14

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 (59) hide show
  1. package/dist/agent-memory.d.ts +21 -0
  2. package/dist/agent-memory.d.ts.map +1 -0
  3. package/dist/ai-models.d.ts +4 -0
  4. package/dist/ai-models.d.ts.map +1 -0
  5. package/dist/api-schema.d.ts +38 -0
  6. package/dist/api-schema.d.ts.map +1 -0
  7. package/dist/bubble-definition-schema.d.ts +840 -0
  8. package/dist/bubble-definition-schema.d.ts.map +1 -0
  9. package/dist/bubbleflow-execution-schema.d.ts +1297 -0
  10. package/dist/bubbleflow-execution-schema.d.ts.map +1 -0
  11. package/dist/bubbleflow-generation-prompts.d.ts +8 -0
  12. package/dist/bubbleflow-generation-prompts.d.ts.map +1 -0
  13. package/dist/bubbleflow-schema.d.ts +2071 -0
  14. package/dist/bubbleflow-schema.d.ts.map +1 -0
  15. package/dist/coffee.d.ts +2201 -0
  16. package/dist/coffee.d.ts.map +1 -0
  17. package/dist/credential-schema.d.ts +574 -0
  18. package/dist/credential-schema.d.ts.map +1 -0
  19. package/dist/cron-utils.d.ts +47 -0
  20. package/dist/cron-utils.d.ts.map +1 -0
  21. package/dist/database-definition-schema.d.ts +97 -0
  22. package/dist/database-definition-schema.d.ts.map +1 -0
  23. package/dist/error-enhancer.d.ts +6 -0
  24. package/dist/error-enhancer.d.ts.map +1 -0
  25. package/dist/generate-bubbleflow-schema.d.ts +1525 -0
  26. package/dist/generate-bubbleflow-schema.d.ts.map +1 -0
  27. package/dist/hash-utils.d.ts +26 -0
  28. package/dist/hash-utils.d.ts.map +1 -0
  29. package/dist/index.d.ts +29 -10076
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +225 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/milk-tea.d.ts +106 -0
  34. package/dist/milk-tea.d.ts.map +1 -0
  35. package/dist/mock-data-generator.d.ts +51 -0
  36. package/dist/mock-data-generator.d.ts.map +1 -0
  37. package/dist/oauth-schema.d.ts +61 -0
  38. package/dist/oauth-schema.d.ts.map +1 -0
  39. package/dist/param-utils.d.ts +10 -0
  40. package/dist/param-utils.d.ts.map +1 -0
  41. package/dist/pearl.d.ts +346 -0
  42. package/dist/pearl.d.ts.map +1 -0
  43. package/dist/rice.d.ts +100 -0
  44. package/dist/rice.d.ts.map +1 -0
  45. package/dist/storage-utils.d.ts +19 -0
  46. package/dist/storage-utils.d.ts.map +1 -0
  47. package/dist/streaming-events.d.ts +140 -0
  48. package/dist/streaming-events.d.ts.map +1 -0
  49. package/dist/subscription-status-schema.d.ts +250 -0
  50. package/dist/subscription-status-schema.d.ts.map +1 -0
  51. package/dist/trigger.d.ts +172 -0
  52. package/dist/trigger.d.ts.map +1 -0
  53. package/dist/types.d.ts +31 -0
  54. package/dist/types.d.ts.map +1 -0
  55. package/dist/waitlist-schema.d.ts +30 -0
  56. package/dist/waitlist-schema.d.ts.map +1 -0
  57. package/dist/webhook-schema.d.ts +95 -0
  58. package/dist/webhook-schema.d.ts.map +1 -0
  59. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -580,6 +580,7 @@ var BUBBLE_CREDENTIAL_OPTIONS = {
580
580
  "hello-world": [],
581
581
  http: ["CUSTOM_AUTH_KEY" /* CUSTOM_AUTH_KEY */],
582
582
  "get-bubble-details-tool": [],
583
+ "get-trigger-detail-tool": [],
583
584
  "list-bubbles-tool": [],
584
585
  "sql-query-tool": ["DATABASE_CRED" /* DATABASE_CRED */],
585
586
  "chart-js-tool": [],
@@ -595,6 +596,9 @@ var BUBBLE_CREDENTIAL_OPTIONS = {
595
596
  "research-agent-tool": [
596
597
  "FIRECRAWL_API_KEY" /* FIRECRAWL_API_KEY */,
597
598
  "GOOGLE_GEMINI_CRED" /* GOOGLE_GEMINI_CRED */,
599
+ "OPENAI_CRED" /* OPENAI_CRED */,
600
+ "ANTHROPIC_CRED" /* ANTHROPIC_CRED */,
601
+ "OPENROUTER_CRED" /* OPENROUTER_CRED */,
598
602
  "APIFY_CRED" /* APIFY_CRED */
599
603
  ],
600
604
  "reddit-scrape-tool": [],
@@ -3026,12 +3030,228 @@ function getCronScheduleInfo(cronString) {
3026
3030
  // src/trigger.ts
3027
3031
  var BUBBLE_TRIGGER_EVENTS = {
3028
3032
  "slack/bot_mentioned": true,
3033
+ "slack/message_received": true,
3029
3034
  "schedule/cron": true,
3030
3035
  "webhook/http": true
3031
3036
  };
3032
3037
  function isValidBubbleTriggerEvent(eventType) {
3033
3038
  return eventType in BUBBLE_TRIGGER_EVENTS;
3034
3039
  }
3040
+ var TRIGGER_EVENT_CONFIGS = {
3041
+ "slack/message_received": {
3042
+ serviceName: "Slack",
3043
+ friendlyName: "When Slack message is received",
3044
+ description: "Triggered when a message is posted in a channel your bot has access to",
3045
+ setupGuide: `## Slack Message Event Setup Guide
3046
+
3047
+ ### 1. Create a Slack App
3048
+ 1. Go to [Slack API Apps](https://api.slack.com/apps)
3049
+ 2. Click "Create New App" \u2192 "From scratch"
3050
+ 3. Name your app and select your workspace
3051
+
3052
+ ### 2. Configure OAuth Scopes
3053
+ Navigate to **OAuth & Permissions** and add these Bot Token Scopes:
3054
+ - \`channels:history\` - To read messages in public channels
3055
+ - \`groups:history\` - To read messages in private channels
3056
+ - \`im:history\` - To read direct messages
3057
+ - \`mpim:history\` - To read group direct messages
3058
+ - \`chat:write\` - To send messages
3059
+
3060
+ ### 3. Enable Event Subscriptions
3061
+ 1. Go to **Event Subscriptions**
3062
+ 2. Toggle "Enable Events" to ON
3063
+ 3. Toggle the webhook active button above and copy the webhook URL
3064
+ 4. Add your webhook URL to the Request URL field
3065
+ 5. Subscribe to bot events: \`message.channels\`, \`message.groups\`, \`message.im\`, \`message.mpim\`
3066
+
3067
+ ### 4. Install to Workspace
3068
+ 1. Go to **Install App**
3069
+ 2. Click "Install to Workspace"
3070
+ 3. Authorize the requested permissions
3071
+
3072
+ ### 5. Get Your Bot Token
3073
+ Copy the **Bot User OAuth Token** (starts with \`xoxb-\`) from the OAuth & Permissions page.`,
3074
+ payloadSchema: {
3075
+ type: "object",
3076
+ properties: {
3077
+ text: { type: "string", description: "The message text" },
3078
+ channel: {
3079
+ type: "string",
3080
+ description: "Channel ID where message was posted"
3081
+ },
3082
+ user: { type: "string", description: "User ID who posted the message" },
3083
+ channel_type: {
3084
+ type: "string",
3085
+ description: "Type of channel (channel, group, im, mpim)"
3086
+ },
3087
+ slack_event: {
3088
+ type: "object",
3089
+ description: "Full Slack event wrapper"
3090
+ }
3091
+ },
3092
+ required: ["text", "channel", "user", "slack_event"]
3093
+ }
3094
+ },
3095
+ "slack/bot_mentioned": {
3096
+ serviceName: "Slack",
3097
+ friendlyName: "When Slack bot is mentioned",
3098
+ description: "Triggered when someone mentions your bot in a Slack channel",
3099
+ setupGuide: `## Slack Bot Setup Guide
3100
+
3101
+ ### 1. Create a Slack App
3102
+ 1. Go to [Slack API Apps](https://api.slack.com/apps)
3103
+ 2. Click "Create New App" \u2192 "From scratch"
3104
+ 3. Name your app and select your workspace
3105
+
3106
+ ### 2. Configure OAuth Scopes
3107
+ Navigate to **OAuth & Permissions** and add these Bot Token Scopes:
3108
+ - \`app_mentions:read\` - To receive mention events
3109
+ - \`chat:write\` - To send messages
3110
+ - \`channels:history\` - To read channel messages (optional)
3111
+
3112
+ ### 3. Enable Event Subscriptions
3113
+ 1. Go to **Event Subscriptions**
3114
+ 2. Toggle "Enable Events" to ON
3115
+ 3. Toggle the webhook active button above and copy the webhook URL
3116
+ 4. Add your webhook URL to the Request URL field
3117
+ 5. Subscribe to bot events: \`app_mention\`
3118
+
3119
+ ### 4. Install to Workspace
3120
+ 1. Go to **Install App**
3121
+ 2. Click "Install to Workspace"
3122
+ 3. Authorize the requested permissions
3123
+
3124
+ ### 5. Get Your Bot Token
3125
+ Copy the **Bot User OAuth Token** (starts with \`xoxb-\`) from the OAuth & Permissions page.`,
3126
+ payloadSchema: {
3127
+ type: "object",
3128
+ properties: {
3129
+ text: {
3130
+ type: "string",
3131
+ description: "The message text mentioning the bot"
3132
+ },
3133
+ channel: {
3134
+ type: "string",
3135
+ description: "Channel ID where bot was mentioned"
3136
+ },
3137
+ user: { type: "string", description: "User ID who mentioned the bot" },
3138
+ thread_ts: {
3139
+ type: "string",
3140
+ description: "Thread timestamp (if replying in a thread)"
3141
+ },
3142
+ slack_event: {
3143
+ type: "object",
3144
+ description: "Full Slack event wrapper"
3145
+ }
3146
+ },
3147
+ required: ["text", "channel", "user", "slack_event"]
3148
+ }
3149
+ },
3150
+ "schedule/cron": {
3151
+ serviceName: "Cron",
3152
+ friendlyName: "On Schedule",
3153
+ description: "Triggered on a recurring schedule defined by a cron expression",
3154
+ setupGuide: `## Cron Schedule Setup Guide
3155
+
3156
+ Configure when this flow should run using the schedule editor or a cron expression.
3157
+
3158
+ ### Common Schedules
3159
+ - **Every minute**: \`* * * * *\`
3160
+ - **Every hour**: \`0 * * * *\`
3161
+ - **Daily at midnight**: \`0 0 * * *\`
3162
+ - **Weekly on Monday**: \`0 0 * * 1\`
3163
+ - **Monthly on the 1st**: \`0 0 1 * *\`
3164
+
3165
+ ### Cron Format
3166
+ \`\`\`
3167
+ \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 minute (0-59)
3168
+ \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 hour (0-23)
3169
+ \u2502 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 day of month (1-31)
3170
+ \u2502 \u2502 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 month (1-12)
3171
+ \u2502 \u2502 \u2502 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 day of week (0-6, Sunday=0)
3172
+ \u2502 \u2502 \u2502 \u2502 \u2502
3173
+ * * * * *
3174
+ \`\`\`
3175
+
3176
+ ### Custom Payload Interface
3177
+ Define your own payload interface extending CronEvent for scheduled input data:
3178
+ \`\`\`typescript
3179
+ interface DailyReportPayload extends CronEvent {
3180
+ reportType: 'summary' | 'detailed';
3181
+ recipients: string[];
3182
+ }
3183
+
3184
+ export class DailyReportFlow extends BubbleFlow<'schedule/cron'> {
3185
+ readonly cronSchedule = '0 9 * * 1-5'; // Weekdays at 9am
3186
+
3187
+ async handle(payload: DailyReportPayload) {
3188
+ // Access fields directly: payload.reportType, payload.recipients
3189
+ }
3190
+ }
3191
+ \`\`\``,
3192
+ payloadSchema: {
3193
+ type: "object",
3194
+ properties: {},
3195
+ additionalProperties: true
3196
+ }
3197
+ },
3198
+ "webhook/http": {
3199
+ serviceName: "Webhook",
3200
+ friendlyName: "HTTP Webhook",
3201
+ description: "Triggered by an HTTP POST request to your webhook URL",
3202
+ setupGuide: `## Webhook Setup Guide
3203
+
3204
+ ### Your Webhook URL
3205
+ Toggle the webhook active button above and copy the webhook URL to send HTTP POST requests to trigger this flow.
3206
+
3207
+ ### Request Format
3208
+ \`\`\`bash
3209
+ curl -X POST https://your-domain.com/webhook/your-path \\
3210
+ -H "Content-Type: application/json" \\
3211
+ -d '{"email": "user@example.com", "name": "John"}'
3212
+ \`\`\`
3213
+
3214
+ ### Custom Payload Interface
3215
+ Define your own payload interface extending WebhookEvent:
3216
+ \`\`\`typescript
3217
+ interface MyPayload extends WebhookEvent {
3218
+ email: string;
3219
+ name: string;
3220
+ message?: string;
3221
+ }
3222
+
3223
+ export class MyFlow extends BubbleFlow<'webhook/http'> {
3224
+ async handle(payload: MyPayload) {
3225
+ // Access fields directly: payload.email, payload.name
3226
+ }
3227
+ }
3228
+ \`\`\`
3229
+
3230
+ The JSON body fields from the HTTP request are directly available on the payload object.`,
3231
+ payloadSchema: {
3232
+ type: "object",
3233
+ properties: {},
3234
+ additionalProperties: true
3235
+ }
3236
+ }
3237
+ };
3238
+ function getTriggerEventConfig(eventType) {
3239
+ return TRIGGER_EVENT_CONFIGS[eventType];
3240
+ }
3241
+ function isServiceTrigger(eventType) {
3242
+ return eventType !== "webhook/http" && eventType !== "schedule/cron";
3243
+ }
3244
+ var TRIGGER_EVENT_INTERFACE_MAP = {
3245
+ SlackMentionEvent: "slack/bot_mentioned",
3246
+ SlackMessageReceivedEvent: "slack/message_received",
3247
+ CronEvent: "schedule/cron",
3248
+ WebhookEvent: "webhook/http",
3249
+ BubbleTriggerEvent: "webhook/http"
3250
+ // Base type defaults to webhook
3251
+ };
3252
+ function getTriggerEventTypeFromInterfaceName(interfaceName) {
3253
+ return TRIGGER_EVENT_INTERFACE_MAP[interfaceName];
3254
+ }
3035
3255
 
3036
3256
  // src/storage-utils.ts
3037
3257
  function prepareForStorage(value, options) {
@@ -3249,6 +3469,8 @@ export {
3249
3469
  ServiceUsageSchema,
3250
3470
  SystemMessageSchema,
3251
3471
  TOOL_CALL_TO_DISCARD,
3472
+ TRIGGER_EVENT_CONFIGS,
3473
+ TRIGGER_EVENT_INTERFACE_MAP,
3252
3474
  ToolResultMessageSchema,
3253
3475
  TransformationFunctionWorkflowNodeSchema,
3254
3476
  TryCatchWorkflowNodeSchema,
@@ -3293,10 +3515,13 @@ export {
3293
3515
  getCronScheduleInfo,
3294
3516
  getOAuthProvider,
3295
3517
  getScopeDescriptions,
3518
+ getTriggerEventConfig,
3519
+ getTriggerEventTypeFromInterfaceName,
3296
3520
  hackathonOfferSchema,
3297
3521
  hashToVariableId,
3298
3522
  isBrowserSessionCredential,
3299
3523
  isOAuthCredential,
3524
+ isServiceTrigger,
3300
3525
  isValidBubbleTriggerEvent,
3301
3526
  joinWaitlistResponseSchema,
3302
3527
  joinWaitlistSchema,