2024-06-22 06:22:53 +02:00
|
|
|
import { z } from "zod";
|
2024-06-22 11:44:21 +02:00
|
|
|
import { Hooks } from "./hooks";
|
2024-06-22 06:22:53 +02:00
|
|
|
import { Plugin, PluginConfigManager } from "./plugin";
|
2024-06-22 11:44:21 +02:00
|
|
|
|
2024-06-22 06:22:53 +02:00
|
|
|
const configManager = new PluginConfigManager(
|
|
|
|
|
z.object({
|
|
|
|
|
apiKey: z.string(),
|
|
|
|
|
}),
|
|
|
|
|
);
|
2024-06-22 11:44:21 +02:00
|
|
|
|
2024-09-23 11:54:42 +02:00
|
|
|
const myPlugin = new Plugin(configManager);
|
2024-06-22 06:22:53 +02:00
|
|
|
|
2024-06-22 11:44:21 +02:00
|
|
|
myPlugin.registerHandler(Hooks.Response, (req) => {
|
2024-06-22 06:22:53 +02:00
|
|
|
console.info("Request received:", req);
|
|
|
|
|
return req;
|
|
|
|
|
});
|