dfx 0.18.2 → 0.20.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.
Files changed (44) hide show
  1. package/Cache/index.d.ts +11 -11
  2. package/Cache/index.js +14 -14
  3. package/Cache/index.js.map +1 -1
  4. package/Cache/prelude.d.ts +29 -12
  5. package/Cache/prelude.js +102 -18
  6. package/Cache/prelude.js.map +1 -1
  7. package/DiscordGateway/Shard/index.d.ts +1 -1
  8. package/DiscordGateway/Shard/index.js +1 -1
  9. package/DiscordGateway/Shard/index.js.map +1 -1
  10. package/DiscordGateway/Sharder/index.d.ts +2 -2
  11. package/DiscordGateway/Sharder/index.js +2 -2
  12. package/DiscordGateway/Sharder/index.js.map +1 -1
  13. package/DiscordREST/index.d.ts +178 -6
  14. package/DiscordREST/index.js +2 -2
  15. package/DiscordREST/index.js.map +1 -1
  16. package/DiscordREST/types.d.ts +4 -4
  17. package/Helpers/permissions.d.ts +7 -0
  18. package/Helpers/permissions.js +12 -0
  19. package/Helpers/permissions.js.map +1 -1
  20. package/Interactions/gateway.d.ts +2 -2
  21. package/Interactions/gateway.js +1 -1
  22. package/Interactions/gateway.js.map +1 -1
  23. package/Interactions/index.d.ts +2 -2
  24. package/Interactions/index.js +3 -3
  25. package/Interactions/index.js.map +1 -1
  26. package/RateLimit/index.d.ts +0 -1
  27. package/RateLimit/index.js +0 -1
  28. package/RateLimit/index.js.map +1 -1
  29. package/RateLimit/memory.d.ts +2 -2
  30. package/RateLimit/memory.js.map +1 -1
  31. package/gateway.d.ts +3 -4
  32. package/gateway.js +1 -2
  33. package/gateway.js.map +1 -1
  34. package/global.d.ts +1 -1
  35. package/index.d.ts +2 -2
  36. package/index.js +2 -2
  37. package/index.js.map +1 -1
  38. package/package.json +2 -2
  39. package/webhooks.d.ts +2 -2
  40. package/webhooks.js +1 -1
  41. package/webhooks.js.map +1 -1
  42. package/Cache/gateway.d.ts +0 -22
  43. package/Cache/gateway.js +0 -91
  44. package/Cache/gateway.js.map +0 -1
@@ -1,13 +1,185 @@
1
- import { RateLimit, Http, Discord } from "dfx";
1
+ import { BucketDetails, FetchError, StatusCodeError, JsonParseError, Discord } from "dfx";
2
2
  import { Effect } from "@effect/io/Effect";
3
3
  import { Success } from "dfx/utils/effect";
4
- import { ResponseWithData } from "./types.js";
5
- declare const make: import("../global.js").Effect<import("../Log/index.js").Log | import("../DiscordConfig/index.js").DiscordConfig | import("../Http/index.js").Http | import("../RateLimit/index.js").RateLimitStore | import("../RateLimit/index.js").RateLimiter, never, {
6
- request: <A = unknown>(path: string, init?: RequestInit) => import("../global.js").Effect<never, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, ResponseWithData<A>>;
7
- routes: import("../types.js").Endpoints<RequestInit>;
4
+ import { ResponseWithData, RestResponse } from "./types.js";
5
+ declare const make: import("../global.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>;
7
+ addGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
8
+ addThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
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>;
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>;
36
+ deleteAllReactions: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
37
+ deleteAllReactionsForEmoji: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
38
+ deleteAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: RequestInit | undefined) => RestResponse<any>;
39
+ deleteChannelPermission: (channelId: string, overwriteId: string, options?: RequestInit | undefined) => RestResponse<any>;
40
+ deletecloseChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
41
+ deleteFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
42
+ deleteGlobalApplicationCommand: (applicationId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<any>;
43
+ deleteGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
44
+ deleteGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<any>;
45
+ deleteGuildEmoji: (guildId: string, emojiId: string, options?: RequestInit | undefined) => RestResponse<any>;
46
+ deleteGuildIntegration: (guildId: string, integrationId: string, options?: RequestInit | undefined) => RestResponse<any>;
47
+ deleteGuildRole: (guildId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
48
+ deleteGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
52
+ deleteMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
53
+ deleteOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
54
+ deleteOwnReaction: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
55
+ deleteStageInstance: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
56
+ deleteUserReaction: (channelId: string, messageId: string, emoji: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
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>;
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>;
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>;
68
+ executeGitHubCompatibleWebhook: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
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[]>;
84
+ getFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
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[]>;
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>;
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>;
129
+ groupDmRemoveRecipient: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
130
+ joinThread: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
131
+ leaveGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
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>;
166
+ modifyWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
167
+ pinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
168
+ removeGuildBan: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
169
+ removeGuildMember: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
170
+ removeGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
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>;
177
+ triggerTypingIndicator: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
178
+ unpinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
179
+ request: <A = unknown>(path: string, init?: RequestInit) => import("../global.js").Effect<never, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, ResponseWithData<A>>;
8
180
  }>;
9
181
  export interface DiscordREST extends Success<typeof make> {
10
182
  }
11
183
  export declare const DiscordREST: import("../global.js").Tag<DiscordREST>;
12
- export declare const LiveDiscordREST: import("../global.js").Layer<import("../Log/index.js").Log | import("../DiscordConfig/index.js").DiscordConfig | import("../Http/index.js").Http | import("../RateLimit/index.js").RateLimitStore | import("../RateLimit/index.js").RateLimiter, never, DiscordREST>;
184
+ export declare const LiveDiscordREST: import("../global.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>;
13
185
  export {};
@@ -113,9 +113,9 @@ const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, r
113
113
  body,
114
114
  });
115
115
  });
116
- return { request, routes };
116
+ return { request, ...routes };
117
117
  })(tsplus_module_6.make(tsplus_module_5.empty()));
118
- })(tsplus_module_2.service(tsplus_module_1.RateLimit.RateLimiter)))(tsplus_module_2.service(tsplus_module_1.RateLimit.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.Http));
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
119
  export const DiscordREST = tsplus_module_7.Tag();
120
120
  export const LiveDiscordREST = tsplus_module_8.fromEffect(DiscordREST)(make);
121
121
  //# 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;AAEzD,MAAM,IAAI,2BACF,IAAI,6BACJ,EAAE,KAAK,EAAE,IAAI,EAAE,6BAEf,GAAG,4BACH,KAAK,6BACL,EAAE,SAAS,EAAE;IAEnB,MAAM,eAAe,GAAG,SAAS,CAC/B,iBAAiB,EACjB,IAAI,CAAC,eAAe,CAAC,MAAM,EAC3B,IAAI,CAAC,eAAe,CAAC,KAAK,CAC3B,CAAA;+BAGK,YAAY;QAClB,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,sCACpC;YACE,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,KAAK,CAAC;YAC7C,uBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC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@ -1,9 +1,9 @@
1
1
  import { Effect } from "@effect/io/Effect";
2
- import { Http } from "dfx";
2
+ import { JsonParseError, BlobError, FetchError, StatusCodeError } from "dfx";
3
3
  export interface ResponseWithData<A> {
4
4
  response: Response;
5
- json: Effect<never, Http.JsonParseError, A>;
5
+ json: Effect<never, JsonParseError, A>;
6
6
  text: Effect<never, never, string>;
7
- blob: Effect<never, Http.BlobError, Blob>;
7
+ blob: Effect<never, BlobError, Blob>;
8
8
  }
9
- export type RestResponse<T> = Effect<never, Http.FetchError | Http.StatusCodeError | Http.JsonParseError, ResponseWithData<T>>;
9
+ export type RestResponse<T> = Effect<never, FetchError | StatusCodeError | JsonParseError, ResponseWithData<T>>;
@@ -1,4 +1,5 @@
1
1
  import { Discord } from "dfx";
2
+ import { Effect } from "@effect/io/Effect";
2
3
  /**
3
4
  * A constant of all the permissions
4
5
  */
@@ -32,3 +33,9 @@ export declare const forChannel: (roles: Discord.Role[]) => ({ guild_id, permiss
32
33
  * Apply permission overwrites to a bitfield.
33
34
  */
34
35
  export declare const applyOverwrites: (permissions: bigint) => (overwrites: Discord.Overwrite[]) => bigint;
36
+ interface RolesCache<E> {
37
+ getForParent: (parentId: string) => Effect<never, E, ReadonlyMap<string, Discord.Role>>;
38
+ }
39
+ export declare const hasInChannel: <E>(rolesCache: RolesCache<E>, permission: bigint) => (channel: Discord.Channel, memberOrRole: Discord.GuildMember | Discord.Role) => import("../global.js").Effect<never, E, boolean>;
40
+ export declare const hasInGuild: <E>(rolesCache: RolesCache<E>, permission: bigint) => (guildId: Discord.Snowflake, member: Discord.GuildMember) => import("../global.js").Effect<never, E, boolean>;
41
+ export {};
@@ -1,5 +1,6 @@
1
1
  import * as tsplus_module_1 from "dfx";
2
2
  import * as tsplus_module_2 from "@fp-ts/data/Function";
3
+ import * as tsplus_module_3 from "@effect/io/Effect";
3
4
  /**
4
5
  * A constant of all the permissions
5
6
  */
@@ -66,4 +67,15 @@ export const forChannel = (roles) => ({ guild_id, permission_overwrites: overwri
66
67
  * Apply permission overwrites to a bitfield.
67
68
  */
68
69
  export const applyOverwrites = (permissions) => (overwrites) => overwrites.reduce((permissions, overwrite) => (permissions & ~BigInt(overwrite.deny)) | BigInt(overwrite.allow), permissions);
70
+ export const hasInChannel = (rolesCache, permission) => (channel, memberOrRole) => tsplus_module_3.map(roles => {
71
+ const channelPerms = forChannel([...roles.values()])(channel)(memberOrRole);
72
+ return has(permission)(channelPerms);
73
+ })(rolesCache.getForParent(channel.guild_id));
74
+ export const hasInGuild = (rolesCache, permission) => (guildId, member) => tsplus_module_3.map(roles => {
75
+ const hasPerm = has(permission);
76
+ return member.roles.some((id) => {
77
+ const role = roles.get(id);
78
+ return role ? hasPerm(role.permissions) : false;
79
+ });
80
+ })(rolesCache.getForParent(guildId));
69
81
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/Helpers/permissions.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAA,KAAK,CAAC,GAAG,CAAC,gBAAA,OAAO,CAAC,cAAc,CAAC,CAAA;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAA,KAAK,CAAC,SAAS,CAAA;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,gBAAA,KAAK,CAAC,MAAM,CAAC,gBAAA,OAAO,CAAC,cAAc,CAAC,CAAA;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAA,KAAK,CAAC,cAAc,CAAC,gBAAA,OAAO,CAAC,cAAc,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAqB,EAAE,EAAE,CAChD,KAAK,CAAC,MAAM,CACV,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,E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,EAAE,EAAE,qBAElD,KAAK;IACX,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,CAAA;IAE/B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IACjD,CAAC,CAAC,CAAA;GANc,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAOhD,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { Effect } from "@effect/io/Effect";
2
- import { DiscordREST, Discord, Http } from "dfx";
2
+ import { DiscordREST, Discord, FetchError, StatusCodeError, JsonParseError } from "dfx";
3
3
  import { DefinitionNotFound } from "./handlers.js";
4
4
  import { InteractionBuilder } from "./index.js";
5
5
  export interface RunOpts {
6
6
  sync?: boolean;
7
7
  }
8
- export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../global.js").Effect<import("../index.js").DiscordREST | import("../types.js").Interaction | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | DefinitionNotFound | E, void>) => import("../global.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../global.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
8
+ export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../global.js").Effect<import("../index.js").DiscordREST | import("../types.js").Interaction | R, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError | DefinitionNotFound | E, void>) => import("../global.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../global.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError | E2, void>;
@@ -7,7 +7,7 @@ import { InteractionContext } from "./index.js";
7
7
  import { splitDefinitions } from "./utils.js";
8
8
  export const run = (postHandler, { sync = true } = {}) => (ix) => (() => {
9
9
  const { GlobalApplicationCommand, GuildApplicationCommand } = splitDefinitions(ix.definitions);
10
- return tsplus_module_1.flatMap(gateway => tsplus_module_1.flatMap(({ routes: rest }) => tsplus_module_1.flatMap(application => {
10
+ return tsplus_module_1.flatMap(gateway => tsplus_module_1.flatMap(rest => tsplus_module_1.flatMap(application => {
11
11
  const globalSync = rest.bulkOverwriteGlobalApplicationCommands(application.id, {
12
12
  body: JSON.stringify(GlobalApplicationCommand.map((a) => a.command)),
13
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAM7C,MAAM,CAAC,MAAM,GAAG,GACd,CACE,WAUyB,EACzB,EAAE,IAAI,GAAG,IAAI,KAAc,EAAE,EAC7B,EAAE,CACJ,CAAC,EAA4B,EAAE,EAAE;IAE7B,MAAM,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,GACzD,gBAAgB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;mCAE5B,OAAO,6BACP,EAAE,MAAM,EAAE,IAAI,EAAE,6BAEhB,WAAW;QAIjB,MAAM,UAAU,GAAG,IAAI,CAAC,sCAAsC,CAC5D,WAAW,CAAC,EAAE,EACd;YACE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC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AAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EADlD,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAEhB,EACD,WAAW,EACX,+BAAsB,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7C,CACF,CAAA;iDAEC,IAAI,CAAC,CAAC,CAAC,uBAA8B,SAAS,EAAvC,uBAAW,UAAU,EAArB,GAAG,CAAmB,CAAkB,CAAC,CAAC,CAAC,GAAG;OAhCrD,wBAAmD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAhE,IAAI,CAAC,mCAAmC,EAAE,CAAuB,GAHpD,wCAAe,WAAW,CAAC,GADxB,wBAAe,gBAAA,OAAO,CAAC,cAAc,CAAC;IAqCxD,CAAA"}
@@ -9,8 +9,8 @@ export declare class InteractionBuilder<R, E> {
9
9
  constructor(definitions: D.InteractionDefinition<R, E>[]);
10
10
  add<R1, E1>(definition: D.InteractionDefinition<R1, E1>): InteractionBuilder<R | R1, E | E1>;
11
11
  concat<R1, E1>(builder: InteractionBuilder<R1, E1>): InteractionBuilder<R | R1, E | E1>;
12
- get syncGlobal(): import("../global.js").Effect<import("../index.js").DiscordREST, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
13
- syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../global.js").Effect<import("../index.js").DiscordREST, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
12
+ get syncGlobal(): import("../global.js").Effect<import("../index.js").DiscordREST, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
13
+ syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../global.js").Effect<import("../index.js").DiscordREST, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
14
14
  }
15
15
  export declare const builder: InteractionBuilder<never, never>;
16
16
  export declare const id: (query: string) => (customId: string) => import("../global.js").Effect<never, never, boolean>;
@@ -24,16 +24,16 @@ export class InteractionBuilder {
24
24
  const commands = this.definitions
25
25
  .filter((c) => c._tag === "GlobalApplicationCommand")
26
26
  .map((c) => c.command);
27
- return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)(({ routes }) => tsplus_module_1.flatMap((app) => routes.bulkOverwriteGlobalApplicationCommands(app.id, {
27
+ return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)((rest) => tsplus_module_1.flatMap((app) => rest.bulkOverwriteGlobalApplicationCommands(app.id, {
28
28
  body: JSON.stringify(commands),
29
- }))(tsplus_module_1.flatMap((r) => r.json)(routes
29
+ }))(tsplus_module_1.flatMap((r) => r.json)(rest
30
30
  .getCurrentBotApplicationInformation())));
31
31
  }
32
32
  syncGuild(appId, guildId) {
33
33
  const commands = this.definitions
34
34
  .filter((c) => c._tag === "GuildApplicationCommand")
35
35
  .map((c) => c.command);
36
- return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)(({ routes }) => routes.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
36
+ return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)((rest) => rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
37
37
  }
38
38
  }
39
39
  export const builder = new InteractionBuilder([]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";;AAEA,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YA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eof makeLimiter> {
23
23
  }
24
24
  export declare const RateLimiter: import("../global.js").Tag<RateLimiter>;
25
25
  export declare const LiveRateLimiter: import("../global.js").Layer<import("../Log/index.js").Log | RateLimitStore, never, RateLimiter>;
26
- export declare const maybeWait: (key: string, window: Duration, limit: number) => import("../global.js").Effect<RateLimiter, never, void>;
27
26
  export {};
@@ -22,5 +22,4 @@ const makeLimiter = tsplus_module_3.flatMap(store => tsplus_module_3.map(log =>
22
22
  })(tsplus_module_3.service(tsplus_module_4.Log.Log)))(tsplus_module_3.service(RateLimitStore));
23
23
  export const RateLimiter = tsplus_module_1.Tag();
24
24
  export const LiveRateLimiter = tsplus_module_2.fromEffect(RateLimiter)(makeLimiter);
25
- export const maybeWait = (key, window, limit) => tsplus_module_3.serviceWithEffect(RateLimiter)((a) => a.maybeWait(key, window, limit));
26
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RateLimit/index.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AA6BrC,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAA,GAAG,EAAkB,CAAA;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAW,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAE/E,MAAM,WAAW,2BACT,KAAK,wBACL,GAAG;IAET,MAAM,SAAS,GAAG,CAChB,GAAW,EACX,MAAgB,EAChB,KAAa,EACb,UAAU,GAAG,IAAI,EACjB,EAAE;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;QAC3C,8BAAO,2CAAA,oBAGA,CAAC,CAAC,EAAE,EAAE,CACT,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE;YACpC,GAAG;YACH,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ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AAI,EACjB,EAAE;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;QAC3C,8BAAO,2CAAA,oBAGA,CAAC,CAAC,EAAE,EAAE,CACT,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE;YACpC,GAAG;YACH,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ;YACR,KAAK;YACL,KAAK,EAAE,CAAC,CAAC,MAAM;SAChB,CAAC,EAVC,oBAEA,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAFxD,KAAK;aACT,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CACuB,CAS7D,CACiB,EAAO;IAC7B,CAAC,CAAA;IAED,OAAO,EAAE,SAAS,EAAE,CAAA;GAxBN,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC,GADrB,wBAAe,cAAc,CAAC,CA0B9C,CAAA;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAA,GAAG,EAAe,CAAA;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,2BAAiB,WAAW,CAAC,CAAC,WAAW,CAAC,CAAA"}
@@ -1,2 +1,2 @@
1
- import { RateLimit } from "dfx";
2
- export declare const make: () => RateLimit.RateLimitStore;
1
+ import { RateLimitStore, BucketDetails } from "dfx";
2
+ export declare const make: () => RateLimitStore;
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/RateLimit/memory.ts"],"names":[],"mappings":";;AAKA,MAAM,CAAC,MAAM,IAAI,GAAG,GAA6B,EAAE;IACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAmC,CAAA;IAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IACxC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAA;IAE3C,MAAM,U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QAExE,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAChC,qBAAY,GAAG,EAAE;YACf,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAC3B,CAAC,CAAC;QAEJ,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CACvC,qBAAY,GAAG,EAAE;YACf,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;YACtB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;YAC5C,MAAM,OAAO,GAAG,0BACd,GAAY,EAAE,CAAC,CAAC;gBACd,OAAO,EAAE,GAAG;gBACZ,KAAK,EAAE,CAAC;aACT,CAAC,EAJY,UAAU,CAAC,GAAG,CAAC,CAK9B,CAAA;YAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAA;YAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,UAAU,CAAA;YAC5C,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;YAEjD,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,CAAA;QAC/B,CAAC,CAAC;KACL,CAAA;AACH,CAAC,CAAA"}
package/gateway.d.ts CHANGED
@@ -4,12 +4,11 @@ export * as DiscordWS from "./DiscordGateway/DiscordWS/index.js";
4
4
  export * as Shard from "./DiscordGateway/Shard/index.js";
5
5
  export * as ShardStore from "./DiscordGateway/ShardStore/index.js";
6
6
  export * as Gateway from "./DiscordGateway/index.js";
7
- export * as CacheOps from "./Cache/gateway.js";
8
7
  export * as CachePrelude from "./Cache/prelude.js";
9
8
  export { run as runIx } from "./Interactions/gateway.js";
10
- export declare const MemoryRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter>;
9
+ export declare const MemoryRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./index.js").RateLimitStore | import("./index.js").RateLimiter>;
11
10
  export declare const MemoryREST: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST>;
12
11
  export declare const MemorySharder: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./DiscordGateway/Sharder/index.js").Sharder>;
13
12
  export declare const MemoryGateway: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./DiscordGateway/index.js").DiscordGateway>;
14
- export declare const MemoryBot: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
15
- export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig | import("./index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
13
+ export declare const MemoryBot: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST | import("./index.js").RateLimitStore | import("./index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
14
+ export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig | import("./index.js").DiscordREST | import("./index.js").RateLimitStore | import("./index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
package/gateway.js CHANGED
@@ -10,10 +10,9 @@ export * as DiscordWS from "./DiscordGateway/DiscordWS/index.js";
10
10
  export * as Shard from "./DiscordGateway/Shard/index.js";
11
11
  export * as ShardStore from "./DiscordGateway/ShardStore/index.js";
12
12
  export * as Gateway from "./DiscordGateway/index.js";
13
- export * as CacheOps from "./Cache/gateway.js";
14
13
  export * as CachePrelude from "./Cache/prelude.js";
15
14
  export { run as runIx } from "./Interactions/gateway.js";
16
- export const MemoryRateLimit = tsplus_module_2.provideToAndMerge(tsplus_module_1.RateLimit.LiveRateLimiter)(tsplus_module_1.RateLimit.LiveMemoryRateLimitStore);
15
+ export const MemoryRateLimit = tsplus_module_2.provideToAndMerge(tsplus_module_1.LiveRateLimiter)(tsplus_module_1.LiveMemoryRateLimitStore);
17
16
  export const MemoryREST = tsplus_module_2.provideTo(tsplus_module_1.LiveDiscordREST)((tsplus_module_2.merge(MemoryRateLimit)(LiveHttp)));
18
17
  export const MemorySharder = tsplus_module_2.provideTo(LiveSharder)((tsplus_module_2.merge(LiveJsonDiscordWSCodec)(tsplus_module_2.merge(MemoryRateLimit)(tsplus_module_2.merge(LiveMemoryShardStore)(MemoryREST)))));
19
18
  export const MemoryGateway = tsplus_module_2.provideTo(tsplus_module_3.Gateway.LiveDiscordGateway)(MemorySharder);
package/gateway.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAA;AACxD,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAClE,OAAO,K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AAA;IAC3C,MAAM,OAAO,qCAA0B,SAAS,wBAAtB,UAAU,EAApB,OAAO,EAAyB,CAAA;IAEhD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/global.d.ts CHANGED
@@ -69,7 +69,7 @@ import type { HashSet } from "@fp-ts/data/HashSet";
69
69
  /**
70
70
  * @tsplus global
71
71
  */
72
- import { RateLimit, Discord, Http, DiscordREST, LiveDiscordREST, Ix, Config, Log, IxHelpers, Flags, Members, Cache, } from "dfx";
72
+ import { BucketDetails, RateLimitStore, LiveMemoryRateLimitStore, RateLimiter, LiveRateLimiter, Discord, Http, LiveHttp, FetchError, StatusCodeError, JsonParseError, BlobError, DiscordREST, LiveDiscordREST, Ix, Config, Log, IxHelpers, Flags, Members, Cache, } from "dfx";
73
73
  /**
74
74
  * @tsplus global
75
75
  */
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export * as Discord from "./types.js";
2
2
  export * as Config from "./DiscordConfig/index.js";
3
- export * as Http from "./Http/index.js";
3
+ export { Http, LiveHttp, FetchError, StatusCodeError, JsonParseError, BlobError, } from "./Http/index.js";
4
4
  export { DiscordREST, LiveDiscordREST } from "./DiscordREST/index.js";
5
5
  export * as Ix from "./Interactions/index.js";
6
6
  export * as Log from "./Log/index.js";
7
- export * as RateLimit from "./RateLimit/index.js";
7
+ export { BucketDetails, RateLimitStore, LiveMemoryRateLimitStore, RateLimiter, LiveRateLimiter, } from "./RateLimit/index.js";
8
8
  export * as Cache from "./Cache/index.js";
9
9
  export * as Flags from "./Helpers/flags.js";
10
10
  export * as Intents from "./Helpers/intents.js";
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export * as Discord from "./types.js";
2
2
  export * as Config from "./DiscordConfig/index.js";
3
- export * as Http from "./Http/index.js";
3
+ export { Http, LiveHttp, FetchError, StatusCodeError, JsonParseError, BlobError, } from "./Http/index.js";
4
4
  export { DiscordREST, LiveDiscordREST } from "./DiscordREST/index.js";
5
5
  export * as Ix from "./Interactions/index.js";
6
6
  export * as Log from "./Log/index.js";
7
- export * as RateLimit from "./RateLimit/index.js";
7
+ export { RateLimitStore, LiveMemoryRateLimitStore, RateLimiter, LiveRateLimiter, } from "./RateLimit/index.js";
8
8
  export * as Cache from "./Cache/index.js";
9
9
  export * as Flags from "./Helpers/flags.js";
10
10
  export * as Intents from "./Helpers/intents.js";
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAClD,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAEL,cAAc,EACd,wBAAwB,EACxB,WAAW,EACX,eAAe,GAChB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dfx",
3
- "version": "0.18.2",
3
+ "version": "0.20.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -49,5 +49,5 @@
49
49
  "@fp-ts/data": "^0.0.25"
50
50
  }
51
51
  },
52
- "gitHead": "fc1f1e1001e30b05e8c36c75b0a98d1940d42d07"
52
+ "gitHead": "379dfb9bdfef4d6ab9163da42b7f159d4085ff39"
53
53
  }