Skip to content

Commit e763836

Browse files
committed
test(plugin-webhooks): type the payload pin's enqueue double as HttpEnqueueFn
Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent bfb7b28 commit e763836

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎packages/plugins/plugin-webhooks/src/webhook-payload-declared-fields.test.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {
2424
RealtimeEventHandler,
2525
RealtimeEventPayload,
2626
} from '@objectstack/spec/contracts';
27-
import { AutoEnqueuer } from './auto-enqueuer.js';
27+
import { AutoEnqueuer, type HttpEnqueueFn } from './auto-enqueuer.js';
2828

2929
type Row = Record<string, unknown>;
3030

@@ -122,9 +122,11 @@ async function boot() {
122122
const realtime = new FakeRealtime();
123123
engine.setRealtimeService(realtime);
124124
const delivered: Array<{ label?: string; payload: Row }> = [];
125-
const enqueuer = new AutoEnqueuer(engine as never, realtime, async (input: any) => {
126-
delivered.push({ label: input.label, payload: input.payload });
127-
});
125+
const enqueue: HttpEnqueueFn = async (input) => {
126+
delivered.push({ label: input.label, payload: input.payload as Row });
127+
return `delivery_${delivered.length}`;
128+
};
129+
const enqueuer = new AutoEnqueuer(engine as never, realtime, enqueue);
128130
await enqueuer.start();
129131
return { engine, enqueuer, delivered };
130132
}

0 commit comments

Comments
 (0)