@voltro/plugin-guilds 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, Select as u, Textarea as d } from "@voltro/ui-shadcn";
3
3
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
4
- //#region src/components.tsx
4
+ // src/components.tsx
5
5
  var m = {
6
6
  en: {
7
7
  owner: "Owner",
@@ -392,5 +392,4 @@ var m = {
392
392
  })]
393
393
  });
394
394
  };
395
- //#endregion
396
395
  export { g as GuildBrowser, h as GuildCard, v as GuildCreateDialog, b as GuildLog, _ as GuildMemberList, m as guildLabels };
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_guilds", n = "_voltro_guild_members", r = "_voltro_guild_roles", i = "_voltro_guild_applications", a = "_voltro_guild_invites", o = "_voltro_guild_log", s = "_voltro_guild_announcements", c = "_voltro_guild_admissions", l = {
4
4
  invite: 1,
5
5
  kick: 2,
@@ -110,5 +110,4 @@ var t = "_voltro_guilds", n = "_voltro_guild_members", r = "_voltro_guild_roles"
110
110
  createdAt: u,
111
111
  metadata: d
112
112
  });
113
- //#endregion
114
113
  export { c as ADMISSIONS_TABLE, s as ANNOUNCEMENTS_TABLE, i as APPLICATIONS_TABLE, t as GUILDS_TABLE, y as GuildAnnouncementSchema, g as GuildApplicationSchema, _ as GuildInviteSchema, v as GuildLogSchema, m as GuildMemberSchema, h as GuildRoleSchema, f as GuildSchema, p as GuildSummarySchema, a as INVITES_TABLE, o as LOG_TABLE, n as MEMBERS_TABLE, l as PERMISSIONS, r as ROLES_TABLE };
package/dist/entities.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ADMISSIONS_TABLE as e, ANNOUNCEMENTS_TABLE as t, APPLICATIONS_TABLE as n, GUILDS_TABLE as r, INVITES_TABLE as i, LOG_TABLE as a, MEMBERS_TABLE as o, ROLES_TABLE as s } from "./contract.js";
2
2
  import { boolean as c, id as l, integer as u, json as d, table as f, text as p, timestamp as m } from "@voltro/database";
3
- //#region src/entities.ts
3
+ // src/entities.ts
4
4
  var h = () => p().maxLength(256).externalId().sensitive("pii"), g = () => p().maxLength(256).externalId().sensitive("pii"), _ = () => p().maxLength(64).safe(), v = f(r, {
5
5
  id: l({ prefix: "guild" }),
6
6
  tenantId: h(),
@@ -112,5 +112,4 @@ var h = () => p().maxLength(256).externalId().sensitive("pii"), g = () => p().ma
112
112
  w,
113
113
  T
114
114
  ];
115
- //#endregion
116
115
  export { T as guildAdmissionsTable, w as guildAnnouncementsTable, x as guildApplicationsTable, S as guildInvitesTable, C as guildLogTable, y as guildMembersTable, b as guildRolesTable, E as guildTables, v as guildsTable };
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()("GuildsError", { code: e.Literals([
4
4
  "identity_required",
5
5
  "invalid_input",
@@ -16,5 +16,4 @@ var t = class extends e.TaggedError()("GuildsError", { code: e.Literals([
16
16
  "unavailable",
17
17
  "export_limit"
18
18
  ]) }) {}, n = (e) => new t({ code: e });
19
- //#endregion
20
19
  export { t as GuildsError, n as guildsError };
@@ -1,6 +1,6 @@
1
1
  import "./contract.js";
2
2
  import { guildChanged as e } from "./events.js";
3
- //#region src/eventProducer.ts
3
+ // src/eventProducer.ts
4
4
  var t = (e) => {
5
5
  if (e.table !== "_voltro_guild_log") throw Error("Guild events require the owned log table");
6
6
  let t = (e.op === "delete" ? e.old : e.new)?.tenantId;
@@ -16,5 +16,4 @@ var t = (e) => {
16
16
  kind: i.kind
17
17
  });
18
18
  };
19
- //#endregion
20
19
  export { t as guildEventTenant, n as publishGuildChange };
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: "guilds.changed",
6
6
  key: e.Struct({ guildId: e.String }),
@@ -10,5 +10,4 @@ var n = t({
10
10
  }),
11
11
  guards: [{ scope: "guilds:events:read" }]
12
12
  });
13
- //#endregion
14
13
  export { n as guildChanged };
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { GuildMembershipPort as y } from "./port.js";
10
10
  import { defineLicensedGamePlugin as b } from "@voltro/plugin-licensing/gate";
11
11
  import { fileURLToPath as x } from "node:url";
12
12
  import { Effect as S, Layer as C } from "effect";
13
- //#region src/index.ts
13
+ // src/index.ts
14
14
  var w = {
15
15
  slots: {
16
16
  permissions: {
@@ -105,5 +105,4 @@ var w = {
105
105
  })
106
106
  });
107
107
  };
108
- //#endregion
109
108
  export { y as GuildMembershipPort, l as GuildsError, d as dataStoreGuilds, f as defaultGuildStrategies, e as guildAdmissionsTable, t as guildAnnouncementsTable, n as guildApplicationsTable, r as guildInvitesTable, i as guildLogTable, a as guildMembersTable, o as guildRolesTable, w as guildSystemContract, s as guildTables, T as guildsPlugin, c as guildsTable, p as resolveGuildOptions };
package/dist/inspect.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { guildTables as e } from "./entities.js";
2
2
  import { guildsError as t } from "./errors.js";
3
3
  import { defaultGuildStrategies as n } from "./strategies.js";
4
- //#region src/inspect.ts
4
+ // src/inspect.ts
5
5
  var r = (r, i) => {
6
6
  let a = r.now();
7
7
  if (!Number.isSafeInteger(a) || a < 0 || a > 864e13) throw t("unavailable");
@@ -24,5 +24,4 @@ var r = (r, i) => {
24
24
  tables: e.map((e) => e.tableName)
25
25
  };
26
26
  };
27
- //#endregion
28
27
  export { r as guildStatus };
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/GuildMembershipPort") {};
4
- //#endregion
5
4
  export { t as GuildMembershipPort };
package/dist/rpc.js CHANGED
@@ -2,7 +2,7 @@ import { ANNOUNCEMENTS_TABLE as e, APPLICATIONS_TABLE as t, GUILDS_TABLE as n, G
2
2
  import { GuildsError as h } from "./errors.js";
3
3
  import { Schema as g } from "effect";
4
4
  import { defineAction as _, defineQuery as v } from "@voltro/protocol";
5
- //#region src/rpc.ts
5
+ // src/rpc.ts
6
6
  var y = "@voltro/plugin-guilds", b = "The server verifies trusted human/guest identity, tenant, committed guild membership, role permissions and rank; creation/join are explicit human intentions.", x = g.NonEmptyString, S = g.Number.pipe(g.check(g.isInt()), g.check(g.isGreaterThanOrEqualTo(0))), C = g.Struct({ guildId: x }), w = g.Struct({
7
7
  guildId: x,
8
8
  subjectId: x
@@ -276,5 +276,4 @@ var y = "@voltro/plugin-guilds", b = "The server verifies trusted human/guest id
276
276
  name: e + "Descriptor"
277
277
  }
278
278
  }))];
279
- //#endregion
280
279
  export { y as BASE_NAME, G as announceDescriptor, K as announcementsDescriptor, F as applicationsDescriptor, P as applyDescriptor, H as configureRoleDescriptor, E as createDescriptor, I as decideApplicationDescriptor, z as decideInviteDescriptor, O as getDescriptor, J as guildRpcClientImports, L as inviteDescriptor, R as invitesDescriptor, M as joinDescriptor, B as kickDescriptor, N as leaveDescriptor, q as logDescriptor, A as membersDescriptor, D as mineDescriptor, j as rolesDescriptor, k as searchDescriptor, V as setRoleDescriptor, U as transferOwnerDescriptor, W as updateProfileDescriptor };
package/dist/rpcRoutes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { announceDescriptor as e, announcementsDescriptor as t, applicationsDescriptor as n, applyDescriptor as r, configureRoleDescriptor as i, createDescriptor as a, decideApplicationDescriptor as o, decideInviteDescriptor as s, getDescriptor as c, inviteDescriptor as l, invitesDescriptor as u, joinDescriptor as d, kickDescriptor as f, leaveDescriptor as p, logDescriptor as m, membersDescriptor as h, mineDescriptor as g, rolesDescriptor as _, searchDescriptor as v, setRoleDescriptor as y, transferOwnerDescriptor as b, updateProfileDescriptor as x } from "./rpc.js";
2
- //#region src/rpcRoutes.ts
2
+ // src/rpcRoutes.ts
3
3
  var S = (S) => [
4
4
  {
5
5
  ...a,
@@ -90,5 +90,4 @@ var S = (S) => [
90
90
  execute: (e, t) => S.log(t.request.subject, e.guildId)
91
91
  }
92
92
  ];
93
- //#endregion
94
93
  export { S as guildRpcRoutes };
package/dist/service.js CHANGED
@@ -6,7 +6,7 @@ import { createHash as x, randomUUID as ee } from "node:crypto";
6
6
  import { and as S, eq as C, isNull as te, or as w, queryFor as ne } from "@voltro/database";
7
7
  import { keywordProvider as re } from "@voltro/plugin-moderation";
8
8
  import { SocialBlockPort as ie } from "@voltro/plugin-social/port";
9
- //#region src/service.ts
9
+ // src/service.ts
10
10
  var T = (e) => x("sha256").update(JSON.stringify(e)).digest("hex"), E = (e, t) => e + "_" + T(t).slice(0, 56), D = (e) => e instanceof _ ? e : v("unavailable"), O = (e) => y.tryPromise({
11
11
  try: e,
12
12
  catch: D
@@ -730,5 +730,4 @@ var T = (e) => x("sha256").update(JSON.stringify(e)).digest("hex"), E = (e, t) =
730
730
  })
731
731
  };
732
732
  };
733
- //#endregion
734
733
  export { B as dataStoreGuilds };
@@ -1,6 +1,6 @@
1
1
  import { PERMISSIONS as e } from "./contract.js";
2
2
  import { guildsError as t } from "./errors.js";
3
- //#region src/strategies.ts
3
+ // src/strategies.ts
4
4
  var n = ({ role: t, permission: n }) => Number.isSafeInteger(t.permissions) && t.permissions >= 0 && t.permissions <= 127 && (t.permissions & e[n]) !== 0, r = ({ xp: e, baseMemberCap: t, maximumMemberCap: n }) => {
5
5
  let r = 1 + Math.floor(Math.sqrt(e / 1e3));
6
6
  return {
@@ -47,5 +47,4 @@ var n = ({ role: t, permission: n }) => Number.isSafeInteger(t.permissions) && t
47
47
  if (n.maximumMemberCap < n.baseMemberCap || n.denyWords.length > 1e3 || n.denyWords.some((e) => !e.trim() || e.length > 256) || typeof n.now != "function" || Object.values(n.strategies).some((e) => typeof e != "function")) throw t("invalid_input");
48
48
  return Object.freeze(n);
49
49
  };
50
- //#endregion
51
50
  export { n as bitSetGuildPermissions, a as defaultGuildStrategies, i as highestActiveGuildSuccessor, r as quadraticGuildLevels, o as resolveGuildOptions };
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { bitSetGuildPermissions as e, highestActiveGuildSuccessor as t, quadraticGuildLevels as n, resolveGuildOptions as r } from "./strategies.js";
2
2
  import { Effect as i } from "effect";
3
- //#region src/testing.ts
3
+ // src/testing.ts
4
4
  var a = {
5
5
  role: {
6
6
  id: "role",
@@ -73,5 +73,4 @@ var a = {
73
73
  expected: null
74
74
  }
75
75
  };
76
- //#endregion
77
76
  export { u as guildInactivityFixture, c as guildLevelFixture, o as guildPermissionsFixture };
package/dist/web.js CHANGED
@@ -2,7 +2,6 @@ import { BASE_NAME as e } from "./rpc.js";
2
2
  import { GuildBrowser as t, GuildCard as n, GuildCreateDialog as r, GuildLog as i, GuildMemberList as a, guildLabels as o } from "./components.js";
3
3
  import { pluginTag as s } from "@voltro/protocol";
4
4
  import { useAction as c, useSubscription as l } from "@voltro/client";
5
- //#region src/web.ts
5
+ // src/web.ts
6
6
  var u = (t, n = "app") => l(n, s(e, "get"), { guildId: t }), d = (t = "app") => l(t, s(e, "mine"), {}), f = (t, n = "app") => l(n, s(e, "members"), { guildId: t }), p = (t, n = "app") => l(n, s(e, "roles"), { guildId: t }), m = (t = {}, n = "app") => l(n, s(e, "search"), t), h = (t, n = "app") => l(n, s(e, "applications"), { guildId: t }), g = (t = "app") => l(t, s(e, "invites"), {}), _ = (t, n = "app") => l(n, s(e, "announcements"), { guildId: t }), v = (t, n = "app") => l(n, s(e, "log"), { guildId: t }), y = (t = "app") => c(t, s(e, "create")), b = (t = "app") => c(t, s(e, "join")), x = (t = "app") => c(t, s(e, "leave"));
7
- //#endregion
8
7
  export { t as GuildBrowser, n as GuildCard, r as GuildCreateDialog, i as GuildLog, a as GuildMemberList, o as guildLabels, u as useGuild, _ as useGuildAnnouncements, h as useGuildApplications, y as useGuildCreate, g as useGuildInvites, b as useGuildJoin, x as useGuildLeave, d as useGuildList, v as useGuildLog, f as useGuildMembers, p as useGuildRoles, m as useGuildSearch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-guilds",
3
- "version": "0.87.0",
3
+ "version": "0.88.0",
4
4
  "description": "SQL-authoritative guilds, scoped roles, membership admission and privacy with replaceable rules",
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-moderation": "0.87.0",
81
- "@voltro/plugin-social": "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-moderation": "0.88.0",
81
+ "@voltro/plugin-social": "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": {