dfx 0.21.5 → 0.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +2 -3
- package/Cache/index.js.map +1 -1
- package/Cache/memory.d.ts +3 -3
- package/Cache/memory.js +19 -18
- package/Cache/memory.js.map +1 -1
- package/Cache/memoryTTL.d.ts +5 -5
- package/Cache/memoryTTL.js +15 -15
- package/Cache/memoryTTL.js.map +1 -1
- package/Cache/prelude.d.ts +37 -37
- package/Cache/prelude.js +5 -6
- package/Cache/prelude.js.map +1 -1
- package/DiscordConfig/index.d.ts +4 -4
- package/DiscordConfig/index.js +8 -5
- package/DiscordConfig/index.js.map +1 -1
- package/DiscordGateway/DiscordWS/index.d.ts +8 -9
- package/DiscordGateway/DiscordWS/index.js +19 -16
- package/DiscordGateway/DiscordWS/index.js.map +1 -1
- package/DiscordGateway/Shard/heartbeats.d.ts +3 -3
- package/DiscordGateway/Shard/heartbeats.js +12 -10
- package/DiscordGateway/Shard/heartbeats.js.map +1 -1
- package/DiscordGateway/Shard/identify.d.ts +4 -5
- package/DiscordGateway/Shard/identify.js +4 -4
- package/DiscordGateway/Shard/identify.js.map +1 -1
- package/DiscordGateway/Shard/index.d.ts +7 -8
- package/DiscordGateway/Shard/index.js +17 -17
- package/DiscordGateway/Shard/index.js.map +1 -1
- package/DiscordGateway/Shard/invalidSession.d.ts +2 -2
- package/DiscordGateway/Shard/invalidSession.js +7 -5
- package/DiscordGateway/Shard/invalidSession.js.map +1 -1
- package/DiscordGateway/Shard/utils.d.ts +3 -3
- package/DiscordGateway/Shard/utils.js +5 -5
- package/DiscordGateway/Shard/utils.js.map +1 -1
- package/DiscordGateway/ShardStore/index.d.ts +6 -6
- package/DiscordGateway/ShardStore/index.js +10 -7
- package/DiscordGateway/ShardStore/index.js.map +1 -1
- package/DiscordGateway/Sharder/index.d.ts +10 -12
- package/DiscordGateway/Sharder/index.js +15 -14
- package/DiscordGateway/Sharder/index.js.map +1 -1
- package/DiscordGateway/WS/index.d.ts +3 -3
- package/DiscordGateway/WS/index.js +12 -11
- package/DiscordGateway/WS/index.js.map +1 -1
- package/DiscordGateway/index.d.ts +8 -8
- package/DiscordGateway/index.js +9 -8
- package/DiscordGateway/index.js.map +1 -1
- package/DiscordREST/index.d.ts +136 -136
- package/DiscordREST/index.js +39 -36
- package/DiscordREST/index.js.map +1 -1
- package/DiscordREST/types.d.ts +4 -4
- package/DiscordREST/utils.d.ts +4 -5
- package/DiscordREST/utils.js +5 -5
- package/DiscordREST/utils.js.map +1 -1
- package/Helpers/intents.js +9 -8
- package/Helpers/intents.js.map +1 -1
- package/Helpers/interactions.d.ts +18 -18
- package/Helpers/interactions.js +23 -22
- package/Helpers/interactions.js.map +1 -1
- package/Helpers/members.d.ts +3 -3
- package/Helpers/members.js.map +1 -1
- package/Helpers/permissions.d.ts +4 -5
- package/Helpers/permissions.js +14 -13
- package/Helpers/permissions.js.map +1 -1
- package/Http/index.d.ts +9 -10
- package/Http/index.js +8 -7
- package/Http/index.js.map +1 -1
- package/Interactions/context.d.ts +23 -22
- package/Interactions/context.js +25 -22
- package/Interactions/context.js.map +1 -1
- package/Interactions/definitions.d.ts +29 -30
- package/Interactions/definitions.js +2 -1
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/gateway.d.ts +3 -4
- package/Interactions/gateway.js +6 -6
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.d.ts +2 -2
- package/Interactions/handlers.js +18 -17
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/index.d.ts +7 -7
- package/Interactions/index.js +7 -8
- package/Interactions/index.js.map +1 -1
- package/Interactions/webhook.d.ts +7 -7
- package/Interactions/webhook.js +13 -11
- package/Interactions/webhook.js.map +1 -1
- package/Log/index.d.ts +8 -8
- package/Log/index.js +11 -9
- package/Log/index.js.map +1 -1
- package/RateLimit/index.d.ts +12 -13
- package/RateLimit/index.js +12 -11
- package/RateLimit/index.js.map +1 -1
- package/RateLimit/memory.js +7 -7
- package/RateLimit/memory.js.map +1 -1
- package/RateLimit/utils.d.ts +1 -1
- package/RateLimit/utils.js.map +1 -1
- package/_common.d.ts +22 -18
- package/_common.js +0 -18
- package/_common.js.map +1 -1
- package/gateway.d.ts +6 -7
- package/gateway.js +0 -2
- package/gateway.js.map +1 -1
- package/global.d.ts +21 -0
- package/global.js +2 -0
- package/global.js.map +1 -0
- package/package.json +3 -3
- package/utils/effect.d.ts +9 -8
- package/utils/effect.js +4 -4
- package/utils/effect.js.map +1 -1
- package/webhooks.d.ts +4 -5
- package/webhooks.js +3 -5
- package/webhooks.js.map +1 -1
package/Interactions/handlers.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
2
|
-
import * as tsplus_module_2 from "@
|
|
3
|
-
import * as tsplus_module_3 from "@
|
|
1
|
+
import * as tsplus_module_1 from "dfx/_common";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
|
+
import * as tsplus_module_3 from "@fp-ts/data/Option";
|
|
4
|
+
import * as tsplus_module_4 from "@fp-ts/data/Function";
|
|
5
|
+
import * as tsplus_module_5 from "@fp-ts/data/Chunk";
|
|
6
|
+
import * as tsplus_module_6 from "dfx";
|
|
4
7
|
import * as Arr from "@fp-ts/data/ReadonlyArray";
|
|
5
|
-
import { IxHelpers } from "dfx";
|
|
6
|
-
import { Effect, Option, pipe } from "dfx/_common";
|
|
7
8
|
import * as Ctx from "./context.js";
|
|
8
9
|
import { splitDefinitions } from "./utils.js";
|
|
9
10
|
export class DefinitionNotFound {
|
|
@@ -23,35 +24,35 @@ const context = {
|
|
|
23
24
|
export const handlers = (definitions) => {
|
|
24
25
|
const { Commands, Autocomplete, MessageComponent, ModalSubmit } = splitDefinitions(definitions);
|
|
25
26
|
return {
|
|
26
|
-
[1 /* Discord.InteractionType.PING */]: () =>
|
|
27
|
+
[1 /* Discord.InteractionType.PING */]: () => tsplus_module_2.succeed({
|
|
27
28
|
type: 1 /* Discord.InteractionCallbackType.PONG */,
|
|
28
29
|
}),
|
|
29
30
|
[2 /* Discord.InteractionType.APPLICATION_COMMAND */]: (i) => {
|
|
30
31
|
const data = i.data;
|
|
31
|
-
return pipe(
|
|
32
|
+
return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (command) => tsplus_module_2.isEffect(command.handle)
|
|
32
33
|
? command.handle
|
|
33
|
-
: command.handle(context))(
|
|
34
|
+
: command.handle(context))(tsplus_module_3.fromNullable(Commands[data.name])), (a) => a, tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data));
|
|
34
35
|
},
|
|
35
36
|
[5 /* Discord.InteractionType.MODAL_SUBMIT */]: (i) => {
|
|
36
37
|
const data = i.data;
|
|
37
|
-
return pipe(ModalSubmit, Arr.map((a) =>
|
|
38
|
-
command:
|
|
38
|
+
return tsplus_module_4.pipe(ModalSubmit, Arr.map((a) => tsplus_module_2.struct({
|
|
39
|
+
command: tsplus_module_2.succeed(a),
|
|
39
40
|
match: a.predicate(data.custom_id),
|
|
40
|
-
})), (a) =>
|
|
41
|
+
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.ModalSubmitContext)(data));
|
|
41
42
|
},
|
|
42
43
|
[3 /* Discord.InteractionType.MESSAGE_COMPONENT */]: (i) => {
|
|
43
44
|
const data = i.data;
|
|
44
|
-
return pipe(MessageComponent, Arr.map((a) =>
|
|
45
|
-
command:
|
|
45
|
+
return tsplus_module_4.pipe(MessageComponent, Arr.map((a) => tsplus_module_2.struct({
|
|
46
|
+
command: tsplus_module_2.succeed(a),
|
|
46
47
|
match: a.predicate(data.custom_id),
|
|
47
|
-
})), (a) =>
|
|
48
|
+
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.MessageComponentContext)(data));
|
|
48
49
|
},
|
|
49
50
|
[4 /* Discord.InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE */]: (i) => {
|
|
50
51
|
const data = i.data;
|
|
51
|
-
return
|
|
52
|
-
command:
|
|
52
|
+
return tsplus_module_3.getOrElse(() => tsplus_module_2.fail(new DefinitionNotFound(i)))(tsplus_module_3.map((focusedOption) => tsplus_module_4.pipe(Autocomplete, Arr.map((a) => tsplus_module_2.struct({
|
|
53
|
+
command: tsplus_module_2.succeed(a),
|
|
53
54
|
match: a.predicate(data, focusedOption),
|
|
54
|
-
})), (a) =>
|
|
55
|
+
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (a) => a.command.handle)(tsplus_module_5.findFirst((a) => a.match)(a)))(tsplus_module_2.collectAllPar(a)), tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data), tsplus_module_2.provideService(Ctx.FocusedOptionContext)({ focusedOption })))(tsplus_module_6.IxHelpers.focusedOption(data)));
|
|
55
56
|
},
|
|
56
57
|
};
|
|
57
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM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|
|
12
12
|
constructor(definitions: D.InteractionDefinition<R, E>[]);
|
|
13
13
|
add<R1, E1>(definition: D.InteractionDefinition<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
14
14
|
concat<R1, E1>(builder: InteractionBuilder<R1, E1>): InteractionBuilder<R | R1, E | E1>;
|
|
15
|
-
get syncGlobal(): Effect
|
|
16
|
-
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): Effect
|
|
15
|
+
get syncGlobal(): Effect<DiscordREST, import("dfx").FetchError | import("dfx").StatusCodeError | import("dfx").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
16
|
+
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): Effect<DiscordREST, import("dfx").FetchError | import("dfx").StatusCodeError | import("dfx").JsonParseError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
17
17
|
}
|
|
18
18
|
export declare const builder: InteractionBuilder<never, never>;
|
|
19
|
-
export declare const id: (query: string) => (customId: string) => Effect
|
|
20
|
-
export declare const idStartsWith: (query: string) => (customId: string) => Effect
|
|
21
|
-
export declare const idRegex: (query: RegExp) => (customId: string) => Effect
|
|
22
|
-
export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect
|
|
23
|
-
export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect
|
|
19
|
+
export declare const id: (query: string) => (customId: string) => Effect<never, never, boolean>;
|
|
20
|
+
export declare const idStartsWith: (query: string) => (customId: string) => Effect<never, never, boolean>;
|
|
21
|
+
export declare const idRegex: (query: RegExp) => (customId: string) => Effect<never, never, boolean>;
|
|
22
|
+
export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect<never, never, boolean>;
|
|
23
|
+
export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => Effect<never, never, boolean>;
|
package/Interactions/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
2
|
import { DiscordREST } from "dfx";
|
|
3
|
-
import { Effect } from "dfx/_common";
|
|
4
3
|
export { response as r } from "../Helpers/interactions.js";
|
|
5
4
|
export * from "./context.js";
|
|
6
5
|
export { autocomplete, global, guild, messageComponent, modalSubmit, } from "./definitions.js";
|
|
@@ -28,7 +27,7 @@ export class InteractionBuilder {
|
|
|
28
27
|
const commands = this.definitions
|
|
29
28
|
.filter((c) => c._tag === "GlobalApplicationCommand")
|
|
30
29
|
.map((c) => c.command);
|
|
31
|
-
return
|
|
30
|
+
return tsplus_module_1.serviceWithEffect(DiscordREST)((rest) => tsplus_module_1.flatMap((app) => rest.bulkOverwriteGlobalApplicationCommands(app.id, {
|
|
32
31
|
body: JSON.stringify(commands),
|
|
33
32
|
}))(tsplus_module_1.flatMap((r) => r.json)(rest
|
|
34
33
|
.getCurrentBotApplicationInformation())));
|
|
@@ -37,14 +36,14 @@ export class InteractionBuilder {
|
|
|
37
36
|
const commands = this.definitions
|
|
38
37
|
.filter((c) => c._tag === "GuildApplicationCommand")
|
|
39
38
|
.map((c) => c.command);
|
|
40
|
-
return
|
|
39
|
+
return tsplus_module_1.serviceWithEffect(DiscordREST)((rest) => rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands));
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
export const builder = new InteractionBuilder([]);
|
|
44
43
|
// Filters
|
|
45
|
-
export const id = (query) => (customId) =>
|
|
46
|
-
export const idStartsWith = (query) => (customId) =>
|
|
47
|
-
export const idRegex = (query) => (customId) =>
|
|
48
|
-
export const option = (command, optionName) => (data, focusedOption) =>
|
|
49
|
-
export const optionOnly = (optionName) => (_, focusedOption) =>
|
|
44
|
+
export const id = (query) => (customId) => tsplus_module_1.succeed(query === customId);
|
|
45
|
+
export const idStartsWith = (query) => (customId) => tsplus_module_1.succeed(customId.startsWith(query));
|
|
46
|
+
export const idRegex = (query) => (customId) => tsplus_module_1.succeed(query.test(customId));
|
|
47
|
+
export const option = (command, optionName) => (data, focusedOption) => tsplus_module_1.succeed(data.name === command && focusedOption.name === optionName);
|
|
48
|
+
export const optionOnly = (optionName) => (_, focusedOption) => tsplus_module_1.succeed(focusedOption.name === optionName);
|
|
50
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Interactions/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAIjC,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAA;AAC1D,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,YAAY,EACZ,MAAM,EACN,KAAK,EAEL,gBAAgB,EAChB,WAAW,GACZ,MAAM,kBAAkB,CAAA;AAEzB;;GAEG;AACH,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,MAAM,CAAS,OAAmC;QAChD,OAAO,IAAI,kBAAkB,CAAiB;YAC5C,GAAG,IAAI,CAAC,WAAW;YACnB,GAAG,OAAO,CAAC,WAAW;SACvB,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,U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,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Discord, Effect, Cause } from "dfx/_common";
|
|
2
2
|
import { DefinitionNotFound } from "./handlers.js";
|
|
3
3
|
import { InteractionBuilder } from "./index.js";
|
|
4
4
|
export declare class BadWebhookSignature {
|
|
@@ -15,8 +15,8 @@ declare const makeConfig: ({ applicationId, publicKey }: MakeConfigOpts) => {
|
|
|
15
15
|
};
|
|
16
16
|
export interface WebhookConfig extends ReturnType<typeof makeConfig> {
|
|
17
17
|
}
|
|
18
|
-
export declare const WebhookConfig:
|
|
19
|
-
export declare const makeConfigLayer: (a_0: MakeConfigOpts) =>
|
|
18
|
+
export declare const WebhookConfig: import("../_common.js").Tag<WebhookConfig>;
|
|
19
|
+
export declare const makeConfigLayer: (a_0: MakeConfigOpts) => import("../_common.js").Layer<never, never, WebhookConfig>;
|
|
20
20
|
export declare class WebhookParseError {
|
|
21
21
|
readonly reason: unknown;
|
|
22
22
|
readonly _tag = "WebhookParseError";
|
|
@@ -25,14 +25,14 @@ export declare class WebhookParseError {
|
|
|
25
25
|
export interface HandleWebhookOpts<E> {
|
|
26
26
|
headers: Headers;
|
|
27
27
|
body: string;
|
|
28
|
-
success: (a: Discord.InteractionResponse) => Effect
|
|
29
|
-
error: (e: Cause
|
|
28
|
+
success: (a: Discord.InteractionResponse) => Effect<never, never, void>;
|
|
29
|
+
error: (e: Cause<E>) => Effect<never, never, void>;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* @tsplus getter dfx/InteractionBuilder webhookHandler
|
|
33
33
|
* @tsplus location "dfx/Interactions/webhook"
|
|
34
34
|
*/
|
|
35
|
-
export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body, success, error, }: HandleWebhookOpts<DefinitionNotFound | BadWebhookSignature | WebhookParseError | E>) =>
|
|
35
|
+
export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body, success, error, }: HandleWebhookOpts<DefinitionNotFound | BadWebhookSignature | WebhookParseError | E>) => import("../_common.js").Effect<WebhookConfig | Exclude<R, import("../types.js").Interaction>, never, void>;
|
|
36
36
|
/**
|
|
37
37
|
* @tsplus getter dfx/InteractionBuilder simpleWebhookHandler
|
|
38
38
|
* @tsplus location "dfx/Interactions/webhook"
|
|
@@ -40,5 +40,5 @@ export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ hea
|
|
|
40
40
|
export declare const makeSimpleHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body }: {
|
|
41
41
|
headers: Headers;
|
|
42
42
|
body: string;
|
|
43
|
-
}) =>
|
|
43
|
+
}) => import("../_common.js").Effect<WebhookConfig | Exclude<R, import("../types.js").Interaction>, DefinitionNotFound | BadWebhookSignature | WebhookParseError | E, import("../types.js").InteractionResponse>;
|
|
44
44
|
export {};
|
package/Interactions/webhook.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fp-ts/data/Option";
|
|
2
2
|
import * as tsplus_module_2 from "@fp-ts/data/Either";
|
|
3
|
-
import * as tsplus_module_3 from "
|
|
4
|
-
import
|
|
3
|
+
import * as tsplus_module_3 from "dfx/_common";
|
|
4
|
+
import * as tsplus_module_4 from "@effect/io/Layer";
|
|
5
|
+
import * as tsplus_module_5 from "@fp-ts/data/Function";
|
|
6
|
+
import * as tsplus_module_6 from "@effect/io/Effect";
|
|
5
7
|
import Nacl from "tweetnacl";
|
|
6
8
|
import { handlers } from "./handlers.js";
|
|
7
9
|
import { InteractionContext } from "./index.js";
|
|
@@ -12,16 +14,16 @@ export class BadWebhookSignature {
|
|
|
12
14
|
const checkSignature = (publicKey, headers, body) => tsplus_module_2.asUnit(tsplus_module_1.toEither(() => new BadWebhookSignature())(tsplus_module_1.filter((a) => {
|
|
13
15
|
const enc = new TextEncoder();
|
|
14
16
|
return Nacl.sign.detached.verify(enc.encode(a.timestamp + body), fromHex(`${a.signature}`), publicKey);
|
|
15
|
-
})(
|
|
16
|
-
signature:
|
|
17
|
-
timestamp:
|
|
17
|
+
})(tsplus_module_1.struct({
|
|
18
|
+
signature: tsplus_module_1.fromNullable(headers["x-signature-ed25519"]),
|
|
19
|
+
timestamp: tsplus_module_1.fromNullable(headers["x-signature-timestamp"]),
|
|
18
20
|
}))));
|
|
19
21
|
const makeConfig = ({ applicationId, publicKey }) => ({
|
|
20
22
|
applicationId,
|
|
21
23
|
publicKey: fromHex(publicKey),
|
|
22
24
|
});
|
|
23
|
-
export const WebhookConfig =
|
|
24
|
-
export const makeConfigLayer = flow(makeConfig,
|
|
25
|
+
export const WebhookConfig = tsplus_module_3.Tag();
|
|
26
|
+
export const makeConfigLayer = tsplus_module_5.flow(makeConfig, tsplus_module_4.succeed(WebhookConfig));
|
|
25
27
|
export class WebhookParseError {
|
|
26
28
|
reason;
|
|
27
29
|
_tag = "WebhookParseError";
|
|
@@ -29,11 +31,11 @@ export class WebhookParseError {
|
|
|
29
31
|
this.reason = reason;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
const fromHeadersAndBody = (headers, body) =>
|
|
34
|
+
const fromHeadersAndBody = (headers, body) => tsplus_module_6.flatMap(({ publicKey }) => tsplus_module_6.flatMap(() => tsplus_module_6.tryCatch(() => JSON.parse(body), (reason) => new WebhookParseError(reason)))(tsplus_module_6.fromEither(checkSignature(publicKey, headers, body))))(tsplus_module_6.service(WebhookConfig));
|
|
33
35
|
const run = (definitions) => {
|
|
34
36
|
const handler = handlers(definitions);
|
|
35
|
-
return (headers, body) =>
|
|
36
|
-
const provide =
|
|
37
|
+
return (headers, body) => tsplus_module_6.flatMap(interaction => {
|
|
38
|
+
const provide = tsplus_module_6.provideService(InteractionContext)(interaction);
|
|
37
39
|
return provide(handler[interaction.type](interaction));
|
|
38
40
|
})(fromHeadersAndBody(headers, body));
|
|
39
41
|
};
|
|
@@ -42,7 +44,7 @@ const run = (definitions) => {
|
|
|
42
44
|
*/
|
|
43
45
|
export const makeHandler = (ix) => {
|
|
44
46
|
const handle = run(ix.definitions);
|
|
45
|
-
return ({ headers, body, success, error, }) =>
|
|
47
|
+
return ({ headers, body, success, error, }) => tsplus_module_6.catchAllCause(error)(tsplus_module_6.flatMap(success)(handle(headers, body)));
|
|
46
48
|
};
|
|
47
49
|
/**
|
|
48
50
|
* @tsplus getter dfx/InteractionBuilder simpleWebhookHandler
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/Interactions/webhook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/Interactions/webhook.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MA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,CAAC,CAAA"}
|
package/Log/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, Layer } from "dfx/_common";
|
|
2
2
|
declare const make: (debug?: boolean) => {
|
|
3
|
-
info: (...args: any[]) => Effect
|
|
4
|
-
debug: (...args: any[]) => Effect
|
|
3
|
+
info: (...args: any[]) => Effect<never, never, void>;
|
|
4
|
+
debug: (...args: any[]) => Effect<never, never, void>;
|
|
5
5
|
};
|
|
6
6
|
export interface Log extends ReturnType<typeof make> {
|
|
7
7
|
}
|
|
8
|
-
export declare const Log:
|
|
9
|
-
export declare const LiveLog: Layer
|
|
10
|
-
export declare const LiveLogDebug: Layer
|
|
11
|
-
export declare const info: (...args: any[]) => Effect
|
|
12
|
-
export declare const debug: (...args: any[]) => Effect
|
|
8
|
+
export declare const Log: import("dfx/_common").Tag<Log>;
|
|
9
|
+
export declare const LiveLog: Layer<never, never, Log>;
|
|
10
|
+
export declare const LiveLogDebug: Layer<never, never, Log>;
|
|
11
|
+
export declare const info: (...args: any[]) => Effect<Log, never, void>;
|
|
12
|
+
export declare const debug: (...args: any[]) => Effect<Log, never, void>;
|
|
13
13
|
export {};
|
package/Log/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as tsplus_module_1 from "@effect/io/Effect";
|
|
2
|
+
import * as tsplus_module_2 from "dfx/_common";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Layer";
|
|
2
4
|
const make = (debug = false) => ({
|
|
3
|
-
info: (...args) =>
|
|
5
|
+
info: (...args) => tsplus_module_1.sync(() => {
|
|
4
6
|
console.error("INFO", ...args);
|
|
5
7
|
}),
|
|
6
8
|
debug: (...args) => debug
|
|
7
|
-
?
|
|
9
|
+
? tsplus_module_1.sync(() => {
|
|
8
10
|
console.error("DEBUG", ...args);
|
|
9
11
|
})
|
|
10
|
-
:
|
|
12
|
+
: tsplus_module_1.unit(),
|
|
11
13
|
});
|
|
12
|
-
export const Log =
|
|
13
|
-
export const LiveLog =
|
|
14
|
-
export const LiveLogDebug =
|
|
15
|
-
export const info = (...args) =>
|
|
16
|
-
export const debug = (...args) =>
|
|
14
|
+
export const Log = tsplus_module_2.Tag();
|
|
15
|
+
export const LiveLog = tsplus_module_3.succeed(Log)(make(false));
|
|
16
|
+
export const LiveLogDebug = tsplus_module_3.succeed(Log)(make(true));
|
|
17
|
+
export const info = (...args) => tsplus_module_1.serviceWithEffect(Log)(({ info: log }) => log(...args));
|
|
18
|
+
export const debug = (...args) => tsplus_module_1.serviceWithEffect(Log)(({ debug }) => debug(...args));
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
package/Log/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,CAAC,KAAK,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CACvB,qBAAY,GAAG,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;IAChC,CAAC,CAAC;IACJ,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CACxB,KAAK;QACH,CAAC,CAAC,qBAAY,GAAG,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;QACjC,CAAC,CAAC;QACJ,CAAC,CAAC,sBAAa;CACpB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,GAAG,GAAG,gBAAA,GAAG,EAAO,CAAA;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAc,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG,wBAAc,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AAE1D,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CACrC,kCAAyB,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AAEhE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CACtC,kCAAyB,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA"}
|
package/RateLimit/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Log } from "dfx";
|
|
1
|
+
import { Effect, Maybe, Duration } from "dfx/_common";
|
|
3
2
|
import { Success } from "dfx/utils/effect";
|
|
4
3
|
export type BucketDetails = {
|
|
5
4
|
key: "global" | string;
|
|
@@ -7,19 +6,19 @@ export type BucketDetails = {
|
|
|
7
6
|
limit: number;
|
|
8
7
|
};
|
|
9
8
|
export interface RateLimitStore {
|
|
10
|
-
hasBucket: (bucketKey: string) => Effect
|
|
11
|
-
putBucket: (bucket: BucketDetails) => Effect
|
|
12
|
-
getBucketForRoute: (route: string) => Effect
|
|
13
|
-
putBucketRoute: (route: string, bucketKey: string) => Effect
|
|
14
|
-
incrementCounter: (key: string, window: number, limit: number) => Effect
|
|
9
|
+
hasBucket: (bucketKey: string) => Effect<never, never, boolean>;
|
|
10
|
+
putBucket: (bucket: BucketDetails) => Effect<never, never, void>;
|
|
11
|
+
getBucketForRoute: (route: string) => Effect<never, never, Maybe<BucketDetails>>;
|
|
12
|
+
putBucketRoute: (route: string, bucketKey: string) => Effect<never, never, void>;
|
|
13
|
+
incrementCounter: (key: string, window: number, limit: number) => Effect<never, never, readonly [count: number, ttl: number]>;
|
|
15
14
|
}
|
|
16
|
-
export declare const RateLimitStore:
|
|
17
|
-
export declare const LiveMemoryRateLimitStore:
|
|
18
|
-
declare const makeLimiter:
|
|
19
|
-
maybeWait: (key: string, window: Duration
|
|
15
|
+
export declare const RateLimitStore: import("../_common.js").Tag<RateLimitStore>;
|
|
16
|
+
export declare const LiveMemoryRateLimitStore: import("../_common.js").Layer<never, never, RateLimitStore>;
|
|
17
|
+
declare const makeLimiter: import("../_common.js").Effect<import("../Log/index.js").Log | RateLimitStore, never, {
|
|
18
|
+
maybeWait: (key: string, window: Duration, limit: number, multiplier?: number) => import("../_common.js").Effect<never, never, void>;
|
|
20
19
|
}>;
|
|
21
20
|
export interface RateLimiter extends Success<typeof makeLimiter> {
|
|
22
21
|
}
|
|
23
|
-
export declare const RateLimiter:
|
|
24
|
-
export declare const LiveRateLimiter:
|
|
22
|
+
export declare const RateLimiter: import("../_common.js").Tag<RateLimiter>;
|
|
23
|
+
export declare const LiveRateLimiter: import("../_common.js").Layer<import("../Log/index.js").Log | RateLimitStore, never, RateLimiter>;
|
|
25
24
|
export {};
|
package/RateLimit/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "
|
|
1
|
+
import * as tsplus_module_1 from "dfx/_common";
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Layer";
|
|
3
|
+
import * as tsplus_module_3 from "@effect/io/Effect";
|
|
4
|
+
import * as tsplus_module_4 from "dfx";
|
|
2
5
|
import { delayFrom } from "./utils.js";
|
|
3
6
|
import * as Memory from "./memory.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const LiveMemoryRateLimitStore = Layer.sync(RateLimitStore)(Memory.make);
|
|
8
|
-
const makeLimiter = tsplus_module_1.flatMap(store => tsplus_module_1.map(log => {
|
|
7
|
+
export const RateLimitStore = tsplus_module_1.Tag();
|
|
8
|
+
export const LiveMemoryRateLimitStore = tsplus_module_2.sync(RateLimitStore)(Memory.make);
|
|
9
|
+
const makeLimiter = tsplus_module_3.flatMap(store => tsplus_module_3.map(log => {
|
|
9
10
|
const maybeWait = (key, window, limit, multiplier = 1.05) => {
|
|
10
11
|
const windowMs = window.millis * multiplier;
|
|
11
|
-
return
|
|
12
|
+
return tsplus_module_3.asUnit(tsplus_module_3.tap(tsplus_module_3.sleep)(tsplus_module_3.tap((d) => log.debug("RateLimitStore maybeWait", {
|
|
12
13
|
key,
|
|
13
14
|
window: window.millis,
|
|
14
15
|
windowMs,
|
|
15
16
|
limit,
|
|
16
17
|
delay: d.millis,
|
|
17
|
-
}))(
|
|
18
|
+
}))(tsplus_module_3.map(([count, ttl]) => delayFrom(windowMs, limit, count, ttl))(store
|
|
18
19
|
.incrementCounter(key, windowMs, limit)))));
|
|
19
20
|
};
|
|
20
21
|
return { maybeWait };
|
|
21
|
-
})(
|
|
22
|
-
export const RateLimiter =
|
|
23
|
-
export const LiveRateLimiter =
|
|
22
|
+
})(tsplus_module_3.service(tsplus_module_4.Log.Log)))(tsplus_module_3.service(RateLimitStore));
|
|
23
|
+
export const RateLimiter = tsplus_module_1.Tag();
|
|
24
|
+
export const LiveRateLimiter = tsplus_module_2.fromEffect(RateLimiter)(makeLimiter);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
package/RateLimit/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RateLimit/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/RateLimit/index.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AA8BrC,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAA,GAAG,EAAkB,CAAA;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAW,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAE/E,MAAM,WAAW,2BACT,KAAK,wBACL,GAAG;IAET,MAAM,SAAS,GAAG,CAChB,GAAW,EACX,MAAgB,EAChB,KAAa,EACb,UAAU,GAAG,IAAI,EACjB,EAAE;QACF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,UAAU,CAAA;QAE3C,8BAAO,2CAAA,oBAGA,CAAC,CAAC,EAAE,EAAE,CACT,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE;YACpC,GAAG;YACH,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ;YACR,KAAK;YACL,KAAK,EAAE,CAAC,CAAC,MAAM;SAChB,CAAC,EAVC,oBAEA,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAFxD,KAAK;aACT,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CACuB,CAS7D,CACiB,EAAO;IAC7B,CAAC,CAAA;IAED,OAAO,EAAE,SAAS,EAAE,CAAA;GAzBN,wBAAe,gBAAA,GAAG,CAAC,GAAG,CAAC,GADrB,wBAAe,cAAc,CAAC,CA2B9C,CAAA;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAA,GAAG,EAAe,CAAA;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG,2BAAiB,WAAW,CAAC,CAAC,WAAW,CAAC,CAAA"}
|
package/RateLimit/memory.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as tsplus_module_1 from "@fp-ts/data/Option";
|
|
2
|
-
import
|
|
2
|
+
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
3
|
export const make = () => {
|
|
4
4
|
const buckets = new Map();
|
|
5
5
|
const routes = new Map();
|
|
6
6
|
const counters = new Map();
|
|
7
|
-
const getCounter = (key) => tsplus_module_1.filter((c) => c.expires > Date.now())(
|
|
7
|
+
const getCounter = (key) => tsplus_module_1.filter((c) => c.expires > Date.now())(tsplus_module_1.fromNullable(counters.get(key)));
|
|
8
8
|
return {
|
|
9
|
-
hasBucket: (key) =>
|
|
10
|
-
putBucket: (bucket) =>
|
|
9
|
+
hasBucket: (key) => tsplus_module_2.sync(() => buckets.has(key)),
|
|
10
|
+
putBucket: (bucket) => tsplus_module_2.sync(() => {
|
|
11
11
|
buckets.set(bucket.key, bucket);
|
|
12
12
|
}),
|
|
13
|
-
getBucketForRoute: (route) =>
|
|
14
|
-
putBucketRoute: (route, bucket) =>
|
|
13
|
+
getBucketForRoute: (route) => tsplus_module_2.sync(() => tsplus_module_1.fromNullable(buckets.get(routes.get(route)))),
|
|
14
|
+
putBucketRoute: (route, bucket) => tsplus_module_2.sync(() => {
|
|
15
15
|
routes.set(route, bucket);
|
|
16
16
|
}),
|
|
17
|
-
incrementCounter: (key, window, limit) =>
|
|
17
|
+
incrementCounter: (key, window, limit) => tsplus_module_2.sync(() => {
|
|
18
18
|
const now = Date.now();
|
|
19
19
|
const perRequest = Math.ceil(window / limit);
|
|
20
20
|
const counter = tsplus_module_1.getOrElse(() => ({
|
package/RateLimit/memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/RateLimit/memory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/RateLimit/memory.ts"],"names":[],"mappings":";;AAOA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAmB,EAAE;IACvC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAA;IAChD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IACxC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAA;IAE3C,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CACjC,uBAA6C,CAAC,C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OAAO,GAAG,UAAU,CAAA;YAC5C,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;YAEjD,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,CAAC,CAAA;QAC/B,CAAC,CAAC;KACL,CAAA;AACH,CAAC,CAAA"}
|
package/RateLimit/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Duration } from "dfx/_common";
|
|
2
|
-
export declare const delayFrom: (window: number, limit: number, count: number, ttl: number) => Duration
|
|
2
|
+
export declare const delayFrom: (window: number, limit: number, count: number, ttl: number) => Duration;
|
package/RateLimit/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/RateLimit/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/RateLimit/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAAc,EACd,KAAa,EACb,KAAa,EACb,GAAW,EACD,EAAE;IACZ,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAA;IAE5C,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,CAAA;IACpC,MAAM,WAAW,GAAG,SAAS,GAAG,GAAG,CAAA;IACnC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IACvD,MAAM,iBAAiB,GAAG,cAAc,GAAG,KAAK,CAAA;IAChD,MAAM,iBAAiB,GAAG,KAAK,GAAG,iBAAiB,CAAA;IACnD,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,iBAAiB,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAA;IACpE,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,CAAA;IAE3C,MAAM,gBAAgB,GAAG,KAAK,GAAG,KAAK,CAAA;IACtC,MAAM,YAAY,GAAG,gBAAgB,GAAG,EAAE,CAAA;IAE1C,IAAI,gBAAgB,KAAK,CAAC,EAAE;QAC1B,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,MAAM,CAAC,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,YAAY,CAAC,CAAA;AAC1E,CAAC,CAAA"}
|
package/_common.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export { pipe, flow, identity } from "@fp-ts/data/Function";
|
|
1
|
+
import type { Schedule as _Schedule } from "@effect/io/Schedule";
|
|
2
|
+
export type { Cause } from "@effect/io/Cause";
|
|
3
|
+
export type { Effect } from "@effect/io/Effect";
|
|
4
|
+
export type { Exit } from "@effect/io/Exit";
|
|
5
|
+
export type { Layer } from "@effect/io/Layer";
|
|
6
|
+
export type { Queue } from "@effect/io/Queue";
|
|
7
|
+
export type { Scope } from "@effect/io/Scope";
|
|
8
|
+
export type { Stream } from "@effect/stream/Stream";
|
|
9
|
+
export type { Chunk } from "@fp-ts/data/Chunk";
|
|
10
|
+
export type { Context, Tag } from "@fp-ts/data/Context";
|
|
11
|
+
export type { Duration } from "@fp-ts/data/Duration";
|
|
12
|
+
export type { Equal } from "@fp-ts/data/Equal";
|
|
13
|
+
export type { Either } from "@fp-ts/data/Either";
|
|
14
|
+
export type { HashMap } from "@fp-ts/data/HashMap";
|
|
15
|
+
export type { Option as Maybe } from "@fp-ts/data/Option";
|
|
16
|
+
export type { Ref } from "@effect/io/Ref";
|
|
17
|
+
export type { HashSet } from "@fp-ts/data/HashSet";
|
|
19
18
|
export * as Discord from "./types.js";
|
|
19
|
+
/**
|
|
20
|
+
* @tsplus type effect/io/Schedule
|
|
21
|
+
* @tsplus companion effect/io/Schedule.Ops
|
|
22
|
+
*/
|
|
23
|
+
export type Schedule<Env, In, Out> = _Schedule<Env, In, Out>;
|
package/_common.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
export * as Cause from "@effect/io/Cause";
|
|
2
|
-
export * as Effect from "@effect/io/Effect";
|
|
3
|
-
export * as Exit from "@effect/io/Exit";
|
|
4
|
-
export * as Layer from "@effect/io/Layer";
|
|
5
|
-
export * as Queue from "@effect/io/Queue";
|
|
6
|
-
export * as Schedule from "@effect/io/Schedule";
|
|
7
|
-
export * as Scope from "@effect/io/Scope";
|
|
8
|
-
export * as Stream from "@effect/stream/Stream";
|
|
9
|
-
export * as Chunk from "@fp-ts/data/Chunk";
|
|
10
|
-
export * as Context from "@fp-ts/data/Context";
|
|
11
|
-
export * as Duration from "@fp-ts/data/Duration";
|
|
12
|
-
export * as Equal from "@fp-ts/data/Equal";
|
|
13
|
-
export * as Either from "@fp-ts/data/Either";
|
|
14
|
-
export * as HashMap from "@fp-ts/data/HashMap";
|
|
15
|
-
export * as Option from "@fp-ts/data/Option";
|
|
16
|
-
export * as Ref from "@effect/io/Ref";
|
|
17
|
-
export * as HashSet from "@fp-ts/data/HashSet";
|
|
18
|
-
export { pipe, flow, identity } from "@fp-ts/data/Function";
|
|
19
1
|
export * as Discord from "./types.js";
|
|
20
2
|
//# sourceMappingURL=_common.js.map
|
package/_common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_common.js","sourceRoot":"","sources":["../src/_common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_common.js","sourceRoot":"","sources":["../src/_common.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAA"}
|
package/gateway.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config, Log } from "dfx";
|
|
2
|
-
import { Layer } from "./_common.js";
|
|
3
2
|
export * as CachePrelude from "./Cache/prelude.js";
|
|
4
3
|
export * as DiscordWS from "./DiscordGateway/DiscordWS/index.js";
|
|
5
4
|
export * as Gateway from "./DiscordGateway/index.js";
|
|
@@ -7,9 +6,9 @@ export * as Shard from "./DiscordGateway/Shard/index.js";
|
|
|
7
6
|
export * as ShardStore from "./DiscordGateway/ShardStore/index.js";
|
|
8
7
|
export * as WS from "./DiscordGateway/WS/index.js";
|
|
9
8
|
export { run as runIx } from "./Interactions/gateway.js";
|
|
10
|
-
export declare const MemoryRateLimit:
|
|
11
|
-
export declare const MemoryREST:
|
|
12
|
-
export declare const MemorySharder:
|
|
13
|
-
export declare const MemoryGateway:
|
|
14
|
-
export declare const MemoryBot:
|
|
15
|
-
export declare const make: (config: Config.MakeOpts, debug?: boolean) =>
|
|
9
|
+
export declare const MemoryRateLimit: import("./_common.js").Layer<Log.Log, never, import("dfx").RateLimitStore | import("dfx").RateLimiter>;
|
|
10
|
+
export declare const MemoryREST: import("./_common.js").Layer<Config.DiscordConfig | Log.Log, never, import("dfx").DiscordREST>;
|
|
11
|
+
export declare const MemorySharder: import("./_common.js").Layer<Config.DiscordConfig | Log.Log, never, import("./DiscordGateway/Sharder/index.js").Sharder>;
|
|
12
|
+
export declare const MemoryGateway: import("./_common.js").Layer<Config.DiscordConfig | Log.Log, never, import("./DiscordGateway/index.js").DiscordGateway>;
|
|
13
|
+
export declare const MemoryBot: import("./_common.js").Layer<Config.DiscordConfig | Log.Log, never, import("dfx").DiscordREST | import("dfx").RateLimitStore | import("dfx").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
|
|
14
|
+
export declare const make: (config: Config.MakeOpts, debug?: boolean) => import("./_common.js").Layer<never, never, import("dfx").DiscordREST | Config.DiscordConfig | Log.Log | import("dfx").RateLimitStore | import("dfx").RateLimiter | import("./DiscordGateway/index.js").DiscordGateway>;
|