dfx 0.23.0 → 0.23.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/package.json +2 -2
- package/webhooks.d.ts +3 -3
- package/webhooks.js +11 -14
- package/webhooks.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"ws": "^8.12.1"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "dd848e717d2055b531b0110081c45af819ac4b2d"
|
|
56
56
|
}
|
package/webhooks.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DiscordConfig } from "dfx";
|
|
2
1
|
import { ConfigWrap } from "dfx/_common";
|
|
2
|
+
import { DiscordConfig } from "dfx";
|
|
3
3
|
import { MakeConfigOpts } from "./Interactions/webhook.js";
|
|
4
4
|
export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
|
|
5
5
|
export declare const MemoryRateLimit: import("@effect-http/client/_common").Layer<import("./Log.js").Log, never, import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter>;
|
|
6
6
|
export declare const MemoryREST: import("@effect-http/client/_common").Layer<import("./DiscordConfig.js").DiscordConfig | import("@effect-http/client/Request/Executor").HttpRequestExecutor | import("./Log.js").Log, never, import("./DiscordREST.js").DiscordREST>;
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const makeLiveWithoutFetch: (options: ConfigWrap.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>, debug?: boolean) => import("@effect-http/client/_common").Layer<import("@effect-http/client/Request/Executor").HttpRequestExecutor, import("./_common.js").ConfigError, import("./DiscordREST.js").DiscordREST | import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
|
|
8
|
+
export declare const makeLive: (config: ConfigWrap.Wrap<DiscordConfig.MakeOpts & MakeConfigOpts>, debug?: boolean) => import("@effect-http/client/_common").Layer<never, import("./_common.js").ConfigError, import("./DiscordREST.js").DiscordREST | import("./RateLimit.js").RateLimitStore | import("./RateLimit.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
|
package/webhooks.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Layer";
|
|
2
|
-
import * as tsplus_module_2 from "dfx";
|
|
3
|
-
import * as tsplus_module_3 from "dfx
|
|
2
|
+
import * as tsplus_module_2 from "dfx/_common";
|
|
3
|
+
import * as tsplus_module_3 from "dfx";
|
|
4
|
+
import { LiveFetchRequestExecutor } from "@effect-http/client";
|
|
4
5
|
import { LiveDiscordREST } from "./DiscordREST.js";
|
|
5
|
-
import {
|
|
6
|
+
import { makeFromConfig } from "./Interactions/webhook.js";
|
|
6
7
|
import { LiveMemoryRateLimitStore, LiveRateLimiter } from "./RateLimit.js";
|
|
7
8
|
export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
|
|
8
9
|
export const MemoryRateLimit = tsplus_module_1.provideMerge(LiveRateLimiter)(LiveMemoryRateLimitStore);
|
|
9
10
|
export const MemoryREST = tsplus_module_1.provide(LiveDiscordREST)(MemoryRateLimit);
|
|
10
|
-
export const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
export const makeLiveWithoutFetch = (options, debug = false) => {
|
|
12
|
+
const config = tsplus_module_2.ConfigWrap.unwrap(options);
|
|
13
|
+
const LiveWebhook = makeFromConfig(config);
|
|
14
|
+
const LiveLog = debug ? tsplus_module_3.Log.LiveLogDebug : tsplus_module_3.Log.LiveLog;
|
|
15
|
+
const LiveConfig = tsplus_module_3.DiscordConfig.makeFromConfig(config);
|
|
14
16
|
const LiveEnv = tsplus_module_1.provide((tsplus_module_1.merge(MemoryRateLimit)(tsplus_module_1.merge(LiveWebhook)(MemoryREST))))((tsplus_module_1.merge(LiveConfig)(LiveLog)));
|
|
15
17
|
return LiveEnv;
|
|
16
18
|
};
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
const LiveWebhook = makeConfigFromConfig(config);
|
|
20
|
-
const LiveLog = debug ? tsplus_module_2.Log.LiveLogDebug : tsplus_module_2.Log.LiveLog;
|
|
21
|
-
const LiveConfig = tsplus_module_2.DiscordConfig.makeFromConfig(config);
|
|
22
|
-
const LiveEnv = tsplus_module_1.provide((tsplus_module_1.merge(MemoryRateLimit)(tsplus_module_1.merge(LiveWebhook)(MemoryREST))))((tsplus_module_1.merge(LiveConfig)(LiveLog)));
|
|
23
|
-
return LiveEnv;
|
|
19
|
+
export const makeLive = (config, debug = false) => {
|
|
20
|
+
return tsplus_module_1.provide(makeLiveWithoutFetch(config, debug))(LiveFetchRequestExecutor);
|
|
24
21
|
};
|
|
25
22
|
//# sourceMappingURL=webhooks.js.map
|
package/webhooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,gB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