Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zaida04 committed May 29, 2024
1 parent f4a2aba commit 10b3ce9
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 419 deletions.
3 changes: 1 addition & 2 deletions packages/api/lib/generated/api-typings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export type JSON<T extends JSONContent> = T["application/json"];

export type WSSchema<T extends keyof components["schemas"]> = components["schemas"][T];
export type WSContent = { content: JSONContent };
export type WSPayload<T extends keyof components["responses"]> =
components["responses"][T]["content"]["application/json"];
export type WSPayload<T extends keyof components["responses"]> = components["responses"][T]["content"]["application/json"];
export type WSPacket<T extends keyof components["responses"]> = SkeletonWSPayload & { d: WSPayload<T> };
8 changes: 2 additions & 6 deletions packages/api/lib/generated/api-typings/v1/structs/Webhook.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export type WebhookContentPayload = {
botId:
| string
| null;
botId: string | null;
channelId: string;
content: APIContent;
createdAt: string;
Expand All @@ -18,9 +16,7 @@ export type APIContent = {

type APILeaf = {
marks: APIMark[];
object:
| string
| "leaf";
object: string | "leaf";
text: string;
};

Expand Down
8 changes: 1 addition & 7 deletions packages/api/lib/generated/api-typings/v1/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ export type RESTPostWebhookBody = {
avatar_url?: string;
content?: string;
embeds?: APIEmbed[];
payload_json?: Pick<
RESTPostWebhookBody,
| "avatar_url"
| "content"
| "embeds"
| "username"
>;
payload_json?: Pick<RESTPostWebhookBody, "avatar_url" | "content" | "embeds" | "username">;
username?: string;
};

Expand Down
73 changes: 10 additions & 63 deletions packages/api/lib/generated/api-typings/v1/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ export type components = {
* @description An operation code corresponding to the nature of the sent message (for example, success, failure, etc.)
* @enum {integer}
*/
op:
| 0
| 1
| 2
| 8
| 9;
op: 0 | 1 | 2 | 8 | 9;
/**
* Data
*
* @description Data of any form depending on the underlying event
*/
d?: Record<
string,
never
>;
d?: Record<string, never>;
/**
* Message ID
*
Expand Down Expand Up @@ -110,9 +102,7 @@ export type components = {
* @description The type of chat message. "system" messages are generated by Guilded, while "default" messages are user or bot-generated.
* @enum {string}
*/
type:
| "default"
| "system";
type: "default" | "system";
/**
* Server ID
*
Expand Down Expand Up @@ -369,20 +359,7 @@ export type components = {
* @description The type of social link that Guilded supports. Depending on this value, `handle` or `serviceId` may or may not be present
* @enum {string}
*/
type:
| "bnet"
| "epic"
| "facebook"
| "origin"
| "patreon"
| "psn"
| "roblox"
| "steam"
| "switch"
| "twitch"
| "twitter"
| "xbox"
| "youtube";
type: "bnet" | "epic" | "facebook" | "origin" | "patreon" | "psn" | "roblox" | "steam" | "switch" | "twitch" | "twitter" | "xbox" | "youtube";
/**
* User ID
*
Expand Down Expand Up @@ -1274,9 +1251,7 @@ export type components = {
* @description The type of user. If this property is absent, it can assumed to be of type `user`
* @enum {string}
*/
type?:
| "bot"
| "user";
type?: "bot" | "user";
/**
* User name
*
Expand Down Expand Up @@ -1325,9 +1300,7 @@ export type components = {
* @description The type of user. If this property is absent, it can assumed to be of type `user`
* @enum {string}
*/
type?:
| "bot"
| "user";
type?: "bot" | "user";
/**
* User name
*
Expand Down Expand Up @@ -1400,17 +1373,7 @@ export type components = {
* @description The type of channel. This will determine what routes to use for creating content in a channel. For example, if this "chat", then one must use the routes for creating channel messages
* @enum {string}
*/
type:
| "announcements"
| "calendar"
| "chat"
| "docs"
| "forums"
| "list"
| "media"
| "scheduling"
| "stream"
| "voice";
type: "announcements" | "calendar" | "chat" | "docs" | "forums" | "list" | "media" | "scheduling" | "stream" | "voice";
/** @description The name of the channel */
name: string;
/** @description The topic of the channel */
Expand Down Expand Up @@ -1509,15 +1472,7 @@ export type components = {
* @description The type of server designated from the server's settings page
* @enum {string}
*/
type?:
| "clan"
| "community"
| "friends"
| "guild"
| "organization"
| "other"
| "streaming"
| "team";
type?: "clan" | "community" | "friends" | "guild" | "organization" | "other" | "streaming" | "team";
/**
* Server name
*
Expand Down Expand Up @@ -1864,13 +1819,7 @@ export type components = {
* @description The status of the RSVP
* @enum {string}
*/
status:
| "declined"
| "going"
| "invited"
| "maybe"
| "not responded"
| "waitlisted";
status: "declined" | "going" | "invited" | "maybe" | "not responded" | "waitlisted";
/**
* Created by
*
Expand Down Expand Up @@ -2461,9 +2410,7 @@ export type components = {
*
* @description The nickname that was just updated for the user
*/
nickname?:
| string
| null;
nickname?: string | null;
};
};
};
Expand Down
171 changes: 29 additions & 142 deletions packages/api/lib/generated/router/GuildedRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,148 +63,35 @@ export class GuildedRouter {

public readonly request: BaseHttpRequest;

constructor(
rest: RestManager,
) {
this.request =
new FetchHttpRequest(
rest,
);
constructor(rest: RestManager) {
this.request = new FetchHttpRequest(rest);

this.announcementComments =
new AnnouncementCommentsService(
this
.request,
);
this.announcements =
new AnnouncementsService(
this
.request,
);
this.calendarEventComments =
new CalendarEventCommentsService(
this
.request,
);
this.calendarEvents =
new CalendarEventsService(
this
.request,
);
this.calendarEventSeries =
new CalendarEventSeriesService(
this
.request,
);
this.categories =
new CategoriesService(
this
.request,
);
this.channels =
new ChannelsService(
this
.request,
);
this.chat =
new ChatService(
this
.request,
);
this.docComments =
new DocCommentsService(
this
.request,
);
this.docs =
new DocsService(
this
.request,
);
this.forumComments =
new ForumCommentsService(
this
.request,
);
this.forums =
new ForumsService(
this
.request,
);
this.groupMembership =
new GroupMembershipService(
this
.request,
);
this.groups =
new GroupsService(
this
.request,
);
this.listItems =
new ListItemsService(
this
.request,
);
this.memberBans =
new MemberBansService(
this
.request,
);
this.members =
new MembersService(
this
.request,
);
this.reactions =
new ReactionsService(
this
.request,
);
this.roleMembership =
new RoleMembershipService(
this
.request,
);
this.roles =
new RolesService(
this
.request,
);
this.servers =
new ServersService(
this
.request,
);
this.serverXp =
new ServerXpService(
this
.request,
);
this.socialLinks =
new SocialLinksService(
this
.request,
);
this.users =
new UsersService(
this
.request,
);
this.userStatus =
new UserStatusService(
this
.request,
);
this.webhook =
new WebhookService(
this
.request,
);
this.serverSubscriptions =
new ServerSubscriptionService(
this
.request,
);
this.announcementComments = new AnnouncementCommentsService(this.request);
this.announcements = new AnnouncementsService(this.request);
this.calendarEventComments = new CalendarEventCommentsService(this.request);
this.calendarEvents = new CalendarEventsService(this.request);
this.calendarEventSeries = new CalendarEventSeriesService(this.request);
this.categories = new CategoriesService(this.request);
this.channels = new ChannelsService(this.request);
this.chat = new ChatService(this.request);
this.docComments = new DocCommentsService(this.request);
this.docs = new DocsService(this.request);
this.forumComments = new ForumCommentsService(this.request);
this.forums = new ForumsService(this.request);
this.groupMembership = new GroupMembershipService(this.request);
this.groups = new GroupsService(this.request);
this.listItems = new ListItemsService(this.request);
this.memberBans = new MemberBansService(this.request);
this.members = new MembersService(this.request);
this.reactions = new ReactionsService(this.request);
this.roleMembership = new RoleMembershipService(this.request);
this.roles = new RolesService(this.request);
this.servers = new ServersService(this.request);
this.serverXp = new ServerXpService(this.request);
this.socialLinks = new SocialLinksService(this.request);
this.users = new UsersService(this.request);
this.userStatus = new UserStatusService(this.request);
this.webhook = new WebhookService(this.request);
this.serverSubscriptions = new ServerSubscriptionService(this.request);
}
}
28 changes: 8 additions & 20 deletions packages/api/lib/generated/router/core/ApiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@ export class ApiError extends Error {
public readonly body: any;
public readonly request: ApiRequestOptions;

constructor(
request: ApiRequestOptions,
response: ApiResult,
message: string,
) {
super(
message,
);
constructor(request: ApiRequestOptions, response: ApiResult, message: string) {
super(message);

this.name =
"ApiError";
this.url =
response.url;
this.status =
response.status;
this.statusText =
response.statusText;
this.body =
response.body;
this.request =
request;
this.name = "ApiError";
this.url = response.url;
this.status = response.status;
this.statusText = response.statusText;
this.body = response.body;
this.request = request;
}
}
Loading

0 comments on commit 10b3ce9

Please sign in to comment.