Initial gori agent gateway
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { OutgoingMessage, WebhookRequestContext, WebhookResponse } from "./types.js";
|
||||
|
||||
export interface PlatformAdapter {
|
||||
name: string;
|
||||
handleWebhook(context: WebhookRequestContext): Promise<WebhookResponse>;
|
||||
sendMessage(message: OutgoingMessage): Promise<void>;
|
||||
}
|
||||
|
||||
export function jsonResponse(body: unknown, status = 200): WebhookResponse {
|
||||
return { status, body };
|
||||
}
|
||||
|
||||
export function notImplemented(platform: string): WebhookResponse {
|
||||
return jsonResponse({ ok: false, error: `${platform} inbound webhook is not implemented in v1` }, 501);
|
||||
}
|
||||
Reference in New Issue
Block a user