dfx 0.60.0 → 0.61.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/Cache/driver.d.ts +1 -1
  2. package/Cache/driver.d.ts.map +1 -1
  3. package/Cache/memory.js +2 -2
  4. package/Cache/memory.js.map +1 -1
  5. package/Cache/memoryTTL.d.ts.map +1 -1
  6. package/Cache/memoryTTL.js.map +1 -1
  7. package/Cache/prelude.d.ts +7 -7
  8. package/Cache/prelude.d.ts.map +1 -1
  9. package/Cache/prelude.js.map +1 -1
  10. package/Cache.d.ts +1 -1
  11. package/Cache.d.ts.map +1 -1
  12. package/Cache.js +1 -1
  13. package/Cache.js.map +1 -1
  14. package/DiscordGateway/DiscordWS.d.ts +5 -5
  15. package/DiscordGateway/DiscordWS.d.ts.map +1 -1
  16. package/DiscordGateway/DiscordWS.js +2 -2
  17. package/DiscordGateway/DiscordWS.js.map +1 -1
  18. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  19. package/DiscordGateway/Shard/utils.d.ts +1 -1
  20. package/DiscordGateway/Shard/utils.d.ts.map +1 -1
  21. package/DiscordGateway/Shard/utils.js.map +1 -1
  22. package/DiscordGateway/Shard.d.ts +8 -8
  23. package/DiscordGateway/Shard.d.ts.map +1 -1
  24. package/DiscordGateway/Shard.js +11 -11
  25. package/DiscordGateway/Shard.js.map +1 -1
  26. package/DiscordGateway/ShardStore.d.ts +2 -2
  27. package/DiscordGateway/ShardStore.d.ts.map +1 -1
  28. package/DiscordGateway/ShardStore.js +2 -2
  29. package/DiscordGateway/ShardStore.js.map +1 -1
  30. package/DiscordGateway/Sharder.d.ts +2 -2
  31. package/DiscordGateway/Sharder.js.map +1 -1
  32. package/DiscordGateway/WS.d.ts +4 -4
  33. package/DiscordGateway/WS.d.ts.map +1 -1
  34. package/DiscordGateway/WS.js +6 -6
  35. package/DiscordGateway/WS.js.map +1 -1
  36. package/DiscordGateway.d.ts +1 -1
  37. package/DiscordGateway.d.ts.map +1 -1
  38. package/DiscordGateway.js.map +1 -1
  39. package/DiscordREST/types.d.ts +4 -4
  40. package/DiscordREST/types.d.ts.map +1 -1
  41. package/DiscordREST/utils.d.ts +5 -4
  42. package/DiscordREST/utils.d.ts.map +1 -1
  43. package/DiscordREST/utils.js +4 -3
  44. package/DiscordREST/utils.js.map +1 -1
  45. package/DiscordREST.d.ts +6 -7
  46. package/DiscordREST.d.ts.map +1 -1
  47. package/DiscordREST.js +12 -18
  48. package/DiscordREST.js.map +1 -1
  49. package/Helpers/flags.d.ts.map +1 -1
  50. package/Helpers/flags.js.map +1 -1
  51. package/Helpers/intents.d.ts.map +1 -1
  52. package/Helpers/intents.js.map +1 -1
  53. package/Helpers/interactions.d.ts +1 -1
  54. package/Helpers/interactions.d.ts.map +1 -1
  55. package/Helpers/interactions.js +2 -2
  56. package/Helpers/interactions.js.map +1 -1
  57. package/Helpers/members.d.ts.map +1 -1
  58. package/Helpers/members.js.map +1 -1
  59. package/Helpers/permissions.js.map +1 -1
  60. package/Interactions/builder.d.ts +3 -3
  61. package/Interactions/builder.d.ts.map +1 -1
  62. package/Interactions/builder.js +1 -1
  63. package/Interactions/builder.js.map +1 -1
  64. package/Interactions/context.d.ts +1 -1
  65. package/Interactions/context.d.ts.map +1 -1
  66. package/Interactions/context.js.map +1 -1
  67. package/Interactions/definitions.d.ts +3 -3
  68. package/Interactions/definitions.d.ts.map +1 -1
  69. package/Interactions/definitions.js.map +1 -1
  70. package/Interactions/gateway.d.ts +3 -3
  71. package/Interactions/gateway.d.ts.map +1 -1
  72. package/Interactions/gateway.js +1 -1
  73. package/Interactions/gateway.js.map +1 -1
  74. package/Interactions/handlers.d.ts.map +1 -1
  75. package/Interactions/handlers.js.map +1 -1
  76. package/Interactions/index.d.ts +1 -1
  77. package/Interactions/index.d.ts.map +1 -1
  78. package/Interactions/index.js.map +1 -1
  79. package/Interactions/utils.d.ts.map +1 -1
  80. package/Interactions/utils.js.map +1 -1
  81. package/Interactions/webhook.d.ts.map +1 -1
  82. package/Interactions/webhook.js.map +1 -1
  83. package/LICENSE +21 -0
  84. package/Log.d.ts +1 -1
  85. package/Log.d.ts.map +1 -1
  86. package/Log.js +1 -1
  87. package/Log.js.map +1 -1
  88. package/RateLimit.d.ts +2 -2
  89. package/RateLimit.d.ts.map +1 -1
  90. package/RateLimit.js.map +1 -1
  91. package/gateway.d.ts +2 -4
  92. package/gateway.d.ts.map +1 -1
  93. package/gateway.js +3 -6
  94. package/gateway.js.map +1 -1
  95. package/index.d.ts +2 -3
  96. package/index.d.ts.map +1 -1
  97. package/index.js +1 -3
  98. package/index.js.map +1 -1
  99. package/mjs/Cache/memory.mjs +2 -2
  100. package/mjs/Cache/memory.mjs.map +1 -1
  101. package/mjs/Cache/memoryTTL.mjs.map +1 -1
  102. package/mjs/Cache/prelude.mjs.map +1 -1
  103. package/mjs/Cache.mjs +1 -1
  104. package/mjs/Cache.mjs.map +1 -1
  105. package/mjs/DiscordGateway/DiscordWS.mjs +2 -2
  106. package/mjs/DiscordGateway/DiscordWS.mjs.map +1 -1
  107. package/mjs/DiscordGateway/Shard/heartbeats.mjs.map +1 -1
  108. package/mjs/DiscordGateway/Shard/utils.mjs.map +1 -1
  109. package/mjs/DiscordGateway/Shard.mjs +11 -11
  110. package/mjs/DiscordGateway/Shard.mjs.map +1 -1
  111. package/mjs/DiscordGateway/ShardStore.mjs +2 -2
  112. package/mjs/DiscordGateway/ShardStore.mjs.map +1 -1
  113. package/mjs/DiscordGateway/Sharder.mjs.map +1 -1
  114. package/mjs/DiscordGateway/WS.mjs +5 -5
  115. package/mjs/DiscordGateway/WS.mjs.map +1 -1
  116. package/mjs/DiscordGateway.mjs.map +1 -1
  117. package/mjs/DiscordREST/utils.mjs +4 -3
  118. package/mjs/DiscordREST/utils.mjs.map +1 -1
  119. package/mjs/DiscordREST.mjs +13 -14
  120. package/mjs/DiscordREST.mjs.map +1 -1
  121. package/mjs/Helpers/flags.mjs.map +1 -1
  122. package/mjs/Helpers/intents.mjs.map +1 -1
  123. package/mjs/Helpers/interactions.mjs +2 -2
  124. package/mjs/Helpers/interactions.mjs.map +1 -1
  125. package/mjs/Helpers/members.mjs.map +1 -1
  126. package/mjs/Helpers/permissions.mjs.map +1 -1
  127. package/mjs/Interactions/builder.mjs +1 -1
  128. package/mjs/Interactions/builder.mjs.map +1 -1
  129. package/mjs/Interactions/context.mjs.map +1 -1
  130. package/mjs/Interactions/definitions.mjs.map +1 -1
  131. package/mjs/Interactions/gateway.mjs +2 -2
  132. package/mjs/Interactions/gateway.mjs.map +1 -1
  133. package/mjs/Interactions/handlers.mjs.map +1 -1
  134. package/mjs/Interactions/index.mjs.map +1 -1
  135. package/mjs/Interactions/utils.mjs.map +1 -1
  136. package/mjs/Interactions/webhook.mjs.map +1 -1
  137. package/mjs/Log.mjs +1 -1
  138. package/mjs/Log.mjs.map +1 -1
  139. package/mjs/RateLimit.mjs.map +1 -1
  140. package/mjs/gateway.mjs +2 -4
  141. package/mjs/gateway.mjs.map +1 -1
  142. package/mjs/index.mjs +2 -3
  143. package/mjs/index.mjs.map +1 -1
  144. package/mjs/types.mjs.map +1 -1
  145. package/mjs/utils/Effect.mjs +4 -4
  146. package/mjs/utils/Effect.mjs.map +1 -1
  147. package/mjs/version.mjs +1 -1
  148. package/mjs/webhooks.mjs +3 -12
  149. package/mjs/webhooks.mjs.map +1 -1
  150. package/package.json +32 -26
  151. package/src/Cache/driver.ts +1 -1
  152. package/src/Cache/memory.ts +2 -2
  153. package/src/Cache/memoryTTL.ts +6 -4
  154. package/src/Cache/prelude.ts +15 -13
  155. package/src/Cache.ts +3 -3
  156. package/src/DiscordGateway/DiscordWS.ts +9 -10
  157. package/src/DiscordGateway/Shard/heartbeats.ts +1 -1
  158. package/src/DiscordGateway/Shard/utils.ts +10 -12
  159. package/src/DiscordGateway/Shard.ts +23 -24
  160. package/src/DiscordGateway/ShardStore.ts +2 -2
  161. package/src/DiscordGateway/Sharder.ts +7 -7
  162. package/src/DiscordGateway/WS.ts +10 -10
  163. package/src/DiscordGateway.ts +8 -9
  164. package/src/DiscordREST/types.ts +4 -4
  165. package/src/DiscordREST/utils.ts +12 -8
  166. package/src/DiscordREST.ts +60 -53
  167. package/src/Helpers/flags.ts +2 -4
  168. package/src/Helpers/intents.ts +3 -4
  169. package/src/Helpers/interactions.ts +53 -56
  170. package/src/Helpers/members.ts +2 -2
  171. package/src/Helpers/permissions.ts +2 -2
  172. package/src/Interactions/builder.ts +22 -20
  173. package/src/Interactions/context.ts +16 -23
  174. package/src/Interactions/definitions.ts +27 -34
  175. package/src/Interactions/gateway.ts +82 -85
  176. package/src/Interactions/handlers.ts +34 -35
  177. package/src/Interactions/index.ts +17 -21
  178. package/src/Interactions/utils.ts +13 -17
  179. package/src/Interactions/webhook.ts +19 -15
  180. package/src/Log.ts +3 -3
  181. package/src/RateLimit.ts +5 -4
  182. package/src/gateway.ts +4 -19
  183. package/src/index.ts +1 -3
  184. package/src/types.ts +50 -26
  185. package/src/utils/Effect.ts +16 -17
  186. package/src/version.ts +1 -1
  187. package/src/webhooks.ts +21 -34
  188. package/tsconfig.tsbuildinfo +1 -0
  189. package/types.d.ts.map +1 -1
  190. package/types.js.map +1 -1
  191. package/utils/Effect.d.ts.map +1 -1
  192. package/utils/Effect.js +4 -4
  193. package/utils/Effect.js.map +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/webhooks.d.ts +3 -5
  197. package/webhooks.d.ts.map +1 -1
  198. package/webhooks.js +4 -14
  199. package/webhooks.js.map +1 -1
package/src/gateway.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { HttpRequestExecutor } from "@effect-http/client"
2
- import { LiveFetchRequestExecutor } from "@effect-http/client"
3
1
  import * as Config from "@effect/io/Config"
4
2
  import type * as ConfigError from "@effect/io/Config/Error"
5
3
  import * as Effect from "@effect/io/Effect"
@@ -16,10 +14,10 @@ import * as SendEvent from "dfx/DiscordGateway/Shard/sendEvents"
16
14
  import * as ShardStore from "dfx/DiscordGateway/ShardStore"
17
15
  import { LiveMemoryShardStore } from "dfx/DiscordGateway/ShardStore"
18
16
  import * as WS from "dfx/DiscordGateway/WS"
19
- import type { RateLimiter } from "dfx/RateLimit"
20
- import { LiveMemoryRateLimitStore, LiveRateLimiter } from "dfx/RateLimit"
21
17
  import { InteractionsRegistryLive } from "dfx/gateway"
22
18
  import type { InteractionsRegistry } from "dfx/gateway"
19
+ import type { RateLimiter } from "dfx/RateLimit"
20
+ import { LiveMemoryRateLimitStore, LiveRateLimiter } from "dfx/RateLimit"
23
21
 
24
22
  export { DiscordGateway, LiveDiscordGateway } from "dfx/DiscordGateway"
25
23
 
@@ -49,10 +47,10 @@ export const MemoryBot = Layer.provide(
49
47
  ),
50
48
  )
51
49
 
52
- export const gatewayLayerWithoutHttp = (
50
+ export const gatewayLayer = (
53
51
  config: Config.Config.Wrap<DiscordConfig.MakeOpts>,
54
52
  ): Layer.Layer<
55
- HttpRequestExecutor,
53
+ never,
56
54
  ConfigError.ConfigError,
57
55
  | RateLimiter
58
56
  | Log.Log
@@ -71,16 +69,3 @@ export const gatewayLayerWithoutHttp = (
71
69
  }),
72
70
  ),
73
71
  )
74
-
75
- export const gatewayLayer = (
76
- config: Config.Config.Wrap<DiscordConfig.MakeOpts>,
77
- ): Layer.Layer<
78
- never,
79
- ConfigError.ConfigError,
80
- | RateLimiter
81
- | Log.Log
82
- | InteractionsRegistry
83
- | DiscordREST
84
- | DiscordGateway
85
- | DiscordConfig.DiscordConfig
86
- > => Layer.provide(LiveFetchRequestExecutor, gatewayLayerWithoutHttp(config))
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as Http from "@effect-http/client"
2
1
  import * as Cache from "dfx/Cache"
3
2
  import * as DiscordConfig from "dfx/DiscordConfig"
4
3
  import * as Flags from "dfx/Helpers/flags"
@@ -17,8 +16,8 @@ export {
17
16
  BucketDetails,
18
17
  LiveMemoryRateLimitStore,
19
18
  LiveRateLimiter,
20
- RateLimitStore,
21
19
  RateLimiter,
20
+ RateLimitStore,
22
21
  } from "dfx/RateLimit"
23
22
 
24
23
  export {
@@ -26,7 +25,6 @@ export {
26
25
  Discord,
27
26
  DiscordConfig,
28
27
  Flags,
29
- Http,
30
28
  Intents,
31
29
  Ix,
32
30
  IxHelpers,
package/src/types.ts CHANGED
@@ -1173,7 +1173,8 @@ export function createRoutes<O = any>(
1173
1173
  batchEditApplicationCommandPermissions: (applicationId, guildId, options) =>
1174
1174
  fetch({
1175
1175
  method: "PUT",
1176
- url: `/applications/${applicationId}/guilds/${guildId}/commands/permissions`,
1176
+ url:
1177
+ `/applications/${applicationId}/guilds/${guildId}/commands/permissions`,
1177
1178
  options,
1178
1179
  }),
1179
1180
  beginGuildPrune: (guildId, params, options) =>
@@ -1342,7 +1343,8 @@ export function createRoutes<O = any>(
1342
1343
  createReaction: (channelId, messageId, emoji, options) =>
1343
1344
  fetch({
1344
1345
  method: "PUT",
1345
- url: `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/@me`,
1346
+ url:
1347
+ `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/@me`,
1346
1348
  options,
1347
1349
  }),
1348
1350
  createStageInstance: (params, options) =>
@@ -1403,7 +1405,8 @@ export function createRoutes<O = any>(
1403
1405
  ) =>
1404
1406
  fetch({
1405
1407
  method: "DELETE",
1406
- url: `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1408
+ url:
1409
+ `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1407
1410
  options,
1408
1411
  }),
1409
1412
  deleteGlobalApplicationCommand: (applicationId, commandId, options) =>
@@ -1426,7 +1429,8 @@ export function createRoutes<O = any>(
1426
1429
  ) =>
1427
1430
  fetch({
1428
1431
  method: "DELETE",
1429
- url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1432
+ url:
1433
+ `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1430
1434
  options,
1431
1435
  }),
1432
1436
  deleteGuildEmoji: (guildId, emojiId, options) =>
@@ -1484,13 +1488,15 @@ export function createRoutes<O = any>(
1484
1488
  ) =>
1485
1489
  fetch({
1486
1490
  method: "DELETE",
1487
- url: `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1491
+ url:
1492
+ `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1488
1493
  options,
1489
1494
  }),
1490
1495
  deleteOwnReaction: (channelId, messageId, emoji, options) =>
1491
1496
  fetch({
1492
1497
  method: "DELETE",
1493
- url: `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/@me`,
1498
+ url:
1499
+ `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/@me`,
1494
1500
  options,
1495
1501
  }),
1496
1502
  deleteStageInstance: (channelId, options) =>
@@ -1502,7 +1508,8 @@ export function createRoutes<O = any>(
1502
1508
  deleteUserReaction: (channelId, messageId, emoji, userId, options) =>
1503
1509
  fetch({
1504
1510
  method: "DELETE",
1505
- url: `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/${userId}`,
1511
+ url:
1512
+ `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/${userId}`,
1506
1513
  options,
1507
1514
  }),
1508
1515
  deleteWebhook: (webhookId, options) =>
@@ -1539,7 +1546,8 @@ export function createRoutes<O = any>(
1539
1546
  ) =>
1540
1547
  fetch({
1541
1548
  method: "PUT",
1542
- url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`,
1549
+ url:
1550
+ `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`,
1543
1551
  params,
1544
1552
  options,
1545
1553
  }),
@@ -1559,7 +1567,8 @@ export function createRoutes<O = any>(
1559
1567
  ) =>
1560
1568
  fetch({
1561
1569
  method: "PATCH",
1562
- url: `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1570
+ url:
1571
+ `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1563
1572
  params,
1564
1573
  options,
1565
1574
  }),
@@ -1579,7 +1588,8 @@ export function createRoutes<O = any>(
1579
1588
  ) =>
1580
1589
  fetch({
1581
1590
  method: "PATCH",
1582
- url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1591
+ url:
1592
+ `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1583
1593
  params,
1584
1594
  options,
1585
1595
  }),
@@ -1598,7 +1608,8 @@ export function createRoutes<O = any>(
1598
1608
  ) =>
1599
1609
  fetch({
1600
1610
  method: "PATCH",
1601
- url: `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1611
+ url:
1612
+ `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1602
1613
  params,
1603
1614
  options,
1604
1615
  }),
@@ -1643,7 +1654,8 @@ export function createRoutes<O = any>(
1643
1654
  ) =>
1644
1655
  fetch({
1645
1656
  method: "GET",
1646
- url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`,
1657
+ url:
1658
+ `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions`,
1647
1659
  options,
1648
1660
  }),
1649
1661
  getApplicationRoleConnectionMetadataRecords: (applicationId, options) =>
@@ -1735,7 +1747,8 @@ export function createRoutes<O = any>(
1735
1747
  ) =>
1736
1748
  fetch({
1737
1749
  method: "GET",
1738
- url: `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1750
+ url:
1751
+ `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
1739
1752
  params,
1740
1753
  options,
1741
1754
  }),
@@ -1774,13 +1787,15 @@ export function createRoutes<O = any>(
1774
1787
  getGuildApplicationCommand: (applicationId, guildId, commandId, options) =>
1775
1788
  fetch({
1776
1789
  method: "GET",
1777
- url: `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1790
+ url:
1791
+ `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}`,
1778
1792
  options,
1779
1793
  }),
1780
1794
  getGuildApplicationCommandPermissions: (applicationId, guildId, options) =>
1781
1795
  fetch({
1782
1796
  method: "GET",
1783
- url: `/applications/${applicationId}/guilds/${guildId}/commands/permissions`,
1797
+ url:
1798
+ `/applications/${applicationId}/guilds/${guildId}/commands/permissions`,
1784
1799
  options,
1785
1800
  }),
1786
1801
  getGuildApplicationCommands: (applicationId, guildId, params, options) =>
@@ -1880,7 +1895,8 @@ export function createRoutes<O = any>(
1880
1895
  ) =>
1881
1896
  fetch({
1882
1897
  method: "GET",
1883
- url: `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`,
1898
+ url:
1899
+ `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`,
1884
1900
  params,
1885
1901
  options,
1886
1902
  }),
@@ -1960,7 +1976,8 @@ export function createRoutes<O = any>(
1960
1976
  ) =>
1961
1977
  fetch({
1962
1978
  method: "GET",
1963
- url: `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1979
+ url:
1980
+ `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
1964
1981
  params,
1965
1982
  options,
1966
1983
  }),
@@ -3195,7 +3212,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
3195
3212
  guildId: string,
3196
3213
  options?: O,
3197
3214
  ) => RestResponse<GuildOnboarding>
3198
- /** Returns the guild preview object for the given id.
3215
+ /** Returns the guild preview object for the given id.
3199
3216
  If the user is not in the guild, then the guild must be discoverable. */
3200
3217
  getGuildPreview: (guildId: string, options?: O) => RestResponse<GuildPreview>
3201
3218
  /** Returns an object with one pruned key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission. */
@@ -4087,7 +4104,8 @@ export const enum GuildFeature {
4087
4104
  /** guild is able to set role icons */
4088
4105
  ROLE_ICONS = "ROLE_ICONS",
4089
4106
  /** guild has role subscriptions that can be purchased */
4090
- ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
4107
+ ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE =
4108
+ "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
4091
4109
  /** guild has enabled role subscriptions */
4092
4110
  ROLE_SUBSCRIPTIONS_ENABLED = "ROLE_SUBSCRIPTIONS_ENABLED",
4093
4111
  /** guild has enabled ticketed events */
@@ -4470,8 +4488,9 @@ export interface IntegrationApplication {
4470
4488
  /** the bot associated with this application */
4471
4489
  readonly bot?: User
4472
4490
  }
4473
- export type IntegrationCreateEvent = Integration &
4474
- IntegrationCreateEventAdditional
4491
+ export type IntegrationCreateEvent =
4492
+ & Integration
4493
+ & IntegrationCreateEventAdditional
4475
4494
  export interface IntegrationCreateEventAdditional {
4476
4495
  /** ID of the guild */
4477
4496
  readonly guild_id: Snowflake
@@ -4488,8 +4507,9 @@ export const enum IntegrationExpireBehavior {
4488
4507
  REMOVE_ROLE = 0,
4489
4508
  KICK = 1,
4490
4509
  }
4491
- export type IntegrationUpdateEvent = Integration &
4492
- IntegrationUpdateEventAdditional
4510
+ export type IntegrationUpdateEvent =
4511
+ & Integration
4512
+ & IntegrationUpdateEventAdditional
4493
4513
  export interface IntegrationUpdateEventAdditional {
4494
4514
  /** ID of the guild */
4495
4515
  readonly guild_id: Snowflake
@@ -5226,7 +5246,9 @@ export interface ModifyGuildParams {
5226
5246
  /** verification level */
5227
5247
  readonly verification_level?: VerificationLevel | null
5228
5248
  /** default message notification level */
5229
- readonly default_message_notifications?: DefaultMessageNotificationLevel | null
5249
+ readonly default_message_notifications?:
5250
+ | DefaultMessageNotificationLevel
5251
+ | null
5230
5252
  /** explicit content filter level */
5231
5253
  readonly explicit_content_filter?: ExplicitContentFilterLevel | null
5232
5254
  /** id for afk channel */
@@ -5368,7 +5390,8 @@ export const enum OAuth2Scope {
5368
5390
  /** allows your app to update its commands using a Bearer token - client credentials grant only */
5369
5391
  APPLICATIONS_COMMANDS_UPDATE = "applications.commands.update",
5370
5392
  /** allows your app to update permissions for its commands in a guild a user has permissions to */
5371
- APPLICATIONS_COMMANDS_PERMISSIONS_UPDATE = "applications.commands.permissions.update",
5393
+ APPLICATIONS_COMMANDS_PERMISSIONS_UPDATE =
5394
+ "applications.commands.permissions.update",
5372
5395
  /** allows your app to read entitlements for a user's applications */
5373
5396
  APPLICATIONS_ENTITLEMENTS = "applications.entitlements",
5374
5397
  /** allows your app to read and update store data (SKUs, store listings, achievements, etc.) for a user's applications */
@@ -5683,7 +5706,8 @@ export interface ReceiveEvents {
5683
5706
  RESUMED: ResumedEvent
5684
5707
  RECONNECT: ReconnectEvent
5685
5708
  INVALID_SESSION: InvalidSessionEvent
5686
- APPLICATION_COMMAND_PERMISSIONS_UPDATE: ApplicationCommandPermissionsUpdateEvent
5709
+ APPLICATION_COMMAND_PERMISSIONS_UPDATE:
5710
+ ApplicationCommandPermissionsUpdateEvent
5687
5711
  AUTO_MODERATION_RULE_CREATE: AutoModerationRuleCreateEvent
5688
5712
  AUTO_MODERATION_RULE_UPDATE: AutoModerationRuleUpdateEvent
5689
5713
  AUTO_MODERATION_RULE_DELETE: AutoModerationRuleDeleteEvent
@@ -1,10 +1,10 @@
1
- import * as Effect from "@effect/io/Effect"
2
1
  import * as Option from "@effect/data/Option"
3
- import * as Ref from "@effect/io/Ref"
4
- import * as Queue from "@effect/io/Queue"
5
- import * as Hub from "@effect/io/Hub"
6
2
  import * as Deferred from "@effect/io/Deferred"
3
+ import * as Effect from "@effect/io/Effect"
7
4
  import * as Fiber from "@effect/io/Fiber"
5
+ import * as Hub from "@effect/io/Hub"
6
+ import * as Queue from "@effect/io/Queue"
7
+ import * as Ref from "@effect/io/Ref"
8
8
 
9
9
  export const subscribeForEachPar = <R, E, A, X>(
10
10
  self: Hub.Hub<A>,
@@ -18,10 +18,10 @@ export const subscribeForEachPar = <R, E, A, X>(
18
18
  effect(_).pipe(
19
19
  Effect.catchAllCause(_ => Deferred.failCause(deferred, _)),
20
20
  Effect.fork,
21
- ),
21
+ )
22
22
  ),
23
23
  Effect.forever,
24
- ),
24
+ )
25
25
  ),
26
26
  Effect.scoped,
27
27
  )
@@ -49,17 +49,16 @@ export const foreverSwitch = <R, E, A, R1, E1, X>(
49
49
  f(_).pipe(
50
50
  Effect.tapErrorCause(_ => Deferred.failCause(causeDeferred, _)),
51
51
  Effect.fork,
52
- ),
53
- ).pipe(
54
- Effect.flatMap(fiber => Ref.getAndSet(fiberRef, Option.some(fiber))),
55
- Effect.tap(_ =>
56
- Option.match(_, {
57
- onNone: () => Effect.unit,
58
- onSome: fiber => Fiber.interrupt(fiber),
59
- }),
60
- ),
61
- Effect.forever,
62
- )
52
+ )).pipe(
53
+ Effect.flatMap(fiber => Ref.getAndSet(fiberRef, Option.some(fiber))),
54
+ Effect.tap(_ =>
55
+ Option.match(_, {
56
+ onNone: () => Effect.unit,
57
+ onSome: fiber => Fiber.interrupt(fiber),
58
+ })
59
+ ),
60
+ Effect.forever,
61
+ )
63
62
 
64
63
  return Effect.all([run, Deferred.await(causeDeferred)], {
65
64
  concurrency: "unbounded",
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const LIB_VERSION = "0.60.0";
1
+ export const LIB_VERSION = "0.61.1";
package/src/webhooks.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { HttpRequestExecutor } from "@effect-http/client"
2
- import { LiveFetchRequestExecutor } from "@effect-http/client"
3
1
  import * as Config from "@effect/io/Config"
4
2
  import type * as ConfigError from "@effect/io/Config/Error"
5
3
  import * as Effect from "@effect/io/Effect"
@@ -15,11 +13,11 @@ import { LiveMemoryRateLimitStore, LiveRateLimiter } from "dfx/RateLimit"
15
13
 
16
14
  export {
17
15
  BadWebhookSignature,
18
- WebhookConfig,
19
- WebhookParseError,
20
16
  makeConfigLayer,
21
17
  makeHandler,
22
18
  makeSimpleHandler,
19
+ WebhookConfig,
20
+ WebhookParseError,
23
21
  } from "dfx/Interactions/webhook"
24
22
 
25
23
  export const MemoryRateLimit = Layer.provide(
@@ -32,39 +30,13 @@ export const MemoryREST = Layer.provide(
32
30
  LiveDiscordREST,
33
31
  )
34
32
 
35
- export const webhookLayerWithoutHttp = (
36
- options: Config.Config.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>,
37
- ): Layer.Layer<
38
- HttpRequestExecutor,
39
- ConfigError.ConfigError,
40
- RateLimiter | DiscordREST | WebhookConfig
41
- > =>
42
- Layer.unwrapEffect(
43
- Effect.map(Effect.config(Config.unwrap(options)), options => {
44
- const config = DiscordConfig.make(options)
45
- const LiveConfig = Layer.succeed(DiscordConfig.DiscordConfig, config)
46
- const LiveWebhook = makeConfigLayer(options)
47
- const LiveLog = config.debug ? Log.LiveLogDebug : Log.LiveLog
48
- const LiveEnv = Layer.provide(
49
- Layer.merge(LiveLog, LiveConfig),
50
- Layer.mergeAll(MemoryREST, LiveWebhook, MemoryRateLimit),
51
- )
52
-
53
- return LiveEnv
54
- }),
55
- )
56
-
57
- export const webhookLayerConfig = (
58
- config: Config.Config.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>,
33
+ export const webhookLayer = (
34
+ options: DiscordConfig.MakeOpts & MakeConfigOpts,
59
35
  ): Layer.Layer<
60
36
  never,
61
37
  ConfigError.ConfigError,
62
38
  RateLimiter | DiscordREST | WebhookConfig
63
- > => Layer.provide(LiveFetchRequestExecutor, webhookLayerWithoutHttp(config))
64
-
65
- export const webhookLayer = (
66
- options: DiscordConfig.MakeOpts & MakeConfigOpts,
67
- ): Layer.Layer<never, never, RateLimiter | DiscordREST | WebhookConfig> => {
39
+ > => {
68
40
  const config = DiscordConfig.make(options)
69
41
  const LiveConfig = Layer.succeed(DiscordConfig.DiscordConfig, config)
70
42
  const LiveWebhook = makeConfigLayer(options)
@@ -73,5 +45,20 @@ export const webhookLayer = (
73
45
  Layer.merge(LiveLog, LiveConfig),
74
46
  Layer.mergeAll(MemoryREST, LiveWebhook, MemoryRateLimit),
75
47
  )
76
- return Layer.provide(LiveFetchRequestExecutor, LiveEnv)
48
+
49
+ return LiveEnv
77
50
  }
51
+
52
+ export const webhookLayerConfig = (
53
+ config: Config.Config.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>,
54
+ ): Layer.Layer<
55
+ never,
56
+ ConfigError.ConfigError,
57
+ RateLimiter | DiscordREST | WebhookConfig
58
+ > =>
59
+ Layer.unwrapEffect(
60
+ Effect.map(
61
+ Effect.config(Config.unwrap(config)),
62
+ webhookLayer,
63
+ ),
64
+ )
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":[],"fileInfos":[],"root":[],"options":{"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":7,"noEmitOnError":false,"noErrorTruncation":false,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":false,"noImplicitThis":true,"noUncheckedIndexedAccess":false,"noUnusedLocals":true,"noUnusedParameters":false,"removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"strictNullChecks":true,"stripInternal":true,"target":99},"referencedMap":[],"exportedModulesMap":[]},"version":"5.1.6"}