forked from bubblelabai/BubbleLab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-processor.ts
More file actions
26 lines (22 loc) · 739 Bytes
/
test-processor.ts
File metadata and controls
26 lines (22 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { processUserCode } from './src/services/code-processor.js';
const testCode = `
import { BubbleFlow } from '@bubblelab/bubble-core';
import type { BubbleTriggerEventRegistry } from '@bubblelab/bubble-core';
export class GreetingFlow extends BubbleFlow<'webhook/http'> {
constructor() {
super('greeting-flow', 'Greets the user');
}
async handle(payload: BubbleTriggerEventRegistry['webhook/http']) {
const name = payload.body?.name || 'World';
return {
greeting: \`Hello, \${name}!\`,
timestamp: new Date().toISOString(),
receivedData: payload,
};
}
}
`;
console.log('Original code:');
console.log(testCode);
console.log('\n\nProcessed code:');
console.log(processUserCode(testCode));