Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/bubble-studio/src/pages/CredentialsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const getServiceNameForCredentialType = (
[CredentialType.ATTIO_CRED]: 'Attio',
[CredentialType.HUBSPOT_CRED]: 'HubSpot',
[CredentialType.SORTLY_API_KEY]: 'Sortly',
[CredentialType.ASSEMBLED_CRED]: 'Assembled',
};

return typeToServiceMap[credentialType] || credentialType;
Expand Down
2 changes: 1 addition & 1 deletion packages/bubble-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bubblelab/bubble-core",
"version": "0.1.210",
"version": "0.1.211",
"type": "module",
"license": "Apache-2.0",
"main": "./dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/bubble-core/src/bubble-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class BubbleFactory {
'attio',
'hubspot',
's3-storage',
'assembled',
];
}

Expand Down Expand Up @@ -406,6 +407,9 @@ export class BubbleFactory {
'./bubbles/service-bubble/hubspot/index.js'
);
const { S3Bubble } = await import('./bubbles/service-bubble/s3/index.js');
const { AssembledBubble } = await import(
'./bubbles/service-bubble/assembled/index.js'
);

// Create the default factory instance
this.register('hello-world', HelloWorldBubble as BubbleClassWithMetadata);
Expand Down Expand Up @@ -565,6 +569,7 @@ export class BubbleFactory {
this.register('attio', AttioBubble as BubbleClassWithMetadata);
this.register('hubspot', HubSpotBubble as BubbleClassWithMetadata);
this.register('s3-storage', S3Bubble as BubbleClassWithMetadata);
this.register('assembled', AssembledBubble as BubbleClassWithMetadata);

// After all default bubbles are registered, auto-populate bubbleDependencies
if (!BubbleFactory.dependenciesPopulated) {
Expand Down Expand Up @@ -869,6 +874,7 @@ import {
AttioBubble, // bubble name: 'attio'
HubSpotBubble, // bubble name: 'hubspot'
S3Bubble, // bubble name: 's3-storage'
AssembledBubble, // bubble name: 'assembled'

// Tool Bubbles (Perform useful actions)
ResearchAgentTool, // bubble name: 'research-agent-tool'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import { BubbleFlow } from '../../../bubble-flow/bubble-flow-class.js';
import type { WebhookEvent } from '@bubblelab/shared-schemas';
import { AssembledBubble } from './assembled.js';

export interface Output {
testResults: {
operation: string;
success: boolean;
details?: string;
}[];
summary: string;
}

export interface TestPayload extends WebhookEvent {
testName?: string;
}

/**
* Integration flow that exercises all Assembled bubble operations end-to-end.
*
* Tests:
* 1. list_queues - List all queues
* 2. list_teams - List all teams
* 3. list_people - List people with pagination
* 4. create_person - Create a test person
* 5. get_person - Get the created person
* 6. update_person - Update the created person
* 7. list_activities - List activities in a time window
* 8. list_time_off - List time off requests
*/
export class AssembledIntegrationFlow extends BubbleFlow<'webhook/http'> {
async handle(_payload: TestPayload): Promise<Output> {
const results: Output['testResults'] = [];

// 1. List queues
const queuesResult = await new AssembledBubble({
operation: 'list_queues',
}).action();
results.push({
operation: 'list_queues',
success: queuesResult.success,
details: queuesResult.success
? `Found ${queuesResult.data?.queues?.length ?? 0} queues`
: queuesResult.error,
});

// 2. List teams
const teamsResult = await new AssembledBubble({
operation: 'list_teams',
}).action();
results.push({
operation: 'list_teams',
success: teamsResult.success,
details: teamsResult.success
? `Found ${teamsResult.data?.teams?.length ?? 0} teams`
: teamsResult.error,
});

// 3. List people
const listPeopleResult = await new AssembledBubble({
operation: 'list_people',
limit: 5,
offset: 0,
}).action();
results.push({
operation: 'list_people',
success: listPeopleResult.success,
details: listPeopleResult.success
? `Found ${listPeopleResult.data?.people?.length ?? 0} people`
: listPeopleResult.error,
});

// 4. Create a test person (with edge-case unicode name)
const testEmail = `bubble-test-${Date.now()}@example.com`;
const createResult = await new AssembledBubble({
operation: 'create_person',
first_name: 'BubbleLab Tëst',
last_name: "O'Connor-López",
email: testEmail,
channels: ['email', 'chat'],
staffable: true,
}).action();
results.push({
operation: 'create_person',
success: createResult.success,
details: createResult.success
? `Created person: ${JSON.stringify(createResult.data?.person)}`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid emitting full person payload in integration output details.

Line 87 includes JSON.stringify(createResult.data?.person), which can leak PII (for example email/name) through flow output and logs. Return only non-sensitive identifiers.

🔧 Proposed fix
     results.push({
       operation: 'create_person',
       success: createResult.success,
       details: createResult.success
-        ? `Created person: ${JSON.stringify(createResult.data?.person)}`
+        ? `Created person ID: ${((createResult.data?.person as Record<string, unknown>)?.id as string | undefined) ?? 'unknown'}`
         : createResult.error,
     });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
? `Created person: ${JSON.stringify(createResult.data?.person)}`
results.push({
operation: 'create_person',
success: createResult.success,
details: createResult.success
? `Created person ID: ${((createResult.data?.person as Record<string, unknown>)?.id as string | undefined) ?? 'unknown'}`
: createResult.error,
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/bubble-core/src/bubbles/service-bubble/assembled/assembled.integration.flow.ts`
at line 87, The output currently emits the full person payload via
JSON.stringify(createResult.data?.person); change the integration output to only
include non-sensitive identifiers (e.g., person.id, person.uuid, or
person.externalId) instead of the whole object. Locate the template string that
references createResult.data?.person in assembled.integration.flow.ts and
replace the JSON.stringify usage with a concise identifier(s) (for example
`createResult.data?.person.id`) so PII like name/email is not included in flow
output or logs.

: createResult.error,
});

// 5. Get the created person (if create succeeded)
const personId = (createResult.data?.person as Record<string, unknown>)
?.id as string | undefined;
if (personId) {
const getResult = await new AssembledBubble({
operation: 'get_person',
person_id: personId,
}).action();
results.push({
operation: 'get_person',
success: getResult.success,
details: getResult.success
? `Retrieved person ID: ${personId}`
: getResult.error,
});

// 6. Update the person
const updateResult = await new AssembledBubble({
operation: 'update_person',
person_id: personId,
first_name: 'Updated Tëst',
channels: ['email', 'chat', 'phone'],
}).action();
results.push({
operation: 'update_person',
success: updateResult.success,
details: updateResult.success
? `Updated person ID: ${personId}`
: updateResult.error,
});
} else {
results.push({
operation: 'get_person',
success: false,
details: 'Skipped: no person ID from create',
});
results.push({
operation: 'update_person',
success: false,
details: 'Skipped: no person ID from create',
});
}

// 7. List activities (last 24 hours)
const now = Math.floor(Date.now() / 1000);
const listActivitiesResult = await new AssembledBubble({
operation: 'list_activities',
start_time: now - 86400,
end_time: now,
include_agents: true,
}).action();
results.push({
operation: 'list_activities',
success: listActivitiesResult.success,
details: listActivitiesResult.success
? `Found ${Object.keys(listActivitiesResult.data?.activities || {}).length} activities`
: listActivitiesResult.error,
});

// 8. List time off requests
const listTimeOffResult = await new AssembledBubble({
operation: 'list_time_off',
limit: 5,
}).action();
results.push({
operation: 'list_time_off',
success: listTimeOffResult.success,
details: listTimeOffResult.success
? `Found ${listTimeOffResult.data?.requests?.length ?? 0} time off requests`
: listTimeOffResult.error,
});

const passed = results.filter((r) => r.success).length;
const total = results.length;

return {
testResults: results,
summary: `${passed}/${total} operations passed`,
};
}
}
Loading
Loading