import * as akashicTypes from "../akashic/types"; const defaultErrorHandler: akashicTypes.AkashicEventHandler = { type: "error", protocol: "http", endpoint: "/logs?type=error", }; const defaultInstanceStateHandler: akashicTypes.AkashicEventHandler = { type: "instanceStatus", protocol: "http", endpoint: "/logs?type=status", }; const defaultGameEventHandler: akashicTypes.AkashicEventHandler = { type: "gameEvent", protocol: "http", endpoint: "/logs?type=game", }; const defaultEventHandlers: akashicTypes.AkashicEventHandler[] = [ defaultErrorHandler, defaultInstanceStateHandler, defaultGameEventHandler, ]; // TODO: いったん適当。本当はコンテンツごとにコールバック設定ができると吉 export function get(baseUrl: string, contentId: string) { return defaultEventHandlers.map((handler) => ({ type: handler.type, protocol: handler.protocol, endpoint: `${baseUrl}${handler.endpoint}`, })); }