UNPKG

@huddle01/server-sdk

Version:

The Huddle01 Server SDK allows you to perform protected admin actions on your server side, like generating peer access tokens and starting and stopping meeting recordings and livestreams.

653 lines (650 loc) 23.1 kB
import * as hono_utils_http_status from 'hono/utils/http-status'; import * as hono_client from 'hono/client'; declare const getInfraClient: (data: { apiKey: string; }) => { api: { v2: { sdk: hono_client.ClientRequest<{ $get: { input: {}; output: { ok: boolean; message: string; }; outputFormat: "json"; status: 200; }; }>; }; }; } & { api: { v2: { sdk: { metrics: hono_client.ClientRequest<{ $get: { input: {}; output: { message: string; }; outputFormat: "json"; status: 404; } | { input: {}; output: { totalSessions: number; totalDuration: number; totalUsers: number; recordingCount: number; livestreamCount: number; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { recordings: hono_client.ClientRequest<{ $get: { input: { query: { sessionId?: string | string[] | undefined; limit?: string | string[] | undefined; cursor?: string | string[] | undefined; }; }; output: { recordings: { id: string; recordingUrl: string; recordingSize: number; }[]; nextCursor: number | null; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { "live-sessions": { participants: { ":roomId": hono_client.ClientRequest<{ $get: { input: { param: { roomId: string; }; }; output: { ok: boolean; message: string; }; outputFormat: "json"; status: 404; } | { input: { param: { roomId: string; }; }; output: { count: number; participants: { peerId: string; joinTime: number | undefined; metadata: never; }[]; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; }; } & { api: { v2: { sdk: { "live-sessions": hono_client.ClientRequest<{ $get: { input: {}; output: { liveSessions: { roomId: string; startTime: number; livestreamCount: number; recordingCount: number; }[]; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { "live-sessions": { ":roomId": hono_client.ClientRequest<{ $get: { input: { param: { roomId: string; }; }; output: { ok: boolean; message: string; }; outputFormat: "json"; status: 404; } | { input: { param: { roomId: string; }; }; output: { liveSessions: { roomId: string; startTime: number; currentPeerCount: number; livestreamCount: number | null; recordingCount: number | null; }; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { metadata: hono_client.ClientRequest<{ $get: { input: { query: { roomId: string; }; }; output: never; outputFormat: "json"; status: 200; }; $post: { input: { query: { roomId: string; }; } & { json: { metadata?: string | undefined; }; }; output: never; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { metadata: { ":roomId": hono_client.ClientRequest<{ $get: { input: { param: { roomId: string; }; }; output: never; outputFormat: "json"; status: 200; }; $post: { input: { param: { roomId: string; }; } & { json: { metadata?: string | undefined; }; }; output: never; outputFormat: "json"; status: 200; }; }>; }; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "participant-lists": hono_client.ClientRequest<{ $get: { input: { query: { sessionId: string; }; }; output: { message: string; }; outputFormat: "json"; status: 404; } | { input: { query: { sessionId: string; }; }; output: { participants: { peerId: string; joinTime: number; exitTime: number | undefined; metadata: never; }[]; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "participant-list": hono_client.ClientRequest<{ $get: { input: { query: { sessionId: string; }; }; output: { message: string; }; outputFormat: "json"; status: 404; } | { input: { query: { sessionId: string; }; }; output: { participants: { peerId: string; joinTime: number; exitTime: number | undefined; metadata: never; }[]; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "session-details": hono_client.ClientRequest<{ $get: { input: { query: { roomId: string | string[]; limit?: string | string[] | undefined; cursor?: string | string[] | undefined; }; }; output: { message: string | undefined; }; outputFormat: "json"; status: 404; } | { input: { query: { roomId: string | string[]; limit?: string | string[] | undefined; cursor?: string | string[] | undefined; }; }; output: { sessions: { sessionId: string; endTime: number | null; startTime: number; }[]; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "room-details": { ":roomId": hono_client.ClientRequest<{ $get: { input: { param: { roomId: string; }; }; output: { metadata: {} | null; roomId: string; roomLocked: boolean; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "get-rooms": hono_client.ClientRequest<{ $get: { input: { query: { limit?: string | undefined; cursor?: string | undefined; }; }; output: { rooms: { roomId: string; createdAt: number; roomLocked: boolean; metadata: never; }[]; pageSize: number; current: number; nextCursor: number | null; prevCursor: number | null; count: number; }; outputFormat: "json"; status: 200; }; }>; }; }; }; }; } & { api: { v2: { sdk: { rooms: { "create-room": hono_client.ClientRequest<{ $post: { input: { json: { metadata?: string | undefined; roomLocked?: boolean | undefined; }; }; output: { message: string; data: { roomId: string; }; }; outputFormat: "json"; status: 201; }; }>; }; }; }; }; } & { api: { v2: { sdk: { "validate-room": hono_client.ClientRequest<{ $get: { input: { query: { roomId: string; }; }; output: { ok: boolean; message: string; validated: boolean; }; outputFormat: "json"; status: 401; } | { input: { query: { roomId: string; }; }; output: { ok: boolean; validated: boolean; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { "join-room-token": hono_client.ClientRequest<{ $post: { input: { json: { roomId: string; displayName?: string | undefined; userType?: "host" | "guest" | undefined; avatarUrl?: string | undefined; guestAsHost?: boolean | undefined; }; }; output: { token: string; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { "create-guest-token": hono_client.ClientRequest<{ $post: { input: { json: { data?: { guestType: "host" | "guest"; } | undefined; }; }; output: { ok: boolean; message: string; validated: boolean; }; outputFormat: "json"; status: hono_utils_http_status.StatusCode; } | { input: { json: { data?: { guestType: "host" | "guest"; } | undefined; }; }; output: { token: string; }; outputFormat: "json"; status: hono_utils_http_status.StatusCode; } | { input: { json: { data?: { guestType: "host" | "guest"; } | undefined; }; }; output: { ok: boolean; message: boolean; error: boolean; data: string; }; outputFormat: "json"; status: hono_utils_http_status.StatusCode; }; }>; }; }; }; } & { api: { v2: { sdk: { "create-peer-token": hono_client.ClientRequest<{ $post: { input: { json: { roomId: string; permissions: { admin: boolean; canConsume: boolean; canProduce: boolean; canProduceSources: { cam: boolean; mic: boolean; screen: boolean; }; canSendData: boolean; canRecvData: boolean; canUpdateMetadata: boolean; }; options?: { roomLocked?: boolean | undefined; maxPeersAllowed?: number | undefined; } | undefined; role?: string | undefined; metadata?: string | undefined; roomType?: "AUDIO" | "VIDEO" | undefined; muteOnEntry?: boolean | undefined; videoOnEntry?: boolean | undefined; ttl?: number | undefined; }; }; output: { token: string; }; outputFormat: "json"; status: 200; }; }>; }; }; }; } & { api: { v2: { sdk: { "get-whitelisted-domains": hono_client.ClientRequest<{ $get: { input: unknown; output: { ok: boolean; message: boolean; error: boolean; data: string; }; outputFormat: "json"; status: hono_utils_http_status.StatusCode; } | { input: unknown; output: { ok: boolean; whitelistedDomains: string[]; }; outputFormat: "json"; status: hono_utils_http_status.StatusCode; }; }>; }; }; }; }; type InfraApiType = ReturnType<typeof getInfraClient>; export { type InfraApiType, getInfraClient };