oceanic.js 1.11.3-dev.9b252f0 → 1.11.3-dev.aa56090
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/README.md +0 -1
- package/dist/lib/Constants.d.ts +48 -6
- package/dist/lib/Constants.js +57 -3
- package/dist/lib/gateway/Shard.js +8 -7
- package/dist/lib/gateway/ShardManager.js +2 -2
- package/dist/lib/gateway/compression/zstd.d.ts +1 -5
- package/dist/lib/gateway/compression/zstd.js +5 -18
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +4 -2
- package/dist/lib/routes/Applications.d.ts +20 -1
- package/dist/lib/routes/Applications.js +66 -4
- package/dist/lib/routes/Channels.js +5 -2
- package/dist/lib/routes/Interactions.d.ts +5 -3
- package/dist/lib/routes/Interactions.js +35 -11
- package/dist/lib/routes/Webhooks.js +14 -2
- package/dist/lib/structures/Application.d.ts +7 -1
- package/dist/lib/structures/Application.js +10 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
- package/dist/lib/structures/ApplicationCommand.js +5 -1
- package/dist/lib/structures/Attachment.d.ts +8 -0
- package/dist/lib/structures/Attachment.js +11 -1
- package/dist/lib/structures/AutocompleteInteraction.d.ts +2 -2
- package/dist/lib/structures/AutocompleteInteraction.js +2 -2
- package/dist/lib/structures/ClientApplication.d.ts +6 -1
- package/dist/lib/structures/ClientApplication.js +8 -1
- package/dist/lib/structures/CommandInteraction.d.ts +15 -12
- package/dist/lib/structures/CommandInteraction.js +26 -23
- package/dist/lib/structures/ComponentInteraction.d.ts +15 -14
- package/dist/lib/structures/ComponentInteraction.js +24 -25
- package/dist/lib/structures/Entitlement.d.ts +2 -2
- package/dist/lib/structures/Entitlement.js +5 -5
- package/dist/lib/structures/Message.d.ts +3 -3
- package/dist/lib/structures/Message.js +25 -16
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +14 -13
- package/dist/lib/structures/ModalSubmitInteraction.js +22 -18
- package/dist/lib/structures/PingInteraction.d.ts +2 -2
- package/dist/lib/structures/PingInteraction.js +2 -2
- package/dist/lib/structures/Subscription.d.ts +25 -0
- package/dist/lib/structures/Subscription.js +38 -0
- package/dist/lib/types/applications.d.ts +89 -8
- package/dist/lib/types/channels.d.ts +333 -188
- package/dist/lib/types/gateway.d.ts +2 -2
- package/dist/lib/types/interactions.d.ts +64 -7
- package/dist/lib/types/json.d.ts +13 -6
- package/dist/lib/types/webhooks.d.ts +6 -2
- package/dist/lib/util/Errors.d.ts +4 -0
- package/dist/lib/util/Errors.js +9 -2
- package/dist/lib/util/Routes.d.ts +3 -0
- package/dist/lib/util/Routes.js +8 -2
- package/dist/lib/util/Util.d.ts +6 -6
- package/dist/lib/util/Util.js +65 -12
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
- package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
- package/dist/package.json +3 -4
- package/esm.mjs +2 -0
- package/package.json +3 -4
@@ -3,21 +3,26 @@ import type { ImplementedChannels, InstallParams, RawOAuthGuild, RawUser } from
|
|
3
3
|
import type { ExclusifyUnion } from "./shared";
|
4
4
|
import type { Emoji, WithRequired } from "./misc";
|
5
5
|
import type {
|
6
|
+
ActivityLocationKind,
|
6
7
|
ApplicationCommandOptionTypes,
|
7
8
|
ApplicationCommandPermissionTypes,
|
8
9
|
ApplicationCommandTypes,
|
9
10
|
ApplicationDiscoverabilityState,
|
11
|
+
ApplicationEventWebhookEventType,
|
12
|
+
ApplicationEventWebhookStatus,
|
10
13
|
ApplicationExplicitContentFilterLevel,
|
11
14
|
ApplicationIntegrationTypes,
|
12
15
|
ApplicationMonetizationState,
|
13
16
|
ApplicationVerificationState,
|
14
17
|
EntitlementOwnerTypes,
|
15
18
|
EntitlementTypes,
|
19
|
+
EntryPointCommandHandlerTypes,
|
16
20
|
InteractionContextTypes,
|
17
21
|
RPCApplicationState,
|
18
22
|
SKUAccessTypes,
|
19
23
|
SKUTypes,
|
20
24
|
StoreApplicationState,
|
25
|
+
SubscriptionStatuses,
|
21
26
|
TeamMembershipState
|
22
27
|
} from "../Constants";
|
23
28
|
import type ApplicationCommand from "../structures/ApplicationCommand";
|
@@ -34,6 +39,9 @@ export interface RawApplication {
|
|
34
39
|
description: string;
|
35
40
|
discoverability_state?: ApplicationDiscoverabilityState;
|
36
41
|
discovery_eligibility_flags?: number;
|
42
|
+
event_webhooks_status: ApplicationEventWebhookStatus;
|
43
|
+
event_webhooks_types?: Array<ApplicationEventWebhookEventType>;
|
44
|
+
event_webhooks_url?: string | null;
|
37
45
|
explicit_content_filter?: ApplicationExplicitContentFilterLevel;
|
38
46
|
flags?: number;
|
39
47
|
guild?: RawOAuthGuild;
|
@@ -119,6 +127,7 @@ export interface RawApplicationCommand {
|
|
119
127
|
description_localized?: string;
|
120
128
|
dm_permission?: boolean;
|
121
129
|
guild_id?: string;
|
130
|
+
handler?: EntryPointCommandHandlerTypes;
|
122
131
|
id: string;
|
123
132
|
integration_types: Array<ApplicationIntegrationTypes>;
|
124
133
|
name: string;
|
@@ -172,19 +181,21 @@ export interface RawApplicationCommandOptionChoice {
|
|
172
181
|
value: string | number;
|
173
182
|
}
|
174
183
|
|
175
|
-
export type AnyApplicationCommand = ChatInputApplicationCommand | UserApplicationCommand | MessageApplicationCommand;
|
184
|
+
export type AnyApplicationCommand = ChatInputApplicationCommand | UserApplicationCommand | MessageApplicationCommand | PrimaryEntryPointApplicationCommand;
|
176
185
|
export type ApplicationCommandOptions = ApplicationCommandOptionsWithOptions | ApplicationCommandOptionsWithValue;
|
177
186
|
export type ApplicationCommandOptionsWithOptions = ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsSubCommandGroup;
|
178
187
|
export type ApplicationCommandOptionsWithValue = ApplicationCommandOptionsString | ApplicationCommandOptionsInteger | ApplicationCommandOptionsBoolean | ApplicationCommandOptionsUser | ApplicationCommandOptionsChannel | ApplicationCommandOptionsRole | ApplicationCommandOptionsMentionable | ApplicationCommandOptionsNumber | ApplicationCommandOptionsAttachment;
|
179
188
|
export type ChatInputApplicationCommand = ApplicationCommand<ApplicationCommandTypes.CHAT_INPUT>;
|
180
189
|
export type UserApplicationCommand = ApplicationCommand<ApplicationCommandTypes.USER>;
|
181
190
|
export type MessageApplicationCommand = ApplicationCommand<ApplicationCommandTypes.MESSAGE>;
|
191
|
+
export type PrimaryEntryPointApplicationCommand = ApplicationCommand<ApplicationCommandTypes.PRIMARY_ENTRY_POINT>;
|
182
192
|
|
183
193
|
export type ApplicationCommandOptionConversion<T extends EditApplicationCommandOptions | CreateApplicationCommandOptions> =
|
184
194
|
T extends EditChatInputApplicationCommandOptions | CreateChatInputApplicationCommandOptions ? ChatInputApplicationCommand :
|
185
195
|
T extends EditUserApplicationCommandOptions | CreateUserApplicationCommandOptions ? UserApplicationCommand :
|
186
196
|
T extends EditMessageApplicationCommandOptions | CreateMessageApplicationCommandOptions ? MessageApplicationCommand :
|
187
|
-
|
197
|
+
T extends EditPrimaryEntryPointApplicationCommandOptions | CreatePrimaryEntryPointApplicationCommandOptions ? PrimaryEntryPointApplicationCommand :
|
198
|
+
never;
|
188
199
|
|
189
200
|
|
190
201
|
export interface ApplicationCommandOptionBase<T extends ApplicationCommandOptionTypes = ApplicationCommandOptionTypes> {
|
@@ -277,7 +288,7 @@ export interface CreateApplicationCommandOptionsBase<T extends ApplicationComman
|
|
277
288
|
type: T;
|
278
289
|
}
|
279
290
|
|
280
|
-
export type CreateApplicationCommandOptions = CreateChatInputApplicationCommandOptions | CreateUserApplicationCommandOptions | CreateMessageApplicationCommandOptions;
|
291
|
+
export type CreateApplicationCommandOptions = CreateChatInputApplicationCommandOptions | CreateUserApplicationCommandOptions | CreateMessageApplicationCommandOptions | CreatePrimaryEntryPointApplicationCommandOptions;
|
281
292
|
export interface CreateGuildChatInputApplicationCommandOptions extends Omit<CreateChatInputApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
|
282
293
|
export interface CreateGuildUserApplicationCommandOptions extends Omit<CreateUserApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
|
283
294
|
export interface CreateGuildMessageApplicationCommandOptions extends Omit<CreateMessageApplicationCommandOptions, "dmPermission" | "integrationTypes" | "contexts"> {}
|
@@ -291,13 +302,17 @@ export interface CreateChatInputApplicationCommandOptions extends CreateApplicat
|
|
291
302
|
options?: Array<ApplicationCommandOptions>;
|
292
303
|
}
|
293
304
|
|
294
|
-
export
|
295
|
-
export
|
305
|
+
export interface CreateUserApplicationCommandOptions extends CreateApplicationCommandOptionsBase<ApplicationCommandTypes.USER> {}
|
306
|
+
export interface CreateMessageApplicationCommandOptions extends CreateApplicationCommandOptionsBase<ApplicationCommandTypes.MESSAGE> {}
|
307
|
+
export interface CreatePrimaryEntryPointApplicationCommandOptions extends CreateApplicationCommandOptionsBase<ApplicationCommandTypes.PRIMARY_ENTRY_POINT> {
|
308
|
+
handler: EntryPointCommandHandlerTypes;
|
309
|
+
}
|
296
310
|
|
297
|
-
export type EditApplicationCommandOptions = EditChatInputApplicationCommandOptions | EditUserApplicationCommandOptions | EditMessageApplicationCommandOptions;
|
311
|
+
export type EditApplicationCommandOptions = EditChatInputApplicationCommandOptions | EditUserApplicationCommandOptions | EditMessageApplicationCommandOptions | EditPrimaryEntryPointApplicationCommandOptions;
|
298
312
|
export interface EditChatInputApplicationCommandOptions extends Partial<Omit<CreateChatInputApplicationCommandOptions, "type">> {}
|
299
313
|
export interface EditUserApplicationCommandOptions extends Partial<Omit<CreateUserApplicationCommandOptions, "type">> {}
|
300
314
|
export interface EditMessageApplicationCommandOptions extends Partial<Omit<CreateMessageApplicationCommandOptions, "type">> {}
|
315
|
+
export interface EditPrimaryEntryPointApplicationCommandOptions extends Partial<Omit<CreatePrimaryEntryPointApplicationCommandOptions, "type">> {}
|
301
316
|
|
302
317
|
export type EditGuildApplicationCommandOptions = EditGuildChatInputApplicationCommandOptions | EditGuildUserApplicationCommandOptions | EditGuildMessageApplicationCommandOptions;
|
303
318
|
export interface EditGuildChatInputApplicationCommandOptions extends Partial<Omit<CreateChatInputApplicationCommandOptions, "type" | "dmPermission" | "integrationTypes" | "contexts">> {}
|
@@ -412,8 +427,8 @@ export interface RawBaseEntitlement {
|
|
412
427
|
}
|
413
428
|
|
414
429
|
export interface RawEntitlement extends RawBaseEntitlement {
|
415
|
-
ends_at: string;
|
416
|
-
starts_at: string;
|
430
|
+
ends_at: string | null;
|
431
|
+
starts_at: string | null;
|
417
432
|
subscription_id: string;
|
418
433
|
}
|
419
434
|
|
@@ -422,6 +437,7 @@ export interface RawTestEntitlement extends RawBaseEntitlement {}
|
|
422
437
|
export interface SearchEntitlementsOptions {
|
423
438
|
after?: string;
|
424
439
|
before?: string;
|
440
|
+
excludeDeleted?: boolean;
|
425
441
|
excludeEnded?: boolean;
|
426
442
|
guildID?: string;
|
427
443
|
limit?: number;
|
@@ -451,6 +467,9 @@ export interface EditApplicationOptions {
|
|
451
467
|
customInstallURL?: string;
|
452
468
|
/** The description of the application. */
|
453
469
|
description?: string;
|
470
|
+
eventWebhooksStatus?: Exclude<ApplicationEventWebhookStatus, ApplicationEventWebhookStatus.DISABLED_BY_DISCORD>;
|
471
|
+
eventWebhooksTypes?: Array<ApplicationEventWebhookEventType>;
|
472
|
+
eventWebhooksURL?: string | null;
|
454
473
|
/** The [public flags](https://discord.com/developers/docs/resources/application#application-object-application-flags) of the application. */
|
455
474
|
flags?: number;
|
456
475
|
/** The icon for the application. */
|
@@ -487,3 +506,65 @@ export interface CreateApplicationEmojiOptions {
|
|
487
506
|
export interface EditApplicationEmojiOptions {
|
488
507
|
name: string;
|
489
508
|
}
|
509
|
+
|
510
|
+
export interface RawSubscription {
|
511
|
+
canceled_at: string | null;
|
512
|
+
country?: string;
|
513
|
+
current_period_end: string;
|
514
|
+
current_period_start: string;
|
515
|
+
entitlement_ids: Array<string>;
|
516
|
+
id: string;
|
517
|
+
renewal_sku_ids: Array<string>;
|
518
|
+
sku_ids: Array<string>;
|
519
|
+
status: SubscriptionStatuses;
|
520
|
+
user_id: string;
|
521
|
+
}
|
522
|
+
|
523
|
+
export interface SearchSKUSubscriptions {
|
524
|
+
after?: string;
|
525
|
+
before?: string;
|
526
|
+
limit?: number;
|
527
|
+
/** Required except for OAuth queries. */
|
528
|
+
userID?: string;
|
529
|
+
}
|
530
|
+
|
531
|
+
export interface RawActivityInstance {
|
532
|
+
application_id: string;
|
533
|
+
instance_id: string;
|
534
|
+
launch_id: string;
|
535
|
+
location: RawActivityLocation;
|
536
|
+
users: Array<string>;
|
537
|
+
}
|
538
|
+
|
539
|
+
|
540
|
+
export interface RawActivityLocation {
|
541
|
+
channel_id: string;
|
542
|
+
guild_id?: string | null;
|
543
|
+
id: string;
|
544
|
+
kind: ActivityLocationKind;
|
545
|
+
}
|
546
|
+
|
547
|
+
export interface ActivityInstance {
|
548
|
+
/** Application ID. */
|
549
|
+
applicationID: string;
|
550
|
+
/** Activity Instance ID. */
|
551
|
+
instanceID: string;
|
552
|
+
/** Unique identifier for the launch. */
|
553
|
+
launchID: string;
|
554
|
+
/** Location the instance is runnning in. */
|
555
|
+
location: ActivityLocation;
|
556
|
+
/** IDs of the Users currently connected to the instance. */
|
557
|
+
users: Array<string>;
|
558
|
+
}
|
559
|
+
|
560
|
+
|
561
|
+
export interface ActivityLocation {
|
562
|
+
/** ID of the Channel. */
|
563
|
+
channelID: string;
|
564
|
+
/** ID of the Guild. */
|
565
|
+
guildID?: string | null;
|
566
|
+
/** Unique identifier for the location. */
|
567
|
+
id: string;
|
568
|
+
/** Enum describing kind of location. `gc` = guild channel, `pc` = private channel (dm, gdm). */
|
569
|
+
kind: ActivityLocationKind;
|
570
|
+
}
|