seyfert/src/api/Routes/users.ts
MARCROCK22 13b8a32d42
fix rest types, collectors update, improve types (#266)
* feat: ctx types, delete threads cache, cache.channels.threads, changes to collectors, fix rest types

* fix: use apithreadchannel instead

* feat: revert threads relationship, fix collectors

* fix: cache thread when creating

* fix: unused

* feat: entitlement trasnformer

* fix: non-null assertion

* fix: circular?

* fix: collector onStop reason type

* fix: types

* feat: onPass method

* fix: undefined value
2024-09-27 22:08:50 -05:00

59 lines
1.9 KiB
TypeScript

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