effect 4.0.0-beta.29 → 4.0.0-beta.30

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 (63) hide show
  1. package/dist/Effect.d.ts +18 -5
  2. package/dist/Effect.d.ts.map +1 -1
  3. package/dist/Effect.js +12 -5
  4. package/dist/Effect.js.map +1 -1
  5. package/dist/Option.d.ts +1 -1
  6. package/dist/Option.d.ts.map +1 -1
  7. package/dist/Option.js +1 -2
  8. package/dist/Option.js.map +1 -1
  9. package/dist/Result.d.ts +1 -1
  10. package/dist/Result.d.ts.map +1 -1
  11. package/dist/Result.js +1 -2
  12. package/dist/Result.js.map +1 -1
  13. package/dist/Schema.d.ts +7 -6
  14. package/dist/Schema.d.ts.map +1 -1
  15. package/dist/Schema.js.map +1 -1
  16. package/dist/ServiceMap.d.ts +1 -1
  17. package/dist/ServiceMap.d.ts.map +1 -1
  18. package/dist/ServiceMap.js.map +1 -1
  19. package/dist/Utils.d.ts +137 -65
  20. package/dist/Utils.d.ts.map +1 -1
  21. package/dist/Utils.js +38 -66
  22. package/dist/Utils.js.map +1 -1
  23. package/dist/index.d.ts +56 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +56 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal/effect.js +4 -4
  28. package/dist/internal/effect.js.map +1 -1
  29. package/dist/testing/TestSchema.d.ts +258 -24
  30. package/dist/testing/TestSchema.d.ts.map +1 -1
  31. package/dist/testing/TestSchema.js +296 -23
  32. package/dist/testing/TestSchema.js.map +1 -1
  33. package/dist/testing/index.d.ts +64 -1
  34. package/dist/testing/index.d.ts.map +1 -1
  35. package/dist/testing/index.js +64 -1
  36. package/dist/testing/index.js.map +1 -1
  37. package/dist/unstable/cli/Command.d.ts +3 -3
  38. package/dist/unstable/cli/Command.d.ts.map +1 -1
  39. package/dist/unstable/http/HttpClient.js +3 -0
  40. package/dist/unstable/http/HttpClient.js.map +1 -1
  41. package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
  42. package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
  43. package/dist/unstable/http/HttpClientResponse.js +4 -0
  44. package/dist/unstable/http/HttpClientResponse.js.map +1 -1
  45. package/dist/unstable/http/HttpServerResponse.d.ts +1 -1
  46. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  47. package/dist/unstable/http/HttpServerResponse.js +4 -0
  48. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/Effect.ts +18 -5
  51. package/src/Option.ts +2 -4
  52. package/src/Result.ts +2 -4
  53. package/src/Schema.ts +13 -6
  54. package/src/ServiceMap.ts +2 -2
  55. package/src/Utils.ts +137 -111
  56. package/src/index.ts +56 -0
  57. package/src/internal/effect.ts +20 -4
  58. package/src/testing/TestSchema.ts +322 -25
  59. package/src/testing/index.ts +64 -1
  60. package/src/unstable/cli/Command.ts +3 -3
  61. package/src/unstable/http/HttpClient.ts +5 -1
  62. package/src/unstable/http/HttpClientResponse.ts +7 -2
  63. package/src/unstable/http/HttpServerResponse.ts +6 -2
package/dist/Effect.d.ts CHANGED
@@ -1599,8 +1599,13 @@ undefined_ as undefined };
1599
1599
  *
1600
1600
  * **When to Use**
1601
1601
  *
1602
- * Use `Effect.async` when dealing with APIs that use callback-style instead of
1602
+ * Use `Effect.callback` when dealing with APIs that use callback-style instead of
1603
1603
  * `async/await` or `Promise`.
1604
+ * * **Previously Known As**
1605
+ *
1606
+ * This API replaces the following from Effect 3.x:
1607
+ *
1608
+ * - `Effect.async`
1604
1609
  *
1605
1610
  * @example
1606
1611
  * ```ts
@@ -6816,7 +6821,8 @@ export declare const sandbox: <A, E, R>(self: Effect<A, E, R>) => Effect<A, Caus
6816
6821
  * it succeeds or fails. This is useful when you only care about the side
6817
6822
  * effects of the effect and do not need to handle or process its outcome.
6818
6823
  *
6819
- * Use the `log` option to emit the full {@link Cause} when the effect fails.
6824
+ * Use the `log` option to emit the full {@link Cause} when the effect fails,
6825
+ * and `message` to prepend a custom log message.
6820
6826
  *
6821
6827
  * @example
6822
6828
  * ```ts
@@ -6840,7 +6846,7 @@ export declare const sandbox: <A, E, R>(self: Effect<A, E, R>) => Effect<A, Caus
6840
6846
  * const task = Effect.fail("Uh oh!")
6841
6847
  *
6842
6848
  * const program = task.pipe(Effect.ignore({ log: true }))
6843
- * const programWarn = task.pipe(Effect.ignore({ log: "Warn" }))
6849
+ * const programWarn = task.pipe(Effect.ignore({ log: "Warn", message: "Ignoring task failure" }))
6844
6850
  * ```
6845
6851
  *
6846
6852
  * **Previously Known As**
@@ -6854,15 +6860,19 @@ export declare const sandbox: <A, E, R>(self: Effect<A, E, R>) => Effect<A, Caus
6854
6860
  */
6855
6861
  export declare const ignore: <Arg extends Effect<any, any, any> | {
6856
6862
  readonly log?: boolean | Severity | undefined;
6863
+ readonly message?: string | undefined;
6857
6864
  } | undefined = {
6858
6865
  readonly log?: boolean | Severity | undefined;
6866
+ readonly message?: string | undefined;
6859
6867
  }>(effectOrOptions?: Arg, options?: {
6860
6868
  readonly log?: boolean | Severity | undefined;
6869
+ readonly message?: string | undefined;
6861
6870
  } | undefined) => [Arg] extends [Effect<infer _A, infer _E, infer _R>] ? Effect<void, never, _R> : <A, E, R>(self: Effect<A, E, R>) => Effect<void, never, R>;
6862
6871
  /**
6863
6872
  * Ignores the effect's failure cause, including defects and interruptions.
6864
6873
  *
6865
- * Use the `log` option to emit the full {@link Cause} when the effect fails.
6874
+ * Use the `log` option to emit the full {@link Cause} when the effect fails,
6875
+ * and `message` to prepend a custom log message.
6866
6876
  *
6867
6877
  * @example
6868
6878
  * ```ts
@@ -6871,7 +6881,7 @@ export declare const ignore: <Arg extends Effect<any, any, any> | {
6871
6881
  * const task = Effect.fail("boom")
6872
6882
  *
6873
6883
  * const program = task.pipe(Effect.ignoreCause)
6874
- * const programLog = task.pipe(Effect.ignoreCause({ log: true }))
6884
+ * const programLog = task.pipe(Effect.ignoreCause({ log: true, message: "Ignoring failure cause" }))
6875
6885
  * ```
6876
6886
  *
6877
6887
  * @since 4.0.0
@@ -6879,10 +6889,13 @@ export declare const ignore: <Arg extends Effect<any, any, any> | {
6879
6889
  */
6880
6890
  export declare const ignoreCause: <Arg extends Effect<any, any, any> | {
6881
6891
  readonly log?: boolean | Severity | undefined;
6892
+ readonly message?: string | undefined;
6882
6893
  } | undefined = {
6883
6894
  readonly log?: boolean | Severity | undefined;
6895
+ readonly message?: string | undefined;
6884
6896
  }>(effectOrOptions?: Arg, options?: {
6885
6897
  readonly log?: boolean | Severity | undefined;
6898
+ readonly message?: string | undefined;
6886
6899
  } | undefined) => [Arg] extends [Effect<infer _A, infer _E, infer _R>] ? Effect<void, never, _R> : <A, E, R>(self: Effect<A, E, R>) => Effect<void, never, R>;
6887
6900
  /**
6888
6901
  * Apply an `ExecutionPlan` to an effect, retrying with step-provided resources