@versori/run 0.1.0-alpha.11 → 0.1.0-alpha.13
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/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +3 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +28 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +35 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +328 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +3 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +2 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +2 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +1 -0
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +2 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/_types.js +2 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +21 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/concat.js +32 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +41 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/bytes/1.0.5/copy.js +50 -0
- package/{script/deps/jsr.io/@std/fmt/1.0.6 → esm/deps/jsr.io/@std/fmt/1.0.5}/colors.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts +3 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/_common.js +8 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +3 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/_constants.js +4 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +321 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/buffer.js +488 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts +25 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/copy.js +36 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +80 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +96 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts +25 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/mod.js +25 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +42 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/read_all.js +72 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +20 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +36 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +40 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +54 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +27 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +44 -0
- package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
- package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/esm/src/context/Context.d.ts +14 -4
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +16 -10
- package/esm/src/context/ContextProvider.d.ts +3 -4
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +5 -5
- package/esm/src/dsl/http/versori/platformapi.d.ts +2 -1
- package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/platformapi.js +12 -1
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +32 -35
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.js +10 -6
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +67 -5
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +106 -32
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +2 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +1 -1
- package/package.json +2 -1
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts +3 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.d.ts.map +1 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/connect.js +31 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +35 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +333 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts +3 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/mod.js +20 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts +2 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.d.ts.map +1 -0
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/version.js +5 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts +9 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/_types.js +3 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts +21 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/concat.js +35 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts +41 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/copy.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/bytes/1.0.5/copy.js +53 -0
- package/{esm/deps/jsr.io/@std/fmt/1.0.6 → script/deps/jsr.io/@std/fmt/1.0.5}/colors.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts +3 -0
- package/script/deps/jsr.io/@std/io/0.225.2/_common.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/_common.js +11 -0
- package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts +3 -0
- package/script/deps/jsr.io/@std/io/0.225.2/_constants.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/_constants.js +7 -0
- package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts +321 -0
- package/script/deps/jsr.io/@std/io/0.225.2/buffer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/buffer.js +492 -0
- package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts +25 -0
- package/script/deps/jsr.io/@std/io/0.225.2/copy.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/copy.js +39 -0
- package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts +80 -0
- package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/iterate_reader.js +100 -0
- package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts +25 -0
- package/script/deps/jsr.io/@std/io/0.225.2/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/mod.js +41 -0
- package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts +42 -0
- package/script/deps/jsr.io/@std/io/0.225.2/read_all.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/read_all.js +76 -0
- package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts +20 -0
- package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.js +39 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts +40 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_readable_stream.js +57 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts +27 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.225.2/to_writable_stream.js +47 -0
- package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
- package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/script/src/context/Context.d.ts +14 -4
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +16 -10
- package/script/src/context/ContextProvider.d.ts +3 -4
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +5 -5
- package/script/src/dsl/http/versori/platformapi.d.ts +2 -1
- package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/platformapi.js +12 -1
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +32 -35
- package/script/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.js +10 -6
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +67 -5
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +109 -32
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts +2 -1
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +3 -3
- /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.js +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.5}/colors.js +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.11}/exists.js +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { DEFAULT_BUFFER_SIZE } from "./_constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* Turns a {@linkcode Reader} into an async iterator.
|
|
6
|
+
*
|
|
7
|
+
* @example Usage
|
|
8
|
+
* ```ts no-assert
|
|
9
|
+
* import { iterateReader } from "@std/io/iterate-reader";
|
|
10
|
+
*
|
|
11
|
+
* using file = await Deno.open("README.md");
|
|
12
|
+
* for await (const chunk of iterateReader(file)) {
|
|
13
|
+
* console.log(chunk);
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example Usage with buffer size
|
|
18
|
+
* ```ts no-assert
|
|
19
|
+
* import { iterateReader } from "@std/io/iterate-reader";
|
|
20
|
+
*
|
|
21
|
+
* using file = await Deno.open("README.md");
|
|
22
|
+
* const iter = iterateReader(file, {
|
|
23
|
+
* bufSize: 1024 * 1024
|
|
24
|
+
* });
|
|
25
|
+
* for await (const chunk of iter) {
|
|
26
|
+
* console.log(chunk);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param reader The reader to read from
|
|
31
|
+
* @param options The options
|
|
32
|
+
* @param options.bufSize The size of the buffer to use
|
|
33
|
+
* @returns The async iterator of Uint8Array chunks
|
|
34
|
+
*/
|
|
35
|
+
export async function* iterateReader(reader, options) {
|
|
36
|
+
const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE;
|
|
37
|
+
const b = new Uint8Array(bufSize);
|
|
38
|
+
while (true) {
|
|
39
|
+
const result = await reader.read(b);
|
|
40
|
+
if (result === null) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
yield b.slice(0, result);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Turns a {@linkcode ReaderSync} into an iterator.
|
|
48
|
+
*
|
|
49
|
+
* @example Usage
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { iterateReaderSync } from "@std/io/iterate-reader";
|
|
52
|
+
* import { assert } from "@std/assert/assert"
|
|
53
|
+
*
|
|
54
|
+
* using file = Deno.openSync("README.md");
|
|
55
|
+
* for (const chunk of iterateReaderSync(file)) {
|
|
56
|
+
* assert(chunk instanceof Uint8Array);
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* Second argument can be used to tune size of a buffer.
|
|
61
|
+
* Default size of the buffer is 32kB.
|
|
62
|
+
*
|
|
63
|
+
* @example Usage with buffer size
|
|
64
|
+
* ```ts
|
|
65
|
+
* import { iterateReaderSync } from "@std/io/iterate-reader";
|
|
66
|
+
* import { assert } from "@std/assert/assert"
|
|
67
|
+
*
|
|
68
|
+
* using file = await Deno.open("README.md");
|
|
69
|
+
* const iter = iterateReaderSync(file, {
|
|
70
|
+
* bufSize: 1024 * 1024
|
|
71
|
+
* });
|
|
72
|
+
* for (const chunk of iter) {
|
|
73
|
+
* assert(chunk instanceof Uint8Array);
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* Iterator uses an internal buffer of fixed size for efficiency; it returns
|
|
78
|
+
* a view on that buffer on each iteration. It is therefore caller's
|
|
79
|
+
* responsibility to copy contents of the buffer if needed; otherwise the
|
|
80
|
+
* next iteration will overwrite contents of previously returned chunk.
|
|
81
|
+
*
|
|
82
|
+
* @param reader The reader to read from
|
|
83
|
+
* @param options The options
|
|
84
|
+
* @returns The iterator of Uint8Array chunks
|
|
85
|
+
*/
|
|
86
|
+
export function* iterateReaderSync(reader, options) {
|
|
87
|
+
const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE;
|
|
88
|
+
const b = new Uint8Array(bufSize);
|
|
89
|
+
while (true) {
|
|
90
|
+
const result = reader.readSync(b);
|
|
91
|
+
if (result === null) {
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
yield b.slice(0, result);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for working with Deno's readers, writers, and web streams.
|
|
3
|
+
*
|
|
4
|
+
* `Reader` and `Writer` interfaces are deprecated in Deno, and so many of these
|
|
5
|
+
* utilities are also deprecated. Consider using web streams instead.
|
|
6
|
+
*
|
|
7
|
+
* ```ts ignore
|
|
8
|
+
* import { toReadableStream, toWritableStream } from "@std/io";
|
|
9
|
+
*
|
|
10
|
+
* await toReadableStream(Deno.stdin)
|
|
11
|
+
* .pipeTo(toWritableStream(Deno.stdout));
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
export * from "./buffer.js";
|
|
17
|
+
export * from "./copy.js";
|
|
18
|
+
export * from "./iterate_reader.js";
|
|
19
|
+
export * from "./read_all.js";
|
|
20
|
+
export * from "./reader_from_stream_reader.js";
|
|
21
|
+
export * from "./to_readable_stream.js";
|
|
22
|
+
export * from "./to_writable_stream.js";
|
|
23
|
+
export * from "./types.js";
|
|
24
|
+
export * from "./write_all.js";
|
|
25
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
/**
|
|
3
|
+
* Utilities for working with Deno's readers, writers, and web streams.
|
|
4
|
+
*
|
|
5
|
+
* `Reader` and `Writer` interfaces are deprecated in Deno, and so many of these
|
|
6
|
+
* utilities are also deprecated. Consider using web streams instead.
|
|
7
|
+
*
|
|
8
|
+
* ```ts ignore
|
|
9
|
+
* import { toReadableStream, toWritableStream } from "@std/io";
|
|
10
|
+
*
|
|
11
|
+
* await toReadableStream(Deno.stdin)
|
|
12
|
+
* .pipeTo(toWritableStream(Deno.stdout));
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
export * from "./buffer.js";
|
|
18
|
+
export * from "./copy.js";
|
|
19
|
+
export * from "./iterate_reader.js";
|
|
20
|
+
export * from "./read_all.js";
|
|
21
|
+
export * from "./reader_from_stream_reader.js";
|
|
22
|
+
export * from "./to_readable_stream.js";
|
|
23
|
+
export * from "./to_writable_stream.js";
|
|
24
|
+
export * from "./types.js";
|
|
25
|
+
export * from "./write_all.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Reader, ReaderSync } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read {@linkcode Reader} `r` until EOF (`null`) and resolve to the content as
|
|
4
|
+
* {@linkcode Uint8Array}.
|
|
5
|
+
*
|
|
6
|
+
* @example Usage
|
|
7
|
+
* ```ts ignore
|
|
8
|
+
* import { readAll } from "@std/io/read-all";
|
|
9
|
+
*
|
|
10
|
+
* // Example from stdin
|
|
11
|
+
* const stdinContent = await readAll(Deno.stdin);
|
|
12
|
+
*
|
|
13
|
+
* // Example from file
|
|
14
|
+
* using file = await Deno.open("my_file.txt", {read: true});
|
|
15
|
+
* const myFileContent = await readAll(file);
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param reader The reader to read from
|
|
19
|
+
* @returns The content as Uint8Array
|
|
20
|
+
*/
|
|
21
|
+
export declare function readAll(reader: Reader): Promise<Uint8Array>;
|
|
22
|
+
/**
|
|
23
|
+
* Synchronously reads {@linkcode ReaderSync} `r` until EOF (`null`) and returns
|
|
24
|
+
* the content as {@linkcode Uint8Array}.
|
|
25
|
+
*
|
|
26
|
+
* @example Usage
|
|
27
|
+
* ```ts ignore
|
|
28
|
+
* import { readAllSync } from "@std/io/read-all";
|
|
29
|
+
*
|
|
30
|
+
* // Example from stdin
|
|
31
|
+
* const stdinContent = readAllSync(Deno.stdin);
|
|
32
|
+
*
|
|
33
|
+
* // Example from file
|
|
34
|
+
* using file = Deno.openSync("my_file.txt", {read: true});
|
|
35
|
+
* const myFileContent = readAllSync(file);
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param reader The reader to read from
|
|
39
|
+
* @returns The content as Uint8Array
|
|
40
|
+
*/
|
|
41
|
+
export declare function readAllSync(reader: ReaderSync): Uint8Array;
|
|
42
|
+
//# sourceMappingURL=read_all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read_all.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/read_all.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAcjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAc1D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { concat } from "../../bytes/1.0.5/concat.js";
|
|
4
|
+
import { DEFAULT_CHUNK_SIZE } from "./_constants.js";
|
|
5
|
+
/**
|
|
6
|
+
* Read {@linkcode Reader} `r` until EOF (`null`) and resolve to the content as
|
|
7
|
+
* {@linkcode Uint8Array}.
|
|
8
|
+
*
|
|
9
|
+
* @example Usage
|
|
10
|
+
* ```ts ignore
|
|
11
|
+
* import { readAll } from "@std/io/read-all";
|
|
12
|
+
*
|
|
13
|
+
* // Example from stdin
|
|
14
|
+
* const stdinContent = await readAll(Deno.stdin);
|
|
15
|
+
*
|
|
16
|
+
* // Example from file
|
|
17
|
+
* using file = await Deno.open("my_file.txt", {read: true});
|
|
18
|
+
* const myFileContent = await readAll(file);
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param reader The reader to read from
|
|
22
|
+
* @returns The content as Uint8Array
|
|
23
|
+
*/
|
|
24
|
+
export async function readAll(reader) {
|
|
25
|
+
const chunks = [];
|
|
26
|
+
while (true) {
|
|
27
|
+
let chunk = new Uint8Array(DEFAULT_CHUNK_SIZE);
|
|
28
|
+
const n = await reader.read(chunk);
|
|
29
|
+
if (n === null) {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
if (n < DEFAULT_CHUNK_SIZE) {
|
|
33
|
+
chunk = chunk.subarray(0, n);
|
|
34
|
+
}
|
|
35
|
+
chunks.push(chunk);
|
|
36
|
+
}
|
|
37
|
+
return concat(chunks);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Synchronously reads {@linkcode ReaderSync} `r` until EOF (`null`) and returns
|
|
41
|
+
* the content as {@linkcode Uint8Array}.
|
|
42
|
+
*
|
|
43
|
+
* @example Usage
|
|
44
|
+
* ```ts ignore
|
|
45
|
+
* import { readAllSync } from "@std/io/read-all";
|
|
46
|
+
*
|
|
47
|
+
* // Example from stdin
|
|
48
|
+
* const stdinContent = readAllSync(Deno.stdin);
|
|
49
|
+
*
|
|
50
|
+
* // Example from file
|
|
51
|
+
* using file = Deno.openSync("my_file.txt", {read: true});
|
|
52
|
+
* const myFileContent = readAllSync(file);
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @param reader The reader to read from
|
|
56
|
+
* @returns The content as Uint8Array
|
|
57
|
+
*/
|
|
58
|
+
export function readAllSync(reader) {
|
|
59
|
+
const chunks = [];
|
|
60
|
+
while (true) {
|
|
61
|
+
let chunk = new Uint8Array(DEFAULT_CHUNK_SIZE);
|
|
62
|
+
const n = reader.readSync(chunk);
|
|
63
|
+
if (n === null) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
if (n < DEFAULT_CHUNK_SIZE) {
|
|
67
|
+
chunk = chunk.subarray(0, n);
|
|
68
|
+
}
|
|
69
|
+
chunks.push(chunk);
|
|
70
|
+
}
|
|
71
|
+
return concat(chunks);
|
|
72
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Reader } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create a {@linkcode Reader} from a {@linkcode ReadableStreamDefaultReader}.
|
|
4
|
+
*
|
|
5
|
+
* @example Usage
|
|
6
|
+
* ```ts ignore
|
|
7
|
+
* import { copy } from "@std/io/copy";
|
|
8
|
+
* import { readerFromStreamReader } from "@std/io/reader-from-stream-reader";
|
|
9
|
+
*
|
|
10
|
+
* const res = await fetch("https://deno.land");
|
|
11
|
+
*
|
|
12
|
+
* const reader = readerFromStreamReader(res.body!.getReader());
|
|
13
|
+
* await copy(reader, Deno.stdout);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param streamReader The stream reader to read from
|
|
17
|
+
* @returns The reader
|
|
18
|
+
*/
|
|
19
|
+
export declare function readerFromStreamReader(streamReader: ReadableStreamDefaultReader<Uint8Array>): Reader;
|
|
20
|
+
//# sourceMappingURL=reader_from_stream_reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader_from_stream_reader.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/reader_from_stream_reader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,2BAA2B,CAAC,UAAU,CAAC,GACpD,MAAM,CAiBR"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { Buffer } from "./buffer.js";
|
|
4
|
+
import { writeAll } from "./write_all.js";
|
|
5
|
+
/**
|
|
6
|
+
* Create a {@linkcode Reader} from a {@linkcode ReadableStreamDefaultReader}.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts ignore
|
|
10
|
+
* import { copy } from "@std/io/copy";
|
|
11
|
+
* import { readerFromStreamReader } from "@std/io/reader-from-stream-reader";
|
|
12
|
+
*
|
|
13
|
+
* const res = await fetch("https://deno.land");
|
|
14
|
+
*
|
|
15
|
+
* const reader = readerFromStreamReader(res.body!.getReader());
|
|
16
|
+
* await copy(reader, Deno.stdout);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param streamReader The stream reader to read from
|
|
20
|
+
* @returns The reader
|
|
21
|
+
*/
|
|
22
|
+
export function readerFromStreamReader(streamReader) {
|
|
23
|
+
const buffer = new Buffer();
|
|
24
|
+
return {
|
|
25
|
+
async read(p) {
|
|
26
|
+
if (buffer.empty()) {
|
|
27
|
+
const res = await streamReader.read();
|
|
28
|
+
if (res.done) {
|
|
29
|
+
return null; // EOF
|
|
30
|
+
}
|
|
31
|
+
await writeAll(buffer, res.value);
|
|
32
|
+
}
|
|
33
|
+
return buffer.read(p);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Closer, Reader } from "./types.js";
|
|
2
|
+
/** Options for {@linkcode toReadableStream}. */
|
|
3
|
+
export interface ToReadableStreamOptions {
|
|
4
|
+
/** If the `reader` is also a `Closer`, automatically close the `reader`
|
|
5
|
+
* when `EOF` is encountered, or a read error occurs.
|
|
6
|
+
*
|
|
7
|
+
* @default {true}
|
|
8
|
+
*/
|
|
9
|
+
autoClose?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The size of chunks to allocate to read.
|
|
12
|
+
*
|
|
13
|
+
* @default {16640}
|
|
14
|
+
*/
|
|
15
|
+
chunkSize?: number;
|
|
16
|
+
/** The queuing strategy to create the {@linkcode ReadableStream} with. */
|
|
17
|
+
strategy?: QueuingStrategy<Uint8Array>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a {@linkcode ReadableStream} of {@linkcode Uint8Array}s from a
|
|
21
|
+
* {@linkcode Reader}.
|
|
22
|
+
*
|
|
23
|
+
* When the pull algorithm is called on the stream, a chunk from the reader
|
|
24
|
+
* will be read. When `null` is returned from the reader, the stream will be
|
|
25
|
+
* closed along with the reader (if it is also a `Closer`).
|
|
26
|
+
*
|
|
27
|
+
* @example Usage
|
|
28
|
+
* ```ts no-assert
|
|
29
|
+
* import { toReadableStream } from "@std/io/to-readable-stream";
|
|
30
|
+
*
|
|
31
|
+
* using file = await Deno.open("./README.md", { read: true });
|
|
32
|
+
* const fileStream = toReadableStream(file);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param reader The reader to read from
|
|
36
|
+
* @param options The options
|
|
37
|
+
* @returns The readable stream
|
|
38
|
+
*/
|
|
39
|
+
export declare function toReadableStream(reader: Reader | (Reader & Closer), options?: ToReadableStreamOptions): ReadableStream<Uint8Array>;
|
|
40
|
+
//# sourceMappingURL=to_readable_stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to_readable_stream.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/to_readable_stream.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEjD,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAChC,cAAc,CAAC,UAAU,CAAC,CAiC5B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { DEFAULT_CHUNK_SIZE } from "./_constants.js";
|
|
4
|
+
import { isCloser } from "./_common.js";
|
|
5
|
+
/**
|
|
6
|
+
* Create a {@linkcode ReadableStream} of {@linkcode Uint8Array}s from a
|
|
7
|
+
* {@linkcode Reader}.
|
|
8
|
+
*
|
|
9
|
+
* When the pull algorithm is called on the stream, a chunk from the reader
|
|
10
|
+
* will be read. When `null` is returned from the reader, the stream will be
|
|
11
|
+
* closed along with the reader (if it is also a `Closer`).
|
|
12
|
+
*
|
|
13
|
+
* @example Usage
|
|
14
|
+
* ```ts no-assert
|
|
15
|
+
* import { toReadableStream } from "@std/io/to-readable-stream";
|
|
16
|
+
*
|
|
17
|
+
* using file = await Deno.open("./README.md", { read: true });
|
|
18
|
+
* const fileStream = toReadableStream(file);
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param reader The reader to read from
|
|
22
|
+
* @param options The options
|
|
23
|
+
* @returns The readable stream
|
|
24
|
+
*/
|
|
25
|
+
export function toReadableStream(reader, options) {
|
|
26
|
+
const { autoClose = true, chunkSize = DEFAULT_CHUNK_SIZE, strategy, } = options ?? {};
|
|
27
|
+
return new ReadableStream({
|
|
28
|
+
async pull(controller) {
|
|
29
|
+
const chunk = new Uint8Array(chunkSize);
|
|
30
|
+
try {
|
|
31
|
+
const read = await reader.read(chunk);
|
|
32
|
+
if (read === null) {
|
|
33
|
+
if (isCloser(reader) && autoClose) {
|
|
34
|
+
reader.close();
|
|
35
|
+
}
|
|
36
|
+
controller.close();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
controller.enqueue(chunk.subarray(0, read));
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
controller.error(e);
|
|
43
|
+
if (isCloser(reader)) {
|
|
44
|
+
reader.close();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
cancel() {
|
|
49
|
+
if (isCloser(reader) && autoClose) {
|
|
50
|
+
reader.close();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
}, strategy);
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Writer } from "./types.js";
|
|
2
|
+
/** Options for {@linkcode toWritableStream}. */
|
|
3
|
+
export interface toWritableStreamOptions {
|
|
4
|
+
/**
|
|
5
|
+
* If the `writer` is also a `Closer`, automatically close the `writer`
|
|
6
|
+
* when the stream is closed, aborted, or a write error occurs.
|
|
7
|
+
*
|
|
8
|
+
* @default {true}
|
|
9
|
+
*/
|
|
10
|
+
autoClose?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a {@linkcode WritableStream} from a {@linkcode Writer}.
|
|
14
|
+
*
|
|
15
|
+
* @example Usage
|
|
16
|
+
* ```ts no-assert
|
|
17
|
+
* import { toWritableStream } from "@std/io/to-writable-stream";
|
|
18
|
+
*
|
|
19
|
+
* const a = toWritableStream(Deno.stdout); // Same as `Deno.stdout.writable`
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param writer The writer to write to
|
|
23
|
+
* @param options The options
|
|
24
|
+
* @returns The writable stream
|
|
25
|
+
*/
|
|
26
|
+
export declare function toWritableStream(writer: Writer, options?: toWritableStreamOptions): WritableStream<Uint8Array>;
|
|
27
|
+
//# sourceMappingURL=to_writable_stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to_writable_stream.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/io/0.225.2/to_writable_stream.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,uBAAuB,GAChC,cAAc,CAAC,UAAU,CAAC,CAyB5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
import { writeAll } from "./write_all.js";
|
|
4
|
+
import { isCloser } from "./_common.js";
|
|
5
|
+
/**
|
|
6
|
+
* Create a {@linkcode WritableStream} from a {@linkcode Writer}.
|
|
7
|
+
*
|
|
8
|
+
* @example Usage
|
|
9
|
+
* ```ts no-assert
|
|
10
|
+
* import { toWritableStream } from "@std/io/to-writable-stream";
|
|
11
|
+
*
|
|
12
|
+
* const a = toWritableStream(Deno.stdout); // Same as `Deno.stdout.writable`
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param writer The writer to write to
|
|
16
|
+
* @param options The options
|
|
17
|
+
* @returns The writable stream
|
|
18
|
+
*/
|
|
19
|
+
export function toWritableStream(writer, options) {
|
|
20
|
+
const { autoClose = true } = options ?? {};
|
|
21
|
+
return new WritableStream({
|
|
22
|
+
async write(chunk, controller) {
|
|
23
|
+
try {
|
|
24
|
+
await writeAll(writer, chunk);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
controller.error(e);
|
|
28
|
+
if (isCloser(writer) && autoClose) {
|
|
29
|
+
writer.close();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
close() {
|
|
34
|
+
if (isCloser(writer) && autoClose) {
|
|
35
|
+
writer.close();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
abort() {
|
|
39
|
+
if (isCloser(writer) && autoClose) {
|
|
40
|
+
writer.close();
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -301,5 +301,26 @@ export declare abstract class BaseHandler {
|
|
|
301
301
|
* ```
|
|
302
302
|
*/
|
|
303
303
|
destroy(): void;
|
|
304
|
+
/**
|
|
305
|
+
* Automatically disposes of the handler when instantiated with the `using`
|
|
306
|
+
* keyword by calling the {@linkcode BaseHandler.destroy} method.
|
|
307
|
+
*
|
|
308
|
+
* @example Usage
|
|
309
|
+
* ```ts
|
|
310
|
+
* import { BaseHandler } from "@std/log/base-handler";
|
|
311
|
+
* import { LogRecord } from "@std/log/logger";
|
|
312
|
+
* import { assertInstanceOf } from "@std/assert/instance-of";
|
|
313
|
+
*
|
|
314
|
+
* class MyHandler extends BaseHandler {
|
|
315
|
+
* log(msg: string) {
|
|
316
|
+
* console.log(msg);
|
|
317
|
+
* }
|
|
318
|
+
* }
|
|
319
|
+
*
|
|
320
|
+
* using handler = new MyHandler("INFO");
|
|
321
|
+
* assertInstanceOf(handler, BaseHandler);
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
[Symbol.dispose](): void;
|
|
304
325
|
}
|
|
305
326
|
//# sourceMappingURL=base_handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/base_handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;AAIjE,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,WAAW;;IAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;;;;OAKG;gBAED,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EA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;GAoBG;AACH,8BAAsB,WAAW;;IAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;;;;OAKG;gBAED,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,kBAAkB;IAQ9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,EAGxB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,SAAS,CAAC,SAAS,EAAE,SAAS,EAGjC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS;IAO3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAIpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK;IAEL;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO;IAEP;;;;;;;;;;;;;;;;;;;OAmBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;CAGjB"}
|
|
@@ -13,7 +13,7 @@ var _ConsoleHandler_useColors;
|
|
|
13
13
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
14
14
|
// This module is browser compatible.
|
|
15
15
|
import { LogLevels } from "./levels.js";
|
|
16
|
-
import { blue, bold, red, yellow } from "../../fmt/1.0.
|
|
16
|
+
import { blue, bold, red, yellow } from "../../fmt/1.0.5/colors.js";
|
|
17
17
|
import { BaseHandler } from "./base_handler.js";
|
|
18
18
|
function applyColors(msg, level) {
|
|
19
19
|
switch (level) {
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _RotatingFileHandler_maxBytes, _RotatingFileHandler_maxBackupCount, _RotatingFileHandler_currentFileSize;
|
|
13
|
-
import { existsSync } from "../../fs/1.0.
|
|
13
|
+
import { existsSync } from "../../fs/1.0.11/exists.js";
|
|
14
14
|
import { FileHandler } from "./file_handler.js";
|
|
15
15
|
import { encoderSymbol, filenameSymbol, fileSymbol, modeSymbol, openOptionsSymbol, } from "./_file_handler_symbols.js";
|
|
16
16
|
/**
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Activation } from '../dsl/http/types.js';
|
|
2
2
|
import { KeyValue, KeyValueProvider, KeyValueScope } from '../kv/KeyValue.js';
|
|
3
3
|
import { Logger } from '../observability/logging/Logger.js';
|
|
4
|
+
export type OnSuccessFn = (ctx: Context<any>) => void;
|
|
5
|
+
export type OnErrorFn = (ctx: Context<any>) => void;
|
|
6
|
+
export type ContextOptions = {
|
|
7
|
+
activation?: Activation;
|
|
8
|
+
onSuccess?: OnSuccessFn;
|
|
9
|
+
onError?: OnErrorFn;
|
|
10
|
+
};
|
|
4
11
|
export interface Context<D> {
|
|
5
12
|
log: Logger;
|
|
6
13
|
executionId: string;
|
|
@@ -15,23 +22,26 @@ export interface Context<D> {
|
|
|
15
22
|
}
|
|
16
23
|
export interface InternalContext<D, Index = void> extends Context<D> {
|
|
17
24
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
18
|
-
withActivation(activation: Activation
|
|
25
|
+
withActivation(activation: Activation): InternalContext<D, Index>;
|
|
19
26
|
setIndex(idx: number): InternalContext<D, number>;
|
|
20
27
|
idx: Index;
|
|
28
|
+
readonly activation: Activation | undefined;
|
|
21
29
|
readonly kvp: KeyValueProvider;
|
|
30
|
+
readonly options: ContextOptions;
|
|
22
31
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
23
32
|
}
|
|
24
33
|
export declare class ContextImpl<D, Index = void> implements InternalContext<D, Index> {
|
|
25
34
|
log: Logger;
|
|
26
35
|
executionId: string;
|
|
27
36
|
startTime: Date;
|
|
28
|
-
activation?: Activation | undefined;
|
|
29
37
|
data: D;
|
|
30
38
|
idx: Index;
|
|
31
39
|
readonly kvp: KeyValueProvider;
|
|
32
|
-
|
|
40
|
+
readonly options: ContextOptions;
|
|
41
|
+
constructor(log: Logger, kvp: KeyValueProvider, executionId: string, startTime: Date, data: D, options: ContextOptions);
|
|
42
|
+
get activation(): Activation | undefined;
|
|
33
43
|
setIndex(idx: number): InternalContext<D, number>;
|
|
34
|
-
withActivation(activation: Activation
|
|
44
|
+
withActivation(activation: Activation): InternalContext<D, Index>;
|
|
35
45
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
36
46
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
37
47
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,MAAM,WAAW,OAAO,CAAC,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC;IAER;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,QAAQ,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