@effected/jsonl 0.1.0 → 0.3.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/JsonlError.js +10 -10
- package/README.md +1 -1
- package/package.json +2 -2
package/JsonlError.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LineSlice } from "./LineSlice.js";
|
|
2
|
-
import { Option, Schema
|
|
2
|
+
import { Option, Schema } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/JsonlError.ts
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ import { Option, Schema, SchemaError } from "effect";
|
|
|
20
20
|
* still carrying the failure **structurally** — `error.issue` keeps its paths
|
|
21
21
|
* and expected types — instead of flattening it to a string at the boundary.
|
|
22
22
|
*/
|
|
23
|
-
const SchemaErrorFromSelf = Schema.declare(
|
|
23
|
+
const SchemaErrorFromSelf = Schema.declare(Schema.isSchemaError);
|
|
24
24
|
/**
|
|
25
25
|
* A journal line that is not valid JSON.
|
|
26
26
|
*
|
|
@@ -47,7 +47,7 @@ const SchemaErrorFromSelf = Schema.declare(SchemaError.isSchemaError);
|
|
|
47
47
|
*
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
var MalformedLine = class extends Schema.
|
|
50
|
+
var MalformedLine = class extends Schema.TaggedError()("MalformedLine", {
|
|
51
51
|
/** The offending line, with its byte offsets into the source. */
|
|
52
52
|
line: LineSlice }) {
|
|
53
53
|
get message() {
|
|
@@ -65,7 +65,7 @@ line: LineSlice }) {
|
|
|
65
65
|
*
|
|
66
66
|
* @public
|
|
67
67
|
*/
|
|
68
|
-
var UnknownEvent = class extends Schema.
|
|
68
|
+
var UnknownEvent = class extends Schema.TaggedError()("UnknownEvent", {
|
|
69
69
|
/** The offending line, with its byte offsets into the source. */
|
|
70
70
|
line: LineSlice,
|
|
71
71
|
/** The unrecognized tag as it appeared on the envelope. */
|
|
@@ -91,7 +91,7 @@ var UnknownEvent = class extends Schema.TaggedErrorClass()("UnknownEvent", {
|
|
|
91
91
|
*
|
|
92
92
|
* @public
|
|
93
93
|
*/
|
|
94
|
-
var InvalidData = class extends Schema.
|
|
94
|
+
var InvalidData = class extends Schema.TaggedError()("InvalidData", {
|
|
95
95
|
/** The offending line, with its byte offsets into the source. */
|
|
96
96
|
line: LineSlice,
|
|
97
97
|
/**
|
|
@@ -115,7 +115,7 @@ var InvalidData = class extends Schema.TaggedErrorClass()("InvalidData", {
|
|
|
115
115
|
*
|
|
116
116
|
* @public
|
|
117
117
|
*/
|
|
118
|
-
var TerminalViolation = class extends Schema.
|
|
118
|
+
var TerminalViolation = class extends Schema.TaggedError()("TerminalViolation", {
|
|
119
119
|
/** The tag of the event whose append was refused. */
|
|
120
120
|
event: Schema.String,
|
|
121
121
|
/** The terminal event currently at the tail of the journal. */
|
|
@@ -137,7 +137,7 @@ var TerminalViolation = class extends Schema.TaggedErrorClass()("TerminalViolati
|
|
|
137
137
|
*
|
|
138
138
|
* @public
|
|
139
139
|
*/
|
|
140
|
-
var JournalNotFound = class extends Schema.
|
|
140
|
+
var JournalNotFound = class extends Schema.TaggedError()("JournalNotFound", {
|
|
141
141
|
/** The path that does not exist. */
|
|
142
142
|
path: Schema.String }) {
|
|
143
143
|
get message() {
|
|
@@ -166,7 +166,7 @@ path: Schema.String }) {
|
|
|
166
166
|
*
|
|
167
167
|
* @public
|
|
168
168
|
*/
|
|
169
|
-
var UnserializableData = class extends Schema.
|
|
169
|
+
var UnserializableData = class extends Schema.TaggedError()("UnserializableData", {
|
|
170
170
|
/** The event tag whose payload could not be serialized. */
|
|
171
171
|
event: Schema.String,
|
|
172
172
|
/** The value `JSON.stringify` threw, carried structurally. */
|
|
@@ -192,7 +192,7 @@ var UnserializableData = class extends Schema.TaggedErrorClass()("Unserializable
|
|
|
192
192
|
*
|
|
193
193
|
* @public
|
|
194
194
|
*/
|
|
195
|
-
var JournalClosed = class extends Schema.
|
|
195
|
+
var JournalClosed = class extends Schema.TaggedError()("JournalClosed", {
|
|
196
196
|
/** The tag of the event whose append was refused. */
|
|
197
197
|
event: Schema.String }) {
|
|
198
198
|
get message() {
|
|
@@ -227,7 +227,7 @@ event: Schema.String }) {
|
|
|
227
227
|
*
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
|
-
var JournalResync = class extends Schema.
|
|
230
|
+
var JournalResync = class extends Schema.TaggedError()("JournalResync", {
|
|
231
231
|
/** The journal path whose file changed identity or shrank. */
|
|
232
232
|
path: Schema.String,
|
|
233
233
|
/** Which contract breach was detected. Diagnostic; the recovery is the same. */
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Append-only, schema-validated JSONL journals as a definable Effect service. The subject is not the format — one JSON value per line is a two-sentence specification and needs no library — but the file as a live object: a journal that only ever grows, whose current state is its last valid line, whose tail may be torn mid-append, and which several processes read while one writes. Every line is an envelope (`at`, `event`, an optional `scope`, and a `data` payload validated by the schema you registered for that event), so a journal stays greppable, `jq`-able and diffable in a pull request while the reads that matter stay typed.
|
|
9
9
|
|
|
10
10
|
> **Pre-release.** This package is part of the `@effected/*` kit, in pre-`1.0.0`
|
|
11
|
-
> development against a single pinned Effect v4
|
|
11
|
+
> development against a single pinned Effect v4 prerelease. Packages graduate to
|
|
12
12
|
> `1.0.0` once Effect `4.0.0` ships. To hold your own `effect` versions at
|
|
13
13
|
> exactly the ones the kit is built and tested against, install
|
|
14
14
|
> [`@effected/pnpm-plugin-effect`](https://www.npmjs.com/package/@effected/pnpm-plugin-effect).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/jsonl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Append-only, schema-validated JSONL journals as a definable Effect service.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"effect": "4.0.0-
|
|
40
|
+
"effect": "4.0.0-rc.109"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=24.11.0"
|