Calendars

Methods and related types for `scrims.calendars`.

Calendars (scrims.calendars)

Table of Contents

Methods

Method Signature
fetch fetch(calendarId: string) => Promise<ScrimsCalendar>
fetchEvents fetchEvents(calendarId: string) => Promise<CalendarEventsResponse>
create create(data: CalendarCreateInput) => Promise<ScrimsCalendar | { calendar: ScrimsCalendar }>
fetchPublicCalendarsByMemberId fetchPublicCalendarsByMemberId(memberId: string) => Promise<PublicCalendarWithRoles[]>
update update(calendarId: string, data: JsonObject) => Promise<ScrimsCalendar>

Method Signatures

fetch

fetch(
  calendarId: string,
): Promise<ScrimsCalendar>

fetchEvents

fetchEvents(
  calendarId: string,
): Promise<CalendarEventsResponse>

create

create(
  data: CalendarCreateInput,
):
  Promise<ScrimsCalendar
    | {
          calendar: ScrimsCalendar;
        }>

fetchPublicCalendarsByMemberId

fetchPublicCalendarsByMemberId(
  memberId: string,
): Promise<PublicCalendarWithRoles[]>

update

update(
  calendarId: string,
  data: JsonObject,
): Promise<ScrimsCalendar>

Related Type References

JsonObject

type JsonObject = Record<string, unknown>;

ScrimsCalendar

type ScrimsCalendar = JsonObject
  & {
        _id?: string;
        owner_id?: string;
        title?: string;
        description?: string;
        icon_url?: string;
        cover_url?: string;
        host_roles?: string[];
        public?: boolean;
        default_event?: DefaultEvent;
        type?: string;
        extensions?: string[];
        meta?: JsonObject;
        parent_calendar?: string;
        sub_calendars_label?: string;
        main_calendar_label?: string;
        created_at?: string | Date;
        updated_at?: string | Date;
        active_for_me?: boolean;
        has_v2_access?: boolean;
        archived?: boolean;
      };

ScrimsEvent

type ScrimsEvent = JsonObject
  & {
        _id?: string;
        calendar?: string;
        owner_id?: string;
        start_time?: string | Date;
        end_time?: string | Date;
        start_timezone?: string;
        end_timezone?: string;
        is_all_day?: boolean;
        recurrence?: string[];
        recurrence_id?: string;
        title?: string;
        subheading?: string;
        remove_assigned_roles?: boolean;
        descriptions?: EventDescription;
        color?: string;
        image_url?: string;
        location_meta?: LocationMeta;
        allowed_roles?: string[];
        banned_roles?: string[];
        assign_roles?: string[];
        primarily_hosting?: boolean;
        archived?: boolean;
        no_further_occurrence?: boolean;
        discarded?: boolean;
        guest_can_edit?: boolean;
        is_private?: boolean;
        logs?: JsonObject[];
        etag?: string;
        notifications?: EventNotification[];
        send_notifications?: boolean;
        template?: string | null;
        tickets?: EventTicket[];
        emailTemplates?: EmailTemplates;
        general?: General;
        register?: Register;
        waitlist?: Waitlist;
        estimate_guest_count?: number;
        migration_overrides?: JsonObject;
        created_at?: string | Date;
        updated_at?: string | Date;
      };

ScrimsRole

type ScrimsRole = JsonObject
  & {
        _id?: string;
        name?: string;
        description?: string;
        permissions?: number | string;
        calendar?: string;
        color?: number;
        hoist?: boolean;
        icon?: string;
        managed?: boolean;
        mentionable?: boolean;
        rawPosition?: number;
        tags?: JsonObject;
        unicodeEmoji?: string;
        created_at?: string | Date;
        updated_at?: string | Date;
      };

DefaultEvent

type DefaultEvent = JsonObject
  & {
        allowed_roles?: string[];
        banned_roles?: string[];
        assign_roles?: string[];
        remove_assigned_roles?: boolean;
        descriptions?: EventDescription;
        duration?: boolean;
        primarily_hosting?: boolean;
        notifications?: EventNotification[];
        send_notifications?: boolean;
        created_at?: string | Date;
        updated_at?: string | Date;
      };

EventDescription

type EventDescription = JsonObject
  & {
        description?: string;
        objectives?: string[];
        specialNotes?: string[];
      };

EventNotification

type EventNotification = JsonObject
  & {
        message?: string;
        status?: number;
        before_in_minutes?: number;
        recipient?: string;
        ticket_type?: string;
      };

CustomQuestionValidation

type CustomQuestionValidation = JsonObject
  & {
        min_length?: number;
        max_length?: number;
        min_value?: number;
        max_value?: number;
        pattern?: string;
        custom_message?: string;
      };

CustomQuestion

type CustomQuestion = JsonObject
  & {
        _id?: string;
        question?: string;
        type?: string;
        required?: boolean;
        placeholder?: string;
        options?: string[];
        validation?: CustomQuestionValidation;
        help_text?: string;
        icon?: string;
        order?: number;
      };

RegistrationDeadline

type RegistrationDeadline = JsonObject
  & {
        days?: number;
        hours?: number;
        minutes?: number;
      };

General

type General = JsonObject
  & {
        allow_multiple_hosts?: boolean;
        allow_multiple_specs?: boolean;
        add_creator_as_host?: boolean;
        enable_tickets?: boolean;
        enable_registration_deadline?: boolean;
        total_capacity?: number;
        specs_label?: string;
        ticket_label?: string;
        host_label?: string;
        invited_label?: string;
        confirmed_label?: string;
        late_label?: string;
        tentative_label?: string;
        absence_label?: string;
        kicked_label?: string;
        ticket_icon?: string;
        invited_icon?: string;
        confirmed_icon?: string;
        late_icon?: string;
        tentative_icon?: string;
        absence_icon?: string;
        kicked_icon?: string;
        host_icon?: string;
        empty_icon?: string;
        signups_icon?: string;
        countdown_icon?: string;
        static_icon?: string;
        reset_specs_icon?: string;
        enable_bundles?: boolean;
        members_only?: boolean;
        allow_multiple_ticket?: boolean;
        registration_deadline?: RegistrationDeadline;
      };

LocationMeta

type LocationMeta = JsonObject
  & {
        address?: string;
        link?: string;
        type?: string;
      };

Register

type Register = JsonObject
  & {
        show_form?: boolean;
        custom_questions?: CustomQuestion[];
      };

Waitlist

type Waitlist = JsonObject
  & {
        waitlist_enabled?: boolean;
        waitlist_label?: string;
        waitlist_icon?: string;
        waitlist_message?: string;
        waitlist_time?: string;
        waitlist_threshold?: number;
        waitlist_max_capacity?: number;
        open_waitlist_if?: string[];
      };

EmailTemplates

type EmailTemplates = JsonObject
  & {
        accept_join_request?: string;
        decline_join_request?: string;
        invite_guests?: string;
        reminder?: string;
        cancellation?: string;
      };

TicketTag

type TicketTag = JsonObject
  & {
        name?: string;
        icon?: string;
      };

Fee

type Fee = JsonObject
  & {
        high?: number;
        low?: number;
        discount?: number;
        offer?: string;
        currency?: string;
        tax?: number;
      };

SalesPeriod

type SalesPeriod = JsonObject
  & {
        sales_start?: string | Date;
        sales_end?: string | Date;
        timezone?: string;
        utc?: string | Date;
      };

Capacity

type Capacity = JsonObject
  & {
        max_quantity_per_order?: number;
        min_quantity_per_order?: number;
        quantity_required?: number;
        max_quantity?: number;
        quantity_remaining?: number;
      };

Refunds

type Refunds = JsonObject
  & {
        allowed?: boolean;
        processed_by?: string;
      };

BoosterOverrides

type BoosterOverrides = JsonObject
  & {
        sales_period?: JsonObject;
        fee?: JsonObject;
        requires_approval?: boolean;
      };

EventTicket

type EventTicket = JsonObject
  & {
        _id?: string;
        name?: string;
        description?: string;
        color?: string;
        icon?: string;
        image?: string;
        ticket_specs?: TicketSpec[];
        ticket_tags?: TicketTag[];
        fee?: Fee;
        sales_period?: SalesPeriod;
        capacity?: Capacity;
        requires_approval?: boolean;
        refunds?: Refunds;
        booster_overrides?: BoosterOverrides;
      };

TicketSpec

type TicketSpec = JsonObject
  & {
        name?: string;
        icon?: string;
        color?: string;
        description?: string;
        max_capacity?: number;
      };

CalendarCreateInput

type CalendarCreateInput = JsonObject
  & {
        title: string;
        icon_url: string;
      };

CalendarEventsResponse

type CalendarEventsResponse = {
    events: ScrimsEvent[];
  }
  & JsonObject;

PublicCalendarWithRoles

type PublicCalendarWithRoles = ScrimsCalendar
  & {
        roles?: ScrimsRole[];
      };