@benchme/scenarios 0.9.1 → 0.11.0
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/acme-v1/index.d.ts +2 -1
- package/dist/acme-v1/index.js +4 -1
- package/dist/acme-v1/index.js.map +1 -1
- package/dist/acme-v1/names.d.ts +3 -0
- package/dist/acme-v1/names.js +3 -0
- package/dist/acme-v1/names.js.map +1 -1
- package/dist/cuj-v1/accounts.d.ts +14 -0
- package/dist/cuj-v1/accounts.js +52 -0
- package/dist/cuj-v1/accounts.js.map +1 -0
- package/dist/cuj-v1/index.d.ts +10 -0
- package/dist/cuj-v1/index.js +21 -0
- package/dist/cuj-v1/index.js.map +1 -0
- package/dist/guide-v1/index.js +2 -0
- package/dist/guide-v1/index.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/prng.d.ts +7 -0
- package/dist/prng.js +12 -0
- package/dist/prng.js.map +1 -1
- package/dist/scenario.d.ts +78 -0
- package/dist/scenario.js.map +1 -1
- package/dist/shops-v1/index.js +2 -0
- package/dist/shops-v1/index.js.map +1 -1
- package/dist/sites/cinema/generate.d.ts +22 -0
- package/dist/sites/cinema/generate.js +258 -0
- package/dist/sites/cinema/generate.js.map +1 -0
- package/dist/sites/cinema/index.d.ts +3 -0
- package/dist/sites/cinema/index.js +4 -0
- package/dist/sites/cinema/index.js.map +1 -0
- package/dist/sites/cinema/rules.d.ts +142 -0
- package/dist/sites/cinema/rules.js +191 -0
- package/dist/sites/cinema/rules.js.map +1 -0
- package/dist/sites/cinema/types.d.ts +93 -0
- package/dist/sites/cinema/types.js +2 -0
- package/dist/sites/cinema/types.js.map +1 -0
- package/dist/sites/clinic/generate.d.ts +28 -0
- package/dist/sites/clinic/generate.js +282 -0
- package/dist/sites/clinic/generate.js.map +1 -0
- package/dist/sites/clinic/index.d.ts +3 -0
- package/dist/sites/clinic/index.js +3 -0
- package/dist/sites/clinic/index.js.map +1 -0
- package/dist/sites/clinic/rules.d.ts +96 -0
- package/dist/sites/clinic/rules.js +154 -0
- package/dist/sites/clinic/rules.js.map +1 -0
- package/dist/sites/clinic/types.d.ts +125 -0
- package/dist/sites/clinic/types.js +2 -0
- package/dist/sites/clinic/types.js.map +1 -0
- package/dist/sites/dining/generate.d.ts +15 -0
- package/dist/sites/dining/generate.js +146 -0
- package/dist/sites/dining/generate.js.map +1 -0
- package/dist/sites/dining/index.d.ts +3 -0
- package/dist/sites/dining/index.js +4 -0
- package/dist/sites/dining/index.js.map +1 -0
- package/dist/sites/dining/rules.d.ts +92 -0
- package/dist/sites/dining/rules.js +156 -0
- package/dist/sites/dining/rules.js.map +1 -0
- package/dist/sites/dining/types.d.ts +69 -0
- package/dist/sites/dining/types.js +14 -0
- package/dist/sites/dining/types.js.map +1 -0
- package/dist/sites/events/generate.d.ts +27 -0
- package/dist/sites/events/generate.js +197 -0
- package/dist/sites/events/generate.js.map +1 -0
- package/dist/sites/events/index.d.ts +3 -0
- package/dist/sites/events/index.js +4 -0
- package/dist/sites/events/index.js.map +1 -0
- package/dist/sites/events/rules.d.ts +99 -0
- package/dist/sites/events/rules.js +172 -0
- package/dist/sites/events/rules.js.map +1 -0
- package/dist/sites/events/types.d.ts +78 -0
- package/dist/sites/events/types.js +10 -0
- package/dist/sites/events/types.js.map +1 -0
- package/dist/sites/flights/generate.d.ts +21 -0
- package/dist/sites/flights/generate.js +210 -0
- package/dist/sites/flights/generate.js.map +1 -0
- package/dist/sites/flights/index.d.ts +3 -0
- package/dist/sites/flights/index.js +3 -0
- package/dist/sites/flights/index.js.map +1 -0
- package/dist/sites/flights/rules.d.ts +79 -0
- package/dist/sites/flights/rules.js +125 -0
- package/dist/sites/flights/rules.js.map +1 -0
- package/dist/sites/flights/types.d.ts +69 -0
- package/dist/sites/flights/types.js +2 -0
- package/dist/sites/flights/types.js.map +1 -0
- package/dist/sites/homes/generate.d.ts +19 -0
- package/dist/sites/homes/generate.js +180 -0
- package/dist/sites/homes/generate.js.map +1 -0
- package/dist/sites/homes/index.d.ts +3 -0
- package/dist/sites/homes/index.js +3 -0
- package/dist/sites/homes/index.js.map +1 -0
- package/dist/sites/homes/rules.d.ts +68 -0
- package/dist/sites/homes/rules.js +94 -0
- package/dist/sites/homes/rules.js.map +1 -0
- package/dist/sites/homes/types.d.ts +62 -0
- package/dist/sites/homes/types.js +2 -0
- package/dist/sites/homes/types.js.map +1 -0
- package/dist/sites/hotels/generate.d.ts +16 -0
- package/dist/sites/hotels/generate.js +134 -0
- package/dist/sites/hotels/generate.js.map +1 -0
- package/dist/sites/pizza/catalog.d.ts +34 -0
- package/dist/sites/pizza/catalog.js +65 -0
- package/dist/sites/pizza/catalog.js.map +1 -0
- package/dist/sites/pizza/generate.d.ts +19 -0
- package/dist/sites/pizza/generate.js +203 -0
- package/dist/sites/pizza/generate.js.map +1 -0
- package/dist/sites/pizza/index.d.ts +4 -0
- package/dist/sites/pizza/index.js +4 -0
- package/dist/sites/pizza/index.js.map +1 -0
- package/dist/sites/pizza/rules.d.ts +134 -0
- package/dist/sites/pizza/rules.js +217 -0
- package/dist/sites/pizza/rules.js.map +1 -0
- package/dist/sites/pizza/types.d.ts +114 -0
- package/dist/sites/pizza/types.js +2 -0
- package/dist/sites/pizza/types.js.map +1 -0
- package/dist/sites/rows.d.ts +14 -0
- package/dist/sites/rows.js +45 -0
- package/dist/sites/rows.js.map +1 -0
- package/dist/sites/sports/generate.d.ts +18 -0
- package/dist/sites/sports/generate.js +247 -0
- package/dist/sites/sports/generate.js.map +1 -0
- package/dist/sites/sports/index.d.ts +3 -0
- package/dist/sites/sports/index.js +3 -0
- package/dist/sites/sports/index.js.map +1 -0
- package/dist/sites/sports/rules.d.ts +110 -0
- package/dist/sites/sports/rules.js +139 -0
- package/dist/sites/sports/rules.js.map +1 -0
- package/dist/sites/sports/types.d.ts +91 -0
- package/dist/sites/sports/types.js +8 -0
- package/dist/sites/sports/types.js.map +1 -0
- package/dist/stays.d.ts +63 -0
- package/dist/stays.js +96 -0
- package/dist/stays.js.map +1 -0
- package/dist/web-v1/index.js +2 -0
- package/dist/web-v1/index.js.map +1 -1
- package/dist/webmcp-v1/index.d.ts +11 -0
- package/dist/webmcp-v1/index.js +26 -0
- package/dist/webmcp-v1/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { isDate } from "../../stays.js";
|
|
2
|
+
import { EVENT_WEEKDAYS } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The office events site's rules, as pure functions over rows. apps/events
|
|
5
|
+
* enforces them inside every write's transaction and answers every room
|
|
6
|
+
* search with them, and the intent corpus derives its answer keys with them,
|
|
7
|
+
* so the site and the keys cannot disagree about what is free, what fits or
|
|
8
|
+
* who can register.
|
|
9
|
+
*/
|
|
10
|
+
/** The dates events can be held on. Fixed, not "from today", so a seed means the same calendar forever. */
|
|
11
|
+
export const EVENT_WINDOW = { first: "2027-01-01", last: "2027-12-31" };
|
|
12
|
+
/** Start and end times fall on the quarter hour. */
|
|
13
|
+
export const EVENT_STEP_MINUTES = 15;
|
|
14
|
+
export const EVENT_MAX_MINUTES = 8 * 60;
|
|
15
|
+
const TIME = /^([01]\d|2[0-3]):([0-5]\d)$/;
|
|
16
|
+
const EMAIL = /^[^\s@]+@[^\s@.]+(\.[^\s@.]+)*\.[A-Za-z]{2,}$/;
|
|
17
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
18
|
+
/** "HH:MM", 24-hour, on the quarter hour. */
|
|
19
|
+
export function isEventTime(s) {
|
|
20
|
+
return TIME.test(s) && Number(s.slice(3, 5)) % EVENT_STEP_MINUTES === 0;
|
|
21
|
+
}
|
|
22
|
+
export function isEventEmail(s) {
|
|
23
|
+
return EMAIL.test(s.trim());
|
|
24
|
+
}
|
|
25
|
+
export const eventMinutes = (t) => Number(t.slice(0, 2)) * 60 + Number(t.slice(3, 5));
|
|
26
|
+
export const eventTimeOf = (minutes) => `${pad(Math.floor(minutes / 60))}:${pad(minutes % 60)}`;
|
|
27
|
+
export function eventWeekday(date) {
|
|
28
|
+
return EVENT_WEEKDAYS[(new Date(`${date}T00:00:00Z`).getUTCDay() + 6) % 7];
|
|
29
|
+
}
|
|
30
|
+
/** Two slots overlap when they share a date and some minute: back to back (one ends as the other starts) is not an overlap. */
|
|
31
|
+
export function eventsOverlap(a, b) {
|
|
32
|
+
return a.date === b.date && a.startTime < b.endTime && b.startTime < a.endTime;
|
|
33
|
+
}
|
|
34
|
+
/** A guest list as the site stores it: trimmed, lowercased, each email once, the organiser left out, sorted. */
|
|
35
|
+
export function eventGuestList(emails, organiserEmail) {
|
|
36
|
+
const organiser = organiserEmail.trim().toLowerCase();
|
|
37
|
+
return [...new Set(emails.map((e) => e.trim().toLowerCase()).filter((e) => e && e !== organiser))].sort();
|
|
38
|
+
}
|
|
39
|
+
/** An office by its code or its city, case-insensitive. */
|
|
40
|
+
export function eventOfficeOf(offices, key) {
|
|
41
|
+
const k = key.trim().toLowerCase();
|
|
42
|
+
return offices.find((o) => o.code.toLowerCase() === k || o.city.toLowerCase() === k);
|
|
43
|
+
}
|
|
44
|
+
/** The scheduled event holding the room for any part of the slot, other than `exceptCode`. Cancelled events hold nothing. */
|
|
45
|
+
export function eventRoomClash(rows, roomCode, slot, exceptCode) {
|
|
46
|
+
return rows.events.find((e) => e.roomCode === roomCode && e.status === "scheduled" && e.code !== exceptCode && eventsOverlap(e, slot)) ?? null;
|
|
47
|
+
}
|
|
48
|
+
export function eventRegisteredCount(rows, eventCode) {
|
|
49
|
+
return rows.registrations.filter((r) => r.eventCode === eventCode && r.status === "registered").length;
|
|
50
|
+
}
|
|
51
|
+
/** Places still open to registration: the place limit less the active registrations; null for an invitation-only event. */
|
|
52
|
+
export function eventPlacesLeft(rows, event) {
|
|
53
|
+
return event.places === null ? null : Math.max(0, event.places - eventRegisteredCount(rows, event.code));
|
|
54
|
+
}
|
|
55
|
+
/** Why an office cannot hold anything at that time: the date, the window, the times, the length, the open days, the hours. */
|
|
56
|
+
export function eventTimeProblem(office, slot) {
|
|
57
|
+
if (!isDate(slot.date))
|
|
58
|
+
return { code: "BAD_DATE", message: `${slot.date} is not a date (YYYY-MM-DD)` };
|
|
59
|
+
if (slot.date < EVENT_WINDOW.first || slot.date > EVENT_WINDOW.last)
|
|
60
|
+
return { code: "OUTSIDE_WINDOW", message: `events can be held from ${EVENT_WINDOW.first} to ${EVENT_WINDOW.last}` };
|
|
61
|
+
if (!isEventTime(slot.startTime) || !isEventTime(slot.endTime))
|
|
62
|
+
return { code: "BAD_TIME", message: "start and end times are HH:MM (24-hour) on the quarter hour" };
|
|
63
|
+
if (slot.endTime <= slot.startTime)
|
|
64
|
+
return { code: "END_BEFORE_START", message: `an event must end after it starts (${slot.startTime} to ${slot.endTime})` };
|
|
65
|
+
if (eventMinutes(slot.endTime) - eventMinutes(slot.startTime) > EVENT_MAX_MINUTES)
|
|
66
|
+
return { code: "TOO_LONG", message: `an event lasts at most ${EVENT_MAX_MINUTES / 60} hours` };
|
|
67
|
+
if (!office.openDays.includes(eventWeekday(slot.date)))
|
|
68
|
+
return { code: "OFFICE_CLOSED", message: `the ${office.name} is closed on ${slot.date} (open ${office.openDays.join(", ")})` };
|
|
69
|
+
if (slot.startTime < office.opensAt || slot.endTime > office.closesAt)
|
|
70
|
+
return { code: "OUTSIDE_HOURS", message: `the ${office.name} is open from ${office.opensAt} to ${office.closesAt}` };
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
/** Everyone the room must hold: the organiser, each invited guest, and every place open to registration. */
|
|
74
|
+
export function eventHeadcount(draft) {
|
|
75
|
+
return 1 + eventGuestList(draft.guestEmails, draft.organiserEmail).length + (draft.places ?? 0);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The rule every new or changed event is held to: a title, a room, a time the
|
|
79
|
+
* office is open, a directory organiser, valid guest emails, places only on an
|
|
80
|
+
* open event, a room that holds everyone, and a room free for the whole time.
|
|
81
|
+
*/
|
|
82
|
+
export function eventDraftProblem(rows, draft, exceptCode) {
|
|
83
|
+
if (!draft.title.trim())
|
|
84
|
+
return { code: "NO_TITLE", message: "an event needs a title" };
|
|
85
|
+
const room = rows.rooms.find((r) => r.code === draft.roomCode);
|
|
86
|
+
if (!room)
|
|
87
|
+
return { code: "UNKNOWN_ROOM", message: `no room ${draft.roomCode}` };
|
|
88
|
+
const office = rows.offices.find((o) => o.code === room.officeCode);
|
|
89
|
+
const slot = { date: draft.date, startTime: draft.startTime, endTime: draft.endTime };
|
|
90
|
+
const time = eventTimeProblem(office, slot);
|
|
91
|
+
if (time)
|
|
92
|
+
return time;
|
|
93
|
+
const organiser = draft.organiserEmail.trim().toLowerCase();
|
|
94
|
+
if (!rows.people.some((p) => p.email === organiser))
|
|
95
|
+
return { code: "UNKNOWN_ORGANISER", message: `${draft.organiserEmail} is not in the staff directory; only staff can organise an event` };
|
|
96
|
+
const bad = draft.guestEmails.find((e) => !isEventEmail(e));
|
|
97
|
+
if (bad !== undefined)
|
|
98
|
+
return { code: "BAD_GUEST_EMAIL", message: `"${bad}" is not an email address` };
|
|
99
|
+
if (draft.registration === "open" && (draft.places === null || !Number.isInteger(draft.places) || draft.places < 1))
|
|
100
|
+
return { code: "BAD_PLACES", message: "an event open to registration needs at least one place" };
|
|
101
|
+
if (draft.registration === "invite-only" && draft.places !== null)
|
|
102
|
+
return { code: "BAD_PLACES", message: "an invitation-only event has no places to register for" };
|
|
103
|
+
const people = eventHeadcount(draft);
|
|
104
|
+
if (people > room.capacity)
|
|
105
|
+
return { code: "OVER_CAPACITY", message: `${room.name} (${room.code}) holds ${room.capacity} people; this event needs ${people} (the organiser, the guests and the places)` };
|
|
106
|
+
const clash = eventRoomClash(rows, room.code, slot, exceptCode);
|
|
107
|
+
if (clash)
|
|
108
|
+
return { code: "ROOM_TAKEN", message: `${room.name} (${room.code}) is taken from ${clash.startTime} to ${clash.endTime} on ${clash.date} by ${clash.code}` };
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
/** Only the organiser changes an event, a cancelled one never, and never down to fewer places than people registered. */
|
|
112
|
+
export function eventChangeProblem(rows, event, actingEmail, next) {
|
|
113
|
+
if (event.status === "cancelled")
|
|
114
|
+
return { code: "EVENT_CANCELLED", message: `${event.code} is cancelled` };
|
|
115
|
+
if (actingEmail.trim().toLowerCase() !== event.organiserEmail)
|
|
116
|
+
return { code: "NOT_ORGANISER", message: `only the organiser of ${event.code} can change it` };
|
|
117
|
+
const registered = eventRegisteredCount(rows, event.code);
|
|
118
|
+
if (registered > 0 && (next.registration === "invite-only" || (next.places ?? 0) < registered)) {
|
|
119
|
+
return { code: "PLACES_BELOW_REGISTERED", message: `${registered} people are registered for ${event.code}; it needs at least that many places` };
|
|
120
|
+
}
|
|
121
|
+
return eventDraftProblem(rows, next, event.code);
|
|
122
|
+
}
|
|
123
|
+
export function eventCancelProblem(event, actingEmail) {
|
|
124
|
+
if (event.status === "cancelled")
|
|
125
|
+
return { code: "ALREADY_CANCELLED", message: `${event.code} is already cancelled` };
|
|
126
|
+
if (actingEmail.trim().toLowerCase() !== event.organiserEmail)
|
|
127
|
+
return { code: "NOT_ORGANISER", message: `only the organiser of ${event.code} can cancel it` };
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Who can register for an event: it is scheduled and open to registration, the
|
|
132
|
+
* person is not registered for it already, a place is left, and they are not
|
|
133
|
+
* registered for another scheduled event at an overlapping time.
|
|
134
|
+
*/
|
|
135
|
+
export function eventRegisterProblem(rows, event, who) {
|
|
136
|
+
if (!who.name.trim())
|
|
137
|
+
return { code: "NO_NAME", message: "a registration needs the person's name" };
|
|
138
|
+
if (!isEventEmail(who.email))
|
|
139
|
+
return { code: "BAD_EMAIL", message: `"${who.email}" is not an email address` };
|
|
140
|
+
if (event.status === "cancelled")
|
|
141
|
+
return { code: "EVENT_CANCELLED", message: `${event.code} is cancelled` };
|
|
142
|
+
if (event.registration === "invite-only")
|
|
143
|
+
return { code: "INVITE_ONLY", message: `${event.code} is by invitation only` };
|
|
144
|
+
const email = who.email.trim().toLowerCase();
|
|
145
|
+
const mine = rows.registrations.filter((r) => r.email === email && r.status === "registered");
|
|
146
|
+
if (mine.some((r) => r.eventCode === event.code))
|
|
147
|
+
return { code: "ALREADY_REGISTERED", message: `${email} is already registered for ${event.code}` };
|
|
148
|
+
if ((eventPlacesLeft(rows, event) ?? 0) < 1)
|
|
149
|
+
return { code: "FULL", message: `${event.code} is full: all ${event.places} places are taken` };
|
|
150
|
+
const byCode = new Map(rows.events.map((e) => [e.code, e]));
|
|
151
|
+
for (const r of mine) {
|
|
152
|
+
const other = byCode.get(r.eventCode);
|
|
153
|
+
if (other && other.status === "scheduled" && eventsOverlap(other, event)) {
|
|
154
|
+
return { code: "OVERLAP", message: `${email} is registered for ${other.code} "${other.title}", ${other.date} ${other.startTime}–${other.endTime}, which overlaps` };
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
/** Rooms in the office that hold the people, have every piece of equipment asked, are step-free when asked, and are free the whole time — smallest first. */
|
|
160
|
+
export function eventFreeRooms(rows, q) {
|
|
161
|
+
const office = rows.offices.find((o) => o.code === q.officeCode);
|
|
162
|
+
const slot = { date: q.date, startTime: q.startTime, endTime: q.endTime };
|
|
163
|
+
if (!office || eventTimeProblem(office, slot))
|
|
164
|
+
return [];
|
|
165
|
+
const wanted = (q.equipment ?? []).map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
166
|
+
return rows.rooms
|
|
167
|
+
.filter((r) => r.officeCode === office.code && r.capacity >= q.people && wanted.every((e) => r.equipment.includes(e)) && (!q.accessible || r.accessible))
|
|
168
|
+
.filter((r) => !eventRoomClash(rows, r.code, slot))
|
|
169
|
+
.sort((x, y) => x.capacity - y.capacity || x.code.localeCompare(y.code))
|
|
170
|
+
.map((r) => ({ roomCode: r.code, roomName: r.name, officeCode: r.officeCode, floor: r.floor, capacity: r.capacity, equipment: [...r.equipment], accessible: r.accessible }));
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/sites/events/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqH,MAAM,YAAY,CAAC;AAE/J;;;;;;GAMG;AAEH,2GAA2G;AAC3G,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAW,CAAC;AACjF,oDAAoD;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,CAAC;AAqBxC,MAAM,IAAI,GAAG,6BAA6B,CAAC;AAC3C,MAAM,KAAK,GAAG,+CAA+C,CAAC;AAC9D,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAEtD,6CAA6C;AAC7C,MAAM,UAAU,WAAW,CAAC,CAAS;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,kBAAkB,KAAK,CAAC,CAAC;AAC1E,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,CAAS;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9B,CAAC;AACD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,E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CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACvE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AACjL,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The office events site (apps/events): offices with meeting rooms and
|
|
3
|
+
* opening hours, a staff directory, events booked into rooms, and
|
|
4
|
+
* registrations for the events that are open to them. Natural keys only
|
|
5
|
+
* (`OF-VEL`, `VEL-R2`, `EV-1001`, `RG-3001`, an email for a person), no
|
|
6
|
+
* database ids. Rules: ./rules.ts.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EVENT_WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
9
|
+
export type EventWeekday = (typeof EVENT_WEEKDAYS)[number];
|
|
10
|
+
export type EventOffice = {
|
|
11
|
+
code: string;
|
|
12
|
+
name: string;
|
|
13
|
+
city: string;
|
|
14
|
+
address: string;
|
|
15
|
+
/** "HH:MM", 24-hour. An event must start at or after opensAt and end at or before closesAt. */
|
|
16
|
+
opensAt: string;
|
|
17
|
+
closesAt: string;
|
|
18
|
+
/** The days the office is open, Monday first. */
|
|
19
|
+
openDays: EventWeekday[];
|
|
20
|
+
};
|
|
21
|
+
export declare const EVENT_EQUIPMENT: readonly ["projector", "video conferencing", "whiteboard"];
|
|
22
|
+
export type EventEquipment = (typeof EVENT_EQUIPMENT)[number];
|
|
23
|
+
export type EventRoom = {
|
|
24
|
+
code: string;
|
|
25
|
+
officeCode: string;
|
|
26
|
+
name: string;
|
|
27
|
+
floor: number;
|
|
28
|
+
/** How many people the room holds, the organiser included. */
|
|
29
|
+
capacity: number;
|
|
30
|
+
equipment: EventEquipment[];
|
|
31
|
+
/** Step-free access. */
|
|
32
|
+
accessible: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** A member of staff in the directory. Only directory people can organise an event; anyone with a valid email can be invited or register. */
|
|
35
|
+
export type EventPerson = {
|
|
36
|
+
email: string;
|
|
37
|
+
name: string;
|
|
38
|
+
officeCode: string;
|
|
39
|
+
team: string;
|
|
40
|
+
};
|
|
41
|
+
export type EventRegistrationMode = "invite-only" | "open";
|
|
42
|
+
export type EventStatus = "scheduled" | "cancelled";
|
|
43
|
+
export type OfficeEvent = {
|
|
44
|
+
code: string;
|
|
45
|
+
title: string;
|
|
46
|
+
description: string;
|
|
47
|
+
/** "YYYY-MM-DD". */
|
|
48
|
+
date: string;
|
|
49
|
+
/** "HH:MM", 24-hour; the event holds its room from startTime up to endTime. */
|
|
50
|
+
startTime: string;
|
|
51
|
+
endTime: string;
|
|
52
|
+
officeCode: string;
|
|
53
|
+
roomCode: string;
|
|
54
|
+
organiserEmail: string;
|
|
55
|
+
/** Invited guests, lowercased, unique, sorted; never the organiser. */
|
|
56
|
+
guestEmails: string[];
|
|
57
|
+
registration: EventRegistrationMode;
|
|
58
|
+
/** Places open to registration; null for an invitation-only event. */
|
|
59
|
+
places: number | null;
|
|
60
|
+
status: EventStatus;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
};
|
|
63
|
+
export type EventRegistrationStatus = "registered" | "cancelled";
|
|
64
|
+
export type EventRegistration = {
|
|
65
|
+
regNo: string;
|
|
66
|
+
eventCode: string;
|
|
67
|
+
name: string;
|
|
68
|
+
email: string;
|
|
69
|
+
status: EventRegistrationStatus;
|
|
70
|
+
createdAt: string;
|
|
71
|
+
};
|
|
72
|
+
export type EventRows = {
|
|
73
|
+
offices: EventOffice[];
|
|
74
|
+
rooms: EventRoom[];
|
|
75
|
+
people: EventPerson[];
|
|
76
|
+
events: OfficeEvent[];
|
|
77
|
+
registrations: EventRegistration[];
|
|
78
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The office events site (apps/events): offices with meeting rooms and
|
|
3
|
+
* opening hours, a staff directory, events booked into rooms, and
|
|
4
|
+
* registrations for the events that are open to them. Natural keys only
|
|
5
|
+
* (`OF-VEL`, `VEL-R2`, `EV-1001`, `RG-3001`, an email for a person), no
|
|
6
|
+
* database ids. Rules: ./rules.ts.
|
|
7
|
+
*/
|
|
8
|
+
export const EVENT_WEEKDAYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
9
|
+
export const EVENT_EQUIPMENT = ["projector", "video conferencing", "whiteboard"];
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sites/events/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAezF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,oBAAoB,EAAE,YAAY,CAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FlightRows } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The flight booking site's rows: an airport in each of the six cities, two
|
|
4
|
+
* hubs that one-stop flights stop at, four carriers, flights both ways
|
|
5
|
+
* between every pair of cities, their cabins, and bookings already made.
|
|
6
|
+
* Drawn from a stream of its own (`substream(seed, "flights")`), so adding the
|
|
7
|
+
* site moved no other row. Some cabins are sold out on some dates on purpose,
|
|
8
|
+
* and some have only a seat or two left: a search has to check seats, not
|
|
9
|
+
* just fares.
|
|
10
|
+
*/
|
|
11
|
+
export declare const FLIGHT_SIZES: {
|
|
12
|
+
readonly flightsPerRoute: readonly [2, 4];
|
|
13
|
+
readonly hubs: 2;
|
|
14
|
+
readonly carriers: 4;
|
|
15
|
+
readonly travellers: 30;
|
|
16
|
+
readonly bookings: 50;
|
|
17
|
+
readonly roundTrips: 14;
|
|
18
|
+
readonly soldOut: 18;
|
|
19
|
+
readonly nearlyFull: 10;
|
|
20
|
+
};
|
|
21
|
+
export declare function flightRows(seed: number): FlightRows;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { CITY_LIST, FIRST_NAMES, LAST_NAMES, word } from "../../acme-v1/names.js";
|
|
2
|
+
import { int, pick, substream } from "../../prng.js";
|
|
3
|
+
import { addDays } from "../../stays.js";
|
|
4
|
+
import { flightSeatsLeft, flightTotalCents } from "./rules.js";
|
|
5
|
+
/**
|
|
6
|
+
* The flight booking site's rows: an airport in each of the six cities, two
|
|
7
|
+
* hubs that one-stop flights stop at, four carriers, flights both ways
|
|
8
|
+
* between every pair of cities, their cabins, and bookings already made.
|
|
9
|
+
* Drawn from a stream of its own (`substream(seed, "flights")`), so adding the
|
|
10
|
+
* site moved no other row. Some cabins are sold out on some dates on purpose,
|
|
11
|
+
* and some have only a seat or two left: a search has to check seats, not
|
|
12
|
+
* just fares.
|
|
13
|
+
*/
|
|
14
|
+
export const FLIGHT_SIZES = { flightsPerRoute: [2, 4], hubs: 2, carriers: 4, travellers: 30, bookings: 50, roundTrips: 14, soldOut: 18, nearlyFull: 10 };
|
|
15
|
+
/** Seeded departures fall in March and April; May and June stay empty, so a write there never meets a seeded booking. */
|
|
16
|
+
const BUSY_FROM = "2027-03-01";
|
|
17
|
+
const BUSY_DAYS = 61;
|
|
18
|
+
const CARRIER_SUFFIXES = ["Air", "Airways", "Wings", "Aviation"];
|
|
19
|
+
const AIRPORT_SUFFIXES = ["International", "Airport", "Field"];
|
|
20
|
+
const MINUTES = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55];
|
|
21
|
+
const LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
22
|
+
const dist = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
23
|
+
const round5 = (n) => Math.round(n / 5) * 5;
|
|
24
|
+
const roundTo5Dollars = (cents) => Math.max(500, Math.round(cents / 500) * 500);
|
|
25
|
+
const hhmm = (minutes) => `${String(Math.floor(minutes / 60) % 24).padStart(2, "0")}:${String(minutes % 60).padStart(2, "0")}`;
|
|
26
|
+
/** A code from the place's own letters: its first, then two more in order. */
|
|
27
|
+
function codeFor(rng, place, taken) {
|
|
28
|
+
const letters = place.toUpperCase().replace(/[^A-Z]/g, "");
|
|
29
|
+
for (;;) {
|
|
30
|
+
const i = int(rng, 1, letters.length - 2);
|
|
31
|
+
const j = int(rng, i + 1, letters.length - 1);
|
|
32
|
+
const code = `${letters[0]}${letters[i]}${letters[j]}`;
|
|
33
|
+
if (!taken.has(code)) {
|
|
34
|
+
taken.add(code);
|
|
35
|
+
return code;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function makeAirports(rng) {
|
|
40
|
+
const taken = new Set();
|
|
41
|
+
const at = new Map();
|
|
42
|
+
const airports = [];
|
|
43
|
+
for (const city of CITY_LIST) {
|
|
44
|
+
const code = codeFor(rng, city, taken);
|
|
45
|
+
airports.push({ code, name: `${city} ${pick(rng, AIRPORT_SUFFIXES)}`, city, hub: false });
|
|
46
|
+
at.set(code, { x: int(rng, 0, 100), y: int(rng, 0, 100) });
|
|
47
|
+
}
|
|
48
|
+
const names = new Set(CITY_LIST);
|
|
49
|
+
for (let i = 0; i < FLIGHT_SIZES.hubs; i++) {
|
|
50
|
+
let city = "";
|
|
51
|
+
do
|
|
52
|
+
city = word(rng, 2);
|
|
53
|
+
while (names.has(city));
|
|
54
|
+
names.add(city);
|
|
55
|
+
const code = codeFor(rng, city, taken);
|
|
56
|
+
airports.push({ code, name: `${city} Junction`, city, hub: true });
|
|
57
|
+
at.set(code, { x: int(rng, 30, 70), y: int(rng, 30, 70) });
|
|
58
|
+
}
|
|
59
|
+
return { airports, at };
|
|
60
|
+
}
|
|
61
|
+
function makeCarriers(rng) {
|
|
62
|
+
const out = [];
|
|
63
|
+
const initials = new Set();
|
|
64
|
+
while (out.length < FLIGHT_SIZES.carriers) {
|
|
65
|
+
const name = `${word(rng, 2)} ${pick(rng, CARRIER_SUFFIXES)}`;
|
|
66
|
+
const code = `${name[0]}${pick(rng, [...LETTERS])}`;
|
|
67
|
+
// One carrier per initial, so no two carriers' names or codes start alike.
|
|
68
|
+
if (initials.has(code[0]))
|
|
69
|
+
continue;
|
|
70
|
+
initials.add(code[0]);
|
|
71
|
+
out.push({ code, name, bagFeeCents: int(rng, 5, 9) * 500, maxBags: int(rng, 1, 3) });
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
function makeFlights(rng, airports, at, carriers) {
|
|
76
|
+
const cities = airports.filter((a) => !a.hub);
|
|
77
|
+
const hubs = airports.filter((a) => a.hub);
|
|
78
|
+
const factor = new Map(carriers.map((c) => [c.code, 0.85 + rng() * 0.4]));
|
|
79
|
+
const numbers = new Set();
|
|
80
|
+
const flights = [];
|
|
81
|
+
const cabins = [];
|
|
82
|
+
const leg = (a, b) => round5(45 + dist(at.get(a), at.get(b)) * 2);
|
|
83
|
+
for (const from of cities) {
|
|
84
|
+
for (const to of cities) {
|
|
85
|
+
if (from === to)
|
|
86
|
+
continue;
|
|
87
|
+
const count = int(rng, FLIGHT_SIZES.flightsPerRoute[0], FLIGHT_SIZES.flightsPerRoute[1]);
|
|
88
|
+
for (let i = 0; i < count; i++) {
|
|
89
|
+
const carrier = pick(rng, carriers);
|
|
90
|
+
let flightNo = "";
|
|
91
|
+
do
|
|
92
|
+
flightNo = `${carrier.code}${int(rng, 100, 989)}`;
|
|
93
|
+
while (numbers.has(flightNo));
|
|
94
|
+
numbers.add(flightNo);
|
|
95
|
+
const via = i > 0 && rng() < 0.45 ? pick(rng, hubs).code : null;
|
|
96
|
+
const durationMinutes = via ? leg(from.code, via) + int(rng, 9, 19) * 5 + leg(via, to.code) : leg(from.code, to.code);
|
|
97
|
+
const dep = int(rng, 6, 21) * 60 + pick(rng, MINUTES);
|
|
98
|
+
flights.push({ flightNo, carrierCode: carrier.code, origin: from.code, destination: to.code, via, stops: via ? 1 : 0, departs: hhmm(dep), arrives: hhmm(dep + durationMinutes), arrivesNextDay: dep + durationMinutes >= 1440, durationMinutes });
|
|
99
|
+
const economy = (4900 + dist(at.get(from.code), at.get(to.code)) * 160) * factor.get(carrier.code) * (via ? 0.78 : 1) * (0.9 + rng() * 0.25);
|
|
100
|
+
const sells = [
|
|
101
|
+
["economy", true, 1, int(rng, 5, 9)],
|
|
102
|
+
["premium", rng() < 0.45, 1.7, int(rng, 2, 4)],
|
|
103
|
+
["business", rng() < 0.6, 2.9, int(rng, 2, 4)],
|
|
104
|
+
];
|
|
105
|
+
for (const [cabin, sold, mult, seats] of sells)
|
|
106
|
+
if (sold)
|
|
107
|
+
cabins.push({ flightNo, cabin, priceCents: roundTo5Dollars(economy * mult), seats });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { flights, cabins };
|
|
112
|
+
}
|
|
113
|
+
function makeTravellers(rng) {
|
|
114
|
+
const out = new Map();
|
|
115
|
+
while (out.size < FLIGHT_SIZES.travellers) {
|
|
116
|
+
const first = pick(rng, FIRST_NAMES);
|
|
117
|
+
const last = pick(rng, LAST_NAMES);
|
|
118
|
+
const email = `${first}.${last}${int(rng, 1, 9)}@example.com`.toLowerCase();
|
|
119
|
+
if (!out.has(email))
|
|
120
|
+
out.set(email, { name: `${first} ${last}`, email });
|
|
121
|
+
}
|
|
122
|
+
return [...out.values()];
|
|
123
|
+
}
|
|
124
|
+
export function flightRows(seed) {
|
|
125
|
+
const rng = substream(seed, "flights");
|
|
126
|
+
const { airports, at } = makeAirports(rng);
|
|
127
|
+
const carriers = makeCarriers(rng);
|
|
128
|
+
const { flights, cabins } = makeFlights(rng, airports, at, carriers);
|
|
129
|
+
const travellers = makeTravellers(rng);
|
|
130
|
+
const carrierOf = new Map(carriers.map((c) => [c.code, c]));
|
|
131
|
+
const flightOf = new Map(flights.map((f) => [f.flightNo, f]));
|
|
132
|
+
const cabinsOf = (flightNo) => cabins.filter((c) => c.flightNo === flightNo);
|
|
133
|
+
const bookings = [];
|
|
134
|
+
const busyDate = () => addDays(BUSY_FROM, int(rng, 0, BUSY_DAYS - 1));
|
|
135
|
+
const companion = () => `${pick(rng, FIRST_NAMES)} ${pick(rng, LAST_NAMES)}`;
|
|
136
|
+
const partyOf = (lead, size) => [lead, ...Array.from({ length: size - 1 }, companion)];
|
|
137
|
+
const book = (cabin, date, party, bags, contactEmail, status) => {
|
|
138
|
+
const carrier = carrierOf.get(flightOf.get(cabin.flightNo).carrierCode);
|
|
139
|
+
bookings.push({
|
|
140
|
+
bookingNo: `BK-${10001 + bookings.length}`,
|
|
141
|
+
flightNo: cabin.flightNo,
|
|
142
|
+
date,
|
|
143
|
+
cabin: cabin.cabin,
|
|
144
|
+
passengers: party.map((name) => ({ name })),
|
|
145
|
+
bags,
|
|
146
|
+
contactEmail,
|
|
147
|
+
status,
|
|
148
|
+
totalCents: flightTotalCents(carrier, cabin, party.length, bags),
|
|
149
|
+
createdAt: new Date(Date.UTC(2027, 0, 2 + int(rng, 0, 50), int(rng, 7, 21), int(rng, 0, 59))).toISOString(),
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
const bagsFor = (cabin) => int(rng, 0, carrierOf.get(flightOf.get(cabin.flightNo).carrierCode).maxBags);
|
|
153
|
+
const pickCabin = (flightNo) => {
|
|
154
|
+
const sold = cabinsOf(flightNo);
|
|
155
|
+
const r = rng();
|
|
156
|
+
return sold.find((c) => c.cabin === (r < 0.6 ? "economy" : r < 0.85 ? "business" : "premium")) ?? sold[0];
|
|
157
|
+
};
|
|
158
|
+
for (let i = 0; i < FLIGHT_SIZES.bookings; i++) {
|
|
159
|
+
const cabin = pickCabin(pick(rng, flights).flightNo);
|
|
160
|
+
const date = busyDate();
|
|
161
|
+
const who = pick(rng, travellers);
|
|
162
|
+
const party = partyOf(who.name, int(rng, 1, 3));
|
|
163
|
+
const status = rng() < 0.15 ? "cancelled" : "confirmed";
|
|
164
|
+
if (status === "confirmed" && flightSeatsLeft(cabin, bookings, date) < party.length)
|
|
165
|
+
continue;
|
|
166
|
+
book(cabin, date, party, bagsFor(cabin), who.email, status);
|
|
167
|
+
}
|
|
168
|
+
// Round trips: the same party out and back, two bookings, a few days apart.
|
|
169
|
+
for (let i = 0; i < FLIGHT_SIZES.roundTrips; i++) {
|
|
170
|
+
const out = pick(rng, flights);
|
|
171
|
+
const back = pick(rng, flights.filter((f) => f.origin === out.destination && f.destination === out.origin));
|
|
172
|
+
const outCabin = pickCabin(out.flightNo);
|
|
173
|
+
const backCabin = cabinsOf(back.flightNo).find((c) => c.cabin === outCabin.cabin) ?? cabinsOf(back.flightNo)[0];
|
|
174
|
+
// Out and back inside the busy span, so the quiet months stay empty.
|
|
175
|
+
const date = addDays(BUSY_FROM, int(rng, 0, BUSY_DAYS - 10));
|
|
176
|
+
const returnDate = addDays(date, int(rng, 2, 9));
|
|
177
|
+
const who = pick(rng, travellers);
|
|
178
|
+
const party = partyOf(who.name, int(rng, 1, 2));
|
|
179
|
+
const bags = Math.min(bagsFor(outCabin), bagsFor(backCabin));
|
|
180
|
+
if (flightSeatsLeft(outCabin, bookings, date) < party.length || flightSeatsLeft(backCabin, bookings, returnDate) < party.length)
|
|
181
|
+
continue;
|
|
182
|
+
book(outCabin, date, party, bags, who.email, "confirmed");
|
|
183
|
+
book(backCabin, returnDate, party, bags, who.email, "confirmed");
|
|
184
|
+
}
|
|
185
|
+
// Sold out on purpose (every seat of the cabin taken that day), and nearly full (one or two seats left) — on
|
|
186
|
+
// routes where at least three flights sell that cabin, so a traveller has other flights to choose from. Half the
|
|
187
|
+
// time it is the route's cheapest fare in that cabin that went first.
|
|
188
|
+
const sameRoute = (a, b) => a.origin === b.origin && a.destination === b.destination;
|
|
189
|
+
const choice = cabins.filter((c) => {
|
|
190
|
+
const f = flightOf.get(c.flightNo);
|
|
191
|
+
return cabins.filter((o) => o.cabin === c.cabin && sameRoute(flightOf.get(o.flightNo), f)).length >= 3;
|
|
192
|
+
});
|
|
193
|
+
const fill = (blocks, leave) => {
|
|
194
|
+
for (let i = 0; i < blocks; i++) {
|
|
195
|
+
const drawn = pick(rng, choice);
|
|
196
|
+
const rivals = choice.filter((o) => o.cabin === drawn.cabin && sameRoute(flightOf.get(o.flightNo), flightOf.get(drawn.flightNo)));
|
|
197
|
+
const cabin = rng() < 0.5 ? rivals.sort((a, b) => a.priceCents - b.priceCents || a.flightNo.localeCompare(b.flightNo))[0] : drawn;
|
|
198
|
+
const date = busyDate();
|
|
199
|
+
const target = leave();
|
|
200
|
+
while (flightSeatsLeft(cabin, bookings, date) > target) {
|
|
201
|
+
const who = pick(rng, travellers);
|
|
202
|
+
book(cabin, date, partyOf(who.name, Math.min(flightSeatsLeft(cabin, bookings, date) - target, int(rng, 1, 3))), bagsFor(cabin), who.email, "confirmed");
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
fill(FLIGHT_SIZES.soldOut, () => 0);
|
|
207
|
+
fill(FLIGHT_SIZES.nearlyFull, () => int(rng, 1, 2));
|
|
208
|
+
return { airports, carriers, flights, cabins, bookings };
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/sites/flights/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAY,GAAG,EAAE,IAAI,EAAE,SA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Q,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;gBACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;gBAClC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YAC1J,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FLIGHT_SIZES, flightRows } from "./generate.js";
|
|
2
|
+
export { FLIGHT_CABIN_CLASSES, FLIGHT_MAX_PASSENGERS, FLIGHT_WINDOW, flightAirportIs, flightBookingProblem, flightDateInWindow, flightFitProblem, flightSeatsLeft, flightTotalCents, isFlightCabinClass, isFlightTime, searchFlights, type FlightBookingRequest, type FlightOffer, type FlightProblem, type FlightQuery, } from "./rules.js";
|
|
3
|
+
export type { Flight, FlightAirport, FlightBooking, FlightBookingStatus, FlightCabin, FlightCabinClass, FlightCarrier, FlightPassenger, FlightRows } from "./types.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { FLIGHT_SIZES, flightRows } from "./generate.js";
|
|
2
|
+
export { FLIGHT_CABIN_CLASSES, FLIGHT_MAX_PASSENGERS, FLIGHT_WINDOW, flightAirportIs, flightBookingProblem, flightDateInWindow, flightFitProblem, flightSeatsLeft, flightTotalCents, isFlightCabinClass, isFlightTime, searchFlights, } from "./rules.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sites/flights/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,aAAa,GAKd,MAAM,YAAY,CAAC"}
|