dfx 0.16.0 → 0.16.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.
- package/DiscordGateway/DiscordWS/index.d.ts +3 -2
- package/DiscordGateway/DiscordWS/index.js +19 -18
- package/DiscordGateway/DiscordWS/index.js.map +1 -1
- package/DiscordGateway/Shard/index.d.ts +3 -3
- package/DiscordGateway/Shard/index.js +40 -45
- package/DiscordGateway/Shard/index.js.map +1 -1
- package/DiscordGateway/Sharder/index.d.ts +3 -3
- package/DiscordGateway/WS/index.d.ts +2 -4
- package/DiscordGateway/WS/index.js +17 -20
- package/DiscordGateway/WS/index.js.map +1 -1
- package/DiscordGateway/index.d.ts +4 -4
- package/DiscordREST/index.d.ts +2 -2
- package/gateway.d.ts +2 -2
- package/global.d.ts +5 -0
- package/global.js.map +1 -1
- package/package.json +3 -3
- package/webhooks.d.ts +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/// <reference types="ws" />
|
|
3
3
|
import { Discord } from "dfx";
|
|
4
4
|
import { WS } from "dfx/gateway";
|
|
5
|
+
import { Effect } from "@effect/io/Effect";
|
|
5
6
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
6
7
|
import WebSocket from "isomorphic-ws";
|
|
7
8
|
export type Message = Discord.GatewayPayload | WS.Reconnect;
|
|
@@ -9,6 +10,7 @@ export interface OpenOpts {
|
|
|
9
10
|
url?: string;
|
|
10
11
|
version?: number;
|
|
11
12
|
encoding?: DiscordWSCodec;
|
|
13
|
+
outbound: Effect<never, never, Message>;
|
|
12
14
|
}
|
|
13
15
|
export interface DiscordWSCodec {
|
|
14
16
|
type: "json" | "etf";
|
|
@@ -17,8 +19,7 @@ export interface DiscordWSCodec {
|
|
|
17
19
|
}
|
|
18
20
|
export declare const DiscordWSCodec: import("../../global.js").Tag<DiscordWSCodec>;
|
|
19
21
|
export declare const LiveJsonDiscordWSCodec: import("../../global.js").Layer<never, never, DiscordWSCodec>;
|
|
20
|
-
export declare const make: ({ url, version, }
|
|
22
|
+
export declare const make: ({ url, version, outbound, }: OpenOpts) => import("../../global.js").Effect<import("../../Log/index.js").Log | DiscordWSCodec, never, {
|
|
21
23
|
source: import("callbag-effect-ts/Source").EffectSource<never, never, import("../../types.js").GatewayPayload<any>>;
|
|
22
|
-
sink: import("callbag-effect-ts/Sink").EffectSink<never, never, never, Message>;
|
|
23
24
|
setUrl: (url: string) => import("../../global.js").Effect<never, never, void>;
|
|
24
25
|
}>;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fp-ts/data/Context";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Layer";
|
|
3
|
-
import * as tsplus_module_3 from "
|
|
4
|
-
import * as tsplus_module_4 from "
|
|
5
|
-
import * as tsplus_module_5 from "
|
|
6
|
-
import * as tsplus_module_6 from "
|
|
7
|
-
import * as tsplus_module_7 from "callbag-effect-ts/Source/
|
|
8
|
-
import * as tsplus_module_8 from "
|
|
9
|
-
import * as tsplus_module_9 from "
|
|
10
|
-
import * as tsplus_module_10 from "dfx";
|
|
11
|
-
import * as tsplus_module_11 from "@effect/io/
|
|
12
|
-
import * as tsplus_module_12 from "@effect/io/Ref";
|
|
3
|
+
import * as tsplus_module_3 from "@fp-ts/data/Duration";
|
|
4
|
+
import * as tsplus_module_4 from "@effect/io/Schedule";
|
|
5
|
+
import * as tsplus_module_5 from "callbag-effect-ts/Source/tapError";
|
|
6
|
+
import * as tsplus_module_6 from "callbag-effect-ts/Source/retry";
|
|
7
|
+
import * as tsplus_module_7 from "callbag-effect-ts/Source/map";
|
|
8
|
+
import * as tsplus_module_8 from "dfx";
|
|
9
|
+
import * as tsplus_module_9 from "@effect/io/Effect";
|
|
10
|
+
import * as tsplus_module_10 from "dfx/gateway";
|
|
11
|
+
import * as tsplus_module_11 from "@effect/io/Ref";
|
|
13
12
|
export const DiscordWSCodec = tsplus_module_1.Tag();
|
|
14
13
|
export const LiveJsonDiscordWSCodec = tsplus_module_2.succeed(DiscordWSCodec)({
|
|
15
14
|
type: "json",
|
|
16
15
|
encode: (p) => JSON.stringify(p),
|
|
17
16
|
decode: (p) => JSON.parse(p.toString("utf8")),
|
|
18
17
|
});
|
|
19
|
-
export const make = ({ url = "wss://gateway.discord.gg/", version = 10,
|
|
20
|
-
const setUrl = (url) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
return { source,
|
|
25
|
-
})(
|
|
26
|
-
|
|
18
|
+
export const make = ({ url = "wss://gateway.discord.gg/", version = 10, outbound, }) => tsplus_module_9.flatMap(encoding => tsplus_module_9.flatMap(urlRef => {
|
|
19
|
+
const setUrl = (url) => tsplus_module_11.set(`${url}?v=${version}&encoding=${encoding.type}`)(urlRef);
|
|
20
|
+
const take = tsplus_module_9.map((a) => a === tsplus_module_10.WS.Reconnect ? a : encoding.encode(a))(outbound);
|
|
21
|
+
return tsplus_module_9.flatMap(ws => tsplus_module_9.map(log => {
|
|
22
|
+
const source = tsplus_module_7.map(encoding.decode)(tsplus_module_6.retry(tsplus_module_4.exponential(tsplus_module_3.seconds(0.5)))(tsplus_module_5.tapError((e) => log.info("DiscordWS", "ERROR", e))(ws)));
|
|
23
|
+
return { source, setUrl };
|
|
24
|
+
})(tsplus_module_9.service(tsplus_module_8.Log.Log)))(tsplus_module_10.WS.make(urlRef, take, {
|
|
25
|
+
perMessageDeflate: false,
|
|
26
|
+
}));
|
|
27
|
+
})(tsplus_module_11.make(`${url}?v=${version}&encoding=${encoding.type}`)))(tsplus_module_9.service(DiscordWSCodec));
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/DiscordWS/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/DiscordWS/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,M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AAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE;QACpB,iBAAiB,EAAE,KAAK;KACzB,CAAC;GATa,sBAAS,GAAG,GAAG,MAAM,OAAO,aAAa,QAAQ,CAAC,IAAI,EAAE,CAAC,GADvD,wBAAe,cAAc,CAAC,CAwBjD,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DiscordWS } from "dfx/gateway";
|
|
2
2
|
import { Discord } from "dfx";
|
|
3
|
-
export declare const make: (shard: [id: number, count: number]) => import("../../global.js").Effect<import("../../Log/index.js").Log | import("../DiscordWS/index.js").DiscordWSCodec | import("../../
|
|
3
|
+
export declare const make: (shard: [id: number, count: number]) => import("../../global.js").Effect<import("../../Log/index.js").Log | import("../DiscordWS/index.js").DiscordWSCodec | import("../../RateLimitStore/index.js").RateLimiter | import("../../DiscordConfig/index.js").DiscordConfig, never, {
|
|
4
4
|
run: import("../../global.js").Effect<never, never, void>;
|
|
5
5
|
raw: import("callbag-effect-ts/Source").EffectSource<never, never, import("../../types.js").GatewayPayload<any>>;
|
|
6
6
|
dispatch: import("callbag-effect-ts/Source").EffectSource<never, never, import("../../types.js").GatewayPayload<import("../../types.js").ReceiveEvent>>;
|
|
7
|
-
send: (p: Discord.GatewayPayload) =>
|
|
8
|
-
reconnect: ()
|
|
7
|
+
send: (p: Discord.GatewayPayload) => import("../../global.js").Effect<never, never, boolean>;
|
|
8
|
+
reconnect: import("../../global.js").Effect<never, never, boolean>;
|
|
9
9
|
}>;
|
|
@@ -1,52 +1,47 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
2
|
import * as tsplus_module_2 from "dfx/gateway";
|
|
3
|
-
import * as tsplus_module_3 from "
|
|
4
|
-
import * as tsplus_module_4 from "
|
|
5
|
-
import * as tsplus_module_5 from "
|
|
6
|
-
import * as tsplus_module_6 from "callbag-effect-ts/Source/
|
|
7
|
-
import * as tsplus_module_7 from "callbag-effect-ts/Source/
|
|
8
|
-
import * as tsplus_module_8 from "
|
|
9
|
-
import * as tsplus_module_9 from "
|
|
10
|
-
import * as tsplus_module_10 from "
|
|
11
|
-
import * as tsplus_module_11 from "
|
|
3
|
+
import * as tsplus_module_3 from "@fp-ts/data/Duration";
|
|
4
|
+
import * as tsplus_module_4 from "callbag-effect-ts/Source/forEach";
|
|
5
|
+
import * as tsplus_module_5 from "dfx";
|
|
6
|
+
import * as tsplus_module_6 from "callbag-effect-ts/Source/filter";
|
|
7
|
+
import * as tsplus_module_7 from "callbag-effect-ts/Source/tap";
|
|
8
|
+
import * as tsplus_module_8 from "callbag-effect-ts/Source/run";
|
|
9
|
+
import * as tsplus_module_9 from "@fp-ts/data/Option";
|
|
10
|
+
import * as tsplus_module_10 from "callbag-effect-ts/Source/share";
|
|
11
|
+
import * as tsplus_module_11 from "@effect/io/Queue";
|
|
12
12
|
import * as Heartbeats from "./heartbeats.js";
|
|
13
13
|
import * as Identify from "./identify.js";
|
|
14
14
|
import * as InvalidSession from "./invalidSession.js";
|
|
15
15
|
import * as Utils from "./utils.js";
|
|
16
|
-
export const make = (shard) => tsplus_module_1.flatMap(({ token, gateway }) => tsplus_module_1.flatMap(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
})(Utils.latest((p) => tsplus_module_8.fromNullable(p.s))))(Utils.latest((p) => tsplus_module_8.map((p) => p.d)(tsplus_module_8.filter((p) => p.op === tsplus_module_4.Discord.GatewayOpcode.DISPATCH && p.t === "READY")(tsplus_module_8.some(p)))));
|
|
49
|
-
})(tsplus_module_9.share(socket.source));
|
|
50
|
-
})(tsplus_module_1.service(tsplus_module_4.RateLimit.RateLimiter));
|
|
51
|
-
})(tsplus_module_2.DiscordWS.make()))(tsplus_module_1.service(tsplus_module_4.Config.DiscordConfig));
|
|
16
|
+
export const make = (shard) => tsplus_module_1.flatMap(({ token, gateway }) => tsplus_module_1.flatMap(limiter => tsplus_module_1.flatMap(outboundQueue => {
|
|
17
|
+
const outbound = tsplus_module_1.tap(() => limiter.maybeWait("shard.send", tsplus_module_3.minutes(1), 120))(outboundQueue
|
|
18
|
+
.take());
|
|
19
|
+
const send = (p) => outboundQueue.offer(p);
|
|
20
|
+
return tsplus_module_1.flatMap(socket => tsplus_module_1.flatMap(raw => tsplus_module_1.flatMap(([latestReady, updateLatestReady]) => tsplus_module_1.map(([latestSequence, updateLatestSequence]) => {
|
|
21
|
+
const maybeUpdateUrl = (p) => tsplus_module_9.match(() => tsplus_module_1.unit(), (a) => socket.setUrl(a.resume_gateway_url))(tsplus_module_9.map((p) => p.d)(tsplus_module_9.filter((p) => p.op === tsplus_module_5.Discord.GatewayOpcode.DISPATCH && p.t === "READY")(tsplus_module_9.some(p))));
|
|
22
|
+
const updateRefs = tsplus_module_8.runDrain(tsplus_module_7.tap(maybeUpdateUrl)(tsplus_module_7.tap(updateLatestSequence)(tsplus_module_7.tap(updateLatestReady)(raw))));
|
|
23
|
+
// heartbeats
|
|
24
|
+
const heartbeatEffects = tsplus_module_4.forEach(send)(Heartbeats.fromRaw(raw, latestSequence));
|
|
25
|
+
const dispatch = tsplus_module_6.filter((p) => p.op === tsplus_module_5.Discord.GatewayOpcode.DISPATCH)(raw);
|
|
26
|
+
// identify
|
|
27
|
+
const identifyEffects = tsplus_module_4.forEach(send)(Identify.fromRaw(raw, {
|
|
28
|
+
token,
|
|
29
|
+
shard,
|
|
30
|
+
intents: gateway.intents,
|
|
31
|
+
presence: gateway.presence,
|
|
32
|
+
latestSequence,
|
|
33
|
+
latestReady,
|
|
34
|
+
}));
|
|
35
|
+
// invalid session
|
|
36
|
+
const invalidEffects = tsplus_module_4.forEach(send)(InvalidSession.fromRaw(raw, latestReady));
|
|
37
|
+
const reconnectSoon = tsplus_module_1.delay(tsplus_module_3.seconds(15))(send(tsplus_module_2.WS.Reconnect));
|
|
38
|
+
return {
|
|
39
|
+
run: tsplus_module_1.asUnit(tsplus_module_1.zipPar(reconnectSoon)(tsplus_module_1.zipPar(invalidEffects)(tsplus_module_1.zipPar(identifyEffects)(tsplus_module_1.zipPar(heartbeatEffects)(updateRefs))))),
|
|
40
|
+
raw,
|
|
41
|
+
dispatch,
|
|
42
|
+
send: (p) => send(p),
|
|
43
|
+
reconnect: send(tsplus_module_2.WS.Reconnect),
|
|
44
|
+
};
|
|
45
|
+
})(Utils.latest((p) => tsplus_module_9.fromNullable(p.s))))(Utils.latest((p) => tsplus_module_9.map((p) => p.d)(tsplus_module_9.filter((p) => p.op === tsplus_module_5.Discord.GatewayOpcode.DISPATCH && p.t === "READY")(tsplus_module_9.some(p))))))(tsplus_module_10.share(socket.source)))(tsplus_module_2.DiscordWS.make({ outbound }));
|
|
46
|
+
})(tsplus_module_11.unbounded()))(tsplus_module_1.service(tsplus_module_5.RateLimit.RateLimiter)))(tsplus_module_1.service(tsplus_module_5.Config.DiscordConfig));
|
|
52
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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,KA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C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,GAV5C,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACjB,oBAKO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAE,EALlB,uBAEI,CAAC,CAAC,EAAmD,EAAE,CACrD,CAAC,CAAC,EAAE,KAAK,gBAAA,OAAO,CAAC,aAAa,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAHhE,qBAAW,CAAC,CAAC,CAIV,CACgB,CACpB,0BAVW,MAAM,CAAC,MAAM,IAFV,gBAAA,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;GANrB,4BAAoC,GAF1C,wBAAe,gBAAA,SAAS,CAAC,WAAW,CAAC,GAD1B,wBAAe,gBAAA,MAAM,CAAC,aAAa,CAAC,CAiFjE,CAAA"}
|
|
@@ -2,10 +2,10 @@ import { Effect } from "@effect/io/Effect";
|
|
|
2
2
|
import { Maybe, Discord } from "dfx";
|
|
3
3
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
4
4
|
import { ShardStore } from "../ShardStore/index.js";
|
|
5
|
-
export declare const spawn: import("callbag-effect-ts/Source").EffectSource<import("../../Log/index.js").Log | import("../DiscordWS/index.js").DiscordWSCodec | import("../../
|
|
5
|
+
export declare const spawn: import("callbag-effect-ts/Source").EffectSource<import("../../Log/index.js").Log | import("../DiscordWS/index.js").DiscordWSCodec | import("../../RateLimitStore/index.js").RateLimiter | import("../../DiscordConfig/index.js").DiscordConfig | ShardStore | import("../../index.js").DiscordREST, never, {
|
|
6
6
|
run: import("../../global.js").Effect<never, never, void>;
|
|
7
7
|
raw: import("callbag-effect-ts/Source").EffectSource<never, never, import("../../types.js").GatewayPayload<any>>;
|
|
8
8
|
dispatch: import("callbag-effect-ts/Source").EffectSource<never, never, import("../../types.js").GatewayPayload<import("../../types.js").ReceiveEvent>>;
|
|
9
|
-
send: (p: import("../../types.js").GatewayPayload<any>) =>
|
|
10
|
-
reconnect: ()
|
|
9
|
+
send: (p: import("../../types.js").GatewayPayload<any>) => import("../../global.js").Effect<never, never, boolean>;
|
|
10
|
+
reconnect: import("../../global.js").Effect<never, never, boolean>;
|
|
11
11
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="ws" />
|
|
3
3
|
import { Ref } from "@effect/io/Ref";
|
|
4
|
+
import { Effect } from "@effect/io/Effect";
|
|
4
5
|
import { EffectSource } from "callbag-effect-ts/Source";
|
|
5
6
|
import WebSocket from "isomorphic-ws";
|
|
6
7
|
export declare const Reconnect: unique symbol;
|
|
@@ -22,7 +23,4 @@ export declare class WebSocketWriteError {
|
|
|
22
23
|
readonly _tag = "WebSocketWriteError";
|
|
23
24
|
constructor(reason: Error);
|
|
24
25
|
}
|
|
25
|
-
export declare const make: (url: Ref<string>, options?: WebSocket.ClientOptions) => import("../../global.js").Effect<import("../../Log/index.js").Log, never,
|
|
26
|
-
source: import("callbag-effect-ts/Source").EffectSource<never, WebSocketError | WebSocketCloseError | WebSocketWriteError, WebSocket.RawData>;
|
|
27
|
-
sink: import("callbag-effect-ts/Sink").EffectSink<never, never, never, Message>;
|
|
28
|
-
}>;
|
|
26
|
+
export declare const make: (url: Ref<string>, takeOutbound: Effect<never, never, Message>, options?: WebSocket.ClientOptions) => import("../../global.js").Effect<import("../../Log/index.js").Log, never, import("callbag-effect-ts/Source").EffectSource<never, WebSocketError | WebSocketCloseError | WebSocketWriteError, WebSocket.RawData>>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Ref";
|
|
3
3
|
import * as tsplus_module_3 from "callbag-effect-ts/Source/async";
|
|
4
|
-
import * as tsplus_module_4 from "callbag-effect-ts/Source/
|
|
5
|
-
import * as tsplus_module_5 from "callbag-effect-ts/Source/
|
|
6
|
-
import * as tsplus_module_6 from "callbag-effect-ts/Source/
|
|
7
|
-
import * as tsplus_module_7 from "
|
|
8
|
-
import * as tsplus_module_8 from "
|
|
9
|
-
import * as tsplus_module_9 from "
|
|
10
|
-
import * as tsplus_module_10 from "callbag-effect-ts/Source/
|
|
11
|
-
import * as tsplus_module_11 from "callbag-effect-ts/Source/
|
|
4
|
+
import * as tsplus_module_4 from "callbag-effect-ts/Source/repeatEffectOption";
|
|
5
|
+
import * as tsplus_module_5 from "callbag-effect-ts/Source/unwrap";
|
|
6
|
+
import * as tsplus_module_6 from "callbag-effect-ts/Source/tap";
|
|
7
|
+
import * as tsplus_module_7 from "callbag-effect-ts/Source/drain";
|
|
8
|
+
import * as tsplus_module_8 from "dfx";
|
|
9
|
+
import * as tsplus_module_9 from "@effect/io/Schedule";
|
|
10
|
+
import * as tsplus_module_10 from "callbag-effect-ts/Source/merge";
|
|
11
|
+
import * as tsplus_module_11 from "callbag-effect-ts/Source/unwrapScope";
|
|
12
|
+
import * as tsplus_module_12 from "callbag-effect-ts/Source/retry";
|
|
12
13
|
import WebSocket from "isomorphic-ws";
|
|
13
14
|
export const Reconnect = Symbol();
|
|
14
15
|
const socket = (urlRef, options) => tsplus_module_1.acquireRelease(tsplus_module_1.map(url => new WebSocket(url, options))(tsplus_module_2.get(urlRef)), (ws) => tsplus_module_1.sync(() => {
|
|
@@ -49,10 +50,10 @@ export class WebSocketWriteError {
|
|
|
49
50
|
this.reason = reason;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
const send = (ws,
|
|
53
|
+
const send = (ws, take) => tsplus_module_1.map(log => tsplus_module_7.drain(tsplus_module_6.tap((data) => tsplus_module_1.async((resume) => {
|
|
53
54
|
if (data === Reconnect) {
|
|
54
55
|
ws.close(1012, "reconnecting");
|
|
55
|
-
resume(tsplus_module_1.
|
|
56
|
+
resume(tsplus_module_1.fail(new WebSocketCloseError(1012, "reconnecting")));
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
59
|
ws.send(data, (err) => {
|
|
@@ -61,7 +62,7 @@ const send = (ws, out) => tsplus_module_1.map(log => tsplus_module_6.drain(tsplu
|
|
|
61
62
|
: tsplus_module_1.unit());
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
}))(
|
|
65
|
+
}))(tsplus_module_6.tap((p) => log.debug("WS", "send", p))(tsplus_module_5.unwrap(tsplus_module_1.map(() => tsplus_module_4.repeatEffectOption(take))(tsplus_module_1.async((resume) => {
|
|
65
66
|
if (ws.readyState & ws.OPEN) {
|
|
66
67
|
resume(tsplus_module_1.unit());
|
|
67
68
|
}
|
|
@@ -70,13 +71,9 @@ const send = (ws, out) => tsplus_module_1.map(log => tsplus_module_6.drain(tsplu
|
|
|
70
71
|
resume(tsplus_module_1.unit());
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
})))))))(tsplus_module_1.service(
|
|
74
|
-
export const make = (url, options) => (
|
|
75
|
-
const
|
|
76
|
-
return tsplus_module_1.map(
|
|
77
|
-
|
|
78
|
-
const source = tsplus_module_11.retry(tsplus_module_8.recurWhile((e) => e._tag === "WebSocketCloseError" && e.code === 1012))(tsplus_module_10.unwrapScope(tsplus_module_1.flatMap(ws => tsplus_module_1.map(sendEffect => tsplus_module_9.merge(sendEffect)(recv(ws)))(withLog(send(ws, outbound))))(socket(url, options))));
|
|
79
|
-
return { source, sink };
|
|
80
|
-
})(tsplus_module_1.service(tsplus_module_7.Log.Log));
|
|
81
|
-
})();
|
|
74
|
+
})))))))(tsplus_module_1.service(tsplus_module_8.Log.Log));
|
|
75
|
+
export const make = (url, takeOutbound, options) => tsplus_module_1.map(log => {
|
|
76
|
+
const withLog = tsplus_module_1.provideService(tsplus_module_8.Log.Log)(log);
|
|
77
|
+
return tsplus_module_12.retry(tsplus_module_9.recurWhile((e) => e._tag === "WebSocketCloseError" && e.code === 1012))(tsplus_module_11.unwrapScope(tsplus_module_1.flatMap(ws => tsplus_module_1.map(sendEffect => tsplus_module_10.merge(sendEffect)(recv(ws)))(withLog(send(ws, takeOutbound))))(socket(url, options))));
|
|
78
|
+
})(tsplus_module_1.service(tsplus_module_8.Log.Log));
|
|
82
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/WS/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/WS/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,SAAS,MAAM,eAAe,CAAA;AAErC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,EAAE,CAAA;AAIjC,MAAM,MAAM,GAAG,CAAC,MAAmB,EAAE,OAAiC,EAAE,EAAE,CACxE,mDACQ,GAAG,IACF,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,sBADpB,MAAM,IAEJ,CAAC,EAAE,EAAE,EAAE,CACvB,qBAAY,GAAG,EAAE;IACf,EAAE,CAAC,KAAK,EAAE,CAAA;IACV,EAAE,CAAC,kBAAkB,EAAE,CAAA;AACzB,CAAC,CAAC,CACH,CAAA;AAEH,MAAM,OAAO,cAAc;IAEJ;IADZ,IAAI,GAAG,gBAAgB,CAAA;IAChC,YAAqB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;CACzC;AAED,MAAM,OAAO,mBAAmB;IAET;IAAuB;IADnC,IAAI,GAAG,qBAAqB,CAAA;IACrC,YAAqB,IAAY,EAAW,MAAc;QAArC,SAAI,GAAJ,IAAI,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;CAC/D;AAED,MAAM,IAAI,GAAG,CAAC,EAAa,EAAE,EAAE,CAC7B,sBACE,CAAC,IAAI,EAAE,EAAE;IACP,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE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AAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,yBAVxC,oBASA,GAAG,EAAE,CAAC,mCAAA,IAAI,CAA0D,EATpE,sBAAiC,CAAC,MAAM,EAAE,EAAE;IACjD,IAAI,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,EAAE;QAC3B,MAAM,CAAC,sBAAa,CAAC,CAAA;KACtB;SAAM;QACL,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;YACnB,MAAM,CAAC,sBAAa,CAAC,CAAA;QACvB,CAAC,CAAC,CAAA;KACH;AACH,CAAC,CAAC,CAC0E,EAC5B,CAkB7C,GA7BW,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC,CA8BrC,CAAA;AAEJ,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,GAAgB,EAChB,YAA2C,EAC3C,OAAiC,EACjC,EAAE,qBAEM,GAAG;IACT,MAAM,OAAO,GAAG,+BAAsB,gBAAA,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;IAEnD,OAAO,uBAKL,2BACE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAC3D,uDANK,EAAE,wBACF,UAAU,IACT,uBAAe,UAAU,EAAzB,IAAI,CAAC,EAAE,CAAC,CAAkB,EADZ,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,GADvC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,GAOlC,CAAA;GAXa,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC,CAYrC,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { EffectSource } from "callbag-effect-ts/Source";
|
|
|
2
2
|
import { Discord } from "dfx";
|
|
3
3
|
import { Effect } from "@effect/io/Effect";
|
|
4
4
|
import { Success } from "dfx/utils/effect";
|
|
5
|
-
export declare const make: import("../global.js").Effect<import("../Log/index.js").Log | import("./DiscordWS/index.js").DiscordWSCodec | import("../
|
|
5
|
+
export declare const make: import("../global.js").Effect<import("../Log/index.js").Log | import("./DiscordWS/index.js").DiscordWSCodec | import("../RateLimitStore/index.js").RateLimiter | import("../DiscordConfig/index.js").DiscordConfig | import("./ShardStore/index.js").ShardStore | import("../index.js").DiscordREST, never, {
|
|
6
6
|
shards: import("callbag-effect-ts/Source").EffectSource<never, never, {
|
|
7
7
|
run: import("../global.js").Effect<never, never, void>;
|
|
8
8
|
raw: import("callbag-effect-ts/Source").EffectSource<never, never, import("../types.js").GatewayPayload<any>>;
|
|
9
9
|
dispatch: import("callbag-effect-ts/Source").EffectSource<never, never, import("../types.js").GatewayPayload<import("../types.js").ReceiveEvent>>;
|
|
10
|
-
send: (p: import("../types.js").GatewayPayload<any>) =>
|
|
11
|
-
reconnect: ()
|
|
10
|
+
send: (p: import("../types.js").GatewayPayload<any>) => import("../global.js").Effect<never, never, boolean>;
|
|
11
|
+
reconnect: import("../global.js").Effect<never, never, boolean>;
|
|
12
12
|
}>;
|
|
13
13
|
raw: import("callbag-effect-ts/Source").EffectSource<never, never, import("../types.js").GatewayPayload<any>>;
|
|
14
14
|
dispatch: import("callbag-effect-ts/Source").EffectSource<never, never, import("../types.js").GatewayPayload<import("../types.js").ReceiveEvent>>;
|
|
@@ -18,5 +18,5 @@ export declare const make: import("../global.js").Effect<import("../Log/index.js
|
|
|
18
18
|
export interface DiscordGateway extends Success<typeof make> {
|
|
19
19
|
}
|
|
20
20
|
export declare const DiscordGateway: import("../global.js").Tag<DiscordGateway>;
|
|
21
|
-
export declare const LiveDiscordGateway: import("../global.js").Layer<import("../Log/index.js").Log | import("./DiscordWS/index.js").DiscordWSCodec | import("../
|
|
21
|
+
export declare const LiveDiscordGateway: import("../global.js").Layer<import("../Log/index.js").Log | import("./DiscordWS/index.js").DiscordWSCodec | import("../RateLimitStore/index.js").RateLimiter | import("../DiscordConfig/index.js").DiscordConfig | import("./ShardStore/index.js").ShardStore | import("../index.js").DiscordREST, never, DiscordGateway>;
|
|
22
22
|
export declare const handleDispatch: <K extends keyof import("../types.js").ReceiveEvents, R1, E1, A>(event: K, handle: (event: import("../types.js").ReceiveEvents[K]) => import("../global.js").Effect<R1, E1, A>) => import("../global.js").Effect<DiscordGateway | R1, E1, void>;
|
package/DiscordREST/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { Effect } from "@effect/io/Effect";
|
|
|
2
2
|
import { Http } from "dfx";
|
|
3
3
|
import { Success } from "dfx/utils/effect";
|
|
4
4
|
import { ResponseWithData } from "./types.js";
|
|
5
|
-
declare const make: import("../global.js").Effect<import("../Log/index.js").Log | import("
|
|
5
|
+
declare const make: import("../global.js").Effect<import("../Log/index.js").Log | import("dfx/RateLimitStore/index").RateLimiter | import("dfx/RateLimitStore/index").RateLimitStore | import("../DiscordConfig/index.js").DiscordConfig, never, {
|
|
6
6
|
request: <A = unknown>(path: string, init?: RequestInit) => import("../global.js").Effect<never, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, ResponseWithData<A>>;
|
|
7
7
|
}>;
|
|
8
8
|
export interface DiscordREST extends Success<typeof make> {
|
|
9
9
|
}
|
|
10
10
|
export declare const DiscordREST: import("../global.js").Tag<DiscordREST>;
|
|
11
|
-
export declare const LiveDiscordREST: import("../global.js").Layer<import("../Log/index.js").Log | import("
|
|
11
|
+
export declare const LiveDiscordREST: import("../global.js").Layer<import("../Log/index.js").Log | import("dfx/RateLimitStore/index").RateLimiter | import("dfx/RateLimitStore/index").RateLimitStore | import("../DiscordConfig/index.js").DiscordConfig, never, DiscordREST>;
|
|
12
12
|
export declare const rest: import("../types.js").Endpoints<RequestInit>;
|
|
13
13
|
export {};
|
package/gateway.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export * as Gateway from "./DiscordGateway/index.js";
|
|
|
7
7
|
export { run as runIx } from "./Interactions/gateway.js";
|
|
8
8
|
export declare const LiveRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore>;
|
|
9
9
|
export declare const LiveREST: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore | import("./index.js").DiscordREST>;
|
|
10
|
-
export declare const LiveGateway: import("./global.js").Layer<import("./Log/index.js").Log | import("./
|
|
10
|
+
export declare const LiveGateway: import("./global.js").Layer<import("./Log/index.js").Log | import("./RateLimitStore/index.js").RateLimiter | import("./DiscordConfig/index.js").DiscordConfig | import("./index.js").DiscordREST, never, import("./DiscordGateway/DiscordWS/index.js").DiscordWSCodec | import("./DiscordGateway/ShardStore/index.js").ShardStore | import("./DiscordGateway/index.js").DiscordGateway>;
|
|
11
11
|
export declare const LiveBot: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./DiscordGateway/DiscordWS/index.js").DiscordWSCodec | import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore | import("./DiscordGateway/ShardStore/index.js").ShardStore | import("./index.js").DiscordREST | import("./DiscordGateway/index.js").DiscordGateway>;
|
|
12
|
-
export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./DiscordGateway/DiscordWS/index.js").DiscordWSCodec | import("./
|
|
12
|
+
export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./DiscordGateway/DiscordWS/index.js").DiscordWSCodec | import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore | import("./DiscordConfig/index.js").DiscordConfig | import("./DiscordGateway/ShardStore/index.js").ShardStore | import("./index.js").DiscordREST | import("./DiscordGateway/index.js").DiscordGateway>;
|
package/global.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import type { Effect } from "@effect/io/Effect";
|
|
|
6
6
|
* @tsplus global
|
|
7
7
|
*/
|
|
8
8
|
import type { Layer } from "@effect/io/Layer";
|
|
9
|
+
/**
|
|
10
|
+
* @tsplus global
|
|
11
|
+
*/
|
|
12
|
+
import type { Dequeue, Queue } from "@effect/io/Queue";
|
|
9
13
|
/**
|
|
10
14
|
* @tsplus global
|
|
11
15
|
*/
|
|
@@ -84,6 +88,7 @@ import type { Success } from "dfx/utils/effect";
|
|
|
84
88
|
import { pipe, flow, identity } from "@fp-ts/data/Function";
|
|
85
89
|
export type { Effect } from "@effect/io/Effect";
|
|
86
90
|
export type { Layer } from "@effect/io/Layer";
|
|
91
|
+
export type {} from "@effect/io/Queue";
|
|
87
92
|
export { Context, Tag } from "@fp-ts/data/Context";
|
|
88
93
|
export type { Duration } from "@fp-ts/data/Duration";
|
|
89
94
|
export type { Ref } from "@effect/io/Ref";
|
package/global.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAW,GAAG,EAAE,MAAM,qBAAqB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/installer/compiler/typescript.tgz"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"callbag-effect-ts": "1.0.0-alpha.
|
|
31
|
+
"callbag-effect-ts": "1.0.0-alpha.20",
|
|
32
32
|
"ts-toolbelt": "^9.6.0",
|
|
33
33
|
"tweetnacl": "^1.0.3"
|
|
34
34
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@fp-ts/data": "^0.0.20"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "54a64aa821495f1c1ad02ba1d270e19a7110abf5"
|
|
52
52
|
}
|
package/webhooks.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import { MakeConfigOpts } from "./Interactions/webhook.js";
|
|
|
3
3
|
export { makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./Interactions/webhook.js";
|
|
4
4
|
export declare const LiveRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore>;
|
|
5
5
|
export declare const LiveREST: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore | import("./index.js").DiscordREST>;
|
|
6
|
-
export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./
|
|
6
|
+
export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./RateLimitStore/index.js").RateLimiter | import("./RateLimitStore/index.js").RateLimitStore | import("./DiscordConfig/index.js").DiscordConfig | import("./index.js").DiscordREST | import("./Interactions/webhook.js").WebhookConfig>;
|