dfx 0.110.2 → 0.111.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/Interactions/commandHelper.d.ts +99 -0
- package/Interactions/commandHelper.d.ts.map +1 -0
- package/Interactions/commandHelper.js +54 -0
- package/Interactions/commandHelper.js.map +1 -0
- package/Interactions/context.d.ts +4 -18
- package/Interactions/context.d.ts.map +1 -1
- package/Interactions/context.js +1 -19
- package/Interactions/context.js.map +1 -1
- package/Interactions/definitions.d.ts +2 -88
- package/Interactions/definitions.d.ts.map +1 -1
- package/Interactions/definitions.js.map +1 -1
- package/Interactions/utils.d.ts +1 -1
- package/Interactions/utils.d.ts.map +1 -1
- package/Interactions/utils.js +2 -14
- package/Interactions/utils.js.map +1 -1
- package/mjs/Interactions/commandHelper.mjs +45 -0
- package/mjs/Interactions/commandHelper.mjs.map +1 -0
- package/mjs/Interactions/context.mjs +0 -14
- package/mjs/Interactions/context.mjs.map +1 -1
- package/mjs/Interactions/definitions.mjs.map +1 -1
- package/mjs/Interactions/utils.mjs +2 -14
- package/mjs/Interactions/utils.mjs.map +1 -1
- package/mjs/version.mjs +1 -1
- package/package.json +2 -2
- package/src/Interactions/commandHelper.ts +236 -0
- package/src/Interactions/context.ts +3 -72
- package/src/Interactions/definitions.ts +1 -185
- package/src/Interactions/utils.ts +3 -18
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as Chunk from "effect/Chunk"
|
|
2
2
|
import * as Effect from "effect/Effect"
|
|
3
|
-
import * as Ctx from "dfx/Interactions/context"
|
|
4
3
|
import type * as D from "dfx/Interactions/definitions"
|
|
5
|
-
import * as Discord from "dfx/types"
|
|
4
|
+
import type * as Discord from "dfx/types"
|
|
6
5
|
import * as Array from "effect/Array"
|
|
7
|
-
import
|
|
6
|
+
import { CommandHelper } from "./commandHelper"
|
|
8
7
|
|
|
9
8
|
export type DefinitionFlattened<R, E, TE, A> =
|
|
10
9
|
D.InteractionDefinition<R, E> extends infer D
|
|
@@ -20,14 +19,6 @@ export type DefinitionFlattenedCommand<R, E, TE, A> = Extract<
|
|
|
20
19
|
{ _tag: "GlobalApplicationCommand" | "GuildApplicationCommand" }
|
|
21
20
|
>
|
|
22
21
|
|
|
23
|
-
const context: D.CommandHelper<any> = {
|
|
24
|
-
resolve: Ctx.resolved,
|
|
25
|
-
option: Ctx.option,
|
|
26
|
-
optionValue: Ctx.optionValue,
|
|
27
|
-
optionValueOptional: Ctx.optionValueOptional,
|
|
28
|
-
subCommands: Ctx.handleSubCommands,
|
|
29
|
-
} as any
|
|
30
|
-
|
|
31
22
|
export const flattenDefinitions = <R, E, TE, A, B>(
|
|
32
23
|
definitions: Chunk.Chunk<
|
|
33
24
|
readonly [
|
|
@@ -60,13 +51,7 @@ export const flattenDefinitions = <R, E, TE, A, B>(
|
|
|
60
51
|
definition.handle as (
|
|
61
52
|
_: any,
|
|
62
53
|
) => Effect.Effect<Discord.InteractionResponse>
|
|
63
|
-
)(
|
|
64
|
-
...context,
|
|
65
|
-
target:
|
|
66
|
-
i.type === Discord.InteractionType.APPLICATION_COMMAND
|
|
67
|
-
? Helpers.target(i.data as any)
|
|
68
|
-
: undefined,
|
|
69
|
-
}),
|
|
54
|
+
)(new CommandHelper(i)),
|
|
70
55
|
_ => handleResponse(i, _),
|
|
71
56
|
),
|
|
72
57
|
),
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.
|
|
1
|
+
export const LIB_VERSION = "0.111.1";
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.
|
|
1
|
+
export declare const LIB_VERSION = "0.111.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED