dfx 0.18.0 → 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/driver.d.ts +4 -4
- package/Cache/driver.js.map +1 -1
- 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 +29 -29
- package/Cache/index.js +2 -2
- package/Cache/index.js.map +1 -1
- package/Cache/memory.d.ts +2 -2
- package/Cache/memoryTTL.d.ts +2 -4
- package/Cache/memoryTTL.js +3 -3
- package/Cache/memoryTTL.js.map +1 -1
- package/Cache/prelude.d.ts +14 -28
- package/Cache/prelude.js +18 -25
- 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/utils/effect.d.ts +19 -0
- package/utils/effect.js +19 -1
- package/utils/effect.js.map +1 -1
- package/webhooks.d.ts +3 -3
- package/webhooks.js +4 -3
- package/webhooks.js.map +1 -1
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","sourceR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AAe,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,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 @@ 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/utils/effect.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
import { Effect } from "@effect/io/Effect";
|
|
2
|
+
import { Tag } from "@fp-ts/data/Context";
|
|
2
3
|
export type Success<A extends Effect<any, any, any>> = A extends Effect<any, any, infer R> ? R : never;
|
|
4
|
+
export type ShapeFn<T> = Pick<T, {
|
|
5
|
+
[k in keyof T]: T[k] extends (...args: infer ARGS) => Effect<infer R, infer E, infer A> ? ((...args: ARGS) => Effect<R, E, A>) extends T[k] ? k : never : never;
|
|
6
|
+
}[keyof T]>;
|
|
7
|
+
export type ShapeCn<T> = Pick<T, {
|
|
8
|
+
[k in keyof T]: T[k] extends Effect<any, any, any> ? k : never;
|
|
9
|
+
}[keyof T]>;
|
|
10
|
+
export type DerivedLifted<T, Fns extends keyof ShapeFn<T>, Cns extends keyof ShapeCn<T>, Values extends keyof T> = {
|
|
11
|
+
[k in Fns]: T[k] extends (...args: infer ARGS) => Effect<infer R, infer E, infer A> ? (...args: ARGS) => Effect<R | T, E, A> : never;
|
|
12
|
+
} & {
|
|
13
|
+
[k in Cns]: T[k] extends Effect<infer R, infer E, infer A> ? Effect<R | T, E, A> : never;
|
|
14
|
+
} & {
|
|
15
|
+
[k in Values]: Effect<T, never, T[k]>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @tsplus static effect/io/Effect.Ops deriveLifted
|
|
19
|
+
* @tsplus location "dfx/utils/effect"
|
|
20
|
+
*/
|
|
21
|
+
export declare function deriveLifted<T>(S: Tag<T>): <Fns extends keyof ShapeFn<T> = never, Cns extends keyof ShapeCn<T> = never, Values extends keyof T = never>(functions: Fns[], effects: Cns[], values: Values[]) => DerivedLifted<T, Fns, Cns, Values>;
|
package/utils/effect.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
+
/**
|
|
3
|
+
* @tsplus static effect/io/Effect.Ops deriveLifted
|
|
4
|
+
*/
|
|
5
|
+
export function deriveLifted(S) {
|
|
6
|
+
return (functions, constants, values) => {
|
|
7
|
+
const ret = {};
|
|
8
|
+
for (const k of functions) {
|
|
9
|
+
ret[k] = (...args) => tsplus_module_1.serviceWithEffect(S)((h) => h[k](...args));
|
|
10
|
+
}
|
|
11
|
+
for (const k of constants) {
|
|
12
|
+
ret[k] = tsplus_module_1.serviceWithEffect(S)((h) => h[k]);
|
|
13
|
+
}
|
|
14
|
+
for (const k of values) {
|
|
15
|
+
ret[k] = tsplus_module_1.serviceWith(S)((h) => h[k]);
|
|
16
|
+
}
|
|
17
|
+
return ret;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
2
20
|
//# sourceMappingURL=effect.js.map
|
package/utils/effect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect.js","sourceRoot":"","sources":["../../src/utils/effect.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"effect.js","sourceRoot":"","sources":["../../src/utils/effect.ts"],"names":[],"mappings":";AA+CA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,CAAS;IAUT,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,EAAS,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAC1B,kCAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAAC,CAAC,CAAC,CAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;SAC7D;QAED,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,kCAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAQ,CAAC,CAAA;SACzD;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,GAAG,CAAC,CAAC,CAAC,GAAG,4BAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAC5C;QAED,OAAO,GAAU,CAAA;IACnB,CAAC,CAAA;AACH,CAAC"}
|
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>;
|
package/webhooks.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "dfx";
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Layer";
|
|
3
|
+
import { LiveHttp } from "./Http/index.js";
|
|
3
4
|
import { makeConfigLayer } from "./Interactions/webhook.js";
|
|
4
5
|
export { makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./Interactions/webhook.js";
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
6
|
+
export const MemoryRateLimit = tsplus_module_2.provideToAndMerge(tsplus_module_1.RateLimit.LiveRateLimiter)(tsplus_module_1.RateLimit.LiveMemoryRateLimitStore);
|
|
7
|
+
export const MemoryREST = tsplus_module_2.provideTo(tsplus_module_1.LiveDiscordREST)((tsplus_module_2.merge(LiveHttp)(MemoryRateLimit)));
|
|
7
8
|
export const make = (config, debug = false) => {
|
|
8
9
|
const LiveWebhook = makeConfigLayer(config);
|
|
9
10
|
const LiveLog = debug ? tsplus_module_1.Log.LiveLogDebug : tsplus_module_1.Log.LiveLog;
|
|
10
11
|
const LiveConfig = tsplus_module_1.Config.makeLayer(config);
|
|
11
|
-
const LiveEnv = tsplus_module_2.
|
|
12
|
+
const LiveEnv = tsplus_module_2.provideTo((tsplus_module_2.merge(MemoryRateLimit)(tsplus_module_2.merge(LiveWebhook)(MemoryREST))))((tsplus_module_2.merge(LiveConfig)(LiveLog)));
|
|
12
13
|
return LiveEnv;
|
|
13
14
|
};
|
|
14
15
|
//# 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,eAAe,EAAkB,MAAM,2BAA2B,CAAA;AAE3E,OAAO,EACL,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAkB,MAAM,2BAA2B,CAAA;AAE3E,OAAO,EACL,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,MAAM,eAAe,qCACW,gBAAA,SAAS,CAAC,eAAe,EAA9D,gBAAA,SAAS,CAAC,wBAAwB,CAA4B,CAAA;AAEhE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