dfx 0.98.1 → 0.99.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/types.d.ts CHANGED
@@ -111,7 +111,7 @@ export interface ActivityTimestamp {
111
111
  readonly end?: number;
112
112
  }
113
113
  export declare enum ActivityType {
114
- GAME = 0,
114
+ PLAYING = 0,
115
115
  STREAMING = 1,
116
116
  LISTENING = 2,
117
117
  WATCHING = 3,
@@ -201,7 +201,7 @@ export interface Application {
201
201
  readonly tags?: Array<string>;
202
202
  /** Settings for the app's default in-app authorization link, if enabled */
203
203
  readonly install_params?: InstallParam;
204
- /** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
204
+ /** Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
205
205
  readonly integration_types_config?: ApplicationIntegrationType;
206
206
  /** Default custom authorization URL for the app, if enabled */
207
207
  readonly custom_install_url?: string;
@@ -972,6 +972,12 @@ export interface Connection {
972
972
  /** visibility of this connection */
973
973
  readonly visibility: VisibilityType;
974
974
  }
975
+ export interface CreateApplicationEmojiParams {
976
+ /** name of the emoji */
977
+ readonly name: string;
978
+ /** the 128x128 emoji image */
979
+ readonly image: string;
980
+ }
975
981
  export interface CreateAutoModerationRuleParams {
976
982
  /** the rule name */
977
983
  readonly name: string;
@@ -1181,6 +1187,8 @@ export interface CreateGuildScheduledEventParams {
1181
1187
  readonly entity_type: GuildScheduledEventEntityType;
1182
1188
  /** the cover image of the scheduled event */
1183
1189
  readonly image?: string;
1190
+ /** the definition for how often this event should recur */
1191
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule;
1184
1192
  }
1185
1193
  export interface CreateGuildStickerParams {
1186
1194
  /** name of the sticker (2-30 characters) */
@@ -1209,7 +1217,7 @@ export interface CreateMessageParams {
1209
1217
  readonly embeds?: Array<Embed>;
1210
1218
  /** Allowed mentions for the message */
1211
1219
  readonly allowed_mentions?: AllowedMention;
1212
- /** Include to make your message a reply */
1220
+ /** Include to make your message a reply or a forward */
1213
1221
  readonly message_reference?: MessageReference;
1214
1222
  /** Components to include with the message */
1215
1223
  readonly components?: Array<Component>;
@@ -1284,7 +1292,7 @@ export interface EditCurrentApplicationParams {
1284
1292
  readonly role_connections_verification_url: string;
1285
1293
  /** Settings for the app's default in-app authorization link, if enabled */
1286
1294
  readonly install_params: InstallParam;
1287
- /** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
1295
+ /** Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
1288
1296
  readonly integration_types_config: ApplicationIntegrationType;
1289
1297
  /** App's public flags */
1290
1298
  readonly flags: number;
@@ -1515,6 +1523,8 @@ export interface Endpoints<O> {
1515
1523
  bulkOverwriteGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<BulkOverwriteGuildApplicationCommandParams>, options?: O) => RestResponse<Array<ApplicationCommand>>;
1516
1524
  /** For One-Time Purchase consumable SKUs, marks a given entitlement for the user as consumed. The entitlement will have consumed: true when using List Entitlements. */
1517
1525
  consumeAnEntitlement: (applicationId: string, entitlementId: string, options?: O) => RestResponse<any>;
1526
+ /** Create a new emoji for the application. Returns the new emoji object on success. */
1527
+ createApplicationEmoji: (applicationId: string, params?: Partial<CreateApplicationEmojiParams>, options?: O) => RestResponse<Emoji>;
1518
1528
  /** Create a new rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Create Gateway event. */
1519
1529
  createAutoModerationRule: (guildId: string, params?: Partial<CreateAutoModerationRuleParams>, options?: O) => RestResponse<AutoModerationRule>;
1520
1530
  /** Create a new invite object for the channel. Only usable for guild channels. Requires the CREATE_INSTANT_INVITE permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object ({}). Returns an invite object. Fires an Invite Create Gateway event. */
@@ -1563,6 +1573,8 @@ export interface Endpoints<O> {
1563
1573
  /** Deletes all the reactions for a given emoji on a message. This endpoint requires the MANAGE_MESSAGES permission to be present on the current user. Fires a Message Reaction Remove Emoji Gateway event.
1564
1574
  The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id. */
1565
1575
  deleteAllReactionsForEmoji: (channelId: string, messageId: string, emoji: string, options?: O) => RestResponse<any>;
1576
+ /** Delete the given emoji. Returns 204 No Content on success. */
1577
+ deleteApplicationEmoji: (applicationId: string, emojiId: string, options?: O) => RestResponse<any>;
1566
1578
  /** Delete a rule. Returns a 204 on success. Fires an Auto Moderation Rule Delete Gateway event. */
1567
1579
  deleteAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: O) => RestResponse<any>;
1568
1580
  /** Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Channel Update Gateway event. For more information about permissions, see permissions */
@@ -1640,6 +1652,8 @@ export interface Endpoints<O> {
1640
1652
  getAnswerVoters: (channelId: string, messageId: string, answerId: string, params?: Partial<GetAnswerVoterParams>, options?: O) => RestResponse<GetAnswerVoterResponse>;
1641
1653
  /** Fetches permissions for a specific command for your application in a guild. Returns a guild application command permissions object. */
1642
1654
  getApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, options?: O) => RestResponse<GuildApplicationCommandPermission>;
1655
+ /** Returns an emoji object for the given application and emoji IDs. Includes the user field. */
1656
+ getApplicationEmoji: (applicationId: string, emojiId: string, options?: O) => RestResponse<Emoji>;
1643
1657
  /** Returns a list of application role connection metadata objects for the given application. */
1644
1658
  getApplicationRoleConnectionMetadataRecords: (applicationId: string, options?: O) => RestResponse<Array<ApplicationRoleConnectionMetadatum>>;
1645
1659
  /** Get a single rule. Returns an auto moderation rule object. */
@@ -1670,6 +1684,8 @@ export interface Endpoints<O> {
1670
1684
  getCurrentUserGuildMember: (guildId: string, options?: O) => RestResponse<GuildMember>;
1671
1685
  /** Returns a list of partial guild objects the current user is a member of. For OAuth2, requires the guilds scope. */
1672
1686
  getCurrentUserGuilds: (params?: Partial<GetCurrentUserGuildParams>, options?: O) => RestResponse<Array<Guild>>;
1687
+ /** Returns the current user's voice state in the guild. */
1688
+ getCurrentUserVoiceState: (guildId: string, options?: O) => RestResponse<VoiceState>;
1673
1689
  /** Returns a followup message for an Interaction. Functions the same as Get Webhook Message. */
1674
1690
  getFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, params?: Partial<GetWebhookMessageParams>, options?: O) => RestResponse<Message>;
1675
1691
  getGateway: (options?: O) => RestResponse<any>;
@@ -1750,6 +1766,8 @@ export interface Endpoints<O> {
1750
1766
  getThreadMember: (channelId: string, userId: string, params?: Partial<GetThreadMemberParams>, options?: O) => RestResponse<ThreadMember>;
1751
1767
  /** Returns a user object for a given user ID. */
1752
1768
  getUser: (userId: string, options?: O) => RestResponse<User>;
1769
+ /** Returns the specified user's voice state in the guild. */
1770
+ getUserVoiceState: (guildId: string, userId: string, options?: O) => RestResponse<VoiceState>;
1753
1771
  /** Returns the new webhook object for the given id. */
1754
1772
  getWebhook: (webhookId: string, options?: O) => RestResponse<Webhook>;
1755
1773
  /** Returns a previously-sent webhook message from the same token. Returns a message object on success. */
@@ -1768,6 +1786,8 @@ export interface Endpoints<O> {
1768
1786
  leaveThread: (channelId: string, options?: O) => RestResponse<any>;
1769
1787
  /** Returns all active threads in the guild, including public and private threads. Threads are ordered by their id, in descending order. */
1770
1788
  listActiveGuildThreads: (guildId: string, options?: O) => RestResponse<ListActiveGuildThreadResponse>;
1789
+ /** Returns an object containing a list of emoji objects for the given application under the items key. Includes a user object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API. */
1790
+ listApplicationEmojis: (applicationId: string, options?: O) => RestResponse<Array<Emoji>>;
1771
1791
  /** Get a list of all rules currently configured for the guild. Returns a list of auto moderation rule objects for the given guild. */
1772
1792
  listAutoModerationRulesForGuild: (guildId: string, options?: O) => RestResponse<Array<AutoModerationRule>>;
1773
1793
  /** Returns all entitlements for a given app, active and expired. */
@@ -1793,6 +1813,8 @@ export interface Endpoints<O> {
1793
1813
  listThreadMembers: (channelId: string, params?: Partial<ListThreadMemberParams>, options?: O) => RestResponse<Array<ThreadMember>>;
1794
1814
  /** Returns an array of voice region objects that can be used when setting a voice or stage channel's rtc_region. */
1795
1815
  listVoiceRegions: (options?: O) => RestResponse<Array<VoiceRegion>>;
1816
+ /** Modify the given emoji. Returns the updated emoji object on success. */
1817
+ modifyApplicationEmoji: (applicationId: string, emojiId: string, params?: Partial<ModifyApplicationEmojiParams>, options?: O) => RestResponse<Emoji>;
1796
1818
  /** Modify an existing rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Update Gateway event. */
1797
1819
  modifyAutoModerationRule: (guildId: string, autoModerationRuleId: string, params?: Partial<ModifyAutoModerationRuleParams>, options?: O) => RestResponse<AutoModerationRule>;
1798
1820
  /** Update a channel's settings. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. All JSON parameters are optional. */
@@ -2135,7 +2157,7 @@ export interface GetGuildAuditLogParams {
2135
2157
  }
2136
2158
  export interface GetGuildBanParams {
2137
2159
  /** number of users to return (up to maximum 1000) */
2138
- readonly limit?: Number;
2160
+ readonly limit?: number;
2139
2161
  /** consider only users before given user id */
2140
2162
  readonly before?: Snowflake;
2141
2163
  /** consider only users after given user id */
@@ -2157,7 +2179,7 @@ export interface GetGuildScheduledEventParams {
2157
2179
  }
2158
2180
  export interface GetGuildScheduledEventUserParams {
2159
2181
  /** number of users to return (up to maximum 100) */
2160
- readonly limit?: Number;
2182
+ readonly limit?: number;
2161
2183
  /** include guild member data if it exists */
2162
2184
  readonly with_member?: boolean;
2163
2185
  /** consider only users before given user id */
@@ -2592,6 +2614,8 @@ export interface GuildScheduledEvent {
2592
2614
  readonly user_count?: number;
2593
2615
  /** the cover image hash of the scheduled event */
2594
2616
  readonly image?: string | null;
2617
+ /** the definition for how often this event should recur */
2618
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule | null;
2595
2619
  }
2596
2620
  export type GuildScheduledEventCreateEvent = GuildScheduledEvent;
2597
2621
  export type GuildScheduledEventDeleteEvent = GuildScheduledEvent;
@@ -2608,6 +2632,63 @@ export declare enum GuildScheduledEventPrivacyLevel {
2608
2632
  /** the scheduled event is only accessible to guild members */
2609
2633
  GUILD_ONLY = 2
2610
2634
  }
2635
+ export interface GuildScheduledEventRecurrenceRule {
2636
+ /** Starting time of the recurrence interval */
2637
+ readonly start: string;
2638
+ /** Ending time of the recurrence interval */
2639
+ readonly end?: string | null;
2640
+ /** How often the event occurs */
2641
+ readonly frequency: GuildScheduledEventRecurrenceRuleFrequency;
2642
+ /** The spacing between the events, defined by frequency. For example, frecency of WEEKLY and an interval of 2 would be "every-other week" */
2643
+ readonly interval: number;
2644
+ /** Set of specific days within a week for the event to recur on */
2645
+ readonly by_weekday?: Array<GuildScheduledEventRecurrenceRuleWeekday> | null;
2646
+ /** List of specific days within a specific week (1-5) to recur on */
2647
+ readonly by_n_weekday?: Array<GuildScheduledEventRecurrenceRuleNWeekday> | null;
2648
+ /** Set of specific months to recur on */
2649
+ readonly by_month?: Array<GuildScheduledEventRecurrenceRuleMonth> | null;
2650
+ /** Set of specific dates within a month to recur on */
2651
+ readonly by_month_day?: Array<number> | null;
2652
+ /** Set of days within a year to recur on (1-364) */
2653
+ readonly by_year_day?: Array<number> | null;
2654
+ /** The total amount of times that the event is allowed to recur before stopping */
2655
+ readonly count?: number | null;
2656
+ }
2657
+ export declare enum GuildScheduledEventRecurrenceRuleFrequency {
2658
+ YEARLY = 0,
2659
+ MONTHLY = 1,
2660
+ WEEKLY = 2,
2661
+ DAILY = 3
2662
+ }
2663
+ export declare enum GuildScheduledEventRecurrenceRuleMonth {
2664
+ JANUARY = 1,
2665
+ FEBRUARY = 2,
2666
+ MARCH = 3,
2667
+ APRIL = 4,
2668
+ MAY = 5,
2669
+ JUNE = 6,
2670
+ JULY = 7,
2671
+ AUGUST = 8,
2672
+ SEPTEMBER = 9,
2673
+ OCTOBER = 10,
2674
+ NOVEMBER = 11,
2675
+ DECEMBER = 12
2676
+ }
2677
+ export interface GuildScheduledEventRecurrenceRuleNWeekday {
2678
+ /** The week to reoccur on. 1 - 5 */
2679
+ readonly n: number;
2680
+ /** The day within the week to reoccur on */
2681
+ readonly day: GuildScheduledEventRecurrenceRuleWeekday;
2682
+ }
2683
+ export declare enum GuildScheduledEventRecurrenceRuleWeekday {
2684
+ MONDAY = 0,
2685
+ TUESDAY = 1,
2686
+ WEDNESDAY = 2,
2687
+ THURSDAY = 3,
2688
+ FRIDAY = 4,
2689
+ SATURDAY = 5,
2690
+ SUNDAY = 6
2691
+ }
2611
2692
  export declare enum GuildScheduledEventStatus {
2612
2693
  SCHEDULED = 1,
2613
2694
  ACTIVE = 2,
@@ -3171,7 +3252,7 @@ export interface Message {
3171
3252
  /** roles specifically mentioned in this message */
3172
3253
  readonly mention_roles: Array<Snowflake>;
3173
3254
  /** channels specifically mentioned in this message */
3174
- readonly mention_channels?: Array<ChannelMention>;
3255
+ readonly mention_channels: Array<ChannelMention>;
3175
3256
  /** any attached files */
3176
3257
  readonly attachments: Array<Attachment>;
3177
3258
  /** any embedded content */
@@ -3192,10 +3273,12 @@ export interface Message {
3192
3273
  readonly application?: Application;
3193
3274
  /** if the message is an Interaction or application-owned webhook, this is the id of the application */
3194
3275
  readonly application_id?: Snowflake;
3195
- /** data showing the source of a crosspost, channel follow add, pin, or reply message */
3196
- readonly message_reference?: MessageReference;
3197
3276
  /** message flags combined as a bitfield */
3198
3277
  readonly flags?: number;
3278
+ /** data showing the source of a crosspost, channel follow add, pin, or reply message */
3279
+ readonly message_reference?: MessageReference;
3280
+ /** the message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.) */
3281
+ readonly message_snapshots: Array<MessageSnapshot>;
3199
3282
  /** the message associated with the message_reference */
3200
3283
  readonly referenced_message?: Message | null;
3201
3284
  /** In preview. Sent if the message is sent as a result of an interaction */
@@ -3205,7 +3288,7 @@ export interface Message {
3205
3288
  /** the thread that was started from this message, includes thread member object */
3206
3289
  readonly thread?: Channel;
3207
3290
  /** sent if the message contains components like buttons, action rows, or other interactive components */
3208
- readonly components?: Array<Component>;
3291
+ readonly components: Array<Component>;
3209
3292
  /** sent if the message contains stickers */
3210
3293
  readonly sticker_items?: Array<StickerItem>;
3211
3294
  /** Deprecated the stickers sent with the message */
@@ -3217,7 +3300,7 @@ export interface Message {
3217
3300
  /** data for users, members, channels, and roles in the message's auto-populated select menus */
3218
3301
  readonly resolved?: ResolvedDatum;
3219
3302
  /** A poll! */
3220
- readonly poll?: Poll;
3303
+ readonly poll: Poll;
3221
3304
  /** the call associated with the message */
3222
3305
  readonly call?: MessageCall;
3223
3306
  }
@@ -3407,6 +3490,8 @@ export interface MessageReactionRemoveEvent {
3407
3490
  readonly type: ReactionType;
3408
3491
  }
3409
3492
  export interface MessageReference {
3493
+ /** type of reference. */
3494
+ readonly type?: MessageReferenceType;
3410
3495
  /** id of the originating message */
3411
3496
  readonly message_id?: Snowflake;
3412
3497
  /** id of the originating message's channel */
@@ -3416,6 +3501,16 @@ export interface MessageReference {
3416
3501
  /** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */
3417
3502
  readonly fail_if_not_exists?: boolean;
3418
3503
  }
3504
+ export declare enum MessageReferenceType {
3505
+ /** A standard reference used by replies. */
3506
+ DEFAULT = 0,
3507
+ /** Reference used to point to a message at a point in time. */
3508
+ FORWARD = 1
3509
+ }
3510
+ export interface MessageSnapshot {
3511
+ /** minimal subset of fields in the forwarded message */
3512
+ readonly message: Message;
3513
+ }
3419
3514
  export declare enum MessageType {
3420
3515
  DEFAULT = 0,
3421
3516
  RECIPIENT_ADD = 1,
@@ -3467,6 +3562,10 @@ export interface ModalSubmitDatum {
3467
3562
  /** the values submitted by the user */
3468
3563
  readonly components: Array<Component>;
3469
3564
  }
3565
+ export interface ModifyApplicationEmojiParams {
3566
+ /** name of the emoji */
3567
+ readonly name: string;
3568
+ }
3470
3569
  export interface ModifyAutoModerationRuleParams {
3471
3570
  /** the rule name */
3472
3571
  readonly name: string;
@@ -3705,6 +3804,8 @@ export interface ModifyGuildScheduledEventParams {
3705
3804
  readonly status?: GuildScheduledEventStatus;
3706
3805
  /** the cover image of the scheduled event */
3707
3806
  readonly image?: string;
3807
+ /** the definition for how often this event should recur */
3808
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule;
3708
3809
  }
3709
3810
  export interface ModifyGuildStickerParams {
3710
3811
  /** name of the sticker (2-30 characters) */