dfx 0.95.3 → 0.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cache.d.ts CHANGED
@@ -73,7 +73,7 @@ export declare const make: <EOps, EDriver, EMiss, A>({ driver, id, onMiss, ops,
73
73
  onMiss: (id: string) => Effect.Effect<A, EMiss>;
74
74
  }) => Effect.Effect<Cache<EDriver, EMiss, A>, never, Scope.Scope>;
75
75
  export declare const CacheErrorTypeId: unique symbol;
76
- declare const CacheMissError_base: new <A extends Record<string, any>>(args: Simplify<A_1>) => import("effect/Cause").YieldableError & Record<typeof CacheErrorTypeId, typeof CacheErrorTypeId> & {
76
+ declare const CacheMissError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof CacheErrorTypeId, typeof CacheErrorTypeId> & {
77
77
  readonly _tag: "CacheMissError";
78
78
  } & Readonly<A>;
79
79
  export declare class CacheMissError extends CacheMissError_base<{
@@ -1,6 +1,7 @@
1
1
  import * as Effect from "effect/Effect";
2
2
  import * as Layer from "effect/Layer";
3
3
  import type * as Discord from "dfx/types";
4
+ import * as Socket from "@effect/platform/Socket";
4
5
  export type Message = Discord.GatewayPayload | Reconnect;
5
6
  export declare const Reconnect: unique symbol;
6
7
  export type Reconnect = typeof Reconnect;
@@ -28,7 +29,7 @@ export declare const DiscordWS: import("effect/Context").Tag<DiscordWS, {
28
29
  readonly connect: ({ onConnecting, outbound, url, version, }: OpenOpts) => Effect.Effect<{
29
30
  readonly take: Effect.Effect<Discord.GatewayPayload<any>, never, never>;
30
31
  readonly setUrl: (url: string) => Effect.Effect<void, never, never>;
31
- }, never, import("effect/Scope").Scope>;
32
+ }, never, import("effect/Scope").Scope | Socket.WebSocketConstructor>;
32
33
  }>;
33
34
  export declare const DiscordWSLive: Layer.Layer<DiscordWS, never, DiscordWSCodec>;
34
35
  //# sourceMappingURL=DiscordWS.d.ts.map
@@ -1 +1 @@
1
-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AAM,aAAa,+CAAgC,CAAA"}
@@ -9,8 +9,8 @@ export declare const make: Effect.Effect<{
9
9
  readonly connect: (shard: [id: number, count: number]) => Effect.Effect<{
10
10
  readonly id: [id: number, count: number];
11
11
  readonly send: (p: Message) => Effect.Effect<boolean, never, never>;
12
- }, never, import("effect/Scope").Scope>;
13
- }, never, DiscordConfig | RateLimiter | ShardStateStore | import("dfx/DiscordGateway/Messaging").Messsaging | DiscordWS>;
12
+ }, never, import("effect/Scope").Scope | import("@effect/platform/Socket").WebSocketConstructor>;
13
+ }, never, DiscordConfig | RateLimiter | DiscordWS | import("dfx/DiscordGateway/Messaging").Messsaging | ShardStateStore>;
14
14
  type ShardService = Effect.Effect.Success<typeof make>;
15
15
  export interface Shard {
16
16
  readonly _: unique symbol;
@@ -19,9 +19,9 @@ export declare const Shard: import("effect/Context").Tag<Shard, {
19
19
  readonly connect: (shard: [id: number, count: number]) => Effect.Effect<{
20
20
  readonly id: [id: number, count: number];
21
21
  readonly send: (p: Message) => Effect.Effect<boolean, never, never>;
22
- }, never, import("effect/Scope").Scope>;
22
+ }, never, import("effect/Scope").Scope | import("@effect/platform/Socket").WebSocketConstructor>;
23
23
  }>;
24
- export declare const ShardLive: Layer.Layer<Shard, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore | ShardStateStore | import("dfx/DiscordGateway/DiscordWS").DiscordWSCodec>;
24
+ export declare const ShardLive: Layer.Layer<Shard, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore | import("dfx/DiscordGateway/DiscordWS").DiscordWSCodec | ShardStateStore>;
25
25
  export interface RunningShard extends Effect.Effect.Success<ReturnType<ShardService["connect"]>> {
26
26
  }
27
27
  export {};
@@ -10,5 +10,5 @@ export interface Sharder {
10
10
  export declare const Sharder: import("effect/Context").Tag<Sharder, {
11
11
  readonly shards: Effect.Effect<HashSet.HashSet<RunningShard>, never, never>;
12
12
  }>;
13
- export declare const SharderLive: Layer.Layer<Sharder, never, DiscordConfig | import("@effect/platform/Http/Client").Client.Default | import("dfx/RateLimit").RateLimitStore | import("./Shard/StateStore").ShardStateStore | ShardStore | import("./DiscordWS").DiscordWSCodec>;
13
+ export declare const SharderLive: Layer.Layer<Sharder, never, DiscordConfig | import("dfx/RateLimit").RateLimitStore | import("./DiscordWS").DiscordWSCodec | import("./Shard/StateStore").ShardStateStore | import("@effect/platform/Socket").WebSocketConstructor | ShardStore | import("@effect/platform/Http/Client").Client.Default>;
14
14
  //# sourceMappingURL=Sharder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sharder.d.ts","sourceRoot":"","sources":["../src/DiscordGateway/Sharder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AA2FrC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,EAAE,OAAO,MAAM,CAAA;CAC1B;AACD,eAAO,MAAM,OAAO;;EAEnB,CAAA;AACD,eAAO,MAAM,WAAW,gPAIvB,CAAA"}
1
+ {"version":3,"file":"Sharder.d.ts","sourceRoot":"","sources":["../src/DiscordGateway/Sharder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM1D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AA2FrC,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,EAAE,OAAO,MAAM,CAAA;CAC1B;AACD,eAAO,MAAM,OAAO;;EAEnB,CAAA;AACD,eAAO,MAAM,WAAW,ySAIvB,CAAA"}
@@ -17,5 +17,5 @@ export interface DiscordGateway {
17
17
  }
18
18
  export declare const DiscordGateway: import("effect/Context").Tag<DiscordGateway, DiscordGateway>;
19
19
  export declare const make: Effect.Effect<DiscordGateway, never, import("dfx/DiscordGateway/Messaging").Messsaging | Sharder>;
20
- export declare const DiscordGatewayLive: Layer.Layer<DiscordGateway, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default | import("./RateLimit").RateLimitStore | import("./DiscordGateway/Shard/StateStore").ShardStateStore | import("./DiscordGateway/ShardStore").ShardStore | import("./DiscordGateway/DiscordWS").DiscordWSCodec>;
20
+ export declare const DiscordGatewayLive: Layer.Layer<DiscordGateway, never, import("./DiscordConfig").DiscordConfig | import("./RateLimit").RateLimitStore | import("./DiscordGateway/DiscordWS").DiscordWSCodec | import("./DiscordGateway/Shard/StateStore").ShardStateStore | import("@effect/platform/Socket").WebSocketConstructor | import("./DiscordGateway/ShardStore").ShardStore | import("@effect/platform/Http/Client").Client.Default>;
21
21
  //# sourceMappingURL=DiscordGateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscordGateway.d.ts","sourceRoot":"","sources":["./src/DiscordGateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAe,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe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E,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,KAC/C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;CAC9D;AAED,eAAO,MAAM,cAAc,8DAAmD,CAAA;AAE9E,eAAO,MAAM,IAAI,mGAYf,CAAA;AAEF,eAAO,MAAM,kBAAkB,4YAG9B,CAAA"}
package/DiscordREST.d.ts CHANGED
@@ -7,7 +7,7 @@ import * as Effect from "effect/Effect";
7
7
  import * as Layer from "effect/Layer";
8
8
  import type { Scope } from "effect/Scope";
9
9
  export declare const DiscordRESTErrorTypeId: unique symbol;
10
- declare const DiscordRESTError_base: new <A extends Record<string, any>>(args: Simplify<A_1>) => import("effect/Cause").YieldableError & Record<typeof DiscordRESTErrorTypeId, typeof DiscordRESTErrorTypeId> & {
10
+ declare const DiscordRESTError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof DiscordRESTErrorTypeId, typeof DiscordRESTErrorTypeId> & {
11
11
  readonly _tag: "DiscordRESTError";
12
12
  } & Readonly<A>;
13
13
  export declare class DiscordRESTError extends DiscordRESTError_base<{
@@ -23,6 +23,6 @@ export interface DiscordRESTService extends Discord.Endpoints<Partial<Http.reque
23
23
  readonly executor: <A = unknown>(request: Http.request.ClientRequest) => Effect.Effect<ResponseWithData<A>, DiscordRESTError, Scope>;
24
24
  }
25
25
  export declare const DiscordREST: import("effect/Context").Tag<DiscordREST, DiscordRESTService>;
26
- export declare const DiscordRESTLive: Layer.Layer<DiscordREST, never, DiscordConfig | Http.client.Client.Default | RateLimitStore>;
26
+ export declare const DiscordRESTLive: Layer.Layer<DiscordREST, never, DiscordConfig | RateLimitStore | Http.client.Client.Default>;
27
27
  export {};
28
28
  //# sourceMappingURL=DiscordREST.d.ts.map
@@ -34,7 +34,7 @@ export declare const SubCommandContext: import("effect/Context").Tag<DiscordSubC
34
34
  export declare const resolvedValues: <A>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<ReadonlyArray<A>, NoSuchElementException, DiscordInteraction>;
35
35
  export declare const resolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect.Effect<A, NoSuchElementException, DiscordInteraction>;
36
36
  export declare const focusedOptionValue: Effect.Effect<string, never, DiscordFocusedOption>;
37
- declare const SubCommandNotFound_base: new <A extends Record<string, any>>(args: Simplify<A_1>) => import("effect/Cause").YieldableError & Record<typeof InteractionsErrorTypeId, typeof InteractionsErrorTypeId> & {
37
+ declare const SubCommandNotFound_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof InteractionsErrorTypeId, typeof InteractionsErrorTypeId> & {
38
38
  readonly _tag: "SubCommandNotFound";
39
39
  } & Readonly<A>;
40
40
  export declare class SubCommandNotFound extends SubCommandNotFound_base<{
@@ -11,35 +11,35 @@ export declare class GlobalApplicationCommand<R, E> {
11
11
  readonly _tag = "GlobalApplicationCommand";
12
12
  constructor(command: Discord.CreateGlobalApplicationCommandParams, handle: CommandHandler<R, E>);
13
13
  }
14
- export declare const global: <R, E, const A extends Discord.CreateGlobalApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R, DiscordInteraction | Scope | DiscordApplicationCommand>, E>;
14
+ export declare const global: <R, E, const A extends Discord.CreateGlobalApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GlobalApplicationCommand<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand>, E>;
15
15
  export declare class GuildApplicationCommand<R, E> {
16
16
  readonly command: Discord.CreateGuildApplicationCommandParams;
17
17
  readonly handle: CommandHandler<R, E>;
18
18
  readonly _tag = "GuildApplicationCommand";
19
19
  constructor(command: Discord.CreateGuildApplicationCommandParams, handle: CommandHandler<R, E>);
20
20
  }
21
- export declare const guild: <R, E, const A extends Discord.CreateGuildApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R, DiscordInteraction | Scope | DiscordApplicationCommand>, E>;
21
+ export declare const guild: <R, E, const A extends Discord.CreateGuildApplicationCommandParams>(command: A, handle: CommandHandler<R, E, A>) => GuildApplicationCommand<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand>, E>;
22
22
  export declare class MessageComponent<R, E> {
23
23
  readonly predicate: (customId: string) => boolean;
24
24
  readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
25
25
  readonly _tag = "MessageComponent";
26
26
  constructor(predicate: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
27
27
  }
28
- export declare const messageComponent: <R, E>(pred: (customId: string) => boolean, handle: CommandHandler<R, E, Discord.InteractionResponse>) => MessageComponent<Exclude<R, DiscordInteraction | Scope | DiscordMessageComponent>, E>;
28
+ export declare const messageComponent: <R, E>(pred: (customId: string) => boolean, handle: CommandHandler<R, E, Discord.InteractionResponse>) => MessageComponent<Exclude<R, Scope | DiscordInteraction | DiscordMessageComponent>, E>;
29
29
  export declare class ModalSubmit<R, E> {
30
30
  readonly predicate: (customId: string) => boolean;
31
31
  readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
32
32
  readonly _tag = "ModalSubmit";
33
33
  constructor(predicate: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
34
34
  }
35
- export declare const modalSubmit: <R, E>(pred: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => ModalSubmit<Exclude<R, DiscordInteraction | Scope | DiscordModalSubmit>, E>;
35
+ export declare const modalSubmit: <R, E>(pred: (customId: string) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => ModalSubmit<Exclude<R, Scope | DiscordInteraction | DiscordModalSubmit>, E>;
36
36
  export declare class Autocomplete<R, E> {
37
37
  readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean;
38
38
  readonly handle: Effect.Effect<Discord.InteractionResponse, E, R>;
39
39
  readonly _tag = "Autocomplete";
40
40
  constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>);
41
41
  }
42
- export declare const autocomplete: <R, E>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => Autocomplete<Exclude<R, DiscordInteraction | Scope | DiscordApplicationCommand | DiscordFocusedOption>, E>;
42
+ export declare const autocomplete: <R, E>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => boolean, handle: Effect.Effect<Discord.InteractionResponse, E, R>) => Autocomplete<Exclude<R, Scope | DiscordInteraction | DiscordApplicationCommand | DiscordFocusedOption>, E>;
43
43
  export type CommandHandler<R, E, A = any> = Effect.Effect<Discord.InteractionResponse, E, R> | CommandHandlerFn<R, E, A>;
44
44
  export interface CommandHelper<A> {
45
45
  resolve: <T>(name: AllResolvables<A>["name"], f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => Effect.Effect<T, NoSuchElementException, DiscordInteraction>;
@@ -17,5 +17,5 @@ export interface InteractionsRegistry {
17
17
  readonly _: unique symbol;
18
18
  }
19
19
  export declare const InteractionsRegistry: import("effect/Context").Tag<InteractionsRegistry, InteractionsRegistryService>;
20
- export declare const InteractionsRegistryLive: Layer.Layer<InteractionsRegistry, never, DiscordREST | DiscordGateway>;
20
+ export declare const InteractionsRegistryLive: Layer.Layer<InteractionsRegistry, never, DiscordGateway | DiscordREST>;
21
21
  //# sourceMappingURL=gateway.d.ts.map
@@ -45,7 +45,7 @@ export declare const WebhookConfig: import("effect/Context").Tag<WebhookConfig,
45
45
  }>;
46
46
  export declare const layer: (opts: MakeConfigOpts) => Layer.Layer<WebhookConfig, never, never>;
47
47
  export declare const layerConfig: (config: Config.Config<MakeConfigOpts>) => Layer.Layer<WebhookConfig, ConfigError.ConfigError>;
48
- declare const WebhookParseError_base: new <A extends Record<string, any>>(args: Simplify<A_1 & {
48
+ declare const WebhookParseError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A & {
49
49
  readonly error: unknown;
50
50
  }>) => Cause.YieldableError & Record<typeof InteractionsErrorTypeId, typeof InteractionsErrorTypeId> & {
51
51
  readonly _tag: "WebhookParseError";
package/README.md CHANGED
@@ -10,11 +10,14 @@ A Discord library built on top of effect
10
10
  ## Example
11
11
 
12
12
  ```typescript
13
- import { runMain } from "@effect/platform-node/Runtime"
13
+ import { NodeHttpClient, NodeRuntime, NodeSocket } from "@effect/platform-node"
14
14
  import { DiscordConfig, Ix } from "dfx"
15
15
  import { DiscordIxLive, InteractionsRegistry } from "dfx/gateway"
16
+ import * as Dotenv from "dotenv"
16
17
  import { Config, Effect, Layer } from "effect"
17
18
 
19
+ Dotenv.config()
20
+
18
21
  // Create a config layer
19
22
  const DiscordConfigLive = DiscordConfig.layerConfig({
20
23
  token: Config.secret("DISCORD_BOT_TOKEN"),
@@ -45,13 +48,17 @@ const HelloLive = Layer.effectDiscard(
45
48
  )
46
49
  }),
47
50
  ).pipe(
48
- // provide discord interactions layer
51
+ // provide discord ix layer
49
52
  Layer.provide(DiscordIxLive),
50
53
  )
51
54
 
52
55
  // Construct the main layer
53
- const MainLive = HelloLive.pipe(Layer.provide(DiscordConfigLive))
56
+ const MainLive = HelloLive.pipe(
57
+ Layer.provide(NodeHttpClient.layerUndici),
58
+ Layer.provide(NodeSocket.layerWebSocketConstructor),
59
+ Layer.provide(DiscordConfigLive),
60
+ )
54
61
 
55
62
  // run it
56
- runMain(Layer.launch(MainLive))
63
+ NodeRuntime.runMain(Layer.launch(MainLive))
57
64
  ```
package/gateway.d.ts CHANGED
@@ -7,6 +7,6 @@ import * as Layer from "effect/Layer";
7
7
  export { DiscordGateway, DiscordGatewayLive } from "dfx/DiscordGateway";
8
8
  export { InteractionsRegistry, InteractionsRegistryLive, interactionsSync, run as runIx, setInteractionsSync, } from "dfx/Interactions/gateway";
9
9
  export { CachePrelude, DiscordWS, SendEvent, Shard, ShardStore };
10
- export declare const DiscordLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordREST").DiscordREST | import("dfx/DiscordGateway").DiscordGateway, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
11
- export declare const DiscordIxLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordREST").DiscordREST | import("dfx/DiscordGateway").DiscordGateway | import("dfx/Interactions/gateway").InteractionsRegistry, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
10
+ export declare const DiscordLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordGateway").DiscordGateway | import("dfx/DiscordREST").DiscordREST, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Socket").WebSocketConstructor | import("@effect/platform/Http/Client").Client.Default>;
11
+ export declare const DiscordIxLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordGateway").DiscordGateway | import("dfx/DiscordREST").DiscordREST | import("dfx/Interactions/gateway").InteractionsRegistry, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Socket").WebSocketConstructor | import("@effect/platform/Http/Client").Client.Default>;
12
12
  //# sourceMappingURL=gateway.d.ts.map
package/gateway.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["./src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAA;AAEzD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AAEjD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAK3D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,GAAG,IAAI,KAAK,EACZ,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;AAEhE,eAAO,MAAM,WAAW,gPASvB,CAAA;AAED,eAAO,MAAM,aAAa,0SAEzB,CAAA"}
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["./src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD,OAAO,KAAK,SAAS,MAAM,8BAA8B,CAAA;AAEzD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AAEjD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAA;AAK3D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvE,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,GAAG,IAAI,KAAK,EACZ,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;AAEhE,eAAO,MAAM,WAAW,ySASvB,CAAA;AAED,eAAO,MAAM,aAAa,mWAEzB,CAAA"}
package/mjs/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const LIB_VERSION = "0.95.3";
1
+ export const LIB_VERSION = "0.97.0";
2
2
  //# sourceMappingURL=version.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dfx",
3
- "version": "0.95.3",
3
+ "version": "0.97.0",
4
4
  "description": "Effect-TS discord library",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,15 +35,12 @@
35
35
  "sideEffects": [],
36
36
  "author": "Tim Smart <hello@timsmart.co>",
37
37
  "peerDependencies": {
38
- "@effect/platform": "^0.50.2",
38
+ "@effect/platform": "^0.53.0",
39
39
  "effect": "^3.0.5"
40
40
  },
41
41
  "optionalDependencies": {
42
- "bufferutil": "^4.0.8",
43
- "discord-verify": "^1.2.0",
44
- "utf-8-validate": "^6.0.3",
45
- "zlib-sync": "^0.1.9"
42
+ "discord-verify": "^1.2.0"
46
43
  },
47
- "gitHead": "f85d8d07d8f016476ca7fb5e0d719022fe4ed31e",
44
+ "gitHead": "c29f6fce1dcce1d9b52fc1091d08f9674730a145",
48
45
  "main": "./index.js"
49
46
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const LIB_VERSION = "0.95.3";
1
+ export const LIB_VERSION = "0.97.0";
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const LIB_VERSION = "0.95.3";
1
+ export declare const LIB_VERSION = "0.97.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LIB_VERSION = void 0;
7
- const LIB_VERSION = exports.LIB_VERSION = "0.95.3";
7
+ const LIB_VERSION = exports.LIB_VERSION = "0.97.0";
8
8
  //# sourceMappingURL=version.js.map
package/webhooks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import * as Layer from "effect/Layer";
2
2
  export { BadWebhookSignature, WebhookConfig, WebhookParseError, makeHandler, makeSimpleHandler, layer as webhookLayer, layerConfig as webhookLayerConfig, } from "dfx/Interactions/webhook";
3
- export declare const DiscordLive: Layer.Layer<import("dfx/DiscordREST").DiscordREST | import("dfx/RateLimit").RateLimiter, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
3
+ export declare const DiscordLive: Layer.Layer<import("dfx/RateLimit").RateLimiter | import("dfx/DiscordREST").DiscordREST, never, import("./DiscordConfig").DiscordConfig | import("@effect/platform/Http/Client").Client.Default>;
4
4
  //# sourceMappingURL=webhooks.d.ts.map