From fc8912068a2df4dd693db26a49fb896ffa6c737e Mon Sep 17 00:00:00 2001 From: Takumi Akimoto Date: Sat, 2 May 2026 01:41:18 +0900 Subject: [PATCH] Commit traQ client --- .gitignore | 1 - Dockerfile | 2 + traq/client.gen.ts | 16 + traq/client/client.gen.ts | 280 + traq/client/index.ts | 25 + traq/client/types.gen.ts | 217 + traq/client/utils.gen.ts | 318 ++ traq/core/auth.gen.ts | 41 + traq/core/bodySerializer.gen.ts | 82 + traq/core/params.gen.ts | 169 + traq/core/pathSerializer.gen.ts | 171 + traq/core/queryKeySerializer.gen.ts | 117 + traq/core/serverSentEvents.gen.ts | 242 + traq/core/types.gen.ts | 104 + traq/core/utils.gen.ts | 140 + traq/index.ts | 4 + traq/sdk.gen.ts | 2669 +++++++++ traq/types.gen.ts | 8258 +++++++++++++++++++++++++++ 18 files changed, 12855 insertions(+), 1 deletion(-) create mode 100644 traq/client.gen.ts create mode 100644 traq/client/client.gen.ts create mode 100644 traq/client/index.ts create mode 100644 traq/client/types.gen.ts create mode 100644 traq/client/utils.gen.ts create mode 100644 traq/core/auth.gen.ts create mode 100644 traq/core/bodySerializer.gen.ts create mode 100644 traq/core/params.gen.ts create mode 100644 traq/core/pathSerializer.gen.ts create mode 100644 traq/core/queryKeySerializer.gen.ts create mode 100644 traq/core/serverSentEvents.gen.ts create mode 100644 traq/core/types.gen.ts create mode 100644 traq/core/utils.gen.ts create mode 100644 traq/index.ts create mode 100644 traq/sdk.gen.ts create mode 100644 traq/types.gen.ts diff --git a/.gitignore b/.gitignore index 77a530a..03b773a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ _fresh/ -traq/ diff --git a/Dockerfile b/Dockerfile index 23eaaf4..e6dec5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,8 @@ WORKDIR /app COPY . . +RUN deno cache main.ts + EXPOSE 8000 CMD ["run", "--allow-env", "--allow-net", "./main.ts"] diff --git a/traq/client.gen.ts b/traq/client.gen.ts new file mode 100644 index 0000000..0b8a2d1 --- /dev/null +++ b/traq/client.gen.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type ClientOptions, type Config, createClient, createConfig } from './client'; +import type { ClientOptions as ClientOptions2 } from './types.gen'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = (override?: Config) => Config & T>; + +export const client = createClient(createConfig({ baseUrl: 'https://q.trap.jp/api/v3' })); diff --git a/traq/client/client.gen.ts b/traq/client/client.gen.ts new file mode 100644 index 0000000..377b6c9 --- /dev/null +++ b/traq/client/client.gen.ts @@ -0,0 +1,280 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createSseClient } from '../core/serverSentEvents.gen'; +import type { HttpMethod } from '../core/types.gen'; +import { getValidRequestBody } from '../core/utils.gen'; +import type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen'; +import { + buildUrl, + createConfig, + createInterceptors, + getParseAs, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils.gen'; + +type ReqInit = Omit & { + body?: any; + headers: ReturnType; +}; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + return getConfig(); + }; + + const interceptors = createInterceptors(); + + const beforeRequest = async < + TData = unknown, + TResponseStyle extends 'data' | 'fields' = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, + >( + options: RequestOptions, + ) => { + const opts = { + ..._config, + ...options, + fetch: options.fetch ?? _config.fetch ?? globalThis.fetch, + headers: mergeHeaders(_config.headers, options.headers), + serializedBody: undefined as string | undefined, + }; + + if (opts.security) { + await setAuthParams({ + ...opts, + security: opts.security, + }); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + if (opts.body !== undefined && opts.bodySerializer) { + opts.serializedBody = opts.bodySerializer(opts.body) as string | undefined; + } + + // remove Content-Type header if body is empty to avoid sending invalid requests + if (opts.body === undefined || opts.serializedBody === '') { + opts.headers.delete('Content-Type'); + } + + const resolvedOpts = opts as typeof opts & + ResolvedRequestOptions; + const url = buildUrl(resolvedOpts); + + return { opts: resolvedOpts, url }; + }; + + const request: Client['request'] = async (options) => { + const throwOnError = options.throwOnError ?? _config.throwOnError; + const responseStyle = options.responseStyle ?? _config.responseStyle; + + let request: Request | undefined; + let response: Response | undefined; + + try { + const { opts, url } = await beforeRequest(options); + const requestInit: ReqInit = { + redirect: 'follow', + ...opts, + body: getValidRequestBody(opts), + }; + + request = new Request(url, requestInit); + + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = opts.fetch!; + + response = await _fetch(request); + + for (const fn of interceptors.response.fns) { + if (fn) { + response = await fn(response, request, opts); + } + } + + const result = { + request, + response, + }; + + if (response.ok) { + const parseAs = + (opts.parseAs === 'auto' + ? getParseAs(response.headers.get('Content-Type')) + : opts.parseAs) ?? 'json'; + + if (response.status === 204 || response.headers.get('Content-Length') === '0') { + let emptyData: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'text': + emptyData = await response[parseAs](); + break; + case 'formData': + emptyData = new FormData(); + break; + case 'stream': + emptyData = response.body; + break; + case 'json': + default: + emptyData = {}; + break; + } + return opts.responseStyle === 'data' + ? emptyData + : { + data: emptyData, + ...result, + }; + } + + let data: any; + switch (parseAs) { + case 'arrayBuffer': + case 'blob': + case 'formData': + case 'text': + data = await response[parseAs](); + break; + case 'json': { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } + case 'stream': + return opts.responseStyle === 'data' + ? response.body + : { + data: response.body, + ...result, + }; + } + + if (parseAs === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return opts.responseStyle === 'data' + ? data + : { + data, + ...result, + }; + } + + const textError = await response.text(); + let jsonError: unknown; + + try { + jsonError = JSON.parse(textError); + } catch { + // noop + } + + throw jsonError ?? textError; + } catch (error) { + let finalError = error; + + for (const fn of interceptors.error.fns) { + if (fn) { + finalError = await fn(finalError, response, request, options as ResolvedRequestOptions); + } + } + + finalError = finalError || {}; + + if (throwOnError) { + throw finalError; + } + + // TODO: we probably want to return error and improve types + return responseStyle === 'data' + ? undefined + : { + error: finalError, + request, + response, + }; + } + }; + + const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + method, + onRequest: async (url, init) => { + let request = new Request(url, init); + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); + } + } + return request; + }, + serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, + url, + }); + }; + + const _buildUrl: Client['buildUrl'] = (options) => buildUrl({ ..._config, ...options }); + + return { + buildUrl: _buildUrl, + connect: makeMethodFn('CONNECT'), + delete: makeMethodFn('DELETE'), + get: makeMethodFn('GET'), + getConfig, + head: makeMethodFn('HEAD'), + interceptors, + options: makeMethodFn('OPTIONS'), + patch: makeMethodFn('PATCH'), + post: makeMethodFn('POST'), + put: makeMethodFn('PUT'), + request, + setConfig, + sse: { + connect: makeSseFn('CONNECT'), + delete: makeSseFn('DELETE'), + get: makeSseFn('GET'), + head: makeSseFn('HEAD'), + options: makeSseFn('OPTIONS'), + patch: makeSseFn('PATCH'), + post: makeSseFn('POST'), + put: makeSseFn('PUT'), + trace: makeSseFn('TRACE'), + }, + trace: makeMethodFn('TRACE'), + } as Client; +}; diff --git a/traq/client/index.ts b/traq/client/index.ts new file mode 100644 index 0000000..b295ede --- /dev/null +++ b/traq/client/index.ts @@ -0,0 +1,25 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from '../core/auth.gen'; +export type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '../core/bodySerializer.gen'; +export { buildClientParams } from '../core/params.gen'; +export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen'; +export { createClient } from './client.gen'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + ResolvedRequestOptions, + ResponseStyle, + TDataShape, +} from './types.gen'; +export { createConfig, mergeHeaders } from './utils.gen'; diff --git a/traq/client/types.gen.ts b/traq/client/types.gen.ts new file mode 100644 index 0000000..4b288a5 --- /dev/null +++ b/traq/client/types.gen.ts @@ -0,0 +1,217 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth } from '../core/auth.gen'; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from '../core/serverSentEvents.gen'; +import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; +import type { Middleware } from './utils.gen'; + +export type ResponseStyle = 'data' | 'fields'; + +export interface Config + extends Omit, CoreConfig { + /** + * Base URL for all requests made by this client. + */ + baseUrl?: T['baseUrl']; + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Please don't use the Fetch client for Next.js applications. The `next` + * options won't have any effect. + * + * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead. + */ + next?: never; + /** + * Return the response data parsed in a specified format. By default, `auto` + * will infer the appropriate method from the `Content-Type` response header. + * You can override this behavior with any of the {@link Body} methods. + * Select `stream` if you don't want to parse response data at all. + * + * @default 'auto' + */ + parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text'; + /** + * Should we return only data or multiple fields (data, error, response, etc.)? + * + * @default 'fields' + */ + responseStyle?: ResponseStyle; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + TData = unknown, + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> + extends + Config<{ + responseStyle: TResponseStyle; + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | 'onRequest' + | 'onSseError' + | 'onSseEvent' + | 'sseDefaultRetryDelay' + | 'sseMaxRetryAttempts' + | 'sseMaxRetryDelay' + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ResolvedRequestOptions< + TResponseStyle extends ResponseStyle = 'fields', + ThrowOnError extends boolean = boolean, + Url extends string = string, +> extends RequestOptions { + headers: Headers; + serializedBody?: string; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, + TResponseStyle extends ResponseStyle = 'fields', +> = ThrowOnError extends true + ? Promise< + TResponseStyle extends 'data' + ? TData extends Record + ? TData[keyof TData] + : TData + : { + data: TData extends Record ? TData[keyof TData] : TData; + request: Request; + response: Response; + } + > + : Promise< + TResponseStyle extends 'data' + ? (TData extends Record ? TData[keyof TData] : TData) | undefined + : ( + | { + data: TData extends Record ? TData[keyof TData] : TData; + error: undefined; + } + | { + data: undefined; + error: TError extends Record ? TError[keyof TError] : TError; + } + ) & { + /** request may be undefined, because error may be from building the request object itself */ + request?: Request; + /** response may be undefined, because error may be from building the request object itself or from a network error */ + response?: Response; + } + >; + +export interface ClientOptions { + baseUrl?: string; + responseStyle?: ResponseStyle; + throwOnError?: boolean; +} + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => RequestResult; + +type SseFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'>, +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, + TResponseStyle extends ResponseStyle = 'fields', +>( + options: Omit, 'method'> & + Pick>, 'method'>, +) => RequestResult; + +type BuildUrlFn = < + TData extends { + body?: unknown; + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & Options, +) => string; + +export type Client = CoreClient & { + interceptors: Middleware; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, + TResponseStyle extends ResponseStyle = 'fields', +> = OmitKeys< + RequestOptions, + 'body' | 'path' | 'query' | 'url' +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/traq/client/utils.gen.ts b/traq/client/utils.gen.ts new file mode 100644 index 0000000..eb0164f --- /dev/null +++ b/traq/client/utils.gen.ts @@ -0,0 +1,318 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from '../core/auth.gen'; +import type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +import { jsonBodySerializer } from '../core/bodySerializer.gen'; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '../core/pathSerializer.gen'; +import { getUrl } from '../core/utils.gen'; +import type { Client, ClientOptions, Config, RequestOptions } from './types.gen'; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'form', + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === 'object') { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join('&'); + }; + return querySerializer; +}; + +/** + * Infers parseAs value from provided Content-Type header. + */ +export const getParseAs = (contentType: string | null): Exclude => { + if (!contentType) { + // If no Content-Type header is provided, the best we can do is return the raw response body, + // which is effectively the same as the 'stream' option. + return 'stream'; + } + + const cleanContent = contentType.split(';')[0]?.trim(); + + if (!cleanContent) { + return; + } + + if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) { + return 'json'; + } + + if (cleanContent === 'multipart/form-data') { + return 'formData'; + } + + if ( + ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type)) + ) { + return 'blob'; + } + + if (cleanContent.startsWith('text/')) { + return 'text'; + } + + return; +}; + +const checkForExistence = ( + options: Pick & { + headers: Headers; + }, + name?: string, +): boolean => { + if (!name) { + return false; + } + if ( + options.headers.has(name) || + options.query?.[name] || + options.headers.get('Cookie')?.includes(`${name}=`) + ) { + return true; + } + return false; +}; + +export const setAuthParams = async ({ + security, + ...options +}: Pick, 'security'> & + Pick & { + headers: Headers; + }) => { + for (const auth of security) { + if (checkForExistence(options, auth.name)) { + continue; + } + + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': + options.headers.append('Cookie', `${name}=${token}`); + break; + case 'header': + default: + options.headers.set(name, token); + break; + } + } +}; + +export const buildUrl: Client['buildUrl'] = (options) => + getUrl({ + baseUrl: options.baseUrl as string, + path: options.path, + query: options.query, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + if (config.baseUrl?.endsWith('/')) { + config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1); + } + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +const headersEntries = (headers: Headers): Array<[string, string]> => { + const entries: Array<[string, string]> = []; + headers.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +}; + +export const mergeHeaders = ( + ...headers: Array['headers'] | undefined> +): Headers => { + const mergedHeaders = new Headers(); + for (const header of headers) { + if (!header) { + continue; + } + + const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header); + + for (const [key, value] of iterator) { + if (value === null) { + mergedHeaders.delete(key); + } else if (Array.isArray(value)) { + for (const v of value) { + mergedHeaders.append(key, v as string); + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e., their + // content value in OpenAPI specification is 'application/json' + mergedHeaders.set( + key, + typeof value === 'object' ? JSON.stringify(value) : (value as string), + ); + } + } + } + return mergedHeaders; +}; + +type ErrInterceptor = ( + error: Err, + /** response may be undefined due to a network error where no response object is produced */ + response: Res | undefined, + /** request may be undefined, because error may be from building the request object itself */ + request: Req | undefined, + options: Options, +) => Err | Promise; + +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; + +type ResInterceptor = ( + response: Res, + request: Req, + options: Options, +) => Res | Promise; + +class Interceptors { + fns: Array = []; + + clear(): void { + this.fns = []; + } + + eject(id: number | Interceptor): void { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = null; + } + } + + exists(id: number | Interceptor): boolean { + const index = this.getInterceptorIndex(id); + return Boolean(this.fns[index]); + } + + getInterceptorIndex(id: number | Interceptor): number { + if (typeof id === 'number') { + return this.fns[id] ? id : -1; + } + return this.fns.indexOf(id); + } + + update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { + const index = this.getInterceptorIndex(id); + if (this.fns[index]) { + this.fns[index] = fn; + return id; + } + return false; + } + + use(fn: Interceptor): number { + this.fns.push(fn); + return this.fns.length - 1; + } +} + +export interface Middleware { + error: Interceptors>; + request: Interceptors>; + response: Interceptors>; +} + +export const createInterceptors = (): Middleware< + Req, + Res, + Err, + Options +> => ({ + error: new Interceptors>(), + request: new Interceptors>(), + response: new Interceptors>(), +}); + +const defaultQuerySerializer = createQuerySerializer({ + allowReserved: false, + array: { + explode: true, + style: 'form', + }, + object: { + explode: true, + style: 'deepObject', + }, +}); + +const defaultHeaders = { + 'Content-Type': 'application/json', +}; + +export const createConfig = ( + override: Config & T> = {}, +): Config & T> => ({ + ...jsonBodySerializer, + headers: defaultHeaders, + parseAs: 'auto', + querySerializer: defaultQuerySerializer, + ...override, +}); diff --git a/traq/core/auth.gen.ts b/traq/core/auth.gen.ts new file mode 100644 index 0000000..3ebf994 --- /dev/null +++ b/traq/core/auth.gen.ts @@ -0,0 +1,41 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, +): Promise => { + const token = typeof callback === 'function' ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === 'bearer') { + return `Bearer ${token}`; + } + + if (auth.scheme === 'basic') { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/traq/core/bodySerializer.gen.ts b/traq/core/bodySerializer.gen.ts new file mode 100644 index 0000000..67daca6 --- /dev/null +++ b/traq/core/bodySerializer.gen.ts @@ -0,0 +1,82 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen'; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: unknown) => unknown; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { + if (typeof value === 'string' || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { + if (typeof value === 'string') { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: (body: unknown): FormData => { + const data = new FormData(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: unknown): string => + JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: (body: unknown): string => { + const data = new URLSearchParams(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/traq/core/params.gen.ts b/traq/core/params.gen.ts new file mode 100644 index 0000000..7955601 --- /dev/null +++ b/traq/core/params.gen.ts @@ -0,0 +1,169 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = 'body' | 'headers' | 'path' | 'query'; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: 'body', + $headers_: 'headers', + $path_: 'path', + $query_: 'query', +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ('in' in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ('key' in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +}; + +interface Params { + body: unknown; + headers: Record; + path: Record; + query: Record; +} + +const stripEmptySlots = (params: Params) => { + for (const [slot, value] of Object.entries(params)) { + if (value && typeof value === 'object' && !Array.isArray(value) && !Object.keys(value).length) { + delete params[slot as Slot]; + } + } +}; + +export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { + const params: Params = { + body: {}, + headers: {}, + path: {}, + query: {}, + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ('in' in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + (params[field.in] as Record)[name] = arg; + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[key.slice(prefix.length)] = value; + } else if ('allowExtra' in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +}; diff --git a/traq/core/pathSerializer.gen.ts b/traq/core/pathSerializer.gen.ts new file mode 100644 index 0000000..994b284 --- /dev/null +++ b/traq/core/pathSerializer.gen.ts @@ -0,0 +1,171 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +export type ObjectStyle = 'form' | 'deepObject'; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'form': + return ','; + case 'pipeDelimited': + return '|'; + case 'spaceDelimited': + return '%20'; + default: + return ','; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}) => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + case 'simple': + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === 'label' || style === 'simple') { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { + if (value === undefined || value === null) { + return ''; + } + + if (typeof value === 'object') { + throw new Error( + 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.', + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}) => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== 'deepObject' && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)]; + }); + const joinedValues = values.join(','); + switch (style) { + case 'form': + return `${name}=${joinedValues}`; + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === 'deepObject' ? `${name}[${key}]` : key, + value: v as string, + }), + ) + .join(separator); + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; +}; diff --git a/traq/core/queryKeySerializer.gen.ts b/traq/core/queryKeySerializer.gen.ts new file mode 100644 index 0000000..5000df6 --- /dev/null +++ b/traq/core/queryKeySerializer.gen.ts @@ -0,0 +1,117 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown) => { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + if (typeof value === 'bigint') { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== 'object') { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { + if (value === null) { + return null; + } + + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return value; + } + + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { + return undefined; + } + + if (typeof value === 'bigint') { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/traq/core/serverSentEvents.gen.ts b/traq/core/serverSentEvents.gen.ts new file mode 100644 index 0000000..ddf3c4d --- /dev/null +++ b/traq/core/serverSentEvents.gen.ts @@ -0,0 +1,242 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from './types.gen'; + +export type ServerSentEventsOptions = Omit & + Pick & { + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Implementing clients can call request interceptors inside this hook. + */ + onRequest?: (url: string, init: RequestInit) => Promise; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit['body']; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export function createSseClient({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult { + let lastEventId: string | undefined; + + const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set('Last-Event-ID', lastEventId); + } + + try { + const requestInit: RequestInit = { + redirect: 'follow', + ...options, + body: options.serializedBody, + headers, + signal, + }; + let request = new Request(url, requestInit); + if (onRequest) { + request = await onRequest(url, requestInit); + } + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = options.fetch ?? globalThis.fetch; + const response = await _fetch(request); + + if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`); + + if (!response.body) throw new Error('No body in SSE response'); + + const reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); + + let buffer = ''; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener('abort', abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings + + const chunks = buffer.split('\n\n'); + buffer = chunks.pop() ?? ''; + + for (const chunk of chunks) { + const lines = chunk.split('\n'); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith('data:')) { + dataLines.push(line.replace(/^data:\s*/, '')); + } else if (line.startsWith('event:')) { + eventName = line.replace(/^event:\s*/, ''); + } else if (line.startsWith('id:')) { + lastEventId = line.replace(/^id:\s*/, ''); + } else if (line.startsWith('retry:')) { + const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join('\n'); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener('abort', abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +} diff --git a/traq/core/types.gen.ts b/traq/core/types.gen.ts new file mode 100644 index 0000000..9efe71d --- /dev/null +++ b/traq/core/types.gen.ts @@ -0,0 +1,104 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from './auth.gen'; +import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen'; + +export type HttpMethod = + | 'connect' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'patch' + | 'post' + | 'put' + | 'trace'; + +export type Client< + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, + SseFn = never, +> = { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit['headers'] + | Record< + string, + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g., converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K]; +}; diff --git a/traq/core/utils.gen.ts b/traq/core/utils.gen.ts new file mode 100644 index 0000000..9a4fec7 --- /dev/null +++ b/traq/core/utils.gen.ts @@ -0,0 +1,140 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from './bodySerializer.gen'; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from './pathSerializer.gen'; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace(match, serializeArrayParam({ explode, name, style, value })); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }), + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}`, + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string), + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export function getValidRequestBody(options: { + body?: unknown; + bodySerializer?: BodySerializer | null; + serializedBody?: unknown; +}) { + const hasBody = options.body !== undefined; + const isSerializedBody = hasBody && options.bodySerializer; + + if (isSerializedBody) { + if ('serializedBody' in options) { + const hasSerializedBody = + options.serializedBody !== undefined && options.serializedBody !== ''; + + return hasSerializedBody ? options.serializedBody : null; + } + + // not all clients implement a serializedBody property (i.e., client-axios) + return options.body !== '' ? options.body : null; + } + + // plain/text body + if (hasBody) { + return options.body; + } + + // no body was provided + return undefined; +} diff --git a/traq/index.ts b/traq/index.ts new file mode 100644 index 0000000..9dd162f --- /dev/null +++ b/traq/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export { activateBot, addMessageStamp, addMyStar, addMyUserTag, addUserGroupAdmin, addUserGroupMember, addUserTag, changeBotIcon, changeMyIcon, changeMyNotifyCitation, changeMyPassword, changeParticipantRole, changeStampImage, changeUserGroupIcon, changeUserIcon, changeUserPassword, changeWebhookIcon, clipMessage, connectBotWs, createBot, createChannel, createClient, createClipFolder, createPin, createStamp, createStampPalette, createUser, createUserGroup, createWebhook, deleteBot, deleteClient, deleteClipFolder, deleteFile, deleteMessage, deleteOgpCache, deleteStamp, deleteStampPalette, deleteUserGroup, deleteWebhook, deleteWebhookMessage, editBot, editChannel, editChannelSubscribers, editChannelTopic, editClient, editClipFolder, editMe, editMessage, editMyUserTag, editStamp, editStampPalette, editUser, editUserGroup, editUserGroupMember, editUserTag, editWebhook, getActivityTimeline, getBot, getBotIcon, getBotLogs, getBots, getChannel, getChannelBots, getChannelEvents, getChannelPath, getChannelPins, getChannels, getChannelStats, getChannelSubscribers, getChannelTopic, getChannelViewers, getClient, getClients, getClipFolder, getClipFolders, getClips, getDirectMessages, getFile, getFileMeta, getFiles, getLiveKitToken, getMe, getMessage, getMessageClips, getMessages, getMessageStamps, getMyChannelSubscriptions, getMyExternalAccounts, getMyIcon, getMyNotifyCitation, getMyQrCode, getMySessions, getMyStampHistory, getMyStampRecommendations, getMyStars, getMyTokens, getMyUnreadChannels, getMyUserTags, getMyViewStates, getOAuth2Authorize, getOgp, getOidcUserInfo, getOnlineUsers, getPin, getPublicUserIcon, getQallEndpoints, getRoomMetadata, getRooms, getServerVersion, getSoundboardList, getStamp, getStampImage, getStampPalette, getStampPalettes, getStamps, getStampStats, getTag, getThumbnailImage, getUser, getUserDmChannel, getUserGroup, getUserGroupAdmins, getUserGroupMembers, getUserGroups, getUserIcon, getUsers, getUserSettings, getUserStats, getUserTags, getWebhook, getWebhookIcon, getWebhookMessages, getWebhooks, getWebRtcState, inactivateBot, letBotJoinChannel, letBotLeaveChannel, linkExternalAccount, liveKitWebhook, login, logout, type Options, postDirectMessage, postFile, postMessage, postOAuth2Authorize, postOAuth2AuthorizeDecide, postOAuth2Token, postSoundboard, postSoundboardPlay, postWebhook, postWebRtcAuthenticate, readChannel, registerFcmDevice, reissueBot, removeMessageStamp, removeMyStar, removeMyUserTag, removePin, removeUserGroupAdmin, removeUserGroupMember, removeUserGroupMembers, removeUserTag, revokeClientTokens, revokeMySession, revokeMyToken, revokeOAuth2Token, searchMessages, setChannelSubscribeLevel, setChannelSubscribers, unclipMessage, unlinkExternalAccount, updateRoomMetadata, ws } from './sdk.gen'; +export type { ActivateBotData, ActivateBotErrors, ActivateBotResponses, ActiveOAuth2Token, ActivityTimelineMessage, AddMessageStampData, AddMessageStampErrors, AddMessageStampResponse, AddMessageStampResponses, AddMyStarData, AddMyStarErrors, AddMyStarResponse, AddMyStarResponses, AddMyUserTagData, AddMyUserTagErrors, AddMyUserTagResponse, AddMyUserTagResponses, AddUserGroupAdminData, AddUserGroupAdminErrors, AddUserGroupAdminResponse, AddUserGroupAdminResponses, AddUserGroupMemberData, AddUserGroupMemberErrors, AddUserGroupMemberResponse, AddUserGroupMemberResponses, AddUserTagData, AddUserTagErrors, AddUserTagResponse, AddUserTagResponses, Bot, BotDetail, BotEventLog, BotEventResult, BotIdInPath, BotMode, BotState, BotTokens, BotUser, ChangeBotIconData, ChangeBotIconErrors, ChangeBotIconResponse, ChangeBotIconResponses, ChangeMyIconData, ChangeMyIconErrors, ChangeMyIconResponse, ChangeMyIconResponses, ChangeMyNotifyCitationData, ChangeMyNotifyCitationErrors, ChangeMyNotifyCitationResponse, ChangeMyNotifyCitationResponses, ChangeMyPasswordData, ChangeMyPasswordErrors, ChangeMyPasswordResponse, ChangeMyPasswordResponses, ChangeParticipantRoleData, ChangeParticipantRoleErrors, ChangeParticipantRoleResponse, ChangeParticipantRoleResponses, ChangeStampImageData, ChangeStampImageErrors, ChangeStampImageResponse, ChangeStampImageResponses, ChangeUserGroupIconData, ChangeUserGroupIconErrors, ChangeUserGroupIconResponse, ChangeUserGroupIconResponses, ChangeUserIconData, ChangeUserIconErrors, ChangeUserIconResponse, ChangeUserIconResponses, ChangeUserPasswordData, ChangeUserPasswordErrors, ChangeUserPasswordResponse, ChangeUserPasswordResponses, ChangeWebhookIconData, ChangeWebhookIconErrors, ChangeWebhookIconResponse, ChangeWebhookIconResponses, Channel, ChannelEvent, ChannelIdInPath, ChannelList, ChannelPath, ChannelStats, ChannelStatsStamp, ChannelStatsUser, ChannelSubscribeLevel, ChannelTopic, ChannelViewer, ChannelViewState, ChildCreatedEvent, ClientIdInPath, ClientOptions, ClipFolder, ClipMessageData, ClipMessageErrors, ClipMessageResponse, ClipMessageResponses, ClippedMessage, ConnectBotWsData, CreateBotData, CreateBotErrors, CreateBotResponse, CreateBotResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponse, CreateChannelResponses, CreateClientData, CreateClientErrors, CreateClientResponse, CreateClientResponses, CreateClipFolderData, CreateClipFolderErrors, CreateClipFolderResponse, CreateClipFolderResponses, CreatePinData, CreatePinErrors, CreatePinResponse, CreatePinResponses, CreateStampData, CreateStampErrors, CreateStampPaletteData, CreateStampPaletteErrors, CreateStampPaletteResponse, CreateStampPaletteResponses, CreateStampResponse, CreateStampResponses, CreateUserData, CreateUserErrors, CreateUserGroupData, CreateUserGroupErrors, CreateUserGroupResponse, CreateUserGroupResponses, CreateUserResponse, CreateUserResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponse, CreateWebhookResponses, DeleteBotData, DeleteBotErrors, DeleteBotResponse, DeleteBotResponses, DeleteClientData, DeleteClientErrors, DeleteClientResponse, DeleteClientResponses, DeleteClipFolderData, DeleteClipFolderErrors, DeleteClipFolderResponse, DeleteClipFolderResponses, DeleteFileData, DeleteFileErrors, DeleteFileResponse, DeleteFileResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponse, DeleteMessageResponses, DeleteOgpCacheData, DeleteOgpCacheErrors, DeleteOgpCacheResponse, DeleteOgpCacheResponses, DeleteStampData, DeleteStampErrors, DeleteStampPaletteData, DeleteStampPaletteErrors, DeleteStampPaletteResponse, DeleteStampPaletteResponses, DeleteStampResponse, DeleteStampResponses, DeleteUserGroupData, DeleteUserGroupErrors, DeleteUserGroupResponse, DeleteUserGroupResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookMessageData, DeleteWebhookMessageErrors, DeleteWebhookMessageResponse, DeleteWebhookMessageResponses, DeleteWebhookResponse, DeleteWebhookResponses, DmChannel, EditBotData, EditBotErrors, EditBotResponse, EditBotResponses, EditChannelData, EditChannelErrors, EditChannelResponse, EditChannelResponses, EditChannelSubscribersData, EditChannelSubscribersErrors, EditChannelSubscribersResponse, EditChannelSubscribersResponses, EditChannelTopicData, EditChannelTopicErrors, EditChannelTopicResponse, EditChannelTopicResponses, EditClientData, EditClientErrors, EditClientResponse, EditClientResponses, EditClipFolderData, EditClipFolderErrors, EditClipFolderResponse, EditClipFolderResponses, EditMeData, EditMeErrors, EditMeResponse, EditMeResponses, EditMessageData, EditMessageErrors, EditMessageResponse, EditMessageResponses, EditMyUserTagData, EditMyUserTagErrors, EditMyUserTagResponse, EditMyUserTagResponses, EditStampData, EditStampErrors, EditStampPaletteData, EditStampPaletteErrors, EditStampPaletteResponse, EditStampPaletteResponses, EditStampResponse, EditStampResponses, EditUserData, EditUserErrors, EditUserGroupData, EditUserGroupErrors, EditUserGroupMemberData, EditUserGroupMemberErrors, EditUserGroupMemberResponse, EditUserGroupMemberResponses, EditUserGroupResponse, EditUserGroupResponses, EditUserResponse, EditUserResponses, EditUserTagData, EditUserTagErrors, EditUserTagResponse, EditUserTagResponses, EditWebhookData, EditWebhookErrors, EditWebhookResponse, EditWebhookResponses, ExcludeDeletedMessagesInQuery, ExternalProviderUser, FileIdInPath, FileInfo, FolderIdInPath, ForcedNotificationChangedEvent, GetActivityTimelineData, GetActivityTimelineErrors, GetActivityTimelineResponse, GetActivityTimelineResponses, GetBotData, GetBotErrors, GetBotIconData, GetBotIconErrors, GetBotIconResponse, GetBotIconResponses, GetBotLogsData, GetBotLogsErrors, GetBotLogsResponse, GetBotLogsResponses, GetBotResponse, GetBotResponses, GetBotsData, GetBotsResponse, GetBotsResponses, GetChannelBotsData, GetChannelBotsErrors, GetChannelBotsResponse, GetChannelBotsResponses, GetChannelData, GetChannelErrors, GetChannelEventsData, GetChannelEventsErrors, GetChannelEventsResponse, GetChannelEventsResponses, GetChannelPathData, GetChannelPathErrors, GetChannelPathResponse, GetChannelPathResponses, GetChannelPinsData, GetChannelPinsErrors, GetChannelPinsResponse, GetChannelPinsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsResponse, GetChannelsResponses, GetChannelStatsData, GetChannelStatsErrors, GetChannelStatsResponse, GetChannelStatsResponses, GetChannelSubscribersData, GetChannelSubscribersErrors, GetChannelSubscribersResponse, GetChannelSubscribersResponses, GetChannelTopicData, GetChannelTopicErrors, GetChannelTopicResponse, GetChannelTopicResponses, GetChannelViewersData, GetChannelViewersErrors, GetChannelViewersResponse, GetChannelViewersResponses, GetClientData, GetClientErrors, GetClientResponse, GetClientResponses, GetClientsData, GetClientsResponse, GetClientsResponses, GetClipFolderData, GetClipFolderErrors, GetClipFolderResponse, GetClipFolderResponses, GetClipFoldersData, GetClipFoldersResponse, GetClipFoldersResponses, GetClipsData, GetClipsErrors, GetClipsResponse, GetClipsResponses, GetDirectMessagesData, GetDirectMessagesErrors, GetDirectMessagesResponse, GetDirectMessagesResponses, GetFileData, GetFileErrors, GetFileMetaData, GetFileMetaErrors, GetFileMetaResponse, GetFileMetaResponses, GetFileResponse, GetFileResponses, GetFilesData, GetFilesErrors, GetFilesResponse, GetFilesResponses, GetLiveKitTokenData, GetLiveKitTokenErrors, GetLiveKitTokenResponse, GetLiveKitTokenResponses, GetMeData, GetMeResponse, GetMeResponses, GetMessageClipsData, GetMessageClipsErrors, GetMessageClipsResponse, GetMessageClipsResponses, GetMessageData, GetMessageErrors, GetMessageResponse, GetMessageResponses, GetMessagesData, GetMessagesErrors, GetMessagesResponse, GetMessagesResponses, GetMessageStampsData, GetMessageStampsErrors, GetMessageStampsResponse, GetMessageStampsResponses, GetMyChannelSubscriptionsData, GetMyChannelSubscriptionsResponse, GetMyChannelSubscriptionsResponses, GetMyExternalAccountsData, GetMyExternalAccountsResponse, GetMyExternalAccountsResponses, GetMyIconData, GetMyIconErrors, GetMyIconResponse, GetMyIconResponses, GetMyNotifyCitationData, GetMyNotifyCitationResponse, GetMyNotifyCitationResponses, GetMyQrCodeData, GetMyQrCodeResponse, GetMyQrCodeResponses, GetMySessionsData, GetMySessionsResponse, GetMySessionsResponses, GetMyStampHistoryData, GetMyStampHistoryResponse, GetMyStampHistoryResponses, GetMyStampRecommendationsData, GetMyStampRecommendationsResponse, GetMyStampRecommendationsResponses, GetMyStarsData, GetMyStarsResponse, GetMyStarsResponses, GetMyTokensData, GetMyTokensResponse, GetMyTokensResponses, GetMyUnreadChannelsData, GetMyUnreadChannelsResponse, GetMyUnreadChannelsResponses, GetMyUserTagsData, GetMyUserTagsResponse, GetMyUserTagsResponses, GetMyViewStatesData, GetMyViewStatesResponse, GetMyViewStatesResponses, GetNotifyCitation, GetOAuth2AuthorizeData, GetOAuth2AuthorizeErrors, GetOgpData, GetOgpErrors, GetOgpResponse, GetOgpResponses, GetOidcUserInfoData, GetOidcUserInfoResponse, GetOidcUserInfoResponses, GetOnlineUsersData, GetOnlineUsersResponse, GetOnlineUsersResponses, GetPinData, GetPinErrors, GetPinResponse, GetPinResponses, GetPublicUserIconData, GetPublicUserIconErrors, GetPublicUserIconResponse, GetPublicUserIconResponses, GetQallEndpointsData, GetQallEndpointsErrors, GetQallEndpointsResponse, GetQallEndpointsResponses, GetRoomMetadataData, GetRoomMetadataErrors, GetRoomMetadataResponse, GetRoomMetadataResponses, GetRoomsData, GetRoomsErrors, GetRoomsResponse, GetRoomsResponses, GetServerVersionData, GetServerVersionResponse, GetServerVersionResponses, GetSoundboardListData, GetSoundboardListErrors, GetSoundboardListResponse, GetSoundboardListResponses, GetStampData, GetStampErrors, GetStampImageData, GetStampImageErrors, GetStampImageResponse, GetStampImageResponses, GetStampPaletteData, GetStampPaletteErrors, GetStampPaletteResponse, GetStampPaletteResponses, GetStampPalettesData, GetStampPalettesResponse, GetStampPalettesResponses, GetStampResponse, GetStampResponses, GetStampsData, GetStampsResponse, GetStampsResponses, GetStampStatsData, GetStampStatsErrors, GetStampStatsResponse, GetStampStatsResponses, GetTagData, GetTagErrors, GetTagResponse, GetTagResponses, GetThumbnailImageData, GetThumbnailImageErrors, GetThumbnailImageResponse, GetThumbnailImageResponses, GetUserData, GetUserDmChannelData, GetUserDmChannelErrors, GetUserDmChannelResponse, GetUserDmChannelResponses, GetUserErrors, GetUserGroupAdminsData, GetUserGroupAdminsErrors, GetUserGroupAdminsResponse, GetUserGroupAdminsResponses, GetUserGroupData, GetUserGroupErrors, GetUserGroupMembersData, GetUserGroupMembersErrors, GetUserGroupMembersResponse, GetUserGroupMembersResponses, GetUserGroupResponse, GetUserGroupResponses, GetUserGroupsData, GetUserGroupsResponse, GetUserGroupsResponses, GetUserIconData, GetUserIconErrors, GetUserIconResponse, GetUserIconResponses, GetUserResponse, GetUserResponses, GetUsersData, GetUsersErrors, GetUserSettingsData, GetUserSettingsResponse, GetUserSettingsResponses, GetUsersResponse, GetUsersResponses, GetUserStatsData, GetUserStatsErrors, GetUserStatsResponse, GetUserStatsResponses, GetUserTagsData, GetUserTagsErrors, GetUserTagsResponse, GetUserTagsResponses, GetWebhookData, GetWebhookErrors, GetWebhookIconData, GetWebhookIconErrors, GetWebhookIconResponse, GetWebhookIconResponses, GetWebhookMessagesData, GetWebhookMessagesErrors, GetWebhookMessagesResponse, GetWebhookMessagesResponses, GetWebhookResponse, GetWebhookResponses, GetWebhooksData, GetWebhooksResponse, GetWebhooksResponses, GetWebRtcStateData, GetWebRtcStateResponse, GetWebRtcStateResponses, GroupIdInPath, InactivateBotData, InactivateBotErrors, InactivateBotResponse, InactivateBotResponses, InclusiveInQuery, IsWebinarInQuery, LetBotJoinChannelData, LetBotJoinChannelErrors, LetBotJoinChannelResponse, LetBotJoinChannelResponses, LetBotLeaveChannelData, LetBotLeaveChannelErrors, LetBotLeaveChannelResponse, LetBotLeaveChannelResponses, LimitInQuery, LinkExternalAccountData, LinkExternalAccountErrors, LiveKitWebhookData, LiveKitWebhookErrors, LiveKitWebhookResponses, LoginData, LoginErrors, LoginResponse, LoginResponses, LoginSession, LogoutData, LogoutResponse, LogoutResponses, Message, MessageClip, MessageIdInPath, MessagePin, MessageStamp, MyChannelViewState, MyUserDetail, NameChangedEvent, OAuth2Authorization, OAuth2Client, OAuth2ClientDetail, OAuth2Decide, OAuth2Prompt, OAuth2ResponseType, OAuth2Revoke, OAuth2Scope, OAuth2Token, OffsetInQuery, Ogp, OgpMedia, OidcTraqUserInfo, OidcUserInfo, OrderInQuery, PaletteIdInPath, ParentChangedEvent, PatchBotRequest, PatchChannelRequest, PatchChannelSubscribersRequest, PatchClientRequest, PatchClipFolderRequest, PatchGroupMemberRequest, PatchMeRequest, PatchStampPaletteRequest, PatchStampRequest, PatchUserGroupRequest, PatchUserRequest, PatchUserTagRequest, PatchWebhookRequest, Pin, PinAddedEvent, PinRemovedEvent, PostBotActionJoinRequest, PostBotActionLeaveRequest, PostBotRequest, PostChannelRequest, PostClientRequest, PostClipFolderMessageRequest, PostClipFolderRequest, PostDirectMessageData, PostDirectMessageErrors, PostDirectMessageResponse, PostDirectMessageResponses, PostFileData, PostFileErrors, PostFileRequest, PostFileResponse, PostFileResponses, PostLinkExternalAccount, PostLoginRequest, PostMessageData, PostMessageErrors, PostMessageRequest, PostMessageResponse, PostMessageResponses, PostMessageStampRequest, PostMyFcmDeviceRequest, PostOAuth2AuthorizeData, PostOAuth2AuthorizeDecideData, PostOAuth2AuthorizeDecideErrors, PostOAuth2AuthorizeErrors, PostOAuth2Token, PostOAuth2TokenData, PostOAuth2TokenErrors, PostOAuth2TokenResponse, PostOAuth2TokenResponses, PostSoundboardData, PostSoundboardErrors, PostSoundboardPlayData, PostSoundboardPlayErrors, PostSoundboardPlayResponse, PostSoundboardPlayResponses, PostSoundboardResponse, PostSoundboardResponses, PostStampPaletteRequest, PostStampRequest, PostStarRequest, PostUnlinkExternalAccount, PostUserGroupAdminRequest, PostUserGroupRequest, PostUserRequest, PostUserTagRequest, PostWebhookData, PostWebhookErrors, PostWebhookRequest, PostWebhookResponse, PostWebhookResponses, PostWebRtcAuthenticateData, PostWebRtcAuthenticateErrors, PostWebRtcAuthenticateRequest, PostWebRtcAuthenticateResponse, PostWebRtcAuthenticateResponses, PutChannelSubscribeLevelRequest, PutChannelSubscribersRequest, PutChannelTopicRequest, PutMyPasswordRequest, PutNotifyCitationRequest, PutUserIconRequest, PutUserPasswordRequest, QallEndpointResponse, QallMetadataRequest, QallMetadataResponse, QallParticipant, QallParticipantRequest, QallParticipantResponse, QallRoomsListResponse, QallRoomStateChangedEvent, QallRoomWithParticipants, QallSoundboardItemCreatedEvent, QallSoundboardItemDeletedEvent, QallTokenResponse, ReadChannelData, ReadChannelResponse, ReadChannelResponses, RedirectInQuery, RegisterFcmDeviceData, RegisterFcmDeviceErrors, RegisterFcmDeviceResponse, RegisterFcmDeviceResponses, ReissueBotData, ReissueBotErrors, ReissueBotResponse, ReissueBotResponses, RemoveMessageStampData, RemoveMessageStampErrors, RemoveMessageStampResponse, RemoveMessageStampResponses, RemoveMyStarData, RemoveMyStarResponse, RemoveMyStarResponses, RemoveMyUserTagData, RemoveMyUserTagErrors, RemoveMyUserTagResponse, RemoveMyUserTagResponses, RemovePinData, RemovePinErrors, RemovePinResponse, RemovePinResponses, RemoveUserGroupAdminData, RemoveUserGroupAdminErrors, RemoveUserGroupAdminResponse, RemoveUserGroupAdminResponses, RemoveUserGroupMemberData, RemoveUserGroupMemberErrors, RemoveUserGroupMemberResponse, RemoveUserGroupMemberResponses, RemoveUserGroupMembersData, RemoveUserGroupMembersErrors, RemoveUserGroupMembersResponse, RemoveUserGroupMembersResponses, RemoveUserTagData, RemoveUserTagErrors, RemoveUserTagResponse, RemoveUserTagResponses, RevokeClientTokensData, RevokeClientTokensErrors, RevokeClientTokensResponse, RevokeClientTokensResponses, RevokeMySessionData, RevokeMySessionResponse, RevokeMySessionResponses, RevokeMyTokenData, RevokeMyTokenErrors, RevokeMyTokenResponse, RevokeMyTokenResponses, RevokeOAuth2TokenData, RevokeOAuth2TokenResponses, RoomIdInPath, RoomIdInQuery, SearchMessagesData, SearchMessagesErrors, SearchMessagesResponse, SearchMessagesResponses, Session, SessionIdInPath, SetChannelSubscribeLevelData, SetChannelSubscribeLevelErrors, SetChannelSubscribeLevelResponse, SetChannelSubscribeLevelResponses, SetChannelSubscribersData, SetChannelSubscribersErrors, SetChannelSubscribersResponse, SetChannelSubscribersResponses, SinceInQuery, SoundboardItem, SoundboardListResponse, SoundboardPlayRequest, SoundboardPlayResponse, SoundboardUploadRequest, SoundboardUploadResponse, Stamp, StampHistoryEntry, StampIdInPath, StampPalette, StampStats, StampWithThumbnail, SubscribersChangedEvent, Tag, TagIdInPath, ThumbnailInfo, ThumbnailType, TokenIdInPath, TopicChangedEvent, UnclipMessageData, UnclipMessageErrors, UnclipMessageResponse, UnclipMessageResponses, UnlinkExternalAccountData, UnlinkExternalAccountErrors, UnlinkExternalAccountResponse, UnlinkExternalAccountResponses, UnreadChannel, UntilInQuery, UpdateRoomMetadataData, UpdateRoomMetadataErrors, UpdateRoomMetadataResponses, User, UserAccountState, UserDetail, UserGroup, UserGroupMember, UserGroupMembers, UserIdInPath, UserPermission, UserSettings, UserStats, UserStatsStamp, UserSubscribeState, UserTag, Version, VisibilityChangedEvent, Webhook, WebhookIdInPath, WebRtcAuthenticateResult, WebRtcUserState, WebRtcUserStates, WsData } from './types.gen'; diff --git a/traq/sdk.gen.ts b/traq/sdk.gen.ts new file mode 100644 index 0000000..68ea0cc --- /dev/null +++ b/traq/sdk.gen.ts @@ -0,0 +1,2669 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape, urlSearchParamsBodySerializer } from './client'; +import { client } from './client.gen'; +import type { ActivateBotData, ActivateBotErrors, ActivateBotResponses, AddMessageStampData, AddMessageStampErrors, AddMessageStampResponses, AddMyStarData, AddMyStarErrors, AddMyStarResponses, AddMyUserTagData, AddMyUserTagErrors, AddMyUserTagResponses, AddUserGroupAdminData, AddUserGroupAdminErrors, AddUserGroupAdminResponses, AddUserGroupMemberData, AddUserGroupMemberErrors, AddUserGroupMemberResponses, AddUserTagData, AddUserTagErrors, AddUserTagResponses, ChangeBotIconData, ChangeBotIconErrors, ChangeBotIconResponses, ChangeMyIconData, ChangeMyIconErrors, ChangeMyIconResponses, ChangeMyNotifyCitationData, ChangeMyNotifyCitationErrors, ChangeMyNotifyCitationResponses, ChangeMyPasswordData, ChangeMyPasswordErrors, ChangeMyPasswordResponses, ChangeParticipantRoleData, ChangeParticipantRoleErrors, ChangeParticipantRoleResponses, ChangeStampImageData, ChangeStampImageErrors, ChangeStampImageResponses, ChangeUserGroupIconData, ChangeUserGroupIconErrors, ChangeUserGroupIconResponses, ChangeUserIconData, ChangeUserIconErrors, ChangeUserIconResponses, ChangeUserPasswordData, ChangeUserPasswordErrors, ChangeUserPasswordResponses, ChangeWebhookIconData, ChangeWebhookIconErrors, ChangeWebhookIconResponses, ClipMessageData, ClipMessageErrors, ClipMessageResponses, ConnectBotWsData, CreateBotData, CreateBotErrors, CreateBotResponses, CreateChannelData, CreateChannelErrors, CreateChannelResponses, CreateClientData, CreateClientErrors, CreateClientResponses, CreateClipFolderData, CreateClipFolderErrors, CreateClipFolderResponses, CreatePinData, CreatePinErrors, CreatePinResponses, CreateStampData, CreateStampErrors, CreateStampPaletteData, CreateStampPaletteErrors, CreateStampPaletteResponses, CreateStampResponses, CreateUserData, CreateUserErrors, CreateUserGroupData, CreateUserGroupErrors, CreateUserGroupResponses, CreateUserResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteBotData, DeleteBotErrors, DeleteBotResponses, DeleteClientData, DeleteClientErrors, DeleteClientResponses, DeleteClipFolderData, DeleteClipFolderErrors, DeleteClipFolderResponses, DeleteFileData, DeleteFileErrors, DeleteFileResponses, DeleteMessageData, DeleteMessageErrors, DeleteMessageResponses, DeleteOgpCacheData, DeleteOgpCacheErrors, DeleteOgpCacheResponses, DeleteStampData, DeleteStampErrors, DeleteStampPaletteData, DeleteStampPaletteErrors, DeleteStampPaletteResponses, DeleteStampResponses, DeleteUserGroupData, DeleteUserGroupErrors, DeleteUserGroupResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookMessageData, DeleteWebhookMessageErrors, DeleteWebhookMessageResponses, DeleteWebhookResponses, EditBotData, EditBotErrors, EditBotResponses, EditChannelData, EditChannelErrors, EditChannelResponses, EditChannelSubscribersData, EditChannelSubscribersErrors, EditChannelSubscribersResponses, EditChannelTopicData, EditChannelTopicErrors, EditChannelTopicResponses, EditClientData, EditClientErrors, EditClientResponses, EditClipFolderData, EditClipFolderErrors, EditClipFolderResponses, EditMeData, EditMeErrors, EditMeResponses, EditMessageData, EditMessageErrors, EditMessageResponses, EditMyUserTagData, EditMyUserTagErrors, EditMyUserTagResponses, EditStampData, EditStampErrors, EditStampPaletteData, EditStampPaletteErrors, EditStampPaletteResponses, EditStampResponses, EditUserData, EditUserErrors, EditUserGroupData, EditUserGroupErrors, EditUserGroupMemberData, EditUserGroupMemberErrors, EditUserGroupMemberResponses, EditUserGroupResponses, EditUserResponses, EditUserTagData, EditUserTagErrors, EditUserTagResponses, EditWebhookData, EditWebhookErrors, EditWebhookResponses, GetActivityTimelineData, GetActivityTimelineErrors, GetActivityTimelineResponses, GetBotData, GetBotErrors, GetBotIconData, GetBotIconErrors, GetBotIconResponses, GetBotLogsData, GetBotLogsErrors, GetBotLogsResponses, GetBotResponses, GetBotsData, GetBotsResponses, GetChannelBotsData, GetChannelBotsErrors, GetChannelBotsResponses, GetChannelData, GetChannelErrors, GetChannelEventsData, GetChannelEventsErrors, GetChannelEventsResponses, GetChannelPathData, GetChannelPathErrors, GetChannelPathResponses, GetChannelPinsData, GetChannelPinsErrors, GetChannelPinsResponses, GetChannelResponses, GetChannelsData, GetChannelsResponses, GetChannelStatsData, GetChannelStatsErrors, GetChannelStatsResponses, GetChannelSubscribersData, GetChannelSubscribersErrors, GetChannelSubscribersResponses, GetChannelTopicData, GetChannelTopicErrors, GetChannelTopicResponses, GetChannelViewersData, GetChannelViewersErrors, GetChannelViewersResponses, GetClientData, GetClientErrors, GetClientResponses, GetClientsData, GetClientsResponses, GetClipFolderData, GetClipFolderErrors, GetClipFolderResponses, GetClipFoldersData, GetClipFoldersResponses, GetClipsData, GetClipsErrors, GetClipsResponses, GetDirectMessagesData, GetDirectMessagesErrors, GetDirectMessagesResponses, GetFileData, GetFileErrors, GetFileMetaData, GetFileMetaErrors, GetFileMetaResponses, GetFileResponses, GetFilesData, GetFilesErrors, GetFilesResponses, GetLiveKitTokenData, GetLiveKitTokenErrors, GetLiveKitTokenResponses, GetMeData, GetMeResponses, GetMessageClipsData, GetMessageClipsErrors, GetMessageClipsResponses, GetMessageData, GetMessageErrors, GetMessageResponses, GetMessagesData, GetMessagesErrors, GetMessagesResponses, GetMessageStampsData, GetMessageStampsErrors, GetMessageStampsResponses, GetMyChannelSubscriptionsData, GetMyChannelSubscriptionsResponses, GetMyExternalAccountsData, GetMyExternalAccountsResponses, GetMyIconData, GetMyIconErrors, GetMyIconResponses, GetMyNotifyCitationData, GetMyNotifyCitationResponses, GetMyQrCodeData, GetMyQrCodeResponses, GetMySessionsData, GetMySessionsResponses, GetMyStampHistoryData, GetMyStampHistoryResponses, GetMyStampRecommendationsData, GetMyStampRecommendationsResponses, GetMyStarsData, GetMyStarsResponses, GetMyTokensData, GetMyTokensResponses, GetMyUnreadChannelsData, GetMyUnreadChannelsResponses, GetMyUserTagsData, GetMyUserTagsResponses, GetMyViewStatesData, GetMyViewStatesResponses, GetOAuth2AuthorizeData, GetOAuth2AuthorizeErrors, GetOgpData, GetOgpErrors, GetOgpResponses, GetOidcUserInfoData, GetOidcUserInfoResponses, GetOnlineUsersData, GetOnlineUsersResponses, GetPinData, GetPinErrors, GetPinResponses, GetPublicUserIconData, GetPublicUserIconErrors, GetPublicUserIconResponses, GetQallEndpointsData, GetQallEndpointsErrors, GetQallEndpointsResponses, GetRoomMetadataData, GetRoomMetadataErrors, GetRoomMetadataResponses, GetRoomsData, GetRoomsErrors, GetRoomsResponses, GetServerVersionData, GetServerVersionResponses, GetSoundboardListData, GetSoundboardListErrors, GetSoundboardListResponses, GetStampData, GetStampErrors, GetStampImageData, GetStampImageErrors, GetStampImageResponses, GetStampPaletteData, GetStampPaletteErrors, GetStampPaletteResponses, GetStampPalettesData, GetStampPalettesResponses, GetStampResponses, GetStampsData, GetStampsResponses, GetStampStatsData, GetStampStatsErrors, GetStampStatsResponses, GetTagData, GetTagErrors, GetTagResponses, GetThumbnailImageData, GetThumbnailImageErrors, GetThumbnailImageResponses, GetUserData, GetUserDmChannelData, GetUserDmChannelErrors, GetUserDmChannelResponses, GetUserErrors, GetUserGroupAdminsData, GetUserGroupAdminsErrors, GetUserGroupAdminsResponses, GetUserGroupData, GetUserGroupErrors, GetUserGroupMembersData, GetUserGroupMembersErrors, GetUserGroupMembersResponses, GetUserGroupResponses, GetUserGroupsData, GetUserGroupsResponses, GetUserIconData, GetUserIconErrors, GetUserIconResponses, GetUserResponses, GetUsersData, GetUsersErrors, GetUserSettingsData, GetUserSettingsResponses, GetUsersResponses, GetUserStatsData, GetUserStatsErrors, GetUserStatsResponses, GetUserTagsData, GetUserTagsErrors, GetUserTagsResponses, GetWebhookData, GetWebhookErrors, GetWebhookIconData, GetWebhookIconErrors, GetWebhookIconResponses, GetWebhookMessagesData, GetWebhookMessagesErrors, GetWebhookMessagesResponses, GetWebhookResponses, GetWebhooksData, GetWebhooksResponses, GetWebRtcStateData, GetWebRtcStateResponses, InactivateBotData, InactivateBotErrors, InactivateBotResponses, LetBotJoinChannelData, LetBotJoinChannelErrors, LetBotJoinChannelResponses, LetBotLeaveChannelData, LetBotLeaveChannelErrors, LetBotLeaveChannelResponses, LinkExternalAccountData, LinkExternalAccountErrors, LiveKitWebhookData, LiveKitWebhookErrors, LiveKitWebhookResponses, LoginData, LoginErrors, LoginResponses, LogoutData, LogoutResponses, PostDirectMessageData, PostDirectMessageErrors, PostDirectMessageResponses, PostFileData, PostFileErrors, PostFileResponses, PostMessageData, PostMessageErrors, PostMessageResponses, PostOAuth2AuthorizeData, PostOAuth2AuthorizeDecideData, PostOAuth2AuthorizeDecideErrors, PostOAuth2AuthorizeErrors, PostOAuth2TokenData, PostOAuth2TokenErrors, PostOAuth2TokenResponses, PostSoundboardData, PostSoundboardErrors, PostSoundboardPlayData, PostSoundboardPlayErrors, PostSoundboardPlayResponses, PostSoundboardResponses, PostWebhookData, PostWebhookErrors, PostWebhookResponses, PostWebRtcAuthenticateData, PostWebRtcAuthenticateErrors, PostWebRtcAuthenticateResponses, ReadChannelData, ReadChannelResponses, RegisterFcmDeviceData, RegisterFcmDeviceErrors, RegisterFcmDeviceResponses, ReissueBotData, ReissueBotErrors, ReissueBotResponses, RemoveMessageStampData, RemoveMessageStampErrors, RemoveMessageStampResponses, RemoveMyStarData, RemoveMyStarResponses, RemoveMyUserTagData, RemoveMyUserTagErrors, RemoveMyUserTagResponses, RemovePinData, RemovePinErrors, RemovePinResponses, RemoveUserGroupAdminData, RemoveUserGroupAdminErrors, RemoveUserGroupAdminResponses, RemoveUserGroupMemberData, RemoveUserGroupMemberErrors, RemoveUserGroupMemberResponses, RemoveUserGroupMembersData, RemoveUserGroupMembersErrors, RemoveUserGroupMembersResponses, RemoveUserTagData, RemoveUserTagErrors, RemoveUserTagResponses, RevokeClientTokensData, RevokeClientTokensErrors, RevokeClientTokensResponses, RevokeMySessionData, RevokeMySessionResponses, RevokeMyTokenData, RevokeMyTokenErrors, RevokeMyTokenResponses, RevokeOAuth2TokenData, RevokeOAuth2TokenResponses, SearchMessagesData, SearchMessagesErrors, SearchMessagesResponses, SetChannelSubscribeLevelData, SetChannelSubscribeLevelErrors, SetChannelSubscribeLevelResponses, SetChannelSubscribersData, SetChannelSubscribersErrors, SetChannelSubscribersResponses, UnclipMessageData, UnclipMessageErrors, UnclipMessageResponses, UnlinkExternalAccountData, UnlinkExternalAccountErrors, UnlinkExternalAccountResponses, UpdateRoomMetadataData, UpdateRoomMetadataErrors, UpdateRoomMetadataResponses, WsData } from './types.gen'; + +export type Options = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +/** + * チャンネルメッセージのリストを取得 + * + * 指定したチャンネルのメッセージのリストを取得します。 + */ +export const getMessages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/messages', + ...options +}); + +/** + * チャンネルにメッセージを投稿 + * + * 指定したチャンネルにメッセージを投稿します。 + * embedをtrueに指定すると、メッセージ埋め込みが自動で行われます。 + * アーカイブされているチャンネルに投稿することはできません。 + */ +export const postMessage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/messages', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * メッセージを検索 + * + * メッセージを検索します。 + */ +export const searchMessages = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages', + ...options +}); + +/** + * メッセージを削除 + * + * 指定したメッセージを削除します。 + * 自身が投稿したメッセージと自身が管理権限を持つWebhookとBOTが投稿したメッセージのみ削除することができます。 + * アーカイブされているチャンネルのメッセージを編集することは出来ません。 + */ +export const deleteMessage = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}', + ...options +}); + +/** + * メッセージを取得 + * + * 指定したメッセージを取得します。 + */ +export const getMessage = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}', + ...options +}); + +/** + * メッセージを編集 + * + * 指定したメッセージを編集します。 + * 自身が投稿したメッセージのみ編集することができます。 + * アーカイブされているチャンネルのメッセージを編集することは出来ません。 + */ +export const editMessage = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ピン留めを外す + * + * 指定したメッセージのピン留めを外します。 + */ +export const removePin = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/pin', + ...options +}); + +/** + * ピン留めを取得 + * + * 指定したメッセージのピン留め情報を取得します。 + */ +export const getPin = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/pin', + ...options +}); + +/** + * ピン留めする + * + * 指定したメッセージをピン留めします。 + * アーカイブされているチャンネルのメッセージ・存在しないメッセージ・チャンネル当たりの上限数を超えたメッセージのピン留めはできません。 + */ +export const createPin = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/pin', + ...options +}); + +/** + * チャンネル統計情報を取得 + * + * 指定したチャンネルの統計情報を取得します。 + */ +export const getChannelStats = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/stats', + ...options +}); + +/** + * チャンネルトピックを取得 + * + * 指定したチャンネルのトピックを取得します。 + */ +export const getChannelTopic = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/topic', + ...options +}); + +/** + * チャンネルトピックを編集 + * + * 指定したチャンネルのトピックを編集します。 + * アーカイブされているチャンネルのトピックは編集できません。 + */ +export const editChannelTopic = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/topic', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * チャンネル閲覧者リストを取得 + * + * 指定したチャンネルの閲覧者のリストを取得します。 + */ +export const getChannelViewers = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/viewers', + ...options +}); + +/** + * ファイルメタのリストを取得 + * + * 指定したクエリでファイルメタのリストを取得します。 + * クエリパラメータ`channelId`, `mine`の少なくともいずれかが必須です。 + */ +export const getFiles = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files', + ...options +}); + +/** + * ファイルをアップロード + * + * 指定したチャンネルにファイルをアップロードします。 + * アーカイブされているチャンネルにはアップロード出来ません。 + */ +export const postFile = (options?: Options) => (options?.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } +}); + +/** + * ファイルメタを取得 + * + * 指定したファイルのメタ情報を取得します。 + * 指定したファイルへのアクセス権限が必要です。 + */ +export const getFileMeta = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files/{fileId}/meta', + ...options +}); + +/** + * サムネイル画像を取得 + * + * 指定したファイルのサムネイル画像を取得します。 + * 指定したファイルへのアクセス権限が必要です。 + */ +export const getThumbnailImage = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files/{fileId}/thumbnail', + ...options +}); + +/** + * ファイルを削除 + * + * 指定したファイルを削除します。 + * 指定したファイルの削除権限が必要です。 + */ +export const deleteFile = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files/{fileId}', + ...options +}); + +/** + * ファイルをダウンロード + * + * 指定したファイル本体を取得します。 + * 指定したファイルへのアクセス権限が必要です。 + */ +export const getFile = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/files/{fileId}', + ...options +}); + +/** + * チャンネルピンのリストを取得 + * + * 指定したチャンネルにピン留めされているピンメッセージのリストを取得します。 + */ +export const getChannelPins = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/pins', + ...options +}); + +/** + * メッセージのスタンプリストを取得 + * + * 指定したメッセージに押されているスタンプのリストを取得します。 + */ +export const getMessageStamps = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/stamps', + ...options +}); + +/** + * スタンプを消す + * + * 指定したメッセージから指定した自身が押したスタンプを削除します。 + */ +export const removeMessageStamp = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/stamps/{stampId}', + ...options +}); + +/** + * スタンプを押す + * + * 指定したメッセージに指定したスタンプを押します。 + */ +export const addMessageStamp = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/stamps/{stampId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * スタンプを削除 + * + * 指定したスタンプを削除します。 + * 対象のスタンプの削除権限が必要です。 + */ +export const deleteStamp = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}', + ...options +}); + +/** + * スタンプ情報を取得 + * + * 指定したスタンプの情報を取得します。 + */ +export const getStamp = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}', + ...options +}); + +/** + * スタンプ情報を変更 + * + * 指定したスタンプの情報を変更します。 + */ +export const editStamp = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * スタンプリストを取得 + * + * スタンプのリストを取得します。 + */ +export const getStamps = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps', + ...options +}); + +/** + * スタンプを作成 + * + * スタンプを新規作成します。 + */ +export const createStamp = (options?: Options) => (options?.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } +}); + +/** + * スタンプ履歴を取得 + * + * 自分のスタンプ履歴を最大100件まで取得します。 + * 結果は降順で返されます。 + * + * このAPIが返すスタンプ履歴は厳密な履歴ではありません。 + */ +export const getMyStampHistory = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/stamp-history', + ...options +}); + +/** + * スタンプレコメンドを取得 + * + * 自分のスタンプレコメンドを最大200件まで取得します。 + * 結果は推薦度の高い順で返されます。 + * スタンプを使用したことがないユーザーの場合は空配列が返されます。 + */ +export const getMyStampRecommendations = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/stamp-recommendations', + ...options +}); + +/** + * QRコードを取得 + * + * 自身のQRコードを取得します。 + * 返されたQRコードまたはトークンは、発行後の5分間のみ有効です + */ +export const getMyQrCode = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/qr-code', + ...options +}); + +/** + * スタンプ統計情報を取得 + * + * 指定したスタンプの統計情報を取得します。 + */ +export const getStampStats = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}/stats', + ...options +}); + +/** + * ユーザー詳細情報を取得 + * + * 指定したユーザーの詳細情報を取得します。 + */ +export const getUser = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}', + ...options +}); + +/** + * ユーザー情報を変更 + * + * 指定したユーザーの情報を変更します。 + * 管理者権限が必要です。 + */ +export const editUser = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ユーザーグループを削除 + * + * 指定したユーザーグループを削除します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const deleteUserGroup = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}', + ...options +}); + +/** + * ユーザーグループを取得 + * + * 指定したユーザーグループの情報を取得します。 + */ +export const getUserGroup = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}', + ...options +}); + +/** + * ユーザーグループを編集 + * + * 指定したユーザーグループの情報を編集します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const editUserGroup = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ユーザーグループのアイコンを変更 + * + * ユーザーグループのアイコンを変更します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const changeUserGroupIcon = (options: Options) => (options.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/icon', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * グループメンバーを一括削除 + * + * 指定したグループから全てのメンバーを削除します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const removeUserGroupMembers = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/members', + ...options +}); + +/** + * グループメンバーを取得 + * + * 指定したグループのメンバーのリストを取得します。 + */ +export const getUserGroupMembers = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/members', + ...options +}); + +/** + * グループメンバーを追加 + * + * 指定したグループにメンバーを追加します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const addUserGroupMember = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/members', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * グループメンバーを削除 + * + * 指定したユーザーグループから指定したユーザーを削除します。 + * 既にグループから削除されているメンバーを指定した場合は204を返します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const removeUserGroupMember = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/members/{userId}', + ...options +}); + +/** + * グループメンバーを編集 + * + * 指定したユーザーグループ内の指定したユーザーの属性を編集します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const editUserGroupMember = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/members/{userId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ユーザーグループのリストを取得 + * + * ユーザーグループのリストを取得します。 + */ +export const getUserGroups = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups', + ...options +}); + +/** + * ユーザーグループを作成 + * + * ユーザーグループを作成します。 + * 作成者は自動的にグループ管理者になります。 + */ +export const createUserGroup = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 自分のユーザー詳細を取得 + * + * 自身のユーザー詳細情報を取得します。 + */ +export const getMe = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me', + ...options +}); + +/** + * 自分のユーザー情報を変更 + * + * 自身のユーザー情報を変更します。 + */ +export const editMe = (options?: Options) => (options?.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 自分のユーザー詳細を取得 (OIDC UserInfo) + * + * OIDCトークンを用いてユーザー詳細を取得します。 + * OIDC UserInfo Endpointです。 + * + */ +export const getOidcUserInfo = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/oidc', + ...options +}); + +/** + * ダイレクトメッセージのリストを取得 + * + * 指定したユーザーとのダイレクトメッセージのリストを取得します。 + */ +export const getDirectMessages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/messages', + ...options +}); + +/** + * ダイレクトメッセージを送信 + * + * 指定したユーザーにダイレクトメッセージを送信します。 + */ +export const postDirectMessage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/messages', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ユーザー統計情報を取得 + * + * 指定したユーザーの統計情報を取得します。 + */ +export const getUserStats = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/stats', + ...options +}); + +/** + * チャンネルの通知購読者のリストを取得 + * + * 指定したチャンネルを通知購読しているユーザーのUUIDのリストを取得します。 + */ +export const getChannelSubscribers = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/subscribers', + ...options +}); + +/** + * チャンネルの通知購読者を編集 + * + * 指定したチャンネルの通知購読者を編集します。 + * リクエストに含めなかったユーザーの通知購読状態は変更しません。 + * また、存在しないユーザーを指定した場合は無視されます。 + */ +export const editChannelSubscribers = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/subscribers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * チャンネルの通知購読者を設定 + * + * 指定したチャンネルの通知購読者を設定します。 + * リクエストに含めなかったユーザーの通知購読状態はオフになります。 + * また、存在しないユーザーを指定した場合は無視されます。 + */ +export const setChannelSubscribers = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/subscribers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * 自分のチャンネル購読状態を取得 + * + * 自身のチャンネル購読状態を取得します。 + */ +export const getMyChannelSubscriptions = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/subscriptions', + ...options +}); + +/** + * チャンネル購読レベルを設定 + * + * 自身の指定したチャンネルの購読レベルを設定します。 + */ +export const setChannelSubscribeLevel = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/subscriptions/{channelId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Webhook情報のリストを取得します + * + * Webhookのリストを取得します。 + * allがtrueで無い場合は、自分がオーナーのWebhookのリストを返します。 + */ +export const getWebhooks = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks', + ...options +}); + +/** + * Webhookを新規作成 + * + * Webhookを新規作成します。 + * `secret`が空文字の場合、insecureウェブフックが作成されます。 + */ +export const createWebhook = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * Webhookを削除 + * + * 指定したWebhookを削除します。 + * Webhookによって投稿されたメッセージは削除されません。 + */ +export const deleteWebhook = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}', + ...options +}); + +/** + * Webhook情報を取得 + * + * 指定したWebhookの詳細を取得します。 + */ +export const getWebhook = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}', + ...options +}); + +/** + * Webhook情報を変更 + * + * 指定したWebhookの情報を変更します。 + */ +export const editWebhook = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * Webhookを送信 + * + * Webhookにメッセージを投稿します。 + * secureなウェブフックに対しては`X-TRAQ-Signature`ヘッダーが必須です。 + * アーカイブされているチャンネルには投稿できません。 + */ +export const postWebhook = (options: Options) => (options.client ?? client).post({ + bodySerializer: null, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}', + ...options, + headers: { + 'Content-Type': 'text/plain', + ...options.headers + } +}); + +/** + * Webhookのアイコンを取得 + * + * 指定したWebhookのアイコン画像を取得します + */ +export const getWebhookIcon = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}/icon', + ...options +}); + +/** + * Webhookのアイコンを変更 + * + * 指定したWebhookのアイコン画像を変更します。 + */ +export const changeWebhookIcon = (options: Options) => (options.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}/icon', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * ユーザーのアイコン画像を取得 + * + * 指定したユーザーのアイコン画像を取得します。 + */ +export const getUserIcon = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/icon', + ...options +}); + +/** + * ユーザーのアイコン画像を変更します + * + * 指定したユーザーのアイコン画像を変更します。 + * 管理者権限が必要です。 + */ +export const changeUserIcon = (options: Options) => (options.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/icon', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * 自分のアイコン画像を取得 + * + * 自分のアイコン画像を取得します。 + */ +export const getMyIcon = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/icon', + ...options +}); + +/** + * 自分のアイコン画像を変更 + * + * 自分のアイコン画像を変更します。 + */ +export const changeMyIcon = (options?: Options) => (options?.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/icon', + ...options, + headers: { + 'Content-Type': null, + ...options?.headers + } +}); + +/** + * 自分のパスワードを変更 + * + * 自身のパスワードを変更します。 + */ +export const changeMyPassword = (options?: Options) => (options?.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * ユーザーのパスワードを変更 + * + * 指定したユーザーのパスワードを変更します。 + * 管理者権限が必要です。 + */ +export const changeUserPassword = (options: Options) => (options.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/password', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * FCMデバイスを登録 + * + * 自身のFCMデバイスを登録します。 + */ +export const registerFcmDevice = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/fcm-device', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 自身のチャンネル閲覧状態一覧を取得 + * + * 自身のチャンネル閲覧状態一覧を取得します。 + */ +export const getMyViewStates = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/view-states', + ...options +}); + +/** + * ユーザーのリストを取得 + * + * ユーザーのリストを取得します。 + * `include-suspended`を指定しない場合、レスポンスにはユーザーアカウント状態が"1: 有効"であるユーザーのみが含まれます。 + * `include-suspended`と`name`を同時に指定することはできません。 + */ +export const getUsers = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users', + ...options +}); + +/** + * ユーザーを登録 + * + * ユーザーを登録します。 + * 管理者権限が必要です。 + */ +export const createUser = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * チャンネルリストを取得 + * + * チャンネルのリストを取得します。 + */ +export const getChannels = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels', + ...options +}); + +/** + * チャンネルを作成 + * + * チャンネルを作成します。 + * 階層が6以上になるチャンネルは作成できません。 + */ +export const createChannel = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * ユーザーのタグリストを取得 + * + * 指定したユーザーのタグリストを取得します。 + */ +export const getUserTags = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/tags', + ...options +}); + +/** + * ユーザーにタグを追加 + * + * 指定したユーザーに指定したタグを追加します。 + * Webhookユーザーにタグを追加することは出来ません。 + */ +export const addUserTag = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/tags', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ユーザーからタグを削除します + * + * 既に存在しないタグを削除しようとした場合は204を返します。 + */ +export const removeUserTag = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/tags/{tagId}', + ...options +}); + +/** + * ユーザーのタグを編集 + * + * 指定したユーザーの指定したタグの状態を変更します。 + * 他人の状態は変更できません。 + */ +export const editUserTag = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/tags/{tagId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * タグ情報を取得 + * + * 指定したタグの情報を取得します。 + */ +export const getTag = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/tags/{tagId}', + ...options +}); + +/** + * 自分のタグリストを取得 + * + * 自分に付けられているタグの配列を取得します。 + */ +export const getMyUserTags = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tags', + ...options +}); + +/** + * 自分にタグを追加 + * + * 自分に新しくタグを追加します。 + */ +export const addMyUserTag = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tags', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 自分からタグを削除します + * + * 既に存在しないタグを削除しようとした場合は204を返します。 + */ +export const removeMyUserTag = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tags/{tagId}', + ...options +}); + +/** + * 自分のタグを編集 + * + * 自分の指定したタグの状態を変更します。 + */ +export const editMyUserTag = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tags/{tagId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * スターチャンネルリストを取得 + * + * 自分がスターしているチャンネルのUUIDの配列を取得します。 + */ +export const getMyStars = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/stars', + ...options +}); + +/** + * チャンネルをスターに追加 + * + * 指定したチャンネルをスターチャンネルに追加します。 + * スター済みのチャンネルIDを指定した場合、204を返します。 + * 不正なチャンネルIDを指定した場合、400を返します。 + */ +export const addMyStar = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/stars', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * チャンネルをスターから削除します + * + * 既にスターから削除されているチャンネルを指定した場合は204を返します。 + */ +export const removeMyStar = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/stars/{channelId}', + ...options +}); + +/** + * 未読チャンネルを取得 + * + * 自分が現在未読のチャンネルの未読情報を取得します。 + */ +export const getMyUnreadChannels = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/unread', + ...options +}); + +/** + * バージョンを取得 + * + * サーバーバージョン及びサーバーフラグ情報を取得します。 + */ +export const getServerVersion = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/version', + ...options +}); + +/** + * ログイン + * + * ログインします。 + */ +export const login = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/login', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * ログアウト + * + * ログアウトします。 + */ +export const logout = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/logout', + ...options +}); + +/** + * 自分のログインセッションリストを取得 + * + * 自分のログインセッションのリストを取得します。 + */ +export const getMySessions = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/sessions', + ...options +}); + +/** + * セッションを無効化 + * + * 指定した自分のセッションを無効化(ログアウト)します。 + * 既に存在しない・無効化されているセッションを指定した場合も`204`を返します。 + */ +export const revokeMySession = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/sessions/{sessionId}', + ...options +}); + +/** + * アクテビティタイムラインを取得 + * + * パブリックチャンネルの直近の投稿メッセージを作成日時の降順で取得します。 + * `all`が`true`でない場合、購読チャンネルのみのタイムラインを取得します + */ +export const getActivityTimeline = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/activity/timeline', + ...options +}); + +/** + * WebSocket通知ストリームに接続します + * + * # WebSocketプロトコル + * ## 送信 + * `コマンド:引数1:引数2:...`のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できる。 + * ### `viewstate`コマンド + * このWebSocketセッションが見ているチャンネル(イベントを受け取るチャンネル)を設定する。 + * 現時点では1つのセッションに対して1つのチャンネルしか設定できない。 + * + * `viewstate:{チャンネルID}:{閲覧状態}` + * + チャンネルID: 対象のチャンネルID + * + 閲覧状態: `none`, `monitoring`, `editing` + * + * 最初の`viewstate`コマンドを送る前、または`viewstate:null`, `viewstate:`を送信した後は、このセッションはどこのチャンネルも見ていないことになる。 + * + * ### `rtcstate`コマンド + * 自分のWebRTC状態を変更する。 + * 他のコネクションが既に状態を保持している場合、変更することができません。 + * + * `rtcstate:{チャンネルID}:({状態}:{セッションID})*` + * + * コネクションが切断された場合、自分のWebRTC状態はリセットされます。 + * + * ### `timeline_streaming`コマンド + * 全てのパブリックチャンネルの`MESSAGE_CREATED`イベントを受け取るかどうかを設定する。 + * 初期状態は`off`です。 + * + * `timeline_streaming:(on|off|true|false)` + * + * ## 受信 + * TextMessageとして各種イベントが`type`と`body`を持つJSONとして非同期に送られます。 + * + * 例: + * ```json + * {"type":"USER_ONLINE","body":{"id":"7dd8e07f-7f5d-4331-9176-b56a4299768b"}} + * ``` + * + * ## イベント一覧 + * + * ### `USER_JOINED` + * ユーザーが新規登録された。 + * + * 対象: 全員 + * + * + `id`: 登録されたユーザーのId + * + * ### `USER_UPDATED` + * ユーザーの情報が更新された。 + * + * 対象: 全員 + * + * + `id`: 情報が更新されたユーザーのId + * + * ### `USER_TAGS_UPDATED` + * ユーザーのタグが更新された。 + * + * 対象: 全員 + * + * + `id`: タグが更新されたユーザーのId + * + `tag_id`: 更新されたタグのId + * + * ### `USER_ICON_UPDATED` + * ユーザーのアイコンが更新された。 + * + * 対象: 全員 + * + * + `id`: アイコンが更新されたユーザーのId + * + * ### `USER_WEBRTC_STATE_CHANGED` + * ユーザーのWebRTCの状態が変化した + * + * 対象: 全員 + * + * + `user_id`: 変更があったユーザーのId + * + `channel_id`: ユーザーの変更後の接続チャンネルのId + * + `sessions`: ユーザーの変更後の状態(配列) + * + `state`: 状態 + * + `sessionId`: セッションID + * + * ### `USER_VIEWSTATE_CHANGED` + * ユーザーのチャンネルの閲覧状態が変化した + * + * 対象: 変化したWSセッションを含めた、該当ユーザーのWSセッション全て + * + * + `view_states`: 変化したWSセッションを含めた、該当ユーザーの変更後の状態(配列) + * + `key`: WSセッションの識別子 + * + `channel_id`: 閲覧しているチャンネルId + * + `state`: 閲覧状態 + * + * ### `USER_ONLINE` + * ユーザーがオンラインになった。 + * + * 対象: 全員 + * + * + `id`: オンラインになったユーザーのId + * + * ### `USER_OFFLINE` + * ユーザーがオフラインになった。 + * + * 対象: 全員 + * + * + `id`: オフラインになったユーザーのId + * + * ### `USER_GROUP_CREATED` + * ユーザーグループが作成された + * + * 対象: 全員 + * + * + `id`: 作成されたユーザーグループのId + * + * ### `USER_GROUP_UPDATED` + * ユーザーグループが更新された + * + * 対象: 全員 + * + * + `id`: 作成されたユーザーグループのId + * + * ### `USER_GROUP_DELETED` + * ユーザーグループが削除された + * + * 対象: 全員 + * + * + `id`: 削除されたユーザーグループのId + * + * ### `CHANNEL_CREATED` + * チャンネルが新規作成された。 + * + * 対象: 該当チャンネルを閲覧可能な全員 + * + * + `id`: 作成されたチャンネルのId + * + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId + * + * ### `CHANNEL_UPDATED` + * チャンネルの情報が変更された。 + * + * 対象: 該当チャンネルを閲覧可能な全員 + * + * + `id`: 変更があったチャンネルのId + * + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId + * + * ### `CHANNEL_DELETED` + * チャンネルが削除された。 + * + * 対象: 該当チャンネルを閲覧可能な全員 + * + * + `id`: 削除されたチャンネルのId + * + `dm_user_id`: (DMの場合のみ) DM相手のユーザーId + * + * ### `CHANNEL_STARED` + * 自分がチャンネルをスターした。 + * + * 対象: 自分 + * + * + `id`: スターしたチャンネルのId + * + * ### `CHANNEL_UNSTARED` + * 自分がチャンネルのスターを解除した。 + * + * 対象: 自分 + * + * + `id`: スターしたチャンネルのId + * + * ### `CHANNEL_VIEWERS_CHANGED` + * チャンネルの閲覧者が変化した。 + * + * 対象: 該当チャンネルを閲覧しているユーザー + * + * + `id`: 変化したチャンネルのId + * + `viewers`: 変化後の閲覧者(配列) + * + `userId`: ユーザーId + * + `state`: 閲覧状態 + * + `updatedAt`: 閲覧状態の更新日時 + * + * ### `CHANNEL_SUBSCRIBERS_CHANGED` + * チャンネルの購読者が変化した。 + * + * 対象: 該当チャンネルを閲覧しているユーザー + * + * + `id`: 変化したチャンネルのId + * + * ### `MESSAGE_CREATED` + * メッセージが投稿された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー・投稿チャンネルに通知をつけているユーザー・メンションを受けたユーザー + * + * + `id`: 投稿されたメッセージのId + * + `is_citing`: 投稿されたメッセージがWebSocketを接続しているユーザーの投稿を引用しているかどうか + * + * ### `MESSAGE_UPDATED` + * メッセージが更新された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `id`: 更新されたメッセージのId + * + * ### `MESSAGE_DELETED` + * メッセージが削除された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `id`: 削除されたメッセージのId + * + * ### `MESSAGE_STAMPED` + * メッセージにスタンプが押された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `message_id`: メッセージId + * + `user_id`: スタンプを押したユーザーのId + * + `stamp_id`: スタンプのId + * + `count`: そのユーザーが押した数 + * + `created_at`: そのユーザーがそのスタンプをそのメッセージに最初に押した日時 + * + * ### `MESSAGE_UNSTAMPED` + * メッセージからスタンプが外された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `message_id`: メッセージId + * + `user_id`: スタンプを押したユーザーのId + * + `stamp_id`: スタンプのId + * + * ### `MESSAGE_PINNED` + * メッセージがピン留めされた。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `message_id`: ピンされたメッセージのID + * + `channel_id`: ピンされたメッセージのチャンネルID + * + * ### `MESSAGE_UNPINNED` + * ピン留めされたメッセージのピンが外された。 + * + * 対象: 投稿チャンネルを閲覧しているユーザー + * + * + `message_id`: ピンが外されたメッセージのID + * + `channel_id`: ピンが外されたメッセージのチャンネルID + * + * ### `MESSAGE_READ` + * 自分があるチャンネルのメッセージを読んだ。 + * + * 対象: 自分 + * + * + `id`: 読んだチャンネルId + * + * ### `STAMP_CREATED` + * スタンプが新しく追加された。 + * + * 対象: 全員 + * + * + `id`: 作成されたスタンプのId + * + * ### `STAMP_UPDATED` + * スタンプが修正された。 + * + * 対象: 全員 + * + * + `id`: 修正されたスタンプのId + * + * ### `STAMP_DELETED` + * スタンプが削除された。 + * + * 対象: 全員 + * + * + `id`: 削除されたスタンプのId + * + * ### `STAMP_PALETTE_CREATED` + * スタンプパレットが新しく追加された。 + * + * 対象: 自分 + * + * + `id`: 作成されたスタンプパレットのId + * + * ### `STAMP_PALETTE_UPDATED` + * スタンプパレットが修正された。 + * + * 対象: 自分 + * + * + `id`: 修正されたスタンプパレットのId + * + * ### `STAMP_PALETTE_DELETED` + * スタンプパレットが削除された。 + * + * 対象: 自分 + * + * + `id`: 削除されたスタンプパレットのId + * + * ### `CLIP_FOLDER_CREATED` + * クリップフォルダーが作成された。 + * + * 対象:自分 + * + * + `id`: 作成されたクリップフォルダーのId + * + * ### `CLIP_FOLDER_UPDATED` + * クリップフォルダーが修正された。 + * + * 対象: 自分 + * + * + `id`: 更新されたクリップフォルダーのId + * + * ### `CLIP_FOLDER_DELETED` + * クリップフォルダーが削除された。 + * + * 対象: 自分 + * + * + `id`: 削除されたクリップフォルダーのId + * + * ### `CLIP_FOLDER_MESSAGE_DELETED` + * クリップフォルダーからメッセージが除外された。 + * + * 対象: 自分 + * + * + `folder_id`: メッセージが除外されたクリップフォルダーのId + * + `message_id`: クリップフォルダーから除外されたメッセージのId + * + * ### `CLIP_FOLDER_MESSAGE_ADDED` + * クリップフォルダーにメッセージが追加された。 + * + * 対象: 自分 + * + * + `folder_id`: メッセージが追加されたクリップフォルダーのId + * + `message_id`: クリップフォルダーに追加されたメッセージのId + * + * ### `QALL_ROOM_STATE_CHANGED` + * ルーム状態が変更された。 + * + * 対象: 全員 + * + * + `room_id`: 変更されたルームのId + * + `state`: 変更後のルーム状態 + * + `roomId`: ルームのID + * + `participants`: ルーム内の参加者(配列) + * + `identity`: ユーザーID_RandomUUID + * + `name`: 表示名 + * + `joinedAt`: 参加した時刻 + * + `attributes`: ユーザーに関連付けられたカスタム属性 + * + `canPublish`: 発言権限 + * + `isWebinar`: ウェビナールームかどうか + * + `metadata`: ルームに関連付けられたカスタム属性 + * + * ### `QALL_SOUNDBOARD_ITEM_CREATED` + * サウンドボードアイテムが作成された。 + * + * 対象: 全員 + * + * + `sound_id`: 作成されたサウンドのId + * + `name`: サウンド名 + * + `creator_id`: 作成者のId + * + * ### `QALL_SOUNDBOARD_ITEM_DELETED` + * サウンドボードアイテムが削除された。 + * + * 対象: 全員 + * + * + `sound_id`: 削除されたサウンドのId + */ +export const ws = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/ws', + ...options +}); + +/** + * 有効トークンのリストを取得 + * + * 有効な自分に発行されたOAuth2トークンのリストを取得します。 + */ +export const getMyTokens = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tokens', + ...options +}); + +/** + * トークンの認可を取り消す + * + * 自分の指定したトークンの認可を取り消します。 + */ +export const revokeMyToken = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/tokens/{tokenId}', + ...options +}); + +/** + * ユーザーのアイコン画像を取得 + * + * ユーザーのアイコン画像を取得します。 + */ +export const getPublicUserIcon = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/public/icon/{username}', + ...options +}); + +/** + * OAuth2クライアントを削除 + * + * 指定したOAuth2クライアントを削除します。 + * 対象のクライアントの管理権限が必要です。正常に削除された場合、このクライアントに対する認可は全て取り消されます。 + */ +export const deleteClient = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients/{clientId}', + ...options +}); + +/** + * OAuth2クライアント情報を取得 + * + * 指定したOAuth2クライアントの情報を取得します。 + * 詳細情報の取得には対象のクライアントの管理権限が必要です。 + */ +export const getClient = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients/{clientId}', + ...options +}); + +/** + * OAuth2クライアント情報を変更 + * + * 指定したOAuth2クライアントの情報を変更します。 + * 対象のクライアントの管理権限が必要です。 + * クライアント開発者UUIDを変更した場合は、変更先ユーザーにクライアント管理権限が移譲され、自分自身は権限を失います。 + */ +export const editClient = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients/{clientId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * OAuthクライアントのトークンを削除 + * + * 自分が許可している指定したOAuthクライアントのアクセストークンを全てRevokeします。 + */ +export const revokeClientTokens = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients/{clientId}/tokens', + ...options +}); + +/** + * OAuth2クライアントのリストを取得 + * + * 自身が開発者のOAuth2クライアントのリストを取得します。 + * `all`が`true`の場合、全開発者の全クライアントのリストを返します。 + */ +export const getClients = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients', + ...options +}); + +/** + * OAuth2クライアントを作成 + * + * OAuth2クライアントを作成します。 + */ +export const createClient = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clients', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * BOTリストを取得 + * + * BOT情報のリストを取得します。 + * allを指定しない場合、自分が開発者のBOTのみを返します。 + */ +export const getBots = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots', + ...options +}); + +/** + * BOTを作成 + * + * BOTを作成します。 + * 作成後に購読イベントの設定を行う必要があります。 + * さらにHTTP Modeの場合はアクティベーションを行う必要があります。 + */ +export const createBot = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * WebSocket Mode BOT用通知ストリームに接続します + * + * # BOT WebSocketプロトコル + * + * ## 送信 + * + * `コマンド:引数1:引数2:...` のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できます。 + * + * ### `rtcstate`コマンド + * 自分のWebRTC状態を変更します。 + * 他のコネクションが既に状態を保持している場合、変更することができません。 + * + * `rtcstate:{チャンネルID}:({状態}:{セッションID})*` + * + * チャンネルIDにnullもしくは空文字を指定するか、状態にnullもしくは空文字を指定した場合、WebRTC状態はリセットされます。 + * + * `rtcstate:null`, `rtcstate:`, `rtcstate:channelId:null`, `rtcstate:channelId:` + * + * コネクションが切断された場合、自分のWebRTC状態はリセットされます。 + * + * ## 受信 + * + * TextMessageとして各種イベントが`type`、`reqId`、`body`を持つJSONとして非同期に送られます。 + * `body`の内容はHTTP Modeの場合のRequest Bodyと同様です。 + * 例外として`ERROR`イベントは`reqId`を持ちません。 + * + * 例: PINGイベント + * `{"type":"PING","reqId":"requestId","body":{"eventTime":"2019-05-07T04:50:48.582586882Z"}}` + * + * ### `ERROR` + * + * コマンドの引数が不正などの理由でコマンドが受理されなかった場合に送られます。 + * 非同期に送られるため、必ずしもコマンドとの対応関係を確定できないことに注意してください。 + * 本番環境ではERRORが送られないようにすることが望ましいです。 + * + * `{"type":"ERROR","body":"message"}` + */ +export const connectBotWs = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/ws', + ...options +}); + +/** + * BOTのアイコン画像を取得 + * + * 指定したBOTのアイコン画像を取得を取得します。 + */ +export const getBotIcon = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/icon', + ...options +}); + +/** + * BOTのアイコン画像を変更 + * + * 指定したBOTのアイコン画像を変更を変更します。 + * 対象のBOTの管理権限が必要です。 + */ +export const changeBotIcon = (options: Options) => (options.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/icon', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * BOTを削除 + * + * 指定したBOTを削除します。 + * 対象のBOTの管理権限が必要です。 + */ +export const deleteBot = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}', + ...options +}); + +/** + * BOT情報を取得 + * + * 指定したBOTのBOT情報を取得します。 + * BOT詳細情報を取得する場合は、対象のBOTの管理権限が必要です。 + */ +export const getBot = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}', + ...options +}); + +/** + * BOT情報を変更 + * + * 指定したBOTの情報を変更します。 + * 対象のBOTの管理権限が必要です。 + * BOT開発者UUIDを変更した場合は、変更先ユーザーにBOT管理権限が移譲され、自分自身は権限を失います。 + */ +export const editBot = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * BOTをアクティベート + * + * 指定したBOTを有効化します。 + * 対象のBOTの管理権限が必要です。 + */ +export const activateBot = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/actions/activate', + ...options +}); + +/** + * BOTをインアクティベート + * + * 指定したBOTを無効化します。対象のBOTの管理権限が必要です。 + */ +export const inactivateBot = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/actions/inactivate', + ...options +}); + +/** + * BOTのトークンを再発行 + * + * 指定したBOTの現在の各種トークンを無効化し、再発行を行います。 + * 対象のBOTの管理権限が必要です。 + */ +export const reissueBot = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/actions/reissue', + ...options +}); + +/** + * BOTのイベントログを取得 + * + * 指定したBOTのイベントログを取得します。 + * 対象のBOTの管理権限が必要です。 + */ +export const getBotLogs = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/logs', + ...options +}); + +/** + * BOTをチャンネルに参加させる + * + * 指定したBOTを指定したチャンネルに参加させます。 + * チャンネルに参加したBOTは、そのチャンネルの各種イベントを受け取るようになります。 + * 対象のBOTの管理権限が必要です。 + */ +export const letBotJoinChannel = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/actions/join', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * BOTをチャンネルから退出させる + * + * 指定したBOTを指定したチャンネルから退出させます。 + * 対象のBOTの管理権限が必要です。 + */ +export const letBotLeaveChannel = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/bots/{botId}/actions/leave', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * チャンネル参加中のBOTのリストを取得 + * + * 指定したチャンネルに参加しているBOTのリストを取得します。 + */ +export const getChannelBots = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/bots', + ...options +}); + +/** + * Skyway用認証API + * + * Skyway WebRTC用の認証API + */ +export const postWebRtcAuthenticate = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webrtc/authenticate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * チャンネル情報を取得 + * + * 指定したチャンネルの情報を取得します。 + */ +export const getChannel = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}', + ...options +}); + +/** + * チャンネル情報を変更 + * + * 指定したチャンネルの情報を変更します。 + * 変更には権限が必要です。 + * ルートチャンネルに移動させる場合は、`parent`に`00000000-0000-0000-0000-000000000000`を指定してください。 + */ +export const editChannel = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * WebRTC状態を取得 + * + * 現在のWebRTC状態を取得します。 + */ +export const getWebRtcState = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webrtc/state', + ...options +}); + +/** + * クリップフォルダのリストを取得 + * + * 自身が所有するクリップフォルダのリストを取得します。 + */ +export const getClipFolders = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders', + ...options +}); + +/** + * クリップフォルダを作成 + * + * クリップフォルダを作成します。 + * 既にあるフォルダと同名のフォルダを作成することは可能です。 + */ +export const createClipFolder = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * クリップフォルダを削除 + * + * 指定したクリップフォルダを削除します。 + */ +export const deleteClipFolder = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}', + ...options +}); + +/** + * クリップフォルダ情報を取得 + * + * 指定したクリップフォルダの情報を取得します。 + */ +export const getClipFolder = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}', + ...options +}); + +/** + * クリップフォルダ情報を編集 + * + * 指定したクリップフォルダの情報を編集します。 + */ +export const editClipFolder = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * フォルダ内のクリップのリストを取得 + * + * 指定したフォルダ内のクリップのリストを取得します。 + * `order`を指定しない場合、クリップした日時の新しい順で返されます。 + */ +export const getClips = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}/messages', + ...options +}); + +/** + * メッセージをクリップフォルダに追加 + * + * 指定したメッセージを指定したクリップフォルダに追加します。 + */ +export const clipMessage = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}/messages', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * メッセージをクリップフォルダから除外 + * + * 指定したフォルダから指定したメッセージのクリップを除外します。 + * 既に外されているメッセージを指定した場合は204を返します。 + */ +export const unclipMessage = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/clip-folders/{folderId}/messages/{messageId}', + ...options +}); + +/** + * Webhookの投稿メッセージのリストを取得 + * + * 指定されたWebhookが投稿したメッセージのリストを返します。 + */ +export const getWebhookMessages = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/{webhookId}/messages', + ...options +}); + +/** + * Webhookの投稿メッセージを削除 + */ +export const deleteWebhookMessage = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/webhooks/:webhookID/messages/:messageID', + ...options +}); + +/** + * チャンネルイベントのリストを取得 + * + * 指定したチャンネルのイベントリストを取得します。 + */ +export const getChannelEvents = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/events', + ...options +}); + +/** + * スタンプパレットのリストを取得 + * + * 自身が所有しているスタンプパレットのリストを取得します。 + */ +export const getStampPalettes = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamp-palettes', + ...options +}); + +/** + * スタンプパレットを作成 + * + * スタンプパレットを作成します。 + */ +export const createStampPalette = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamp-palettes', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * スタンプパレットを削除 + * + * 指定したスタンプパレットを削除します。 + * 対象のスタンプパレットの管理権限が必要です。 + */ +export const deleteStampPalette = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamp-palettes/{paletteId}', + ...options +}); + +/** + * スタンプパレットを取得 + * + * 指定したスタンプパレットの情報を取得します。 + */ +export const getStampPalette = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamp-palettes/{paletteId}', + ...options +}); + +/** + * スタンプパレットを編集 + * + * 指定したスタンプパレットを編集します。 + * リクエストのスタンプの配列の順番は保存されて変更されます。 + * 対象のスタンプパレットの管理権限が必要です。 + */ +export const editStampPalette = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamp-palettes/{paletteId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * オンラインユーザーリストを取得 + * + * 現在オンラインな(SSEまたはWSが接続中)ユーザーのUUIDのリストを返します。 + */ +export const getOnlineUsers = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/activity/onlines', + ...options +}); + +/** + * スタンプ画像を取得 + * + * 指定したIDのスタンプ画像を返します。 + */ +export const getStampImage = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}/image', + ...options +}); + +/** + * スタンプ画像を変更 + * + * 指定したスタンプの画像を変更します。 + */ +export const changeStampImage = (options: Options) => (options.client ?? client).put({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/stamps/{stampId}/image', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * チャンネルを既読にする + * + * 自分が未読のチャンネルを既読にします。 + */ +export const readChannel = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/unread/{channelId}', + ...options +}); + +/** + * グループ管理者を削除 + * + * 指定したユーザーグループから指定した管理者を削除します。 + * 対象のユーザーグループの管理者権限が必要です。 + * グループから管理者が存在しなくなる場合は400エラーを返します。 + */ +export const removeUserGroupAdmin = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/admins/{userId}', + ...options +}); + +/** + * グループ管理者を取得 + * + * 指定したグループの管理者のリストを取得します。 + */ +export const getUserGroupAdmins = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/admins', + ...options +}); + +/** + * グループ管理者を追加 + * + * 指定したグループに管理者を追加します。 + * 対象のユーザーグループの管理者権限が必要です。 + */ +export const addUserGroupAdmin = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/groups/{groupId}/admins', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * OAuth2 トークンエンドポイント + * + * OAuth2 トークンエンドポイント + */ +export const postOAuth2Token = (options: Options) => (options.client ?? client).post({ + ...urlSearchParamsBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/oauth2/token', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options.headers + } +}); + +/** + * OAuth2 認可承諾API + * + * OAuth2 認可承諾 + */ +export const postOAuth2AuthorizeDecide = (options: Options) => (options.client ?? client).post({ + ...urlSearchParamsBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/oauth2/authorize/decide', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options.headers + } +}); + +/** + * OAuth2 認可エンドポイント + * + * OAuth2 認可エンドポイント + */ +export const getOAuth2Authorize = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/oauth2/authorize', + ...options +}); + +/** + * OAuth2 認可エンドポイント + * + * OAuth2 認可エンドポイント + */ +export const postOAuth2Authorize = (options: Options) => (options.client ?? client).post({ + ...urlSearchParamsBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/oauth2/authorize', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options.headers + } +}); + +/** + * OAuth2 トークン無効化エンドポイント + * + * OAuth2 トークン無効化エンドポイント + */ +export const revokeOAuth2Token = (options: Options) => (options.client ?? client).post({ + ...urlSearchParamsBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/oauth2/revoke', + ...options, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...options.headers + } +}); + +/** + * 外部ログインアカウント一覧を取得 + * + * 自分に紐付けられている外部ログインアカウント一覧を取得します。 + */ +export const getMyExternalAccounts = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/ex-accounts', + ...options +}); + +/** + * 外部ログインアカウントを紐付ける + * + * 自分に外部ログインアカウントを紐付けます。 + * 指定した`providerName`がサーバー側で有効である必要があります。 + * リクエストが受理された場合、外部サービスの認証画面にリダイレクトされ、認証される必要があります。 + */ +export const linkExternalAccount = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/ex-accounts/link', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 外部ログインアカウントの紐付けを解除 + * + * 自分に紐付けられている外部ログインアカウントの紐付けを解除します。 + */ +export const unlinkExternalAccount = (options?: Options) => (options?.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/ex-accounts/unlink', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * DMチャンネル情報を取得 + * + * 指定したユーザーとのダイレクトメッセージチャンネルの情報を返します。 + * ダイレクトメッセージチャンネルが存在しなかった場合、自動的に作成されます。 + */ +export const getUserDmChannel = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/{userId}/dm-channel', + ...options +}); + +/** + * 自分のクリップを取得 + * + * 対象のメッセージの自分のクリップの一覧を返します。 + */ +export const getMessageClips = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/messages/{messageId}/clips', + ...options +}); + +/** + * OGP情報を取得 + * + * 指定されたURLのOGP情報を取得します。 + * 指定されたURLに対するOGP情報が見つからなかった場合、typeがemptyに設定された空のOGP情報を返します。 + * + */ +export const getOgp = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/ogp', + ...options +}); + +/** + * OGP情報のキャッシュを削除 + * + * 指定されたURLのOGP情報のキャッシュを削除します。 + */ +export const deleteOgpCache = (options: Options) => (options.client ?? client).delete({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/ogp/cache', + ...options +}); + +/** + * ユーザー設定を取得 + * + * ユーザー設定を取得します。 + */ +export const getUserSettings = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/settings', + ...options +}); + +/** + * メッセージ引用通知の設定情報を取得 + * + * メッセージ引用通知の設定情報を変更します。 + */ +export const getMyNotifyCitation = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/settings/notify-citation', + ...options +}); + +/** + * メッセージ引用通知の設定情報を変更 + * + * メッセージ引用通知の設定情報を変更します + */ +export const changeMyNotifyCitation = (options?: Options) => (options?.client ?? client).put({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/users/me/settings/notify-citation', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } +}); + +/** + * 指定したチャンネルパスを取得 + */ +export const getChannelPath = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/channels/{channelId}/path', + ...options +}); + +/** + * LiveKitエンドポイントを取得 + * + * 接続可能なLiveKitエンドポイントを取得します。 + * + */ +export const getQallEndpoints = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/endpoints', + ...options +}); + +/** + * LiveKitトークンを取得 + * + * 指定したルームに参加するためのLiveKitトークンを取得します。 + * + */ +export const getLiveKitToken = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/token', + ...options +}); + +/** + * ルームと参加者の一覧を取得 + * + * 現在存在する(またはアクティブな)ルームと、そのルームに所属している参加者情報を取得します。 + * + */ +export const getRooms = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/rooms', + ...options +}); + +/** + * ルームのメタデータを取得 + * + * ルームのメタデータを取得します。 + * + */ +export const getRoomMetadata = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/rooms/{roomId}/metadata', + ...options +}); + +/** + * ルームのメタデータを更新 + * + * ルームのメタデータを更新します。 + * + */ +export const updateRoomMetadata = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/rooms/{roomId}/metadata', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * ルームでの発言権限を変更 + * + * ルーム内の参加者の発言権限を変更します。 + * + */ +export const changeParticipantRole = (options: Options) => (options.client ?? client).patch({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/rooms/{roomId}/participants', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); + +/** + * LiveKit Webhook受信 + * + * LiveKit側で設定したWebhookから呼び出されるエンドポイントです。 参加者の入室・退出などのイベントを受け取り、サーバ内で処理を行います。 + * + */ +export const liveKitWebhook = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/webhook', + ...options, + headers: { + 'Content-Type': 'application/webhook+json', + ...options.headers + } +}); + +/** + * サウンドボード用の音声一覧を取得 + * + * DBに保存されたサウンドボード情報を取得します。 各アイテムには soundId, soundName, stampId が含まれます。 + * + */ +export const getSoundboardList = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/soundboard', + ...options +}); + +/** + * サウンドボード用の短い音声ファイルをアップロード + * + * 15秒程度の短い音声ファイルを multipart/form-data で送信し、S3(互換ストレージ)にアップロードします。 クライアントは「soundName」というフィールドを送信し、それをDBに保存して関連付けを行います。 また、サーバ側で soundId を自動生成し、S3のファイル名に使用します。 + * + */ +export const postSoundboard = (options: Options) => (options.client ?? client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/soundboard', + ...options, + headers: { + 'Content-Type': null, + ...options.headers + } +}); + +/** + * アップロード済み音声を LiveKit ルームで再生 + * + * S3上にある音声ファイルの署名付きURLを生成し、 Ingressを介して指定ルームに音声を流します。 該当ルームに参加しているユーザであれば再生可能とします。 + * + */ +export const postSoundboardPlay = (options: Options) => (options.client ?? client).post({ + security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/qall/soundboard/play', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } +}); diff --git a/traq/types.gen.ts b/traq/types.gen.ts new file mode 100644 index 0000000..b73577e --- /dev/null +++ b/traq/types.gen.ts @@ -0,0 +1,8258 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ClientOptions = { + baseUrl: 'https://q.trap.jp/api/v3' | 'https://q-dev.trapti.tech/api/v3' | 'http://localhost:3000/api/v3' | (string & {}); +}; + +/** + * Message + * + * メッセージ + */ +export type Message = { + /** + * メッセージUUID + */ + id: string; + /** + * 投稿者UUID + */ + userId: string; + /** + * チャンネルUUID + */ + channelId: string; + /** + * メッセージ本文 + */ + content: string; + /** + * 投稿日時 + */ + createdAt: string; + /** + * 編集日時 + */ + updatedAt: string; + /** + * ピン留めされているかどうか + */ + pinned: boolean; + /** + * 押されているスタンプの配列 + */ + stamps: Array; + /** + * スレッドUUID + */ + threadId: string | null; + /** + * メッセージ送信の確認に使うことができる任意の識別子(投稿でのみ使用可) + */ + nonce?: string; +}; + +/** + * MessageStamp + * + * メッセージに押されたスタンプ + */ +export type MessageStamp = { + /** + * ユーザーUUID + */ + userId: string; + /** + * スタンプUUID + */ + stampId: string; + /** + * スタンプ数 + */ + count: number; + /** + * スタンプが最初に押された日時 + */ + createdAt: string; + /** + * スタンプが最後に押された日時 + */ + updatedAt: string; +}; + +/** + * StampStats + * + * スタンプ統計情報 + */ +export type StampStats = { + /** + * スタンプ使用総数(同じユーザによって同じメッセージに貼られたものは複数カウントしない) + */ + count: number; + /** + * スタンプ使用総数(全てカウント) + */ + totalCount: number; +}; + +/** + * Pin + * + * ピン情報(メッセージ本体付き) + */ +export type Pin = { + /** + * ピン留めしたユーザーUUID + */ + userId: string; + /** + * ピン留めされた日時 + */ + pinnedAt: string; + message: Message; +}; + +/** + * Channel + * + * チャンネル + */ +export type Channel = { + /** + * チャンネルUUID + */ + id: string; + /** + * 親チャンネルUUID + */ + parentId: string | null; + /** + * チャンネルがアーカイブされているかどうか + */ + archived: boolean; + /** + * 強制通知チャンネルかどうか + */ + force: boolean; + /** + * チャンネルトピック + */ + topic: string; + /** + * チャンネル名 + */ + name: string; + /** + * 子チャンネルのUUID配列 + */ + children: Array; +}; + +/** + * PostMessageRequest + * + * メッセージ投稿リクエスト + */ +export type PostMessageRequest = { + /** + * メッセージ本文 + */ + content: string; + /** + * メンション・チャンネルリンクを自動埋め込みするか + */ + embed?: boolean; + /** + * メッセージ送信の確認に使うことができる任意の識別子(投稿でのみ使用可) + */ + nonce?: string; +}; + +/** + * ChannelStats + * + * チャンネル統計情報 + */ +export type ChannelStats = { + /** + * チャンネルの総投稿メッセージ数(削除されたものも含む) + */ + totalMessageCount: number; + /** + * チャンネル上のスタンプ統計情報 + */ + stamps: Array; + /** + * チャンネル上のユーザー統計情報 + */ + users: Array; + /** + * 統計情報日時 + */ + datetime: string; +}; + +/** + * ChannelStatsStamp + * + * チャンネル上の特定スタンプ統計情報 + */ +export type ChannelStatsStamp = { + /** + * スタンプID + */ + id: string; + /** + * スタンプ数(同一メッセージ上のものは複数カウントしない) + */ + count: number; + /** + * スタンプ数(同一メッセージ上のものも複数カウントする) + */ + total: number; +}; + +/** + * ChannelStatsUser + * + * チャンネル上の特定ユーザー統計情報 + */ +export type ChannelStatsUser = { + /** + * ユーザーID + */ + id: string; + /** + * メッセージ数 + */ + messageCount: number; +}; + +/** + * ChannelTopic + * + * チャンネルトピック + */ +export type ChannelTopic = { + /** + * トピック + */ + topic: string; +}; + +/** + * PutChannelTopicRequest + * + * チャンネルトピック編集リクエスト + */ +export type PutChannelTopicRequest = { + /** + * トピック + */ + topic: string; +}; + +/** + * ChannelViewer + * + * チャンネル閲覧者情報 + */ +export type ChannelViewer = { + /** + * ユーザーUUID + */ + userId: string; + state: ChannelViewState; + /** + * 更新日時 + */ + updatedAt: string; +}; + +/** + * MyChannelViewState + * + * 自身のチャンネル閲覧状態 + */ +export type MyChannelViewState = { + /** + * WSセッションの識別子 + */ + key: string; + /** + * チャンネルUUID + */ + channelId: string; + state: ChannelViewState; +}; + +/** + * ChannelViewState + * + * 閲覧状態 + */ +export type ChannelViewState = 'none' | 'stale_viewing' | 'monitoring' | 'editing'; + +/** + * PostFileRequest + * + * ファイルアップロードリクエスト + */ +export type PostFileRequest = { + /** + * ファイル本体 + */ + file: Blob | File; + /** + * アップロード先チャンネルUUID + */ + channelId: string; +}; + +/** + * ThumbnailType + * + * サムネイル画像のタイプ + * + */ +export type ThumbnailType = 'image' | 'waveform'; + +export type ThumbnailInfo = { + type: ThumbnailType; + /** + * MIMEタイプ + */ + mime: string; + /** + * サムネイル幅 + */ + width?: number; + /** + * サムネイル高さ + */ + height?: number; +}; + +/** + * FileInfo + * + * ファイル情報 + */ +export type FileInfo = { + /** + * ファイルUUID + */ + id: string; + /** + * ファイル名 + */ + name: string; + /** + * MIMEタイプ + */ + mime: string; + /** + * ファイルサイズ + */ + size: number; + /** + * MD5ハッシュ + */ + md5: string; + /** + * アニメーション画像かどうか + */ + isAnimatedImage: boolean; + /** + * アップロード日時 + */ + createdAt: string; + thumbnails: Array; + /** + * サムネイル情報 + * サムネイルが存在しない場合はnullになります + * Deprecated: thumbnailsを参照してください + * + * @deprecated + */ + thumbnail: { + /** + * MIMEタイプ + * + * @deprecated + */ + mime: string; + /** + * サムネイル幅 + * + * @deprecated + */ + width?: number; + /** + * サムネイル高さ + * + * @deprecated + */ + height?: number; + } | null; + /** + * 属しているチャンネルUUID + */ + channelId: string | null; + /** + * アップロード者UUID + */ + uploaderId: string | null; +}; + +/** + * PostMessageStampRequest + * + * スタンプを押すリクエスト + */ +export type PostMessageStampRequest = { + /** + * 押す数 + */ + count: number; +}; + +/** + * Stamp + * + * スタンプ情報 + */ +export type Stamp = { + /** + * スタンプUUID + */ + id: string; + /** + * スタンプ名 + */ + name: string; + /** + * 作成者UUID + */ + creatorId: string; + /** + * 作成日時 + */ + createdAt: string; + /** + * 更新日時 + */ + updatedAt: string; + /** + * ファイルUUID + */ + fileId: string; + /** + * Unicode絵文字か + */ + isUnicode: boolean; +}; + +/** + * PostStampRequest + * + * スタンプ作成リクエスト + */ +export type PostStampRequest = { + /** + * スタンプ名 + */ + name: string; + /** + * スタンプ画像(1MBまでのpng, jpeg, gif) + */ + file: Blob | File; +}; + +/** + * StampHistoryEntry + * + * スタンプ履歴の1項目 + */ +export type StampHistoryEntry = { + /** + * スタンプUUID + */ + stampId: string; + /** + * 使用日時 + */ + datetime: string; +}; + +/** + * StampWithThumbnail + * + * スタンプ情報とサムネイルの有無 + */ +export type StampWithThumbnail = { + /** + * スタンプUUID + */ + id: string; + /** + * スタンプ名 + */ + name: string; + /** + * 作成者UUID + */ + creatorId: string; + /** + * 作成日時 + */ + createdAt: string; + /** + * 更新日時 + */ + updatedAt: string; + /** + * ファイルUUID + */ + fileId: string; + /** + * Unicode絵文字か + */ + isUnicode: boolean; + /** + * サムネイルの有無 + */ + hasThumbnail: boolean; +}; + +/** + * User + * + * ユーザー情報 + */ +export type User = { + /** + * ユーザーUUID + */ + id: string; + /** + * ユーザー名 + */ + name: string; + /** + * ユーザー表示名 + */ + displayName: string; + /** + * アイコンファイルUUID + */ + iconFileId: string; + /** + * BOTかどうか + */ + bot: boolean; + state: UserAccountState; + /** + * 更新日時 + */ + updatedAt: string; +}; + +/** + * UserDetail + * + * ユーザー詳細情報 + */ +export type UserDetail = { + /** + * ユーザーUUID + */ + id: string; + state: UserAccountState; + /** + * BOTかどうか + */ + bot: boolean; + /** + * アイコンファイルUUID + */ + iconFileId: string; + /** + * ユーザー表示名 + */ + displayName: string; + /** + * ユーザー名 + */ + name: string; + /** + * Twitter ID + */ + twitterId: string; + /** + * 最終オンライン日時 + */ + lastOnline: string | null; + /** + * 更新日時 + */ + updatedAt: string; + /** + * タグリスト + */ + tags: Array; + /** + * 所属グループのUUIDの配列 + */ + groups: Array; + /** + * 自己紹介(biography) + */ + bio: string; + /** + * ホームチャンネル + */ + homeChannel: string | null; +}; + +/** + * UserTag + * + * ユーザータグ + */ +export type UserTag = { + /** + * タグUUID + */ + tagId: string; + /** + * タグ文字列 + */ + tag: string; + /** + * タグがロックされているか + */ + isLocked: boolean; + /** + * タグ付与日時 + */ + createdAt: string; + /** + * タグ更新日時 + */ + updatedAt: string; +}; + +/** + * UserAccountState + * + * ユーザーアカウント状態 + * 0: 停止 + * 1: 有効 + * 2: 一時停止 + */ +export type UserAccountState = 0 | 1 | 2; + +/** + * UserGroup + * + * ユーザーグループ + */ +export type UserGroup = { + /** + * グループUUID + */ + id: string; + /** + * グループ名 + */ + name: string; + /** + * グループ説明 + */ + description: string; + /** + * グループタイプ + */ + type: string; + /** + * グループアイコンUUID + */ + icon: string; + /** + * グループメンバーの配列 + */ + members: Array; + /** + * 作成日時 + */ + createdAt: string; + /** + * 更新日時 + */ + updatedAt: string; + /** + * グループ管理者のUUIDの配列 + */ + admins: Array; +}; + +/** + * UserGroupMember + * + * ユーザーグループメンバー + */ +export type UserGroupMember = { + /** + * ユーザーUUID + */ + id: string; + /** + * ユーザーの役割 + */ + role: string; +}; + +/** + * UserGroupMembers + * + * ユーザーグループメンバーの配列 + */ +export type UserGroupMembers = Array; + +/** + * UserStats + * + * ユーザー統計情報 + */ +export type UserStats = { + /** + * ユーザーの総投稿メッセージ数(削除されたものも含む) + */ + totalMessageCount: number; + /** + * ユーザーのスタンプ統計情報 + */ + stamps: Array; + /** + * 統計情報日時 + */ + datetime: string; +}; + +/** + * UserStatsStamp + * + * ユーザーの特定スタンプ統計情報 + */ +export type UserStatsStamp = { + /** + * スタンプID + */ + id: string; + /** + * スタンプ数(同一メッセージ上のものは複数カウントしない) + */ + count: number; + /** + * スタンプ数(同一メッセージ上のものも複数カウントする) + */ + total: number; +}; + +/** + * PatchGroupMemberRequest + * + * ユーザーグループメンバー編集リクエスト + */ +export type PatchGroupMemberRequest = { + /** + * ユーザーの役割 + */ + role: string; +}; + +/** + * PatchUserGroupRequest + * + * ユーザーグループ編集リクエスト + */ +export type PatchUserGroupRequest = { + /** + * グループ名 + */ + name?: string; + /** + * グループ説明 + */ + description?: string; + /** + * グループタイプ + */ + type?: string; +}; + +/** + * PostUserGroupRequest + * + * ユーザーグループ作成リクエスト + */ +export type PostUserGroupRequest = { + /** + * グループ名 + */ + name: string; + /** + * 説明 + */ + description: string; + /** + * グループタイプ + */ + type: string; +}; + +/** + * MyUserDetail + * + * 自分のユーザー詳細情報 + */ +export type MyUserDetail = { + /** + * ユーザーUUID + */ + id: string; + /** + * 自己紹介(biography) + */ + bio: string; + /** + * 所属グループのUUIDの配列 + */ + groups: Array; + /** + * タグリスト + */ + tags: Array; + /** + * 更新日時 + */ + updatedAt: string; + /** + * 最終オンライン日時 + */ + lastOnline: string | null; + /** + * Twitter ID + */ + twitterId: string; + /** + * ユーザー名 + */ + name: string; + /** + * ユーザー表示名 + */ + displayName: string; + /** + * アイコンファイルUUID + */ + iconFileId: string; + /** + * BOTかどうか + */ + bot: boolean; + state: UserAccountState; + /** + * 所有している権限の配列 + */ + permissions: Array; + /** + * ホームチャンネル + */ + homeChannel: string | null; +}; + +/** + * OIDCUserInfo + * + * 自分のユーザー詳細情報 + */ +export type OidcUserInfo = { + /** + * ユーザーUUID + */ + sub: string; + /** + * ユーザー名 + */ + name: string; + /** + * ユーザー名 + */ + preferred_username: string; + /** + * アイコン画像URL + */ + picture: string; + /** + * 更新日時 + */ + updated_at?: number; + traq?: OidcTraqUserInfo; +}; + +/** + * OIDCTraqUserInfo + * + * traQ特有のユーザー詳細情報 + */ +export type OidcTraqUserInfo = { + /** + * 自己紹介(biography) + */ + bio: string; + /** + * 所属グループのUUIDの配列 + */ + groups: Array; + /** + * タグリスト + */ + tags: Array; + /** + * 最終オンライン日時 + */ + last_online: string | null; + /** + * Twitter ID + */ + twitter_id: string; + /** + * ユーザー表示名 + */ + display_name: string; + /** + * アイコンファイルUUID + */ + icon_file_id: string; + /** + * BOTかどうか + */ + bot: boolean; + state: UserAccountState; + /** + * 所有している権限の配列 + */ + permissions: Array; + /** + * ホームチャンネル + */ + home_channel: string | null; +}; + +/** + * PatchChannelSubscribersRequest + * + * チャンネル購読者編集リクエスト + */ +export type PatchChannelSubscribersRequest = { + /** + * 通知をオンにするユーザーのUUID配列 + */ + on?: Array; + /** + * 通知をオフにするユーザーのUUID配列 + */ + off?: Array; +}; + +/** + * PutChannelSubscribersRequest + * + * 通知をオンにするユーザーのUUID配列 + */ +export type PutChannelSubscribersRequest = { + /** + * 通知をオンにするユーザーのUUID配列 + */ + on: Array; +}; + +/** + * UserSubscribeState + * + * ユーザーのチャンネル購読状態 + */ +export type UserSubscribeState = { + /** + * チャンネルUUID + */ + channelId: string; + level: ChannelSubscribeLevel; +}; + +/** + * ChannelSubscribeLevel + * + * チャンネル購読レベル + * 0:無し + * 1:未読管理 + * 2:未読管理+通知 + */ +export type ChannelSubscribeLevel = 0 | 1 | 2; + +/** + * PutChannelSubscribeLevelRequest + * + * チャンネル購読レベル変更リクエスト + */ +export type PutChannelSubscribeLevelRequest = { + level: ChannelSubscribeLevel; +}; + +/** + * Webhook + * + * Webhook情報 + */ +export type Webhook = { + /** + * WebhookUUID + */ + id: string; + /** + * WebhookユーザーUUID + */ + botUserId: string; + /** + * Webhookユーザー表示名 + */ + displayName: string; + /** + * 説明 + */ + description: string; + /** + * セキュアWebhookかどうか + */ + secure: boolean; + /** + * デフォルトの投稿先チャンネルUUID + */ + channelId: string; + /** + * オーナーUUID + */ + ownerId: string; + /** + * 作成日時 + */ + createdAt: string; + /** + * 更新日時 + */ + updatedAt: string; +}; + +/** + * PatchWebhookRequest + * + * Webhook情報変更リクエスト + */ +export type PatchWebhookRequest = { + /** + * Webhookユーザー表示名 + */ + name?: string; + /** + * 説明 + */ + description?: string; + /** + * デフォルトの投稿先チャンネルUUID + */ + channelId?: string; + /** + * Webhookシークレット + */ + secret?: string; + /** + * 移譲先のユーザーUUID + */ + ownerId?: string; +}; + +/** + * PostWebhookRequest + * + * Webhook作成リクエスト + */ +export type PostWebhookRequest = { + /** + * Webhookユーザーの表示名 + */ + name: string; + /** + * 説明 + */ + description: string; + /** + * デフォルトの投稿先チャンネルUUID + */ + channelId: string; + /** + * Webhookシークレット + */ + secret: string; +}; + +/** + * PutUserIconRequest + * + * アイコン画像変更リクエスト + */ +export type PutUserIconRequest = { + /** + * アイコン画像(2MB,`Config.Imaging.MaxPixels`(default: 2560*1600)までのpng, jpeg, gif) + */ + file: Blob | File; +}; + +/** + * PutMyPasswordRequest + * + * パスワード変更リクエスト + */ +export type PutMyPasswordRequest = { + /** + * 現在のパスワード + */ + password: string; + /** + * 新しいパスワード + */ + newPassword: string; +}; + +/** + * PatchMeRequest + * + * 自分のユーザー情報変更リクエスト + */ +export type PatchMeRequest = { + /** + * 新しい表示名 + */ + displayName?: string; + /** + * TwitterID + */ + twitterId?: string; + /** + * 自己紹介(biography) + */ + bio?: string; + /** + * ホームチャンネルのUUID + * `00000000-0000-0000-0000-000000000000`を指定すると、ホームチャンネルが`null`に設定されます + */ + homeChannel?: string; +}; + +/** + * PutUserPasswordRequest + * + * ユーザーパスワード変更リクエスト + */ +export type PutUserPasswordRequest = { + /** + * 新しいパスワード + */ + newPassword: string; +}; + +/** + * PatchUserRequest + * + * ユーザー情報編集リクエスト + */ +export type PatchUserRequest = { + /** + * 新しい表示名 + */ + displayName?: string; + /** + * TwitterID + */ + twitterId?: string; + state?: UserAccountState; + /** + * ユーザーロール + */ + role?: string; +}; + +/** + * PostMyFCMDeviceRequest + * + * FCMデバイス登録リクエスト + */ +export type PostMyFcmDeviceRequest = { + /** + * FCMのデバイストークン + */ + token: string; +}; + +/** + * PostUserRequest + * + * ユーザー登録リクエスト + */ +export type PostUserRequest = { + /** + * ユーザー名 + */ + name: string; + /** + * パスワード + */ + password?: string; +}; + +/** + * PostChannelRequest + * + * チャンネル作成リクエスト + */ +export type PostChannelRequest = { + /** + * チャンネル名 + */ + name: string; + /** + * 親チャンネルのUUID + * ルートに作成する場合はnullを指定 + */ + parent: string | null; +}; + +/** + * PostUserTagRequest + * + * ユーザータグ追加リクエスト + */ +export type PostUserTagRequest = { + /** + * タグ文字列 + */ + tag: string; +}; + +/** + * PatchUserTagRequest + * + * ユーザーのタグの編集リクエスト + */ +export type PatchUserTagRequest = { + /** + * タグのロック状態 + */ + isLocked: boolean; +}; + +/** + * Tag + * + * タグ情報 + */ +export type Tag = { + /** + * タグUUID + */ + id: string; + /** + * タグ文字列 + */ + tag: string; + /** + * タグがつけられているユーザーのUUID配列 + */ + users: Array; +}; + +/** + * PostStarRequest + * + * スター追加リクエスト + */ +export type PostStarRequest = { + /** + * チャンネルUUID + */ + channelId: string; +}; + +/** + * UnreadChannel + * + * 未読チャンネル情報 + */ +export type UnreadChannel = { + /** + * チャンネルUUID + */ + channelId: string; + /** + * 未読メッセージ数 + */ + count: number; + /** + * 自分宛てメッセージが含まれているかどうか + */ + noticeable: boolean; + /** + * チャンネルの最古の未読メッセージの日時 + */ + since: string; + /** + * チャンネルの最新の未読メッセージの日時 + */ + updatedAt: string; + /** + * そのチャンネルの未読の中で最も古いメッセージのid + */ + oldestMessageId: string; +}; + +/** + * PostLoginRequest + * + * ログインリクエスト + */ +export type PostLoginRequest = { + /** + * ユーザー名 + */ + name: string; + /** + * パスワード + */ + password: string; +}; + +/** + * LoginSession + * + * ログインセッション情報 + */ +export type LoginSession = { + /** + * セッションUUID + */ + id: string; + /** + * 発行日時 + */ + issuedAt: string; +}; + +/** + * ActiveOAuth2Token + * + * 有効なOAuth2トークン情報 + */ +export type ActiveOAuth2Token = { + /** + * トークンUUID + */ + id: string; + /** + * OAuth2クライアントUUID + */ + clientId: string; + /** + * スコープ + */ + scopes: Array; + /** + * 発行日時 + */ + issuedAt: string; +}; + +/** + * OAuth2Scope + * + * OAuth2スコープ + */ +export type OAuth2Scope = 'openid' | 'profile' | 'read' | 'write' | 'manage_bot'; + +/** + * OAuth2Client + * + * OAuth2クライアント情報 + */ +export type OAuth2Client = { + /** + * クライアントUUID + */ + id: string; + /** + * クライアント名 + */ + name: string; + /** + * 説明 + */ + description: string; + /** + * クライアント開発者UUID + */ + developerId: string; + /** + * 要求スコープの配列 + */ + scopes: Array; + /** + * confidential client なら true, public client なら false + */ + confidential: boolean; +}; + +/** + * PatchClientRequest + * + * OAuth2クライアント情報変更リクエスト + */ +export type PatchClientRequest = { + /** + * クライアント名 + */ + name?: string; + /** + * 説明 + */ + description?: string; + /** + * コールバックURL + */ + callbackUrl?: string; + /** + * クライアント開発者UUID + */ + developerId?: string; + /** + * confidential client なら true, public client なら false + */ + confidential?: boolean; +}; + +/** + * OAuth2ClientDetail + * + * OAuth2クライアント詳細情報 + */ +export type OAuth2ClientDetail = { + /** + * クライアントUUID + */ + id: string; + /** + * クライアント開発者UUID + */ + developerId: string; + /** + * 説明 + */ + description: string; + /** + * クライアント名 + */ + name: string; + /** + * 要求スコープの配列 + */ + scopes: Array; + /** + * コールバックURL + */ + callbackUrl: string; + /** + * クライアントシークレット + */ + secret: string; + /** + * confidential client なら true, public client なら false + */ + confidential: boolean; +}; + +/** + * PostClientRequest + * + * OAuth2クライアント作成リクエスト + */ +export type PostClientRequest = { + /** + * クライアント名 + */ + name: string; + /** + * コールバックURL + */ + callbackUrl: string; + /** + * 要求スコープの配列 + */ + scopes: Array; + /** + * 説明 + */ + description: string; + /** + * confidential client なら true, public cleint なら false + */ + confidential?: boolean; +}; + +/** + * BotMode + * + * BOT動作モード + * + * HTTP: HTTP Mode + * WebSocket: WebSocket Mode + */ +export type BotMode = 'HTTP' | 'WebSocket'; + +/** + * BotState + * + * BOT状態 + * 0: 停止 + * 1: 有効 + * 2: 一時停止 + */ +export type BotState = 0 | 1 | 2; + +/** + * Bot + * + * BOT情報 + */ +export type Bot = { + /** + * BOT UUID + */ + id: string; + /** + * BOTユーザーUUID + */ + botUserId: string; + /** + * 説明 + */ + description: string; + /** + * BOT開発者UUID + */ + developerId: string; + /** + * BOTが購読しているイベントの配列 + */ + subscribeEvents: Array; + mode: BotMode; + state: BotState; + /** + * 作成日時 + */ + createdAt: string; + /** + * 更新日時 + */ + updatedAt: string; +}; + +/** + * PatchBotRequest + * + * BOT情報変更リクエスト + */ +export type PatchBotRequest = { + /** + * BOTユーザー表示名 + */ + displayName?: string; + /** + * BOTの説明 + */ + description?: string; + /** + * 特権 + */ + privileged?: boolean; + mode?: BotMode; + /** + * BOTサーバーエンドポイント + */ + endpoint?: string; + /** + * 移譲先の開発者UUID + */ + developerId?: string; + /** + * 購読するイベント + */ + subscribeEvents?: Array; + /** + * 自己紹介(biography) + */ + bio?: string; +}; + +/** + * BotTokens + * + * BOTのトークン情報 + */ +export type BotTokens = { + /** + * Verification Token + */ + verificationToken: string; + /** + * BOTアクセストークン + */ + accessToken: string; +}; + +/** + * BotDetail + * + * BOT詳細情報 + */ +export type BotDetail = { + /** + * BOT UUID + */ + id: string; + /** + * 更新日時 + */ + updatedAt: string; + /** + * 作成日時 + */ + createdAt: string; + mode: BotMode; + state: BotState; + /** + * BOTが購読しているイベントの配列 + */ + subscribeEvents: Array; + /** + * BOT開発者UUID + */ + developerId: string; + /** + * 説明 + */ + description: string; + /** + * BOTユーザーUUID + */ + botUserId: string; + tokens: BotTokens; + /** + * BOTサーバーエンドポイント + */ + endpoint: string; + /** + * 特権BOTかどうか + */ + privileged: boolean; + /** + * BOTが参加しているチャンネルのUUID配列 + */ + channels: Array; +}; + +/** + * BotEventLog + * + * BOTイベントログ + */ +export type BotEventLog = { + /** + * BOT UUID + */ + botId: string; + /** + * リクエストUUID + */ + requestId: string; + /** + * イベントタイプ + */ + event: string; + result?: BotEventResult; + /** + * ステータスコード + */ + code: number; + /** + * イベント日時 + */ + datetime: string; +}; + +/** + * BotEventResult + * + * イベント配送結果 + */ +export type BotEventResult = 'ok' | 'ng' | 'ne' | 'dp'; + +/** + * PostBotRequest + * + * BOT作成リクエスト + */ +export type PostBotRequest = { + /** + * BOTユーザーID + * 自動的に接頭辞"BOT_"が付与されます + */ + name: string; + /** + * BOTユーザー表示名 + */ + displayName: string; + /** + * BOTの説明 + */ + description: string; + mode: BotMode; + /** + * BOTサーバーエンドポイント + * BOT動作モードがHTTPの場合必須です + */ + endpoint?: string; +}; + +/** + * PostBotActionJoinRequest + * + * BOTチャンネル参加リクエスト + */ +export type PostBotActionJoinRequest = { + /** + * チャンネルUUID + */ + channelId: string; +}; + +/** + * PostBotActionLeaveRequest + * + * BOTチャンネル退出リクエスト + */ +export type PostBotActionLeaveRequest = { + /** + * チャンネルUUID + */ + channelId: string; +}; + +/** + * BotUser + * + * BOTユーザー対 + */ +export type BotUser = { + /** + * BOT UUID + */ + id: string; + /** + * BOTユーザーUUID + */ + botUserId: string; +}; + +/** + * PostWebRTCAuthenticateRequest + * + * skyway用認証リクエスト + */ +export type PostWebRtcAuthenticateRequest = { + /** + * ピアID + */ + peerId: string; +}; + +/** + * WebRTCAuthenticateResult + * + * skyway用認証リクエストリザルト + */ +export type WebRtcAuthenticateResult = { + /** + * ピアID + */ + peerId: string; + /** + * TTL + */ + ttl: number; + /** + * タイムスタンプ + */ + timestamp: number; + /** + * 認証トークン + */ + authToken: string; +}; + +/** + * PatchChannelRequest + * + * チャンネル情報変更リクエスト + */ +export type PatchChannelRequest = { + /** + * チャンネル名 + */ + name?: string; + /** + * アーカイブされているかどうか + */ + archived?: boolean; + /** + * 強制通知チャンネルかどうか + */ + force?: boolean; + /** + * 親チャンネルUUID + */ + parent?: string; +}; + +/** + * WebRTCUserStates + * + * WebRTC状態の配列 + */ +export type WebRtcUserStates = Array; + +/** + * ClipFolder + * + * クリップフォルダ情報 + */ +export type ClipFolder = { + /** + * フォルダUUID + */ + id: string; + /** + * フォルダ名 + */ + name: string; + /** + * 作成日時 + */ + createdAt: string; + /** + * フォルダ所有者UUID + */ + ownerId: string; + /** + * 説明 + */ + description: string; +}; + +/** + * PatchClipFolderRequest + * + * クリップフォルダ情報編集リクエスト + */ +export type PatchClipFolderRequest = { + /** + * フォルダ名 + */ + name?: string; + /** + * 説明 + */ + description?: string; +}; + +/** + * PostClipFolderRequest + * + * クリップフォルダ作成リクエスト + */ +export type PostClipFolderRequest = { + /** + * フォルダ名 + */ + name: string; + /** + * 説明 + */ + description: string; +}; + +/** + * PostClipFolderMessageRequest + * + * クリップ追加リクエスト + */ +export type PostClipFolderMessageRequest = { + /** + * メッセージUUID + */ + messageId: string; +}; + +/** + * ClippedMessage + * + * クリップされたメッセージ + */ +export type ClippedMessage = { + message: Message; + /** + * クリップした日時 + */ + clippedAt: string; +}; + +/** + * ChannelEvent + * + * チャンネルイベント + */ +export type ChannelEvent = { + /** + * イベントタイプ + */ + type: 'TopicChanged' | 'SubscribersChanged' | 'PinAdded' | 'PinRemoved' | 'NameChanged' | 'ParentChanged' | 'VisibilityChanged' | 'ForcedNotificationChanged' | 'ChildCreated'; + /** + * イベント日時 + */ + datetime: string; + /** + * イベント内容 + */ + detail: TopicChangedEvent | SubscribersChangedEvent | PinAddedEvent | PinRemovedEvent | NameChangedEvent | ParentChangedEvent | VisibilityChangedEvent | ForcedNotificationChangedEvent | ChildCreatedEvent; +}; + +/** + * TopicChangedEvent + * + * トピック変更イベント + */ +export type TopicChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * 変更前トピック + */ + before: string; + /** + * 変更後トピック + */ + after: string; +}; + +/** + * SubscribersChangedEvent + * + * 購読者変更イベント + */ +export type SubscribersChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * オンにされたユーザーのUUID配列 + */ + on: Array; + /** + * オフにされたユーザーのUUID配列 + */ + off: Array; +}; + +/** + * PinAddedEvent + * + * ピン追加イベント + */ +export type PinAddedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * メッセージUUID + */ + messageId: string; +}; + +/** + * PinRemovedEvent + * + * ピン削除イベント + */ +export type PinRemovedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * メッセージUUID + */ + messageId: string; +}; + +/** + * NameChangedEvent + * + * チャンネル名変更イベント + */ +export type NameChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * 変更前チャンネル名 + */ + before: string; + /** + * 変更後チャンネル名 + */ + after: string; +}; + +/** + * ParentChangedEvent + * + * 親チャンネル変更イベント + */ +export type ParentChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * 変更前親チャンネルUUID + */ + before: string; + /** + * 変更後親チャンネルUUID + */ + after: string; +}; + +/** + * VisibilityChangedEvent + * + * チャンネル可視状態変更イベント + */ +export type VisibilityChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * 変更後可視状態 + */ + visibility: boolean; +}; + +/** + * ForcedNotificationChangedEvent + * + * チャンネル強制通知状態変更イベント + */ +export type ForcedNotificationChangedEvent = { + /** + * 変更者UUID + */ + userId: string; + /** + * 変更後強制通知状態 + */ + force: boolean; +}; + +/** + * ChildCreatedEvent + * + * 子チャンネル作成イベント + */ +export type ChildCreatedEvent = { + /** + * 作成者UUID + */ + userId: string; + /** + * チャンネルUUID + */ + channelId: string; +}; + +/** + * QallRoomStateChangedEvent + * + * Qallのルーム状態が変更された + */ +export type QallRoomStateChangedEvent = { + roomStates: Array<{ + /** + * ルームのID + */ + roomId: string; + participants: Array<{ + /** + * ユーザーID_RandomUUID + */ + identity: string; + /** + * 表示名 + */ + name: string; + /** + * 参加した時刻 + */ + joinedAt: string; + attributes?: { + [key: string]: string; + }; + /** + * 発言権限 + */ + canPublish: boolean; + }>; + /** + * ウェビナールームかどうか + */ + isWebinar: boolean; + /** + * ルームに関連付けられたカスタム属性 + */ + metadata?: string; + }>; +}; + +/** + * QallSoundboardItemCreatedEvent + * + * Qallのサウンドボードアイテムが作成された + */ +export type QallSoundboardItemCreatedEvent = { + /** + * 作成されたサウンドボードアイテムのId + */ + soundId: string; + /** + * 作成されたサウンドボードアイテムの名前 + */ + name: string; + /** + * 作成者のId + */ + creatorId: string; +}; + +/** + * QallSoundboardItemDeletedEvent + * + * Qallのサウンドボードアイテムが削除された + */ +export type QallSoundboardItemDeletedEvent = { + /** + * 削除されたサウンドボードアイテムのId + */ + soundId: string; +}; + +/** + * StampPalette + * + * スタンプパレット情報 + */ +export type StampPalette = { + /** + * スタンプパレットUUID + */ + id: string; + /** + * パレット名 + */ + name: string; + /** + * パレット内のスタンプのUUID配列 + */ + stamps: Array; + /** + * 作成者UUID + */ + creatorId: string; + /** + * パレット作成日時 + */ + createdAt: string; + /** + * パレット更新日時 + */ + updatedAt: string; + /** + * パレット説明 + */ + description: string; +}; + +/** + * PostStampPaletteRequest + * + * スタンプパレット作成リクエスト + */ +export type PostStampPaletteRequest = { + /** + * パレット内のスタンプのUUID配列 + */ + stamps: Array; + /** + * パレット名 + */ + name: string; + /** + * 説明 + */ + description: string; +}; + +/** + * PatchStampPaletteRequest + * + * スタンプパレット情報変更リクエスト + */ +export type PatchStampPaletteRequest = { + /** + * パレット名 + */ + name?: string; + /** + * 説明 + */ + description?: string; + /** + * パレット内のスタンプUUIDの配列 + */ + stamps?: Array; +}; + +/** + * PatchStampRequest + * + * スタンプ情報変更リクエスト + */ +export type PatchStampRequest = { + /** + * スタンプ名 + */ + name?: string; + /** + * 作成者UUID + */ + creatorId?: string; +}; + +/** + * MessagePin + * + * ピン情報 + */ +export type MessagePin = { + /** + * ピン留めしたユーザーUUID + */ + userId: string; + /** + * ピン留めされた日時 + */ + pinnedAt: string; +}; + +/** + * PostUserGroupAdmin + * + * グループ管理者追加リクエスト + */ +export type PostUserGroupAdminRequest = { + /** + * 追加するユーザーのUUID + */ + id: string; +}; + +/** + * ChannelList + * + * GET /channelsレスポンス + */ +export type ChannelList = { + /** + * パブリックチャンネルの配列 + */ + public: Array; + /** + * ダイレクトメッセージチャンネルの配列 + */ + dm?: Array; +}; + +/** + * DMChannel + * + * ダイレクトメッセージチャンネル + */ +export type DmChannel = { + /** + * チャンネルUUID + */ + id: string; + /** + * 送信先相手のUUID + */ + userId: string; +}; + +/** + * ActivityTimelineMessage + * + * Timelineアクテビティ用メッセージ + */ +export type ActivityTimelineMessage = { + /** + * メッセージUUID + */ + id: string; + /** + * 投稿者UUID + */ + userId: string; + /** + * チャンネルUUID + */ + channelId: string; + /** + * メッセージ本文 + */ + content: string; + /** + * 投稿日時 + */ + createdAt: string; + /** + * 編集日時 + */ + updatedAt: string; +}; + +export type OAuth2Decide = { + /** + * 承諾する場合は"approve" + */ + submit: string; +}; + +export type PostOAuth2Token = { + grant_type: string; + code?: string; + redirect_uri?: string; + client_id?: string; + code_verifier?: string; + username?: string; + password?: string; + scope?: string; + refresh_token?: string; + client_secret?: string; +}; + +export type OAuth2Token = { + access_token: string; + token_type: string; + expires_in?: number; + refresh_token?: string; + scope?: string; + id_token?: string; +}; + +export type OAuth2Authorization = { + response_type?: OAuth2ResponseType; + client_id: string; + redirect_uri?: string; + scope?: string; + state?: string; + code_challenge?: string; + code_challenge_method?: string; + nonce?: string; + prompt?: OAuth2Prompt; +}; + +export type OAuth2Prompt = 'none'; + +export type OAuth2ResponseType = 'code' | 'token' | 'none'; + +/** + * OAuth2Revoke + * + * POST /oauth2/revoke 用リクエストボディ + */ +export type OAuth2Revoke = { + /** + * 無効化するOAuth2トークンまたはOAuth2リフレッシュトークン + */ + token: string; +}; + +/** + * ExternalProviderUser + * + * 外部認証アカウントユーザー + */ +export type ExternalProviderUser = { + /** + * 外部サービス名 + */ + providerName: string; + /** + * 紐付けた日時 + */ + linkedAt: string; + /** + * 外部アカウント名 + */ + externalName: string; +}; + +/** + * PostLinkExternalAccount + * + * POST /users/me/ex-accounts/link 用リクエストボディ + */ +export type PostLinkExternalAccount = { + /** + * 外部サービス名 + */ + providerName: string; +}; + +/** + * PostUnlinkExternalAccount + * + * POST /users/me/ex-accounts/unlink 用リクエストボディ + */ +export type PostUnlinkExternalAccount = { + /** + * 外部サービス名 + */ + providerName: string; +}; + +/** + * UserPermission + * + * ユーザー権限 + */ +export type UserPermission = 'get_webhook' | 'create_webhook' | 'edit_webhook' | 'delete_webhook' | 'access_others_webhook' | 'get_bot' | 'create_bot' | 'edit_bot' | 'delete_bot' | 'access_others_bot' | 'bot_action_join_channel' | 'bot_action_leave_channel' | 'create_channel' | 'get_channel' | 'edit_channel' | 'delete_channel' | 'change_parent_channel' | 'edit_channel_topic' | 'get_channel_star' | 'edit_channel_star' | 'get_my_tokens' | 'revoke_my_token' | 'get_clients' | 'create_client' | 'edit_my_client' | 'delete_my_client' | 'manage_others_client' | 'upload_file' | 'download_file' | 'delete_file' | 'get_message' | 'post_message' | 'edit_message' | 'delete_message' | 'report_message' | 'get_message_reports' | 'create_message_pin' | 'delete_message_pin' | 'get_channel_subscription' | 'edit_channel_subscription' | 'connect_notification_stream' | 'register_fcm_device' | 'get_stamp' | 'create_stamp' | 'edit_stamp' | 'edit_stamp_created_by_others' | 'delete_stamp' | 'delete_my_stamp' | 'add_message_stamp' | 'remove_message_stamp' | 'get_my_stamp_history' | 'get_my_stamp_recommendations' | 'get_stamp_palette' | 'create_stamp_palette' | 'edit_stamp_palette' | 'delete_stamp_palette' | 'get_user' | 'register_user' | 'get_me' | 'get_oidc_userinfo' | 'edit_me' | 'change_my_icon' | 'change_my_password' | 'edit_other_users' | 'get_user_qr_code' | 'get_user_tag' | 'edit_user_tag' | 'get_user_group' | 'create_user_group' | 'create_special_user_group' | 'edit_user_group' | 'delete_user_group' | 'edit_others_user_group' | 'web_rtc' | 'get_my_sessions' | 'delete_my_sessions' | 'get_my_external_account' | 'edit_my_external_account' | 'get_unread' | 'delete_unread' | 'get_clip_folder' | 'create_clip_folder' | 'edit_clip_folder' | 'delete_clip_folder'; + +/** + * Version + * + * バージョン・サーバーフラグ情報 + */ +export type Version = { + /** + * traQ(サーバー)リビジョン + */ + revision: string; + /** + * traQ(サーバー)バージョン + */ + version: string; + flags: { + /** + * 有効な外部ログインプロバイダ + */ + externalLogin: Array; + /** + * ユーザーが自身で新規登録(POST /api/v3/users)可能か + */ + signUpAllowed: boolean; + }; +}; + +/** + * WebRTCUserState + * + * WebRTC状態 + */ +export type WebRtcUserState = { + /** + * ユーザーUUID + */ + userId: string; + /** + * チャンネルUUID + */ + channelId: string; + /** + * セッションの配列 + */ + sessions: Array; +}; + +/** + * MessageClip + * + * メッセージクリップ + */ +export type MessageClip = { + /** + * クリップされているフォルダのID + */ + folderId: string; + /** + * クリップされた日時 + */ + clippedAt: string; +}; + +/** + * Ogp + * + * OGPの情報 + */ +export type Ogp = { + type: string; + title: string; + url: string; + images: Array; + description: string; + videos: Array; +}; + +/** + * OgpMedia + * + * OGPに含まれる画像の情報 + */ +export type OgpMedia = { + url: string; + secureUrl: string | null; + type: string | null; + width: number | null; + height: number | null; +}; + +/** + * GetNotifyCitation + * + * メッセージ引用通知の設定情報 + */ +export type GetNotifyCitation = { + notifyCitation: boolean; +}; + +/** + * UserSettings + * + * ユーザー設定の情報 + */ +export type UserSettings = { + /** + * ユーザーUUID + */ + id: string; + /** + * メッセージ引用通知の設定情報 + */ + notifyCitation: boolean; +}; + +/** + * PutNotifyCitationRequest + * + * メッセージ引用通知設定リクエスト + */ +export type PutNotifyCitationRequest = { + /** + * メッセージ引用通知の設定情報 + */ + notifyCitation: boolean; +}; + +/** + * ChannelPath + * + * チャンネルパス + */ +export type ChannelPath = { + /** + * チャンネルパス + */ + path: string; +}; + +export type Session = { + /** + * 状態 + */ + state: string; + /** + * セッションID + */ + sessionId: string; +}; + +export type SoundboardPlayResponse = { + /** + * 作成された Ingress のID + */ + ingressId: string; + /** + * 作成された Ingress のストリームURL等 + */ + url?: string; + /** + * RTMP配信の場合のstream key + */ + streamKey?: string; +}; + +export type QallEndpointResponse = { + /** + * LiveKitのエンドポイント + */ + endpoint: string; +}; + +export type SoundboardListResponse = Array; + +export type SoundboardItem = { + /** + * サーバが発行したサウンドID + */ + soundId: string; + /** + * ユーザが指定した表示用のサウンド名 + */ + soundName: string; + /** + * 任意のスタンプID等、サウンドに紐づく拡張情報 + */ + stampId: string; + /** + * 作成者のユーザID + */ + creatorId: string; +}; + +export type SoundboardUploadResponse = { + /** + * 登録されたサウンドID (ファイル名) + */ + soundId: string; +}; + +export type QallRoomsListResponse = Array; + +export type QallTokenResponse = { + /** + * LiveKit用のJWTトークン + */ + token: string; +}; + +export type QallRoomWithParticipants = { + /** + * ルームのID + */ + roomId: string; + participants: Array; + /** + * ウェビナールームかどうか + */ + isWebinar?: boolean; + /** + * ルームに関連付けられたカスタム属性 + */ + metadata?: string; +}; + +/** + * ルーム内の参加者一覧 + */ +export type QallParticipant = { + /** + * ユーザーID_RandomUUID + */ + identity?: string; + /** + * 表示名 + */ + name?: string; + /** + * 参加した時刻 + */ + joinedAt?: string; + /** + * ユーザーに関連付けられたカスタム属性 + */ + attributes?: { + [key: string]: string; + }; + /** + * 発言権限 + */ + canPublish?: boolean; +}; + +export type QallParticipantRequest = { + users: Array<{ + /** + * ユーザーID + */ + userId?: string; + /** + * 発言権限 + */ + canPublish?: boolean; + }>; +}; + +export type QallMetadataRequest = { + /** + * ルームに関連付けられたカスタム属性 + */ + metadata?: string; +}; + +export type QallMetadataResponse = { + /** + * ルームに関連付けられたカスタム属性 + */ + metadata?: string; +}; + +export type QallParticipantResponse = { + results?: Array<{ + /** + * 対象参加者ID + */ + participantId?: string; + /** + * success もしくは error + */ + status?: string; + /** + * エラーがある場合の詳細 + */ + errorMessage?: string; + }>; +}; + +export type SoundboardUploadRequest = { + /** + * アップロードする音声ファイル(20秒以内) + */ + audio: Blob | File; + /** + * ユーザが自由につけるサウンド名 + */ + soundName: string; + /** + * アイコンスタンプID + */ + stampId?: string; +}; + +export type SoundboardPlayRequest = { + /** + * サウンドID (DB登録済み) + */ + soundId: string; + /** + * 再生させたいルームのUUID + */ + roomName: string; +}; + +/** + * スタンプパレットUUID + */ +export type PaletteIdInPath = string; + +/** + * クリップフォルダUUID + */ +export type FolderIdInPath = string; + +/** + * BOTUUID + */ +export type BotIdInPath = string; + +/** + * OAuth2クライアントUUID + */ +export type ClientIdInPath = string; + +/** + * OAuth2トークンUUID + */ +export type TokenIdInPath = string; + +/** + * セッションUUID + */ +export type SessionIdInPath = string; + +/** + * リダイレクト先 + */ +export type RedirectInQuery = string; + +/** + * タグUUID + */ +export type TagIdInPath = string; + +/** + * WebhookUUID + */ +export type WebhookIdInPath = string; + +/** + * ユーザーグループUUID + */ +export type GroupIdInPath = string; + +/** + * ユーザーUUID + */ +export type UserIdInPath = string; + +/** + * スタンプUUID + */ +export type StampIdInPath = string; + +/** + * ファイルUUID + */ +export type FileIdInPath = string; + +/** + * メッセージUUID + */ +export type MessageIdInPath = string; + +/** + * 取得する件数 + */ +export type LimitInQuery = number; + +/** + * 取得するオフセット + */ +export type OffsetInQuery = number; + +/** + * 取得する時間範囲の開始日時 + */ +export type SinceInQuery = string; + +/** + * 取得する時間範囲の終了日時 + */ +export type UntilInQuery = string; + +/** + * 範囲の端を含めるかどうか + */ +export type InclusiveInQuery = boolean; + +/** + * 昇順か降順か + */ +export type OrderInQuery = 'asc' | 'desc'; + +/** + * チャンネルUUID + */ +export type ChannelIdInPath = string; + +/** + * ルームUUID + */ +export type RoomIdInPath = string; + +/** + * ルームUUID + */ +export type RoomIdInQuery = string; + +/** + * ウェビナールームかどうか(デフォルト false) + */ +export type IsWebinarInQuery = boolean; + +/** + * 削除されたメッセージを除外するかどうか(デフォルト false) + */ +export type ExcludeDeletedMessagesInQuery = boolean; + +export type GetMessagesData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 取得する時間範囲の開始日時 + */ + since?: string; + /** + * 取得する時間範囲の終了日時 + */ + until?: string; + /** + * 範囲の端を含めるかどうか + */ + inclusive?: boolean; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + }; + url: '/channels/{channelId}/messages'; +}; + +export type GetMessagesErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetMessagesResponses = { + /** + * メッセージの配列 + */ + 200: Array; +}; + +export type GetMessagesResponse = GetMessagesResponses[keyof GetMessagesResponses]; + +export type PostMessageData = { + body?: PostMessageRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/messages'; +}; + +export type PostMessageErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type PostMessageResponses = { + /** + * Created + */ + 201: Message; +}; + +export type PostMessageResponse = PostMessageResponses[keyof PostMessageResponses]; + +export type SearchMessagesData = { + body?: never; + path?: never; + query?: { + /** + * 検索ワード + * Simple-Query-String-Syntaxをパースして検索します + * + */ + word?: string; + /** + * 投稿日時が指定日時より後 + */ + after?: string; + /** + * 投稿日時が指定日時より前 + */ + before?: string; + /** + * メッセージが投稿されたチャンネル + */ + in?: string; + /** + * メンションされたユーザー + */ + to?: Array; + /** + * メッセージを投稿したユーザー + */ + from?: Array; + /** + * 引用しているメッセージ + */ + citation?: string; + /** + * メッセージを投稿したユーザーがBotかどうか + */ + bot?: boolean; + /** + * メッセージがURLを含むか + */ + hasURL?: boolean; + /** + * メッセージが添付ファイルを含むか + */ + hasAttachments?: boolean; + /** + * メッセージが画像を含むか + */ + hasImage?: boolean; + /** + * メッセージが動画を含むか + */ + hasVideo?: boolean; + /** + * メッセージが音声ファイルを含むか + */ + hasAudio?: boolean; + /** + * 検索結果から取得するメッセージの最大件数 + */ + limit?: number; + /** + * 検索結果から取得するメッセージのオフセット + */ + offset?: number; + /** + * ソート順 (作成日時が新しい `createdAt`, 作成日時が古い `-createdAt`, 更新日時が新しい `updatedAt`, 更新日時が古い `-updatedAt`) + */ + sort?: 'createdAt' | '-createdAt' | 'updatedAt' | '-updatedAt'; + }; + url: '/messages'; +}; + +export type SearchMessagesErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * search service is currently unavailable + */ + 503: unknown; +}; + +export type SearchMessagesResponses = { + /** + * MessageSearchResult + * + * メッセージ検索結果 + */ + 200: { + /** + * 検索にヒットしたメッセージ件数 + */ + totalHits: number; + /** + * 検索にヒットしたメッセージの配列 + */ + hits: Array; + }; +}; + +export type SearchMessagesResponse = SearchMessagesResponses[keyof SearchMessagesResponses]; + +export type DeleteMessageData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}'; +}; + +export type DeleteMessageErrors = { + /** + * Forbidden + * 指定されたメッセージを削除する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteMessageResponses = { + /** + * No Content + * 正常に削除できました。 + */ + 204: void; +}; + +export type DeleteMessageResponse = DeleteMessageResponses[keyof DeleteMessageResponses]; + +export type GetMessageData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}'; +}; + +export type GetMessageErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetMessageResponses = { + /** + * OK + */ + 200: Message; +}; + +export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses]; + +export type EditMessageData = { + body?: PostMessageRequest; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}'; +}; + +export type EditMessageErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 指定されたメッセージを編集する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type EditMessageResponses = { + /** + * No Content + * メッセージを編集できました。 + */ + 204: void; +}; + +export type EditMessageResponse = EditMessageResponses[keyof EditMessageResponses]; + +export type RemovePinData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}/pin'; +}; + +export type RemovePinErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * 指定したメッセージ、またはピン留めが見つかりません。 + */ + 404: unknown; +}; + +export type RemovePinResponses = { + /** + * No Content + * 指定したメッセージのピン留めが外されました。 + */ + 204: void; +}; + +export type RemovePinResponse = RemovePinResponses[keyof RemovePinResponses]; + +export type GetPinData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}/pin'; +}; + +export type GetPinErrors = { + /** + * Not Found + * 指定したメッセージ、またはピン留めが見つかりません。 + */ + 404: unknown; +}; + +export type GetPinResponses = { + /** + * OK + */ + 200: MessagePin; +}; + +export type GetPinResponse = GetPinResponses[keyof GetPinResponses]; + +export type CreatePinData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}/pin'; +}; + +export type CreatePinErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * メッセージが見つかりません。 + */ + 404: unknown; +}; + +export type CreatePinResponses = { + /** + * Created + * 指定したメッセージがピン留めされました。 + */ + 201: MessagePin; +}; + +export type CreatePinResponse = CreatePinResponses[keyof CreatePinResponses]; + +export type GetChannelStatsData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: { + /** + * 削除されたメッセージを除外するかどうか(デフォルト false) + */ + 'exclude-deleted-messages'?: boolean; + }; + url: '/channels/{channelId}/stats'; +}; + +export type GetChannelStatsErrors = { + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelStatsResponses = { + /** + * OK + */ + 200: ChannelStats; +}; + +export type GetChannelStatsResponse = GetChannelStatsResponses[keyof GetChannelStatsResponses]; + +export type GetChannelTopicData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/topic'; +}; + +export type GetChannelTopicErrors = { + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelTopicResponses = { + /** + * OK + */ + 200: ChannelTopic; +}; + +export type GetChannelTopicResponse = GetChannelTopicResponses[keyof GetChannelTopicResponses]; + +export type EditChannelTopicData = { + body?: PutChannelTopicRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/topic'; +}; + +export type EditChannelTopicErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type EditChannelTopicResponses = { + /** + * No Content + * チャンネルトピックが編集されました + */ + 204: void; +}; + +export type EditChannelTopicResponse = EditChannelTopicResponses[keyof EditChannelTopicResponses]; + +export type GetChannelViewersData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/viewers'; +}; + +export type GetChannelViewersErrors = { + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelViewersResponses = { + /** + * チャンネル閲覧者の配列 + */ + 200: Array; +}; + +export type GetChannelViewersResponse = GetChannelViewersResponses[keyof GetChannelViewersResponses]; + +export type GetFilesData = { + body?: never; + path?: never; + query?: { + /** + * アップロード先チャンネルUUID + */ + channelId?: string; + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 取得する時間範囲の開始日時 + */ + since?: string; + /** + * 取得する時間範囲の終了日時 + */ + until?: string; + /** + * 範囲の端を含めるかどうか + */ + inclusive?: boolean; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + /** + * アップロード者が自分のファイルのみを取得するか + */ + mine?: boolean; + }; + url: '/files'; +}; + +export type GetFilesErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type GetFilesResponses = { + /** + * ファイルメタの配列 + */ + 200: Array; +}; + +export type GetFilesResponse = GetFilesResponses[keyof GetFilesResponses]; + +export type PostFileData = { + body?: PostFileRequest; + path?: never; + query?: never; + url: '/files'; +}; + +export type PostFileErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Length Required + */ + 411: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type PostFileResponses = { + /** + * Created + */ + 201: FileInfo; +}; + +export type PostFileResponse = PostFileResponses[keyof PostFileResponses]; + +export type GetFileMetaData = { + body?: never; + path: { + /** + * ファイルUUID + */ + fileId: string; + }; + query?: never; + url: '/files/{fileId}/meta'; +}; + +export type GetFileMetaErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * ファイルが見つかりません。 + */ + 404: unknown; +}; + +export type GetFileMetaResponses = { + /** + * OK + */ + 200: FileInfo; +}; + +export type GetFileMetaResponse = GetFileMetaResponses[keyof GetFileMetaResponses]; + +export type GetThumbnailImageData = { + body?: never; + path: { + /** + * ファイルUUID + */ + fileId: string; + }; + query?: { + /** + * 取得するサムネイルのタイプ + */ + type?: ThumbnailType; + }; + url: '/files/{fileId}/thumbnail'; +}; + +export type GetThumbnailImageErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * ファイルが見つからない、またはサムネイル画像が存在しません。 + */ + 404: unknown; +}; + +export type GetThumbnailImageResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetThumbnailImageResponse = GetThumbnailImageResponses[keyof GetThumbnailImageResponses]; + +export type DeleteFileData = { + body?: never; + path: { + /** + * ファイルUUID + */ + fileId: string; + }; + query?: never; + url: '/files/{fileId}'; +}; + +export type DeleteFileErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteFileResponses = { + /** + * No Content + * ファイルが削除できました。 + */ + 204: void; +}; + +export type DeleteFileResponse = DeleteFileResponses[keyof DeleteFileResponses]; + +export type GetFileData = { + body?: never; + path: { + /** + * ファイルUUID + */ + fileId: string; + }; + query?: { + /** + * 1を指定するとレスポンスにContent-Dispositionヘッダーが付与されます + */ + dl?: number; + }; + url: '/files/{fileId}'; +}; + +export type GetFileErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type GetFileResponses = { + /** + * OK + * ファイル本体を返します。 + * application/octet-streamで返すことになっていますが、ファイルの形式によって変わります。 + */ + 200: Blob | File; +}; + +export type GetFileResponse = GetFileResponses[keyof GetFileResponses]; + +export type GetChannelPinsData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/pins'; +}; + +export type GetChannelPinsErrors = { + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelPinsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetChannelPinsResponse = GetChannelPinsResponses[keyof GetChannelPinsResponses]; + +export type GetMessageStampsData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}/stamps'; +}; + +export type GetMessageStampsErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetMessageStampsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetMessageStampsResponse = GetMessageStampsResponses[keyof GetMessageStampsResponses]; + +export type RemoveMessageStampData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/messages/{messageId}/stamps/{stampId}'; +}; + +export type RemoveMessageStampErrors = { + /** + * Not Found + * メッセージ、またはスタンプが見つかりません。 + */ + 404: unknown; +}; + +export type RemoveMessageStampResponses = { + /** + * No Content + * スタンプを消すことができました。 + */ + 204: void; +}; + +export type RemoveMessageStampResponse = RemoveMessageStampResponses[keyof RemoveMessageStampResponses]; + +export type AddMessageStampData = { + body?: PostMessageStampRequest; + path: { + /** + * メッセージUUID + */ + messageId: string; + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/messages/{messageId}/stamps/{stampId}'; +}; + +export type AddMessageStampErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * メッセージ、またはスタンプが見つかりません。 + */ + 404: unknown; +}; + +export type AddMessageStampResponses = { + /** + * No Content + * スタンプを押すことができました。 + */ + 204: void; +}; + +export type AddMessageStampResponse = AddMessageStampResponses[keyof AddMessageStampResponses]; + +export type DeleteStampData = { + body?: never; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}'; +}; + +export type DeleteStampErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteStampResponses = { + /** + * No Content + * スタンプが削除されました。 + */ + 204: void; +}; + +export type DeleteStampResponse = DeleteStampResponses[keyof DeleteStampResponses]; + +export type GetStampData = { + body?: never; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}'; +}; + +export type GetStampErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetStampResponses = { + /** + * OK + */ + 200: Stamp; +}; + +export type GetStampResponse = GetStampResponses[keyof GetStampResponses]; + +export type EditStampData = { + body?: PatchStampRequest; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}'; +}; + +export type EditStampErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Conflict + */ + 409: unknown; +}; + +export type EditStampResponses = { + /** + * No Content + * スタンプ情報が変更されました。 + */ + 204: void; +}; + +export type EditStampResponse = EditStampResponses[keyof EditStampResponses]; + +export type GetStampsData = { + body?: never; + path?: never; + query?: { + /** + * Unicode絵文字を含ませるかどうか + * Deprecated: typeクエリを指定しなければ全てのスタンプを取得できるため、そちらを利用してください + * + * + * @deprecated + */ + 'include-unicode'?: boolean; + /** + * 取得するスタンプの種類 + */ + type?: 'unicode' | 'original'; + }; + url: '/stamps'; +}; + +export type GetStampsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetStampsResponse = GetStampsResponses[keyof GetStampsResponses]; + +export type CreateStampData = { + body?: PostStampRequest; + path?: never; + query?: never; + url: '/stamps'; +}; + +export type CreateStampErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type CreateStampResponses = { + /** + * Created + */ + 201: Stamp; +}; + +export type CreateStampResponse = CreateStampResponses[keyof CreateStampResponses]; + +export type GetMyStampHistoryData = { + body?: never; + path?: never; + query?: { + /** + * 件数 + */ + limit?: number; + }; + url: '/users/me/stamp-history'; +}; + +export type GetMyStampHistoryResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetMyStampHistoryResponse = GetMyStampHistoryResponses[keyof GetMyStampHistoryResponses]; + +export type GetMyStampRecommendationsData = { + body?: never; + path?: never; + query?: { + /** + * 件数 + */ + limit?: number; + }; + url: '/users/me/stamp-recommendations'; +}; + +export type GetMyStampRecommendationsResponses = { + /** + * OK + */ + 200: Array<{ + /** + * スタンプUUID + */ + stampId: string; + /** + * レコメンドスコア + */ + score: number; + }>; +}; + +export type GetMyStampRecommendationsResponse = GetMyStampRecommendationsResponses[keyof GetMyStampRecommendationsResponses]; + +export type GetMyQrCodeData = { + body?: never; + path?: never; + query?: { + /** + * 画像でなくトークン文字列で返すかどうか + */ + token?: boolean; + }; + url: '/users/me/qr-code'; +}; + +export type GetMyQrCodeResponses = { + /** + * QRコード画像 + */ + 200: Blob | File; +}; + +export type GetMyQrCodeResponse = GetMyQrCodeResponses[keyof GetMyQrCodeResponses]; + +export type GetStampStatsData = { + body?: never; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}/stats'; +}; + +export type GetStampStatsErrors = { + /** + * Not Found + * スタンプが見つかりません。 + */ + 404: unknown; +}; + +export type GetStampStatsResponses = { + /** + * OK + */ + 200: StampStats; +}; + +export type GetStampStatsResponse = GetStampStatsResponses[keyof GetStampStatsResponses]; + +export type GetUserData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}'; +}; + +export type GetUserErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetUserResponses = { + /** + * OK + */ + 200: UserDetail; +}; + +export type GetUserResponse = GetUserResponses[keyof GetUserResponses]; + +export type EditUserData = { + body?: PatchUserRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}'; +}; + +export type EditUserErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type EditUserResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type EditUserResponse = EditUserResponses[keyof EditUserResponses]; + +export type DeleteUserGroupData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}'; +}; + +export type DeleteUserGroupErrors = { + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteUserGroupResponses = { + /** + * No Content + * ユーザーグループが削除されました。 + */ + 204: void; +}; + +export type DeleteUserGroupResponse = DeleteUserGroupResponses[keyof DeleteUserGroupResponses]; + +export type GetUserGroupData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}'; +}; + +export type GetUserGroupErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetUserGroupResponses = { + /** + * OK + */ + 200: UserGroup; +}; + +export type GetUserGroupResponse = GetUserGroupResponses[keyof GetUserGroupResponses]; + +export type EditUserGroupData = { + body?: PatchUserGroupRequest; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}'; +}; + +export type EditUserGroupErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Conflict + * 変更後のグループ名のグループは既に存在します。 + */ + 409: unknown; +}; + +export type EditUserGroupResponses = { + /** + * No Content + * 編集されました。 + */ + 204: void; +}; + +export type EditUserGroupResponse = EditUserGroupResponses[keyof EditUserGroupResponses]; + +export type ChangeUserGroupIconData = { + body?: PutUserIconRequest; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/icon'; +}; + +export type ChangeUserGroupIconErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeUserGroupIconResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type ChangeUserGroupIconResponse = ChangeUserGroupIconResponses[keyof ChangeUserGroupIconResponses]; + +export type RemoveUserGroupMembersData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/members'; +}; + +export type RemoveUserGroupMembersErrors = { + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type RemoveUserGroupMembersResponses = { + /** + * No Content + * グループから全てのユーザーが削除されました。 + */ + 204: void; +}; + +export type RemoveUserGroupMembersResponse = RemoveUserGroupMembersResponses[keyof RemoveUserGroupMembersResponses]; + +export type GetUserGroupMembersData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/members'; +}; + +export type GetUserGroupMembersErrors = { + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type GetUserGroupMembersResponses = { + /** + * ユーザーグループメンバーの配列 + */ + 200: Array; +}; + +export type GetUserGroupMembersResponse = GetUserGroupMembersResponses[keyof GetUserGroupMembersResponses]; + +export type AddUserGroupMemberData = { + body?: UserGroupMember | UserGroupMembers; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/members'; +}; + +export type AddUserGroupMemberErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type AddUserGroupMemberResponses = { + /** + * No Content + * 追加されました。 + */ + 204: void; +}; + +export type AddUserGroupMemberResponse = AddUserGroupMemberResponses[keyof AddUserGroupMemberResponses]; + +export type RemoveUserGroupMemberData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/groups/{groupId}/members/{userId}'; +}; + +export type RemoveUserGroupMemberErrors = { + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type RemoveUserGroupMemberResponses = { + /** + * No Content + * 指定したユーザーがユーザーグループから削除されました。 + */ + 204: void; +}; + +export type RemoveUserGroupMemberResponse = RemoveUserGroupMemberResponses[keyof RemoveUserGroupMemberResponses]; + +export type EditUserGroupMemberData = { + body?: PatchGroupMemberRequest; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/groups/{groupId}/members/{userId}'; +}; + +export type EditUserGroupMemberErrors = { + /** + * Bad Request + * ユーザーがグループに存在しないか、リクエストが不正です。 + */ + 400: unknown; + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type EditUserGroupMemberResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type EditUserGroupMemberResponse = EditUserGroupMemberResponses[keyof EditUserGroupMemberResponses]; + +export type GetUserGroupsData = { + body?: never; + path?: never; + query?: never; + url: '/groups'; +}; + +export type GetUserGroupsResponses = { + /** + * ユーザーグループの配列 + */ + 200: Array; +}; + +export type GetUserGroupsResponse = GetUserGroupsResponses[keyof GetUserGroupsResponses]; + +export type CreateUserGroupData = { + body?: PostUserGroupRequest; + path?: never; + query?: never; + url: '/groups'; +}; + +export type CreateUserGroupErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 指定したグループを作成する権限がありません。 + */ + 403: unknown; + /** + * Conflict + * 指定した名前のグループは既に存在します。 + */ + 409: unknown; +}; + +export type CreateUserGroupResponses = { + /** + * Created + */ + 201: UserGroup; +}; + +export type CreateUserGroupResponse = CreateUserGroupResponses[keyof CreateUserGroupResponses]; + +export type GetMeData = { + body?: never; + path?: never; + query?: never; + url: '/users/me'; +}; + +export type GetMeResponses = { + /** + * OK + */ + 200: MyUserDetail; +}; + +export type GetMeResponse = GetMeResponses[keyof GetMeResponses]; + +export type EditMeData = { + body?: PatchMeRequest; + path?: never; + query?: never; + url: '/users/me'; +}; + +export type EditMeErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type EditMeResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type EditMeResponse = EditMeResponses[keyof EditMeResponses]; + +export type GetOidcUserInfoData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/oidc'; +}; + +export type GetOidcUserInfoResponses = { + /** + * OK + */ + 200: OidcUserInfo; +}; + +export type GetOidcUserInfoResponse = GetOidcUserInfoResponses[keyof GetOidcUserInfoResponses]; + +export type GetDirectMessagesData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 取得する時間範囲の開始日時 + */ + since?: string; + /** + * 取得する時間範囲の終了日時 + */ + until?: string; + /** + * 範囲の端を含めるかどうか + */ + inclusive?: boolean; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + }; + url: '/users/{userId}/messages'; +}; + +export type GetDirectMessagesErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type GetDirectMessagesResponses = { + /** + * メッセージの配列 + */ + 200: Array; +}; + +export type GetDirectMessagesResponse = GetDirectMessagesResponses[keyof GetDirectMessagesResponses]; + +export type PostDirectMessageData = { + body?: PostMessageRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/messages'; +}; + +export type PostDirectMessageErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type PostDirectMessageResponses = { + /** + * Created + */ + 201: Message; +}; + +export type PostDirectMessageResponse = PostDirectMessageResponses[keyof PostDirectMessageResponses]; + +export type GetUserStatsData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/stats'; +}; + +export type GetUserStatsErrors = { + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type GetUserStatsResponses = { + /** + * OK + */ + 200: UserStats; +}; + +export type GetUserStatsResponse = GetUserStatsResponses[keyof GetUserStatsResponses]; + +export type GetChannelSubscribersData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/subscribers'; +}; + +export type GetChannelSubscribersErrors = { + /** + * Forbidden + * プライベートチャンネル・強制通知チャンネルの設定は取得できません。 + */ + 403: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelSubscribersResponses = { + /** + * 購読者UUIDの配列 + */ + 200: Array; +}; + +export type GetChannelSubscribersResponse = GetChannelSubscribersResponses[keyof GetChannelSubscribersResponses]; + +export type EditChannelSubscribersData = { + body?: PatchChannelSubscribersRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/subscribers'; +}; + +export type EditChannelSubscribersErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 指定したチャンネルの通知購読者は変更できません。 + */ + 403: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type EditChannelSubscribersResponses = { + /** + * No Content + * 変更できました。 + */ + 204: void; +}; + +export type EditChannelSubscribersResponse = EditChannelSubscribersResponses[keyof EditChannelSubscribersResponses]; + +export type SetChannelSubscribersData = { + body?: PutChannelSubscribersRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/subscribers'; +}; + +export type SetChannelSubscribersErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 指定したチャンネルの通知購読者は変更できません。 + */ + 403: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type SetChannelSubscribersResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type SetChannelSubscribersResponse = SetChannelSubscribersResponses[keyof SetChannelSubscribersResponses]; + +export type GetMyChannelSubscriptionsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/subscriptions'; +}; + +export type GetMyChannelSubscriptionsResponses = { + /** + * チャンネル購読状態の配列 + */ + 200: Array; +}; + +export type GetMyChannelSubscriptionsResponse = GetMyChannelSubscriptionsResponses[keyof GetMyChannelSubscriptionsResponses]; + +export type SetChannelSubscribeLevelData = { + body?: PutChannelSubscribeLevelRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/users/me/subscriptions/{channelId}'; +}; + +export type SetChannelSubscribeLevelErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 指定したチャンネルの通知購読レベルは変更できません。 + */ + 403: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type SetChannelSubscribeLevelResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type SetChannelSubscribeLevelResponse = SetChannelSubscribeLevelResponses[keyof SetChannelSubscribeLevelResponses]; + +export type GetWebhooksData = { + body?: never; + path?: never; + query?: { + /** + * 全てのWebhookを取得します。権限が必要です。 + */ + all?: boolean; + }; + url: '/webhooks'; +}; + +export type GetWebhooksResponses = { + /** + * Webhook情報の配列 + */ + 200: Array; +}; + +export type GetWebhooksResponse = GetWebhooksResponses[keyof GetWebhooksResponses]; + +export type CreateWebhookData = { + body?: PostWebhookRequest; + path?: never; + query?: never; + url: '/webhooks'; +}; + +export type CreateWebhookErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type CreateWebhookResponses = { + /** + * Created + */ + 201: Webhook; +}; + +export type CreateWebhookResponse = CreateWebhookResponses[keyof CreateWebhookResponses]; + +export type DeleteWebhookData = { + body?: never; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: never; + url: '/webhooks/{webhookId}'; +}; + +export type DeleteWebhookErrors = { + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; +}; + +export type DeleteWebhookResponses = { + /** + * No Content + * 削除されました。 + */ + 204: void; +}; + +export type DeleteWebhookResponse = DeleteWebhookResponses[keyof DeleteWebhookResponses]; + +export type GetWebhookData = { + body?: never; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: never; + url: '/webhooks/{webhookId}'; +}; + +export type GetWebhookErrors = { + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; +}; + +export type GetWebhookResponses = { + /** + * OK + */ + 200: Webhook; +}; + +export type GetWebhookResponse = GetWebhookResponses[keyof GetWebhookResponses]; + +export type EditWebhookData = { + body?: PatchWebhookRequest; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: never; + url: '/webhooks/{webhookId}'; +}; + +export type EditWebhookErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; +}; + +export type EditWebhookResponses = { + /** + * No Content + * 編集できました。 + */ + 204: void; +}; + +export type EditWebhookResponse = EditWebhookResponses[keyof EditWebhookResponses]; + +export type PostWebhookData = { + /** + * メッセージ文字列 + */ + body?: string; + headers?: { + /** + * リクエストボディシグネチャ(Secretが設定されている場合は必須) + */ + 'X-TRAQ-Signature'?: string; + /** + * 投稿先のチャンネルID(変更する場合) + */ + 'X-TRAQ-Channel-Id'?: string; + }; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: { + /** + * メンション・チャンネルリンクを自動埋め込みする場合に1を指定する + */ + embed?: number; + }; + url: '/webhooks/{webhookId}'; +}; + +export type PostWebhookErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type PostWebhookResponses = { + /** + * No Content + */ + 204: void; +}; + +export type PostWebhookResponse = PostWebhookResponses[keyof PostWebhookResponses]; + +export type GetWebhookIconData = { + body?: never; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: never; + url: '/webhooks/{webhookId}/icon'; +}; + +export type GetWebhookIconErrors = { + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; +}; + +export type GetWebhookIconResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetWebhookIconResponse = GetWebhookIconResponses[keyof GetWebhookIconResponses]; + +export type ChangeWebhookIconData = { + body?: PutUserIconRequest; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: never; + url: '/webhooks/{webhookId}/icon'; +}; + +export type ChangeWebhookIconErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeWebhookIconResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type ChangeWebhookIconResponse = ChangeWebhookIconResponses[keyof ChangeWebhookIconResponses]; + +export type GetUserIconData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/icon'; +}; + +export type GetUserIconErrors = { + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type GetUserIconResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetUserIconResponse = GetUserIconResponses[keyof GetUserIconResponses]; + +export type ChangeUserIconData = { + body?: PutUserIconRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/icon'; +}; + +export type ChangeUserIconErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeUserIconResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type ChangeUserIconResponse = ChangeUserIconResponses[keyof ChangeUserIconResponses]; + +export type GetMyIconData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/icon'; +}; + +export type GetMyIconErrors = { + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type GetMyIconResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetMyIconResponse = GetMyIconResponses[keyof GetMyIconResponses]; + +export type ChangeMyIconData = { + body?: PutUserIconRequest; + path?: never; + query?: never; + url: '/users/me/icon'; +}; + +export type ChangeMyIconErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeMyIconResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type ChangeMyIconResponse = ChangeMyIconResponses[keyof ChangeMyIconResponses]; + +export type ChangeMyPasswordData = { + body?: PutMyPasswordRequest; + path?: never; + query?: never; + url: '/users/me/password'; +}; + +export type ChangeMyPasswordErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Unauthorized + * 現在のパスワードが違います。 + */ + 401: unknown; +}; + +export type ChangeMyPasswordResponses = { + /** + * No Content + * 変更できました。 + */ + 204: void; +}; + +export type ChangeMyPasswordResponse = ChangeMyPasswordResponses[keyof ChangeMyPasswordResponses]; + +export type ChangeUserPasswordData = { + body?: PutUserPasswordRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/password'; +}; + +export type ChangeUserPasswordErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type ChangeUserPasswordResponses = { + /** + * No Content + * 変更できました。 + */ + 204: void; +}; + +export type ChangeUserPasswordResponse = ChangeUserPasswordResponses[keyof ChangeUserPasswordResponses]; + +export type RegisterFcmDeviceData = { + body?: PostMyFcmDeviceRequest; + path?: never; + query?: never; + url: '/users/me/fcm-device'; +}; + +export type RegisterFcmDeviceErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type RegisterFcmDeviceResponses = { + /** + * No Content + * 登録できました。 + */ + 204: void; +}; + +export type RegisterFcmDeviceResponse = RegisterFcmDeviceResponses[keyof RegisterFcmDeviceResponses]; + +export type GetMyViewStatesData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/view-states'; +}; + +export type GetMyViewStatesResponses = { + /** + * チャンネル閲覧状態 + */ + 200: Array; +}; + +export type GetMyViewStatesResponse = GetMyViewStatesResponses[keyof GetMyViewStatesResponses]; + +export type GetUsersData = { + body?: never; + path?: never; + query?: { + /** + * アカウントがアクティブでないユーザーを含め、全てのユーザーを取得するかどうか + */ + 'include-suspended'?: boolean; + /** + * 名前が一致するアカウントのみを取得する + */ + name?: string; + }; + url: '/users'; +}; + +export type GetUsersErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type GetUsersResponses = { + /** + * ユーザー情報の配列 + */ + 200: Array; +}; + +export type GetUsersResponse = GetUsersResponses[keyof GetUsersResponses]; + +export type CreateUserData = { + body?: PostUserRequest; + path?: never; + query?: never; + url: '/users'; +}; + +export type CreateUserErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Conflict + * nameが重複しています。 + */ + 409: unknown; +}; + +export type CreateUserResponses = { + /** + * Created + */ + 201: UserDetail; +}; + +export type CreateUserResponse = CreateUserResponses[keyof CreateUserResponses]; + +export type GetChannelsData = { + body?: never; + path?: never; + query?: { + /** + * ダイレクトメッセージチャンネルをレスポンスに含めるかどうか + */ + 'include-dm'?: boolean; + /** + * パスが一致するチャンネルのみを取得する + */ + path?: string; + }; + url: '/channels'; +}; + +export type GetChannelsResponses = { + /** + * OK + */ + 200: ChannelList; +}; + +export type GetChannelsResponse = GetChannelsResponses[keyof GetChannelsResponses]; + +export type CreateChannelData = { + body?: PostChannelRequest; + path?: never; + query?: never; + url: '/channels'; +}; + +export type CreateChannelErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Conflict + * 指定した名前のチャンネルは既に存在しています。 + */ + 409: unknown; +}; + +export type CreateChannelResponses = { + /** + * Created + */ + 201: Channel; +}; + +export type CreateChannelResponse = CreateChannelResponses[keyof CreateChannelResponses]; + +export type GetUserTagsData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/tags'; +}; + +export type GetUserTagsErrors = { + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type GetUserTagsResponses = { + /** + * ユーザータグの配列 + */ + 200: Array; +}; + +export type GetUserTagsResponse = GetUserTagsResponses[keyof GetUserTagsResponses]; + +export type AddUserTagData = { + body?: PostUserTagRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/users/{userId}/tags'; +}; + +export type AddUserTagErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; + /** + * Conflict + * 既に追加されています。 + */ + 409: unknown; +}; + +export type AddUserTagResponses = { + /** + * Created + */ + 201: UserTag; +}; + +export type AddUserTagResponse = AddUserTagResponses[keyof AddUserTagResponses]; + +export type RemoveUserTagData = { + body?: never; + path: { + /** + * ユーザーUUID + */ + userId: string; + /** + * タグUUID + */ + tagId: string; + }; + query?: never; + url: '/users/{userId}/tags/{tagId}'; +}; + +export type RemoveUserTagErrors = { + /** + * Forbidden + * タグがロックされていました。 + */ + 403: unknown; + /** + * Not Found + * ユーザーが見つかりません。 + */ + 404: unknown; +}; + +export type RemoveUserTagResponses = { + /** + * No Content + * 削除されました。 + */ + 204: void; +}; + +export type RemoveUserTagResponse = RemoveUserTagResponses[keyof RemoveUserTagResponses]; + +export type EditUserTagData = { + body?: PatchUserTagRequest; + path: { + /** + * ユーザーUUID + */ + userId: string; + /** + * タグUUID + */ + tagId: string; + }; + query?: never; + url: '/users/{userId}/tags/{tagId}'; +}; + +export type EditUserTagErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * ユーザーか、タグが見つかりません。 + */ + 404: unknown; +}; + +export type EditUserTagResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type EditUserTagResponse = EditUserTagResponses[keyof EditUserTagResponses]; + +export type GetTagData = { + body?: never; + path: { + /** + * タグUUID + */ + tagId: string; + }; + query?: never; + url: '/tags/{tagId}'; +}; + +export type GetTagErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetTagResponses = { + /** + * OK + */ + 200: Tag; +}; + +export type GetTagResponse = GetTagResponses[keyof GetTagResponses]; + +export type GetMyUserTagsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/tags'; +}; + +export type GetMyUserTagsResponses = { + /** + * ユーザータグの配列 + */ + 200: Array; +}; + +export type GetMyUserTagsResponse = GetMyUserTagsResponses[keyof GetMyUserTagsResponses]; + +export type AddMyUserTagData = { + body?: PostUserTagRequest; + path?: never; + query?: never; + url: '/users/me/tags'; +}; + +export type AddMyUserTagErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Conflict + * 既に追加されています。 + */ + 409: unknown; +}; + +export type AddMyUserTagResponses = { + /** + * Created + */ + 201: UserTag; +}; + +export type AddMyUserTagResponse = AddMyUserTagResponses[keyof AddMyUserTagResponses]; + +export type RemoveMyUserTagData = { + body?: never; + path: { + /** + * タグUUID + */ + tagId: string; + }; + query?: never; + url: '/users/me/tags/{tagId}'; +}; + +export type RemoveMyUserTagErrors = { + /** + * Forbidden + * タグがロックされています。 + */ + 403: unknown; +}; + +export type RemoveMyUserTagResponses = { + /** + * No Content + * 削除されました。 + */ + 204: void; +}; + +export type RemoveMyUserTagResponse = RemoveMyUserTagResponses[keyof RemoveMyUserTagResponses]; + +export type EditMyUserTagData = { + body?: PatchUserTagRequest; + path: { + /** + * タグUUID + */ + tagId: string; + }; + query?: never; + url: '/users/me/tags/{tagId}'; +}; + +export type EditMyUserTagErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * タグが見つかりません。 + */ + 404: unknown; +}; + +export type EditMyUserTagResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type EditMyUserTagResponse = EditMyUserTagResponses[keyof EditMyUserTagResponses]; + +export type GetMyStarsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/stars'; +}; + +export type GetMyStarsResponses = { + /** + * スターしているチャンネルのUUID配列 + */ + 200: Array; +}; + +export type GetMyStarsResponse = GetMyStarsResponses[keyof GetMyStarsResponses]; + +export type AddMyStarData = { + body?: PostStarRequest; + path?: never; + query?: never; + url: '/users/me/stars'; +}; + +export type AddMyStarErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type AddMyStarResponses = { + /** + * No Content + * スターしました。 + */ + 204: void; +}; + +export type AddMyStarResponse = AddMyStarResponses[keyof AddMyStarResponses]; + +export type RemoveMyStarData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/users/me/stars/{channelId}'; +}; + +export type RemoveMyStarResponses = { + /** + * No Content + * 削除されました。 + */ + 204: void; +}; + +export type RemoveMyStarResponse = RemoveMyStarResponses[keyof RemoveMyStarResponses]; + +export type GetMyUnreadChannelsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/unread'; +}; + +export type GetMyUnreadChannelsResponses = { + /** + * 未読チャンネル情報の配列 + */ + 200: Array; +}; + +export type GetMyUnreadChannelsResponse = GetMyUnreadChannelsResponses[keyof GetMyUnreadChannelsResponses]; + +export type GetServerVersionData = { + body?: never; + path?: never; + query?: never; + url: '/version'; +}; + +export type GetServerVersionResponses = { + /** + * OK + */ + 200: Version; +}; + +export type GetServerVersionResponse = GetServerVersionResponses[keyof GetServerVersionResponses]; + +export type LoginData = { + body?: PostLoginRequest; + path?: never; + query?: { + /** + * リダイレクト先 + */ + redirect?: string; + }; + url: '/login'; +}; + +export type LoginErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Unauthorized + * 認証情報が間違っています。 + */ + 401: unknown; + /** + * Forbidden + * ログインを試行したユーザーアカウントに問題があります。 + */ + 403: unknown; +}; + +export type LoginResponses = { + /** + * No Content + * ログインしました。 + */ + 204: void; +}; + +export type LoginResponse = LoginResponses[keyof LoginResponses]; + +export type LogoutData = { + body?: never; + path?: never; + query?: { + /** + * リダイレクト先 + */ + redirect?: string; + /** + * 全てのセッションでログアウトするかどうか + */ + all?: boolean; + }; + url: '/logout'; +}; + +export type LogoutResponses = { + /** + * No Content + * ログアウトしました。 + */ + 204: void; +}; + +export type LogoutResponse = LogoutResponses[keyof LogoutResponses]; + +export type GetMySessionsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/sessions'; +}; + +export type GetMySessionsResponses = { + /** + * 有効なログインセッションの配列 + */ + 200: Array; +}; + +export type GetMySessionsResponse = GetMySessionsResponses[keyof GetMySessionsResponses]; + +export type RevokeMySessionData = { + body?: never; + path: { + /** + * セッションUUID + */ + sessionId: string; + }; + query?: never; + url: '/users/me/sessions/{sessionId}'; +}; + +export type RevokeMySessionResponses = { + /** + * No Content + * 無効化しました。 + */ + 204: void; +}; + +export type RevokeMySessionResponse = RevokeMySessionResponses[keyof RevokeMySessionResponses]; + +export type GetActivityTimelineData = { + body?: never; + path?: never; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 全てのチャンネルのタイムラインを取得する + */ + all?: boolean; + /** + * 同じチャンネルのメッセージは最新のもののみ取得するか + */ + per_channel?: boolean; + }; + url: '/activity/timeline'; +}; + +export type GetActivityTimelineErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type GetActivityTimelineResponses = { + /** + * メッセージの配列 + */ + 200: Array; +}; + +export type GetActivityTimelineResponse = GetActivityTimelineResponses[keyof GetActivityTimelineResponses]; + +export type WsData = { + body?: never; + path?: never; + query?: never; + url: '/ws'; +}; + +export type GetMyTokensData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/tokens'; +}; + +export type GetMyTokensResponses = { + /** + * トークン情報の配列 + */ + 200: Array; +}; + +export type GetMyTokensResponse = GetMyTokensResponses[keyof GetMyTokensResponses]; + +export type RevokeMyTokenData = { + body?: never; + path: { + /** + * OAuth2トークンUUID + */ + tokenId: string; + }; + query?: never; + url: '/users/me/tokens/{tokenId}'; +}; + +export type RevokeMyTokenErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type RevokeMyTokenResponses = { + /** + * No Content + * 取り消しました。 + */ + 204: void; +}; + +export type RevokeMyTokenResponse = RevokeMyTokenResponses[keyof RevokeMyTokenResponses]; + +export type GetPublicUserIconData = { + body?: never; + path: { + /** + * ユーザー名 + */ + username: string; + }; + query?: never; + url: '/public/icon/{username}'; +}; + +export type GetPublicUserIconErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetPublicUserIconResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetPublicUserIconResponse = GetPublicUserIconResponses[keyof GetPublicUserIconResponses]; + +export type DeleteClientData = { + body?: never; + path: { + /** + * OAuth2クライアントUUID + */ + clientId: string; + }; + query?: never; + url: '/clients/{clientId}'; +}; + +export type DeleteClientErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * OAuth2クライアントが見つかりません。 + */ + 404: unknown; +}; + +export type DeleteClientResponses = { + /** + * No Content + * 削除されました。 + */ + 204: void; +}; + +export type DeleteClientResponse = DeleteClientResponses[keyof DeleteClientResponses]; + +export type GetClientData = { + body?: never; + path: { + /** + * OAuth2クライアントUUID + */ + clientId: string; + }; + query?: { + /** + * 詳細情報を含めるかどうか + */ + detail?: boolean; + }; + url: '/clients/{clientId}'; +}; + +export type GetClientErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type GetClientResponses = { + /** + * OK + */ + 200: OAuth2Client | OAuth2ClientDetail; +}; + +export type GetClientResponse = GetClientResponses[keyof GetClientResponses]; + +export type EditClientData = { + body?: PatchClientRequest; + path: { + /** + * OAuth2クライアントUUID + */ + clientId: string; + }; + query?: never; + url: '/clients/{clientId}'; +}; + +export type EditClientErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * OAuth2クライアントが見つかりません。 + */ + 404: unknown; +}; + +export type EditClientResponses = { + /** + * No Content + * 変更できました。 + */ + 204: void; +}; + +export type EditClientResponse = EditClientResponses[keyof EditClientResponses]; + +export type RevokeClientTokensData = { + body?: never; + path: { + /** + * OAuth2クライアントUUID + */ + clientId: string; + }; + query?: never; + url: '/clients/{clientId}/tokens'; +}; + +export type RevokeClientTokensErrors = { + /** + * Not Found + * OAuth2クライアントが見つかりません。 + */ + 404: unknown; +}; + +export type RevokeClientTokensResponses = { + /** + * No Content + * 削除できました。 + */ + 204: void; +}; + +export type RevokeClientTokensResponse = RevokeClientTokensResponses[keyof RevokeClientTokensResponses]; + +export type GetClientsData = { + body?: never; + path?: never; + query?: { + /** + * 全てのクライアントを取得するかどうか + */ + all?: boolean; + }; + url: '/clients'; +}; + +export type GetClientsResponses = { + /** + * OAuth2クライアント情報の配列 + */ + 200: Array; +}; + +export type GetClientsResponse = GetClientsResponses[keyof GetClientsResponses]; + +export type CreateClientData = { + body?: PostClientRequest; + path?: never; + query?: never; + url: '/clients'; +}; + +export type CreateClientErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type CreateClientResponses = { + /** + * Created + */ + 201: OAuth2ClientDetail; +}; + +export type CreateClientResponse = CreateClientResponses[keyof CreateClientResponses]; + +export type GetBotsData = { + body?: never; + path?: never; + query?: { + /** + * 全てのBOTを取得するかどうか + */ + all?: boolean; + }; + url: '/bots'; +}; + +export type GetBotsResponses = { + /** + * BOT情報の配列 + */ + 200: Array; +}; + +export type GetBotsResponse = GetBotsResponses[keyof GetBotsResponses]; + +export type CreateBotData = { + body?: PostBotRequest; + path?: never; + query?: never; + url: '/bots'; +}; + +export type CreateBotErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Conflict + * 既に使われている名前です。 + */ + 409: unknown; +}; + +export type CreateBotResponses = { + /** + * Created + */ + 201: BotDetail; +}; + +export type CreateBotResponse = CreateBotResponses[keyof CreateBotResponses]; + +export type ConnectBotWsData = { + body?: never; + path?: never; + query?: never; + url: '/bots/ws'; +}; + +export type GetBotIconData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/icon'; +}; + +export type GetBotIconErrors = { + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type GetBotIconResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetBotIconResponse = GetBotIconResponses[keyof GetBotIconResponses]; + +export type ChangeBotIconData = { + body?: PutUserIconRequest; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/icon'; +}; + +export type ChangeBotIconErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeBotIconResponses = { + /** + * No Content + * 変更されました。 + */ + 204: void; +}; + +export type ChangeBotIconResponse = ChangeBotIconResponses[keyof ChangeBotIconResponses]; + +export type DeleteBotData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}'; +}; + +export type DeleteBotErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteBotResponses = { + /** + * No Content + * 削除しました。 + */ + 204: void; +}; + +export type DeleteBotResponse = DeleteBotResponses[keyof DeleteBotResponses]; + +export type GetBotData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: { + /** + * 詳細情報を含めるかどうか + */ + detail?: boolean; + }; + url: '/bots/{botId}'; +}; + +export type GetBotErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type GetBotResponses = { + /** + * OK + */ + 200: Bot | BotDetail; +}; + +export type GetBotResponse = GetBotResponses[keyof GetBotResponses]; + +export type EditBotData = { + body?: PatchBotRequest; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}'; +}; + +export type EditBotErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type EditBotResponses = { + /** + * No Content + * 変更しました。 + */ + 204: void; +}; + +export type EditBotResponse = EditBotResponses[keyof EditBotResponses]; + +export type ActivateBotData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/actions/activate'; +}; + +export type ActivateBotErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type ActivateBotResponses = { + /** + * Accepted + */ + 202: unknown; +}; + +export type InactivateBotData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/actions/inactivate'; +}; + +export type InactivateBotErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type InactivateBotResponses = { + /** + * No Content + * BOTがインアクティベートされました。 + */ + 204: void; +}; + +export type InactivateBotResponse = InactivateBotResponses[keyof InactivateBotResponses]; + +export type ReissueBotData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/actions/reissue'; +}; + +export type ReissueBotErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type ReissueBotResponses = { + /** + * OK + */ + 200: BotTokens; +}; + +export type ReissueBotResponse = ReissueBotResponses[keyof ReissueBotResponses]; + +export type GetBotLogsData = { + body?: never; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + }; + url: '/bots/{botId}/logs'; +}; + +export type GetBotLogsErrors = { + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type GetBotLogsResponses = { + /** + * イベントログの配列 + */ + 200: Array; +}; + +export type GetBotLogsResponse = GetBotLogsResponses[keyof GetBotLogsResponses]; + +export type LetBotJoinChannelData = { + body?: PostBotActionJoinRequest; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/actions/join'; +}; + +export type LetBotJoinChannelErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type LetBotJoinChannelResponses = { + /** + * No Content + * BOTを参加させました。 + */ + 204: void; +}; + +export type LetBotJoinChannelResponse = LetBotJoinChannelResponses[keyof LetBotJoinChannelResponses]; + +export type LetBotLeaveChannelData = { + body?: PostBotActionLeaveRequest; + path: { + /** + * BOTUUID + */ + botId: string; + }; + query?: never; + url: '/bots/{botId}/actions/leave'; +}; + +export type LetBotLeaveChannelErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + * BOTが見つかりません。 + */ + 404: unknown; +}; + +export type LetBotLeaveChannelResponses = { + /** + * No Content + * BOTを退出させました。 + */ + 204: void; +}; + +export type LetBotLeaveChannelResponse = LetBotLeaveChannelResponses[keyof LetBotLeaveChannelResponses]; + +export type GetChannelBotsData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/bots'; +}; + +export type GetChannelBotsErrors = { + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelBotsResponses = { + /** + * BOTの配列 + */ + 200: Array; +}; + +export type GetChannelBotsResponse = GetChannelBotsResponses[keyof GetChannelBotsResponses]; + +export type PostWebRtcAuthenticateData = { + body?: PostWebRtcAuthenticateRequest; + path?: never; + query?: never; + url: '/webrtc/authenticate'; +}; + +export type PostWebRtcAuthenticateErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Service Unavailable + * WebRTCは現在機能を停止しています + */ + 503: unknown; +}; + +export type PostWebRtcAuthenticateResponses = { + /** + * OK + */ + 200: WebRtcAuthenticateResult; +}; + +export type PostWebRtcAuthenticateResponse = PostWebRtcAuthenticateResponses[keyof PostWebRtcAuthenticateResponses]; + +export type GetChannelData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}'; +}; + +export type GetChannelErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetChannelResponses = { + /** + * OK + */ + 200: Channel; +}; + +export type GetChannelResponse = GetChannelResponses[keyof GetChannelResponses]; + +export type EditChannelData = { + body?: PatchChannelRequest; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}'; +}; + +export type EditChannelErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Conflict + * 変更後の名前のチャンネルが既に存在しています。 + */ + 409: unknown; +}; + +export type EditChannelResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EditChannelResponse = EditChannelResponses[keyof EditChannelResponses]; + +export type GetWebRtcStateData = { + body?: never; + path?: never; + query?: never; + url: '/webrtc/state'; +}; + +export type GetWebRtcStateResponses = { + /** + * OK + */ + 200: WebRtcUserStates; +}; + +export type GetWebRtcStateResponse = GetWebRtcStateResponses[keyof GetWebRtcStateResponses]; + +export type GetClipFoldersData = { + body?: never; + path?: never; + query?: never; + url: '/clip-folders'; +}; + +export type GetClipFoldersResponses = { + /** + * クリップフォルダの配列 + */ + 200: Array; +}; + +export type GetClipFoldersResponse = GetClipFoldersResponses[keyof GetClipFoldersResponses]; + +export type CreateClipFolderData = { + body?: PostClipFolderRequest; + path?: never; + query?: never; + url: '/clip-folders'; +}; + +export type CreateClipFolderErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type CreateClipFolderResponses = { + /** + * Created + */ + 201: ClipFolder; +}; + +export type CreateClipFolderResponse = CreateClipFolderResponses[keyof CreateClipFolderResponses]; + +export type DeleteClipFolderData = { + body?: never; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + }; + query?: never; + url: '/clip-folders/{folderId}'; +}; + +export type DeleteClipFolderErrors = { + /** + * Not Found + * クリップフォルダが見つかりません。 + */ + 404: unknown; +}; + +export type DeleteClipFolderResponses = { + /** + * No Content + * 削除しました。 + */ + 204: void; +}; + +export type DeleteClipFolderResponse = DeleteClipFolderResponses[keyof DeleteClipFolderResponses]; + +export type GetClipFolderData = { + body?: never; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + }; + query?: never; + url: '/clip-folders/{folderId}'; +}; + +export type GetClipFolderErrors = { + /** + * Not Found + * クリップフォルダが見つかりません。 + */ + 404: unknown; +}; + +export type GetClipFolderResponses = { + /** + * OK + */ + 200: ClipFolder; +}; + +export type GetClipFolderResponse = GetClipFolderResponses[keyof GetClipFolderResponses]; + +export type EditClipFolderData = { + body?: PatchClipFolderRequest; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + }; + query?: never; + url: '/clip-folders/{folderId}'; +}; + +export type EditClipFolderErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type EditClipFolderResponses = { + /** + * No Content + * 編集しました。 + */ + 204: void; +}; + +export type EditClipFolderResponse = EditClipFolderResponses[keyof EditClipFolderResponses]; + +export type GetClipsData = { + body?: never; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + }; + url: '/clip-folders/{folderId}/messages'; +}; + +export type GetClipsErrors = { + /** + * Not Found + * クリップフォルダが見つかりません。 + */ + 404: unknown; +}; + +export type GetClipsResponses = { + /** + * クリップの配列 + */ + 200: Array; +}; + +export type GetClipsResponse = GetClipsResponses[keyof GetClipsResponses]; + +export type ClipMessageData = { + body?: PostClipFolderMessageRequest; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + }; + query?: never; + url: '/clip-folders/{folderId}/messages'; +}; + +export type ClipMessageErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * クリップフォルダが見つかりません。 + */ + 404: unknown; + /** + * Conflict + * 既に追加されています。 + */ + 409: unknown; +}; + +export type ClipMessageResponses = { + /** + * OK + */ + 200: ClippedMessage; +}; + +export type ClipMessageResponse = ClipMessageResponses[keyof ClipMessageResponses]; + +export type UnclipMessageData = { + body?: never; + path: { + /** + * クリップフォルダUUID + */ + folderId: string; + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/clip-folders/{folderId}/messages/{messageId}'; +}; + +export type UnclipMessageErrors = { + /** + * Not Found + * クリップフォルダが見つかりません。 + */ + 404: unknown; +}; + +export type UnclipMessageResponses = { + /** + * No Content + * 外しました。 + */ + 204: void; +}; + +export type UnclipMessageResponse = UnclipMessageResponses[keyof UnclipMessageResponses]; + +export type GetWebhookMessagesData = { + body?: never; + path: { + /** + * WebhookUUID + */ + webhookId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 取得する時間範囲の開始日時 + */ + since?: string; + /** + * 取得する時間範囲の終了日時 + */ + until?: string; + /** + * 範囲の端を含めるかどうか + */ + inclusive?: boolean; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + }; + url: '/webhooks/{webhookId}/messages'; +}; + +export type GetWebhookMessagesErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * Webhookが見つかりません。 + */ + 404: unknown; +}; + +export type GetWebhookMessagesResponses = { + /** + * メッセージの配列 + */ + 200: Array; +}; + +export type GetWebhookMessagesResponse = GetWebhookMessagesResponses[keyof GetWebhookMessagesResponses]; + +export type DeleteWebhookMessageData = { + body?: never; + path: { + /** + * WebhookUUID + */ + webhookId: string; + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/webhooks/:webhookID/messages/:messageID'; +}; + +export type DeleteWebhookMessageErrors = { + /** + * Forbidden + * メッセージを削除する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * webhookまたはメッセージが見つかりません + */ + 404: unknown; +}; + +export type DeleteWebhookMessageResponses = { + /** + * No Content + * 正常に削除できました。 + */ + 204: void; +}; + +export type DeleteWebhookMessageResponse = DeleteWebhookMessageResponses[keyof DeleteWebhookMessageResponses]; + +export type GetChannelEventsData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: { + /** + * 取得する件数 + */ + limit?: number; + /** + * 取得するオフセット + */ + offset?: number; + /** + * 取得する時間範囲の開始日時 + */ + since?: string; + /** + * 取得する時間範囲の終了日時 + */ + until?: string; + /** + * 範囲の端を含めるかどうか + */ + inclusive?: boolean; + /** + * 昇順か降順か + */ + order?: 'asc' | 'desc'; + }; + url: '/channels/{channelId}/events'; +}; + +export type GetChannelEventsErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + * チャンネルが見つかりません。 + */ + 404: unknown; +}; + +export type GetChannelEventsResponses = { + /** + * チャンネルイベントの配列 + */ + 200: Array; +}; + +export type GetChannelEventsResponse = GetChannelEventsResponses[keyof GetChannelEventsResponses]; + +export type GetStampPalettesData = { + body?: never; + path?: never; + query?: never; + url: '/stamp-palettes'; +}; + +export type GetStampPalettesResponses = { + /** + * スタンプパレットの配列 + */ + 200: Array; +}; + +export type GetStampPalettesResponse = GetStampPalettesResponses[keyof GetStampPalettesResponses]; + +export type CreateStampPaletteData = { + body?: PostStampPaletteRequest; + path?: never; + query?: never; + url: '/stamp-palettes'; +}; + +export type CreateStampPaletteErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type CreateStampPaletteResponses = { + /** + * Created + */ + 201: StampPalette; +}; + +export type CreateStampPaletteResponse = CreateStampPaletteResponses[keyof CreateStampPaletteResponses]; + +export type DeleteStampPaletteData = { + body?: never; + path: { + /** + * スタンプパレットUUID + */ + paletteId: string; + }; + query?: never; + url: '/stamp-palettes/{paletteId}'; +}; + +export type DeleteStampPaletteErrors = { + /** + * Forbidden + * 対象のスタンプパレットを削除する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type DeleteStampPaletteResponses = { + /** + * No Content + * 削除しました。 + */ + 204: void; +}; + +export type DeleteStampPaletteResponse = DeleteStampPaletteResponses[keyof DeleteStampPaletteResponses]; + +export type GetStampPaletteData = { + body?: never; + path: { + /** + * スタンプパレットUUID + */ + paletteId: string; + }; + query?: never; + url: '/stamp-palettes/{paletteId}'; +}; + +export type GetStampPaletteErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetStampPaletteResponses = { + /** + * OK + */ + 200: StampPalette; +}; + +export type GetStampPaletteResponse = GetStampPaletteResponses[keyof GetStampPaletteResponses]; + +export type EditStampPaletteData = { + body?: PatchStampPaletteRequest; + path: { + /** + * スタンプパレットUUID + */ + paletteId: string; + }; + query?: never; + url: '/stamp-palettes/{paletteId}'; +}; + +export type EditStampPaletteErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * 対象のスタンプパレットを編集する権限がありません。 + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; +}; + +export type EditStampPaletteResponses = { + /** + * No Content + * 変更しました。 + */ + 204: void; +}; + +export type EditStampPaletteResponse = EditStampPaletteResponses[keyof EditStampPaletteResponses]; + +export type GetOnlineUsersData = { + body?: never; + path?: never; + query?: never; + url: '/activity/onlines'; +}; + +export type GetOnlineUsersResponses = { + /** + * ユーザーのUUID配列 + */ + 200: Array; +}; + +export type GetOnlineUsersResponse = GetOnlineUsersResponses[keyof GetOnlineUsersResponses]; + +export type GetStampImageData = { + body?: never; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}/image'; +}; + +export type GetStampImageErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetStampImageResponses = { + /** + * OK + */ + 200: Blob | File; +}; + +export type GetStampImageResponse = GetStampImageResponses[keyof GetStampImageResponses]; + +export type ChangeStampImageData = { + body?: { + /** + * スタンプ画像(1MBまでのpng, jpeg, gif) + */ + file: Blob | File; + }; + path: { + /** + * スタンプUUID + */ + stampId: string; + }; + query?: never; + url: '/stamps/{stampId}/image'; +}; + +export type ChangeStampImageErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Request Entity Too Large + */ + 413: unknown; +}; + +export type ChangeStampImageResponses = { + /** + * No Content + */ + 204: void; +}; + +export type ChangeStampImageResponse = ChangeStampImageResponses[keyof ChangeStampImageResponses]; + +export type ReadChannelData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/users/me/unread/{channelId}'; +}; + +export type ReadChannelResponses = { + /** + * No Content + * 既読にしました。 + */ + 204: void; +}; + +export type ReadChannelResponse = ReadChannelResponses[keyof ReadChannelResponses]; + +export type RemoveUserGroupAdminData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + /** + * ユーザーUUID + */ + userId: string; + }; + query?: never; + url: '/groups/{groupId}/admins/{userId}'; +}; + +export type RemoveUserGroupAdminErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type RemoveUserGroupAdminResponses = { + /** + * No Content + * 指定したユーザーがユーザーグループ管理者から削除されました。 + */ + 204: void; +}; + +export type RemoveUserGroupAdminResponse = RemoveUserGroupAdminResponses[keyof RemoveUserGroupAdminResponses]; + +export type GetUserGroupAdminsData = { + body?: never; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/admins'; +}; + +export type GetUserGroupAdminsErrors = { + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type GetUserGroupAdminsResponses = { + /** + * ユーザーグループ管理者のUUIDの配列 + */ + 200: Array; +}; + +export type GetUserGroupAdminsResponse = GetUserGroupAdminsResponses[keyof GetUserGroupAdminsResponses]; + +export type AddUserGroupAdminData = { + body?: PostUserGroupAdminRequest; + path: { + /** + * ユーザーグループUUID + */ + groupId: string; + }; + query?: never; + url: '/groups/{groupId}/admins'; +}; + +export type AddUserGroupAdminErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + * ユーザーグループを操作する権限がありません。 + */ + 403: unknown; + /** + * Not Found + * ユーザーグループが見つかりません。 + */ + 404: unknown; +}; + +export type AddUserGroupAdminResponses = { + /** + * No Content + * 追加されました。 + */ + 204: void; +}; + +export type AddUserGroupAdminResponse = AddUserGroupAdminResponses[keyof AddUserGroupAdminResponses]; + +export type PostOAuth2TokenData = { + body: PostOAuth2Token; + path?: never; + query?: never; + url: '/oauth2/token'; +}; + +export type PostOAuth2TokenErrors = { + /** + * トークン発行に失敗しました。 + */ + 400: unknown; + /** + * トークン発行に失敗しました。 + */ + 403: unknown; +}; + +export type PostOAuth2TokenResponses = { + /** + * トークンが正常に発行されました。 + */ + 200: OAuth2Token; +}; + +export type PostOAuth2TokenResponse = PostOAuth2TokenResponses[keyof PostOAuth2TokenResponses]; + +export type PostOAuth2AuthorizeDecideData = { + body: OAuth2Decide; + path?: never; + query?: never; + url: '/oauth2/authorize/decide'; +}; + +export type PostOAuth2AuthorizeDecideErrors = { + /** + * リクエストが不正です。 + */ + 400: unknown; + /** + * リクエストが許可されていません。 + */ + 403: unknown; +}; + +export type GetOAuth2AuthorizeData = { + body?: never; + path?: never; + query: { + response_type?: OAuth2ResponseType; + client_id: string; + redirect_uri?: string; + scope?: string; + state?: string; + code_challenge?: string; + code_challenge_method?: string; + nonce?: string; + prompt?: OAuth2Prompt; + }; + url: '/oauth2/authorize'; +}; + +export type GetOAuth2AuthorizeErrors = { + /** + * リクエストが不正です。 + */ + 400: unknown; + /** + * リクエストが許可されていません。 + */ + 403: unknown; +}; + +export type PostOAuth2AuthorizeData = { + body: OAuth2Authorization; + path?: never; + query?: never; + url: '/oauth2/authorize'; +}; + +export type PostOAuth2AuthorizeErrors = { + /** + * リクエストが不正です。 + */ + 400: unknown; + /** + * リクエストが許可されていません。 + */ + 403: unknown; +}; + +export type RevokeOAuth2TokenData = { + body: OAuth2Revoke; + path?: never; + query?: never; + url: '/oauth2/revoke'; +}; + +export type RevokeOAuth2TokenResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type GetMyExternalAccountsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/ex-accounts'; +}; + +export type GetMyExternalAccountsResponses = { + /** + * 紐付けられているアカウントの配列 + */ + 200: Array; +}; + +export type GetMyExternalAccountsResponse = GetMyExternalAccountsResponses[keyof GetMyExternalAccountsResponses]; + +export type LinkExternalAccountData = { + body?: PostLinkExternalAccount; + path?: never; + query?: never; + url: '/users/me/ex-accounts/link'; +}; + +export type LinkExternalAccountErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type UnlinkExternalAccountData = { + body?: PostUnlinkExternalAccount; + path?: never; + query?: never; + url: '/users/me/ex-accounts/unlink'; +}; + +export type UnlinkExternalAccountErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type UnlinkExternalAccountResponses = { + /** + * No Content + * 紐付けを解除しました。 + */ + 204: void; +}; + +export type UnlinkExternalAccountResponse = UnlinkExternalAccountResponses[keyof UnlinkExternalAccountResponses]; + +export type GetUserDmChannelData = { + body?: never; + path: { + userId: string; + }; + query?: never; + url: '/users/{userId}/dm-channel'; +}; + +export type GetUserDmChannelErrors = { + /** + * Not Found + * ユーザーが見つかりません。 + * + */ + 404: unknown; +}; + +export type GetUserDmChannelResponses = { + /** + * OK + */ + 200: DmChannel; +}; + +export type GetUserDmChannelResponse = GetUserDmChannelResponses[keyof GetUserDmChannelResponses]; + +export type GetMessageClipsData = { + body?: never; + path: { + /** + * メッセージUUID + */ + messageId: string; + }; + query?: never; + url: '/messages/{messageId}/clips'; +}; + +export type GetMessageClipsErrors = { + /** + * Not Found + * + */ + 404: unknown; +}; + +export type GetMessageClipsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetMessageClipsResponse = GetMessageClipsResponses[keyof GetMessageClipsResponses]; + +export type GetOgpData = { + body?: never; + path?: never; + query: { + /** + * OGPを取得したいURL + */ + url: string; + }; + url: '/ogp'; +}; + +export type GetOgpErrors = { + /** + * 指定したURLが不正です。 + */ + 400: unknown; +}; + +export type GetOgpResponses = { + /** + * OK + */ + 200: Ogp; +}; + +export type GetOgpResponse = GetOgpResponses[keyof GetOgpResponses]; + +export type DeleteOgpCacheData = { + body?: never; + path?: never; + query: { + /** + * OGPのキャッシュを削除したいURL + */ + url: string; + }; + url: '/ogp/cache'; +}; + +export type DeleteOgpCacheErrors = { + /** + * 指定したURLが不正です。 + */ + 400: unknown; +}; + +export type DeleteOgpCacheResponses = { + /** + * No Content + */ + 204: void; +}; + +export type DeleteOgpCacheResponse = DeleteOgpCacheResponses[keyof DeleteOgpCacheResponses]; + +export type GetUserSettingsData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/settings'; +}; + +export type GetUserSettingsResponses = { + /** + * OK + */ + 200: UserSettings; +}; + +export type GetUserSettingsResponse = GetUserSettingsResponses[keyof GetUserSettingsResponses]; + +export type GetMyNotifyCitationData = { + body?: never; + path?: never; + query?: never; + url: '/users/me/settings/notify-citation'; +}; + +export type GetMyNotifyCitationResponses = { + /** + * OK + */ + 200: GetNotifyCitation; +}; + +export type GetMyNotifyCitationResponse = GetMyNotifyCitationResponses[keyof GetMyNotifyCitationResponses]; + +export type ChangeMyNotifyCitationData = { + body?: PutNotifyCitationRequest; + path?: never; + query?: never; + url: '/users/me/settings/notify-citation'; +}; + +export type ChangeMyNotifyCitationErrors = { + /** + * Bad Request + */ + 400: unknown; +}; + +export type ChangeMyNotifyCitationResponses = { + /** + * 変更できました。 + */ + 204: void; +}; + +export type ChangeMyNotifyCitationResponse = ChangeMyNotifyCitationResponses[keyof ChangeMyNotifyCitationResponses]; + +export type GetChannelPathData = { + body?: never; + path: { + /** + * チャンネルUUID + */ + channelId: string; + }; + query?: never; + url: '/channels/{channelId}/path'; +}; + +export type GetChannelPathErrors = { + /** + * Not Found + */ + 404: unknown; +}; + +export type GetChannelPathResponses = { + /** + * OK + */ + 200: ChannelPath; +}; + +export type GetChannelPathResponse = GetChannelPathResponses[keyof GetChannelPathResponses]; + +export type GetQallEndpointsData = { + body?: never; + path?: never; + query?: never; + url: '/qall/endpoints'; +}; + +export type GetQallEndpointsErrors = { + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetQallEndpointsResponses = { + /** + * 成功 - LiveKitエンドポイントの取得 + */ + 200: QallEndpointResponse; +}; + +export type GetQallEndpointsResponse = GetQallEndpointsResponses[keyof GetQallEndpointsResponses]; + +export type GetLiveKitTokenData = { + body?: never; + path?: never; + query?: { + /** + * ルームUUID + */ + roomId?: string; + /** + * ウェビナールームかどうか(デフォルト false) + */ + isWebinar?: boolean; + }; + url: '/qall/token'; +}; + +export type GetLiveKitTokenErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetLiveKitTokenResponses = { + /** + * 成功 - LiveKitトークンを返します + */ + 200: QallTokenResponse; +}; + +export type GetLiveKitTokenResponse = GetLiveKitTokenResponses[keyof GetLiveKitTokenResponses]; + +export type GetRoomsData = { + body?: never; + path?: never; + query?: never; + url: '/qall/rooms'; +}; + +export type GetRoomsErrors = { + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetRoomsResponses = { + /** + * 成功 - ルームと参加者一覧の取得 + */ + 200: QallRoomsListResponse; +}; + +export type GetRoomsResponse = GetRoomsResponses[keyof GetRoomsResponses]; + +export type GetRoomMetadataData = { + body?: never; + path: { + /** + * ルームUUID + */ + roomId: string; + }; + query?: never; + url: '/qall/rooms/{roomId}/metadata'; +}; + +export type GetRoomMetadataErrors = { + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetRoomMetadataResponses = { + /** + * 成功 - ルームのメタデータを取得 + */ + 200: QallMetadataResponse; +}; + +export type GetRoomMetadataResponse = GetRoomMetadataResponses[keyof GetRoomMetadataResponses]; + +export type UpdateRoomMetadataData = { + /** + * ルームのメタデータ + */ + body: QallMetadataRequest; + path: { + /** + * ルームUUID + */ + roomId: string; + }; + query?: never; + url: '/qall/rooms/{roomId}/metadata'; +}; + +export type UpdateRoomMetadataErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type UpdateRoomMetadataResponses = { + /** + * 成功 - ルームのメタデータを更新 + */ + 200: unknown; +}; + +export type ChangeParticipantRoleData = { + /** + * 発言権限を変更する参加者の情報 + */ + body: Array; + path: { + /** + * ルームUUID + */ + roomId: string; + }; + query?: never; + url: '/qall/rooms/{roomId}/participants'; +}; + +export type ChangeParticipantRoleErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type ChangeParticipantRoleResponses = { + /** + * 成功 - 発言権限を変更(部分的成功含む) + */ + 200: QallParticipantResponse; +}; + +export type ChangeParticipantRoleResponse = ChangeParticipantRoleResponses[keyof ChangeParticipantRoleResponses]; + +export type LiveKitWebhookData = { + /** + * LiveKit Webhook イベントのペイロード + */ + body: { + [key: string]: unknown; + }; + path?: never; + query?: never; + url: '/qall/webhook'; +}; + +export type LiveKitWebhookErrors = { + /** + * Invalid payload + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type LiveKitWebhookResponses = { + /** + * Webhookを正常に受信 + */ + 200: unknown; +}; + +export type GetSoundboardListData = { + body?: never; + path?: never; + query?: never; + url: '/qall/soundboard'; +}; + +export type GetSoundboardListErrors = { + /** + * サーバエラー + */ + 500: unknown; +}; + +export type GetSoundboardListResponses = { + /** + * サウンド一覧の取得に成功 + */ + 200: SoundboardListResponse; +}; + +export type GetSoundboardListResponse = GetSoundboardListResponses[keyof GetSoundboardListResponses]; + +export type PostSoundboardData = { + body: SoundboardUploadRequest; + path?: never; + query?: never; + url: '/qall/soundboard'; +}; + +export type PostSoundboardErrors = { + /** + * ファイルが提供されていない等 + */ + 400: unknown; + /** + * アップロードエラーなどのサーバエラー + */ + 500: unknown; +}; + +export type PostSoundboardResponses = { + /** + * アップロード成功 + */ + 200: SoundboardUploadResponse; +}; + +export type PostSoundboardResponse = PostSoundboardResponses[keyof PostSoundboardResponses]; + +export type PostSoundboardPlayData = { + body: SoundboardPlayRequest; + path?: never; + query?: never; + url: '/qall/soundboard/play'; +}; + +export type PostSoundboardPlayErrors = { + /** + * パラメータ不足 or ユーザが部屋にいない等 + */ + 400: unknown; + /** + * 認証エラー + */ + 401: unknown; + /** + * Ingress作成失敗などのサーバエラー + */ + 500: unknown; +}; + +export type PostSoundboardPlayResponses = { + /** + * Ingressの作成に成功 + */ + 200: SoundboardPlayResponse; +}; + +export type PostSoundboardPlayResponse = PostSoundboardPlayResponses[keyof PostSoundboardPlayResponses]; -- 2.51.2