@voltro/plugin-sanctions 0.0.0-stage → 0.88.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/web.d.ts ADDED
@@ -0,0 +1,239 @@
1
+ import { ActionState } from '@voltro/client';
2
+ import { ReactNode } from 'react';
3
+ import { Schema } from 'effect';
4
+ import { SubscriptionState } from '@voltro/client';
5
+
6
+ declare const ACTION_KINDS: readonly ["warn", "mute", "chatBan", "matchmakingBan", "rankedBan", "tradeBan", "ban", "shadowBan", "nameReset", "rollback"];
7
+
8
+ export declare const AppealDialog: ({ scopeKey, dataScopeKey, action, text, pending, error, labels, onChange, onSubmit, onCancel, maxTextLength }: {
9
+ readonly scopeKey: string;
10
+ readonly dataScopeKey: string;
11
+ readonly action: Sanction;
12
+ readonly text: string;
13
+ readonly pending?: boolean;
14
+ readonly error?: string;
15
+ readonly labels?: SanctionLabels;
16
+ readonly onChange: (text: string) => void;
17
+ readonly onSubmit: () => void;
18
+ readonly onCancel: () => void;
19
+ readonly maxTextLength?: number;
20
+ }) => ReactNode;
21
+
22
+ declare const AppealSchema: Schema.Struct<{
23
+ readonly id: Schema.String;
24
+ readonly actionId: Schema.String;
25
+ readonly text: Schema.String;
26
+ readonly state: Schema.Literals<readonly ["pending", "reviewed"]>;
27
+ readonly outcome: Schema.NullOr<Schema.Literals<readonly ["upheld", "revoked"]>>;
28
+ readonly createdAt: Schema.Number;
29
+ readonly decidedAt: Schema.NullOr<Schema.Number>;
30
+ }>;
31
+
32
+ declare const CaseSchema: Schema.Struct<{
33
+ readonly id: Schema.String;
34
+ readonly targetId: Schema.NullOr<Schema.String>;
35
+ readonly reports: Schema.Number;
36
+ readonly evidence: Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>;
37
+ readonly trustScore: Schema.Number;
38
+ readonly state: Schema.Literals<readonly ["open", "reviewing", "actioned", "dismissed"]>;
39
+ readonly decidedBy: Schema.NullOr<Schema.String>;
40
+ readonly decidedAt: Schema.NullOr<Schema.Number>;
41
+ readonly version: Schema.Number;
42
+ }>;
43
+
44
+ declare const CATEGORIES: readonly ["cheating", "abuse", "name", "spam", "griefing", "rmt"];
45
+
46
+ declare interface IssueSanctionInput {
47
+ readonly requestId: string;
48
+ readonly targetId: string;
49
+ readonly kind: SanctionKind;
50
+ readonly scope?: SanctionScope;
51
+ readonly durationMs?: number | null;
52
+ readonly reason: string;
53
+ readonly publicReason: string;
54
+ readonly evidenceCaseId?: string;
55
+ readonly appealable?: boolean;
56
+ }
57
+
58
+ declare type ReportContext = typeof ReportContextSchema.Type;
59
+
60
+ declare const ReportContextSchema: Schema.Struct<{
61
+ readonly channelId: Schema.optional<Schema.String>;
62
+ readonly messageIds: Schema.optional<Schema.$Array<Schema.String>>;
63
+ readonly roomId: Schema.optional<Schema.String>;
64
+ readonly matchId: Schema.optional<Schema.String>;
65
+ readonly replayRef: Schema.optional<Schema.String>;
66
+ }>;
67
+
68
+ /** Parent retains draft, request identity and pending state through transport uncertainty. */
69
+ export declare const ReportDialog: ({ scopeKey, dataScopeKey, targetId, draft, pending, error, labels, onChange, onSubmit, onCancel, maxNoteLength }: {
70
+ readonly scopeKey: string;
71
+ readonly dataScopeKey: string;
72
+ readonly targetId: string;
73
+ readonly draft: ReportDraft;
74
+ readonly pending?: boolean;
75
+ readonly error?: string;
76
+ readonly labels?: SanctionLabels;
77
+ readonly onChange: (draft: ReportDraft) => void;
78
+ readonly onSubmit: () => void;
79
+ readonly onCancel: () => void;
80
+ readonly maxNoteLength?: number;
81
+ }) => ReactNode;
82
+
83
+ export declare interface ReportDraft {
84
+ readonly category: SanctionCategory;
85
+ readonly note: string;
86
+ }
87
+
88
+ declare interface ReportInput {
89
+ readonly requestId: string;
90
+ readonly targetId: string;
91
+ readonly category: SanctionCategory;
92
+ readonly context?: ReportContext;
93
+ readonly note?: string;
94
+ }
95
+
96
+ declare type Sanction = typeof SanctionSchema.Type;
97
+
98
+ declare type SanctionAppeal = typeof AppealSchema.Type;
99
+
100
+ declare type SanctionCase = typeof CaseSchema.Type;
101
+
102
+ declare type SanctionCategory = typeof CATEGORIES[number];
103
+
104
+ export declare interface SanctionDialogLabels {
105
+ readonly reportTitle: string;
106
+ readonly category: string;
107
+ readonly note: string;
108
+ readonly report: string;
109
+ readonly cancel: string;
110
+ readonly pending: string;
111
+ readonly appealTitle: string;
112
+ readonly appealText: string;
113
+ readonly appeal: string;
114
+ readonly expires: string;
115
+ readonly permanent: string;
116
+ readonly scopeLoading: string;
117
+ readonly noActions: string;
118
+ readonly noticeTitle: string;
119
+ readonly categories: Readonly<Record<SanctionCategory, string>>;
120
+ readonly kinds: Readonly<Record<Sanction['kind'], string>>;
121
+ }
122
+
123
+ declare type SanctionKind = typeof ACTION_KINDS[number];
124
+
125
+ export declare type SanctionLabels = SanctionDialogLabels;
126
+
127
+ export declare const sanctionLabels: Readonly<Record<'en' | 'de', SanctionLabels>>;
128
+
129
+ export declare const SanctionNotice: ({ scopeKey, dataScopeKey, actions, appeals, locale, labels, onAppeal }: {
130
+ readonly scopeKey: string;
131
+ readonly dataScopeKey: string;
132
+ readonly actions: ReadonlyArray<Sanction>;
133
+ readonly appeals?: ReadonlyArray<SanctionAppeal>;
134
+ readonly locale?: "en" | "de";
135
+ readonly labels?: SanctionLabels;
136
+ readonly onAppeal?: (actionId: string) => void;
137
+ }) => ReactNode;
138
+
139
+ declare const SanctionSchema: Schema.Struct<{
140
+ readonly id: Schema.String;
141
+ readonly kind: Schema.Literals<readonly ["warn", "mute", "chatBan", "matchmakingBan", "rankedBan", "tradeBan", "ban", "shadowBan", "nameReset", "rollback"]>;
142
+ readonly scope: Schema.Struct<{
143
+ readonly channels: Schema.$Array<Schema.String>;
144
+ readonly queues: Schema.$Array<Schema.String>;
145
+ }>;
146
+ readonly from: Schema.Number;
147
+ readonly until: Schema.NullOr<Schema.Number>;
148
+ readonly publicReason: Schema.String;
149
+ readonly appealable: Schema.Boolean;
150
+ }>;
151
+
152
+ declare type SanctionScope = typeof SanctionScopeSchema.Type;
153
+
154
+ declare const SanctionScopeSchema: Schema.Struct<{
155
+ readonly channels: Schema.$Array<Schema.String>;
156
+ readonly queues: Schema.$Array<Schema.String>;
157
+ }>;
158
+
159
+ export declare const useAppeal: (apiName?: string) => ActionState<{
160
+ actionId: string;
161
+ text: string;
162
+ }, unknown>;
163
+
164
+ export declare const useReport: (apiName?: string) => ActionState<ReportInput, unknown>;
165
+
166
+ export declare const useSanctionAppealQueue: (apiName?: string) => SubscriptionState<readonly {
167
+ readonly id: string;
168
+ readonly actionId: string;
169
+ readonly text: string;
170
+ readonly state: "pending" | "reviewed";
171
+ readonly outcome: "revoked" | "upheld" | null;
172
+ readonly createdAt: number;
173
+ readonly decidedAt: number | null;
174
+ }[]>;
175
+
176
+ export declare const useSanctionAppealReview: (apiName?: string) => ActionState<{
177
+ appealId: string;
178
+ outcome: "upheld" | "revoked";
179
+ }, unknown>;
180
+
181
+ export declare const useSanctionAppeals: (apiName?: string) => SubscriptionState<readonly {
182
+ readonly id: string;
183
+ readonly actionId: string;
184
+ readonly text: string;
185
+ readonly state: "pending" | "reviewed";
186
+ readonly outcome: "revoked" | "upheld" | null;
187
+ readonly createdAt: number;
188
+ readonly decidedAt: number | null;
189
+ }[]>;
190
+
191
+ export declare const useSanctionCaseReview: (apiName?: string) => ActionState<{
192
+ caseId: string;
193
+ baseVersion: number;
194
+ state: SanctionCase["state"];
195
+ }, unknown>;
196
+
197
+ export declare const useSanctionCases: (apiName?: string) => SubscriptionState<readonly {
198
+ readonly id: string;
199
+ readonly targetId: string | null;
200
+ readonly reports: number;
201
+ readonly evidence: readonly {
202
+ readonly [x: string]: unknown;
203
+ }[];
204
+ readonly trustScore: number;
205
+ readonly state: "open" | "reviewing" | "actioned" | "dismissed";
206
+ readonly decidedBy: string | null;
207
+ readonly decidedAt: number | null;
208
+ readonly version: number;
209
+ }[]>;
210
+
211
+ export declare const useSanctionIssue: (apiName?: string) => ActionState<IssueSanctionInput, unknown>;
212
+
213
+ export declare const useSanctionReports: (apiName?: string) => SubscriptionState<readonly {
214
+ readonly id: string;
215
+ readonly targetId: string;
216
+ readonly category: "name" | "cheating" | "abuse" | "spam" | "griefing" | "rmt";
217
+ readonly state: "open" | "reviewing" | "actioned" | "dismissed";
218
+ readonly createdAt: number;
219
+ readonly caseId: string;
220
+ }[]>;
221
+
222
+ export declare const useSanctionRevoke: (apiName?: string) => ActionState<{
223
+ actionId: string;
224
+ }, unknown>;
225
+
226
+ export declare const useSanctions: (apiName?: string) => SubscriptionState<readonly {
227
+ readonly id: string;
228
+ readonly kind: "warn" | "mute" | "chatBan" | "matchmakingBan" | "rankedBan" | "tradeBan" | "ban" | "shadowBan" | "nameReset" | "rollback";
229
+ readonly scope: {
230
+ readonly channels: readonly string[];
231
+ readonly queues: readonly string[];
232
+ };
233
+ readonly from: number;
234
+ readonly until: number | null;
235
+ readonly publicReason: string;
236
+ readonly appealable: boolean;
237
+ }[]>;
238
+
239
+ export { }
package/dist/web.js ADDED
@@ -0,0 +1,7 @@
1
+ import { BASE_NAME as e } from "./rpc.js";
2
+ import { AppealDialog as t, ReportDialog as n, SanctionNotice as r, sanctionLabels as i } from "./components.js";
3
+ import { pluginTag as a } from "@voltro/protocol";
4
+ import { useAction as o, useSubscription as s } from "@voltro/client";
5
+ // src/web.ts
6
+ var c = (t = "app") => s(t, a(e, "mine"), {}), l = (t = "app") => s(t, a(e, "reportsMine"), {}), u = (t = "app") => s(t, a(e, "appealsMine"), {}), d = (t = "app") => s(t, a(e, "cases"), {}), f = (t = "app") => s(t, a(e, "appealsQueue"), {}), p = (t = "app") => o(t, a(e, "report")), m = (t = "app") => o(t, a(e, "appeal")), h = (t = "app") => o(t, a(e, "issue")), g = (t = "app") => o(t, a(e, "revoke")), _ = (t = "app") => o(t, a(e, "reviewCase")), v = (t = "app") => o(t, a(e, "reviewAppeal"));
7
+ export { t as AppealDialog, n as ReportDialog, r as SanctionNotice, i as sanctionLabels, m as useAppeal, p as useReport, f as useSanctionAppealQueue, v as useSanctionAppealReview, u as useSanctionAppeals, _ as useSanctionCaseReview, d as useSanctionCases, h as useSanctionIssue, l as useSanctionReports, g as useSanctionRevoke, c as useSanctions };
package/package.json CHANGED
@@ -1,6 +1,101 @@
1
1
  {
2
2
  "name": "@voltro/plugin-sanctions",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.88.0",
4
+ "description": "SQL-authoritative sanctions, reports, review, appeals and replaceable enforcement",
5
+ "keywords": [
6
+ "voltro",
7
+ "typescript",
8
+ "framework"
9
+ ],
10
+ "license": "SEE LICENSE IN LICENSE",
11
+ "homepage": "https://voltro.dev",
12
+ "bugs": {
13
+ "email": "support@voltro.dev"
14
+ },
15
+ "author": {
16
+ "name": "Voltro UG",
17
+ "url": "https://voltro.dev"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./errors": {
27
+ "types": "./dist/errors.d.ts",
28
+ "import": "./dist/errors.js",
29
+ "default": "./dist/errors.js"
30
+ },
31
+ "./rpc": {
32
+ "types": "./dist/rpc.d.ts",
33
+ "import": "./dist/rpc.js",
34
+ "default": "./dist/rpc.js"
35
+ },
36
+ "./port": {
37
+ "types": "./dist/port.d.ts",
38
+ "import": "./dist/port.js",
39
+ "default": "./dist/port.js"
40
+ },
41
+ "./strategies": {
42
+ "types": "./dist/strategies.d.ts",
43
+ "import": "./dist/strategies.js",
44
+ "default": "./dist/strategies.js"
45
+ },
46
+ "./testing": {
47
+ "types": "./dist/testing.d.ts",
48
+ "import": "./dist/testing.js",
49
+ "default": "./dist/testing.js"
50
+ },
51
+ "./web": {
52
+ "types": "./dist/web.d.ts",
53
+ "import": "./dist/web.js",
54
+ "default": "./dist/web.js"
55
+ },
56
+ "./guard": {
57
+ "types": "./dist/guard.d.ts",
58
+ "import": "./dist/guard.js",
59
+ "default": "./dist/guard.js"
60
+ },
61
+ "./events": {
62
+ "types": "./dist/events.d.ts",
63
+ "import": "./dist/events.js",
64
+ "default": "./dist/events.js"
65
+ },
66
+ "./events/server": {
67
+ "types": "./dist/eventProducer.d.ts",
68
+ "import": "./dist/eventProducer.js",
69
+ "default": "./dist/eventProducer.js"
70
+ },
71
+ "./package.json": "./package.json",
72
+ "./server": {
73
+ "types": "./dist/server.d.ts",
74
+ "import": "./dist/server.js",
75
+ "default": "./dist/server.js"
76
+ }
77
+ },
78
+ "main": "./dist/index.js",
79
+ "module": "./dist/index.js",
80
+ "types": "./dist/index.d.ts",
81
+ "sideEffects": false,
82
+ "engines": {
83
+ "node": ">=24.0.0"
84
+ },
85
+ "dependencies": {
86
+ "@voltro/protocol": "0.88.0",
87
+ "@voltro/database": "0.88.0",
88
+ "@voltro/client": "0.88.0",
89
+ "@voltro/runtime": "0.88.0",
90
+ "@voltro/plugin-ratelimit": "0.88.0",
91
+ "@voltro/ui-shadcn": "0.88.0",
92
+ "@voltro/plugin-licensing": "0.88.0"
93
+ },
94
+ "peerDependencies": {
95
+ "effect": "4.1.0",
96
+ "react": "^19.0.0"
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ }
101
+ }