dfx 0.20.5 → 0.21.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/Cache/driver.d.ts +16 -16
- package/Cache/driver.js.map +1 -1
- package/Cache/index.d.ts +21 -21
- package/Cache/index.js +12 -13
- package/Cache/index.js.map +1 -1
- package/Cache/memory.d.ts +3 -3
- package/Cache/memory.js +19 -20
- package/Cache/memory.js.map +1 -1
- package/Cache/memoryTTL.d.ts +5 -5
- package/Cache/memoryTTL.js +16 -16
- package/Cache/memoryTTL.js.map +1 -1
- package/Cache/prelude.d.ts +41 -41
- package/Cache/prelude.js +39 -41
- package/Cache/prelude.js.map +1 -1
- package/DiscordConfig/index.d.ts +4 -19
- package/DiscordConfig/index.js +5 -12
- package/DiscordConfig/index.js.map +1 -1
- package/DiscordGateway/DiscordWS/index.d.ts +9 -9
- package/DiscordGateway/DiscordWS/index.js +16 -20
- package/DiscordGateway/DiscordWS/index.js.map +1 -1
- package/DiscordGateway/Shard/heartbeats.d.ts +3 -4
- package/DiscordGateway/Shard/heartbeats.js +9 -16
- package/DiscordGateway/Shard/heartbeats.js.map +1 -1
- package/DiscordGateway/Shard/identify.d.ts +4 -4
- package/DiscordGateway/Shard/identify.js +5 -4
- package/DiscordGateway/Shard/identify.js.map +1 -1
- package/DiscordGateway/Shard/index.d.ts +8 -7
- package/DiscordGateway/Shard/index.js +17 -20
- package/DiscordGateway/Shard/index.js.map +1 -1
- package/DiscordGateway/Shard/invalidSession.d.ts +2 -3
- package/DiscordGateway/Shard/invalidSession.js +5 -8
- package/DiscordGateway/Shard/invalidSession.js.map +1 -1
- package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
- package/DiscordGateway/Shard/sendEvents.js +7 -7
- package/DiscordGateway/Shard/sendEvents.js.map +1 -1
- package/DiscordGateway/Shard/utils.d.ts +3 -4
- package/DiscordGateway/Shard/utils.js +6 -6
- package/DiscordGateway/Shard/utils.js.map +1 -1
- package/DiscordGateway/ShardStore/index.d.ts +6 -6
- package/DiscordGateway/ShardStore/index.js +7 -10
- package/DiscordGateway/ShardStore/index.js.map +1 -1
- package/DiscordGateway/Sharder/index.d.ts +11 -11
- package/DiscordGateway/Sharder/index.js +21 -42
- package/DiscordGateway/Sharder/index.js.map +1 -1
- package/DiscordGateway/WS/index.d.ts +3 -2
- package/DiscordGateway/WS/index.js +30 -40
- package/DiscordGateway/WS/index.js.map +1 -1
- package/DiscordGateway/index.d.ts +8 -9
- package/DiscordGateway/index.js +10 -15
- package/DiscordGateway/index.js.map +1 -1
- package/DiscordREST/index.d.ts +132 -132
- package/DiscordREST/index.js +37 -40
- package/DiscordREST/index.js.map +1 -1
- package/DiscordREST/types.d.ts +6 -6
- package/DiscordREST/utils.d.ts +5 -4
- package/DiscordREST/utils.js +5 -5
- package/DiscordREST/utils.js.map +1 -1
- package/Helpers/intents.js +8 -8
- package/Helpers/intents.js.map +1 -1
- package/Helpers/interactions.d.ts +18 -19
- package/Helpers/interactions.js +22 -23
- package/Helpers/interactions.js.map +1 -1
- package/Helpers/members.d.ts +2 -2
- package/Helpers/members.js.map +1 -1
- package/Helpers/permissions.d.ts +4 -4
- package/Helpers/permissions.js +13 -13
- package/Helpers/permissions.js.map +1 -1
- package/Http/index.d.ts +10 -9
- package/Http/index.js +7 -8
- package/Http/index.js.map +1 -1
- package/Interactions/context.d.ts +22 -23
- package/Interactions/context.js +21 -21
- package/Interactions/context.js.map +1 -1
- package/Interactions/definitions.d.ts +31 -31
- package/Interactions/definitions.js +1 -2
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/gateway.d.ts +4 -3
- package/Interactions/gateway.js +6 -6
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.d.ts +3 -4
- package/Interactions/handlers.js +23 -23
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/index.d.ts +11 -11
- package/Interactions/index.js +11 -10
- package/Interactions/index.js.map +1 -1
- package/Interactions/webhook.d.ts +7 -8
- package/Interactions/webhook.js +11 -12
- package/Interactions/webhook.js.map +1 -1
- package/Log/index.d.ts +8 -7
- package/Log/index.js +9 -11
- package/Log/index.js.map +1 -1
- package/RateLimit/index.d.ts +13 -12
- package/RateLimit/index.js +11 -12
- package/RateLimit/index.js.map +1 -1
- package/RateLimit/memory.d.ts +1 -1
- package/RateLimit/memory.js +7 -7
- package/RateLimit/memory.js.map +1 -1
- package/RateLimit/utils.d.ts +2 -2
- package/RateLimit/utils.js.map +1 -1
- package/_common.d.ts +19 -0
- package/_common.js +20 -0
- package/_common.js.map +1 -0
- package/gateway.d.ts +11 -10
- package/gateway.js +17 -14
- package/gateway.js.map +1 -1
- package/package.json +6 -16
- package/utils/effect.d.ts +8 -8
- package/utils/effect.js +4 -4
- package/utils/effect.js.map +1 -1
- package/webhooks.d.ts +6 -5
- package/webhooks.js +12 -8
- package/webhooks.js.map +1 -1
- package/global.d.ts +0 -21
- package/global.js +0 -2
- package/global.js.map +0 -1
- package/utils/common.d.ts +0 -18
- package/utils/common.js +0 -3
- package/utils/common.js.map +0 -1
package/Cache/prelude.js
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as tsplus_module_7 from "dfx/gateway";
|
|
8
|
-
import { make, makeWithParent, CacheMissError, } from "./index.js";
|
|
1
|
+
import * as tsplus_module_1 from "@effect/stream/Stream";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
+
import { DiscordREST } from "dfx";
|
|
4
|
+
import { Gateway } from "dfx/gateway";
|
|
5
|
+
import { Effect, Stream } from "dfx/_common";
|
|
6
|
+
import { CacheMissError, make, makeWithParent, } from "./index.js";
|
|
9
7
|
export const opsWithParent = ({ id, fromParent, create, update, remove, parentRemove, }) => {
|
|
10
|
-
const fromParentOps =
|
|
8
|
+
const fromParentOps = tsplus_module_1.flatMap(([parentId, a]) => Stream.fromIterable(a.map((resource) => ({
|
|
11
9
|
op: "create",
|
|
12
10
|
parentId,
|
|
13
11
|
resourceId: id(resource),
|
|
14
12
|
resource,
|
|
15
13
|
}))))(fromParent);
|
|
16
|
-
const createOps =
|
|
14
|
+
const createOps = tsplus_module_1.map(([parentId, resource]) => ({
|
|
17
15
|
op: "create",
|
|
18
16
|
parentId,
|
|
19
17
|
resourceId: id(resource),
|
|
20
18
|
resource,
|
|
21
19
|
}))(create);
|
|
22
|
-
const updateOps =
|
|
20
|
+
const updateOps = tsplus_module_1.map(([parentId, resource]) => ({
|
|
23
21
|
op: "update",
|
|
24
22
|
parentId,
|
|
25
23
|
resourceId: id(resource),
|
|
26
24
|
resource,
|
|
27
25
|
}))(update);
|
|
28
|
-
const removeOps =
|
|
26
|
+
const removeOps = tsplus_module_1.map(([parentId, resourceId]) => ({
|
|
29
27
|
op: "delete",
|
|
30
28
|
parentId,
|
|
31
29
|
resourceId,
|
|
32
30
|
}))(remove);
|
|
33
|
-
const parentRemoveOps =
|
|
31
|
+
const parentRemoveOps = tsplus_module_1.map((parentId) => ({
|
|
34
32
|
op: "parentDelete",
|
|
35
33
|
parentId,
|
|
36
34
|
}))(parentRemove);
|
|
37
|
-
return
|
|
35
|
+
return tsplus_module_1.merge(parentRemoveOps)(tsplus_module_1.merge(removeOps)(tsplus_module_1.merge(updateOps)(tsplus_module_1.merge(createOps)(fromParentOps))));
|
|
38
36
|
};
|
|
39
37
|
export const ops = ({ id, create, update, remove }) => {
|
|
40
|
-
const createOps =
|
|
38
|
+
const createOps = tsplus_module_1.map((resource) => ({
|
|
41
39
|
op: "create",
|
|
42
40
|
resourceId: id(resource),
|
|
43
41
|
resource,
|
|
44
42
|
}))(create);
|
|
45
|
-
const updateOps =
|
|
43
|
+
const updateOps = tsplus_module_1.map((resource) => ({
|
|
46
44
|
op: "update",
|
|
47
45
|
resourceId: id(resource),
|
|
48
46
|
resource,
|
|
49
47
|
}))(update);
|
|
50
|
-
const removeOps =
|
|
48
|
+
const removeOps = tsplus_module_1.map((resourceId) => ({
|
|
51
49
|
op: "delete",
|
|
52
50
|
resourceId,
|
|
53
51
|
}))(remove);
|
|
54
|
-
return
|
|
52
|
+
return tsplus_module_1.merge(removeOps)(tsplus_module_1.merge(updateOps)(createOps));
|
|
55
53
|
};
|
|
56
|
-
export const guilds = (makeDriver) =>
|
|
54
|
+
export const guilds = (makeDriver) => tsplus_module_2.flatMap(driver => tsplus_module_2.flatMap(gateway => tsplus_module_2.map(rest => make({
|
|
57
55
|
driver,
|
|
58
56
|
ops: ops({
|
|
59
57
|
id: (g) => g.id,
|
|
60
|
-
create:
|
|
58
|
+
create: tsplus_module_1.map((g) => ({
|
|
61
59
|
...g,
|
|
62
60
|
channels: [],
|
|
63
61
|
roles: [],
|
|
@@ -65,44 +63,44 @@ export const guilds = (makeDriver) => tsplus_module_5.flatMap(driver => tsplus_m
|
|
|
65
63
|
members: [],
|
|
66
64
|
}))(gateway.fromDispatch("GUILD_CREATE")),
|
|
67
65
|
update: gateway.fromDispatch("GUILD_UPDATE"),
|
|
68
|
-
remove:
|
|
66
|
+
remove: tsplus_module_1.map((a) => a.id)(gateway.fromDispatch("GUILD_DELETE")),
|
|
69
67
|
}),
|
|
70
|
-
onMiss: (id) =>
|
|
71
|
-
}))(
|
|
72
|
-
export const channels = (makeDriver) =>
|
|
68
|
+
onMiss: (id) => tsplus_module_2.flatMap((r) => r.json)(rest.getGuild(id)),
|
|
69
|
+
}))(Effect.service(DiscordREST)))(Effect.service(Gateway.DiscordGateway)))(makeDriver);
|
|
70
|
+
export const channels = (makeDriver) => tsplus_module_2.flatMap(driver => tsplus_module_2.flatMap(gateway => tsplus_module_2.map(rest => makeWithParent({
|
|
73
71
|
driver,
|
|
74
72
|
ops: opsWithParent({
|
|
75
73
|
id: (a) => a.id,
|
|
76
|
-
fromParent:
|
|
74
|
+
fromParent: tsplus_module_1.map((g) => [g.id, g.channels])(gateway
|
|
77
75
|
.fromDispatch("GUILD_CREATE")),
|
|
78
|
-
create:
|
|
76
|
+
create: tsplus_module_1.map((c) => [c.guild_id, c])(gateway
|
|
79
77
|
.fromDispatch("CHANNEL_CREATE")),
|
|
80
|
-
update:
|
|
78
|
+
update: tsplus_module_1.map((c) => [c.guild_id, c])(gateway
|
|
81
79
|
.fromDispatch("CHANNEL_UPDATE")),
|
|
82
|
-
remove:
|
|
80
|
+
remove: tsplus_module_1.map((a) => [a.guild_id, a.id])(gateway
|
|
83
81
|
.fromDispatch("CHANNEL_DELETE")),
|
|
84
|
-
parentRemove:
|
|
82
|
+
parentRemove: tsplus_module_1.map((g) => g.id)(gateway.fromDispatch("GUILD_DELETE")),
|
|
85
83
|
}),
|
|
86
|
-
onMiss: (id) =>
|
|
87
|
-
onParentMiss: (guildId) =>
|
|
84
|
+
onMiss: (id) => tsplus_module_2.flatMap((r) => r.json)(rest.getChannel(id)),
|
|
85
|
+
onParentMiss: (guildId) => tsplus_module_2.map((a) => a.map((a) => [a.id, a]))(tsplus_module_2.flatMap((r) => r.json)(rest
|
|
88
86
|
.getGuildChannels(guildId))),
|
|
89
|
-
}))(
|
|
90
|
-
export const roles = (makeDriver) =>
|
|
87
|
+
}))(Effect.service(DiscordREST)))(Effect.service(Gateway.DiscordGateway)))(makeDriver);
|
|
88
|
+
export const roles = (makeDriver) => tsplus_module_2.flatMap(driver => tsplus_module_2.flatMap(gateway => tsplus_module_2.map(rest => makeWithParent({
|
|
91
89
|
driver,
|
|
92
90
|
ops: opsWithParent({
|
|
93
91
|
id: (a) => a.id,
|
|
94
|
-
fromParent:
|
|
92
|
+
fromParent: tsplus_module_1.map((g) => [g.id, g.roles])(gateway
|
|
95
93
|
.fromDispatch("GUILD_CREATE")),
|
|
96
|
-
create:
|
|
94
|
+
create: tsplus_module_1.map((r) => [r.guild_id, r.role])(gateway
|
|
97
95
|
.fromDispatch("GUILD_ROLE_CREATE")),
|
|
98
|
-
update:
|
|
96
|
+
update: tsplus_module_1.map((r) => [r.guild_id, r.role])(gateway
|
|
99
97
|
.fromDispatch("GUILD_ROLE_UPDATE")),
|
|
100
|
-
remove:
|
|
98
|
+
remove: tsplus_module_1.map((a) => [a.guild_id, a.role_id])(gateway
|
|
101
99
|
.fromDispatch("GUILD_ROLE_DELETE")),
|
|
102
|
-
parentRemove:
|
|
100
|
+
parentRemove: tsplus_module_1.map((g) => g.id)(gateway.fromDispatch("GUILD_DELETE")),
|
|
103
101
|
}),
|
|
104
|
-
onMiss: (id) =>
|
|
105
|
-
onParentMiss: (guildId) =>
|
|
102
|
+
onMiss: (id) => Effect.fail(new CacheMissError("RolesCache", id)),
|
|
103
|
+
onParentMiss: (guildId) => tsplus_module_2.map((a) => a.map((a) => [a.id, a]))(tsplus_module_2.flatMap((r) => r.json)(rest
|
|
106
104
|
.getGuildRoles(guildId))),
|
|
107
|
-
}))(
|
|
105
|
+
}))(Effect.service(DiscordREST)))(Effect.service(Gateway.DiscordGateway)))(makeDriver);
|
|
108
106
|
//# sourceMappingURL=prelude.js.map
|
package/Cache/prelude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../src/Cache/prelude.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../src/Cache/prelude.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAW,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAEL,cAAc,EAEd,IAAI,EACJ,cAAc,GAGf,MAAM,YAAY,CAAA;AAWnB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAO,EAClC,EAAE,EACF,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,YAAY,GACgB,EAAE,EAAE;IAChC,MAAM,aAAa,GAAG,wB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B,OAAO;aACZ,YAAY,CAAC,mBAAmB,CAAC,CACD;QACnC,MAAM,EAAE,oBAED,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,EAF1B,OAAO;aACZ,YAAY,CAAC,mBAAmB,CAAC,CACD;QACnC,MAAM,EAAE,oBAED,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAF7B,OAAO;aACZ,YAAY,CAAC,mBAAmB,CAAC,CACE;QACtC,YAAY,EAAE,oBAAyC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAApD,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAiB;KACpE,CAAC;IACF,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACjE,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CACxB,oBAGO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAHrC,wBAEW,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAFxB,IAAI;SACD,aAAa,CAAC,OAAO,CAAC,CACA,CACa;CACzC,CAAC,EA1Ba,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GADxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GADvC,UAAU,CA6B3B,CAAA"}
|
package/DiscordConfig/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Duration } from "dfx/
|
|
2
|
-
import { Discord } from "dfx";
|
|
1
|
+
import { Context, Discord, Duration, Layer } from "dfx/_common";
|
|
3
2
|
export interface DiscordConfig {
|
|
4
3
|
token: string;
|
|
5
4
|
rest: {
|
|
6
5
|
baseUrl: string;
|
|
7
6
|
globalRateLimit: {
|
|
8
7
|
limit: number;
|
|
9
|
-
window: Duration;
|
|
8
|
+
window: Duration.Duration;
|
|
10
9
|
};
|
|
11
10
|
};
|
|
12
11
|
gateway: {
|
|
@@ -16,25 +15,11 @@ export interface DiscordConfig {
|
|
|
16
15
|
identifyRateLimit: readonly [window: number, limit: number];
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
|
-
export declare const DiscordConfig:
|
|
18
|
+
export declare const DiscordConfig: Context.Tag<DiscordConfig>;
|
|
20
19
|
export interface MakeOpts {
|
|
21
20
|
token: string;
|
|
22
21
|
rest?: Partial<DiscordConfig["rest"]>;
|
|
23
22
|
gateway?: Partial<DiscordConfig["gateway"]>;
|
|
24
23
|
}
|
|
25
24
|
export declare const make: ({ token, rest, gateway }: MakeOpts) => DiscordConfig;
|
|
26
|
-
export declare const makeLayer: (a_0: MakeOpts) =>
|
|
27
|
-
export declare const token: import("../utils/common.js").Effect<DiscordConfig, never, string>;
|
|
28
|
-
export declare const rest: import("../utils/common.js").Effect<DiscordConfig, never, {
|
|
29
|
-
baseUrl: string;
|
|
30
|
-
globalRateLimit: {
|
|
31
|
-
limit: number;
|
|
32
|
-
window: Duration;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
35
|
-
export declare const gateway: import("../utils/common.js").Effect<DiscordConfig, never, {
|
|
36
|
-
intents: number;
|
|
37
|
-
presence?: import("../types.js").UpdatePresence | undefined;
|
|
38
|
-
shardCount?: number | undefined;
|
|
39
|
-
identifyRateLimit: readonly [window: number, limit: number];
|
|
40
|
-
}>;
|
|
25
|
+
export declare const makeLayer: (a_0: MakeOpts) => Layer.Layer<never, never, DiscordConfig>;
|
package/DiscordConfig/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as tsplus_module_2 from "@fp-ts/data/Duration";
|
|
3
|
-
import * as tsplus_module_3 from "dfx";
|
|
4
|
-
import * as tsplus_module_4 from "@effect/io/Layer";
|
|
5
|
-
import * as tsplus_module_5 from "@effect/io/Effect";
|
|
1
|
+
import { Context, Discord, Duration, flow, Layer } from "dfx/_common";
|
|
6
2
|
const VERSION = 10;
|
|
7
|
-
export const DiscordConfig =
|
|
3
|
+
export const DiscordConfig = Context.Tag();
|
|
8
4
|
export const make = ({ token, rest, gateway }) => ({
|
|
9
5
|
token,
|
|
10
6
|
rest: {
|
|
@@ -12,18 +8,15 @@ export const make = ({ token, rest, gateway }) => ({
|
|
|
12
8
|
...(rest ?? {}),
|
|
13
9
|
globalRateLimit: {
|
|
14
10
|
limit: 50,
|
|
15
|
-
window:
|
|
11
|
+
window: Duration.seconds(1),
|
|
16
12
|
...(rest?.globalRateLimit ?? {}),
|
|
17
13
|
},
|
|
18
14
|
},
|
|
19
15
|
gateway: {
|
|
20
|
-
intents:
|
|
16
|
+
intents: Discord.GatewayIntents.GUILDS,
|
|
21
17
|
identifyRateLimit: [5000, 1],
|
|
22
18
|
...(gateway ?? {}),
|
|
23
19
|
},
|
|
24
20
|
});
|
|
25
|
-
export const makeLayer =
|
|
26
|
-
export const token = tsplus_module_5.serviceWith(DiscordConfig)(({ token }) => token);
|
|
27
|
-
export const rest = tsplus_module_5.serviceWith(DiscordConfig)(({ rest }) => rest);
|
|
28
|
-
export const gateway = tsplus_module_5.serviceWith(DiscordConfig)(({ gateway }) => gateway);
|
|
21
|
+
export const makeLayer = flow(make, Layer.succeed(DiscordConfig));
|
|
29
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordConfig/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordConfig/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAU,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE7E,MAAM,OAAO,GAAG,EAAE,CAAA;AAmBlB,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAiB,CAAA;AAQzD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAY,EAAiB,EAAE,CAAC,CAAC;IAC1E,KAAK;IACL,IAAI,EAAE;QACJ,OAAO,EAAE,4BAA4B,OAAO,EAAE;QAC9C,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACf,eAAe,EAAE;YACf,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3B,GAAG,CAAC,IAAI,EAAE,eAAe,IAAI,EAAE,CAAC;SACjC;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,MAAM;QACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC5B,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;KACnB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAA"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/// <reference types="ws" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Effect, EffectSource } from "dfx/utils/common";
|
|
2
|
+
import { Log } from "dfx/Log/index";
|
|
3
|
+
import { Context, Discord, Effect, Layer, Stream } from "dfx/_common";
|
|
5
4
|
import WebSocket from "isomorphic-ws";
|
|
5
|
+
import * as WS from "../WS/index.js";
|
|
6
6
|
export type Message = Discord.GatewayPayload | WS.Reconnect;
|
|
7
7
|
export interface OpenOpts {
|
|
8
8
|
url?: string;
|
|
9
9
|
version?: number;
|
|
10
10
|
encoding?: DiscordWSCodec;
|
|
11
|
-
outbound: Effect<never, never, Message>;
|
|
11
|
+
outbound: Effect.Effect<never, never, Message>;
|
|
12
12
|
}
|
|
13
13
|
export interface DiscordWSCodec {
|
|
14
14
|
type: "json" | "etf";
|
|
15
15
|
encode: (p: Discord.GatewayPayload) => string;
|
|
16
16
|
decode: (p: WebSocket.Data) => Discord.GatewayPayload;
|
|
17
17
|
}
|
|
18
|
-
export declare const DiscordWSCodec:
|
|
19
|
-
export declare const LiveJsonDiscordWSCodec:
|
|
20
|
-
export declare const make: ({ url, version, outbound, }: OpenOpts) =>
|
|
21
|
-
source:
|
|
22
|
-
setUrl: (url: string) =>
|
|
18
|
+
export declare const DiscordWSCodec: Context.Tag<DiscordWSCodec>;
|
|
19
|
+
export declare const LiveJsonDiscordWSCodec: Layer.Layer<never, never, DiscordWSCodec>;
|
|
20
|
+
export declare const make: ({ url, version, outbound, }: OpenOpts) => Effect.Effect<Log | DiscordWSCodec, never, {
|
|
21
|
+
source: Stream.Stream<never, never, Discord.GatewayPayload<any>>;
|
|
22
|
+
setUrl: (url: string) => Effect.Effect<never, never, void>;
|
|
23
23
|
}>;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "@effect/io/
|
|
3
|
-
import * as tsplus_module_3 from "@
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
|
|
8
|
-
|
|
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";
|
|
12
|
-
export const DiscordWSCodec = tsplus_module_1.Tag();
|
|
13
|
-
export const LiveJsonDiscordWSCodec = tsplus_module_2.succeed(DiscordWSCodec)({
|
|
1
|
+
import * as tsplus_module_1 from "@effect/stream/Stream";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Ref";
|
|
4
|
+
import { Log } from "dfx/Log/index";
|
|
5
|
+
import { Context, Duration, Effect, Layer, Ref, Schedule, Stream, } from "dfx/_common";
|
|
6
|
+
import * as WS from "../WS/index.js";
|
|
7
|
+
export const DiscordWSCodec = Context.Tag();
|
|
8
|
+
export const LiveJsonDiscordWSCodec = Layer.succeed(DiscordWSCodec)({
|
|
14
9
|
type: "json",
|
|
15
10
|
encode: (p) => JSON.stringify(p),
|
|
16
11
|
decode: (p) => JSON.parse(p.toString("utf8")),
|
|
17
12
|
});
|
|
18
|
-
export const make = ({ url = "wss://gateway.discord.gg/", version = 10, outbound, }) =>
|
|
19
|
-
const setUrl = (url) =>
|
|
20
|
-
const take =
|
|
21
|
-
return
|
|
22
|
-
const
|
|
13
|
+
export const make = ({ url = "wss://gateway.discord.gg/", version = 10, outbound, }) => tsplus_module_2.flatMap(encoding => tsplus_module_2.flatMap(urlRef => {
|
|
14
|
+
const setUrl = (url) => tsplus_module_3.set(`${url}?v=${version}&encoding=${encoding.type}`)(urlRef);
|
|
15
|
+
const take = tsplus_module_2.map((a) => a === WS.Reconnect ? a : encoding.encode(a))(outbound);
|
|
16
|
+
return tsplus_module_2.map(log => {
|
|
17
|
+
const ws = Stream.provideService(Log)(log)(WS.make(urlRef, take));
|
|
18
|
+
const source = tsplus_module_1.map(encoding.decode)(tsplus_module_1.retry(Schedule.exponential(Duration.seconds(0.5)))(tsplus_module_1.tapError((e) => log.info("DiscordWS", "ERROR", e))(ws)));
|
|
23
19
|
return { source, setUrl };
|
|
24
|
-
})(
|
|
25
|
-
})(
|
|
20
|
+
})(Effect.service(Log));
|
|
21
|
+
})(Ref.make(`${url}?v=${version}&encoding=${encoding.type}`)))(Effect.service(DiscordWSCodec));
|
|
26
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/DiscordWS/index.ts"],"names":[],"mappings":"
|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,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;QACjE,MAAM,MAAM,GAAG,oBAGR,QAAQ,CAAC,MAAM,EAHP,sBAEN,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAFrC,yBACH,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,EADrC,EAAE,CACoC,CACA,CAKpD,CAAA;QAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;OAXX,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;GANhB,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,MAAM,OAAO,aAAa,QAAQ,CAAC,IAAI,EAAE,CAAC,GADvD,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAmBjD,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export declare const fromRaw: <R, E>(source: import("callbag-effect-ts/Source").EffectSource<R, E, import("../../types.js").GatewayPayload<any>>, seqRef: Ref<Maybe<number>>) => import("callbag-effect-ts/Source").EffectSource<R, E, import("../DiscordWS/index.js").Message>;
|
|
1
|
+
import { Discord, Option, Ref, Stream } from "dfx/_common";
|
|
2
|
+
import * as DiscordWS from "../DiscordWS/index.js";
|
|
3
|
+
export declare const fromRaw: <R, E>(source: Stream.Stream<R, E, Discord.GatewayPayload<any>>, seqRef: Ref.Ref<Option.Option<number>>) => Stream.Stream<R, E, DiscordWS.Message>;
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Ref";
|
|
2
2
|
import * as tsplus_module_2 from "@fp-ts/data/Option";
|
|
3
3
|
import * as tsplus_module_3 from "@effect/io/Effect";
|
|
4
|
-
import * as tsplus_module_4 from "
|
|
4
|
+
import * as tsplus_module_4 from "@effect/stream/Stream";
|
|
5
5
|
import * as tsplus_module_5 from "@effect/io/Schedule";
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
import * as tsplus_module_8 from "callbag-effect-ts/Source/tap";
|
|
9
|
-
import * as tsplus_module_9 from "callbag-effect-ts/Source/switchMap";
|
|
10
|
-
import * as tsplus_module_10 from "callbag-effect-ts/Source/mapEffect";
|
|
11
|
-
import * as tsplus_module_11 from "callbag-effect-ts/Source/drain";
|
|
12
|
-
import * as tsplus_module_12 from "callbag-effect-ts/Source/merge";
|
|
13
|
-
import * as tsplus_module_13 from "callbag-effect-ts/Source/unwrap";
|
|
14
|
-
import { millis } from "@fp-ts/data/Duration";
|
|
6
|
+
import { Discord, Duration, Effect, pipe, Ref, Schedule, Stream, } from "dfx/_common";
|
|
7
|
+
import * as WS from "../WS/index.js";
|
|
15
8
|
import * as SendEvents from "./sendEvents.js";
|
|
16
9
|
import * as Utils from "./utils.js";
|
|
17
10
|
const send = (ref, seqRef) => tsplus_module_3.tap(() => tsplus_module_1.set(false)(ref))(tsplus_module_3.map((a) => SendEvents.heartbeat(tsplus_module_2.getOrNull(a)))(tsplus_module_1.get(seqRef)));
|
|
18
|
-
const maybeSend = (ref, seqRef) => tsplus_module_3.flatMap((acked) => acked ? send(ref, seqRef) :
|
|
19
|
-
export const fromRaw = (source, seqRef) =>
|
|
20
|
-
const heartbeats =
|
|
21
|
-
const acks =
|
|
22
|
-
return
|
|
23
|
-
})(
|
|
11
|
+
const maybeSend = (ref, seqRef) => tsplus_module_3.flatMap((acked) => acked ? send(ref, seqRef) : Effect.succeed(WS.Reconnect))(tsplus_module_1.get(ref));
|
|
12
|
+
export const fromRaw = (source, seqRef) => pipe(tsplus_module_3.map((ackedRef) => {
|
|
13
|
+
const heartbeats = tsplus_module_4.mapEffect(() => maybeSend(ackedRef, seqRef))(pipe(tsplus_module_4.tap(() => tsplus_module_1.set(true)(ackedRef))(Utils.opCode(source)(Discord.GatewayOpcode.HELLO)), Stream.flatMapParSwitch(1)((p) => Stream.fromSchedule(tsplus_module_5.andThen(Schedule.spaced(Duration.millis(p.d.heartbeat_interval)))(Schedule.duration(Duration.millis(p.d.heartbeat_interval * Math.random())))))));
|
|
14
|
+
const acks = tsplus_module_4.drain(tsplus_module_4.tap(() => tsplus_module_1.set(true)(ackedRef))(Utils.opCode(source)(Discord.GatewayOpcode.HEARTBEAT_ACK)));
|
|
15
|
+
return tsplus_module_4.merge(acks)(heartbeats);
|
|
16
|
+
})(Ref.make(true)), Stream.unwrap);
|
|
24
17
|
//# sourceMappingURL=heartbeats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeats.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/heartbeats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heartbeats.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/heartbeats.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EAEN,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,MAAM,GACP,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAEnC,MAAM,IAAI,GAAG,CAAC,GAAqB,EAAE,MAAsC,EAAE,EAAE,CAC7E,oBAEO,GAAG,EAAE,CAAC,oBAAQ,KAAK,EAAb,GAAG,CAAW,EAF3B,oBACO,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,2BAAC,CAAC,EAAW,sBAD/C,MAAM,EAC0C,CACpB,CAAA;AAE9B,MAAM,SAAS,GAAG,CAChB,GAAqB,EACrB,MAAsC,EACtC,EAAE,CACF,wBACE,CAAC,KAAK,EAAkD,EAAE,CACxD,KA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MAAM,CACd,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Discord } from "dfx";
|
|
2
|
-
import {
|
|
2
|
+
import { Option, Ref, Stream } from "dfx/_common";
|
|
3
3
|
export interface Options {
|
|
4
4
|
token: string;
|
|
5
5
|
intents: number;
|
|
@@ -7,7 +7,7 @@ export interface Options {
|
|
|
7
7
|
presence?: Discord.UpdatePresence;
|
|
8
8
|
}
|
|
9
9
|
export interface Requirements {
|
|
10
|
-
latestReady: Ref<
|
|
11
|
-
latestSequence: Ref<
|
|
10
|
+
latestReady: Ref.Ref<Option.Option<Discord.ReadyEvent>>;
|
|
11
|
+
latestSequence: Ref.Ref<Option.Option<number>>;
|
|
12
12
|
}
|
|
13
|
-
export declare const fromRaw: <R, E>(source:
|
|
13
|
+
export declare const fromRaw: <R, E>(source: Stream.Stream<R, E, Discord.GatewayPayload<any>>, { latestReady, latestSequence, ...opts }: Options & Requirements) => Stream.Stream<R, E, Discord.GatewayPayload<any>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fp-ts/data/Option";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Ref";
|
|
3
3
|
import * as tsplus_module_3 from "@effect/io/Effect";
|
|
4
|
-
import * as tsplus_module_4 from "
|
|
5
|
-
import * as tsplus_module_5 from "callbag-effect-ts/Source/mapEffect";
|
|
4
|
+
import * as tsplus_module_4 from "@effect/stream/Stream";
|
|
6
5
|
import * as SendEvents from "./sendEvents.js";
|
|
7
6
|
import * as OS from "os";
|
|
8
7
|
import { opCode } from "./utils.js";
|
|
8
|
+
import { Discord } from "dfx";
|
|
9
|
+
import { Option } from "dfx/_common";
|
|
9
10
|
const identify = ({ token, intents, shard, presence }) => SendEvents.identify({
|
|
10
11
|
token,
|
|
11
12
|
intents,
|
|
@@ -22,9 +23,9 @@ const resume = (token, ready, seq) => SendEvents.resume({
|
|
|
22
23
|
session_id: ready.session_id,
|
|
23
24
|
seq,
|
|
24
25
|
});
|
|
25
|
-
const identifyOrResume = (opts, ready, seq) => tsplus_module_3.flatMap(readyEvent => tsplus_module_3.map(seqNumber => tsplus_module_1.match(() => identify(opts), ({ readyEvent, seqNumber }) => resume(opts.token, readyEvent, seqNumber))(
|
|
26
|
+
const identifyOrResume = (opts, ready, seq) => tsplus_module_3.flatMap(readyEvent => tsplus_module_3.map(seqNumber => tsplus_module_1.match(() => identify(opts), ({ readyEvent, seqNumber }) => resume(opts.token, readyEvent, seqNumber))(Option.struct({
|
|
26
27
|
readyEvent,
|
|
27
28
|
seqNumber,
|
|
28
29
|
})))(tsplus_module_2.get(seq)))(tsplus_module_2.get(ready));
|
|
29
|
-
export const fromRaw = (source, { latestReady, latestSequence, ...opts }) =>
|
|
30
|
+
export const fromRaw = (source, { latestReady, latestSequence, ...opts }) => tsplus_module_4.mapEffect(() => identifyOrResume(opts, latestReady, latestSequence))(opCode(source)(Discord.GatewayOpcode.HELLO));
|
|
30
31
|
//# sourceMappingURL=identify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/identify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"identify.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/identify.ts"],"names":[],"mappings":";;;;AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAA;AAcjD,MAAM,QAAQ,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAW,EAAE,EAAE,CAChE,UAAU,CAAC,QAAQ,CAAC;IAClB,KAAK;IACL,OAAO;IACP,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE;QACjB,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;KACd;IACD,KAAK;IACL,QAAQ;CACT,CAAC,CAAA;AAEJ,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,KAAyB,EAAE,GAAW,EAAE,EAAE,CACvE,UAAU,CAAC,MAAM,CAAC;IAChB,KAAK;IACL,UAAU,EAAE,KAAK,CAAC,UAAU;IAC5B,GAAG;CACJ,CAAC,CAAA;AAEJ,MAAM,gBAAgB,GAAG,CACvB,IAAa,EACb,KAAiD,EACjD,GAAmC,EACnC,EAAE,yBAEM,UAAU,wBACV,SAAS,IAER,sBAIL,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EACpB,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EALnE,MAAM,CAAC,MAAM,CAAC;IACnB,UAAU;IACV,SAAS;CACV,CAAC,CAGD,sBARmB,GAAG,wBADF,KAAK,EAU1B,CAAA;AAEJ,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,MAAmD,EACnD,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAI,EAA0B,EAChE,EAAE,CACF,0BACE,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,EAD3D,MAAM,CAAC,MAAM,CAAC,CAAqB,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAE9D,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Config, RateLimiter } from "dfx";
|
|
1
2
|
import { DiscordWS } from "dfx/gateway";
|
|
2
|
-
import { Discord } from "dfx";
|
|
3
|
-
export declare const make: (shard: [id: number, count: number]) =>
|
|
4
|
-
run:
|
|
5
|
-
raw:
|
|
6
|
-
dispatch:
|
|
7
|
-
send: (p: Discord.GatewayPayload) =>
|
|
8
|
-
reconnect:
|
|
3
|
+
import { Discord, Effect, Scope, Stream } from "dfx/_common";
|
|
4
|
+
export declare const make: (shard: [id: number, count: number]) => Effect.Effect<Scope.Scope | Config.DiscordConfig | import("../../Log/index.js").Log | RateLimiter | DiscordWS.DiscordWSCodec, never, {
|
|
5
|
+
run: Effect.Effect<never, never, void>;
|
|
6
|
+
raw: Stream.Stream<never, never, Discord.GatewayPayload<any>>;
|
|
7
|
+
dispatch: Stream.Stream<never, never, Discord.GatewayPayload<Discord.ReceiveEvent>>;
|
|
8
|
+
send: (p: Discord.GatewayPayload) => Effect.Effect<never, never, boolean>;
|
|
9
|
+
reconnect: Effect.Effect<never, never, boolean>;
|
|
9
10
|
}>;
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
-
import * as tsplus_module_2 from "
|
|
3
|
-
import * as tsplus_module_3 from "
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as tsplus_module_7 from "callbag-effect-ts/Source/run";
|
|
8
|
-
import * as tsplus_module_8 from "@fp-ts/data/Option";
|
|
9
|
-
import * as tsplus_module_9 from "callbag-effect-ts/Source/share";
|
|
10
|
-
import * as tsplus_module_10 from "@fp-ts/data/Duration";
|
|
11
|
-
import * as tsplus_module_11 from "@effect/io/Queue";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/stream/Stream";
|
|
3
|
+
import * as tsplus_module_3 from "@fp-ts/data/Option";
|
|
4
|
+
import { Config, RateLimiter } from "dfx";
|
|
5
|
+
import { DiscordWS, WS } from "dfx/gateway";
|
|
6
|
+
import { Discord, Duration, Effect, Option, Queue, Scope, Stream, } from "dfx/_common";
|
|
12
7
|
import * as Heartbeats from "./heartbeats.js";
|
|
13
8
|
import * as Identify from "./identify.js";
|
|
14
9
|
import * as InvalidSession from "./invalidSession.js";
|
|
15
10
|
import * as Utils from "./utils.js";
|
|
11
|
+
const _scope = Scope.Tag;
|
|
12
|
+
const _stream = Stream.StreamTypeId;
|
|
16
13
|
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("dfx.shard.send",
|
|
14
|
+
const outbound = tsplus_module_1.tap(() => limiter.maybeWait("dfx.shard.send", Duration.minutes(1), 120))(outboundQueue
|
|
18
15
|
.take());
|
|
19
16
|
const send = (p) => outboundQueue.offer(p);
|
|
20
17
|
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) =>
|
|
22
|
-
const updateRefs =
|
|
18
|
+
const maybeUpdateUrl = (p) => tsplus_module_3.match(() => Effect.unit(), (a) => socket.setUrl(a.resume_gateway_url))(tsplus_module_3.map((p) => p.d)(tsplus_module_3.filter((p) => p.op === Discord.GatewayOpcode.DISPATCH && p.t === "READY")(Option.some(p))));
|
|
19
|
+
const updateRefs = tsplus_module_2.runDrain(tsplus_module_2.tap(maybeUpdateUrl)(tsplus_module_2.tap(updateLatestSequence)(tsplus_module_2.tap(updateLatestReady)(raw))));
|
|
23
20
|
// heartbeats
|
|
24
|
-
const heartbeatEffects =
|
|
25
|
-
const dispatch =
|
|
21
|
+
const heartbeatEffects = tsplus_module_2.runForEach(send)(Heartbeats.fromRaw(raw, latestSequence));
|
|
22
|
+
const dispatch = tsplus_module_2.filter((p) => p.op === Discord.GatewayOpcode.DISPATCH)(raw);
|
|
26
23
|
// identify
|
|
27
|
-
const identifyEffects =
|
|
24
|
+
const identifyEffects = tsplus_module_2.runForEach(send)(Identify.fromRaw(raw, {
|
|
28
25
|
token,
|
|
29
26
|
shard,
|
|
30
27
|
intents: gateway.intents,
|
|
@@ -33,14 +30,14 @@ export const make = (shard) => tsplus_module_1.flatMap(({ token, gateway }) => t
|
|
|
33
30
|
latestReady,
|
|
34
31
|
}));
|
|
35
32
|
// invalid session
|
|
36
|
-
const invalidEffects =
|
|
33
|
+
const invalidEffects = tsplus_module_2.runForEach(send)(InvalidSession.fromRaw(raw, latestReady));
|
|
37
34
|
return {
|
|
38
35
|
run: tsplus_module_1.asUnit(tsplus_module_1.zipPar(invalidEffects)(tsplus_module_1.zipPar(identifyEffects)(tsplus_module_1.zipPar(heartbeatEffects)(updateRefs)))),
|
|
39
36
|
raw,
|
|
40
37
|
dispatch,
|
|
41
38
|
send: (p) => send(p),
|
|
42
|
-
reconnect: send(
|
|
39
|
+
reconnect: send(WS.Reconnect),
|
|
43
40
|
};
|
|
44
|
-
})(Utils.latest((p) =>
|
|
45
|
-
})(
|
|
41
|
+
})(Utils.latest((p) => Option.fromNullable(p.s))))(Utils.latest((p) => tsplus_module_3.map((p) => p.d)(tsplus_module_3.filter((p) => p.op === Discord.GatewayOpcode.DISPATCH && p.t === "READY")(Option.some(p))))))(tsplus_module_2.broadcastDynamic(1)(socket.source)))(DiscordWS.make({ outbound }));
|
|
42
|
+
})(Queue.unbounded()))(Effect.service(RateLimiter)))(Effect.service(Config.DiscordConfig));
|
|
46
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/DiscordGateway/Shard/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,aAAa,CAAA;AACpB,OAAO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AAE,EAAE,CAAC,CAAC,CAAC,CAAE,EALlB,uBAEI,CAAC,CAAC,EAAmD,EAAE,CACrD,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,aAAa,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAHhE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAIX,CACgB,CACpB,GAVW,iCAA+B,CAAC,EAAhC,MAAM,CAAC,MAAM,CAAoB,GAF9B,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;GANrB,KAAK,CAAC,SAAS,EAAqB,GAF1C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GADhB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CA8EjE,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EffectSource, Ref, Maybe } from "dfx/utils/common";
|
|
2
|
-
import { Discord } from "dfx";
|
|
3
1
|
import { DiscordWS } from "dfx/gateway";
|
|
4
|
-
|
|
2
|
+
import { Discord, Option, Ref, Stream } from "dfx/_common";
|
|
3
|
+
export declare const fromRaw: <R, E>(raw: Stream.Stream<R, E, Discord.GatewayPayload<any>>, latestReady: Ref.Ref<Option.Option<Discord.ReadyEvent>>) => Stream.Stream<R, E, DiscordWS.Message>;
|