effect 4.0.0-beta.10 → 4.0.0-beta.12
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 +7 -7
- package/dist/Config.d.ts +157 -0
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +56 -1
- package/dist/Config.js.map +1 -1
- package/dist/Effect.d.ts +296 -8
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +72 -0
- package/dist/Effect.js.map +1 -1
- package/dist/ErrorReporter.d.ts +376 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +246 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/Fiber.d.ts +2 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +3 -6
- package/dist/Graph.js.map +1 -1
- package/dist/LogLevel.d.ts +5 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +25 -91
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +0 -1
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +17 -0
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +17 -0
- package/dist/Random.js.map +1 -1
- package/dist/References.d.ts +3 -3
- package/dist/References.d.ts.map +1 -1
- package/dist/Schema.d.ts +3 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +2 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/Stream.d.ts +5 -5
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +98 -33
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +2 -2
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +86 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +112 -36
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +47 -10
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +33 -6
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +16 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/CliOutput.js +37 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +199 -7
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +116 -6
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +60 -2
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +11 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +33 -8
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +10 -2
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +27 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +28 -4
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -8
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +25 -31
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +4 -8
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +14 -27
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +37 -44
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +2 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +2 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +11 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +29 -9
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -1
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +22 -1
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +14 -0
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +34 -9
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +0 -7
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +9 -10
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +6 -0
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +131 -0
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Channel.ts +9 -9
- package/src/Config.ts +171 -9
- package/src/Effect.ts +315 -8
- package/src/ErrorReporter.ts +459 -0
- package/src/Fiber.ts +9 -2
- package/src/Graph.ts +16 -6
- package/src/LogLevel.ts +6 -0
- package/src/Logger.ts +28 -95
- package/src/Queue.ts +0 -1
- package/src/Random.ts +18 -0
- package/src/References.ts +4 -4
- package/src/Schema.ts +1 -1
- package/src/SchemaAST.ts +2 -1
- package/src/Stream.ts +7 -7
- package/src/index.ts +5 -0
- package/src/internal/effect.ts +205 -49
- package/src/internal/hashMap.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +117 -16
- package/src/unstable/ai/McpSchema.ts +57 -11
- package/src/unstable/ai/McpServer.ts +44 -6
- package/src/unstable/ai/Tool.ts +15 -0
- package/src/unstable/cli/CliOutput.ts +45 -6
- package/src/unstable/cli/Command.ts +298 -11
- package/src/unstable/cli/HelpDoc.ts +68 -2
- package/src/unstable/cli/internal/command.ts +47 -11
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
- package/src/unstable/cli/internal/parser.ts +11 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +2 -2
- package/src/unstable/http/Headers.ts +28 -13
- package/src/unstable/http/HttpClient.ts +45 -10
- package/src/unstable/http/HttpEffect.ts +30 -44
- package/src/unstable/http/HttpMiddleware.ts +4 -14
- package/src/unstable/http/HttpServerError.ts +42 -45
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +3 -1
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +2 -1
- package/src/unstable/httpapi/HttpApiError.ts +30 -9
- package/src/unstable/observability/OtlpLogger.ts +9 -5
- package/src/unstable/reactivity/Atom.ts +1 -1
- package/src/unstable/reactivity/AtomRegistry.ts +29 -1
- package/src/unstable/rpc/RpcSchema.ts +17 -0
- package/src/unstable/rpc/RpcSerialization.ts +44 -9
- package/src/unstable/rpc/RpcServer.ts +14 -19
- package/src/unstable/workflow/WorkflowEngine.ts +178 -0
package/src/Logger.ts
CHANGED
|
@@ -115,8 +115,7 @@ import type { PlatformError } from "./PlatformError.ts"
|
|
|
115
115
|
import * as Predicate from "./Predicate.ts"
|
|
116
116
|
import { CurrentLogAnnotations, CurrentLogSpans } from "./References.ts"
|
|
117
117
|
import type * as Scope from "./Scope.ts"
|
|
118
|
-
import * as ServiceMap from "./ServiceMap.ts"
|
|
119
|
-
import type * as Types from "./Types.ts"
|
|
118
|
+
import type * as ServiceMap from "./ServiceMap.ts"
|
|
120
119
|
|
|
121
120
|
const TypeId = "~effect/Logger"
|
|
122
121
|
|
|
@@ -144,8 +143,9 @@ const TypeId = "~effect/Logger"
|
|
|
144
143
|
* @since 2.0.0
|
|
145
144
|
* @category models
|
|
146
145
|
*/
|
|
147
|
-
export interface Logger<in Message, out Output> extends
|
|
148
|
-
|
|
146
|
+
export interface Logger<in Message, out Output> extends Pipeable {
|
|
147
|
+
readonly [TypeId]: typeof TypeId
|
|
148
|
+
log(options: Options<Message>): Output
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
/**
|
|
@@ -153,100 +153,32 @@ export interface Logger<in Message, out Output> extends Logger.Variance<Message,
|
|
|
153
153
|
* ```ts
|
|
154
154
|
* import { Effect, Logger } from "effect"
|
|
155
155
|
*
|
|
156
|
-
* //
|
|
157
|
-
* const
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
156
|
+
* // Options interface provides all logging context
|
|
157
|
+
* const detailedLogger = Logger.make((options) => {
|
|
158
|
+
* const output = {
|
|
159
|
+
* message: options.message,
|
|
160
|
+
* level: options.logLevel,
|
|
161
|
+
* timestamp: options.date.toISOString(),
|
|
162
|
+
* fiberId: options.fiber.id,
|
|
163
|
+
* hasCause: options.cause !== undefined
|
|
164
|
+
* }
|
|
165
|
+
* console.log(JSON.stringify(output))
|
|
162
166
|
* })
|
|
163
167
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* Effect.provide(Logger.layer([customLogger]))
|
|
168
|
+
* const program = Effect.log("Processing request").pipe(
|
|
169
|
+
* Effect.provide(Logger.layer([detailedLogger]))
|
|
167
170
|
* )
|
|
168
171
|
* ```
|
|
169
172
|
*
|
|
170
173
|
* @since 2.0.0
|
|
171
174
|
* @category models
|
|
172
175
|
*/
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
* // Variance interface defines contravariance for Message and covariance for Output
|
|
180
|
-
* const customLogger = Logger.make<unknown, void>((options) => {
|
|
181
|
-
* console.log(options.message)
|
|
182
|
-
* })
|
|
183
|
-
*
|
|
184
|
-
* // The logger can accept more specific message types (contravariance)
|
|
185
|
-
* // and can be used where less specific output types are expected (covariance)
|
|
186
|
-
* ```
|
|
187
|
-
*
|
|
188
|
-
* @since 2.0.0
|
|
189
|
-
* @category models
|
|
190
|
-
*/
|
|
191
|
-
export interface Variance<in Message, out Output> {
|
|
192
|
-
readonly [TypeId]: VarianceStruct<Message, Output>
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @example
|
|
197
|
-
* ```ts
|
|
198
|
-
* import { Logger } from "effect"
|
|
199
|
-
*
|
|
200
|
-
* // VarianceStruct defines the actual variance structure used internally
|
|
201
|
-
* // This structure ensures proper typing and variance behavior
|
|
202
|
-
* const logger = Logger.make<unknown, void>((options) => {
|
|
203
|
-
* console.log(options.message)
|
|
204
|
-
* })
|
|
205
|
-
*
|
|
206
|
-
* // The variance structure handles contravariance for input Message type
|
|
207
|
-
* // and covariance for output Output type
|
|
208
|
-
* ```
|
|
209
|
-
*
|
|
210
|
-
* @since 4.0.0
|
|
211
|
-
* @category models
|
|
212
|
-
*/
|
|
213
|
-
export interface VarianceStruct<in Message, out Output> {
|
|
214
|
-
_Message: Types.Contravariant<Message>
|
|
215
|
-
_Output: Types.Covariant<Output>
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @example
|
|
220
|
-
* ```ts
|
|
221
|
-
* import { Effect, Logger } from "effect"
|
|
222
|
-
*
|
|
223
|
-
* // Options interface provides all logging context
|
|
224
|
-
* const detailedLogger = Logger.make((options) => {
|
|
225
|
-
* const output = {
|
|
226
|
-
* message: options.message,
|
|
227
|
-
* level: options.logLevel,
|
|
228
|
-
* timestamp: options.date.toISOString(),
|
|
229
|
-
* fiberId: options.fiber.id,
|
|
230
|
-
* hasCause: options.cause !== undefined
|
|
231
|
-
* }
|
|
232
|
-
* console.log(JSON.stringify(output))
|
|
233
|
-
* })
|
|
234
|
-
*
|
|
235
|
-
* const program = Effect.log("Processing request").pipe(
|
|
236
|
-
* Effect.provide(Logger.layer([detailedLogger]))
|
|
237
|
-
* )
|
|
238
|
-
* ```
|
|
239
|
-
*
|
|
240
|
-
* @since 2.0.0
|
|
241
|
-
* @category models
|
|
242
|
-
*/
|
|
243
|
-
export interface Options<out Message> {
|
|
244
|
-
readonly message: Message
|
|
245
|
-
readonly logLevel: LogLevel.LogLevel
|
|
246
|
-
readonly cause: Cause.Cause<unknown>
|
|
247
|
-
readonly fiber: Fiber.Fiber<unknown, unknown>
|
|
248
|
-
readonly date: Date
|
|
249
|
-
}
|
|
176
|
+
export interface Options<out Message> {
|
|
177
|
+
readonly message: Message
|
|
178
|
+
readonly logLevel: LogLevel.LogLevel
|
|
179
|
+
readonly cause: Cause.Cause<unknown>
|
|
180
|
+
readonly fiber: Fiber.Fiber<unknown, unknown>
|
|
181
|
+
readonly date: Date
|
|
250
182
|
}
|
|
251
183
|
|
|
252
184
|
/**
|
|
@@ -562,7 +494,7 @@ const format = (
|
|
|
562
494
|
quoteValue: (s: string) => string,
|
|
563
495
|
space?: number | string | undefined
|
|
564
496
|
) =>
|
|
565
|
-
({ cause, date, fiber, logLevel, message }:
|
|
497
|
+
({ cause, date, fiber, logLevel, message }: Options<unknown>): string => {
|
|
566
498
|
const formatValue = (value: string): string => value.match(textOnly) ? value : quoteValue(value)
|
|
567
499
|
const format = (label: string, value: string): string => `${effect.formatLabel(label)}=${formatValue(value)}`
|
|
568
500
|
const append = (label: string, value: string): string => " " + format(label, value)
|
|
@@ -636,7 +568,7 @@ const format = (
|
|
|
636
568
|
* @category constructors
|
|
637
569
|
*/
|
|
638
570
|
export const make: <Message, Output>(
|
|
639
|
-
log: (options:
|
|
571
|
+
log: (options: Options<Message>) => Output
|
|
640
572
|
) => Logger<Message, Output> = effect.loggerMake
|
|
641
573
|
|
|
642
574
|
/**
|
|
@@ -1389,7 +1321,7 @@ export const layer = <
|
|
|
1389
1321
|
const Loggers extends ReadonlyArray<Logger<unknown, unknown> | Effect.Effect<Logger<unknown, unknown>, any, any>>
|
|
1390
1322
|
>(
|
|
1391
1323
|
loggers: Loggers,
|
|
1392
|
-
options?: { mergeWithExisting
|
|
1324
|
+
options?: { readonly mergeWithExisting?: boolean | undefined } | undefined
|
|
1393
1325
|
): Layer.Layer<
|
|
1394
1326
|
never,
|
|
1395
1327
|
Loggers extends readonly [] ? never : Effect.Error<Loggers[number]>,
|
|
@@ -1398,13 +1330,14 @@ export const layer = <
|
|
|
1398
1330
|
Scope.Scope
|
|
1399
1331
|
>
|
|
1400
1332
|
> =>
|
|
1401
|
-
Layer.
|
|
1333
|
+
Layer.effect(
|
|
1334
|
+
CurrentLoggers,
|
|
1402
1335
|
withFiber(effect.fnUntraced(function*(fiber) {
|
|
1403
1336
|
const currentLoggers = new Set(options?.mergeWithExisting === true ? fiber.getRef(effect.CurrentLoggers) : [])
|
|
1404
1337
|
for (const logger of loggers) {
|
|
1405
1338
|
currentLoggers.add(isEffect(logger) ? yield* logger : logger)
|
|
1406
1339
|
}
|
|
1407
|
-
return
|
|
1340
|
+
return currentLoggers
|
|
1408
1341
|
}))
|
|
1409
1342
|
)
|
|
1410
1343
|
|
package/src/Queue.ts
CHANGED
|
@@ -1113,7 +1113,6 @@ export const collect = <A, E>(self: Dequeue<A, E | Done>): Effect<Array<A>, Pull
|
|
|
1113
1113
|
while: constTrue,
|
|
1114
1114
|
body: constant(takeAll(self)),
|
|
1115
1115
|
step(items: Arr.NonEmptyArray<A>) {
|
|
1116
|
-
out.push(...items)
|
|
1117
1116
|
for (let i = 0; i < items.length; i++) {
|
|
1118
1117
|
out.push(items[i])
|
|
1119
1118
|
}
|
package/src/Random.ts
CHANGED
|
@@ -76,6 +76,24 @@ const randomWith = <A>(f: (random: typeof Random["Service"]) => A): Effect.Effec
|
|
|
76
76
|
*/
|
|
77
77
|
export const next: Effect.Effect<number> = randomWith((r) => r.nextDoubleUnsafe())
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Generates a random boolean value.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import { Effect, Random } from "effect"
|
|
85
|
+
*
|
|
86
|
+
* const program = Effect.gen(function*() {
|
|
87
|
+
* const value = yield* Random.nextBoolean
|
|
88
|
+
* console.log("Random boolean:", value)
|
|
89
|
+
* })
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @since 4.0.0
|
|
93
|
+
* @category Random Number Generators
|
|
94
|
+
*/
|
|
95
|
+
export const nextBoolean: Effect.Effect<boolean> = randomWith((r) => r.nextDoubleUnsafe() > 0.5)
|
|
96
|
+
|
|
79
97
|
/**
|
|
80
98
|
* Generates a random integer between `Number.MIN_SAFE_INTEGER` (inclusive)
|
|
81
99
|
* and `Number.MAX_SAFE_INTEGER` (inclusive).
|
package/src/References.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
import { constTrue, constUndefined } from "./Function.ts"
|
|
14
|
-
import type { LogLevel } from "./LogLevel.ts"
|
|
14
|
+
import type { LogLevel, Severity } from "./LogLevel.ts"
|
|
15
15
|
import type { ReadonlyRecord } from "./Record.ts"
|
|
16
16
|
import { MaxOpsBeforeYield } from "./Scheduler.ts"
|
|
17
17
|
import * as ServiceMap from "./ServiceMap.ts"
|
|
@@ -451,7 +451,7 @@ export const CurrentLogAnnotations = ServiceMap.Reference<ReadonlyRecord<string,
|
|
|
451
451
|
* @category references
|
|
452
452
|
* @since 4.0.0
|
|
453
453
|
*/
|
|
454
|
-
export const CurrentLogLevel: ServiceMap.Reference<
|
|
454
|
+
export const CurrentLogLevel: ServiceMap.Reference<Severity> = ServiceMap.Reference<Severity>(
|
|
455
455
|
"effect/References/CurrentLogLevel",
|
|
456
456
|
{ defaultValue: () => "Info" }
|
|
457
457
|
)
|
|
@@ -516,9 +516,9 @@ export const MinimumLogLevel = ServiceMap.Reference<
|
|
|
516
516
|
* @category references
|
|
517
517
|
* @since 4.0.0
|
|
518
518
|
*/
|
|
519
|
-
export const UnhandledLogLevel: ServiceMap.Reference<
|
|
519
|
+
export const UnhandledLogLevel: ServiceMap.Reference<Severity | undefined> = ServiceMap.Reference(
|
|
520
520
|
"effect/References/UnhandledLogLevel",
|
|
521
|
-
{ defaultValue: ():
|
|
521
|
+
{ defaultValue: (): Severity | undefined => "Error" }
|
|
522
522
|
)
|
|
523
523
|
|
|
524
524
|
/**
|
package/src/Schema.ts
CHANGED
|
@@ -1717,7 +1717,7 @@ export function fieldsAssign<const NewFields extends Struct.Fields>(fields: NewF
|
|
|
1717
1717
|
* @since 4.0.0
|
|
1718
1718
|
*/
|
|
1719
1719
|
export function encodeKeys<
|
|
1720
|
-
S extends Struct
|
|
1720
|
+
S extends Top & { readonly fields: Struct.Fields },
|
|
1721
1721
|
const M extends { readonly [K in keyof S["fields"]]?: PropertyKey }
|
|
1722
1722
|
>(mapping: M) {
|
|
1723
1723
|
return function(
|
package/src/SchemaAST.ts
CHANGED
|
@@ -1455,7 +1455,8 @@ export class Arrays extends Base {
|
|
|
1455
1455
|
// handle post rest elements
|
|
1456
1456
|
// ---------------------------------------------
|
|
1457
1457
|
for (let j = 0; j < tail.length; j++) {
|
|
1458
|
-
|
|
1458
|
+
i += j
|
|
1459
|
+
if (len < i) {
|
|
1459
1460
|
continue
|
|
1460
1461
|
} else {
|
|
1461
1462
|
const tailj = tail[j]
|
package/src/Stream.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { addSpanStackTrace } from "./internal/tracer.ts"
|
|
|
22
22
|
import * as Iterable from "./Iterable.ts"
|
|
23
23
|
import * as Latch from "./Latch.ts"
|
|
24
24
|
import type * as Layer from "./Layer.ts"
|
|
25
|
-
import type {
|
|
25
|
+
import type { Severity } from "./LogLevel.ts"
|
|
26
26
|
import * as MutableHashMap from "./MutableHashMap.ts"
|
|
27
27
|
import * as MutableList from "./MutableList.ts"
|
|
28
28
|
import * as Option from "./Option.ts"
|
|
@@ -8820,12 +8820,12 @@ export const orDie = <A, E, R>(self: Stream<A, E, R>): Stream<A, never, R> => fr
|
|
|
8820
8820
|
*/
|
|
8821
8821
|
export const ignore: <
|
|
8822
8822
|
Arg extends Stream<any, any, any> | {
|
|
8823
|
-
readonly log?: boolean |
|
|
8823
|
+
readonly log?: boolean | Severity | undefined
|
|
8824
8824
|
} | undefined
|
|
8825
8825
|
>(
|
|
8826
8826
|
selfOrOptions: Arg,
|
|
8827
8827
|
options?: {
|
|
8828
|
-
readonly log?: boolean |
|
|
8828
|
+
readonly log?: boolean | Severity | undefined
|
|
8829
8829
|
} | undefined
|
|
8830
8830
|
) => [Arg] extends [Stream<infer A, infer _E, infer R>] ? Stream<A, never, R>
|
|
8831
8831
|
: <A, E, R>(self: Stream<A, E, R>) => Stream<A, never, R> = dual(
|
|
@@ -8833,7 +8833,7 @@ export const ignore: <
|
|
|
8833
8833
|
<A, E, R>(
|
|
8834
8834
|
self: Stream<A, E, R>,
|
|
8835
8835
|
options?: {
|
|
8836
|
-
readonly log?: boolean |
|
|
8836
|
+
readonly log?: boolean | Severity | undefined
|
|
8837
8837
|
} | undefined
|
|
8838
8838
|
): Stream<A, never, R> => fromChannel(Channel.ignore(self.channel, options))
|
|
8839
8839
|
)
|
|
@@ -8860,19 +8860,19 @@ export const ignore: <
|
|
|
8860
8860
|
*/
|
|
8861
8861
|
export const ignoreCause: <
|
|
8862
8862
|
Arg extends Stream<any, any, any> | {
|
|
8863
|
-
readonly log?: boolean |
|
|
8863
|
+
readonly log?: boolean | Severity | undefined
|
|
8864
8864
|
} | undefined
|
|
8865
8865
|
>(
|
|
8866
8866
|
streamOrOptions: Arg,
|
|
8867
8867
|
options?: {
|
|
8868
|
-
readonly log?: boolean |
|
|
8868
|
+
readonly log?: boolean | Severity | undefined
|
|
8869
8869
|
} | undefined
|
|
8870
8870
|
) => [Arg] extends [Stream<infer A, infer _E, infer R>] ? Stream<A, never, R>
|
|
8871
8871
|
: <A, E, R>(self: Stream<A, E, R>) => Stream<A, never, R> = dual(
|
|
8872
8872
|
(args) => isStream(args[0]),
|
|
8873
8873
|
<A, E, R>(
|
|
8874
8874
|
self: Stream<A, E, R>,
|
|
8875
|
-
options?: { readonly log?: boolean |
|
|
8875
|
+
options?: { readonly log?: boolean | Severity | undefined } | undefined
|
|
8876
8876
|
): Stream<A, never, R> => fromChannel(Channel.ignoreCause(self.channel, options))
|
|
8877
8877
|
)
|
|
8878
8878
|
|
package/src/index.ts
CHANGED
|
@@ -1119,6 +1119,11 @@ export * as Equal from "./Equal.ts"
|
|
|
1119
1119
|
*/
|
|
1120
1120
|
export * as Equivalence from "./Equivalence.ts"
|
|
1121
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
* @since 4.0.0
|
|
1124
|
+
*/
|
|
1125
|
+
export * as ErrorReporter from "./ErrorReporter.ts"
|
|
1126
|
+
|
|
1122
1127
|
/**
|
|
1123
1128
|
* @since 3.16.0
|
|
1124
1129
|
*/
|