@voltro/plugin-guilds 0.0.0-stage → 0.87.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 +24329 -0
- package/LICENSE +61 -0
- package/README.md +165 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +8467 -0
- package/dist/components.js +396 -0
- package/dist/contract.js +114 -0
- package/dist/entities.js +116 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +20 -0
- package/dist/eventProducer.d.ts +8 -0
- package/dist/eventProducer.js +20 -0
- package/dist/events.d.ts +15 -0
- package/dist/events.js +14 -0
- package/dist/guild-app/events/guilds.changed.event.ts +1 -0
- package/dist/guild-app/subscribers/guilds.log.subscribe.ts +3 -0
- package/dist/index.d.ts +606 -0
- package/dist/index.js +109 -0
- package/dist/inspect.js +28 -0
- package/dist/port.d.ts +25 -0
- package/dist/port.js +5 -0
- package/dist/rpc.d.ts +355 -0
- package/dist/rpc.js +280 -0
- package/dist/rpcRoutes.js +94 -0
- package/dist/service.js +734 -0
- package/dist/strategies.d.ts +111 -0
- package/dist/strategies.js +51 -0
- package/dist/testing.d.ts +104 -0
- package/dist/testing.js +77 -0
- package/dist/web.d.ts +365 -0
- package/dist/web.js +8 -0
- package/package.json +90 -4
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
export declare const bitSetGuildPermissions: ({ role, permission }: GuildPermissionsInput) => boolean;
|
|
4
|
+
|
|
5
|
+
export declare const defaultGuildStrategies: Readonly<{
|
|
6
|
+
permissions: ({ role, permission }: GuildPermissionsInput) => boolean;
|
|
7
|
+
levelCurve: ({ xp, baseMemberCap, maximumMemberCap }: GuildLevelInput) => {
|
|
8
|
+
level: number;
|
|
9
|
+
memberCap: number;
|
|
10
|
+
};
|
|
11
|
+
inactivityPolicy: (input: GuildInactivityInput) => string | null;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export declare interface GuildInactivityInput {
|
|
15
|
+
readonly now: number;
|
|
16
|
+
readonly inactiveAfterMs: number;
|
|
17
|
+
readonly ownerLastActiveAt: number;
|
|
18
|
+
readonly members: ReadonlyArray<{
|
|
19
|
+
readonly subjectId: string;
|
|
20
|
+
readonly rank: number;
|
|
21
|
+
readonly lastActiveAt: number;
|
|
22
|
+
readonly joinedAt: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface GuildLevelInput {
|
|
27
|
+
readonly xp: number;
|
|
28
|
+
readonly baseMemberCap: number;
|
|
29
|
+
readonly maximumMemberCap: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare interface GuildOptions {
|
|
33
|
+
readonly baseMemberCap?: number;
|
|
34
|
+
readonly maximumMemberCap?: number;
|
|
35
|
+
readonly maxGuildsPerSubject?: number;
|
|
36
|
+
readonly maxRoles?: number;
|
|
37
|
+
readonly maxPending?: number;
|
|
38
|
+
readonly inviteTtlMs?: number;
|
|
39
|
+
readonly inactiveAfterMs?: number;
|
|
40
|
+
readonly pageSize?: number;
|
|
41
|
+
readonly maxExportRows?: number;
|
|
42
|
+
readonly maxDescriptionLength?: number;
|
|
43
|
+
readonly maxAnnouncementLength?: number;
|
|
44
|
+
readonly denyWords?: ReadonlyArray<string>;
|
|
45
|
+
readonly strategies?: Partial<typeof defaultGuildStrategies>;
|
|
46
|
+
readonly now?: () => number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare type GuildPermission = keyof typeof PERMISSIONS;
|
|
50
|
+
|
|
51
|
+
export declare interface GuildPermissionsInput {
|
|
52
|
+
readonly role: GuildRole;
|
|
53
|
+
readonly permission: GuildPermission;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare type GuildRole = typeof GuildRoleSchema.Type;
|
|
57
|
+
|
|
58
|
+
declare const GuildRoleSchema: Schema.Struct<{
|
|
59
|
+
readonly id: Schema.String;
|
|
60
|
+
readonly guildId: Schema.String;
|
|
61
|
+
readonly name: Schema.String;
|
|
62
|
+
readonly rank: Schema.Number;
|
|
63
|
+
readonly permissions: Schema.Number;
|
|
64
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
/** Suggests only; owner transfer requires an explicit trusted server command. */
|
|
68
|
+
export declare const highestActiveGuildSuccessor: (input: GuildInactivityInput) => string | null;
|
|
69
|
+
|
|
70
|
+
declare const PERMISSIONS: {
|
|
71
|
+
readonly invite: 1;
|
|
72
|
+
readonly kick: 2;
|
|
73
|
+
readonly promote: 4;
|
|
74
|
+
readonly treasury: 8;
|
|
75
|
+
readonly announce: 16;
|
|
76
|
+
readonly startEvent: 32;
|
|
77
|
+
readonly editProfile: 64;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export declare const quadraticGuildLevels: ({ xp, baseMemberCap, maximumMemberCap }: GuildLevelInput) => {
|
|
81
|
+
level: number;
|
|
82
|
+
memberCap: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export declare type ResolvedGuildOptions = ReturnType<typeof resolveGuildOptions>;
|
|
86
|
+
|
|
87
|
+
export declare const resolveGuildOptions: (input?: GuildOptions) => Readonly<{
|
|
88
|
+
baseMemberCap: number;
|
|
89
|
+
maximumMemberCap: number;
|
|
90
|
+
maxGuildsPerSubject: number;
|
|
91
|
+
maxRoles: number;
|
|
92
|
+
maxPending: number;
|
|
93
|
+
inviteTtlMs: number;
|
|
94
|
+
inactiveAfterMs: number;
|
|
95
|
+
pageSize: number;
|
|
96
|
+
maxExportRows: number;
|
|
97
|
+
maxDescriptionLength: number;
|
|
98
|
+
maxAnnouncementLength: number;
|
|
99
|
+
denyWords: readonly string[];
|
|
100
|
+
strategies: Readonly<{
|
|
101
|
+
permissions: ({ role, permission }: GuildPermissionsInput) => boolean;
|
|
102
|
+
levelCurve: ({ xp, baseMemberCap, maximumMemberCap }: GuildLevelInput) => {
|
|
103
|
+
level: number;
|
|
104
|
+
memberCap: number;
|
|
105
|
+
};
|
|
106
|
+
inactivityPolicy: (input: GuildInactivityInput) => string | null;
|
|
107
|
+
}>;
|
|
108
|
+
now: () => number;
|
|
109
|
+
}>;
|
|
110
|
+
|
|
111
|
+
export { }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PERMISSIONS as e } from "./contract.js";
|
|
2
|
+
import { guildsError as t } from "./errors.js";
|
|
3
|
+
//#region src/strategies.ts
|
|
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
|
+
let r = 1 + Math.floor(Math.sqrt(e / 1e3));
|
|
6
|
+
return {
|
|
7
|
+
level: r,
|
|
8
|
+
memberCap: Math.min(n, t + (r - 1) * 5)
|
|
9
|
+
};
|
|
10
|
+
}, i = (e) => e.ownerLastActiveAt > e.now - e.inactiveAfterMs ? null : [...e.members].filter((t) => t.lastActiveAt > e.now - e.inactiveAfterMs).sort((e, t) => e.rank - t.rank || e.joinedAt - t.joinedAt || (e.subjectId < t.subjectId ? -1 : +(e.subjectId > t.subjectId)))[0]?.subjectId ?? null, a = Object.freeze({
|
|
11
|
+
permissions: n,
|
|
12
|
+
levelCurve: r,
|
|
13
|
+
inactivityPolicy: i
|
|
14
|
+
}), o = (e = {}) => {
|
|
15
|
+
let n = {
|
|
16
|
+
baseMemberCap: e.baseMemberCap ?? 50,
|
|
17
|
+
maximumMemberCap: e.maximumMemberCap ?? 500,
|
|
18
|
+
maxGuildsPerSubject: e.maxGuildsPerSubject ?? 1,
|
|
19
|
+
maxRoles: e.maxRoles ?? 20,
|
|
20
|
+
maxPending: e.maxPending ?? 100,
|
|
21
|
+
inviteTtlMs: e.inviteTtlMs ?? 6048e5,
|
|
22
|
+
inactiveAfterMs: e.inactiveAfterMs ?? 2592e6,
|
|
23
|
+
pageSize: e.pageSize ?? 50,
|
|
24
|
+
maxExportRows: e.maxExportRows ?? 1e4,
|
|
25
|
+
maxDescriptionLength: e.maxDescriptionLength ?? 2e3,
|
|
26
|
+
maxAnnouncementLength: e.maxAnnouncementLength ?? 4e3,
|
|
27
|
+
denyWords: Object.freeze([...e.denyWords ?? []]),
|
|
28
|
+
strategies: Object.freeze({
|
|
29
|
+
...a,
|
|
30
|
+
...e.strategies
|
|
31
|
+
}),
|
|
32
|
+
now: e.now ?? Date.now
|
|
33
|
+
};
|
|
34
|
+
for (let [e, r] of [
|
|
35
|
+
[n.baseMemberCap, 1e4],
|
|
36
|
+
[n.maximumMemberCap, 1e4],
|
|
37
|
+
[n.maxGuildsPerSubject, 100],
|
|
38
|
+
[n.maxRoles, 100],
|
|
39
|
+
[n.maxPending, 1e4],
|
|
40
|
+
[n.inviteTtlMs, 31536e6],
|
|
41
|
+
[n.inactiveAfterMs, 31536e7],
|
|
42
|
+
[n.pageSize, 200],
|
|
43
|
+
[n.maxExportRows, 1e5],
|
|
44
|
+
[n.maxDescriptionLength, 2e4],
|
|
45
|
+
[n.maxAnnouncementLength, 2e4]
|
|
46
|
+
]) if (!Number.isSafeInteger(e) || e < 1 || e > r) throw t("invalid_input");
|
|
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
|
+
return Object.freeze(n);
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { n as bitSetGuildPermissions, a as defaultGuildStrategies, i as highestActiveGuildSuccessor, r as quadraticGuildLevels, o as resolveGuildOptions };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import { Schema } from 'effect';
|
|
3
|
+
|
|
4
|
+
export declare const guildInactivityFixture: {
|
|
5
|
+
kind: "slot";
|
|
6
|
+
defaultImplementation: (input: GuildInactivityInput) => string | null;
|
|
7
|
+
defaultProbe: {
|
|
8
|
+
run: () => Effect.Effect<string | null, never, never>;
|
|
9
|
+
expected: string;
|
|
10
|
+
};
|
|
11
|
+
overrideProbe: {
|
|
12
|
+
run: () => Effect.Effect<string | null, never, never>;
|
|
13
|
+
expected: null;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare interface GuildInactivityInput {
|
|
18
|
+
readonly now: number;
|
|
19
|
+
readonly inactiveAfterMs: number;
|
|
20
|
+
readonly ownerLastActiveAt: number;
|
|
21
|
+
readonly members: ReadonlyArray<{
|
|
22
|
+
readonly subjectId: string;
|
|
23
|
+
readonly rank: number;
|
|
24
|
+
readonly lastActiveAt: number;
|
|
25
|
+
readonly joinedAt: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare const guildLevelFixture: {
|
|
30
|
+
kind: "slot";
|
|
31
|
+
defaultImplementation: ({ xp, baseMemberCap, maximumMemberCap }: GuildLevelInput) => {
|
|
32
|
+
level: number;
|
|
33
|
+
memberCap: number;
|
|
34
|
+
};
|
|
35
|
+
defaultProbe: {
|
|
36
|
+
run: () => Effect.Effect<{
|
|
37
|
+
level: number;
|
|
38
|
+
memberCap: number;
|
|
39
|
+
}, never, never>;
|
|
40
|
+
expected: {
|
|
41
|
+
level: number;
|
|
42
|
+
memberCap: number;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
overrideProbe: {
|
|
46
|
+
run: () => Effect.Effect<{
|
|
47
|
+
level: number;
|
|
48
|
+
memberCap: number;
|
|
49
|
+
}, never, never>;
|
|
50
|
+
expected: {
|
|
51
|
+
level: number;
|
|
52
|
+
memberCap: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare interface GuildLevelInput {
|
|
58
|
+
readonly xp: number;
|
|
59
|
+
readonly baseMemberCap: number;
|
|
60
|
+
readonly maximumMemberCap: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare type GuildPermission = keyof typeof PERMISSIONS;
|
|
64
|
+
|
|
65
|
+
export declare const guildPermissionsFixture: {
|
|
66
|
+
kind: "slot";
|
|
67
|
+
defaultImplementation: ({ role, permission }: GuildPermissionsInput) => boolean;
|
|
68
|
+
defaultProbe: {
|
|
69
|
+
run: () => Effect.Effect<boolean, never, never>;
|
|
70
|
+
expected: boolean;
|
|
71
|
+
};
|
|
72
|
+
overrideProbe: {
|
|
73
|
+
run: () => Effect.Effect<boolean, never, never>;
|
|
74
|
+
expected: boolean;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
declare interface GuildPermissionsInput {
|
|
79
|
+
readonly role: GuildRole;
|
|
80
|
+
readonly permission: GuildPermission;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare type GuildRole = typeof GuildRoleSchema.Type;
|
|
84
|
+
|
|
85
|
+
declare const GuildRoleSchema: Schema.Struct<{
|
|
86
|
+
readonly id: Schema.String;
|
|
87
|
+
readonly guildId: Schema.String;
|
|
88
|
+
readonly name: Schema.String;
|
|
89
|
+
readonly rank: Schema.Number;
|
|
90
|
+
readonly permissions: Schema.Number;
|
|
91
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
declare const PERMISSIONS: {
|
|
95
|
+
readonly invite: 1;
|
|
96
|
+
readonly kick: 2;
|
|
97
|
+
readonly promote: 4;
|
|
98
|
+
readonly treasury: 8;
|
|
99
|
+
readonly announce: 16;
|
|
100
|
+
readonly startEvent: 32;
|
|
101
|
+
readonly editProfile: 64;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { }
|
package/dist/testing.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { bitSetGuildPermissions as e, highestActiveGuildSuccessor as t, quadraticGuildLevels as n, resolveGuildOptions as r } from "./strategies.js";
|
|
2
|
+
import { Effect as i } from "effect";
|
|
3
|
+
//#region src/testing.ts
|
|
4
|
+
var a = {
|
|
5
|
+
role: {
|
|
6
|
+
id: "role",
|
|
7
|
+
guildId: "guild",
|
|
8
|
+
name: "Member",
|
|
9
|
+
rank: 100,
|
|
10
|
+
permissions: 0,
|
|
11
|
+
metadata: {}
|
|
12
|
+
},
|
|
13
|
+
permission: "kick"
|
|
14
|
+
}, o = {
|
|
15
|
+
kind: "slot",
|
|
16
|
+
defaultImplementation: e,
|
|
17
|
+
defaultProbe: {
|
|
18
|
+
run: () => i.sync(() => e(a)),
|
|
19
|
+
expected: !1
|
|
20
|
+
},
|
|
21
|
+
overrideProbe: {
|
|
22
|
+
run: () => i.sync(() => r({ strategies: { permissions: () => !0 } }).strategies.permissions(a)),
|
|
23
|
+
expected: !0
|
|
24
|
+
}
|
|
25
|
+
}, s = {
|
|
26
|
+
xp: 1e3,
|
|
27
|
+
baseMemberCap: 50,
|
|
28
|
+
maximumMemberCap: 500
|
|
29
|
+
}, c = {
|
|
30
|
+
kind: "slot",
|
|
31
|
+
defaultImplementation: n,
|
|
32
|
+
defaultProbe: {
|
|
33
|
+
run: () => i.sync(() => n(s)),
|
|
34
|
+
expected: {
|
|
35
|
+
level: 2,
|
|
36
|
+
memberCap: 55
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
overrideProbe: {
|
|
40
|
+
run: () => i.sync(() => r({ strategies: { levelCurve: () => ({
|
|
41
|
+
level: 3,
|
|
42
|
+
memberCap: 60
|
|
43
|
+
}) } }).strategies.levelCurve(s)),
|
|
44
|
+
expected: {
|
|
45
|
+
level: 3,
|
|
46
|
+
memberCap: 60
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, l = {
|
|
50
|
+
now: 1e3,
|
|
51
|
+
inactiveAfterMs: 100,
|
|
52
|
+
ownerLastActiveAt: 0,
|
|
53
|
+
members: [{
|
|
54
|
+
subjectId: "a",
|
|
55
|
+
rank: 10,
|
|
56
|
+
lastActiveAt: 999,
|
|
57
|
+
joinedAt: 1
|
|
58
|
+
}, {
|
|
59
|
+
subjectId: "b",
|
|
60
|
+
rank: 100,
|
|
61
|
+
lastActiveAt: 999,
|
|
62
|
+
joinedAt: 0
|
|
63
|
+
}]
|
|
64
|
+
}, u = {
|
|
65
|
+
kind: "slot",
|
|
66
|
+
defaultImplementation: t,
|
|
67
|
+
defaultProbe: {
|
|
68
|
+
run: () => i.sync(() => t(l)),
|
|
69
|
+
expected: "a"
|
|
70
|
+
},
|
|
71
|
+
overrideProbe: {
|
|
72
|
+
run: () => i.sync(() => r({ strategies: { inactivityPolicy: () => null } }).strategies.inactivityPolicy(l)),
|
|
73
|
+
expected: null
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { u as guildInactivityFixture, c as guildLevelFixture, o as guildPermissionsFixture };
|
package/dist/web.d.ts
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { ActionState } from '@voltro/client';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Schema } from 'effect';
|
|
4
|
+
import { SubscriptionState } from '@voltro/client';
|
|
5
|
+
|
|
6
|
+
declare interface CreateGuildInput {
|
|
7
|
+
readonly requestId: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly tag: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly visibility?: Guild['visibility'];
|
|
12
|
+
readonly region?: string;
|
|
13
|
+
readonly language?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare type Guild = typeof GuildSchema.Type;
|
|
17
|
+
|
|
18
|
+
export declare const GuildBrowser: ({ guilds, query, onQueryChange, onFind, onView, scopeKey, dataScopeKey, loading, error, labels }: {
|
|
19
|
+
readonly guilds: ReadonlyArray<GuildSummary>;
|
|
20
|
+
readonly query: string;
|
|
21
|
+
readonly onQueryChange: (value: string) => void;
|
|
22
|
+
readonly onFind: (name: string) => void;
|
|
23
|
+
readonly onView: (guildId: string) => void;
|
|
24
|
+
readonly scopeKey: string;
|
|
25
|
+
readonly dataScopeKey: string;
|
|
26
|
+
readonly loading?: boolean;
|
|
27
|
+
readonly error?: unknown;
|
|
28
|
+
readonly labels?: GuildLabels;
|
|
29
|
+
}) => ReactNode;
|
|
30
|
+
|
|
31
|
+
export declare const GuildCard: ({ guild, labels, onView, pending }: {
|
|
32
|
+
readonly guild: GuildSummary;
|
|
33
|
+
readonly labels?: GuildLabels;
|
|
34
|
+
readonly onView: (guildId: string) => void;
|
|
35
|
+
readonly pending?: boolean;
|
|
36
|
+
}) => ReactNode;
|
|
37
|
+
|
|
38
|
+
/** Parent owns the immutable request ID and pending/error state across dialog close or session changes. */
|
|
39
|
+
export declare const GuildCreateDialog: ({ open, onOpenChange, value, onChange, onCreate, pending, error, labels, scopeKey, dataScopeKey }: {
|
|
40
|
+
readonly open: boolean;
|
|
41
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
42
|
+
readonly value: GuildCreateDraft;
|
|
43
|
+
readonly onChange: (value: GuildCreateDraft) => void;
|
|
44
|
+
readonly onCreate: (value: GuildCreateDraft) => void;
|
|
45
|
+
readonly pending?: boolean;
|
|
46
|
+
readonly error?: unknown;
|
|
47
|
+
readonly labels?: GuildLabels;
|
|
48
|
+
readonly scopeKey: string;
|
|
49
|
+
readonly dataScopeKey: string;
|
|
50
|
+
}) => ReactNode;
|
|
51
|
+
|
|
52
|
+
export declare type GuildCreateDraft = Pick<CreateGuildInput, 'name' | 'tag' | 'description' | 'visibility'>;
|
|
53
|
+
|
|
54
|
+
export declare interface GuildIdentity {
|
|
55
|
+
readonly subjectId: string;
|
|
56
|
+
readonly displayName: string;
|
|
57
|
+
readonly tag: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare type GuildLabels = {
|
|
61
|
+
readonly [K in keyof typeof guildLabels.en]: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export declare const guildLabels: {
|
|
65
|
+
readonly en: {
|
|
66
|
+
readonly owner: "Owner";
|
|
67
|
+
readonly officer: "Officer";
|
|
68
|
+
readonly member: "Member";
|
|
69
|
+
readonly title: "Guilds";
|
|
70
|
+
readonly empty: "No guilds match these filters.";
|
|
71
|
+
readonly loading: "Loading guilds…";
|
|
72
|
+
readonly failed: "Guilds could not be updated. Check the result before retrying.";
|
|
73
|
+
readonly open: "Open membership";
|
|
74
|
+
readonly apply: "Applications required";
|
|
75
|
+
readonly invite: "Invitation required";
|
|
76
|
+
readonly level: "Level";
|
|
77
|
+
readonly view: "View guild";
|
|
78
|
+
readonly search: "Exact guild name";
|
|
79
|
+
readonly find: "Find guild";
|
|
80
|
+
readonly members: "Members";
|
|
81
|
+
readonly unknown: "Player unavailable";
|
|
82
|
+
readonly role: "Role";
|
|
83
|
+
readonly create: "Create guild";
|
|
84
|
+
readonly createDescription: "Choose a guild name, a 3–5 character tag and a membership policy.";
|
|
85
|
+
readonly name: "Guild name";
|
|
86
|
+
readonly tag: "Guild tag";
|
|
87
|
+
readonly description: "Description";
|
|
88
|
+
readonly visibility: "Membership policy";
|
|
89
|
+
readonly close: "Close";
|
|
90
|
+
readonly log: "Guild activity";
|
|
91
|
+
readonly logEmpty: "No activity is available.";
|
|
92
|
+
};
|
|
93
|
+
readonly de: {
|
|
94
|
+
readonly owner: "Owner";
|
|
95
|
+
readonly officer: "Offizier";
|
|
96
|
+
readonly member: "Mitglied";
|
|
97
|
+
readonly title: "Gilden";
|
|
98
|
+
readonly empty: "Keine Gilden für diese Filter.";
|
|
99
|
+
readonly loading: "Gilden werden geladen…";
|
|
100
|
+
readonly failed: "Gilden konnten nicht aktualisiert werden. Prüfe das Ergebnis vor einem erneuten Versuch.";
|
|
101
|
+
readonly open: "Offener Beitritt";
|
|
102
|
+
readonly apply: "Bewerbung erforderlich";
|
|
103
|
+
readonly invite: "Einladung erforderlich";
|
|
104
|
+
readonly level: "Level";
|
|
105
|
+
readonly view: "Gilde ansehen";
|
|
106
|
+
readonly search: "Genauer Gildenname";
|
|
107
|
+
readonly find: "Gilde finden";
|
|
108
|
+
readonly members: "Mitglieder";
|
|
109
|
+
readonly unknown: "Spieler nicht verfügbar";
|
|
110
|
+
readonly role: "Rolle";
|
|
111
|
+
readonly create: "Gilde erstellen";
|
|
112
|
+
readonly createDescription: "Wähle einen Gildennamen, ein Tag mit 3–5 Zeichen und eine Beitrittsregel.";
|
|
113
|
+
readonly name: "Gildenname";
|
|
114
|
+
readonly tag: "Gildentag";
|
|
115
|
+
readonly description: "Beschreibung";
|
|
116
|
+
readonly visibility: "Beitrittsregel";
|
|
117
|
+
readonly close: "Schließen";
|
|
118
|
+
readonly log: "Gildenaktivität";
|
|
119
|
+
readonly logEmpty: "Keine Aktivität verfügbar.";
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export declare const GuildLog: ({ entries, identities, labels, locale }: {
|
|
124
|
+
readonly entries: ReadonlyArray<GuildLogEntry>;
|
|
125
|
+
readonly identities: ReadonlyArray<GuildIdentity>;
|
|
126
|
+
readonly labels?: GuildLabels;
|
|
127
|
+
readonly locale?: string;
|
|
128
|
+
}) => ReactNode;
|
|
129
|
+
|
|
130
|
+
declare type GuildLogEntry = typeof GuildLogSchema.Type;
|
|
131
|
+
|
|
132
|
+
declare const GuildLogSchema: Schema.Struct<{
|
|
133
|
+
readonly id: Schema.String;
|
|
134
|
+
readonly guildId: Schema.String;
|
|
135
|
+
readonly kind: Schema.String;
|
|
136
|
+
readonly actorId: Schema.NullOr<Schema.String>;
|
|
137
|
+
readonly targetId: Schema.NullOr<Schema.String>;
|
|
138
|
+
readonly detail: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
139
|
+
readonly at: Schema.Number;
|
|
140
|
+
}>;
|
|
141
|
+
|
|
142
|
+
declare type GuildMember = typeof GuildMemberSchema.Type;
|
|
143
|
+
|
|
144
|
+
export declare const GuildMemberList: ({ members, roles, identities, labels, pending, canChangeRole, onRoleChange }: {
|
|
145
|
+
readonly members: ReadonlyArray<GuildMember>;
|
|
146
|
+
readonly roles: ReadonlyArray<GuildRole>;
|
|
147
|
+
readonly identities: ReadonlyArray<GuildIdentity>;
|
|
148
|
+
readonly labels?: GuildLabels;
|
|
149
|
+
readonly pending?: boolean;
|
|
150
|
+
readonly canChangeRole?: (member: GuildMember) => boolean;
|
|
151
|
+
readonly onRoleChange?: (subjectId: string, roleId: string) => void;
|
|
152
|
+
}) => ReactNode;
|
|
153
|
+
|
|
154
|
+
declare const GuildMemberSchema: Schema.Struct<{
|
|
155
|
+
readonly id: Schema.String;
|
|
156
|
+
readonly guildId: Schema.String;
|
|
157
|
+
readonly subjectId: Schema.String;
|
|
158
|
+
readonly roleId: Schema.String;
|
|
159
|
+
readonly joinedAt: Schema.Number;
|
|
160
|
+
readonly contribution: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
161
|
+
readonly lastActiveAt: Schema.Number;
|
|
162
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
163
|
+
}>;
|
|
164
|
+
|
|
165
|
+
declare type GuildRole = typeof GuildRoleSchema.Type;
|
|
166
|
+
|
|
167
|
+
declare const GuildRoleSchema: Schema.Struct<{
|
|
168
|
+
readonly id: Schema.String;
|
|
169
|
+
readonly guildId: Schema.String;
|
|
170
|
+
readonly name: Schema.String;
|
|
171
|
+
readonly rank: Schema.Number;
|
|
172
|
+
readonly permissions: Schema.Number;
|
|
173
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
174
|
+
}>;
|
|
175
|
+
|
|
176
|
+
declare const GuildSchema: Schema.Struct<{
|
|
177
|
+
readonly id: Schema.String;
|
|
178
|
+
readonly name: Schema.String;
|
|
179
|
+
readonly tag: Schema.String;
|
|
180
|
+
readonly description: Schema.String;
|
|
181
|
+
readonly emblem: Schema.NullOr<Schema.String>;
|
|
182
|
+
readonly visibility: Schema.Literals<readonly ["open", "apply", "invite"]>;
|
|
183
|
+
readonly minLevel: Schema.Number;
|
|
184
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
185
|
+
readonly language: Schema.NullOr<Schema.String>;
|
|
186
|
+
readonly level: Schema.Number;
|
|
187
|
+
readonly xp: Schema.Number;
|
|
188
|
+
readonly memberCap: Schema.Number;
|
|
189
|
+
readonly createdAt: Schema.Number;
|
|
190
|
+
readonly ownerId: Schema.NullOr<Schema.String>;
|
|
191
|
+
readonly version: Schema.Number;
|
|
192
|
+
readonly metadata: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
193
|
+
}>;
|
|
194
|
+
|
|
195
|
+
declare type GuildSummary = typeof GuildSummarySchema.Type;
|
|
196
|
+
|
|
197
|
+
declare const GuildSummarySchema: Schema.Struct<{
|
|
198
|
+
readonly id: Schema.String;
|
|
199
|
+
readonly name: Schema.String;
|
|
200
|
+
readonly tag: Schema.String;
|
|
201
|
+
readonly description: Schema.String;
|
|
202
|
+
readonly emblem: Schema.NullOr<Schema.String>;
|
|
203
|
+
readonly visibility: Schema.Literals<readonly ["open", "apply", "invite"]>;
|
|
204
|
+
readonly minLevel: Schema.Number;
|
|
205
|
+
readonly region: Schema.NullOr<Schema.String>;
|
|
206
|
+
readonly language: Schema.NullOr<Schema.String>;
|
|
207
|
+
readonly level: Schema.Number;
|
|
208
|
+
readonly xp: Schema.Number;
|
|
209
|
+
readonly memberCap: Schema.Number;
|
|
210
|
+
readonly createdAt: Schema.Number;
|
|
211
|
+
readonly version: Schema.Number;
|
|
212
|
+
}>;
|
|
213
|
+
|
|
214
|
+
export declare const useGuild: (guildId: string, apiName?: string) => SubscriptionState<{
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly name: string;
|
|
217
|
+
readonly tag: string;
|
|
218
|
+
readonly description: string;
|
|
219
|
+
readonly emblem: string | null;
|
|
220
|
+
readonly visibility: "open" | "apply" | "invite";
|
|
221
|
+
readonly minLevel: number;
|
|
222
|
+
readonly region: string | null;
|
|
223
|
+
readonly language: string | null;
|
|
224
|
+
readonly level: number;
|
|
225
|
+
readonly xp: number;
|
|
226
|
+
readonly memberCap: number;
|
|
227
|
+
readonly createdAt: number;
|
|
228
|
+
readonly ownerId: string | null;
|
|
229
|
+
readonly version: number;
|
|
230
|
+
readonly metadata: {
|
|
231
|
+
readonly [x: string]: unknown;
|
|
232
|
+
};
|
|
233
|
+
}>;
|
|
234
|
+
|
|
235
|
+
export declare const useGuildAnnouncements: (guildId: string, apiName?: string) => SubscriptionState<readonly {
|
|
236
|
+
readonly id: string;
|
|
237
|
+
readonly guildId: string;
|
|
238
|
+
readonly authorId: string | null;
|
|
239
|
+
readonly body: string;
|
|
240
|
+
readonly pinned: boolean;
|
|
241
|
+
readonly createdAt: number;
|
|
242
|
+
readonly metadata: {
|
|
243
|
+
readonly [x: string]: unknown;
|
|
244
|
+
};
|
|
245
|
+
}[]>;
|
|
246
|
+
|
|
247
|
+
export declare const useGuildApplications: (guildId: string, apiName?: string) => SubscriptionState<readonly {
|
|
248
|
+
readonly id: string;
|
|
249
|
+
readonly guildId: string;
|
|
250
|
+
readonly subjectId: string;
|
|
251
|
+
readonly message: string;
|
|
252
|
+
readonly state: "pending" | "accepted" | "withdrawn" | "declined";
|
|
253
|
+
readonly decidedBy: string | null;
|
|
254
|
+
readonly decidedAt: number | null;
|
|
255
|
+
readonly createdAt: number;
|
|
256
|
+
readonly metadata: {
|
|
257
|
+
readonly [x: string]: unknown;
|
|
258
|
+
};
|
|
259
|
+
}[]>;
|
|
260
|
+
|
|
261
|
+
export declare const useGuildCreate: (apiName?: string) => ActionState<CreateGuildInput, unknown>;
|
|
262
|
+
|
|
263
|
+
export declare const useGuildInvites: (apiName?: string) => SubscriptionState<readonly {
|
|
264
|
+
readonly id: string;
|
|
265
|
+
readonly guildId: string;
|
|
266
|
+
readonly toId: string;
|
|
267
|
+
readonly fromId: string;
|
|
268
|
+
readonly expiresAt: number;
|
|
269
|
+
readonly state: "pending" | "cancelled" | "accepted" | "declined";
|
|
270
|
+
readonly createdAt: number;
|
|
271
|
+
readonly metadata: {
|
|
272
|
+
readonly [x: string]: unknown;
|
|
273
|
+
};
|
|
274
|
+
}[]>;
|
|
275
|
+
|
|
276
|
+
export declare const useGuildJoin: (apiName?: string) => ActionState<{
|
|
277
|
+
guildId: string;
|
|
278
|
+
}, unknown>;
|
|
279
|
+
|
|
280
|
+
export declare const useGuildLeave: (apiName?: string) => ActionState<{
|
|
281
|
+
guildId: string;
|
|
282
|
+
}, unknown>;
|
|
283
|
+
|
|
284
|
+
export declare const useGuildList: (apiName?: string) => SubscriptionState<readonly {
|
|
285
|
+
readonly id: string;
|
|
286
|
+
readonly name: string;
|
|
287
|
+
readonly tag: string;
|
|
288
|
+
readonly description: string;
|
|
289
|
+
readonly emblem: string | null;
|
|
290
|
+
readonly visibility: "open" | "apply" | "invite";
|
|
291
|
+
readonly minLevel: number;
|
|
292
|
+
readonly region: string | null;
|
|
293
|
+
readonly language: string | null;
|
|
294
|
+
readonly level: number;
|
|
295
|
+
readonly xp: number;
|
|
296
|
+
readonly memberCap: number;
|
|
297
|
+
readonly createdAt: number;
|
|
298
|
+
readonly ownerId: string | null;
|
|
299
|
+
readonly version: number;
|
|
300
|
+
readonly metadata: {
|
|
301
|
+
readonly [x: string]: unknown;
|
|
302
|
+
};
|
|
303
|
+
}[]>;
|
|
304
|
+
|
|
305
|
+
export declare const useGuildLog: (guildId: string, apiName?: string) => SubscriptionState<readonly {
|
|
306
|
+
readonly id: string;
|
|
307
|
+
readonly guildId: string;
|
|
308
|
+
readonly kind: string;
|
|
309
|
+
readonly actorId: string | null;
|
|
310
|
+
readonly targetId: string | null;
|
|
311
|
+
readonly detail: {
|
|
312
|
+
readonly [x: string]: unknown;
|
|
313
|
+
};
|
|
314
|
+
readonly at: number;
|
|
315
|
+
}[]>;
|
|
316
|
+
|
|
317
|
+
export declare const useGuildMembers: (guildId: string, apiName?: string) => SubscriptionState<readonly {
|
|
318
|
+
readonly id: string;
|
|
319
|
+
readonly guildId: string;
|
|
320
|
+
readonly subjectId: string;
|
|
321
|
+
readonly roleId: string;
|
|
322
|
+
readonly joinedAt: number;
|
|
323
|
+
readonly contribution: {
|
|
324
|
+
readonly [x: string]: unknown;
|
|
325
|
+
};
|
|
326
|
+
readonly lastActiveAt: number;
|
|
327
|
+
readonly metadata: {
|
|
328
|
+
readonly [x: string]: unknown;
|
|
329
|
+
};
|
|
330
|
+
}[]>;
|
|
331
|
+
|
|
332
|
+
export declare const useGuildRoles: (guildId: string, apiName?: string) => SubscriptionState<readonly {
|
|
333
|
+
readonly id: string;
|
|
334
|
+
readonly guildId: string;
|
|
335
|
+
readonly name: string;
|
|
336
|
+
readonly rank: number;
|
|
337
|
+
readonly permissions: number;
|
|
338
|
+
readonly metadata: {
|
|
339
|
+
readonly [x: string]: unknown;
|
|
340
|
+
};
|
|
341
|
+
}[]>;
|
|
342
|
+
|
|
343
|
+
export declare const useGuildSearch: (filters?: {
|
|
344
|
+
name?: string;
|
|
345
|
+
tag?: string;
|
|
346
|
+
region?: string;
|
|
347
|
+
language?: string;
|
|
348
|
+
}, apiName?: string) => SubscriptionState<readonly {
|
|
349
|
+
readonly id: string;
|
|
350
|
+
readonly name: string;
|
|
351
|
+
readonly tag: string;
|
|
352
|
+
readonly description: string;
|
|
353
|
+
readonly emblem: string | null;
|
|
354
|
+
readonly visibility: "open" | "apply" | "invite";
|
|
355
|
+
readonly minLevel: number;
|
|
356
|
+
readonly region: string | null;
|
|
357
|
+
readonly language: string | null;
|
|
358
|
+
readonly level: number;
|
|
359
|
+
readonly xp: number;
|
|
360
|
+
readonly memberCap: number;
|
|
361
|
+
readonly createdAt: number;
|
|
362
|
+
readonly version: number;
|
|
363
|
+
}[]>;
|
|
364
|
+
|
|
365
|
+
export { }
|