chore: build library from latest spec [skip ci]

This commit is contained in:
Revolt CI
2023-03-01 19:24:44 +00:00
parent c22264ed08
commit b82b249f4d
4 changed files with 218 additions and 2 deletions
+2 -2
View File
@@ -1,3 +1,3 @@
// This file was auto-generated by @insertish/oapi!
export const pathResolve = {"1":[[""]],"2":[["users","@me"],["users",["{target}"]],["users","dms"],["users","friend"],["bots","create"],["bots",["{target}"]],["bots","@me"],["channels",["{target}"]],["channels","create"],["servers","create"],["servers",["{target}"]],["invites",["{target}"]],["safety","report"],["onboard","hello"],["onboard","complete"],["push","subscribe"],["push","unsubscribe"],["sync","unreads"]],"3":[["users",["{target}"],"flags"],["users","@me","username"],["users",["{target}"],"default_avatar"],["users",["{target}"],"profile"],["users",["{target}"],"dm"],["users",["{target}"],"mutual"],["users",["{target}"],"friend"],["users",["{target}"],"block"],["bots",["{target}"],"invite"],["channels",["{target}"],"members"],["channels",["{target}"],"invites"],["channels",["{target}"],"messages"],["channels",["{target}"],"search"],["channels",["{target}"],"join_call"],["servers",["{target}"],"ack"],["servers",["{target}"],"channels"],["servers",["{target}"],"members"],["servers",["{target}"],"bans"],["servers",["{target}"],"invites"],["servers",["{target}"],"roles"],["servers",["{target}"],"emojis"],["custom","emoji",["{id}"]],["auth","account","create"],["auth","account","reverify"],["auth","account","delete"],["auth","account",""],["auth","account","disable"],["auth","account","reset_password"],["auth","session","login"],["auth","session","logout"],["auth","session","all"],["auth","session",["{id}"]],["auth","mfa","ticket"],["auth","mfa",""],["auth","mfa","recovery"],["auth","mfa","methods"],["auth","mfa","totp"],["sync","settings","fetch"],["sync","settings","set"]],"4":[["channels",["{target}"],"ack",["{message}"]],["channels",["{_target}"],"messages","stale"],["channels",["{target}"],"messages",["{msg}"]],["channels",["{target}"],"messages","bulk"],["channels",["{target}"],"recipients",["{member}"]],["channels",["{target}"],"permissions",["{role_id}"]],["channels",["{target}"],"permissions","default"],["servers",["{target}"],"members",["{member}"]],["servers",["{server}"],"members",["{target}"]],["servers",["{server}"],"bans",["{target}"]],["servers",["{target}"],"roles",["{role_id}"]],["servers",["{target}"],"permissions",["{role_id}"]],["servers",["{target}"],"permissions","default"],["auth","account","change","password"],["auth","account","change","email"],["auth","account","verify",["{code}"]]],"5":[["channels",["{target}"],"messages",["{msg}"],"reactions"]],"6":[["channels",["{target}"],"messages",["{msg}"],"reactions",["{emoji}"]]]};
export const queryParams = {"/":{"get":[]},"/users/@me":{"get":[],"patch":[]},"/users/{target}":{"get":[]},"/users/{target}/flags":{"get":[]},"/users/@me/username":{"patch":[]},"/users/{target}/default_avatar":{"get":[]},"/users/{target}/profile":{"get":[]},"/users/dms":{"get":[]},"/users/{target}/dm":{"get":[]},"/users/{target}/mutual":{"get":[]},"/users/{target}/friend":{"put":[],"delete":[]},"/users/{target}/block":{"put":[],"delete":[]},"/users/friend":{"post":[]},"/bots/create":{"post":[]},"/bots/{target}/invite":{"get":[],"post":[]},"/bots/{target}":{"get":[],"delete":[],"patch":[]},"/bots/@me":{"get":[]},"/channels/{target}/ack/{message}":{"put":[]},"/channels/{target}":{"get":[],"delete":["leave_silently"],"patch":[]},"/channels/{target}/members":{"get":[]},"/channels/{target}/invites":{"post":[]},"/channels/{target}/messages":{"get":["limit","before","after","sort","nearby","include_users"],"post":[]},"/channels/{target}/search":{"post":[]},"/channels/{_target}/messages/stale":{"post":[]},"/channels/{target}/messages/{msg}":{"get":[],"delete":[],"patch":[]},"/channels/{target}/messages/bulk":{"delete":[]},"/channels/create":{"post":[]},"/channels/{target}/recipients/{member}":{"put":[],"delete":[]},"/channels/{target}/join_call":{"post":[]},"/channels/{target}/permissions/{role_id}":{"put":[]},"/channels/{target}/permissions/default":{"put":[]},"/channels/{target}/messages/{msg}/reactions/{emoji}":{"put":[],"delete":["user_id","remove_all"]},"/channels/{target}/messages/{msg}/reactions":{"delete":[]},"/servers/create":{"post":[]},"/servers/{target}":{"get":[],"delete":["leave_silently"],"patch":[]},"/servers/{target}/ack":{"put":[]},"/servers/{target}/channels":{"post":[]},"/servers/{target}/members":{"get":["exclude_offline"]},"/servers/{target}/members/{member}":{"get":[],"delete":[]},"/servers/{server}/members/{target}":{"patch":[]},"/servers/{server}/bans/{target}":{"put":[],"delete":[]},"/servers/{target}/bans":{"get":[]},"/servers/{target}/invites":{"get":[]},"/servers/{target}/roles":{"post":[]},"/servers/{target}/roles/{role_id}":{"delete":[],"patch":[]},"/servers/{target}/permissions/{role_id}":{"put":[]},"/servers/{target}/permissions/default":{"put":[]},"/servers/{target}/emojis":{"get":[]},"/invites/{target}":{"get":[],"post":[],"delete":[]},"/custom/emoji/{id}":{"get":[],"put":[],"delete":[]},"/safety/report":{"post":[]},"/auth/account/create":{"post":[]},"/auth/account/reverify":{"post":[]},"/auth/account/delete":{"put":[],"post":[]},"/auth/account/":{"get":[]},"/auth/account/disable":{"post":[]},"/auth/account/change/password":{"patch":[]},"/auth/account/change/email":{"patch":[]},"/auth/account/verify/{code}":{"post":[]},"/auth/account/reset_password":{"post":[],"patch":[]},"/auth/session/login":{"post":[]},"/auth/session/logout":{"post":[]},"/auth/session/all":{"get":[],"delete":["revoke_self"]},"/auth/session/{id}":{"delete":[],"patch":[]},"/auth/mfa/ticket":{"put":[]},"/auth/mfa/":{"get":[]},"/auth/mfa/recovery":{"post":[],"patch":[]},"/auth/mfa/methods":{"get":[]},"/auth/mfa/totp":{"put":[],"post":[],"delete":[]},"/onboard/hello":{"get":[]},"/onboard/complete":{"post":[]},"/push/subscribe":{"post":[]},"/push/unsubscribe":{"post":[]},"/sync/settings/fetch":{"post":[]},"/sync/settings/set":{"post":["timestamp"]},"/sync/unreads":{"get":[]}};
export const pathResolve = {"1":[[""]],"2":[["users","@me"],["users",["{target}"]],["users","dms"],["users","friend"],["bots","create"],["bots",["{target}"]],["bots","@me"],["channels",["{target}"]],["channels","create"],["servers","create"],["servers",["{target}"]],["invites",["{target}"]],["safety","report"],["safety","reports"],["onboard","hello"],["onboard","complete"],["push","subscribe"],["push","unsubscribe"],["sync","unreads"]],"3":[["users",["{target}"],"flags"],["users","@me","username"],["users",["{target}"],"default_avatar"],["users",["{target}"],"profile"],["users",["{target}"],"dm"],["users",["{target}"],"mutual"],["users",["{target}"],"friend"],["users",["{target}"],"block"],["bots",["{target}"],"invite"],["channels",["{target}"],"members"],["channels",["{target}"],"invites"],["channels",["{target}"],"messages"],["channels",["{target}"],"search"],["channels",["{target}"],"join_call"],["servers",["{target}"],"ack"],["servers",["{target}"],"channels"],["servers",["{target}"],"members"],["servers",["{target}"],"bans"],["servers",["{target}"],"invites"],["servers",["{target}"],"roles"],["servers",["{target}"],"emojis"],["custom","emoji",["{id}"]],["safety","snapshot",["{report_id}"]],["auth","account","create"],["auth","account","reverify"],["auth","account","delete"],["auth","account",""],["auth","account","disable"],["auth","account","reset_password"],["auth","session","login"],["auth","session","logout"],["auth","session","all"],["auth","session",["{id}"]],["auth","mfa","ticket"],["auth","mfa",""],["auth","mfa","recovery"],["auth","mfa","methods"],["auth","mfa","totp"],["sync","settings","fetch"],["sync","settings","set"]],"4":[["channels",["{target}"],"ack",["{message}"]],["channels",["{_target}"],"messages","stale"],["channels",["{target}"],"messages",["{msg}"]],["channels",["{target}"],"messages","bulk"],["channels",["{target}"],"recipients",["{member}"]],["channels",["{target}"],"permissions",["{role_id}"]],["channels",["{target}"],"permissions","default"],["servers",["{target}"],"members",["{member}"]],["servers",["{server}"],"members",["{target}"]],["servers",["{server}"],"bans",["{target}"]],["servers",["{target}"],"roles",["{role_id}"]],["servers",["{target}"],"permissions",["{role_id}"]],["servers",["{target}"],"permissions","default"],["auth","account","change","password"],["auth","account","change","email"],["auth","account","verify",["{code}"]]],"5":[["channels",["{target}"],"messages",["{msg}"],"reactions"]],"6":[["channels",["{target}"],"messages",["{msg}"],"reactions",["{emoji}"]]]};
export const queryParams = {"/":{"get":[]},"/users/@me":{"get":[],"patch":[]},"/users/{target}":{"get":[]},"/users/{target}/flags":{"get":[]},"/users/@me/username":{"patch":[]},"/users/{target}/default_avatar":{"get":[]},"/users/{target}/profile":{"get":[]},"/users/dms":{"get":[]},"/users/{target}/dm":{"get":[]},"/users/{target}/mutual":{"get":[]},"/users/{target}/friend":{"put":[],"delete":[]},"/users/{target}/block":{"put":[],"delete":[]},"/users/friend":{"post":[]},"/bots/create":{"post":[]},"/bots/{target}/invite":{"get":[],"post":[]},"/bots/{target}":{"get":[],"delete":[],"patch":[]},"/bots/@me":{"get":[]},"/channels/{target}/ack/{message}":{"put":[]},"/channels/{target}":{"get":[],"delete":["leave_silently"],"patch":[]},"/channels/{target}/members":{"get":[]},"/channels/{target}/invites":{"post":[]},"/channels/{target}/messages":{"get":["limit","before","after","sort","nearby","include_users"],"post":[]},"/channels/{target}/search":{"post":[]},"/channels/{_target}/messages/stale":{"post":[]},"/channels/{target}/messages/{msg}":{"get":[],"delete":[],"patch":[]},"/channels/{target}/messages/bulk":{"delete":[]},"/channels/create":{"post":[]},"/channels/{target}/recipients/{member}":{"put":[],"delete":[]},"/channels/{target}/join_call":{"post":[]},"/channels/{target}/permissions/{role_id}":{"put":[]},"/channels/{target}/permissions/default":{"put":[]},"/channels/{target}/messages/{msg}/reactions/{emoji}":{"put":[],"delete":["user_id","remove_all"]},"/channels/{target}/messages/{msg}/reactions":{"delete":[]},"/servers/create":{"post":[]},"/servers/{target}":{"get":[],"delete":["leave_silently"],"patch":[]},"/servers/{target}/ack":{"put":[]},"/servers/{target}/channels":{"post":[]},"/servers/{target}/members":{"get":["exclude_offline"]},"/servers/{target}/members/{member}":{"get":[],"delete":[]},"/servers/{server}/members/{target}":{"patch":[]},"/servers/{server}/bans/{target}":{"put":[],"delete":[]},"/servers/{target}/bans":{"get":[]},"/servers/{target}/invites":{"get":[]},"/servers/{target}/roles":{"post":[]},"/servers/{target}/roles/{role_id}":{"delete":[],"patch":[]},"/servers/{target}/permissions/{role_id}":{"put":[]},"/servers/{target}/permissions/default":{"put":[]},"/servers/{target}/emojis":{"get":[]},"/invites/{target}":{"get":[],"post":[],"delete":[]},"/custom/emoji/{id}":{"get":[],"put":[],"delete":[]},"/safety/report":{"post":[]},"/safety/reports":{"get":[]},"/safety/snapshot/{report_id}":{"get":[]},"/auth/account/create":{"post":[]},"/auth/account/reverify":{"post":[]},"/auth/account/delete":{"put":[],"post":[]},"/auth/account/":{"get":[]},"/auth/account/disable":{"post":[]},"/auth/account/change/password":{"patch":[]},"/auth/account/change/email":{"patch":[]},"/auth/account/verify/{code}":{"post":[]},"/auth/account/reset_password":{"post":[],"patch":[]},"/auth/session/login":{"post":[]},"/auth/session/logout":{"post":[]},"/auth/session/all":{"get":[],"delete":["revoke_self"]},"/auth/session/{id}":{"delete":[],"patch":[]},"/auth/mfa/ticket":{"put":[]},"/auth/mfa/":{"get":[]},"/auth/mfa/recovery":{"post":[],"patch":[]},"/auth/mfa/methods":{"get":[]},"/auth/mfa/totp":{"put":[],"post":[],"delete":[]},"/onboard/hello":{"get":[]},"/onboard/complete":{"post":[]},"/push/subscribe":{"post":[]},"/push/unsubscribe":{"post":[]},"/sync/settings/fetch":{"post":[]},"/sync/settings/set":{"post":["timestamp"]},"/sync/unreads":{"get":[]}};
+3
View File
@@ -136,6 +136,9 @@ export type APIRoutes =
| { method: 'delete', path: `/custom/emoji/${string}`, parts: 3, params: undefined, response: undefined }
| { method: 'delete', path: '-/custom/emoji/{id}', parts: 3, params: undefined, response: undefined }
| { method: 'post', path: `/safety/report`, parts: 2, params: paths['/safety/report']['post']['requestBody']['content']['application/json'], response: undefined }
| { method: 'get', path: `/safety/reports`, parts: 2, params: undefined, response: paths['/safety/reports']['get']['responses']['200']['content']['application/json'] }
| { method: 'get', path: `/safety/snapshot/${string}`, parts: 3, params: undefined, response: paths['/safety/snapshot/{report_id}']['get']['responses']['200']['content']['application/json'] }
| { method: 'get', path: '-/safety/snapshot/{report_id}', parts: 3, params: undefined, response: paths['/safety/snapshot/{report_id}']['get']['responses']['200']['content']['application/json'] }
| { method: 'post', path: `/auth/account/create`, parts: 3, params: paths['/auth/account/create']['post']['requestBody']['content']['application/json'], response: undefined }
| { method: 'post', path: `/auth/account/reverify`, parts: 3, params: paths['/auth/account/reverify']['post']['requestBody']['content']['application/json'], response: undefined }
| { method: 'put', path: `/auth/account/delete`, parts: 3, params: paths['/auth/account/delete']['put']['requestBody']['content']['application/json'], response: undefined }
+210
View File
@@ -292,6 +292,14 @@ export interface paths {
/** Report a piece of content to the moderation team. */
post: operations["report_content_report_content"];
};
"/safety/reports": {
/** Fetch all available reports */
get: operations["fetch_reports_fetch_reports"];
};
"/safety/snapshot/{report_id}": {
/** Fetch a snapshot for a given report */
get: operations["fetch_snapshot_fetch_snapshot"];
};
"/auth/account/create": {
/** Create a new account. */
post: operations["create_account_create_account"];
@@ -678,6 +686,10 @@ export interface components {
/** @enum {string} */
type: "NotElevated";
}
| {
/** @enum {string} */
type: "NotPrivileged";
}
| {
/** @enum {string} */
type: "CannotGiveMissingPermissions";
@@ -2021,6 +2033,7 @@ export interface components {
/** @description Additional report description */
additional_context?: string;
};
/** @description The content being reported */
ReportedContent:
| {
/** @enum {string} */
@@ -2068,6 +2081,166 @@ export interface components {
| "Impersonation"
| "BanEvasion"
| "Underage";
/** @description User-generated platform moderation report. */
Report: (
| {
/** @enum {string} */
status: "Created";
}
| {
/** @enum {string} */
status: "Rejected";
rejection_reason: string;
}
| {
/** @enum {string} */
status: "Resolved";
}
) & {
/** @description Unique Id */
_id: string;
/** @description Id of the user creating this report */
author_id: string;
/** @description Reported content */
content: components["schemas"]["ReportedContent"];
/** @description Additional report context */
additional_context: string;
};
/** @description Snapshot of some content with required data to render */
SnapshotWithContext: {
/** @description Users involved in snapshot */
_users: components["schemas"]["User"][];
/** @description Channels involved in snapshot */
_channels: components["schemas"]["Channel"][];
/** @description Server involved in snapshot */
_server?: components["schemas"]["Server"] | null;
/** @description Unique Id */
_id: string;
/** @description Report parent Id */
report_id: string;
/** @description Snapshot of content */
content: components["schemas"]["SnapshotContent"];
};
/** @description Enum to map into different models that can be saved in a snapshot */
SnapshotContent:
| {
/** @enum {string} */
_type: "Message";
/**
* @description Context before the message
* @default
*/
_prior_context?: components["schemas"]["Message"][];
/**
* @description Context after the message
* @default
*/
_leading_context?: components["schemas"]["Message"][];
/** @description Unique Id */
_id: string;
/** @description Unique value generated by client sending this message */
nonce?: string | null;
/** @description Id of the channel this message was sent in */
channel: string;
/** @description Id of the user that sent this message */
author: string;
/** @description Message content */
content?: string | null;
/** @description System message */
system?: components["schemas"]["SystemMessage"] | null;
/** @description Array of attachments */
attachments?: components["schemas"]["File"][] | null;
/** @description Time at which this message was last edited */
edited?: components["schemas"]["ISO8601 Timestamp"] | null;
/** @description Attached embeds to this message */
embeds?: components["schemas"]["Embed"][] | null;
/** @description Array of user ids mentioned in this message */
mentions?: string[] | null;
/** @description Array of message ids this message is replying to */
replies?: string[] | null;
/** @description Hashmap of emoji IDs to array of user IDs */
reactions?: { [key: string]: string[] };
/** @description Information about how this message should be interacted with */
interactions?: components["schemas"]["Interactions"];
/** @description Name and / or avatar overrides for this message */
masquerade?: components["schemas"]["Masquerade"] | null;
}
| {
/** @enum {string} */
_type: "Server";
/** @description Unique Id */
_id: string;
/** @description User id of the owner */
owner: string;
/** @description Name of the server */
name: string;
/** @description Description for the server */
description?: string | null;
/** @description Channels within this server */
channels: string[];
/** @description Categories for this server */
categories?: components["schemas"]["Category"][] | null;
/** @description Configuration for sending system event messages */
system_messages?:
| components["schemas"]["SystemMessageChannels"]
| null;
/** @description Roles for this server */
roles?: { [key: string]: components["schemas"]["Role"] };
/**
* Format: int64
* @description Default set of server and channel permissions
*/
default_permissions: number;
/** @description Icon attachment */
icon?: components["schemas"]["File"] | null;
/** @description Banner attachment */
banner?: components["schemas"]["File"] | null;
/**
* Format: int32
* @description Enum of server flags
*/
flags?: number | null;
/** @description Whether this server is flagged as not safe for work */
nsfw?: boolean;
/** @description Whether to enable analytics */
analytics?: boolean;
/** @description Whether this server should be publicly discoverable */
discoverable?: boolean;
}
| {
/** @enum {string} */
_type: "User";
/** @description Unique Id */
_id: string;
/** @description Username */
username: string;
/** @description Avatar attachment */
avatar?: components["schemas"]["File"] | null;
/** @description Relationships with other users */
relations?: components["schemas"]["Relationship"][] | null;
/**
* Format: int32
* @description Bitfield of user badges
*/
badges?: number | null;
/** @description User's current status */
status?: components["schemas"]["UserStatus"] | null;
/** @description User's profile page */
profile?: components["schemas"]["UserProfile"] | null;
/**
* Format: int32
* @description Enum of user flags
*/
flags?: number | null;
/** @description Whether this user is privileged */
privileged?: boolean;
/** @description Bot information */
bot?: components["schemas"]["BotInformation"] | null;
/** @description Current session user's relationship with this user */
relationship?: components["schemas"]["RelationshipStatus"] | null;
/** @description Whether this user is currently online */
online?: boolean | null;
};
/** Error */
"Authifier Error":
| {
@@ -3953,6 +4126,43 @@ export interface operations {
};
};
};
/** Fetch all available reports */
fetch_reports_fetch_reports: {
responses: {
200: {
content: {
"application/json": components["schemas"]["Report"][];
};
};
/** An error occurred. */
default: {
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
/** Fetch a snapshot for a given report */
fetch_snapshot_fetch_snapshot: {
parameters: {
path: {
report_id: string;
};
};
responses: {
200: {
content: {
"application/json": components["schemas"]["SnapshotWithContext"];
};
};
/** An error occurred. */
default: {
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
/** Create a new account. */
create_account_create_account: {
responses: {
+3
View File
@@ -100,6 +100,9 @@ export type DataReportContent = components['schemas']['DataReportContent'];
export type ReportedContent = components['schemas']['ReportedContent'];
export type ContentReportReason = components['schemas']['ContentReportReason'];
export type UserReportReason = components['schemas']['UserReportReason'];
export type Report = components['schemas']['Report'];
export type SnapshotWithContext = components['schemas']['SnapshotWithContext'];
export type SnapshotContent = components['schemas']['SnapshotContent'];
export type Authifier_Error = components['schemas']['Authifier Error'];
export type DataCreateAccount = components['schemas']['DataCreateAccount'];
export type DataResendVerification = components['schemas']['DataResendVerification'];