@voltro/plugin-guilds 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/rpc.js ADDED
@@ -0,0 +1,279 @@
1
+ import { ANNOUNCEMENTS_TABLE as e, APPLICATIONS_TABLE as t, GUILDS_TABLE as n, GuildAnnouncementSchema as r, GuildApplicationSchema as i, GuildInviteSchema as a, GuildLogSchema as o, GuildMemberSchema as s, GuildRoleSchema as c, GuildSchema as l, GuildSummarySchema as u, INVITES_TABLE as d, LOG_TABLE as f, MEMBERS_TABLE as p, ROLES_TABLE as m } from "./contract.js";
2
+ import { GuildsError as h } from "./errors.js";
3
+ import { Schema as g } from "effect";
4
+ import { defineAction as _, defineQuery as v } from "@voltro/protocol";
5
+ // src/rpc.ts
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
+ guildId: x,
8
+ subjectId: x
9
+ }), T = [
10
+ n,
11
+ p,
12
+ m,
13
+ t,
14
+ d,
15
+ f,
16
+ e
17
+ ], E = _({
18
+ name: "guilds.create",
19
+ input: g.Struct({
20
+ requestId: x,
21
+ name: x,
22
+ tag: x,
23
+ description: g.optional(g.String),
24
+ visibility: g.optional(g.Literals([
25
+ "open",
26
+ "apply",
27
+ "invite"
28
+ ])),
29
+ region: g.optional(x),
30
+ language: g.optional(x)
31
+ }),
32
+ output: l,
33
+ error: h,
34
+ openAccess: b
35
+ }), D = v({
36
+ name: "guilds.mine",
37
+ input: g.Struct({}),
38
+ output: g.Array(l),
39
+ source: T,
40
+ error: h,
41
+ openAccess: b
42
+ }), O = v({
43
+ name: "guilds.get",
44
+ input: C,
45
+ output: l,
46
+ source: T,
47
+ error: h,
48
+ openAccess: b
49
+ }), k = v({
50
+ name: "guilds.search",
51
+ input: g.Struct({
52
+ name: g.optional(x),
53
+ tag: g.optional(x),
54
+ region: g.optional(x),
55
+ language: g.optional(x)
56
+ }),
57
+ output: g.Array(u),
58
+ source: [n],
59
+ error: h,
60
+ openAccess: b
61
+ }), A = v({
62
+ name: "guilds.members",
63
+ input: C,
64
+ output: g.Array(s),
65
+ source: [
66
+ n,
67
+ p,
68
+ m
69
+ ],
70
+ error: h,
71
+ openAccess: b
72
+ }), j = v({
73
+ name: "guilds.roles",
74
+ input: C,
75
+ output: g.Array(c),
76
+ source: [
77
+ n,
78
+ p,
79
+ m
80
+ ],
81
+ error: h,
82
+ openAccess: b
83
+ }), M = _({
84
+ name: "guilds.join",
85
+ input: C,
86
+ output: s,
87
+ error: h,
88
+ openAccess: b
89
+ }), N = _({
90
+ name: "guilds.leave",
91
+ input: C,
92
+ output: g.Void,
93
+ error: h,
94
+ openAccess: b
95
+ }), P = _({
96
+ name: "guilds.apply",
97
+ input: g.Struct({
98
+ guildId: x,
99
+ requestId: x,
100
+ message: g.String
101
+ }),
102
+ output: i,
103
+ error: h,
104
+ openAccess: b
105
+ }), F = v({
106
+ name: "guilds.applications",
107
+ input: C,
108
+ output: g.Array(i),
109
+ source: [
110
+ n,
111
+ p,
112
+ m,
113
+ t
114
+ ],
115
+ error: h,
116
+ openAccess: b
117
+ }), I = _({
118
+ name: "guilds.decideApplication",
119
+ input: g.Struct({
120
+ applicationId: x,
121
+ accept: g.Boolean
122
+ }),
123
+ output: i,
124
+ error: h,
125
+ openAccess: b
126
+ }), L = _({
127
+ name: "guilds.invite",
128
+ input: g.Struct({
129
+ guildId: x,
130
+ subjectId: x,
131
+ requestId: x
132
+ }),
133
+ output: a,
134
+ error: h,
135
+ openAccess: b
136
+ }), R = v({
137
+ name: "guilds.invites",
138
+ input: g.Struct({}),
139
+ output: g.Array(a),
140
+ source: [
141
+ d,
142
+ p,
143
+ n
144
+ ],
145
+ error: h,
146
+ openAccess: b
147
+ }), z = _({
148
+ name: "guilds.decideInvite",
149
+ input: g.Struct({
150
+ inviteId: x,
151
+ accept: g.Boolean
152
+ }),
153
+ output: a,
154
+ error: h,
155
+ openAccess: b
156
+ }), B = _({
157
+ name: "guilds.kick",
158
+ input: w,
159
+ output: g.Void,
160
+ error: h,
161
+ openAccess: b
162
+ }), V = _({
163
+ name: "guilds.setRole",
164
+ input: g.Struct({
165
+ guildId: x,
166
+ subjectId: x,
167
+ roleId: x
168
+ }),
169
+ output: s,
170
+ error: h,
171
+ openAccess: b
172
+ }), H = _({
173
+ name: "guilds.configureRole",
174
+ input: g.Struct({
175
+ guildId: x,
176
+ roleId: x,
177
+ name: x,
178
+ rank: S,
179
+ permissions: S
180
+ }),
181
+ output: c,
182
+ error: h,
183
+ openAccess: b
184
+ }), U = _({
185
+ name: "guilds.transferOwner",
186
+ input: w,
187
+ output: l,
188
+ error: h,
189
+ openAccess: b
190
+ }), W = _({
191
+ name: "guilds.updateProfile",
192
+ input: g.Struct({
193
+ guildId: x,
194
+ baseVersion: S,
195
+ description: g.optional(g.String),
196
+ visibility: g.optional(g.Literals([
197
+ "open",
198
+ "apply",
199
+ "invite"
200
+ ])),
201
+ region: g.optional(g.NullOr(x)),
202
+ language: g.optional(g.NullOr(x))
203
+ }),
204
+ output: l,
205
+ error: h,
206
+ openAccess: b
207
+ }), G = _({
208
+ name: "guilds.announce",
209
+ input: g.Struct({
210
+ guildId: x,
211
+ requestId: x,
212
+ body: x,
213
+ pinned: g.optional(g.Boolean)
214
+ }),
215
+ output: r,
216
+ error: h,
217
+ openAccess: b
218
+ }), K = v({
219
+ name: "guilds.announcements",
220
+ input: C,
221
+ output: g.Array(r),
222
+ source: [
223
+ n,
224
+ p,
225
+ e
226
+ ],
227
+ error: h,
228
+ openAccess: b
229
+ }), q = v({
230
+ name: "guilds.log",
231
+ input: C,
232
+ output: g.Array(o),
233
+ source: [
234
+ n,
235
+ p,
236
+ f
237
+ ],
238
+ error: h,
239
+ openAccess: b
240
+ }), J = [...[
241
+ "create",
242
+ "join",
243
+ "leave",
244
+ "apply",
245
+ "decideApplication",
246
+ "invite",
247
+ "decideInvite",
248
+ "kick",
249
+ "setRole",
250
+ "configureRole",
251
+ "transferOwner",
252
+ "updateProfile",
253
+ "announce"
254
+ ].map((e) => ({
255
+ tag: "guilds." + e,
256
+ kind: "action",
257
+ import: {
258
+ module: "@voltro/plugin-guilds/rpc",
259
+ name: e + "Descriptor"
260
+ }
261
+ })), ...[
262
+ "mine",
263
+ "get",
264
+ "search",
265
+ "members",
266
+ "roles",
267
+ "applications",
268
+ "invites",
269
+ "announcements",
270
+ "log"
271
+ ].map((e) => ({
272
+ tag: "guilds." + e,
273
+ kind: "query",
274
+ import: {
275
+ module: "@voltro/plugin-guilds/rpc",
276
+ name: e + "Descriptor"
277
+ }
278
+ }))];
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 };
@@ -0,0 +1,93 @@
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
+ // src/rpcRoutes.ts
3
+ var S = (S) => [
4
+ {
5
+ ...a,
6
+ execute: (e, t) => S.create(t.request.subject, e)
7
+ },
8
+ {
9
+ ...g,
10
+ execute: (e, t) => S.mine(t.request.subject)
11
+ },
12
+ {
13
+ ...c,
14
+ execute: (e, t) => S.get(t.request.subject, e.guildId)
15
+ },
16
+ {
17
+ ...v,
18
+ execute: (e, t) => S.search(t.request.subject, e)
19
+ },
20
+ {
21
+ ...h,
22
+ execute: (e, t) => S.members(t.request.subject, e.guildId)
23
+ },
24
+ {
25
+ ..._,
26
+ execute: (e, t) => S.roles(t.request.subject, e.guildId)
27
+ },
28
+ {
29
+ ...d,
30
+ execute: (e, t) => S.join(t.request.subject, e.guildId)
31
+ },
32
+ {
33
+ ...p,
34
+ execute: (e, t) => S.leave(t.request.subject, e.guildId)
35
+ },
36
+ {
37
+ ...r,
38
+ execute: (e, t) => S.apply(t.request.subject, e)
39
+ },
40
+ {
41
+ ...n,
42
+ execute: (e, t) => S.applications(t.request.subject, e.guildId)
43
+ },
44
+ {
45
+ ...o,
46
+ execute: (e, t) => S.decideApplication(t.request.subject, e)
47
+ },
48
+ {
49
+ ...l,
50
+ execute: (e, t) => S.invite(t.request.subject, e)
51
+ },
52
+ {
53
+ ...u,
54
+ execute: (e, t) => S.invites(t.request.subject)
55
+ },
56
+ {
57
+ ...s,
58
+ execute: (e, t) => S.decideInvite(t.request.subject, e)
59
+ },
60
+ {
61
+ ...f,
62
+ execute: (e, t) => S.kick(t.request.subject, e.guildId, e.subjectId)
63
+ },
64
+ {
65
+ ...y,
66
+ execute: (e, t) => S.setRole(t.request.subject, e.guildId, e.subjectId, e.roleId)
67
+ },
68
+ {
69
+ ...i,
70
+ execute: (e, t) => S.configureRole(t.request.subject, e)
71
+ },
72
+ {
73
+ ...b,
74
+ execute: (e, t) => S.transferOwner(t.request.subject, e.guildId, e.subjectId)
75
+ },
76
+ {
77
+ ...x,
78
+ execute: (e, t) => S.updateProfile(t.request.subject, e)
79
+ },
80
+ {
81
+ ...e,
82
+ execute: (e, t) => S.announce(t.request.subject, e)
83
+ },
84
+ {
85
+ ...t,
86
+ execute: (e, t) => S.announcements(t.request.subject, e.guildId)
87
+ },
88
+ {
89
+ ...m,
90
+ execute: (e, t) => S.log(t.request.subject, e.guildId)
91
+ }
92
+ ];
93
+ export { S as guildRpcRoutes };