@erebus-sh/sdk
Version:
To install dependencies:
322 lines • 10.3 kB
TypeScript
import { ErebusSession } from "@/service/session";
export type AppVars = {
reqId: string;
session?: ErebusSession;
};
type SessionProvider = (req: Request) => ErebusSession | Promise<ErebusSession>;
export declare function createApp(sessionOrProvider?: ErebusSession | SessionProvider): import("hono/hono-base").HonoBase<{
Variables: AppVars;
}, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
"/api/health-not-meaningful": {
$get: {
input: {};
output: {
ok: true;
reqId: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/generate-token-test": {
$get: {
input: {};
output: {
error: string;
reqId: string;
};
outputFormat: "json";
status: 400;
} | {
input: {};
output: {
token: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/erebus/pubsub/grant": {
$post: {
input: {
json: {
channel: string;
};
};
output: {
error: string;
reqId: string;
};
outputFormat: "json";
status: 400;
} | {
input: {
json: {
channel: string;
};
};
output: {
error: string;
reqId: string;
message: string;
};
outputFormat: "json";
status: 500;
} | {
input: {
json: {
channel: string;
};
};
output: {
grant_jwt: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/erebus/pubsub/fire-webhook": {
$post: {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
error: string;
};
outputFormat: "json";
status: 500;
} | {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
error: string;
};
outputFormat: "json";
status: 401;
} | {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
ok: true;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
}, "/">, "/">;
declare const routes: import("hono/hono-base").HonoBase<{
Variables: AppVars;
}, {
"/api/health-not-meaningful": {
$get: {
input: {};
output: {
ok: true;
reqId: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/generate-token-test": {
$get: {
input: {};
output: {
error: string;
reqId: string;
};
outputFormat: "json";
status: 400;
} | {
input: {};
output: {
token: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/erebus/pubsub/grant": {
$post: {
input: {
json: {
channel: string;
};
};
output: {
error: string;
reqId: string;
};
outputFormat: "json";
status: 400;
} | {
input: {
json: {
channel: string;
};
};
output: {
error: string;
reqId: string;
message: string;
};
outputFormat: "json";
status: 500;
} | {
input: {
json: {
channel: string;
};
};
output: {
grant_jwt: string;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
} & {
"/api/erebus/pubsub/fire-webhook": {
$post: {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
error: string;
};
outputFormat: "json";
status: 500;
} | {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
error: string;
};
outputFormat: "json";
status: 401;
} | {
input: {
json: {
messageBody: {
id: string;
topic: string;
senderId: string;
seq: string;
sentAt: unknown;
payload: string;
t_ingress?: number | undefined;
t_enqueued?: number | undefined;
t_broadcast_begin?: number | undefined;
t_ws_write_end?: number | undefined;
t_broadcast_end?: number | undefined;
clientMsgId?: string | undefined;
clientPublishTs?: number | undefined;
}[];
hmac: string;
};
};
output: {
ok: true;
};
outputFormat: "json";
status: import("hono/utils/http-status").ContentfulStatusCode;
};
};
}, "/">;
export type AppType = typeof routes;
export type AuthorizeServer = (req: Request) => ErebusSession | Promise<ErebusSession>;
export {};
//# sourceMappingURL=app.d.ts.map