@chatwarden/core 0.1.1 → 0.1.3
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 +128 -4
- package/dist/src/audit.d.ts +27 -5
- package/dist/src/audit.d.ts.map +1 -1
- package/dist/src/audit.js +57 -6
- package/dist/src/audit.js.map +1 -1
- package/dist/src/chatwarden.d.ts +183 -11
- package/dist/src/chatwarden.d.ts.map +1 -1
- package/dist/src/chatwarden.js +65 -10
- package/dist/src/chatwarden.js.map +1 -1
- package/dist/src/documents.d.ts +12 -2
- package/dist/src/documents.d.ts.map +1 -1
- package/dist/src/documents.js +56 -34
- package/dist/src/documents.js.map +1 -1
- package/dist/src/events.d.ts +3 -0
- package/dist/src/events.d.ts.map +1 -1
- package/dist/src/events.js.map +1 -1
- package/dist/src/index.d.ts +20 -11
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/ladder.d.ts +2 -0
- package/dist/src/ladder.d.ts.map +1 -1
- package/dist/src/ladder.js +1 -1
- package/dist/src/ladder.js.map +1 -1
- package/dist/src/policy.d.ts +129 -0
- package/dist/src/policy.d.ts.map +1 -0
- package/dist/src/policy.js +242 -0
- package/dist/src/policy.js.map +1 -0
- package/dist/src/profile.d.ts +120 -7
- package/dist/src/profile.d.ts.map +1 -1
- package/dist/src/profile.js +295 -7
- package/dist/src/profile.js.map +1 -1
- package/dist/src/reporting.d.ts +127 -0
- package/dist/src/reporting.d.ts.map +1 -0
- package/dist/src/reporting.js +172 -0
- package/dist/src/reporting.js.map +1 -0
- package/dist/src/reports.d.ts +80 -4
- package/dist/src/reports.d.ts.map +1 -1
- package/dist/src/reports.js +120 -6
- package/dist/src/reports.js.map +1 -1
- package/dist/src/staffReports.d.ts +17 -5
- package/dist/src/staffReports.d.ts.map +1 -1
- package/dist/src/staffReports.js +22 -5
- package/dist/src/staffReports.js.map +1 -1
- package/dist/src/staffViews.d.ts +138 -0
- package/dist/src/staffViews.d.ts.map +1 -0
- package/dist/src/staffViews.js +205 -0
- package/dist/src/staffViews.js.map +1 -0
- package/dist/src/team.d.ts +149 -0
- package/dist/src/team.d.ts.map +1 -0
- package/dist/src/team.js +385 -0
- package/dist/src/team.js.map +1 -0
- package/dist/src/types.d.ts +245 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +5 -0
- package/dist/src/types.js.map +1 -1
- package/package.json +2 -2
- package/src/audit.ts +71 -7
- package/src/chatwarden.ts +245 -20
- package/src/documents.ts +70 -43
- package/src/events.ts +10 -1
- package/src/index.ts +109 -4
- package/src/ladder.ts +1 -1
- package/src/policy.ts +288 -0
- package/src/profile.ts +369 -14
- package/src/reporting.ts +251 -0
- package/src/reports.ts +163 -10
- package/src/staffReports.ts +33 -7
- package/src/staffViews.ts +325 -0
- package/src/team.ts +422 -0
- package/src/types.ts +257 -4
package/dist/src/reports.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomId } from './crypto.js';
|
|
2
2
|
import { safeWarn } from './log.js';
|
|
3
|
+
import { defaultReporting, findReason, legacyCategoryOf, OTHER_REASON_ID } from './reporting.js';
|
|
3
4
|
const DAY_MS = 24 * 3_600_000;
|
|
4
5
|
const WEEK_MS = 7 * DAY_MS;
|
|
5
6
|
// REPORTS_PER_DAY, SUSPEND_AFTER and SUSPEND_WINDOW_MS are the DEFAULTS of `limits.reports`.
|
|
@@ -11,8 +12,10 @@ export const SUSPEND_AFTER = 3;
|
|
|
11
12
|
export const SUSPEND_WINDOW_MS = 30 * DAY_MS;
|
|
12
13
|
/** A note is trimmed, then cut to this many characters. */
|
|
13
14
|
export const REPORT_NOTE_MAX = 500;
|
|
14
|
-
/**
|
|
15
|
+
/** The 0.1.1 categories. A report's stored `category` is always one of these (see `legacyCategoryOf`); they stay valid ids for `ReportInput.category`. */
|
|
15
16
|
export const REPORT_CATEGORIES = ['harassment', 'hate', 'cheating', 'spam', 'disruption', 'other'];
|
|
17
|
+
/** How long after a report its reporter may add their one follow-up: 10 minutes. */
|
|
18
|
+
export const REPORT_DETAIL_WINDOW_MS = 10 * 60_000;
|
|
16
19
|
const newId = () => randomId(16);
|
|
17
20
|
const errName = (err) => (err instanceof Error ? err.name : typeof err);
|
|
18
21
|
const present = (id) => typeof id === 'string' && id !== '';
|
|
@@ -38,6 +41,20 @@ const copyReport = (r) => ({
|
|
|
38
41
|
excerpt: r.excerpt.map((l) => ({ ...l, audience: l.audience === null ? null : [...l.audience] })),
|
|
39
42
|
people: [...r.people],
|
|
40
43
|
});
|
|
44
|
+
/**
|
|
45
|
+
* When a reporter's suspension ends, or null when they are not suspended. `marks` are the `actionedAt` times of the
|
|
46
|
+
* reporter's bad-faith dismissals that are still inside the window (the rows `loadBadFaithMarks` returns for it).
|
|
47
|
+
* Suspended means `suspendAfter` or more of them; the suspension lifts once enough of the oldest have aged out for the
|
|
48
|
+
* count to fall below `suspendAfter`, that is one millisecond after the window has passed the first mark that must go
|
|
49
|
+
* (a mark counts while `actionedAt >= now - suspendWindowMs`). The single place the rule lives: intake refuses with it
|
|
50
|
+
* and the staff view reports it.
|
|
51
|
+
*/
|
|
52
|
+
export function reporterSuspendedUntil(marks, limits) {
|
|
53
|
+
if (marks.length < limits.suspendAfter)
|
|
54
|
+
return null;
|
|
55
|
+
const sorted = [...marks].sort((a, b) => a - b);
|
|
56
|
+
return sorted[sorted.length - limits.suspendAfter] + limits.suspendWindowMs + 1;
|
|
57
|
+
}
|
|
41
58
|
export class ReportService {
|
|
42
59
|
roster;
|
|
43
60
|
buffer;
|
|
@@ -45,6 +62,7 @@ export class ReportService {
|
|
|
45
62
|
store;
|
|
46
63
|
clock;
|
|
47
64
|
enabled;
|
|
65
|
+
reporting;
|
|
48
66
|
onReport;
|
|
49
67
|
logger;
|
|
50
68
|
limits;
|
|
@@ -55,6 +73,7 @@ export class ReportService {
|
|
|
55
73
|
this.store = deps.store;
|
|
56
74
|
this.clock = deps.clock;
|
|
57
75
|
this.enabled = deps.enabled ?? (() => true);
|
|
76
|
+
this.reporting = deps.reporting ?? defaultReporting;
|
|
58
77
|
this.onReport = deps.onReport;
|
|
59
78
|
this.logger = deps.logger;
|
|
60
79
|
this.limits = deps.limits ?? {
|
|
@@ -68,6 +87,10 @@ export class ReportService {
|
|
|
68
87
|
*
|
|
69
88
|
* - `off`: moderation is disabled, the reporter's seat has no occupant or no subject (nothing to count or
|
|
70
89
|
* dedupe their reports by), or the store failed (logged by event and error class only).
|
|
90
|
+
* - `reason_required`: the flow is `reason_required` and the report names no reason (see {@link ReportInput.reason}).
|
|
91
|
+
* - `reason_unknown`: `reason` is not an enabled reason, in every flow. A refused reason uses up nothing: it never counts toward
|
|
92
|
+
* the daily allowance. The 0.1.1 `category` alias is not refused for this: an id that is not an enabled reason (or not text) is
|
|
93
|
+
* taken as `other`, as it was in 0.1.1. A blank `reason` falls back to `category`.
|
|
71
94
|
* - `not_player`: the target seat has no occupant, or the occupant (or the line's author) has no subject.
|
|
72
95
|
* - `self`: reporter and target are the same canonical subject.
|
|
73
96
|
* - `suspended`: three or more of the reporter's reports were dismissed as bad faith within 30 days.
|
|
@@ -89,7 +112,92 @@ export class ReportService {
|
|
|
89
112
|
return refuse('off');
|
|
90
113
|
}
|
|
91
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Add the reporter's one follow-up to their report: a reason, a note, or both. Never rejects. Refusals, in this order:
|
|
117
|
+
*
|
|
118
|
+
* - `off`: moderation is disabled, the store cannot take a follow-up (it has no `addReportDetail`), or it failed (logged by
|
|
119
|
+
* event and error class only).
|
|
120
|
+
* - `not_found`: no such report.
|
|
121
|
+
* - `not_reporter`: `reporterSeat` is not the seat the report was filed from, or that seat, in the report's room, no longer
|
|
122
|
+
* holds the reporter (the same canonical person; a merged alias counts). The player must still be in the room.
|
|
123
|
+
* - `too_late`: more than ten minutes after the report (`REPORT_DETAIL_WINDOW_MS`; exactly ten is still in time), or the
|
|
124
|
+
* report has been decided.
|
|
125
|
+
* - `already_added`: the follow-up was already taken once.
|
|
126
|
+
* - `reason_unknown`: the reason is not an enabled reason.
|
|
127
|
+
*
|
|
128
|
+
* A reason given replaces the report's reported reason (it is only a hint); a note replaces its note (trimmed and cut like a
|
|
129
|
+
* report note). One left out (missing, null or blank) keeps what the report had. A follow-up that gives neither is `ok: true`
|
|
130
|
+
* and changes nothing, and does not use up the one allowed. It never changes the target, the excerpt or the line, and
|
|
131
|
+
* announces nothing.
|
|
132
|
+
*/
|
|
133
|
+
async addDetail(reportId, reporterSeat, detail) {
|
|
134
|
+
try {
|
|
135
|
+
return this.runDetail(reportId, reporterSeat, detail);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
this.warn('reports.detail_failed', { error: errName(err) });
|
|
139
|
+
return { ok: false, refused: 'off' };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
92
142
|
// --- internals -----------------------------------------------------------
|
|
143
|
+
/**
|
|
144
|
+
* The reason a report names: `{ id }` (an enabled one; null for none), or why it cannot be taken. A blank reason is none; the
|
|
145
|
+
* `category` alias is read when there is no `reason`. A match is exact, after trimming; an old `disruption` finds `griefing`.
|
|
146
|
+
*/
|
|
147
|
+
readReason(input) {
|
|
148
|
+
const reporting = this.reporting();
|
|
149
|
+
const none = reporting.flow === 'reason_required' ? 'required' : { id: null };
|
|
150
|
+
const blank = (v) => v === undefined || v === null || (typeof v === 'string' && v.trim() === '');
|
|
151
|
+
if (!blank(input.reason)) {
|
|
152
|
+
// The new field is strict: anything that is not an enabled reason is refused.
|
|
153
|
+
if (typeof input.reason !== 'string')
|
|
154
|
+
return 'unknown';
|
|
155
|
+
const found = findReason(reporting.reasons, input.reason.trim());
|
|
156
|
+
return found !== undefined && found.enabled ? { id: found.id } : 'unknown';
|
|
157
|
+
}
|
|
158
|
+
if (blank(input.category))
|
|
159
|
+
return none;
|
|
160
|
+
// The 0.1.1 alias keeps its 0.1.1 behaviour: an id that is not an enabled reason (or not text at all) is taken as `other`.
|
|
161
|
+
const found = typeof input.category === 'string' ? findReason(reporting.reasons, input.category.trim()) : undefined;
|
|
162
|
+
return found !== undefined && found.enabled ? { id: found.id } : { id: OTHER_REASON_ID };
|
|
163
|
+
}
|
|
164
|
+
runDetail(reportId, reporterSeat, detail) {
|
|
165
|
+
if (!this.enabled())
|
|
166
|
+
return { ok: false, refused: 'off' };
|
|
167
|
+
const store = this.store;
|
|
168
|
+
if (typeof store.addReportDetail !== 'function')
|
|
169
|
+
return { ok: false, refused: 'off' };
|
|
170
|
+
const report = typeof reportId === 'string' && reportId !== '' ? store.loadReport(reportId) : null;
|
|
171
|
+
if (report === null)
|
|
172
|
+
return { ok: false, refused: 'not_found' };
|
|
173
|
+
// The reporter, in the room and the seat the report was filed from. Looked up in the report's own room.
|
|
174
|
+
const occ = typeof reporterSeat === 'string' && reporterSeat === report.reporterSeat ? this.roster.occupant(report.roomId, reporterSeat) : null;
|
|
175
|
+
if (occ === null || !present(occ.subject) || this.subjects.canonical(occ.subject) !== this.subjects.canonical(report.reporterSubject)) {
|
|
176
|
+
return { ok: false, refused: 'not_reporter' };
|
|
177
|
+
}
|
|
178
|
+
const now = this.clock.now();
|
|
179
|
+
if (report.status !== 'open' || now - report.createdAt > REPORT_DETAIL_WINDOW_MS)
|
|
180
|
+
return { ok: false, refused: 'too_late' };
|
|
181
|
+
if ((report.detailAt ?? null) !== null)
|
|
182
|
+
return { ok: false, refused: 'already_added' };
|
|
183
|
+
const d = typeof detail === 'object' && detail !== null ? detail : {};
|
|
184
|
+
const picked = this.readReason({ reason: d.reason });
|
|
185
|
+
if (picked === 'unknown')
|
|
186
|
+
return { ok: false, refused: 'reason_unknown' };
|
|
187
|
+
// In the `reason_required` flow a follow-up with no reason is not a refusal: the report has its reason already.
|
|
188
|
+
const reason = picked === 'required' || picked.id === null ? null : picked.id;
|
|
189
|
+
const note = cleanNote(d.note);
|
|
190
|
+
if (reason === null && note === null)
|
|
191
|
+
return { ok: true };
|
|
192
|
+
const finalReason = reason ?? report.reportedReason ?? null;
|
|
193
|
+
const written = store.transaction(() => store.addReportDetail?.(report.id, {
|
|
194
|
+
reportedReason: finalReason,
|
|
195
|
+
category: legacyCategoryOf(finalReason),
|
|
196
|
+
note: note ?? report.note,
|
|
197
|
+
at: now,
|
|
198
|
+
}));
|
|
199
|
+
return written === true ? { ok: true } : { ok: false, refused: 'already_added' };
|
|
200
|
+
}
|
|
93
201
|
run(input) {
|
|
94
202
|
if (!this.enabled())
|
|
95
203
|
return refuse('off');
|
|
@@ -98,6 +206,11 @@ export class ReportService {
|
|
|
98
206
|
if (reporterOcc === null || !present(reporterOcc.subject))
|
|
99
207
|
return refuse('off');
|
|
100
208
|
const reporter = this.subjects.canonical(reporterOcc.subject);
|
|
209
|
+
const given = this.readReason(input);
|
|
210
|
+
if (given === 'required')
|
|
211
|
+
return refuse('reason_required');
|
|
212
|
+
if (given === 'unknown')
|
|
213
|
+
return refuse('reason_unknown');
|
|
101
214
|
let line = typeof input.lineId === 'string' ? this.buffer.get(roomId, input.lineId) : undefined;
|
|
102
215
|
// A reporter cannot cite a line they never saw: one sent to a limited audience that left their seat out is
|
|
103
216
|
// ignored, and the target falls back to the targetSeat occupant.
|
|
@@ -166,7 +279,8 @@ export class ReportService {
|
|
|
166
279
|
targetSubject: targetPerson,
|
|
167
280
|
targetSeat: target.seat,
|
|
168
281
|
targetHandle: target.handle,
|
|
169
|
-
category:
|
|
282
|
+
category: legacyCategoryOf(given.id),
|
|
283
|
+
reportedReason: given.id,
|
|
170
284
|
note: cleanNote(input.note),
|
|
171
285
|
lineId: line === undefined ? null : line.lineId,
|
|
172
286
|
excerpt,
|
|
@@ -186,7 +300,7 @@ export class ReportService {
|
|
|
186
300
|
return refuse('off');
|
|
187
301
|
}
|
|
188
302
|
this.notify(row, targetPerson, now);
|
|
189
|
-
return { ok: true, reportId: row.id, remaining };
|
|
303
|
+
return { ok: true, reportId: row.id, remaining, detailUntil: row.createdAt + REPORT_DETAIL_WINDOW_MS };
|
|
190
304
|
}
|
|
191
305
|
/**
|
|
192
306
|
* Suspended, rate, duplicate, in that order: the refusal, or how many reports the reporter filed in the last
|
|
@@ -194,11 +308,11 @@ export class ReportService {
|
|
|
194
308
|
*/
|
|
195
309
|
checkLimits(reporter, target, roomId, now) {
|
|
196
310
|
const marks = this.store.loadBadFaithMarks(now - this.limits.suspendWindowMs);
|
|
197
|
-
|
|
311
|
+
const bad = [];
|
|
198
312
|
for (const m of marks)
|
|
199
313
|
if (this.subjects.canonical(m.reporter) === reporter)
|
|
200
|
-
bad
|
|
201
|
-
if (bad
|
|
314
|
+
bad.push(m.actionedAt);
|
|
315
|
+
if (reporterSuspendedUntil(bad, this.limits) !== null)
|
|
202
316
|
return { refusal: refuse('suspended') };
|
|
203
317
|
const used = this.reportsByInLastDay(reporter, now);
|
|
204
318
|
if (used >= this.limits.perDay)
|
package/dist/src/reports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAmBpC,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,CAAC;AAC9B,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC;AAE3B,6FAA6F;AAE7F,mDAAmD;AACnD,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,sEAAsE;AACtE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,MAAM,CAAC;AAE7C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAA8B,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,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,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACjE,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAEO,IAAI,CAAC,KAAa,EAAE,MAAiD;QAC3E,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReportReason } from './reporting.js';
|
|
1
2
|
import type { SubjectIndex } from './subjects.js';
|
|
2
3
|
import type { ReportRecord, Store, SubjectId } from './types.js';
|
|
3
4
|
/** The page size when `limit` is missing or not a number. */
|
|
@@ -5,12 +6,13 @@ export declare const REPORT_PAGE_DEFAULT = 50;
|
|
|
5
6
|
/** The largest page; a bigger `limit` is clamped to this. */
|
|
6
7
|
export declare const REPORT_PAGE_MAX = 200;
|
|
7
8
|
/**
|
|
8
|
-
* A report query that cannot be answered: an unknown `status`, a `before` cursor that is not one we issued,
|
|
9
|
-
* that is not a subject id (or one combined with a `status` / `before`, which a
|
|
9
|
+
* A report query that cannot be answered: an unknown `status`, a `before` cursor that is not one we issued, a `reason` that is
|
|
10
|
+
* not a well-formed id, or a `person` that is not a subject id (or one combined with a `status` / `before` / `reason`, which a
|
|
11
|
+
* person query does not take).
|
|
10
12
|
*/
|
|
11
13
|
export declare class ReportQueryError extends Error {
|
|
12
|
-
readonly field: 'status' | 'before' | 'person';
|
|
13
|
-
constructor(field: 'status' | 'before' | 'person');
|
|
14
|
+
readonly field: 'status' | 'before' | 'person' | 'reason';
|
|
15
|
+
constructor(field: 'status' | 'before' | 'person' | 'reason');
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* A report as the staff queue shows it: the whole {@link ReportRecord} (status, bad-faith mark, evidence and the
|
|
@@ -28,6 +30,10 @@ export declare class ReportQueryError extends Error {
|
|
|
28
30
|
* Carries subject ids: staff channels only, never send to a player.
|
|
29
31
|
*/
|
|
30
32
|
export interface StaffReport extends ReportRecord {
|
|
33
|
+
/** When the reporter added their one follow-up, or null. Always present here. */
|
|
34
|
+
detailAt: number | null;
|
|
35
|
+
/** The reason the reporter gave (an id from the profile's reasons, an old category read as its new id), or null when they gave none. A hint, never the truth. */
|
|
36
|
+
reportedReason: string | null;
|
|
31
37
|
targetPerson: SubjectId;
|
|
32
38
|
reporterPerson: SubjectId;
|
|
33
39
|
ownLineIds: Record<SubjectId, string[]>;
|
|
@@ -46,6 +52,12 @@ export interface ReportQuery {
|
|
|
46
52
|
* (`ReportQueryError`).
|
|
47
53
|
*/
|
|
48
54
|
person?: SubjectId;
|
|
55
|
+
/**
|
|
56
|
+
* Only reports whose reported reason is this id (the old `disruption` finds `griefing`), or, with `null`, only those with no
|
|
57
|
+
* reason given. An id that is no reason any more still finds its old reports. A malformed id is `ReportQueryError`; a person
|
|
58
|
+
* query does not take it.
|
|
59
|
+
*/
|
|
60
|
+
reason?: string | null;
|
|
49
61
|
}
|
|
50
62
|
/**
|
|
51
63
|
* One page of the staff queue, newest first. `next` is an opaque cursor to pass back as `before`, or null when this
|
|
@@ -68,5 +80,5 @@ export declare function decodeReportCursor(cursor: string): {
|
|
|
68
80
|
/** A stored record as the staff queue shows it (see {@link StaffReport}). Copies; the record is not touched. */
|
|
69
81
|
export declare function staffReport(record: ReportRecord, subjects: SubjectIndex): StaffReport;
|
|
70
82
|
/** One page of the staff queue. Throws {@link ReportQueryError} for an unknown status or a bad cursor. */
|
|
71
|
-
export declare function listStaffReports(store: Store, subjects: SubjectIndex, q?: ReportQuery): ReportPage;
|
|
83
|
+
export declare function listStaffReports(store: Store, subjects: SubjectIndex, q?: ReportQuery, reasons?: readonly ReportReason[]): ReportPage;
|
|
72
84
|
//# sourceMappingURL=staffReports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staffReports.d.ts","sourceRoot":"","sources":["../../src/staffReports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staffReports.d.ts","sourceRoot":"","sources":["../../src/staffReports.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjE,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,6DAA6D;AAC7D,eAAO,MAAM,eAAe,MAAM,CAAC;AAInC;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;gBAC9C,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ;CAa7D;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,iFAAiF;IACjF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iKAAiK;IACjK,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;IACxB,cAAc,EAAE,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;CACzC;AAED,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,MAI3C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAQtD,CAAC;AAEF,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,2GAA2G;AAC3G,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAQpF;AAOD,gHAAgH;AAChH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,WAAW,CAYrF;AAED,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,GAAE,WAAgB,EAAE,OAAO,GAAE,SAAS,YAAY,EAAO,GAAG,UAAU,CA4B7I"}
|
package/dist/src/staffReports.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ownLineIdsByPerson } from './notices.js';
|
|
2
|
+
import { canonicalReasonId, isReasonId, reasonOfCategory } from './reporting.js';
|
|
2
3
|
/** The page size when `limit` is missing or not a number. */
|
|
3
4
|
export const REPORT_PAGE_DEFAULT = 50;
|
|
4
5
|
/** The largest page; a bigger `limit` is clamped to this. */
|
|
5
6
|
export const REPORT_PAGE_MAX = 200;
|
|
6
7
|
const STATUSES = ['open', 'actioned', 'dismissed'];
|
|
7
8
|
/**
|
|
8
|
-
* A report query that cannot be answered: an unknown `status`, a `before` cursor that is not one we issued,
|
|
9
|
-
* that is not a subject id (or one combined with a `status` / `before`, which a
|
|
9
|
+
* A report query that cannot be answered: an unknown `status`, a `before` cursor that is not one we issued, a `reason` that is
|
|
10
|
+
* not a well-formed id, or a `person` that is not a subject id (or one combined with a `status` / `before` / `reason`, which a
|
|
11
|
+
* person query does not take).
|
|
10
12
|
*/
|
|
11
13
|
export class ReportQueryError extends Error {
|
|
12
14
|
field;
|
|
@@ -15,7 +17,9 @@ export class ReportQueryError extends Error {
|
|
|
15
17
|
? 'reports.list: unknown status'
|
|
16
18
|
: field === 'person'
|
|
17
19
|
? 'reports.list: invalid person'
|
|
18
|
-
:
|
|
20
|
+
: field === 'reason'
|
|
21
|
+
? 'reports.list: invalid reason'
|
|
22
|
+
: 'reports.list: invalid cursor');
|
|
19
23
|
this.name = 'ReportQueryError';
|
|
20
24
|
this.field = field;
|
|
21
25
|
}
|
|
@@ -60,8 +64,12 @@ const clampLimit = (limit) => {
|
|
|
60
64
|
};
|
|
61
65
|
/** A stored record as the staff queue shows it (see {@link StaffReport}). Copies; the record is not touched. */
|
|
62
66
|
export function staffReport(record, subjects) {
|
|
67
|
+
// A record from a store that predates `reportedReason` has none at all (not even null): its category is the reason it was filed under.
|
|
68
|
+
const stored = record.reportedReason;
|
|
63
69
|
return {
|
|
64
70
|
...structuredClone(record),
|
|
71
|
+
reportedReason: stored === undefined ? reasonOfCategory(record.category) : stored,
|
|
72
|
+
detailAt: record.detailAt ?? null,
|
|
65
73
|
people: record.people.map((p) => subjects.canonical(p)),
|
|
66
74
|
targetPerson: subjects.canonical(record.targetSubject),
|
|
67
75
|
reporterPerson: subjects.canonical(record.reporterSubject),
|
|
@@ -69,12 +77,14 @@ export function staffReport(record, subjects) {
|
|
|
69
77
|
};
|
|
70
78
|
}
|
|
71
79
|
/** One page of the staff queue. Throws {@link ReportQueryError} for an unknown status or a bad cursor. */
|
|
72
|
-
export function listStaffReports(store, subjects, q = {}) {
|
|
80
|
+
export function listStaffReports(store, subjects, q = {}, reasons = []) {
|
|
73
81
|
if (q.person !== undefined) {
|
|
74
82
|
if (typeof q.person !== 'string' || q.person === '')
|
|
75
83
|
throw new ReportQueryError('person');
|
|
76
84
|
if (q.status !== undefined)
|
|
77
85
|
throw new ReportQueryError('status');
|
|
86
|
+
if (q.reason !== undefined)
|
|
87
|
+
throw new ReportQueryError('reason');
|
|
78
88
|
if (q.before !== undefined && q.before !== null)
|
|
79
89
|
throw new ReportQueryError('before');
|
|
80
90
|
const rows = store.listReportsByPerson(subjects.aliasesOf(q.person), clampLimit(q.limit));
|
|
@@ -82,16 +92,23 @@ export function listStaffReports(store, subjects, q = {}) {
|
|
|
82
92
|
}
|
|
83
93
|
if (q.status !== undefined && !STATUSES.includes(q.status))
|
|
84
94
|
throw new ReportQueryError('status');
|
|
95
|
+
if (q.reason !== undefined && q.reason !== null && !isReasonId(q.reason))
|
|
96
|
+
throw new ReportQueryError('reason');
|
|
85
97
|
const cursor = q.before === undefined || q.before === null ? null : decodeReportCursor(q.before);
|
|
86
98
|
const limit = clampLimit(q.limit);
|
|
99
|
+
const reason = q.reason === undefined || q.reason === null ? q.reason : canonicalReasonId(reasons, q.reason);
|
|
87
100
|
const rows = store.listReports({
|
|
88
101
|
...(q.status === undefined ? {} : { status: q.status }),
|
|
89
102
|
...(cursor === null ? {} : { before: cursor.createdAt, beforeId: cursor.id }),
|
|
103
|
+
...(reason === undefined ? {} : { reason }),
|
|
90
104
|
limit,
|
|
91
105
|
});
|
|
92
106
|
const last = rows[rows.length - 1];
|
|
107
|
+
// The cursor and "is there more" follow the rows the store gave; the filter is applied again to what it returned, so a store
|
|
108
|
+
// that does not know `reason` still cannot show the wrong reports.
|
|
109
|
+
const items = rows.map((r) => staffReport(r, subjects));
|
|
93
110
|
return {
|
|
94
|
-
items:
|
|
111
|
+
items: reason === undefined ? items : items.filter((r) => r.reportedReason === reason),
|
|
95
112
|
next: rows.length === limit && last !== undefined ? encodeReportCursor(last.createdAt, last.id) : null,
|
|
96
113
|
};
|
|
97
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staffReports.js","sourceRoot":"","sources":["../../src/staffReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"staffReports.js","sourceRoot":"","sources":["../../src/staffReports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKjF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,MAAM,QAAQ,GAA0C,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE1F;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAChC,KAAK,CAA4C;IAC1D,YAAY,KAAgD;QAC1D,KAAK,CACH,KAAK,KAAK,QAAQ;YAChB,CAAC,CAAC,8BAA8B;YAChC,CAAC,CAAC,KAAK,KAAK,QAAQ;gBAClB,CAAC,CAAC,8BAA8B;gBAChC,CAAC,CAAC,KAAK,KAAK,QAAQ;oBAClB,CAAC,CAAC,8BAA8B;oBAChC,CAAC,CAAC,8BAA8B,CACvC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AA2DD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE;IACnD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,IAA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AC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;QAC7E,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3C,KAAK;KACN,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnC,6HAA6H;IAC7H,mEAAmE;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;IACxD,OAAO;QACL,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,MAAM,CAAC;QACtF,IAAI,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;KACvG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Limits } from './limits.js';
|
|
2
|
+
import type { ReportReason } from './reporting.js';
|
|
3
|
+
import type { RuleRef } from './rules.js';
|
|
4
|
+
import type { SubjectIndex } from './subjects.js';
|
|
5
|
+
import type { SanctionKind, SanctionRow, Source, Store, SubjectId } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* One sanction as the staff see it, built from the SUBJECT row of its group alone: never the IP row, and never a stored
|
|
8
|
+
* identifier (no row id, no `value`, no hashed IP). A group is one view however many rows it has.
|
|
9
|
+
*
|
|
10
|
+
* - `rule`: the cited Community Rule (`parseRuleRef`); null on a row written before rules existed.
|
|
11
|
+
* - `endsAt`: epoch ms the restriction stops applying, null when permanent. A warning or note has no end, so it is null too
|
|
12
|
+
* (`kind` tells the two apart; the stored row has `endsAt === startsAt` for those).
|
|
13
|
+
* - `active`: see {@link isSanctionActive}. It is about time and revocation only, not about enforcement.
|
|
14
|
+
* - `pending`: true when the sanction was written while enforcement was off (it applies nothing until enforcement is on).
|
|
15
|
+
* The hub can label such a row; it does not change `active`.
|
|
16
|
+
* - `revokedAt`, `revokedBy`, `revokeReason`: who lifted it, when and why; all null while it stands. A group revoked
|
|
17
|
+
* before the actor was kept reads `revokedBy` and `revokeReason` as the store has them (the columns have existed since
|
|
18
|
+
* the first sanction migration, so in practice both are set).
|
|
19
|
+
*
|
|
20
|
+
* Carries staff-only text (`reason`, `actor`): never send to a player.
|
|
21
|
+
*/
|
|
22
|
+
export interface SanctionGroupView {
|
|
23
|
+
groupId: string;
|
|
24
|
+
refCode: string;
|
|
25
|
+
kind: SanctionKind;
|
|
26
|
+
rule: RuleRef | null;
|
|
27
|
+
startsAt: number;
|
|
28
|
+
endsAt: number | null;
|
|
29
|
+
reason: string;
|
|
30
|
+
actor: string;
|
|
31
|
+
source: Source;
|
|
32
|
+
automated: boolean;
|
|
33
|
+
active: boolean;
|
|
34
|
+
pending: boolean;
|
|
35
|
+
revokedAt: number | null;
|
|
36
|
+
revokedBy: string | null;
|
|
37
|
+
revokeReason: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** A {@link SanctionGroupView} with the canonical person it is about (a staff ref). */
|
|
40
|
+
export interface PersonSanctionView extends SanctionGroupView {
|
|
41
|
+
person: SubjectId;
|
|
42
|
+
}
|
|
43
|
+
/** One page of {@link PersonSanctionView}, newest first. `next` is an opaque cursor, or null when the page was not full. */
|
|
44
|
+
export interface SanctionPage {
|
|
45
|
+
items: PersonSanctionView[];
|
|
46
|
+
next: string | null;
|
|
47
|
+
}
|
|
48
|
+
/** What `cw.sanctions.list` takes. Every field is optional. */
|
|
49
|
+
export interface SanctionListInput {
|
|
50
|
+
/** The `next` of the previous page. Omit or null for the first page. */
|
|
51
|
+
cursor?: string | null;
|
|
52
|
+
/** Page size: default 50, clamped to 1..200 (never rejected). */
|
|
53
|
+
limit?: number;
|
|
54
|
+
/** Only sanctions from this source. */
|
|
55
|
+
source?: Source;
|
|
56
|
+
}
|
|
57
|
+
/** The page size when `limit` is missing or not a number. */
|
|
58
|
+
export declare const SANCTION_PAGE_DEFAULT = 50;
|
|
59
|
+
/** The largest page; a bigger `limit` is clamped to this. */
|
|
60
|
+
export declare const SANCTION_PAGE_MAX = 200;
|
|
61
|
+
/** The most sanction groups `cw.sanctions.forPerson` returns (the newest). */
|
|
62
|
+
export declare const PERSON_SANCTIONS_MAX = 200;
|
|
63
|
+
/** A sanction list query that cannot be answered: a cursor that is not one we issued, or an unknown source. The message never echoes the input. */
|
|
64
|
+
export declare class SanctionQueryError extends Error {
|
|
65
|
+
readonly field: 'cursor' | 'source';
|
|
66
|
+
constructor(field: 'cursor' | 'source');
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Is this sanction in force at `now`? A revoked row never is, nor is one that has not started (`startsAt` after `now`). A restriction (chat, area, ban) applies strictly before its
|
|
70
|
+
* `endsAt` and, with no end, until it is revoked. A warning or note restricts nothing and has no end, so it counts for as
|
|
71
|
+
* long as the escalation ladder counts it: 90 days from its `startsAt` (`HISTORY_LOOKBACK_MS`, inclusive). A row without
|
|
72
|
+
* `revokedAt` (a load that does not carry it) reads as not revoked.
|
|
73
|
+
*/
|
|
74
|
+
export declare function isSanctionActive(row: SanctionRow, now: number): boolean;
|
|
75
|
+
/** The staff view of one subject row. Lists each field by name. */
|
|
76
|
+
export declare function sanctionGroupView(row: SanctionRow, now: number): SanctionGroupView;
|
|
77
|
+
/**
|
|
78
|
+
* A person's sanctions, newest first: the last 90 days (the escalation window, by `startsAt`) plus every permanent one
|
|
79
|
+
* that has not been revoked, across every alias merged into them. Every group still in force (not revoked, no end or an
|
|
80
|
+
* end in the future, of any age) is always included; the rest of the window fills what is left of
|
|
81
|
+
* {@link PERSON_SANCTIONS_MAX}, newest first.
|
|
82
|
+
*/
|
|
83
|
+
export declare function sanctionsOfPerson(store: Store, subjects: SubjectIndex, person: SubjectId, now: number): SanctionGroupView[];
|
|
84
|
+
/**
|
|
85
|
+
* Every person's sanctions, newest first, one page at a time. Not windowed. Throws {@link SanctionQueryError} for an
|
|
86
|
+
* unknown `source` or a cursor that is not one of ours. As with reports, a full page always carries a cursor, so the page
|
|
87
|
+
* after an exactly-full last one is empty with `next` null.
|
|
88
|
+
*/
|
|
89
|
+
export declare function listSanctionGroups(store: Store, subjects: SubjectIndex, q: SanctionListInput, now: number): SanctionPage;
|
|
90
|
+
/**
|
|
91
|
+
* How the reports a person FILED stand: `reports` is the total, `open`, `actioned` and `dismissed` its split, `badFaith`
|
|
92
|
+
* how many of the dismissals carry the bad-faith mark (all that are still stored), and `suspendedUntil` the epoch ms their
|
|
93
|
+
* reporting suspension ends, or null when they are not suspended. Suspension is the intake rule: `suspendAfter` bad-faith
|
|
94
|
+
* dismissals inside `suspendWindowMs`. Counts folded over every alias of the person. Staff only.
|
|
95
|
+
*
|
|
96
|
+
* `reasonDecided` counts the decided (actioned or dismissed) reports they filed that named a reason, and `reasonMatched` how many
|
|
97
|
+
* of those the decision bore out: the decision cited, against the reported person, a rule in that reason's `rules`. A dismissal
|
|
98
|
+
* never matches. A reason no longer in the profile's list, or one that maps to no rule (`other` by default), cannot be judged and is
|
|
99
|
+
* left out of both; a switched-off one still counts. Read from the newest 200 decided reports. It is read against the reasons in force now, so editing a reason's rules changes the count. A reporter's reason is a
|
|
100
|
+
* hint, so this is a signal for moderators and nothing more: it is never used to refuse a report.
|
|
101
|
+
*/
|
|
102
|
+
export interface ReporterRecord {
|
|
103
|
+
reports: number;
|
|
104
|
+
open: number;
|
|
105
|
+
actioned: number;
|
|
106
|
+
dismissed: number;
|
|
107
|
+
badFaith: number;
|
|
108
|
+
suspendedUntil: number | null;
|
|
109
|
+
reasonMatched: number;
|
|
110
|
+
reasonDecided: number;
|
|
111
|
+
}
|
|
112
|
+
export declare function reporterRecord(store: Store, subjects: SubjectIndex, limits: Limits['reports'], person: SubjectId, now: number, reasons?: readonly ReportReason[]): ReporterRecord;
|
|
113
|
+
/** The most blocked messages one call lists. */
|
|
114
|
+
export declare const BLOCKED_MAX = 500;
|
|
115
|
+
/** The look-back windows of the blocked list, in days. */
|
|
116
|
+
export declare const BLOCKED_DAYS: readonly [1, 7, 30];
|
|
117
|
+
export type BlockedDays = (typeof BLOCKED_DAYS)[number];
|
|
118
|
+
/**
|
|
119
|
+
* One blocked chat line: the strike the slur filter recorded. `text` is the line exactly as the person typed it, and
|
|
120
|
+
* `person` the canonical subject (a staff ref). Strikes are purged after 30 days. Carries chat text and a subject id:
|
|
121
|
+
* staff channels only, never send to a player.
|
|
122
|
+
*/
|
|
123
|
+
export interface BlockedItem {
|
|
124
|
+
id: string;
|
|
125
|
+
at: number;
|
|
126
|
+
roomId: string;
|
|
127
|
+
termId: string;
|
|
128
|
+
person: SubjectId;
|
|
129
|
+
text: string;
|
|
130
|
+
}
|
|
131
|
+
/** The blocked lines of the last `days` days (1, 7 or 30; `RangeError` otherwise), newest first, at most {@link BLOCKED_MAX}. */
|
|
132
|
+
export declare function blockedItems(store: Store, subjects: SubjectIndex, days: unknown, now: number): BlockedItem[];
|
|
133
|
+
/**
|
|
134
|
+
* How many strikes each term earned in the last `days` days (1, 7 or 30; `RangeError` otherwise). Terms with none are
|
|
135
|
+
* absent. The record has no prototype: read it with `counts[id]` or `Object.hasOwn`, never `counts.hasOwnProperty`.
|
|
136
|
+
*/
|
|
137
|
+
export declare function blockedCountsByTerm(store: Store, days: unknown, now: number): Record<string, number>;
|
|
138
|
+
//# sourceMappingURL=staffViews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staffViews.d.ts","sourceRoot":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