@notidotbot/noti-api-client 1.9.116 → 1.9.118
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/classes/@me.d.ts +81 -0
- package/dist/classes/@me.js +37 -0
- package/dist/classes/admin.d.ts +66 -0
- package/dist/classes/admin.js +32 -1
- package/dist/classes/client.d.ts +2 -2
- package/dist/classes/feedback.d.ts +7 -2
- package/dist/classes/feedback.js +1 -0
- package/dist/classes/guild.d.ts +14 -0
- package/dist/classes/guild.js +11 -0
- package/dist/classes/guildClipForward.d.ts +18 -18
- package/dist/classes/guildEmojis.d.ts +28 -34
- package/dist/classes/guildEmojis.js +11 -10
- package/dist/classes/guildRolePanel.d.ts +14 -14
- package/dist/classes/guildStarboard.d.ts +1 -1
- package/dist/other/bitfields.d.ts +11 -2
- package/dist/other/bitfields.js +6 -0
- package/dist/other/features.d.ts +1 -1
- package/dist/other/features.js +1 -0
- package/dist/other/types.d.ts +2 -0
- package/dist/other/zod/gameConfig.zod.d.ts +9 -9
- package/dist/other/zod/guild.zod.d.ts +29 -0
- package/dist/other/zod/guild.zod.js +15 -0
- package/dist/other/zod/rolePanels.zod.d.ts +2 -2
- package/dist/other/zod/rumbleStreamer.zod.d.ts +1 -1
- package/dist/other/zod/scheduledMessage.zod.d.ts +4 -4
- package/dist/other/zod/schema.zod.d.ts +6 -6
- package/dist/other/zod/user.zod.d.ts +5 -3
- package/dist/other/zod/user.zod.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/prisma/generated/ts-prisma.d.ts +43 -0
- package/prisma/schema/models/guild.prisma +22 -0
- package/prisma/schema/models/kickBadge.prisma +24 -0
- package/prisma/schema/models/user.prisma +5 -0
package/dist/classes/@me.d.ts
CHANGED
|
@@ -37,6 +37,30 @@ export declare class APIMe {
|
|
|
37
37
|
}>>;
|
|
38
38
|
/** Unlink in one server. 404 when nothing is linked there. */
|
|
39
39
|
unlinkMinecraft({ auth, guildId }: MeFunctionsInput['unlinkMinecraft']): Promise<import("../types").WebResponse<string>>;
|
|
40
|
+
/**
|
|
41
|
+
* Kick badge sync link page (noti.bot/link/kick/<guildId>): the server, whether this user is a member, their linked
|
|
42
|
+
* Kick account, the creators and the badge roles they give, and - when the server's join door is open (Premium
|
|
43
|
+
* Plus) and the user is NOT a member - which badges let them in plus Discord's Authorize link (`authorizeUrl`, null
|
|
44
|
+
* until Kick is linked). 404 `unknown_guild`, 403 `not_available`, 503 `guild_unavailable`.
|
|
45
|
+
*/
|
|
46
|
+
getKickGuildLink({ auth, guildId }: MeFunctionsInput['getKickGuildLink']): Promise<import("../types").WebResponse<KickGuildLink>>;
|
|
47
|
+
/**
|
|
48
|
+
* Sync my Kick badge roles in this server - the same as /sync. Errors (`error.code`): 403 `vote_required` (same
|
|
49
|
+
* shape as the other vote gates; Premium Plus skips it), 429 `daily_limit` (`error.retryAt`, `error.premiumUrl` -
|
|
50
|
+
* free servers sync once a day), 409 `kick_not_linked` / `bot_missing_permissions`, 403 `not_member`, 404
|
|
51
|
+
* `no_creators`, 503 `guild_unavailable`.
|
|
52
|
+
*/
|
|
53
|
+
syncKickGuildRoles({ auth, guildId }: MeFunctionsInput['syncKickGuildRoles']): Promise<import("../types").WebResponse<KickBadgeSyncResult>>;
|
|
54
|
+
/**
|
|
55
|
+
* The join door: Discord's Authorize screen (from `getKickGuildLink().join.authorizeUrl`) sent the user back with
|
|
56
|
+
* `code` and `state` - pass both as they arrived. Noti checks their badge on the server's chosen creator, adds them,
|
|
57
|
+
* and gives their roles. Errors: 400 `invalid_state` / `discord_refused` / `join_not_allowed` (they unticked "Join
|
|
58
|
+
* servers"), 403 `wrong_account` / `join_closed` / `badge_required` (`error.streamer`, `error.badges`), 409
|
|
59
|
+
* `already_member` / `kick_not_linked` / `running`, 502 `join_failed`, 503 `kick_unavailable` / `join_unavailable`.
|
|
60
|
+
*/
|
|
61
|
+
joinKickGuild({ auth, guildId, code, state }: MeFunctionsInput['joinKickGuild']): Promise<import("../types").WebResponse<KickBadgeSyncResult & {
|
|
62
|
+
joined: true;
|
|
63
|
+
}>>;
|
|
40
64
|
/**
|
|
41
65
|
* The one server upgrade that comes with User Premium: where it currently sits, and whether it can
|
|
42
66
|
* be moved yet. Everything the dashboard needs is inside `data` - a field beside it would exist at
|
|
@@ -163,6 +187,20 @@ export type MeFunctionsInput<T extends GuildDataType = never> = {
|
|
|
163
187
|
'confirmMinecraftAuthorization': {
|
|
164
188
|
pendingId: string;
|
|
165
189
|
};
|
|
190
|
+
'getKickGuildLink': {
|
|
191
|
+
auth: string;
|
|
192
|
+
guildId: string;
|
|
193
|
+
};
|
|
194
|
+
'syncKickGuildRoles': {
|
|
195
|
+
auth: string;
|
|
196
|
+
guildId: string;
|
|
197
|
+
};
|
|
198
|
+
'joinKickGuild': {
|
|
199
|
+
auth: string;
|
|
200
|
+
guildId: string;
|
|
201
|
+
code: string;
|
|
202
|
+
state: string;
|
|
203
|
+
};
|
|
166
204
|
};
|
|
167
205
|
export type MeGetReturnTypes = {
|
|
168
206
|
'getCurrentUserRaw': Awaited<ReturnType<APIMe['getCurrentUser']>>;
|
|
@@ -207,6 +245,49 @@ export type MeGetReturnTypes = {
|
|
|
207
245
|
'createMinecraftAuthorizationSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['createMinecraftAuthorization']>>>;
|
|
208
246
|
'confirmMinecraftAuthorizationRaw': Awaited<ReturnType<APIMe['confirmMinecraftAuthorization']>>;
|
|
209
247
|
'confirmMinecraftAuthorizationSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['confirmMinecraftAuthorization']>>>;
|
|
248
|
+
'getKickGuildLinkRaw': Awaited<ReturnType<APIMe['getKickGuildLink']>>;
|
|
249
|
+
'getKickGuildLinkSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['getKickGuildLink']>>>;
|
|
250
|
+
'syncKickGuildRolesRaw': Awaited<ReturnType<APIMe['syncKickGuildRoles']>>;
|
|
251
|
+
'syncKickGuildRolesSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['syncKickGuildRoles']>>>;
|
|
252
|
+
'joinKickGuildRaw': Awaited<ReturnType<APIMe['joinKickGuild']>>;
|
|
253
|
+
'joinKickGuildSuccess': CancelOutWebResponses<Awaited<ReturnType<APIMe['joinKickGuild']>>>;
|
|
254
|
+
};
|
|
255
|
+
export type KickBadgeName = 'subscriber' | 'vip' | 'og' | 'founder' | 'moderator' | 'verified' | 'sub_gifter';
|
|
256
|
+
/** The Kick badge sync link page for one server (`getKickGuildLink`). */
|
|
257
|
+
export type KickGuildLink = {
|
|
258
|
+
guild: {
|
|
259
|
+
id: string;
|
|
260
|
+
name: string;
|
|
261
|
+
icon: string | null;
|
|
262
|
+
};
|
|
263
|
+
isMember: boolean;
|
|
264
|
+
kickAccount: {
|
|
265
|
+
username: string;
|
|
266
|
+
} | null;
|
|
267
|
+
/** Premium: roles update themselves (instant sub role, rechecks, grace). */
|
|
268
|
+
autoSync: boolean;
|
|
269
|
+
creators: {
|
|
270
|
+
streamer: string;
|
|
271
|
+
roles: {
|
|
272
|
+
badge: Exclude<KickBadgeName, 'sub_gifter'>;
|
|
273
|
+
roleName: string | null;
|
|
274
|
+
}[];
|
|
275
|
+
}[];
|
|
276
|
+
/** The join door, only for a non-member while it is open. */
|
|
277
|
+
join: {
|
|
278
|
+
streamer: string;
|
|
279
|
+
badges: KickBadgeName[];
|
|
280
|
+
authorizeUrl: string | null;
|
|
281
|
+
} | null;
|
|
282
|
+
};
|
|
283
|
+
/** One sync: role ids added / removed, and roles Noti could not touch (`error`: missing_role, managed, position, unknown). */
|
|
284
|
+
export type KickBadgeSyncResult = {
|
|
285
|
+
added: string[];
|
|
286
|
+
removed: string[];
|
|
287
|
+
errors: {
|
|
288
|
+
roleId: string;
|
|
289
|
+
error: 'missing_role' | 'managed' | 'position' | 'unknown';
|
|
290
|
+
}[];
|
|
210
291
|
};
|
|
211
292
|
/** What `connectMinecraft` linked. `bedrock`: a Bedrock player through Geyser/Floodgate. */
|
|
212
293
|
export type MinecraftLinkResult = {
|
package/dist/classes/@me.js
CHANGED
|
@@ -103,6 +103,43 @@ class APIMe {
|
|
|
103
103
|
endpoint: this.web.qp('/@me/connect/minecraft/' + guildId),
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Kick badge sync link page (noti.bot/link/kick/<guildId>): the server, whether this user is a member, their linked
|
|
108
|
+
* Kick account, the creators and the badge roles they give, and - when the server's join door is open (Premium
|
|
109
|
+
* Plus) and the user is NOT a member - which badges let them in plus Discord's Authorize link (`authorizeUrl`, null
|
|
110
|
+
* until Kick is linked). 404 `unknown_guild`, 403 `not_available`, 503 `guild_unavailable`.
|
|
111
|
+
*/
|
|
112
|
+
async getKickGuildLink({ auth, guildId }) {
|
|
113
|
+
return await this.web.request({
|
|
114
|
+
method: 'GET', auth,
|
|
115
|
+
endpoint: this.web.qp('/@me/connect/kick/guilds/' + guildId),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sync my Kick badge roles in this server - the same as /sync. Errors (`error.code`): 403 `vote_required` (same
|
|
120
|
+
* shape as the other vote gates; Premium Plus skips it), 429 `daily_limit` (`error.retryAt`, `error.premiumUrl` -
|
|
121
|
+
* free servers sync once a day), 409 `kick_not_linked` / `bot_missing_permissions`, 403 `not_member`, 404
|
|
122
|
+
* `no_creators`, 503 `guild_unavailable`.
|
|
123
|
+
*/
|
|
124
|
+
async syncKickGuildRoles({ auth, guildId }) {
|
|
125
|
+
return await this.web.request({
|
|
126
|
+
method: 'POST', auth,
|
|
127
|
+
endpoint: this.web.qp('/@me/connect/kick/guilds/' + guildId + '/sync'),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The join door: Discord's Authorize screen (from `getKickGuildLink().join.authorizeUrl`) sent the user back with
|
|
132
|
+
* `code` and `state` - pass both as they arrived. Noti checks their badge on the server's chosen creator, adds them,
|
|
133
|
+
* and gives their roles. Errors: 400 `invalid_state` / `discord_refused` / `join_not_allowed` (they unticked "Join
|
|
134
|
+
* servers"), 403 `wrong_account` / `join_closed` / `badge_required` (`error.streamer`, `error.badges`), 409
|
|
135
|
+
* `already_member` / `kick_not_linked` / `running`, 502 `join_failed`, 503 `kick_unavailable` / `join_unavailable`.
|
|
136
|
+
*/
|
|
137
|
+
async joinKickGuild({ auth, guildId, code, state }) {
|
|
138
|
+
return await this.web.request({
|
|
139
|
+
method: 'POST', auth, body: { code, state },
|
|
140
|
+
endpoint: this.web.qp('/@me/connect/kick/guilds/' + guildId + '/join'),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
106
143
|
/**
|
|
107
144
|
* The one server upgrade that comes with User Premium: where it currently sits, and whether it can
|
|
108
145
|
* be moved yet. Everything the dashboard needs is inside `data` - a field beside it would exist at
|
package/dist/classes/admin.d.ts
CHANGED
|
@@ -33,6 +33,24 @@ export declare class APIAdmin {
|
|
|
33
33
|
setDropsSettings({ auth, global, kick, twitch }: AdminFunctionsInput['setDropsSettings']): Promise<import("../types").WebResponse<DropsSettingsResult>>;
|
|
34
34
|
getBadges({ auth }: AdminFunctionsInput['getBadges']): Promise<import("../types").WebResponse<AdminBadgesResult>>;
|
|
35
35
|
getGuildVods({ auth, guildId, page, limit, creator, enrich }: AdminFunctionsInput['getGuildVods']): Promise<import("../types").WebResponse<GuildVodsResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Running Tester / Partner plans (same as /utils status given). `plan` filters to one. Developers only (403).
|
|
38
|
+
* Each row: server, plan, who it is for (`userId`), who gave it, since when, and the server's live add-ons.
|
|
39
|
+
*/
|
|
40
|
+
getStaffPlans({ auth, plan }: AdminFunctionsInput['getStaffPlans']): Promise<import("../types").WebResponse<StaffPlansResponse>>;
|
|
41
|
+
/**
|
|
42
|
+
* Give someone Tester or Partner on 1-25 servers. Branding is forced on; `addons` (Partner only) sets extra slots,
|
|
43
|
+
* e.g. `{ KickConnections: 5, Starboards: 2 }` - names from `getStaffPlans().addonNames`. A server that pays comes
|
|
44
|
+
* back `ok: false, reason: 'pays'` and is left alone. 400 `invalid_body` / `invalid_addons`, 403 `not_developer`.
|
|
45
|
+
*/
|
|
46
|
+
createStaffPlans({ auth, ...body }: AdminFunctionsInput['createStaffPlans']): Promise<import("../types").WebResponse<{
|
|
47
|
+
results: StaffPlanGiveResult[];
|
|
48
|
+
}>>;
|
|
49
|
+
/** End a server's Tester / Partner plan: back to free, add-ons cleared. 404 `not_found`, 409 `pays`. */
|
|
50
|
+
deleteStaffPlan({ auth, guildId }: AdminFunctionsInput['deleteStaffPlan']): Promise<import("../types").WebResponse<{
|
|
51
|
+
guildId: string;
|
|
52
|
+
revoked: true;
|
|
53
|
+
}>>;
|
|
36
54
|
getGuildDropsAudit({ auth, guildId, platform }: AdminFunctionsInput['getGuildDropsAudit']): Promise<import("../types").WebResponse<GuildDropsAuditResponse>>;
|
|
37
55
|
getPubSubHealth({ auth, platform, channel, all }: AdminFunctionsInput['getPubSubHealth']): Promise<import("../types").WebResponse<PubSubHealthResponse>>;
|
|
38
56
|
getCooldowns({ auth, streamer, guildId, platform, page, limit }: AdminFunctionsInput['getCooldowns']): Promise<import("../types").WebResponse<CooldownsResponse>>;
|
|
@@ -166,6 +184,21 @@ export type AdminFunctionsInput = {
|
|
|
166
184
|
guildId: string;
|
|
167
185
|
platform?: DropPlatform;
|
|
168
186
|
};
|
|
187
|
+
'getStaffPlans': {
|
|
188
|
+
auth: string;
|
|
189
|
+
plan?: StaffPlanKind;
|
|
190
|
+
};
|
|
191
|
+
'createStaffPlans': {
|
|
192
|
+
auth: string;
|
|
193
|
+
plan: StaffPlanKind;
|
|
194
|
+
userId: string;
|
|
195
|
+
guildIds: string[];
|
|
196
|
+
addons?: Partial<Record<StaffPlanAddon, number>>;
|
|
197
|
+
};
|
|
198
|
+
'deleteStaffPlan': {
|
|
199
|
+
auth: string;
|
|
200
|
+
guildId: string;
|
|
201
|
+
};
|
|
169
202
|
'getPubSubHealth': {
|
|
170
203
|
auth: string;
|
|
171
204
|
platform: 'youtube';
|
|
@@ -245,6 +278,12 @@ export type AdminGetReturnTypes = {
|
|
|
245
278
|
'getGuildVodsSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getGuildVods']>>>;
|
|
246
279
|
'getGuildDropsAuditRaw': Awaited<ReturnType<APIAdmin['getGuildDropsAudit']>>;
|
|
247
280
|
'getGuildDropsAuditSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getGuildDropsAudit']>>>;
|
|
281
|
+
'getStaffPlansRaw': Awaited<ReturnType<APIAdmin['getStaffPlans']>>;
|
|
282
|
+
'getStaffPlansSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getStaffPlans']>>>;
|
|
283
|
+
'createStaffPlansRaw': Awaited<ReturnType<APIAdmin['createStaffPlans']>>;
|
|
284
|
+
'createStaffPlansSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['createStaffPlans']>>>;
|
|
285
|
+
'deleteStaffPlanRaw': Awaited<ReturnType<APIAdmin['deleteStaffPlan']>>;
|
|
286
|
+
'deleteStaffPlanSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['deleteStaffPlan']>>>;
|
|
248
287
|
'getPubSubHealthRaw': Awaited<ReturnType<APIAdmin['getPubSubHealth']>>;
|
|
249
288
|
'getPubSubHealthSuccess': CancelOutWebResponses<Awaited<ReturnType<APIAdmin['getPubSubHealth']>>>;
|
|
250
289
|
'getCooldownsRaw': Awaited<ReturnType<APIAdmin['getCooldowns']>>;
|
|
@@ -627,3 +666,30 @@ export type InGameAdminSettings = {
|
|
|
627
666
|
guildId: string | null;
|
|
628
667
|
};
|
|
629
668
|
};
|
|
669
|
+
/** Tester / Partner plans (Noti-v3 modules/premium/staffPlans.ts). */
|
|
670
|
+
export type StaffPlanKind = 'tester' | 'partner';
|
|
671
|
+
/** Mirrors PARTNER_ADDONS in Noti-v3 modules/premium/staffPlans.ts. */
|
|
672
|
+
export declare const STAFF_PLAN_ADDONS: readonly ["StickyMessages", "AutoLiveRoles", "LinkedRoles", "StatusRoles", "Starboards", "Overrides", "KickConnections", "ClipperConnections", "RumbleConnections", "TwitchConnections", "YoutubeConnections", "TiktokConnections", "WhatnotConnections", "ClubConnections", "TwitterConnections", "KickClips", "TwitchClips", "StatCounters"];
|
|
673
|
+
export type StaffPlanAddon = (typeof STAFF_PLAN_ADDONS)[number];
|
|
674
|
+
export type StaffPlanRow = {
|
|
675
|
+
guildId: string;
|
|
676
|
+
plan: StaffPlanKind;
|
|
677
|
+
userId: string | null;
|
|
678
|
+
grantedBy: string | null;
|
|
679
|
+
since: string;
|
|
680
|
+
addons: Partial<Record<StaffPlanAddon, number>>;
|
|
681
|
+
};
|
|
682
|
+
export type StaffPlansResponse = {
|
|
683
|
+
plans: StaffPlanRow[];
|
|
684
|
+
addonNames: StaffPlanAddon[];
|
|
685
|
+
};
|
|
686
|
+
export type StaffPlanGiveResult = {
|
|
687
|
+
guildId: string;
|
|
688
|
+
ok: true;
|
|
689
|
+
brandingForced: boolean;
|
|
690
|
+
replaced: string | null;
|
|
691
|
+
} | {
|
|
692
|
+
guildId: string;
|
|
693
|
+
ok: false;
|
|
694
|
+
reason: 'no_guild_row' | 'pays';
|
|
695
|
+
};
|
package/dist/classes/admin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APIAdmin = void 0;
|
|
3
|
+
exports.STAFF_PLAN_ADDONS = exports.APIAdmin = void 0;
|
|
4
4
|
// Data.
|
|
5
5
|
class APIAdmin {
|
|
6
6
|
web;
|
|
@@ -168,6 +168,35 @@ class APIAdmin {
|
|
|
168
168
|
endpoint: this.web.qp(`/admin/guilds/${guildId}/vods`, { page, limit, creator, enrich }),
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Running Tester / Partner plans (same as /utils status given). `plan` filters to one. Developers only (403).
|
|
173
|
+
* Each row: server, plan, who it is for (`userId`), who gave it, since when, and the server's live add-ons.
|
|
174
|
+
*/
|
|
175
|
+
async getStaffPlans({ auth, plan }) {
|
|
176
|
+
return await this.web.request({
|
|
177
|
+
method: 'GET', auth,
|
|
178
|
+
endpoint: this.web.qp('/admin/staff-plans', { plan }),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Give someone Tester or Partner on 1-25 servers. Branding is forced on; `addons` (Partner only) sets extra slots,
|
|
183
|
+
* e.g. `{ KickConnections: 5, Starboards: 2 }` - names from `getStaffPlans().addonNames`. A server that pays comes
|
|
184
|
+
* back `ok: false, reason: 'pays'` and is left alone. 400 `invalid_body` / `invalid_addons`, 403 `not_developer`.
|
|
185
|
+
*/
|
|
186
|
+
async createStaffPlans({ auth, ...body }) {
|
|
187
|
+
return await this.web.request({
|
|
188
|
+
method: 'POST', auth,
|
|
189
|
+
endpoint: this.web.qp('/admin/staff-plans'),
|
|
190
|
+
body,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** End a server's Tester / Partner plan: back to free, add-ons cleared. 404 `not_found`, 409 `pays`. */
|
|
194
|
+
async deleteStaffPlan({ auth, guildId }) {
|
|
195
|
+
return await this.web.request({
|
|
196
|
+
method: 'DELETE', auth,
|
|
197
|
+
endpoint: this.web.qp(`/admin/staff-plans/${guildId}`),
|
|
198
|
+
});
|
|
199
|
+
}
|
|
171
200
|
async getGuildDropsAudit({ auth, guildId, platform }) {
|
|
172
201
|
return await this.web.request({
|
|
173
202
|
method: 'GET', auth,
|
|
@@ -200,3 +229,5 @@ class APIAdmin {
|
|
|
200
229
|
}
|
|
201
230
|
}
|
|
202
231
|
exports.APIAdmin = APIAdmin;
|
|
232
|
+
/** Mirrors PARTNER_ADDONS in Noti-v3 modules/premium/staffPlans.ts. */
|
|
233
|
+
exports.STAFF_PLAN_ADDONS = ['StickyMessages', 'AutoLiveRoles', 'LinkedRoles', 'StatusRoles', 'Starboards', 'Overrides', 'KickConnections', 'ClipperConnections', 'RumbleConnections', 'TwitchConnections', 'YoutubeConnections', 'TiktokConnections', 'WhatnotConnections', 'ClubConnections', 'TwitterConnections', 'KickClips', 'TwitchClips', 'StatCounters'];
|
package/dist/classes/client.d.ts
CHANGED
|
@@ -40,15 +40,15 @@ export declare class APIClient {
|
|
|
40
40
|
content: string;
|
|
41
41
|
thumbnail: string | null;
|
|
42
42
|
authorIcon: string;
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
tags: string[];
|
|
45
43
|
clientId: string;
|
|
46
44
|
identifier: string;
|
|
47
45
|
isPinned: boolean;
|
|
48
46
|
views: number | null;
|
|
49
47
|
reactions: string[];
|
|
50
48
|
reactionsCount: number | null;
|
|
49
|
+
tags: string[];
|
|
51
50
|
authorName: string;
|
|
51
|
+
createdAt: Date;
|
|
52
52
|
lastEdited: Date;
|
|
53
53
|
isPublic: boolean;
|
|
54
54
|
}[]>>;
|
|
@@ -34,6 +34,7 @@ export declare class APIFeedback {
|
|
|
34
34
|
/**
|
|
35
35
|
* The list. `board` / `tag` take a slug or id; `sort` is `top` (default, pinned first inside a board),
|
|
36
36
|
* `new` or `trending` (votes in the last 14 days). `limit` up to 50. Searching logged out is rate limited.
|
|
37
|
+
* `status` takes one or several (sent as `status=open,planned`); the sort and paging run over the whole set.
|
|
37
38
|
*/
|
|
38
39
|
getFeedbackPosts({ auth, ...query }?: FeedbackFunctionsInput['getFeedbackPosts']): Promise<import("../types").WebResponse<FeedbackPostList>>;
|
|
39
40
|
/** Up to 5 visible posts whose titles look like `q` - the "is this already asked?" hint while typing a title. */
|
|
@@ -154,7 +155,7 @@ export type FeedbackFunctionsInput = {
|
|
|
154
155
|
auth?: string;
|
|
155
156
|
board?: string;
|
|
156
157
|
tag?: string;
|
|
157
|
-
status?: FeedbackStatus;
|
|
158
|
+
status?: FeedbackStatus | FeedbackStatus[];
|
|
158
159
|
q?: string;
|
|
159
160
|
sort?: FeedbackSort;
|
|
160
161
|
offset?: number;
|
|
@@ -493,10 +494,14 @@ export type FeedbackVoters = {
|
|
|
493
494
|
total: number;
|
|
494
495
|
};
|
|
495
496
|
export type FeedbackPostList = {
|
|
496
|
-
/**
|
|
497
|
+
/**
|
|
498
|
+
* `commentCount` counts visible comments only (no staff notes, hidden or deleted). `trendingScore` (votes in
|
|
499
|
+
* the last 14 days, what `trending` sorts by) is sent only when `sort` is `trending`.
|
|
500
|
+
*/
|
|
497
501
|
posts: Array<{
|
|
498
502
|
post: FeedbackPost & {
|
|
499
503
|
commentCount: number;
|
|
504
|
+
trendingScore?: number;
|
|
500
505
|
};
|
|
501
506
|
viewer: {
|
|
502
507
|
voted: boolean;
|
package/dist/classes/feedback.js
CHANGED
|
@@ -44,6 +44,7 @@ class APIFeedback {
|
|
|
44
44
|
/**
|
|
45
45
|
* The list. `board` / `tag` take a slug or id; `sort` is `top` (default, pinned first inside a board),
|
|
46
46
|
* `new` or `trending` (votes in the last 14 days). `limit` up to 50. Searching logged out is rate limited.
|
|
47
|
+
* `status` takes one or several (sent as `status=open,planned`); the sort and paging run over the whole set.
|
|
47
48
|
*/
|
|
48
49
|
async getFeedbackPosts({ auth, ...query } = {}) {
|
|
49
50
|
return await this.web.request({
|
package/dist/classes/guild.d.ts
CHANGED
|
@@ -8,6 +8,14 @@ export declare class APIGuild {
|
|
|
8
8
|
constructor(web: WebDataManager);
|
|
9
9
|
getGuild({ auth, guildId }: GuildFunctionsInput['getGuild']): Promise<import("../types").WebResponse<GuildWithStuff>>;
|
|
10
10
|
updateGuild({ auth, guildId, guild }: GuildFunctionsInput['updateGuild']): Promise<import("../types").WebResponse<string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Kick badge sync (Premium): recheck every synced member at the next round. Members whose sub role came from Kick's
|
|
13
|
+
* live event are otherwise not rechecked for 30 days. Once an hour per server. Errors: 403 `not_available` /
|
|
14
|
+
* `premium_required`, 429 `cooldown` (`error.retryAt`). Answers how many members were queued.
|
|
15
|
+
*/
|
|
16
|
+
createKickBadgeRecheck({ auth, guildId }: GuildFunctionsInput['createKickBadgeRecheck']): Promise<import("../types").WebResponse<{
|
|
17
|
+
members: number;
|
|
18
|
+
}>>;
|
|
11
19
|
getCustomBotProfile({ auth, guildId }: GuildFunctionsInput['getCustomBotProfile']): Promise<import("../types").WebResponse<GetCustomBotProfileResponse>>;
|
|
12
20
|
updateCustomBotProfile({ auth, guildId, formData }: GuildFunctionsInput['updateCustomBotProfile']): Promise<import("../types").WebResponse<GetCustomBotProfileResponse>>;
|
|
13
21
|
getGuildErrors({ auth, guildId }: GuildFunctionsInput['getGuildErrors']): Promise<import("../types").WebResponse<GuildErrors>>;
|
|
@@ -45,6 +53,10 @@ export type GuildFunctionsInput<T extends SendPanelType = never, T2 extends Guil
|
|
|
45
53
|
guildId: string;
|
|
46
54
|
guild: DeepPartial<GuildZod>;
|
|
47
55
|
};
|
|
56
|
+
'createKickBadgeRecheck': {
|
|
57
|
+
auth: string;
|
|
58
|
+
guildId: string;
|
|
59
|
+
};
|
|
48
60
|
'getCustomBotProfile': {
|
|
49
61
|
auth: string;
|
|
50
62
|
guildId: string;
|
|
@@ -162,6 +174,8 @@ export type GuildReturnTypes = {
|
|
|
162
174
|
'getGuildRaw': Awaited<ReturnType<APIGuild['getGuild']>>;
|
|
163
175
|
'getGuildSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['getGuild']>>>;
|
|
164
176
|
'updateGuildRaw': Awaited<ReturnType<APIGuild['updateGuild']>>;
|
|
177
|
+
'createKickBadgeRecheckRaw': Awaited<ReturnType<APIGuild['createKickBadgeRecheck']>>;
|
|
178
|
+
'createKickBadgeRecheckSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['createKickBadgeRecheck']>>>;
|
|
165
179
|
'updateGuildSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['updateGuild']>>>;
|
|
166
180
|
'getCustomBotProfileRaw': Awaited<ReturnType<APIGuild['getCustomBotProfile']>>;
|
|
167
181
|
'getCustomBotProfileSuccess': CancelOutWebResponses<Awaited<ReturnType<APIGuild['getCustomBotProfile']>>>;
|
package/dist/classes/guild.js
CHANGED
|
@@ -20,6 +20,17 @@ class APIGuild {
|
|
|
20
20
|
endpoint: this.web.qp('/data/guild/' + guildId),
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Kick badge sync (Premium): recheck every synced member at the next round. Members whose sub role came from Kick's
|
|
25
|
+
* live event are otherwise not rechecked for 30 days. Once an hour per server. Errors: 403 `not_available` /
|
|
26
|
+
* `premium_required`, 429 `cooldown` (`error.retryAt`). Answers how many members were queued.
|
|
27
|
+
*/
|
|
28
|
+
async createKickBadgeRecheck({ auth, guildId }) {
|
|
29
|
+
return await this.web.request({
|
|
30
|
+
method: 'POST', auth,
|
|
31
|
+
endpoint: this.web.qp('/data/guild/' + guildId + '/kick-badges/rechecks'),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
23
34
|
async getCustomBotProfile({ auth, guildId }) {
|
|
24
35
|
return await this.web.request({
|
|
25
36
|
method: 'GET', auth,
|
|
@@ -48,10 +48,8 @@ export declare class APIGuildClipForward {
|
|
|
48
48
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
49
49
|
channelId: string | null;
|
|
50
50
|
streamerUserName: string;
|
|
51
|
-
usePerStreamerEmbeds: boolean | null;
|
|
52
|
-
showNotifyButton: boolean | null;
|
|
53
|
-
pingRoleId: string | null;
|
|
54
51
|
clipForwardId: string;
|
|
52
|
+
pingRoleId: string | null;
|
|
55
53
|
minViews: number | null;
|
|
56
54
|
minDuration: number | null;
|
|
57
55
|
maxPerCycle: number | null;
|
|
@@ -61,6 +59,8 @@ export declare class APIGuildClipForward {
|
|
|
61
59
|
blacklistClippers: string[];
|
|
62
60
|
whitelistCategories: string[];
|
|
63
61
|
blacklistCategories: string[];
|
|
62
|
+
showNotifyButton: boolean | null;
|
|
63
|
+
usePerStreamerEmbeds: boolean | null;
|
|
64
64
|
lastClipAt: Date | null;
|
|
65
65
|
lastClipId: string | null;
|
|
66
66
|
} | null;
|
|
@@ -72,10 +72,8 @@ export declare class APIGuildClipForward {
|
|
|
72
72
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
73
73
|
channelId: string | null;
|
|
74
74
|
streamerUserName: string;
|
|
75
|
-
usePerStreamerEmbeds: boolean | null;
|
|
76
|
-
showNotifyButton: boolean | null;
|
|
77
|
-
pingRoleId: string | null;
|
|
78
75
|
clipForwardId: string;
|
|
76
|
+
pingRoleId: string | null;
|
|
79
77
|
minViews: number | null;
|
|
80
78
|
minDuration: number | null;
|
|
81
79
|
maxPerCycle: number | null;
|
|
@@ -85,6 +83,8 @@ export declare class APIGuildClipForward {
|
|
|
85
83
|
blacklistClippers: string[];
|
|
86
84
|
whitelistCategories: string[];
|
|
87
85
|
blacklistCategories: string[];
|
|
86
|
+
showNotifyButton: boolean | null;
|
|
87
|
+
usePerStreamerEmbeds: boolean | null;
|
|
88
88
|
lastClipAt: Date | null;
|
|
89
89
|
lastClipId: string | null;
|
|
90
90
|
} | null;
|
|
@@ -157,10 +157,8 @@ export declare class APIGuildClipForward {
|
|
|
157
157
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
158
158
|
channelId: string | null;
|
|
159
159
|
streamerUserName: string;
|
|
160
|
-
usePerStreamerEmbeds: boolean | null;
|
|
161
|
-
showNotifyButton: boolean | null;
|
|
162
|
-
pingRoleId: string | null;
|
|
163
160
|
clipForwardId: string;
|
|
161
|
+
pingRoleId: string | null;
|
|
164
162
|
minViews: number | null;
|
|
165
163
|
minDuration: number | null;
|
|
166
164
|
maxPerCycle: number | null;
|
|
@@ -170,6 +168,8 @@ export declare class APIGuildClipForward {
|
|
|
170
168
|
blacklistClippers: string[];
|
|
171
169
|
whitelistCategories: string[];
|
|
172
170
|
blacklistCategories: string[];
|
|
171
|
+
showNotifyButton: boolean | null;
|
|
172
|
+
usePerStreamerEmbeds: boolean | null;
|
|
173
173
|
lastClipAt: Date | null;
|
|
174
174
|
lastClipId: string | null;
|
|
175
175
|
} | null;
|
|
@@ -223,10 +223,8 @@ export declare class APIGuildClipForward {
|
|
|
223
223
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
224
224
|
channelId: string | null;
|
|
225
225
|
streamerUserName: string;
|
|
226
|
-
usePerStreamerEmbeds: boolean | null;
|
|
227
|
-
showNotifyButton: boolean | null;
|
|
228
|
-
pingRoleId: string | null;
|
|
229
226
|
clipForwardId: string;
|
|
227
|
+
pingRoleId: string | null;
|
|
230
228
|
minViews: number | null;
|
|
231
229
|
minDuration: number | null;
|
|
232
230
|
maxPerCycle: number | null;
|
|
@@ -236,6 +234,8 @@ export declare class APIGuildClipForward {
|
|
|
236
234
|
blacklistClippers: string[];
|
|
237
235
|
whitelistCategories: string[];
|
|
238
236
|
blacklistCategories: string[];
|
|
237
|
+
showNotifyButton: boolean | null;
|
|
238
|
+
usePerStreamerEmbeds: boolean | null;
|
|
239
239
|
lastClipAt: Date | null;
|
|
240
240
|
lastClipId: string | null;
|
|
241
241
|
} | null;
|
|
@@ -283,10 +283,8 @@ export declare class APIGuildClipForward {
|
|
|
283
283
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
284
284
|
channelId: string | null;
|
|
285
285
|
streamerUserName: string;
|
|
286
|
-
usePerStreamerEmbeds: boolean | null;
|
|
287
|
-
showNotifyButton: boolean | null;
|
|
288
|
-
pingRoleId: string | null;
|
|
289
286
|
clipForwardId: string;
|
|
287
|
+
pingRoleId: string | null;
|
|
290
288
|
minViews: number | null;
|
|
291
289
|
minDuration: number | null;
|
|
292
290
|
maxPerCycle: number | null;
|
|
@@ -296,6 +294,8 @@ export declare class APIGuildClipForward {
|
|
|
296
294
|
blacklistClippers: string[];
|
|
297
295
|
whitelistCategories: string[];
|
|
298
296
|
blacklistCategories: string[];
|
|
297
|
+
showNotifyButton: boolean | null;
|
|
298
|
+
usePerStreamerEmbeds: boolean | null;
|
|
299
299
|
lastClipAt: Date | null;
|
|
300
300
|
lastClipId: string | null;
|
|
301
301
|
} | null;
|
|
@@ -372,10 +372,8 @@ export declare class APIGuildClipForward {
|
|
|
372
372
|
platform: import("@prisma/client").$Enums.PlatformEnum;
|
|
373
373
|
channelId: string | null;
|
|
374
374
|
streamerUserName: string;
|
|
375
|
-
usePerStreamerEmbeds: boolean | null;
|
|
376
|
-
showNotifyButton: boolean | null;
|
|
377
|
-
pingRoleId: string | null;
|
|
378
375
|
clipForwardId: string;
|
|
376
|
+
pingRoleId: string | null;
|
|
379
377
|
minViews: number | null;
|
|
380
378
|
minDuration: number | null;
|
|
381
379
|
maxPerCycle: number | null;
|
|
@@ -385,6 +383,8 @@ export declare class APIGuildClipForward {
|
|
|
385
383
|
blacklistClippers: string[];
|
|
386
384
|
whitelistCategories: string[];
|
|
387
385
|
blacklistCategories: string[];
|
|
386
|
+
showNotifyButton: boolean | null;
|
|
387
|
+
usePerStreamerEmbeds: boolean | null;
|
|
388
388
|
lastClipAt: Date | null;
|
|
389
389
|
lastClipId: string | null;
|
|
390
390
|
}>>;
|
|
@@ -3,13 +3,15 @@ import { CancelOutWebResponses, WebResponse } from '../types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Reposition Emojis - reorder a server's emojis in Discord's emoji picker.
|
|
5
5
|
*
|
|
6
|
-
* Discord has no reorder API
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Discord has no reorder API, and its picker sorts a server's emojis **by name**: case-sensitive (capitals before
|
|
7
|
+
* lowercase), same names oldest upload first. So Noti renames every emoji with a letter prefix in the new order:
|
|
8
|
+
* `a_wave`, `b_heart`, ... (`aa_`, `ab_`, ... past 26). Ids, images and role locks stay, so old messages still show the
|
|
9
|
+
* emoji; people type the new names, and other bots that look an emoji up by name may need updating. Noti updates its
|
|
10
|
+
* own starboards. A re-run replaces Noti's earlier prefix (`base`) instead of stacking it.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* New name = prefix + `base`, cut to 32 characters. Integration emojis (`managed`) and greyed-out ones
|
|
13
|
+
* (`available: false`) cannot be renamed: they keep their name and stay where it sorts, and their place in `order` is
|
|
14
|
+
* ignored - show them apart, as fixed.
|
|
13
15
|
*
|
|
14
16
|
* Free servers: one reposition per 7 days (`nextFreeAt`). Premium: unlimited (`unlimited`). Starting one needs a top.gg
|
|
15
17
|
* vote (403 `vote_required`, Premium skips it) and Manage Expressions for both the caller and Noti. Behind the
|
|
@@ -18,14 +20,13 @@ import { CancelOutWebResponses, WebResponse } from '../types';
|
|
|
18
20
|
export declare class APIGuildEmojis {
|
|
19
21
|
private web;
|
|
20
22
|
constructor(web: WebDataManager);
|
|
21
|
-
/** The server's emojis in picker order,
|
|
23
|
+
/** The server's emojis in picker order, the weekly cap, permissions, and the current / last job. */
|
|
22
24
|
getGuildEmojis({ auth, guildId }: GuildEmojisFunctionsInput['getGuildEmojis']): Promise<WebResponse<GuildEmojisData>>;
|
|
23
25
|
/**
|
|
24
26
|
* Start a reposition. `order` is EVERY emoji id in the server, in the new order. Runs in the background - poll
|
|
25
|
-
* `getEmojiReposition` for progress (
|
|
27
|
+
* `getEmojiReposition` for progress (about one rename a second).
|
|
26
28
|
*
|
|
27
|
-
* Errors (`error.code`): 400 `invalid_body` / `mismatch` (the list changed - reload) / `noop` / `
|
|
28
|
-
* `unavailable_locked` (`error.ids`) / `over_limit`; 403 `not_available` / `vote_required` / `not_manager` /
|
|
29
|
+
* Errors (`error.code`): 400 `invalid_body` / `mismatch` (the list changed - reload) / `noop`; 403 `not_available` / `vote_required` / `not_manager` /
|
|
29
30
|
* `missing_permissions`; 409 `running`; 429 `weekly_limit` (`error.resetsAt`, `error.premiumUrl`); 503
|
|
30
31
|
* `guild_unavailable`.
|
|
31
32
|
*/
|
|
@@ -41,23 +42,19 @@ export type GuildEmoji = {
|
|
|
41
42
|
id: string;
|
|
42
43
|
name: string;
|
|
43
44
|
animated: boolean;
|
|
44
|
-
/**
|
|
45
|
+
/** The name without the prefix Noti gave it last time - what the new prefix goes in front of. */
|
|
46
|
+
base: string;
|
|
47
|
+
/** Integration (Twitch / YouTube) emoji: cannot be renamed, stays where its name sorts. */
|
|
45
48
|
managed: boolean;
|
|
46
|
-
/** False when greyed out (over the limit after a boost-level drop): cannot be
|
|
49
|
+
/** False when greyed out (over the limit after a boost-level drop): cannot be renamed. */
|
|
47
50
|
available: boolean;
|
|
48
|
-
/** Restricted to roles;
|
|
51
|
+
/** Restricted to roles; a rename keeps the restriction. */
|
|
49
52
|
roleLocked: boolean;
|
|
50
53
|
url: string;
|
|
51
54
|
};
|
|
52
55
|
export type GuildEmojisData = {
|
|
53
|
-
/** Picker order: oldest upload first. */
|
|
56
|
+
/** Picker order: by name, capitals first, same names oldest upload first. */
|
|
54
57
|
emojis: GuildEmoji[];
|
|
55
|
-
/** Static and animated each have `max` slots. */
|
|
56
|
-
limits: {
|
|
57
|
-
static: number;
|
|
58
|
-
animated: number;
|
|
59
|
-
max: number;
|
|
60
|
-
};
|
|
61
58
|
canManage: {
|
|
62
59
|
bot: boolean;
|
|
63
60
|
member: boolean;
|
|
@@ -68,30 +65,27 @@ export type GuildEmojisData = {
|
|
|
68
65
|
nextFreeAt: number | null;
|
|
69
66
|
job: EmojiRepositionJob | null;
|
|
70
67
|
};
|
|
71
|
-
/** One emoji's progress. `skipped` = someone deleted it during the job; `failed` carries `error
|
|
72
|
-
export type EmojiRepositionStep = 'pending' | '
|
|
68
|
+
/** One emoji's progress. `skipped` = someone deleted it during the job; `failed` carries `error` (the emoji keeps its old name). */
|
|
69
|
+
export type EmojiRepositionStep = 'pending' | 'done' | 'failed' | 'skipped';
|
|
73
70
|
export type EmojiRepositionJob = {
|
|
74
71
|
jobId: string;
|
|
75
72
|
guildId: string;
|
|
76
73
|
startedBy: string;
|
|
77
74
|
startedAt: number;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/** Emojis being re-uploaded, in order. `newId` once its copy exists. */
|
|
75
|
+
/** `repointing`: renames finished, Noti's starboards are being updated. `superseded`-failed jobs are from the old re-upload build. */
|
|
76
|
+
status: 'renaming' | 'repointing' | 'done' | 'failed';
|
|
77
|
+
/** The renames, in order. Emojis already carrying their new name are not listed. */
|
|
82
78
|
emojis: Array<{
|
|
83
79
|
id: string;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
from: string;
|
|
81
|
+
to: string;
|
|
82
|
+
prefix: string;
|
|
87
83
|
step: EmojiRepositionStep;
|
|
88
|
-
newId?: string;
|
|
89
|
-
deletedFirst?: boolean;
|
|
90
|
-
backupKey?: string;
|
|
91
84
|
error?: string;
|
|
92
85
|
}>;
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
/** False on a failed job = nothing changed (the free week was given back). */
|
|
87
|
+
renamedAny: boolean;
|
|
88
|
+
/** `guild_unreachable` / `superseded` on a failed job; `repoint_failed` on a done one (renames stand, a starboard may need its emoji re-picked). */
|
|
95
89
|
failure?: string;
|
|
96
90
|
finishedAt?: number;
|
|
97
91
|
};
|