20 lines
873 B
TypeScript
20 lines
873 B
TypeScript
import type { PushProvider, PushSendResult, SendPushParams } from "./push-provider";
|
|
|
|
/** Dev-only — see console-email-provider.ts for the same pattern and reasoning. */
|
|
export class ConsolePushProvider implements PushProvider {
|
|
readonly name = "console";
|
|
|
|
async sendPush(params: SendPushParams): Promise<PushSendResult> {
|
|
console.log(
|
|
[
|
|
"──── [ConsolePushProvider] would send a push (not actually sent) ────",
|
|
`Endpoint: ${params.subscription.endpoint.slice(0, 60)}...`,
|
|
`Title: ${params.title}`,
|
|
`Body: ${params.body}`,
|
|
"────────────────────────────────────────────────────────────────────",
|
|
].join("\n"),
|
|
);
|
|
return { status: "sent" };
|
|
}
|
|
}
|