# Class JCalendarApi

#### Hierarchy (View Summary)

- JBaseApi
  - JCalendarApi

- Defined in jamespot-user-api/src/apis/calendar/calendar.ts:15

##### Index

### Constructors

constructor

### Properties

jApi
network

### Methods

getEvents
getLastEvents
listEvents
reviveSubmit
transformOccurrenceIntoEvent

## Constructors

### constructor

- new JCalendarApi(jApi: JamespotUserApi): JCalendarApi

  #### Parameters

  - jApi: JamespotUserApi

  #### Returns JCalendarApi

  Inherited from JBaseApi.constructor

  - Defined in jamespot-user-api/src/apis/base.ts:8

## Properties

### jApi

jApi: JamespotUserApi

Inherited from JBaseApi.jApi

- Defined in jamespot-user-api/src/apis/base.ts:5

### network

network: Network

Inherited from JBaseApi.network

- Defined in jamespot-user-api/src/apis/base.ts:6

## Methods

### getEvents

- getEvents(
  params: {
  end?: string;
  idArticle?: number;
  idSpot?: number;
  mode?: "user" | "spot";
  start?: string;
  },
  ): Promise<
  ApiWrapper<
  {
  backgroundColor?: string;
  bgColor?: string;
  color?: string;
  end: string;
  idArticle: number;
  start: string;
  subscribe: boolean;
  textColor?: string;
  title: string;
  url: string;
  }[],
  BaseMessages,
  >,
  >

  #### Parameters

  - params: {
    end?: string;
    idArticle?: number;
    idSpot?: number;
    mode?: "user" | "spot";
    start?: string;
    }

  #### Returns Promise<
  ApiWrapper<
  {
  backgroundColor?: string;
  bgColor?: string;
  color?: string;
  end: string;
  idArticle: number;
  start: string;
  subscribe: boolean;
  textColor?: string;
  title: string;
  url: string;
  }[],
  BaseMessages,
  >,
  >

  #### Deprecated

  Use `getEventsV2` instead.

  - Defined in jamespot-user-api/src/apis/calendar/calendar.ts:19

### getLastEvents

- getLastEvents(
  params: {
  format?: Format;
  limit?: number;
  page?: number;
  uriContext?: string;
  },
  ): Promise<ApiWrapper<CalendarCombinedEventsList[], BaseMessages>>

  #### Parameters

  - params: { format?: Format; limit?: number; page?: number; uriContext?: string }

  #### Returns Promise<ApiWrapper<CalendarCombinedEventsList[], BaseMessages>>

  - Defined in jamespot-user-api/src/apis/calendar/calendar.ts:53

### listEvents

- listEvents<T extends CalendarEventList = CalendarEventList>(
  params: {
  dateEnd: string;
  dateStart: string;
  spotId?: number;
  statuses?: ("subscribed" | "unanswered" | "refused")[];
  types?: string[];
  },
  options?: {
  format?: "raw-little" | "raw-list" | "raw-view";
  signal?: AbortSignal;
  },
  ): Promise<
  ApiWrapper<
  CalendarEventWithExtensions<
  T,
  ["socialEventRecord", "recurringEventRecord"],
  >[],
  BaseMessages,
  >,
  >

  #### Type Parameters

  - T extends CalendarEventList = CalendarEventList

  #### Parameters

  - params: {
    dateEnd: string;
    dateStart: string;
    spotId?: number;
    statuses?: ("subscribed" | "unanswered" | "refused")[];
    types?: string[];
    }
  - `Optional` options: { format?: "raw-little" | "raw-list" | "raw-view"; signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  CalendarEventWithExtensions<
  T,
  ["socialEventRecord", "recurringEventRecord"],
  >[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/calendar/calendar.ts:29

### reviveSubmit

- reviveSubmit(
  params: {
  idArticle: number;
  list:
  | "unit"
  | "onSpot"
  | "visio"
  | "available"
  | "unavailable"
  | "presence"
  | "refused"
  | "all"
  | "waiting";
  text: string;
  userURI?: string;
  },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - params: {
    idArticle: number;
    list:
    | "unit"
    | "onSpot"
    | "visio"
    | "available"
    | "unavailable"
    | "presence"
    | "refused"
    | "all"
    | "waiting";
    text: string;
    userURI?: string;
    }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/calendar/calendar.ts:81

### transformOccurrenceIntoEvent

- transformOccurrenceIntoEvent<
  P extends
  {
  address?: string
  | null;
  allDay?: boolean;
  bgColor?: string | null;
  dateEnd: string;
  dateStart: string;
  description?: string;
  hideFromCalendar?: boolean;
  noGestion?: boolean;
  place?: string | null;
  publishTo?: string;
  socialEventCeiling?: number | null;
  socialEventUseCeiling?: boolean;
  textColor?: string | null;
  title: string;
  token: string;
  type: "socialEvent";
  uiObjectLink?: string;
  urlGestion?: string;
  useQrcode?: boolean;
  } & { alertAuthor?: "0"
  | "1"; idDraft?: number; sendAlert?: "0" | "1" } = {
  address?: string | null;
  allDay?: boolean;
  bgColor?: string | null;
  dateEnd: string;
  dateStart: string;
  description?: string;
  hideFromCalendar?: boolean;
  noGestion?: boolean;
  place?: string | null;
  publishTo?: string;
  socialEventCeiling?: number | null;
  socialEventUseCeiling?: boolean;
  textColor?: string | null;
  title: string;
  token: string;
  type: "socialEvent";
  uiObjectLink?: string;
  urlGestion?: string;
  useQrcode?: boolean;
  } & { alertAuthor?: "0"
  | "1"; idDraft?: number; sendAlert?: "0" | "1" },
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = VIEW,
  E extends ArticleFormatsExtension = [],
  >(
  payload: P & { hiddenOccurrenceDateTime: string },
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): PromiseApiWrapper<ArticleReturn<F, "socialEvent", E>>

  #### Type Parameters

  - P extends {
    address?: string | null;
    allDay?: boolean;
    bgColor?: string | null;
    dateEnd: string;
    dateStart: string;
    description?: string;
    hideFromCalendar?: boolean;
    noGestion?: boolean;
    place?: string | null;
    publishTo?: string;
    socialEventCeiling?: number | null;
    socialEventUseCeiling?: boolean;
    textColor?: string | null;
    title: string;
    token: string;
    type: "socialEvent";
    uiObjectLink?: string;
    urlGestion?: string;
    useQrcode?: boolean;
    } & { alertAuthor?: "0"
    | "1"; idDraft?: number; sendAlert?: "0" | "1" } = {
    address?: string | null;
    allDay?: boolean;
    bgColor?: string | null;
    dateEnd: string;
    dateStart: string;
    description?: string;
    hideFromCalendar?: boolean;
    noGestion?: boolean;
    place?: string | null;
    publishTo?: string;
    socialEventCeiling?: number | null;
    socialEventUseCeiling?: boolean;
    textColor?: string | null;
    title: string;
    token: string;
    type: "socialEvent";
    uiObjectLink?: string;
    urlGestion?: string;
    useQrcode?: boolean;
    } & { alertAuthor?: "0"
    | "1"; idDraft?: number; sendAlert?: "0" | "1" }
  - F extends "raw-little" | "raw-list" | "raw-view" = VIEW
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: P & { hiddenOccurrenceDateTime: string }
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns PromiseApiWrapper<ArticleReturn<F, "socialEvent", E>>

  - Defined in jamespot-user-api/src/apis/calendar/calendar.ts:62