0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00
server/project/src/routers/static/NotifierStaticRouter.ts

41 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { NotifierCallbacks } from "@spt/callbacks/NotifierCallbacks";
import { RouteAction, StaticRouter } from "@spt/di/Router";
import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData";
import { INotifierChannel } from "@spt/models/eft/notifier/INotifier";
import { ISelectProfileResponse } from "@spt/models/eft/notifier/ISelectProfileResponse";
2023-03-03 15:23:46 +00:00
@injectable()
2023-11-15 20:35:05 -05:00
export class NotifierStaticRouter extends StaticRouter
2023-03-03 15:23:46 +00:00
{
2023-11-15 20:35:05 -05:00
constructor(@inject("NotifierCallbacks") protected notifierCallbacks: NotifierCallbacks)
2023-03-03 15:23:46 +00:00
{
2023-11-15 20:35:05 -05:00
super([
new RouteAction(
"/client/notifier/channel/create",
async (
url: string,
info: any,
sessionID: string,
output: string,
): Promise<IGetBodyResponseData<INotifierChannel>> =>
2023-11-15 20:35:05 -05:00
{
return this.notifierCallbacks.createNotifierChannel(url, info, sessionID);
},
),
new RouteAction(
"/client/game/profile/select",
async (
url: string,
info: any,
sessionID: string,
output: string,
): Promise<IGetBodyResponseData<ISelectProfileResponse>> =>
2023-11-15 20:35:05 -05:00
{
return this.notifierCallbacks.selectProfile(url, info, sessionID);
},
),
]);
2023-03-03 15:23:46 +00:00
}
2023-11-15 20:35:05 -05:00
}