dfx 0.110.2 → 0.111.0

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.
@@ -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 * as Helpers from "dfx/Helpers/interactions"
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.110.2";
1
+ export const LIB_VERSION = "0.111.0";
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const LIB_VERSION = "0.110.2";
1
+ export declare const LIB_VERSION = "0.111.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LIB_VERSION = void 0;
7
- const LIB_VERSION = exports.LIB_VERSION = "0.110.2";
7
+ const LIB_VERSION = exports.LIB_VERSION = "0.111.0";
8
8
  //# sourceMappingURL=version.js.map