@effected/jsonl 0.14.0 → 0.15.0
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/Envelope.js +1 -2
- package/Journal.js +1 -2
- package/JournalWatcher.js +1 -2
- package/JsonlError.js +1 -2
- package/JsonlEvent.js +1 -2
- package/Line.js +1 -2
- package/LineSlice.js +1 -2
- package/NodeJournalWatcher.js +1 -2
- package/Slice.js +1 -2
- package/index.d.ts +0 -18
- package/internal/engine.js +1 -2
- package/internal/merge.js +1 -2
- package/internal/tail.js +1 -2
- package/internal/utf8.js +1 -2
- package/node.d.ts +0 -2
- package/package.json +1 -1
package/Envelope.js
CHANGED
|
@@ -2,7 +2,7 @@ import { InvalidData, UnknownEvent, UnserializableData } from "./JsonlError.js";
|
|
|
2
2
|
import { Line, isBlank } from "./Line.js";
|
|
3
3
|
import { DateTime, Option, Result, Schema } from "effect";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/Envelope.ts
|
|
6
6
|
/**
|
|
7
7
|
* Stage one: the envelope with its payload left undecoded.
|
|
8
8
|
*
|
|
@@ -203,5 +203,4 @@ const Envelope = {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
//#endregion
|
|
207
206
|
export { Envelope, completeResult, frameResult };
|
package/Journal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeEngine } from "./internal/engine.js";
|
|
2
2
|
import { Context, Effect, Layer } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/Journal.ts
|
|
5
5
|
/**
|
|
6
6
|
* Defines journal services.
|
|
7
7
|
*
|
|
@@ -54,5 +54,4 @@ var Journal = class {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { Journal };
|
package/JournalWatcher.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/JournalWatcher.ts
|
|
4
4
|
/**
|
|
5
5
|
* How a journal is told its file changed underneath it: a watch that reports
|
|
6
6
|
* when it is armed.
|
|
@@ -21,5 +21,4 @@ import { Context } from "effect";
|
|
|
21
21
|
*/
|
|
22
22
|
var JournalWatcher = class extends Context.Service()("@effected/jsonl/JournalWatcher") {};
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { JournalWatcher };
|
package/JsonlError.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LineSlice } from "./LineSlice.js";
|
|
2
2
|
import { Option, Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/JsonlError.ts
|
|
5
5
|
/**
|
|
6
6
|
* `Schema.SchemaError` as a schema of itself.
|
|
7
7
|
*
|
|
@@ -238,5 +238,4 @@ var JournalResync = class extends Schema.TaggedError()("JournalResync", {
|
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
//#endregion
|
|
242
241
|
export { InvalidData, JournalClosed, JournalNotFound, JournalResync, MalformedLine, TerminalViolation, UnknownEvent, UnserializableData };
|
package/JsonlEvent.js
CHANGED
package/Line.js
CHANGED
|
@@ -2,7 +2,7 @@ import { MalformedLine } from "./JsonlError.js";
|
|
|
2
2
|
import { utf8Length } from "./internal/utf8.js";
|
|
3
3
|
import { Result } from "effect";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/Line.ts
|
|
6
6
|
/**
|
|
7
7
|
* Whether a line carries nothing but whitespace.
|
|
8
8
|
*
|
|
@@ -107,5 +107,4 @@ var Line = class {
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
//#endregion
|
|
111
110
|
export { Line, isBlank };
|
package/LineSlice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/LineSlice.ts
|
|
4
4
|
/**
|
|
5
5
|
* A single candidate line: its text, and where it lives in the source **in
|
|
6
6
|
* bytes**.
|
|
@@ -55,5 +55,4 @@ const LineSlice = Schema.Struct({
|
|
|
55
55
|
terminated: Schema.Boolean
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
//#endregion
|
|
59
58
|
export { LineSlice };
|
package/NodeJournalWatcher.js
CHANGED
|
@@ -2,7 +2,7 @@ import { JournalWatcher } from "./JournalWatcher.js";
|
|
|
2
2
|
import { Cause, Effect, Layer, PlatformError, Queue, Stream } from "effect";
|
|
3
3
|
import * as NFS from "node:fs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/NodeJournalWatcher.ts
|
|
6
6
|
/** The `SystemErrorTag` an errno code maps to, after core's Node filesystem mapping. */
|
|
7
7
|
const reasonOf = (code) => {
|
|
8
8
|
switch (code) {
|
|
@@ -100,5 +100,4 @@ var NodeJournalWatcher = class {
|
|
|
100
100
|
static layer = Layer.succeed(JournalWatcher, { watch });
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
//#endregion
|
|
104
103
|
export { NodeJournalWatcher };
|
package/Slice.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Slice.ts
|
|
2
2
|
/**
|
|
3
3
|
* Whether frame fields satisfy a slice.
|
|
4
4
|
*
|
|
@@ -13,5 +13,4 @@ const matchesFrame = (frame, slice) => {
|
|
|
13
13
|
return slice.to === void 0 || millis < slice.to.epochMilliseconds;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { matchesFrame };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Context, DateTime, Duration, Effect, FileSystem, Layer, Option, PlatformError, Result, Schema, Scope, Stream } from "effect";
|
|
2
|
-
//#region src/JsonlError.d.ts
|
|
3
2
|
declare const MalformedLine_base: Schema.Class<MalformedLine, Schema.TaggedStruct<"MalformedLine", {
|
|
4
3
|
/** The offending line, with its byte offsets into the source. */
|
|
5
4
|
readonly line: Schema.Struct<{
|
|
@@ -252,8 +251,6 @@ type DecodeError = MalformedLine | InvalidData | UnknownEvent;
|
|
|
252
251
|
* @public
|
|
253
252
|
*/
|
|
254
253
|
type JsonlError = MalformedLine | UnknownEvent | InvalidData | UnserializableData | TerminalViolation | JournalClosed | JournalNotFound | JournalResync;
|
|
255
|
-
//#endregion
|
|
256
|
-
//#region src/JsonlEvent.d.ts
|
|
257
254
|
/**
|
|
258
255
|
* The bound every registered payload schema must satisfy: a codec requiring
|
|
259
256
|
* **no services** in either direction.
|
|
@@ -370,8 +367,6 @@ export declare const JsonlEvent: {
|
|
|
370
367
|
readonly reopen?: Reopen | undefined;
|
|
371
368
|
}) => JsonlEvent<Tag, Data, Terminal, Reopen>;
|
|
372
369
|
};
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region src/LineSlice.d.ts
|
|
375
370
|
/**
|
|
376
371
|
* A single candidate line: its text, and where it lives in the source **in
|
|
377
372
|
* bytes**.
|
|
@@ -451,8 +446,6 @@ interface LinePosition {
|
|
|
451
446
|
*/
|
|
452
447
|
readonly end: number;
|
|
453
448
|
}
|
|
454
|
-
//#endregion
|
|
455
|
-
//#region src/Envelope.d.ts
|
|
456
449
|
/**
|
|
457
450
|
* A decoded envelope: the frame, its validated payload, and where its line sits.
|
|
458
451
|
*
|
|
@@ -581,8 +574,6 @@ export declare const Envelope: {
|
|
|
581
574
|
readonly scope?: string | undefined;
|
|
582
575
|
}) => Result.Result<string, UnknownEvent | InvalidData | UnserializableData>;
|
|
583
576
|
};
|
|
584
|
-
//#endregion
|
|
585
|
-
//#region src/JournalWatcher.d.ts
|
|
586
577
|
/**
|
|
587
578
|
* The service shape behind {@link JournalWatcher}.
|
|
588
579
|
*
|
|
@@ -633,8 +624,6 @@ declare const JournalWatcher_base: Context.ServiceClass<JournalWatcher, "@effect
|
|
|
633
624
|
* @public
|
|
634
625
|
*/
|
|
635
626
|
export declare class JournalWatcher extends JournalWatcher_base {}
|
|
636
|
-
//#endregion
|
|
637
|
-
//#region src/Slice.d.ts
|
|
638
627
|
/**
|
|
639
628
|
* A filter over envelope fields, plus where to resume and what to do with a
|
|
640
629
|
* line that cannot be decoded.
|
|
@@ -684,8 +673,6 @@ interface Slice<R extends JsonlEvent.Registry, T extends JsonlEvent.Tag<R> = Jso
|
|
|
684
673
|
*/
|
|
685
674
|
readonly onInvalid?: "skip" | "fail" | undefined;
|
|
686
675
|
}
|
|
687
|
-
//#endregion
|
|
688
|
-
//#region src/internal/engine.d.ts
|
|
689
676
|
/**
|
|
690
677
|
* Options for one append.
|
|
691
678
|
*
|
|
@@ -748,8 +735,6 @@ type QueryError = JournalNotFound | DecodeError | PlatformError.PlatformError;
|
|
|
748
735
|
* @public
|
|
749
736
|
*/
|
|
750
737
|
type ChangesError = QueryError | JournalResync;
|
|
751
|
-
//#endregion
|
|
752
|
-
//#region src/Journal.d.ts
|
|
753
738
|
/**
|
|
754
739
|
* The shape of a `Journal`, typed by its registry.
|
|
755
740
|
*
|
|
@@ -899,8 +884,6 @@ export declare class Journal {
|
|
|
899
884
|
readonly config: JournalConfig | Effect.Effect<JournalConfig, E, RC>;
|
|
900
885
|
}) => JournalClass<Self, Id, R, E, RC>;
|
|
901
886
|
}
|
|
902
|
-
//#endregion
|
|
903
|
-
//#region src/Line.d.ts
|
|
904
887
|
/**
|
|
905
888
|
* Splitting and parsing JSONL text.
|
|
906
889
|
*
|
|
@@ -957,6 +940,5 @@ export declare class Line {
|
|
|
957
940
|
*/
|
|
958
941
|
static parseResult(line: LineSlice): Result.Result<unknown, MalformedLine>;
|
|
959
942
|
}
|
|
960
|
-
//#endregion
|
|
961
943
|
export type { AppendError, AppendOptions, ChangesError, DataSchema, DecodeError, EnvelopeOf, EnvelopeUnion, EnvelopeWithTag, JournalClass, JournalConfig, JournalShape, JournalWatcherShape, JsonlError, LinePosition, QueryError, Slice };
|
|
962
944
|
//# sourceMappingURL=index.d.ts.map
|
package/internal/engine.js
CHANGED
|
@@ -7,7 +7,7 @@ import { canMerge, shallowMerge } from "./merge.js";
|
|
|
7
7
|
import { probeBomBytes, readLinePages, readTailUntil } from "./tail.js";
|
|
8
8
|
import { ByteSize, Channel, DateTime, Deferred, Duration, Effect, Exit, FileSystem, Option, PubSub, Result, Semaphore, Stream, SubscriptionRef } from "effect";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/internal/engine.ts
|
|
11
11
|
const positionOf = (item) => Result.isSuccess(item) ? item.success.position : item.failure.position;
|
|
12
12
|
const SHUTDOWN_PUBLISH_TIMEOUT = Duration.seconds(5);
|
|
13
13
|
/**
|
|
@@ -396,5 +396,4 @@ const makeEngine = (id, events, config) => Effect.gen(function* () {
|
|
|
396
396
|
};
|
|
397
397
|
});
|
|
398
398
|
|
|
399
|
-
//#endregion
|
|
400
399
|
export { makeEngine };
|
package/internal/merge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/merge.ts
|
|
2
2
|
/**
|
|
3
3
|
* Keys that must never be copied from either side.
|
|
4
4
|
*
|
|
@@ -99,5 +99,4 @@ const shallowMerge = (base, patch) => {
|
|
|
99
99
|
return result;
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
//#endregion
|
|
103
102
|
export { canMerge, isRecordLike, shallowMerge };
|
package/internal/tail.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ByteSize, Effect, Option, Stream } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/tail.ts
|
|
4
4
|
/** UTF-8 BOM, as bytes. `U+FEFF` encodes to these three. */
|
|
5
5
|
const BOM = [
|
|
6
6
|
239,
|
|
@@ -222,5 +222,4 @@ const readLinePages = (fs, path, from, end, bomBytes, pageSize = PAGE_SIZE) => S
|
|
|
222
222
|
}));
|
|
223
223
|
}));
|
|
224
224
|
|
|
225
|
-
//#endregion
|
|
226
225
|
export { DEFAULT_WINDOW, MAX_WINDOW, PAGE_SIZE, probeBomBytes, readLinePages, readTailUntil };
|
package/internal/utf8.js
CHANGED
package/node.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Jsonl from "@effected/jsonl";
|
|
2
2
|
import { Layer } from "effect";
|
|
3
|
-
//#region src/NodeJournalWatcher.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The Node implementation of {@link Jsonl.JournalWatcher}, over `node:fs`'s
|
|
6
5
|
* `watch`.
|
|
@@ -33,5 +32,4 @@ export declare class NodeJournalWatcher {
|
|
|
33
32
|
/** Provides {@link Jsonl.JournalWatcher} over `node:fs`. */
|
|
34
33
|
static readonly layer: Layer.Layer<Jsonl.JournalWatcher>;
|
|
35
34
|
}
|
|
36
|
-
//#endregion
|
|
37
35
|
//# sourceMappingURL=node.d.ts.map
|