mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
refactor(api): tidy the api and shared packages (#2733)
This commit is contained in:
1 parent
580401d2dc
commit
5afbf67a70
333 files changed
+10180
-7910
No files matched your search
@@ -413,6 +413,8 @@ export const GenerateGiftCodesRequest = z.object({
|
||||
|
||||
export type GenerateGiftCodesRequest = z.infer<typeof GenerateGiftCodesRequest>;
|
||||
|
||||
const SsoAllowedDomainsSchema = z.array(z.string()).max(100);
|
||||
|
||||
const SsoConfigResponse = z.object({
|
||||
enabled: z.boolean(),
|
||||
enforced: z.boolean(),
|
||||
@@ -425,7 +427,7 @@ const SsoConfigResponse = z.object({
|
||||
client_id: z.string().nullable(),
|
||||
client_secret_set: z.boolean(),
|
||||
scope: z.string().nullable(),
|
||||
allowed_domains: z.array(z.string()).max(100),
|
||||
allowed_domains: SsoAllowedDomainsSchema,
|
||||
auto_provision: z.boolean(),
|
||||
redirect_uri: z.string().nullable(),
|
||||
});
|
||||
@@ -448,6 +450,7 @@ const RegistrationUrlResponse = z.object({
|
||||
last_used_at: z.iso.datetime().nullable(),
|
||||
last_used_by_user_id: SnowflakeStringType.nullable(),
|
||||
});
|
||||
export type RegistrationUrlResponse = z.infer<typeof RegistrationUrlResponse>;
|
||||
|
||||
const PendingRegistrationResponse = z.object({
|
||||
user_id: SnowflakeStringType,
|
||||
@@ -459,6 +462,7 @@ const PendingRegistrationResponse = z.object({
|
||||
registration_url_id: createStringType(1, 128).nullable(),
|
||||
client_ip: z.string().nullable(),
|
||||
});
|
||||
export type PendingRegistrationResponse = z.infer<typeof PendingRegistrationResponse>;
|
||||
|
||||
const InstanceRegistrationResponse = InstanceRegistrationConfigResponse.extend({
|
||||
urls: z.array(RegistrationUrlResponse),
|
||||
@@ -636,6 +640,28 @@ export const InstanceConfigResponse = z.object({
|
||||
|
||||
export type InstanceConfigResponse = z.infer<typeof InstanceConfigResponse>;
|
||||
|
||||
const InstancePolicyUpdateSchema = z.object({
|
||||
single_community_enabled: z.boolean().optional(),
|
||||
single_community_name: z.string().trim().min(1).max(100).optional(),
|
||||
direct_messages_disabled: z.boolean().optional(),
|
||||
direct_messages_locked: z.literal(false).optional(),
|
||||
premium_mode: z.enum(['mirror', 'everyone']).optional(),
|
||||
services: z
|
||||
.object({
|
||||
gif_enabled: z.boolean().nullish(),
|
||||
youtube_enabled: z.boolean().nullish(),
|
||||
bluesky_enabled: z.boolean().nullish(),
|
||||
})
|
||||
.nullish(),
|
||||
deferred_phone_gate: z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
window_hours: z.number().positive().max(8760).optional(),
|
||||
member_threshold: z.number().int().positive().max(1_000_000).optional(),
|
||||
})
|
||||
.nullish(),
|
||||
});
|
||||
|
||||
export const InstanceConfigUpdateRequest = z.object({
|
||||
gateway_rollout: GatewayRolloutConfigUpdateRequest.nullish(),
|
||||
voice_noise_suppression: VoiceNoiseSuppressionConfigUpdateRequest.nullish(),
|
||||
@@ -659,7 +685,7 @@ export const InstanceConfigUpdateRequest = z.object({
|
||||
client_id: z.string().nullish(),
|
||||
client_secret: z.string().nullish(),
|
||||
scope: z.string().nullish(),
|
||||
allowed_domains: z.array(z.string()).max(100).optional(),
|
||||
allowed_domains: SsoAllowedDomainsSchema.optional(),
|
||||
auto_provision: z.boolean().optional(),
|
||||
})
|
||||
.nullish(),
|
||||
@@ -741,29 +767,7 @@ export const InstanceConfigUpdateRequest = z.object({
|
||||
.nullish(),
|
||||
})
|
||||
.nullish(),
|
||||
policy: z
|
||||
.object({
|
||||
single_community_enabled: z.boolean().optional(),
|
||||
single_community_name: z.string().trim().min(1).max(100).optional(),
|
||||
direct_messages_disabled: z.boolean().optional(),
|
||||
direct_messages_locked: z.literal(false).optional(),
|
||||
premium_mode: z.enum(['mirror', 'everyone']).optional(),
|
||||
services: z
|
||||
.object({
|
||||
gif_enabled: z.boolean().nullish(),
|
||||
youtube_enabled: z.boolean().nullish(),
|
||||
bluesky_enabled: z.boolean().nullish(),
|
||||
})
|
||||
.nullish(),
|
||||
deferred_phone_gate: z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
window_hours: z.number().positive().max(8760).optional(),
|
||||
member_threshold: z.number().int().positive().max(1_000_000).optional(),
|
||||
})
|
||||
.nullish(),
|
||||
})
|
||||
.nullish(),
|
||||
policy: InstancePolicyUpdateSchema.nullish(),
|
||||
});
|
||||
|
||||
export type InstanceConfigUpdateRequest = z.infer<typeof InstanceConfigUpdateRequest>;
|
||||
|
||||
@@ -6,31 +6,33 @@ const GatewayRolloutModeEnum = z.enum(['modulo', 'random']);
|
||||
|
||||
const VoiceE2EEScopeEnum = z.enum(['guild_feature_only', 'platform_wide']);
|
||||
|
||||
const gatewayRolloutFields = {
|
||||
session_rollout_percentage: z.number().min(0).max(100),
|
||||
session_rollout_mode: GatewayRolloutModeEnum,
|
||||
guild_rollout_percentage: z.number().min(0).max(100),
|
||||
rpc_request_timeout_ms: z.number().int().min(1000).max(60000),
|
||||
max_concurrent_session_starts: z.number().int().min(1).max(10000),
|
||||
max_concurrent_guild_starts: z.number().int().min(1).max(10000),
|
||||
gateway_dispatch_relay_shards: z.number().int().min(1).max(10000),
|
||||
gateway_dispatch_relay_max_queue: z.number().int().min(0).max(1000000),
|
||||
voice_e2ee_scope: VoiceE2EEScopeEnum,
|
||||
};
|
||||
|
||||
export const GatewayRolloutConfigSchema = z.object({
|
||||
session_rollout_percentage: z.number().min(0).max(100).default(100),
|
||||
session_rollout_mode: GatewayRolloutModeEnum.default('modulo'),
|
||||
guild_rollout_percentage: z.number().min(0).max(100).default(100),
|
||||
rpc_request_timeout_ms: z.number().int().min(1000).max(60000).default(10000),
|
||||
max_concurrent_session_starts: z.number().int().min(1).max(10000).default(512),
|
||||
max_concurrent_guild_starts: z.number().int().min(1).max(10000).default(256),
|
||||
gateway_dispatch_relay_shards: z.number().int().min(1).max(10000).default(32),
|
||||
gateway_dispatch_relay_max_queue: z.number().int().min(0).max(1000000).default(50000),
|
||||
voice_e2ee_scope: VoiceE2EEScopeEnum.default('guild_feature_only'),
|
||||
session_rollout_percentage: gatewayRolloutFields.session_rollout_percentage.default(100),
|
||||
session_rollout_mode: gatewayRolloutFields.session_rollout_mode.default('modulo'),
|
||||
guild_rollout_percentage: gatewayRolloutFields.guild_rollout_percentage.default(100),
|
||||
rpc_request_timeout_ms: gatewayRolloutFields.rpc_request_timeout_ms.default(10000),
|
||||
max_concurrent_session_starts: gatewayRolloutFields.max_concurrent_session_starts.default(512),
|
||||
max_concurrent_guild_starts: gatewayRolloutFields.max_concurrent_guild_starts.default(256),
|
||||
gateway_dispatch_relay_shards: gatewayRolloutFields.gateway_dispatch_relay_shards.default(32),
|
||||
gateway_dispatch_relay_max_queue: gatewayRolloutFields.gateway_dispatch_relay_max_queue.default(50000),
|
||||
voice_e2ee_scope: gatewayRolloutFields.voice_e2ee_scope.default('guild_feature_only'),
|
||||
});
|
||||
|
||||
export type GatewayRolloutConfig = z.infer<typeof GatewayRolloutConfigSchema>;
|
||||
|
||||
export const GatewayRolloutConfigUpdateRequest = z.object({
|
||||
session_rollout_percentage: z.number().min(0).max(100).optional(),
|
||||
session_rollout_mode: GatewayRolloutModeEnum.optional(),
|
||||
guild_rollout_percentage: z.number().min(0).max(100).optional(),
|
||||
rpc_request_timeout_ms: z.number().int().min(1000).max(60000).optional(),
|
||||
max_concurrent_session_starts: z.number().int().min(1).max(10000).optional(),
|
||||
max_concurrent_guild_starts: z.number().int().min(1).max(10000).optional(),
|
||||
gateway_dispatch_relay_shards: z.number().int().min(1).max(10000).optional(),
|
||||
gateway_dispatch_relay_max_queue: z.number().int().min(0).max(1000000).optional(),
|
||||
voice_e2ee_scope: VoiceE2EEScopeEnum.optional(),
|
||||
});
|
||||
export const GatewayRolloutConfigUpdateRequest = z.object(gatewayRolloutFields).partial();
|
||||
|
||||
export type GatewayRolloutConfigUpdateRequest = z.infer<typeof GatewayRolloutConfigUpdateRequest>;
|
||||
|
||||
|
||||
@@ -128,7 +128,6 @@ export const InstanceRegistrationModeSchema = createNamedStringLiteralUnion(
|
||||
],
|
||||
'Registration mode',
|
||||
);
|
||||
export type InstanceRegistrationMode = z.infer<typeof InstanceRegistrationModeSchema>;
|
||||
|
||||
export const InstanceRegistrationSchema = z
|
||||
.object({
|
||||
|
||||
@@ -1,49 +1,46 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {AuditLogActionType} from '@fluxer/constants/src/AuditLogActionType';
|
||||
import {createInt32EnumType, withOpenApiType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {createInt32EnumType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
|
||||
export const AuditLogActionTypeSchema = withOpenApiType(
|
||||
createInt32EnumType(
|
||||
[
|
||||
[AuditLogActionType.GUILD_UPDATE, 'GUILD_UPDATE', 'Guild settings were updated'],
|
||||
[AuditLogActionType.CHANNEL_CREATE, 'CHANNEL_CREATE', 'Channel was created'],
|
||||
[AuditLogActionType.CHANNEL_UPDATE, 'CHANNEL_UPDATE', 'Channel was updated'],
|
||||
[AuditLogActionType.CHANNEL_DELETE, 'CHANNEL_DELETE', 'Channel was deleted'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_CREATE, 'CHANNEL_OVERWRITE_CREATE', 'Permission overwrite was created'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_UPDATE, 'CHANNEL_OVERWRITE_UPDATE', 'Permission overwrite was updated'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_DELETE, 'CHANNEL_OVERWRITE_DELETE', 'Permission overwrite was deleted'],
|
||||
[AuditLogActionType.MEMBER_KICK, 'MEMBER_KICK', 'Member was kicked'],
|
||||
[AuditLogActionType.MEMBER_PRUNE, 'MEMBER_PRUNE', 'Members were pruned'],
|
||||
[AuditLogActionType.MEMBER_BAN_ADD, 'MEMBER_BAN_ADD', 'Member was banned'],
|
||||
[AuditLogActionType.MEMBER_BAN_REMOVE, 'MEMBER_BAN_REMOVE', 'Member ban was removed'],
|
||||
[AuditLogActionType.MEMBER_UPDATE, 'MEMBER_UPDATE', 'Member was updated'],
|
||||
[AuditLogActionType.MEMBER_ROLE_UPDATE, 'MEMBER_ROLE_UPDATE', 'Member roles were updated'],
|
||||
[AuditLogActionType.MEMBER_MOVE, 'MEMBER_MOVE', 'Member was moved to a different voice channel'],
|
||||
[AuditLogActionType.MEMBER_DISCONNECT, 'MEMBER_DISCONNECT', 'Member was disconnected from a voice channel'],
|
||||
[AuditLogActionType.BOT_ADD, 'BOT_ADD', 'Bot was added to the guild'],
|
||||
[AuditLogActionType.ROLE_CREATE, 'ROLE_CREATE', 'Role was created'],
|
||||
[AuditLogActionType.ROLE_UPDATE, 'ROLE_UPDATE', 'Role was updated'],
|
||||
[AuditLogActionType.ROLE_DELETE, 'ROLE_DELETE', 'Role was deleted'],
|
||||
[AuditLogActionType.INVITE_CREATE, 'INVITE_CREATE', 'Invite was created'],
|
||||
[AuditLogActionType.INVITE_UPDATE, 'INVITE_UPDATE', 'Invite was updated'],
|
||||
[AuditLogActionType.INVITE_DELETE, 'INVITE_DELETE', 'Invite was deleted'],
|
||||
[AuditLogActionType.WEBHOOK_CREATE, 'WEBHOOK_CREATE', 'Webhook was created'],
|
||||
[AuditLogActionType.WEBHOOK_UPDATE, 'WEBHOOK_UPDATE', 'Webhook was updated'],
|
||||
[AuditLogActionType.WEBHOOK_DELETE, 'WEBHOOK_DELETE', 'Webhook was deleted'],
|
||||
[AuditLogActionType.EMOJI_CREATE, 'EMOJI_CREATE', 'Emoji was created'],
|
||||
[AuditLogActionType.EMOJI_UPDATE, 'EMOJI_UPDATE', 'Emoji was updated'],
|
||||
[AuditLogActionType.EMOJI_DELETE, 'EMOJI_DELETE', 'Emoji was deleted'],
|
||||
[AuditLogActionType.STICKER_CREATE, 'STICKER_CREATE', 'Sticker was created'],
|
||||
[AuditLogActionType.STICKER_UPDATE, 'STICKER_UPDATE', 'Sticker was updated'],
|
||||
[AuditLogActionType.STICKER_DELETE, 'STICKER_DELETE', 'Sticker was deleted'],
|
||||
[AuditLogActionType.MESSAGE_DELETE, 'MESSAGE_DELETE', 'Message was deleted'],
|
||||
[AuditLogActionType.MESSAGE_BULK_DELETE, 'MESSAGE_BULK_DELETE', 'Messages were bulk deleted'],
|
||||
[AuditLogActionType.MESSAGE_PIN, 'MESSAGE_PIN', 'Message was pinned'],
|
||||
[AuditLogActionType.MESSAGE_UNPIN, 'MESSAGE_UNPIN', 'Message was unpinned'],
|
||||
],
|
||||
'The type of action that occurred',
|
||||
'AuditLogActionType',
|
||||
),
|
||||
export const AuditLogActionTypeSchema = createInt32EnumType(
|
||||
[
|
||||
[AuditLogActionType.GUILD_UPDATE, 'GUILD_UPDATE', 'Guild settings were updated'],
|
||||
[AuditLogActionType.CHANNEL_CREATE, 'CHANNEL_CREATE', 'Channel was created'],
|
||||
[AuditLogActionType.CHANNEL_UPDATE, 'CHANNEL_UPDATE', 'Channel was updated'],
|
||||
[AuditLogActionType.CHANNEL_DELETE, 'CHANNEL_DELETE', 'Channel was deleted'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_CREATE, 'CHANNEL_OVERWRITE_CREATE', 'Permission overwrite was created'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_UPDATE, 'CHANNEL_OVERWRITE_UPDATE', 'Permission overwrite was updated'],
|
||||
[AuditLogActionType.CHANNEL_OVERWRITE_DELETE, 'CHANNEL_OVERWRITE_DELETE', 'Permission overwrite was deleted'],
|
||||
[AuditLogActionType.MEMBER_KICK, 'MEMBER_KICK', 'Member was kicked'],
|
||||
[AuditLogActionType.MEMBER_PRUNE, 'MEMBER_PRUNE', 'Members were pruned'],
|
||||
[AuditLogActionType.MEMBER_BAN_ADD, 'MEMBER_BAN_ADD', 'Member was banned'],
|
||||
[AuditLogActionType.MEMBER_BAN_REMOVE, 'MEMBER_BAN_REMOVE', 'Member ban was removed'],
|
||||
[AuditLogActionType.MEMBER_UPDATE, 'MEMBER_UPDATE', 'Member was updated'],
|
||||
[AuditLogActionType.MEMBER_ROLE_UPDATE, 'MEMBER_ROLE_UPDATE', 'Member roles were updated'],
|
||||
[AuditLogActionType.MEMBER_MOVE, 'MEMBER_MOVE', 'Member was moved to a different voice channel'],
|
||||
[AuditLogActionType.MEMBER_DISCONNECT, 'MEMBER_DISCONNECT', 'Member was disconnected from a voice channel'],
|
||||
[AuditLogActionType.BOT_ADD, 'BOT_ADD', 'Bot was added to the guild'],
|
||||
[AuditLogActionType.ROLE_CREATE, 'ROLE_CREATE', 'Role was created'],
|
||||
[AuditLogActionType.ROLE_UPDATE, 'ROLE_UPDATE', 'Role was updated'],
|
||||
[AuditLogActionType.ROLE_DELETE, 'ROLE_DELETE', 'Role was deleted'],
|
||||
[AuditLogActionType.INVITE_CREATE, 'INVITE_CREATE', 'Invite was created'],
|
||||
[AuditLogActionType.INVITE_UPDATE, 'INVITE_UPDATE', 'Invite was updated'],
|
||||
[AuditLogActionType.INVITE_DELETE, 'INVITE_DELETE', 'Invite was deleted'],
|
||||
[AuditLogActionType.WEBHOOK_CREATE, 'WEBHOOK_CREATE', 'Webhook was created'],
|
||||
[AuditLogActionType.WEBHOOK_UPDATE, 'WEBHOOK_UPDATE', 'Webhook was updated'],
|
||||
[AuditLogActionType.WEBHOOK_DELETE, 'WEBHOOK_DELETE', 'Webhook was deleted'],
|
||||
[AuditLogActionType.EMOJI_CREATE, 'EMOJI_CREATE', 'Emoji was created'],
|
||||
[AuditLogActionType.EMOJI_UPDATE, 'EMOJI_UPDATE', 'Emoji was updated'],
|
||||
[AuditLogActionType.EMOJI_DELETE, 'EMOJI_DELETE', 'Emoji was deleted'],
|
||||
[AuditLogActionType.STICKER_CREATE, 'STICKER_CREATE', 'Sticker was created'],
|
||||
[AuditLogActionType.STICKER_UPDATE, 'STICKER_UPDATE', 'Sticker was updated'],
|
||||
[AuditLogActionType.STICKER_DELETE, 'STICKER_DELETE', 'Sticker was deleted'],
|
||||
[AuditLogActionType.MESSAGE_DELETE, 'MESSAGE_DELETE', 'Message was deleted'],
|
||||
[AuditLogActionType.MESSAGE_BULK_DELETE, 'MESSAGE_BULK_DELETE', 'Messages were bulk deleted'],
|
||||
[AuditLogActionType.MESSAGE_PIN, 'MESSAGE_PIN', 'Message was pinned'],
|
||||
[AuditLogActionType.MESSAGE_UNPIN, 'MESSAGE_UNPIN', 'Message was unpinned'],
|
||||
],
|
||||
'The type of action that occurred',
|
||||
'AuditLogActionType',
|
||||
);
|
||||
@@ -18,19 +18,17 @@ import {
|
||||
} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {z} from 'zod';
|
||||
|
||||
export const ChannelTypeSchema = withOpenApiType(
|
||||
createInt32EnumType(
|
||||
[
|
||||
[ChannelTypes.GUILD_TEXT, 'GUILD_TEXT', 'A text channel within a guild'],
|
||||
[ChannelTypes.DM, 'DM', 'A direct message between users'],
|
||||
[ChannelTypes.GUILD_VOICE, 'GUILD_VOICE', 'A voice channel within a guild'],
|
||||
[ChannelTypes.GROUP_DM, 'GROUP_DM', 'A group direct message between users'],
|
||||
[ChannelTypes.GUILD_CATEGORY, 'GUILD_CATEGORY', 'A category that contains channels'],
|
||||
[ChannelTypes.GUILD_LINK, 'GUILD_LINK', 'A link channel for external resources'],
|
||||
[ChannelTypes.DM_PERSONAL_NOTES, 'DM_PERSONAL_NOTES', 'Personal notes DM channel'],
|
||||
],
|
||||
'The type of the channel',
|
||||
),
|
||||
export const ChannelTypeSchema = createInt32EnumType(
|
||||
[
|
||||
[ChannelTypes.GUILD_TEXT, 'GUILD_TEXT', 'A text channel within a guild'],
|
||||
[ChannelTypes.DM, 'DM', 'A direct message between users'],
|
||||
[ChannelTypes.GUILD_VOICE, 'GUILD_VOICE', 'A voice channel within a guild'],
|
||||
[ChannelTypes.GROUP_DM, 'GROUP_DM', 'A group direct message between users'],
|
||||
[ChannelTypes.GUILD_CATEGORY, 'GUILD_CATEGORY', 'A category that contains channels'],
|
||||
[ChannelTypes.GUILD_LINK, 'GUILD_LINK', 'A link channel for external resources'],
|
||||
[ChannelTypes.DM_PERSONAL_NOTES, 'DM_PERSONAL_NOTES', 'Personal notes DM channel'],
|
||||
],
|
||||
'The type of the channel',
|
||||
'ChannelType',
|
||||
);
|
||||
export const ChannelOverwriteTypeSchema = withOpenApiType(
|
||||
|
||||
@@ -10,11 +10,7 @@ import {
|
||||
JoinSourceTypes,
|
||||
} from '@fluxer/constants/src/GuildConstants';
|
||||
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
|
||||
import {
|
||||
createInt32EnumType,
|
||||
createNamedLiteralUnion,
|
||||
withOpenApiType,
|
||||
} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {createInt32EnumType, createNamedLiteralUnion} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
|
||||
export const GuildVerificationLevelSchema = createInt32EnumType(
|
||||
[
|
||||
@@ -80,18 +76,15 @@ export const SplashCardAlignmentSchema = createNamedLiteralUnion(
|
||||
] as const,
|
||||
'Alignment of the guild splash card',
|
||||
);
|
||||
export const JoinSourceTypeSchema = withOpenApiType(
|
||||
createInt32EnumType(
|
||||
[
|
||||
[JoinSourceTypes.CREATOR, 'CREATOR', 'Member created the guild'],
|
||||
[JoinSourceTypes.INSTANT_INVITE, 'INSTANT_INVITE', 'Member joined via an instant invite'],
|
||||
[JoinSourceTypes.VANITY_URL, 'VANITY_URL', 'Member joined via the vanity URL'],
|
||||
[JoinSourceTypes.BOT_INVITE, 'BOT_INVITE', 'Member was added via a bot invite'],
|
||||
[JoinSourceTypes.ADMIN_FORCE_ADD, 'ADMIN_FORCE_ADD', 'Member was force-added by a platform administrator'],
|
||||
[JoinSourceTypes.DISCOVERY, 'DISCOVERY', 'Member joined via guild discovery'],
|
||||
],
|
||||
'How the member joined the guild',
|
||||
'JoinSourceType',
|
||||
),
|
||||
export const JoinSourceTypeSchema = createInt32EnumType(
|
||||
[
|
||||
[JoinSourceTypes.CREATOR, 'CREATOR', 'Member created the guild'],
|
||||
[JoinSourceTypes.INSTANT_INVITE, 'INSTANT_INVITE', 'Member joined via an instant invite'],
|
||||
[JoinSourceTypes.VANITY_URL, 'VANITY_URL', 'Member joined via the vanity URL'],
|
||||
[JoinSourceTypes.BOT_INVITE, 'BOT_INVITE', 'Member was added via a bot invite'],
|
||||
[JoinSourceTypes.ADMIN_FORCE_ADD, 'ADMIN_FORCE_ADD', 'Member was force-added by a platform administrator'],
|
||||
[JoinSourceTypes.DISCOVERY, 'DISCOVERY', 'Member joined via guild discovery'],
|
||||
],
|
||||
'How the member joined the guild',
|
||||
'JoinSourceType',
|
||||
);
|
||||
@@ -7,35 +7,25 @@ import {
|
||||
MessageReferenceTypesDescriptions,
|
||||
MessageTypes,
|
||||
} from '@fluxer/constants/src/ChannelConstants';
|
||||
import {
|
||||
createInt32EnumType,
|
||||
createNamedStringLiteralUnion,
|
||||
withOpenApiType,
|
||||
} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {createInt32EnumType, createNamedStringLiteralUnion} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
|
||||
export const MessageTypeSchema = withOpenApiType(
|
||||
createInt32EnumType(
|
||||
export const MessageTypeSchema = createInt32EnumType(
|
||||
[
|
||||
[MessageTypes.DEFAULT, 'DEFAULT', 'A regular message'],
|
||||
[MessageTypes.RECIPIENT_ADD, 'RECIPIENT_ADD', 'A system message indicating a user was added to the conversation'],
|
||||
[
|
||||
[MessageTypes.DEFAULT, 'DEFAULT', 'A regular message'],
|
||||
[MessageTypes.RECIPIENT_ADD, 'RECIPIENT_ADD', 'A system message indicating a user was added to the conversation'],
|
||||
[
|
||||
MessageTypes.RECIPIENT_REMOVE,
|
||||
'RECIPIENT_REMOVE',
|
||||
'A system message indicating a user was removed from the conversation',
|
||||
],
|
||||
[MessageTypes.CALL, 'CALL', 'A message representing a call'],
|
||||
[MessageTypes.CHANNEL_NAME_CHANGE, 'CHANNEL_NAME_CHANGE', 'A system message indicating the channel name changed'],
|
||||
[MessageTypes.CHANNEL_ICON_CHANGE, 'CHANNEL_ICON_CHANGE', 'A system message indicating the channel icon changed'],
|
||||
[
|
||||
MessageTypes.CHANNEL_PINNED_MESSAGE,
|
||||
'CHANNEL_PINNED_MESSAGE',
|
||||
'A system message indicating a message was pinned',
|
||||
],
|
||||
[MessageTypes.USER_JOIN, 'USER_JOIN', 'A system message indicating a user joined'],
|
||||
[MessageTypes.REPLY, 'REPLY', 'A reply message'],
|
||||
MessageTypes.RECIPIENT_REMOVE,
|
||||
'RECIPIENT_REMOVE',
|
||||
'A system message indicating a user was removed from the conversation',
|
||||
],
|
||||
'The type of message',
|
||||
),
|
||||
[MessageTypes.CALL, 'CALL', 'A message representing a call'],
|
||||
[MessageTypes.CHANNEL_NAME_CHANGE, 'CHANNEL_NAME_CHANGE', 'A system message indicating the channel name changed'],
|
||||
[MessageTypes.CHANNEL_ICON_CHANGE, 'CHANNEL_ICON_CHANGE', 'A system message indicating the channel icon changed'],
|
||||
[MessageTypes.CHANNEL_PINNED_MESSAGE, 'CHANNEL_PINNED_MESSAGE', 'A system message indicating a message was pinned'],
|
||||
[MessageTypes.USER_JOIN, 'USER_JOIN', 'A system message indicating a user joined'],
|
||||
[MessageTypes.REPLY, 'REPLY', 'A reply message'],
|
||||
],
|
||||
'The type of message',
|
||||
'MessageType',
|
||||
);
|
||||
export const MessageReferenceTypeSchema = createInt32EnumType(
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createInt32EnumType, withOpenApiType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
import {createInt32EnumType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
|
||||
|
||||
export const WebhookTypeSchema = withOpenApiType(
|
||||
createInt32EnumType(
|
||||
[
|
||||
[1, 'INCOMING', 'Incoming webhook'],
|
||||
[2, 'CHANNEL_FOLLOWER', 'Channel follower webhook'],
|
||||
],
|
||||
'The type of webhook',
|
||||
'WebhookType',
|
||||
),
|
||||
export const WebhookTypeSchema = createInt32EnumType(
|
||||
[
|
||||
[1, 'INCOMING', 'Incoming webhook'],
|
||||
[2, 'CHANNEL_FOLLOWER', 'Channel follower webhook'],
|
||||
],
|
||||
'The type of webhook',
|
||||
'WebhookType',
|
||||
);
|
||||
Reference in new issue
Block a user