effect 4.0.0-beta.73 → 4.0.0-beta.74
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/Array.d.ts +16 -16
- package/dist/Array.js +4 -4
- package/dist/Boolean.d.ts +2 -2
- package/dist/Boolean.js +2 -2
- package/dist/Channel.d.ts +63 -63
- package/dist/Channel.js +25 -25
- package/dist/Chunk.d.ts +17 -17
- package/dist/Chunk.js +5 -5
- package/dist/Context.d.ts +3 -3
- package/dist/Context.js +1 -1
- package/dist/Cron.d.ts +4 -4
- package/dist/Cron.js +4 -4
- package/dist/Deferred.d.ts +37 -37
- package/dist/Deferred.js +13 -13
- package/dist/Duration.d.ts +6 -6
- package/dist/Duration.js +2 -2
- package/dist/Effect.d.ts +58 -58
- package/dist/Effect.js +39 -39
- package/dist/Equal.d.ts +2 -2
- package/dist/Equal.js +2 -2
- package/dist/Equivalence.d.ts +1 -1
- package/dist/Equivalence.js +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.js +1 -1
- package/dist/FileSystem.d.ts +6 -6
- package/dist/FileSystem.js +2 -2
- package/dist/Function.d.ts +5 -5
- package/dist/Function.js +5 -5
- package/dist/Graph.d.ts +11 -11
- package/dist/Graph.js +5 -5
- package/dist/HKT.d.ts +1 -1
- package/dist/HashMap.d.ts +3 -3
- package/dist/HashSet.d.ts +1 -1
- package/dist/Iterable.d.ts +15 -15
- package/dist/Iterable.js +5 -5
- package/dist/Layer.d.ts +16 -16
- package/dist/Layer.js +5 -5
- package/dist/Logger.d.ts +5 -5
- package/dist/Logger.js +4 -4
- package/dist/ManagedRuntime.d.ts +2 -2
- package/dist/Match.d.ts +20 -20
- package/dist/Match.js +16 -16
- package/dist/Metric.d.ts +16 -16
- package/dist/Metric.js +3 -3
- package/dist/Option.d.ts +36 -36
- package/dist/Option.js +17 -17
- package/dist/Order.d.ts +1 -1
- package/dist/Order.js +1 -1
- package/dist/Path.d.ts +1 -1
- package/dist/Path.js +1 -1
- package/dist/Pipeable.d.ts +1 -1
- package/dist/Pipeable.js +1 -1
- package/dist/Predicate.d.ts +5 -5
- package/dist/PubSub.d.ts +9 -9
- package/dist/PubSub.js +5 -5
- package/dist/Queue.d.ts +24 -24
- package/dist/Queue.js +20 -20
- package/dist/Record.d.ts +15 -15
- package/dist/Record.js +5 -5
- package/dist/Redacted.d.ts +2 -2
- package/dist/Redacted.js +1 -1
- package/dist/Ref.d.ts +6 -6
- package/dist/Ref.js +6 -6
- package/dist/RegExp.d.ts +1 -1
- package/dist/RegExp.js +1 -1
- package/dist/Request.d.ts +4 -4
- package/dist/RequestResolver.d.ts +6 -6
- package/dist/RequestResolver.js +2 -2
- package/dist/Resource.d.ts +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Result.d.ts +18 -18
- package/dist/Result.js +11 -11
- package/dist/Schedule.d.ts +44 -44
- package/dist/Schedule.js +18 -18
- package/dist/Schema.d.ts +177 -459
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +25 -25
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +1 -1
- package/dist/SchemaGetter.d.ts +13 -13
- package/dist/SchemaGetter.js +12 -12
- package/dist/SchemaParser.d.ts +3 -3
- package/dist/SchemaParser.js +3 -3
- package/dist/Scope.d.ts +1 -1
- package/dist/Scope.js +1 -1
- package/dist/Sink.d.ts +5 -5
- package/dist/Sink.js +3 -3
- package/dist/Stream.d.ts +55 -55
- package/dist/Stream.js +21 -21
- package/dist/String.d.ts +5 -5
- package/dist/String.js +3 -3
- package/dist/Struct.d.ts +8 -8
- package/dist/Struct.js +3 -3
- package/dist/SynchronizedRef.d.ts +57 -57
- package/dist/SynchronizedRef.js +19 -19
- package/dist/Terminal.d.ts +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Tracer.d.ts +5 -5
- package/dist/Tracer.js +2 -2
- package/dist/Tuple.d.ts +14 -14
- package/dist/Tuple.js +6 -6
- package/dist/TxHashMap.d.ts +3 -3
- package/dist/TxHashSet.d.ts +1 -1
- package/dist/Unify.d.ts +7 -7
- package/dist/Unify.js +1 -1
- package/dist/testing/TestClock.d.ts +5 -5
- package/dist/testing/TestClock.js +4 -4
- package/dist/testing/TestConsole.d.ts +3 -3
- package/dist/testing/TestConsole.js +3 -3
- package/dist/unstable/ai/Chat.d.ts +2 -2
- package/dist/unstable/ai/Chat.js +2 -2
- package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +2 -2
- package/dist/unstable/ai/IdGenerator.js +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +4 -4
- package/dist/unstable/ai/LanguageModel.js +1 -1
- package/dist/unstable/ai/Prompt.d.ts +15 -15
- package/dist/unstable/ai/Prompt.js +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +5 -5
- package/dist/unstable/ai/Telemetry.js +2 -2
- package/dist/unstable/ai/Tokenizer.d.ts +1 -1
- package/dist/unstable/ai/Tokenizer.js +1 -1
- package/dist/unstable/ai/Tool.d.ts +6 -6
- package/dist/unstable/ai/Tool.js +6 -6
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +1 -1
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -3
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.d.ts +11 -11
- package/dist/unstable/cli/internal/parser.js +145 -10
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +1 -1
- package/dist/unstable/cluster/Entity.js +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.js +2 -2
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +1 -1
- package/dist/unstable/cluster/Runners.d.ts +1 -1
- package/dist/unstable/cluster/Runners.js +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +1 -1
- package/dist/unstable/cluster/Sharding.js +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +5 -5
- package/dist/unstable/cluster/Snowflake.js +5 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +1 -1
- package/dist/unstable/eventlog/EventLog.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +3 -3
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +3 -3
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Etag.d.ts +1 -1
- package/dist/unstable/http/Etag.js +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +2 -2
- package/dist/unstable/http/FetchHttpClient.js +2 -2
- package/dist/unstable/http/HttpClient.d.ts +1 -1
- package/dist/unstable/http/HttpClient.js +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +2 -2
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.js +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +1 -1
- package/dist/unstable/http/HttpPlatform.js +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +4 -4
- package/dist/unstable/http/HttpRouter.js +4 -4
- package/dist/unstable/http/HttpServerResponse.d.ts +3 -3
- package/dist/unstable/http/Url.d.ts +33 -33
- package/dist/unstable/http/Url.js +11 -11
- package/dist/unstable/httpapi/HttpApi.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApi.js +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/observability/PrometheusMetrics.d.ts +4 -4
- package/dist/unstable/observability/PrometheusMetrics.js +2 -2
- package/dist/unstable/persistence/KeyValueStore.d.ts +3 -3
- package/dist/unstable/persistence/KeyValueStore.js +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.js +2 -2
- package/dist/unstable/persistence/PersistedQueue.d.ts +8 -8
- package/dist/unstable/persistence/PersistedQueue.js +8 -8
- package/dist/unstable/persistence/RateLimiter.d.ts +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -5
- package/dist/unstable/process/ChildProcess.js +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts +4 -4
- package/dist/unstable/reactivity/AsyncResult.js +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +1 -1
- package/dist/unstable/reactivity/Reactivity.js +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +5 -5
- package/dist/unstable/rpc/Rpc.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +3 -3
- package/dist/unstable/rpc/RpcSchema.js +2 -2
- package/dist/unstable/schema/Model.d.ts +2 -2
- package/dist/unstable/schema/Model.js +1 -1
- package/dist/unstable/socket/Socket.d.ts +3 -3
- package/dist/unstable/socket/Socket.js +3 -3
- package/dist/unstable/socket/SocketServer.d.ts +1 -1
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +3 -3
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/Statement.d.ts +2 -2
- package/dist/unstable/sql/Statement.js +2 -2
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Worker.d.ts +1 -1
- package/dist/unstable/workers/Worker.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +1 -1
- package/package.json +1 -1
- package/src/Array.ts +16 -16
- package/src/Boolean.ts +2 -2
- package/src/Channel.ts +67 -67
- package/src/Chunk.ts +18 -18
- package/src/Context.ts +4 -4
- package/src/Cron.ts +4 -4
- package/src/Deferred.ts +37 -37
- package/src/Duration.ts +6 -6
- package/src/Effect.ts +58 -58
- package/src/Equal.ts +2 -2
- package/src/Equivalence.ts +1 -1
- package/src/ExecutionPlan.ts +2 -2
- package/src/FileSystem.ts +6 -6
- package/src/Function.ts +5 -5
- package/src/Graph.ts +11 -11
- package/src/HKT.ts +1 -1
- package/src/HashMap.ts +3 -3
- package/src/HashSet.ts +1 -1
- package/src/Iterable.ts +15 -15
- package/src/Layer.ts +16 -16
- package/src/Logger.ts +7 -7
- package/src/ManagedRuntime.ts +2 -2
- package/src/Match.ts +20 -20
- package/src/Metric.ts +20 -20
- package/src/Option.ts +36 -36
- package/src/Order.ts +1 -1
- package/src/Path.ts +1 -1
- package/src/Pipeable.ts +1 -1
- package/src/Predicate.ts +5 -5
- package/src/PubSub.ts +9 -9
- package/src/Queue.ts +24 -24
- package/src/Record.ts +15 -15
- package/src/Redacted.ts +2 -2
- package/src/Ref.ts +18 -18
- package/src/RegExp.ts +1 -1
- package/src/Request.ts +4 -4
- package/src/RequestResolver.ts +8 -8
- package/src/Resource.ts +1 -1
- package/src/Result.ts +18 -18
- package/src/Schedule.ts +45 -45
- package/src/Schema.ts +177 -459
- package/src/SchemaAST.ts +1 -1
- package/src/SchemaGetter.ts +13 -13
- package/src/SchemaParser.ts +3 -3
- package/src/Scope.ts +1 -1
- package/src/Sink.ts +5 -5
- package/src/Stream.ts +57 -57
- package/src/String.ts +5 -5
- package/src/Struct.ts +8 -8
- package/src/SynchronizedRef.ts +57 -57
- package/src/Terminal.ts +1 -1
- package/src/Tracer.ts +5 -5
- package/src/Tuple.ts +14 -14
- package/src/TxHashMap.ts +3 -3
- package/src/TxHashSet.ts +1 -1
- package/src/Unify.ts +7 -7
- package/src/testing/TestClock.ts +5 -5
- package/src/testing/TestConsole.ts +3 -3
- package/src/unstable/ai/Chat.ts +2 -2
- package/src/unstable/ai/EmbeddingModel.ts +1 -1
- package/src/unstable/ai/IdGenerator.ts +2 -2
- package/src/unstable/ai/LanguageModel.ts +4 -4
- package/src/unstable/ai/Prompt.ts +15 -15
- package/src/unstable/ai/Telemetry.ts +5 -5
- package/src/unstable/ai/Tokenizer.ts +1 -1
- package/src/unstable/ai/Tool.ts +6 -6
- package/src/unstable/cli/Command.ts +5 -1
- package/src/unstable/cli/Param.ts +1 -1
- package/src/unstable/cli/Primitive.ts +3 -3
- package/src/unstable/cli/Prompt.ts +11 -11
- package/src/unstable/cli/internal/parser.ts +204 -10
- package/src/unstable/cluster/Entity.ts +1 -1
- package/src/unstable/cluster/HttpRunner.ts +2 -2
- package/src/unstable/cluster/K8sHttpClient.ts +1 -1
- package/src/unstable/cluster/Runners.ts +1 -1
- package/src/unstable/cluster/Sharding.ts +1 -1
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +5 -5
- package/src/unstable/devtools/DevToolsClient.ts +1 -1
- package/src/unstable/eventlog/EventLog.ts +1 -1
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +3 -3
- package/src/unstable/http/Cookies.ts +1 -1
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +2 -2
- package/src/unstable/http/HttpClient.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +2 -2
- package/src/unstable/http/HttpMiddleware.ts +1 -1
- package/src/unstable/http/HttpPlatform.ts +1 -1
- package/src/unstable/http/HttpRouter.ts +4 -4
- package/src/unstable/http/HttpServerResponse.ts +3 -3
- package/src/unstable/http/Url.ts +33 -33
- package/src/unstable/httpapi/HttpApi.ts +1 -1
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/observability/PrometheusMetrics.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +3 -3
- package/src/unstable/persistence/Persistable.ts +2 -2
- package/src/unstable/persistence/PersistedQueue.ts +8 -8
- package/src/unstable/persistence/RateLimiter.ts +1 -1
- package/src/unstable/process/ChildProcess.ts +5 -5
- package/src/unstable/reactivity/AsyncResult.ts +4 -4
- package/src/unstable/reactivity/Atom.ts +1 -1
- package/src/unstable/reactivity/AtomRegistry.ts +1 -1
- package/src/unstable/reactivity/Reactivity.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +5 -5
- package/src/unstable/rpc/RpcMiddleware.ts +1 -1
- package/src/unstable/rpc/RpcSchema.ts +3 -3
- package/src/unstable/schema/Model.ts +2 -2
- package/src/unstable/socket/Socket.ts +3 -3
- package/src/unstable/socket/SocketServer.ts +1 -1
- package/src/unstable/sql/Migrator.ts +1 -1
- package/src/unstable/sql/SqlClient.ts +3 -3
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/Statement.ts +2 -2
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +1 -1
- package/src/unstable/workflow/Activity.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +1 -1
|
@@ -149,7 +149,7 @@ export interface Handlers<State, Output> {
|
|
|
149
149
|
* Options for a confirmation prompt that asks the user to choose a boolean
|
|
150
150
|
* yes/no value.
|
|
151
151
|
*
|
|
152
|
-
* @category
|
|
152
|
+
* @category options
|
|
153
153
|
* @since 4.0.0
|
|
154
154
|
*/
|
|
155
155
|
export interface ConfirmOptions {
|
|
@@ -195,7 +195,7 @@ export interface ConfirmOptions {
|
|
|
195
195
|
* Options for a date prompt, including the displayed message, initial value,
|
|
196
196
|
* format mask, validation, and locale labels.
|
|
197
197
|
*
|
|
198
|
-
* @category
|
|
198
|
+
* @category options
|
|
199
199
|
* @since 4.0.0
|
|
200
200
|
*/
|
|
201
201
|
export interface DateOptions {
|
|
@@ -270,7 +270,7 @@ export interface DateOptions {
|
|
|
270
270
|
* Options for an integer prompt, including bounds, keyboard step sizes, and
|
|
271
271
|
* additional validation.
|
|
272
272
|
*
|
|
273
|
-
* @category
|
|
273
|
+
* @category options
|
|
274
274
|
* @since 4.0.0
|
|
275
275
|
*/
|
|
276
276
|
export interface IntegerOptions {
|
|
@@ -315,7 +315,7 @@ export interface IntegerOptions {
|
|
|
315
315
|
* In addition to the numeric bounds and step settings from `IntegerOptions`,
|
|
316
316
|
* the prompt can be configured with a display precision.
|
|
317
317
|
*
|
|
318
|
-
* @category
|
|
318
|
+
* @category options
|
|
319
319
|
* @since 4.0.0
|
|
320
320
|
*/
|
|
321
321
|
export interface FloatOptions extends IntegerOptions {
|
|
@@ -329,7 +329,7 @@ export interface FloatOptions extends IntegerOptions {
|
|
|
329
329
|
* Options for a text prompt that returns a list of strings by splitting the
|
|
330
330
|
* input on a delimiter.
|
|
331
331
|
*
|
|
332
|
-
* @category
|
|
332
|
+
* @category options
|
|
333
333
|
* @since 4.0.0
|
|
334
334
|
*/
|
|
335
335
|
export interface ListOptions extends TextOptions {
|
|
@@ -347,7 +347,7 @@ export interface ListOptions extends TextOptions {
|
|
|
347
347
|
* They control which path type can be selected, the starting directory, paging,
|
|
348
348
|
* and filtering of displayed entries.
|
|
349
349
|
*
|
|
350
|
-
* @category
|
|
350
|
+
* @category options
|
|
351
351
|
* @since 4.0.0
|
|
352
352
|
*/
|
|
353
353
|
export interface FileOptions {
|
|
@@ -383,7 +383,7 @@ export interface FileOptions {
|
|
|
383
383
|
* Options for a prompt that asks the user to select one value from a list of
|
|
384
384
|
* choices.
|
|
385
385
|
*
|
|
386
|
-
* @category
|
|
386
|
+
* @category options
|
|
387
387
|
* @since 4.0.0
|
|
388
388
|
*/
|
|
389
389
|
export interface SelectOptions<A> {
|
|
@@ -405,7 +405,7 @@ export interface SelectOptions<A> {
|
|
|
405
405
|
* Options for an autocomplete prompt that lets the user filter selectable
|
|
406
406
|
* choices by typing.
|
|
407
407
|
*
|
|
408
|
-
* @category
|
|
408
|
+
* @category options
|
|
409
409
|
* @since 4.0.0
|
|
410
410
|
*/
|
|
411
411
|
export interface AutoCompleteOptions<A> extends SelectOptions<A> {
|
|
@@ -427,7 +427,7 @@ export interface AutoCompleteOptions<A> extends SelectOptions<A> {
|
|
|
427
427
|
* Options for a multi-select prompt, including bulk-selection labels and
|
|
428
428
|
* minimum or maximum selection counts.
|
|
429
429
|
*
|
|
430
|
-
* @category
|
|
430
|
+
* @category options
|
|
431
431
|
* @since 4.0.0
|
|
432
432
|
*/
|
|
433
433
|
export interface MultiSelectOptions {
|
|
@@ -488,7 +488,7 @@ export interface SelectChoice<A> {
|
|
|
488
488
|
* Options for text-entry prompts, including the displayed message, default
|
|
489
489
|
* text, and effectful validation before submission.
|
|
490
490
|
*
|
|
491
|
-
* @category
|
|
491
|
+
* @category options
|
|
492
492
|
* @since 4.0.0
|
|
493
493
|
*/
|
|
494
494
|
export interface TextOptions {
|
|
@@ -511,7 +511,7 @@ export interface TextOptions {
|
|
|
511
511
|
* Options for a toggle prompt that lets the user switch between active and
|
|
512
512
|
* inactive boolean states.
|
|
513
513
|
*
|
|
514
|
-
* @category
|
|
514
|
+
* @category options
|
|
515
515
|
* @since 4.0.0
|
|
516
516
|
*/
|
|
517
517
|
export interface ToggleOptions {
|
|
@@ -329,6 +329,17 @@ type ConsumedFlagValue =
|
|
|
329
329
|
readonly _tag: "Error"
|
|
330
330
|
readonly error: CliError.InvalidValue
|
|
331
331
|
}
|
|
332
|
+
type ConsumedFlagValueWithTokens =
|
|
333
|
+
| {
|
|
334
|
+
readonly _tag: "Value"
|
|
335
|
+
readonly value: string | undefined
|
|
336
|
+
readonly tokens: ReadonlyArray<Token>
|
|
337
|
+
}
|
|
338
|
+
| {
|
|
339
|
+
readonly _tag: "Error"
|
|
340
|
+
readonly error: CliError.InvalidValue
|
|
341
|
+
readonly tokens: ReadonlyArray<Token>
|
|
342
|
+
}
|
|
332
343
|
|
|
333
344
|
const isFlagToken = (t: Token): t is FlagToken => t._tag === "LongOption" || t._tag === "ShortOption"
|
|
334
345
|
|
|
@@ -407,60 +418,88 @@ const consumeFlagValue = (
|
|
|
407
418
|
spec: FlagParam,
|
|
408
419
|
negated = false
|
|
409
420
|
): ConsumedFlagValue => {
|
|
421
|
+
const consumed = consumeFlagValueWithTokens(cursor, token, spec, negated)
|
|
422
|
+
switch (consumed._tag) {
|
|
423
|
+
case "Value":
|
|
424
|
+
return {
|
|
425
|
+
_tag: "Value",
|
|
426
|
+
value: consumed.value
|
|
427
|
+
}
|
|
428
|
+
case "Error":
|
|
429
|
+
return {
|
|
430
|
+
_tag: "Error",
|
|
431
|
+
error: consumed.error
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const consumeFlagValueWithTokens = (
|
|
437
|
+
cursor: TokenCursor,
|
|
438
|
+
token: FlagToken,
|
|
439
|
+
spec: FlagParam,
|
|
440
|
+
negated = false
|
|
441
|
+
): ConsumedFlagValueWithTokens => {
|
|
410
442
|
// Inline value has highest priority
|
|
411
443
|
if (negated) {
|
|
412
444
|
if (token.value !== undefined) {
|
|
413
445
|
return {
|
|
414
446
|
_tag: "Error",
|
|
415
|
-
error: invalidNegatedFlagValue(token, spec, token.value)
|
|
447
|
+
error: invalidNegatedFlagValue(token, spec, token.value),
|
|
448
|
+
tokens: []
|
|
416
449
|
}
|
|
417
450
|
}
|
|
418
451
|
|
|
419
452
|
const literal = asBooleanLiteral(cursor.peek())
|
|
420
453
|
if (literal !== undefined) {
|
|
421
|
-
cursor.take()
|
|
454
|
+
const literalToken = cursor.take()
|
|
422
455
|
return {
|
|
423
456
|
_tag: "Error",
|
|
424
|
-
error: invalidNegatedFlagValue(token, spec, literal)
|
|
457
|
+
error: invalidNegatedFlagValue(token, spec, literal),
|
|
458
|
+
tokens: literalToken === undefined ? [] : [literalToken]
|
|
425
459
|
}
|
|
426
460
|
}
|
|
427
461
|
|
|
428
462
|
return {
|
|
429
463
|
_tag: "Value",
|
|
430
|
-
value: "false"
|
|
464
|
+
value: "false",
|
|
465
|
+
tokens: []
|
|
431
466
|
}
|
|
432
467
|
}
|
|
433
468
|
|
|
434
469
|
if (token.value !== undefined) {
|
|
435
470
|
return {
|
|
436
471
|
_tag: "Value",
|
|
437
|
-
value: token.value
|
|
472
|
+
value: token.value,
|
|
473
|
+
tokens: []
|
|
438
474
|
}
|
|
439
475
|
}
|
|
440
476
|
|
|
441
477
|
// Boolean flags: check for explicit literal or default to "true"
|
|
442
478
|
if (Primitive.isBoolean(spec.primitiveType)) {
|
|
443
479
|
const literal = asBooleanLiteral(cursor.peek())
|
|
444
|
-
|
|
480
|
+
const literalToken = literal !== undefined ? cursor.take() : undefined
|
|
445
481
|
return {
|
|
446
482
|
_tag: "Value",
|
|
447
|
-
value: literal ?? "true"
|
|
483
|
+
value: literal ?? "true",
|
|
484
|
+
tokens: literalToken === undefined ? [] : [literalToken]
|
|
448
485
|
}
|
|
449
486
|
}
|
|
450
487
|
|
|
451
488
|
// Non-boolean: try to consume next Value token
|
|
452
489
|
const next = cursor.peek()
|
|
453
490
|
if (next?._tag === "Value") {
|
|
454
|
-
cursor.take()
|
|
491
|
+
const valueToken = cursor.take()
|
|
455
492
|
return {
|
|
456
493
|
_tag: "Value",
|
|
457
|
-
value: next.value
|
|
494
|
+
value: next.value,
|
|
495
|
+
tokens: valueToken === undefined ? [] : [valueToken]
|
|
458
496
|
}
|
|
459
497
|
}
|
|
460
498
|
|
|
461
499
|
return {
|
|
462
500
|
_tag: "Value",
|
|
463
|
-
value: undefined
|
|
501
|
+
value: undefined,
|
|
502
|
+
tokens: []
|
|
464
503
|
}
|
|
465
504
|
}
|
|
466
505
|
|
|
@@ -504,6 +543,161 @@ export const consumeKnownFlags = (
|
|
|
504
543
|
return { flagMap, remainder, errors }
|
|
505
544
|
}
|
|
506
545
|
|
|
546
|
+
const extractFlagParams = (command: Command.Any): ReadonlyArray<FlagParam> => {
|
|
547
|
+
const commandImpl = toImpl(command)
|
|
548
|
+
const singles = commandImpl.config.flags.flatMap(Param.extractSingleParams)
|
|
549
|
+
return singles.filter(Param.isFlagParam)
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
const extractContextFlagParams = (command: Command.Any): ReadonlyArray<FlagParam> => {
|
|
553
|
+
const commandImpl = toImpl(command)
|
|
554
|
+
const singles = commandImpl.contextConfig.flags.flatMap(Param.extractSingleParams)
|
|
555
|
+
return singles.filter(Param.isFlagParam)
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
const resolveFromRegistries = (
|
|
559
|
+
token: FlagToken,
|
|
560
|
+
registries: ReadonlyArray<FlagRegistry>
|
|
561
|
+
): ResolvedFlag | undefined => {
|
|
562
|
+
for (const registry of registries) {
|
|
563
|
+
const resolved = resolveFlag(token, registry)
|
|
564
|
+
if (resolved !== undefined) {
|
|
565
|
+
return resolved
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return undefined
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
const preserveFlag = (
|
|
572
|
+
remainder: Array<Token>,
|
|
573
|
+
cursor: TokenCursor,
|
|
574
|
+
token: FlagToken,
|
|
575
|
+
resolved: ResolvedFlag
|
|
576
|
+
): void => {
|
|
577
|
+
remainder.push(token)
|
|
578
|
+
const consumed = consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated)
|
|
579
|
+
remainder.push(...consumed.tokens)
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const localFlagWouldPrecedeSubcommand = (
|
|
583
|
+
token: FlagToken,
|
|
584
|
+
remainingTokens: ReadonlyArray<Token>,
|
|
585
|
+
resolved: ResolvedFlag,
|
|
586
|
+
subIndex: Map<string, Command<string, unknown, unknown, unknown, unknown>>,
|
|
587
|
+
registries: ReadonlyArray<FlagRegistry>
|
|
588
|
+
): boolean => {
|
|
589
|
+
const cursor = makeCursor(remainingTokens)
|
|
590
|
+
consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated)
|
|
591
|
+
for (let token = cursor.take(); token; token = cursor.take()) {
|
|
592
|
+
if (isFlagToken(token)) {
|
|
593
|
+
const known = resolveFromRegistries(token, registries)
|
|
594
|
+
if (known !== undefined) {
|
|
595
|
+
consumeFlagValueWithTokens(cursor, token, known.param, known.negated)
|
|
596
|
+
}
|
|
597
|
+
continue
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
if (token._tag === "Value") {
|
|
601
|
+
return subIndex.has(token.value)
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return false
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Consumes global flags while walking the command tree.
|
|
609
|
+
*
|
|
610
|
+
* Command-local flags take precedence over global flags at the selected command
|
|
611
|
+
* level. This lets commands reuse a global flag name, for example a subcommand
|
|
612
|
+
* with its own `--version <value>` flag overriding the built-in global
|
|
613
|
+
* `--version` action.
|
|
614
|
+
* @internal
|
|
615
|
+
*/
|
|
616
|
+
export const consumeGlobalFlags = (
|
|
617
|
+
tokens: ReadonlyArray<Token>,
|
|
618
|
+
command: Command.Any,
|
|
619
|
+
registry: FlagRegistry
|
|
620
|
+
): { flagMap: FlagMap; remainder: ReadonlyArray<Token>; errors: ReadonlyArray<CliError.InvalidValue> } => {
|
|
621
|
+
const flagMap = createEmptyFlagMap(registry.params)
|
|
622
|
+
const errors: Array<CliError.InvalidValue> = []
|
|
623
|
+
|
|
624
|
+
const consumeLevel = (
|
|
625
|
+
tokens: ReadonlyArray<Token>,
|
|
626
|
+
command: Command.Any,
|
|
627
|
+
ignoredRegistries: ReadonlyArray<FlagRegistry>
|
|
628
|
+
): ReadonlyArray<Token> => {
|
|
629
|
+
const localRegistry = createFlagRegistry(extractFlagParams(command))
|
|
630
|
+
const inheritedRegistry = createFlagRegistry(extractContextFlagParams(command))
|
|
631
|
+
const subIndex = buildSubcommandIndex(command.subcommands)
|
|
632
|
+
const cursor = makeCursor(tokens)
|
|
633
|
+
const remainder: Array<Token> = []
|
|
634
|
+
let awaitingFirstValue = true
|
|
635
|
+
|
|
636
|
+
for (let token = cursor.take(); token; token = cursor.take()) {
|
|
637
|
+
if (isFlagToken(token)) {
|
|
638
|
+
const ignored = resolveFromRegistries(token, ignoredRegistries)
|
|
639
|
+
if (ignored !== undefined) {
|
|
640
|
+
preserveFlag(remainder, cursor, token, ignored)
|
|
641
|
+
continue
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const inherited = resolveFlag(token, inheritedRegistry)
|
|
645
|
+
if (inherited !== undefined) {
|
|
646
|
+
preserveFlag(remainder, cursor, token, inherited)
|
|
647
|
+
continue
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const local = resolveFlag(token, localRegistry)
|
|
651
|
+
const global = resolveFlag(token, registry)
|
|
652
|
+
if (local !== undefined) {
|
|
653
|
+
if (
|
|
654
|
+
global === undefined || !awaitingFirstValue ||
|
|
655
|
+
!localFlagWouldPrecedeSubcommand(token, cursor.rest(), local, subIndex, [
|
|
656
|
+
localRegistry,
|
|
657
|
+
inheritedRegistry,
|
|
658
|
+
registry
|
|
659
|
+
])
|
|
660
|
+
) {
|
|
661
|
+
preserveFlag(remainder, cursor, token, local)
|
|
662
|
+
continue
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
if (global !== undefined) {
|
|
667
|
+
const consumed = consumeFlagValueWithTokens(cursor, token, global.param, global.negated)
|
|
668
|
+
if (consumed._tag === "Error") {
|
|
669
|
+
errors.push(consumed.error)
|
|
670
|
+
continue
|
|
671
|
+
}
|
|
672
|
+
if (consumed.value !== undefined) {
|
|
673
|
+
flagMap[global.param.name].push(consumed.value)
|
|
674
|
+
}
|
|
675
|
+
continue
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
remainder.push(token)
|
|
679
|
+
continue
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if (token._tag === "Value" && awaitingFirstValue) {
|
|
683
|
+
const sub = subIndex.get(token.value)
|
|
684
|
+
if (sub !== undefined) {
|
|
685
|
+
remainder.push(token)
|
|
686
|
+
remainder.push(...consumeLevel(cursor.rest(), sub, [...ignoredRegistries, inheritedRegistry]))
|
|
687
|
+
return remainder
|
|
688
|
+
}
|
|
689
|
+
awaitingFirstValue = false
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
remainder.push(token)
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
return remainder
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
return { flagMap, remainder: consumeLevel(tokens, command, []), errors }
|
|
699
|
+
}
|
|
700
|
+
|
|
507
701
|
/* ========================================================================== */
|
|
508
702
|
/* Error Creation */
|
|
509
703
|
/* ========================================================================== */
|
|
@@ -574,7 +574,7 @@ export declare namespace Replier {
|
|
|
574
574
|
* It includes the underlying request envelope plus the last stream reply chunk
|
|
575
575
|
* that was sent, allowing handlers to resume chunk sequencing after a restart.
|
|
576
576
|
*
|
|
577
|
-
* @category
|
|
577
|
+
* @category request
|
|
578
578
|
* @since 4.0.0
|
|
579
579
|
*/
|
|
580
580
|
export class Request<Rpc extends Rpc.Any> extends Data.Class<
|
|
@@ -166,7 +166,7 @@ export const layerClientProtocolWebsocketDefault: Layer.Layer<
|
|
|
166
166
|
* The returned effect is produced from `RunnerServer.layerHandlers` and the
|
|
167
167
|
* cluster runner RPC group.
|
|
168
168
|
*
|
|
169
|
-
* @category
|
|
169
|
+
* @category http app
|
|
170
170
|
* @since 4.0.0
|
|
171
171
|
*/
|
|
172
172
|
export const toHttpEffect: Effect.Effect<
|
|
@@ -189,7 +189,7 @@ export const toHttpEffect: Effect.Effect<
|
|
|
189
189
|
* The returned effect is produced from `RunnerServer.layerHandlers` and the
|
|
190
190
|
* cluster runner RPC group.
|
|
191
191
|
*
|
|
192
|
-
* @category
|
|
192
|
+
* @category http app
|
|
193
193
|
* @since 4.0.0
|
|
194
194
|
*/
|
|
195
195
|
export const toHttpEffectWebsocket: Effect.Effect<
|
|
@@ -56,7 +56,7 @@ import * as HttpClientResponse from "../http/HttpClientResponse.ts"
|
|
|
56
56
|
/**
|
|
57
57
|
* Service tag for the HTTP client used to call the Kubernetes API.
|
|
58
58
|
*
|
|
59
|
-
* @category
|
|
59
|
+
* @category services
|
|
60
60
|
* @since 4.0.0
|
|
61
61
|
*/
|
|
62
62
|
export class K8sHttpClient extends Context.Service<
|
|
@@ -702,7 +702,7 @@ export const layerRpc: Layer.Layer<
|
|
|
702
702
|
* Service that creates an RPC client protocol for communicating with a runner at a
|
|
703
703
|
* given address.
|
|
704
704
|
*
|
|
705
|
-
* @category
|
|
705
|
+
* @category client
|
|
706
706
|
* @since 4.0.0
|
|
707
707
|
*/
|
|
708
708
|
export class RpcClientProtocol extends Context.Service<
|
|
@@ -112,7 +112,7 @@ import * as Snowflake from "./Snowflake.ts"
|
|
|
112
112
|
* Use to access or provide cluster routing, shard ownership, entity
|
|
113
113
|
* registration, singleton registration, and persisted-work polling.
|
|
114
114
|
*
|
|
115
|
-
* @category
|
|
115
|
+
* @category services
|
|
116
116
|
* @since 4.0.0
|
|
117
117
|
*/
|
|
118
118
|
export class Sharding extends Context.Service<Sharding, {
|
|
@@ -39,7 +39,7 @@ const TypeId = "~effect/cluster/SingletonAddress"
|
|
|
39
39
|
/**
|
|
40
40
|
* Represents the unique address of an singleton within the cluster.
|
|
41
41
|
*
|
|
42
|
-
* @category
|
|
42
|
+
* @category address
|
|
43
43
|
* @since 4.0.0
|
|
44
44
|
*/
|
|
45
45
|
export class SingletonAddress extends Schema.Class<SingletonAddress>(TypeId)({
|
|
@@ -179,7 +179,7 @@ export const make = (options: {
|
|
|
179
179
|
/**
|
|
180
180
|
* Extracts the Unix timestamp in milliseconds from a snowflake id.
|
|
181
181
|
*
|
|
182
|
-
* @category
|
|
182
|
+
* @category parts
|
|
183
183
|
* @since 4.0.0
|
|
184
184
|
*/
|
|
185
185
|
export const timestamp = (snowflake: Snowflake): number => Number(snowflake >> constBigInt22) + sinceUnixEpoch
|
|
@@ -187,7 +187,7 @@ export const timestamp = (snowflake: Snowflake): number => Number(snowflake >> c
|
|
|
187
187
|
/**
|
|
188
188
|
* Extracts the timestamp from a snowflake id as a `DateTime.Utc`.
|
|
189
189
|
*
|
|
190
|
-
* @category
|
|
190
|
+
* @category parts
|
|
191
191
|
* @since 4.0.0
|
|
192
192
|
*/
|
|
193
193
|
export const dateTime = (snowflake: Snowflake): DateTime.Utc => DateTime.makeUnsafe(timestamp(snowflake))
|
|
@@ -195,7 +195,7 @@ export const dateTime = (snowflake: Snowflake): DateTime.Utc => DateTime.makeUns
|
|
|
195
195
|
/**
|
|
196
196
|
* Extracts the machine id component from a snowflake id.
|
|
197
197
|
*
|
|
198
|
-
* @category
|
|
198
|
+
* @category parts
|
|
199
199
|
* @since 4.0.0
|
|
200
200
|
*/
|
|
201
201
|
export const machineId = (snowflake: Snowflake): MachineId =>
|
|
@@ -204,7 +204,7 @@ export const machineId = (snowflake: Snowflake): MachineId =>
|
|
|
204
204
|
/**
|
|
205
205
|
* Extracts the per-machine sequence component from a snowflake id.
|
|
206
206
|
*
|
|
207
|
-
* @category
|
|
207
|
+
* @category parts
|
|
208
208
|
* @since 4.0.0
|
|
209
209
|
*/
|
|
210
210
|
export const sequence = (snowflake: Snowflake): number => Number(snowflake % constBigInt4096)
|
|
@@ -212,7 +212,7 @@ export const sequence = (snowflake: Snowflake): number => Number(snowflake % con
|
|
|
212
212
|
/**
|
|
213
213
|
* Decomposes a snowflake id into its timestamp, machine id, and sequence parts.
|
|
214
214
|
*
|
|
215
|
-
* @category
|
|
215
|
+
* @category parts
|
|
216
216
|
* @since 4.0.0
|
|
217
217
|
*/
|
|
218
218
|
export const toParts = (snowflake: Snowflake): Snowflake.Parts => ({
|
|
@@ -55,7 +55,7 @@ const ResponseSchema = Schema.toCodecJson(DevToolsSchema.Response)
|
|
|
55
55
|
* Service for sending span and span-event telemetry to the Effect devtools
|
|
56
56
|
* connection.
|
|
57
57
|
*
|
|
58
|
-
* @category
|
|
58
|
+
* @category services
|
|
59
59
|
* @since 4.0.0
|
|
60
60
|
*/
|
|
61
61
|
export class DevToolsClient extends Context.Service<
|
|
@@ -66,7 +66,7 @@ import type { EventLogRemote } from "./EventLogRemote.ts"
|
|
|
66
66
|
* only when the handler succeeds, and exposes access to the underlying journal
|
|
67
67
|
* entries and destroy operation.
|
|
68
68
|
*
|
|
69
|
-
* @category
|
|
69
|
+
* @category services
|
|
70
70
|
* @since 4.0.0
|
|
71
71
|
*/
|
|
72
72
|
export class EventLog extends Context.Service<EventLog, {
|
|
@@ -82,7 +82,7 @@ const toBufferSource = (data: Uint8Array): ArrayBufferView<ArrayBuffer> => new U
|
|
|
82
82
|
* Use to provide cryptographic operations required by encrypted event-log
|
|
83
83
|
* replication.
|
|
84
84
|
*
|
|
85
|
-
* @category
|
|
85
|
+
* @category services
|
|
86
86
|
* @since 4.0.0
|
|
87
87
|
*/
|
|
88
88
|
export class EventLogEncryption extends Context.Service<EventLogEncryption, {
|
|
@@ -63,7 +63,7 @@ import { makeGetIdentityRootSecretMaterial } from "./internal/identityRootSecret
|
|
|
63
63
|
* It can write local entries to the remote, stream remote changes from a sequence
|
|
64
64
|
* number, and run effects only after the supplied identity has authenticated.
|
|
65
65
|
*
|
|
66
|
-
* @category
|
|
66
|
+
* @category services
|
|
67
67
|
* @since 4.0.0
|
|
68
68
|
*/
|
|
69
69
|
export class EventLogRemote extends Context.Service<EventLogRemote, {
|
|
@@ -79,7 +79,7 @@ import * as EventLogServer from "./EventLogServer.ts"
|
|
|
79
79
|
* Use to access or provide the server service that handles plaintext
|
|
80
80
|
* event-log writes.
|
|
81
81
|
*
|
|
82
|
-
* @category
|
|
82
|
+
* @category services
|
|
83
83
|
* @since 4.0.0
|
|
84
84
|
*/
|
|
85
85
|
export class EventLogServerUnencrypted extends Context.Service<EventLogServerUnencrypted, {
|
|
@@ -290,7 +290,7 @@ export class EventLogServerAuthError extends Data.TaggedError("EventLogServerAut
|
|
|
290
290
|
* Use to provide authorization checks for plaintext event-log writes, reads,
|
|
291
291
|
* and identity authentication.
|
|
292
292
|
*
|
|
293
|
-
* @category
|
|
293
|
+
* @category services
|
|
294
294
|
* @since 4.0.0
|
|
295
295
|
*/
|
|
296
296
|
export class EventLogServerAuthorization extends Context.Service<EventLogServerAuthorization, {
|
|
@@ -317,7 +317,7 @@ export class EventLogServerAuthorization extends Context.Service<EventLogServerA
|
|
|
317
317
|
* Use to map client-visible store identifiers to server storage identifiers
|
|
318
318
|
* before authorizing or serving unencrypted event-log requests.
|
|
319
319
|
*
|
|
320
|
-
* @category
|
|
320
|
+
* @category services
|
|
321
321
|
* @since 4.0.0
|
|
322
322
|
*/
|
|
323
323
|
export class StoreMapping extends Context.Service<StoreMapping, {
|
|
@@ -152,7 +152,7 @@ const CookieTypeId = "~effect/http/Cookies/Cookie"
|
|
|
152
152
|
* HTTP cookie value with its decoded value, encoded value, and optional cookie
|
|
153
153
|
* attributes such as domain, path, expiration, security, and same-site settings.
|
|
154
154
|
*
|
|
155
|
-
* @category
|
|
155
|
+
* @category cookies
|
|
156
156
|
* @since 4.0.0
|
|
157
157
|
*/
|
|
158
158
|
export interface Cookie extends Inspectable.Inspectable {
|
|
@@ -78,7 +78,7 @@ export interface Strong {
|
|
|
78
78
|
/**
|
|
79
79
|
* Formats an `Etag` as an HTTP header value, including quotes and the `W/` prefix for weak tags.
|
|
80
80
|
*
|
|
81
|
-
* @category
|
|
81
|
+
* @category converting
|
|
82
82
|
* @since 4.0.0
|
|
83
83
|
*/
|
|
84
84
|
export const toString = (self: Etag): string => {
|
|
@@ -47,7 +47,7 @@ import * as HttpClientResponse from "./HttpClientResponse.ts"
|
|
|
47
47
|
*
|
|
48
48
|
* Defaults to `globalThis.fetch`.
|
|
49
49
|
*
|
|
50
|
-
* @category
|
|
50
|
+
* @category services
|
|
51
51
|
* @since 4.0.0
|
|
52
52
|
*/
|
|
53
53
|
export const Fetch = Context.Reference<typeof globalThis.fetch>("effect/http/FetchHttpClient/Fetch", {
|
|
@@ -66,7 +66,7 @@ export const Fetch = Context.Reference<typeof globalThis.fetch>("effect/http/Fet
|
|
|
66
66
|
*
|
|
67
67
|
* Request-specific method, headers, body, and abort signal are supplied by the client when a request is executed.
|
|
68
68
|
*
|
|
69
|
-
* @category
|
|
69
|
+
* @category services
|
|
70
70
|
* @since 4.0.0
|
|
71
71
|
*/
|
|
72
72
|
export class RequestInit extends Context.Service<RequestInit, globalThis.RequestInit>()(
|
|
@@ -168,7 +168,7 @@ export declare namespace HttpClient {
|
|
|
168
168
|
* Use to provide the HTTP client implementation consumed by the module's
|
|
169
169
|
* request accessor functions.
|
|
170
170
|
*
|
|
171
|
-
* @category
|
|
171
|
+
* @category services
|
|
172
172
|
* @since 4.0.0
|
|
173
173
|
*/
|
|
174
174
|
export const HttpClient: Context.Service<HttpClient, HttpClient> = Context.Service<HttpClient, HttpClient>(
|
|
@@ -90,7 +90,7 @@ export interface HttpClientRequest extends Inspectable.Inspectable, Pipeable {
|
|
|
90
90
|
/**
|
|
91
91
|
* Options for constructing or modifying an `HttpClientRequest`.
|
|
92
92
|
*
|
|
93
|
-
* @category
|
|
93
|
+
* @category options
|
|
94
94
|
* @since 4.0.0
|
|
95
95
|
*/
|
|
96
96
|
export interface Options {
|
|
@@ -113,7 +113,7 @@ export declare namespace Options {
|
|
|
113
113
|
/**
|
|
114
114
|
* Request options that omit the method and URL for helpers that already receive those values separately.
|
|
115
115
|
*
|
|
116
|
-
* @category
|
|
116
|
+
* @category options
|
|
117
117
|
* @since 4.0.0
|
|
118
118
|
*/
|
|
119
119
|
export interface NoUrl extends Omit<Options, "method" | "url"> {}
|
|
@@ -267,7 +267,7 @@ export const xForwardedHeaders = make((httpApp) =>
|
|
|
267
267
|
/**
|
|
268
268
|
* Middleware that parses the current request URL's search parameters and provides them as `ParsedSearchParams`.
|
|
269
269
|
*
|
|
270
|
-
* @category
|
|
270
|
+
* @category search params
|
|
271
271
|
* @since 4.0.0
|
|
272
272
|
*/
|
|
273
273
|
export const searchParamsParser = <E, R>(
|
|
@@ -38,7 +38,7 @@ import * as Response from "./HttpServerResponse.ts"
|
|
|
38
38
|
/**
|
|
39
39
|
* Service for platform-specific HTTP response helpers, including file-backed server responses.
|
|
40
40
|
*
|
|
41
|
-
* @category
|
|
41
|
+
* @category services
|
|
42
42
|
* @since 4.0.0
|
|
43
43
|
*/
|
|
44
44
|
export class HttpPlatform extends Context.Service<HttpPlatform, {
|
|
@@ -302,7 +302,7 @@ export const RouterConfig = Context.Reference<Partial<FindMyWay.RouterConfig>>(
|
|
|
302
302
|
* It provides the route definition and the path parameters captured by the route
|
|
303
303
|
* matcher.
|
|
304
304
|
*
|
|
305
|
-
* @category
|
|
305
|
+
* @category services
|
|
306
306
|
* @since 4.0.0
|
|
307
307
|
*/
|
|
308
308
|
export class RouteContext extends Context.Service<RouteContext, {
|
|
@@ -313,7 +313,7 @@ export class RouteContext extends Context.Service<RouteContext, {
|
|
|
313
313
|
/**
|
|
314
314
|
* Effect that returns the path parameters captured for the current matched route.
|
|
315
315
|
*
|
|
316
|
-
* @category
|
|
316
|
+
* @category getters
|
|
317
317
|
* @since 4.0.0
|
|
318
318
|
*/
|
|
319
319
|
export const params: Effect.Effect<
|
|
@@ -1293,7 +1293,7 @@ export const provideRequest =
|
|
|
1293
1293
|
/**
|
|
1294
1294
|
* Runs the provided application layer as an HTTP server.
|
|
1295
1295
|
*
|
|
1296
|
-
* @category
|
|
1296
|
+
* @category server
|
|
1297
1297
|
* @since 4.0.0
|
|
1298
1298
|
*/
|
|
1299
1299
|
export const serve = <A, E, R, HE, HR = Request.Only<"Requires", R> | Request.Only<"GlobalRequires", R>>(
|
|
@@ -1357,7 +1357,7 @@ export const serve = <A, E, R, HE, HR = Request.Only<"Requires", R> | Request.On
|
|
|
1357
1357
|
* Web `Response` values and a `dispose` function for releasing the layer
|
|
1358
1358
|
* resources.
|
|
1359
1359
|
*
|
|
1360
|
-
* @category
|
|
1360
|
+
* @category server
|
|
1361
1361
|
* @since 4.0.0
|
|
1362
1362
|
*/
|
|
1363
1363
|
export const toWebHandler = <
|