effect 4.0.0-beta.19 → 4.0.0-beta.20
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/Channel.d.ts +6 -6
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts +5 -6
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +3 -3
- package/dist/Config.js.map +1 -1
- package/dist/Effect.d.ts +22 -22
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +3 -3
- package/dist/Effect.js.map +1 -1
- package/dist/ErrorReporter.js +2 -2
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/Layer.d.ts +9 -9
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js.map +1 -1
- package/dist/Schedule.d.ts +14 -6
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +25 -9
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +21 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js.map +1 -1
- package/dist/ServiceMap.d.ts +39 -30
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +3 -3
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Sink.d.ts +2 -2
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +6 -6
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/effect.js +2 -2
- package/dist/internal/effect.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -2
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +90 -10
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +11 -12
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +25 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +22 -6
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +3 -3
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +1 -1
- package/dist/unstable/ai/index.js +1 -1
- package/dist/unstable/cli/Command.d.ts +6 -6
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +2 -2
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +2 -2
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +20 -20
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +7 -2
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +3 -126
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +39 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +21 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +2 -2
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +3 -3
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Channel.ts +9 -9
- package/src/Config.ts +9 -9
- package/src/Effect.ts +24 -32
- package/src/ErrorReporter.ts +2 -2
- package/src/Layer.ts +11 -15
- package/src/Schedule.ts +35 -19
- package/src/Schema.ts +21 -0
- package/src/ServiceMap.ts +47 -38
- package/src/Sink.ts +3 -3
- package/src/Stream.ts +9 -9
- package/src/index.ts +1 -1
- package/src/internal/effect.ts +24 -24
- package/src/testing/TestSchema.ts +2 -2
- package/src/unstable/ai/AiError.ts +95 -42
- package/src/unstable/ai/Model.ts +40 -9
- package/src/unstable/ai/Tool.ts +4 -4
- package/src/unstable/ai/index.ts +1 -1
- package/src/unstable/cli/Command.ts +9 -12
- package/src/unstable/cli/internal/command.ts +2 -2
- package/src/unstable/cluster/Entity.ts +4 -4
- package/src/unstable/cluster/ShardingConfig.ts +20 -20
- package/src/unstable/httpapi/HttpApi.ts +5 -5
- package/src/unstable/httpapi/HttpApiBuilder.ts +2 -2
- package/src/unstable/httpapi/HttpApiClient.ts +11 -3
- package/src/unstable/httpapi/HttpApiEndpoint.ts +7 -7
- package/src/unstable/httpapi/HttpApiGroup.ts +6 -6
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
- package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
- package/src/unstable/httpapi/OpenApi.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +4 -206
- package/src/unstable/process/ChildProcessSpawner.ts +69 -14
- package/src/unstable/rpc/Rpc.ts +2 -2
- package/src/unstable/rpc/RpcGroup.ts +4 -4
- package/src/unstable/rpc/RpcMiddleware.ts +3 -3
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/workflow/Workflow.ts +1 -1
package/dist/Effect.d.ts
CHANGED
|
@@ -636,7 +636,7 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
|
|
|
636
636
|
readonly mode?: "default" | "result" | undefined;
|
|
637
637
|
}>(arg: Arg, options?: O) => All.Return<Arg, O>;
|
|
638
638
|
/**
|
|
639
|
-
* Applies an effectful
|
|
639
|
+
* Applies an effectful function to each element and partitions failures and
|
|
640
640
|
* successes.
|
|
641
641
|
*
|
|
642
642
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
@@ -649,10 +649,10 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
|
|
|
649
649
|
*
|
|
650
650
|
* @example
|
|
651
651
|
* ```ts
|
|
652
|
-
* import { Effect
|
|
652
|
+
* import { Effect } from "effect"
|
|
653
653
|
*
|
|
654
654
|
* const program = Effect.partition([0, 1, 2, 3], (n) =>
|
|
655
|
-
*
|
|
655
|
+
* n % 2 === 0 ? Effect.fail(`${n} is even`) : Effect.succeed(n)
|
|
656
656
|
* )
|
|
657
657
|
*
|
|
658
658
|
* Effect.runPromise(program).then(console.log)
|
|
@@ -664,7 +664,7 @@ export declare const all: <const Arg extends Iterable<Effect<any, any, any>> | R
|
|
|
664
664
|
*/
|
|
665
665
|
export declare const partition: {
|
|
666
666
|
/**
|
|
667
|
-
* Applies an effectful
|
|
667
|
+
* Applies an effectful function to each element and partitions failures and
|
|
668
668
|
* successes.
|
|
669
669
|
*
|
|
670
670
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
@@ -677,10 +677,10 @@ export declare const partition: {
|
|
|
677
677
|
*
|
|
678
678
|
* @example
|
|
679
679
|
* ```ts
|
|
680
|
-
* import { Effect
|
|
680
|
+
* import { Effect } from "effect"
|
|
681
681
|
*
|
|
682
682
|
* const program = Effect.partition([0, 1, 2, 3], (n) =>
|
|
683
|
-
*
|
|
683
|
+
* n % 2 === 0 ? Effect.fail(`${n} is even`) : Effect.succeed(n)
|
|
684
684
|
* )
|
|
685
685
|
*
|
|
686
686
|
* Effect.runPromise(program).then(console.log)
|
|
@@ -690,11 +690,11 @@ export declare const partition: {
|
|
|
690
690
|
* @since 3.0.0
|
|
691
691
|
* @category Collecting
|
|
692
692
|
*/
|
|
693
|
-
<A,
|
|
693
|
+
<A, B, E, R>(f: (a: A, i: number) => Effect<B, E, R>, options?: {
|
|
694
694
|
readonly concurrency?: Concurrency | undefined;
|
|
695
|
-
}): (elements: Iterable<A>) => Effect<[excluded: Array<
|
|
695
|
+
}): (elements: Iterable<A>) => Effect<[excluded: Array<E>, satisfying: Array<B>], never, R>;
|
|
696
696
|
/**
|
|
697
|
-
* Applies an effectful
|
|
697
|
+
* Applies an effectful function to each element and partitions failures and
|
|
698
698
|
* successes.
|
|
699
699
|
*
|
|
700
700
|
* The returned tuple is `[excluded, satisfying]`, where:
|
|
@@ -707,10 +707,10 @@ export declare const partition: {
|
|
|
707
707
|
*
|
|
708
708
|
* @example
|
|
709
709
|
* ```ts
|
|
710
|
-
* import { Effect
|
|
710
|
+
* import { Effect } from "effect"
|
|
711
711
|
*
|
|
712
712
|
* const program = Effect.partition([0, 1, 2, 3], (n) =>
|
|
713
|
-
*
|
|
713
|
+
* n % 2 === 0 ? Effect.fail(`${n} is even`) : Effect.succeed(n)
|
|
714
714
|
* )
|
|
715
715
|
*
|
|
716
716
|
* Effect.runPromise(program).then(console.log)
|
|
@@ -720,9 +720,9 @@ export declare const partition: {
|
|
|
720
720
|
* @since 3.0.0
|
|
721
721
|
* @category Collecting
|
|
722
722
|
*/
|
|
723
|
-
<A,
|
|
723
|
+
<A, B, E, R>(elements: Iterable<A>, f: (a: A, i: number) => Effect<B, E, R>, options?: {
|
|
724
724
|
readonly concurrency?: Concurrency | undefined;
|
|
725
|
-
}): Effect<[excluded: Array<
|
|
725
|
+
}): Effect<[excluded: Array<E>, satisfying: Array<B>], never, R>;
|
|
726
726
|
};
|
|
727
727
|
/**
|
|
728
728
|
* Applies an effectful function to each element and accumulates all failures.
|
|
@@ -9950,7 +9950,7 @@ export declare const provideServices: {
|
|
|
9950
9950
|
* @since 4.0.0
|
|
9951
9951
|
* @category ServiceMap
|
|
9952
9952
|
*/
|
|
9953
|
-
export declare const service: <I, S>(service: ServiceMap.
|
|
9953
|
+
export declare const service: <I, S>(service: ServiceMap.Key<I, S>) => Effect<S, never, I>;
|
|
9954
9954
|
/**
|
|
9955
9955
|
* Optionally accesses a service from the environment.
|
|
9956
9956
|
*
|
|
@@ -9985,7 +9985,7 @@ export declare const service: <I, S>(service: ServiceMap.Service<I, S>) => Effec
|
|
|
9985
9985
|
* @since 2.0.0
|
|
9986
9986
|
* @category ServiceMap
|
|
9987
9987
|
*/
|
|
9988
|
-
export declare const serviceOption: <I, S>(key: ServiceMap.
|
|
9988
|
+
export declare const serviceOption: <I, S>(key: ServiceMap.Key<I, S>) => Effect<Option<S>>;
|
|
9989
9989
|
/**
|
|
9990
9990
|
* Provides part of the required context while leaving the rest unchanged.
|
|
9991
9991
|
*
|
|
@@ -10167,7 +10167,7 @@ export declare const updateService: {
|
|
|
10167
10167
|
* @since 2.0.0
|
|
10168
10168
|
* @category ServiceMap
|
|
10169
10169
|
*/
|
|
10170
|
-
<I, A>(service: ServiceMap.
|
|
10170
|
+
<I, A>(service: ServiceMap.Key<I, A>, f: (value: A) => A): <XA, E, R>(self: Effect<XA, E, R>) => Effect<XA, E, R | I>;
|
|
10171
10171
|
/**
|
|
10172
10172
|
* Updates the service with the required service entry.
|
|
10173
10173
|
*
|
|
@@ -10196,7 +10196,7 @@ export declare const updateService: {
|
|
|
10196
10196
|
* @since 2.0.0
|
|
10197
10197
|
* @category ServiceMap
|
|
10198
10198
|
*/
|
|
10199
|
-
<XA, E, R, I, A>(self: Effect<XA, E, R>, service: ServiceMap.
|
|
10199
|
+
<XA, E, R, I, A>(self: Effect<XA, E, R>, service: ServiceMap.Key<I, A>, f: (value: A) => A): Effect<XA, E, R | I>;
|
|
10200
10200
|
};
|
|
10201
10201
|
/**
|
|
10202
10202
|
* The `provideService` function is used to provide an actual
|
|
@@ -10289,7 +10289,7 @@ export declare const provideService: {
|
|
|
10289
10289
|
* @since 2.0.0
|
|
10290
10290
|
* @category ServiceMap
|
|
10291
10291
|
*/
|
|
10292
|
-
<I, S>(service: ServiceMap.
|
|
10292
|
+
<I, S>(service: ServiceMap.Key<I, S>): {
|
|
10293
10293
|
/**
|
|
10294
10294
|
* The `provideService` function is used to provide an actual
|
|
10295
10295
|
* implementation for a service in the context of an effect.
|
|
@@ -10428,7 +10428,7 @@ export declare const provideService: {
|
|
|
10428
10428
|
* @since 2.0.0
|
|
10429
10429
|
* @category ServiceMap
|
|
10430
10430
|
*/
|
|
10431
|
-
<I, S>(service: ServiceMap.
|
|
10431
|
+
<I, S>(service: ServiceMap.Key<I, S>, implementation: S): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, I>>;
|
|
10432
10432
|
/**
|
|
10433
10433
|
* The `provideService` function is used to provide an actual
|
|
10434
10434
|
* implementation for a service in the context of an effect.
|
|
@@ -10474,7 +10474,7 @@ export declare const provideService: {
|
|
|
10474
10474
|
* @since 2.0.0
|
|
10475
10475
|
* @category ServiceMap
|
|
10476
10476
|
*/
|
|
10477
|
-
<A, E, R, I, S>(self: Effect<A, E, R>, service: ServiceMap.
|
|
10477
|
+
<A, E, R, I, S>(self: Effect<A, E, R>, service: ServiceMap.Key<I, S>, implementation: S): Effect<A, E, Exclude<R, I>>;
|
|
10478
10478
|
};
|
|
10479
10479
|
/**
|
|
10480
10480
|
* Provides the effect with the single service it requires. If the effect
|
|
@@ -10581,7 +10581,7 @@ export declare const provideServiceEffect: {
|
|
|
10581
10581
|
* @since 2.0.0
|
|
10582
10582
|
* @category ServiceMap
|
|
10583
10583
|
*/
|
|
10584
|
-
<I, S, E2, R2>(service: ServiceMap.
|
|
10584
|
+
<I, S, E2, R2>(service: ServiceMap.Key<I, S>, acquire: Effect<S, E2, R2>): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E | E2, Exclude<R, I> | R2>;
|
|
10585
10585
|
/**
|
|
10586
10586
|
* Provides the effect with the single service it requires. If the effect
|
|
10587
10587
|
* requires more than one service use `provide` instead.
|
|
@@ -10634,7 +10634,7 @@ export declare const provideServiceEffect: {
|
|
|
10634
10634
|
* @since 2.0.0
|
|
10635
10635
|
* @category ServiceMap
|
|
10636
10636
|
*/
|
|
10637
|
-
<A, E, R, I, S, E2, R2>(self: Effect<A, E, R>, service: ServiceMap.
|
|
10637
|
+
<A, E, R, I, S, E2, R2>(self: Effect<A, E, R>, service: ServiceMap.Key<I, S>, acquire: Effect<S, E2, R2>): Effect<A, E | E2, Exclude<R, I> | R2>;
|
|
10638
10638
|
};
|
|
10639
10639
|
/**
|
|
10640
10640
|
* Sets the concurrency level for parallel operations within an effect.
|