dfx 0.42.6 → 0.42.7
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.
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "dfx/_common";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Layer";
|
|
3
|
-
import * as tsplus_module_3 from "@effect/
|
|
4
|
-
import * as tsplus_module_4 from "@effect/io/
|
|
5
|
-
import * as tsplus_module_5 from "@effect/io/Effect";
|
|
6
|
-
import * as tsplus_module_6 from "@effect/io/Ref";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Effect";
|
|
4
|
+
import * as tsplus_module_4 from "@effect/io/Ref";
|
|
7
5
|
import { LiveWS, Reconnect, WS, } from "dfx/DiscordGateway/WS";
|
|
8
6
|
export const DiscordWSCodec = tsplus_module_1.Tag();
|
|
9
7
|
export const LiveJsonDiscordWSCodec = tsplus_module_2.succeed(DiscordWSCodec, {
|
|
@@ -11,14 +9,14 @@ export const LiveJsonDiscordWSCodec = tsplus_module_2.succeed(DiscordWSCodec, {
|
|
|
11
9
|
encode: p => JSON.stringify(p),
|
|
12
10
|
decode: p => JSON.parse(p.toString("utf8")),
|
|
13
11
|
});
|
|
14
|
-
const make =
|
|
15
|
-
const connect = ({ url = "wss://gateway.discord.gg/", version = 10, outbound, onReconnect, }) =>
|
|
16
|
-
const setUrl = (url) =>
|
|
17
|
-
const takeOutbound =
|
|
18
|
-
return
|
|
19
|
-
const take =
|
|
20
|
-
const run =
|
|
21
|
-
(_._tag === "WebSocketError" && _.reason === "open-timeout"))
|
|
12
|
+
const make = tsplus_module_3.flatMap(WS, ws => tsplus_module_3.map(DiscordWSCodec, encoding => {
|
|
13
|
+
const connect = ({ url = "wss://gateway.discord.gg/", version = 10, outbound, onReconnect, }) => tsplus_module_3.flatMap(tsplus_module_4.make(`${url}?v=${version}&encoding=${encoding.type}`), urlRef => {
|
|
14
|
+
const setUrl = (url) => tsplus_module_4.set(urlRef, `${url}?v=${version}&encoding=${encoding.type}`);
|
|
15
|
+
const takeOutbound = tsplus_module_3.map(outbound, a => a === Reconnect ? a : encoding.encode(a));
|
|
16
|
+
return tsplus_module_3.map(ws.connect(urlRef, takeOutbound, onReconnect), socket => {
|
|
17
|
+
const take = tsplus_module_3.map(socket.take, encoding.decode);
|
|
18
|
+
const run = tsplus_module_3.retryWhile(socket.run, _ => (_._tag === "WebSocketCloseError" && _.code < 2000) ||
|
|
19
|
+
(_._tag === "WebSocketError" && _.reason === "open-timeout"));
|
|
22
20
|
return {
|
|
23
21
|
run,
|
|
24
22
|
take,
|
|
@@ -29,5 +27,5 @@ const make = tsplus_module_5.flatMap(WS, ws => tsplus_module_5.map(DiscordWSCode
|
|
|
29
27
|
return { connect };
|
|
30
28
|
}));
|
|
31
29
|
export const DiscordWS = tsplus_module_1.Tag();
|
|
32
|
-
export const LiveDiscordWS = tsplus_module_2.provide(
|
|
30
|
+
export const LiveDiscordWS = tsplus_module_2.provide(tsplus_module_3.toLayer(make, DiscordWS))(LiveWS);
|
|
33
31
|
//# sourceMappingURL=DiscordWS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordWS.js","sourceRoot":"","sources":["../src/DiscordGateway/DiscordWS.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiscordWS.js","sourceRoot":"","sources":["../src/DiscordGateway/DiscordWS.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EACL,MAAM,EACN,SAAS,EACT,EAAE,GAGH,MAAM,uBAAuB,CAAA;AAkB9B,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAA,GAAG,EAAkB,CAAA;AACnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAc,cAAc,EAAE;IAClE,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,C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,CAAA;GAC3B,CAAA;AAGF,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAA,GAAG,EAAa,CAAA;AACzC,MAAM,CAAC,MAAM,aAAa,2BAAa,wBAAA,IAAI,EAAS,SAAS,CAAC,EAAjC,MAAM,CAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"ws": "^8.13.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "737667fa756e695e8de6ee42fb395d75679801a1"
|
|
52
52
|
}
|
|
@@ -51,12 +51,10 @@ const make = Do($ => {
|
|
|
51
51
|
const socket = $(ws.connect(urlRef, takeOutbound, onReconnect))
|
|
52
52
|
const take = socket.take.map(encoding.decode)
|
|
53
53
|
|
|
54
|
-
const run = socket.run.
|
|
55
|
-
|
|
56
|
-
(_
|
|
57
|
-
|
|
58
|
-
(_._tag === "WebSocketError" && _.reason === "open-timeout"),
|
|
59
|
-
),
|
|
54
|
+
const run = socket.run.retryWhile(
|
|
55
|
+
_ =>
|
|
56
|
+
(_._tag === "WebSocketCloseError" && _.code < 2000) ||
|
|
57
|
+
(_._tag === "WebSocketError" && _.reason === "open-timeout"),
|
|
60
58
|
)
|
|
61
59
|
|
|
62
60
|
return {
|
package/src/package.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dfx",
|
|
3
|
-
"version": "0.42.6",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public",
|
|
7
|
-
"directory": "dist"
|
|
8
|
-
},
|
|
9
|
-
"description": "Effect-TS discord library",
|
|
10
|
-
"author": "Tim Smart <hello@timsmart.co>",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/tim-smart/dfx.git"
|
|
14
|
-
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"prepublishOnly": "make build",
|
|
18
|
-
"types": "discord-api-codegen ./discord-api-docs -l typescript -o 'imports=RestResponse|dfx/DiscordREST/types' 'endpointReturnType=RestResponse' > src/types.ts && prettier -w src/types.ts"
|
|
19
|
-
},
|
|
20
|
-
"exports": {
|
|
21
|
-
".": "./index.js",
|
|
22
|
-
"./gateway": "./gateway.js",
|
|
23
|
-
"./webhooks": "./webhooks.js",
|
|
24
|
-
"./*": "./*.js"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@tim-smart/discord-api-docs-parser": "^0.5.2",
|
|
28
|
-
"@tsplus-types/effect__data": "0.12.2-3b576ba",
|
|
29
|
-
"@tsplus-types/effect__io": "0.25.8-3b576ba",
|
|
30
|
-
"@tsplus-types/effect__stream": "0.21.1-3b576ba",
|
|
31
|
-
"@types/ws": "^8.5.4",
|
|
32
|
-
"dotenv": "^16.0.3",
|
|
33
|
-
"lerna": "^6.6.1",
|
|
34
|
-
"madge": "^6.0.0",
|
|
35
|
-
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/installer@0.0.171/compiler/typescript.tgz"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@effect-http/client": "^0.24.2",
|
|
39
|
-
"@effect/data": "^0.12.2",
|
|
40
|
-
"@effect/io": "~0.25.8",
|
|
41
|
-
"@effect/stream": "~0.21.1",
|
|
42
|
-
"tweetnacl": "^1.0.3"
|
|
43
|
-
},
|
|
44
|
-
"optionalDependencies": {
|
|
45
|
-
"bufferutil": "^4.0.7",
|
|
46
|
-
"isomorphic-ws": "^5.0.0",
|
|
47
|
-
"utf-8-validate": "^6.0.3",
|
|
48
|
-
"ws": "^8.13.0"
|
|
49
|
-
},
|
|
50
|
-
"sideEffects": false,
|
|
51
|
-
"gitHead": "e2c2735d0cc2e6e0aa38477a22becfd795cd24c3"
|
|
52
|
-
}
|