dfx 0.20.5 → 0.21.1

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.
Files changed (118) hide show
  1. package/Cache/driver.d.ts +16 -16
  2. package/Cache/driver.js.map +1 -1
  3. package/Cache/index.d.ts +21 -21
  4. package/Cache/index.js +12 -13
  5. package/Cache/index.js.map +1 -1
  6. package/Cache/memory.d.ts +3 -3
  7. package/Cache/memory.js +19 -20
  8. package/Cache/memory.js.map +1 -1
  9. package/Cache/memoryTTL.d.ts +5 -5
  10. package/Cache/memoryTTL.js +16 -16
  11. package/Cache/memoryTTL.js.map +1 -1
  12. package/Cache/prelude.d.ts +41 -41
  13. package/Cache/prelude.js +39 -41
  14. package/Cache/prelude.js.map +1 -1
  15. package/DiscordConfig/index.d.ts +4 -19
  16. package/DiscordConfig/index.js +5 -12
  17. package/DiscordConfig/index.js.map +1 -1
  18. package/DiscordGateway/DiscordWS/index.d.ts +9 -9
  19. package/DiscordGateway/DiscordWS/index.js +16 -20
  20. package/DiscordGateway/DiscordWS/index.js.map +1 -1
  21. package/DiscordGateway/Shard/heartbeats.d.ts +3 -4
  22. package/DiscordGateway/Shard/heartbeats.js +9 -16
  23. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  24. package/DiscordGateway/Shard/identify.d.ts +4 -4
  25. package/DiscordGateway/Shard/identify.js +5 -4
  26. package/DiscordGateway/Shard/identify.js.map +1 -1
  27. package/DiscordGateway/Shard/index.d.ts +8 -7
  28. package/DiscordGateway/Shard/index.js +17 -20
  29. package/DiscordGateway/Shard/index.js.map +1 -1
  30. package/DiscordGateway/Shard/invalidSession.d.ts +2 -3
  31. package/DiscordGateway/Shard/invalidSession.js +5 -8
  32. package/DiscordGateway/Shard/invalidSession.js.map +1 -1
  33. package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
  34. package/DiscordGateway/Shard/sendEvents.js +7 -7
  35. package/DiscordGateway/Shard/sendEvents.js.map +1 -1
  36. package/DiscordGateway/Shard/utils.d.ts +3 -4
  37. package/DiscordGateway/Shard/utils.js +6 -6
  38. package/DiscordGateway/Shard/utils.js.map +1 -1
  39. package/DiscordGateway/ShardStore/index.d.ts +6 -6
  40. package/DiscordGateway/ShardStore/index.js +7 -10
  41. package/DiscordGateway/ShardStore/index.js.map +1 -1
  42. package/DiscordGateway/Sharder/index.d.ts +11 -11
  43. package/DiscordGateway/Sharder/index.js +21 -42
  44. package/DiscordGateway/Sharder/index.js.map +1 -1
  45. package/DiscordGateway/WS/index.d.ts +3 -2
  46. package/DiscordGateway/WS/index.js +30 -40
  47. package/DiscordGateway/WS/index.js.map +1 -1
  48. package/DiscordGateway/index.d.ts +8 -9
  49. package/DiscordGateway/index.js +10 -15
  50. package/DiscordGateway/index.js.map +1 -1
  51. package/DiscordREST/index.d.ts +132 -132
  52. package/DiscordREST/index.js +37 -40
  53. package/DiscordREST/index.js.map +1 -1
  54. package/DiscordREST/types.d.ts +6 -6
  55. package/DiscordREST/utils.d.ts +5 -4
  56. package/DiscordREST/utils.js +5 -5
  57. package/DiscordREST/utils.js.map +1 -1
  58. package/Helpers/intents.js +8 -8
  59. package/Helpers/intents.js.map +1 -1
  60. package/Helpers/interactions.d.ts +18 -19
  61. package/Helpers/interactions.js +22 -23
  62. package/Helpers/interactions.js.map +1 -1
  63. package/Helpers/members.d.ts +2 -2
  64. package/Helpers/members.js.map +1 -1
  65. package/Helpers/permissions.d.ts +4 -4
  66. package/Helpers/permissions.js +13 -13
  67. package/Helpers/permissions.js.map +1 -1
  68. package/Http/index.d.ts +10 -9
  69. package/Http/index.js +7 -8
  70. package/Http/index.js.map +1 -1
  71. package/Interactions/context.d.ts +22 -23
  72. package/Interactions/context.js +21 -21
  73. package/Interactions/context.js.map +1 -1
  74. package/Interactions/definitions.d.ts +31 -31
  75. package/Interactions/definitions.js +1 -2
  76. package/Interactions/definitions.js.map +1 -1
  77. package/Interactions/gateway.d.ts +4 -3
  78. package/Interactions/gateway.js +6 -6
  79. package/Interactions/gateway.js.map +1 -1
  80. package/Interactions/handlers.d.ts +3 -4
  81. package/Interactions/handlers.js +23 -23
  82. package/Interactions/handlers.js.map +1 -1
  83. package/Interactions/index.d.ts +11 -11
  84. package/Interactions/index.js +11 -10
  85. package/Interactions/index.js.map +1 -1
  86. package/Interactions/webhook.d.ts +7 -8
  87. package/Interactions/webhook.js +11 -12
  88. package/Interactions/webhook.js.map +1 -1
  89. package/Log/index.d.ts +8 -7
  90. package/Log/index.js +9 -11
  91. package/Log/index.js.map +1 -1
  92. package/RateLimit/index.d.ts +13 -12
  93. package/RateLimit/index.js +11 -12
  94. package/RateLimit/index.js.map +1 -1
  95. package/RateLimit/memory.d.ts +1 -1
  96. package/RateLimit/memory.js +7 -7
  97. package/RateLimit/memory.js.map +1 -1
  98. package/RateLimit/utils.d.ts +2 -2
  99. package/RateLimit/utils.js.map +1 -1
  100. package/_common.d.ts +19 -0
  101. package/_common.js +20 -0
  102. package/_common.js.map +1 -0
  103. package/gateway.d.ts +11 -10
  104. package/gateway.js +17 -14
  105. package/gateway.js.map +1 -1
  106. package/package.json +6 -16
  107. package/utils/effect.d.ts +8 -8
  108. package/utils/effect.js +4 -4
  109. package/utils/effect.js.map +1 -1
  110. package/webhooks.d.ts +6 -5
  111. package/webhooks.js +12 -8
  112. package/webhooks.js.map +1 -1
  113. package/global.d.ts +0 -21
  114. package/global.js +0 -2
  115. package/global.js.map +0 -1
  116. package/utils/common.d.ts +0 -18
  117. package/utils/common.js +0 -3
  118. package/utils/common.js.map +0 -1
@@ -1,43 +1,43 @@
1
- import { BucketDetails, FetchError, StatusCodeError, JsonParseError, Discord } from "dfx";
2
- import { Effect } from "dfx/utils/common";
1
+ import { Config, FetchError, Http, JsonParseError, Log, RateLimiter, RateLimitStore, StatusCodeError } from "dfx";
3
2
  import { Success } from "dfx/utils/effect";
3
+ import { Context, Discord, Effect, Layer } from "dfx/_common";
4
4
  import { ResponseWithData, RestResponse } from "./types.js";
5
- declare const make: import("../utils/common.js").Effect<import("../Log/index.js").Log | import("../DiscordConfig/index.js").DiscordConfig | import("../index.js").Http | import("../index.js").RateLimitStore | import("../index.js").RateLimiter, never, {
6
- addGuildMember: (guildId: string, userId: string, params?: Partial<import("../types.js").AddGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
5
+ declare const make: Effect.Effect<Config.DiscordConfig | Http | Log.Log | RateLimitStore | RateLimiter, never, {
6
+ addGuildMember: (guildId: string, userId: string, params?: Partial<Discord.AddGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember>;
7
7
  addGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
8
8
  addThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
9
9
  batchEditApplicationCommandPermissions: (applicationId: string, guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
10
- beginGuildPrune: (guildId: string, params?: Partial<import("../types.js").BeginGuildPruneParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
11
- bulkDeleteMessages: (channelId: string, params?: Partial<import("../types.js").BulkDeleteMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
12
- bulkOverwriteGlobalApplicationCommands: (applicationId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
13
- bulkOverwriteGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<import("../types.js").BulkOverwriteGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
14
- createAutoModerationRule: (guildId: string, params?: Partial<import("../types.js").CreateAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule>;
15
- createChannelInvite: (channelId: string, params?: Partial<import("../types.js").CreateChannelInviteParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
16
- createDm: (params?: Partial<import("../types.js").CreateDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
10
+ beginGuildPrune: (guildId: string, params?: Partial<Discord.BeginGuildPruneParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
11
+ bulkDeleteMessages: (channelId: string, params?: Partial<Discord.BulkDeleteMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
12
+ bulkOverwriteGlobalApplicationCommands: (applicationId: string, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand[]>;
13
+ bulkOverwriteGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<Discord.BulkOverwriteGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand[]>;
14
+ createAutoModerationRule: (guildId: string, params?: Partial<Discord.CreateAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.AutoModerationRule>;
15
+ createChannelInvite: (channelId: string, params?: Partial<Discord.CreateChannelInviteParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Invite>;
16
+ createDm: (params?: Partial<Discord.CreateDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
17
17
  createFollowupMessage: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
18
- createGlobalApplicationCommand: (applicationId: string, params?: Partial<import("../types.js").CreateGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
19
- createGroupDm: (params?: Partial<import("../types.js").CreateGroupDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
20
- createGuild: (params?: Partial<import("../types.js").CreateGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
21
- createGuildApplicationCommand: (applicationId: string, guildId: string, params?: Partial<import("../types.js").CreateGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
22
- createGuildBan: (guildId: string, userId: string, params?: Partial<import("../types.js").CreateGuildBanParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
23
- createGuildChannel: (guildId: string, params?: Partial<import("../types.js").CreateGuildChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
24
- createGuildEmoji: (guildId: string, params?: Partial<import("../types.js").CreateGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji>;
25
- createGuildFromGuildTemplate: (templateCode: string, params?: Partial<import("../types.js").CreateGuildFromGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
26
- createGuildRole: (guildId: string, params?: Partial<import("../types.js").CreateGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role>;
27
- createGuildScheduledEvent: (guildId: string, params?: Partial<import("../types.js").CreateGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent>;
28
- createGuildSticker: (guildId: string, params?: Partial<import("../types.js").CreateGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
29
- createGuildTemplate: (guildId: string, params?: Partial<import("../types.js").CreateGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
30
- createInteractionResponse: (interactionId: string, interactionToken: string, params?: Partial<import("../types.js").InteractionResponse> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").InteractionResponse>;
31
- createMessage: (channelId: string, params?: Partial<import("../types.js").CreateMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
18
+ createGlobalApplicationCommand: (applicationId: string, params?: Partial<Discord.CreateGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
19
+ createGroupDm: (params?: Partial<Discord.CreateGroupDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
20
+ createGuild: (params?: Partial<Discord.CreateGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Guild>;
21
+ createGuildApplicationCommand: (applicationId: string, guildId: string, params?: Partial<Discord.CreateGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
22
+ createGuildBan: (guildId: string, userId: string, params?: Partial<Discord.CreateGuildBanParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
23
+ createGuildChannel: (guildId: string, params?: Partial<Discord.CreateGuildChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
24
+ createGuildEmoji: (guildId: string, params?: Partial<Discord.CreateGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Emoji>;
25
+ createGuildFromGuildTemplate: (templateCode: string, params?: Partial<Discord.CreateGuildFromGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Guild>;
26
+ createGuildRole: (guildId: string, params?: Partial<Discord.CreateGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Role>;
27
+ createGuildScheduledEvent: (guildId: string, params?: Partial<Discord.CreateGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildScheduledEvent>;
28
+ createGuildSticker: (guildId: string, params?: Partial<Discord.CreateGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Sticker>;
29
+ createGuildTemplate: (guildId: string, params?: Partial<Discord.CreateGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate>;
30
+ createInteractionResponse: (interactionId: string, interactionToken: string, params?: Partial<Discord.InteractionResponse> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.InteractionResponse>;
31
+ createMessage: (channelId: string, params?: Partial<Discord.CreateMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
32
32
  createReaction: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
33
- createStageInstance: (params?: Partial<import("../types.js").CreateStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").StageInstance>;
34
- createWebhook: (channelId: string, params?: Partial<import("../types.js").CreateWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
35
- crosspostMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
33
+ createStageInstance: (params?: Partial<Discord.CreateStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.StageInstance>;
34
+ createWebhook: (channelId: string, params?: Partial<Discord.CreateWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Webhook>;
35
+ crosspostMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
36
36
  deleteAllReactions: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
37
37
  deleteAllReactionsForEmoji: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
38
38
  deleteAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: RequestInit | undefined) => RestResponse<any>;
39
39
  deleteChannelPermission: (channelId: string, overwriteId: string, options?: RequestInit | undefined) => RestResponse<any>;
40
- deletecloseChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
40
+ deletecloseChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
41
41
  deleteFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
42
42
  deleteGlobalApplicationCommand: (applicationId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<any>;
43
43
  deleteGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
@@ -47,139 +47,139 @@ declare const make: import("../utils/common.js").Effect<import("../Log/index.js"
47
47
  deleteGuildRole: (guildId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
48
48
  deleteGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, options?: RequestInit | undefined) => RestResponse<any>;
49
49
  deleteGuildSticker: (guildId: string, stickerId: string, options?: RequestInit | undefined) => RestResponse<any>;
50
- deleteGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
51
- deleteInvite: (inviteCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
50
+ deleteGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate>;
51
+ deleteInvite: (inviteCode: string, options?: RequestInit | undefined) => RestResponse<Discord.Invite>;
52
52
  deleteMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
53
53
  deleteOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
54
54
  deleteOwnReaction: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
55
55
  deleteStageInstance: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
56
56
  deleteUserReaction: (channelId: string, messageId: string, emoji: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
57
57
  deleteWebhook: (webhookId: string, options?: RequestInit | undefined) => RestResponse<any>;
58
- deleteWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").DeleteWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
58
+ deleteWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<Discord.DeleteWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
59
59
  deleteWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
60
- editApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, params?: Partial<import("../types.js").EditApplicationCommandPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildApplicationCommandPermission>;
61
- editChannelPermissions: (channelId: string, overwriteId: string, params?: Partial<import("../types.js").EditChannelPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
60
+ editApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, params?: Partial<Discord.EditApplicationCommandPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildApplicationCommandPermission>;
61
+ editChannelPermissions: (channelId: string, overwriteId: string, params?: Partial<Discord.EditChannelPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
62
62
  editFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
63
- editGlobalApplicationCommand: (applicationId: string, commandId: string, params?: Partial<import("../types.js").EditGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
64
- editGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, params?: Partial<import("../types.js").EditGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
65
- editMessage: (channelId: string, messageId: string, params?: Partial<import("../types.js").EditMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
63
+ editGlobalApplicationCommand: (applicationId: string, commandId: string, params?: Partial<Discord.EditGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
64
+ editGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, params?: Partial<Discord.EditGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
65
+ editMessage: (channelId: string, messageId: string, params?: Partial<Discord.EditMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
66
66
  editOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
67
- editWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").EditWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
67
+ editWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<Discord.EditWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
68
68
  executeGitHubCompatibleWebhook: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
69
69
  executeSlackCompatibleWebhook: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
70
- executeWebhook: (webhookId: string, webhookToken: string, params?: Partial<import("../types.js").ExecuteWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
71
- followAnnouncementChannel: (channelId: string, params?: Partial<import("../types.js").FollowAnnouncementChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").FollowedChannel>;
72
- getApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildApplicationCommandPermission>;
73
- getAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule>;
74
- getChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
75
- getChannelInvites: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite[]>;
76
- getChannelMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
77
- getChannelMessages: (channelId: string, params?: Partial<import("../types.js").GetChannelMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message[]>;
78
- getChannelWebhooks: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook[]>;
79
- getCurrentAuthorizationInformation: (options?: RequestInit | undefined) => RestResponse<import("../types.js").GetCurrentAuthorizationInformationResponse>;
80
- getCurrentBotApplicationInformation: (options?: RequestInit | undefined) => RestResponse<import("../types.js").Application>;
81
- getCurrentUser: (options?: RequestInit | undefined) => RestResponse<import("../types.js").User>;
82
- getCurrentUserGuildMember: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
83
- getCurrentUserGuilds: (params?: Partial<import("../types.js").GetCurrentUserGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild[]>;
70
+ executeWebhook: (webhookId: string, webhookToken: string, params?: Partial<Discord.ExecuteWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
71
+ followAnnouncementChannel: (channelId: string, params?: Partial<Discord.FollowAnnouncementChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.FollowedChannel>;
72
+ getApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildApplicationCommandPermission>;
73
+ getAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: RequestInit | undefined) => RestResponse<Discord.AutoModerationRule>;
74
+ getChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
75
+ getChannelInvites: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.Invite[]>;
76
+ getChannelMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
77
+ getChannelMessages: (channelId: string, params?: Partial<Discord.GetChannelMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Message[]>;
78
+ getChannelWebhooks: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.Webhook[]>;
79
+ getCurrentAuthorizationInformation: (options?: RequestInit | undefined) => RestResponse<Discord.GetCurrentAuthorizationInformationResponse>;
80
+ getCurrentBotApplicationInformation: (options?: RequestInit | undefined) => RestResponse<Discord.Application>;
81
+ getCurrentUser: (options?: RequestInit | undefined) => RestResponse<Discord.User>;
82
+ getCurrentUserGuildMember: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember>;
83
+ getCurrentUserGuilds: (params?: Partial<Discord.GetCurrentUserGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Guild[]>;
84
84
  getFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
85
85
  getGateway: (options?: RequestInit | undefined) => RestResponse<any>;
86
- getGatewayBot: (options?: RequestInit | undefined) => RestResponse<import("../types.js").GetGatewayBotResponse>;
87
- getGlobalApplicationCommand: (applicationId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
88
- getGlobalApplicationCommands: (applicationId: string, params?: Partial<import("../types.js").GetGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
89
- getGuild: (guildId: string, params?: Partial<import("../types.js").GetGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
90
- getGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
91
- getGuildApplicationCommandPermissions: (applicationId: string, guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildApplicationCommandPermission[]>;
92
- getGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<import("../types.js").GetGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
93
- getGuildAuditLog: (guildId: string, params?: Partial<import("../types.js").GetGuildAuditLogParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").AuditLog>;
94
- getGuildBan: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Ban>;
95
- getGuildBans: (guildId: string, params?: Partial<import("../types.js").GetGuildBanParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Ban[]>;
96
- getGuildChannels: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel[]>;
97
- getGuildEmoji: (guildId: string, emojiId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji>;
98
- getGuildIntegrations: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Integration[]>;
99
- getGuildInvites: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite[]>;
100
- getGuildMember: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
101
- getGuildPreview: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildPreview>;
102
- getGuildPruneCount: (guildId: string, params?: Partial<import("../types.js").GetGuildPruneCountParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
103
- getGuildRoles: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role[]>;
104
- getGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, params?: Partial<import("../types.js").GetGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent>;
105
- getGuildScheduledEventUsers: (guildId: string, guildScheduledEventId: string, params?: Partial<import("../types.js").GetGuildScheduledEventUserParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEventUser[]>;
106
- getGuildSticker: (guildId: string, stickerId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
107
- getGuildTemplate: (templateCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
108
- getGuildTemplates: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate[]>;
109
- getGuildVanityUrl: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
110
- getGuildVoiceRegions: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").VoiceRegion[]>;
111
- getGuildWebhooks: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook[]>;
112
- getGuildWelcomeScreen: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").WelcomeScreen>;
113
- getGuildWidget: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildWidget>;
114
- getGuildWidgetImage: (guildId: string, params?: Partial<import("../types.js").GetGuildWidgetImageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
115
- getGuildWidgetSettings: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildWidgetSetting>;
116
- getInvite: (inviteCode: string, params?: Partial<import("../types.js").GetInviteParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
86
+ getGatewayBot: (options?: RequestInit | undefined) => RestResponse<Discord.GetGatewayBotResponse>;
87
+ getGlobalApplicationCommand: (applicationId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
88
+ getGlobalApplicationCommands: (applicationId: string, params?: Partial<Discord.GetGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand[]>;
89
+ getGuild: (guildId: string, params?: Partial<Discord.GetGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Guild>;
90
+ getGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand>;
91
+ getGuildApplicationCommandPermissions: (applicationId: string, guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildApplicationCommandPermission[]>;
92
+ getGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<Discord.GetGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ApplicationCommand[]>;
93
+ getGuildAuditLog: (guildId: string, params?: Partial<Discord.GetGuildAuditLogParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.AuditLog>;
94
+ getGuildBan: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<Discord.Ban>;
95
+ getGuildBans: (guildId: string, params?: Partial<Discord.GetGuildBanParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Ban[]>;
96
+ getGuildChannels: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Channel[]>;
97
+ getGuildEmoji: (guildId: string, emojiId: string, options?: RequestInit | undefined) => RestResponse<Discord.Emoji>;
98
+ getGuildIntegrations: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Integration[]>;
99
+ getGuildInvites: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Invite[]>;
100
+ getGuildMember: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember>;
101
+ getGuildPreview: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildPreview>;
102
+ getGuildPruneCount: (guildId: string, params?: Partial<Discord.GetGuildPruneCountParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
103
+ getGuildRoles: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Role[]>;
104
+ getGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, params?: Partial<Discord.GetGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildScheduledEvent>;
105
+ getGuildScheduledEventUsers: (guildId: string, guildScheduledEventId: string, params?: Partial<Discord.GetGuildScheduledEventUserParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildScheduledEventUser[]>;
106
+ getGuildSticker: (guildId: string, stickerId: string, options?: RequestInit | undefined) => RestResponse<Discord.Sticker>;
107
+ getGuildTemplate: (templateCode: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate>;
108
+ getGuildTemplates: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate[]>;
109
+ getGuildVanityUrl: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Invite>;
110
+ getGuildVoiceRegions: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.VoiceRegion[]>;
111
+ getGuildWebhooks: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Webhook[]>;
112
+ getGuildWelcomeScreen: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.WelcomeScreen>;
113
+ getGuildWidget: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildWidget>;
114
+ getGuildWidgetImage: (guildId: string, params?: Partial<Discord.GetGuildWidgetImageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
115
+ getGuildWidgetSettings: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildWidgetSetting>;
116
+ getInvite: (inviteCode: string, params?: Partial<Discord.GetInviteParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Invite>;
117
117
  getOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
118
- getPinnedMessages: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message[]>;
119
- getReactions: (channelId: string, messageId: string, emoji: string, params?: Partial<import("../types.js").GetReactionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").User[]>;
118
+ getPinnedMessages: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.Message[]>;
119
+ getReactions: (channelId: string, messageId: string, emoji: string, params?: Partial<Discord.GetReactionParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.User[]>;
120
120
  getStageInstance: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
121
- getSticker: (stickerId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
122
- getThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ThreadMember>;
123
- getUser: (userId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").User>;
124
- getUserConnections: (options?: RequestInit | undefined) => RestResponse<import("../types.js").Connection[]>;
125
- getWebhook: (webhookId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
126
- getWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").GetWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
121
+ getSticker: (stickerId: string, options?: RequestInit | undefined) => RestResponse<Discord.Sticker>;
122
+ getThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<Discord.ThreadMember>;
123
+ getUser: (userId: string, options?: RequestInit | undefined) => RestResponse<Discord.User>;
124
+ getUserConnections: (options?: RequestInit | undefined) => RestResponse<Discord.Connection[]>;
125
+ getWebhook: (webhookId: string, options?: RequestInit | undefined) => RestResponse<Discord.Webhook>;
126
+ getWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<Discord.GetWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Message>;
127
127
  getWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
128
- groupDmAddRecipient: (channelId: string, userId: string, params?: Partial<import("../types.js").GroupDmAddRecipientParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
128
+ groupDmAddRecipient: (channelId: string, userId: string, params?: Partial<Discord.GroupDmAddRecipientParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
129
129
  groupDmRemoveRecipient: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
130
130
  joinThread: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
131
131
  leaveGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
132
132
  leaveThread: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
133
- listActiveGuildThreads: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListActiveGuildThreadResponse>;
134
- listAutoModerationRulesForGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule[]>;
135
- listGuildEmojis: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji[]>;
136
- listGuildMembers: (guildId: string, params?: Partial<import("../types.js").ListGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember[]>;
137
- listGuildStickers: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker[]>;
138
- listJoinedPrivateArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListJoinedPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListJoinedPrivateArchivedThreadResponse>;
133
+ listActiveGuildThreads: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.ListActiveGuildThreadResponse>;
134
+ listAutoModerationRulesForGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.AutoModerationRule[]>;
135
+ listGuildEmojis: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Emoji[]>;
136
+ listGuildMembers: (guildId: string, params?: Partial<Discord.ListGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember[]>;
137
+ listGuildStickers: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.Sticker[]>;
138
+ listJoinedPrivateArchivedThreads: (channelId: string, params?: Partial<Discord.ListJoinedPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ListJoinedPrivateArchivedThreadResponse>;
139
139
  listNitroStickerPacks: (options?: RequestInit | undefined) => RestResponse<any>;
140
- listPrivateArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListPrivateArchivedThreadResponse>;
141
- listPublicArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListPublicArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListPublicArchivedThreadResponse>;
142
- listScheduledEventsForGuild: (guildId: string, params?: Partial<import("../types.js").ListScheduledEventsForGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent[]>;
143
- listThreadMembers: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ThreadMember[]>;
144
- listVoiceRegions: (options?: RequestInit | undefined) => RestResponse<import("../types.js").VoiceRegion[]>;
145
- modifyAutoModerationRule: (guildId: string, autoModerationRuleId: string, params?: Partial<import("../types.js").ModifyAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule>;
146
- modifyChannel: (channelId: string, params?: Partial<import("../types.js").ModifyChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
147
- modifyCurrentMember: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
148
- modifyCurrentUser: (params?: Partial<import("../types.js").ModifyCurrentUserParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").User>;
149
- modifyCurrentUserNick: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentUserNickParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
150
- modifyCurrentUserVoiceState: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
151
- modifyGuild: (guildId: string, params?: Partial<import("../types.js").ModifyGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
152
- modifyGuildChannelPositions: (guildId: string, params?: Partial<import("../types.js").ModifyGuildChannelPositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
153
- modifyGuildEmoji: (guildId: string, emojiId: string, params?: Partial<import("../types.js").ModifyGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji>;
154
- modifyGuildMember: (guildId: string, userId: string, params?: Partial<import("../types.js").ModifyGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
155
- modifyGuildMfaLevel: (guildId: string, params?: Partial<import("../types.js").ModifyGuildMfaLevelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").MfaLevel>;
156
- modifyGuildRole: (guildId: string, roleId: string, params?: Partial<import("../types.js").ModifyGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role>;
157
- modifyGuildRolePositions: (guildId: string, params?: Partial<import("../types.js").ModifyGuildRolePositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role[]>;
158
- modifyGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, params?: Partial<import("../types.js").ModifyGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent>;
159
- modifyGuildSticker: (guildId: string, stickerId: string, params?: Partial<import("../types.js").ModifyGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
160
- modifyGuildTemplate: (guildId: string, templateCode: string, params?: Partial<import("../types.js").ModifyGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
161
- modifyGuildWelcomeScreen: (guildId: string, params?: Partial<import("../types.js").ModifyGuildWelcomeScreenParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").WelcomeScreen>;
162
- modifyGuildWidget: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildWidgetSetting>;
163
- modifyStageInstance: (channelId: string, params?: Partial<import("../types.js").ModifyStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").StageInstance>;
164
- modifyUserVoiceState: (guildId: string, userId: string, params?: Partial<import("../types.js").ModifyUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
165
- modifyWebhook: (webhookId: string, params?: Partial<import("../types.js").ModifyWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
140
+ listPrivateArchivedThreads: (channelId: string, params?: Partial<Discord.ListPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ListPrivateArchivedThreadResponse>;
141
+ listPublicArchivedThreads: (channelId: string, params?: Partial<Discord.ListPublicArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.ListPublicArchivedThreadResponse>;
142
+ listScheduledEventsForGuild: (guildId: string, params?: Partial<Discord.ListScheduledEventsForGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildScheduledEvent[]>;
143
+ listThreadMembers: (channelId: string, options?: RequestInit | undefined) => RestResponse<Discord.ThreadMember[]>;
144
+ listVoiceRegions: (options?: RequestInit | undefined) => RestResponse<Discord.VoiceRegion[]>;
145
+ modifyAutoModerationRule: (guildId: string, autoModerationRuleId: string, params?: Partial<Discord.ModifyAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.AutoModerationRule>;
146
+ modifyChannel: (channelId: string, params?: Partial<Discord.ModifyChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
147
+ modifyCurrentMember: (guildId: string, params?: Partial<Discord.ModifyCurrentMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
148
+ modifyCurrentUser: (params?: Partial<Discord.ModifyCurrentUserParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.User>;
149
+ modifyCurrentUserNick: (guildId: string, params?: Partial<Discord.ModifyCurrentUserNickParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
150
+ modifyCurrentUserVoiceState: (guildId: string, params?: Partial<Discord.ModifyCurrentUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
151
+ modifyGuild: (guildId: string, params?: Partial<Discord.ModifyGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Guild>;
152
+ modifyGuildChannelPositions: (guildId: string, params?: Partial<Discord.ModifyGuildChannelPositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
153
+ modifyGuildEmoji: (guildId: string, emojiId: string, params?: Partial<Discord.ModifyGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Emoji>;
154
+ modifyGuildMember: (guildId: string, userId: string, params?: Partial<Discord.ModifyGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember>;
155
+ modifyGuildMfaLevel: (guildId: string, params?: Partial<Discord.ModifyGuildMfaLevelParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.MfaLevel>;
156
+ modifyGuildRole: (guildId: string, roleId: string, params?: Partial<Discord.ModifyGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Role>;
157
+ modifyGuildRolePositions: (guildId: string, params?: Partial<Discord.ModifyGuildRolePositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Role[]>;
158
+ modifyGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, params?: Partial<Discord.ModifyGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildScheduledEvent>;
159
+ modifyGuildSticker: (guildId: string, stickerId: string, params?: Partial<Discord.ModifyGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Sticker>;
160
+ modifyGuildTemplate: (guildId: string, templateCode: string, params?: Partial<Discord.ModifyGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate>;
161
+ modifyGuildWelcomeScreen: (guildId: string, params?: Partial<Discord.ModifyGuildWelcomeScreenParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.WelcomeScreen>;
162
+ modifyGuildWidget: (guildId: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildWidgetSetting>;
163
+ modifyStageInstance: (channelId: string, params?: Partial<Discord.ModifyStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.StageInstance>;
164
+ modifyUserVoiceState: (guildId: string, userId: string, params?: Partial<Discord.ModifyUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
165
+ modifyWebhook: (webhookId: string, params?: Partial<Discord.ModifyWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Webhook>;
166
166
  modifyWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
167
167
  pinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
168
168
  removeGuildBan: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
169
169
  removeGuildMember: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
170
170
  removeGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
171
171
  removeThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
172
- searchGuildMembers: (guildId: string, params?: Partial<import("../types.js").SearchGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember[]>;
173
- startThreadFromMessage: (channelId: string, messageId: string, params?: Partial<import("../types.js").StartThreadFromMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
174
- startThreadInForumChannel: (channelId: string, params?: Partial<import("../types.js").StartThreadInForumChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
175
- startThreadWithoutMessage: (channelId: string, params?: Partial<import("../types.js").StartThreadWithoutMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
176
- syncGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
172
+ searchGuildMembers: (guildId: string, params?: Partial<Discord.SearchGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.GuildMember[]>;
173
+ startThreadFromMessage: (channelId: string, messageId: string, params?: Partial<Discord.StartThreadFromMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
174
+ startThreadInForumChannel: (channelId: string, params?: Partial<Discord.StartThreadInForumChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
175
+ startThreadWithoutMessage: (channelId: string, params?: Partial<Discord.StartThreadWithoutMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<Discord.Channel>;
176
+ syncGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<Discord.GuildTemplate>;
177
177
  triggerTypingIndicator: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
178
178
  unpinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
179
- request: <A = unknown>(path: string, init?: RequestInit) => import("../utils/common.js").Effect<never, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, ResponseWithData<A>>;
179
+ request: <A = unknown>(path: string, init?: RequestInit) => Effect.Effect<never, FetchError | StatusCodeError | JsonParseError, ResponseWithData<A>>;
180
180
  }>;
181
181
  export interface DiscordREST extends Success<typeof make> {
182
182
  }
183
- export declare const DiscordREST: import("../utils/common.js").Tag<DiscordREST>;
184
- export declare const LiveDiscordREST: import("../utils/common.js").Layer<import("../Log/index.js").Log | import("../DiscordConfig/index.js").DiscordConfig | import("../index.js").Http | import("../index.js").RateLimitStore | import("../index.js").RateLimiter, never, DiscordREST>;
183
+ export declare const DiscordREST: Context.Tag<DiscordREST>;
184
+ export declare const LiveDiscordREST: Layer.Layer<Config.DiscordConfig | Http | Log.Log | RateLimitStore | RateLimiter, never, DiscordREST>;
185
185
  export {};
@@ -1,49 +1,46 @@
1
- import * as tsplus_module_1 from "dfx";
2
- import * as tsplus_module_2 from "@effect/io/Effect";
3
- import * as tsplus_module_3 from "@fp-ts/data/Duration";
4
- import * as tsplus_module_4 from "@fp-ts/data/Option";
5
- import * as tsplus_module_5 from "@fp-ts/data/HashSet";
6
- import * as tsplus_module_6 from "@effect/io/Ref";
7
- import * as tsplus_module_7 from "dfx/utils/common";
8
- import * as tsplus_module_8 from "@effect/io/Layer";
9
- import { millis } from "@fp-ts/data/Duration";
10
- import { rateLimitFromHeaders, routeFromConfig, retryAfter } from "./utils.js";
1
+ import * as tsplus_module_1 from "@effect/io/Effect";
2
+ import * as tsplus_module_2 from "@fp-ts/data/Option";
3
+ import * as tsplus_module_3 from "@fp-ts/data/HashSet";
4
+ import * as tsplus_module_4 from "@effect/io/Ref";
5
+ import { Config, Http, Log, RateLimiter, RateLimitStore, } from "dfx";
6
+ import { Context, Discord, Duration, Effect, HashSet, Layer, Ref, } from "dfx/_common";
11
7
  import Pkg from "../package.json" assert { type: "json" };
12
- const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, rest }) => tsplus_module_2.flatMap(log => tsplus_module_2.flatMap(store => tsplus_module_2.flatMap(({ maybeWait }) => {
8
+ import { rateLimitFromHeaders, retryAfter, routeFromConfig } from "./utils.js";
9
+ const make = tsplus_module_1.flatMap(http => tsplus_module_1.flatMap(({ token, rest }) => tsplus_module_1.flatMap(log => tsplus_module_1.flatMap(store => tsplus_module_1.flatMap(({ maybeWait }) => {
13
10
  const globalRateLimit = maybeWait("dfx.rest.global", rest.globalRateLimit.window, rest.globalRateLimit.limit);
14
- return tsplus_module_2.map(badRoutesRef => {
15
- const addBadRoute = (route) => tsplus_module_2.collectAllParDiscard([
11
+ return tsplus_module_1.map(badRoutesRef => {
12
+ const addBadRoute = (route) => tsplus_module_1.collectAllParDiscard([
16
13
  log.info("DiscordREST", "addBadRoute", route),
17
- tsplus_module_6.update((s) => tsplus_module_5.add(route)(s))(badRoutesRef),
18
- store.incrementCounter("dfx.rest.invalid", tsplus_module_3.minutes(10).millis, 10000),
14
+ tsplus_module_4.update((s) => tsplus_module_3.add(route)(s))(badRoutesRef),
15
+ store.incrementCounter("dfx.rest.invalid", Duration.minutes(10).millis, 10000),
19
16
  ]);
20
- const isBadRoute = (route) => tsplus_module_2.map((s) => tsplus_module_5.has(route)(s))(tsplus_module_6.get(badRoutesRef));
21
- const removeBadRoute = (route) => tsplus_module_6.update((s) => tsplus_module_5.remove(route)(s))(badRoutesRef);
22
- const invalidRateLimit = (route) => tsplus_module_2.asUnit(tsplus_module_2.tap((invalid) => invalid
23
- ? maybeWait("dfx.rest.invalid", tsplus_module_3.minutes(10), 10000)
24
- : tsplus_module_2.unit())(isBadRoute(route)));
17
+ const isBadRoute = (route) => tsplus_module_1.map((s) => tsplus_module_3.has(route)(s))(tsplus_module_4.get(badRoutesRef));
18
+ const removeBadRoute = (route) => tsplus_module_4.update((s) => tsplus_module_3.remove(route)(s))(badRoutesRef);
19
+ const invalidRateLimit = (route) => tsplus_module_1.asUnit(tsplus_module_1.tap((invalid) => invalid
20
+ ? maybeWait("dfx.rest.invalid", Duration.minutes(10), 10000)
21
+ : Effect.unit())(isBadRoute(route)));
25
22
  // Request rate limiting
26
23
  const requestRateLimit = (path, init) => (() => {
27
24
  const route = routeFromConfig(path, init);
28
- return tsplus_module_2.flatMap(maybeBucket => {
29
- const bucket = tsplus_module_4.getOrElse(() => ({
25
+ return tsplus_module_1.flatMap(maybeBucket => {
26
+ const bucket = tsplus_module_2.getOrElse(() => ({
30
27
  key: `?.${route}`,
31
28
  resetAfter: 5000,
32
29
  limit: 1,
33
30
  }))(maybeBucket);
34
- const resetAfter = millis(bucket.resetAfter);
35
- return tsplus_module_2.flatMap(() => tsplus_module_2.map(() => void 0)(maybeWait(`dfx.rest.${bucket.key}`, resetAfter, bucket.limit)))(invalidRateLimit(route));
31
+ const resetAfter = Duration.millis(bucket.resetAfter);
32
+ return tsplus_module_1.flatMap(() => tsplus_module_1.map(() => void 0)(maybeWait(`dfx.rest.${bucket.key}`, resetAfter, bucket.limit)))(invalidRateLimit(route));
36
33
  })(store.getBucketForRoute(route));
37
34
  })();
38
35
  // Update rate limit buckets
39
- const updateBuckets = (path, init, response) => tsplus_module_2.ignore((() => {
36
+ const updateBuckets = (path, init, response) => tsplus_module_1.ignore((() => {
40
37
  const route = routeFromConfig(path, init);
41
- return tsplus_module_2.flatMap(({ bucket, retryAfter, limit, remaining }) => {
38
+ return tsplus_module_1.flatMap(({ bucket, retryAfter, limit, remaining }) => {
42
39
  const effectsToRun = [
43
40
  removeBadRoute(route),
44
41
  store.putBucketRoute(route, bucket),
45
42
  ];
46
- return tsplus_module_2.flatMap(hasBucket => {
43
+ return tsplus_module_1.flatMap(hasBucket => {
47
44
  if (!hasBucket || limit - 1 === remaining) {
48
45
  effectsToRun.push(store.putBucket({
49
46
  key: bucket,
@@ -51,28 +48,28 @@ const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, r
51
48
  limit: !hasBucket && remaining > 0 ? remaining : limit,
52
49
  }));
53
50
  }
54
- return tsplus_module_2.map(() => void 0)(tsplus_module_2.collectAllParDiscard(effectsToRun));
51
+ return tsplus_module_1.map(() => void 0)(tsplus_module_1.collectAllParDiscard(effectsToRun));
55
52
  })(store.hasBucket(bucket));
56
- })(tsplus_module_2.fromOption(rateLimitFromHeaders(response.headers)));
53
+ })(Effect.fromOption(rateLimitFromHeaders(response.headers)));
57
54
  })());
58
- const request = (path, init = {}) => tsplus_module_2.catchTag("StatusCodeError", (e) => {
55
+ const request = (path, init = {}) => tsplus_module_1.catchTag("StatusCodeError", (e) => {
59
56
  switch (e.code) {
60
57
  case 403:
61
- return tsplus_module_2.flatMap(() => tsplus_module_2.fail(e))(tsplus_module_2.collectAllParDiscard([
58
+ return tsplus_module_1.flatMap(() => Effect.fail(e))(tsplus_module_1.collectAllParDiscard([
62
59
  log.info("DiscordREST", "403", path),
63
60
  addBadRoute(routeFromConfig(path, init)),
64
61
  updateBuckets(path, init, e.response),
65
62
  ]));
66
63
  case 429:
67
- return tsplus_module_2.flatMap(() => request(path, init))(tsplus_module_2.collectAllParDiscard([
64
+ return tsplus_module_1.flatMap(() => request(path, init))(tsplus_module_1.collectAllParDiscard([
68
65
  log.info("DiscordREST", "429", path),
69
66
  addBadRoute(routeFromConfig(path, init)),
70
67
  updateBuckets(path, init, e.response),
71
- tsplus_module_2.sleep(tsplus_module_4.getOrElse(() => tsplus_module_3.seconds(5))(retryAfter(e.response.headers))),
68
+ Effect.sleep(tsplus_module_2.getOrElse(() => Duration.seconds(5))(retryAfter(e.response.headers))),
72
69
  ]));
73
70
  }
74
- return tsplus_module_2.fail(e);
75
- })(tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(response => tsplus_module_2.map(() => response)(updateBuckets(path, init, response.response)))(http.requestWithJson(`${rest.baseUrl}${path}`, {
71
+ return Effect.fail(e);
72
+ })(tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(() => tsplus_module_1.flatMap(response => tsplus_module_1.map(() => response)(updateBuckets(path, init, response.response)))(http.requestWithJson(`${rest.baseUrl}${path}`, {
76
73
  ...init,
77
74
  headers: {
78
75
  ...(init?.headers ?? {}),
@@ -80,7 +77,7 @@ const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, r
80
77
  "User-Agent": `DiscordBot (https://github.com/tim-smart/dfx, ${Pkg.version})`,
81
78
  },
82
79
  })))(globalRateLimit))(requestRateLimit(path, init)));
83
- const routes = tsplus_module_1.Discord.createRoutes(({ method, url, params, options = {}, }) => {
80
+ const routes = Discord.createRoutes(({ method, url, params, options = {}, }) => {
84
81
  const hasBody = method !== "GET" && method !== "DELETE";
85
82
  let hasFormData = typeof options?.body?.append === "function";
86
83
  let body = undefined;
@@ -114,8 +111,8 @@ const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, r
114
111
  });
115
112
  });
116
113
  return { request, ...routes };
117
- })(tsplus_module_6.make(tsplus_module_5.empty()));
118
- })(tsplus_module_2.service(tsplus_module_1.RateLimiter)))(tsplus_module_2.service(tsplus_module_1.RateLimitStore)))(tsplus_module_2.service(tsplus_module_1.Log.Log)))(tsplus_module_2.service(tsplus_module_1.Config.DiscordConfig)))(tsplus_module_2.service(tsplus_module_1.Http));
119
- export const DiscordREST = tsplus_module_7.Tag();
120
- export const LiveDiscordREST = tsplus_module_8.fromEffect(DiscordREST)(make);
114
+ })(Ref.make(HashSet.empty()));
115
+ })(Effect.service(RateLimiter)))(Effect.service(RateLimitStore)))(Effect.service(Log.Log)))(Effect.service(Config.DiscordConfig)))(Effect.service(Http));
116
+ export const DiscordREST = Context.Tag();
117
+ export const LiveDiscordREST = Layer.fromEffect(DiscordREST)(make);
121
118
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordREST/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9E,OAAO,GAAG,MAAM,iBAAiB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAA;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AI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;aAC9B;iBAAM;gBACL,IAAI,GAAG,OAAO,CAAC,IAAK,CAAA;aACrB;YAED,OAAO,OAAO,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE;gBACxC,MAAM;gBACN,OAAO;gBACP,IAAI;aACL,CAAC,CAAA;QACJ,CAAC,CACF,CAAA;QAED,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAAA;OA3KN,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAU,CAAC;GAThC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GADnC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GADhC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAFX,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,GAD/C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CA0LnC,CAAA;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAe,CAAA;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAA"}
@@ -1,9 +1,9 @@
1
- import { Effect } from "dfx/utils/common";
2
- import { JsonParseError, BlobError, FetchError, StatusCodeError } from "dfx";
1
+ import { BlobError, FetchError, JsonParseError, StatusCodeError } from "dfx";
2
+ import { Effect } from "dfx/_common";
3
3
  export interface ResponseWithData<A> {
4
4
  response: Response;
5
- json: Effect<never, JsonParseError, A>;
6
- text: Effect<never, never, string>;
7
- blob: Effect<never, BlobError, Blob>;
5
+ json: Effect.Effect<never, JsonParseError, A>;
6
+ text: Effect.Effect<never, never, string>;
7
+ blob: Effect.Effect<never, BlobError, Blob>;
8
8
  }
9
- export type RestResponse<T> = Effect<never, FetchError | StatusCodeError | JsonParseError, ResponseWithData<T>>;
9
+ export type RestResponse<T> = Effect.Effect<never, FetchError | StatusCodeError | JsonParseError, ResponseWithData<T>>;
@@ -1,9 +1,10 @@
1
+ import { Duration, Option } from "dfx/_common";
1
2
  export declare const routeFromConfig: (path: string, init: RequestInit) => string;
2
- export declare const numberHeader: (headers: Headers) => (key: string) => import("../index.js").Maybe<number>;
3
- export declare const retryAfter: (headers: Headers) => import("../index.js").Maybe<import("../utils/common.js").Duration>;
4
- export declare const rateLimitFromHeaders: (headers: Headers) => import("../index.js").Maybe<{
3
+ export declare const numberHeader: (headers: Headers) => (key: string) => Option.Option<number>;
4
+ export declare const retryAfter: (headers: Headers) => Option.Option<Duration.Duration>;
5
+ export declare const rateLimitFromHeaders: (headers: Headers) => Option.Option<{
5
6
  readonly bucket: string;
6
- readonly retryAfter: import("../utils/common.js").Duration;
7
+ readonly retryAfter: Duration.Duration;
7
8
  readonly limit: number;
8
9
  readonly remaining: number;
9
10
  }>;