dfx 0.20.4 → 0.21.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 (119) hide show
  1. package/Cache/driver.d.ts +16 -16
  2. package/Cache/driver.js.map +1 -1
  3. package/Cache/index.d.ts +21 -21
  4. package/Cache/index.js +12 -13
  5. package/Cache/index.js.map +1 -1
  6. package/Cache/memory.d.ts +3 -3
  7. package/Cache/memory.js +19 -20
  8. package/Cache/memory.js.map +1 -1
  9. package/Cache/memoryTTL.d.ts +5 -5
  10. package/Cache/memoryTTL.js +16 -16
  11. package/Cache/memoryTTL.js.map +1 -1
  12. package/Cache/prelude.d.ts +41 -41
  13. package/Cache/prelude.js +39 -41
  14. package/Cache/prelude.js.map +1 -1
  15. package/DiscordConfig/index.d.ts +4 -19
  16. package/DiscordConfig/index.js +5 -12
  17. package/DiscordConfig/index.js.map +1 -1
  18. package/DiscordGateway/DiscordWS/index.d.ts +9 -9
  19. package/DiscordGateway/DiscordWS/index.js +16 -20
  20. package/DiscordGateway/DiscordWS/index.js.map +1 -1
  21. package/DiscordGateway/Shard/heartbeats.d.ts +3 -4
  22. package/DiscordGateway/Shard/heartbeats.js +9 -16
  23. package/DiscordGateway/Shard/heartbeats.js.map +1 -1
  24. package/DiscordGateway/Shard/identify.d.ts +4 -4
  25. package/DiscordGateway/Shard/identify.js +5 -4
  26. package/DiscordGateway/Shard/identify.js.map +1 -1
  27. package/DiscordGateway/Shard/index.d.ts +8 -7
  28. package/DiscordGateway/Shard/index.js +17 -20
  29. package/DiscordGateway/Shard/index.js.map +1 -1
  30. package/DiscordGateway/Shard/invalidSession.d.ts +2 -3
  31. package/DiscordGateway/Shard/invalidSession.js +5 -8
  32. package/DiscordGateway/Shard/invalidSession.js.map +1 -1
  33. package/DiscordGateway/Shard/sendEvents.d.ts +1 -1
  34. package/DiscordGateway/Shard/sendEvents.js +7 -7
  35. package/DiscordGateway/Shard/sendEvents.js.map +1 -1
  36. package/DiscordGateway/Shard/utils.d.ts +3 -4
  37. package/DiscordGateway/Shard/utils.js +6 -6
  38. package/DiscordGateway/Shard/utils.js.map +1 -1
  39. package/DiscordGateway/ShardStore/index.d.ts +6 -6
  40. package/DiscordGateway/ShardStore/index.js +7 -10
  41. package/DiscordGateway/ShardStore/index.js.map +1 -1
  42. package/DiscordGateway/Sharder/index.d.ts +11 -11
  43. package/DiscordGateway/Sharder/index.js +21 -42
  44. package/DiscordGateway/Sharder/index.js.map +1 -1
  45. package/DiscordGateway/WS/index.d.ts +3 -2
  46. package/DiscordGateway/WS/index.js +30 -40
  47. package/DiscordGateway/WS/index.js.map +1 -1
  48. package/DiscordGateway/index.d.ts +8 -9
  49. package/DiscordGateway/index.js +10 -15
  50. package/DiscordGateway/index.js.map +1 -1
  51. package/DiscordREST/index.d.ts +132 -132
  52. package/DiscordREST/index.js +37 -40
  53. package/DiscordREST/index.js.map +1 -1
  54. package/DiscordREST/types.d.ts +6 -6
  55. package/DiscordREST/utils.d.ts +5 -4
  56. package/DiscordREST/utils.js +5 -5
  57. package/DiscordREST/utils.js.map +1 -1
  58. package/Helpers/intents.js +8 -8
  59. package/Helpers/intents.js.map +1 -1
  60. package/Helpers/interactions.d.ts +18 -19
  61. package/Helpers/interactions.js +22 -23
  62. package/Helpers/interactions.js.map +1 -1
  63. package/Helpers/members.d.ts +2 -2
  64. package/Helpers/members.js.map +1 -1
  65. package/Helpers/permissions.d.ts +4 -4
  66. package/Helpers/permissions.js +13 -13
  67. package/Helpers/permissions.js.map +1 -1
  68. package/Http/index.d.ts +10 -9
  69. package/Http/index.js +7 -8
  70. package/Http/index.js.map +1 -1
  71. package/Interactions/context.d.ts +22 -23
  72. package/Interactions/context.js +21 -21
  73. package/Interactions/context.js.map +1 -1
  74. package/Interactions/definitions.d.ts +31 -31
  75. package/Interactions/definitions.js +1 -2
  76. package/Interactions/definitions.js.map +1 -1
  77. package/Interactions/gateway.d.ts +4 -3
  78. package/Interactions/gateway.js +6 -6
  79. package/Interactions/gateway.js.map +1 -1
  80. package/Interactions/handlers.d.ts +3 -4
  81. package/Interactions/handlers.js +23 -23
  82. package/Interactions/handlers.js.map +1 -1
  83. package/Interactions/index.d.ts +11 -11
  84. package/Interactions/index.js +11 -10
  85. package/Interactions/index.js.map +1 -1
  86. package/Interactions/webhook.d.ts +7 -8
  87. package/Interactions/webhook.js +11 -12
  88. package/Interactions/webhook.js.map +1 -1
  89. package/Log/index.d.ts +8 -7
  90. package/Log/index.js +9 -11
  91. package/Log/index.js.map +1 -1
  92. package/README.md +48 -0
  93. package/RateLimit/index.d.ts +13 -12
  94. package/RateLimit/index.js +11 -12
  95. package/RateLimit/index.js.map +1 -1
  96. package/RateLimit/memory.d.ts +1 -1
  97. package/RateLimit/memory.js +7 -7
  98. package/RateLimit/memory.js.map +1 -1
  99. package/RateLimit/utils.d.ts +2 -2
  100. package/RateLimit/utils.js.map +1 -1
  101. package/_common.d.ts +19 -0
  102. package/_common.js +20 -0
  103. package/_common.js.map +1 -0
  104. package/gateway.d.ts +11 -10
  105. package/gateway.js +17 -14
  106. package/gateway.js.map +1 -1
  107. package/package.json +10 -16
  108. package/utils/effect.d.ts +8 -8
  109. package/utils/effect.js +4 -4
  110. package/utils/effect.js.map +1 -1
  111. package/webhooks.d.ts +6 -5
  112. package/webhooks.js +12 -8
  113. package/webhooks.js.map +1 -1
  114. package/global.d.ts +0 -21
  115. package/global.js +0 -2
  116. package/global.js.map +0 -1
  117. package/utils/common.d.ts +0 -18
  118. package/utils/common.js +0 -3
  119. package/utils/common.js.map +0 -1
package/utils/effect.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as tsplus_module_1 from "@effect/io/Effect";
1
+ import { Effect } from "dfx/_common";
2
2
  /**
3
3
  * @tsplus static effect/io/Effect.Ops deriveLifted
4
4
  */
@@ -6,13 +6,13 @@ export function deriveLifted(S) {
6
6
  return (functions, constants, values) => {
7
7
  const ret = {};
8
8
  for (const k of functions) {
9
- ret[k] = (...args) => tsplus_module_1.serviceWithEffect(S)((h) => h[k](...args));
9
+ ret[k] = (...args) => Effect.serviceWithEffect(S)((h) => h[k](...args));
10
10
  }
11
11
  for (const k of constants) {
12
- ret[k] = tsplus_module_1.serviceWithEffect(S)((h) => h[k]);
12
+ ret[k] = Effect.serviceWithEffect(S)((h) => h[k]);
13
13
  }
14
14
  for (const k of values) {
15
- ret[k] = tsplus_module_1.serviceWith(S)((h) => h[k]);
15
+ ret[k] = Effect.serviceWith(S)((h) => h[k]);
16
16
  }
17
17
  return ret;
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"effect.js","sourceRoot":"","sources":["../../src/utils/effect.ts"],"names":[],"mappings":";AA+CA;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,CAAS;IAUT,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,EAAS,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAC1B,kCAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAAC,CAAC,CAAC,CAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;SAC7D;QAED,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,kCAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAQ,CAAC,CAAA;SACzD;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,GAAG,CAAC,CAAC,CAAC,GAAG,4BAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAC5C;QAED,OAAO,GAAU,CAAA;IACnB,CAAC,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"effect.js","sourceRoot":"","sources":["../../src/utils/effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,aAAa,CAAA;AA4C7C;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,CAAiB;IAUjB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,GAAG,GAAG,EAAS,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAW,EAAE,EAAE,CAC1B,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAE,CAAC,CAAC,CAAC,CAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;SAC7D;QAED,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;YACzB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAQ,CAAC,CAAA;SACzD;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAC5C;QAED,OAAO,GAAU,CAAA;IACnB,CAAC,CAAA;AACH,CAAC"}
package/webhooks.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Config } from "dfx";
1
+ import { Config, Log } from "dfx";
2
2
  import { MakeConfigOpts } from "./Interactions/webhook.js";
3
- export { makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./Interactions/webhook.js";
4
- export declare const MemoryRateLimit: import("./utils/common.js").Layer<import("./Log/index.js").Log, never, import("./index.js").RateLimitStore | import("./index.js").RateLimiter>;
5
- export declare const MemoryREST: import("./utils/common.js").Layer<import("./Log/index.js").Log | import("./DiscordConfig/index.js").DiscordConfig, never, import("./index.js").DiscordREST>;
6
- export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => import("./utils/common.js").Layer<never, never, import("./index.js").DiscordREST | import("./index.js").RateLimitStore | import("./index.js").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
3
+ import { Layer } from "./_common.js";
4
+ export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
5
+ export declare const MemoryRateLimit: Layer.Layer<Log.Log, never, import("dfx").RateLimitStore | import("dfx").RateLimiter>;
6
+ export declare const MemoryREST: Layer.Layer<Config.DiscordConfig | Log.Log, never, import("dfx").DiscordREST>;
7
+ export declare const make: (config: Config.MakeOpts & MakeConfigOpts, debug?: boolean) => Layer.Layer<never, never, import("dfx").DiscordREST | import("dfx").RateLimitStore | import("dfx").RateLimiter | import("./Interactions/webhook.js").WebhookConfig>;
package/webhooks.js CHANGED
@@ -1,15 +1,19 @@
1
- import * as tsplus_module_1 from "dfx";
2
- import * as tsplus_module_2 from "@effect/io/Layer";
1
+ import * as tsplus_module_1 from "@effect/io/Layer";
2
+ import { Config, Log } from "dfx";
3
+ import { LiveDiscordREST } from "./DiscordREST/index.js";
3
4
  import { LiveHttp } from "./Http/index.js";
4
5
  import { makeConfigLayer } from "./Interactions/webhook.js";
5
- export { makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, BadWebhookSignature, } from "./Interactions/webhook.js";
6
- export const MemoryRateLimit = tsplus_module_2.provideToAndMerge(tsplus_module_1.LiveRateLimiter)(tsplus_module_1.LiveMemoryRateLimitStore);
7
- export const MemoryREST = tsplus_module_2.provideTo(tsplus_module_1.LiveDiscordREST)((tsplus_module_2.merge(LiveHttp)(MemoryRateLimit)));
6
+ import { LiveMemoryRateLimitStore, LiveRateLimiter } from "./RateLimit/index.js";
7
+ import { Layer } from "./_common.js";
8
+ export { BadWebhookSignature, makeConfigLayer, makeHandler, makeSimpleHandler, WebhookConfig, WebhookParseError, } from "./Interactions/webhook.js";
9
+ const _layer = Layer.LayerTypeId;
10
+ export const MemoryRateLimit = tsplus_module_1.provideToAndMerge(LiveRateLimiter)(LiveMemoryRateLimitStore);
11
+ export const MemoryREST = tsplus_module_1.provideTo(LiveDiscordREST)((tsplus_module_1.merge(LiveHttp)(MemoryRateLimit)));
8
12
  export const make = (config, debug = false) => {
9
13
  const LiveWebhook = makeConfigLayer(config);
10
- const LiveLog = debug ? tsplus_module_1.Log.LiveLogDebug : tsplus_module_1.Log.LiveLog;
11
- const LiveConfig = tsplus_module_1.Config.makeLayer(config);
12
- const LiveEnv = tsplus_module_2.provideTo((tsplus_module_2.merge(MemoryRateLimit)(tsplus_module_2.merge(LiveWebhook)(MemoryREST))))((tsplus_module_2.merge(LiveConfig)(LiveLog)));
14
+ const LiveLog = debug ? Log.LiveLogDebug : Log.LiveLog;
15
+ const LiveConfig = Config.makeLayer(config);
16
+ const LiveEnv = tsplus_module_1.provideTo((tsplus_module_1.merge(MemoryRateLimit)(tsplus_module_1.merge(LiveWebhook)(MemoryREST))))((tsplus_module_1.merge(LiveConfig)(LiveLog)));
13
17
  return LiveEnv;
14
18
  };
15
19
  //# sourceMappingURL=webhooks.js.map
package/webhooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAkB,MAAM,2BAA2B,CAAA;AAE3E,OAAO,EACL,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,MAAM,eAAe,qDAA8B,eAAe,kBAA1C,wBAAwB,C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,wBAAwB,CAAkB,CAAA;AAEzE,MAAM,CAAC,MAAM,UAAU,6BAAmC,eAAe,EAA/C,uBAAmB,QAAQ,EAA1B,eAAe,EAAY,CAAmB,CAAA;AAEzE,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,MAAwC,EACxC,KAAK,GAAG,KAAK,EACb,EAAE;IACF,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAA;IACtD,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,OAAO,6BACe,uBAA4B,eAAe,wBAA7B,WAAW,EAAxB,UAAU,GAAiC,EAAtE,uBAAW,UAAU,EAApB,OAAO,EAAc,CAAgD,CAAA;IAExE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/global.d.ts DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * @tsplus global
3
- */
4
- import { Cause, Duration, Effect, EffectSource, HashMap, HashSet, Layer, Maybe, Queue, Ref, Schedule, Tag, flow, identity, pipe, } from "dfx/utils/common";
5
- /**
6
- * @tsplus global
7
- */
8
- import { BucketDetails, RateLimitStore, LiveMemoryRateLimitStore, RateLimiter, LiveRateLimiter, Discord, Http, LiveHttp, FetchError, StatusCodeError, JsonParseError, BlobError, DiscordREST, LiveDiscordREST, Ix, Config, Log, IxHelpers, Flags, Members, Cache, } from "dfx";
9
- /**
10
- * @tsplus global
11
- */
12
- import { Gateway, WS, DiscordWS, Shard, ShardStore } from "dfx/gateway";
13
- /**
14
- * @tsplus global
15
- */
16
- import {} from "dfx/webhooks";
17
- /**
18
- * @tsplus global
19
- */
20
- import type { Success } from "dfx/utils/effect";
21
- export {};
package/global.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=global.js.map
package/global.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"global.js","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":""}
package/utils/common.d.ts DELETED
@@ -1,18 +0,0 @@
1
- export type { Cause } from "@effect/io/Cause";
2
- export type { Effect } from "@effect/io/Effect";
3
- export type { Exit } from "@effect/io/Exit";
4
- export type { Layer } from "@effect/io/Layer";
5
- export type { Dequeue, Queue } from "@effect/io/Queue";
6
- export type { Schedule } from "@effect/io/Schedule";
7
- export type { Chunk } from "@fp-ts/data/Chunk";
8
- export { Context, Tag } from "@fp-ts/data/Context";
9
- export type { Duration } from "@fp-ts/data/Duration";
10
- export type { Equal } from "@fp-ts/data/Equal";
11
- export type { Either } from "@fp-ts/data/Either";
12
- export type { HashMap } from "@fp-ts/data/HashMap";
13
- export type { Option as Maybe } from "@fp-ts/data/Option";
14
- export type { Ref } from "@effect/io/Ref";
15
- export type { HashSet } from "@fp-ts/data/HashSet";
16
- export { pipe, flow, identity } from "@fp-ts/data/Function";
17
- export type { EffectSource } from "callbag-effect-ts/Source";
18
- export type { EffectSink } from "callbag-effect-ts/Sink";
package/utils/common.js DELETED
@@ -1,3 +0,0 @@
1
- export { Tag } from "@fp-ts/data/Context";
2
- export { pipe, flow, identity } from "@fp-ts/data/Function";
3
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAQA,OAAO,EAAW,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA"}