From ca674d7ab2ca76eba3ed0e66758f2f8d1c11386c Mon Sep 17 00:00:00 2001 From: DaStormer Date: Thu, 16 Mar 2023 21:08:47 -0400 Subject: [PATCH] fix lint --- .../lib/v1/structs/CalendarEvent.ts | 254 +++++++++--------- packages/rest/lib/webhook/WebhookClient.ts | 8 +- packages/rest/lib/webhook/WebhookEmbed.ts | 12 + 3 files changed, 146 insertions(+), 128 deletions(-) diff --git a/packages/guilded-api-typings/lib/v1/structs/CalendarEvent.ts b/packages/guilded-api-typings/lib/v1/structs/CalendarEvent.ts index 15b52ee1..8fb85d6a 100644 --- a/packages/guilded-api-typings/lib/v1/structs/CalendarEvent.ts +++ b/packages/guilded-api-typings/lib/v1/structs/CalendarEvent.ts @@ -1,137 +1,137 @@ import type { MentionsPayload } from "./Message"; export type CalendarEventCancellationPayload = { - /** - * The ID of the user who created this event cancellation - */ - createdBy?: string; - /** - * The description of event cancellation (min 1; max 140) - */ - description?: string; + /** + * The ID of the user who created this event cancellation + */ + createdBy?: string; + /** + * The description of event cancellation (min 1; max 140) + */ + description?: string; }; export type CalendarEventPayload = { - cancellation?: CalendarEventCancellationPayload; - /** - * The ID of the channel - */ - channelId: string; - /** - * The color of the event when viewed in the calendar (min 0; max 16777215) - */ - color?: number; - /** - * The ISO 8601 timestamp that the event was created at - */ - createdAt: string; - /** - * The ID of the user who created this event - */ - createdBy: string; - /** - * The description of the event length: (min 1; max 8000) - */ - description?: string; - /** - * The duration of the event IN MINUTES (min 1) - */ - duration?: number; - /** - * The ID of the calendar event - */ - id: number; - /** - * If the event has a limited view - */ - isPrivate?: boolean; - /** - * The location of the event - */ - location?: string; - mentions?: MentionsPayload; - /** - * The name of the event length: (min 1; max 60) - */ - name: string; - /** - * The number of rsvps to allow before waitlisting rsvps (min 1) - */ - rsvpLimit?: number; - /** - * Collection of fetched rsvps if cached - */ - rsvps?: CalendarEventRsvpPayload[]; - /** - * The ID of the server - */ - serverId: string; - /** - * The ID of the calendar event series. Only shows if the event is repeating - */ - seriesId?: string; - /** - * The role IDs to restrict the event to (min items 1; must have unique items true) - */ - roleIds?: number[]; - /** - * The ISO 8601 timestamp that the event starts at - */ - startsAt: string; - /** - * Whether this is a repeating event - */ - repeats?: boolean; - /** - * Whether this event lasts all day - */ - isAllDay?: boolean; - /** - * When rsvpLimit is set, users from the waitlist will be added as space becomes available in the event - */ - autofillWaitlist?: boolean; - /** - * A URL to associate with the event - */ - url?: string; + /** + * When rsvpLimit is set, users from the waitlist will be added as space becomes available in the event + */ + autofillWaitlist?: boolean; + cancellation?: CalendarEventCancellationPayload; + /** + * The ID of the channel + */ + channelId: string; + /** + * The color of the event when viewed in the calendar (min 0; max 16777215) + */ + color?: number; + /** + * The ISO 8601 timestamp that the event was created at + */ + createdAt: string; + /** + * The ID of the user who created this event + */ + createdBy: string; + /** + * The description of the event length: (min 1; max 8000) + */ + description?: string; + /** + * The duration of the event IN MINUTES (min 1) + */ + duration?: number; + /** + * The ID of the calendar event + */ + id: number; + /** + * Whether this event lasts all day + */ + isAllDay?: boolean; + /** + * If the event has a limited view + */ + isPrivate?: boolean; + /** + * The location of the event + */ + location?: string; + mentions?: MentionsPayload; + /** + * The name of the event length: (min 1; max 60) + */ + name: string; + /** + * Whether this is a repeating event + */ + repeats?: boolean; + /** + * The role IDs to restrict the event to (min items 1; must have unique items true) + */ + roleIds?: number[]; + /** + * The number of rsvps to allow before waitlisting rsvps (min 1) + */ + rsvpLimit?: number; + /** + * Collection of fetched rsvps if cached + */ + rsvps?: CalendarEventRsvpPayload[]; + /** + * The ID of the calendar event series. Only shows if the event is repeating + */ + seriesId?: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The ISO 8601 timestamp that the event starts at + */ + startsAt: string; + /** + * A URL to associate with the event + */ + url?: string; }; export type CalendarEventRsvpPayload = { - /** - * The ID of the calendar event - */ - calendarEventId: number; - /** - * The ID of the channel - */ - channelId: string; - /** - * The ISO 8601 timestamp that the rsvp was created at - */ - createdAt: string; - /** - * The ID of the user who created this rsvp - */ - createdBy: string; - id: string; - /** - * The ID of the server - */ - serverId: string; - /** - * The status of the rsvp ("going", "maybe", "declined", "invited", "waitlisted", or "not responded") - */ - status: string; - /** - * The ISO 8601 timestamp that the rsvp was updated at, if relevant - */ - updatedAt?: string; - /** - * The ID of the user who updated this rsvp - */ - updatedBy?: string; - /** - * The ID of the user - */ - userId: string; + /** + * The ID of the calendar event + */ + calendarEventId: number; + /** + * The ID of the channel + */ + channelId: string; + /** + * The ISO 8601 timestamp that the rsvp was created at + */ + createdAt: string; + /** + * The ID of the user who created this rsvp + */ + createdBy: string; + id: string; + /** + * The ID of the server + */ + serverId: string; + /** + * The status of the rsvp ("going", "maybe", "declined", "invited", "waitlisted", or "not responded") + */ + status: string; + /** + * The ISO 8601 timestamp that the rsvp was updated at, if relevant + */ + updatedAt?: string; + /** + * The ID of the user who updated this rsvp + */ + updatedBy?: string; + /** + * The ID of the user + */ + userId: string; }; diff --git a/packages/rest/lib/webhook/WebhookClient.ts b/packages/rest/lib/webhook/WebhookClient.ts index c9e358f6..55126d26 100644 --- a/packages/rest/lib/webhook/WebhookClient.ts +++ b/packages/rest/lib/webhook/WebhookClient.ts @@ -11,15 +11,21 @@ import { type MessageAttachment, type WebhookMessageContent, parseMessage, - transformEmbedToAPIEmbed } from "../util/message"; + transformEmbedToAPIEmbed, +} from "../util/message"; import type { WebhookEmbed } from "./WebhookEmbed"; export class WebhookClient { public URL: string; + public id: string; + public token: string; + public username: string | null; + public avatarURL: string | null; + private readonly rest: RestManager; public constructor( diff --git a/packages/rest/lib/webhook/WebhookEmbed.ts b/packages/rest/lib/webhook/WebhookEmbed.ts index b96d64bb..3ae44be0 100644 --- a/packages/rest/lib/webhook/WebhookEmbed.ts +++ b/packages/rest/lib/webhook/WebhookEmbed.ts @@ -3,29 +3,41 @@ import { resolveColor } from "../util/color"; export class WebhookEmbed { public title: string | null; + public description: string | null; + public url: string | null; + public timestamp: number | null; + public timestampString: string | null; + public color: number | null; + public footer: { iconURL: string | null; proxyIconURL: string | null; text: string; } | null; + public image: APIWebhookEmbedMediaData | null; + public thumbnail: APIWebhookEmbedMediaData | null; + public video: APIWebhookEmbedMediaData | null; + public provider: { name: string | null; url: string | null; } | null; + public author: { iconURL: string | null; name: string | null; proxyIconURL: string | null; url: string | null; } | null; + public fields: { inline: boolean | null; name: string;