dfx 0.18.1 → 0.18.2
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/gateway.d.ts +15 -15
- package/Cache/gateway.js +26 -34
- package/Cache/gateway.js.map +1 -1
- package/Cache/index.d.ts +10 -10
- package/Cache/index.js.map +1 -1
- package/Cache/prelude.d.ts +13 -13
- package/Cache/prelude.js +18 -16
- package/Cache/prelude.js.map +1 -1
- package/DiscordGateway/DiscordWS/index.d.ts +1 -1
- package/DiscordGateway/Shard/index.d.ts +1 -1
- package/DiscordGateway/Sharder/index.d.ts +14 -6
- package/DiscordGateway/Sharder/index.js +48 -47
- package/DiscordGateway/Sharder/index.js.map +1 -1
- package/DiscordGateway/index.d.ts +3 -11
- package/DiscordGateway/index.js +3 -7
- package/DiscordGateway/index.js.map +1 -1
- package/DiscordREST/index.d.ts +4 -4
- package/DiscordREST/index.js +61 -61
- package/DiscordREST/index.js.map +1 -1
- package/DiscordREST/types.d.ts +1 -2
- package/Http/index.d.ts +14 -7
- package/Http/index.js +17 -10
- package/Http/index.js.map +1 -1
- package/Interactions/gateway.d.ts +1 -1
- package/Interactions/gateway.js +7 -7
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/index.d.ts +4 -2
- package/Interactions/index.js +17 -10
- package/Interactions/index.js.map +1 -1
- package/gateway.d.ts +6 -5
- package/gateway.js +10 -5
- package/gateway.js.map +1 -1
- package/global.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/webhooks.d.ts +3 -3
- package/webhooks.js +4 -3
- package/webhooks.js.map +1 -1
package/DiscordREST/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "@
|
|
3
|
-
import * as tsplus_module_3 from "@fp-ts/data/
|
|
4
|
-
import * as tsplus_module_4 from "
|
|
1
|
+
import * as tsplus_module_1 from "dfx";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
+
import * as tsplus_module_3 from "@fp-ts/data/Duration";
|
|
4
|
+
import * as tsplus_module_4 from "@fp-ts/data/Option";
|
|
5
5
|
import * as tsplus_module_5 from "@fp-ts/data/HashSet";
|
|
6
6
|
import * as tsplus_module_6 from "@effect/io/Ref";
|
|
7
7
|
import * as tsplus_module_7 from "@fp-ts/data/Context";
|
|
@@ -9,41 +9,41 @@ import * as tsplus_module_8 from "@effect/io/Layer";
|
|
|
9
9
|
import { millis } from "@fp-ts/data/Duration";
|
|
10
10
|
import { rateLimitFromHeaders, routeFromConfig, retryAfter } from "./utils.js";
|
|
11
11
|
import Pkg from "../package.json" assert { type: "json" };
|
|
12
|
-
const make =
|
|
12
|
+
const make = tsplus_module_2.flatMap(http => tsplus_module_2.flatMap(({ token, rest }) => tsplus_module_2.flatMap(log => tsplus_module_2.flatMap(store => tsplus_module_2.flatMap(({ maybeWait }) => {
|
|
13
13
|
const globalRateLimit = maybeWait("dfx.rest.global", rest.globalRateLimit.window, rest.globalRateLimit.limit);
|
|
14
|
-
return
|
|
15
|
-
const addBadRoute = (route) =>
|
|
14
|
+
return tsplus_module_2.map(badRoutesRef => {
|
|
15
|
+
const addBadRoute = (route) => tsplus_module_2.collectAllParDiscard([
|
|
16
16
|
log.info("DiscordREST", "addBadRoute", route),
|
|
17
17
|
tsplus_module_6.update((s) => tsplus_module_5.add(route)(s))(badRoutesRef),
|
|
18
|
-
store.incrementCounter("dfx.rest.invalid",
|
|
18
|
+
store.incrementCounter("dfx.rest.invalid", tsplus_module_3.minutes(10).millis, 10000),
|
|
19
19
|
]);
|
|
20
|
-
const isBadRoute = (route) =>
|
|
20
|
+
const isBadRoute = (route) => tsplus_module_2.map((s) => tsplus_module_5.has(route)(s))(tsplus_module_6.get(badRoutesRef));
|
|
21
21
|
const removeBadRoute = (route) => tsplus_module_6.update((s) => tsplus_module_5.remove(route)(s))(badRoutesRef);
|
|
22
|
-
const invalidRateLimit = (route) =>
|
|
23
|
-
? maybeWait("dfx.rest.invalid",
|
|
24
|
-
:
|
|
22
|
+
const invalidRateLimit = (route) => tsplus_module_2.asUnit(tsplus_module_2.tap((invalid) => invalid
|
|
23
|
+
? maybeWait("dfx.rest.invalid", tsplus_module_3.minutes(10), 10000)
|
|
24
|
+
: tsplus_module_2.unit())(isBadRoute(route)));
|
|
25
25
|
// Request rate limiting
|
|
26
26
|
const requestRateLimit = (path, init) => (() => {
|
|
27
27
|
const route = routeFromConfig(path, init);
|
|
28
|
-
return
|
|
29
|
-
const bucket =
|
|
28
|
+
return tsplus_module_2.flatMap(maybeBucket => {
|
|
29
|
+
const bucket = tsplus_module_4.getOrElse(() => ({
|
|
30
30
|
key: `?.${route}`,
|
|
31
31
|
resetAfter: 5000,
|
|
32
32
|
limit: 1,
|
|
33
33
|
}))(maybeBucket);
|
|
34
34
|
const resetAfter = millis(bucket.resetAfter);
|
|
35
|
-
return
|
|
35
|
+
return tsplus_module_2.flatMap(() => tsplus_module_2.map(() => void 0)(maybeWait(`dfx.rest.${bucket.key}`, resetAfter, bucket.limit)))(invalidRateLimit(route));
|
|
36
36
|
})(store.getBucketForRoute(route));
|
|
37
37
|
})();
|
|
38
38
|
// Update rate limit buckets
|
|
39
|
-
const updateBuckets = (path, init, response) =>
|
|
39
|
+
const updateBuckets = (path, init, response) => tsplus_module_2.ignore((() => {
|
|
40
40
|
const route = routeFromConfig(path, init);
|
|
41
|
-
return
|
|
41
|
+
return tsplus_module_2.flatMap(({ bucket, retryAfter, limit, remaining }) => {
|
|
42
42
|
const effectsToRun = [
|
|
43
43
|
removeBadRoute(route),
|
|
44
44
|
store.putBucketRoute(route, bucket),
|
|
45
45
|
];
|
|
46
|
-
return
|
|
46
|
+
return tsplus_module_2.flatMap(hasBucket => {
|
|
47
47
|
if (!hasBucket || limit - 1 === remaining) {
|
|
48
48
|
effectsToRun.push(store.putBucket({
|
|
49
49
|
key: bucket,
|
|
@@ -51,28 +51,28 @@ const make = tsplus_module_1.flatMap(({ token, rest }) => tsplus_module_1.flatMa
|
|
|
51
51
|
limit: !hasBucket && remaining > 0 ? remaining : limit,
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return tsplus_module_2.map(() => void 0)(tsplus_module_2.collectAllParDiscard(effectsToRun));
|
|
55
55
|
})(store.hasBucket(bucket));
|
|
56
|
-
})(
|
|
56
|
+
})(tsplus_module_2.fromOption(rateLimitFromHeaders(response.headers)));
|
|
57
57
|
})());
|
|
58
|
-
const request = (path, init = {}) =>
|
|
58
|
+
const request = (path, init = {}) => tsplus_module_2.catchTag("StatusCodeError", (e) => {
|
|
59
59
|
switch (e.code) {
|
|
60
60
|
case 403:
|
|
61
|
-
return
|
|
61
|
+
return tsplus_module_2.flatMap(() => tsplus_module_2.fail(e))(tsplus_module_2.collectAllParDiscard([
|
|
62
62
|
log.info("DiscordREST", "403", path),
|
|
63
63
|
addBadRoute(routeFromConfig(path, init)),
|
|
64
64
|
updateBuckets(path, init, e.response),
|
|
65
65
|
]));
|
|
66
66
|
case 429:
|
|
67
|
-
return
|
|
67
|
+
return tsplus_module_2.flatMap(() => request(path, init))(tsplus_module_2.collectAllParDiscard([
|
|
68
68
|
log.info("DiscordREST", "429", path),
|
|
69
69
|
addBadRoute(routeFromConfig(path, init)),
|
|
70
70
|
updateBuckets(path, init, e.response),
|
|
71
|
-
|
|
71
|
+
tsplus_module_2.sleep(tsplus_module_4.getOrElse(() => tsplus_module_3.seconds(5))(retryAfter(e.response.headers))),
|
|
72
72
|
]));
|
|
73
73
|
}
|
|
74
|
-
return
|
|
75
|
-
})(
|
|
74
|
+
return tsplus_module_2.fail(e);
|
|
75
|
+
})(tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(() => tsplus_module_2.flatMap(response => tsplus_module_2.map(() => response)(updateBuckets(path, init, response.response)))(http.requestWithJson(`${rest.baseUrl}${path}`, {
|
|
76
76
|
...init,
|
|
77
77
|
headers: {
|
|
78
78
|
...(init?.headers ?? {}),
|
|
@@ -80,42 +80,42 @@ const make = tsplus_module_1.flatMap(({ token, rest }) => tsplus_module_1.flatMa
|
|
|
80
80
|
"User-Agent": `DiscordBot (https://github.com/tim-smart/dfx, ${Pkg.version})`,
|
|
81
81
|
},
|
|
82
82
|
})))(globalRateLimit))(requestRateLimit(path, init)));
|
|
83
|
-
|
|
83
|
+
const routes = tsplus_module_1.Discord.createRoutes(({ method, url, params, options = {}, }) => {
|
|
84
|
+
const hasBody = method !== "GET" && method !== "DELETE";
|
|
85
|
+
let hasFormData = typeof options?.body?.append === "function";
|
|
86
|
+
let body = undefined;
|
|
87
|
+
const headers = {};
|
|
88
|
+
if (hasBody && !hasFormData) {
|
|
89
|
+
headers["content-type"] = "application/json";
|
|
90
|
+
}
|
|
91
|
+
const qs = new URLSearchParams();
|
|
92
|
+
if (!hasBody) {
|
|
93
|
+
Object.entries((params ?? {})).forEach(([key, value]) => {
|
|
94
|
+
qs.append(key, value);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
else if (hasFormData) {
|
|
98
|
+
body = options.body;
|
|
99
|
+
if (params) {
|
|
100
|
+
;
|
|
101
|
+
body.append("payload_json", JSON.stringify(params));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (params) {
|
|
105
|
+
body = JSON.stringify(params);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
body = options.body;
|
|
109
|
+
}
|
|
110
|
+
return request(`${url}?${qs.toString()}`, {
|
|
111
|
+
method,
|
|
112
|
+
headers,
|
|
113
|
+
body,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
return { request, routes };
|
|
84
117
|
})(tsplus_module_6.make(tsplus_module_5.empty()));
|
|
85
|
-
})(
|
|
118
|
+
})(tsplus_module_2.service(tsplus_module_1.RateLimit.RateLimiter)))(tsplus_module_2.service(tsplus_module_1.RateLimit.RateLimitStore)))(tsplus_module_2.service(tsplus_module_1.Log.Log)))(tsplus_module_2.service(tsplus_module_1.Config.DiscordConfig)))(tsplus_module_2.service(tsplus_module_1.Http.Http));
|
|
86
119
|
export const DiscordREST = tsplus_module_7.Tag();
|
|
87
120
|
export const LiveDiscordREST = tsplus_module_8.fromEffect(DiscordREST)(make);
|
|
88
|
-
export const rest = tsplus_module_4.Discord.createRoutes(({ method, url, params, options = {} }) => tsplus_module_1.serviceWithEffect(DiscordREST)(({ request }) => {
|
|
89
|
-
const hasBody = method !== "GET" && method !== "DELETE";
|
|
90
|
-
let hasFormData = typeof options?.body?.append === "function";
|
|
91
|
-
let body = undefined;
|
|
92
|
-
const headers = {};
|
|
93
|
-
if (hasBody && !hasFormData) {
|
|
94
|
-
headers["content-type"] = "application/json";
|
|
95
|
-
}
|
|
96
|
-
const qs = new URLSearchParams();
|
|
97
|
-
if (!hasBody) {
|
|
98
|
-
Object.entries((params ?? {})).forEach(([key, value]) => {
|
|
99
|
-
qs.append(key, value);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
else if (hasFormData) {
|
|
103
|
-
body = options.body;
|
|
104
|
-
if (params) {
|
|
105
|
-
;
|
|
106
|
-
body.append("payload_json", JSON.stringify(params));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else if (params) {
|
|
110
|
-
body = JSON.stringify(params);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
body = options.body;
|
|
114
|
-
}
|
|
115
|
-
return request(`${url}?${qs.toString()}`, {
|
|
116
|
-
method,
|
|
117
|
-
headers,
|
|
118
|
-
body,
|
|
119
|
-
});
|
|
120
|
-
}));
|
|
121
121
|
//# sourceMappingURL=index.js.map
|
package/DiscordREST/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/DiscordREST/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,E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effect } from "@effect/io/Effect";
|
|
2
2
|
import { Http } from "dfx";
|
|
3
|
-
import { DiscordREST } from "./index.js";
|
|
4
3
|
export interface ResponseWithData<A> {
|
|
5
4
|
response: Response;
|
|
6
5
|
json: Effect<never, Http.JsonParseError, A>;
|
|
7
6
|
text: Effect<never, never, string>;
|
|
8
7
|
blob: Effect<never, Http.BlobError, Blob>;
|
|
9
8
|
}
|
|
10
|
-
export type RestResponse<T> = Effect<
|
|
9
|
+
export type RestResponse<T> = Effect<never, Http.FetchError | Http.StatusCodeError | Http.JsonParseError, ResponseWithData<T>>;
|
package/Http/index.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
declare const make: () => {
|
|
2
|
+
request: (url: URL | string, init?: RequestInit) => import("../global.js").Effect<never, FetchError | StatusCodeError, Response>;
|
|
3
|
+
requestWithJson: <A = unknown>(url: URL | string, init?: RequestInit) => import("../global.js").Effect<never, FetchError | StatusCodeError, {
|
|
4
|
+
response: Response;
|
|
5
|
+
json: import("../global.js").Effect<never, JsonParseError, A>;
|
|
6
|
+
blob: import("../global.js").Effect<never, BlobError, Blob>;
|
|
7
|
+
text: import("../global.js").Effect<never, never, string>;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export interface Http extends ReturnType<typeof make> {
|
|
11
|
+
}
|
|
12
|
+
export declare const Http: import("../global.js").Tag<Http>;
|
|
13
|
+
export declare const LiveHttp: import("../global.js").Layer<never, never, Http>;
|
|
1
14
|
export declare class FetchError {
|
|
2
15
|
readonly reason: unknown;
|
|
3
16
|
readonly _tag = "FetchError";
|
|
@@ -9,7 +22,6 @@ export declare class StatusCodeError {
|
|
|
9
22
|
readonly code: number;
|
|
10
23
|
constructor(response: Response);
|
|
11
24
|
}
|
|
12
|
-
export declare const request: (url: URL | string, init?: RequestInit) => import("../global.js").Effect<never, FetchError | StatusCodeError, Response>;
|
|
13
25
|
export declare class JsonParseError {
|
|
14
26
|
readonly reason: unknown;
|
|
15
27
|
readonly _tag = "JsonParseError";
|
|
@@ -22,9 +34,4 @@ export declare class BlobError {
|
|
|
22
34
|
constructor(reason: unknown);
|
|
23
35
|
}
|
|
24
36
|
export declare const blob: (r: Response) => import("../global.js").Effect<never, BlobError, Blob>;
|
|
25
|
-
export
|
|
26
|
-
response: Response;
|
|
27
|
-
json: import("../global.js").Effect<never, JsonParseError, A>;
|
|
28
|
-
blob: import("../global.js").Effect<never, BlobError, Blob>;
|
|
29
|
-
text: import("../global.js").Effect<never, never, string>;
|
|
30
|
-
}>;
|
|
37
|
+
export {};
|
package/Http/index.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
+
import * as tsplus_module_2 from "@fp-ts/data/Context";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Layer";
|
|
4
|
+
const make = () => {
|
|
5
|
+
const request = (url, init = {}) => tsplus_module_1.filterOrElseWith((r) => r.status < 300, (r) => tsplus_module_1.fail(new StatusCodeError(r)))(tsplus_module_1.tryCatchPromiseAbort((signal) => fetch(url, {
|
|
6
|
+
...init,
|
|
7
|
+
signal,
|
|
8
|
+
}), (e) => new FetchError(e)));
|
|
9
|
+
const requestWithJson = (url, init = {}) => tsplus_module_1.map((response) => ({
|
|
10
|
+
response,
|
|
11
|
+
json: json(response),
|
|
12
|
+
blob: blob(response),
|
|
13
|
+
text: tsplus_module_1.promise(() => response.text()),
|
|
14
|
+
}))(request(url, init));
|
|
15
|
+
return { request, requestWithJson };
|
|
16
|
+
};
|
|
17
|
+
export const Http = tsplus_module_2.Tag();
|
|
18
|
+
export const LiveHttp = tsplus_module_3.sync(Http)(make);
|
|
2
19
|
export class FetchError {
|
|
3
20
|
reason;
|
|
4
21
|
_tag = "FetchError";
|
|
@@ -15,10 +32,6 @@ export class StatusCodeError {
|
|
|
15
32
|
this.code = response.status;
|
|
16
33
|
}
|
|
17
34
|
}
|
|
18
|
-
export const request = (url, init = {}) => tsplus_module_1.filterOrElseWith((r) => r.status < 300, (r) => tsplus_module_1.fail(new StatusCodeError(r)))(tsplus_module_1.tryCatchPromiseAbort((signal) => fetch(url, {
|
|
19
|
-
...init,
|
|
20
|
-
signal,
|
|
21
|
-
}), (e) => new FetchError(e)));
|
|
22
35
|
export class JsonParseError {
|
|
23
36
|
reason;
|
|
24
37
|
_tag = "JsonParseError";
|
|
@@ -35,10 +48,4 @@ export class BlobError {
|
|
|
35
48
|
}
|
|
36
49
|
}
|
|
37
50
|
export const blob = (r) => tsplus_module_1.tryCatchPromise(() => r.blob(), (reason) => new BlobError(reason));
|
|
38
|
-
export const requestWithJson = (url, init = {}) => tsplus_module_1.map((response) => ({
|
|
39
|
-
response,
|
|
40
|
-
json: json(response),
|
|
41
|
-
blob: blob(response),
|
|
42
|
-
text: tsplus_module_1.promise(() => response.text()),
|
|
43
|
-
}))(request(url, init));
|
|
44
51
|
//# sourceMappingURL=index.js.map
|
package/Http/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Http/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Http/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,MAAM,OAAO,GAAG,CAAC,GAAiB,EAAE,OAAoB,EAAE,EAAE,EAAE,CAC5D,iCAQE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,EACrB,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAY,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,EAT5C,qCACE,CAAC,MAAM,EAAE,EAAE,CACT,KAAK,CAAC,GAAG,EAAE;QACT,GAAG,IAAI;QACP,MAAM;KACP,CAAC,EACJ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CACzB,CAGA,CAAA;IAEH,MAAM,eAA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O,SAAS;IAEC;IADZ,IAAI,GAAG,WAAW,CAAA;IAC3B,YAAqB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;CACzC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAW,EAAE,EAAE,CAClC,gCACE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAClC,CAAA"}
|
|
@@ -5,4 +5,4 @@ import { InteractionBuilder } from "./index.js";
|
|
|
5
5
|
export interface RunOpts {
|
|
6
6
|
sync?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../global.js").Effect<import("../
|
|
8
|
+
export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../global.js").Effect<import("../index.js").DiscordREST | import("../types.js").Interaction | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | DefinitionNotFound | E, void>) => import("../global.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../global.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
|
package/Interactions/gateway.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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 "
|
|
2
|
+
import * as tsplus_module_2 from "@fp-ts/data/Function";
|
|
3
|
+
import * as tsplus_module_3 from "dfx";
|
|
4
4
|
import * as tsplus_module_4 from "dfx/gateway";
|
|
5
5
|
import { handlers } from "./handlers.js";
|
|
6
6
|
import { InteractionContext } from "./index.js";
|
|
7
7
|
import { splitDefinitions } from "./utils.js";
|
|
8
8
|
export const run = (postHandler, { sync = true } = {}) => (ix) => (() => {
|
|
9
9
|
const { GlobalApplicationCommand, GuildApplicationCommand } = splitDefinitions(ix.definitions);
|
|
10
|
-
return tsplus_module_1.flatMap(application => {
|
|
11
|
-
const globalSync =
|
|
10
|
+
return tsplus_module_1.flatMap(gateway => tsplus_module_1.flatMap(({ routes: rest }) => tsplus_module_1.flatMap(application => {
|
|
11
|
+
const globalSync = rest.bulkOverwriteGlobalApplicationCommands(application.id, {
|
|
12
12
|
body: JSON.stringify(GlobalApplicationCommand.map((a) => a.command)),
|
|
13
13
|
});
|
|
14
14
|
const guildSync = GuildApplicationCommand.length
|
|
15
|
-
?
|
|
15
|
+
? gateway.handleDispatch("GUILD_CREATE", (a) => rest.bulkOverwriteGuildApplicationCommands(application.id, a.id, GuildApplicationCommand.map((a) => a.command)))
|
|
16
16
|
: tsplus_module_1.unit();
|
|
17
17
|
const handle = handlers(ix.definitions);
|
|
18
|
-
const run =
|
|
18
|
+
const run = gateway.handleDispatch("INTERACTION_CREATE", (i) => tsplus_module_2.pipe(tsplus_module_1.tap((r) => rest.createInteractionResponse(i.id, i.token, r))(handle[i.type](i)), postHandler, tsplus_module_1.provideService(InteractionContext)(i)));
|
|
19
19
|
return tsplus_module_1.map(() => void 0)(sync ? tsplus_module_1.zipPar(guildSync)(tsplus_module_1.zipPar(globalSync)(run)) : run);
|
|
20
|
-
})(tsplus_module_1.flatMap((a) => a.json)(
|
|
20
|
+
})(tsplus_module_1.flatMap((a) => a.json)(rest.getCurrentBotApplicationInformation())))(tsplus_module_1.service(tsplus_module_3.DiscordREST)))(tsplus_module_1.service(tsplus_module_4.Gateway.DiscordGateway));
|
|
21
21
|
})();
|
|
22
22
|
//# sourceMappingURL=gateway.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAsB,QAAQ,EAAE,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,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAC3C,IAAI,CAAC,qCAAqC,CACxC,WAAW,CAAC,EAAE,EACd,CAAC,CAAC,EAAE,EACJ,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAQ,CACrD,CACF;YACH,CAAC,CAAC,sBAAa,CAAA;QAEjB,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;QAEvC,MAAM,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC7D,gBAAA,IAAI,CACF,oBAAsB,CAAC,CAAC,EAAE,EAAE,CAC1B,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EADlD,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAEhB,EACD,WAAW,EACX,+BAAsB,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7C,CACF,CAAA;iDAEC,IAAI,CAAC,CAAC,CAAC,uBAA8B,SAAS,EAAvC,uBAAW,UAAU,EAArB,GAAG,CAAmB,CAAkB,CAAC,CAAC,CAAC,GAAG;OAhCrD,wBAAmD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAhE,IAAI,CAAC,mCAAmC,EAAE,CAAuB,GAHxC,wCAAe,WAAW,CAAC,GADpC,wBAAe,gBAAA,OAAO,CAAC,cAAc,CAAC;IAqCxD,CAAA"}
|
package/Interactions/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "@effect/io/Effect";
|
|
2
|
+
import { DiscordREST, Discord } from "dfx";
|
|
2
3
|
import * as D from "./definitions.js";
|
|
3
4
|
export * from "./context.js";
|
|
4
5
|
export { global, guild, messageComponent, modalSubmit, autocomplete, InteractionDefinition, } from "./definitions.js";
|
|
@@ -7,8 +8,9 @@ export declare class InteractionBuilder<R, E> {
|
|
|
7
8
|
readonly definitions: D.InteractionDefinition<R, E>[];
|
|
8
9
|
constructor(definitions: D.InteractionDefinition<R, E>[]);
|
|
9
10
|
add<R1, E1>(definition: D.InteractionDefinition<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
11
|
+
concat<R1, E1>(builder: InteractionBuilder<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
10
12
|
get syncGlobal(): import("../global.js").Effect<import("../index.js").DiscordREST, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
|
|
11
|
-
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../DiscordREST/types.js").
|
|
13
|
+
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../global.js").Effect<import("../index.js").DiscordREST, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<import("../types.js").ApplicationCommand[]>>;
|
|
12
14
|
}
|
|
13
15
|
export declare const builder: InteractionBuilder<never, never>;
|
|
14
16
|
export declare const id: (query: string) => (customId: string) => import("../global.js").Effect<never, never, boolean>;
|
package/Interactions/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "
|
|
1
|
+
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
+
import * as tsplus_module_2 from "dfx";
|
|
3
3
|
export * from "./context.js";
|
|
4
4
|
export { global, guild, messageComponent, modalSubmit, autocomplete, } from "./definitions.js";
|
|
5
5
|
export { response as r } from "../Helpers/interactions.js";
|
|
@@ -14,26 +14,33 @@ export class InteractionBuilder {
|
|
|
14
14
|
definition,
|
|
15
15
|
]);
|
|
16
16
|
}
|
|
17
|
+
concat(builder) {
|
|
18
|
+
return new InteractionBuilder([
|
|
19
|
+
...this.definitions,
|
|
20
|
+
...builder.definitions,
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
17
23
|
get syncGlobal() {
|
|
18
24
|
const commands = this.definitions
|
|
19
25
|
.filter((c) => c._tag === "GlobalApplicationCommand")
|
|
20
26
|
.map((c) => c.command);
|
|
21
|
-
return tsplus_module_2.flatMap((app) =>
|
|
27
|
+
return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)(({ routes }) => tsplus_module_1.flatMap((app) => routes.bulkOverwriteGlobalApplicationCommands(app.id, {
|
|
22
28
|
body: JSON.stringify(commands),
|
|
23
|
-
}))(
|
|
29
|
+
}))(tsplus_module_1.flatMap((r) => r.json)(routes
|
|
30
|
+
.getCurrentBotApplicationInformation())));
|
|
24
31
|
}
|
|
25
32
|
syncGuild(appId, guildId) {
|
|
26
33
|
const commands = this.definitions
|
|
27
34
|
.filter((c) => c._tag === "GuildApplicationCommand")
|
|
28
35
|
.map((c) => c.command);
|
|
29
|
-
return tsplus_module_1.
|
|
36
|
+
return tsplus_module_1.serviceWithEffect(tsplus_module_2.DiscordREST)(({ routes }) => routes.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
export const builder = new InteractionBuilder([]);
|
|
33
40
|
// Filters
|
|
34
|
-
export const id = (query) => (customId) =>
|
|
35
|
-
export const idStartsWith = (query) => (customId) =>
|
|
36
|
-
export const idRegex = (query) => (customId) =>
|
|
37
|
-
export const option = (command, optionName) => (data, focusedOption) =>
|
|
38
|
-
export const optionOnly = (optionName) => (_, focusedOption) =>
|
|
41
|
+
export const id = (query) => (customId) => tsplus_module_1.succeed(query === customId);
|
|
42
|
+
export const idStartsWith = (query) => (customId) => tsplus_module_1.succeed(customId.startsWith(query));
|
|
43
|
+
export const idRegex = (query) => (customId) => tsplus_module_1.succeed(query.test(customId));
|
|
44
|
+
export const option = (command, optionName) => (data, focusedOption) => tsplus_module_1.succeed(data.name === command && focusedOption.name === optionName);
|
|
45
|
+
export const optionOnly = (optionName) => (_, focusedOption) => tsplus_module_1.succeed(focusedOption.name === optionName);
|
|
39
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";;AAEA,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,GAEb,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAA;AAE1D,MAAM,OAAO,kBAAkB;IACR;IAArB,YAAqB,WAA4C;QAA5C,gBAAW,GAAX,WAAW,CAAiC;IAAG,CAAC;IAErE,GAAG,CAAS,UAA2C;QACrD,OAAO,IAAI,kBAAkB,CAAiB;YAC5C,GAAG,IAAI,CAAC,WAAW;YACnB,UAAU;SACX,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW;aAC9B,MAAM,CACL,CAAC,CAAC,EAAyC,EAAE,CAC3C,CAAC,CAAC,IAAI,KAAK,0BAA0B,CACxC;aACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";;AAEA,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,GAEb,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAA;AAE1D,MAAM,OAAO,kBAAkB;IACR;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AE,MAAM,EAAE,EAAE,EAAE,CAC1D,MAAM,CAAC,qCAAqC,CAC1C,KAAK,EACL,OAAO,EACP,QAAe,CAChB,CACF,CAAA;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAe,EAAE,CAAC,CAAA;AAE/D,UAAU;AACV,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE,CACxD,wBAAe,KAAK,KAAK,QAAQ,CAAC,CAAA;AAEpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE,CAClE,wBAAe,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;AAE5C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,EAAE,CAC7D,wBAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEtC,MAAM,CAAC,MAAM,MAAM,GACjB,CAAC,OAAe,EAAE,UAAkB,EAAE,EAAE,CACxC,CACE,IAAmD,EACnD,aAGC,EACD,EAAE,CACF,wBAAe,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,aAAa,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;AAE9E,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,UAAkB,EAAE,EAAE,CACvB,CACE,CAAU,EACV,aAGC,EACD,EAAE,CACF,wBAAe,aAAa,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA"}
|
package/gateway.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export * as Gateway from "./DiscordGateway/index.js";
|
|
|
7
7
|
export * as CacheOps from "./Cache/gateway.js";
|
|
8
8
|
export * as CachePrelude from "./Cache/prelude.js";
|
|
9
9
|
export { run as runIx } from "./Interactions/gateway.js";
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
10
|
+
export declare const MemoryRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter>;
|
|
11
|
+
export declare const MemoryREST: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST>;
|
|
12
|
+
export declare const MemorySharder: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./DiscordGateway/Sharder/index.js").Sharder>;
|
|
13
|
+
export declare const MemoryGateway: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./DiscordGateway/index.js").DiscordGateway>;
|
|
14
|
+
export declare const MemoryBot: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
|
|
15
|
+
export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig | import("./index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
|
package/gateway.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "dfx";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Layer";
|
|
3
3
|
import * as tsplus_module_3 from "dfx/gateway";
|
|
4
|
+
import { LiveJsonDiscordWSCodec } from "./DiscordGateway/DiscordWS/index.js";
|
|
5
|
+
import { LiveSharder } from "./DiscordGateway/Sharder/index.js";
|
|
6
|
+
import { LiveMemoryShardStore } from "./DiscordGateway/ShardStore/index.js";
|
|
7
|
+
import { LiveHttp } from "./Http/index.js";
|
|
4
8
|
export * as WS from "./DiscordGateway/WS/index.js";
|
|
5
9
|
export * as DiscordWS from "./DiscordGateway/DiscordWS/index.js";
|
|
6
10
|
export * as Shard from "./DiscordGateway/Shard/index.js";
|
|
@@ -9,14 +13,15 @@ export * as Gateway from "./DiscordGateway/index.js";
|
|
|
9
13
|
export * as CacheOps from "./Cache/gateway.js";
|
|
10
14
|
export * as CachePrelude from "./Cache/prelude.js";
|
|
11
15
|
export { run as runIx } from "./Interactions/gateway.js";
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
+
export const MemoryRateLimit = tsplus_module_2.provideToAndMerge(tsplus_module_1.RateLimit.LiveRateLimiter)(tsplus_module_1.RateLimit.LiveMemoryRateLimitStore);
|
|
17
|
+
export const MemoryREST = tsplus_module_2.provideTo(tsplus_module_1.LiveDiscordREST)((tsplus_module_2.merge(MemoryRateLimit)(LiveHttp)));
|
|
18
|
+
export const MemorySharder = tsplus_module_2.provideTo(LiveSharder)((tsplus_module_2.merge(LiveJsonDiscordWSCodec)(tsplus_module_2.merge(MemoryRateLimit)(tsplus_module_2.merge(LiveMemoryShardStore)(MemoryREST)))));
|
|
19
|
+
export const MemoryGateway = tsplus_module_2.provideTo(tsplus_module_3.Gateway.LiveDiscordGateway)(MemorySharder);
|
|
20
|
+
export const MemoryBot = tsplus_module_2.provideToAndMerge(tsplus_module_2.merge(MemoryRateLimit)(MemoryGateway))(MemoryREST);
|
|
16
21
|
export const make = (config, debug = false) => {
|
|
17
22
|
const LiveLog = debug ? tsplus_module_1.Log.LiveLogDebug : tsplus_module_1.Log.LiveLog;
|
|
18
23
|
const LiveConfig = tsplus_module_1.Config.makeLayer(config);
|
|
19
|
-
const LiveEnv = tsplus_module_2.provideToAndMerge(
|
|
24
|
+
const LiveEnv = tsplus_module_2.provideToAndMerge(MemoryBot)(tsplus_module_2.merge(LiveConfig)(LiveLog));
|
|
20
25
|
return LiveEnv;
|
|
21
26
|
};
|
|
22
27
|
//# sourceMappingURL=gateway.js.map
|
package/gateway.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAA;AACxD,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAClE,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAA;AACpD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,iCAAiC,CAAA;AACxD,OAAO,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAClE,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAA;AACpD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAExD,MAAM,CAAC,MAAM,eAAe,qCACW,gBAAA,SAAS,CAAC,eAAe,EAA9D,gBAAA,SAAS,CAAC,wBAAwB,CAA4B,CAAA;AAEhE,MAAM,CAAC,MAAM,UAAU,6CAAmC,eAAe,EAA/C,uBAAY,eAAe,EAA1B,QAAQ,EAAmB,CAAmB,CAAA;AAEzE,MAAM,CAAC,MAAM,aAAa,6BAKxB,WAAW,EAJX,uBAGE,sBAAsB,wBADtB,eAAe,wBADf,oBAAoB,EADrB,UAAU,IAGc,CACd,CAAA;AAEb,MAAM,CAAC,MAAM,aAAa,6BAAoB,gBAAA,OAAO,CAAC,kBAAkB,EAA3C,aAAa,CAA8B,CAAA;AAExE,MAAM,CAAC,MAAM,SAAS,2DAAgC,eAAe,EAA/B,aAAa,GAA1B,UAAU,CAAkC,CAAA;AAErE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAuB,EAAE,KAAK,GAAG,KAAK,EAAE,EAAE;IAC7D,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,gBAAA,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAA,GAAG,CAAC,OAAO,CAAA;IACtD,MAAM,UAAU,GAAG,gBAAA,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,OAAO,qCAA0B,SAAS,wBAAtB,UAAU,EAApB,OAAO,EAAyB,CAAA;IAEhD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/global.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ import type { HashSet } from "@fp-ts/data/HashSet";
|
|
|
69
69
|
/**
|
|
70
70
|
* @tsplus global
|
|
71
71
|
*/
|
|
72
|
-
import { RateLimit,
|
|
72
|
+
import { RateLimit, Discord, Http, DiscordREST, LiveDiscordREST, Ix, Config, Log, IxHelpers, Flags, Members, Cache, } from "dfx";
|
|
73
73
|
/**
|
|
74
74
|
* @tsplus global
|
|
75
75
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as Discord from "./types.js";
|
|
2
2
|
export * as Config from "./DiscordConfig/index.js";
|
|
3
3
|
export * as Http from "./Http/index.js";
|
|
4
|
-
export { DiscordREST, LiveDiscordREST
|
|
4
|
+
export { DiscordREST, LiveDiscordREST } from "./DiscordREST/index.js";
|
|
5
5
|
export * as Ix from "./Interactions/index.js";
|
|
6
6
|
export * as Log from "./Log/index.js";
|
|
7
7
|
export * as RateLimit from "./RateLimit/index.js";
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as Discord from "./types.js";
|
|
2
2
|
export * as Config from "./DiscordConfig/index.js";
|
|
3
3
|
export * as Http from "./Http/index.js";
|
|
4
|
-
export { DiscordREST, LiveDiscordREST
|
|
4
|
+
export { DiscordREST, LiveDiscordREST } from "./DiscordREST/index.js";
|
|
5
5
|
export * as Ix from "./Interactions/index.js";
|
|
6
6
|
export * as Log from "./Log/index.js";
|
|
7
7
|
export * as RateLimit from "./RateLimit/index.js";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC7C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAEzC,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@fp-ts/data": "^0.0.25"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "fc1f1e1001e30b05e8c36c75b0a98d1940d42d07"
|
|
53
53
|
}
|
package/webhooks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config } from "dfx";
|
|
2
2
|
import { MakeConfigOpts } from "./Interactions/webhook.js";
|
|
3
3
|
export { makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./Interactions/webhook.js";
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./
|
|
4
|
+
export declare const MemoryRateLimit: import("./global.js").Layer<import("./Log/index.js").Log, never, import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter>;
|
|
5
|
+
export declare const MemoryREST: import("./global.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST>;
|
|
6
|
+
export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./global.js").Layer<never, never, import("./index.js").DiscordREST | import("./RateLimit/index.js").RateLimitStore | import("./RateLimit/index.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
|