edit actions and video stop

This commit is contained in:
Peter Maquiran
2023-12-13 16:44:29 +01:00
parent 5e8c4187fa
commit d2c1e100cc
13 changed files with 251 additions and 19 deletions
+99 -1
View File
@@ -1,5 +1,103 @@
export interface refreshToken {
export interface refreshTokenDTO {
Authorization: string,
refreshToken: null
}
export interface EventsDTO {
HasAttachments: boolean
IsAllDayEvent: boolean
EventId: string
Subject: string
Location: string
CalendarId: string
CalendarName: string
StartDate: string
EndDate: string
Schedule: string
RequiredAttendees: any
OptionalAttendees: any
HumanDate: string
TimeZone: string
IsPrivate: boolean
}
export interface EventDetailsDTO {
HasAttachments: boolean
EventComunicationId: number
EventId: string
Subject: string
Body: EventDetailsBody
Location: string
CalendarId: string
CalendarName: string
StartDate: string
EndDate: string
EventType: string
Attendees: EventDetailsAttendee[]
IsMeeting: boolean
IsRecurring: boolean
IsAllDayEvent: boolean
AppointmentState: number
TimeZone: string
Organizer: EventDetailsOrganizer
InstanceId: any
Category: string
EventRecurrence: EventDetailsEventRecurrence
Attachments: EventDetailsAttachment[]
IsPrivate: boolean
}
interface EventDetailsBodyDTO {
BodyType: number
Text: string
}
interface EventDetailsAttendee {
Id: number
EmailAddress: string
Name: string
IsRequired: boolean
UserType: string
IsPR: boolean
Entity: any
Acknowledgment: boolean
RoleDescription: any
}
interface EventDetailsOrganizer {
Id: number
EmailAddress: string
Name: string
IsRequired: boolean
UserType: any
IsPR: boolean
Entity: any
Acknowledgment: boolean
RoleDescription: any
}
interface EventDetailsEventRecurrence {
Type: number
Day: any
DayOfWeek: any
Month: any
LastOccurrence: any
}
interface EventDetailsAttachment {
Id: number
ParentId: string
Source: number
SourceId: string
Description: string
SourceName: string
CreateDate: string
Stakeholders: string
Link: string
Data: any
ApplicationId: number
FileSize: number
}
@@ -1,8 +1,16 @@
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpServiceService } from 'src/app/services/http/http-service.service';
import { Observable } from "rxjs";
import { refreshToken } from "./interface"
import { Observable} from 'rxjs';
import { EventsDTO, refreshTokenDTO } from "./interface";
import { HttpParams } from '@angular/common/http';
import { DetectCalendars, makeHeaderForCalendar } from '../../utils/utils';
import { z } from "zod";
import { ok, err } from 'neverthrow';
// let a = z
// let b = ok
@Injectable({
providedIn: 'root'
})
@@ -12,12 +20,42 @@ export class MiddlewareServiceService {
private HttpServiceService: HttpServiceService,
) {}
refreshToken(refreshToken: string): Observable<refreshToken> {
refreshToken(refreshToken: string): Observable<refreshTokenDTO> {
const data = {
refreshToken: refreshToken
}
return this.HttpServiceService.put(environment.apiURL + "UserAuthentication/RefreshToken", data, {})
// .pipe(
// map((response: HttpResponse<refreshToken>) => {
// return response.body
// })
// );
}
// ================================ Calendar =================================================
GetEvents(startDate: string, endDate: string, calendarId): Observable<EventsDTO[]> {
let geturl = environment.apiURL + 'calendar/GetEvents';
geturl = geturl.replace('/V4/', '/V5/')
let params = new HttpParams();
params = params.set("StartDate", startDate);
params = params.set("EndDate", endDate);
const calendar = DetectCalendars(calendarId)
const header = makeHeaderForCalendar(calendar)
let options = {
headers: header,
params: params
};
// return this.HttpServiceService.get<Event[]>(`${geturl}`, options);
return {} as any
}
}