@toa.io/core 1.0.0-alpha.292 → 1.0.0-alpha.299
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/package.json +10 -4
- package/transpiled/call.js +12 -0
- package/transpiled/call.js.map +1 -1
- package/transpiled/component.js +31 -4
- package/transpiled/component.js.map +1 -1
- package/transpiled/context.d.ts +5 -0
- package/transpiled/context.js +6 -0
- package/transpiled/context.js.map +1 -1
- package/transpiled/emission.d.ts +4 -2
- package/transpiled/emission.js +4 -2
- package/transpiled/emission.js.map +1 -1
- package/transpiled/entities/entity.js +34 -6
- package/transpiled/entities/entity.js.map +1 -1
- package/transpiled/entities/factory.d.ts +5 -0
- package/transpiled/entities/factory.js +6 -2
- package/transpiled/entities/factory.js.map +1 -1
- package/transpiled/event.d.ts +2 -2
- package/transpiled/event.js +6 -1
- package/transpiled/event.js.map +1 -1
- package/transpiled/exceptions.d.ts +19 -0
- package/transpiled/exceptions.js +74 -2
- package/transpiled/exceptions.js.map +1 -1
- package/transpiled/index.d.ts +2 -1
- package/transpiled/index.js +2 -1
- package/transpiled/index.js.map +1 -1
- package/transpiled/{outbox/outbox.d.ts → outbox.d.ts} +6 -7
- package/transpiled/outbox.js +424 -0
- package/transpiled/outbox.js.map +1 -0
- package/transpiled/query/options.js +1 -1
- package/transpiled/query/options.js.map +1 -1
- package/transpiled/receiver.js +14 -1
- package/transpiled/receiver.js.map +1 -1
- package/transpiled/remote.js +2 -3
- package/transpiled/remote.js.map +1 -1
- package/transpiled/state.d.ts +1 -1
- package/transpiled/trail.d.ts +49 -0
- package/transpiled/trail.js +98 -0
- package/transpiled/trail.js.map +1 -0
- package/transpiled/types/bindings.d.ts +22 -0
- package/transpiled/types/extensions.d.ts +13 -2
- package/transpiled/types/message.d.ts +5 -0
- package/transpiled/types/outbox.d.ts +29 -3
- package/transpiled/types/request.d.ts +5 -0
- package/transpiled/types/storages.d.ts +20 -0
- package/CHANGELOG.md +0 -43
- package/source/assignment.ts +0 -27
- package/source/call.ts +0 -63
- package/source/cascade.ts +0 -32
- package/source/component.ts +0 -83
- package/source/composition.ts +0 -27
- package/source/connector.ts +0 -217
- package/source/context.ts +0 -68
- package/source/contract/contract.ts +0 -23
- package/source/contract/index.ts +0 -2
- package/source/contract/reply.ts +0 -56
- package/source/contract/request.ts +0 -140
- package/source/contract/schemas.ts +0 -39
- package/source/discovery.ts +0 -53
- package/source/effect.ts +0 -14
- package/source/emission.ts +0 -21
- package/source/entities/changeset.ts +0 -37
- package/source/entities/entity.ts +0 -137
- package/source/entities/factory.ts +0 -52
- package/source/entities/index.ts +0 -4
- package/source/entities/newid.ts +0 -9
- package/source/entities/set.ts +0 -27
- package/source/event.ts +0 -57
- package/source/exceptions.ts +0 -133
- package/source/exposition.ts +0 -33
- package/source/guard.ts +0 -16
- package/source/index.ts +0 -36
- package/source/locator.ts +0 -37
- package/source/observation.ts +0 -16
- package/source/operation.ts +0 -139
- package/source/outbox/index.ts +0 -1
- package/source/outbox/outbox.ts +0 -341
- package/source/query/criteria.ts +0 -90
- package/source/query/options.ts +0 -35
- package/source/query.ts +0 -67
- package/source/receiver.ts +0 -120
- package/source/reflection.ts +0 -20
- package/source/remote.ts +0 -20
- package/source/state.ts +0 -179
- package/source/transition.ts +0 -79
- package/source/transmission.ts +0 -38
- package/source/types/atomicity.ts +0 -63
- package/source/types/bindings.ts +0 -59
- package/source/types/bridges.ts +0 -54
- package/source/types/extensions.ts +0 -89
- package/source/types/index.ts +0 -14
- package/source/types/message.ts +0 -5
- package/source/types/operations.ts +0 -31
- package/source/types/outbox.ts +0 -35
- package/source/types/receiver.ts +0 -10
- package/source/types/request.ts +0 -54
- package/source/types/state.ts +0 -9
- package/source/types/storages.ts +0 -134
- package/source/unmanaged.ts +0 -8
- package/test/call.fixtures.js +0 -25
- package/test/call.test.js +0 -79
- package/test/component.fixtures.js +0 -18
- package/test/component.test.js +0 -57
- package/test/connector.fixtures.js +0 -56
- package/test/connector.test.js +0 -266
- package/test/context.fixtures.js +0 -14
- package/test/context.test.js +0 -40
- package/test/contract/conditions.test.js +0 -32
- package/test/contract/contract.fixtures.js +0 -28
- package/test/contract/request.test.js +0 -196
- package/test/discovery.test.js +0 -71
- package/test/emission.fixtures.js +0 -13
- package/test/emission.test.js +0 -60
- package/test/entities/entity.fixtures.js +0 -24
- package/test/entities/entity.test.js +0 -137
- package/test/entities/factory.fixtures.js +0 -31
- package/test/entities/factory.test.js +0 -99
- package/test/entities/set.fixtures.js +0 -9
- package/test/entities/set.test.js +0 -13
- package/test/event.fixtures.js +0 -24
- package/test/event.test.js +0 -162
- package/test/locator.test.js +0 -120
- package/test/outbox.test.js +0 -202
- package/test/query.fixtures.js +0 -96
- package/test/query.test.js +0 -183
- package/test/receiver.fixtures.js +0 -20
- package/test/receiver.test.js +0 -144
- package/test/reflection.test.js +0 -31
- package/test/state.fixtures.js +0 -49
- package/test/state.test.js +0 -162
- package/test/transmission.fixtures.js +0 -13
- package/test/transmission.test.js +0 -77
- package/transpiled/outbox/index.d.ts +0 -1
- package/transpiled/outbox/index.js +0 -2
- package/transpiled/outbox/index.js.map +0 -1
- package/transpiled/outbox/outbox.js +0 -268
- package/transpiled/outbox/outbox.js.map +0 -1
- package/tsconfig.json +0 -10
- package/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.299",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Core",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -28,6 +28,12 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
+
"files": [
|
|
32
|
+
"transpiled",
|
|
33
|
+
"!**/tsconfig.tsbuildinfo",
|
|
34
|
+
"!**/*.test.*",
|
|
35
|
+
"!**/.env*"
|
|
36
|
+
],
|
|
31
37
|
"scripts": {
|
|
32
38
|
"transpile": "tsc",
|
|
33
39
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
@@ -35,9 +41,9 @@
|
|
|
35
41
|
"dependencies": {
|
|
36
42
|
"@rsql/parser": "1.6.0",
|
|
37
43
|
"@toa.io/generic": "1.0.0-alpha.292",
|
|
38
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
39
|
-
"openspan": "1.0.0-alpha.
|
|
44
|
+
"@toa.io/schemas": "1.0.0-alpha.299",
|
|
45
|
+
"openspan": "1.0.0-alpha.293",
|
|
40
46
|
"uuid": "14.0.2"
|
|
41
47
|
},
|
|
42
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "2ba95b16f2cf06f82d6ff8d436761e843e5e4b43"
|
|
43
49
|
}
|
package/transpiled/call.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import { current, encode } from 'openspan';
|
|
3
3
|
import { Connector } from './connector.js';
|
|
4
|
+
import * as trail from './trail.js';
|
|
4
5
|
export class Call extends Connector {
|
|
5
6
|
#transmitter;
|
|
6
7
|
#contract;
|
|
@@ -24,6 +25,13 @@ export class Call extends Connector {
|
|
|
24
25
|
const context = current();
|
|
25
26
|
if (context !== undefined)
|
|
26
27
|
request.telemetry = encode(context);
|
|
28
|
+
/*
|
|
29
|
+
* Assigned, never appended to: one request object is handed to several concurrent calls in
|
|
30
|
+
* more than one place, and appending there would put a hop on the caller's own array once
|
|
31
|
+
* per sibling. `??=` so that what a receiver has already put on the request wins, and so
|
|
32
|
+
* that a service with no chain in scope starts one under its own name.
|
|
33
|
+
*/
|
|
34
|
+
request.trail ??= trail.current() ?? service(this.#source);
|
|
27
35
|
const reply = await this.#transmitter.request(request);
|
|
28
36
|
if (reply === null)
|
|
29
37
|
return null;
|
|
@@ -42,6 +50,10 @@ export class Call extends Connector {
|
|
|
42
50
|
return this.#contract.discovery;
|
|
43
51
|
}
|
|
44
52
|
}
|
|
53
|
+
/** Where a service calls from no invocation, the chain starts under the service's own name. */
|
|
54
|
+
function service(source) {
|
|
55
|
+
return source !== undefined && 'service' in source ? [source.service] : undefined;
|
|
56
|
+
}
|
|
45
57
|
// the remote error as a value: every property it carries, and nothing else enumerable
|
|
46
58
|
class RemoteError extends Error {
|
|
47
59
|
constructor(error) {
|
package/transpiled/call.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../source/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../source/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AAKnC,MAAM,OAAO,IAAK,SAAQ,SAAS;IACxB,YAAY,CAAc;IAC1B,SAAS,CAAU;IACnB,OAAO,CAAoB;IAEpC,YAAmB,WAAyB,EAAE,QAAkB,EAAE,MAAe;QAC/E,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QAErB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAC3B,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,OAAO,GAAY,EAAE;QACvC,0EAA0E;QAC1E,I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AACnF,CAAC;AAED,sFAAsF;AACtF,MAAM,WAAY,SAAQ,KAAK;IAC7B,YAAmB,KAAa;QAC9B,KAAK,EAAE,CAAA;QAEP,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAC5B,CAAC;CACF"}
|
package/transpiled/component.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
1
|
import { console, current, decode, run } from 'openspan';
|
|
3
2
|
import { Connector } from './connector.js';
|
|
3
|
+
import { EndpointException } from './exceptions.js';
|
|
4
|
+
import * as trail from './trail.js';
|
|
4
5
|
export class Component extends Connector {
|
|
5
6
|
locator;
|
|
6
7
|
operations;
|
|
7
8
|
kind = 'server';
|
|
8
9
|
/** span options per endpoint */
|
|
9
10
|
#spans = {};
|
|
11
|
+
/** what refuses a call that has been here already, as the environment states it */
|
|
12
|
+
#limits = trail.limits();
|
|
10
13
|
constructor(locator, operations) {
|
|
11
14
|
super();
|
|
12
15
|
this.locator = locator;
|
|
@@ -15,11 +18,35 @@ export class Component extends Connector {
|
|
|
15
18
|
}
|
|
16
19
|
async invoke(endpoint, request) {
|
|
17
20
|
if (!(endpoint in this.operations))
|
|
18
|
-
|
|
19
|
-
assert.fail(`Endpoint '${endpoint}' is not provided by '${this.locator.id}'`);
|
|
21
|
+
throw new EndpointException(`'${endpoint}' is not provided by '${this.locator.id}'`);
|
|
20
22
|
// if the request carries no telemetry, the trace starts here
|
|
21
23
|
const remote = request?.telemetry === undefined ? null : decode(request.telemetry);
|
|
22
|
-
const
|
|
24
|
+
const invocation = async () => this.#process(endpoint, request);
|
|
25
|
+
let task = invocation;
|
|
26
|
+
/*
|
|
27
|
+
* The hop is the server's alone. A `Remote` is a component too and names the very endpoint
|
|
28
|
+
* this one does, so counting it there as well would make the threshold depend on how many
|
|
29
|
+
* clients a call happened to cross — a different number for a local call, an HTTP one and a
|
|
30
|
+
* delayed one. An endpoint beginning with `.` is the runtime's own and is no hop at all.
|
|
31
|
+
*/
|
|
32
|
+
if (this.kind === 'server' && endpoint[0] !== '.') {
|
|
33
|
+
let hops;
|
|
34
|
+
try {
|
|
35
|
+
// the span's name is the hop's, and it is already built once per endpoint
|
|
36
|
+
hops = trail.extend(request?.trail, this.#span(endpoint).name, this.#limits);
|
|
37
|
+
}
|
|
38
|
+
catch (exception) {
|
|
39
|
+
console.error('Call chain refused', {
|
|
40
|
+
endpoint: `${this.locator.id}.${endpoint}`,
|
|
41
|
+
exception
|
|
42
|
+
});
|
|
43
|
+
// answered, not thrown: thrown, this would run into the broker library on the event
|
|
44
|
+
// path, and on the call path its code would survive only by `Exception` not being an
|
|
45
|
+
// `Error`. Answered, `Call` throws it into the caller as it does any other.
|
|
46
|
+
return { exception };
|
|
47
|
+
}
|
|
48
|
+
task = async () => trail.follow(hops, invocation);
|
|
49
|
+
}
|
|
23
50
|
if (remote === null)
|
|
24
51
|
return task();
|
|
25
52
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../source/component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../source/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAoB,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AASnC,MAAM,OAAO,SAA2C,SAAQ,SAAS;IACvD,OAAO,CAAS;IAEb,UAAU,CAAmB;IAEtC,IAAI,GAAwB,QAAQ,CAAA;IAE9C,gCAAgC;IACvB,MAAM,GAAgC,EAAE,CAAA;IAEjD,mFAAmF;IAC1E,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;IAEjC,YAAmB,OAA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,EAAE,CAAC;YAC1B,OAAO,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAA;YAErE,4EAA4E;YAC5E,kEAAkE;YAClE,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;gBAAE,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;YAE7D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAA;QACjC,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF"}
|
package/transpiled/context.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export declare class Context extends Connector {
|
|
|
9
9
|
#private;
|
|
10
10
|
readonly env: string | undefined;
|
|
11
11
|
readonly name: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The rank of the region this deployment is, which is what its writes are stamped with. A
|
|
14
|
+
* deployment that is no region at all reads as zero, which is what its records carry.
|
|
15
|
+
*/
|
|
16
|
+
readonly region: number;
|
|
12
17
|
readonly aspects: Aspect[];
|
|
13
18
|
readonly locator: Locator;
|
|
14
19
|
constructor(local: Component, discover: Discover, aspects?: Aspect[]);
|
package/transpiled/context.js
CHANGED
|
@@ -3,6 +3,11 @@ import { environment } from '@toa.io/generic';
|
|
|
3
3
|
export class Context extends Connector {
|
|
4
4
|
env;
|
|
5
5
|
name;
|
|
6
|
+
/**
|
|
7
|
+
* The rank of the region this deployment is, which is what its writes are stamped with. A
|
|
8
|
+
* deployment that is no region at all reads as zero, which is what its records carry.
|
|
9
|
+
*/
|
|
10
|
+
region;
|
|
6
11
|
aspects;
|
|
7
12
|
locator;
|
|
8
13
|
#local;
|
|
@@ -12,6 +17,7 @@ export class Context extends Connector {
|
|
|
12
17
|
super();
|
|
13
18
|
this.env = environment.get('TOA_ENV');
|
|
14
19
|
this.name = environment.get('TOA_CONTEXT');
|
|
20
|
+
this.region = Number(environment.get('TOA_REGION') ?? 0);
|
|
15
21
|
this.aspects = aspects;
|
|
16
22
|
this.locator = local?.locator;
|
|
17
23
|
this.#local = local;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../source/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAS7C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpB,GAAG,CAAoB;IACvB,IAAI,CAAoB;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../source/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAS7C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpB,GAAG,CAAoB;IACvB,IAAI,CAAoB;IAExC;;;OAGG;IACa,MAAM,CAAQ;IAEd,OAAO,CAAU;IACjB,OAAO,CAAS;IAEvB,MAAM,CAAW;IACjB,SAAS,CAAU;IACnB,QAAQ,GAAoC,EAAE,CAAA;IAEvD,YAAmB,KAAgB,EAAE,QAAkB,EAAE,OAAO,GAAa,EAAE;QAC7E,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACrC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,CAAA;QAE7B,IAAI,CAAC,MAAM,GAAG,KAA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
import type {
|
|
3
|
+
import type { Row } from './types/outbox.js';
|
|
4
4
|
export declare class Emission extends Connector {
|
|
5
5
|
#private;
|
|
6
|
+
/** what a row is outstanding for while this has not published it */
|
|
7
|
+
readonly name = "events";
|
|
6
8
|
constructor(events: Event[]);
|
|
7
|
-
emit(
|
|
9
|
+
emit(row: Row): Promise<void>;
|
|
8
10
|
}
|
package/transpiled/emission.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Connector } from './connector.js';
|
|
2
2
|
export class Emission extends Connector {
|
|
3
|
+
/** what a row is outstanding for while this has not published it */
|
|
4
|
+
name = 'events';
|
|
3
5
|
#events;
|
|
4
6
|
constructor(events) {
|
|
5
7
|
super();
|
|
6
8
|
this.#events = events;
|
|
7
9
|
this.depends(events);
|
|
8
10
|
}
|
|
9
|
-
async emit(
|
|
10
|
-
const emission = this.#events.map((e) => e.emit(
|
|
11
|
+
async emit(row) {
|
|
12
|
+
const emission = this.#events.map((e) => e.emit(row));
|
|
11
13
|
await Promise.all(emission);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emission.js","sourceRoot":"","sources":["../source/emission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI1C,MAAM,OAAO,QAAS,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"emission.js","sourceRoot":"","sources":["../source/emission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI1C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,oEAAoE;IACpD,IAAI,GAAG,QAAQ,CAAA;IAEtB,OAAO,CAAS;IAEzB,YAAmB,MAAe;QAChC,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QAErB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACtB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,GAAQ;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;QAErD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { environment } from '@toa.io/generic';
|
|
1
2
|
import { EntityContractException, EntityGuardException } from '../exceptions.js';
|
|
2
3
|
import { newid } from './newid.js';
|
|
3
4
|
export class Entity {
|
|
@@ -66,7 +67,15 @@ export class Entity {
|
|
|
66
67
|
* makes is written over its own.
|
|
67
68
|
*/
|
|
68
69
|
#compose(id) {
|
|
69
|
-
|
|
70
|
+
// `REGION` here as well as in `#write`, because a record is validated before it is written
|
|
71
|
+
// and what is composed is about to be written here: it is this region's
|
|
72
|
+
return {
|
|
73
|
+
id,
|
|
74
|
+
VERSION: 0,
|
|
75
|
+
DELETED: null,
|
|
76
|
+
REGION,
|
|
77
|
+
...structuredClone(this.#blank)
|
|
78
|
+
};
|
|
70
79
|
}
|
|
71
80
|
#guard(value) {
|
|
72
81
|
if (this.#guards === undefined)
|
|
@@ -93,17 +102,36 @@ export class Entity {
|
|
|
93
102
|
enumerable: false,
|
|
94
103
|
value: {}
|
|
95
104
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
/*
|
|
106
|
+
* The system properties are the runtime's to write, and a record does not always come from
|
|
107
|
+
* a storage that wrote them: a component may bring its own, and one that answers with an
|
|
108
|
+
* id and a version has left the rest to whoever asked. Filling them in here is what makes
|
|
109
|
+
* a record's shape the runtime's guarantee rather than a storage's promise, and what lets
|
|
110
|
+
* the entity require them.
|
|
111
|
+
*/
|
|
112
|
+
value.CREATED ??= Date.now();
|
|
113
|
+
value.UPDATED ??= value.CREATED;
|
|
114
|
+
value.VERSION ??= 0;
|
|
115
|
+
value.DELETED ??= null;
|
|
116
|
+
value.REGION ??= REGION;
|
|
117
|
+
if (value.DELETED !== null)
|
|
101
118
|
this.deleted = true;
|
|
119
|
+
// beside the version and the timestamp, and for the same reason: all three say what the
|
|
120
|
+
// write did, so all three change only where there is one. A record read here keeps the
|
|
121
|
+
// region that wrote it, which is not necessarily this one — that is the whole of what it
|
|
122
|
+
// is for, and stamping it on the way in would answer every read with the wrong region.
|
|
102
123
|
if (this.#state !== undefined) {
|
|
103
124
|
value.UPDATED = Date.now();
|
|
104
125
|
value.VERSION++;
|
|
126
|
+
value.REGION = REGION;
|
|
105
127
|
}
|
|
106
128
|
this.#state = value;
|
|
107
129
|
}
|
|
108
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* The rank of the region this deployment is, from what deployed it. An application that is one
|
|
133
|
+
* region has none and writes `0`, which is what the first region is and what a record written
|
|
134
|
+
* before any of this existed is backfilled with.
|
|
135
|
+
*/
|
|
136
|
+
const REGION = Number(environment.get('TOA_REGION') ?? 0);
|
|
109
137
|
//# sourceMappingURL=entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../source/entities/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAMlC,MAAM,OAAO,MAAM;IACV,OAAO,GAAG,KAAK,CAAA;IAEb,OAAO,CAAQ;IACf,MAAM,CAAQ;IACd,OAAO,CAAqB;IACrC,OAAO,GAAkB,IAAI,CAAA;IAC7B,MAAM,CAAS;IACf,QAAQ,GAAG,IAAI,CAAA;IAEf;;;;;;OAMG;IACH,sCAAsC;IACtC,YACE,MAAc,EACd,KAAa,EACb,QAA0B,EAC1B,MAAgB,EAChB,OAAO,GAAG,IAAI;QAEd,IAAI,CAAC,OAAO,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ACf,KAAK,CAAC,MAAM,GAAG,MAAM,CAAA;QACvB,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA"}
|
|
@@ -14,6 +14,11 @@ export interface Schemas {
|
|
|
14
14
|
export declare class Factory {
|
|
15
15
|
#private;
|
|
16
16
|
constructor(schemas: Schemas, blank: object, guards?: Guard[]);
|
|
17
|
+
/**
|
|
18
|
+
* What these values would make of a record, held to what a record must be. It starts from a
|
|
19
|
+
* blank rather than from the declared properties alone, because what is validated is the
|
|
20
|
+
* record and a record carries what the runtime writes into every one of them.
|
|
21
|
+
*/
|
|
17
22
|
fit(values: object): void;
|
|
18
23
|
init(id?: string): Entity;
|
|
19
24
|
object(record: Record, mutable?: boolean): Entity;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { newid } from './newid.js';
|
|
2
1
|
import { Entity } from './entity.js';
|
|
3
2
|
import { EntitySet } from './set.js';
|
|
4
3
|
import { Changeset } from './changeset.js';
|
|
@@ -11,8 +10,13 @@ export class Factory {
|
|
|
11
10
|
this.#blank = blank;
|
|
12
11
|
this.#guards = guards;
|
|
13
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* What these values would make of a record, held to what a record must be. It starts from a
|
|
15
|
+
* blank rather than from the declared properties alone, because what is validated is the
|
|
16
|
+
* record and a record carries what the runtime writes into every one of them.
|
|
17
|
+
*/
|
|
14
18
|
fit(values) {
|
|
15
|
-
this.#schemas.entity.validate({
|
|
19
|
+
this.#schemas.entity.validate({ ...this.init().get(), ...values }, 'Entity');
|
|
16
20
|
}
|
|
17
21
|
init(id) {
|
|
18
22
|
return new Entity(this.#schemas.entity, this.#blank, id, this.#guards);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../source/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AC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;QAEnE,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,MAAM,EAAE,IAAI,IAAI;gBAAE,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;QAEzE,OAAO,IAAI,SAAS,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;IAEM,SAAS,CAAC,KAAY;QAC3B,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;CACF"}
|
package/transpiled/event.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Connector } from './connector.js';
|
|
2
2
|
import type { Emitter } from './types/bindings.js';
|
|
3
3
|
import type { Event as Bridge } from './types/bridges.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Row } from './types/outbox.js';
|
|
5
5
|
export interface Definition {
|
|
6
6
|
conditioned?: boolean;
|
|
7
7
|
subjective?: boolean;
|
|
@@ -10,5 +10,5 @@ export interface Definition {
|
|
|
10
10
|
export declare class Event extends Connector {
|
|
11
11
|
#private;
|
|
12
12
|
constructor(definition: Definition, emitter: Emitter, bridge?: Bridge);
|
|
13
|
-
emit(
|
|
13
|
+
emit(row: Row): Promise<void>;
|
|
14
14
|
}
|
package/transpiled/event.js
CHANGED
|
@@ -17,10 +17,15 @@ export class Event extends Connector {
|
|
|
17
17
|
if (bridge !== undefined)
|
|
18
18
|
this.depends(bridge);
|
|
19
19
|
}
|
|
20
|
-
async emit(
|
|
20
|
+
async emit(row) {
|
|
21
|
+
const event = row.event;
|
|
21
22
|
if (this.#conditioned === false || (await this.#bridge?.condition(event)) === true) {
|
|
22
23
|
const payload = this.#subjective === true ? await this.#bridge?.payload(event) : event.state;
|
|
23
24
|
const message = { payload };
|
|
25
|
+
// the chain the change was made by, so a receiver of this continues it rather than
|
|
26
|
+
// starting one; read off the row, because the pump publishes off the operation's path
|
|
27
|
+
if (row.trail !== undefined)
|
|
28
|
+
message.trail = row.trail;
|
|
24
29
|
const options = {
|
|
25
30
|
name: `${this.#label} publish`,
|
|
26
31
|
kind: 'producer',
|
package/transpiled/event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../source/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAY1C,MAAM,OAAO,KAAM,SAAQ,SAAS;IACzB,QAAQ,CAAS;IACjB,OAAO,CAAoB;IAC3B,YAAY,CAAqB;IACjC,WAAW,CAAqB;IAChC,MAAM,CAAQ;IAEvB,YAAmB,UAAsB,EAAE,OAAgB,EAAE,MAAe;QAC1E,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,WAAW,CAAA;QAC1C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAA;QACxC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,KAAK,IAAI,OAAO,CAAA;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QAErB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAErB,IAAI,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAChD,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../source/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,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EAAE,GAAG,IAAI,CAAC,MAAM,UAAU;gBAC9B,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,EAAE,4BAA4B,EAAE,IAAI,CAAC,MAAM,EAAE;aAC1D,CAAA;YAED,MAAM,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;gBACrC,MAAM,OAAO,GAAG,OAAO,EAAE,CAAA;gBAEzB,IAAI,OAAO,KAAK,SAAS;oBAAE,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;gBAE9D,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACnC,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -17,6 +17,9 @@ export declare const codes: {
|
|
|
17
17
|
Duplicate: number;
|
|
18
18
|
Communication: number;
|
|
19
19
|
Transmission: number;
|
|
20
|
+
Endpoint: number;
|
|
21
|
+
/** a chain that came back to where it had been, or went further than a chain goes */
|
|
22
|
+
Loop: number;
|
|
20
23
|
};
|
|
21
24
|
export declare class Exception {
|
|
22
25
|
readonly code: number;
|
|
@@ -30,6 +33,15 @@ export declare class SystemException extends Exception {
|
|
|
30
33
|
readonly stack?: string;
|
|
31
34
|
constructor(error: Error | string);
|
|
32
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A call refused for where it has been rather than for what it says. Named, and so permanent:
|
|
38
|
+
* the chain is deterministic, and another attempt reproduces it hop for hop.
|
|
39
|
+
*/
|
|
40
|
+
export declare class LoopException extends Exception {
|
|
41
|
+
/** the whole chain, so what is set aside can be read without guessing */
|
|
42
|
+
readonly trail: string[];
|
|
43
|
+
constructor(message: string, trail: string[]);
|
|
44
|
+
}
|
|
33
45
|
export declare class ContractException extends Exception {
|
|
34
46
|
constructor(code: number | undefined, error: SchemaError | string | null, cause?: unknown);
|
|
35
47
|
}
|
|
@@ -57,5 +69,12 @@ export declare const StateInitializationException: Derived;
|
|
|
57
69
|
export declare const DuplicateException: Derived;
|
|
58
70
|
export declare const CommunicationException: Derived;
|
|
59
71
|
export declare const TransmissionException: Derived;
|
|
72
|
+
export declare const EndpointException: Derived;
|
|
60
73
|
export declare const names: Record<string, string>;
|
|
74
|
+
/**
|
|
75
|
+
* Takes `unknown` because a caller has caught something rather than been handed an `Exception`.
|
|
76
|
+
* Anything core did not raise — an error from a driver, a rejection with no code at all — is not
|
|
77
|
+
* on the list, and is therefore worth trying again.
|
|
78
|
+
*/
|
|
79
|
+
export declare function permanent(exception: unknown): boolean;
|
|
61
80
|
export {};
|
package/transpiled/exceptions.js
CHANGED
|
@@ -16,7 +16,10 @@ export const codes = {
|
|
|
16
16
|
StateInitialization: 305,
|
|
17
17
|
Duplicate: 306,
|
|
18
18
|
Communication: 400,
|
|
19
|
-
Transmission: 401
|
|
19
|
+
Transmission: 401,
|
|
20
|
+
Endpoint: 402,
|
|
21
|
+
/** a chain that came back to where it had been, or went further than a chain goes */
|
|
22
|
+
Loop: 500
|
|
20
23
|
};
|
|
21
24
|
export class Exception {
|
|
22
25
|
code;
|
|
@@ -37,11 +40,29 @@ export class SystemException extends Exception {
|
|
|
37
40
|
this.stack = error.stack;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* A call refused for where it has been rather than for what it says. Named, and so permanent:
|
|
45
|
+
* the chain is deterministic, and another attempt reproduces it hop for hop.
|
|
46
|
+
*/
|
|
47
|
+
export class LoopException extends Exception {
|
|
48
|
+
/** the whole chain, so what is set aside can be read without guessing */
|
|
49
|
+
trail;
|
|
50
|
+
constructor(message, trail) {
|
|
51
|
+
super(codes.Loop, message);
|
|
52
|
+
this.trail = trail;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
40
55
|
export class ContractException extends Exception {
|
|
41
56
|
constructor(code, error, cause) {
|
|
42
57
|
super(code ?? codes.Contract, typeof error === 'string' ? error : (error?.message ?? ''), cause);
|
|
43
58
|
if (typeof error === 'object' && error !== null)
|
|
44
|
-
for (const k of [
|
|
59
|
+
for (const k of [
|
|
60
|
+
'keyword',
|
|
61
|
+
'instancePath',
|
|
62
|
+
'schemaPath',
|
|
63
|
+
'params',
|
|
64
|
+
'propertyName'
|
|
65
|
+
])
|
|
45
66
|
if (k in error)
|
|
46
67
|
this[k] = error[k];
|
|
47
68
|
}
|
|
@@ -88,6 +109,57 @@ export const StateInitializationException = derive('StateInitialization');
|
|
|
88
109
|
export const DuplicateException = derive('Duplicate');
|
|
89
110
|
export const CommunicationException = derive('Communication');
|
|
90
111
|
export const TransmissionException = derive('Transmission');
|
|
112
|
+
export const EndpointException = derive('Endpoint');
|
|
91
113
|
export const names = swap(codes);
|
|
92
114
|
// #endregion
|
|
115
|
+
/**
|
|
116
|
+
* Whether a failure means the same thing on a later attempt.
|
|
117
|
+
*
|
|
118
|
+
* Every code answers, and the answer is here rather than inferred: `Record<keyof typeof codes>`
|
|
119
|
+
* refuses to compile until a code added later says which it is. What core names, core raised on
|
|
120
|
+
* purpose — a contract does not start fitting, a version that has passed does not come back.
|
|
121
|
+
* `System` is the exception that proves it: it is a code like any other, and what it wraps is
|
|
122
|
+
* whatever reached core from below, which is the kind that passes.
|
|
123
|
+
*/
|
|
124
|
+
const OUTCOME = {
|
|
125
|
+
// whatever the algorithm or a connector threw: core neither chose it nor can read it
|
|
126
|
+
System: 'transient',
|
|
127
|
+
Contract: 'permanent',
|
|
128
|
+
RequestSyntax: 'permanent',
|
|
129
|
+
RequestContract: 'permanent',
|
|
130
|
+
RequestConflict: 'permanent',
|
|
131
|
+
ResponseContract: 'permanent',
|
|
132
|
+
EntityContract: 'permanent',
|
|
133
|
+
EntityGuard: 'permanent',
|
|
134
|
+
QuerySyntax: 'permanent',
|
|
135
|
+
State: 'permanent',
|
|
136
|
+
// an event about an entity can outrun the one that creates it; nothing promises order
|
|
137
|
+
StateNotFound: 'transient',
|
|
138
|
+
// an entity's version only grows, so one that has passed does not start matching
|
|
139
|
+
StatePrecondition: 'permanent',
|
|
140
|
+
// the compare-and-swap lost, which is the case a later attempt exists for
|
|
141
|
+
StateConcurrency: 'transient',
|
|
142
|
+
StateInitialization: 'permanent',
|
|
143
|
+
Duplicate: 'permanent',
|
|
144
|
+
Communication: 'transient',
|
|
145
|
+
// nothing is listening on that queue yet — a deployment in progress, most of the time
|
|
146
|
+
Transmission: 'transient',
|
|
147
|
+
// its sibling, and the other way round: nothing carried the call is a moment,
|
|
148
|
+
// there is nothing to carry it to is a fact
|
|
149
|
+
Endpoint: 'permanent',
|
|
150
|
+
// the chain is deterministic, so another attempt walks it again: a retry is another cycle
|
|
151
|
+
Loop: 'permanent'
|
|
152
|
+
};
|
|
153
|
+
const PERMANENT = new Set(Object.entries(OUTCOME)
|
|
154
|
+
.filter(([, outcome]) => outcome === 'permanent')
|
|
155
|
+
.map(([name]) => codes[name]));
|
|
156
|
+
/**
|
|
157
|
+
* Takes `unknown` because a caller has caught something rather than been handed an `Exception`.
|
|
158
|
+
* Anything core did not raise — an error from a driver, a rejection with no code at all — is not
|
|
159
|
+
* on the list, and is therefore worth trying again.
|
|
160
|
+
*/
|
|
161
|
+
export function permanent(exception) {
|
|
162
|
+
const code = exception?.code;
|
|
163
|
+
return code !== undefined && PERMANENT.has(code);
|
|
164
|
+
}
|
|
93
165
|
//# sourceMappingURL=exceptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../source/exceptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAGtC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,CAAC;IAET,QAAQ,EAAE,GAAG;IACb,aAAa,EAAE,GAAG;IAClB,eAAe,EAAE,GAAG;IACpB,eAAe,EAAE,GAAG;IACpB,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,GAAG;IACnB,WAAW,EAAE,GAAG;IAChB,WAAW,EAAE,GAAG;IAEhB,KAAK,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4C;IAC5C,QAAQ,EAAE,WAAW;IAErB,0FAA0F;IAC1F,IAAI,EAAE,WAAW;CAClB,CAAA;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,WAAW,CAAC;KAChD,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAA0B,CAAC,CAAC,CACtD,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,SAAkB;IAC1C,MAAM,IAAI,GAAI,SAAmC,EAAE,IAAI,CAAA;IAEvD,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC"}
|
package/transpiled/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { Event } from './event.js';
|
|
|
12
12
|
export { Exposition } from './exposition.js';
|
|
13
13
|
export { Locator } from './locator.js';
|
|
14
14
|
export { Observation } from './observation.js';
|
|
15
|
-
export { Outbox } from './outbox
|
|
15
|
+
export { Outbox } from './outbox.js';
|
|
16
16
|
export { Operation } from './operation.js';
|
|
17
17
|
export { Query } from './query.js';
|
|
18
18
|
export { Receiver } from './receiver.js';
|
|
@@ -25,6 +25,7 @@ export { Unmanaged } from './unmanaged.js';
|
|
|
25
25
|
export { Guard } from './guard.js';
|
|
26
26
|
export * as entities from './entities/index.js';
|
|
27
27
|
export * as exceptions from './exceptions.js';
|
|
28
|
+
export * as trail from './trail.js';
|
|
28
29
|
export * as contract from './contract/index.js';
|
|
29
30
|
export type { Exception } from './exceptions.js';
|
|
30
31
|
export type { Invocable } from './component.js';
|
package/transpiled/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { Event } from './event.js';
|
|
|
12
12
|
export { Exposition } from './exposition.js';
|
|
13
13
|
export { Locator } from './locator.js';
|
|
14
14
|
export { Observation } from './observation.js';
|
|
15
|
-
export { Outbox } from './outbox
|
|
15
|
+
export { Outbox } from './outbox.js';
|
|
16
16
|
export { Operation } from './operation.js';
|
|
17
17
|
export { Query } from './query.js';
|
|
18
18
|
export { Receiver } from './receiver.js';
|
|
@@ -25,5 +25,6 @@ export { Unmanaged } from './unmanaged.js';
|
|
|
25
25
|
export { Guard } from './guard.js';
|
|
26
26
|
export * as entities from './entities/index.js';
|
|
27
27
|
export * as exceptions from './exceptions.js';
|
|
28
|
+
export * as trail from './trail.js';
|
|
28
29
|
export * as contract from './contract/index.js';
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/transpiled/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,E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