@voltro/plugin-sanctions 0.87.0 → 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/CHANGELOG.md +169 -6
- package/THIRD-PARTY-NOTICES.md +684 -88
- package/dist/admission.server.js +1 -2
- package/dist/components.js +1 -2
- package/dist/contract.js +1 -2
- package/dist/entities.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/eventProducer.js +1 -2
- package/dist/events.js +1 -2
- package/dist/guard.js +1 -2
- package/dist/index.js +1 -2
- package/dist/inspect.js +1 -2
- package/dist/port.js +1 -2
- package/dist/rpc.js +1 -2
- package/dist/rpcRoutes.js +1 -2
- package/dist/service.js +1 -2
- package/dist/strategies.js +1 -2
- package/dist/testing.js +1 -2
- package/dist/web.js +1 -2
- package/package.json +9 -9
package/dist/admission.server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { POINTS as e } from "./contract.js";
|
|
2
2
|
import { sanctionsError as t } from "./errors.js";
|
|
3
|
-
|
|
3
|
+
// src/admission.server.ts
|
|
4
4
|
var n = (e, n) => {
|
|
5
5
|
if (!e || typeof e != "object" || Array.isArray(e) || ![Object.prototype, null].includes(Object.getPrototypeOf(e))) throw t("invalid_input");
|
|
6
6
|
let r = Object.create(null);
|
|
@@ -93,5 +93,4 @@ var n = (e, n) => {
|
|
|
93
93
|
if (n === void 0) throw t("unavailable");
|
|
94
94
|
return n;
|
|
95
95
|
};
|
|
96
|
-
//#endregion
|
|
97
96
|
export { a as canonicalSanctionsRecords, r as captureSanctionsAdmission, i as captureSanctionsAdmissionBatch };
|
package/dist/components.js
CHANGED
|
@@ -2,7 +2,7 @@ import { CATEGORIES as e } from "./contract.js";
|
|
|
2
2
|
import { useId as t } from "react";
|
|
3
3
|
import { Button as n, Textarea as r } from "@voltro/ui-shadcn";
|
|
4
4
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components.tsx
|
|
6
6
|
var s = {
|
|
7
7
|
en: {
|
|
8
8
|
reportTitle: "Report player",
|
|
@@ -279,5 +279,4 @@ var s = {
|
|
|
279
279
|
})]
|
|
280
280
|
});
|
|
281
281
|
};
|
|
282
|
-
//#endregion
|
|
283
282
|
export { u as AppealDialog, c as ReportDialog, l as SanctionNotice, s as sanctionLabels };
|
package/dist/contract.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/contract.ts
|
|
3
3
|
var t = "_voltro_sanc_reports", n = "_voltro_sanc_cases", r = "_voltro_sanc_actions", i = "_voltro_sanc_appeals", a = "_voltro_sanc_strikes", o = "_voltro_sanc_device_hints", s = "_voltro_sanc_admissions", c = [
|
|
4
4
|
"warn",
|
|
5
5
|
"mute",
|
|
@@ -85,5 +85,4 @@ e.Struct({
|
|
|
85
85
|
actionIds: e.Array(e.String),
|
|
86
86
|
shadow: e.Boolean
|
|
87
87
|
});
|
|
88
|
-
//#endregion
|
|
89
88
|
export { r as ACTIONS_TABLE, c as ACTION_KINDS, s as ADMISSIONS_TABLE, i as APPEALS_TABLE, g as AppealSchema, n as CASES_TABLE, l as CATEGORIES, _ as CaseSchema, o as DEVICE_HINTS_TABLE, u as POINTS, t as REPORTS_TABLE, p as ReportContextSchema, h as ReportSchema, a as STRIKES_TABLE, m as SanctionSchema, f as SanctionScopeSchema };
|
package/dist/entities.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ACTIONS_TABLE as e, ACTION_KINDS as t, ADMISSIONS_TABLE as n, APPEALS_TABLE as r, CASES_TABLE as i, CATEGORIES as a, DEVICE_HINTS_TABLE as o, REPORTS_TABLE as s, STRIKES_TABLE as c } from "./contract.js";
|
|
2
2
|
import { boolean as l, id as u, integer as d, json as f, table as p, text as m, timestamp as h } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/entities.ts
|
|
4
4
|
var g = () => m().maxLength(256).externalId().sensitive("pii"), _ = () => m().maxLength(256).externalId().sensitive("pii"), v = () => m().maxLength(64).safe(), y = p(s, {
|
|
5
5
|
id: u({ prefix: "srep" }),
|
|
6
6
|
tenantId: g(),
|
|
@@ -98,5 +98,4 @@ var g = () => m().maxLength(256).externalId().sensitive("pii"), _ = () => m().ma
|
|
|
98
98
|
w,
|
|
99
99
|
T
|
|
100
100
|
];
|
|
101
|
-
//#endregion
|
|
102
101
|
export { x as sanctionActionsTable, T as sanctionAdmissionsTable, S as sanctionAppealsTable, b as sanctionCasesTable, w as sanctionDeviceHintsTable, y as sanctionReportsTable, C as sanctionStrikesTable, E as sanctionTables };
|
package/dist/errors.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/errors.ts
|
|
3
3
|
var t = class extends e.TaggedError()("SanctionsError", { code: e.Literals([
|
|
4
4
|
"identity_required",
|
|
5
5
|
"invalid_input",
|
|
@@ -11,5 +11,4 @@ var t = class extends e.TaggedError()("SanctionsError", { code: e.Literals([
|
|
|
11
11
|
"unavailable",
|
|
12
12
|
"export_limit"
|
|
13
13
|
]) }) {}, n = (e) => new t({ code: e });
|
|
14
|
-
//#endregion
|
|
15
14
|
export { t as SanctionsError, n as sanctionsError };
|
package/dist/eventProducer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./contract.js";
|
|
2
2
|
import { sanctionsChanged as e } from "./events.js";
|
|
3
|
-
|
|
3
|
+
// src/eventProducer.ts
|
|
4
4
|
var t = (e) => {
|
|
5
5
|
if (e.table !== "_voltro_sanc_actions") throw Error("Sanction events require the owned actions table");
|
|
6
6
|
let t = (e.op === "delete" ? e.old : e.new)?.tenantId;
|
|
@@ -16,5 +16,4 @@ var t = (e) => {
|
|
|
16
16
|
await r.publish(e, { subjectId: i.targetId }, { actionId: i.id });
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { n as publishSanctionChange, t as sanctionEventTenant };
|
package/dist/events.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { defineEvent as e } from "@voltro/protocol";
|
|
2
2
|
import { Schema as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/events.ts
|
|
4
4
|
var n = e({
|
|
5
5
|
name: "sanctions.changed",
|
|
6
6
|
key: t.Struct({ subjectId: t.String }),
|
|
7
7
|
payload: t.Struct({ actionId: t.String }),
|
|
8
8
|
guards: [{ scope: "sanctions:events:read" }]
|
|
9
9
|
});
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as sanctionsChanged };
|
package/dist/guard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/guard.ts
|
|
3
3
|
var t = {
|
|
4
4
|
ok: !1,
|
|
5
5
|
code: "sanctions_check_unavailable",
|
|
@@ -13,5 +13,4 @@ var t = {
|
|
|
13
13
|
id: i.id,
|
|
14
14
|
tenantId: i.tenantId
|
|
15
15
|
}, "login")).pipe(e.map((e) => e.allowed ? { ok: !0 } : n), e.catch(() => e.succeed(t)), e.catchDefect(() => e.succeed(t))), i = (r) => async (i) => i.type === "user" ? e.runPromise(e.suspend(() => r.check(i, "login")).pipe(e.map((e) => e.allowed ? { ok: !0 } : n), e.catch(() => e.succeed(t)), e.catchDefect(() => e.succeed(t)))) : { ok: !0 };
|
|
16
|
-
//#endregion
|
|
17
16
|
export { r as sanctionsLoginGuard, i as sanctionsSubjectGuard };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { defineLicensedGamePlugin as T } from "@voltro/plugin-licensing/gate";
|
|
|
14
14
|
import { fileURLToPath as E } from "node:url";
|
|
15
15
|
import { replicaEvidence as D } from "@voltro/protocol/identity";
|
|
16
16
|
import { redisStore as O } from "@voltro/plugin-ratelimit";
|
|
17
|
-
|
|
17
|
+
// src/index.ts
|
|
18
18
|
var k = {
|
|
19
19
|
slots: {
|
|
20
20
|
escalationLadder: {
|
|
@@ -176,5 +176,4 @@ var k = {
|
|
|
176
176
|
})
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
|
-
//#endregion
|
|
180
179
|
export { c as SanctionsError, p as SanctionsPort, f as dataStoreSanctions, m as defaultSanctionsStrategies, h as resolveSanctionsOptions, e as sanctionActionsTable, t as sanctionAdmissionsTable, n as sanctionAppealsTable, r as sanctionCasesTable, i as sanctionDeviceHintsTable, a as sanctionReportsTable, o as sanctionStrikesTable, s as sanctionTables, A as sanctionsPlugin, k as sanctionsSystemContract };
|
package/dist/inspect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sanctionTables as e } from "./entities.js";
|
|
2
2
|
import { defaultSanctionsStrategies as t } from "./strategies.js";
|
|
3
|
-
|
|
3
|
+
// src/inspect.ts
|
|
4
4
|
var n = (n, r, i) => ({
|
|
5
5
|
observedAt: n.now(),
|
|
6
6
|
bound: r,
|
|
@@ -20,5 +20,4 @@ var n = (n, r, i) => ({
|
|
|
20
20
|
slots: Object.fromEntries(Object.keys(t).map((e) => [e, n.strategies[e] === t[e] ? "default" : "custom"])),
|
|
21
21
|
tables: e.map((e) => e.tableName)
|
|
22
22
|
});
|
|
23
|
-
//#endregion
|
|
24
23
|
export { n as sanctionsStatus };
|
package/dist/port.js
CHANGED
package/dist/rpc.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ACTIONS_TABLE as e, ACTION_KINDS as t, ADMISSIONS_TABLE as n, APPEALS_T
|
|
|
2
2
|
import { SanctionsError as p } from "./errors.js";
|
|
3
3
|
import { defineAction as m, defineQuery as h } from "@voltro/protocol";
|
|
4
4
|
import { Schema as g } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/rpc.ts
|
|
6
6
|
var _ = "@voltro/plugin-sanctions", v = g.NonEmptyString, y = g.Number.pipe(g.check(g.isInt()), g.check(g.isGreaterThanOrEqualTo(0))), b = "Trusted human or guest identity and exact tenant are required. Operator actions require sanctions:manage or admin:full; the server owns all sanction decisions.", x = g.Struct({}), S = [
|
|
7
7
|
c,
|
|
8
8
|
a,
|
|
@@ -143,5 +143,4 @@ var _ = "@voltro/plugin-sanctions", v = g.NonEmptyString, y = g.Number.pipe(g.ch
|
|
|
143
143
|
name: e + "Descriptor"
|
|
144
144
|
}
|
|
145
145
|
}))];
|
|
146
|
-
//#endregion
|
|
147
146
|
export { _ as BASE_NAME, E as appealDescriptor, D as appealsMineDescriptor, M as appealsQueueDescriptor, O as casesDescriptor, A as issueDescriptor, T as mineDescriptor, C as reportDescriptor, w as reportsMineDescriptor, N as reviewAppealDescriptor, k as reviewCaseDescriptor, j as revokeDescriptor, P as sanctionsRpcClientImports };
|
package/dist/rpcRoutes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appealDescriptor as e, appealsMineDescriptor as t, appealsQueueDescriptor as n, casesDescriptor as r, issueDescriptor as i, mineDescriptor as a, reportDescriptor as o, reportsMineDescriptor as s, reviewAppealDescriptor as c, reviewCaseDescriptor as l, revokeDescriptor as u } from "./rpc.js";
|
|
2
|
-
|
|
2
|
+
// src/rpcRoutes.ts
|
|
3
3
|
var d = (d) => [
|
|
4
4
|
{
|
|
5
5
|
...o,
|
|
@@ -46,5 +46,4 @@ var d = (d) => [
|
|
|
46
46
|
execute: (e, t) => d.reviewAppeal(t.request.subject, e)
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
|
-
//#endregion
|
|
50
49
|
export { d as sanctionsRpcRoutes };
|
package/dist/service.js
CHANGED
|
@@ -7,7 +7,7 @@ import { and as b, eq as x, or as S, queryFor as ie } from "@voltro/database";
|
|
|
7
7
|
import { effectiveScopes as ae } from "@voltro/protocol";
|
|
8
8
|
import { Effect as C, Schema as w } from "effect";
|
|
9
9
|
import { prepareSqlMutation as oe } from "@voltro/database/sql";
|
|
10
|
-
|
|
10
|
+
// src/service.ts
|
|
11
11
|
var T = (e) => y("sha256").update(JSON.stringify(e)).digest("hex"), E = (e, t) => e + "_" + T(t).slice(0, 54), D = (e) => e instanceof _ ? e : v("unavailable"), O = (e) => C.tryPromise({
|
|
12
12
|
try: e,
|
|
13
13
|
catch: D
|
|
@@ -705,5 +705,4 @@ var T = (e) => y("sha256").update(JSON.stringify(e)).digest("hex"), E = (e, t) =
|
|
|
705
705
|
})
|
|
706
706
|
};
|
|
707
707
|
};
|
|
708
|
-
//#endregion
|
|
709
708
|
export { H as dataStoreSanctions };
|
package/dist/strategies.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sanctionsError as e } from "./errors.js";
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/strategies.ts
|
|
4
4
|
var n = [
|
|
5
5
|
{
|
|
6
6
|
kind: "warn",
|
|
@@ -69,5 +69,4 @@ var n = [
|
|
|
69
69
|
if (!Number.isFinite(n.minimumSignalConfidence) || n.minimumSignalConfidence < 0 || n.minimumSignalConfidence > 1 || typeof n.now != "function" || Object.values(n.strategies).some((e) => typeof e != "function")) throw e("invalid_input");
|
|
70
70
|
return Object.freeze(n);
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
export { r as abuseEscalationLadder, i as conservativeTrustScore, s as defaultSanctionEnforcement, c as defaultSanctionsStrategies, a as noCollectedSanctionEvidence, l as resolveSanctionsOptions };
|
package/dist/testing.js
CHANGED
|
@@ -2,7 +2,7 @@ import { sanctionsError as e } from "./errors.js";
|
|
|
2
2
|
import { SanctionsPort as t } from "./port.js";
|
|
3
3
|
import { abuseEscalationLadder as n, conservativeTrustScore as r, defaultSanctionEnforcement as i, noCollectedSanctionEvidence as a, resolveSanctionsOptions as o } from "./strategies.js";
|
|
4
4
|
import { Effect as s, Layer as c, Result as l } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/testing.ts
|
|
6
6
|
var u = (t = {}) => ({
|
|
7
7
|
check: () => s.fail(e("unavailable")),
|
|
8
8
|
active: () => s.fail(e("unavailable")),
|
|
@@ -117,5 +117,4 @@ var u = (t = {}) => ({
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
//#endregion
|
|
121
120
|
export { d as fakeSanctionsLayer, u as fakeSanctionsService, x as sanctionsEnforcementFixture, h as sanctionsEscalationFixture, y as sanctionsEvidenceFixture, f as sanctionsFakeLayer, p as sanctionsPortFixture, _ as sanctionsTrustFixture };
|
package/dist/web.js
CHANGED
|
@@ -2,7 +2,6 @@ import { BASE_NAME as e } from "./rpc.js";
|
|
|
2
2
|
import { AppealDialog as t, ReportDialog as n, SanctionNotice as r, sanctionLabels as i } from "./components.js";
|
|
3
3
|
import { pluginTag as a } from "@voltro/protocol";
|
|
4
4
|
import { useAction as o, useSubscription as s } from "@voltro/client";
|
|
5
|
-
|
|
5
|
+
// src/web.ts
|
|
6
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
|
-
//#endregion
|
|
8
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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-sanctions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "SQL-authoritative sanctions, reports, review, appeals and replaceable enforcement",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -83,16 +83,16 @@
|
|
|
83
83
|
"node": ">=24.0.0"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@voltro/protocol": "0.
|
|
87
|
-
"@voltro/database": "0.
|
|
88
|
-
"@voltro/client": "0.
|
|
89
|
-
"@voltro/runtime": "0.
|
|
90
|
-
"@voltro/plugin-ratelimit": "0.
|
|
91
|
-
"@voltro/ui-shadcn": "0.
|
|
92
|
-
"@voltro/plugin-licensing": "0.
|
|
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
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"effect": "4.0
|
|
95
|
+
"effect": "4.1.0",
|
|
96
96
|
"react": "^19.0.0"
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": {
|