From d403f0ff42bb8a950c7d3a1ef1d75256d0ae0015 Mon Sep 17 00:00:00 2001 From: Yuzuki Aida Date: Wed, 5 Jun 2024 02:47:31 +0900 Subject: [PATCH] Add live metrics --- .../src/controllers/internal/on_publish.ts | 2 +- apps/push-serverless/src/services/action.ts | 33 +- apps/push-serverless/src/services/srs-api.ts | 98 ++ apps/push-serverless/src/types.ts | 1 + apps/push-serverless/src/utils/sessions.ts | 5 + .../20240604171658_add_stats/migration.sql | 2 + apps/server/prisma/schema.prisma | 1 + .../controllers/v1/internals/push/action.ts | 73 +- apps/server/src/controllers/v1/streams/get.ts | 5 +- apps/server/src/models/live.ts | 57 +- .../src/services/redis/live-bitrate-stats.ts | 49 + apps/web/organisms/live/admin/index.tsx | 35 +- .../stream-software/config-description.tsx | 25 + .../admin/{ => stream-software}/push-key.tsx | 0 .../live/admin/stream-software/stats.tsx | 129 ++ packages/api-types/api/$api.ts | 1565 ++++------------- .../api/v1/internals/push/action/index.ts | 23 +- .../api/v1/streams/_liveId@number/index.ts | 3 +- packages/api-types/common/types.ts | 20 + packages/api-types/external-mastodon/$api.ts | 33 +- packages/api-types/external-misskey/$api.ts | 31 +- packages/api-types/push/$api.ts | 58 +- packages/api-types/video/$api.ts | 60 +- 23 files changed, 881 insertions(+), 1427 deletions(-) create mode 100644 apps/server/prisma/migrations/20240604171658_add_stats/migration.sql create mode 100644 apps/server/src/services/redis/live-bitrate-stats.ts create mode 100644 apps/web/organisms/live/admin/stream-software/config-description.tsx rename apps/web/organisms/live/admin/{ => stream-software}/push-key.tsx (100%) create mode 100644 apps/web/organisms/live/admin/stream-software/stats.tsx diff --git a/apps/push-serverless/src/controllers/internal/on_publish.ts b/apps/push-serverless/src/controllers/internal/on_publish.ts index 74c38fc7..d01a0608 100644 --- a/apps/push-serverless/src/controllers/internal/on_publish.ts +++ b/apps/push-serverless/src/controllers/internal/on_publish.ts @@ -37,7 +37,7 @@ export const apiInternalOnPublish: Middleware = async ctx => { return; } - await Action.startStream(liveId, watchToken, body.client_id); + await Action.startStream(liveId, watchToken, body.client_id, body.stream_id); void client.v1.internals.push.action.$post({ body: { diff --git a/apps/push-serverless/src/services/action.ts b/apps/push-serverless/src/services/action.ts index 58d7788e..526c0b51 100644 --- a/apps/push-serverless/src/services/action.ts +++ b/apps/push-serverless/src/services/action.ts @@ -1,12 +1,15 @@ import { lives, rejectSession, sessions } from '../utils/sessions'; import { Encoder } from './encoder'; import { generateToken } from '../utils/token'; +import { client, serverToken } from '../utils/api'; +import { getStream } from './srs-api'; export class Action { static async startStream( liveId: number, watchToken: string, - clientId: string + clientId: string, + streamId: string ) { const currentSession = sessions.get(liveId); if (currentSession) { @@ -17,10 +20,34 @@ export class Action { const internalToken = generateToken(); const encoder = new Encoder(liveId, watchToken, internalToken); + const sendHeartbeat = async () => { + const streamInfo = await getStream(streamId); + const stats = streamInfo?.stream; + if (!stats) { + console.warn('stream not found', streamId, liveId); + return; + } + + void client.v1.internals.push.action.$post({ + body: { + liveId, + action: 'stream:heartbeat', + serverToken, + stats: stats + } + }); + }; + + const heartbeatInterval = setInterval( + () => void sendHeartbeat(), + 1000 * 15 + ); + sessions.set(liveId, { clientId, encoder, - internalToken + internalToken, + heartbeatInterval }); setTimeout(() => { @@ -28,6 +55,8 @@ export class Action { void encoder.encodeToLowQualityHls(); void encoder.encodeToAudio(); + void sendHeartbeat(); + // this.startRecording(liveId); }, 500); } diff --git a/apps/push-serverless/src/services/srs-api.ts b/apps/push-serverless/src/services/srs-api.ts index e98dd2aa..0c776265 100644 --- a/apps/push-serverless/src/services/srs-api.ts +++ b/apps/push-serverless/src/services/srs-api.ts @@ -8,3 +8,101 @@ export const kickoffClient = async (id: string) => { } }); }; + +/** "streams": [ + { + "id": "vid-ff500jr", + "name": "10_628f27feff6be7187b295317f8d5fe81e20e524f7f57e581c9430d3b3eea06ada579f23ba03c78ea43bf6c64520db4d6", + "vhost": "vid-8n5l812", + "app": "live", + "tcUrl": "rtmp://127.0.0.1/live", + "url": "/live/10_628f27feff6be7187b295317f8d5fe81e20e524f7f57e581c9430d3b3eea06ada579f23ba03c78ea43bf6c64520db4d6", + "live_ms": 1717517428337, + "clients": 6, + "frames": 7795, + "send_bytes": 186135731, + "recv_bytes": 44801527, + "kbps": { + "recv_30s": 2668, + "send_30s": 10686 + }, + "publish": { + "active": true, + "cid": "69kaucce" + }, + "video": { + "codec": "H264", + "profile": "High", + "level": "Other", + "width": 1920, + "height": 1080 + }, + "audio": { + "codec": "AAC", + "sample_rate": 44100, + "channel": 2, + "profile": "LC" + } + } + ] + */ +interface Stream { + id: string; + name: string; + vhost: string; + app: string; + tcUrl: string; + url: string; + live_ms: number; + clients: number; + frames: number; + send_bytes: number; + recv_bytes: number; + kbps: { + recv_30s: number; + send_30s: number; + }; + publish: { + active: boolean; + cid: string; + }; + video: { + codec: string; + profile: string; + level: string; + width: number; + height: number; + } | null; + audio: { + codec: string; + sample_rate: number; + channel: number; + profile: string; + } | null; +} + +interface StreamsResponse { + code: number; + server: string; + service: string; + pid: string; + streams: Stream[]; +} + +interface StreamResponse { + code: number; + server: string; + service: string; + pid: string; + stream?: Stream; +} + +export const getStreams = async () => { + const res = await fetch(`${API_ENDPOINT}/api/v1/streams`); + return res.json() as Promise; +}; + +export const getStream = async (id: string) => { + const res = await fetch(`${API_ENDPOINT}/api/v1/streams/${id}`); + return res.json() as Promise; +}; diff --git a/apps/push-serverless/src/types.ts b/apps/push-serverless/src/types.ts index 5ca7bb04..a62b21d5 100644 --- a/apps/push-serverless/src/types.ts +++ b/apps/push-serverless/src/types.ts @@ -8,6 +8,7 @@ export type SRSPublishCallback = { stream: string; tcUrl: string; param: string; + stream_id: string; }; export type SRSUnPublishCallback = { diff --git a/apps/push-serverless/src/utils/sessions.ts b/apps/push-serverless/src/utils/sessions.ts index dede72c8..1f7a3ce2 100644 --- a/apps/push-serverless/src/utils/sessions.ts +++ b/apps/push-serverless/src/utils/sessions.ts @@ -7,6 +7,7 @@ export const sessions = new Map< clientId: string; encoder: Encoder; internalToken: string; + heartbeatInterval?: NodeJS.Timeout; } >(); @@ -37,6 +38,10 @@ export const rejectSession = async (liveId: number) => { console.warn('cleanup error', liveId, e); } + if (session.heartbeatInterval) { + clearInterval(session.heartbeatInterval); + } + try { await kickoffClient(session.clientId); } catch (e) { diff --git a/apps/server/prisma/migrations/20240604171658_add_stats/migration.sql b/apps/server/prisma/migrations/20240604171658_add_stats/migration.sql new file mode 100644 index 00000000..fab1cb89 --- /dev/null +++ b/apps/server/prisma/migrations/20240604171658_add_stats/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Live" ADD COLUMN "stats" JSONB NOT NULL DEFAULT '{}'; diff --git a/apps/server/prisma/schema.prisma b/apps/server/prisma/schema.prisma index f48a904b..6e4f72ee 100644 --- a/apps/server/prisma/schema.prisma +++ b/apps/server/prisma/schema.prisma @@ -81,6 +81,7 @@ model Live { watchToken String? @db.VarChar(100) thumbnailId Int? config Json @default("{}") + stats Json @default("{}") isDeleted Boolean @default(false) isRecording Boolean @default(false) isPushing Boolean @default(false) diff --git a/apps/server/src/controllers/v1/internals/push/action.ts b/apps/server/src/controllers/v1/internals/push/action.ts index 9ba04c5c..5495c1af 100644 --- a/apps/server/src/controllers/v1/internals/push/action.ts +++ b/apps/server/src/controllers/v1/internals/push/action.ts @@ -29,7 +29,8 @@ const reqBodySchema: JSONSchemaType = { 'stream:stop', 'record:processing', 'record:done', - 'record:failed' + 'record:failed', + 'stream:heartbeat' ] }, serverToken: { @@ -42,6 +43,66 @@ const reqBodySchema: JSONSchemaType = { fileSize: { type: 'string', nullable: true + }, + stats: { + type: 'object', + properties: { + kbps: { + type: 'object', + properties: { + recv_30s: { + type: 'number' + }, + send_30s: { + type: 'number' + } + }, + required: ['recv_30s', 'send_30s'] + }, + video: { + type: 'object', + properties: { + codec: { + type: 'string' + }, + profile: { + type: 'string' + }, + level: { + type: 'string' + }, + width: { + type: 'number' + }, + height: { + type: 'number' + } + }, + required: ['codec', 'profile', 'level', 'width', 'height'], + nullable: true + }, + audio: { + type: 'object', + properties: { + codec: { + type: 'string' + }, + sample_rate: { + type: 'number' + }, + channel: { + type: 'number' + }, + profile: { + type: 'string' + } + }, + required: ['codec', 'sample_rate', 'channel', 'profile'], + nullable: true + } + }, + required: ['kbps'], + nullable: true } }, required: ['liveId', 'action', 'serverToken'], @@ -127,6 +188,16 @@ export const postV1InternalsPushAction: APIRoute< live.id, LiveRecordingStatus.Failed ); + } else if (body.action === 'stream:heartbeat') { + if (!body.stats) { + ctx.status = 400; + ctx.body = { + errorCode: 'invalid_request' + }; + return; + } + + await lives.updateStats(live, body.stats); } if (newLive) { diff --git a/apps/server/src/controllers/v1/streams/get.ts b/apps/server/src/controllers/v1/streams/get.ts index ecc1b3ad..65a16624 100644 --- a/apps/server/src/controllers/v1/streams/get.ts +++ b/apps/server/src/controllers/v1/streams/get.ts @@ -10,8 +10,9 @@ export const getV1Streams: APIRoute< never, Response, UserState & LiveState -> = ctx => { +> = async ctx => { ctx.body = { - live: lives.getPrivate(ctx.state.live) + live: lives.getPrivate(ctx.state.live), + stats: await lives.getStats(ctx.state.live) }; }; diff --git a/apps/server/src/models/live.ts b/apps/server/src/models/live.ts index 48aff90d..6d267702 100644 --- a/apps/server/src/models/live.ts +++ b/apps/server/src/models/live.ts @@ -1,7 +1,12 @@ import crypto from 'crypto'; import { Image, Live, LivePrivacy, PrismaClient, Tenant } from '@prisma/client'; import { images, liveStreamProgresses, lives, tenants } from '.'; -import { LiveConfig, LivePrivate, LivePublic } from 'api-types/common/types'; +import { + LiveConfig, + LivePrivate, + LivePublic, + LiveStats +} from 'api-types/common/types'; import { basePushStream, frontendUrl, @@ -13,6 +18,7 @@ import { pushApi } from '../services/push-api'; import { thumbnailStorage } from '../services/storage/thumbnail'; import { jwtWebInternalAPI } from '../services/jwt'; import { RelationCache } from '../services/redis/relation-cache'; +import { LiveBitrateStats } from '../services/redis/live-bitrate-stats'; export const Lives = (client: PrismaClient['live']) => Object.assign(client, { @@ -66,6 +72,17 @@ export const Lives = (client: PrismaClient['live']) => isRequiredFollower: config.isRequiredFollower ?? false }; }, + getStats: async (live: Live) => { + const stats = (live.stats || {}) as LiveStats; + const bitrate = await new LiveBitrateStats(live.id).getLatest(); + return { + ...stats, + kbps: { + recv_30s: bitrate?.recv_30s || 0, + send_30s: bitrate?.send_30s || 0 + } + } satisfies LiveStats; + }, get: async (id: number) => { const live = await client.findUnique({ where: { @@ -420,6 +437,44 @@ export const Lives = (client: PrismaClient['live']) => }); return data; + }, + updateStats: async (live: Live, stats: LiveStats) => { + const currentStats = (live.stats || {}) as LiveStats; + const same = + currentStats.audio?.channel === stats.audio?.channel && + currentStats.audio?.codec === stats.audio?.codec && + currentStats.audio?.profile === stats.audio?.profile && + currentStats.audio?.sample_rate === stats.audio?.sample_rate && + // いれてない + // currentStats.kbps.recv_30s === stats.kbps.recv_30s && + // currentStats.kbps.send_30s === stats.kbps.send_30s && + currentStats.video?.codec === stats.video?.codec && + currentStats.video?.height === stats.video?.height && + currentStats.video?.level === stats.video?.level && + currentStats.video?.profile === stats.video?.profile && + currentStats.video?.width === stats.video?.width; + const hasUpdate = !same; + + await new LiveBitrateStats(live.id).insert( + stats.kbps.recv_30s, + stats.kbps.send_30s + ); + + if (hasUpdate) { + return await client.update({ + where: { + id: live.id + }, + data: { + stats: { + audio: stats.audio, + video: stats.video + } + } + }); + } + + return undefined; } }); diff --git a/apps/server/src/services/redis/live-bitrate-stats.ts b/apps/server/src/services/redis/live-bitrate-stats.ts new file mode 100644 index 00000000..e5c46475 --- /dev/null +++ b/apps/server/src/services/redis/live-bitrate-stats.ts @@ -0,0 +1,49 @@ +import { redis } from './_client'; + +type LiveBitrate = { + recv_30s: number; + send_30s: number; + createdAt: number; +}; + +export class LiveBitrateStats { + private key: string; + constructor(liveId: number) { + this.key = `liveBitrate:${liveId}`; + } + + async remove() { + await redis.del(this.key); + } + + async insert(recv_30s: number, send_30s: number) { + await redis.rpush( + this.key, + JSON.stringify({ + recv_30s, + send_30s, + createdAt: Date.now() + } satisfies LiveBitrate) + ); + + // 最新100件だけ残す + await redis.ltrim(this.key, -100, -1); + + await redis.expire(this.key, 60 * 60 * 24); + } + + async getAll() { + const raw = await redis.lrange(this.key, 0, -1); + return raw.map(r => JSON.parse(r) as LiveBitrate); + } + + async getLatest() { + const raw = await redis.lrange(this.key, -1, -1); + const latest = raw[0]; + if (!latest) { + return undefined; + } + + return JSON.parse(latest) as LiveBitrate; + } +} diff --git a/apps/web/organisms/live/admin/index.tsx b/apps/web/organisms/live/admin/index.tsx index 9b865b02..2494450c 100644 --- a/apps/web/organisms/live/admin/index.tsx +++ b/apps/web/organisms/live/admin/index.tsx @@ -11,20 +11,19 @@ import { AlertIcon, Button, Center, - Spinner, - Text, - UnorderedList, - ListItem + Spinner } from '@chakra-ui/react'; import { FC, useEffect } from 'react'; import { useStream } from '~/utils/hooks/api/use-stream'; -import { PushKey } from './push-key'; +import { PushKey } from './stream-software/push-key'; import { CommentViewer } from './comment-viewer'; import { GeneralSettings } from './general-settings'; import Link from 'next/link'; import { LivePublic } from '~/../../packages/api-types/common/types'; import { AutoMods } from './auto-mods'; import { NewFeature } from '~/atoms/new-badge'; +import { ConfigDescription } from './stream-software/config-description'; +import { Stats } from './stream-software/stats'; type Props = { liveId: number; @@ -93,6 +92,11 @@ export const Admin: FC = ({ + + 配信サーバー設定 @@ -109,26 +113,7 @@ export const Admin: FC = ({ 配信ソフトウェア設定 - - 現在、配信システム側でハードリミットは設定されていませんが、快適な配信をするために以下の設定を推奨します。 - - - - - キーフレーム間隔: 1s (重要: - 間隔が大きい/オートだと視聴がカクつきます) - - - 映像エンコーダ: H264{' '} - の任意のハードウェア/ソフトウェアエンコーダ (重要: - H265(HEVC) は対応していません) - - 出力解像度: 1920x1080 - - ビットレート: 2000 kbps 前後 - (重くなる場合は落としてください) - - + diff --git a/apps/web/organisms/live/admin/stream-software/config-description.tsx b/apps/web/organisms/live/admin/stream-software/config-description.tsx new file mode 100644 index 00000000..ecce163d --- /dev/null +++ b/apps/web/organisms/live/admin/stream-software/config-description.tsx @@ -0,0 +1,25 @@ +import { ListItem, Text, UnorderedList } from '@chakra-ui/react'; +import { Fragment } from 'react'; + +export const ConfigDescription = () => ( + + + 現在、配信システム側でハードリミットは設定されていませんが、快適な配信をするために以下の設定を推奨します。 + + + + + キーフレーム間隔: 1s (重要: + 間隔が大きい/オートだと視聴がカクつきます) + + + 映像エンコーダ: H264 の任意のハードウェア/ソフトウェアエンコーダ + (重要: H265(HEVC) は対応していません) + + 出力解像度: 1920x1080 + + ビットレート: 2000 kbps 前後 (重くなる場合は落としてください) + + + +); diff --git a/apps/web/organisms/live/admin/push-key.tsx b/apps/web/organisms/live/admin/stream-software/push-key.tsx similarity index 100% rename from apps/web/organisms/live/admin/push-key.tsx rename to apps/web/organisms/live/admin/stream-software/push-key.tsx diff --git a/apps/web/organisms/live/admin/stream-software/stats.tsx b/apps/web/organisms/live/admin/stream-software/stats.tsx new file mode 100644 index 00000000..7c95ae5b --- /dev/null +++ b/apps/web/organisms/live/admin/stream-software/stats.tsx @@ -0,0 +1,129 @@ +import { + Grid, + GridItem, + HStack, + Heading, + Text, + VStack +} from '@chakra-ui/react'; +import { LiveStats } from 'api-types/common/types'; +import { FC } from 'react'; +import { + FiArrowDown, + FiArrowUp, + FiMic, + FiMinus, + FiRadio, + FiVideo +} from 'react-icons/fi'; + +interface Props { + isPushing: boolean; + stats?: LiveStats; +} + +export const Stats: FC = ({ isPushing, stats }) => ( + + + + + Live Metrics (Beta) + + + + {isPushing ? : } + {isPushing ? 'プッシュ中' : 'オフライン'} + + + + {stats?.kbps && isPushing && ( + + + + + {stats.kbps?.recv_30s ? ( + `${stats.kbps.recv_30s}kbps` + ) : ( + 計測中 + )} + + + + + + {stats.kbps?.send_30s ? ( + `${stats.kbps.send_30s}kbps` + ) : ( + 計測中 + )} + + + )} + + + + + 映像 + + + {stats?.video && isPushing ? ( + + + 解像度 + コーデック + プロファイル + + + + + {stats?.video?.width}x{stats?.video?.height} + + {stats?.video?.codec} + {stats?.video?.profile} + + + ) : ( + 映像入力なし + )} + + + + + 音声 + + + {stats?.audio && isPushing ? ( + + + サンプリングレート + チャンネル + コーデック + プロファイル + + + + {stats?.audio?.sample_rate}Hz + {stats?.audio?.channel} + {stats?.audio?.codec} + {stats?.audio?.profile} + + + ) : ( + 音声入力なし + )} + + +); diff --git a/packages/api-types/api/$api.ts b/packages/api-types/api/$api.ts index 0529f610..2cfb3ad3 100644 --- a/packages/api-types/api/$api.ts +++ b/packages/api-types/api/$api.ts @@ -1,46 +1,46 @@ import type { AspidaClient } from 'aspida'; import { dataToURLString } from 'aspida'; -import type { Methods as Methods0 } from './v1/about'; -import type { Methods as Methods1 } from './v1/auth/mastodon/callback'; -import type { Methods as Methods2 } from './v1/auth/mastodon/login'; -import type { Methods as Methods3 } from './v1/auth/mastodon/refresh'; -import type { Methods as Methods4 } from './v1/auth/mastodon/revoke'; -import type { Methods as Methods5 } from './v1/auth/mastodon/token'; -import type { Methods as Methods6 } from './v1/auth/misskey/callback'; -import type { Methods as Methods7 } from './v1/auth/misskey/login'; -import type { Methods as Methods8 } from './v1/auth/misskey/refresh'; -import type { Methods as Methods9 } from './v1/auth/misskey/revoke'; -import type { Methods as Methods10 } from './v1/auth/misskey/token'; -import type { Methods as Methods11 } from './v1/internals/push/action'; -import type { Methods as Methods12 } from './v1/internals/push/check-token'; -import type { Methods as Methods13 } from './v1/internals/video/check-outdated'; -import type { Methods as Methods14 } from './v1/internals/video/signal'; -import type { Methods as Methods15 } from './v1/invites'; -import type { Methods as Methods16 } from './v1/lives/_liveId@number'; -import type { Methods as Methods17 } from './v1/lives/_liveId@number/check-relation'; -import type { Methods as Methods18 } from './v1/lives/_liveId@number/comments'; -import type { Methods as Methods19 } from './v1/lives/_liveId@number/count'; -import type { Methods as Methods20 } from './v1/lives/_liveId@number/url'; -import type { Methods as Methods21 } from './v1/lives/explore'; -import type { Methods as Methods22 } from './v1/lives/find/_slug@string/_idInTenant@number'; -import type { Methods as Methods23 } from './v1/streams'; -import type { Methods as Methods24 } from './v1/streams/_liveId@number'; -import type { Methods as Methods25 } from './v1/streams/_liveId@number/action'; -import type { Methods as Methods26 } from './v1/streams/_liveId@number/comment-viewer-url'; -import type { Methods as Methods27 } from './v1/streams/_liveId@number/recording'; -import type { Methods as Methods28 } from './v1/streams/_liveId@number/url'; -import type { Methods as Methods29 } from './v1/streams/thumbnail'; -import type { Methods as Methods30 } from './v1/tenants'; -import type { Methods as Methods31 } from './v1/tenants/_tenantId@number'; -import type { Methods as Methods32 } from './v1/tenants/_tenantId@number/auto-mod'; -import type { Methods as Methods33 } from './v1/tenants/_tenantId@number/auto-mod/_id@number'; -import type { Methods as Methods34 } from './v1/tenants/_tenantId@number/lives'; -import type { Methods as Methods35 } from './v1/tenants/find/_slugOrId'; -import type { Methods as Methods36 } from './v1/tenants/find/_slugOrId/lives'; -import type { Methods as Methods37 } from './v1/users/_userId@number'; -import type { Methods as Methods38 } from './v1/users/me'; -import type { Methods as Methods39 } from './v1/videos/_liveId@number'; -import type { Methods as Methods40 } from './v1/videos/_liveId@number/event'; +import type { Methods as Methods_b3exqt } from './v1/about'; +import type { Methods as Methods_zo9ena } from './v1/auth/mastodon/callback'; +import type { Methods as Methods_yck5jm } from './v1/auth/mastodon/login'; +import type { Methods as Methods_g7lqtw } from './v1/auth/mastodon/refresh'; +import type { Methods as Methods_1alo4nn } from './v1/auth/mastodon/revoke'; +import type { Methods as Methods_vwwzrm } from './v1/auth/mastodon/token'; +import type { Methods as Methods_4j9x8 } from './v1/auth/misskey/callback'; +import type { Methods as Methods_rweivk } from './v1/auth/misskey/login'; +import type { Methods as Methods_7ek692 } from './v1/auth/misskey/refresh'; +import type { Methods as Methods_12e73wp } from './v1/auth/misskey/revoke'; +import type { Methods as Methods_oqqrxc } from './v1/auth/misskey/token'; +import type { Methods as Methods_1l7izl6 } from './v1/internals/push/action'; +import type { Methods as Methods_jvbbec } from './v1/internals/push/check-token'; +import type { Methods as Methods_1iiv4ik } from './v1/internals/video/check-outdated'; +import type { Methods as Methods_gu6xh7 } from './v1/internals/video/signal'; +import type { Methods as Methods_a24e26 } from './v1/invites'; +import type { Methods as Methods_l6a9uv } from './v1/lives/_liveId@number'; +import type { Methods as Methods_1xrcwxj } from './v1/lives/_liveId@number/check-relation'; +import type { Methods as Methods_1n6zere } from './v1/lives/_liveId@number/comments'; +import type { Methods as Methods_1lxg5o7 } from './v1/lives/_liveId@number/count'; +import type { Methods as Methods_hchnah } from './v1/lives/_liveId@number/url'; +import type { Methods as Methods_1ou31sr } from './v1/lives/explore'; +import type { Methods as Methods_1jqr2r8 } from './v1/lives/find/_slug@string/_idInTenant@number'; +import type { Methods as Methods_5gnb9l } from './v1/streams'; +import type { Methods as Methods_1veam95 } from './v1/streams/_liveId@number'; +import type { Methods as Methods_1rprl8g } from './v1/streams/_liveId@number/action'; +import type { Methods as Methods_xu6x0k } from './v1/streams/_liveId@number/comment-viewer-url'; +import type { Methods as Methods_1atwewx } from './v1/streams/_liveId@number/recording'; +import type { Methods as Methods_dnsr } from './v1/streams/_liveId@number/url'; +import type { Methods as Methods_9qhh6i } from './v1/streams/thumbnail'; +import type { Methods as Methods_1jkaejl } from './v1/tenants'; +import type { Methods as Methods_e5218j } from './v1/tenants/_tenantId@number'; +import type { Methods as Methods_oshzm6 } from './v1/tenants/_tenantId@number/auto-mod'; +import type { Methods as Methods_bvnwsq } from './v1/tenants/_tenantId@number/auto-mod/_id@number'; +import type { Methods as Methods_14fcgzb } from './v1/tenants/_tenantId@number/lives'; +import type { Methods as Methods_15me5i4 } from './v1/tenants/find/_slugOrId'; +import type { Methods as Methods_1dslozc } from './v1/tenants/find/_slugOrId/lives'; +import type { Methods as Methods_1npqkyd } from './v1/users/_userId@number'; +import type { Methods as Methods_zyr5pb } from './v1/users/me'; +import type { Methods as Methods_1g8nz8q } from './v1/videos/_liveId@number'; +import type { Methods as Methods_117kp4t } from './v1/videos/_liveId@number/event'; const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, ''); @@ -88,404 +88,136 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { v1: { about: { - get: ( - option?: - | { - headers?: Methods0['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, PATH0, GET, option).json(), - $get: ( - option?: - | { - headers?: Methods0['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, PATH0, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH0}` + get: (option?: { headers?: Methods_b3exqt['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, PATH0, GET, option).json(), + $get: (option?: { headers?: Methods_b3exqt['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, PATH0, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}`, }, auth: { mastodon: { callback: { - get: (option: { - query: Methods1['get']['query']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH1, - GET, - option - ).json(), - $get: (option: { - query: Methods1['get']['query']; - config?: T | undefined; - }) => - fetch(prefix, PATH1, GET, option) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods1['get']['query']; - } - | undefined - ) => - `${prefix}${PATH1}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option: { query: Methods_zo9ena['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH1, GET, option).json(), + $get: (option: { query: Methods_zo9ena['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH1, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_zo9ena['get']['query'] } | undefined) => + `${prefix}${PATH1}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, login: { - get: (option: { - query: Methods2['get']['query']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH2, - GET, - option - ).json(), - $get: (option: { - query: Methods2['get']['query']; - config?: T | undefined; - }) => - fetch(prefix, PATH2, GET, option) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods2['get']['query']; - } - | undefined - ) => - `${prefix}${PATH2}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option: { query: Methods_yck5jm['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH2, GET, option).json(), + $get: (option: { query: Methods_yck5jm['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH2, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_yck5jm['get']['query'] } | undefined) => + `${prefix}${PATH2}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, refresh: { - post: (option: { - body: Methods3['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH3, - POST, - option - ).json(), - $post: (option: { - body: Methods3['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH3, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH3}` + post: (option: { body: Methods_g7lqtw['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH3, POST, option).json(), + $post: (option: { body: Methods_g7lqtw['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH3, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH3}`, }, revoke: { - post: (option: { - body: Methods4['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH4, - POST, - option - ).json(), - $post: (option: { - body: Methods4['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH4, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH4}` + post: (option: { body: Methods_1alo4nn['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH4, POST, option).json(), + $post: (option: { body: Methods_1alo4nn['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH4, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH4}`, }, token: { - post: (option: { - body: Methods5['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH5, - POST, - option - ).json(), - $post: (option: { - body: Methods5['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH5, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH5}` - } + post: (option: { body: Methods_vwwzrm['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH5, POST, option).json(), + $post: (option: { body: Methods_vwwzrm['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH5, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH5}`, + }, }, misskey: { callback: { - get: (option: { - query: Methods6['get']['query']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH6, - GET, - option - ).json(), - $get: (option: { - query: Methods6['get']['query']; - config?: T | undefined; - }) => - fetch(prefix, PATH6, GET, option) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods6['get']['query']; - } - | undefined - ) => - `${prefix}${PATH6}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option: { query: Methods_4j9x8['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH6, GET, option).json(), + $get: (option: { query: Methods_4j9x8['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH6, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_4j9x8['get']['query'] } | undefined) => + `${prefix}${PATH6}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, login: { - get: (option: { - query: Methods7['get']['query']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH7, - GET, - option - ).json(), - $get: (option: { - query: Methods7['get']['query']; - config?: T | undefined; - }) => - fetch(prefix, PATH7, GET, option) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods7['get']['query']; - } - | undefined - ) => - `${prefix}${PATH7}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option: { query: Methods_rweivk['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH7, GET, option).json(), + $get: (option: { query: Methods_rweivk['get']['query'], config?: T | undefined }) => + fetch(prefix, PATH7, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_rweivk['get']['query'] } | undefined) => + `${prefix}${PATH7}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, refresh: { - post: (option: { - body: Methods8['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH8, - POST, - option - ).json(), - $post: (option: { - body: Methods8['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH8, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH8}` + post: (option: { body: Methods_7ek692['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH8, POST, option).json(), + $post: (option: { body: Methods_7ek692['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH8, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH8}`, }, revoke: { - post: (option: { - body: Methods9['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH9, - POST, - option - ).json(), - $post: (option: { - body: Methods9['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH9, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH9}` + post: (option: { body: Methods_12e73wp['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH9, POST, option).json(), + $post: (option: { body: Methods_12e73wp['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH9, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH9}`, }, token: { - post: (option: { - body: Methods10['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH10, - POST, - option - ).json(), - $post: (option: { - body: Methods10['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH10, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH10}` - } - } + post: (option: { body: Methods_oqqrxc['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH10, POST, option).json(), + $post: (option: { body: Methods_oqqrxc['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH10, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH10}`, + }, + }, }, internals: { push: { action: { - post: (option: { - body: Methods11['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH11, - POST, - option - ).json(), - $post: (option: { - body: Methods11['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH11, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH11}` + post: (option: { body: Methods_1l7izl6['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH11, POST, option).json(), + $post: (option: { body: Methods_1l7izl6['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH11, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH11}`, }, check_token: { - post: (option: { - body: Methods12['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH12, - POST, - option - ).json(), - $post: (option: { - body: Methods12['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH12, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH12}` - } + post: (option: { body: Methods_jvbbec['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH12, POST, option).json(), + $post: (option: { body: Methods_jvbbec['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH12, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH12}`, + }, }, video: { check_outdated: { - post: (option: { - body: Methods13['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH13, - POST, - option - ).json(), - $post: (option: { - body: Methods13['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH13, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH13}` + post: (option: { body: Methods_1iiv4ik['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH13, POST, option).json(), + $post: (option: { body: Methods_1iiv4ik['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH13, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH13}`, }, signal: { - post: (option: { - body: Methods14['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH14, - POST, - option - ).json(), - $post: (option: { - body: Methods14['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH14, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH14}` - } - } + post: (option: { body: Methods_gu6xh7['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH14, POST, option).json(), + $post: (option: { body: Methods_gu6xh7['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH14, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH14}`, + }, + }, }, invites: { - get: (option: { - headers: Methods15['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH15, - GET, - option - ).json(), - $get: (option: { - headers: Methods15['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH15, GET, option) - .json() - .then(r => r.body), - post: (option: { - headers: Methods15['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH15, - POST, - option - ).json(), - $post: (option: { - headers: Methods15['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH15, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH15}` + get: (option: { headers: Methods_a24e26['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH15, GET, option).json(), + $get: (option: { headers: Methods_a24e26['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH15, GET, option).json().then(r => r.body), + post: (option: { headers: Methods_a24e26['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH15, POST, option).json(), + $post: (option: { headers: Methods_a24e26['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH15, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH15}`, }, lives: { _liveId: (val2: number) => { @@ -493,249 +225,55 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { check_relation: { - post: (option: { - body: Methods17['post']['reqBody']; - headers?: Methods17['post']['reqHeaders'] | undefined; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH17}`, - POST, - option - ).json(), - $post: (option: { - body: Methods17['post']['reqBody']; - headers?: Methods17['post']['reqHeaders'] | undefined; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH17}`, - POST, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH17}` + post: (option: { body: Methods_1xrcwxj['post']['reqBody'], headers?: Methods_1xrcwxj['post']['reqHeaders'] | undefined, config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH17}`, POST, option).json(), + $post: (option: { body: Methods_1xrcwxj['post']['reqBody'], headers?: Methods_1xrcwxj['post']['reqHeaders'] | undefined, config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH17}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH17}`, }, comments: { - get: ( - option?: - | { - query?: Methods18['get']['query'] | undefined; - headers?: Methods18['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH18}`, - GET, - option - ).json(), - $get: ( - option?: - | { - query?: Methods18['get']['query'] | undefined; - headers?: Methods18['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH18}`, - GET, - option - ) - .json() - .then(r => r.body), - post: (option: { - body: Methods18['post']['reqBody']; - headers: Methods18['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH18}`, - POST, - option - ).json(), - $post: (option: { - body: Methods18['post']['reqBody']; - headers: Methods18['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH18}`, - POST, - option - ) - .json() - .then(r => r.body), - delete: (option: { - query: Methods18['delete']['query']; - headers: Methods18['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH18}`, - DELETE, - option - ).json(), - $delete: (option: { - query: Methods18['delete']['query']; - headers: Methods18['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH18}`, - DELETE, - option - ) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods18['get']['query']; - } - | { method: 'delete'; query: Methods18['delete']['query'] } - | undefined - ) => - `${prefix}${prefix2}${PATH18}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option?: { query?: Methods_1n6zere['get']['query'] | undefined, headers?: Methods_1n6zere['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH18}`, GET, option).json(), + $get: (option?: { query?: Methods_1n6zere['get']['query'] | undefined, headers?: Methods_1n6zere['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH18}`, GET, option).json().then(r => r.body), + post: (option: { body: Methods_1n6zere['post']['reqBody'], headers: Methods_1n6zere['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH18}`, POST, option).json(), + $post: (option: { body: Methods_1n6zere['post']['reqBody'], headers: Methods_1n6zere['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH18}`, POST, option).json().then(r => r.body), + delete: (option: { query: Methods_1n6zere['delete']['query'], headers: Methods_1n6zere['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH18}`, DELETE, option).json(), + $delete: (option: { query: Methods_1n6zere['delete']['query'], headers: Methods_1n6zere['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH18}`, DELETE, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_1n6zere['get']['query'] } | { method: 'delete'; query: Methods_1n6zere['delete']['query'] } | undefined) => + `${prefix}${prefix2}${PATH18}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, count: { - get: ( - option?: - | { - headers?: Methods19['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH19}`, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods19['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH19}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH19}` + get: (option?: { headers?: Methods_1lxg5o7['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH19}`, GET, option).json(), + $get: (option?: { headers?: Methods_1lxg5o7['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH19}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH19}`, }, url: { - get: ( - option?: - | { - headers?: Methods20['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH20}`, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods20['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH20}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH20}` + get: (option?: { headers?: Methods_hchnah['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH20}`, GET, option).json(), + $get: (option?: { headers?: Methods_hchnah['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH20}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH20}`, }, - get: ( - option?: - | { - headers?: Methods16['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix2, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods16['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, prefix2, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}` + get: (option?: { headers?: Methods_l6a9uv['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json(), + $get: (option?: { headers?: Methods_l6a9uv['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}`, }; }, explore: { - get: ( - option?: - | { - headers?: Methods21['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - PATH21, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods21['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, PATH21, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH21}` + get: (option?: { headers?: Methods_1ou31sr['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, PATH21, GET, option).json(), + $get: (option?: { headers?: Methods_1ou31sr['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, PATH21, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH21}`, }, find: { _slug: (val3: string) => { @@ -746,42 +284,16 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix4 = `${prefix3}/${val4}`; return { - get: ( - option?: - | { - headers?: Methods22['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix4, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods22['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix4, - GET, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix4}` + get: (option?: { headers?: Methods_1jqr2r8['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix4, GET, option).json(), + $get: (option?: { headers?: Methods_1jqr2r8['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix4, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix4}`, }; - } + }, }; - } - } + }, + }, }, streams: { _liveId: (val2: number) => { @@ -789,244 +301,64 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { action: { - post: (option: { - body: Methods25['post']['reqBody']; - headers: Methods25['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH24}`, - POST, - option - ).json(), - $post: (option: { - body: Methods25['post']['reqBody']; - headers: Methods25['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH24}`, - POST, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH24}` + post: (option: { body: Methods_1rprl8g['post']['reqBody'], headers: Methods_1rprl8g['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH24}`, POST, option).json(), + $post: (option: { body: Methods_1rprl8g['post']['reqBody'], headers: Methods_1rprl8g['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH24}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH24}`, }, comment_viewer_url: { - get: (option: { - headers: Methods26['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH25}`, - GET, - option - ).json(), - $get: (option: { - headers: Methods26['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH25}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH25}` + get: (option: { headers: Methods_xu6x0k['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH25}`, GET, option).json(), + $get: (option: { headers: Methods_xu6x0k['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH25}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH25}`, }, recording: { - post: (option: { - headers: Methods27['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH26}`, - POST, - option - ).json(), - $post: (option: { - headers: Methods27['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH26}`, - POST, - option - ) - .json() - .then(r => r.body), - delete: (option: { - headers: Methods27['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH26}`, - DELETE, - option - ).json(), - $delete: (option: { - headers: Methods27['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH26}`, - DELETE, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH26}` + post: (option: { headers: Methods_1atwewx['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH26}`, POST, option).json(), + $post: (option: { headers: Methods_1atwewx['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH26}`, POST, option).json().then(r => r.body), + delete: (option: { headers: Methods_1atwewx['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH26}`, DELETE, option).json(), + $delete: (option: { headers: Methods_1atwewx['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH26}`, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH26}`, }, url: { - get: (option: { - headers: Methods28['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH20}`, - GET, - option - ).json(), - $get: (option: { - headers: Methods28['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH20}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH20}` + get: (option: { headers: Methods_dnsr['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH20}`, GET, option).json(), + $get: (option: { headers: Methods_dnsr['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH20}`, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH20}`, }, - patch: (option: { - body: Methods24['patch']['reqBody']; - headers: Methods24['patch']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - PATCH, - option - ).json(), - $patch: (option: { - body: Methods24['patch']['reqBody']; - headers: Methods24['patch']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - PATCH, - option - ) - .json() - .then(r => r.body), - get: (option: { - headers: Methods24['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - GET, - option - ).json(), - $get: (option: { - headers: Methods24['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, prefix2, GET, option) - .json() - .then(r => r.body), - delete: (option: { - headers: Methods24['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - DELETE, - option - ).json(), - $delete: (option: { - headers: Methods24['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - DELETE, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}` + patch: (option: { body: Methods_1veam95['patch']['reqBody'], headers: Methods_1veam95['patch']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, PATCH, option).json(), + $patch: (option: { body: Methods_1veam95['patch']['reqBody'], headers: Methods_1veam95['patch']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, PATCH, option).json().then(r => r.body), + get: (option: { headers: Methods_1veam95['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, GET, option).json(), + $get: (option: { headers: Methods_1veam95['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + delete: (option: { headers: Methods_1veam95['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, DELETE, option).json(), + $delete: (option: { headers: Methods_1veam95['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}`, }; }, thumbnail: { - post: (option: { - body: Methods29['post']['reqBody']; - headers: Methods29['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH27, - POST, - option, - 'FormData' - ).json(), - $post: (option: { - body: Methods29['post']['reqBody']; - headers: Methods29['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH27, - POST, - option, - 'FormData' - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH27}` + post: (option: { body: Methods_9qhh6i['post']['reqBody'], headers: Methods_9qhh6i['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH27, POST, option, 'FormData').json(), + $post: (option: { body: Methods_9qhh6i['post']['reqBody'], headers: Methods_9qhh6i['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH27, POST, option, 'FormData').json().then(r => r.body), + $path: () => `${prefix}${PATH27}`, }, - post: (option: { - body: Methods23['post']['reqBody']; - headers: Methods23['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH23, - POST, - option - ).json(), - $post: (option: { - body: Methods23['post']['reqBody']; - headers: Methods23['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH23, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH23}` + post: (option: { body: Methods_5gnb9l['post']['reqBody'], headers: Methods_5gnb9l['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH23, POST, option).json(), + $post: (option: { body: Methods_5gnb9l['post']['reqBody'], headers: Methods_5gnb9l['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH23, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH23}`, }, tenants: { _tenantId: (val2: number) => { @@ -1038,168 +370,40 @@ const api = ({ baseURL, fetch }: AspidaClient) => { const prefix4 = `${prefix2}${PATH29}/${val4}`; return { - delete: (option: { - headers: Methods33['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix4, - DELETE, - option - ).json(), - $delete: (option: { - headers: Methods33['delete']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix4, - DELETE, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix4}` + delete: (option: { headers: Methods_bvnwsq['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix4, DELETE, option).json(), + $delete: (option: { headers: Methods_bvnwsq['delete']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix4, DELETE, option).json().then(r => r.body), + $path: () => `${prefix}${prefix4}`, }; }, - get: (option: { - headers: Methods32['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH29}`, - GET, - option - ).json(), - $get: (option: { - headers: Methods32['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH29}`, - GET, - option - ) - .json() - .then(r => r.body), - post: (option: { - body: Methods32['post']['reqBody']; - headers: Methods32['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH29}`, - POST, - option - ).json(), - $post: (option: { - body: Methods32['post']['reqBody']; - headers: Methods32['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH29}`, - POST, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH29}` + get: (option: { headers: Methods_oshzm6['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH29}`, GET, option).json(), + $get: (option: { headers: Methods_oshzm6['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH29}`, GET, option).json().then(r => r.body), + post: (option: { body: Methods_oshzm6['post']['reqBody'], headers: Methods_oshzm6['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH29}`, POST, option).json(), + $post: (option: { body: Methods_oshzm6['post']['reqBody'], headers: Methods_oshzm6['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH29}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH29}`, }, lives: { - get: ( - option?: - | { - query?: Methods34['get']['query'] | undefined; - headers?: Methods34['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH30}`, - GET, - option - ).json(), - $get: ( - option?: - | { - query?: Methods34['get']['query'] | undefined; - headers?: Methods34['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix2}${PATH30}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods34['get']['query']; - } - | undefined - ) => - `${prefix}${prefix2}${PATH30}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option?: { query?: Methods_14fcgzb['get']['query'] | undefined, headers?: Methods_14fcgzb['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH30}`, GET, option).json(), + $get: (option?: { query?: Methods_14fcgzb['get']['query'] | undefined, headers?: Methods_14fcgzb['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix2}${PATH30}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_14fcgzb['get']['query'] } | undefined) => + `${prefix}${prefix2}${PATH30}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, - patch: (option: { - body: Methods31['patch']['reqBody']; - headers: Methods31['patch']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - PATCH, - option - ).json(), - $patch: (option: { - body: Methods31['patch']['reqBody']; - headers: Methods31['patch']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - PATCH, - option - ) - .json() - .then(r => r.body), - get: (option: { - headers: Methods31['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - prefix2, - GET, - option - ).json(), - $get: (option: { - headers: Methods31['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, prefix2, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}` + patch: (option: { body: Methods_e5218j['patch']['reqBody'], headers: Methods_e5218j['patch']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, PATCH, option).json(), + $patch: (option: { body: Methods_e5218j['patch']['reqBody'], headers: Methods_e5218j['patch']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, PATCH, option).json().then(r => r.body), + get: (option: { headers: Methods_e5218j['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, GET, option).json(), + $get: (option: { headers: Methods_e5218j['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}`, }; }, find: { @@ -1208,172 +412,50 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { lives: { - get: ( - option?: - | { - query?: Methods36['get']['query'] | undefined; - headers?: Methods36['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix3}${PATH30}`, - GET, - option - ).json(), - $get: ( - option?: - | { - query?: Methods36['get']['query'] | undefined; - headers?: Methods36['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - `${prefix3}${PATH30}`, - GET, - option - ) - .json() - .then(r => r.body), - $path: ( - option?: - | { - method?: 'get' | undefined; - query: Methods36['get']['query']; - } - | undefined - ) => - `${prefix}${prefix3}${PATH30}${ - option && option.query - ? `?${dataToURLString(option.query)}` - : '' - }` + get: (option?: { query?: Methods_1dslozc['get']['query'] | undefined, headers?: Methods_1dslozc['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix3}${PATH30}`, GET, option).json(), + $get: (option?: { query?: Methods_1dslozc['get']['query'] | undefined, headers?: Methods_1dslozc['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, `${prefix3}${PATH30}`, GET, option).json().then(r => r.body), + $path: (option?: { method?: 'get' | undefined; query: Methods_1dslozc['get']['query'] } | undefined) => + `${prefix}${prefix3}${PATH30}${option && option.query ? `?${dataToURLString(option.query)}` : ''}`, }, - get: ( - option?: - | { - headers?: Methods35['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix3, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods35['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, prefix3, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix3}` + get: (option?: { headers?: Methods_15me5i4['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix3, GET, option).json(), + $get: (option?: { headers?: Methods_15me5i4['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix3, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix3}`, }; - } + }, }, - get: (option: { - headers: Methods30['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH28, - GET, - option - ).json(), - $get: (option: { - headers: Methods30['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH28, GET, option) - .json() - .then(r => r.body), - post: (option: { - body: Methods30['post']['reqBody']; - headers: Methods30['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH28, - POST, - option - ).json(), - $post: (option: { - body: Methods30['post']['reqBody']; - headers: Methods30['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH28, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH28}` + get: (option: { headers: Methods_1jkaejl['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH28, GET, option).json(), + $get: (option: { headers: Methods_1jkaejl['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH28, GET, option).json().then(r => r.body), + post: (option: { body: Methods_1jkaejl['post']['reqBody'], headers: Methods_1jkaejl['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH28, POST, option).json(), + $post: (option: { body: Methods_1jkaejl['post']['reqBody'], headers: Methods_1jkaejl['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH28, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH28}`, }, users: { _userId: (val2: number) => { const prefix2 = `${PATH32}/${val2}`; return { - get: ( - option?: - | { - headers?: Methods37['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix2, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods37['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, prefix2, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}` + get: (option?: { headers?: Methods_1npqkyd['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json(), + $get: (option?: { headers?: Methods_1npqkyd['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}`, }; }, me: { - get: (option: { - headers: Methods38['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH33, - GET, - option - ).json(), - $get: (option: { - headers: Methods38['get']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH33, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH33}` - } + get: (option: { headers: Methods_zyr5pb['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH33, GET, option).json(), + $get: (option: { headers: Methods_zyr5pb['get']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH33, GET, option).json().then(r => r.body), + $path: () => `${prefix}${PATH33}`, + }, }, videos: { _liveId: (val2: number) => { @@ -1381,62 +463,21 @@ const api = ({ baseURL, fetch }: AspidaClient) => { return { event: { - post: (option: { - body: Methods40['post']['reqBody']; - headers?: Methods40['post']['reqHeaders'] | undefined; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH35}`, - POST, - option - ).json(), - $post: (option: { - body: Methods40['post']['reqBody']; - headers?: Methods40['post']['reqHeaders'] | undefined; - config?: T | undefined; - }) => - fetch( - prefix, - `${prefix2}${PATH35}`, - POST, - option - ) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}${PATH35}` + post: (option: { body: Methods_117kp4t['post']['reqBody'], headers?: Methods_117kp4t['post']['reqHeaders'] | undefined, config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH35}`, POST, option).json(), + $post: (option: { body: Methods_117kp4t['post']['reqBody'], headers?: Methods_117kp4t['post']['reqHeaders'] | undefined, config?: T | undefined }) => + fetch(prefix, `${prefix2}${PATH35}`, POST, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}${PATH35}`, }, - get: ( - option?: - | { - headers?: Methods39['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch( - prefix, - prefix2, - GET, - option - ).json(), - $get: ( - option?: - | { - headers?: Methods39['get']['reqHeaders'] | undefined; - config?: T | undefined; - } - | undefined - ) => - fetch(prefix, prefix2, GET, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${prefix2}` + get: (option?: { headers?: Methods_1g8nz8q['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json(), + $get: (option?: { headers?: Methods_1g8nz8q['get']['reqHeaders'] | undefined, config?: T | undefined } | undefined) => + fetch(prefix, prefix2, GET, option).json().then(r => r.body), + $path: () => `${prefix}${prefix2}`, }; - } - } - } + }, + }, + }, }; }; diff --git a/packages/api-types/api/v1/internals/push/action/index.ts b/packages/api-types/api/v1/internals/push/action/index.ts index 893cd09a..d632d402 100644 --- a/packages/api-types/api/v1/internals/push/action/index.ts +++ b/packages/api-types/api/v1/internals/push/action/index.ts @@ -3,7 +3,8 @@ export type Event = | 'stream:stop' | 'record:processing' | 'record:done' - | 'record:failed'; + | 'record:failed' + | 'stream:heartbeat'; export type Methods = { post: { @@ -14,6 +15,26 @@ export type Methods = { // record:done recordingKey?: string; fileSize?: string; + // stream:heartbeat + stats?: { + kbps: { + recv_30s: number; + send_30s: number; + }; + video?: { + codec: string; + profile: string; + level: string; + width: number; + height: number; + } | null; + audio?: { + codec: string; + sample_rate: number; + channel: number; + profile: string; + } | null; + }; }; resBody: { diff --git a/packages/api-types/api/v1/streams/_liveId@number/index.ts b/packages/api-types/api/v1/streams/_liveId@number/index.ts index e224f320..a2ba6fe7 100644 --- a/packages/api-types/api/v1/streams/_liveId@number/index.ts +++ b/packages/api-types/api/v1/streams/_liveId@number/index.ts @@ -1,4 +1,4 @@ -import { LivePrivate } from 'api-types/common/types'; +import { LivePrivate, LiveStats } from 'api-types/common/types'; import { AuthorizationHeader } from '../../../../common/types'; import { LiveSetting } from '../index'; @@ -18,6 +18,7 @@ export type Methods = { resBody: { live: LivePrivate; + stats: LiveStats; }; }; diff --git a/packages/api-types/common/types.ts b/packages/api-types/common/types.ts index e95f81ea..408c69b6 100644 --- a/packages/api-types/common/types.ts +++ b/packages/api-types/common/types.ts @@ -52,6 +52,26 @@ export type LiveConfig = { isRequiredFollower?: boolean; }; +export type LiveStats = { + kbps: { + recv_30s: number; + send_30s: number; + }; + video?: { + codec: string; + profile: string; + level: string; + width: number; + height: number; + } | null; + audio?: { + codec: string; + sample_rate: number; + channel: number; + profile: string; + } | null; +}; + export type LivePrivacy = 'Public' | 'Private' | 'Hidden'; export type LivePublic = { diff --git a/packages/api-types/external-mastodon/$api.ts b/packages/api-types/external-mastodon/$api.ts index c092fbcc..8b8dd57c 100644 --- a/packages/api-types/external-mastodon/$api.ts +++ b/packages/api-types/external-mastodon/$api.ts @@ -1,5 +1,5 @@ import type { AspidaClient } from 'aspida'; -import type { Methods as Methods0 } from './api/v1/statuses'; +import type { Methods as Methods_1h4hmv9 } from './api/v1/statuses'; const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, ''); @@ -10,29 +10,14 @@ const api = ({ baseURL, fetch }: AspidaClient) => { api: { v1: { statuses: { - post: (option: { - body: Methods0['post']['reqBody']; - headers: Methods0['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH0, - POST, - option - ).json(), - $post: (option: { - body: Methods0['post']['reqBody']; - headers: Methods0['post']['reqHeaders']; - config?: T | undefined; - }) => - fetch(prefix, PATH0, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH0}` - } - } - } + post: (option: { body: Methods_1h4hmv9['post']['reqBody'], headers: Methods_1h4hmv9['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json(), + $post: (option: { body: Methods_1h4hmv9['post']['reqBody'], headers: Methods_1h4hmv9['post']['reqHeaders'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}`, + }, + }, + }, }; }; diff --git a/packages/api-types/external-misskey/$api.ts b/packages/api-types/external-misskey/$api.ts index 62145752..91b242a0 100644 --- a/packages/api-types/external-misskey/$api.ts +++ b/packages/api-types/external-misskey/$api.ts @@ -1,5 +1,5 @@ import type { AspidaClient } from 'aspida'; -import type { Methods as Methods0 } from './api/notes/create'; +import type { Methods as Methods_17gbsmd } from './api/notes/create'; const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, ''); @@ -10,27 +10,14 @@ const api = ({ baseURL, fetch }: AspidaClient) => { api: { notes: { create: { - post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH0, - POST, - option - ).json(), - $post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH0, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH0}` - } - } - } + post: (option: { body: Methods_17gbsmd['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json(), + $post: (option: { body: Methods_17gbsmd['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}`, + }, + }, + }, }; }; diff --git a/packages/api-types/push/$api.ts b/packages/api-types/push/$api.ts index 427bd381..5fb12de2 100644 --- a/packages/api-types/push/$api.ts +++ b/packages/api-types/push/$api.ts @@ -1,6 +1,6 @@ import type { AspidaClient } from 'aspida'; -import type { Methods as Methods0 } from './api/externals/v1/action'; -import type { Methods as Methods1 } from './api/externals/v1/thumbnail'; +import type { Methods as Methods_1p49xj6 } from './api/externals/v1/action'; +import type { Methods as Methods_1ovx5p0 } from './api/externals/v1/thumbnail'; const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, ''); @@ -13,48 +13,22 @@ const api = ({ baseURL, fetch }: AspidaClient) => { externals: { v1: { action: { - post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH0, - POST, - option - ).json(), - $post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH0, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH0}` + post: (option: { body: Methods_1p49xj6['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json(), + $post: (option: { body: Methods_1p49xj6['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}`, }, thumbnail: { - post: (option: { - body: Methods1['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH1, - POST, - option - ).json(), - $post: (option: { - body: Methods1['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH1, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH1}` - } - } - } - } + post: (option: { body: Methods_1ovx5p0['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH1, POST, option).json(), + $post: (option: { body: Methods_1ovx5p0['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}`, + }, + }, + }, + }, }; }; diff --git a/packages/api-types/video/$api.ts b/packages/api-types/video/$api.ts index fb924eed..bbeffa7d 100644 --- a/packages/api-types/video/$api.ts +++ b/packages/api-types/video/$api.ts @@ -1,6 +1,6 @@ import type { AspidaClient } from 'aspida'; -import type { Methods as Methods0 } from './api/externals/v1/recording/publish'; -import type { Methods as Methods1 } from './api/externals/v1/recording/unpublish'; +import type { Methods as Methods_4p4vzr } from './api/externals/v1/recording/publish'; +import type { Methods as Methods_17uvs9a } from './api/externals/v1/recording/unpublish'; const api = ({ baseURL, fetch }: AspidaClient) => { const prefix = (baseURL === undefined ? '' : baseURL).replace(/\/$/, ''); @@ -14,49 +14,23 @@ const api = ({ baseURL, fetch }: AspidaClient) => { v1: { recording: { publish: { - post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH0, - POST, - option - ).json(), - $post: (option: { - body: Methods0['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH0, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH0}` + post: (option: { body: Methods_4p4vzr['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json(), + $post: (option: { body: Methods_4p4vzr['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH0, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH0}`, }, unpublish: { - post: (option: { - body: Methods1['post']['reqBody']; - config?: T | undefined; - }) => - fetch( - prefix, - PATH1, - POST, - option - ).json(), - $post: (option: { - body: Methods1['post']['reqBody']; - config?: T | undefined; - }) => - fetch(prefix, PATH1, POST, option) - .json() - .then(r => r.body), - $path: () => `${prefix}${PATH1}` - } - } - } - } - } + post: (option: { body: Methods_17uvs9a['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH1, POST, option).json(), + $post: (option: { body: Methods_17uvs9a['post']['reqBody'], config?: T | undefined }) => + fetch(prefix, PATH1, POST, option).json().then(r => r.body), + $path: () => `${prefix}${PATH1}`, + }, + }, + }, + }, + }, }; };