dfx 0.9.10 → 0.9.12
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/Interactions/context.d.ts +17 -11
- package/Interactions/context.js +9 -5
- package/Interactions/context.js.map +1 -1
- package/Interactions/gateway.d.ts +2 -1
- package/Interactions/gateway.js.map +1 -1
- package/Interactions/handlers.d.ts +4 -3
- package/Interactions/handlers.js +7 -7
- package/Interactions/handlers.js.map +1 -1
- package/Interactions/webhook.d.ts +2 -1
- package/Interactions/webhook.js.map +1 -1
- package/common.d.ts +1 -1
- package/common.js +0 -1
- package/common.js.map +1 -1
- package/global.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Discord,
|
|
1
|
+
import { Discord, Maybe } from "dfx/common";
|
|
2
2
|
import { InteractionResponse } from "./definitions.js";
|
|
3
|
+
import { EffectTypeId, Effect } from "@effect/io/Effect";
|
|
3
4
|
export declare const InteractionContext: import("../common.js").Tag<import("../types.js").Interaction>;
|
|
4
5
|
export declare const ApplicationCommandContext: import("../common.js").Tag<import("../types.js").ApplicationCommandDatum>;
|
|
5
6
|
export declare const MessageComponentContext: import("../common.js").Tag<import("../types.js").MessageComponentDatum>;
|
|
@@ -12,25 +13,30 @@ export interface SubCommandContext {
|
|
|
12
13
|
readonly command: Discord.ApplicationCommandInteractionDataOption;
|
|
13
14
|
}
|
|
14
15
|
export declare const SubCommandContext: import("../common.js").Tag<SubCommandContext>;
|
|
15
|
-
export declare const getCommand:
|
|
16
|
+
export declare const getCommand: Effect<import("../types.js").ApplicationCommandDatum, never, import("../types.js").ApplicationCommandDatum>;
|
|
16
17
|
export declare class ResolvedDataNotFound {
|
|
17
18
|
readonly data: Discord.ApplicationCommandDatum;
|
|
18
19
|
readonly name: string;
|
|
19
20
|
readonly _tag = "ResolvedDataNotFound";
|
|
20
21
|
constructor(data: Discord.ApplicationCommandDatum, name: string);
|
|
21
22
|
}
|
|
22
|
-
export declare const getResolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) =>
|
|
23
|
-
export declare const focusedOptionValue:
|
|
24
|
-
export declare const commandOptionsMap:
|
|
25
|
-
export declare
|
|
23
|
+
export declare const getResolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<import("../types.js").ApplicationCommandDatum, ResolvedDataNotFound, A>;
|
|
24
|
+
export declare const focusedOptionValue: Effect<FocusedOptionContext, never, string>;
|
|
25
|
+
export declare const commandOptionsMap: Effect<import("../types.js").ApplicationCommandDatum, never, Record<string, string | undefined>>;
|
|
26
|
+
export declare class SubCommandNotFound {
|
|
27
|
+
readonly data: Discord.ApplicationCommandDatum;
|
|
28
|
+
readonly _tag = "SubCommandNotFound";
|
|
29
|
+
constructor(data: Discord.ApplicationCommandDatum);
|
|
30
|
+
}
|
|
31
|
+
export declare const handleSubCommands: <NER extends Record<string, Effect<any, any, import("../common.js").Maybe<InteractionResponse>>>>(commands: NER) => Effect<import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | Exclude<[NER[keyof NER]] extends [{
|
|
26
32
|
[EffectTypeId]: {
|
|
27
33
|
_R: (_: never) => infer R;
|
|
28
34
|
};
|
|
29
|
-
}] ? R : never, SubCommandContext>, [NER[keyof NER]] extends [{
|
|
35
|
+
}] ? R : never, SubCommandContext>, SubCommandNotFound | ([NER[keyof NER]] extends [{
|
|
30
36
|
[EffectTypeId]: {
|
|
31
37
|
_E: (_: never) => infer E;
|
|
32
38
|
};
|
|
33
|
-
}] ? E : never, import("../common.js").Maybe<InteractionResponse>>;
|
|
34
|
-
export declare const getSubCommand:
|
|
35
|
-
export declare const subCommandOptionsMap:
|
|
36
|
-
export declare const modalValues:
|
|
39
|
+
}] ? E : never), import("../common.js").Maybe<InteractionResponse>>;
|
|
40
|
+
export declare const getSubCommand: Effect<SubCommandContext, never, import("../types.js").ApplicationCommandInteractionDataOption>;
|
|
41
|
+
export declare const subCommandOptionsMap: Effect<SubCommandContext, never, Record<string, string | undefined>>;
|
|
42
|
+
export declare const modalValues: Effect<import("../types.js").ModalSubmitDatum, never, Record<string, string | undefined>>;
|
package/Interactions/context.js
CHANGED
|
@@ -2,9 +2,9 @@ import * as tsplus_module_1 from "dfx/common";
|
|
|
2
2
|
import * as tsplus_module_2 from "@effect/io/Effect";
|
|
3
3
|
import * as tsplus_module_3 from "@fp-ts/data/Option";
|
|
4
4
|
import * as tsplus_module_4 from "@fp-ts/data/Function";
|
|
5
|
-
import { InteractionNotFound } from "./handlers.js";
|
|
6
5
|
import * as Arr from "@fp-ts/data/ReadonlyArray";
|
|
7
6
|
import { optionsMap } from "dfx/Helpers/interactions";
|
|
7
|
+
import { EffectTypeId } from "@effect/io/Effect";
|
|
8
8
|
export const InteractionContext = tsplus_module_1.Tag();
|
|
9
9
|
export const ApplicationCommandContext = tsplus_module_1.Tag();
|
|
10
10
|
export const MessageComponentContext = tsplus_module_1.Tag();
|
|
@@ -24,10 +24,14 @@ export class ResolvedDataNotFound {
|
|
|
24
24
|
export const getResolved = (name, f) => tsplus_module_2.serviceWithEffect(ApplicationCommandContext)((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new ResolvedDataNotFound(a, name)), tsplus_module_2.succeed)(tsplus_module_1.IxHelpers.resolveOptionValue(name, f)(a)));
|
|
25
25
|
export const focusedOptionValue = tsplus_module_2.serviceWith(FocusedOptionContext)((a) => a.focusedOption.value ?? "");
|
|
26
26
|
export const commandOptionsMap = tsplus_module_2.serviceWith(ApplicationCommandContext)(optionsMap);
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export class SubCommandNotFound {
|
|
28
|
+
data;
|
|
29
|
+
_tag = "SubCommandNotFound";
|
|
30
|
+
constructor(data) {
|
|
31
|
+
this.data = data;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const handleSubCommands = (commands) => tsplus_module_2.flatMap((data) => tsplus_module_4.pipe(tsplus_module_1.IxHelpers.allSubCommands(data), Arr.findFirst((a) => !!commands[a.name]), (o) => tsplus_module_3.toEither(() => new SubCommandNotFound(data))(o), tsplus_module_2.fromEither, (a) => tsplus_module_2.flatMap((command) => tsplus_module_4.pipe(commands[command.name], tsplus_module_2.provideService(SubCommandContext)({ command })))(a)))(tsplus_module_2.service(ApplicationCommandContext));
|
|
31
35
|
export const getSubCommand = tsplus_module_2.serviceWith(SubCommandContext)((a) => a.command);
|
|
32
36
|
export const subCommandOptionsMap = tsplus_module_2.map(tsplus_module_1.IxHelpers.optionsMap)(getSubCommand);
|
|
33
37
|
export const modalValues = tsplus_module_2.serviceWith(ModalSubmitContext)(tsplus_module_1.IxHelpers.componentsMap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":";;;;AAEA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAA;AAExD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAA,GAAG,EAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAA,GAAG,EAAmC,CAAA;AAC/E,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAA,GAAG,EAAiC,CAAA;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAA,GAAG,EAA4B,CAAA;AAKjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAA,GAAG,EAAwB,CAAA;AAK/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAA,GAAG,EAAqB,CAAA;AAEzD,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAe,yBAAyB,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,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAA7C,CAAC,CAA6C,8BAErD,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAU,CAAC,OAAO,EAAE,EAAE,CACpB,gBAAA,IAAI,CACF,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EACtB,+BAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CACtD,EAJH,CAAC,CAKA,CACJ,EAbH,wBAAe,yBAAyB,CAAC,CAcxC,CAAA;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,4BAAmB,iBAAiB,CAAC,CAChE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CACjB,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAkB,gBAAA,SAAS,CAAC,UAAU,EAAtC,aAAa,CAA0B,CAAA;AAE3E,MAAM,CAAC,MAAM,WAAW,GAAG,4BAAmB,kBAAkB,CAAC,CAC/D,gBAAA,SAAS,CAAC,aAAa,CACxB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Http, Effect } from "dfx/common";
|
|
2
|
+
import { DefinitionNotFound } from "./handlers.js";
|
|
2
3
|
import { InteractionBuilder } from "./index.js";
|
|
3
4
|
export interface RunOpts {
|
|
4
5
|
sync?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const run: <R2, E, E2>(catchAll: (e: import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E) => import("../common.js").Effect<R2, E2, any>, { sync }?: RunOpts) => <R>(ix: InteractionBuilder<R, E>) => import("../common.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | R2 | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
|
|
7
|
+
export declare const run: <R2, E, E2>(catchAll: (e: import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | DefinitionNotFound | E) => import("../common.js").Effect<R2, E2, any>, { sync }?: RunOpts) => <R>(ix: InteractionBuilder<R, E>) => import("../common.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | R2 | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAM7C,MAAM,CAAC,MAAM,GAAG,GACd,CACE,QAOwB,EACxB,EAAE,IAAI,GAAG,IAAI,KAAc,EAAE,EAC7B,EAAE,CACJ,CAAI,EAA4B,EAAE,EAAE;IAEhC,MAAM,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,GACzD,gBAAgB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;mCAE5B,WAAW;QAIjB,MAAM,UAAU,GAAG,gBAAA,IAAI,CAAC,IAAI,CAAC,sCAAsC,CACjE,WAAW,CAAC,EAAE,EACd;YACE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;SACrE,CACF,CAAA;QAED,MAAM,SAAS,GAAG,uBAAuB,CAAC,MAAM;YAC9C,CAAC,CAAC,gBAAA,OAAO,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAC3C,gBAAA,IAAI,CAAC,IAAI,CAAC,qCAAqC,CAC7C,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,gBAAA,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC7D,yBAMY,QAAQ,EANpB,oBACO,CAAC,CAAC,EAAE,EAAE,CACT,4CAAqB,CAAC,CAAC,EAAE,EAAE,CACzB,gBAAA,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EADvD,CAAC,CAEA,EAJL,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAKd,CACkB,CACtB,CAAA;iDAEC,IAAI,CAAC,CAAC,CAAC,uBAA8B,SAAS,EAAvC,uBAAW,UAAU,EAArB,GAAG,CAAmB,CAAkB,CAAC,CAAC,CAAC,GAAG;OAhCrD,wBAAwD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAArE,gBAAA,IAAI,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAuB;IAiCxE,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Discord, Effect, Maybe } from "dfx/common";
|
|
2
2
|
import * as D from "./definitions.js";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class DefinitionNotFound {
|
|
4
4
|
readonly interaction: Discord.Interaction;
|
|
5
|
-
readonly _tag = "
|
|
5
|
+
readonly _tag = "DefinitionNotFound";
|
|
6
6
|
constructor(interaction: Discord.Interaction);
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type Handler<R, E> = Effect<R, E | DefinitionNotFound, Maybe<Discord.InteractionResponse>>;
|
|
9
|
+
export declare const handlers: <R, E>(definitions: D.InteractionDefinition<R, E>[]) => Record<import("../types.js").InteractionType, (i: Discord.Interaction) => Handler<R, E>>;
|
package/Interactions/handlers.js
CHANGED
|
@@ -6,9 +6,9 @@ import * as tsplus_module_5 from "@fp-ts/data/Chunk";
|
|
|
6
6
|
import * as Ctx from "./context.js";
|
|
7
7
|
import * as Arr from "@fp-ts/data/ReadonlyArray";
|
|
8
8
|
import { splitDefinitions } from "./utils.js";
|
|
9
|
-
export class
|
|
9
|
+
export class DefinitionNotFound {
|
|
10
10
|
interaction;
|
|
11
|
-
_tag = "
|
|
11
|
+
_tag = "DefinitionNotFound";
|
|
12
12
|
constructor(interaction) {
|
|
13
13
|
this.interaction = interaction;
|
|
14
14
|
}
|
|
@@ -21,28 +21,28 @@ export const handlers = (definitions) => {
|
|
|
21
21
|
})),
|
|
22
22
|
[tsplus_module_1.Discord.InteractionType.APPLICATION_COMMAND]: (i) => {
|
|
23
23
|
const data = i.data;
|
|
24
|
-
return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new
|
|
24
|
+
return tsplus_module_4.pipe(tsplus_module_3.match(() => tsplus_module_2.fail(new DefinitionNotFound(i)), (command) => command.handle)(tsplus_module_3.fromNullable(Commands[data.name])), (a) => a, tsplus_module_2.provideService(Ctx.InteractionContext)(i), tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data));
|
|
25
25
|
},
|
|
26
26
|
[tsplus_module_1.Discord.InteractionType.MODAL_SUBMIT]: (i) => {
|
|
27
27
|
const data = i.data;
|
|
28
28
|
return tsplus_module_4.pipe(ModalSubmit, Arr.map((a) => tsplus_module_2.struct({
|
|
29
29
|
command: tsplus_module_2.succeed(a),
|
|
30
30
|
match: a.predicate(data.custom_id),
|
|
31
|
-
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new
|
|
31
|
+
})), (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.InteractionContext)(i), tsplus_module_2.provideService(Ctx.ModalSubmitContext)(data));
|
|
32
32
|
},
|
|
33
33
|
[tsplus_module_1.Discord.InteractionType.MESSAGE_COMPONENT]: (i) => {
|
|
34
34
|
const data = i.data;
|
|
35
35
|
return tsplus_module_4.pipe(MessageComponent, Arr.map((a) => tsplus_module_2.struct({
|
|
36
36
|
command: tsplus_module_2.succeed(a),
|
|
37
37
|
match: a.predicate(data.custom_id),
|
|
38
|
-
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new
|
|
38
|
+
})), (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.InteractionContext)(i), tsplus_module_2.provideService(Ctx.MessageComponentContext)(data));
|
|
39
39
|
},
|
|
40
40
|
[tsplus_module_1.Discord.InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE]: (i) => {
|
|
41
41
|
const data = i.data;
|
|
42
|
-
return tsplus_module_3.getOrElse(() => tsplus_module_2.fail(new
|
|
42
|
+
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({
|
|
43
43
|
command: tsplus_module_2.succeed(a),
|
|
44
44
|
match: a.predicate(focusedOption),
|
|
45
|
-
})), (a) => tsplus_module_2.flatMap((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new
|
|
45
|
+
})), (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.InteractionContext)(i), tsplus_module_2.provideService(Ctx.ApplicationCommandContext)(data), tsplus_module_2.provideService(Ctx.FocusedOptionContext)({ focusedOption })))(tsplus_module_1.IxHelpers.focusedOption(data)));
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/Interactions/handlers.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AAEnC,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,OAAO,kBAAkB;IAER;IADZ,IAAI,GAAG,oBAAoB,CAAA;IACpC,YAAqB,WAAgC;QAAhC,gBAAW,GAAX,WAAW,CAAqB;IAAG,CAAC;CAC1D;AAQD,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,WAA4C,EAI5C,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAC7D,gBAAgB,CAAC,WAAW,CAAC,CAAA;IAE/B,OAAO;QACL,CAAC,gBAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,wBACnC,wBAAe;YACb,IAAI,EAAE,gBAAA,OAAO,CAAC,uBAAuB,CAAC,IAAI;SAC3C,CAAC,CAAO;QAEX,C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AAI,CACF,YAAY,EACZ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACZ,uBAAc;gBACZ,OAAO,EAAE,wBAAe,CAAC,CAAC;gBAC1B,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC;aAClC,CAAC,CACH,EACD,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAwB,CAAC,CAAC,EAAE,EAAE,CAC5B,sBAGI,GAAG,EAAE,CACH,qBAAY,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAkB,EACzD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAL3B,0BACa,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAD3B,CAAC,CAC2B,CAKzB,gCAPL,CAAC,EAQA,EACH,+BAAsB,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAChD,+BAAsB,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,EAC1D,+BAAsB,GAAG,CAAC,oBAAoB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CACnE,EAvBE,gBAAA,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAwBjC,CAC8D,CAAA;QACnE,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Discord, Effect, Cause } from "dfx/common";
|
|
2
|
+
import { DefinitionNotFound } from "./handlers.js";
|
|
2
3
|
import { InteractionBuilder } from "./index.js";
|
|
3
4
|
export declare class BadWebhookSignature {
|
|
4
5
|
readonly _tag = "BadWebhookSignature";
|
|
@@ -28,5 +29,5 @@ export interface HandleWebhookOpts<E> {
|
|
|
28
29
|
error: (e: Cause<E>) => Effect<never, never, void>;
|
|
29
30
|
empty: Effect<never, never, void>;
|
|
30
31
|
}
|
|
31
|
-
export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body, success, empty, error, }: HandleWebhookOpts<BadWebhookSignature | WebhookParseError | E>) => import("../common.js").Effect<WebhookConfig | R, never, void>;
|
|
32
|
+
export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body, success, empty, error, }: HandleWebhookOpts<DefinitionNotFound | BadWebhookSignature | WebhookParseError | E>) => import("../common.js").Effect<WebhookConfig | R, never, void>;
|
|
32
33
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/Interactions/webhook.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,
|
|
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;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,OAAO,mBAAmB;IACrB,IAAI,GAAG,qBAAqB,CAAA;CACtC;AAID,MAAM,cAAc,GAAG,CACrB,SAAqB,EACrB,OAAgB,EAChB,IAAY,EACZ,EAAE,wBACF,yBAYY,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE,EAZ3C,uBAIU,CAAC,CAAC,EAAE,EAAE;IACZ,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAA;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC9B,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,EAC9B,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EACzB,SAAS,CACV,CAAA;AACH,CAAC,EAXH,uBAAa;IACX,SAAS,EAAE,6BAAmB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC7D,SAAS,EAAE,6BAAmB,OAAO,C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,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;IAElC,OAAO,CAAC,EACN,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,GAGN,EAAE,EAAE,CACH,8BAOiB,KAAK,EAPtB,wBACW,CAAC,CAAC,EAAE,EAAE,CACb,sBACE,GAAG,EAAE,CAAC,KAAK,EACX,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAFnB,CAAC,CAGA,EALL,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAMlB,CACoB,CAAA;AAC3B,CAAC,CAAA"}
|
package/common.d.ts
CHANGED
package/common.js
CHANGED
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":"AAKA,OAAO,EAAW,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAWlD,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAA;AACjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAA;AAC7C,OAAO,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAA"}
|
package/global.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @tsplus global
|
|
3
3
|
*/
|
|
4
|
-
import type { Effect,
|
|
4
|
+
import type { Effect, Layer, Either, Maybe, Tag, Context, Cause, Chunk, Duration, Equal, Exit, HashMap, Schedule, EffectSource, EffectSink, Ref, Config, Discord, Http, Log, RateLimitStore, Rest, Ix, Flags, Intents, IxHelpers, Members, Perms, UI, } from "dfx/common";
|
|
5
5
|
/**
|
|
6
6
|
* @tsplus global
|
|
7
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"@fp-ts/data": "^0.0.20"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e9f5d544e6a90ffbe3a19c9c1427932804ca64c6"
|
|
51
51
|
}
|