@eliasrrosa/tutorhub-public-assets 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/AsaasCustomer.d.ts +14 -0
- package/dist/entities/AsaasCustomer.js +13 -0
- package/dist/entities/Class.d.ts +79 -0
- package/dist/entities/Class.js +30 -0
- package/dist/entities/ClassRequest.d.ts +15 -0
- package/dist/entities/ClassRequest.js +2 -0
- package/dist/entities/Contract.d.ts +40 -0
- package/dist/entities/Contract.js +2 -0
- package/dist/entities/Course.d.ts +34 -0
- package/dist/entities/Course.js +2 -0
- package/dist/entities/CourseToSchoolConnectionRequest.d.ts +10 -0
- package/dist/entities/CourseToSchoolConnectionRequest.js +2 -0
- package/dist/entities/Date.d.ts +56 -0
- package/dist/entities/Date.js +2 -0
- package/dist/entities/Date.test.d.ts +0 -0
- package/dist/entities/Date.test.js +23 -0
- package/dist/entities/DateTimeSlot.d.ts +6 -0
- package/dist/entities/DateTimeSlot.js +2 -0
- package/dist/entities/DateValidator.d.ts +3 -0
- package/dist/entities/DateValidator.js +2 -0
- package/dist/entities/File.d.ts +23 -0
- package/dist/entities/File.js +2 -0
- package/dist/entities/FreeTimeSlot.d.ts +19 -0
- package/dist/entities/FreeTimeSlot.js +12 -0
- package/dist/entities/GenericNotification.d.ts +11 -0
- package/dist/entities/GenericNotification.js +2 -0
- package/dist/entities/GoogleAuth.d.ts +8 -0
- package/dist/entities/GoogleAuth.js +2 -0
- package/dist/entities/GoogleCalendar.d.ts +10 -0
- package/dist/entities/GoogleCalendar.js +2 -0
- package/dist/entities/GoogleCalendarEvent.d.ts +10 -0
- package/dist/entities/GoogleCalendarEvent.js +2 -0
- package/dist/entities/ISO8601Date.d.ts +35 -0
- package/dist/entities/ISO8601Date.js +86 -0
- package/dist/entities/ISO8601Date.test.d.ts +1 -0
- package/dist/entities/ISO8601Date.test.js +210 -0
- package/dist/entities/ISO8601DateTime.d.ts +41 -0
- package/dist/entities/ISO8601DateTime.js +44 -0
- package/dist/entities/ISO8601DateTime.test.d.ts +1 -0
- package/dist/entities/ISO8601DateTime.test.js +146 -0
- package/dist/entities/ISO8601DateValidator.d.ts +13 -0
- package/dist/entities/ISO8601DateValidator.js +20 -0
- package/dist/entities/ISO8601DateValidator.test.d.ts +1 -0
- package/dist/entities/ISO8601DateValidator.test.js +15 -0
- package/dist/entities/ISO8601Time.d.ts +25 -0
- package/dist/entities/ISO8601Time.js +57 -0
- package/dist/entities/ISO8601Time.test.d.ts +1 -0
- package/dist/entities/ISO8601Time.test.js +63 -0
- package/dist/entities/ISO8601TimeValidator.d.ts +12 -0
- package/dist/entities/ISO8601TimeValidator.js +19 -0
- package/dist/entities/ISO8601TimeValidator.test.d.ts +1 -0
- package/dist/entities/ISO8601TimeValidator.test.js +42 -0
- package/dist/entities/PasswordRecovery.d.ts +6 -0
- package/dist/entities/PasswordRecovery.js +2 -0
- package/dist/entities/Payment.d.ts +42 -0
- package/dist/entities/Payment.js +2 -0
- package/dist/entities/PaymentRecognitionRequest.d.ts +12 -0
- package/dist/entities/PaymentRecognitionRequest.js +2 -0
- package/dist/entities/PreApprovedUser.d.ts +12 -0
- package/dist/entities/PreApprovedUser.js +2 -0
- package/dist/entities/RescheduleRequest.d.ts +16 -0
- package/dist/entities/RescheduleRequest.js +2 -0
- package/dist/entities/School.d.ts +31 -0
- package/dist/entities/School.js +2 -0
- package/dist/entities/SchoolConnection.d.ts +10 -0
- package/dist/entities/SchoolConnection.js +2 -0
- package/dist/entities/SchoolConnectionRequest.d.ts +7 -0
- package/dist/entities/SchoolConnectionRequest.js +2 -0
- package/dist/entities/SchoolStudent.d.ts +14 -0
- package/dist/entities/SchoolStudent.js +2 -0
- package/dist/entities/SchoolTeacher.d.ts +14 -0
- package/dist/entities/SchoolTeacher.js +2 -0
- package/dist/entities/Time.d.ts +9 -0
- package/dist/entities/Time.js +2 -0
- package/dist/entities/TimeSlot.d.ts +4 -0
- package/dist/entities/TimeSlot.js +2 -0
- package/dist/entities/TimeValidator.d.ts +3 -0
- package/dist/entities/TimeValidator.js +2 -0
- package/dist/entities/UnauthorizedUser.d.ts +16 -0
- package/dist/entities/UnauthorizedUser.js +2 -0
- package/dist/entities/UserAuth.d.ts +72 -0
- package/dist/entities/UserAuth.js +2 -0
- package/dist/entities/UserConnection.d.ts +8 -0
- package/dist/entities/UserConnection.js +2 -0
- package/dist/entities/UserConnectionRequest.d.ts +9 -0
- package/dist/entities/UserConnectionRequest.js +2 -0
- package/dist/entities/UserCredentials.d.ts +16 -0
- package/dist/entities/UserCredentials.js +11 -0
- package/dist/entities/UserNavigation.d.ts +8 -0
- package/dist/entities/UserNavigation.js +2 -0
- package/dist/entities/UserPreferences.d.ts +6 -0
- package/dist/entities/UserPreferences.js +2 -0
- package/dist/entities/UserPremium.d.ts +13 -0
- package/dist/entities/UserPremium.js +2 -0
- package/dist/entities/UserProfile.d.ts +9 -0
- package/dist/entities/UserProfile.js +2 -0
- package/dist/entities/UserRoles.d.ts +11 -0
- package/dist/entities/UserRoles.js +2 -0
- package/dist/entities/UserSharedFileTimestamps.d.ts +9 -0
- package/dist/entities/UserSharedFileTimestamps.js +2 -0
- package/dist/entities/UserUnavailableTime.d.ts +49 -0
- package/dist/entities/UserUnavailableTime.js +32 -0
- package/dist/entities/UserUnavailableTime.test.d.ts +1 -0
- package/dist/entities/UserUnavailableTime.test.js +22 -0
- package/dist/repositories/UnavailableTimeRepository.d.ts +20 -0
- package/dist/repositories/UnavailableTimeRepository.js +2 -0
- package/package.json +33 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class AsaasCustomer {
|
|
2
|
+
name: string;
|
|
3
|
+
cpfCnpj: string;
|
|
4
|
+
email: string;
|
|
5
|
+
mobilePhone: string;
|
|
6
|
+
externalReference?: string;
|
|
7
|
+
constructor(opts: {
|
|
8
|
+
name: string;
|
|
9
|
+
cpfCnpj: string;
|
|
10
|
+
email: string;
|
|
11
|
+
mobilePhone: string;
|
|
12
|
+
externalReference?: string;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsaasCustomer = void 0;
|
|
4
|
+
class AsaasCustomer {
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
this.name = opts.name;
|
|
7
|
+
this.cpfCnpj = opts.cpfCnpj;
|
|
8
|
+
this.email = opts.email;
|
|
9
|
+
this.mobilePhone = opts.mobilePhone;
|
|
10
|
+
this.externalReference = opts.externalReference;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.AsaasCustomer = AsaasCustomer;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IContract } from "./Contract";
|
|
2
|
+
import { ICourse } from "./Course";
|
|
3
|
+
import { IDate } from "./Date";
|
|
4
|
+
import { IFile } from "./File";
|
|
5
|
+
import { IGoogleCalendarEvent } from "./GoogleCalendarEvent";
|
|
6
|
+
import { IPayment } from "./Payment";
|
|
7
|
+
import { IRescheduleRequest } from "./RescheduleRequest";
|
|
8
|
+
export interface IClass {
|
|
9
|
+
id: string;
|
|
10
|
+
groupId: string | null;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
createdAt: Date | null;
|
|
14
|
+
updatedAt: Date | null;
|
|
15
|
+
date: IDate;
|
|
16
|
+
time: string;
|
|
17
|
+
endTime: string;
|
|
18
|
+
endDate: IDate | null;
|
|
19
|
+
courseId: string;
|
|
20
|
+
paymentId: string | null;
|
|
21
|
+
status: string | null;
|
|
22
|
+
course?: ICourse;
|
|
23
|
+
payment?: IPayment;
|
|
24
|
+
files?: IFile[];
|
|
25
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
26
|
+
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
27
|
+
meetingLink: string | null;
|
|
28
|
+
contractId: string | null;
|
|
29
|
+
contract?: IContract;
|
|
30
|
+
ownerId: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class Class implements IClass {
|
|
33
|
+
id: string;
|
|
34
|
+
groupId: string | null;
|
|
35
|
+
title: string;
|
|
36
|
+
description: string | null;
|
|
37
|
+
createdAt: Date | null;
|
|
38
|
+
updatedAt: Date | null;
|
|
39
|
+
date: IDate;
|
|
40
|
+
time: string;
|
|
41
|
+
endTime: string;
|
|
42
|
+
endDate: IDate | null;
|
|
43
|
+
courseId: string;
|
|
44
|
+
paymentId: string | null;
|
|
45
|
+
status: string | null;
|
|
46
|
+
course?: ICourse;
|
|
47
|
+
payment?: IPayment;
|
|
48
|
+
files?: IFile[];
|
|
49
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
50
|
+
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
51
|
+
meetingLink: string | null;
|
|
52
|
+
contractId: string | null;
|
|
53
|
+
contract?: IContract;
|
|
54
|
+
ownerId: string;
|
|
55
|
+
constructor(params: {
|
|
56
|
+
id: string;
|
|
57
|
+
groupId?: string | null;
|
|
58
|
+
title: string;
|
|
59
|
+
description?: string | null;
|
|
60
|
+
createdAt?: Date | null;
|
|
61
|
+
updatedAt?: Date | null;
|
|
62
|
+
date: IDate;
|
|
63
|
+
time: string;
|
|
64
|
+
endTime: string;
|
|
65
|
+
endDate?: IDate | null;
|
|
66
|
+
courseId: string;
|
|
67
|
+
paymentId?: string | null;
|
|
68
|
+
status?: string | null;
|
|
69
|
+
course?: ICourse;
|
|
70
|
+
payment?: IPayment;
|
|
71
|
+
files?: IFile[];
|
|
72
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
73
|
+
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
74
|
+
meetingLink?: string | null;
|
|
75
|
+
contractId?: string | null;
|
|
76
|
+
contract?: IContract;
|
|
77
|
+
ownerId: string;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Class = void 0;
|
|
4
|
+
class Class {
|
|
5
|
+
constructor(params) {
|
|
6
|
+
this.id = params.id;
|
|
7
|
+
this.groupId = params.groupId ? params.groupId : null;
|
|
8
|
+
this.title = params.title;
|
|
9
|
+
this.description = params.description ? params.description : null;
|
|
10
|
+
this.createdAt = params.createdAt ? params.createdAt : null;
|
|
11
|
+
this.updatedAt = params.updatedAt ? params.updatedAt : null;
|
|
12
|
+
this.date = params.date;
|
|
13
|
+
this.time = params.time;
|
|
14
|
+
this.endTime = params.endTime;
|
|
15
|
+
this.endDate = params.endDate ? params.endDate : null;
|
|
16
|
+
this.courseId = params.courseId;
|
|
17
|
+
this.paymentId = params.paymentId ? params.paymentId : null;
|
|
18
|
+
this.status = params.status ? params.status : null;
|
|
19
|
+
this.course = params.course;
|
|
20
|
+
this.payment = params.payment;
|
|
21
|
+
this.files = params.files;
|
|
22
|
+
this.rescheduleRequests = params.rescheduleRequests;
|
|
23
|
+
this.googleCalendarEvents = params.googleCalendarEvents;
|
|
24
|
+
this.meetingLink = params.meetingLink ? params.meetingLink : null;
|
|
25
|
+
this.contractId = params.contractId ? params.contractId : null;
|
|
26
|
+
this.contract = params.contract;
|
|
27
|
+
this.ownerId = params.ownerId;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Class = Class;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUserAuth } from "./UserAuth";
|
|
2
|
+
import { ICourse } from "./Course";
|
|
3
|
+
export interface IClassRequest {
|
|
4
|
+
id: string;
|
|
5
|
+
requesterId: string;
|
|
6
|
+
requester?: IUserAuth;
|
|
7
|
+
requestedId: string;
|
|
8
|
+
requested?: IUserAuth;
|
|
9
|
+
date: Date;
|
|
10
|
+
startTime: string;
|
|
11
|
+
endTime: string;
|
|
12
|
+
courseId?: string;
|
|
13
|
+
course?: ICourse;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IClass } from "./Class";
|
|
2
|
+
import { ICourse } from "./Course";
|
|
3
|
+
import { IFile } from "./File";
|
|
4
|
+
import { IPayment } from "./Payment";
|
|
5
|
+
import { IPreApprovedUser } from "./PreApprovedUser";
|
|
6
|
+
import { ISchool } from "./School";
|
|
7
|
+
import { IUserAuth } from "./UserAuth";
|
|
8
|
+
export interface IContract {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
contractorId: string | null;
|
|
12
|
+
schoolContractorId: string | null;
|
|
13
|
+
contractantId: string | null;
|
|
14
|
+
schoolContractantId: string | null;
|
|
15
|
+
preApprovedUserContractantEmail: string | null;
|
|
16
|
+
contractantSigned: boolean;
|
|
17
|
+
contractorSigned: boolean;
|
|
18
|
+
creatorId: string;
|
|
19
|
+
contractorSignatureDate: Date | null;
|
|
20
|
+
contractantSignatureDate: Date | null;
|
|
21
|
+
fileId: string | null;
|
|
22
|
+
responsibleTeacherId: string | null;
|
|
23
|
+
contractExpiryDate: Date | null;
|
|
24
|
+
status: string | null;
|
|
25
|
+
courseId: string | null;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
schoolId: string | null;
|
|
28
|
+
creator?: IUserAuth;
|
|
29
|
+
contractor?: IUserAuth | null;
|
|
30
|
+
schoolContractor?: ISchool | null;
|
|
31
|
+
contractant?: IUserAuth | null;
|
|
32
|
+
schoolContractant?: ISchool | null;
|
|
33
|
+
classes?: IClass[];
|
|
34
|
+
payments?: IPayment[];
|
|
35
|
+
file?: IFile | null;
|
|
36
|
+
responsibleTeacher?: IUserAuth | null;
|
|
37
|
+
course?: ICourse | null;
|
|
38
|
+
school?: ISchool | null;
|
|
39
|
+
preApprovedUserContractant?: IPreApprovedUser | null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IClass } from "./Class";
|
|
2
|
+
import { IClassRequest } from "./ClassRequest";
|
|
3
|
+
import { IContract } from "./Contract";
|
|
4
|
+
import { ICourseToSchoolConnectionRequest } from "./CourseToSchoolConnectionRequest";
|
|
5
|
+
import { IFile } from "./File";
|
|
6
|
+
import { IPayment } from "./Payment";
|
|
7
|
+
import { IPreApprovedUser } from "./PreApprovedUser";
|
|
8
|
+
import { ISchool } from "./School";
|
|
9
|
+
import { IUserAuth } from "./UserAuth";
|
|
10
|
+
import { IUserUnavailableTime } from "./UserUnavailableTime";
|
|
11
|
+
export interface ICourse {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
createdAt: Date | null;
|
|
16
|
+
updatedAt: Date | null;
|
|
17
|
+
isActive: boolean;
|
|
18
|
+
ownerId: string;
|
|
19
|
+
schoolId: string | null;
|
|
20
|
+
responsibleTeacherId: string | null;
|
|
21
|
+
owner?: IUserAuth;
|
|
22
|
+
students?: IUserAuth[];
|
|
23
|
+
preApprovedUserStudents?: IPreApprovedUser[];
|
|
24
|
+
classes?: IClass[];
|
|
25
|
+
payments?: IPayment[];
|
|
26
|
+
files?: IFile[];
|
|
27
|
+
availableTimes?: IUserUnavailableTime[];
|
|
28
|
+
classRequests?: IClassRequest[];
|
|
29
|
+
meetingLink: string | null;
|
|
30
|
+
contracts?: IContract[];
|
|
31
|
+
schools?: ISchool;
|
|
32
|
+
courseToSchoolConnectionRequests?: ICourseToSchoolConnectionRequest[];
|
|
33
|
+
responsibleTeacher?: IUserAuth;
|
|
34
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**An utility to separate dates from times. Operate on dates
|
|
2
|
+
* by clearly chosing between local time and utc, and without the nuances
|
|
3
|
+
* of hours, minutes and seconds.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDate {
|
|
6
|
+
/**
|
|
7
|
+
* a string like formatted like YYYY-MM-DD (eg. '1920-01-02', '2025-12-30') representing a date.
|
|
8
|
+
*/
|
|
9
|
+
value: string;
|
|
10
|
+
/**
|
|
11
|
+
* @returns a string like formatted like DD (eg. '03', '21') representing the day.
|
|
12
|
+
*/
|
|
13
|
+
getDay: () => string;
|
|
14
|
+
/**
|
|
15
|
+
* @returns a string like formatted like MM (eg. '03', '12') representing the month.
|
|
16
|
+
*/
|
|
17
|
+
getMonth: () => string;
|
|
18
|
+
/**
|
|
19
|
+
* @returns a string like formatted like YYYY (eg. '1920', '2025') representing the year.
|
|
20
|
+
*/
|
|
21
|
+
getYear: () => string;
|
|
22
|
+
/**
|
|
23
|
+
* @returns a string like formatted like YYYY-MM-DD (eg. '1920-01-02', '2025-12-30') representing the today's date,
|
|
24
|
+
* in the system's timezone.
|
|
25
|
+
*/
|
|
26
|
+
getToday: () => string;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a new instance of IDate with the days added.
|
|
29
|
+
* Counts for added months and years.
|
|
30
|
+
*/
|
|
31
|
+
addDays: (daysToAdd: number) => IDate;
|
|
32
|
+
/**
|
|
33
|
+
* Converts a Javascript Date instance into an IDate instance. Uses local timezone as default.
|
|
34
|
+
* @param useUtc set to true to consider UTC when extracting year, month and date
|
|
35
|
+
* @returns a new IDate instance.
|
|
36
|
+
*/
|
|
37
|
+
jsDateTimeToDate: (dateTime: Date, opts?: {
|
|
38
|
+
useUtc?: boolean;
|
|
39
|
+
}) => IDate;
|
|
40
|
+
/**
|
|
41
|
+
* Returns `date` or `this.date` as a Javascript Date object.
|
|
42
|
+
* Considers `date` or `this.date` as local time, with hours, minutes
|
|
43
|
+
* and seconds set to 0.
|
|
44
|
+
*/
|
|
45
|
+
toLocalJsDateTime: (date?: IDate) => Date;
|
|
46
|
+
/**
|
|
47
|
+
* Returns `date` or `this.date` as a Javascript Date object.
|
|
48
|
+
* Considers `date` or `this.date` as utc time, with hours, minutes
|
|
49
|
+
* and seconds set to 0.
|
|
50
|
+
*/
|
|
51
|
+
readonly toUtcJsDateTime: (date?: IDate) => Date;
|
|
52
|
+
/**Returns the time elapsed in days since the epoch (1970-01-01 00:00:00 UTC)
|
|
53
|
+
* up to `this.value` or `date` param if specified. */
|
|
54
|
+
readonly getDaysSinceEpoch: (date?: IDate) => number;
|
|
55
|
+
readonly getDayOfTheWeek: (date?: IDate) => number;
|
|
56
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
describe("Date", () => {
|
|
3
|
+
describe("Date.getDate()", () => {
|
|
4
|
+
it("Should return the same date if instantiated with timezone.", () => {
|
|
5
|
+
const date = new Date("2025-01-01T00:00:00-03:00");
|
|
6
|
+
expect(date.getDate()).toBe(1);
|
|
7
|
+
});
|
|
8
|
+
it("Should return same date if instantiated with numbers", () => {
|
|
9
|
+
const date = new Date(2025, 1, 1);
|
|
10
|
+
expect(date.getDate()).toBe(1);
|
|
11
|
+
});
|
|
12
|
+
it("Should return incorrect date if instantiated with string.", () => {
|
|
13
|
+
const date = new Date("2025-01-01");
|
|
14
|
+
expect(date.getDate()).toBe(31);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe("Date.getTimezoneOffset().toLocaleString()", () => {
|
|
18
|
+
it("Should return brazilian timezone offset.", () => {
|
|
19
|
+
const date = new Date("2025-01-01");
|
|
20
|
+
expect(date.getTimezoneOffset()).toBe(180);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IClass } from "./Class";
|
|
2
|
+
import { IContract } from "./Contract";
|
|
3
|
+
import { ICourse } from "./Course";
|
|
4
|
+
import { IPayment } from "./Payment";
|
|
5
|
+
import { IUserAuth } from "./UserAuth";
|
|
6
|
+
import { IUserSharedFileTimestamps } from "./UserSharedFileTimestamps";
|
|
7
|
+
export interface IFile {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
ownerId: string;
|
|
12
|
+
privacy: string;
|
|
13
|
+
createdAt: Date | null;
|
|
14
|
+
updatedAt: Date | null;
|
|
15
|
+
downloadCount: number;
|
|
16
|
+
owner?: IUserAuth;
|
|
17
|
+
viewers?: IUserAuth[];
|
|
18
|
+
courses?: ICourse[];
|
|
19
|
+
classes?: IClass[];
|
|
20
|
+
payments?: IPayment[];
|
|
21
|
+
userSharedFileTimestamps?: IUserSharedFileTimestamps[];
|
|
22
|
+
contract?: IContract;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IDate } from "./Date";
|
|
2
|
+
export interface IFreeDateTimeSlot {
|
|
3
|
+
date: IDate;
|
|
4
|
+
startTime: string;
|
|
5
|
+
endTime: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FreeDateTimeSlot implements IFreeDateTimeSlot {
|
|
9
|
+
date: IDate;
|
|
10
|
+
startTime: string;
|
|
11
|
+
endTime: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
constructor(opts: {
|
|
14
|
+
date: IDate;
|
|
15
|
+
startTime: string;
|
|
16
|
+
endTime: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FreeDateTimeSlot = void 0;
|
|
4
|
+
class FreeDateTimeSlot {
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
this.date = opts.date;
|
|
7
|
+
this.startTime = opts.startTime;
|
|
8
|
+
this.endTime = opts.endTime;
|
|
9
|
+
this.userId = opts.userId;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.FreeDateTimeSlot = FreeDateTimeSlot;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IUserAuth } from "./UserAuth";
|
|
2
|
+
export interface IGenericNotification {
|
|
3
|
+
id: string;
|
|
4
|
+
text: string;
|
|
5
|
+
senderId: string | null;
|
|
6
|
+
sender?: IUserAuth | null;
|
|
7
|
+
receivers?: IUserAuth[];
|
|
8
|
+
createdAt: Date | null;
|
|
9
|
+
usersThatSeen?: IUserAuth[];
|
|
10
|
+
link: string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IUserAuth } from "./UserAuth";
|
|
2
|
+
import { IGoogleCalendarEvent } from "./GoogleCalendarEvent";
|
|
3
|
+
export interface IGoogleCalendar {
|
|
4
|
+
userId: string;
|
|
5
|
+
calendarId: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
isSynched: boolean;
|
|
8
|
+
user?: IUserAuth;
|
|
9
|
+
events?: IGoogleCalendarEvent[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IClass } from "./Class";
|
|
2
|
+
import { IGoogleCalendar } from "./GoogleCalendar";
|
|
3
|
+
export interface IGoogleCalendarEvent {
|
|
4
|
+
calendarId: string;
|
|
5
|
+
classId: string;
|
|
6
|
+
eventId: string;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
calendar?: IGoogleCalendar;
|
|
9
|
+
class?: IClass;
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IDate } from "./Date";
|
|
2
|
+
import { IDateValidator } from "./DateValidator";
|
|
3
|
+
export declare class ISO8601Date implements IDate {
|
|
4
|
+
readonly value: string;
|
|
5
|
+
validator: IDateValidator;
|
|
6
|
+
constructor(value?: string);
|
|
7
|
+
private throwIfFormatIsNotValid;
|
|
8
|
+
getDay: () => string;
|
|
9
|
+
getMonth: () => string;
|
|
10
|
+
getYear: () => string;
|
|
11
|
+
/**
|
|
12
|
+
* @returns today's date as a string, in local time, formatted like YYYY-MM-DD.
|
|
13
|
+
*/
|
|
14
|
+
static getToday(): string;
|
|
15
|
+
/**
|
|
16
|
+
* @returns today's date as a srting, in local time, formatted like YYYY-MM-DD.
|
|
17
|
+
*/
|
|
18
|
+
getToday: typeof ISO8601Date.getToday;
|
|
19
|
+
addDays: (x: number) => IDate;
|
|
20
|
+
/**
|
|
21
|
+
* Converts a Javascript Date instance into an IDate instance. Uses local timezone as default.
|
|
22
|
+
* @param useUtc set to `true` to consider UTC when extracting year, month and date
|
|
23
|
+
* @returns a new `ISO8601Date` instance.
|
|
24
|
+
*/
|
|
25
|
+
static jsDateTimeToDate: (dateTime: Date, opts?: {
|
|
26
|
+
useUtc?: boolean;
|
|
27
|
+
}) => IDate;
|
|
28
|
+
jsDateTimeToDate: (dateTime: Date, opts?: {
|
|
29
|
+
useUtc?: boolean;
|
|
30
|
+
}) => IDate;
|
|
31
|
+
toLocalJsDateTime: (date?: IDate) => Date;
|
|
32
|
+
getDaysSinceEpoch: (date?: IDate) => number;
|
|
33
|
+
readonly toUtcJsDateTime: (date?: IDate) => Date;
|
|
34
|
+
readonly getDayOfTheWeek: (date?: IDate) => number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISO8601Date = void 0;
|
|
4
|
+
const ISO8601DateValidator_1 = require("./ISO8601DateValidator");
|
|
5
|
+
class ISO8601Date {
|
|
6
|
+
constructor(value) {
|
|
7
|
+
this.validator = new ISO8601DateValidator_1.ISO8601DateValidator();
|
|
8
|
+
this.getDay = () => {
|
|
9
|
+
this.throwIfFormatIsNotValid();
|
|
10
|
+
return this.value.split("-")[2];
|
|
11
|
+
};
|
|
12
|
+
this.getMonth = () => {
|
|
13
|
+
this.throwIfFormatIsNotValid();
|
|
14
|
+
return this.value.split("-")[1];
|
|
15
|
+
};
|
|
16
|
+
this.getYear = () => {
|
|
17
|
+
this.throwIfFormatIsNotValid();
|
|
18
|
+
return this.value.split("-")[0];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @returns today's date as a srting, in local time, formatted like YYYY-MM-DD.
|
|
22
|
+
*/
|
|
23
|
+
this.getToday = ISO8601Date.getToday;
|
|
24
|
+
this.addDays = (x) => {
|
|
25
|
+
const now = new Date(parseInt(this.getYear()), parseInt(this.getMonth()) - 1, parseInt(this.getDay()));
|
|
26
|
+
const day = now.getDate() + x;
|
|
27
|
+
const newDate = new Date(now.getFullYear(), now.getMonth(), day);
|
|
28
|
+
return new ISO8601Date(this.jsDateTimeToDate(newDate).value);
|
|
29
|
+
};
|
|
30
|
+
this.jsDateTimeToDate = ISO8601Date.jsDateTimeToDate;
|
|
31
|
+
this.toLocalJsDateTime = (date) => {
|
|
32
|
+
const targetDate = date ? date : this;
|
|
33
|
+
return new Date(parseInt(targetDate.getYear()), parseInt(targetDate.getMonth()) - 1, parseInt(targetDate.getDay()));
|
|
34
|
+
};
|
|
35
|
+
this.getDaysSinceEpoch = (date) => {
|
|
36
|
+
const targetDate = date || this;
|
|
37
|
+
const differenceInDays = Math.floor(targetDate.toLocalJsDateTime(targetDate).getTime() / 1000 / 60 / 60 / 24);
|
|
38
|
+
return differenceInDays;
|
|
39
|
+
};
|
|
40
|
+
this.toUtcJsDateTime = (date) => {
|
|
41
|
+
const targetDate = date ? date : this;
|
|
42
|
+
const year = targetDate.getYear();
|
|
43
|
+
const month = targetDate.getMonth();
|
|
44
|
+
const day = targetDate.getDay();
|
|
45
|
+
const dateString = `${year}-${month}-${day}T00:00:00.000Z`;
|
|
46
|
+
return new Date(dateString);
|
|
47
|
+
};
|
|
48
|
+
this.getDayOfTheWeek = (date) => {
|
|
49
|
+
const targetDate = date || this;
|
|
50
|
+
return targetDate.toUtcJsDateTime().getUTCDay();
|
|
51
|
+
};
|
|
52
|
+
this.value = value ? value : this.getToday();
|
|
53
|
+
this.throwIfFormatIsNotValid();
|
|
54
|
+
}
|
|
55
|
+
throwIfFormatIsNotValid() {
|
|
56
|
+
if (!this.validator.formatIsValid(this.value)) {
|
|
57
|
+
throw new Error("Date format must be YYYY-MM-DD.");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @returns today's date as a string, in local time, formatted like YYYY-MM-DD.
|
|
62
|
+
*/
|
|
63
|
+
static getToday() {
|
|
64
|
+
const now = new Date();
|
|
65
|
+
const day = now.getDate().toString().padStart(2, "0");
|
|
66
|
+
const month = (now.getMonth() + 1).toString().padStart(2, "0");
|
|
67
|
+
const year = now.getFullYear().toString();
|
|
68
|
+
return `${year}-${month}-${day}`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.ISO8601Date = ISO8601Date;
|
|
72
|
+
/**
|
|
73
|
+
* Converts a Javascript Date instance into an IDate instance. Uses local timezone as default.
|
|
74
|
+
* @param useUtc set to `true` to consider UTC when extracting year, month and date
|
|
75
|
+
* @returns a new `ISO8601Date` instance.
|
|
76
|
+
*/
|
|
77
|
+
ISO8601Date.jsDateTimeToDate = (dateTime, opts) => {
|
|
78
|
+
const day = ((opts === null || opts === void 0 ? void 0 : opts.useUtc) ? dateTime.getUTCDate() : dateTime.getDate())
|
|
79
|
+
.toString()
|
|
80
|
+
.padStart(2, "0");
|
|
81
|
+
const month = ((opts === null || opts === void 0 ? void 0 : opts.useUtc) ? dateTime.getUTCMonth() + 1 : dateTime.getMonth() + 1)
|
|
82
|
+
.toString()
|
|
83
|
+
.padStart(2, "0");
|
|
84
|
+
const year = ((opts === null || opts === void 0 ? void 0 : opts.useUtc) ? dateTime.getUTCFullYear() : dateTime.getFullYear()).toString();
|
|
85
|
+
return new ISO8601Date(`${year}-${month}-${day}`);
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|