feat(core): add shared constants, interaction components and Gitea client helpers
Moderation, tickets, polls and Gitea events reuse the same labels, colours and buttons; normalising list responses in the client keeps both commands and webhooks free of version quirks.
This commit is contained in:
4 files changed
+77
-6
No files matched your search
@@ -20,6 +20,16 @@ export const ACCESS_LEVELS = Object.freeze({
|
||||
OWNER: 3,
|
||||
});
|
||||
|
||||
/** Moderation actions: Discord label, embed color and stored duration (M8). */
|
||||
export const MODERATION_ACTIONS = Object.freeze({
|
||||
warn: { label: 'Avertissement', color: COLORS.warning, duration: false },
|
||||
mute: { label: 'Exclusion temporaire', color: COLORS.moderation, duration: true },
|
||||
kick: { label: 'Expulsion', color: COLORS.moderation, duration: false },
|
||||
ban: { label: 'Bannissement', color: COLORS.error, duration: false },
|
||||
clear: { label: 'Suppression de messages', color: COLORS.warning, duration: false },
|
||||
role: { label: 'Modification de rôle', color: COLORS.primary, duration: false },
|
||||
});
|
||||
|
||||
/** Ticket categories and who can see them (M0-T05 / M6-T01). */
|
||||
export const TICKET_CATEGORIES = Object.freeze([
|
||||
{ id: 'support', label: 'Support utilisateur', scope: ['staff', 'owner'] },
|
||||
@@ -29,6 +39,16 @@ export const TICKET_CATEGORIES = Object.freeze([
|
||||
{ id: 'internal', label: 'Demande interne', scope: ['owner'] },
|
||||
]);
|
||||
|
||||
/** Gitea webhook event -> notification type (M9-T03). */
|
||||
export const GITEA_EVENT_TYPES = Object.freeze({
|
||||
issues: 'issues',
|
||||
pull_request: 'pull_request',
|
||||
push: 'push',
|
||||
create: 'push',
|
||||
delete: 'push',
|
||||
release: 'release',
|
||||
});
|
||||
|
||||
export const NOTIFICATION_TYPES = Object.freeze([
|
||||
'issues',
|
||||
'pull_requests',
|
||||
|
||||
Reference in new issue
Block a user