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/src/types.ts CHANGED
@@ -112,7 +112,7 @@ export interface ActivityTimestamp {
112
112
  readonly end?: number
113
113
  }
114
114
  export enum ActivityType {
115
- GAME = 0,
115
+ PLAYING = 0,
116
116
  STREAMING = 1,
117
117
  LISTENING = 2,
118
118
  WATCHING = 3,
@@ -202,7 +202,7 @@ export interface Application {
202
202
  readonly tags?: Array<string>
203
203
  /** Settings for the app's default in-app authorization link, if enabled */
204
204
  readonly install_params?: InstallParam
205
- /** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
205
+ /** Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
206
206
  readonly integration_types_config?: ApplicationIntegrationType
207
207
  /** Default custom authorization URL for the app, if enabled */
208
208
  readonly custom_install_url?: string
@@ -974,6 +974,12 @@ export interface Connection {
974
974
  /** visibility of this connection */
975
975
  readonly visibility: VisibilityType
976
976
  }
977
+ export interface CreateApplicationEmojiParams {
978
+ /** name of the emoji */
979
+ readonly name: string
980
+ /** the 128x128 emoji image */
981
+ readonly image: string
982
+ }
977
983
  export interface CreateAutoModerationRuleParams {
978
984
  /** the rule name */
979
985
  readonly name: string
@@ -1183,6 +1189,8 @@ export interface CreateGuildScheduledEventParams {
1183
1189
  readonly entity_type: GuildScheduledEventEntityType
1184
1190
  /** the cover image of the scheduled event */
1185
1191
  readonly image?: string
1192
+ /** the definition for how often this event should recur */
1193
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule
1186
1194
  }
1187
1195
  export interface CreateGuildStickerParams {
1188
1196
  /** name of the sticker (2-30 characters) */
@@ -1211,7 +1219,7 @@ export interface CreateMessageParams {
1211
1219
  readonly embeds?: Array<Embed>
1212
1220
  /** Allowed mentions for the message */
1213
1221
  readonly allowed_mentions?: AllowedMention
1214
- /** Include to make your message a reply */
1222
+ /** Include to make your message a reply or a forward */
1215
1223
  readonly message_reference?: MessageReference
1216
1224
  /** Components to include with the message */
1217
1225
  readonly components?: Array<Component>
@@ -1304,6 +1312,13 @@ export function createRoutes<O = any>(
1304
1312
  url: `/applications/${applicationId}/entitlements/${entitlementId}/consume`,
1305
1313
  options,
1306
1314
  }),
1315
+ createApplicationEmoji: (applicationId, params, options) =>
1316
+ fetch({
1317
+ method: "POST",
1318
+ url: `/applications/${applicationId}/emojis`,
1319
+ params,
1320
+ options,
1321
+ }),
1307
1322
  createAutoModerationRule: (guildId, params, options) =>
1308
1323
  fetch({
1309
1324
  method: "POST",
@@ -1479,6 +1494,12 @@ export function createRoutes<O = any>(
1479
1494
  url: `/channels/${channelId}/messages/${messageId}/reactions/${emoji}`,
1480
1495
  options,
1481
1496
  }),
1497
+ deleteApplicationEmoji: (applicationId, emojiId, options) =>
1498
+ fetch({
1499
+ method: "DELETE",
1500
+ url: `/applications/${applicationId}/emojis/${emojiId}`,
1501
+ options,
1502
+ }),
1482
1503
  deleteAutoModerationRule: (guildId, autoModerationRuleId, options) =>
1483
1504
  fetch({
1484
1505
  method: "DELETE",
@@ -1774,6 +1795,12 @@ export function createRoutes<O = any>(
1774
1795
  url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`,
1775
1796
  options,
1776
1797
  }),
1798
+ getApplicationEmoji: (applicationId, emojiId, options) =>
1799
+ fetch({
1800
+ method: "GET",
1801
+ url: `/applications/${applicationId}/emojis/${emojiId}`,
1802
+ options,
1803
+ }),
1777
1804
  getApplicationRoleConnectionMetadataRecords: (applicationId, options) =>
1778
1805
  fetch({
1779
1806
  method: "GET",
@@ -1866,6 +1893,12 @@ export function createRoutes<O = any>(
1866
1893
  params,
1867
1894
  options,
1868
1895
  }),
1896
+ getCurrentUserVoiceState: (guildId, options) =>
1897
+ fetch({
1898
+ method: "GET",
1899
+ url: `/guilds/${guildId}/voice-states/@me`,
1900
+ options,
1901
+ }),
1869
1902
  getFollowupMessage: (
1870
1903
  applicationId,
1871
1904
  interactionToken,
@@ -2142,6 +2175,12 @@ export function createRoutes<O = any>(
2142
2175
  url: `/users/${userId}`,
2143
2176
  options,
2144
2177
  }),
2178
+ getUserVoiceState: (guildId, userId, options) =>
2179
+ fetch({
2180
+ method: "GET",
2181
+ url: `/guilds/${guildId}/voice-states/${userId}`,
2182
+ options,
2183
+ }),
2145
2184
  getWebhook: (webhookId, options) =>
2146
2185
  fetch({
2147
2186
  method: "GET",
@@ -2198,6 +2237,12 @@ export function createRoutes<O = any>(
2198
2237
  url: `/guilds/${guildId}/threads/active`,
2199
2238
  options,
2200
2239
  }),
2240
+ listApplicationEmojis: (applicationId, options) =>
2241
+ fetch({
2242
+ method: "GET",
2243
+ url: `/applications/${applicationId}/emojis`,
2244
+ options,
2245
+ }),
2201
2246
  listAutoModerationRulesForGuild: (guildId, options) =>
2202
2247
  fetch({
2203
2248
  method: "GET",
@@ -2282,6 +2327,13 @@ export function createRoutes<O = any>(
2282
2327
  url: `/voice/regions`,
2283
2328
  options,
2284
2329
  }),
2330
+ modifyApplicationEmoji: (applicationId, emojiId, params, options) =>
2331
+ fetch({
2332
+ method: "PATCH",
2333
+ url: `/applications/${applicationId}/emojis/${emojiId}`,
2334
+ params,
2335
+ options,
2336
+ }),
2285
2337
  modifyAutoModerationRule: (
2286
2338
  guildId,
2287
2339
  autoModerationRuleId,
@@ -2601,7 +2653,7 @@ export interface EditCurrentApplicationParams {
2601
2653
  readonly role_connections_verification_url: string
2602
2654
  /** Settings for the app's default in-app authorization link, if enabled */
2603
2655
  readonly install_params: InstallParam
2604
- /** In preview. Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
2656
+ /** Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object */
2605
2657
  readonly integration_types_config: ApplicationIntegrationType
2606
2658
  /** App's public flags */
2607
2659
  readonly flags: number
@@ -2874,6 +2926,12 @@ export interface Endpoints<O> {
2874
2926
  entitlementId: string,
2875
2927
  options?: O,
2876
2928
  ) => RestResponse<any>
2929
+ /** Create a new emoji for the application. Returns the new emoji object on success. */
2930
+ createApplicationEmoji: (
2931
+ applicationId: string,
2932
+ params?: Partial<CreateApplicationEmojiParams>,
2933
+ options?: O,
2934
+ ) => RestResponse<Emoji>
2877
2935
  /** Create a new rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Create Gateway event. */
2878
2936
  createAutoModerationRule: (
2879
2937
  guildId: string,
@@ -3023,6 +3081,12 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3023
3081
  emoji: string,
3024
3082
  options?: O,
3025
3083
  ) => RestResponse<any>
3084
+ /** Delete the given emoji. Returns 204 No Content on success. */
3085
+ deleteApplicationEmoji: (
3086
+ applicationId: string,
3087
+ emojiId: string,
3088
+ options?: O,
3089
+ ) => RestResponse<any>
3026
3090
  /** Delete a rule. Returns a 204 on success. Fires an Auto Moderation Rule Delete Gateway event. */
3027
3091
  deleteAutoModerationRule: (
3028
3092
  guildId: string,
@@ -3258,6 +3322,12 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3258
3322
  commandId: string,
3259
3323
  options?: O,
3260
3324
  ) => RestResponse<GuildApplicationCommandPermission>
3325
+ /** Returns an emoji object for the given application and emoji IDs. Includes the user field. */
3326
+ getApplicationEmoji: (
3327
+ applicationId: string,
3328
+ emojiId: string,
3329
+ options?: O,
3330
+ ) => RestResponse<Emoji>
3261
3331
  /** Returns a list of application role connection metadata objects for the given application. */
3262
3332
  getApplicationRoleConnectionMetadataRecords: (
3263
3333
  applicationId: string,
@@ -3322,6 +3392,11 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3322
3392
  params?: Partial<GetCurrentUserGuildParams>,
3323
3393
  options?: O,
3324
3394
  ) => RestResponse<Array<Guild>>
3395
+ /** Returns the current user's voice state in the guild. */
3396
+ getCurrentUserVoiceState: (
3397
+ guildId: string,
3398
+ options?: O,
3399
+ ) => RestResponse<VoiceState>
3325
3400
  /** Returns a followup message for an Interaction. Functions the same as Get Webhook Message. */
3326
3401
  getFollowupMessage: (
3327
3402
  applicationId: string,
@@ -3526,6 +3601,12 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3526
3601
  ) => RestResponse<ThreadMember>
3527
3602
  /** Returns a user object for a given user ID. */
3528
3603
  getUser: (userId: string, options?: O) => RestResponse<User>
3604
+ /** Returns the specified user's voice state in the guild. */
3605
+ getUserVoiceState: (
3606
+ guildId: string,
3607
+ userId: string,
3608
+ options?: O,
3609
+ ) => RestResponse<VoiceState>
3529
3610
  /** Returns the new webhook object for the given id. */
3530
3611
  getWebhook: (webhookId: string, options?: O) => RestResponse<Webhook>
3531
3612
  /** Returns a previously-sent webhook message from the same token. Returns a message object on success. */
@@ -3566,6 +3647,11 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3566
3647
  guildId: string,
3567
3648
  options?: O,
3568
3649
  ) => RestResponse<ListActiveGuildThreadResponse>
3650
+ /** 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. */
3651
+ listApplicationEmojis: (
3652
+ applicationId: string,
3653
+ options?: O,
3654
+ ) => RestResponse<Array<Emoji>>
3569
3655
  /** Get a list of all rules currently configured for the guild. Returns a list of auto moderation rule objects for the given guild. */
3570
3656
  listAutoModerationRulesForGuild: (
3571
3657
  guildId: string,
@@ -3621,6 +3707,13 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3621
3707
  ) => RestResponse<Array<ThreadMember>>
3622
3708
  /** Returns an array of voice region objects that can be used when setting a voice or stage channel's rtc_region. */
3623
3709
  listVoiceRegions: (options?: O) => RestResponse<Array<VoiceRegion>>
3710
+ /** Modify the given emoji. Returns the updated emoji object on success. */
3711
+ modifyApplicationEmoji: (
3712
+ applicationId: string,
3713
+ emojiId: string,
3714
+ params?: Partial<ModifyApplicationEmojiParams>,
3715
+ options?: O,
3716
+ ) => RestResponse<Emoji>
3624
3717
  /** Modify an existing rule. Returns an auto moderation rule on success. Fires an Auto Moderation Rule Update Gateway event. */
3625
3718
  modifyAutoModerationRule: (
3626
3719
  guildId: string,
@@ -4114,7 +4207,7 @@ export interface GetGuildAuditLogParams {
4114
4207
  }
4115
4208
  export interface GetGuildBanParams {
4116
4209
  /** number of users to return (up to maximum 1000) */
4117
- readonly limit?: Number
4210
+ readonly limit?: number
4118
4211
  /** consider only users before given user id */
4119
4212
  readonly before?: Snowflake
4120
4213
  /** consider only users after given user id */
@@ -4136,7 +4229,7 @@ export interface GetGuildScheduledEventParams {
4136
4229
  }
4137
4230
  export interface GetGuildScheduledEventUserParams {
4138
4231
  /** number of users to return (up to maximum 100) */
4139
- readonly limit?: Number
4232
+ readonly limit?: number
4140
4233
  /** include guild member data if it exists */
4141
4234
  readonly with_member?: boolean
4142
4235
  /** consider only users before given user id */
@@ -4571,6 +4664,8 @@ export interface GuildScheduledEvent {
4571
4664
  readonly user_count?: number
4572
4665
  /** the cover image hash of the scheduled event */
4573
4666
  readonly image?: string | null
4667
+ /** the definition for how often this event should recur */
4668
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule | null
4574
4669
  }
4575
4670
  export type GuildScheduledEventCreateEvent = GuildScheduledEvent
4576
4671
  export type GuildScheduledEventDeleteEvent = GuildScheduledEvent
@@ -4587,6 +4682,63 @@ export enum GuildScheduledEventPrivacyLevel {
4587
4682
  /** the scheduled event is only accessible to guild members */
4588
4683
  GUILD_ONLY = 2,
4589
4684
  }
4685
+ export interface GuildScheduledEventRecurrenceRule {
4686
+ /** Starting time of the recurrence interval */
4687
+ readonly start: string
4688
+ /** Ending time of the recurrence interval */
4689
+ readonly end?: string | null
4690
+ /** How often the event occurs */
4691
+ readonly frequency: GuildScheduledEventRecurrenceRuleFrequency
4692
+ /** The spacing between the events, defined by frequency. For example, frecency of WEEKLY and an interval of 2 would be "every-other week" */
4693
+ readonly interval: number
4694
+ /** Set of specific days within a week for the event to recur on */
4695
+ readonly by_weekday?: Array<GuildScheduledEventRecurrenceRuleWeekday> | null
4696
+ /** List of specific days within a specific week (1-5) to recur on */
4697
+ readonly by_n_weekday?: Array<GuildScheduledEventRecurrenceRuleNWeekday> | null
4698
+ /** Set of specific months to recur on */
4699
+ readonly by_month?: Array<GuildScheduledEventRecurrenceRuleMonth> | null
4700
+ /** Set of specific dates within a month to recur on */
4701
+ readonly by_month_day?: Array<number> | null
4702
+ /** Set of days within a year to recur on (1-364) */
4703
+ readonly by_year_day?: Array<number> | null
4704
+ /** The total amount of times that the event is allowed to recur before stopping */
4705
+ readonly count?: number | null
4706
+ }
4707
+ export enum GuildScheduledEventRecurrenceRuleFrequency {
4708
+ YEARLY = 0,
4709
+ MONTHLY = 1,
4710
+ WEEKLY = 2,
4711
+ DAILY = 3,
4712
+ }
4713
+ export enum GuildScheduledEventRecurrenceRuleMonth {
4714
+ JANUARY = 1,
4715
+ FEBRUARY = 2,
4716
+ MARCH = 3,
4717
+ APRIL = 4,
4718
+ MAY = 5,
4719
+ JUNE = 6,
4720
+ JULY = 7,
4721
+ AUGUST = 8,
4722
+ SEPTEMBER = 9,
4723
+ OCTOBER = 10,
4724
+ NOVEMBER = 11,
4725
+ DECEMBER = 12,
4726
+ }
4727
+ export interface GuildScheduledEventRecurrenceRuleNWeekday {
4728
+ /** The week to reoccur on. 1 - 5 */
4729
+ readonly n: number
4730
+ /** The day within the week to reoccur on */
4731
+ readonly day: GuildScheduledEventRecurrenceRuleWeekday
4732
+ }
4733
+ export enum GuildScheduledEventRecurrenceRuleWeekday {
4734
+ MONDAY = 0,
4735
+ TUESDAY = 1,
4736
+ WEDNESDAY = 2,
4737
+ THURSDAY = 3,
4738
+ FRIDAY = 4,
4739
+ SATURDAY = 5,
4740
+ SUNDAY = 6,
4741
+ }
4590
4742
  export enum GuildScheduledEventStatus {
4591
4743
  SCHEDULED = 1,
4592
4744
  ACTIVE = 2,
@@ -5158,7 +5310,7 @@ export interface Message {
5158
5310
  /** roles specifically mentioned in this message */
5159
5311
  readonly mention_roles: Array<Snowflake>
5160
5312
  /** channels specifically mentioned in this message */
5161
- readonly mention_channels?: Array<ChannelMention>
5313
+ readonly mention_channels: Array<ChannelMention>
5162
5314
  /** any attached files */
5163
5315
  readonly attachments: Array<Attachment>
5164
5316
  /** any embedded content */
@@ -5179,10 +5331,12 @@ export interface Message {
5179
5331
  readonly application?: Application
5180
5332
  /** if the message is an Interaction or application-owned webhook, this is the id of the application */
5181
5333
  readonly application_id?: Snowflake
5182
- /** data showing the source of a crosspost, channel follow add, pin, or reply message */
5183
- readonly message_reference?: MessageReference
5184
5334
  /** message flags combined as a bitfield */
5185
5335
  readonly flags?: number
5336
+ /** data showing the source of a crosspost, channel follow add, pin, or reply message */
5337
+ readonly message_reference?: MessageReference
5338
+ /** the message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.) */
5339
+ readonly message_snapshots: Array<MessageSnapshot>
5186
5340
  /** the message associated with the message_reference */
5187
5341
  readonly referenced_message?: Message | null
5188
5342
  /** In preview. Sent if the message is sent as a result of an interaction */
@@ -5192,7 +5346,7 @@ export interface Message {
5192
5346
  /** the thread that was started from this message, includes thread member object */
5193
5347
  readonly thread?: Channel
5194
5348
  /** sent if the message contains components like buttons, action rows, or other interactive components */
5195
- readonly components?: Array<Component>
5349
+ readonly components: Array<Component>
5196
5350
  /** sent if the message contains stickers */
5197
5351
  readonly sticker_items?: Array<StickerItem>
5198
5352
  /** Deprecated the stickers sent with the message */
@@ -5204,7 +5358,7 @@ export interface Message {
5204
5358
  /** data for users, members, channels, and roles in the message's auto-populated select menus */
5205
5359
  readonly resolved?: ResolvedDatum
5206
5360
  /** A poll! */
5207
- readonly poll?: Poll
5361
+ readonly poll: Poll
5208
5362
  /** the call associated with the message */
5209
5363
  readonly call?: MessageCall
5210
5364
  }
@@ -5394,6 +5548,8 @@ export interface MessageReactionRemoveEvent {
5394
5548
  readonly type: ReactionType
5395
5549
  }
5396
5550
  export interface MessageReference {
5551
+ /** type of reference. */
5552
+ readonly type?: MessageReferenceType
5397
5553
  /** id of the originating message */
5398
5554
  readonly message_id?: Snowflake
5399
5555
  /** id of the originating message's channel */
@@ -5403,6 +5559,16 @@ export interface MessageReference {
5403
5559
  /** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */
5404
5560
  readonly fail_if_not_exists?: boolean
5405
5561
  }
5562
+ export enum MessageReferenceType {
5563
+ /** A standard reference used by replies. */
5564
+ DEFAULT = 0,
5565
+ /** Reference used to point to a message at a point in time. */
5566
+ FORWARD = 1,
5567
+ }
5568
+ export interface MessageSnapshot {
5569
+ /** minimal subset of fields in the forwarded message */
5570
+ readonly message: Message
5571
+ }
5406
5572
  export enum MessageType {
5407
5573
  DEFAULT = 0,
5408
5574
  RECIPIENT_ADD = 1,
@@ -5454,6 +5620,10 @@ export interface ModalSubmitDatum {
5454
5620
  /** the values submitted by the user */
5455
5621
  readonly components: Array<Component>
5456
5622
  }
5623
+ export interface ModifyApplicationEmojiParams {
5624
+ /** name of the emoji */
5625
+ readonly name: string
5626
+ }
5457
5627
  export interface ModifyAutoModerationRuleParams {
5458
5628
  /** the rule name */
5459
5629
  readonly name: string
@@ -5695,6 +5865,8 @@ export interface ModifyGuildScheduledEventParams {
5695
5865
  readonly status?: GuildScheduledEventStatus
5696
5866
  /** the cover image of the scheduled event */
5697
5867
  readonly image?: string
5868
+ /** the definition for how often this event should recur */
5869
+ readonly recurrence_rule?: GuildScheduledEventRecurrenceRule
5698
5870
  }
5699
5871
  export interface ModifyGuildStickerParams {
5700
5872
  /** name of the sticker (2-30 characters) */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const LIB_VERSION = "0.98.1";
1
+ export const LIB_VERSION = "0.99.0";