@mccaskie-labs/workbench-roster 0.0.0-stage → 0.2.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/ui.js ADDED
@@ -0,0 +1,255 @@
1
+ // The owner's week and staff pages and a person's own page: plain HTML
2
+ // strings, no script of their own, mobile first. Every change is a form post
3
+ // to the project's endpoint (behind the owner's sign-in), which hands the
4
+ // fields to rosterAction with the signed-in owner's account. Every element
5
+ // carries a wb-roster-* class (ROSTER_STYLES), and every control is at least
6
+ // 44 px tall. Taking someone off the roster, removing leave, emailing a new
7
+ // link, publishing and removing a shift from a published week ask "Are you
8
+ // sure?" first (renderConfirm), and rosterAction refuses them without
9
+ // confirm=yes.
10
+ import { confirmed, renderConfirm } from "./confirm.js";
11
+ import { RosterError } from "./errors.js";
12
+ import { dayText, localeFor, spanText, timeText, words } from "./format.js";
13
+ import { addDays, clockMinutes, todayIn } from "./time.js";
14
+ import { ROSTER_WORDS } from "./words.js";
15
+ const esc = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[c]);
16
+ const ctx = (o) => ({ say: words(o), locale: localeFor(o.lang, o.locale), tz: o.config.time_zone });
17
+ const roleTitle = (o, r) => (r ? (o.config.roles?.[r]?.title ?? r) : null);
18
+ const hidden = (fields) => Object.entries(fields).map(([k, v]) => `<input type="hidden" name="${k}" value="${esc(v)}">`).join("");
19
+ const leaveDays = (l, tz) => ({ from: todayIn(tz, new Date(l.starts_at)), to: todayIn(tz, new Date(Date.parse(l.ends_at) - 1)) });
20
+ /** A button that asks "Are you sure?" first, with the roster's class names. */
21
+ const ask = (c, endpoint, fields, o) => renderConfirm({ prefix: "wb-roster", endpoint, fields, ask: o.ask, askClass: o.askClass, question: o.question, consequence: o.consequence, yes: o.yes, no: o.no ?? c.say("confirm.no") });
22
+ function shiftParts(s, o, c, withName) {
23
+ const role = roleTitle(o, s.role);
24
+ return [
25
+ withName ? `<span class="wb-roster-who">${esc(s.staff_name)}</span>` : "",
26
+ `<span class="wb-roster-time">${esc(withName ? `${timeText(s.starts_at, c.tz, c.locale)} – ${timeText(s.ends_at, c.tz, c.locale)}` : spanText(s.starts_at, s.ends_at, c.tz, c.locale))}</span>`,
27
+ role ? `<span class="wb-roster-role">${esc(role)}</span>` : "",
28
+ s.break_minutes ? `<span class="wb-roster-break">${esc(c.say("shift.break", { minutes: s.break_minutes }))}</span>` : "",
29
+ s.note ? `<span class="wb-roster-note">${esc(s.note)}</span>` : "",
30
+ ].join("");
31
+ }
32
+ function gapText(g, o, c) {
33
+ const role = (g.role ? roleTitle(o, g.role) : null) ?? c.say("gaps.anyone");
34
+ const when = `${g.title ? `${g.title}, ` : ""}${spanText(g.start, g.end, c.tz, c.locale)}`;
35
+ return g.rostered === 0 ? c.say("gaps.nobody", { when, role }) : c.say("gaps.short", { when, role, rostered: g.rostered, needed: g.needed });
36
+ }
37
+ const field = (id, label, control) => `<div class="wb-roster-field"><label class="wb-roster-label" for="${id}">${esc(label)}</label>${control}</div>`;
38
+ const option = (value, label, selected = false) => `<option class="wb-roster-option" value="${esc(value)}"${selected ? " selected" : ""}>${esc(label)}</option>`;
39
+ /** Publish, or Send the changes: asks first, saying how many people get the email. */
40
+ function publishAsk(v, o, c) {
41
+ const first = v.status === "draft";
42
+ const date = dayText(v.week, c.locale);
43
+ const n = v.emailing;
44
+ const consequence = n === undefined
45
+ ? c.say(first ? "week.publish.consequence_all" : "week.send.consequence_all")
46
+ : n === 0
47
+ ? c.say(first ? "week.publish.consequence_none" : "week.send.consequence_none")
48
+ : c.say(n === 1 ? (first ? "week.publish.consequence_one" : "week.send.consequence_one") : first ? "week.publish.consequence" : "week.send.consequence", { count: n });
49
+ return ask(c, o.endpoint, { action: "publish", week: v.week }, {
50
+ ask: c.say(first ? "week.publish" : "week.send"),
51
+ askClass: "wb-roster-publish",
52
+ question: c.say(first ? "week.publish.question" : "week.send.question", { date }),
53
+ consequence,
54
+ yes: c.say(first ? "week.publish.yes" : "week.send.yes"),
55
+ no: c.say("week.publish.no"),
56
+ });
57
+ }
58
+ /** The owner's week: its state, Last and Next week, the gaps, each day's shifts with Remove, Add a shift, Publish or Send changes, Copy last week and Download hours. */
59
+ export function renderWeek(v, o) {
60
+ const c = ctx(o);
61
+ const status = v.status === "draft" ? "draft" : v.unsent ? "unsent" : "published";
62
+ const statusText = c.say(status === "draft" ? "week.draft" : status === "unsent" ? "week.unsent" : "week.published");
63
+ const done = o.done ? `<p class="wb-roster-done" role="status">${esc(c.say(`done.${o.done}`))}</p>` : "";
64
+ const nav = `<nav class="wb-roster-nav"><a class="wb-roster-nav-link" href="${esc(o.weekUrl(addDays(v.week, -7)))}">${esc(c.say("week.prev"))}</a><a class="wb-roster-nav-link" href="${esc(o.weekUrl(addDays(v.week, 7)))}">${esc(c.say("week.next"))}</a></nav>`;
65
+ const flagged = new Map((o.gaps?.clashes ?? []).map((x) => [x.shift.id, x.reason]));
66
+ let gaps = "";
67
+ if (o.gaps) {
68
+ const items = [
69
+ ...o.gaps.gaps.map((g) => `<li class="wb-roster-gap">${esc(gapText(g, o, c))}</li>`),
70
+ ...o.gaps.clashes.map((x) => `<li class="wb-roster-gap wb-roster-gap-clash">${esc(`${x.shift.staff_name}: ${c.say(x.reason === "on_leave" ? "shift.on_leave" : "shift.removed")}, ${spanText(x.shift.starts_at, x.shift.ends_at, c.tz, c.locale)}`)}</li>`),
71
+ ];
72
+ gaps = `<section class="wb-roster-gaps"><h3 class="wb-roster-heading">${esc(c.say("gaps.title"))}</h3>${items.length ? `<ul class="wb-roster-gap-list">${items.join("")}</ul>` : `<p class="wb-roster-ok">${esc(c.say("gaps.none"))}</p>`}</section>`;
73
+ }
74
+ const dayHtml = v.days
75
+ .map((d) => {
76
+ const shifts = v.shifts.filter((s) => todayIn(c.tz, new Date(s.starts_at)) === d);
77
+ const list = shifts.length
78
+ ? `<ul class="wb-roster-shifts">${shifts
79
+ .map((s) => {
80
+ const flag = flagged.get(s.id);
81
+ // On a published week the person has been told about this shift, so taking it off asks first.
82
+ const p = { name: s.staff_name, when: spanText(s.starts_at, s.ends_at, c.tz, c.locale) };
83
+ const told = v.staff.some((x) => x.id === s.staff && x.active);
84
+ const remove = v.status === "published"
85
+ ? ask(c, o.endpoint, { action: "remove_shift", shift: s.id, week: v.week }, { ask: c.say("shift.remove"), askClass: "wb-roster-remove", question: c.say("shift.remove.question", p), consequence: c.say(!told ? "shift.remove.consequence_gone" : o.config.changes === "manual" ? "shift.remove.consequence_manual" : "shift.remove.consequence", p), yes: c.say("shift.remove.yes") })
86
+ : `<form class="wb-roster-inline" method="post" action="${esc(o.endpoint)}">${hidden({ action: "remove_shift", shift: s.id, week: v.week })}<button class="wb-roster-remove" type="submit">${esc(c.say("shift.remove"))}</button></form>`;
87
+ return `<li class="wb-roster-shift">${shiftParts(s, o, c, true)}${flag ? `<span class="wb-roster-flag">${esc(c.say(flag === "on_leave" ? "shift.on_leave" : "shift.removed"))}</span>` : ""}${remove}</li>`;
88
+ })
89
+ .join("")}</ul>`
90
+ : `<p class="wb-roster-empty">${esc(c.say("week.none"))}</p>`;
91
+ return `<section class="wb-roster-day"><h3 class="wb-roster-day-title">${esc(dayText(d, c.locale))}</h3>${list}</section>`;
92
+ })
93
+ .join("");
94
+ const active = v.staff.filter((s) => s.active);
95
+ const roles = Object.entries(o.config.roles ?? {});
96
+ const add = active.length
97
+ ? `<form class="wb-roster-form" method="post" action="${esc(o.endpoint)}">${hidden({ action: "add_shift", week: v.week })}<h3 class="wb-roster-heading">${esc(c.say("add.title"))}</h3>${field("wb-roster-staff", c.say("add.person"), `<select class="wb-roster-select" id="wb-roster-staff" name="staff" required>${active.map((s) => option(s.id, s.name)).join("")}</select>`)}${field("wb-roster-on", c.say("add.day"), `<select class="wb-roster-select" id="wb-roster-on" name="day" required>${v.days.map((d) => option(d, dayText(d, c.locale))).join("")}</select>`)}${field("wb-roster-start", c.say("add.start"), `<input class="wb-roster-input" id="wb-roster-start" type="time" name="start" required>`)}${field("wb-roster-end", c.say("add.end"), `<input class="wb-roster-input" id="wb-roster-end" type="time" name="end" required>`)}${roles.length ? field("wb-roster-role", c.say("add.role"), `<select class="wb-roster-select" id="wb-roster-role" name="role">${option("", c.say("add.role_any"))}${roles.map(([k, r]) => option(k, r.title)).join("")}</select>`) : ""}${field("wb-roster-break", c.say("add.break"), `<input class="wb-roster-input" id="wb-roster-break" type="number" name="break" min="0" max="240" step="5" value="0" inputmode="numeric">`)}${field("wb-roster-note", c.say("add.note"), `<input class="wb-roster-input" id="wb-roster-note" type="text" name="note" maxlength="200" autocomplete="off">`)}<button class="wb-roster-button" type="submit">${esc(c.say("add.button"))}</button></form>`
98
+ : "";
99
+ const actions = [
100
+ v.status === "draft" || v.unsent ? publishAsk(v, o, c) : "",
101
+ v.shifts.length === 0 ? `<form class="wb-roster-inline" method="post" action="${esc(o.endpoint)}">${hidden({ action: "copy_week", week: v.week })}<button class="wb-roster-secondary" type="submit">${esc(c.say("week.copy"))}</button></form>` : "",
102
+ o.exportUrl ? `<a class="wb-roster-export" href="${esc(o.exportUrl)}" download>${esc(c.say("week.export"))}</a>` : "",
103
+ ].join("");
104
+ return `<section class="wb-roster-week"><h2 class="wb-roster-title">${esc(c.say("week.title", { date: dayText(v.week, c.locale) }))}</h2><p class="wb-roster-status" data-status="${status}">${esc(statusText)}</p>${done}${nav}${gaps}<div class="wb-roster-days">${dayHtml}</div>${add}${actions ? `<div class="wb-roster-actions">${actions}</div>` : ""}</section>`;
105
+ }
106
+ /** The owner's staff page: each person with their leave, Email them their link, Add leave and Take off the roster; then Add person. */
107
+ export function renderStaff(staff, o) {
108
+ const c = ctx(o);
109
+ const done = o.done ? `<p class="wb-roster-done" role="status">${esc(c.say(`done.${o.done}`))}</p>` : "";
110
+ const roles = Object.entries(o.config.roles ?? {});
111
+ const active = staff.filter((s) => s.active);
112
+ const people = active.length
113
+ ? `<ul class="wb-roster-people">${active
114
+ .map((s) => {
115
+ const detail = [s.email, ...s.roles.map((r) => roleTitle(o, r) ?? r), s.resource].filter(Boolean).join(" · ");
116
+ const theirs = (o.leave ?? []).filter((l) => l.staff === s.id);
117
+ const leave = theirs.length
118
+ ? `<ul class="wb-roster-leave-list">${theirs
119
+ .map((l) => {
120
+ const d = leaveDays(l, c.tz);
121
+ const p = { name: s.name, from: dayText(d.from, c.locale), to: dayText(d.to, c.locale) };
122
+ return `<li class="wb-roster-leave"><span class="wb-roster-time">${esc(c.say("leave.when", p))}</span>${ask(c, o.endpoint, { action: "remove_leave", leave: l.id }, { ask: c.say("leave.remove"), askClass: "wb-roster-remove", question: c.say("leave.remove.question", p), consequence: c.say("leave.remove.consequence", p), yes: c.say("leave.remove.yes") })}</li>`;
123
+ })
124
+ .join("")}</ul>`
125
+ : `<p class="wb-roster-empty">${esc(c.say("leave.none"))}</p>`;
126
+ const id = `wb-roster-${s.id.slice(0, 8)}`;
127
+ const leaveForm = `<form class="wb-roster-form" method="post" action="${esc(o.endpoint)}">${hidden({ action: "add_leave", staff: s.id })}${field(`${id}-from`, c.say("leave.from"), `<input class="wb-roster-input" id="${id}-from" type="date" name="from" required>`)}${field(`${id}-to`, c.say("leave.to"), `<input class="wb-roster-input" id="${id}-to" type="date" name="to" required>`)}<button class="wb-roster-secondary" type="submit">${esc(c.say("leave.add"))}</button></form>`;
128
+ const p = { name: s.name };
129
+ const link = ask(c, o.endpoint, { action: "send_link", staff: s.id }, { ask: c.say("staff.link"), askClass: "wb-roster-secondary", question: c.say("staff.link.question", p), consequence: c.say(s.has_link ? "staff.link.consequence" : "staff.link.consequence_first", p), yes: c.say("staff.link.yes"), no: c.say("staff.link.no") });
130
+ const remove = `<div class="wb-roster-remove-form">${ask(c, o.endpoint, { action: "remove_staff", staff: s.id }, { ask: c.say("staff.remove"), askClass: "wb-roster-danger", question: c.say("staff.remove.question", p), consequence: c.say("staff.remove.consequence", p), yes: c.say("staff.remove.yes", p), no: c.say("staff.remove.no") })}</div>`;
131
+ return `<li class="wb-roster-person"><span class="wb-roster-who">${esc(s.name)}</span><span class="wb-roster-detail">${esc(detail)}</span><span class="wb-roster-flag">${esc(c.say(s.has_link ? "staff.link_sent" : "staff.no_link"))}</span><h3 class="wb-roster-heading">${esc(c.say("leave.title"))}</h3>${leave}${leaveForm}${link}${remove}</li>`;
132
+ })
133
+ .join("")}</ul>`
134
+ : `<p class="wb-roster-empty">${esc(c.say("staff.empty"))}</p>`;
135
+ const roleBoxes = roles.length
136
+ ? `<fieldset class="wb-roster-roles"><legend class="wb-roster-label">${esc(c.say("staff.roles"))}</legend>${roles.map(([k, r]) => `<label class="wb-roster-tick"><input class="wb-roster-check" type="checkbox" name="roles" value="${esc(k)}"> ${esc(r.title)}</label>`).join("")}</fieldset>`
137
+ : "";
138
+ const add = `<form class="wb-roster-form" method="post" action="${esc(o.endpoint)}">${hidden({ action: "save_staff" })}<h3 class="wb-roster-heading">${esc(c.say("staff.add"))}</h3>${field("wb-roster-name", c.say("staff.name"), `<input class="wb-roster-input" id="wb-roster-name" type="text" name="name" maxlength="100" required autocomplete="off">`)}${field("wb-roster-email", c.say("staff.email"), `<input class="wb-roster-input" id="wb-roster-email" type="email" name="email" maxlength="254" required autocomplete="off">`)}${roleBoxes}${field("wb-roster-resource", c.say("staff.resource"), `<input class="wb-roster-input" id="wb-roster-resource" type="text" name="resource" maxlength="40" pattern="[a-z0-9][a-z0-9\\-]*" autocomplete="off">`)}<p class="wb-roster-hint">${esc(c.say("staff.resource_hint"))}</p><button class="wb-roster-button" type="submit">${esc(c.say("staff.add"))}</button></form>`;
139
+ return `<section class="wb-roster-staff"><h2 class="wb-roster-title">${esc(c.say("staff.title"))}</h2>${done}${people}${add}</section>`;
140
+ }
141
+ /** A person's own page, from roster.mine(token): their coming shifts, their leave, and Add my shifts to my calendar. */
142
+ export function renderMyShifts(v, o) {
143
+ const c = ctx(o);
144
+ const shifts = v.shifts.length ? `<ul class="wb-roster-shifts">${v.shifts.map((s) => `<li class="wb-roster-shift">${shiftParts(s, o, c, false)}</li>`).join("")}</ul>` : `<p class="wb-roster-empty">${esc(c.say("mine.none"))}</p>`;
145
+ const leave = v.leave.length
146
+ ? `<ul class="wb-roster-leave-list">${v.leave
147
+ .map((l) => {
148
+ const d = leaveDays(l, c.tz);
149
+ return `<li class="wb-roster-leave"><span class="wb-roster-time">${esc(c.say("mine.leave", { from: dayText(d.from, c.locale), to: dayText(d.to, c.locale) }))}</span></li>`;
150
+ })
151
+ .join("")}</ul>`
152
+ : "";
153
+ const calendar = o.feedUrl ? `<a class="wb-roster-calendar" href="${esc(o.feedUrl)}">${esc(c.say("mine.calendar"))}</a>` : "";
154
+ return `<article class="wb-roster-mine"><h2 class="wb-roster-title">${esc(c.say("mine.title", { name: v.staff.name }))}</h2>${shifts}${leave}${calendar}<p class="wb-roster-hint">${esc(c.say("mine.private"))}</p></article>`;
155
+ }
156
+ /** These can't be undone, so the post must carry the answer to "Are you sure?" (confirm=yes, which renderConfirm's button sends). */
157
+ function needConfirm() {
158
+ throw new RosterError("confirm_needed", ROSTER_WORDS.en["error.confirm_needed"]);
159
+ }
160
+ /** Whether a shift is in a week that isn't published yet (staff haven't seen it). A shift not found in that week asks first. */
161
+ async function inDraft(roster, account, week, shift) {
162
+ if (!week)
163
+ return false;
164
+ const v = await roster.week(account, week);
165
+ return v.status === "draft" && v.shifts.some((s) => s.id === shift);
166
+ }
167
+ const field1 = (body, k) => {
168
+ const v = body[k];
169
+ return typeof v === "string" ? v.trim() : "";
170
+ };
171
+ /**
172
+ * The project's endpoint (behind the owner's sign-in) hands the posted form
173
+ * fields here with the signed-in owner's account: add_shift, remove_shift
174
+ * (needs confirm=yes when the shift is in a published week), publish (also
175
+ * Send changes; needs confirm=yes), copy_week, save_staff, remove_staff
176
+ * (needs confirm=yes), send_link (needs confirm=yes), add_leave and
177
+ * remove_leave (needs confirm=yes). Without it they are refused with
178
+ * `confirm_needed` (409) and nothing changes. Another account's shift or
179
+ * person is answered as unknown.
180
+ */
181
+ export async function rosterAction(roster, body, account) {
182
+ try {
183
+ const action = field1(body, "action");
184
+ const week = field1(body, "week");
185
+ switch (action) {
186
+ case "add_shift": {
187
+ const d = field1(body, "day");
188
+ const from = field1(body, "start");
189
+ const to = field1(body, "end");
190
+ if (clockMinutes(from) === null || clockMinutes(to) === null)
191
+ throw new RosterError("bad_input", "start and end are times such as 09:00");
192
+ // An end at or before the start is the next day: a night shift.
193
+ const end = roster.at((clockMinutes(to) ?? 0) <= (clockMinutes(from) ?? 0) ? addDays(d, 1) : d, to);
194
+ const brk = field1(body, "break");
195
+ const s = await roster.addShift(account, { staff: field1(body, "staff"), start: roster.at(d, from), end, role: field1(body, "role") || null, break_minutes: brk ? Number(brk) : 0, note: field1(body, "note") || null });
196
+ return { status: 200, body: { ok: true, action, done: "add_shift", week: s.week } };
197
+ }
198
+ case "remove_shift":
199
+ // A shift in a draft week is one click; one staff have been told about asks first.
200
+ if (!confirmed(body) && !(await inDraft(roster, account, week, field1(body, "shift"))))
201
+ needConfirm();
202
+ if (!(await roster.removeShift(account, field1(body, "shift"))))
203
+ throw new RosterError("unknown_shift", "no such shift");
204
+ return { status: 200, body: { ok: true, action, done: "remove_shift", ...(week ? { week } : {}) } };
205
+ case "publish": {
206
+ if (!confirmed(body))
207
+ needConfirm();
208
+ const r = await roster.publish(account, week);
209
+ return { status: 200, body: { ok: true, action, done: "publish", week: r.week.week, emailed: r.emailed } };
210
+ }
211
+ case "copy_week": {
212
+ const r = await roster.copyWeek(account, addDays(week, -7), week);
213
+ return { status: 200, body: { ok: true, action, done: "copy", week, copied: r.copied, skipped: r.skipped } };
214
+ }
215
+ case "save_staff": {
216
+ const raw = body.roles;
217
+ const roles = Array.isArray(raw) ? raw.map(String) : typeof raw === "string" && raw ? raw.split(",").map((r) => r.trim()).filter(Boolean) : [];
218
+ const id = field1(body, "id");
219
+ await roster.saveStaff(account, { ...(id ? { id } : {}), name: field1(body, "name"), email: field1(body, "email"), roles, resource: field1(body, "resource") || null });
220
+ return { status: 200, body: { ok: true, action, done: "save_staff" } };
221
+ }
222
+ case "remove_staff":
223
+ if (!confirmed(body))
224
+ needConfirm();
225
+ if (!(await roster.removeStaff(account, field1(body, "staff"))))
226
+ throw new RosterError("unknown_staff", "no such person on the roster");
227
+ return { status: 200, body: { ok: true, action, done: "remove_staff" } };
228
+ case "send_link": {
229
+ if (!confirmed(body))
230
+ needConfirm();
231
+ const r = await roster.sendLink(account, field1(body, "staff"));
232
+ return { status: 200, body: { ok: true, action, done: "send_link", emailed: r.emailed } };
233
+ }
234
+ case "add_leave":
235
+ await roster.addLeave(account, { staff: field1(body, "staff"), from: field1(body, "from"), to: field1(body, "to") });
236
+ return { status: 200, body: { ok: true, action, done: "add_leave" } };
237
+ case "remove_leave":
238
+ if (!confirmed(body))
239
+ needConfirm();
240
+ if (!(await roster.removeLeave(account, field1(body, "leave"))))
241
+ throw new RosterError("unknown_shift", "no such leave");
242
+ return { status: 200, body: { ok: true, action, done: "remove_leave" } };
243
+ default:
244
+ throw new RosterError("bad_input", "action must be add_shift, remove_shift, publish, copy_week, save_staff, remove_staff, send_link, add_leave or remove_leave");
245
+ }
246
+ }
247
+ catch (e) {
248
+ if (e instanceof RosterError) {
249
+ const status = e.code === "unknown_staff" || e.code === "unknown_shift" ? 404 : e.code === "clash" || e.code === "on_leave" || e.code === "taken" || e.code === "not_empty" || e.code === "confirm_needed" ? 409 : e.code === "store_failed" ? 502 : e.code === "bad_config" ? 500 : 400;
250
+ const message = e.code === "store_failed" || e.code === "bad_config" ? "roster: it failed on the app's side (the detail is in the result's cause, for the log)" : e.message;
251
+ return { status, body: { ok: false, error: e.code, message }, cause: e };
252
+ }
253
+ throw e;
254
+ }
255
+ }
@@ -0,0 +1,3 @@
1
+ export declare const ROSTER_WORD_KEYS: readonly ["week.title", "week.draft", "week.published", "week.unsent", "week.prev", "week.next", "week.none", "week.publish", "week.send", "week.copy", "week.export", "shift.break", "shift.remove", "shift.on_leave", "shift.removed", "add.title", "add.person", "add.day", "add.start", "add.end", "add.role", "add.role_any", "add.break", "add.note", "add.button", "gaps.title", "gaps.none", "gaps.nobody", "gaps.short", "gaps.anyone", "staff.title", "staff.empty", "staff.name", "staff.email", "staff.roles", "staff.resource", "staff.resource_hint", "staff.add", "staff.save", "staff.link", "staff.link_sent", "staff.no_link", "staff.remove", "leave.title", "leave.none", "leave.from", "leave.to", "leave.add", "leave.remove", "leave.when", "mine.title", "mine.none", "mine.calendar", "mine.private", "mine.leave", "done.add_shift", "done.remove_shift", "done.publish", "done.copy", "done.save_staff", "done.remove_staff", "done.send_link", "done.add_leave", "done.remove_leave", "email.week.subject", "email.changed.subject", "email.hello", "email.week.intro", "email.changed.intro", "email.none", "email.gone", "email.calendar", "email.footer", "email.link.subject", "email.link.body", "email.link.feed", "email.link.keep", "ics.cancelled", "csv.date", "csv.name", "csv.role", "csv.start", "csv.end", "csv.break", "csv.hours", "confirm.no", "error.confirm_needed", "shift.remove.question", "shift.remove.consequence", "shift.remove.consequence_manual", "shift.remove.consequence_gone", "shift.remove.yes", "week.publish.question", "week.publish.consequence", "week.publish.consequence_one", "week.publish.consequence_none", "week.publish.consequence_all", "week.publish.yes", "week.publish.no", "week.send.question", "week.send.consequence", "week.send.consequence_one", "week.send.consequence_none", "week.send.consequence_all", "week.send.yes", "staff.link.question", "staff.link.consequence", "staff.link.consequence_first", "staff.link.yes", "staff.link.no", "staff.remove.question", "staff.remove.consequence", "staff.remove.yes", "staff.remove.no", "leave.remove.question", "leave.remove.consequence", "leave.remove.yes", "email.removed.subject", "email.removed.body", "email.removed.next", "email.leave_removed.subject", "email.leave_removed.body", "email.leave_removed.next"];
2
+ export type RosterWordKey = (typeof ROSTER_WORD_KEYS)[number];
3
+ export declare const ROSTER_WORDS: Readonly<Record<"en" | "tl" | "taglish", Readonly<Record<RosterWordKey, string>>>>;