@helyx/module-moderation 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/LICENSE +725 -0
  3. package/README.md +107 -0
  4. package/dist/action-support.d.ts +48 -0
  5. package/dist/action-support.js +201 -0
  6. package/dist/case-actions.d.ts +9 -0
  7. package/dist/case-actions.js +311 -0
  8. package/dist/case-naming.d.ts +4 -0
  9. package/dist/case-naming.js +9 -0
  10. package/dist/case-repository.d.ts +29 -0
  11. package/dist/case-repository.js +199 -0
  12. package/dist/channel-actions.d.ts +3 -0
  13. package/dist/channel-actions.js +267 -0
  14. package/dist/commands.d.ts +4 -0
  15. package/dist/commands.js +309 -0
  16. package/dist/components.d.ts +15 -0
  17. package/dist/components.js +381 -0
  18. package/dist/configuration.d.ts +16 -0
  19. package/dist/configuration.js +94 -0
  20. package/dist/constants.d.ts +53 -0
  21. package/dist/constants.js +53 -0
  22. package/dist/contracts.d.ts +109 -0
  23. package/dist/contracts.js +84 -0
  24. package/dist/domain.d.ts +29 -0
  25. package/dist/domain.js +101 -0
  26. package/dist/events.d.ts +3 -0
  27. package/dist/events.js +60 -0
  28. package/dist/health.d.ts +10 -0
  29. package/dist/health.js +56 -0
  30. package/dist/index.d.ts +9 -0
  31. package/dist/index.js +92 -0
  32. package/dist/moderation-cases-resource.d.ts +14 -0
  33. package/dist/moderation-cases-resource.js +226 -0
  34. package/dist/presentation.d.ts +8 -0
  35. package/dist/presentation.js +69 -0
  36. package/dist/privacy.d.ts +8 -0
  37. package/dist/privacy.js +38 -0
  38. package/dist/provider.d.ts +4 -0
  39. package/dist/provider.js +335 -0
  40. package/dist/receipt-repository.d.ts +9 -0
  41. package/dist/receipt-repository.js +36 -0
  42. package/dist/records.d.ts +399 -0
  43. package/dist/records.js +303 -0
  44. package/dist/repository-model.d.ts +131 -0
  45. package/dist/repository-model.js +318 -0
  46. package/dist/repository.d.ts +21 -0
  47. package/dist/repository.js +41 -0
  48. package/dist/service.d.ts +75 -0
  49. package/dist/service.js +329 -0
  50. package/dist/tasks.d.ts +49 -0
  51. package/dist/tasks.js +391 -0
  52. package/dist/thread-controls.d.ts +23 -0
  53. package/dist/thread-controls.js +376 -0
  54. package/dist/thread-deletion-recovery.d.ts +13 -0
  55. package/dist/thread-deletion-recovery.js +46 -0
  56. package/dist/thread-delivery.d.ts +11 -0
  57. package/dist/thread-delivery.js +427 -0
  58. package/dist/thread-reconciliation.d.ts +24 -0
  59. package/dist/thread-reconciliation.js +181 -0
  60. package/dist/thread-repository.d.ts +16 -0
  61. package/dist/thread-repository.js +70 -0
  62. package/manifest.json +999 -0
  63. package/migrations/0001_moderation_foundation.sql +552 -0
  64. package/migrations/0002_staff_attempt_parameters.sql +27 -0
  65. package/package.json +56 -0
@@ -0,0 +1,399 @@
1
+ export declare const moderationRecords: {
2
+ readonly case_sequences: {
3
+ readonly table: "moderation_case_sequences";
4
+ readonly fields: {
5
+ readonly guild_id: {
6
+ readonly type: "string";
7
+ };
8
+ readonly next_case_number: {
9
+ readonly type: "number";
10
+ };
11
+ readonly updated_at: {
12
+ readonly type: "date";
13
+ };
14
+ };
15
+ readonly uniqueKeys: readonly [readonly ["guild_id"]];
16
+ readonly readableFields: readonly ["guild_id", "next_case_number", "updated_at"];
17
+ readonly writableFields: readonly ["guild_id", "next_case_number", "updated_at"];
18
+ readonly incrementableFields: readonly ["next_case_number"];
19
+ };
20
+ readonly cases: {
21
+ readonly table: "moderation_cases";
22
+ readonly fields: {
23
+ readonly case_id: {
24
+ readonly type: "string";
25
+ };
26
+ readonly guild_id: {
27
+ readonly type: "string";
28
+ };
29
+ readonly case_number: {
30
+ readonly type: "number";
31
+ };
32
+ readonly operation_key: {
33
+ readonly type: "string";
34
+ };
35
+ readonly subject_user_id: {
36
+ readonly type: "string";
37
+ readonly optional: true;
38
+ };
39
+ readonly actor_user_id: {
40
+ readonly type: "string";
41
+ readonly optional: true;
42
+ };
43
+ readonly source: {
44
+ readonly type: "string";
45
+ };
46
+ readonly source_module_id: {
47
+ readonly type: "string";
48
+ };
49
+ readonly source_event_id: {
50
+ readonly type: "string";
51
+ readonly optional: true;
52
+ };
53
+ readonly action: {
54
+ readonly type: "string";
55
+ };
56
+ readonly reason: {
57
+ readonly type: "string";
58
+ };
59
+ readonly private_note: {
60
+ readonly type: "string";
61
+ readonly optional: true;
62
+ };
63
+ readonly evidence_channel_id: {
64
+ readonly type: "string";
65
+ readonly optional: true;
66
+ };
67
+ readonly evidence_message_id: {
68
+ readonly type: "string";
69
+ readonly optional: true;
70
+ };
71
+ readonly related_case_id: {
72
+ readonly type: "string";
73
+ readonly optional: true;
74
+ };
75
+ readonly requested_duration_seconds: {
76
+ readonly type: "number";
77
+ readonly optional: true;
78
+ };
79
+ readonly delete_message_seconds: {
80
+ readonly type: "number";
81
+ readonly optional: true;
82
+ };
83
+ readonly demote_role_ids: {
84
+ readonly type: "json";
85
+ };
86
+ readonly observed_action_type: {
87
+ readonly type: "string";
88
+ readonly optional: true;
89
+ };
90
+ readonly observed_timeout_duration_seconds: {
91
+ readonly type: "number";
92
+ readonly optional: true;
93
+ };
94
+ readonly repeat_rule_id: {
95
+ readonly type: "string";
96
+ readonly optional: true;
97
+ };
98
+ readonly repeat_rule_revision: {
99
+ readonly type: "number";
100
+ readonly optional: true;
101
+ };
102
+ readonly repeat_configuration_revision: {
103
+ readonly type: "string";
104
+ readonly optional: true;
105
+ };
106
+ readonly repeat_policy_fingerprint: {
107
+ readonly type: "string";
108
+ readonly optional: true;
109
+ };
110
+ readonly repeat_window_starts_at: {
111
+ readonly type: "date";
112
+ readonly optional: true;
113
+ };
114
+ readonly repeat_offence_ordinal: {
115
+ readonly type: "number";
116
+ readonly optional: true;
117
+ };
118
+ readonly repeat_offence_count: {
119
+ readonly type: "number";
120
+ readonly optional: true;
121
+ };
122
+ readonly open_violation_thread: {
123
+ readonly type: "boolean";
124
+ };
125
+ readonly state: {
126
+ readonly type: "string";
127
+ };
128
+ readonly safe_outcome: {
129
+ readonly type: "string";
130
+ readonly optional: true;
131
+ };
132
+ readonly revision: {
133
+ readonly type: "number";
134
+ };
135
+ readonly disassociated_at: {
136
+ readonly type: "date";
137
+ readonly optional: true;
138
+ };
139
+ readonly settled_at: {
140
+ readonly type: "date";
141
+ readonly optional: true;
142
+ };
143
+ readonly retention_expires_at: {
144
+ readonly type: "date";
145
+ readonly optional: true;
146
+ };
147
+ readonly retention_processed_at: {
148
+ readonly type: "date";
149
+ readonly optional: true;
150
+ };
151
+ readonly created_at: {
152
+ readonly type: "date";
153
+ };
154
+ readonly updated_at: {
155
+ readonly type: "date";
156
+ };
157
+ };
158
+ readonly uniqueKeys: readonly [readonly ["case_id"], readonly ["guild_id", "case_id"], readonly ["guild_id", "case_number"], readonly ["guild_id", "source_module_id", "operation_key"]];
159
+ readonly readableFields: string[];
160
+ readonly writableFields: string[];
161
+ readonly orderKeys: readonly [readonly ["created_at", "case_id"]];
162
+ readonly searchableFields: readonly ["subject_user_id", "actor_user_id"];
163
+ readonly groupableFields: readonly ["source", "action", "state", "repeat_rule_id"];
164
+ };
165
+ readonly case_operations: {
166
+ readonly table: "moderation_case_operations";
167
+ readonly fields: {
168
+ readonly operation_id: {
169
+ readonly type: "string";
170
+ };
171
+ readonly guild_id: {
172
+ readonly type: "string";
173
+ };
174
+ readonly operation_key: {
175
+ readonly type: "string";
176
+ };
177
+ readonly case_id: {
178
+ readonly type: "string";
179
+ readonly optional: true;
180
+ };
181
+ readonly operation_type: {
182
+ readonly type: "string";
183
+ };
184
+ readonly input_hash: {
185
+ readonly type: "string";
186
+ };
187
+ readonly outcome_code: {
188
+ readonly type: "string";
189
+ };
190
+ readonly outcome_revision: {
191
+ readonly type: "number";
192
+ readonly optional: true;
193
+ };
194
+ readonly outcome_attempt_id: {
195
+ readonly type: "string";
196
+ readonly optional: true;
197
+ };
198
+ readonly outcome_attempt_number: {
199
+ readonly type: "number";
200
+ readonly optional: true;
201
+ };
202
+ readonly created_at: {
203
+ readonly type: "date";
204
+ };
205
+ };
206
+ readonly uniqueKeys: readonly [readonly ["operation_id"], readonly ["guild_id", "operation_key"]];
207
+ readonly readableFields: readonly ["operation_id", "guild_id", "operation_key", "case_id", "operation_type", "input_hash", "outcome_code", "outcome_revision", "outcome_attempt_id", "outcome_attempt_number", "created_at"];
208
+ readonly writableFields: readonly ["operation_id", "guild_id", "operation_key", "case_id", "operation_type", "input_hash", "outcome_code", "outcome_revision", "outcome_attempt_id", "outcome_attempt_number", "created_at"];
209
+ readonly orderKeys: readonly [readonly ["created_at", "operation_id"]];
210
+ readonly groupableFields: readonly ["operation_type", "outcome_code"];
211
+ };
212
+ readonly action_attempts: {
213
+ readonly table: "moderation_action_attempts";
214
+ readonly fields: {
215
+ readonly attempt_id: {
216
+ readonly type: "string";
217
+ };
218
+ readonly guild_id: {
219
+ readonly type: "string";
220
+ };
221
+ readonly case_id: {
222
+ readonly type: "string";
223
+ };
224
+ readonly operation_key: {
225
+ readonly type: "string";
226
+ };
227
+ readonly actor_user_id: {
228
+ readonly type: "string";
229
+ readonly optional: true;
230
+ };
231
+ readonly attempt_number: {
232
+ readonly type: "number";
233
+ };
234
+ readonly action: {
235
+ readonly type: "string";
236
+ };
237
+ readonly reason: {
238
+ readonly type: "string";
239
+ };
240
+ readonly outcome: {
241
+ readonly type: "string";
242
+ };
243
+ readonly safe_code: {
244
+ readonly type: "string";
245
+ readonly optional: true;
246
+ };
247
+ readonly removed_role_ids: {
248
+ readonly type: "json";
249
+ };
250
+ readonly requested_duration_seconds: {
251
+ readonly type: "number";
252
+ readonly optional: true;
253
+ };
254
+ readonly requested_demote_role_ids: {
255
+ readonly type: "json";
256
+ readonly optional: true;
257
+ };
258
+ readonly created_at: {
259
+ readonly type: "date";
260
+ };
261
+ readonly updated_at: {
262
+ readonly type: "date";
263
+ };
264
+ };
265
+ readonly uniqueKeys: readonly [readonly ["attempt_id"], readonly ["attempt_id", "attempt_number"], readonly ["case_id", "attempt_number"], readonly ["case_id", "operation_key"]];
266
+ readonly readableFields: readonly ["attempt_id", "guild_id", "case_id", "operation_key", "actor_user_id", "attempt_number", "action", "reason", "outcome", "safe_code", "removed_role_ids", "requested_duration_seconds", "requested_demote_role_ids", "created_at", "updated_at"];
267
+ readonly writableFields: readonly ["attempt_id", "guild_id", "case_id", "operation_key", "actor_user_id", "attempt_number", "action", "reason", "outcome", "safe_code", "removed_role_ids", "requested_duration_seconds", "requested_demote_role_ids", "created_at", "updated_at"];
268
+ readonly orderKeys: readonly [readonly ["created_at", "attempt_id"]];
269
+ readonly groupableFields: readonly ["action", "outcome"];
270
+ };
271
+ readonly dm_receipts: {
272
+ readonly table: "moderation_dm_receipts";
273
+ readonly fields: {
274
+ readonly receipt_id: {
275
+ readonly type: "string";
276
+ };
277
+ readonly guild_id: {
278
+ readonly type: "string";
279
+ };
280
+ readonly case_id: {
281
+ readonly type: "string";
282
+ };
283
+ readonly template_revision: {
284
+ readonly type: "number";
285
+ };
286
+ readonly delivery_state: {
287
+ readonly type: "string";
288
+ };
289
+ readonly safe_code: {
290
+ readonly type: "string";
291
+ readonly optional: true;
292
+ };
293
+ readonly message_id: {
294
+ readonly type: "string";
295
+ readonly optional: true;
296
+ };
297
+ readonly attempted_at: {
298
+ readonly type: "date";
299
+ readonly optional: true;
300
+ };
301
+ readonly created_at: {
302
+ readonly type: "date";
303
+ };
304
+ readonly updated_at: {
305
+ readonly type: "date";
306
+ };
307
+ };
308
+ readonly uniqueKeys: readonly [readonly ["receipt_id"], readonly ["guild_id", "case_id"]];
309
+ readonly readableFields: readonly ["receipt_id", "guild_id", "case_id", "template_revision", "delivery_state", "safe_code", "message_id", "attempted_at", "created_at", "updated_at"];
310
+ readonly writableFields: readonly ["receipt_id", "guild_id", "case_id", "template_revision", "delivery_state", "safe_code", "message_id", "attempted_at", "created_at", "updated_at"];
311
+ readonly orderKeys: readonly [readonly ["created_at", "receipt_id"]];
312
+ readonly groupableFields: readonly ["delivery_state"];
313
+ };
314
+ readonly thread_deliveries: {
315
+ readonly table: "moderation_thread_deliveries";
316
+ readonly fields: {
317
+ readonly delivery_id: {
318
+ readonly type: "string";
319
+ };
320
+ readonly guild_id: {
321
+ readonly type: "string";
322
+ };
323
+ readonly case_id: {
324
+ readonly type: "string";
325
+ };
326
+ readonly case_revision: {
327
+ readonly type: "number";
328
+ };
329
+ readonly operation_key: {
330
+ readonly type: "string";
331
+ };
332
+ readonly parent_channel_id: {
333
+ readonly type: "string";
334
+ readonly optional: true;
335
+ };
336
+ readonly access_role_id: {
337
+ readonly type: "string";
338
+ readonly optional: true;
339
+ };
340
+ readonly thread_id: {
341
+ readonly type: "string";
342
+ readonly optional: true;
343
+ };
344
+ readonly control_token: {
345
+ readonly type: "string";
346
+ readonly optional: true;
347
+ };
348
+ readonly control_message_id: {
349
+ readonly type: "string";
350
+ readonly optional: true;
351
+ };
352
+ readonly member_state: {
353
+ readonly type: "string";
354
+ };
355
+ readonly evidence_state: {
356
+ readonly type: "string";
357
+ };
358
+ readonly opening_state: {
359
+ readonly type: "string";
360
+ };
361
+ readonly notification_state: {
362
+ readonly type: "string";
363
+ };
364
+ readonly close_state: {
365
+ readonly type: "string";
366
+ };
367
+ readonly resolution_state: {
368
+ readonly type: "string";
369
+ };
370
+ readonly attempt_count: {
371
+ readonly type: "number";
372
+ };
373
+ readonly fence_token: {
374
+ readonly type: "number";
375
+ };
376
+ readonly safe_code: {
377
+ readonly type: "string";
378
+ readonly optional: true;
379
+ };
380
+ readonly retry_at: {
381
+ readonly type: "date";
382
+ readonly optional: true;
383
+ };
384
+ readonly created_at: {
385
+ readonly type: "date";
386
+ };
387
+ readonly updated_at: {
388
+ readonly type: "date";
389
+ };
390
+ };
391
+ readonly uniqueKeys: readonly [readonly ["delivery_id"], readonly ["guild_id", "case_id"], readonly ["guild_id", "operation_key"], readonly ["control_token"]];
392
+ readonly readableFields: readonly ["delivery_id", "guild_id", "case_id", "case_revision", "operation_key", "parent_channel_id", "access_role_id", "thread_id", "control_token", "control_message_id", "member_state", "evidence_state", "opening_state", "notification_state", "close_state", "resolution_state", "attempt_count", "fence_token", "safe_code", "retry_at", "created_at", "updated_at"];
393
+ readonly writableFields: readonly ["delivery_id", "guild_id", "case_id", "case_revision", "operation_key", "parent_channel_id", "access_role_id", "thread_id", "control_token", "control_message_id", "member_state", "evidence_state", "opening_state", "notification_state", "close_state", "resolution_state", "attempt_count", "fence_token", "safe_code", "retry_at", "created_at", "updated_at"];
394
+ readonly orderKeys: readonly [readonly ["updated_at", "delivery_id"]];
395
+ readonly searchableFields: readonly ["thread_id", "control_token"];
396
+ readonly groupableFields: readonly ["resolution_state", "close_state"];
397
+ };
398
+ };
399
+ //# sourceMappingURL=records.d.ts.map