@voltro/plugin-social 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.
@@ -1,7 +1,7 @@
1
1
  import { useEffect as e, useId as t, useRef as n } from "react";
2
2
  import { Button as r, Dialog as i, DialogDescription as a, DialogFooter as o, DialogHeader as s, DialogTitle as c, Input as l } from "@voltro/ui-shadcn";
3
3
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
- //#region src/components.tsx
4
+ // src/components.tsx
5
5
  var f = {
6
6
  en: {
7
7
  title: "Friends",
@@ -198,5 +198,4 @@ var f = {
198
198
  ]
199
199
  });
200
200
  };
201
- //#endregion
202
201
  export { g as AddFriendDialog, p as FriendRow, m as FriendsPanel, h as addFriendLabels, f as friendsLabels };
package/dist/contract.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema as e } from "effect";
2
- //#region src/contract.ts
2
+ // src/contract.ts
3
3
  var t = "_voltro_social_relations", n = "_voltro_social_recent", r = "_voltro_social_settings", i = e.Number.pipe(e.check(e.isInt()), e.check(e.isGreaterThanOrEqualTo(0))), a = e.Struct({
4
4
  ownerId: e.String,
5
5
  requestsFrom: e.Literals([
@@ -36,5 +36,4 @@ var t = "_voltro_social_relations", n = "_voltro_social_recent", r = "_voltro_so
36
36
  mutualFriends: e.Number.pipe(e.check(e.isInt()), e.check(e.isGreaterThan(0))),
37
37
  recentMatches: i
38
38
  });
39
- //#endregion
40
39
  export { n as RECENT_TABLE, t as RELATIONS_TABLE, s as RecentPlayerSchema, r as SETTINGS_TABLE, o as SocialRelationSchema, a as SocialSettingsSchema, c as SuggestionSchema };
package/dist/errors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema as e } from "effect";
2
- //#region src/errors.ts
2
+ // src/errors.ts
3
3
  var t = class extends e.TaggedError()("SocialError", { code: e.Literals([
4
4
  "identity_required",
5
5
  "invalid_input",
@@ -12,5 +12,4 @@ var t = class extends e.TaggedError()("SocialError", { code: e.Literals([
12
12
  "unavailable",
13
13
  "export_limit"
14
14
  ]) }) {}, n = (e) => new t({ code: e });
15
- //#endregion
16
15
  export { t as SocialError, n as socialError };
@@ -1,6 +1,6 @@
1
1
  import "./contract.js";
2
2
  import { accepted as e, requested as t } from "./events.js";
3
- //#region src/eventProducer.ts
3
+ // src/eventProducer.ts
4
4
  var n = (e) => {
5
5
  if (e.table !== "_voltro_social_relations") throw Error("Social events require the owned relation table");
6
6
  let t = (e.op === "delete" ? e.old : e.new)?.tenantId;
@@ -16,5 +16,4 @@ var n = (e) => {
16
16
  else for (let t of [a.fromId, a.toId]) await i.publish(e, { recipientId: t }, { relationId: a.id });
17
17
  }
18
18
  };
19
- //#endregion
20
19
  export { r as publishSocialChange, n as socialEventTenant };
package/dist/events.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Schema as e } from "effect";
2
2
  import { defineEvent as t } from "@voltro/protocol";
3
- //#region src/events.ts
3
+ // src/events.ts
4
4
  var n = t({
5
5
  name: "social.requested",
6
6
  key: e.Struct({ recipientId: e.String }),
@@ -12,5 +12,4 @@ var n = t({
12
12
  payload: e.Struct({ relationId: e.String }),
13
13
  guards: [{ scope: "social:events:read" }]
14
14
  });
15
- //#endregion
16
15
  export { r as accepted, n as requested };
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { Effect as g, Layer as _ } from "effect";
14
14
  import { fileURLToPath as v } from "node:url";
15
15
  import { replicaEvidence as y } from "@voltro/protocol/identity";
16
16
  import { redisStore as b } from "@voltro/plugin-ratelimit";
17
- //#region src/index.ts
17
+ // src/index.ts
18
18
  var x = {
19
19
  slots: {
20
20
  suggestions: {
@@ -131,5 +131,4 @@ var x = {
131
131
  })
132
132
  });
133
133
  };
134
- //#endregion
135
134
  export { n as SocialBlockPort, e as SocialError, o as dataStoreSocial, u as defaultSocialStrategies, d as resolveSocialOptions, S as socialPlugin, i as socialRecentTable, r as socialRelationsTable, a as socialSettingsTable, x as socialSystemContract };
package/dist/inspect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { socialError as e } from "./errors.js";
2
2
  import { RECENT_TABLE as t, RELATIONS_TABLE as n, SETTINGS_TABLE as r } from "./contract.js";
3
3
  import { defaultSocialStrategies as i } from "./strategies.js";
4
- //#region src/inspect.ts
4
+ // src/inspect.ts
5
5
  var a = (a, o, s) => {
6
6
  let c = a.now();
7
7
  if (!Number.isSafeInteger(c) || c < 0 || c > 864e13) throw e("unavailable");
@@ -24,5 +24,4 @@ var a = (a, o, s) => {
24
24
  ]
25
25
  };
26
26
  };
27
- //#endregion
28
27
  export { a as socialStatus };
package/dist/port.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Context as e } from "effect";
2
- //#region src/port.ts
2
+ // src/port.ts
3
3
  var t = class extends e.Service()("@voltro/SocialBlockPort") {};
4
- //#endregion
5
4
  export { t as SocialBlockPort };
@@ -1,6 +1,6 @@
1
1
  import { RECENT_TABLE as e } from "./contract.js";
2
2
  import { id as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
3
- //#region src/recent.entity.ts
3
+ // src/recent.entity.ts
4
4
  var o = r(e, {
5
5
  id: t({ prefix: "srecent" }),
6
6
  tenantId: i().maxLength(256).externalId().sensitive("pii"),
@@ -14,5 +14,4 @@ var o = r(e, {
14
14
  "ownerId",
15
15
  "at"
16
16
  ]).index(["tenantId", "otherId"]);
17
- //#endregion
18
17
  export { o as socialRecentTable };
@@ -1,6 +1,6 @@
1
1
  import { RELATIONS_TABLE as e } from "./contract.js";
2
2
  import { id as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
3
- //#region src/relations.entity.ts
3
+ // src/relations.entity.ts
4
4
  var o = r(e, {
5
5
  id: t({ prefix: "srel" }),
6
6
  tenantId: i().maxLength(256).externalId().sensitive("pii"),
@@ -26,5 +26,4 @@ var o = r(e, {
26
26
  "toId",
27
27
  "kind"
28
28
  ]);
29
- //#endregion
30
29
  export { o as socialRelationsTable };
package/dist/rpc.js CHANGED
@@ -2,7 +2,7 @@ import { SocialError as e } from "./errors.js";
2
2
  import { RECENT_TABLE as t, RELATIONS_TABLE as n, RecentPlayerSchema as r, SETTINGS_TABLE as i, SocialRelationSchema as a, SocialSettingsSchema as o, SuggestionSchema as s } from "./contract.js";
3
3
  import { Schema as c } from "effect";
4
4
  import { defineAction as l, defineQuery as u } from "@voltro/protocol";
5
- //#region src/rpc.ts
5
+ // src/rpc.ts
6
6
  var d = "@voltro/plugin-social", f = "The handler requires a verified human subject and uses its tenant and identity; callers supply only intentions.", p = c.Struct({ otherId: c.NonEmptyString }), m = l({
7
7
  name: "social.request",
8
8
  input: p,
@@ -151,5 +151,4 @@ var d = "@voltro/plugin-social", f = "The handler requires a verified human subj
151
151
  name: e + "Descriptor"
152
152
  }
153
153
  }))];
154
- //#endregion
155
154
  export { d as BASE_NAME, h as acceptDescriptor, y as blockDescriptor, D as blockedDescriptor, _ as cancelDescriptor, g as declineDescriptor, x as favoriteDescriptor, T as favoritesDescriptor, w as friendsDescriptor, O as recentDescriptor, v as removeDescriptor, m as requestDescriptor, E as requestsDescriptor, S as setSettingsDescriptor, C as settingsDescriptor, A as socialRpcClientImports, k as suggestionsDescriptor, b as unblockDescriptor };
package/dist/rpcRoutes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { acceptDescriptor as e, blockDescriptor as t, blockedDescriptor as n, cancelDescriptor as r, declineDescriptor as i, favoriteDescriptor as a, favoritesDescriptor as o, friendsDescriptor as s, recentDescriptor as c, removeDescriptor as l, requestDescriptor as u, requestsDescriptor as d, setSettingsDescriptor as f, settingsDescriptor as p, suggestionsDescriptor as m, unblockDescriptor as h } from "./rpc.js";
2
- //#region src/rpcRoutes.ts
2
+ // src/rpcRoutes.ts
3
3
  var g = (g) => [
4
4
  {
5
5
  ...u,
@@ -66,5 +66,4 @@ var g = (g) => [
66
66
  execute: (e, t) => g.suggestions(t.request.subject)
67
67
  }
68
68
  ];
69
- //#endregion
70
69
  export { g as socialRpcRoutes };
package/dist/service.js CHANGED
@@ -6,7 +6,7 @@ import { socialSettingsTable as c } from "./settings.entity.js";
6
6
  import { Effect as l, Schema as u } from "effect";
7
7
  import { createHash as d } from "node:crypto";
8
8
  import { and as f, eq as p, gte as m, lt as h, or as g, queryFor as _ } from "@voltro/database";
9
- //#region src/service.ts
9
+ // src/service.ts
10
10
  var v = (e) => d("sha256").update(JSON.stringify(e)).digest("hex"), y = (n) => n instanceof e ? n : t("unavailable"), b = (e) => l.tryPromise({
11
11
  try: e,
12
12
  catch: y
@@ -350,5 +350,4 @@ var v = (e) => d("sha256").update(JSON.stringify(e)).digest("hex"), y = (n) => n
350
350
  })
351
351
  };
352
352
  };
353
- //#endregion
354
353
  export { D as dataStoreSocial };
@@ -1,6 +1,6 @@
1
1
  import { SETTINGS_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 } from "@voltro/database";
3
- //#region src/settings.entity.ts
3
+ // src/settings.entity.ts
4
4
  var s = a(e, {
5
5
  id: n({ prefix: "ssettings" }),
6
6
  tenantId: o().maxLength(256).externalId().sensitive("pii"),
@@ -16,5 +16,4 @@ var s = a(e, {
16
16
  admission: r().serverOnly(),
17
17
  metadata: i().sensitive("pii")
18
18
  }).index(["tenantId", "ownerId"]);
19
- //#endregion
20
19
  export { s as socialSettingsTable };
@@ -1,5 +1,5 @@
1
1
  import { socialError as e } from "./errors.js";
2
- //#region src/strategies.ts
2
+ // src/strategies.ts
3
3
  var t = ({ settings: e, mutualFriends: t }) => e.requestsFrom === "anyone" || e.requestsFrom === "friends-of-friends" && t > 0, n = (e, t) => [...e].sort((e, t) => t.recentMatches - e.recentMatches || t.mutualFriends - e.mutualFriends || (e.subjectId < t.subjectId ? -1 : +(e.subjectId > t.subjectId))).slice(0, t), r = (e) => e.ownerId !== e.otherId, i = Object.freeze({
4
4
  suggestions: n,
5
5
  requestPolicy: t,
@@ -36,5 +36,4 @@ var t = ({ settings: e, mutualFriends: t }) => e.requestsFrom === "anyone" || e.
36
36
  if (typeof n.now != "function" || Object.values(n.strategies).some((e) => typeof e != "function")) throw e("invalid_input");
37
37
  return Object.freeze(n);
38
38
  };
39
- //#endregion
40
39
  export { i as defaultSocialStrategies, r as distinctRecentPeers, n as mutualMatchSuggestions, t as recipientRequestPolicy, a as resolveSocialOptions };
package/dist/testing.js CHANGED
@@ -2,7 +2,7 @@ import { socialError as e } from "./errors.js";
2
2
  import { SocialBlockPort as t } from "./port.js";
3
3
  import { distinctRecentPeers as n, mutualMatchSuggestions as r, recipientRequestPolicy as i, resolveSocialOptions as a } from "./strategies.js";
4
4
  import { Effect as o, Layer as s, Result as c } from "effect";
5
- //#region src/testing.ts
5
+ // src/testing.ts
6
6
  var l = (t = {}) => ({
7
7
  isBlocked: () => o.fail(e("unavailable")),
8
8
  blockPairs: () => o.fail(e("unavailable")),
@@ -82,5 +82,4 @@ var l = (t = {}) => ({
82
82
  expected: !1
83
83
  }
84
84
  };
85
- //#endregion
86
85
  export { u as fakeSocialBlockLayer, l as fakeSocialBlockService, d as socialBlockFakeLayer, f as socialBlockPortFixture, v as socialRecentPolicyFixture, g as socialRequestPolicyFixture, h as socialSuggestionsFixture };
package/dist/web.js CHANGED
@@ -2,7 +2,6 @@ import { BASE_NAME as e } from "./rpc.js";
2
2
  import { AddFriendDialog as t, FriendRow as n, FriendsPanel as r, addFriendLabels as i, friendsLabels as a } from "./components.js";
3
3
  import { pluginTag as o } from "@voltro/protocol";
4
4
  import { useSubscription as s } from "@voltro/client";
5
- //#region src/web.ts
5
+ // src/web.ts
6
6
  var c = (t = "app") => s(t, o(e, "friends"), {}), l = (t = "app") => s(t, o(e, "favorites"), {}), u = (t = "app") => s(t, o(e, "requests"), {}), d = (t = "app") => s(t, o(e, "blocked"), {}), f = (t = "app") => s(t, o(e, "recent"), {}), p = (t = "app") => s(t, o(e, "suggestions"), {}), m = (t = "app") => s(t, o(e, "settings"), {});
7
- //#endregion
8
7
  export { t as AddFriendDialog, n as FriendRow, r as FriendsPanel, i as addFriendLabels, a as friendsLabels, d as useBlockList, l as useFavoriteFriends, u as useFriendRequests, c as useFriends, f as useRecentPlayers, m as useSocialSettings, p as useSocialSuggestions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-social",
3
- "version": "0.87.0",
3
+ "version": "0.88.0",
4
4
  "description": "SQL-owned social graph with symmetric block admission and configurable policies",
5
5
  "keywords": [
6
6
  "voltro",
@@ -73,17 +73,17 @@
73
73
  "node": ">=24.0.0"
74
74
  },
75
75
  "dependencies": {
76
- "@voltro/protocol": "0.87.0",
77
- "@voltro/database": "0.87.0",
78
- "@voltro/client": "0.87.0",
79
- "@voltro/runtime": "0.87.0",
80
- "@voltro/plugin-ratelimit": "0.87.0",
81
- "@voltro/kv": "0.87.0",
82
- "@voltro/ui-shadcn": "0.87.0",
83
- "@voltro/plugin-licensing": "0.87.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/kv": "0.88.0",
82
+ "@voltro/ui-shadcn": "0.88.0",
83
+ "@voltro/plugin-licensing": "0.88.0"
84
84
  },
85
85
  "peerDependencies": {
86
- "effect": "4.0.1",
86
+ "effect": "4.1.0",
87
87
  "react": "^19.0.0"
88
88
  },
89
89
  "publishConfig": {