@isoloop/bus 0.1.0-next.10 → 0.1.0-next.11
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/bus-worker.js +6 -6
- package/dist/index.d.ts +3 -447
- package/dist/index.js +5 -2015
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +17 -1
- package/dist/{topic-BpgHePIE.d.ts → topic-BkBLtTpT.d.ts} +2 -21
- package/package.json +7 -4
- package/dist/standard-schema-BtwRaC9-.js +0 -18
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Contracts } from "./topic-
|
|
1
|
+
import { n as Contracts } from "./topic-BkBLtTpT.js";
|
|
2
2
|
import { Issue } from "@isoloop/protocol";
|
|
3
3
|
/** Sample values for one topic. An array is shorthand for `{ values }`. */
|
|
4
4
|
export type TopicSamples = readonly unknown[] | {
|
package/dist/testing.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
// src/contracts/standard-schema.ts
|
|
2
|
+
const segmentKey = (s) => typeof s === "object" ? s.key : s;
|
|
3
|
+
/**
|
|
4
|
+
* Maps schema issues to the cloneable `{ message, path }[]` sent with `invalid`
|
|
5
|
+
* (ADR 0003, decision 10). Symbol keys become their description.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function toIssues(issues) {
|
|
10
|
+
return issues.map((i) => ({
|
|
11
|
+
message: i.message,
|
|
12
|
+
path: (i.path ?? []).map((s) => {
|
|
13
|
+
const k = segmentKey(s);
|
|
14
|
+
return typeof k === "symbol" ? String(k) : k;
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
2
18
|
// src/testing.ts
|
|
3
19
|
const PLAIN_TAGS = /* @__PURE__ */ new Set([
|
|
4
20
|
"[object Date]",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BusRecord, ErrorCode,
|
|
1
|
+
import { BusRecord, ErrorCode, Retention, Retention as Retention$1, ToolSpec, ToolSpec as ToolSpec$1 } from "@isoloop/protocol";
|
|
2
2
|
/**
|
|
3
3
|
* The Standard Schema V1 interface (https://standardschema.dev), copied from
|
|
4
4
|
* the spec so the bus depends on no schema library. Zod 4, Valibot and ArkType
|
|
@@ -36,13 +36,6 @@ declare namespace StandardSchemaV1 {
|
|
|
36
36
|
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
37
37
|
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
38
38
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Maps schema issues to the cloneable `{ message, path }[]` sent with `invalid`
|
|
41
|
-
* (ADR 0003, decision 10). Symbol keys become their description.
|
|
42
|
-
*
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
declare function toIssues(issues: ReadonlyArray<StandardSchemaV1.Issue>): Issue$1[];
|
|
46
39
|
/** The default `maxRecordBytes`: 256 KiB. */
|
|
47
40
|
declare const DEFAULT_MAX_RECORD_BYTES: number;
|
|
48
41
|
/**
|
|
@@ -128,12 +121,6 @@ declare function topic<In, Out = In, RIn = never, ROut = RIn>(name: string, def:
|
|
|
128
121
|
* @returns A schema whose input and output type is `T`.
|
|
129
122
|
*/
|
|
130
123
|
declare function unchecked<T>(): StandardSchemaV1<T, T>;
|
|
131
|
-
/**
|
|
132
|
-
* True if the schema came from `unchecked()`.
|
|
133
|
-
*
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
declare function isUnchecked(schema: StandardSchemaV1): boolean;
|
|
137
124
|
/**
|
|
138
125
|
* The default export of a contracts module. Built only by `contracts()`, so
|
|
139
126
|
* the bus worker can tell it from any other export.
|
|
@@ -194,10 +181,4 @@ declare function contracts(...topics: AnyTopicDef[]): Contracts;
|
|
|
194
181
|
* @internal
|
|
195
182
|
*/
|
|
196
183
|
declare function isContracts(x: unknown): x is Contracts;
|
|
197
|
-
|
|
198
|
-
* The structured-cloneable part of a topic, sent at `boot` for the contracts check (ADR 0003, decision 5).
|
|
199
|
-
*
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
declare function topicConfig(t: AnyTopicDef): TopicConfig;
|
|
203
|
-
export { unchecked as _, InputOf as a, ReplyOutputOf as c, TopicDef as d, contracts as f, topicConfig as g, topic as h, DEFAULT_MAX_RECORD_BYTES as i, Retention as l, isUnchecked as m, Contracts as n, OutputOf as o, isContracts as p, ContractsError as r, ReplyInputOf as s, AnyTopicDef as t, ToolSpec as u, StandardSchemaV1 as v, toIssues as y };
|
|
184
|
+
export { InputOf as a, ReplyOutputOf as c, TopicDef as d, contracts as f, StandardSchemaV1 as g, unchecked as h, DEFAULT_MAX_RECORD_BYTES as i, Retention as l, topic as m, Contracts as n, OutputOf as o, isContracts as p, ContractsError as r, ReplyInputOf as s, AnyTopicDef as t, ToolSpec as u };
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isoloop/bus",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.11",
|
|
4
4
|
"description": "Log bus that runs in its own worker: topics, schemas, offsets, replay.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"sideEffects":
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./src/worker.ts",
|
|
9
|
+
"./dist/bus-worker.js"
|
|
10
|
+
],
|
|
8
11
|
"repository": {
|
|
9
12
|
"type": "git",
|
|
10
13
|
"url": "git+https://github.com/isoloop/isoloop.git",
|
|
@@ -27,8 +30,8 @@
|
|
|
27
30
|
}
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@isoloop/codec": "0.1.0-next.
|
|
31
|
-
"@isoloop/protocol": "0.1.0-next.
|
|
33
|
+
"@isoloop/codec": "0.1.0-next.11",
|
|
34
|
+
"@isoloop/protocol": "0.1.0-next.11"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
37
|
"fast-check": "4.10.2",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/standard-schema.ts
|
|
2
|
-
const segmentKey = (s) => typeof s === "object" ? s.key : s;
|
|
3
|
-
/**
|
|
4
|
-
* Maps schema issues to the cloneable `{ message, path }[]` sent with `invalid`
|
|
5
|
-
* (ADR 0003, decision 10). Symbol keys become their description.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
function toIssues(issues) {
|
|
10
|
-
return issues.map((i) => ({
|
|
11
|
-
message: i.message,
|
|
12
|
-
path: (i.path ?? []).map((s) => {
|
|
13
|
-
const k = segmentKey(s);
|
|
14
|
-
return typeof k === "symbol" ? String(k) : k;
|
|
15
|
-
})
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
export { toIssues as t };
|