seyfert/src/api/Routes/users.ts
David 017ccfc3bf
fix: github actions (#210)
* fix: github actions

* fix: pnpm version

* fix: github actions checkout

* fix: brackets in failure function

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* fix: github actions

* chore: apply formatting

* fix: github actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-14 14:23:58 -04:00

68 lines
2.2 KiB
TypeScript

import type {
APIDMChannel,
RESTDeleteAPIGuildResult,
RESTGetAPICurrentUserApplicationRoleConnectionResult,
RESTGetAPICurrentUserConnectionsResult,
RESTGetAPICurrentUserGuildsQuery,
RESTGetAPICurrentUserGuildsResult,
RESTGetAPICurrentUserResult,
RESTGetAPIUserResult,
RESTGetCurrentUserGuildMemberResult,
RESTPatchAPICurrentUserJSONBody,
RESTPatchAPICurrentUserResult,
RESTPostAPICurrentUserCreateDMChannelJSONBody,
RESTPutAPICurrentUserApplicationRoleConnectionJSONBody,
RESTPutAPICurrentUserApplicationRoleConnectionResult,
} from 'discord-api-types/v10';
import type { ProxyRequestMethod } from '../Router';
import type { RestArguments } from '../api';
export interface UserRoutes {
users: {
(
id: string,
): {
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIUserResult>;
};
(
id: '@me',
): {
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPICurrentUserResult>;
patch(
args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPICurrentUserJSONBody>,
): Promise<RESTPatchAPICurrentUserResult>;
guilds: {
get(
args?: RestArguments<ProxyRequestMethod.Get, RESTGetAPICurrentUserGuildsQuery>,
): Promise<RESTGetAPICurrentUserGuildsResult>;
(
id: string,
): {
member: {
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetCurrentUserGuildMemberResult>;
};
delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<RESTDeleteAPIGuildResult>;
};
};
channels: {
post(
args: RestArguments<ProxyRequestMethod.Post, RESTPostAPICurrentUserCreateDMChannelJSONBody>,
): Promise<APIDMChannel>;
};
connections: {
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPICurrentUserConnectionsResult>;
};
applications(applicationId: string): {
'role-connection': {
get(
args?: RestArguments<ProxyRequestMethod.Get>,
): Promise<RESTGetAPICurrentUserApplicationRoleConnectionResult>;
put(
args: RestArguments<ProxyRequestMethod.Put, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody>,
): Promise<RESTPutAPICurrentUserApplicationRoleConnectionResult>;
};
};
};
};
}