dfx 1.0.15 → 1.1.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 (98) hide show
  1. package/dist/Cache/driver.d.ts.map +1 -1
  2. package/dist/Cache/memoryTTL.d.ts.map +1 -1
  3. package/dist/Cache/prelude.d.ts.map +1 -1
  4. package/dist/Cache/prelude.js +1 -1
  5. package/dist/Cache/prelude.js.map +1 -1
  6. package/dist/Cache.d.ts.map +1 -1
  7. package/dist/DiscordConfig.d.ts.map +1 -1
  8. package/dist/DiscordGateway/DiscordWS.d.ts +1 -1
  9. package/dist/DiscordGateway/DiscordWS.d.ts.map +1 -1
  10. package/dist/DiscordGateway/DiscordWS.js +33 -20
  11. package/dist/DiscordGateway/DiscordWS.js.map +1 -1
  12. package/dist/DiscordGateway/Messaging.d.ts +131 -131
  13. package/dist/DiscordGateway/Messaging.d.ts.map +1 -1
  14. package/dist/DiscordGateway/Shard/StateStore.d.ts +1 -1
  15. package/dist/DiscordGateway/Shard/StateStore.d.ts.map +1 -1
  16. package/dist/DiscordGateway/Shard/StateStore.js +1 -1
  17. package/dist/DiscordGateway/Shard/StateStore.js.map +1 -1
  18. package/dist/DiscordGateway/Shard/heartbeats.d.ts.map +1 -1
  19. package/dist/DiscordGateway/Shard/identify.d.ts.map +1 -1
  20. package/dist/DiscordGateway/Shard/sendEvents.d.ts.map +1 -1
  21. package/dist/DiscordGateway/Shard/utils.d.ts.map +1 -1
  22. package/dist/DiscordGateway/Shard.d.ts +4 -4
  23. package/dist/DiscordGateway/Shard.js.map +1 -1
  24. package/dist/DiscordGateway/Sharder.d.ts +1 -1
  25. package/dist/DiscordGateway/Sharder.d.ts.map +1 -1
  26. package/dist/DiscordGateway.d.ts +2 -2
  27. package/dist/DiscordGateway.d.ts.map +1 -1
  28. package/dist/DiscordREST/Generated.d.ts +90 -51
  29. package/dist/DiscordREST/Generated.d.ts.map +1 -1
  30. package/dist/DiscordREST/Generated.js +11 -5
  31. package/dist/DiscordREST/Generated.js.map +1 -1
  32. package/dist/DiscordREST/utils.d.ts +1 -1
  33. package/dist/DiscordREST/utils.d.ts.map +1 -1
  34. package/dist/DiscordREST/utils.js +1 -1
  35. package/dist/DiscordREST/utils.js.map +1 -1
  36. package/dist/DiscordREST.d.ts +2 -2
  37. package/dist/DiscordREST.d.ts.map +1 -1
  38. package/dist/DiscordREST.js +3 -3
  39. package/dist/DiscordREST.js.map +1 -1
  40. package/dist/Helpers/flags.d.ts.map +1 -1
  41. package/dist/Helpers/intents.d.ts +4 -3
  42. package/dist/Helpers/intents.d.ts.map +1 -1
  43. package/dist/Helpers/interactions.d.ts.map +1 -1
  44. package/dist/Helpers/members.d.ts.map +1 -1
  45. package/dist/Helpers/permissions.d.ts +4 -3
  46. package/dist/Helpers/permissions.d.ts.map +1 -1
  47. package/dist/Helpers/ui.d.ts.map +1 -1
  48. package/dist/Interactions/builder.d.ts +7 -7
  49. package/dist/Interactions/builder.d.ts.map +1 -1
  50. package/dist/Interactions/builder.js.map +1 -1
  51. package/dist/Interactions/commandHelper.d.ts.map +1 -1
  52. package/dist/Interactions/commandHelper.js.map +1 -1
  53. package/dist/Interactions/context.d.ts +1 -1
  54. package/dist/Interactions/context.d.ts.map +1 -1
  55. package/dist/Interactions/context.js.map +1 -1
  56. package/dist/Interactions/definitions.d.ts +5 -5
  57. package/dist/Interactions/definitions.d.ts.map +1 -1
  58. package/dist/Interactions/definitions.js.map +1 -1
  59. package/dist/Interactions/gateway.d.ts.map +1 -1
  60. package/dist/Interactions/gateway.js +5 -7
  61. package/dist/Interactions/gateway.js.map +1 -1
  62. package/dist/Interactions/handlers.d.ts.map +1 -1
  63. package/dist/Interactions/handlers.js.map +1 -1
  64. package/dist/Interactions/index.d.ts.map +1 -1
  65. package/dist/Interactions/utils.d.ts +11 -11
  66. package/dist/Interactions/utils.d.ts.map +1 -1
  67. package/dist/Interactions/webhook.d.ts.map +1 -1
  68. package/dist/RateLimit/utils.d.ts.map +1 -1
  69. package/dist/gateway.d.ts +2 -2
  70. package/dist/gateway.d.ts.map +1 -1
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/types.d.ts +1 -1
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js.map +1 -1
  76. package/dist/utils/Effect.d.ts.map +1 -1
  77. package/dist/utils/Effect.js.map +1 -1
  78. package/dist/version.d.ts +1 -1
  79. package/dist/version.d.ts.map +1 -1
  80. package/dist/version.js +1 -1
  81. package/dist/version.js.map +1 -1
  82. package/dist/webhooks.d.ts +1 -1
  83. package/dist/webhooks.d.ts.map +1 -1
  84. package/package.json +12 -14
  85. package/src/Cache/prelude.ts +21 -32
  86. package/src/DiscordGateway/DiscordWS.ts +25 -18
  87. package/src/DiscordGateway/Shard/StateStore.ts +1 -1
  88. package/src/DiscordGateway.ts +2 -2
  89. package/src/DiscordREST/Generated.ts +264 -367
  90. package/src/DiscordREST/utils.ts +1 -1
  91. package/src/DiscordREST.ts +5 -5
  92. package/src/Interactions/gateway.ts +6 -9
  93. package/src/gateway.ts +2 -2
  94. package/src/index.ts +1 -1
  95. package/src/types.ts +2 -1
  96. package/src/utils/Effect.ts +2 -1
  97. package/src/version.ts +1 -1
  98. package/src/webhooks.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as Duration from "effect/Duration"
2
2
  import { pipe } from "effect/Function"
3
3
  import * as Option from "effect/Option"
4
- import * as Headers from "effect/unstable/http/Headers"
4
+ import * as Headers from "effect/http/Headers"
5
5
 
6
6
  const majorResources = ["channels", "guilds", "webhooks"] as const
7
7
 
@@ -16,11 +16,11 @@ import * as Layer from "effect/Layer"
16
16
  import * as Option from "effect/Option"
17
17
  import * as Redacted from "effect/Redacted"
18
18
  import * as Context from "effect/Context"
19
- import * as HttpBody from "effect/unstable/http/HttpBody"
20
- import * as HttpClient from "effect/unstable/http/HttpClient"
21
- import type { HttpClientError } from "effect/unstable/http/HttpClientError"
22
- import * as HttpRequest from "effect/unstable/http/HttpClientRequest"
23
- import type * as HttpResponse from "effect/unstable/http/HttpClientResponse"
19
+ import * as HttpBody from "effect/http/HttpBody"
20
+ import * as HttpClient from "effect/http/HttpClient"
21
+ import type { HttpClientError } from "effect/http/HttpClientError"
22
+ import * as HttpRequest from "effect/http/HttpClientRequest"
23
+ import type * as HttpResponse from "effect/http/HttpClientResponse"
24
24
 
25
25
  const make = Effect.gen(function* () {
26
26
  const { rest, token } = yield* DiscordConfig
@@ -11,7 +11,7 @@ import * as Context from "effect/Context"
11
11
  import { DiscordGateway } from "../DiscordGateway.ts"
12
12
  import type { DiscordRESTError } from "../DiscordREST.ts"
13
13
  import { DiscordREST } from "../DiscordREST.ts"
14
- import type { ListMyGuilds200, MyGuildResponse } from "../types.ts"
14
+ import type { ListMyGuilds200 } from "../types.ts"
15
15
  import type {
16
16
  GlobalApplicationCommand,
17
17
  GuildApplicationCommand,
@@ -81,16 +81,13 @@ export const run =
81
81
 
82
82
  const runGuildSync = Effect.gen(function* () {
83
83
  const commands = GuildApplicationCommand.map(_ => _.command)
84
- let results: Arr.NonEmptyReadonlyArray<MyGuildResponse> | undefined =
85
- undefined
84
+ let after: string | undefined
86
85
  while (true) {
87
- const next: ListMyGuilds200 = yield* rest.listMyGuilds({
88
- after: results && Arr.lastNonEmpty(results).id,
89
- })
90
- if (!Arr.isReadonlyArrayNonEmpty(next)) break
91
- results = next
86
+ const next: ListMyGuilds200 = yield* rest.listMyGuilds({ after })
87
+ if (next === null || !Arr.isReadonlyArrayNonEmpty(next)) break
88
+ after = Arr.lastNonEmpty(next).id
92
89
  yield* Effect.forEach(
93
- results!,
90
+ next,
94
91
  guild =>
95
92
  rest.bulkSetGuildApplicationCommands(
96
93
  application.id,
package/src/gateway.ts CHANGED
@@ -15,9 +15,9 @@ import { InteractionsRegistryLive } from "./Interactions/gateway.ts"
15
15
  import type { RateLimiter } from "./RateLimit.ts"
16
16
  import { MemoryRateLimitStoreLive, RateLimiterLive } from "./RateLimit.ts"
17
17
  import * as Layer from "effect/Layer"
18
- import type * as HttpClient from "effect/unstable/http/HttpClient"
18
+ import type * as HttpClient from "effect/http/HttpClient"
19
19
  import type { DiscordConfig } from "./DiscordConfig.ts"
20
- import type { WebSocketConstructor } from "effect/unstable/socket/Socket"
20
+ import type { WebSocketConstructor } from "effect/socket/Socket"
21
21
 
22
22
  export { DiscordGateway, DiscordGatewayLive } from "./DiscordGateway.ts"
23
23
 
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { HttpClient } from "effect/unstable/http/HttpClient"
1
+ import type { HttpClient } from "effect/http/HttpClient"
2
2
  import * as Cache from "./Cache.ts"
3
3
  import * as DiscordConfig from "./DiscordConfig.ts"
4
4
  import type { DiscordREST } from "./DiscordREST.ts"
package/src/types.ts CHANGED
@@ -45,7 +45,8 @@ interface APIAutoModerationAction {
45
45
  export type APIChannel = Rest.GetChannel200
46
46
  export type APIEmoji = Rest.EmojiResponse
47
47
  export type APIGuild = Rest.GuildResponse
48
- export type APIGuildIntegration = Rest.ListGuildIntegrations200[number]
48
+ export type APIGuildIntegration =
49
+ NonNullable<Rest.ListGuildIntegrations200>[number]
49
50
  export type APIGuildMember = Rest.GuildMemberResponse
50
51
  export type APIGuildScheduledEvent = Rest.ScheduledEventResponse
51
52
  export type APIMessage = Rest.MessageResponse
@@ -5,6 +5,7 @@ import * as Fiber from "effect/Fiber"
5
5
  import * as PubSub from "effect/PubSub"
6
6
  import * as Scope from "effect/Scope"
7
7
  import * as Exit from "effect/Exit"
8
+ import type { NonEmptyArray } from "effect/Array"
8
9
 
9
10
  export const subscribeForEachPar = <R, E, A, X>(
10
11
  self: PubSub.PubSub<A>,
@@ -22,7 +23,7 @@ export const subscribeForEachPar = <R, E, A, X>(
22
23
  Deferred.doneUnsafe(deferred, exit as Exit.Exit<never, E>)
23
24
  }
24
25
  }
25
- yield* Effect.whileLoop<[A, ...A[]], never, never>({
26
+ yield* Effect.whileLoop<NonEmptyArray<A>, never, never>({
26
27
  while: constTrue,
27
28
  body: constant(PubSub.takeAll(sub)),
28
29
  step(items) {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const LIB_VERSION = "1.0.15";
1
+ export const LIB_VERSION = "1.1.0";
package/src/webhooks.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { HttpClient } from "effect/unstable/http/HttpClient"
1
+ import type { HttpClient } from "effect/http/HttpClient"
2
2
  import type { DiscordConfig } from "./DiscordConfig.ts"
3
3
  import type { DiscordREST } from "./DiscordREST.ts"
4
4
  import { DiscordRESTLive } from "./DiscordREST.ts"