@chatwarden/store-memory 0.0.0-stage → 0.1.2
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/LICENSE +202 -0
- package/README.md +116 -2
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/memoryStore.d.ts +200 -0
- package/dist/src/memoryStore.d.ts.map +1 -0
- package/dist/src/memoryStore.js +962 -0
- package/dist/src/memoryStore.js.map +1 -0
- package/package.json +53 -4
- package/src/index.ts +4 -0
- package/src/memoryStore.ts +1035 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @chatwarden/store-memory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The in-memory store for Chatwarden, the open-source chat moderation kit for games. It keeps everything the kit stores (people as
|
|
4
|
+
hashed identifiers, reports, sanctions, strikes, mutes, notices, decisions, the audit trail, moderators' claims and saved reasons) in plain JavaScript objects inside
|
|
5
|
+
your process. Nothing is written to disk.
|
|
6
|
+
|
|
7
|
+
**It is memory only. Everything is lost when the process restarts, exits or stops.** It is for tests, demos and single-process
|
|
8
|
+
prototypes. Do not use it in production: a restart would forget every report, every ban and every strike. For anything that must
|
|
9
|
+
survive a restart, use [`@chatwarden/store-sqlite`](https://github.com/hainix/chatwarden/tree/main/packages/store-sqlite).
|
|
10
|
+
|
|
11
|
+
Use it with `@chatwarden/core`: `createMemoryStore()` returns the `store` that `createChatwarden` asks for.
|
|
12
|
+
|
|
13
|
+
Status: pre-release, as-is, no support promise.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install @chatwarden/store-memory @chatwarden/core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`@chatwarden/core` is a peer dependency, so your project has exactly one copy of it. Node 22.13 or newer. The package imports no
|
|
22
|
+
`node:` module and has no dependencies, so it also bundles for a browser.
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createChatwarden, type Platform } from '@chatwarden/core';
|
|
28
|
+
import { createMemoryStore } from '@chatwarden/store-memory';
|
|
29
|
+
|
|
30
|
+
// A fresh, empty store. There is nothing to open, configure or close on disk.
|
|
31
|
+
const store = createMemoryStore();
|
|
32
|
+
|
|
33
|
+
const platform: Platform = {
|
|
34
|
+
identify: (ctx) => {
|
|
35
|
+
const conn = ctx as { playerToken: string; remoteAddress: string };
|
|
36
|
+
return { clientKey: conn.playerToken, ip: conn.remoteAddress };
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const cw = await createChatwarden({ store, secret: 'a-long-random-secret-for-this-run', platform, retention: false });
|
|
41
|
+
|
|
42
|
+
// ... run your test or demo ...
|
|
43
|
+
|
|
44
|
+
await cw.close(); // flushes pending writes; the store's contents are then simply dropped
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
In a test you can also read back what was stored, or make the store fail on purpose. `MemoryStore` is a class; subclass it and
|
|
48
|
+
override one method to inject a failure:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import { MemoryStore } from '@chatwarden/store-memory';
|
|
52
|
+
import type { StrikeRow } from '@chatwarden/core';
|
|
53
|
+
|
|
54
|
+
class FullDisk extends MemoryStore {
|
|
55
|
+
override insertStrike(_row: StrikeRow): void {
|
|
56
|
+
throw new Error('disk full');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const store = new FullDisk();
|
|
61
|
+
console.log(store.rawReports().length); // 0: a copy of every stored report, for assertions
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Options
|
|
65
|
+
|
|
66
|
+
`createMemoryStore()` and `new MemoryStore()` take no options. The inspection helpers below return copies, so changing what they
|
|
67
|
+
return changes nothing in the store.
|
|
68
|
+
|
|
69
|
+
| Method | What it returns |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `rawReports()` | Every stored report, with its decision columns. |
|
|
72
|
+
| `rawSanctions()` | Every sanction row, revoked ones included. |
|
|
73
|
+
| `rawNotices()` | Every player notice, seen, unseen and withdrawn. |
|
|
74
|
+
| `rawDecisions()` | Every recorded moderator decision. |
|
|
75
|
+
| `rawStrikes()` | Every strike. |
|
|
76
|
+
| `rawMutes()` | Every mute. |
|
|
77
|
+
|
|
78
|
+
How it behaves:
|
|
79
|
+
|
|
80
|
+
- **Transactions are real.** The kit's multi-step writes (a decision that closes a report, writes a sanction and a notice) run in
|
|
81
|
+
`store.transaction(fn)`. Every write inside is journaled; if `fn` throws, they are undone in reverse order and the error is
|
|
82
|
+
rethrown. Calls nest: an inner failure the outer function catches undoes only the inner writes.
|
|
83
|
+
- **Same behaviour as the SQLite store.** Both stores run one shared store contract suite (ordering, paging, uniqueness, rollback,
|
|
84
|
+
what each purge deletes). Where they ever disagree, the SQLite store is the reference and this one is the bug.
|
|
85
|
+
- **The editable profile.** It implements `loadPolicyLayer` and `savePolicyLayer`, so `cw.policy.save` works. The stored layer lives in
|
|
86
|
+
the heap with everything else: it is lost when the process ends, so a profile edited at runtime goes back to your code's profile
|
|
87
|
+
on restart. Use the SQLite store (or your own) for edits that must last.
|
|
88
|
+
- **One process, one thread.** It is a set of objects in your heap. Two processes, or two workers, each get their own empty store.
|
|
89
|
+
- **No size limit.** Memory grows with what you store until the retention purge runs or the process ends.
|
|
90
|
+
|
|
91
|
+
## Security notes
|
|
92
|
+
|
|
93
|
+
- **What it holds.** The same things the SQLite store holds: subject ids, keyed hashes of client keys and IP addresses, account ids
|
|
94
|
+
exactly as your app gave them, reports with an excerpt of the conversation, sanction reasons and moderator notes. The raw client
|
|
95
|
+
key and raw IP address never reach any store; hashing happens in `@chatwarden/core` first. Pass an opaque account id, not an
|
|
96
|
+
email address.
|
|
97
|
+
- **Subject ids are staff-only.** `rawReports()` and the other helpers return subject ids and chat excerpts. Use them in tests and
|
|
98
|
+
staff tooling only; never send their output to a player.
|
|
99
|
+
- **Nothing is logged.** The store never logs anything. Errors it throws are plain `Error`s with no values in them; the kit logs only an
|
|
100
|
+
event name and the error class.
|
|
101
|
+
- **Retention is core's call, not the store's.** The store has no timer and nothing purges by itself. The purge methods
|
|
102
|
+
(`purgeReports`, `purgeSanctions`, `purgeNotices` and the rest) delete exactly what the SQLite store would (both pass the same
|
|
103
|
+
store contract suite), and run only when
|
|
104
|
+
`@chatwarden/core` calls them: its built-in retention timer, or `cw.purge()`. With `retention: false` and no `cw.purge()`
|
|
105
|
+
call, nothing is ever deleted until the process ends. The subject records, and the Discord thread map, are never purged, as in
|
|
106
|
+
the SQLite store.
|
|
107
|
+
- **Everything is lost on restart, and that is the whole point.** There is no file to protect, no backup to leak and no
|
|
108
|
+
encryption question; the flip side is no durability at all.
|
|
109
|
+
|
|
110
|
+
## Links
|
|
111
|
+
|
|
112
|
+
- [Chatwarden on GitHub](https://github.com/hainix/chatwarden) and the [root README](https://github.com/hainix/chatwarden#readme)
|
|
113
|
+
- [`@chatwarden/core`](https://github.com/hainix/chatwarden/tree/main/packages/core): the engine that uses this store
|
|
114
|
+
- [`@chatwarden/store-sqlite`](https://github.com/hainix/chatwarden/tree/main/packages/store-sqlite): the store for anything that must survive a restart
|
|
115
|
+
- [`@chatwarden/http`](https://github.com/hainix/chatwarden/tree/main/packages/http): routes for moderators and players
|
|
116
|
+
- [Report a problem](https://github.com/hainix/chatwarden/issues)
|
|
117
|
+
- [Licence: Apache-2.0](https://github.com/hainix/chatwarden/blob/main/LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { AuditListQuery, AuditRow, ClaimAttempt, ClaimMode, ClaimRow, DecisionRow, MuteRow, NoticeRow, OpenReportQuery, PolicyLayer, ReasonRow, ReportActivity, ReportListQuery, ReportRecord, ReporterDecision, ReporterTally, SanctionListQuery, SanctionRow, Store, StoredReport, StrikeRow, SubjectIdRecord, SubjectId, SubjectRecord, WebhookKeyReservation, DiscordThreadRow } from '@chatwarden/core';
|
|
2
|
+
/** A report plus the moderation columns a decision fills. */
|
|
3
|
+
export type StoredReportRow = ReportRecord;
|
|
4
|
+
/** A stored sanction row plus its revocation, as the SQL table keeps it. */
|
|
5
|
+
export interface StoredSanction extends SanctionRow {
|
|
6
|
+
/** The new rule a closed gap became (`ruled`), as text; null otherwise. */
|
|
7
|
+
gapRef: string | null;
|
|
8
|
+
/** Who closed the gap, and when; null while it is open. */
|
|
9
|
+
gapClosedBy: string | null;
|
|
10
|
+
gapClosedAt: number | null;
|
|
11
|
+
revokedBy: string | null;
|
|
12
|
+
revokedAt: number | null;
|
|
13
|
+
revokeReason: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* In-memory {@link Store}: everything lives in this object and is lost when it is garbage collected or the process ends.
|
|
17
|
+
* For tests, demos and single-process prototypes; use `@chatwarden/store-sqlite` for anything that must survive a
|
|
18
|
+
* restart. It keeps the same rows in the same order as the SQLite adapter (both run one shared contract suite), and
|
|
19
|
+
* `transaction` is real: writes are journaled and a throwing function undoes them, nested calls included.
|
|
20
|
+
*
|
|
21
|
+
* It imports no `node:` module, so it bundles for a browser. Subclass it or overwrite a method on an instance to inject
|
|
22
|
+
* failures in a test.
|
|
23
|
+
*/
|
|
24
|
+
export declare class MemoryStore implements Store {
|
|
25
|
+
protected subjects: Map<string, SubjectRecord>;
|
|
26
|
+
protected subjectIds: Map<string, SubjectIdRecord>;
|
|
27
|
+
protected sanctions: StoredSanction[];
|
|
28
|
+
/** Mutes by `viewer, target`; `seq` stands in for SQLite's rowid (insertion order, kept on refresh). */
|
|
29
|
+
protected mutes: Map<string, {
|
|
30
|
+
row: MuteRow;
|
|
31
|
+
seq: number;
|
|
32
|
+
}>;
|
|
33
|
+
private muteSeq;
|
|
34
|
+
protected strikes: StrikeRow[];
|
|
35
|
+
/** Reports in insertion order; `insertReport` enforces UNIQUE (reporter, target, room). */
|
|
36
|
+
protected reports: StoredReportRow[];
|
|
37
|
+
/** Recorded decisions by key. */
|
|
38
|
+
protected decisions: Map<string, DecisionRow>;
|
|
39
|
+
/** Notices in insertion order (stands in for SQLite's rowid). */
|
|
40
|
+
protected notices: NoticeRow[];
|
|
41
|
+
/** Staff audit entries in insertion order. */
|
|
42
|
+
protected auditRows: AuditRow[];
|
|
43
|
+
/** Incoming-webhook idempotency keys. */
|
|
44
|
+
protected webhookKeys: Map<string, {
|
|
45
|
+
createdAt: number;
|
|
46
|
+
state: "pending" | "done";
|
|
47
|
+
resultJson: string | null;
|
|
48
|
+
fingerprint: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** The Discord feed's thread map by subject. */
|
|
51
|
+
protected discordThreads: Map<string, DiscordThreadRow>;
|
|
52
|
+
/** Group id that owns each ref code: the O(1) collision check. */
|
|
53
|
+
protected refOwners: Map<string, string>;
|
|
54
|
+
/** Soft claims by person (one row each; an expired one is replaced or ignored, never swept). */
|
|
55
|
+
protected claims: Map<string, ClaimRow>;
|
|
56
|
+
/** Saved reasons in the order they were added. */
|
|
57
|
+
protected reasons: ReasonRow[];
|
|
58
|
+
/** The stored policy layer and its version, or null when none was ever saved. */
|
|
59
|
+
protected policy: {
|
|
60
|
+
layer: PolicyLayer;
|
|
61
|
+
version: number;
|
|
62
|
+
} | null;
|
|
63
|
+
/** The change token's counter (see `changeToken`). */
|
|
64
|
+
private changes;
|
|
65
|
+
/** Undo steps of the innermost open transaction, or null outside one. */
|
|
66
|
+
private journal;
|
|
67
|
+
private undoWith;
|
|
68
|
+
/** Move the change token; an undone transaction moves it back. */
|
|
69
|
+
private bump;
|
|
70
|
+
schemaVersion(): number;
|
|
71
|
+
/**
|
|
72
|
+
* Synchronous like the real thing. Writes inside are journaled as undo steps
|
|
73
|
+
* (cost is O(writes), not O(store size)); if `fn` throws the steps run in
|
|
74
|
+
* reverse and the error is rethrown. Calls nest: an inner failure the outer
|
|
75
|
+
* `fn` catches undoes only the inner writes, and a successful inner call
|
|
76
|
+
* hands its steps to the outer one so an outer failure still undoes them.
|
|
77
|
+
*/
|
|
78
|
+
transaction<T>(fn: () => T): T;
|
|
79
|
+
close(): void;
|
|
80
|
+
saveSubject(subject: SubjectRecord): Promise<void>;
|
|
81
|
+
saveIdentifier(record: SubjectIdRecord): Promise<void>;
|
|
82
|
+
markMerged(id: SubjectId, into: SubjectId): Promise<void>;
|
|
83
|
+
loadSubjects(): Promise<{
|
|
84
|
+
subjects: SubjectRecord[];
|
|
85
|
+
ids: SubjectIdRecord[];
|
|
86
|
+
}>;
|
|
87
|
+
insertSanctionGroup(rows: readonly SanctionRow[]): boolean;
|
|
88
|
+
revokeSanctionGroup(groupId: string, actor: string, at: number, reason: string): number;
|
|
89
|
+
sanctionRefCode(groupId: string): string | null;
|
|
90
|
+
sanctionGroupTarget(groupId: string): {
|
|
91
|
+
subject: SubjectId;
|
|
92
|
+
rule: string | null;
|
|
93
|
+
} | null;
|
|
94
|
+
loadSanctions(now: number): SanctionRow[];
|
|
95
|
+
loadSubjectActions(since: number): SanctionRow[];
|
|
96
|
+
private sanctionRow;
|
|
97
|
+
listSubjectSanctions(q: SanctionListQuery): SanctionRow[];
|
|
98
|
+
listGaps(): SanctionRow[];
|
|
99
|
+
closeGap(groupId: string, status: 'ruled' | 'not_a_rule', ref: string | null, actor: string, at: number): boolean;
|
|
100
|
+
changeToken(): string;
|
|
101
|
+
claimCase(person: SubjectId, by: string, now: number, until: number, mode: ClaimMode): ClaimAttempt;
|
|
102
|
+
releaseClaim(person: SubjectId, by: string, now: number): boolean;
|
|
103
|
+
loadClaims(persons: readonly SubjectId[], now: number): ClaimRow[];
|
|
104
|
+
listReasons(): ReasonRow[];
|
|
105
|
+
insertReason(row: ReasonRow): void;
|
|
106
|
+
updateReason(id: string, patch: {
|
|
107
|
+
label?: string;
|
|
108
|
+
text?: string;
|
|
109
|
+
}): boolean;
|
|
110
|
+
setReasonActive(id: string, active: boolean): boolean;
|
|
111
|
+
loadPolicyLayer(): {
|
|
112
|
+
layer: PolicyLayer;
|
|
113
|
+
version: number;
|
|
114
|
+
} | null;
|
|
115
|
+
savePolicyLayer(layer: PolicyLayer, expectedVersion: number): number | null;
|
|
116
|
+
insertAudit(row: AuditRow): void;
|
|
117
|
+
listAudit(q: AuditListQuery): AuditRow[];
|
|
118
|
+
purgeAudit(before: number): number;
|
|
119
|
+
reserveWebhookKey(key: string, now: number, notBefore: number, fingerprint: string): WebhookKeyReservation;
|
|
120
|
+
completeWebhookKey(key: string, resultJson: string): boolean;
|
|
121
|
+
releaseWebhookKey(key: string): boolean;
|
|
122
|
+
purgeWebhookKeys(before: number): number;
|
|
123
|
+
getDiscordThread(subject: string): DiscordThreadRow | null;
|
|
124
|
+
putDiscordThread(row: DiscordThreadRow): void;
|
|
125
|
+
upsertMute(row: MuteRow): void;
|
|
126
|
+
deleteMute(viewer: SubjectId, target: SubjectId): boolean;
|
|
127
|
+
loadMutes(since: number): MuteRow[];
|
|
128
|
+
pruneMutes(viewer: SubjectId, keep: number): SubjectId[];
|
|
129
|
+
insertStrike(row: StrikeRow): void;
|
|
130
|
+
loadStrikes(since: number): StrikeRow[];
|
|
131
|
+
listStrikes(since: number, limit: number): StrikeRow[];
|
|
132
|
+
countStrikesByTerm(since: number): Array<{
|
|
133
|
+
termId: string;
|
|
134
|
+
count: number;
|
|
135
|
+
}>;
|
|
136
|
+
loadAutoChatStarts(): Array<{
|
|
137
|
+
subject: SubjectId;
|
|
138
|
+
startsAt: number;
|
|
139
|
+
}>;
|
|
140
|
+
insertReport(row: StoredReport): boolean;
|
|
141
|
+
loadReport(id: string): ReportRecord | null;
|
|
142
|
+
listReportsByPerson(subjects: readonly SubjectId[], limit: number): ReportRecord[];
|
|
143
|
+
listOpenReports(q: OpenReportQuery): ReportRecord[];
|
|
144
|
+
listOpenReportsByPerson(subjects: readonly SubjectId[], limit: number): ReportRecord[];
|
|
145
|
+
reporterTally(reporters: readonly SubjectId[]): ReporterTally;
|
|
146
|
+
listReports(q: ReportListQuery): ReportRecord[];
|
|
147
|
+
loadReporterDecisions(reporters: readonly SubjectId[]): ReporterDecision[];
|
|
148
|
+
addReportDetail(id: string, detail: {
|
|
149
|
+
reportedReason: string | null;
|
|
150
|
+
category: ReportRecord['category'];
|
|
151
|
+
note: string | null;
|
|
152
|
+
at: number;
|
|
153
|
+
}): boolean;
|
|
154
|
+
closeReport(id: string, status: 'actioned' | 'dismissed', badFaith: boolean, actor: string, at: number, note: string, evidence?: string | null): boolean;
|
|
155
|
+
insertDecision(key: string, reportId: string, at: number, resultJson: string): void;
|
|
156
|
+
findDecision(key: string): DecisionRow | null;
|
|
157
|
+
loadReportActivity(since: number): ReportActivity[];
|
|
158
|
+
loadRoomReportPairs(roomId: string): Array<{
|
|
159
|
+
reporter: SubjectId;
|
|
160
|
+
target: SubjectId;
|
|
161
|
+
}>;
|
|
162
|
+
loadBadFaithMarks(since: number): Array<{
|
|
163
|
+
reporter: SubjectId;
|
|
164
|
+
actionedAt: number;
|
|
165
|
+
}>;
|
|
166
|
+
loadAutoChatGroups(since: number): Array<{
|
|
167
|
+
subject: SubjectId;
|
|
168
|
+
groupId: string;
|
|
169
|
+
}>;
|
|
170
|
+
purgeReports(before: number, keepBadFaithSince: number): number;
|
|
171
|
+
purgeSanctions(before: number): number;
|
|
172
|
+
purgeStrikes(before: number): number;
|
|
173
|
+
purgeMutes(before: number): number;
|
|
174
|
+
insertNotice(row: NoticeRow): void;
|
|
175
|
+
loadNotices(subjects: readonly SubjectId[]): NoticeRow[];
|
|
176
|
+
ackNotice(id: string, at: number): boolean;
|
|
177
|
+
findNoticeForGroup(groupId: string): {
|
|
178
|
+
id: string;
|
|
179
|
+
subject: SubjectId;
|
|
180
|
+
ackedAt: number | null;
|
|
181
|
+
withdrawnAt: number | null;
|
|
182
|
+
} | null;
|
|
183
|
+
withdrawNoticeGroup(groupId: string, at: number): number;
|
|
184
|
+
purgeNotices(before: number): number;
|
|
185
|
+
/** Inspection helper: every stored notice. */
|
|
186
|
+
rawNotices(): NoticeRow[];
|
|
187
|
+
/** Inspection helper: every recorded decision. */
|
|
188
|
+
rawDecisions(): DecisionRow[];
|
|
189
|
+
/** Inspection helper: every stored report. */
|
|
190
|
+
rawReports(): StoredReportRow[];
|
|
191
|
+
/** Inspection helper: every stored strike. */
|
|
192
|
+
rawStrikes(): StrikeRow[];
|
|
193
|
+
/** Inspection helper: every stored mute. */
|
|
194
|
+
rawMutes(): MuteRow[];
|
|
195
|
+
/** Inspection helper: every stored row, revoked ones included. */
|
|
196
|
+
rawSanctions(): StoredSanction[];
|
|
197
|
+
}
|
|
198
|
+
/** A new, empty {@link MemoryStore}. */
|
|
199
|
+
export declare function createMemoryStore(): MemoryStore;
|
|
200
|
+
//# sourceMappingURL=memoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoryStore.d.ts","sourceRoot":"","sources":["../../src/memoryStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAoB1B,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,qBAAa,WAAY,YAAW,KAAK;IACvC,SAAS,CAAC,QAAQ,6BAAuC;IACzD,SAAS,CAAC,UAAU,+BAAsC;IAC1D,SAAS,CAAC,SAAS,EAAE,cAAc,EAAE,CAAM;IAC3C,wGAAwG;IACxG,SAAS,CAAC,KAAK;aAA0B,OAAO;aAAO,MAAM;OAAM;IACnE,OAAO,CAAC,OAAO,CAAK;IACpB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAM;IACpC,2FAA2F;IAC3F,SAAS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