Skip to content

Commit

Permalink
ES Lint Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcameron1231 committed Feb 19, 2024
1 parent 0de49be commit 35803ab
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 123 deletions.
8 changes: 4 additions & 4 deletions packages/graph/attachments/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ export const Attachment = graphInvokableFactory<IAttachment>(_Attachment);
export class _Attachments extends _GraphCollection<IAttachmentType[]> {

// TODO: Adding attachments is not implemented correctly. I believe it requires updating the parent item but needs further investigation.

/**
* Add attachment to this collection
*
* @param attachmentInfo Attachment properties
* @param bytes File content
*/
public addFile(attachmentInfo:IAttachmentType, bytes:string | Blob): Promise<IAttachmentType> {
public addFile(attachmentInfo: IAttachmentType, bytes: string | Blob): Promise<IAttachmentType> {

return graphPost(GraphInstance(this), body(type("#microsoft.graph.fileAttachment", {
contentBytes: bytes,
...attachmentInfo
...attachmentInfo,
})));
}

}
export interface IAttachments extends _Attachments, IGetById<IAttachment> {}
export const Attachments = graphInvokableFactory<IAttachments>(_Attachments);
11 changes: 9 additions & 2 deletions packages/graph/calendars/funcs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { body } from "@pnp/queryable/index.js";
import { IGraphQueryable, GraphCollection, IGraphCollection, IGraphInstance, graphPost } from "../graphqueryable.js";
import { EmailAddress, Event as IEvent, Reminder as IReminder, MeetingTimeSuggestionsResult, LocationConstraint, TimeConstraint, AttendeeBase} from "@microsoft/microsoft-graph-types";
import {
EmailAddress,
Event as IEvent,
Reminder as IReminder,
MeetingTimeSuggestionsResult,
LocationConstraint, TimeConstraint,
AttendeeBase,
} from "@microsoft/microsoft-graph-types";
import { CalendarView, ICalendarView } from "./types.js";

interface IEventWithTag extends IEvent {
Expand Down Expand Up @@ -86,4 +93,4 @@ export function reminderView(this: IGraphQueryable, start: string, end: string):
return query;
}

export type IReminderInfo = IReminder;
export type IReminderInfo = IReminder;
2 changes: 1 addition & 1 deletion packages/graph/calendars/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ declare module "../groups/types" {

addProp(_Group, "calendar", Calendar);
addProp(_Group, "events", Events);
_Group.prototype.calendarView = calendarView;
_Group.prototype.calendarView = calendarView;
35 changes: 21 additions & 14 deletions packages/graph/calendars/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { body } from "@pnp/queryable";
import { Event as IEventType, Calendar as ICalendarType, CalendarGroup as ICalendarGroupType, CalendarPermission as ICalendarPermissionType, ScheduleInformation as IScheduleInformationType, DateTimeTimeZone as IDateTimeTimeZoneType, Recipient, TimeSlot, } from "@microsoft/microsoft-graph-types";
import {
Event as IEventType,
Calendar as ICalendarType,
CalendarGroup as ICalendarGroupType,
CalendarPermission as ICalendarPermissionType,
ScheduleInformation as IScheduleInformationType,
DateTimeTimeZone as IDateTimeTimeZoneType,
Recipient,
TimeSlot,
} from "@microsoft/microsoft-graph-types";
import { GraphQueryable, IGraphQueryable, _GraphCollection, _GraphInstance, _GraphQueryable, graphInvokableFactory, graphPost } from "../graphqueryable.js";
import { defaultPath, IDeleteable, deleteable, IUpdateable, updateable, getById, IGetById, IAddable, addable } from "../decorators.js";
import { calendarView, instances, reminderView } from "./funcs.js";
import { calendarView, instances } from "./funcs.js";

/**
* Calendar
Expand All @@ -11,6 +20,8 @@ import { calendarView, instances, reminderView } from "./funcs.js";
@updateable()
export class _Calendar extends _GraphInstance<ICalendarType> {

public calendarView = calendarView;

public get calendarPermissions(): ICalendarPermissions {
return CalendarPermissions(this);
}
Expand All @@ -26,9 +37,6 @@ export class _Calendar extends _GraphInstance<ICalendarType> {
public async getSchedule(properties: IGetScheduleRequest): Promise<IScheduleInformationType[]> {
return graphPost(Calendar(this, "getSchedule"), body(properties));
}

public calendarView = calendarView;

}
export interface ICalendar extends _Calendar, IUpdateable<ICalendarType>, IDeleteable { }
export const Calendar = graphInvokableFactory<ICalendar>(_Calendar);
Expand All @@ -52,28 +60,28 @@ export class _CalendarView extends _GraphCollection<IEventType[]> {
this.query.set("startDateTime", start);
this.query.set("endDateTime", end);
}

public async delta(token?: string): Promise<IEventType[]> {
return graphPost(GraphQueryable(this, `delta?${this.query}`), body({ token }));
}
}
export interface ICalendarView extends _CalendarView { }
export const CalendarView = (baseUrl: string | IGraphQueryable, start: string, end: string): _CalendarView => new _CalendarView(baseUrl, start, end);
//export const CalendarView = graphInvokableFactory<ICalendarView>(_CalendarView);

/**
* Event
*/
@deleteable()
@updateable()
export class _Event extends _GraphInstance<IEventType> {
public instances = instances;

public async accept(comment?: string, sendResponse?: boolean): Promise<void> {
return graphPost(Event(this, "accept"), body({ comment, sendResponse }));
}

public async cancel(comment?: string): Promise<void> {
return graphPost(Event(this, "cancel"));
return graphPost(Event(this, "cancel"), body({ comment }));
}

public async decline(comment?: string, sendResponse?: boolean, proposedNewTime?: TimeSlot): Promise<void> {
Expand Down Expand Up @@ -102,7 +110,6 @@ export class _Event extends _GraphInstance<IEventType> {
return graphPost(Event(this, "tentativelyAccept"), body({ comment, sendResponse, proposedNewTime }));
}

public instances = instances;
}
export interface IEvent extends _Event, IDeleteable, IUpdateable { }
export const Event = graphInvokableFactory<IEvent>(_Event);
Expand All @@ -123,10 +130,10 @@ export const Events = graphInvokableFactory<IEvents>(_Events);
@deleteable()
@updateable()
export class _CalendarGroup extends _GraphInstance<ICalendarGroupType> {
public get calendars(): ICalendars {
return Calendars(this);
}

public get calendars(): ICalendars {
return Calendars(this);
}
}
export interface ICalendarGroup extends _CalendarGroup, IDeleteable, IUpdateable { }
export const CalendarGroup = graphInvokableFactory<ICalendarGroup>(_CalendarGroup);
Expand Down Expand Up @@ -178,4 +185,4 @@ export interface IGetScheduleRequest {
startTime: IDateTimeTimeZoneType;
endTime: IDateTimeTimeZoneType;
availabilityViewInterval?: number;
}
}
Loading

0 comments on commit 35803ab

Please sign in to comment.