effect 4.0.0-beta.35 → 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.
- package/dist/Cause.d.ts +31 -0
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +19 -0
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +2 -2
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +9 -7
- package/dist/Channel.js.map +1 -1
- package/dist/Cron.d.ts +7 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +109 -45
- package/dist/Cron.js.map +1 -1
- package/dist/Effect.d.ts +1 -16
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js.map +1 -1
- package/dist/Equivalence.d.ts +52 -0
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +52 -0
- package/dist/Equivalence.js.map +1 -1
- package/dist/LayerMap.d.ts +5 -4
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +9 -3
- package/dist/PubSub.js.map +1 -1
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +19 -1
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +37 -41
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +20 -0
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaParser.d.ts +39 -54
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +38 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/Sink.d.ts +5 -2
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +1 -1
- package/dist/Stream.d.ts.map +1 -1
- package/dist/internal/effect.js +18 -3
- package/dist/internal/effect.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +15 -3
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +158 -15
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +4 -3
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +2 -3
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +11 -1
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +24 -2
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +97 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +2 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +2 -2
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +15 -13
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +5 -3
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +2 -2
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +229 -9
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +256 -6
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/package.json +1 -1
- package/src/Cause.ts +35 -0
- package/src/Channel.ts +14 -12
- package/src/Cron.ts +142 -45
- package/src/Effect.ts +1 -16
- package/src/Equivalence.ts +56 -0
- package/src/LayerMap.ts +7 -5
- package/src/PubSub.ts +13 -5
- package/src/Schedule.ts +20 -8
- package/src/Schema.ts +38 -18
- package/src/SchemaParser.ts +74 -25
- package/src/Sink.ts +5 -2
- package/src/Stream.ts +1 -1
- package/src/internal/effect.ts +30 -4
- package/src/unstable/ai/LanguageModel.ts +17 -2
- package/src/unstable/cli/Prompt.ts +158 -16
- package/src/unstable/devtools/DevToolsClient.ts +23 -18
- package/src/unstable/devtools/DevToolsSchema.ts +13 -1
- package/src/unstable/http/HttpClientRequest.ts +104 -2
- package/src/unstable/http/HttpServerResponse.ts +8 -4
- package/src/unstable/httpapi/HttpApiEndpoint.ts +2 -2
- package/src/unstable/httpapi/HttpApiMiddleware.ts +36 -20
- package/src/unstable/sql/Migrator.ts +7 -5
- package/src/unstable/sql/SqlError.ts +360 -8
package/dist/internal/effect.js
CHANGED
|
@@ -1666,14 +1666,15 @@ export const cachedInvalidateWithTTL = /*#__PURE__*/dual(2, (self, ttl) => sync(
|
|
|
1666
1666
|
let exit;
|
|
1667
1667
|
const wait = flatMap(latch.await, () => exit);
|
|
1668
1668
|
return [withFiber(fiber => {
|
|
1669
|
-
const
|
|
1669
|
+
const clock = fiber.getRef(ClockRef);
|
|
1670
|
+
const now = isFinite ? clock.currentTimeMillisUnsafe() : 0;
|
|
1670
1671
|
if (running || now < expiresAt) return exit ?? wait;
|
|
1671
1672
|
running = true;
|
|
1672
1673
|
latch.closeUnsafe();
|
|
1673
1674
|
exit = undefined;
|
|
1674
1675
|
return onExit(self, exit_ => sync(() => {
|
|
1675
1676
|
running = false;
|
|
1676
|
-
expiresAt =
|
|
1677
|
+
expiresAt = clock.currentTimeMillisUnsafe() + ttlMillis;
|
|
1677
1678
|
exit = exit_;
|
|
1678
1679
|
latch.openUnsafe();
|
|
1679
1680
|
}));
|
|
@@ -2116,7 +2117,7 @@ export const runSyncExitWith = services => {
|
|
|
2116
2117
|
scheduler
|
|
2117
2118
|
});
|
|
2118
2119
|
fiber.currentDispatcher?.flush();
|
|
2119
|
-
return fiber._exit ?? exitDie(fiber);
|
|
2120
|
+
return fiber._exit ?? exitDie(new AsyncFiberError(fiber));
|
|
2120
2121
|
};
|
|
2121
2122
|
};
|
|
2122
2123
|
/** @internal */
|
|
@@ -2488,6 +2489,20 @@ export class ExceededCapacityError extends /*#__PURE__*/TaggedError("ExceededCap
|
|
|
2488
2489
|
}
|
|
2489
2490
|
}
|
|
2490
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 */
|
|
2491
2506
|
export const UnknownErrorTypeId = "~effect/Cause/UnknownError";
|
|
2492
2507
|
/** @internal */
|
|
2493
2508
|
export const isUnknownError = u => hasProperty(u, UnknownErrorTypeId);
|