dfx 0.21.22 → 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.
Files changed (113) hide show
  1. package/Cache/memory.d.ts +2 -2
  2. package/Cache/memoryTTL.d.ts +2 -2
  3. package/Cache/memoryTTL.js +11 -11
  4. package/Cache/memoryTTL.js.map +1 -1
  5. package/Cache/prelude.d.ts +5 -5
  6. package/Cache/prelude.js +52 -52
  7. package/Cache/prelude.js.map +1 -1
  8. package/Cache.d.ts +69 -0
  9. package/{Cache/index.js → Cache.js} +15 -15
  10. package/Cache.js.map +1 -0
  11. package/{DiscordConfig/index.d.ts → DiscordConfig.d.ts} +3 -3
  12. package/{DiscordConfig/index.js → DiscordConfig.js} +2 -2
  13. package/DiscordConfig.js.map +1 -0
  14. package/DiscordGateway/{DiscordWS/index.d.ts → DiscordWS.d.ts} +5 -5
  15. package/DiscordGateway/{DiscordWS/index.js → DiscordWS.js} +9 -9
  16. package/DiscordGateway/DiscordWS.js.map +1 -0
  17. package/DiscordGateway/Shard/heartbeats.d.ts +1 -1
  18. package/DiscordGateway/Shard/heartbeats.js +7 -7
  19. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  20. package/DiscordGateway/Shard/identify.d.ts +1 -1
  21. package/DiscordGateway/Shard/identify.js +3 -3
  22. package/DiscordGateway/Shard/identify.js.map +1 -1
  23. package/DiscordGateway/Shard/invalidSession.d.ts +1 -1
  24. package/DiscordGateway/Shard/invalidSession.js +1 -1
  25. package/DiscordGateway/Shard/invalidSession.js.map +1 -1
  26. package/DiscordGateway/Shard/utils.d.ts +2 -2
  27. package/DiscordGateway/Shard/utils.js +3 -3
  28. package/DiscordGateway/Shard/utils.js.map +1 -1
  29. package/DiscordGateway/Shard.d.ts +9 -0
  30. package/DiscordGateway/Shard.js +44 -0
  31. package/DiscordGateway/Shard.js.map +1 -0
  32. package/DiscordGateway/{ShardStore/index.d.ts → ShardStore.d.ts} +2 -2
  33. package/DiscordGateway/{ShardStore/index.js → ShardStore.js} +1 -1
  34. package/DiscordGateway/ShardStore.js.map +1 -0
  35. package/DiscordGateway/Sharder.d.ts +16 -0
  36. package/DiscordGateway/Sharder.js +42 -0
  37. package/DiscordGateway/Sharder.js.map +1 -0
  38. package/DiscordGateway/{WS/index.d.ts → WS.d.ts} +1 -1
  39. package/DiscordGateway/{WS/index.js → WS.js} +10 -10
  40. package/DiscordGateway/WS.js.map +1 -0
  41. package/DiscordGateway.d.ts +12 -0
  42. package/DiscordGateway.js +20 -0
  43. package/DiscordGateway.js.map +1 -0
  44. package/DiscordREST/types.d.ts +5 -7
  45. package/DiscordREST/utils.d.ts +1 -1
  46. package/DiscordREST/utils.js +3 -4
  47. package/DiscordREST/utils.js.map +1 -1
  48. package/DiscordREST.d.ts +194 -0
  49. package/DiscordREST.js +120 -0
  50. package/DiscordREST.js.map +1 -0
  51. package/Helpers/interactions.js +10 -10
  52. package/Helpers/interactions.js.map +1 -1
  53. package/Helpers/permissions.d.ts +2 -2
  54. package/Helpers/permissions.js +4 -4
  55. package/Helpers/permissions.js.map +1 -1
  56. package/Interactions/context.d.ts +6 -6
  57. package/Interactions/context.js +6 -6
  58. package/Interactions/context.js.map +1 -1
  59. package/Interactions/gateway.d.ts +4 -2
  60. package/Interactions/gateway.js +6 -7
  61. package/Interactions/gateway.js.map +1 -1
  62. package/Interactions/handlers.js +6 -6
  63. package/Interactions/handlers.js.map +1 -1
  64. package/Interactions/index.d.ts +3 -2
  65. package/Interactions/index.js +5 -4
  66. package/Interactions/index.js.map +1 -1
  67. package/Interactions/webhook.d.ts +3 -3
  68. package/Interactions/webhook.js +9 -9
  69. package/Interactions/webhook.js.map +1 -1
  70. package/Log.d.ts +12 -0
  71. package/{Log/index.js → Log.js} +1 -1
  72. package/Log.js.map +1 -0
  73. package/RateLimit/memory.d.ts +1 -1
  74. package/RateLimit/memory.js +3 -3
  75. package/RateLimit/memory.js.map +1 -1
  76. package/{RateLimit/index.d.ts → RateLimit.d.ts} +6 -6
  77. package/{RateLimit/index.js → RateLimit.js} +8 -8
  78. package/RateLimit.js.map +1 -0
  79. package/gateway.d.ts +10 -10
  80. package/gateway.js +11 -12
  81. package/gateway.js.map +1 -1
  82. package/global.d.ts +1 -1
  83. package/index.d.ts +5 -6
  84. package/index.js +5 -6
  85. package/index.js.map +1 -1
  86. package/package.json +8 -6
  87. package/webhooks.d.ts +4 -4
  88. package/webhooks.js +3 -4
  89. package/webhooks.js.map +1 -1
  90. package/Cache/index.d.ts +0 -69
  91. package/Cache/index.js.map +0 -1
  92. package/DiscordConfig/index.js.map +0 -1
  93. package/DiscordGateway/DiscordWS/index.js.map +0 -1
  94. package/DiscordGateway/Shard/index.d.ts +0 -9
  95. package/DiscordGateway/Shard/index.js +0 -44
  96. package/DiscordGateway/Shard/index.js.map +0 -1
  97. package/DiscordGateway/ShardStore/index.js.map +0 -1
  98. package/DiscordGateway/Sharder/index.d.ts +0 -16
  99. package/DiscordGateway/Sharder/index.js +0 -42
  100. package/DiscordGateway/Sharder/index.js.map +0 -1
  101. package/DiscordGateway/WS/index.js.map +0 -1
  102. package/DiscordGateway/index.d.ts +0 -12
  103. package/DiscordGateway/index.js +0 -20
  104. package/DiscordGateway/index.js.map +0 -1
  105. package/DiscordREST/index.d.ts +0 -188
  106. package/DiscordREST/index.js +0 -122
  107. package/DiscordREST/index.js.map +0 -1
  108. package/Http/index.d.ts +0 -37
  109. package/Http/index.js +0 -51
  110. package/Http/index.js.map +0 -1
  111. package/Log/index.d.ts +0 -12
  112. package/Log/index.js.map +0 -1
  113. package/RateLimit/index.js.map +0 -1
package/webhooks.d.ts CHANGED
@@ -2,7 +2,7 @@ import { DiscordConfig } from "dfx";
2
2
  import { ConfigWrap } from "dfx/_common";
3
3
  import { MakeConfigOpts } from "./Interactions/webhook.js";
4
4
  export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
5
- export declare const MemoryRateLimit: import("./_common.js").Layer<import("./Log/index.js").Log, never, import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter>;
6
- export declare const MemoryREST: import("./_common.js").Layer<import("./DiscordConfig/index.js").DiscordConfig | import("./Log/index.js").Log, never, import("./DiscordREST/index.js").DiscordREST>;
7
- export declare const make: (config: DiscordConfig.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./_common.js").Layer<never, never, import("./DiscordREST/index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
8
- export declare const makeFromConfig: (options: ConfigWrap.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>, debug?: boolean) => import("./_common.js").Layer<never, import("./_common.js").ConfigError, import("./DiscordREST/index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
5
+ export declare const MemoryRateLimit: import("./_common.js").Layer<import("./Log.js").Log, never, import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter>;
6
+ export declare const MemoryREST: import("./_common.js").Layer<import("./DiscordConfig.js").DiscordConfig | import("./Log.js").Log, never, import("./DiscordREST.js").DiscordREST>;
7
+ export declare const make: (config: DiscordConfig.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./_common.js").Layer<never, never, import("./DiscordREST.js").DiscordREST | import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
8
+ export declare const makeFromConfig: (options: ConfigWrap.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>, debug?: boolean) => import("./_common.js").Layer<never, import("./_common.js").ConfigError, import("./DiscordREST.js").DiscordREST | import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
package/webhooks.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import * as tsplus_module_1 from "@effect/io/Layer";
2
2
  import * as tsplus_module_2 from "dfx";
3
3
  import * as tsplus_module_3 from "dfx/_common";
4
- import { LiveDiscordREST } from "./DiscordREST/index.js";
5
- import { LiveHttp } from "./Http/index.js";
4
+ import { LiveDiscordREST } from "./DiscordREST.js";
6
5
  import { makeConfigLayer, makeFromConfig as makeConfigFromConfig, } from "./Interactions/webhook.js";
7
- import { LiveMemoryRateLimitStore, LiveRateLimiter } from "./RateLimit/index.js";
6
+ import { LiveMemoryRateLimitStore, LiveRateLimiter } from "./RateLimit.js";
8
7
  export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
9
8
  export const MemoryRateLimit = tsplus_module_1.provideMerge(LiveRateLimiter)(LiveMemoryRateLimitStore);
10
- export const MemoryREST = tsplus_module_1.provide(LiveDiscordREST)((tsplus_module_1.merge(LiveHttp)(MemoryRateLimit)));
9
+ export const MemoryREST = tsplus_module_1.provide(LiveDiscordREST)(MemoryRateLimit);
11
10
  export const make = (config, debug = false) => {
12
11
  const LiveWebhook = makeConfigLayer(config);
13
12
  const LiveLog = debug ? tsplus_module_2.Log.LiveLogDebug : tsplus_module_2.Log.LiveLog;
package/webhooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAEL,eAAe,EACf,cAAc,IAAI,oBAAoB,GACvC,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEhF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,MAA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,CAAC,CAAA;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,gBAAA,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAA,GAAG,CAAC,OAAO,CAAA;IACtD,MAAM,UAAU,GAAG,gBAAA,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;IACvD,MAAM,OAAO,2BACe,uBAA4B,eAAe,wBAA7B,WAAW,EAAxB,UAAU,GAAiC,EAAtE,uBAAW,UAAU,EAApB,OAAO,EAAc,CAAgD,CAAA;IAExE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/Cache/index.d.ts DELETED
@@ -1,69 +0,0 @@
1
- import { Stream, Effect } from "dfx/_common";
2
- import { CacheDriver, ParentCacheDriver } from "./driver.js";
3
- export * from "./driver.js";
4
- export { create as memoryDriver, createWithParent as memoryParentDriver, } from "./memory.js";
5
- export { create as memoryTTLDriver, createWithParent as memoryTTLParentDriver, } from "./memoryTTL.js";
6
- export type ParentCacheOp<T> = {
7
- op: "create";
8
- parentId: string;
9
- resourceId: string;
10
- resource: T;
11
- } | {
12
- op: "update";
13
- parentId: string;
14
- resourceId: string;
15
- resource: T;
16
- } | {
17
- op: "delete";
18
- parentId: string;
19
- resourceId: string;
20
- } | {
21
- op: "parentDelete";
22
- parentId: string;
23
- };
24
- export type CacheOp<T> = {
25
- op: "create";
26
- resourceId: string;
27
- resource: T;
28
- } | {
29
- op: "update";
30
- resourceId: string;
31
- resource: T;
32
- } | {
33
- op: "delete";
34
- resourceId: string;
35
- };
36
- export declare const makeWithParent: <EOps, EDriver, EMiss, EPMiss, A>({ driver, ops, onMiss, onParentMiss, }: {
37
- driver: ParentCacheDriver<EDriver, A>;
38
- ops?: import("../_common.js").Stream<never, EOps, ParentCacheOp<A>> | undefined;
39
- onMiss: (parentId: string, id: string) => import("../_common.js").Effect<never, EMiss, A>;
40
- onParentMiss: (parentId: string) => import("../_common.js").Effect<never, EPMiss, [id: string, resource: A][]>;
41
- }) => {
42
- get: (parentId: string, id: string) => import("../_common.js").Effect<never, EDriver | EMiss, A>;
43
- getForParent: (parentId: string) => import("../_common.js").Effect<never, EDriver | EPMiss, ReadonlyMap<string, A>>;
44
- run: import("../_common.js").Effect<never, EOps | EDriver, void>;
45
- size: import("../_common.js").Effect<never, EDriver, number>;
46
- sizeForParent: (parentId: string) => import("../_common.js").Effect<never, EDriver, number>;
47
- set: (parentId: string, resourceId: string, resource: A) => import("../_common.js").Effect<never, EDriver, void>;
48
- delete: (parentId: string, resourceId: string) => import("../_common.js").Effect<never, EDriver, void>;
49
- parentDelete: (parentId: string) => import("../_common.js").Effect<never, EDriver, void>;
50
- refreshTTL: (parentId: string, resourceId: string) => import("../_common.js").Effect<never, EDriver, void>;
51
- };
52
- export declare const make: <EOps, EDriver, EMiss, A>({ driver, ops, onMiss, }: {
53
- driver: CacheDriver<EDriver, A>;
54
- ops?: import("../_common.js").Stream<never, EOps, CacheOp<A>> | undefined;
55
- onMiss: (id: string) => import("../_common.js").Effect<never, EMiss, A>;
56
- }) => {
57
- get: (id: string) => import("../_common.js").Effect<never, EDriver | EMiss, A>;
58
- run: import("../_common.js").Effect<never, EOps | EDriver, void>;
59
- size: import("../_common.js").Effect<never, EDriver, number>;
60
- set: (resourceId: string, resource: A) => import("../_common.js").Effect<never, EDriver, void>;
61
- delete: (resourceId: string) => import("../_common.js").Effect<never, EDriver, void>;
62
- refreshTTL: (resourceId: string) => import("../_common.js").Effect<never, EDriver, void>;
63
- };
64
- export declare class CacheMissError {
65
- readonly cacheName: string;
66
- readonly id: string;
67
- readonly _tag = "CacheMissError";
68
- constructor(cacheName: string, id: string);
69
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Cache/index.ts"],"names":[],"mappings":";;AAEA,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,MAAM,IAAI,YAAY,EACtB,gBAAgB,IAAI,kBAAkB,GACvC,MAAM,aAAa,CAAA;AACpB,OAAO,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iB,EAAW,EAAU;QAAtC,cAAS,GAAT,SAAS,CAAQ;QAAW,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;CAChE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordConfig/index.ts"],"names":[],"mappings":";;;;;;AAAA,MAAM,OAAO,GAAG,EAAE,CAAA;AAmBlB,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAA,GAAG,EAAiB,CAAA;AAQjD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAY,EAAiB,EAAE,CAAC,CAAC;IAC1E,KAAK;IACL,IAAI,EAAE;QACJ,OAAO,EAAE,4BAA4B,OAAO,EAAE;QAC9C,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACf,eAAe,EAAE;YACf,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,wBAAiB,CAAC,CAAC;YAC3B,GAAG,CAAC,IAAI,EAAE,eAAe,IAAI,EAAE,CAAC;SACjC;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,gBAAA,OAAO,CAAC,cAAc,CAAC,MAAM;QACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5B,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;KACnB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAA,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,wBAAc,aAAa,EAAE,CAAC,CAAC,CAAC,CAAA;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAwB,EAAE,EAAE,CACzD,wBAA0C,aAAa,EAAvD,oBAA4B,IAAI,yBAAhC,uBAAc,CAAC,CAAC,EAAiB,CAAuB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/DiscordWS/index.ts"],"names":[],"mappings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CACE,CACkB,CAAA;QAEvE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;OAPX,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC;GANpB,qBAAS,GAAG,GAAG,MAAM,OAAO,aAAa,QAAQ,CAAC,IAAI,EAAE,CAAC,GADvD,wBAAe,cAAc,CAAC,CAejD,CAAA"}
@@ -1,9 +0,0 @@
1
- import { DiscordWS } from "dfx/gateway";
2
- import { Discord } from "dfx/_common";
3
- export declare const make: (shard: [id: number, count: number]) => import("../../_common.js").Effect<import("../../_common.js").Scope | import("../../DiscordConfig/index.js").DiscordConfig | import("../../Log/index.js").Log | import("../../index.js").RateLimiter | import("../DiscordWS/index.js").DiscordWSCodec, never, {
4
- run: import("../../_common.js").Effect<never, never, void>;
5
- raw: import("../../_common.js").Stream<never, never, import("../../types.js").GatewayPayload<any>>;
6
- dispatch: import("../../_common.js").Stream<never, never, import("../../types.js").GatewayPayload<import("../../types.js").ReceiveEvent>>;
7
- send: (p: Discord.GatewayPayload) => import("../../_common.js").Effect<never, never, boolean>;
8
- reconnect: import("../../_common.js").Effect<never, never, boolean>;
9
- }>;
@@ -1,44 +0,0 @@
1
- import * as tsplus_module_1 from "@effect/io/Effect";
2
- import * as tsplus_module_2 from "dfx/gateway";
3
- import * as tsplus_module_3 from "@effect/stream/Stream";
4
- import * as tsplus_module_4 from "@effect/io/Config/Secret";
5
- import * as tsplus_module_5 from "dfx/_common";
6
- import * as tsplus_module_6 from "@fp-ts/core/Option";
7
- import * as tsplus_module_7 from "@effect/data/Duration";
8
- import * as tsplus_module_8 from "@effect/io/Queue";
9
- import * as tsplus_module_9 from "dfx";
10
- import * as Heartbeats from "./heartbeats.js";
11
- import * as Identify from "./identify.js";
12
- import * as InvalidSession from "./invalidSession.js";
13
- import * as Utils from "./utils.js";
14
- export const make = (shard) => tsplus_module_1.flatMap(({ token, gateway }) => tsplus_module_1.flatMap(limiter => tsplus_module_1.flatMap(outboundQueue => {
15
- const outbound = tsplus_module_1.tap(() => limiter.maybeWait("dfx.shard.send", tsplus_module_7.minutes(1), 120))(outboundQueue
16
- .take());
17
- const send = (p) => outboundQueue.offer(p);
18
- return tsplus_module_1.flatMap(socket => tsplus_module_1.flatMap(raw => tsplus_module_1.flatMap(([latestReady, updateLatestReady]) => tsplus_module_1.map(([latestSequence, updateLatestSequence]) => {
19
- const maybeUpdateUrl = (p) => tsplus_module_6.match(() => tsplus_module_1.unit(), a => socket.setUrl(a.resume_gateway_url))(tsplus_module_6.map(p => p.d)(tsplus_module_6.filter(tsplus_module_6.some(p), (p) => p.op === 0 /* Discord.GatewayOpcode.DISPATCH */ && p.t === "READY")));
20
- const updateRefs = tsplus_module_3.runDrain(tsplus_module_3.tap(maybeUpdateUrl)(tsplus_module_3.tap(updateLatestSequence)(tsplus_module_3.tap(updateLatestReady)(raw))));
21
- // heartbeats
22
- const heartbeatEffects = tsplus_module_3.runForEach(send)(Heartbeats.fromRaw(raw, latestSequence));
23
- const dispatch = tsplus_module_3.filter((p) => p.op === 0 /* Discord.GatewayOpcode.DISPATCH */)(raw);
24
- // identify
25
- const identifyEffects = tsplus_module_3.runForEach(send)(Identify.fromRaw(raw, {
26
- token: tsplus_module_4.value(token),
27
- shard,
28
- intents: gateway.intents,
29
- presence: gateway.presence,
30
- latestSequence,
31
- latestReady,
32
- }));
33
- // invalid session
34
- const invalidEffects = tsplus_module_3.runForEach(send)(InvalidSession.fromRaw(raw, latestReady));
35
- return {
36
- run: tsplus_module_1.asUnit(tsplus_module_1.zipPar(invalidEffects)(tsplus_module_1.zipPar(identifyEffects)(tsplus_module_1.zipPar(heartbeatEffects)(updateRefs)))),
37
- raw,
38
- dispatch,
39
- send: (p) => send(p),
40
- reconnect: send(tsplus_module_2.WS.Reconnect),
41
- };
42
- })(Utils.latest(p => tsplus_module_6.fromNullable(p.s))))(Utils.latest(p => tsplus_module_6.map(p => p.d)(tsplus_module_6.filter(tsplus_module_6.some(p), (p) => p.op === 0 /* Discord.GatewayOpcode.DISPATCH */ && p.t === "READY")))))(tsplus_module_3.broadcastDynamic(1)(socket.source)))(tsplus_module_2.DiscordWS.make({ outbound }));
43
- })(tsplus_module_8.unbounded()))(tsplus_module_1.service(tsplus_module_9.RateLimiter)))(tsplus_module_1.service(tsplus_module_9.DiscordConfig.DiscordConfig));
44
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAkC,EAAE,EAAE,0BAEjD,EAAE,KAAK,EAAE,OAAO,EAAE,6BAClB,OAAO,4BAEP,aAAa;IACnB,MAAM,QAAQ,GAAG,oBAEV,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,EAAE,wBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC,EAFzD,aAAa;SAC3B,IAAI,EAAE,CACkE,CAAA;IAC3E,MAAM,IAAI,GAAG,CAAC,CAAoB,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;mCAEvD,MAAM,4BAEN,GAAG,6BAEH,CAAC,WAAW,EAAE,iBAAiB,CAAC,0BAUhC,CAAC,cAAc,EAAE,oBAAoB,CAAC;QAG5C,MAAM,cAAc,GAAG,CAAC,CAAyB,EAAE,EAAE,CACnD,sBAOI,GAAG,EAAE,CAAC,sBAAa,EACnB,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,EAR5C,oBAKO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,EAL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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,42 +0,0 @@
1
- import * as tsplus_module_1 from "@effect/stream/Stream";
2
- import * as tsplus_module_2 from "dfx/gateway";
3
- import * as tsplus_module_3 from "@effect/io/Effect";
4
- import * as tsplus_module_4 from "@effect/stream/GroupBy";
5
- import * as tsplus_module_5 from "@effect/data/Duration";
6
- import * as tsplus_module_6 from "@fp-ts/core/Option";
7
- import * as tsplus_module_7 from "dfx";
8
- import * as tsplus_module_8 from "dfx/_common";
9
- import * as tsplus_module_9 from "@effect/io/Layer";
10
- import { millis } from "@effect/data/Duration";
11
- import { ShardStore } from "../ShardStore/index.js";
12
- const make = tsplus_module_3.flatMap(store => tsplus_module_3.flatMap(rest => tsplus_module_3.flatMap(({ gateway: config }) => tsplus_module_3.flatMap(limiter => {
13
- const configs = (totalCount) => {
14
- const claimId = (sharderCount) => tsplus_module_3.flatMap(a => tsplus_module_6.match(() => tsplus_module_3.delay(tsplus_module_5.minutes(3))(claimId(sharderCount)), id => tsplus_module_3.succeed(id))(a))(store
15
- .claimId({
16
- totalCount,
17
- sharderCount,
18
- }));
19
- return tsplus_module_1.map(id => ({
20
- id,
21
- totalCount,
22
- }))(tsplus_module_1.unfoldEffect(0, sharderCount => tsplus_module_3.map(id => tsplus_module_6.some([id, sharderCount + 1]))(claimId(sharderCount))));
23
- };
24
- return tsplus_module_3.flatMap(gateway => tsplus_module_3.map(shards => ({ shards }))(tsplus_module_1.broadcastDynamic(1)(tsplus_module_1.flatMap(shard => tsplus_module_1.merge(tsplus_module_1.drain(tsplus_module_1.fromEffect(shard.run)))(tsplus_module_1.succeed(shard)))(tsplus_module_4.evaluate((key, shardConfig) => tsplus_module_1.mapEffect(c => tsplus_module_2.Shard.make([c.id, c.totalCount]))(tsplus_module_1.tap(() => limiter.maybeWait(`dfx.sharder.${key}`, millis(config.identifyRateLimit[0]), config.identifyRateLimit[1]))(shardConfig)))(tsplus_module_1.groupBy(c => tsplus_module_3.succeed([c.id % c.concurrency, c]))(tsplus_module_1.map(config => ({
25
- ...config,
26
- url: gateway.url,
27
- concurrency: gateway.session_start_limit.max_concurrency,
28
- }))(configs(config.shardCount ?? gateway.shards))))))))(tsplus_module_3.catchAll(() => tsplus_module_3.succeed({
29
- url: "wss://gateway.discord.gg/",
30
- shards: 1,
31
- session_start_limit: {
32
- total: 0,
33
- remaining: 0,
34
- reset_after: 0,
35
- max_concurrency: 1,
36
- },
37
- }))(tsplus_module_3.flatMap(r => r.json)(rest
38
- .getGatewayBot())));
39
- })(tsplus_module_3.service(tsplus_module_7.RateLimiter)))(tsplus_module_3.service(tsplus_module_7.DiscordConfig.DiscordConfig)))(tsplus_module_3.service(tsplus_module_7.DiscordREST)))(tsplus_module_3.service(ShardStore));
40
- export const Sharder = tsplus_module_8.Tag();
41
- export const LiveSharder = tsplus_module_9.scoped(Sharder, make);
42
- //# sourceMappingURL=index.js.map
@@ -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,2BACF,KAAK,4BACL,IAAI,6BACJ,EAAE,OAAO,EAAE,MAAM,EAAE,6BACnB,OAAO;IAEb,MAAM,OAAO,GAAG,CAAC,UAAkB,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,CAAC,YAAoB,EAAgC,EAAE,CACrE,wBAKW,CAAC,CAAC,EAAE,CACX,sBACE,GAAG,EAAE,CAAC,sBAA4B,wBAAiB,CAAC,CAAC,EAA/C,OAAO,CAAC,YAAY,CAAC,CAA2B,EACtD,EAAE,CAAC,EAAE,CAAC,wBAAe,EAAE,CAAC,EAF1B,CAAC,CAGA,EATL,KAAK;aACF,OAAO,CAAC;YACP,UAAU;YACV,YAAY;SACb,CAAC,CAMD,CAAA;QAEL,OAAO,oBAID,EAAE,CAAC,EAAE,CAAC,CAAC;YACX,EAAE;YACF,UAAU;SACX,CAAC,EAPK,6BAAoB,CAAC,EAAE,YAAY,CAAC,EAAE,CAC3C,oBAA0B,EAAE,CAAC,EAAE,CAC7B,qBAAW,CAAC,EAAE,EAAE,YAAY,GAAG,CAAC,CAAU,CAAC,EAD7C,OAAO,CAAC,YAAY,CAAC,CAEpB,CACF,CAGE,CAAA;IACL,CAAC,CAAA;mCAEK,OAAO,wBAkBP,MAAM,IAyBL,CAAA,EAAE,MAAM,EAAE,CAAA,EAxBf,iCAqBoB,CAAC,EArBrB,wBAkBW,KAAK,CAAC,EAAE,CACf,4CAA4B,2BAAkB,KAAK,CAAC,GAAG,CAAC,GAAxD,wBAAe,KAAK,CAA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,yBAEM,GAAG,wBACH,EAAE;IACR,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,CAAA;IAE9C,OAAO,sBAGH,2BACE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CACzD,EALE,sBACE,2BAAkB,UAAU,CAAC,EAD/B,IAAI,CAAC,EAAE,CAAC,CACwB,CAKpC,CAAA;GATU,MAAM,CAAC,GAAG,CAAC,GADV,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC,gCAaxC,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>;
@@ -1,20 +0,0 @@
1
- import * as tsplus_module_1 from "@effect/stream/Stream";
2
- import * as tsplus_module_2 from "@effect/io/Effect";
3
- import * as tsplus_module_3 from "dfx/_common";
4
- import * as tsplus_module_4 from "@effect/io/Layer";
5
- import { Sharder } from "./Sharder/index.js";
6
- const fromDispatchFactory = (source) => (event) => tsplus_module_1.map(p => p.d)(tsplus_module_1.filter(p => p.t === event)(source));
7
- const handleDispatchFactory = (source) => (event, handle) => tsplus_module_1.runDrain(tsplus_module_1.flatMapPar(a => tsplus_module_1.fromEffect(handle(a.d)), Number.POSITIVE_INFINITY)(tsplus_module_1.filter(p => p.t === event)(source)));
8
- export const make = tsplus_module_2.flatMap(sharder => tsplus_module_2.flatMap(raw => tsplus_module_2.map(dispatch => {
9
- const fromDispatch = fromDispatchFactory(dispatch);
10
- const handleDispatch = handleDispatchFactory(dispatch);
11
- return {
12
- raw,
13
- dispatch,
14
- fromDispatch,
15
- handleDispatch,
16
- };
17
- })(tsplus_module_1.broadcastDynamic(8)(tsplus_module_1.flatMapPar(s => s.dispatch, Number.POSITIVE_INFINITY)(sharder.shards))))(tsplus_module_1.broadcastDynamic(8)(tsplus_module_1.flatMapPar(s => s.raw, Number.POSITIVE_INFINITY)(sharder.shards))))(tsplus_module_2.service(Sharder));
18
- export const DiscordGateway = tsplus_module_3.Tag();
19
- export const LiveDiscordGateway = tsplus_module_4.scoped(DiscordGateway, make);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordGateway/index.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAE5C,MAAM,mBAAmB,GACvB,CAAO,MAAkE,EAAE,EAAE,CAC7E,CACE,KAAQ,EACgC,EAAE,CAC1C,oBAAsC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAS,EAAtD,uBAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,EAAhC,MAAM,CAA2B,CAAsB,CAAA;AAE3D,MAAM,qBAAqB,GACzB,CAAO,MAAkE,EAAE,EAAE,CAC7E,CACE,KAAQ,EACR,MAA8D,EAChC,EAAE,0BAChC,2BAGI,CAAC,CAAC,EAAE,CAAC,2BAAkB,MAAM,CAAC,CAAC,CAAC,CAAQ,CAAC,CAAC,EAC1C,MAAM,CAAC,iBAAiB,EAJ5B,uBACU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,EAD5B,MAAM,CACuB,CAI1B,CAAS,CAAA;AAEhB,MAAM,CAAC,MAAM,IAAI,2BACT,OAAO,4BACP,GAAG,wBAKH,QAAQ;IAKd,MAAM,YAAY,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAClD,MAAM,cAAc,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAA;IAEtD,OAAO;QACL,GAAG;QACH,QAAQ;QACR,YAAY;QACZ,cAAc;KACf,CAAA;GAZC,iCAEoB,CAAC,EAFrB,2BACc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EADvD,OAAO,CAAC,MAAM,CAC0C,CAClC,GAPtB,iCAEoB,CAAC,EAFrB,2BACc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,iBAAiB,EADlD,OAAO,CAAC,MAAM,CACqC,CAC7B,GAJN,wBAAe,OAAO,CAAC,CAoBzC,CAAA;AAGF,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAA,GAAG,EAAkB,CAAA;AACnD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAa,cAAc,EAAE,IAAI,CAAC,CAAA"}
@@ -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 {};