dfx 0.13.4 → 0.15.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.
Files changed (84) hide show
  1. package/DiscordConfig/index.d.ts +7 -6
  2. package/DiscordConfig/index.js +10 -9
  3. package/DiscordConfig/index.js.map +1 -1
  4. package/DiscordGateway/DiscordWS/index.d.ts +7 -6
  5. package/DiscordGateway/DiscordWS/index.js +10 -9
  6. package/DiscordGateway/DiscordWS/index.js.map +1 -1
  7. package/DiscordGateway/Shard/heartbeats.d.ts +6 -2
  8. package/DiscordGateway/Shard/heartbeats.js +2 -2
  9. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  10. package/DiscordGateway/Shard/identify.d.ts +4 -1
  11. package/DiscordGateway/Shard/identify.js +1 -1
  12. package/DiscordGateway/Shard/index.d.ts +4 -4
  13. package/DiscordGateway/Shard/index.js +5 -5
  14. package/DiscordGateway/Shard/index.js.map +1 -1
  15. package/DiscordGateway/Shard/invalidSession.d.ts +5 -2
  16. package/DiscordGateway/Shard/invalidSession.js +2 -2
  17. package/DiscordGateway/Shard/invalidSession.js.map +1 -1
  18. package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
  19. package/DiscordGateway/Shard/sendEvents.js +1 -1
  20. package/DiscordGateway/Shard/utils.d.ts +5 -2
  21. package/DiscordGateway/ShardStore/index.d.ts +4 -3
  22. package/DiscordGateway/ShardStore/index.js +1 -1
  23. package/DiscordGateway/Sharder/index.d.ts +6 -3
  24. package/DiscordGateway/Sharder/index.js +4 -5
  25. package/DiscordGateway/Sharder/index.js.map +1 -1
  26. package/DiscordGateway/WS/index.d.ts +3 -2
  27. package/DiscordGateway/WS/index.js +1 -1
  28. package/DiscordGateway/index.d.ts +9 -7
  29. package/DiscordGateway/index.js +1 -1
  30. package/DiscordREST/index.d.ts +6 -5
  31. package/DiscordREST/index.js +6 -5
  32. package/DiscordREST/index.js.map +1 -1
  33. package/DiscordREST/types.d.ts +2 -1
  34. package/DiscordREST/utils.d.ts +4 -4
  35. package/Helpers/intents.js +1 -1
  36. package/Helpers/interactions.d.ts +15 -10
  37. package/Helpers/interactions.js +7 -3
  38. package/Helpers/interactions.js.map +1 -1
  39. package/Helpers/members.d.ts +1 -1
  40. package/Helpers/permissions.d.ts +1 -1
  41. package/Helpers/permissions.js +1 -1
  42. package/Http/index.d.ts +7 -7
  43. package/Interactions/context.d.ts +14 -13
  44. package/Interactions/context.js +3 -2
  45. package/Interactions/context.js.map +1 -1
  46. package/Interactions/definitions.d.ts +7 -6
  47. package/Interactions/gateway.d.ts +3 -2
  48. package/Interactions/gateway.js +6 -6
  49. package/Interactions/gateway.js.map +1 -1
  50. package/Interactions/handlers.d.ts +2 -1
  51. package/Interactions/handlers.js +1 -1
  52. package/Interactions/index.d.ts +7 -8
  53. package/Interactions/index.js +4 -6
  54. package/Interactions/index.js.map +1 -1
  55. package/Interactions/webhook.d.ts +7 -5
  56. package/Interactions/webhook.js +1 -1
  57. package/Log/index.d.ts +7 -7
  58. package/Log/index.js +1 -1
  59. package/RateLimitStore/index.d.ts +9 -7
  60. package/RateLimitStore/index.js +3 -2
  61. package/RateLimitStore/index.js.map +1 -1
  62. package/RateLimitStore/memory.d.ts +2 -2
  63. package/RateLimitStore/memory.js.map +1 -1
  64. package/RateLimitStore/utils.d.ts +1 -1
  65. package/gateway.d.ts +12 -0
  66. package/gateway.js +20 -0
  67. package/gateway.js.map +1 -0
  68. package/global.d.ts +72 -3
  69. package/global.js +1 -1
  70. package/global.js.map +1 -1
  71. package/index.d.ts +2 -10
  72. package/index.js +2 -17
  73. package/index.js.map +1 -1
  74. package/package.json +2 -2
  75. package/utils/effect.d.ts +1 -1
  76. package/webhooks.d.ts +6 -15
  77. package/webhooks.js +7 -16
  78. package/webhooks.js.map +1 -1
  79. package/common-gateway.d.ts +0 -5
  80. package/common-gateway.js +0 -6
  81. package/common-gateway.js.map +0 -1
  82. package/common.d.ts +0 -28
  83. package/common.js +0 -15
  84. package/common.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "dfx";
2
2
  /**
3
3
  * All the intents
4
4
  */
@@ -1,4 +1,5 @@
1
- import { Discord, Maybe } from "dfx/common";
1
+ import { Discord } from "dfx";
2
+ import { Maybe } from "@fp-ts/data/Option";
2
3
  /**
3
4
  * Maybe find a sub-command within the interaction options.
4
5
  */
@@ -6,7 +7,7 @@ export declare const allSubCommands: (interaction: Discord.ApplicationCommandDat
6
7
  /**
7
8
  * Maybe find a sub-command within the interaction options.
8
9
  */
9
- export declare const findSubCommand: (name: string) => (interaction: Discord.ApplicationCommandDatum) => import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
10
+ export declare const findSubCommand: (name: string) => (interaction: Discord.ApplicationCommandDatum) => import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
10
11
  /**
11
12
  * If the sub-command exists return `true`, else `false`.
12
13
  */
@@ -14,7 +15,7 @@ export declare const isSubCommand: (name: string) => (interaction: import("../ty
14
15
  /**
15
16
  * Maybe get the options for a sub-command
16
17
  */
17
- export declare const subCommandOptions: (name: string) => (interaction: import("../types.js").ApplicationCommandDatum) => import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption[]>;
18
+ export declare const subCommandOptions: (name: string) => (interaction: import("../types.js").ApplicationCommandDatum) => import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption[]>;
18
19
  /**
19
20
  * A lens for accessing nested options in a interaction.
20
21
  */
@@ -30,23 +31,27 @@ export declare const optionsMap: (data: Pick<import("../types.js").ApplicationCo
30
31
  /**
31
32
  * Try find a matching option from the interaction.
32
33
  */
33
- export declare const getOption: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
34
+ export declare const getOption: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
34
35
  /**
35
36
  * Try find a matching option from the interaction.
36
37
  */
37
- export declare const focusedOption: (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
38
+ export declare const focusedOption: (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>;
38
39
  /**
39
40
  * Try find a matching option value from the interaction.
40
41
  */
41
- export declare const optionValue: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../common.js").Maybe<string>;
42
+ export declare const optionValue: (name: string) => (data: Pick<import("../types.js").ApplicationCommandDatum, "options">) => import("../global.js").Maybe<string>;
42
43
  /**
43
44
  * Try extract resolved data
44
45
  */
45
- export declare const resolved: (data: Discord.ApplicationCommandDatum) => import("../common.js").Maybe<import("../types.js").ResolvedDatum>;
46
+ export declare const resolved: (data: Discord.Interaction) => import("../global.js").Maybe<import("../types.js").ResolvedDatum>;
46
47
  /**
47
48
  * Try find a matching option value from the interaction.
48
49
  */
49
- export declare const resolveOptionValue: <T>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.ApplicationCommandDatum) => import("../common.js").Maybe<T>;
50
+ export declare const resolveOptionValue: <T>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../global.js").Maybe<T>;
51
+ /**
52
+ * Try find matching option values from the interaction.
53
+ */
54
+ export declare const resolveValues: <T>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => T | undefined) => (a: Discord.Interaction) => import("../global.js").Maybe<readonly T[]>;
50
55
  /**
51
56
  * A lens for accessing the components in a interaction.
52
57
  */
@@ -66,11 +71,11 @@ export declare const componentsMap: (a: import("../types.js").ModalSubmitDatum)
66
71
  /**
67
72
  * Try find a matching component from the interaction.
68
73
  */
69
- export declare const getComponent: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../common.js").Maybe<import("../types.js").Component>;
74
+ export declare const getComponent: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../global.js").Maybe<import("../types.js").Component>;
70
75
  /**
71
76
  * Try find a matching component value from the interaction.
72
77
  */
73
- export declare const componentValue: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../common.js").Maybe<string>;
78
+ export declare const componentValue: (id: string) => (a: import("../types.js").ModalSubmitDatum) => import("../global.js").Maybe<string>;
74
79
  export type InteractionResponse = {
75
80
  type: Discord.InteractionCallbackType.CHANNEL_MESSAGE_WITH_SOURCE;
76
81
  data: Discord.InteractionCallbackMessage;
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "dfx";
2
2
  import * as tsplus_module_2 from "@fp-ts/data/Function";
3
3
  import * as tsplus_module_3 from "@fp-ts/data/Option";
4
4
  import * as Arr from "@fp-ts/data/ReadonlyArray";
@@ -52,11 +52,15 @@ export const optionValue = (name) => tsplus_module_2.flow(getOption(name), (o) =
52
52
  /**
53
53
  * Try extract resolved data
54
54
  */
55
- export const resolved = (data) => tsplus_module_3.fromNullable(data.resolved);
55
+ export const resolved = (data) => tsplus_module_3.flatMapNullable((a) => a.resolved)(tsplus_module_3.fromNullable(data.data));
56
56
  /**
57
57
  * Try find a matching option value from the interaction.
58
58
  */
59
- export const resolveOptionValue = (name, f) => (a) => tsplus_module_3.flatMap(id => tsplus_module_3.flatMap(data => tsplus_module_3.fromNullable(f(id, data)))(resolved(a)))(tsplus_module_3.flatMapNullable(({ value }) => value)(getOption(name)(a)));
59
+ export const resolveOptionValue = (name, f) => (a) => tsplus_module_3.flatMap(data => tsplus_module_3.flatMap(id => tsplus_module_3.flatMap(r => tsplus_module_3.fromNullable(f(id, r)))(resolved(a)))(tsplus_module_3.flatMapNullable(({ value }) => value)(getOption(name)(data))))(tsplus_module_3.fromNullable(a.data));
60
+ /**
61
+ * Try find matching option values from the interaction.
62
+ */
63
+ export const resolveValues = (f) => (a) => tsplus_module_3.flatMap(values => tsplus_module_3.flatMap(r => tsplus_module_3.productAll(values.map((a) => tsplus_module_3.fromNullable(f(a.value, r)))))(resolved(a)))(tsplus_module_3.flatMapNullable((a) => a.values)(tsplus_module_3.fromNullable(a.data)));
60
64
  const extractComponents = (c) => {
61
65
  if ("components" in c) {
62
66
  return [...c.components, ...c.components.flatMap(extractComponents)];
@@ -1 +1 @@
1
- {"version":3,"file":"interactions.js","sourceRoot":"","sources":["../../src/Helpers/interactions.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAA4C,EAAE,EAAE,CAC7E,gBAAA,IAAI,CACF,iBAAiB,CAAC,WAAW,CAAC,EAC9B,GAAG,CAAC,MAAM,CACR,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAA,OAAO,CAAC,4BAA4B,CAAC,WAAW,CACnE,CACF,CAAA;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,WAA4C,EAAE,EAAE,CACjE,gBAAA,IAAI,CACF,iBAAiB,CAAC,WAAW,CAAC,EAC9B,GAAG,CAAC,SAAS,CACX,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,IAAI,KAAK,gBAAA,OAAO,CAAC,4BAA4B,CAAC,WAAW;IAC3D,CAAC,CAAC,IAAI,KAAK,IAAI,CAClB,CACF,CAAA;AAEL;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAC3C,gBAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,wBAAC,CAAC,CAAO,CAAC,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,iB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,CAAC,GAAG,CAAC,EACpE,EAAwC,CACzC,CAAA;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAA,IAAI,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,EAAE,CACzC,gBAAA,IAAI,CACF,UAAU,EACV,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAAuB,CAAC,SAAS,KAAK,EAAE,CAAC,CAChE,CAAA;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAU,EAAE,EAAE,CAC3C,gBAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAC3B,gCAAkB,CAAC,CAAC,EAAE,EAAE,CAAE,CAAuB,CAAC,KAAK,EAAvD,CAAC,CAAuD,CACzD,CAAA;AA0BH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAsB,EAAE,EAAE,CAAC,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Discord } from "dfx/common";
1
+ import { Discord } from "dfx";
2
2
  /**
3
3
  * From a list of roles, filter out the ones the guild member has.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Discord } from "dfx/common";
1
+ import { Discord } from "dfx";
2
2
  /**
3
3
  * A constant of all the permissions
4
4
  */
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "dfx";
2
2
  import * as tsplus_module_2 from "@fp-ts/data/Function";
3
3
  /**
4
4
  * A constant of all the permissions
package/Http/index.d.ts CHANGED
@@ -9,22 +9,22 @@ export declare class StatusCodeError {
9
9
  readonly code: number;
10
10
  constructor(response: Response);
11
11
  }
12
- export declare const request: (url: URL | string, init?: RequestInit) => import("../common.js").Effect<never, FetchError | StatusCodeError, Response>;
12
+ export declare const request: (url: URL | string, init?: RequestInit) => import("../global.js").Effect<never, FetchError | StatusCodeError, Response>;
13
13
  export declare class JsonParseError {
14
14
  readonly reason: unknown;
15
15
  readonly _tag = "JsonParseError";
16
16
  constructor(reason: unknown);
17
17
  }
18
- export declare const json: <A = unknown>(r: Response) => import("../common.js").Effect<never, JsonParseError, A>;
18
+ export declare const json: <A = unknown>(r: Response) => import("../global.js").Effect<never, JsonParseError, A>;
19
19
  export declare class BlobError {
20
20
  readonly reason: unknown;
21
21
  readonly _tag = "BlobError";
22
22
  constructor(reason: unknown);
23
23
  }
24
- export declare const blob: (r: Response) => import("../common.js").Effect<never, BlobError, Blob>;
25
- export declare const requestWithJson: <A = unknown>(url: URL | string, init?: RequestInit) => import("../common.js").Effect<never, FetchError | StatusCodeError, {
24
+ export declare const blob: (r: Response) => import("../global.js").Effect<never, BlobError, Blob>;
25
+ export declare const requestWithJson: <A = unknown>(url: URL | string, init?: RequestInit) => import("../global.js").Effect<never, FetchError | StatusCodeError, {
26
26
  response: Response;
27
- json: import("../common.js").Effect<never, JsonParseError, A>;
28
- blob: import("../common.js").Effect<never, BlobError, Blob>;
29
- text: import("../common.js").Effect<never, never, string>;
27
+ json: import("../global.js").Effect<never, JsonParseError, A>;
28
+ blob: import("../global.js").Effect<never, BlobError, Blob>;
29
+ text: import("../global.js").Effect<never, never, string>;
30
30
  }>;
@@ -1,25 +1,26 @@
1
- import { Discord } from "dfx/common";
1
+ import { Discord } from "dfx";
2
2
  import { Effect, EffectTypeId } from "@effect/io/Effect";
3
- export declare const InteractionContext: import("../common.js").Tag<import("../types.js").Interaction>;
4
- export declare const ApplicationCommandContext: import("../common.js").Tag<import("../types.js").ApplicationCommandDatum>;
5
- export declare const MessageComponentContext: import("../common.js").Tag<import("../types.js").MessageComponentDatum>;
6
- export declare const ModalSubmitContext: import("../common.js").Tag<import("../types.js").ModalSubmitDatum>;
3
+ export declare const InteractionContext: import("../global.js").Tag<import("../types.js").Interaction>;
4
+ export declare const ApplicationCommandContext: import("../global.js").Tag<import("../types.js").ApplicationCommandDatum>;
5
+ export declare const MessageComponentContext: import("../global.js").Tag<import("../types.js").MessageComponentDatum>;
6
+ export declare const ModalSubmitContext: import("../global.js").Tag<import("../types.js").ModalSubmitDatum>;
7
7
  export interface FocusedOptionContext {
8
8
  readonly focusedOption: Discord.ApplicationCommandInteractionDataOption;
9
9
  }
10
- export declare const FocusedOptionContext: import("../common.js").Tag<FocusedOptionContext>;
10
+ export declare const FocusedOptionContext: import("../global.js").Tag<FocusedOptionContext>;
11
11
  export interface SubCommandContext {
12
12
  readonly command: Discord.ApplicationCommandInteractionDataOption;
13
13
  }
14
- export declare const SubCommandContext: import("../common.js").Tag<SubCommandContext>;
14
+ export declare const SubCommandContext: import("../global.js").Tag<SubCommandContext>;
15
15
  export declare const getCommand: Effect<import("../types.js").ApplicationCommandDatum, never, import("../types.js").ApplicationCommandDatum>;
16
16
  export declare class ResolvedDataNotFound {
17
- readonly data: Discord.ApplicationCommandDatum;
18
- readonly name: string;
17
+ readonly data: Discord.Interaction;
18
+ readonly name?: string | undefined;
19
19
  readonly _tag = "ResolvedDataNotFound";
20
- constructor(data: Discord.ApplicationCommandDatum, name: string);
20
+ constructor(data: Discord.Interaction, name?: string | undefined);
21
21
  }
22
- export declare const getResolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<import("../types.js").ApplicationCommandDatum, ResolvedDataNotFound, A>;
22
+ export declare const getResolvedValues: <A>(f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<import("../types.js").Interaction, ResolvedDataNotFound, readonly A[]>;
23
+ export declare const getResolved: <A>(name: string, f: (id: Discord.Snowflake, data: Discord.ResolvedDatum) => A | undefined) => Effect<import("../types.js").Interaction, ResolvedDataNotFound, A>;
23
24
  export declare const focusedOptionValue: Effect<FocusedOptionContext, never, string>;
24
25
  export declare class SubCommandNotFound {
25
26
  readonly data: Discord.ApplicationCommandDatum;
@@ -43,9 +44,9 @@ export declare class RequiredOptionNotFound {
43
44
  readonly _tag = "RequiredOptionNotFound";
44
45
  constructor(data: Discord.ApplicationCommandDatum | Discord.ApplicationCommandInteractionDataOption, name: string);
45
46
  }
46
- export declare const findOption: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
47
+ export declare const findOption: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, never, import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
47
48
  export declare const requiredOptionValue: (name: string) => Effect<import("../types.js").ApplicationCommandDatum, RequiredOptionNotFound, string>;
48
49
  export declare const subCommandOptionsMap: Effect<SubCommandContext, never, Record<string, string | undefined>>;
49
- export declare const findSubCommandOption: (name: string) => Effect<SubCommandContext, never, import("../common.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
50
+ export declare const findSubCommandOption: (name: string) => Effect<SubCommandContext, never, import("../global.js").Maybe<import("../types.js").ApplicationCommandInteractionDataOption>>;
50
51
  export declare const requiredSubCommandOptionValue: (name: string) => Effect<SubCommandContext, RequiredOptionNotFound, string>;
51
52
  export declare const modalValues: Effect<import("../types.js").ModalSubmitDatum, never, Record<string, string | undefined>>;
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "@fp-ts/data/Context";
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";
@@ -21,7 +21,8 @@ export class ResolvedDataNotFound {
21
21
  this.name = name;
22
22
  }
23
23
  }
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)(IxHelpers.resolveOptionValue(name, f)(a)));
24
+ export const getResolvedValues = (f) => tsplus_module_2.serviceWithEffect(InteractionContext)((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new ResolvedDataNotFound(a)), tsplus_module_2.succeed)(IxHelpers.resolveValues(f)(a)));
25
+ export const getResolved = (name, f) => tsplus_module_2.serviceWithEffect(InteractionContext)((a) => tsplus_module_3.match(() => tsplus_module_2.fail(new ResolvedDataNotFound(a, name)), tsplus_module_2.succeed)(IxHelpers.resolveOptionValue(name, f)(a)));
25
26
  export const focusedOptionValue = tsplus_module_2.serviceWith(FocusedOptionContext)((a) => a.focusedOption.value ?? "");
26
27
  export class SubCommandNotFound {
27
28
  data;
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/Interactions/context.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAA;AAChD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAA;AAEvD,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,CAAC,CAAA;AAEnE,MAAM,OAAO,oBAAoB;IAGpB;IACA;IAHF,IAAI,GAAG,sBAAsB,CAAA;IACtC,YACW,IAAqC,EACrC,IAAY;QADZ,SAAI,GAAJ,IAAI,CAAiC;QACrC,SAAI,GAAJ,IAAI,CAAQ;IACpB,CAAC;C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CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EADjC,CAAC,CACiC,CAO/B,EATL,UAAU,CAAC,IAAI,CAAC,CAUf,CAAA;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAkB,SAAS,CAAC,UAAU,EAAtC,aAAa,CAA0B,CAAA;AAE3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE,CACnD,4BAAmB,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CACpD,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CACnC,CAAA;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAAY,EAAE,EAAE,CAC5D,wBAAmC,CAAC,CAAC,EAAE,EAAE,CACvC,sBAGI,GAAG,EAAE,CACH,wBAAsB,CAAC,IAAI,EAAE,EAAE,CAC7B,qBAAY,IAAI,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EADrD,aAAa,CAEZ,2BANP,gCACmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EADjC,CAAC,CACiC,CAO/B,EATL,oBAAoB,CAAC,IAAI,CAAC,CAUzB,CAAA;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,4BAAmB,kBAAkB,CAAC,CAC/D,SAAS,CAAC,aAAa,CACxB,CAAA"}
@@ -1,4 +1,5 @@
1
- import { Discord, Effect } from "dfx/common";
1
+ import { Discord } from "dfx";
2
+ import { Effect } from "@effect/io/Effect";
2
3
  type DescriptionMissing<A> = A extends {
3
4
  type: Exclude<Discord.ApplicationCommandType, 1>;
4
5
  } ? false : A extends {
@@ -11,33 +12,33 @@ export declare class GlobalApplicationCommand<R, E> {
11
12
  readonly _tag = "GlobalApplicationCommand";
12
13
  constructor(command: Discord.CreateGlobalApplicationCommandParams, handle: Effect<R, E, Discord.InteractionResponse>);
13
14
  }
14
- export declare const global: <R, E, A extends import("../types.js").CreateGlobalApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" : import("../common.js").Effect<R, E, import("../types.js").InteractionResponse>) => GlobalApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
15
+ export declare const global: <R, E, A extends import("../types.js").CreateGlobalApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" : import("../global.js").Effect<R, E, import("../types.js").InteractionResponse>) => GlobalApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
15
16
  export declare class GuildApplicationCommand<R, E> {
16
17
  readonly command: Discord.CreateGuildApplicationCommandParams;
17
18
  readonly handle: Effect<R, E, Discord.InteractionResponse>;
18
19
  readonly _tag = "GuildApplicationCommand";
19
20
  constructor(command: Discord.CreateGuildApplicationCommandParams, handle: Effect<R, E, Discord.InteractionResponse>);
20
21
  }
21
- export declare const guild: <R, E, A extends import("../types.js").CreateGuildApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" : import("../common.js").Effect<R, E, import("../types.js").InteractionResponse>) => GuildApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
22
+ export declare const guild: <R, E, A extends import("../types.js").CreateGuildApplicationCommandParams>(command: A, handle: DescriptionMissing<A> extends true ? "command description is missing" : import("../global.js").Effect<R, E, import("../types.js").InteractionResponse>) => GuildApplicationCommand<Exclude<R, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum>, E>;
22
23
  export declare class MessageComponent<R, E> {
23
24
  readonly predicate: (customId: string) => Effect<R, E, boolean>;
24
25
  readonly handle: Effect<R, E, Discord.InteractionResponse>;
25
26
  readonly _tag = "MessageComponent";
26
27
  constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
27
28
  }
28
- export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) => import("../common.js").Effect<R1, E1, boolean>, handle: import("../common.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => MessageComponent<Exclude<R1, import("../types.js").Interaction | import("../types.js").MessageComponentDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").MessageComponentDatum>, E1 | E2>;
29
+ export declare const messageComponent: <R1, R2, E1, E2>(pred: (customId: string) => import("../global.js").Effect<R1, E1, boolean>, handle: import("../global.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => MessageComponent<Exclude<R1, import("../types.js").Interaction | import("../types.js").MessageComponentDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").MessageComponentDatum>, E1 | E2>;
29
30
  export declare class ModalSubmit<R, E> {
30
31
  readonly predicate: (customId: string) => Effect<R, E, boolean>;
31
32
  readonly handle: Effect<R, E, Discord.InteractionResponse>;
32
33
  readonly _tag = "ModalSubmit";
33
34
  constructor(predicate: (customId: string) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
34
35
  }
35
- export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) => import("../common.js").Effect<R1, E1, boolean>, handle: import("../common.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => ModalSubmit<Exclude<R1, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum>, E1 | E2>;
36
+ export declare const modalSubmit: <R1, R2, E1, E2>(pred: (customId: string) => import("../global.js").Effect<R1, E1, boolean>, handle: import("../global.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => ModalSubmit<Exclude<R1, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ModalSubmitDatum>, E1 | E2>;
36
37
  export declare class Autocomplete<R, E> {
37
38
  readonly predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>;
38
39
  readonly handle: Effect<R, E, Discord.InteractionResponse>;
39
40
  readonly _tag = "Autocomplete";
40
41
  constructor(predicate: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => Effect<R, E, boolean>, handle: Effect<R, E, Discord.InteractionResponse>);
41
42
  }
42
- export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => import("../common.js").Effect<R1, E1, boolean>, handle: import("../common.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => Autocomplete<Exclude<R1, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption>, E1 | E2>;
43
+ export declare const autocomplete: <R1, R2, E1, E2>(pred: (data: Discord.ApplicationCommandDatum, focusedOption: Discord.ApplicationCommandInteractionDataOption) => import("../global.js").Effect<R1, E1, boolean>, handle: import("../global.js").Effect<R2, E2, import("../types.js").InteractionResponse>) => Autocomplete<Exclude<R1, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption> | Exclude<R2, import("../types.js").Interaction | import("../types.js").ApplicationCommandDatum | import("../types.js").ApplicationCommandInteractionDataOption>, E1 | E2>;
43
44
  export {};
@@ -1,7 +1,8 @@
1
- import { Effect, Rest, Discord, Http } from "dfx/common";
1
+ import { Effect } from "@effect/io/Effect";
2
+ import { DiscordREST, Discord, Http } from "dfx";
2
3
  import { DefinitionNotFound } from "./handlers.js";
3
4
  import { InteractionBuilder } from "./index.js";
4
5
  export interface RunOpts {
5
6
  sync?: boolean;
6
7
  }
7
- export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../common.js").Effect<import("../index.js").DiscordREST | import("../types.js").Interaction | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | DefinitionNotFound | E, void>) => import("../common.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../common.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
8
+ export declare const run: <R, R2, E, E2>(postHandler: (effect: import("../global.js").Effect<import("../types.js").Interaction | import("../index.js").DiscordREST | R, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | DefinitionNotFound | E, void>) => import("../global.js").Effect<R2, E2, void>, { sync }?: RunOpts) => (ix: InteractionBuilder<R, E>) => import("../global.js").Effect<import("../index.js").DiscordREST | import("../DiscordGateway/index.js").DiscordGateway | Exclude<R2, import("../types.js").Interaction>, import("../Http/index.js").FetchError | import("../Http/index.js").StatusCodeError | import("../Http/index.js").JsonParseError | E2, void>;
@@ -1,22 +1,22 @@
1
1
  import * as tsplus_module_1 from "@effect/io/Effect";
2
- import * as tsplus_module_2 from "dfx/common";
2
+ import * as tsplus_module_2 from "dfx";
3
3
  import * as tsplus_module_3 from "@fp-ts/data/Function";
4
- import * as tsplus_module_4 from "dfx/common-gateway";
4
+ import * as tsplus_module_4 from "dfx/gateway";
5
5
  import { handlers } from "./handlers.js";
6
6
  import { InteractionContext } from "./index.js";
7
7
  import { splitDefinitions } from "./utils.js";
8
8
  export const run = (postHandler, { sync = true } = {}) => (ix) => (() => {
9
9
  const { GlobalApplicationCommand, GuildApplicationCommand } = splitDefinitions(ix.definitions);
10
10
  return tsplus_module_1.flatMap(application => {
11
- const globalSync = tsplus_module_2.Rest.rest.bulkOverwriteGlobalApplicationCommands(application.id, {
11
+ const globalSync = tsplus_module_2.rest.bulkOverwriteGlobalApplicationCommands(application.id, {
12
12
  body: JSON.stringify(GlobalApplicationCommand.map((a) => a.command)),
13
13
  });
14
14
  const guildSync = GuildApplicationCommand.length
15
- ? tsplus_module_4.Gateway.handleDispatch("GUILD_CREATE", (a) => tsplus_module_2.Rest.rest.bulkOverwriteGuildApplicationCommands(application.id, a.id, GuildApplicationCommand.map((a) => a.command)))
15
+ ? tsplus_module_4.Gateway.handleDispatch("GUILD_CREATE", (a) => tsplus_module_2.rest.bulkOverwriteGuildApplicationCommands(application.id, a.id, GuildApplicationCommand.map((a) => a.command)))
16
16
  : tsplus_module_1.unit();
17
17
  const handle = handlers(ix.definitions);
18
- const run = tsplus_module_4.Gateway.handleDispatch("INTERACTION_CREATE", (i) => tsplus_module_3.pipe(tsplus_module_1.tap((r) => tsplus_module_2.Rest.rest.createInteractionResponse(i.id, i.token, r))(handle[i.type](i)), postHandler, tsplus_module_1.provideService(InteractionContext)(i)));
18
+ const run = tsplus_module_4.Gateway.handleDispatch("INTERACTION_CREATE", (i) => tsplus_module_3.pipe(tsplus_module_1.tap((r) => tsplus_module_2.rest.createInteractionResponse(i.id, i.token, r))(handle[i.type](i)), postHandler, tsplus_module_1.provideService(InteractionContext)(i)));
19
19
  return tsplus_module_1.map(() => void 0)(sync ? tsplus_module_1.zipPar(guildSync)(tsplus_module_1.zipPar(globalSync)(run)) : run);
20
- })(tsplus_module_1.flatMap((a) => a.json)(tsplus_module_2.Rest.rest.getCurrentBotApplicationInformation()));
20
+ })(tsplus_module_1.flatMap((a) => a.json)(tsplus_module_2.rest.getCurrentBotApplicationInformation()));
21
21
  })();
22
22
  //# sourceMappingURL=gateway.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/Interactions/gateway.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAsB,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAsB,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAM7C,MAAM,CAAC,MAAM,GAAG,GACd,CACE,WAUyB,EACzB,EAAE,IAAI,GAAG,IAAI,KAAc,EAAE,EAC7B,EA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C,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,gBAAA,IAAI,CACF,oBAAsB,CAAC,CAAC,EAAE,EAAE,CAC1B,gBAAA,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EADlD,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAEhB,EACD,WAAW,EACX,+BAAsB,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAC7C,CACF,CAAA;iDAEC,IAAI,CAAC,CAAC,CAAC,uBAA8B,SAAS,EAAvC,uBAAW,UAAU,EAArB,GAAG,CAAmB,CAAkB,CAAC,CAAC,CAAC,GAAG;OAhCrD,wBAAmD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAhE,gBAAA,IAAI,CAAC,mCAAmC,EAAE,CAAuB;IAiCnE,CAAA"}
@@ -1,4 +1,5 @@
1
- import { Discord, Effect } from "dfx/common";
1
+ import { Discord } from "dfx";
2
+ import { Effect } from "@effect/io/Effect";
2
3
  import * as D from "./definitions.js";
3
4
  export declare class DefinitionNotFound {
4
5
  readonly interaction: Discord.Interaction;
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "dfx";
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";
@@ -1,19 +1,18 @@
1
- import { Rest, Discord } from "dfx/common";
1
+ import { rest, Discord } from "dfx";
2
2
  import * as D from "./definitions.js";
3
3
  export * from "./context.js";
4
4
  export { global, guild, messageComponent, modalSubmit, autocomplete, InteractionDefinition, } from "./definitions.js";
5
- export { makeConfigLayer as makeWebhookConfig, makeHandler as makeWebhookHandler, makeSimpleHandler as makeSimpleWebhookHandler, MakeConfigOpts as MakeWebhookConfigOpts, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./webhook.js";
6
5
  export { response as r } from "../Helpers/interactions.js";
7
6
  export declare class InteractionBuilder<R, E> {
8
7
  readonly definitions: D.InteractionDefinition<R, E>[];
9
8
  constructor(definitions: D.InteractionDefinition<R, E>[]);
10
9
  add<R1, E1>(definition: D.InteractionDefinition<R1, E1>): InteractionBuilder<R | R1, E | E1>;
11
- get syncGlobal(): import("../common.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[]>>;
10
+ 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[]>>;
12
11
  syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): import("../DiscordREST/types.js").RestResponse<import("../types.js").ApplicationCommand[]>;
13
12
  }
14
13
  export declare const builder: InteractionBuilder<never, never>;
15
- export declare const id: (query: string) => (customId: string) => import("../common.js").Effect<never, never, boolean>;
16
- export declare const idStartsWith: (query: string) => (customId: string) => import("../common.js").Effect<never, never, boolean>;
17
- export declare const idRegex: (query: RegExp) => (customId: string) => import("../common.js").Effect<never, never, boolean>;
18
- export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../common.js").Effect<never, never, boolean>;
19
- export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../common.js").Effect<never, never, boolean>;
14
+ export declare const id: (query: string) => (customId: string) => import("../global.js").Effect<never, never, boolean>;
15
+ export declare const idStartsWith: (query: string) => (customId: string) => import("../global.js").Effect<never, never, boolean>;
16
+ export declare const idRegex: (query: RegExp) => (customId: string) => import("../global.js").Effect<never, never, boolean>;
17
+ export declare const option: (command: string, optionName: string) => (data: Pick<Discord.ApplicationCommandDatum, "name">, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../global.js").Effect<never, never, boolean>;
18
+ export declare const optionOnly: (optionName: string) => (_: unknown, focusedOption: Pick<Discord.ApplicationCommandInteractionDataOption, "name">) => import("../global.js").Effect<never, never, boolean>;
@@ -1,8 +1,7 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "dfx";
2
2
  import * as tsplus_module_2 from "@effect/io/Effect";
3
3
  export * from "./context.js";
4
4
  export { global, guild, messageComponent, modalSubmit, autocomplete, } from "./definitions.js";
5
- export { makeConfigLayer as makeWebhookConfig, makeHandler as makeWebhookHandler, makeSimpleHandler as makeSimpleWebhookHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./webhook.js";
6
5
  export { response as r } from "../Helpers/interactions.js";
7
6
  export class InteractionBuilder {
8
7
  definitions;
@@ -19,16 +18,15 @@ export class InteractionBuilder {
19
18
  const commands = this.definitions
20
19
  .filter((c) => c._tag === "GlobalApplicationCommand")
21
20
  .map((c) => c.command);
22
- return tsplus_module_2.flatMap((app) => tsplus_module_1.Rest.rest.bulkOverwriteGlobalApplicationCommands(app.id, {
21
+ return tsplus_module_2.flatMap((app) => tsplus_module_1.rest.bulkOverwriteGlobalApplicationCommands(app.id, {
23
22
  body: JSON.stringify(commands),
24
- }))(tsplus_module_2.flatMap((r) => r.json)(tsplus_module_1.Rest.rest
25
- .getCurrentBotApplicationInformation()));
23
+ }))(tsplus_module_2.flatMap((r) => r.json)(tsplus_module_1.rest.getCurrentBotApplicationInformation()));
26
24
  }
27
25
  syncGuild(appId, guildId) {
28
26
  const commands = this.definitions
29
27
  .filter((c) => c._tag === "GuildApplicationCommand")
30
28
  .map((c) => c.command);
31
- return tsplus_module_1.Rest.rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands);
29
+ return tsplus_module_1.rest.bulkOverwriteGuildApplicationCommands(appId, guildId, commands);
32
30
  }
33
31
  }
34
32
  export const builder = new InteractionBuilder([]);
@@ -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,EACL,eAAe,IAAI,iBAAiB,EACpC,WAAW,IAAI,kBAAkB,EACjC,iBAAiB,IAAI,wBAAwB,EAE7C,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,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,wBAGI,CAAC,GAAG,EAAE,EAAE,CACf,gBAAA,IAAI,CAAC,IAAI,CAAC,sCAAsC,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EAAE,CACF,wBAAe,aAAa,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA"}
@@ -1,4 +1,6 @@
1
- import { Discord, Effect, Cause } from "dfx/common";
1
+ import { Discord } from "dfx";
2
+ import { Effect } from "@effect/io/Effect";
3
+ import { Cause } from "@effect/io/Cause";
2
4
  import { DefinitionNotFound } from "./handlers.js";
3
5
  import { InteractionBuilder } from "./index.js";
4
6
  export declare class BadWebhookSignature {
@@ -15,8 +17,8 @@ declare const makeConfig: ({ applicationId, publicKey }: MakeConfigOpts) => {
15
17
  };
16
18
  export interface WebhookConfig extends ReturnType<typeof makeConfig> {
17
19
  }
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
+ export declare const WebhookConfig: import("../global.js").Tag<WebhookConfig>;
21
+ export declare const makeConfigLayer: (a_0: MakeConfigOpts) => import("../global.js").Layer<never, never, WebhookConfig>;
20
22
  export declare class WebhookParseError {
21
23
  readonly reason: unknown;
22
24
  readonly _tag = "WebhookParseError";
@@ -28,9 +30,9 @@ export interface HandleWebhookOpts<E> {
28
30
  success: (a: Discord.InteractionResponse) => Effect<never, never, void>;
29
31
  error: (e: Cause<E>) => Effect<never, never, void>;
30
32
  }
31
- 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>;
33
+ export declare const makeHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body, success, error, }: HandleWebhookOpts<DefinitionNotFound | BadWebhookSignature | WebhookParseError | E>) => import("../global.js").Effect<WebhookConfig | Exclude<R, import("../types.js").Interaction>, never, void>;
32
34
  export declare const makeSimpleHandler: <R, E>(ix: InteractionBuilder<R, E>) => ({ headers, body }: {
33
35
  headers: Headers;
34
36
  body: string;
35
- }) => import("../common.js").Effect<WebhookConfig | Exclude<R, import("../types.js").Interaction>, DefinitionNotFound | BadWebhookSignature | WebhookParseError | E, import("../types.js").InteractionResponse>;
37
+ }) => import("../global.js").Effect<WebhookConfig | Exclude<R, import("../types.js").Interaction>, DefinitionNotFound | BadWebhookSignature | WebhookParseError | E, import("../types.js").InteractionResponse>;
36
38
  export {};
@@ -1,6 +1,6 @@
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 "dfx/common";
3
+ import * as tsplus_module_3 from "@fp-ts/data/Context";
4
4
  import * as tsplus_module_4 from "@effect/io/Layer";
5
5
  import * as tsplus_module_5 from "@fp-ts/data/Function";
6
6
  import * as tsplus_module_6 from "@effect/io/Effect";
package/Log/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  declare const make: (debug?: boolean) => {
2
- info: (...args: any[]) => import("../common.js").Effect<never, never, void>;
3
- debug: (...args: any[]) => import("../common.js").Effect<never, never, void>;
2
+ info: (...args: any[]) => import("../global.js").Effect<never, never, void>;
3
+ debug: (...args: any[]) => import("../global.js").Effect<never, never, void>;
4
4
  };
5
5
  export interface Log extends ReturnType<typeof make> {
6
6
  }
7
- export declare const Log: import("../common.js").Tag<Log>;
8
- export declare const LiveLog: import("../common.js").Layer<never, never, Log>;
9
- export declare const LiveLogDebug: import("../common.js").Layer<never, never, Log>;
10
- export declare const info: (...args: any[]) => import("../common.js").Effect<Log, never, void>;
11
- export declare const debug: (...args: any[]) => import("../common.js").Effect<Log, never, void>;
7
+ export declare const Log: import("../global.js").Tag<Log>;
8
+ export declare const LiveLog: import("../global.js").Layer<never, never, Log>;
9
+ export declare const LiveLogDebug: import("../global.js").Layer<never, never, Log>;
10
+ export declare const info: (...args: any[]) => import("../global.js").Effect<Log, never, void>;
11
+ export declare const debug: (...args: any[]) => import("../global.js").Effect<Log, never, void>;
12
12
  export {};
package/Log/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as tsplus_module_1 from "@effect/io/Effect";
2
- import * as tsplus_module_2 from "dfx/common";
2
+ import * as tsplus_module_2 from "@fp-ts/data/Context";
3
3
  import * as tsplus_module_3 from "@effect/io/Layer";
4
4
  const make = (debug = false) => ({
5
5
  info: (...args) => tsplus_module_1.sync(() => {
@@ -1,4 +1,6 @@
1
- import { Effect, Maybe, Duration } from "dfx/common";
1
+ import { Effect } from "@effect/io/Effect";
2
+ import { Maybe } from "@fp-ts/data/Option";
3
+ import { Duration } from "@fp-ts/data/Duration";
2
4
  import { Success } from "dfx/utils/effect";
3
5
  export type BucketDetails = {
4
6
  key: "global" | string;
@@ -12,13 +14,13 @@ export interface RateLimitStore {
12
14
  putBucketRoute: (route: string, bucketKey: string) => Effect<never, never, void>;
13
15
  incrementCounter: (key: string, window: number, limit: number) => Effect<never, never, readonly [count: number, ttl: number]>;
14
16
  }
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>;
17
+ export declare const RateLimitStore: import("../global.js").Tag<RateLimitStore>;
18
+ export declare const LiveMemoryRateLimitStore: import("../global.js").Layer<never, never, RateLimitStore>;
19
+ declare const makeLimiter: import("../global.js").Effect<import("../Log/index.js").Log | RateLimitStore, never, {
20
+ maybeWait: (key: string, window: Duration, limit: number, multiplier?: number) => import("../global.js").Effect<never, never, void>;
19
21
  }>;
20
22
  export interface RateLimiter extends Success<typeof makeLimiter> {
21
23
  }
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>;
24
+ export declare const RateLimiter: import("../global.js").Tag<RateLimiter>;
25
+ export declare const LiveRateLimiter: import("../global.js").Layer<import("../Log/index.js").Log | RateLimitStore, never, RateLimiter>;
24
26
  export {};
@@ -1,6 +1,7 @@
1
- import * as tsplus_module_1 from "dfx/common";
1
+ import * as tsplus_module_1 from "@fp-ts/data/Context";
2
2
  import * as tsplus_module_2 from "@effect/io/Layer";
3
3
  import * as tsplus_module_3 from "@effect/io/Effect";
4
+ import * as tsplus_module_4 from "dfx";
4
5
  import { delayFrom } from "./utils.js";
5
6
  import * as Memory from "./memory.js";
6
7
  export const RateLimitStore = tsplus_module_1.Tag();
@@ -18,7 +19,7 @@ const makeLimiter = tsplus_module_3.flatMap(store => tsplus_module_3.map(log =>
18
19
  .incrementCounter(key, windowMs, limit)))));
19
20
  };
20
21
  return { maybeWait };
21
- })(tsplus_module_3.service(tsplus_module_1.Log.Log)))(tsplus_module_3.service(RateLimitStore));
22
+ })(tsplus_module_3.service(tsplus_module_4.Log.Log)))(tsplus_module_3.service(RateLimitStore));
22
23
  export const RateLimiter = tsplus_module_1.Tag();
23
24
  export const LiveRateLimiter = tsplus_module_2.fromEffect(RateLimiter)(makeLimiter);
24
25
  //# sourceMappingURL=index.js.map