dfx 0.21.21 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cache/memory.d.ts +2 -2
- package/Cache/memoryTTL.d.ts +2 -2
- package/Cache/prelude.d.ts +5 -5
- package/Cache/prelude.js +1 -1
- package/Cache/prelude.js.map +1 -1
- package/Cache.d.ts +69 -0
- package/{Cache/index.js → Cache.js} +4 -4
- package/Cache.js.map +1 -0
- package/{DiscordConfig/index.d.ts → DiscordConfig.d.ts} +3 -3
- package/{DiscordConfig/index.js → DiscordConfig.js} +1 -1
- package/DiscordConfig.js.map +1 -0
- package/DiscordGateway/{DiscordWS/index.d.ts → DiscordWS.d.ts} +5 -5
- package/DiscordGateway/{DiscordWS/index.js → DiscordWS.js} +1 -1
- package/DiscordGateway/DiscordWS.js.map +1 -0
- package/DiscordGateway/Shard/heartbeats.d.ts +1 -1
- package/DiscordGateway/Shard/identify.d.ts +1 -1
- package/DiscordGateway/Shard/identify.js +2 -2
- package/DiscordGateway/Shard/identify.js.map +1 -1
- package/DiscordGateway/Shard/invalidSession.d.ts +1 -1
- package/DiscordGateway/Shard/utils.d.ts +2 -2
- package/DiscordGateway/Shard/utils.js +1 -1
- package/DiscordGateway/Shard/utils.js.map +1 -1
- package/DiscordGateway/Shard.d.ts +9 -0
- package/DiscordGateway/{Shard/index.js → Shard.js} +7 -7
- package/DiscordGateway/Shard.js.map +1 -0
- package/DiscordGateway/{ShardStore/index.d.ts → ShardStore.d.ts} +2 -2
- package/DiscordGateway/{ShardStore/index.js → ShardStore.js} +1 -1
- package/DiscordGateway/ShardStore.js.map +1 -0
- package/DiscordGateway/Sharder.d.ts +16 -0
- package/DiscordGateway/{Sharder/index.js → Sharder.js} +3 -3
- package/DiscordGateway/Sharder.js.map +1 -0
- package/DiscordGateway/{WS/index.d.ts → WS.d.ts} +1 -1
- package/DiscordGateway/{WS/index.js → WS.js} +1 -1
- package/DiscordGateway/WS.js.map +1 -0
- package/DiscordGateway.d.ts +12 -0
- package/{DiscordGateway/index.js → DiscordGateway.js} +2 -2
- package/{DiscordGateway/index.js.map → DiscordGateway.js.map} +1 -1
- package/DiscordREST/types.d.ts +5 -7
- package/DiscordREST/utils.d.ts +1 -1
- package/DiscordREST/utils.js +3 -4
- package/DiscordREST/utils.js.map +1 -1
- package/DiscordREST.d.ts +194 -0
- package/DiscordREST.js +120 -0
- package/DiscordREST.js.map +1 -0
- package/Helpers/interactions.js +8 -8
- package/Helpers/interactions.js.map +1 -1
- package/Helpers/permissions.d.ts +2 -2
- package/Interactions/context.d.ts +6 -6
- package/Interactions/context.js +4 -4
- package/Interactions/context.js.map +1 -1
- package/Interactions/gateway.d.ts +4 -2
- package/Interactions/gateway.js +2 -3
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.js +6 -6
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/index.d.ts +3 -2
- package/Interactions/index.js +2 -1
- package/Interactions/index.js.map +1 -1
- package/Interactions/webhook.d.ts +3 -3
- package/Log.d.ts +12 -0
- package/{Log/index.js → Log.js} +1 -1
- package/Log.js.map +1 -0
- package/RateLimit/memory.d.ts +1 -1
- package/RateLimit/memory.js +2 -2
- package/RateLimit/memory.js.map +1 -1
- package/{RateLimit/index.d.ts → RateLimit.d.ts} +6 -6
- package/{RateLimit/index.js → RateLimit.js} +3 -3
- package/RateLimit.js.map +1 -0
- package/gateway.d.ts +10 -10
- package/gateway.js +11 -12
- package/gateway.js.map +1 -1
- package/global.d.ts +1 -1
- package/index.d.ts +5 -6
- package/index.js +5 -6
- package/index.js.map +1 -1
- package/package.json +12 -10
- package/webhooks.d.ts +4 -4
- package/webhooks.js +3 -4
- package/webhooks.js.map +1 -1
- package/Cache/index.d.ts +0 -69
- package/Cache/index.js.map +0 -1
- package/DiscordConfig/index.js.map +0 -1
- package/DiscordGateway/DiscordWS/index.js.map +0 -1
- package/DiscordGateway/Shard/index.d.ts +0 -9
- package/DiscordGateway/Shard/index.js.map +0 -1
- package/DiscordGateway/ShardStore/index.js.map +0 -1
- package/DiscordGateway/Sharder/index.d.ts +0 -16
- package/DiscordGateway/Sharder/index.js.map +0 -1
- package/DiscordGateway/WS/index.js.map +0 -1
- package/DiscordGateway/index.d.ts +0 -12
- package/DiscordREST/index.d.ts +0 -188
- package/DiscordREST/index.js +0 -122
- package/DiscordREST/index.js.map +0 -1
- package/Http/index.d.ts +0 -37
- package/Http/index.js +0 -51
- package/Http/index.js.map +0 -1
- package/Log/index.d.ts +0 -12
- package/Log/index.js.map +0 -1
- package/RateLimit/index.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Effect, Discord } from "dfx/_common";
|
|
2
|
-
import { ShardStore } from "../ShardStore/index.js";
|
|
3
|
-
declare const make: import("../../_common.js").Effect<import("../../_common.js").Scope | import("../../index.js").DiscordREST | import("../../DiscordConfig/index.js").DiscordConfig | import("../../Log/index.js").Log | import("../../index.js").RateLimiter | import("../DiscordWS/index.js").DiscordWSCodec | ShardStore, never, {
|
|
4
|
-
shards: import("../../_common.js").Stream<never, never, {
|
|
5
|
-
run: import("../../_common.js").Effect<never, never, void>;
|
|
6
|
-
raw: import("../../_common.js").Stream<never, never, import("../../types.js").GatewayPayload<any>>;
|
|
7
|
-
dispatch: import("../../_common.js").Stream<never, never, import("../../types.js").GatewayPayload<import("../../types.js").ReceiveEvent>>;
|
|
8
|
-
send: (p: import("../../types.js").GatewayPayload<any>) => import("../../_common.js").Effect<never, never, boolean>;
|
|
9
|
-
reconnect: import("../../_common.js").Effect<never, never, boolean>;
|
|
10
|
-
}>;
|
|
11
|
-
}>;
|
|
12
|
-
export interface Sharder extends Effect.Success<typeof make> {
|
|
13
|
-
}
|
|
14
|
-
export declare const Sharder: import("../../_common.js").Tag<Sharder>;
|
|
15
|
-
export declare const LiveSharder: import("../../_common.js").Layer<import("../../index.js").DiscordREST | import("../../DiscordConfig/index.js").DiscordConfig | import("../../Log/index.js").Log | import("../../index.js").RateLimiter | import("../DiscordWS/index.js").DiscordWSCodec | ShardStore, never, Sharder>;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Sharder/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,MAAM,IAAI,2BACQ,wBAAe,UAAU,CAAC,EAApC,KAAK,4BACI,wCAAe,WAAW,CAAC,EAApC,IAAI,4BACoB,wBAAe,gBAAA,aAAa,CAAC,aAAa,CAAC,GAAnE,EAAE,OAAO,EAAE,MAAM,EAAE,6BACP,wCAAe,WAAW,CAAC,EAAvC,OAAO;IAEb,MAAM,OAAO,GAAG,CAAC,UAAkB,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,CAAC,YAAoB,EAAgC,EAAE,CACrE,wBAAA,KAAK;aACF,OAAO,CAAC;YACP,UAAU;YACV,YAAY;SACb,CAAC,EACO,CAAC,CAAC,EAAE,CACX,sBACE,GAAG,EAAE,CAAC,sBAAA,OAAO,CAAC,YAAY,CAAC,EAAO,wBAAiB,CAAC,CAAC,CAAC,EACtD,EAAE,CAAC,EAAE,CAAC,wBAAe,EAAE,CAAC,EAF1B,CAAC,CAGA,CACF,CAAA;QAEL,OAAO,oBAAA,6BAAoB,CAAC,EAAE,YAAY,CAAC,EAAE,CAC3C,oBAAA,OAAO,CAAC,YAAY,CAAC,EAAK,EAAE,CAAC,EAAE,CAC7B,qBAAW,CAAC,EAAE,EAAE,YAAY,GAAG,CAAC,CAAU,CAAC,CAC5C,CACF,EAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YACX,EAAE;YACF,UAAU;SACX,CAAC,CAAC,CAAA;IACL,CAAC,CAAA;mCAGC,yBAAA,wBAAA,IAAI;SACD,aAAa,EAAE,EACP,CAAC,CAAC,EAAE,CA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Ae,gBAAA,GAAG,CAAC,GAAG,CAAC,EAA/B,GAAG,wBACI,MAAM,CAAC,GAAG,CAAC,EAAlB,EAAE;IACR,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,CAAA;IAE9C,OAAO,sBAAA,sBAAA,IAAI,CAAC,EAAE,CAAC,EACN,2BAAkB,UAAU,CAAC,CAAC,EAEnC,2BACE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CACzD,CACF,CAAA;kCAGN,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Stream, Discord, Effect } from "dfx/_common";
|
|
2
|
-
import { Sharder } from "./Sharder/index.js";
|
|
3
|
-
export declare const make: import("../_common.js").Effect<import("../_common.js").Scope | Sharder, never, {
|
|
4
|
-
raw: import("../_common.js").Stream<never, never, import("../types.js").GatewayPayload<any>>;
|
|
5
|
-
dispatch: import("../_common.js").Stream<never, never, import("../types.js").GatewayPayload<import("../types.js").ReceiveEvent>>;
|
|
6
|
-
fromDispatch: <K extends keyof import("../types.js").ReceiveEvents>(event: K) => import("../_common.js").Stream<never, never, import("../types.js").ReceiveEvents[K]>;
|
|
7
|
-
handleDispatch: <K_1 extends keyof import("../types.js").ReceiveEvents, R1, E1, A>(event: K_1, handle: (event: import("../types.js").ReceiveEvents[K_1]) => import("../_common.js").Effect<R1, E1, A>) => import("../_common.js").Effect<R1, E1, void>;
|
|
8
|
-
}>;
|
|
9
|
-
export interface DiscordGateway extends Effect.Success<typeof make> {
|
|
10
|
-
}
|
|
11
|
-
export declare const DiscordGateway: import("../_common.js").Tag<DiscordGateway>;
|
|
12
|
-
export declare const LiveDiscordGateway: import("../_common.js").Layer<Sharder, never, DiscordGateway>;
|
package/DiscordREST/index.d.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { BucketDetails, FetchError, StatusCodeError, JsonParseError } from "dfx";
|
|
2
|
-
import { Effect, Discord } from "dfx/_common";
|
|
3
|
-
import { ResponseWithData, RestResponse } from "./types.js";
|
|
4
|
-
declare const make: import("../_common.js").Effect<import("../DiscordConfig/index.js").DiscordConfig | import("../index.js").Http | import("../Log/index.js").Log | import("../index.js").RateLimitStore | import("../index.js").RateLimiter, never, {
|
|
5
|
-
addGuildMember: (guildId: string, userId: string, params?: Partial<import("../types.js").AddGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
|
|
6
|
-
addGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
7
|
-
addThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
8
|
-
batchEditApplicationCommandPermissions: (applicationId: string, guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
9
|
-
beginGuildPrune: (guildId: string, params?: Partial<import("../types.js").BeginGuildPruneParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
10
|
-
bulkDeleteMessages: (channelId: string, params?: Partial<import("../types.js").BulkDeleteMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
11
|
-
bulkOverwriteGlobalApplicationCommands: (applicationId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
|
|
12
|
-
bulkOverwriteGuildApplicationCommands: (applicationId: string, guildId: string, params?: Partial<import("../types.js").BulkOverwriteGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand[]>;
|
|
13
|
-
createAutoModerationRule: (guildId: string, params?: Partial<import("../types.js").CreateAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule>;
|
|
14
|
-
createChannelInvite: (channelId: string, params?: Partial<import("../types.js").CreateChannelInviteParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
|
|
15
|
-
createDm: (params?: Partial<import("../types.js").CreateDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
16
|
-
createFollowupMessage: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
17
|
-
createGlobalApplicationCommand: (applicationId: string, params?: Partial<import("../types.js").CreateGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
|
|
18
|
-
createGroupDm: (params?: Partial<import("../types.js").CreateGroupDmParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
19
|
-
createGuild: (params?: Partial<import("../types.js").CreateGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
|
|
20
|
-
createGuildApplicationCommand: (applicationId: string, guildId: string, params?: Partial<import("../types.js").CreateGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
|
|
21
|
-
createGuildBan: (guildId: string, userId: string, params?: Partial<import("../types.js").CreateGuildBanParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
22
|
-
createGuildChannel: (guildId: string, params?: Partial<import("../types.js").CreateGuildChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
23
|
-
createGuildEmoji: (guildId: string, params?: Partial<import("../types.js").CreateGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji>;
|
|
24
|
-
createGuildFromGuildTemplate: (templateCode: string, params?: Partial<import("../types.js").CreateGuildFromGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
|
|
25
|
-
createGuildRole: (guildId: string, params?: Partial<import("../types.js").CreateGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role>;
|
|
26
|
-
createGuildScheduledEvent: (guildId: string, params?: Partial<import("../types.js").CreateGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent>;
|
|
27
|
-
createGuildSticker: (guildId: string, params?: Partial<import("../types.js").CreateGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
|
|
28
|
-
createGuildTemplate: (guildId: string, params?: Partial<import("../types.js").CreateGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
|
|
29
|
-
createInteractionResponse: (interactionId: string, interactionToken: string, params?: Partial<import("../types.js").InteractionResponse> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").InteractionResponse>;
|
|
30
|
-
createMessage: (channelId: string, params?: Partial<import("../types.js").CreateMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
|
|
31
|
-
createReaction: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
32
|
-
createStageInstance: (params?: Partial<import("../types.js").CreateStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").StageInstance>;
|
|
33
|
-
createWebhook: (channelId: string, params?: Partial<import("../types.js").CreateWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
|
|
34
|
-
crosspostMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
|
|
35
|
-
deleteAllReactions: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
36
|
-
deleteAllReactionsForEmoji: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
37
|
-
deleteAutoModerationRule: (guildId: string, autoModerationRuleId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
38
|
-
deleteChannelPermission: (channelId: string, overwriteId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
39
|
-
deletecloseChannel: (channelId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
40
|
-
deleteFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
41
|
-
deleteGlobalApplicationCommand: (applicationId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
42
|
-
deleteGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
43
|
-
deleteGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
44
|
-
deleteGuildEmoji: (guildId: string, emojiId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
45
|
-
deleteGuildIntegration: (guildId: string, integrationId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
46
|
-
deleteGuildRole: (guildId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
47
|
-
deleteGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
48
|
-
deleteGuildSticker: (guildId: string, stickerId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
49
|
-
deleteGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
|
|
50
|
-
deleteInvite: (inviteCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Invite>;
|
|
51
|
-
deleteMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
52
|
-
deleteOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
53
|
-
deleteOwnReaction: (channelId: string, messageId: string, emoji: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
54
|
-
deleteStageInstance: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
55
|
-
deleteUserReaction: (channelId: string, messageId: string, emoji: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
56
|
-
deleteWebhook: (webhookId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
57
|
-
deleteWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").DeleteWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
58
|
-
deleteWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
59
|
-
editApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, params?: Partial<import("../types.js").EditApplicationCommandPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildApplicationCommandPermission>;
|
|
60
|
-
editChannelPermissions: (channelId: string, overwriteId: string, params?: Partial<import("../types.js").EditChannelPermissionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
61
|
-
editFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
62
|
-
editGlobalApplicationCommand: (applicationId: string, commandId: string, params?: Partial<import("../types.js").EditGlobalApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
|
|
63
|
-
editGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, params?: Partial<import("../types.js").EditGuildApplicationCommandParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationCommand>;
|
|
64
|
-
editMessage: (channelId: string, messageId: string, params?: Partial<import("../types.js").EditMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
|
|
65
|
-
editOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
66
|
-
editWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").EditWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
|
|
67
|
-
executeGitHubCompatibleWebhook: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
68
|
-
executeSlackCompatibleWebhook: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
69
|
-
executeWebhook: (webhookId: string, webhookToken: string, params?: Partial<import("../types.js").ExecuteWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
70
|
-
followAnnouncementChannel: (channelId: string, params?: Partial<import("../types.js").FollowAnnouncementChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").FollowedChannel>;
|
|
71
|
-
getApplicationCommandPermissions: (applicationId: string, guildId: string, commandId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildApplicationCommandPermission>;
|
|
72
|
-
getApplicationRoleConnectionMetadataRecords: (applicationId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationRoleConnectionMetadatum[]>;
|
|
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, params?: Partial<import("../types.js").GetThreadMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ThreadMember>;
|
|
123
|
-
getUser: (userId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").User>;
|
|
124
|
-
getUserApplicationRoleConnection: (applicationId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationRoleConnection>;
|
|
125
|
-
getUserConnections: (options?: RequestInit | undefined) => RestResponse<import("../types.js").Connection[]>;
|
|
126
|
-
getWebhook: (webhookId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
|
|
127
|
-
getWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<import("../types.js").GetWebhookMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Message>;
|
|
128
|
-
getWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
129
|
-
groupDmAddRecipient: (channelId: string, userId: string, params?: Partial<import("../types.js").GroupDmAddRecipientParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
130
|
-
groupDmRemoveRecipient: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
131
|
-
joinThread: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
132
|
-
leaveGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
133
|
-
leaveThread: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
134
|
-
listActiveGuildThreads: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListActiveGuildThreadResponse>;
|
|
135
|
-
listAutoModerationRulesForGuild: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule[]>;
|
|
136
|
-
listGuildEmojis: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji[]>;
|
|
137
|
-
listGuildMembers: (guildId: string, params?: Partial<import("../types.js").ListGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember[]>;
|
|
138
|
-
listGuildStickers: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker[]>;
|
|
139
|
-
listJoinedPrivateArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListJoinedPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListJoinedPrivateArchivedThreadResponse>;
|
|
140
|
-
listNitroStickerPacks: (options?: RequestInit | undefined) => RestResponse<any>;
|
|
141
|
-
listPrivateArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListPrivateArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListPrivateArchivedThreadResponse>;
|
|
142
|
-
listPublicArchivedThreads: (channelId: string, params?: Partial<import("../types.js").ListPublicArchivedThreadParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ListPublicArchivedThreadResponse>;
|
|
143
|
-
listScheduledEventsForGuild: (guildId: string, params?: Partial<import("../types.js").ListScheduledEventsForGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent[]>;
|
|
144
|
-
listThreadMembers: (channelId: string, params?: Partial<import("../types.js").ListThreadMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ThreadMember[]>;
|
|
145
|
-
listVoiceRegions: (options?: RequestInit | undefined) => RestResponse<import("../types.js").VoiceRegion[]>;
|
|
146
|
-
modifyAutoModerationRule: (guildId: string, autoModerationRuleId: string, params?: Partial<import("../types.js").ModifyAutoModerationRuleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").AutoModerationRule>;
|
|
147
|
-
modifyChannel: (channelId: string, params?: Partial<import("../types.js").ModifyChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
148
|
-
modifyCurrentMember: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
149
|
-
modifyCurrentUser: (params?: Partial<import("../types.js").ModifyCurrentUserParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").User>;
|
|
150
|
-
modifyCurrentUserNick: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentUserNickParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
151
|
-
modifyCurrentUserVoiceState: (guildId: string, params?: Partial<import("../types.js").ModifyCurrentUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
152
|
-
modifyGuild: (guildId: string, params?: Partial<import("../types.js").ModifyGuildParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Guild>;
|
|
153
|
-
modifyGuildChannelPositions: (guildId: string, params?: Partial<import("../types.js").ModifyGuildChannelPositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
154
|
-
modifyGuildEmoji: (guildId: string, emojiId: string, params?: Partial<import("../types.js").ModifyGuildEmojiParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Emoji>;
|
|
155
|
-
modifyGuildMember: (guildId: string, userId: string, params?: Partial<import("../types.js").ModifyGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember>;
|
|
156
|
-
modifyGuildMfaLevel: (guildId: string, params?: Partial<import("../types.js").ModifyGuildMfaLevelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").MfaLevel>;
|
|
157
|
-
modifyGuildRole: (guildId: string, roleId: string, params?: Partial<import("../types.js").ModifyGuildRoleParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role>;
|
|
158
|
-
modifyGuildRolePositions: (guildId: string, params?: Partial<import("../types.js").ModifyGuildRolePositionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Role[]>;
|
|
159
|
-
modifyGuildScheduledEvent: (guildId: string, guildScheduledEventId: string, params?: Partial<import("../types.js").ModifyGuildScheduledEventParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildScheduledEvent>;
|
|
160
|
-
modifyGuildSticker: (guildId: string, stickerId: string, params?: Partial<import("../types.js").ModifyGuildStickerParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Sticker>;
|
|
161
|
-
modifyGuildTemplate: (guildId: string, templateCode: string, params?: Partial<import("../types.js").ModifyGuildTemplateParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
|
|
162
|
-
modifyGuildWelcomeScreen: (guildId: string, params?: Partial<import("../types.js").ModifyGuildWelcomeScreenParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").WelcomeScreen>;
|
|
163
|
-
modifyGuildWidget: (guildId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildWidgetSetting>;
|
|
164
|
-
modifyStageInstance: (channelId: string, params?: Partial<import("../types.js").ModifyStageInstanceParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").StageInstance>;
|
|
165
|
-
modifyUserVoiceState: (guildId: string, userId: string, params?: Partial<import("../types.js").ModifyUserVoiceStateParams> | undefined, options?: RequestInit | undefined) => RestResponse<any>;
|
|
166
|
-
modifyWebhook: (webhookId: string, params?: Partial<import("../types.js").ModifyWebhookParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Webhook>;
|
|
167
|
-
modifyWebhookWithToken: (webhookId: string, webhookToken: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
168
|
-
pinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
169
|
-
removeGuildBan: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
170
|
-
removeGuildMember: (guildId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
171
|
-
removeGuildMemberRole: (guildId: string, userId: string, roleId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
172
|
-
removeThreadMember: (channelId: string, userId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
173
|
-
searchGuildMembers: (guildId: string, params?: Partial<import("../types.js").SearchGuildMemberParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildMember[]>;
|
|
174
|
-
startThreadFromMessage: (channelId: string, messageId: string, params?: Partial<import("../types.js").StartThreadFromMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
175
|
-
startThreadInForumChannel: (channelId: string, params?: Partial<import("../types.js").StartThreadInForumChannelParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
176
|
-
startThreadWithoutMessage: (channelId: string, params?: Partial<import("../types.js").StartThreadWithoutMessageParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").Channel>;
|
|
177
|
-
syncGuildTemplate: (guildId: string, templateCode: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").GuildTemplate>;
|
|
178
|
-
triggerTypingIndicator: (channelId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
179
|
-
unpinMessage: (channelId: string, messageId: string, options?: RequestInit | undefined) => RestResponse<any>;
|
|
180
|
-
updateApplicationRoleConnectionMetadataRecords: (applicationId: string, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationRoleConnectionMetadatum[]>;
|
|
181
|
-
updateUserApplicationRoleConnection: (applicationId: string, params?: Partial<import("../types.js").UpdateUserApplicationRoleConnectionParams> | undefined, options?: RequestInit | undefined) => RestResponse<import("../types.js").ApplicationRoleConnection>;
|
|
182
|
-
request: <A = unknown>(path: string, init?: RequestInit) => import("../_common.js").Effect<never, import("../index.js").FetchError | import("../index.js").StatusCodeError | import("../index.js").JsonParseError, ResponseWithData<A>>;
|
|
183
|
-
}>;
|
|
184
|
-
export interface DiscordREST extends Effect.Success<typeof make> {
|
|
185
|
-
}
|
|
186
|
-
export declare const DiscordREST: import("../_common.js").Tag<DiscordREST>;
|
|
187
|
-
export declare const LiveDiscordREST: import("../_common.js").Layer<import("../DiscordConfig/index.js").DiscordConfig | import("../index.js").Http | import("../Log/index.js").Log | import("../index.js").RateLimitStore | import("../index.js").RateLimiter, never, DiscordREST>;
|
|
188
|
-
export {};
|
package/DiscordREST/index.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "dfx/_common";
|
|
2
|
-
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
-
import * as tsplus_module_3 from "@effect/data/Duration";
|
|
4
|
-
import * as tsplus_module_4 from "@fp-ts/core/Option";
|
|
5
|
-
import * as tsplus_module_5 from "@effect/io/Config/Secret";
|
|
6
|
-
import * as tsplus_module_6 from "@effect/data/HashSet";
|
|
7
|
-
import * as tsplus_module_7 from "@effect/io/Ref";
|
|
8
|
-
import * as tsplus_module_8 from "dfx";
|
|
9
|
-
import * as tsplus_module_9 from "@effect/io/Layer";
|
|
10
|
-
import { millis } from "@effect/data/Duration";
|
|
11
|
-
import Pkg from "../package.json" assert { type: "json" };
|
|
12
|
-
import { rateLimitFromHeaders, retryAfter, routeFromConfig } from "./utils.js";
|
|
13
|
-
const make = tsplus_module_2.flatMap(tsplus_module_2.service(tsplus_module_8.Http), http => tsplus_module_2.flatMap(tsplus_module_2.service(tsplus_module_8.DiscordConfig.DiscordConfig), ({ token, rest }) => tsplus_module_2.flatMap(tsplus_module_2.service(tsplus_module_8.Log.Log), log => tsplus_module_2.flatMap(tsplus_module_2.service(tsplus_module_8.RateLimitStore), store => tsplus_module_2.flatMap(tsplus_module_2.service(tsplus_module_8.RateLimiter), ({ maybeWait }) => {
|
|
14
|
-
const globalRateLimit = maybeWait("dfx.rest.global", rest.globalRateLimit.window, rest.globalRateLimit.limit);
|
|
15
|
-
return tsplus_module_2.map(tsplus_module_7.make(tsplus_module_6.empty()), badRoutesRef => {
|
|
16
|
-
const addBadRoute = (route) => tsplus_module_2.collectAllParDiscard([
|
|
17
|
-
log.info("DiscordREST", "addBadRoute", route),
|
|
18
|
-
tsplus_module_7.update(badRoutesRef, s => tsplus_module_6.add(s, route)),
|
|
19
|
-
store.incrementCounter("dfx.rest.invalid", tsplus_module_3.minutes(10).millis, 10000),
|
|
20
|
-
]);
|
|
21
|
-
const isBadRoute = (route) => tsplus_module_2.map(tsplus_module_7.get(badRoutesRef), s => tsplus_module_6.has(s, route));
|
|
22
|
-
const removeBadRoute = (route) => tsplus_module_7.update(badRoutesRef, s => tsplus_module_6.remove(s, route));
|
|
23
|
-
const invalidRateLimit = (route) => tsplus_module_2.asUnit(tsplus_module_2.tap(isBadRoute(route), invalid => invalid
|
|
24
|
-
? maybeWait("dfx.rest.invalid", tsplus_module_3.minutes(10), 10000)
|
|
25
|
-
: tsplus_module_2.unit()));
|
|
26
|
-
// Request rate limiting
|
|
27
|
-
const requestRateLimit = (path, init) => (() => {
|
|
28
|
-
const route = routeFromConfig(path, init);
|
|
29
|
-
return tsplus_module_2.flatMap(store.getBucketForRoute(route), maybeBucket => {
|
|
30
|
-
const bucket = tsplus_module_4.getOrElse(() => ({
|
|
31
|
-
key: `?.${route}`,
|
|
32
|
-
resetAfter: 5000,
|
|
33
|
-
limit: 1,
|
|
34
|
-
}))(maybeBucket);
|
|
35
|
-
const resetAfter = millis(bucket.resetAfter);
|
|
36
|
-
return tsplus_module_2.flatMap(invalidRateLimit(route), () => tsplus_module_2.map(maybeWait(`dfx.rest.${bucket.key}`, resetAfter, bucket.limit), () => void 0));
|
|
37
|
-
});
|
|
38
|
-
})();
|
|
39
|
-
// Update rate limit buckets
|
|
40
|
-
const updateBuckets = (path, init, response) => tsplus_module_2.ignore((() => {
|
|
41
|
-
const route = routeFromConfig(path, init);
|
|
42
|
-
return tsplus_module_2.flatMap(tsplus_module_2.fromOption(rateLimitFromHeaders(response.headers)), ({ bucket, retryAfter, limit, remaining }) => {
|
|
43
|
-
const effectsToRun = [
|
|
44
|
-
removeBadRoute(route),
|
|
45
|
-
store.putBucketRoute(route, bucket),
|
|
46
|
-
];
|
|
47
|
-
return tsplus_module_2.flatMap(store.hasBucket(bucket), hasBucket => {
|
|
48
|
-
if (!hasBucket || limit - 1 === remaining) {
|
|
49
|
-
effectsToRun.push(store.removeCounter(`dfx.rest.?.${route}`), store.putBucket({
|
|
50
|
-
key: bucket,
|
|
51
|
-
resetAfter: retryAfter.millis,
|
|
52
|
-
limit: !hasBucket && remaining > 0 ? remaining : limit,
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
return tsplus_module_2.map(tsplus_module_2.collectAllParDiscard(effectsToRun), () => void 0);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
})());
|
|
59
|
-
const request = (path, init = {}) => tsplus_module_2.catchTag(tsplus_module_2.flatMap(requestRateLimit(path, init), () => tsplus_module_2.flatMap(globalRateLimit, () => tsplus_module_2.flatMap(http.requestWithJson(`${rest.baseUrl}${path}`, {
|
|
60
|
-
...init,
|
|
61
|
-
headers: {
|
|
62
|
-
...(init?.headers ?? {}),
|
|
63
|
-
Authorization: `Bot ${tsplus_module_5.value(token)}`,
|
|
64
|
-
"User-Agent": `DiscordBot (https://github.com/tim-smart/dfx, ${Pkg.version})`,
|
|
65
|
-
},
|
|
66
|
-
}), response => tsplus_module_2.map(updateBuckets(path, init, response.response), () => response)))), "StatusCodeError", e => {
|
|
67
|
-
switch (e.code) {
|
|
68
|
-
case 403:
|
|
69
|
-
return tsplus_module_2.flatMap(tsplus_module_2.collectAllParDiscard([
|
|
70
|
-
log.info("DiscordREST", "403", path),
|
|
71
|
-
addBadRoute(routeFromConfig(path, init)),
|
|
72
|
-
updateBuckets(path, init, e.response),
|
|
73
|
-
]), () => tsplus_module_2.fail(e));
|
|
74
|
-
case 429:
|
|
75
|
-
return tsplus_module_2.flatMap(tsplus_module_2.collectAllParDiscard([
|
|
76
|
-
log.info("DiscordREST", "429", path),
|
|
77
|
-
addBadRoute(routeFromConfig(path, init)),
|
|
78
|
-
updateBuckets(path, init, e.response),
|
|
79
|
-
tsplus_module_2.sleep(tsplus_module_4.getOrElse(() => tsplus_module_3.seconds(5))(retryAfter(e.response.headers))),
|
|
80
|
-
]), () => request(path, init));
|
|
81
|
-
}
|
|
82
|
-
return tsplus_module_2.fail(e);
|
|
83
|
-
});
|
|
84
|
-
const routes = tsplus_module_1.Discord.createRoutes(({ method, url, params, options = {}, }) => {
|
|
85
|
-
const hasBody = method !== "GET" && method !== "DELETE";
|
|
86
|
-
let hasFormData = typeof options?.body?.append === "function";
|
|
87
|
-
let body = undefined;
|
|
88
|
-
const headers = {};
|
|
89
|
-
if (hasBody && !hasFormData) {
|
|
90
|
-
headers["content-type"] = "application/json";
|
|
91
|
-
}
|
|
92
|
-
const qs = new URLSearchParams();
|
|
93
|
-
if (!hasBody) {
|
|
94
|
-
Object.entries((params ?? {})).forEach(([key, value]) => {
|
|
95
|
-
qs.append(key, value);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else if (hasFormData) {
|
|
99
|
-
body = options.body;
|
|
100
|
-
if (params) {
|
|
101
|
-
;
|
|
102
|
-
body.append("payload_json", JSON.stringify(params));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (params) {
|
|
106
|
-
body = JSON.stringify(params);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
body = options.body;
|
|
110
|
-
}
|
|
111
|
-
return request(`${url}?${qs.toString()}`, {
|
|
112
|
-
method,
|
|
113
|
-
headers,
|
|
114
|
-
body,
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
return { request, ...routes };
|
|
118
|
-
});
|
|
119
|
-
})))));
|
|
120
|
-
export const DiscordREST = tsplus_module_1.Tag();
|
|
121
|
-
export const LiveDiscordREST = tsplus_module_9.effect(DiscordREST, make);
|
|
122
|
-
//# sourceMappingURL=index.js.map
|
package/DiscordREST/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordREST/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,GAAG,MAAM,iBAAiB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAA;AAEzD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE9E,MAAM,IAAI,2BACO,wCAAe,IAAI,CAAC,EAA7B,IAAI,4BACgB,wBAAe,gBAAA,aAAa,CAAC,aAAa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AAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;iBACnE;aACF;iBAAM,IAAI,MAAM,EAAE;gBACjB,IAAI,GAAG,IAAI,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;;MAC7B,CAAA;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAA,GAAG,EAAe,CAAA;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAa,WAAW,EAAE,IAAI,CAAC,CAAA"}
|
package/Http/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
declare const make: () => {
|
|
2
|
-
request: (url: URL | string, init?: RequestInit) => import("../_common.js").Effect<never, FetchError | StatusCodeError, Response>;
|
|
3
|
-
requestWithJson: <A = unknown>(url: URL | string, init?: RequestInit) => import("../_common.js").Effect<never, FetchError | StatusCodeError, {
|
|
4
|
-
response: Response;
|
|
5
|
-
json: import("../_common.js").Effect<never, JsonParseError, A>;
|
|
6
|
-
blob: import("../_common.js").Effect<never, BlobError, Blob>;
|
|
7
|
-
text: import("../_common.js").Effect<never, never, string>;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
export interface Http extends ReturnType<typeof make> {
|
|
11
|
-
}
|
|
12
|
-
export declare const Http: import("../_common.js").Tag<Http>;
|
|
13
|
-
export declare const LiveHttp: import("../_common.js").Layer<never, never, Http>;
|
|
14
|
-
export declare class FetchError {
|
|
15
|
-
readonly reason: unknown;
|
|
16
|
-
readonly _tag = "FetchError";
|
|
17
|
-
constructor(reason: unknown);
|
|
18
|
-
}
|
|
19
|
-
export declare class StatusCodeError {
|
|
20
|
-
readonly response: Response;
|
|
21
|
-
readonly _tag = "StatusCodeError";
|
|
22
|
-
readonly code: number;
|
|
23
|
-
constructor(response: Response);
|
|
24
|
-
}
|
|
25
|
-
export declare class JsonParseError {
|
|
26
|
-
readonly reason: unknown;
|
|
27
|
-
readonly _tag = "JsonParseError";
|
|
28
|
-
constructor(reason: unknown);
|
|
29
|
-
}
|
|
30
|
-
export declare const json: <A = unknown>(r: Response) => import("../_common.js").Effect<never, JsonParseError, A>;
|
|
31
|
-
export declare class BlobError {
|
|
32
|
-
readonly reason: unknown;
|
|
33
|
-
readonly _tag = "BlobError";
|
|
34
|
-
constructor(reason: unknown);
|
|
35
|
-
}
|
|
36
|
-
export declare const blob: (r: Response) => import("../_common.js").Effect<never, BlobError, Blob>;
|
|
37
|
-
export {};
|
package/Http/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
-
import * as tsplus_module_2 from "dfx/_common";
|
|
3
|
-
import * as tsplus_module_3 from "@effect/io/Layer";
|
|
4
|
-
const make = () => {
|
|
5
|
-
const request = (url, init = {}) => tsplus_module_1.filterOrElseWith(tsplus_module_1.tryCatchPromiseInterrupt(signal => fetch(url, {
|
|
6
|
-
...init,
|
|
7
|
-
signal,
|
|
8
|
-
}), e => new FetchError(e)), r => r.status < 300, r => tsplus_module_1.fail(new StatusCodeError(r)));
|
|
9
|
-
const requestWithJson = (url, init = {}) => tsplus_module_1.map(request(url, init), response => ({
|
|
10
|
-
response,
|
|
11
|
-
json: json(response),
|
|
12
|
-
blob: blob(response),
|
|
13
|
-
text: tsplus_module_1.promise(() => response.text()),
|
|
14
|
-
}));
|
|
15
|
-
return { request, requestWithJson };
|
|
16
|
-
};
|
|
17
|
-
export const Http = tsplus_module_2.Tag();
|
|
18
|
-
export const LiveHttp = tsplus_module_3.sync(Http, make);
|
|
19
|
-
export class FetchError {
|
|
20
|
-
reason;
|
|
21
|
-
_tag = "FetchError";
|
|
22
|
-
constructor(reason) {
|
|
23
|
-
this.reason = reason;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class StatusCodeError {
|
|
27
|
-
response;
|
|
28
|
-
_tag = "StatusCodeError";
|
|
29
|
-
code;
|
|
30
|
-
constructor(response) {
|
|
31
|
-
this.response = response;
|
|
32
|
-
this.code = response.status;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export class JsonParseError {
|
|
36
|
-
reason;
|
|
37
|
-
_tag = "JsonParseError";
|
|
38
|
-
constructor(reason) {
|
|
39
|
-
this.reason = reason;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export const json = (r) => tsplus_module_1.tryCatchPromise(() => r.json(), reason => new JsonParseError(reason));
|
|
43
|
-
export class BlobError {
|
|
44
|
-
reason;
|
|
45
|
-
_tag = "BlobError";
|
|
46
|
-
constructor(reason) {
|
|
47
|
-
this.reason = reason;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export const blob = (r) => tsplus_module_1.tryCatchPromise(() => r.blob(), reason => new BlobError(reason));
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
package/Http/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Http/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,MAAM,OAAO,GAAG,CAAC,GAAiB,EAAE,OAAoB,EAAE,EAAE,EAAE,CAC5D,iCAAA,yCACE,MAAM,CAAC,EAAE,CACP,KAAK,CAAC,GAAG,EAAE;QACT,GAAG,IAAI;QACP,MAAM;KACP,CAAC,EACJ,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CACvB,EACC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,EACnB,CAAC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C,EAAE,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,CACrC,CAAA;AAEH,MAAM,OAAO,SAAS;IAEC;IADZ,IAAI,GAAG,WAAW,CAAA;IAC3B,YAAqB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;CACzC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAW,EAAE,EAAE,CAClC,gCACE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,MAAM,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAChC,CAAA"}
|
package/Log/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const make: (debug?: boolean) => {
|
|
2
|
-
info: (...args: any[]) => import("../_common.js").Effect<never, never, void>;
|
|
3
|
-
debug: (...args: any[]) => import("../_common.js").Effect<never, never, void>;
|
|
4
|
-
};
|
|
5
|
-
export interface Log extends ReturnType<typeof make> {
|
|
6
|
-
}
|
|
7
|
-
export declare const Log: import("../_common.js").Tag<Log>;
|
|
8
|
-
export declare const LiveLog: import("../_common.js").Layer<never, never, Log>;
|
|
9
|
-
export declare const LiveLogDebug: import("../_common.js").Layer<never, never, Log>;
|
|
10
|
-
export declare const info: (...args: any[]) => import("../_common.js").Effect<Log, never, void>;
|
|
11
|
-
export declare const debug: (...args: any[]) => import("../_common.js").Effect<Log, never, void>;
|
|
12
|
-
export {};
|
package/Log/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CACvB,qBAAY,GAAG,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;IAChC,CAAC,C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