turboself-api 0.1.5 → 1.1.6
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/README.md +28 -14
- package/dist/api/balanceGet.d.ts +2 -0
- package/dist/api/balanceGet.js +27 -0
- package/dist/api/bookDay.d.ts +2 -0
- package/dist/api/bookDay.js +58 -0
- package/dist/api/bookingGet.d.ts +2 -0
- package/dist/api/bookingGet.js +48 -0
- package/dist/api/canBookEveningGet.d.ts +1 -0
- package/dist/api/canBookEveningGet.js +18 -0
- package/dist/api/establishmentGet.d.ts +2 -0
- package/dist/api/establishmentGet.js +43 -0
- package/dist/api/establishmentSearch.d.ts +2 -0
- package/dist/api/establishmentSearch.js +21 -0
- package/dist/api/historyGet.d.ts +2 -0
- package/dist/api/historyGet.js +26 -0
- package/dist/api/hostGet.d.ts +2 -0
- package/dist/api/hostGet.js +53 -0
- package/dist/api/lastPaymentGet.d.ts +2 -0
- package/dist/api/lastPaymentGet.js +21 -0
- package/dist/api/siblingsGet.d.ts +2 -0
- package/dist/api/siblingsGet.js +56 -0
- package/dist/authenticate/index.d.ts +3 -0
- package/dist/authenticate/index.js +25 -0
- package/dist/client/Turboself.d.ts +53 -0
- package/dist/client/Turboself.js +119 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +9 -6
- package/dist/index.mjs +8 -4
- package/dist/interfaces/AuthFlow.d.ts +24 -0
- package/dist/interfaces/AuthFlow.js +3 -0
- package/dist/interfaces/Balance.d.ts +16 -0
- package/dist/{types → interfaces}/Balance.js +1 -1
- package/dist/interfaces/Bookings.d.ts +144 -0
- package/dist/interfaces/Bookings.js +3 -0
- package/dist/interfaces/Establishment.d.ts +95 -0
- package/dist/interfaces/Establishment.js +3 -0
- package/dist/interfaces/Fetcher.d.ts +9 -0
- package/dist/interfaces/Fetcher.js +3 -0
- package/dist/interfaces/Home.d.ts +27 -0
- package/dist/{types → interfaces}/Home.js +1 -1
- package/dist/interfaces/Host.d.ts +38 -0
- package/dist/{types/School.js → interfaces/Host.js} +1 -1
- package/dist/parser/Balance.d.ts +17 -0
- package/dist/parser/Balance.js +20 -0
- package/dist/parser/BookedMeal.d.ts +29 -0
- package/dist/parser/BookedMeal.js +28 -0
- package/dist/parser/BookingDay.d.ts +32 -0
- package/dist/parser/BookingDay.js +39 -0
- package/dist/parser/BookingPrice.d.ts +7 -0
- package/dist/parser/BookingPrice.js +13 -0
- package/dist/parser/BookingTerminal.d.ts +32 -0
- package/dist/parser/BookingTerminal.js +30 -0
- package/dist/parser/BookingWeek.d.ts +17 -0
- package/dist/parser/BookingWeek.js +19 -0
- package/dist/parser/Establishment.d.ts +117 -0
- package/dist/parser/Establishment.js +84 -0
- package/dist/parser/History.d.ts +17 -0
- package/dist/parser/History.js +20 -0
- package/dist/parser/Host.d.ts +70 -0
- package/dist/parser/Host.js +67 -0
- package/dist/parser/LatestPayment.d.ts +26 -0
- package/dist/parser/LatestPayment.js +27 -0
- package/dist/utils/endpoints.d.ts +10 -0
- package/dist/utils/endpoints.js +24 -0
- package/dist/utils/fetcher.d.ts +7 -0
- package/dist/utils/fetcher.js +25 -0
- package/dist/utils/weekNumber.d.ts +1 -0
- package/dist/utils/weekNumber.js +14 -0
- package/package.json +4 -6
- package/dist/auth/index.d.ts +0 -7
- package/dist/auth/index.js +0 -35
- package/dist/rest/RESTManager.d.ts +0 -7
- package/dist/rest/RESTManager.js +0 -15
- package/dist/rest/RequestHandler.d.ts +0 -5
- package/dist/rest/RequestHandler.js +0 -27
- package/dist/rest/endpoints.d.ts +0 -10
- package/dist/rest/endpoints.js +0 -23
- package/dist/routes/School.d.ts +0 -19
- package/dist/routes/School.js +0 -55
- package/dist/routes/User.d.ts +0 -74
- package/dist/routes/User.js +0 -237
- package/dist/structures/Client.d.ts +0 -26
- package/dist/structures/Client.js +0 -195
- package/dist/types/Balance.d.ts +0 -24
- package/dist/types/Booking.d.ts +0 -73
- package/dist/types/Booking.js +0 -3
- package/dist/types/Home.d.ts +0 -42
- package/dist/types/Login.d.ts +0 -14
- package/dist/types/Login.js +0 -3
- package/dist/types/School.d.ts +0 -103
- package/dist/types/User.d.ts +0 -69
- package/dist/types/User.js +0 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookedMeal = void 0;
|
|
4
|
+
class BookedMeal {
|
|
5
|
+
constructor(id,
|
|
6
|
+
/** If the meal is booked ? */
|
|
7
|
+
booked,
|
|
8
|
+
/** If the meal is booked from the kiosk */
|
|
9
|
+
kioskBooked,
|
|
10
|
+
/** If the meal is booked at the last synchronization */
|
|
11
|
+
bookedAtLastSynchronisation,
|
|
12
|
+
/** Id of the meal */
|
|
13
|
+
bookId,
|
|
14
|
+
/** Message of the meal */
|
|
15
|
+
message,
|
|
16
|
+
/** Host */
|
|
17
|
+
host) {
|
|
18
|
+
this.id = id;
|
|
19
|
+
this.booked = booked;
|
|
20
|
+
this.kioskBooked = kioskBooked;
|
|
21
|
+
this.bookedAtLastSynchronisation = bookedAtLastSynchronisation;
|
|
22
|
+
this.bookId = bookId;
|
|
23
|
+
this.message = message;
|
|
24
|
+
this.host = host;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.BookedMeal = BookedMeal;
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9va2VkTWVhbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wYXJzZXIvQm9va2VkTWVhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFhLFVBQVU7SUFDckIsWUFDUyxFQUFVO0lBQ2pCLDhCQUE4QjtJQUN2QixNQUFlO0lBQ3RCLDJDQUEyQztJQUNwQyxXQUFvQjtJQUMzQix3REFBd0Q7SUFDakQsMkJBQW9DO0lBQzNDLHFCQUFxQjtJQUNkLE1BQWM7SUFDckIsMEJBQTBCO0lBQ25CLE9BQWU7SUFDdEIsV0FBVztJQUNKLElBQVU7UUFaVixPQUFFLEdBQUYsRUFBRSxDQUFRO1FBRVYsV0FBTSxHQUFOLE1BQU0sQ0FBUztRQUVmLGdCQUFXLEdBQVgsV0FBVyxDQUFTO1FBRXBCLGdDQUEyQixHQUEzQiwyQkFBMkIsQ0FBUztRQUVwQyxXQUFNLEdBQU4sTUFBTSxDQUFRO1FBRWQsWUFBTyxHQUFQLE9BQU8sQ0FBUTtRQUVmLFNBQUksR0FBSixJQUFJLENBQU07SUFHbkIsQ0FBQztDQUNGO0FBbEJELGdDQWtCQyJ9
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BookedMeal } from "./BookedMeal";
|
|
2
|
+
export declare class BookingDay {
|
|
3
|
+
token: string;
|
|
4
|
+
hoteId: number;
|
|
5
|
+
/** ID for book a Meal */
|
|
6
|
+
bookId: string;
|
|
7
|
+
/** If this day is booked */
|
|
8
|
+
booked: boolean;
|
|
9
|
+
/** If this day is booked at the last synchronization */
|
|
10
|
+
bookedAtLastSynchronization: boolean;
|
|
11
|
+
/** If the host has the right to book this meal */
|
|
12
|
+
canBook: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
/** Date of the day */
|
|
15
|
+
date: Date;
|
|
16
|
+
constructor(token: string, hoteId: number,
|
|
17
|
+
/** ID for book a Meal */
|
|
18
|
+
bookId: string,
|
|
19
|
+
/** If this day is booked */
|
|
20
|
+
booked: boolean,
|
|
21
|
+
/** If this day is booked at the last synchronization */
|
|
22
|
+
bookedAtLastSynchronization: boolean,
|
|
23
|
+
/** If the host has the right to book this meal */
|
|
24
|
+
canBook: boolean, message: string,
|
|
25
|
+
/** Date of the day */
|
|
26
|
+
date: Date);
|
|
27
|
+
/** This method is used to book this day.
|
|
28
|
+
* @param book If the meal should be booked.
|
|
29
|
+
* @param bookEvening If the meal should be booked evening.
|
|
30
|
+
*/
|
|
31
|
+
book(book?: boolean, bookEvening?: boolean): Promise<BookedMeal>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookingDay = void 0;
|
|
4
|
+
const bookDay_1 = require("../api/bookDay");
|
|
5
|
+
class BookingDay {
|
|
6
|
+
constructor(token, hoteId,
|
|
7
|
+
/** ID for book a Meal */
|
|
8
|
+
bookId,
|
|
9
|
+
/** If this day is booked */
|
|
10
|
+
booked,
|
|
11
|
+
/** If this day is booked at the last synchronization */
|
|
12
|
+
bookedAtLastSynchronization,
|
|
13
|
+
/** If the host has the right to book this meal */
|
|
14
|
+
canBook, message,
|
|
15
|
+
/** Date of the day */
|
|
16
|
+
date) {
|
|
17
|
+
this.token = token;
|
|
18
|
+
this.hoteId = hoteId;
|
|
19
|
+
this.bookId = bookId;
|
|
20
|
+
this.booked = booked;
|
|
21
|
+
this.bookedAtLastSynchronization = bookedAtLastSynchronization;
|
|
22
|
+
this.canBook = canBook;
|
|
23
|
+
this.message = message;
|
|
24
|
+
this.date = date;
|
|
25
|
+
}
|
|
26
|
+
/** This method is used to book this day.
|
|
27
|
+
* @param book If the meal should be booked.
|
|
28
|
+
* @param bookEvening If the meal should be booked evening.
|
|
29
|
+
*/
|
|
30
|
+
async book(book, bookEvening) {
|
|
31
|
+
if (!book)
|
|
32
|
+
book = !this.booked;
|
|
33
|
+
if (!bookEvening)
|
|
34
|
+
bookEvening = false;
|
|
35
|
+
return await (0, bookDay_1.bookMeal)(this.token, this.hoteId, this.bookId, book === false ? 0 : 1, book === false ? 0 : 1, ((this.date.getDay()) - 1));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.BookingDay = BookingDay;
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9va2luZ0RheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4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UssS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsRUFDckIsQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQzlCLENBQUM7Q0FDRjtBQWpDRCxnQ0FpQ0MifQ==
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookingPrice = void 0;
|
|
4
|
+
class BookingPrice {
|
|
5
|
+
constructor(id,
|
|
6
|
+
/** ID of the terminal */
|
|
7
|
+
terminalId,
|
|
8
|
+
/** Meal Price */
|
|
9
|
+
price) {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.BookingPrice = BookingPrice;
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9va2luZ1ByaWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vbGliL3BhcnNlci9Cb29raW5nUHJpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsTUFBYSxZQUFZO0lBQ3ZCLFlBQ0UsRUFBVTtJQUNWLHlCQUF5QjtJQUN6QixVQUFrQjtJQUNsQixpQkFBaUI7SUFDakIsS0FBYTtJQUdmLENBQUM7Q0FDRjtBQVZELG9DQVVDIn0=
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BookingDay } from "./BookingDay";
|
|
2
|
+
import { BookingPrice } from "./BookingPrice";
|
|
3
|
+
export declare class BookingTerminal {
|
|
4
|
+
terminalId: number;
|
|
5
|
+
/** ID associated to book with this terminal */
|
|
6
|
+
bookId: string;
|
|
7
|
+
/** Booking Year */
|
|
8
|
+
bookYear: number;
|
|
9
|
+
/** Booking Weak Number */
|
|
10
|
+
bookWeak: number;
|
|
11
|
+
/** Name of the terminal */
|
|
12
|
+
name: string;
|
|
13
|
+
dayAuthorized: number;
|
|
14
|
+
usage: number;
|
|
15
|
+
/** Prices of the terminal */
|
|
16
|
+
prices: Array<BookingPrice>;
|
|
17
|
+
/** Days of the terminal */
|
|
18
|
+
days: Array<BookingDay>;
|
|
19
|
+
constructor(terminalId: number,
|
|
20
|
+
/** ID associated to book with this terminal */
|
|
21
|
+
bookId: string,
|
|
22
|
+
/** Booking Year */
|
|
23
|
+
bookYear: number,
|
|
24
|
+
/** Booking Weak Number */
|
|
25
|
+
bookWeak: number,
|
|
26
|
+
/** Name of the terminal */
|
|
27
|
+
name: string, dayAuthorized: number, usage: number,
|
|
28
|
+
/** Prices of the terminal */
|
|
29
|
+
prices: Array<BookingPrice>,
|
|
30
|
+
/** Days of the terminal */
|
|
31
|
+
days: Array<BookingDay>);
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookingTerminal = void 0;
|
|
4
|
+
class BookingTerminal {
|
|
5
|
+
constructor(terminalId,
|
|
6
|
+
/** ID associated to book with this terminal */
|
|
7
|
+
bookId,
|
|
8
|
+
/** Booking Year */
|
|
9
|
+
bookYear,
|
|
10
|
+
/** Booking Weak Number */
|
|
11
|
+
bookWeak,
|
|
12
|
+
/** Name of the terminal */
|
|
13
|
+
name, dayAuthorized, usage,
|
|
14
|
+
/** Prices of the terminal */
|
|
15
|
+
prices,
|
|
16
|
+
/** Days of the terminal */
|
|
17
|
+
days) {
|
|
18
|
+
this.terminalId = terminalId;
|
|
19
|
+
this.bookId = bookId;
|
|
20
|
+
this.bookYear = bookYear;
|
|
21
|
+
this.bookWeak = bookWeak;
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.dayAuthorized = dayAuthorized;
|
|
24
|
+
this.usage = usage;
|
|
25
|
+
this.prices = prices;
|
|
26
|
+
this.days = days;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.BookingTerminal = BookingTerminal;
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9va2luZ1Rlcm1pbmFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vbGliL3BhcnNlci9Cb29raW5nVGVybWluYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBR0EsTUFBYSxlQUFlO0lBQzFCLFlBQ1MsVUFBa0I7SUFDekIsK0NBQStDO0lBQ3hDLE1BQWM7SUFDckIsbUJBQW1CO0lBQ1osUUFBZ0I7SUFDdkIsMEJBQTBCO0lBQ25CLFFBQWdCO0lBQ3ZCLDJCQUEyQjtJQUNwQixJQUFZLEVBQ1osYUFBcUIsRUFDckIsS0FBYTtJQUNwQiw2QkFBNkI7SUFDdEIsTUFBMkI7SUFDbEMsMkJBQTJCO0lBQ3BCLElBQXVCO1FBZHZCLGVBQVUsR0FBVixVQUFVLENBQVE7UUFFbEIsV0FBTSxHQUFOLE1BQU0sQ0FBUTtRQUVkLGFBQVEsR0FBUixRQUFRLENBQVE7UUFFaEIsYUFBUSxHQUFSLFFBQVEsQ0FBUTtRQUVoQixTQUFJLEdBQUosSUFBSSxDQUFRO1FBQ1osa0JBQWEsR0FBYixhQUFhLENBQVE7UUFDckIsVUFBSyxHQUFMLEtBQUssQ0FBUTtRQUViLFdBQU0sR0FBTixNQUFNLENBQXFCO1FBRTNCLFNBQUksR0FBSixJQUFJLENBQW1CO0lBR2hDLENBQUM7Q0FDRjtBQXBCRCwwQ0FvQkMifQ==
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BookingTerminal } from "./BookingTerminal";
|
|
2
|
+
export declare class BookingWeek {
|
|
3
|
+
terminals: Array<BookingTerminal>;
|
|
4
|
+
/** Available weeks number */
|
|
5
|
+
weeksNumber: Array<number>;
|
|
6
|
+
/** If a user can book evening this week */
|
|
7
|
+
canBookEvening: boolean;
|
|
8
|
+
/** Date of the week */
|
|
9
|
+
weekDate: Date;
|
|
10
|
+
constructor(terminals: Array<BookingTerminal>,
|
|
11
|
+
/** Available weeks number */
|
|
12
|
+
weeksNumber: Array<number>,
|
|
13
|
+
/** If a user can book evening this week */
|
|
14
|
+
canBookEvening: boolean,
|
|
15
|
+
/** Date of the week */
|
|
16
|
+
weekDate: Date);
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookingWeek = void 0;
|
|
4
|
+
class BookingWeek {
|
|
5
|
+
constructor(terminals,
|
|
6
|
+
/** Available weeks number */
|
|
7
|
+
weeksNumber,
|
|
8
|
+
/** If a user can book evening this week */
|
|
9
|
+
canBookEvening,
|
|
10
|
+
/** Date of the week */
|
|
11
|
+
weekDate) {
|
|
12
|
+
this.terminals = terminals;
|
|
13
|
+
this.weeksNumber = weeksNumber;
|
|
14
|
+
this.canBookEvening = canBookEvening;
|
|
15
|
+
this.weekDate = weekDate;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.BookingWeek = BookingWeek;
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9va2luZ1dlZWsuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvcGFyc2VyL0Jvb2tpbmdXZWVrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLE1BQWEsV0FBVztJQUN0QixZQUNTLFNBQWlDO0lBQ3hDLDZCQUE2QjtJQUN0QixXQUEwQjtJQUNqQywyQ0FBMkM7SUFDcEMsY0FBdUI7SUFDOUIsdUJBQXVCO0lBQ2hCLFFBQWM7UUFOZCxjQUFTLEdBQVQsU0FBUyxDQUF3QjtRQUVqQyxnQkFBVyxHQUFYLFdBQVcsQ0FBZTtRQUUxQixtQkFBYyxHQUFkLGNBQWMsQ0FBUztRQUV2QixhQUFRLEdBQVIsUUFBUSxDQUFNO0lBR3ZCLENBQUM7Q0FDRjtBQVpELGtDQVlDIn0=
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export declare class Establishment {
|
|
2
|
+
code: string;
|
|
3
|
+
/** Name of the establishment */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Turboself Version used by the establishment */
|
|
6
|
+
version: string;
|
|
7
|
+
/** Etablishment Identifier */
|
|
8
|
+
id?: number | null | undefined;
|
|
9
|
+
/** TurboSelf etablishment Identifier */
|
|
10
|
+
turboselfId?: number | undefined;
|
|
11
|
+
/** Currency symbol used by the establishment */
|
|
12
|
+
currencySymbol?: string | undefined;
|
|
13
|
+
/** Minimum amount of meal for the establishment */
|
|
14
|
+
minimumMeal?: number | undefined;
|
|
15
|
+
/** Minimum amount of creance for the establishment */
|
|
16
|
+
minimumCreance?: number | undefined;
|
|
17
|
+
/** Minimum amount of credit for the establishment */
|
|
18
|
+
minimumCredit?: number | undefined;
|
|
19
|
+
/** HTML Welcome Message */
|
|
20
|
+
welcomeMessage?: string | undefined;
|
|
21
|
+
/** If the establishment is disabled */
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
/** UAI Code (Unité Administrative Immatriculée) */
|
|
24
|
+
uai?: string | undefined;
|
|
25
|
+
/** MAC Address of the establishment's TurboSelf server */
|
|
26
|
+
macServerAddress?: string | undefined;
|
|
27
|
+
reservations?: {
|
|
28
|
+
id: number;
|
|
29
|
+
usage: number;
|
|
30
|
+
elecom: number;
|
|
31
|
+
endReservation: string;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
geolocation?: {
|
|
34
|
+
address1?: string | undefined;
|
|
35
|
+
address2?: string | undefined;
|
|
36
|
+
zipCode?: string | undefined;
|
|
37
|
+
city?: string | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
contact?: {
|
|
40
|
+
/** Establishment phone number */
|
|
41
|
+
phoneNumber?: string | undefined;
|
|
42
|
+
/** Establishment website */
|
|
43
|
+
website?: string | undefined;
|
|
44
|
+
/** Establishment email */
|
|
45
|
+
email?: string | undefined;
|
|
46
|
+
} | undefined;
|
|
47
|
+
permissions?: {
|
|
48
|
+
/** If the student can use the QR code for the establishment */
|
|
49
|
+
canStudentUseQrCode?: boolean | undefined;
|
|
50
|
+
/** If the dinner companion can use the QR code for the establishment */
|
|
51
|
+
canCompanionUseQrCode?: boolean | undefined;
|
|
52
|
+
/** If the intern can use the QR code for the establishment */
|
|
53
|
+
canInternUseQrCode?: boolean | undefined;
|
|
54
|
+
/** If the student can see the history of the establishment */
|
|
55
|
+
canStudentSeeHistory?: boolean | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
SynchronizationDate?: {
|
|
58
|
+
firstSync: string;
|
|
59
|
+
lastSync: string;
|
|
60
|
+
lastSelfSync: string;
|
|
61
|
+
} | undefined;
|
|
62
|
+
constructor(code: string,
|
|
63
|
+
/** Name of the establishment */
|
|
64
|
+
name: string,
|
|
65
|
+
/** Turboself Version used by the establishment */
|
|
66
|
+
version: string,
|
|
67
|
+
/** Etablishment Identifier */
|
|
68
|
+
id?: number | null | undefined,
|
|
69
|
+
/** TurboSelf etablishment Identifier */
|
|
70
|
+
turboselfId?: number | undefined,
|
|
71
|
+
/** Currency symbol used by the establishment */
|
|
72
|
+
currencySymbol?: string | undefined,
|
|
73
|
+
/** Minimum amount of meal for the establishment */
|
|
74
|
+
minimumMeal?: number | undefined,
|
|
75
|
+
/** Minimum amount of creance for the establishment */
|
|
76
|
+
minimumCreance?: number | undefined,
|
|
77
|
+
/** Minimum amount of credit for the establishment */
|
|
78
|
+
minimumCredit?: number | undefined,
|
|
79
|
+
/** HTML Welcome Message */
|
|
80
|
+
welcomeMessage?: string | undefined,
|
|
81
|
+
/** If the establishment is disabled */
|
|
82
|
+
disabled?: boolean | undefined,
|
|
83
|
+
/** UAI Code (Unité Administrative Immatriculée) */
|
|
84
|
+
uai?: string | undefined,
|
|
85
|
+
/** MAC Address of the establishment's TurboSelf server */
|
|
86
|
+
macServerAddress?: string | undefined, reservations?: {
|
|
87
|
+
id: number;
|
|
88
|
+
usage: number;
|
|
89
|
+
elecom: number;
|
|
90
|
+
endReservation: string;
|
|
91
|
+
}[] | undefined, geolocation?: {
|
|
92
|
+
address1?: string | undefined;
|
|
93
|
+
address2?: string | undefined;
|
|
94
|
+
zipCode?: string | undefined;
|
|
95
|
+
city?: string | undefined;
|
|
96
|
+
} | undefined, contact?: {
|
|
97
|
+
/** Establishment phone number */
|
|
98
|
+
phoneNumber?: string | undefined;
|
|
99
|
+
/** Establishment website */
|
|
100
|
+
website?: string | undefined;
|
|
101
|
+
/** Establishment email */
|
|
102
|
+
email?: string | undefined;
|
|
103
|
+
} | undefined, permissions?: {
|
|
104
|
+
/** If the student can use the QR code for the establishment */
|
|
105
|
+
canStudentUseQrCode?: boolean | undefined;
|
|
106
|
+
/** If the dinner companion can use the QR code for the establishment */
|
|
107
|
+
canCompanionUseQrCode?: boolean | undefined;
|
|
108
|
+
/** If the intern can use the QR code for the establishment */
|
|
109
|
+
canInternUseQrCode?: boolean | undefined;
|
|
110
|
+
/** If the student can see the history of the establishment */
|
|
111
|
+
canStudentSeeHistory?: boolean | undefined;
|
|
112
|
+
} | undefined, SynchronizationDate?: {
|
|
113
|
+
firstSync: string;
|
|
114
|
+
lastSync: string;
|
|
115
|
+
lastSelfSync: string;
|
|
116
|
+
} | undefined);
|
|
117
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Establishment = void 0;
|
|
4
|
+
class Establishment {
|
|
5
|
+
constructor(code,
|
|
6
|
+
/** Name of the establishment */
|
|
7
|
+
name,
|
|
8
|
+
/** Turboself Version used by the establishment */
|
|
9
|
+
version,
|
|
10
|
+
/** Etablishment Identifier */
|
|
11
|
+
id,
|
|
12
|
+
/** TurboSelf etablishment Identifier */
|
|
13
|
+
turboselfId,
|
|
14
|
+
/** Currency symbol used by the establishment */
|
|
15
|
+
currencySymbol,
|
|
16
|
+
/** Minimum amount of meal for the establishment */
|
|
17
|
+
minimumMeal,
|
|
18
|
+
/** Minimum amount of creance for the establishment */
|
|
19
|
+
minimumCreance,
|
|
20
|
+
/** Minimum amount of credit for the establishment */
|
|
21
|
+
minimumCredit,
|
|
22
|
+
/** HTML Welcome Message */
|
|
23
|
+
welcomeMessage,
|
|
24
|
+
/** If the establishment is disabled */
|
|
25
|
+
disabled,
|
|
26
|
+
/** UAI Code (Unité Administrative Immatriculée) */
|
|
27
|
+
uai,
|
|
28
|
+
/** MAC Address of the establishment's TurboSelf server */
|
|
29
|
+
macServerAddress, reservations, geolocation, contact, permissions, SynchronizationDate) {
|
|
30
|
+
this.code = code;
|
|
31
|
+
this.name = name;
|
|
32
|
+
this.version = version;
|
|
33
|
+
this.id = id;
|
|
34
|
+
this.turboselfId = turboselfId;
|
|
35
|
+
this.currencySymbol = currencySymbol;
|
|
36
|
+
this.minimumMeal = minimumMeal;
|
|
37
|
+
this.minimumCreance = minimumCreance;
|
|
38
|
+
this.minimumCredit = minimumCredit;
|
|
39
|
+
this.welcomeMessage = welcomeMessage;
|
|
40
|
+
this.disabled = disabled;
|
|
41
|
+
this.uai = uai;
|
|
42
|
+
this.macServerAddress = macServerAddress;
|
|
43
|
+
this.reservations = reservations;
|
|
44
|
+
this.geolocation = geolocation;
|
|
45
|
+
this.contact = contact;
|
|
46
|
+
this.permissions = permissions;
|
|
47
|
+
this.SynchronizationDate = SynchronizationDate;
|
|
48
|
+
if (this.permissions?.canStudentSeeHistory !== undefined) {
|
|
49
|
+
this.permissions.canStudentSeeHistory = !this.permissions.canStudentSeeHistory;
|
|
50
|
+
}
|
|
51
|
+
if (!id)
|
|
52
|
+
delete this.id;
|
|
53
|
+
if (!turboselfId)
|
|
54
|
+
delete this.turboselfId;
|
|
55
|
+
if (!currencySymbol)
|
|
56
|
+
delete this.currencySymbol;
|
|
57
|
+
if (!minimumMeal && minimumMeal !== 0)
|
|
58
|
+
delete this.minimumMeal;
|
|
59
|
+
if (!minimumCreance && minimumCreance !== 0)
|
|
60
|
+
delete this.minimumCreance;
|
|
61
|
+
if (!minimumCredit && minimumCredit !== 0)
|
|
62
|
+
delete this.minimumCredit;
|
|
63
|
+
if (!welcomeMessage)
|
|
64
|
+
delete this.welcomeMessage;
|
|
65
|
+
if (!disabled)
|
|
66
|
+
delete this.disabled;
|
|
67
|
+
if (!uai)
|
|
68
|
+
delete this.uai;
|
|
69
|
+
if (!macServerAddress)
|
|
70
|
+
delete this.macServerAddress;
|
|
71
|
+
if (!reservations)
|
|
72
|
+
delete this.reservations;
|
|
73
|
+
if (!geolocation)
|
|
74
|
+
delete this.geolocation;
|
|
75
|
+
if (!contact)
|
|
76
|
+
delete this.contact;
|
|
77
|
+
if (!permissions)
|
|
78
|
+
delete this.permissions;
|
|
79
|
+
if (!SynchronizationDate)
|
|
80
|
+
delete this.SynchronizationDate;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.Establishment = Establishment;
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXN0YWJsaXNobWVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wYXJzZXIvRXN0YWJsaXNobWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSxNQUFhLGFBQWE7SUFDeEIsWUFDUyxJQUFZO0lBQ25CLGdDQUFnQztJQUN6QixJQUFZO0lBQ25CLGtEQUFrRDtJQUMzQyxPQUFlO0lBQ3RCLDhCQUE4QjtJQUN2QixFQUFrQjtJQUN6Qix3Q0FBd0M7SUFDakMsV0FBb0I7SUFFM0IsZ0RBQWdEO0lBQ3pDLGNBQXVCO0lBQzlCLG1EQUFtRDtJ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UFDLFdBQVc7WUFBRSxPQUFPLElBQUksQ0FBQyxXQUFXLENBQUM7UUFDMUMsSUFBSSxDQUFDLG1CQUFtQjtZQUFFLE9BQU8sSUFBSSxDQUFDLG1CQUFtQixDQUFDO0lBQzVELENBQUM7Q0FDRjtBQXRGRCxzQ0FzRkMifQ==
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class History {
|
|
2
|
+
id: number;
|
|
3
|
+
/** Date of the history element */
|
|
4
|
+
date: Date;
|
|
5
|
+
label: string;
|
|
6
|
+
/** 0 if it's not a debit */
|
|
7
|
+
debit: number;
|
|
8
|
+
/** 0 if it's not a credit */
|
|
9
|
+
credit: number;
|
|
10
|
+
constructor(id: number,
|
|
11
|
+
/** Date of the history element */
|
|
12
|
+
date: Date, label: string,
|
|
13
|
+
/** 0 if it's not a debit */
|
|
14
|
+
debit: number,
|
|
15
|
+
/** 0 if it's not a credit */
|
|
16
|
+
credit: number);
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.History = void 0;
|
|
4
|
+
class History {
|
|
5
|
+
constructor(id,
|
|
6
|
+
/** Date of the history element */
|
|
7
|
+
date, label,
|
|
8
|
+
/** 0 if it's not a debit */
|
|
9
|
+
debit,
|
|
10
|
+
/** 0 if it's not a credit */
|
|
11
|
+
credit) {
|
|
12
|
+
this.id = id;
|
|
13
|
+
this.date = date;
|
|
14
|
+
this.label = label;
|
|
15
|
+
this.debit = debit;
|
|
16
|
+
this.credit = credit;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.History = History;
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSGlzdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wYXJzZXIvSGlzdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxNQUFhLE9BQU87SUFDbEIsWUFDUyxFQUFVO0lBQ2pCLGtDQUFrQztJQUMzQixJQUFVLEVBQ1YsS0FBYTtJQUNwQiw0QkFBNEI7SUFDckIsS0FBYTtJQUNwQiw2QkFBNkI7SUFDdEIsTUFBYztRQVBkLE9BQUUsR0FBRixFQUFFLENBQVE7UUFFVixTQUFJLEdBQUosSUFBSSxDQUFNO1FBQ1YsVUFBSyxHQUFMLEtBQUssQ0FBUTtRQUViLFVBQUssR0FBTCxLQUFLLENBQVE7UUFFYixXQUFNLEdBQU4sTUFBTSxDQUFRO0lBRXZCLENBQUM7Q0FDRjtBQVpELDBCQVlDIn0=
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Balance } from "./Balance";
|
|
2
|
+
import { Establishment } from "./Establishment";
|
|
3
|
+
import { History } from "./History";
|
|
4
|
+
import { LatestPayment } from "./LatestPayment";
|
|
5
|
+
export declare class Host {
|
|
6
|
+
id: number;
|
|
7
|
+
/** Firstname of the Host */
|
|
8
|
+
firstname: string;
|
|
9
|
+
/** Lastname of the Host */
|
|
10
|
+
lastname: string;
|
|
11
|
+
/** Quality of the Host */
|
|
12
|
+
quality: string;
|
|
13
|
+
/** Division of the Host */
|
|
14
|
+
division: string;
|
|
15
|
+
/** Meal price of the Host in cents */
|
|
16
|
+
mealPrice: number;
|
|
17
|
+
etablishment: Establishment;
|
|
18
|
+
permissions?: {
|
|
19
|
+
/** If the host can add funds */
|
|
20
|
+
canPay: boolean;
|
|
21
|
+
/** If the host can book a meal */
|
|
22
|
+
canBookMeal: boolean;
|
|
23
|
+
/** If the host can book a meal at cafeteria */
|
|
24
|
+
canBookCafeteria: boolean;
|
|
25
|
+
/** If the host can book a meal even if its balance is insufficient */
|
|
26
|
+
canBookIfBalanceInsufficient: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
SynchronizationDate?: {
|
|
29
|
+
lastSync: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
/** Code used to identify the card, not null if QRCode is enabled */
|
|
32
|
+
cardCode?: number | undefined;
|
|
33
|
+
token?: string | undefined;
|
|
34
|
+
constructor(id: number,
|
|
35
|
+
/** Firstname of the Host */
|
|
36
|
+
firstname: string,
|
|
37
|
+
/** Lastname of the Host */
|
|
38
|
+
lastname: string,
|
|
39
|
+
/** Quality of the Host */
|
|
40
|
+
quality: string,
|
|
41
|
+
/** Division of the Host */
|
|
42
|
+
division: string,
|
|
43
|
+
/** Meal price of the Host in cents */
|
|
44
|
+
mealPrice: number, etablishment: Establishment, permissions?: {
|
|
45
|
+
/** If the host can add funds */
|
|
46
|
+
canPay: boolean;
|
|
47
|
+
/** If the host can book a meal */
|
|
48
|
+
canBookMeal: boolean;
|
|
49
|
+
/** If the host can book a meal at cafeteria */
|
|
50
|
+
canBookCafeteria: boolean;
|
|
51
|
+
/** If the host can book a meal even if its balance is insufficient */
|
|
52
|
+
canBookIfBalanceInsufficient: boolean;
|
|
53
|
+
} | undefined, SynchronizationDate?: {
|
|
54
|
+
lastSync: string;
|
|
55
|
+
} | undefined,
|
|
56
|
+
/** Code used to identify the card, not null if QRCode is enabled */
|
|
57
|
+
cardCode?: number | undefined, token?: string | undefined);
|
|
58
|
+
/** This method is used to get the balance of the host.
|
|
59
|
+
*/
|
|
60
|
+
getBalance(): Promise<Balance>;
|
|
61
|
+
/** This method is used to get the siblings of the host.
|
|
62
|
+
*/
|
|
63
|
+
getSiblings(): Promise<Host[]>;
|
|
64
|
+
/** This method is used to get the history of the host.
|
|
65
|
+
*/
|
|
66
|
+
getHistory(): Promise<History[]>;
|
|
67
|
+
/** This method is used to get the latest payment of the host.
|
|
68
|
+
*/
|
|
69
|
+
getLatestPayment(): Promise<LatestPayment>;
|
|
70
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Host = void 0;
|
|
4
|
+
const balanceGet_1 = require("../api/balanceGet");
|
|
5
|
+
const historyGet_1 = require("../api/historyGet");
|
|
6
|
+
const lastPaymentGet_1 = require("../api/lastPaymentGet");
|
|
7
|
+
const siblingsGet_1 = require("../api/siblingsGet");
|
|
8
|
+
class Host {
|
|
9
|
+
constructor(id,
|
|
10
|
+
/** Firstname of the Host */
|
|
11
|
+
firstname,
|
|
12
|
+
/** Lastname of the Host */
|
|
13
|
+
lastname,
|
|
14
|
+
/** Quality of the Host */
|
|
15
|
+
quality,
|
|
16
|
+
/** Division of the Host */
|
|
17
|
+
division,
|
|
18
|
+
/** Meal price of the Host in cents */
|
|
19
|
+
mealPrice, etablishment, permissions, SynchronizationDate,
|
|
20
|
+
/** Code used to identify the card, not null if QRCode is enabled */
|
|
21
|
+
cardCode, token) {
|
|
22
|
+
this.id = id;
|
|
23
|
+
this.firstname = firstname;
|
|
24
|
+
this.lastname = lastname;
|
|
25
|
+
this.quality = quality;
|
|
26
|
+
this.division = division;
|
|
27
|
+
this.mealPrice = mealPrice;
|
|
28
|
+
this.etablishment = etablishment;
|
|
29
|
+
this.permissions = permissions;
|
|
30
|
+
this.SynchronizationDate = SynchronizationDate;
|
|
31
|
+
this.cardCode = cardCode;
|
|
32
|
+
this.token = token;
|
|
33
|
+
this.token = token;
|
|
34
|
+
if (cardCode && cardCode < 0)
|
|
35
|
+
delete this.cardCode;
|
|
36
|
+
}
|
|
37
|
+
/** This method is used to get the balance of the host.
|
|
38
|
+
*/
|
|
39
|
+
async getBalance() {
|
|
40
|
+
if (this.token)
|
|
41
|
+
return await (0, balanceGet_1.getBalance)(this.token, this.id);
|
|
42
|
+
throw new Error("You need to login to this account first");
|
|
43
|
+
}
|
|
44
|
+
/** This method is used to get the siblings of the host.
|
|
45
|
+
*/
|
|
46
|
+
async getSiblings() {
|
|
47
|
+
if (this.token)
|
|
48
|
+
return await (0, siblingsGet_1.getSiblings)(this.token, this.id);
|
|
49
|
+
throw new Error("You need to login to this account first");
|
|
50
|
+
}
|
|
51
|
+
/** This method is used to get the history of the host.
|
|
52
|
+
*/
|
|
53
|
+
async getHistory() {
|
|
54
|
+
if (this.token)
|
|
55
|
+
return await (0, historyGet_1.getHistory)(this.token, this.id);
|
|
56
|
+
throw new Error("You need to login to this account first");
|
|
57
|
+
}
|
|
58
|
+
/** This method is used to get the latest payment of the host.
|
|
59
|
+
*/
|
|
60
|
+
async getLatestPayment() {
|
|
61
|
+
if (this.token)
|
|
62
|
+
return await (0, lastPaymentGet_1.getLatestPayment)(this.token, this.id);
|
|
63
|
+
throw new Error("You need to login to this account first");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.Host = Host;
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSG9zdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9wYXJzZXIvSG9zdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxrREFBK0M7QUFDL0Msa0RBQStDO0FBQy9DLDBEQUF5RDtBQUN6RCxvREFBaUQ7QUFNakQsTUFBYSxJQUFJO0lBQ2YsWUFDUyxFQUFVO0lBQ2pCLDRCQUE0QjtJQUNyQixTQUFpQjtJQUN4QiwyQkFBMkI7SUFDcEIsUUFBZ0I7SUFDdkIsMEJBQTBCO0lBQ25CLE9BQWU7SUFDdEIsMkJBQTJCO0lBQ3BCLFFBQWdCO0lBQ3ZCLHNDQUFzQztJQUMvQixTQUFpQixFQUNqQixZQUEyQixFQUMzQixXQVNOLEVBQ00sbUJBRU47SUFDRCxvRUFBb0U7SUFDN0QsUUFBaUIsRUFDakIsS0FBYztRQTNCZCxPQUFFLEdBQUYsRUFBRSxDQUFRO1FBRVYsY0FBUyxHQUFULFNBQVMsQ0FBUTtRQUVqQixhQUFRLEdBQVIsUUFBUSxDQUFRO1FBRWhCLFlBQU8sR0FBUCxPQUFPLENBQVE7UUFFZixhQUF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sQ0FBQyxDQUFDO1FBQzdELE1BQU0sSUFBSSxLQUFLLENBQUMseUNBQXlDLENBQUMsQ0FBQztJQUM3RCxDQUFDO0lBRUQ7UUFDSTtJQUNHLEtBQUssQ0FBQyxnQkFBZ0I7UUFDM0IsSUFBSSxJQUFJLENBQUMsS0FBSztZQUFFLE9BQU8sTUFBTSxJQUFBLGlDQUFnQixFQUFDLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDO1FBQ25FLE1BQU0sSUFBSSxLQUFLLENBQUMseUNBQXlDLENBQUMsQ0FBQztJQUM3RCxDQUFDO0NBQ0Y7QUE5REQsb0JBOERDIn0=
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare class LatestPayment {
|
|
2
|
+
id: number;
|
|
3
|
+
/** Date of the payment */
|
|
4
|
+
date: Date;
|
|
5
|
+
/** Date of the last update */
|
|
6
|
+
updateDate: Date | null;
|
|
7
|
+
type: string | null;
|
|
8
|
+
/** Amount of the payment in cents */
|
|
9
|
+
amount: number;
|
|
10
|
+
/** Actual Payment Status */
|
|
11
|
+
status: string;
|
|
12
|
+
/** Transaction ID of the payment */
|
|
13
|
+
transactionId: string;
|
|
14
|
+
token: string;
|
|
15
|
+
constructor(id: number,
|
|
16
|
+
/** Date of the payment */
|
|
17
|
+
date: Date,
|
|
18
|
+
/** Date of the last update */
|
|
19
|
+
updateDate: Date | null, type: string | null,
|
|
20
|
+
/** Amount of the payment in cents */
|
|
21
|
+
amount: number,
|
|
22
|
+
/** Actual Payment Status */
|
|
23
|
+
status: string,
|
|
24
|
+
/** Transaction ID of the payment */
|
|
25
|
+
transactionId: string, token: string);
|
|
26
|
+
}
|