effect 4.0.0-beta.36 → 4.0.0-beta.37

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 (65) hide show
  1. package/dist/Cause.d.ts +31 -0
  2. package/dist/Cause.d.ts.map +1 -1
  3. package/dist/Cause.js +19 -0
  4. package/dist/Cause.js.map +1 -1
  5. package/dist/Channel.d.ts +2 -2
  6. package/dist/Channel.d.ts.map +1 -1
  7. package/dist/Effect.d.ts +1 -16
  8. package/dist/Effect.d.ts.map +1 -1
  9. package/dist/Effect.js.map +1 -1
  10. package/dist/Schedule.d.ts.map +1 -1
  11. package/dist/Schedule.js +19 -1
  12. package/dist/Schedule.js.map +1 -1
  13. package/dist/Schema.d.ts +14 -42
  14. package/dist/Schema.d.ts.map +1 -1
  15. package/dist/Schema.js.map +1 -1
  16. package/dist/SchemaParser.d.ts +22 -66
  17. package/dist/SchemaParser.d.ts.map +1 -1
  18. package/dist/SchemaParser.js.map +1 -1
  19. package/dist/Sink.d.ts +5 -2
  20. package/dist/Sink.d.ts.map +1 -1
  21. package/dist/Sink.js.map +1 -1
  22. package/dist/Stream.d.ts +1 -1
  23. package/dist/Stream.d.ts.map +1 -1
  24. package/dist/internal/effect.js +15 -1
  25. package/dist/internal/effect.js.map +1 -1
  26. package/dist/unstable/cli/Prompt.js +16 -6
  27. package/dist/unstable/cli/Prompt.js.map +1 -1
  28. package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
  29. package/dist/unstable/devtools/DevToolsClient.js +4 -3
  30. package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
  31. package/dist/unstable/devtools/DevToolsSchema.d.ts +2 -3
  32. package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
  33. package/dist/unstable/devtools/DevToolsSchema.js +11 -1
  34. package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
  35. package/dist/unstable/http/HttpClientRequest.d.ts +24 -2
  36. package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
  37. package/dist/unstable/http/HttpClientRequest.js +97 -0
  38. package/dist/unstable/http/HttpClientRequest.js.map +1 -1
  39. package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
  40. package/dist/unstable/http/HttpServerResponse.js +2 -1
  41. package/dist/unstable/http/HttpServerResponse.js.map +1 -1
  42. package/dist/unstable/sql/Migrator.d.ts.map +1 -1
  43. package/dist/unstable/sql/Migrator.js +2 -2
  44. package/dist/unstable/sql/Migrator.js.map +1 -1
  45. package/dist/unstable/sql/SqlError.d.ts +229 -9
  46. package/dist/unstable/sql/SqlError.d.ts.map +1 -1
  47. package/dist/unstable/sql/SqlError.js +256 -6
  48. package/dist/unstable/sql/SqlError.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/Cause.ts +35 -0
  51. package/src/Channel.ts +2 -2
  52. package/src/Effect.ts +1 -16
  53. package/src/Schedule.ts +20 -8
  54. package/src/Schema.ts +6 -10
  55. package/src/SchemaParser.ts +25 -29
  56. package/src/Sink.ts +5 -2
  57. package/src/Stream.ts +1 -1
  58. package/src/internal/effect.ts +27 -2
  59. package/src/unstable/cli/Prompt.ts +15 -6
  60. package/src/unstable/devtools/DevToolsClient.ts +23 -18
  61. package/src/unstable/devtools/DevToolsSchema.ts +13 -1
  62. package/src/unstable/http/HttpClientRequest.ts +104 -2
  63. package/src/unstable/http/HttpServerResponse.ts +8 -4
  64. package/src/unstable/sql/Migrator.ts +7 -5
  65. package/src/unstable/sql/SqlError.ts +360 -8
@@ -2117,7 +2117,7 @@ export const runSyncExitWith = services => {
2117
2117
  scheduler
2118
2118
  });
2119
2119
  fiber.currentDispatcher?.flush();
2120
- return fiber._exit ?? exitDie(fiber);
2120
+ return fiber._exit ?? exitDie(new AsyncFiberError(fiber));
2121
2121
  };
2122
2122
  };
2123
2123
  /** @internal */
@@ -2489,6 +2489,20 @@ export class ExceededCapacityError extends /*#__PURE__*/TaggedError("ExceededCap
2489
2489
  }
2490
2490
  }
2491
2491
  /** @internal */
2492
+ export const AsyncFiberErrorTypeId = "~effect/Cause/AsyncFiberError";
2493
+ /** @internal */
2494
+ export const isAsyncFiberError = u => hasProperty(u, AsyncFiberErrorTypeId);
2495
+ /** @internal */
2496
+ export class AsyncFiberError extends /*#__PURE__*/TaggedError("AsyncFiberError") {
2497
+ [AsyncFiberErrorTypeId] = AsyncFiberErrorTypeId;
2498
+ constructor(fiber) {
2499
+ super({
2500
+ message: "An asynchronous Effect was executed with Effect.runSync",
2501
+ fiber
2502
+ });
2503
+ }
2504
+ }
2505
+ /** @internal */
2492
2506
  export const UnknownErrorTypeId = "~effect/Cause/UnknownError";
2493
2507
  /** @internal */
2494
2508
  export const isUnknownError = u => hasProperty(u, UnknownErrorTypeId);