@voltro/plugin-chat 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 +1482 -308
- package/dist/admissions.entity.js +1 -2
- package/dist/channels.entity.js +1 -2
- package/dist/components.js +1 -2
- package/dist/contract.js +1 -2
- package/dist/errors.js +1 -2
- package/dist/eventProducer.js +1 -2
- package/dist/events.js +1 -2
- package/dist/evidence.entity.js +1 -2
- package/dist/index.js +1 -2
- package/dist/inspect.js +1 -2
- package/dist/media.entity.js +1 -2
- package/dist/members.entity.js +1 -2
- package/dist/mentionDraft.js +1 -2
- package/dist/mentionNotifications.js +1 -2
- package/dist/messages.entity.js +1 -2
- package/dist/reportEvidence.js +1 -2
- package/dist/retention.entity.js +1 -2
- package/dist/rpc.js +1 -2
- package/dist/rpcRoutes.js +1 -2
- package/dist/server.js +1 -2
- package/dist/service.js +1 -2
- package/dist/strategies.js +1 -2
- package/dist/testing.js +1 -2
- package/dist/typing.js +1 -2
- package/dist/typingInvalidation.js +1 -2
- package/dist/typingLease.js +0 -1
- package/dist/typingPublisher.js +1 -2
- package/dist/useChatTypingPublisher.js +1 -2
- package/dist/useTyping.js +1 -2
- package/dist/web.js +1 -2
- package/package.json +18 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { boolean as e, id as t, integer as n, table as r, text as i } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/admissions.entity.ts
|
|
3
3
|
var a = r("_voltro_chat_admissions", {
|
|
4
4
|
id: t({ prefix: "cadm" }),
|
|
5
5
|
tenantId: i().maxLength(256).externalId().serverOnly(),
|
|
@@ -7,5 +7,4 @@ var a = r("_voltro_chat_admissions", {
|
|
|
7
7
|
admission: n().serverOnly(),
|
|
8
8
|
erased: e().serverOnly()
|
|
9
9
|
}).index(["tenantId", "subjectId"]);
|
|
10
|
-
//#endregion
|
|
11
10
|
export { a as chatAdmissionsTable };
|
package/dist/channels.entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CHANNELS_TABLE as e, CHANNEL_KINDS as t } from "./contract.js";
|
|
2
2
|
import { boolean as n, id as r, integer as i, json as a, table as o, text as s, timestamp as c } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/channels.entity.ts
|
|
4
4
|
var l = o(e, {
|
|
5
5
|
id: r({ prefix: "cchan" }),
|
|
6
6
|
tenantId: s().maxLength(256).externalId().sensitive("pii"),
|
|
@@ -16,5 +16,4 @@ var l = o(e, {
|
|
|
16
16
|
creationKey: s().maxLength(64).serverOnly(),
|
|
17
17
|
metadata: a().sensitive("pii")
|
|
18
18
|
}).index(["tenantId", "kind"]);
|
|
19
|
-
//#endregion
|
|
20
19
|
export { l as chatChannelsTable };
|
package/dist/components.js
CHANGED
|
@@ -2,7 +2,7 @@ import { insertMentionDraft as e, mentionDraftToken as t } from "./mentionDraft.
|
|
|
2
2
|
import { useEffect as n, useId as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
3
|
import { Button as c, Textarea as l } from "@voltro/ui-shadcn";
|
|
4
4
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components.tsx
|
|
6
6
|
var f = {
|
|
7
7
|
en: {
|
|
8
8
|
title: "Chat",
|
|
@@ -428,5 +428,4 @@ var f = {
|
|
|
428
428
|
]
|
|
429
429
|
});
|
|
430
430
|
};
|
|
431
|
-
//#endregion
|
|
432
431
|
export { y as ChannelTabs, b as ChatPanel, v as Composer, m as MessageList, g as TypingIndicator, f as chatLabels, _ as chatMentionLabels, h as chatTypingLabels };
|
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 = 200, n = 10, r = 2147483647, i = "_voltro_chat_channels", a = "_voltro_chat_members", o = "_voltro_chat_messages", s = "_voltro_chat_media", c = 50, l = [
|
|
4
4
|
"global",
|
|
5
5
|
"lobby",
|
|
@@ -88,5 +88,4 @@ var b = e.Struct({
|
|
|
88
88
|
active: e.Boolean,
|
|
89
89
|
expiresAt: u
|
|
90
90
|
});
|
|
91
|
-
//#endregion
|
|
92
91
|
export { i as CHANNELS_TABLE, l as CHANNEL_KINDS, r as CHAT_MAX_MESSAGE_VERSION, c as CHAT_MEDIA_SWEEP_BATCH_SIZE, t as CHAT_RETENTION_BATCH_SIZE, n as CHAT_RETENTION_RUN_BATCHES, x as CHAT_TYPING_TTL_MS, g as ChatAuthorProjectionSchema, f as ChatChannelSchema, b as ChatMediaUrlSchema, p as ChatMemberSchema, _ as ChatMentionCandidatesSchema, h as ChatMessagePageSchema, m as ChatMessageSchema, y as ChatOriginalSchema, S as ChatTypingSchema, v as ChatUnreadSchema, s as MEDIA_TABLE, a as MEMBERS_TABLE, o as MESSAGES_TABLE };
|
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()("ChatError", { code: e.Literals([
|
|
4
4
|
"identity_required",
|
|
5
5
|
"invalid_input",
|
|
@@ -17,5 +17,4 @@ var t = class extends e.TaggedError()("ChatError", { code: e.Literals([
|
|
|
17
17
|
"unavailable",
|
|
18
18
|
"export_limit"
|
|
19
19
|
]) }) {}, n = (e) => new t({ code: e });
|
|
20
|
-
//#endregion
|
|
21
20
|
export { t as ChatError, n as chatError };
|
package/dist/eventProducer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./contract.js";
|
|
2
2
|
import { mentioned as e, messageChanged as t } from "./events.js";
|
|
3
|
-
|
|
3
|
+
// src/eventProducer.ts
|
|
4
4
|
var n = (e) => {
|
|
5
5
|
if (e.table !== "_voltro_chat_messages") throw Error("Chat events require the owned message table");
|
|
6
6
|
let t = (e.op === "delete" ? e.old : e.new)?.tenantId;
|
|
@@ -42,5 +42,4 @@ var n = (e) => {
|
|
|
42
42
|
recipientId: e
|
|
43
43
|
}));
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { n as chatEventTenant, i as committedChatMentions, r as publishChatChange };
|
package/dist/events.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatTypingSchema as e } from "./contract.js";
|
|
2
2
|
import { Schema as t } from "effect";
|
|
3
3
|
import { defineEvent as n } from "@voltro/protocol";
|
|
4
|
-
|
|
4
|
+
// src/events.ts
|
|
5
5
|
var r = n({
|
|
6
6
|
name: "chat.messageChanged",
|
|
7
7
|
key: t.Struct({ channelId: t.String }),
|
|
@@ -32,5 +32,4 @@ var r = n({
|
|
|
32
32
|
payload: t.Struct({ messageId: t.NonEmptyString.pipe(t.check(t.isMaxLength(64))) }),
|
|
33
33
|
guards: [{ scope: "chat:events:read" }]
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { a as mentioned, r as messageChanged, i as typing };
|
package/dist/evidence.entity.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { id as e, integer as t, table as n, text as r, timestamp as i } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/evidence.entity.ts
|
|
3
3
|
var a = n("_voltro_chat_evidence", {
|
|
4
4
|
id: e({ prefix: "cevi" }),
|
|
5
5
|
tenantId: r().maxLength(256).externalId().serverOnly(),
|
|
@@ -21,5 +21,4 @@ var a = n("_voltro_chat_evidence", {
|
|
|
21
21
|
"messageId",
|
|
22
22
|
"messageVersion"
|
|
23
23
|
]);
|
|
24
|
-
//#endregion
|
|
25
24
|
export { a as chatEvidenceTable };
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { Effect as T, Layer as E } from "effect";
|
|
|
19
19
|
import { fileURLToPath as D } from "node:url";
|
|
20
20
|
import { replicaEvidence as O } from "@voltro/protocol/identity";
|
|
21
21
|
import { redisStore as k } from "@voltro/plugin-ratelimit";
|
|
22
|
-
|
|
22
|
+
// src/index.ts
|
|
23
23
|
var A = {
|
|
24
24
|
slots: {
|
|
25
25
|
moderate: {
|
|
@@ -177,5 +177,4 @@ var A = {
|
|
|
177
177
|
})
|
|
178
178
|
});
|
|
179
179
|
};
|
|
180
|
-
//#endregion
|
|
181
180
|
export { i as CHAT_MAX_MESSAGE_VERSION, a as CHAT_MEDIA_SWEEP_BATCH_SIZE, o as CHAT_RETENTION_BATCH_SIZE, s as CHAT_RETENTION_RUN_BATCHES, e as ChatError, n as chatAdmissionsTable, p as chatChannelsTable, r as chatEvidenceTable, c as chatMediaTable, m as chatMembersTable, h as chatMessagesTable, j as chatPlugin, l as chatRetentionTable, A as chatSystemContract, g as dataStoreChat, b as defaultChatStrategies, x as resolveChatOptions };
|
package/dist/inspect.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { chatError as e } from "./errors.js";
|
|
2
2
|
import { defaultChatStrategies as t } from "./strategies.js";
|
|
3
|
-
|
|
3
|
+
// src/inspect.ts
|
|
4
4
|
var n = (n, r, i) => {
|
|
5
5
|
let a = n.now();
|
|
6
6
|
if (!Number.isSafeInteger(a) || a < 0 || a > 864e13) throw e("unavailable");
|
|
@@ -34,5 +34,4 @@ var n = (n, r, i) => {
|
|
|
34
34
|
]
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { n as chatStatus };
|
package/dist/media.entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MEDIA_TABLE as e } from "./contract.js";
|
|
2
2
|
import { id as t, table as n, text as r, timestamp as i } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/media.entity.ts
|
|
4
4
|
var a = n(e, {
|
|
5
5
|
id: t({ prefix: "cmed" }),
|
|
6
6
|
tenantId: r().maxLength(256).externalId().serverOnly(),
|
|
@@ -11,5 +11,4 @@ var a = n(e, {
|
|
|
11
11
|
state: r().maxLength(16).oneOf(["active", "deleting"]).serverOnly(),
|
|
12
12
|
createdAt: i().serverOnly()
|
|
13
13
|
}).index(["tenantId", "ownerId"]).index(["state", "id"]).index(["tenantId", "storageId"]);
|
|
14
|
-
//#endregion
|
|
15
14
|
export { a as chatMediaTable };
|
package/dist/members.entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MEMBERS_TABLE as e } from "./contract.js";
|
|
2
2
|
import { boolean as t, id as n, json as r, table as i, text as a, timestamp as o } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/members.entity.ts
|
|
4
4
|
var s = i(e, {
|
|
5
5
|
id: n({ prefix: "cmem" }),
|
|
6
6
|
tenantId: a().maxLength(256).externalId().sensitive("pii"),
|
|
@@ -18,5 +18,4 @@ var s = i(e, {
|
|
|
18
18
|
notify: t().safe(),
|
|
19
19
|
metadata: r().sensitive("pii")
|
|
20
20
|
}).index(["tenantId", "subjectId"]).index(["channelId"]);
|
|
21
|
-
//#endregion
|
|
22
21
|
export { s as chatMembersTable };
|
package/dist/mentionDraft.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/mentionDraft.ts
|
|
2
2
|
var e = (e, t, n) => {
|
|
3
3
|
if (t !== n || !Number.isSafeInteger(t) || t < 0 || t > e.length || t < e.length && /[\p{L}\p{N}\p{M}_#]/u.test(String.fromCodePoint(e.codePointAt(t)))) return null;
|
|
4
4
|
let r = e.lastIndexOf("@", t - 1);
|
|
@@ -17,5 +17,4 @@ var e = (e, t, n) => {
|
|
|
17
17
|
caret: n.start + a.length
|
|
18
18
|
} : null;
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { t as insertMentionDraft, e as mentionDraftToken };
|
|
@@ -6,7 +6,7 @@ import { Effect as a, Schema as o } from "effect";
|
|
|
6
6
|
import { createHash as s } from "node:crypto";
|
|
7
7
|
import { defineOutboxHandler as c, defineSubscriber as l } from "@voltro/runtime";
|
|
8
8
|
import { defineNotification as u, notificationOutboxHandler as d } from "@voltro/plugin-notifications";
|
|
9
|
-
|
|
9
|
+
// src/mentionNotifications.ts
|
|
10
10
|
var f = "voltro.chat.mention.notify", p = "chat.mention", m = o.NonEmptyString.pipe(o.check(o.isMaxLength(256)), o.check(o.makeFilter((e) => e.trim().length > 0 && !e.includes("\0") && e !== "~"))), h = o.Struct({
|
|
11
11
|
tenantId: m,
|
|
12
12
|
channelId: m,
|
|
@@ -106,5 +106,4 @@ var f = "voltro.chat.mention.notify", p = "chat.mention", m = o.NonEmptyString.p
|
|
|
106
106
|
})
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
//#endregion
|
|
110
109
|
export { f as CHAT_MENTION_NOTIFICATION_EFFECT, p as CHAT_MENTION_NOTIFICATION_GUARD, v as createChatMentionNotifications };
|
package/dist/messages.entity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MESSAGES_TABLE as e } from "./contract.js";
|
|
2
2
|
import { boolean as t, id as n, integer as r, json as i, table as a, text as o, timestamp as s } from "@voltro/database";
|
|
3
|
-
|
|
3
|
+
// src/messages.entity.ts
|
|
4
4
|
var c = a(e, {
|
|
5
5
|
id: n({ prefix: "cmsg" }),
|
|
6
6
|
tenantId: o().maxLength(256).externalId().sensitive("pii"),
|
|
@@ -24,5 +24,4 @@ var c = a(e, {
|
|
|
24
24
|
version: r().safe(),
|
|
25
25
|
metadata: i().sensitive("pii")
|
|
26
26
|
}).index(["channelId", "createdAt"]).index(["tenantId", "authorId"]);
|
|
27
|
-
//#endregion
|
|
28
27
|
export { c as chatMessagesTable };
|
package/dist/reportEvidence.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatAdministration as e } from "./server.js";
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
3
|
import { sanctionsError as n } from "@voltro/plugin-sanctions/errors";
|
|
4
|
-
|
|
4
|
+
// src/reportEvidence.ts
|
|
5
5
|
var r = (r) => t.gen(function* () {
|
|
6
6
|
if (r.context.channelId === void 0) return [];
|
|
7
7
|
if (!Array.isArray(r.context.messageIds) || r.context.messageIds.length !== 1) return yield* t.fail(n("invalid_input"));
|
|
@@ -12,5 +12,4 @@ var r = (r) => t.gen(function* () {
|
|
|
12
12
|
targetId: r.targetId
|
|
13
13
|
}).pipe(t.mapError((e) => n(e.code === "unavailable" ? "unavailable" : "forbidden")), t.catchDefect(() => t.fail(n("unavailable")))) }];
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { r as chatSanctionEvidenceCollector };
|
package/dist/retention.entity.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { id as e, integer as t, table as n, text as r, timestamp as i } from "@voltro/database";
|
|
2
|
-
|
|
2
|
+
// src/retention.entity.ts
|
|
3
3
|
var a = n("_voltro_chat_retention", {
|
|
4
4
|
id: e({ prefix: "cret" }),
|
|
5
5
|
tenantId: r().maxLength(256).nullable().serverOnly(),
|
|
@@ -7,5 +7,4 @@ var a = n("_voltro_chat_retention", {
|
|
|
7
7
|
admission: t().serverOnly(),
|
|
8
8
|
updatedAt: i().serverOnly()
|
|
9
9
|
});
|
|
10
|
-
//#endregion
|
|
11
10
|
export { a as chatRetentionTable };
|
package/dist/rpc.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ChatError as e } from "./errors.js";
|
|
|
2
2
|
import { CHANNELS_TABLE as t, ChatAuthorProjectionSchema as n, ChatChannelSchema as r, ChatMediaUrlSchema as i, ChatMemberSchema as a, ChatMentionCandidatesSchema as o, ChatMessagePageSchema as s, ChatMessageSchema as c, ChatOriginalSchema as l, ChatUnreadSchema as u, MEMBERS_TABLE as d, MESSAGES_TABLE as f } from "./contract.js";
|
|
3
3
|
import { Schema as p } from "effect";
|
|
4
4
|
import { defineAction as m, defineQuery as h } from "@voltro/protocol";
|
|
5
|
-
|
|
5
|
+
// src/rpc.ts
|
|
6
6
|
var g = "@voltro/plugin-chat", _ = "The handler verifies human identity, same-tenant channel membership and the required author/mod role; input is an intention only.", v = p.Number.pipe(p.check(p.isInt()), p.check(p.isGreaterThanOrEqualTo(0))), y = p.Struct({ channelId: p.NonEmptyString }), b = m({
|
|
7
7
|
name: "chat.setTyping",
|
|
8
8
|
input: p.Struct({
|
|
@@ -263,5 +263,4 @@ var g = "@voltro/plugin-chat", _ = "The handler verifies human identity, same-te
|
|
|
263
263
|
name: e + "Descriptor"
|
|
264
264
|
}
|
|
265
265
|
}))];
|
|
266
|
-
//#endregion
|
|
267
266
|
export { g as BASE_NAME, D as authorsDescriptor, O as channelDescriptor, A as channelsDescriptor, B as chatRpcClientImports, I as configureDescriptor, x as dmDescriptor, C as editDescriptor, L as joinDescriptor, R as leaveDescriptor, P as markReadDescriptor, N as mediaUrlDescriptor, k as membershipDescriptor, E as mentionCandidatesDescriptor, T as messagesDescriptor, F as muteDescriptor, M as originalDescriptor, w as removeDescriptor, S as sendDescriptor, b as setTypingDescriptor, z as transferOwnershipDescriptor, j as unreadDescriptor };
|
package/dist/rpcRoutes.js
CHANGED
|
@@ -2,7 +2,7 @@ import { chatError as e } from "./errors.js";
|
|
|
2
2
|
import { typing as t } from "./events.js";
|
|
3
3
|
import { authorsDescriptor as n, channelDescriptor as r, channelsDescriptor as i, configureDescriptor as a, dmDescriptor as o, editDescriptor as s, joinDescriptor as c, leaveDescriptor as l, markReadDescriptor as u, mediaUrlDescriptor as d, membershipDescriptor as f, mentionCandidatesDescriptor as p, messagesDescriptor as m, muteDescriptor as h, originalDescriptor as g, removeDescriptor as _, sendDescriptor as v, setTypingDescriptor as y, transferOwnershipDescriptor as b, unreadDescriptor as x } from "./rpc.js";
|
|
4
4
|
import { Effect as S } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/rpcRoutes.ts
|
|
6
6
|
var C = (C) => [
|
|
7
7
|
{
|
|
8
8
|
...y,
|
|
@@ -93,5 +93,4 @@ var C = (C) => [
|
|
|
93
93
|
execute: (e, t) => C.transferOwnership(t.request.subject, e.channelId, e.targetId)
|
|
94
94
|
}
|
|
95
95
|
];
|
|
96
|
-
//#endregion
|
|
97
96
|
export { C as chatRpcRoutes };
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CHAT_MENTION_NOTIFICATION_EFFECT as e, CHAT_MENTION_NOTIFICATION_GUARD as t, createChatMentionNotifications as n } from "./mentionNotifications.js";
|
|
2
2
|
import { chatSanctionEvidenceCollector as r } from "./reportEvidence.js";
|
|
3
3
|
import { Context as i } from "effect";
|
|
4
|
-
|
|
4
|
+
// src/server.ts
|
|
5
5
|
var a = class extends i.Service()("@voltro/ChatAdministration") {};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { e as CHAT_MENTION_NOTIFICATION_EFFECT, t as CHAT_MENTION_NOTIFICATION_GUARD, a as ChatAdministration, r as chatSanctionEvidenceCollector, n as createChatMentionNotifications };
|
package/dist/service.js
CHANGED
|
@@ -17,7 +17,7 @@ import { PlayersPort as ne } from "@voltro/plugin-players/port";
|
|
|
17
17
|
import { GuildMembershipPort as T } from "@voltro/plugin-guilds/port";
|
|
18
18
|
import { PartyMembershipPort as re } from "@voltro/plugin-matchmaking/port";
|
|
19
19
|
import { SocialBlockPort as ie } from "@voltro/plugin-social/port";
|
|
20
|
-
|
|
20
|
+
// src/service.ts
|
|
21
21
|
var E = (e) => w("sha256").update(JSON.stringify(e)).digest("hex"), D = (n) => n instanceof e ? n : t("unavailable"), O = (e) => d.tryPromise({
|
|
22
22
|
try: e,
|
|
23
23
|
catch: D
|
|
@@ -1408,5 +1408,4 @@ var E = (e) => w("sha256").update(JSON.stringify(e)).digest("hex"), D = (n) => n
|
|
|
1408
1408
|
}
|
|
1409
1409
|
};
|
|
1410
1410
|
};
|
|
1411
|
-
//#endregion
|
|
1412
1411
|
export { z as dataStoreChat };
|
package/dist/strategies.js
CHANGED
|
@@ -2,7 +2,7 @@ import { chatError as e } from "./errors.js";
|
|
|
2
2
|
import { Effect as t } from "effect";
|
|
3
3
|
import { PlayersPort as n } from "@voltro/plugin-players/port";
|
|
4
4
|
import { keywordProvider as r } from "@voltro/plugin-moderation";
|
|
5
|
-
|
|
5
|
+
// src/strategies.ts
|
|
6
6
|
var i = (e) => r(e.denyWords)(e.body).pipe(t.map((t) => ({
|
|
7
7
|
body: e.body,
|
|
8
8
|
flagged: t.flagged,
|
|
@@ -86,5 +86,4 @@ var i = (e) => r(e.denyWords)(e.body).pipe(t.map((t) => ({
|
|
|
86
86
|
if (n.retentionMs !== null && (!Number.isSafeInteger(n.retentionMs) || n.retentionMs < 1 || n.retentionMs > 31536e7) || n.denyWords.length > 1e3 || !["block", "flag"].includes(n.moderationAction) || n.denyWords.some((e) => typeof e != "string" || !e.trim() || e.length > 256) || n.mediaContentTypes.length > 64 || n.mediaContentTypes.some((e) => typeof e != "string" || !/^[a-z0-9.+-]+\/[a-z0-9.+-]+$/.test(e)) || Object.values(n.strategies).some((e) => typeof e != "function") || typeof n.now != "function") throw e("invalid_input");
|
|
87
87
|
return Object.freeze(n);
|
|
88
88
|
};
|
|
89
|
-
//#endregion
|
|
90
89
|
export { s as channelChatRetention, l as defaultChatStrategies, a as fixedChatRateBudgets, i as keywordChatModeration, o as playerChatMentions, u as resolveChatOptions, c as typedChatMedia };
|
package/dist/testing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { channelChatRetention as e, fixedChatRateBudgets as t, keywordChatModeration as n, playerChatMentions as r, resolveChatOptions as i, typedChatMedia as a } from "./strategies.js";
|
|
2
2
|
import { Effect as o } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/testing.ts
|
|
4
4
|
var s = {
|
|
5
5
|
id: "channel",
|
|
6
6
|
kind: "custom",
|
|
@@ -107,5 +107,4 @@ var s = {
|
|
|
107
107
|
expected: !1
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
//#endregion
|
|
111
110
|
export { g as chatMediaModerationFixture, p as chatMentionResolverFixture, l as chatModerationFixture, d as chatRateLimitFixture, m as chatRetentionFixture };
|
package/dist/typing.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createTypingInvalidation as r } from "./typingInvalidation.js";
|
|
|
4
4
|
import { typing as i } from "./events.js";
|
|
5
5
|
import { Effect as a, Schema as o } from "effect";
|
|
6
6
|
import { createHash as s } from "node:crypto";
|
|
7
|
-
|
|
7
|
+
// src/typing.ts
|
|
8
8
|
var c = (c) => {
|
|
9
9
|
let l = (t) => {
|
|
10
10
|
if (!t || typeof t != "object" || Array.isArray(t)) throw e("invalid_input");
|
|
@@ -84,5 +84,4 @@ var c = (c) => {
|
|
|
84
84
|
close: m.close
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
//#endregion
|
|
88
87
|
export { c as createChatTyping };
|
|
@@ -2,7 +2,7 @@ import { chatError as e } from "./errors.js";
|
|
|
2
2
|
import "./contract.js";
|
|
3
3
|
import { Deferred as t, Effect as n } from "effect";
|
|
4
4
|
import { socialRelationsTable as r } from "@voltro/plugin-social";
|
|
5
|
-
|
|
5
|
+
// src/typingInvalidation.ts
|
|
6
6
|
var i = (e, t) => e instanceof Date && t instanceof Date ? e.getTime() === t.getTime() : e === t, a = (e, t, n) => e !== null && t !== null && n.every((n) => i(e[n], t[n])), o = (i) => {
|
|
7
7
|
let o = /* @__PURE__ */ new Set(), s = !1, c, l, u = (e, t) => {
|
|
8
8
|
if (![
|
|
@@ -82,5 +82,4 @@ var i = (e, t) => e instanceof Date && t instanceof Date ? e.getTime() === t.get
|
|
|
82
82
|
if (t) throw e("unavailable");
|
|
83
83
|
} });
|
|
84
84
|
};
|
|
85
|
-
//#endregion
|
|
86
85
|
export { o as createTypingInvalidation };
|
package/dist/typingLease.js
CHANGED
package/dist/typingPublisher.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/typingPublisher.ts
|
|
2
2
|
var e = Object.freeze({
|
|
3
3
|
pending: !1,
|
|
4
4
|
error: void 0
|
|
@@ -55,5 +55,4 @@ var e = Object.freeze({
|
|
|
55
55
|
}), this.#c && !t.signal.aborted && this.activity(!1)) : this.#l(e);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
//#endregion
|
|
59
58
|
export { t as TypingPublisher };
|
|
@@ -5,7 +5,7 @@ import { pluginTag as r } from "@voltro/protocol";
|
|
|
5
5
|
import { isUnresolvedApi as i, resolveByTag as a, useFrameworkApi as o } from "@voltro/client";
|
|
6
6
|
import { useLayoutEffect as s, useMemo as c, useRef as l, useSyncExternalStore as u } from "react";
|
|
7
7
|
import { runRpcPromise as d } from "@voltro/client/runtime";
|
|
8
|
-
|
|
8
|
+
// src/useChatTypingPublisher.ts
|
|
9
9
|
var f = (f, p = "app") => {
|
|
10
10
|
let m = o(p), h = l({ owner: void 0 }), g = c(() => new t(async (t, o) => {
|
|
11
11
|
if (f === null || i(m) || m.subjectSignal?.aborted) return;
|
|
@@ -29,5 +29,4 @@ var f = (f, p = "app") => {
|
|
|
29
29
|
activity: g.activity
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { f as useChatTypingPublisher };
|
package/dist/useTyping.js
CHANGED
|
@@ -2,7 +2,7 @@ import { typing as e } from "./events.js";
|
|
|
2
2
|
import { TypingLeaseStore as t } from "./typingLease.js";
|
|
3
3
|
import { useEvent as n, useFrameworkApi as r } from "@voltro/client";
|
|
4
4
|
import { useEffect as i, useLayoutEffect as a, useMemo as o, useSyncExternalStore as s } from "react";
|
|
5
|
-
|
|
5
|
+
// src/useTyping.ts
|
|
6
6
|
var c = Object.freeze([]), l = (l, u = "app") => {
|
|
7
7
|
let d = r(u), f = o(() => new t(), [
|
|
8
8
|
l,
|
|
@@ -20,5 +20,4 @@ var c = Object.freeze([]), l = (l, u = "app") => {
|
|
|
20
20
|
status: p.status
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { l as useTyping };
|
package/dist/web.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useTyping as l } from "./useTyping.js";
|
|
|
4
4
|
import { useChatTypingPublisher as u } from "./useChatTypingPublisher.js";
|
|
5
5
|
import { pluginTag as d } from "@voltro/protocol";
|
|
6
6
|
import { useAction as f, useSubscription as p } from "@voltro/client";
|
|
7
|
-
|
|
7
|
+
// src/web.ts
|
|
8
8
|
var m = (t, n, r = "app") => p(r, d(e, "mentionCandidates"), {
|
|
9
9
|
channelId: t,
|
|
10
10
|
...n === void 0 ? {} : { after: n }
|
|
@@ -15,5 +15,4 @@ var m = (t, n, r = "app") => p(r, d(e, "mentionCandidates"), {
|
|
|
15
15
|
channelId: t,
|
|
16
16
|
...n === void 0 ? {} : { before: n }
|
|
17
17
|
}), b = (t = "app") => f(t, d(e, "send")), x = (t = "app") => f(t, d(e, "edit")), S = (t = "app") => f(t, d(e, "remove")), C = (t = "app") => p(t, d(e, "unread"), {}), w = (t = "app") => f(t, d(e, "markRead")), T = (t = "app") => f(t, d(e, "original")), E = (t = "app") => f(t, d(e, "join")), D = (t = "app") => f(t, d(e, "leave")), O = (t = "app") => f(t, d(e, "transferOwnership")), k = (t = "app") => f(t, d(e, "setTyping"));
|
|
18
|
-
//#endregion
|
|
19
18
|
export { t as ChannelTabs, n as ChatPanel, r as Composer, i as MessageList, a as TypingIndicator, o as chatLabels, s as chatMentionLabels, c as chatTypingLabels, g as useChannel, v as useChannelList, h as useChatAuthors, x as useChatEdit, E as useChatJoin, D as useChatLeave, w as useChatMarkRead, _ as useChatMembership, m as useChatMentionCandidates, y as useChatMessages, T as useChatOriginal, S as useChatRemove, b as useChatSend, k as useChatSetTyping, O as useChatTransferOwnership, u as useChatTypingPublisher, l as useTyping, C as useUnread };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltro/plugin-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.0",
|
|
4
4
|
"description": "Membership-filtered durable chat with configurable moderation, rate and retention strategies",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"voltro",
|
|
@@ -73,25 +73,25 @@
|
|
|
73
73
|
"node": ">=24.0.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@voltro/protocol": "0.
|
|
77
|
-
"@voltro/database": "0.
|
|
78
|
-
"@voltro/client": "0.
|
|
79
|
-
"@voltro/runtime": "0.
|
|
80
|
-
"@voltro/plugin-ratelimit": "0.
|
|
81
|
-
"@voltro/plugin-moderation": "0.
|
|
82
|
-
"@voltro/plugin-social": "0.
|
|
83
|
-
"@voltro/plugin-players": "0.
|
|
84
|
-
"@voltro/plugin-notifications": "0.
|
|
85
|
-
"@voltro/kv": "0.
|
|
86
|
-
"@voltro/ui-shadcn": "0.
|
|
87
|
-
"@voltro/plugin-sanctions": "0.
|
|
88
|
-
"@voltro/plugin-licensing": "0.
|
|
89
|
-
"@voltro/plugin-storage": "0.
|
|
90
|
-
"@voltro/plugin-guilds": "0.
|
|
91
|
-
"@voltro/plugin-matchmaking": "0.
|
|
76
|
+
"@voltro/protocol": "0.88.0",
|
|
77
|
+
"@voltro/database": "0.88.0",
|
|
78
|
+
"@voltro/client": "0.88.0",
|
|
79
|
+
"@voltro/runtime": "0.88.0",
|
|
80
|
+
"@voltro/plugin-ratelimit": "0.88.0",
|
|
81
|
+
"@voltro/plugin-moderation": "0.88.0",
|
|
82
|
+
"@voltro/plugin-social": "0.88.0",
|
|
83
|
+
"@voltro/plugin-players": "0.88.0",
|
|
84
|
+
"@voltro/plugin-notifications": "0.88.0",
|
|
85
|
+
"@voltro/kv": "0.88.0",
|
|
86
|
+
"@voltro/ui-shadcn": "0.88.0",
|
|
87
|
+
"@voltro/plugin-sanctions": "0.88.0",
|
|
88
|
+
"@voltro/plugin-licensing": "0.88.0",
|
|
89
|
+
"@voltro/plugin-storage": "0.88.0",
|
|
90
|
+
"@voltro/plugin-guilds": "0.88.0",
|
|
91
|
+
"@voltro/plugin-matchmaking": "0.88.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"effect": "4.0
|
|
94
|
+
"effect": "4.1.0",
|
|
95
95
|
"react": "^19.0.0"
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|