@toa.io/core 1.0.0-alpha.32 → 1.0.0-alpha.320
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 +28 -12
- package/transpiled/abandon.d.ts +9 -0
- package/transpiled/abandon.js +37 -0
- package/transpiled/abandon.js.map +1 -0
- package/transpiled/assignment.d.ts +6 -0
- package/transpiled/assignment.js +25 -0
- package/transpiled/assignment.js.map +1 -0
- package/transpiled/call.d.ts +10 -0
- package/transpiled/call.js +187 -0
- package/transpiled/call.js.map +1 -0
- package/transpiled/cascade.d.ts +7 -0
- package/transpiled/cascade.js +28 -0
- package/transpiled/cascade.js.map +1 -0
- package/transpiled/component.d.ts +15 -0
- package/transpiled/component.js +148 -0
- package/transpiled/component.js.map +1 -0
- package/transpiled/composition.d.ts +6 -0
- package/transpiled/composition.js +20 -0
- package/transpiled/composition.js.map +1 -0
- package/transpiled/connector.d.ts +71 -0
- package/transpiled/connector.js +248 -0
- package/transpiled/connector.js.map +1 -0
- package/transpiled/context.d.ts +25 -0
- package/transpiled/context.js +55 -0
- package/transpiled/context.js.map +1 -0
- package/transpiled/contract/component.d.ts +37 -0
- package/transpiled/contract/component.js +94 -0
- package/transpiled/contract/component.js.map +1 -0
- package/transpiled/contract/contract.d.ts +10 -0
- package/transpiled/contract/contract.js +14 -0
- package/transpiled/contract/contract.js.map +1 -0
- package/transpiled/contract/index.d.ts +4 -0
- package/transpiled/contract/index.js +5 -0
- package/transpiled/contract/index.js.map +1 -0
- package/transpiled/contract/reply.d.ts +7 -0
- package/transpiled/contract/reply.js +48 -0
- package/transpiled/contract/reply.js.map +1 -0
- package/transpiled/contract/request.d.ts +49 -0
- package/transpiled/contract/request.js +152 -0
- package/transpiled/contract/request.js.map +1 -0
- package/transpiled/contract/schemas.d.ts +4 -0
- package/transpiled/contract/schemas.js +38 -0
- package/transpiled/contract/schemas.js.map +1 -0
- package/transpiled/contract/system.d.ts +33 -0
- package/transpiled/contract/system.js +76 -0
- package/transpiled/contract/system.js.map +1 -0
- package/transpiled/deliveries.d.ts +22 -0
- package/transpiled/deliveries.js +31 -0
- package/transpiled/deliveries.js.map +1 -0
- package/transpiled/effect.d.ts +7 -0
- package/transpiled/effect.js +13 -0
- package/transpiled/effect.js.map +1 -0
- package/transpiled/emission.d.ts +10 -0
- package/transpiled/emission.js +16 -0
- package/transpiled/emission.js.map +1 -0
- package/transpiled/encoded.d.ts +16 -0
- package/transpiled/encoded.js +25 -0
- package/transpiled/encoded.js.map +1 -0
- package/transpiled/entities/changeset.d.ts +10 -0
- package/transpiled/entities/changeset.js +27 -0
- package/transpiled/entities/changeset.js.map +1 -0
- package/transpiled/entities/entity.d.ts +19 -0
- package/transpiled/entities/entity.js +137 -0
- package/transpiled/entities/entity.js.map +1 -0
- package/transpiled/entities/factory.d.ts +27 -0
- package/transpiled/entities/factory.js +38 -0
- package/transpiled/entities/factory.js.map +1 -0
- package/transpiled/entities/index.d.ts +5 -0
- package/transpiled/entities/index.js +6 -0
- package/transpiled/entities/index.js.map +1 -0
- package/transpiled/entities/newid.d.ts +11 -0
- package/transpiled/entities/newid.js +41 -0
- package/transpiled/entities/newid.js.map +1 -0
- package/transpiled/entities/set.d.ts +10 -0
- package/transpiled/entities/set.js +19 -0
- package/transpiled/entities/set.js.map +1 -0
- package/transpiled/event.d.ts +20 -0
- package/transpiled/event.js +65 -0
- package/transpiled/event.js.map +1 -0
- package/transpiled/exceptions.d.ts +110 -0
- package/transpiled/exceptions.js +215 -0
- package/transpiled/exceptions.js.map +1 -0
- package/transpiled/gate.d.ts +40 -0
- package/transpiled/gate.js +84 -0
- package/transpiled/gate.js.map +1 -0
- package/transpiled/guard.d.ts +7 -0
- package/transpiled/guard.js +12 -0
- package/transpiled/guard.js.map +1 -0
- package/transpiled/halting.d.ts +16 -0
- package/transpiled/halting.js +25 -0
- package/transpiled/halting.js.map +1 -0
- package/transpiled/index.d.ts +44 -0
- package/transpiled/index.js +36 -0
- package/transpiled/index.js.map +1 -0
- package/transpiled/instance.d.ts +10 -0
- package/transpiled/instance.js +30 -0
- package/transpiled/instance.js.map +1 -0
- package/transpiled/locator.d.ts +12 -0
- package/transpiled/locator.js +32 -0
- package/transpiled/locator.js.map +1 -0
- package/transpiled/measurements.d.ts +20 -0
- package/transpiled/measurements.js +40 -0
- package/transpiled/measurements.js.map +1 -0
- package/transpiled/observation.d.ts +7 -0
- package/transpiled/observation.js +14 -0
- package/transpiled/observation.js.map +1 -0
- package/transpiled/operation.d.ts +73 -0
- package/transpiled/operation.js +213 -0
- package/transpiled/operation.js.map +1 -0
- package/transpiled/outbox.d.ts +45 -0
- package/transpiled/outbox.js +448 -0
- package/transpiled/outbox.js.map +1 -0
- package/transpiled/outbox.measurements.d.ts +4 -0
- package/transpiled/outbox.measurements.js +38 -0
- package/transpiled/outbox.measurements.js.map +1 -0
- package/transpiled/parts.d.ts +20 -0
- package/transpiled/parts.js +23 -0
- package/transpiled/parts.js.map +1 -0
- package/transpiled/query/criteria.d.ts +6 -0
- package/transpiled/query/criteria.js +177 -0
- package/transpiled/query/criteria.js.map +1 -0
- package/transpiled/query/options.d.ts +3 -0
- package/transpiled/query/options.js +34 -0
- package/transpiled/query/options.js.map +1 -0
- package/transpiled/query.d.ts +9 -0
- package/transpiled/query.js +57 -0
- package/transpiled/query.js.map +1 -0
- package/transpiled/receiver.d.ts +20 -0
- package/transpiled/receiver.js +113 -0
- package/transpiled/receiver.js.map +1 -0
- package/transpiled/reflection.d.ts +9 -0
- package/transpiled/reflection.js +13 -0
- package/transpiled/reflection.js.map +1 -0
- package/transpiled/remote.d.ts +10 -0
- package/transpiled/remote.js +11 -0
- package/transpiled/remote.js.map +1 -0
- package/transpiled/rendering.d.ts +13 -0
- package/transpiled/rendering.js +21 -0
- package/transpiled/rendering.js.map +1 -0
- package/transpiled/safety.d.ts +5 -0
- package/transpiled/safety.js +26 -0
- package/transpiled/safety.js.map +1 -0
- package/transpiled/state.d.ts +36 -0
- package/transpiled/state.js +131 -0
- package/transpiled/state.js.map +1 -0
- package/transpiled/trail.d.ts +78 -0
- package/transpiled/trail.js +112 -0
- package/transpiled/trail.js.map +1 -0
- package/transpiled/transition.d.ts +14 -0
- package/transpiled/transition.js +51 -0
- package/transpiled/transition.js.map +1 -0
- package/transpiled/transmission.d.ts +8 -0
- package/transpiled/transmission.js +30 -0
- package/transpiled/transmission.js.map +1 -0
- package/transpiled/types/atomicity.d.ts +58 -0
- package/transpiled/types/atomicity.js +2 -0
- package/transpiled/types/atomicity.js.map +1 -0
- package/transpiled/types/bindings.d.ts +82 -0
- package/transpiled/types/bindings.js +2 -0
- package/transpiled/types/bindings.js.map +1 -0
- package/transpiled/types/bridges.d.ts +41 -0
- package/transpiled/types/bridges.js +2 -0
- package/transpiled/types/bridges.js.map +1 -0
- package/transpiled/types/extensions.d.ts +121 -0
- package/transpiled/types/extensions.js +2 -0
- package/transpiled/types/extensions.js.map +1 -0
- package/transpiled/types/inbox.d.ts +27 -0
- package/transpiled/types/inbox.js +2 -0
- package/transpiled/types/inbox.js.map +1 -0
- package/transpiled/types/index.d.ts +14 -0
- package/transpiled/types/index.js +9 -0
- package/transpiled/types/index.js.map +1 -0
- package/transpiled/types/message.d.ts +16 -0
- package/transpiled/types/message.js +2 -0
- package/transpiled/types/message.js.map +1 -0
- package/transpiled/types/operations.d.ts +15 -0
- package/transpiled/types/operations.js +2 -0
- package/transpiled/types/operations.js.map +1 -0
- package/transpiled/types/outbox.d.ts +68 -0
- package/transpiled/types/outbox.js +2 -0
- package/transpiled/types/outbox.js.map +1 -0
- package/transpiled/types/receiver.d.ts +9 -0
- package/transpiled/types/receiver.js +2 -0
- package/transpiled/types/receiver.js.map +1 -0
- package/transpiled/types/request.d.ts +119 -0
- package/transpiled/types/request.js +2 -0
- package/transpiled/types/request.js.map +1 -0
- package/transpiled/types/state.d.ts +9 -0
- package/transpiled/types/state.js +2 -0
- package/transpiled/types/state.js.map +1 -0
- package/transpiled/types/storages.d.ts +154 -0
- package/transpiled/types/storages.js +2 -0
- package/transpiled/types/storages.js.map +1 -0
- package/transpiled/unmanaged.d.ts +5 -0
- package/transpiled/unmanaged.js +7 -0
- package/transpiled/unmanaged.js.map +1 -0
- package/src/assignment.js +0 -31
- package/src/call.js +0 -42
- package/src/cascade.js +0 -35
- package/src/component.js +0 -41
- package/src/composition.js +0 -25
- package/src/connector.js +0 -183
- package/src/context.js +0 -55
- package/src/contract/conditions.js +0 -21
- package/src/contract/index.js +0 -7
- package/src/contract/reply.js +0 -25
- package/src/contract/request.js +0 -67
- package/src/contract/schemas/error.yaml +0 -9
- package/src/contract/schemas/index.js +0 -7
- package/src/contract/schemas/query.yaml +0 -30
- package/src/discovery.js +0 -44
- package/src/emission.js +0 -23
- package/src/entities/changeset.js +0 -38
- package/src/entities/entity.js +0 -74
- package/src/entities/factory.js +0 -33
- package/src/entities/index.js +0 -5
- package/src/entities/set.js +0 -15
- package/src/event.js +0 -40
- package/src/exceptions.js +0 -100
- package/src/exposition.js +0 -27
- package/src/index.js +0 -47
- package/src/locator.js +0 -54
- package/src/observation.js +0 -20
- package/src/operation.js +0 -69
- package/src/query/criteria.js +0 -41
- package/src/query/options.js +0 -40
- package/src/query.js +0 -41
- package/src/receiver.js +0 -61
- package/src/reflection.js +0 -28
- package/src/remote.js +0 -17
- package/src/state.js +0 -99
- package/src/transition.js +0 -67
- package/src/transmission.js +0 -33
- package/test/call.fixtures.js +0 -27
- package/test/call.test.js +0 -46
- package/test/component.fixtures.js +0 -21
- package/test/component.test.js +0 -40
- package/test/connector.fixtures.js +0 -40
- package/test/connector.test.js +0 -176
- package/test/context.fixtures.js +0 -18
- package/test/context.test.js +0 -29
- package/test/contract/conditions.test.js +0 -26
- package/test/contract/contract.fixtures.js +0 -33
- package/test/contract/request.test.js +0 -112
- package/test/emission.fixtures.js +0 -17
- package/test/emission.test.js +0 -35
- package/test/entities/entity.fixtures.js +0 -29
- package/test/entities/entity.test.js +0 -65
- package/test/entities/factory.fixtures.js +0 -18
- package/test/entities/factory.test.js +0 -48
- package/test/entities/set.fixtures.js +0 -11
- package/test/entities/set.test.js +0 -12
- package/test/event.fixtures.js +0 -29
- package/test/event.test.js +0 -118
- package/test/locator.test.js +0 -113
- package/test/query.fixtures.js +0 -100
- package/test/query.test.js +0 -86
- package/test/receiver.fixtures.js +0 -23
- package/test/receiver.test.js +0 -95
- package/test/reflection.test.js +0 -30
- package/test/state.fixtures.js +0 -47
- package/test/state.test.js +0 -46
- package/test/transmission.fixtures.js +0 -15
- package/test/transmission.test.js +0 -46
- package/types/bindings.d.ts +0 -40
- package/types/bridges.ts +0 -30
- package/types/component.d.ts +0 -9
- package/types/connector.d.ts +0 -18
- package/types/context.d.ts +0 -21
- package/types/entity.d.ts +0 -46
- package/types/event.d.ts +0 -11
- package/types/exception.d.ts +0 -4
- package/types/extensions.d.ts +0 -29
- package/types/index.ts +0 -14
- package/types/locator.d.ts +0 -13
- package/types/message.d.ts +0 -3
- package/types/operations.d.ts +0 -2
- package/types/query.d.ts +0 -15
- package/types/receiver.d.ts +0 -12
- package/types/reflection.d.ts +0 -14
- package/types/request.d.ts +0 -23
- package/types/state.d.ts +0 -35
- package/types/storages.d.ts +0 -71
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.js","sourceRoot":"","sources":["../../source/contract/reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAI5D,MAAM,OAAO,KAAM,SAAQ,QAAQ;IAC1B,MAAM,CAAU,SAAS,GAC9B,yBAA+C,CAAA;IAE1C,MAAM,CAAC,MAAM,CAAC,MAAmB,EAAE,MAA+B;QACvE,MAAM,MAAM,GAAe;YACzB,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,oBAAoB,EAAE,KAAK;SAC5B,CAAA;QAED,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB;;;;;eAKG;YACH,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;YAEhC,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;gBAAE,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAA;iBAC3D,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,IAAI,KAAK,QAAQ;gBACjE,MAAM,CAAC,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAAA;YAE1C,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,MAAM,CAAA;QACnC,CAAC;QAED;;;;WAIG;QACH,MAAM,CAAC,UAAU,CAAC,KAAK;YACrB,MAAM,KAAK,SAAS;gBAClB,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC;oBACE,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;yBACb;wBACD,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;yBACf;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB,CAAA;QAEP,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Contract } from './contract.ts';
|
|
2
|
+
import type { Schema } from '@toa.io/schemas';
|
|
3
|
+
import type { Refusal } from './contract.ts';
|
|
4
|
+
import type { JSONSchema } from './schemas.ts';
|
|
5
|
+
/** What an operation states about itself, and answers when asked to explain. */
|
|
6
|
+
export interface Explanation {
|
|
7
|
+
description?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the same call arriving twice changes state once. Said, because a caller cannot tell
|
|
10
|
+
* it from an answer that says nothing, and what it changes is whether a retry is safe to make.
|
|
11
|
+
*/
|
|
12
|
+
once?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether a call to it names the process it goes to. Said, because the caller is the one who
|
|
15
|
+
* has to name one, and a call that names none is refused.
|
|
16
|
+
*/
|
|
17
|
+
stateful?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The input property that carries a stream, where the operation takes one. Said, because a
|
|
20
|
+
* caller has to put one there, and a call that carries none is refused.
|
|
21
|
+
*/
|
|
22
|
+
stream?: string;
|
|
23
|
+
input?: JSONSchema | null;
|
|
24
|
+
output?: JSONSchema | null;
|
|
25
|
+
errors?: Array<string | number>;
|
|
26
|
+
}
|
|
27
|
+
export interface Definition extends Explanation {
|
|
28
|
+
type?: string;
|
|
29
|
+
scope?: string;
|
|
30
|
+
query?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** What the operation works on, as the manifest declares it. */
|
|
33
|
+
export interface Entity {
|
|
34
|
+
properties: Record<string, JSONSchema>;
|
|
35
|
+
required?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Whether its system properties are the ones the runtime gives every entity, in which case a
|
|
38
|
+
* contract leaves them out and whoever reads one puts them back.
|
|
39
|
+
*/
|
|
40
|
+
system?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare class Request extends Contract {
|
|
43
|
+
readonly discovery: Explanation;
|
|
44
|
+
static Exception: Refusal;
|
|
45
|
+
constructor(schema: Schema, definition: Definition, entity?: Entity);
|
|
46
|
+
static schema(definition: Definition, entity?: {
|
|
47
|
+
properties: Record<string, JSONSchema>;
|
|
48
|
+
}): JSONSchema;
|
|
49
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as schemas from './schemas.js';
|
|
2
|
+
import { RequestContractException } from '../exceptions.js';
|
|
3
|
+
import { Contract } from './contract.js';
|
|
4
|
+
export class Request extends Contract {
|
|
5
|
+
discovery = {};
|
|
6
|
+
static Exception = RequestContractException;
|
|
7
|
+
constructor(schema, definition, entity) {
|
|
8
|
+
super(schema);
|
|
9
|
+
for (const key of [
|
|
10
|
+
'description',
|
|
11
|
+
'once',
|
|
12
|
+
'stateful',
|
|
13
|
+
'stream',
|
|
14
|
+
'input',
|
|
15
|
+
'output',
|
|
16
|
+
'errors'
|
|
17
|
+
])
|
|
18
|
+
if (definition[key] !== undefined)
|
|
19
|
+
this.discovery[key] = definition[key];
|
|
20
|
+
// how long a call is remembered is the operation's to keep, not the caller's to plan by
|
|
21
|
+
if (this.discovery.once !== undefined)
|
|
22
|
+
this.discovery.once = this.discovery.once !== false;
|
|
23
|
+
/*
|
|
24
|
+
* An operation that states no output states an empty schema, which every reply fits —
|
|
25
|
+
* and which says nothing to whoever reads it. What its type answers does, so that is
|
|
26
|
+
* said here instead. Here and not in the definition, because the definition is what a
|
|
27
|
+
* reply is held to: a projection is a lawful answer, and describing one is not the same
|
|
28
|
+
* as requiring it.
|
|
29
|
+
*/
|
|
30
|
+
if (empty(this.discovery.output)) {
|
|
31
|
+
const answered = answers(definition, entity);
|
|
32
|
+
if (answered !== undefined)
|
|
33
|
+
this.discovery.output = answered;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
static schema(definition, entity) {
|
|
37
|
+
// `source` is not among these: the framework stamps it and whoever reads it takes the keys
|
|
38
|
+
// it knows, so holding it to a schema would only fail calls from a peer that stamps one more
|
|
39
|
+
const schema = {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
/*
|
|
43
|
+
* Listed, and not required. `additionalProperties` already admits it, and a callee skips
|
|
44
|
+
* this contract altogether for an `authentic` request — which every request from a `Call`
|
|
45
|
+
* is — so requiring it would refuse nothing on the side where a missing identity matters,
|
|
46
|
+
* and would refuse every request built by hand on the side where it never is. An
|
|
47
|
+
* operation that declares `once` raises on a request without one instead.
|
|
48
|
+
*/
|
|
49
|
+
id: { type: 'string' },
|
|
50
|
+
authentic: { type: 'boolean' },
|
|
51
|
+
task: { type: 'boolean' },
|
|
52
|
+
// whether the call may reach only a safe operation, which every operation admits
|
|
53
|
+
readonly: { type: 'boolean' },
|
|
54
|
+
// what a caller receives of the output, which every operation admits
|
|
55
|
+
output: { type: 'array', uniqueItems: true, items: { type: 'string' } }
|
|
56
|
+
},
|
|
57
|
+
additionalProperties: true
|
|
58
|
+
};
|
|
59
|
+
const required = [];
|
|
60
|
+
if (definition.stream !== undefined) {
|
|
61
|
+
schema.properties.input = streamed(definition.input ?? { type: 'object' }, definition.stream);
|
|
62
|
+
required.push('input');
|
|
63
|
+
}
|
|
64
|
+
else if (definition.input !== undefined) {
|
|
65
|
+
schema.properties.input = definition.input;
|
|
66
|
+
required.push('input');
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
schema.properties.input = { type: 'null' };
|
|
70
|
+
if (entity === undefined)
|
|
71
|
+
definition.query = false;
|
|
72
|
+
if (definition.query === true)
|
|
73
|
+
required.push('query');
|
|
74
|
+
if (definition.query === false)
|
|
75
|
+
schema.properties.query = { type: 'null' };
|
|
76
|
+
if (definition.query !== false) {
|
|
77
|
+
const query = structuredClone(schemas.query);
|
|
78
|
+
query.properties.id = entity?.properties.id;
|
|
79
|
+
if (definition.type === 'observation')
|
|
80
|
+
delete query.properties.version;
|
|
81
|
+
else
|
|
82
|
+
delete query.properties.projection;
|
|
83
|
+
if (definition.scope === 'stream') {
|
|
84
|
+
// a window of a stream is read after the one before it, and ordered by what never moves
|
|
85
|
+
delete query.properties.omit;
|
|
86
|
+
query.if = { anyOf: [{ required: ['limit'] }, { required: ['token'] }] };
|
|
87
|
+
query.then = { properties: { sort: { items: { pattern: UNMOVING } } } };
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
delete query.properties.token;
|
|
91
|
+
delete query.properties.stop;
|
|
92
|
+
if (definition.type !== 'observation' || definition.scope !== 'entries') {
|
|
93
|
+
delete query.properties.omit;
|
|
94
|
+
delete query.properties.limit;
|
|
95
|
+
}
|
|
96
|
+
else if (query.required === undefined)
|
|
97
|
+
query.required = ['limit'];
|
|
98
|
+
else
|
|
99
|
+
query.required.push('limit');
|
|
100
|
+
}
|
|
101
|
+
schema.properties.query = query;
|
|
102
|
+
}
|
|
103
|
+
if (required.length > 0)
|
|
104
|
+
schema.required = required;
|
|
105
|
+
return schema;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The input of an operation that takes a stream: the input it declared, with the property that
|
|
110
|
+
* carries one admitted and required. What that property holds is described by nothing — a stream
|
|
111
|
+
* is no value with a schema — so what a caller is held to is that it is there.
|
|
112
|
+
*/
|
|
113
|
+
function streamed(input, property) {
|
|
114
|
+
const properties = { ...input.properties, [property]: {} };
|
|
115
|
+
const required = input.required === undefined ? [property] : [...input.required, property];
|
|
116
|
+
return { ...input, properties, required };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* What an operation of this type answers, where it did not say.
|
|
120
|
+
*
|
|
121
|
+
* A transition, an observation and an assignment work on the Entity Object, so that is what
|
|
122
|
+
* they answer — a set of them where the scope is a set. A computation neither uses the scope
|
|
123
|
+
* nor produces one, and an effect answers whatever it computed, so neither is guessed at.
|
|
124
|
+
* A stream is not a value with a schema, and is not one either.
|
|
125
|
+
*
|
|
126
|
+
* What the entity requires is said as well. It is a description and nothing is held to it —
|
|
127
|
+
* an operation answering a projection says so by declaring its own output — and a shape
|
|
128
|
+
* whose every property reads as optional says less than it knows.
|
|
129
|
+
*/
|
|
130
|
+
function answers(definition, entity) {
|
|
131
|
+
if (entity === undefined || !ENTITY.has(definition.type))
|
|
132
|
+
return undefined;
|
|
133
|
+
const object = {
|
|
134
|
+
type: 'object',
|
|
135
|
+
properties: entity.properties,
|
|
136
|
+
...(entity.required === undefined ? {} : { required: entity.required })
|
|
137
|
+
};
|
|
138
|
+
if (definition.scope === 'entries')
|
|
139
|
+
return { type: 'array', items: object };
|
|
140
|
+
return definition.scope === 'entry' || definition.scope === 'changeset'
|
|
141
|
+
? object
|
|
142
|
+
: undefined;
|
|
143
|
+
}
|
|
144
|
+
/** The types whose subject is the Entity Object; see `documentation/design.md`. */
|
|
145
|
+
const ENTITY = new Set(['transition', 'observation', 'assignment']);
|
|
146
|
+
/** A schema that states nothing, which is what an operation saying nothing normalizes to. */
|
|
147
|
+
function empty(schema) {
|
|
148
|
+
return schema === undefined || schema === null || Object.keys(schema).length === 0;
|
|
149
|
+
}
|
|
150
|
+
/** What a window of a stream may be ordered by: what an entry never changes. */
|
|
151
|
+
const UNMOVING = '^(?:id|CREATED)(?::(?:asc|desc))?$';
|
|
152
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../source/contract/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AA8CxC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnB,SAAS,GAAgB,EAAE,CAAA;IAEpC,MAAM,CAAU,SAAS,GAC9B,wBAA8C,CAAA;IAEhD,YAAmB,MAAc,EAAE,UAAsB,EAAE,MAAe;QACxE,KAAK,CAAC,MAAM,CAAC,CAAA;QAEb,KAAK,MAAM,GAAG,IAAI;YAChB,aAAa;YACb,MAAM;YACN,UAAU;YACV,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,QAAQ;SACA;YACR,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS;gBAC9B,IAAI,CAAC,SAAqC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAA;QAEtE,wFAAwF;QACxF,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAA;QAE1F;;;;;;WAMG;QACH,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;YAE5C,IAAI,QAAQ,KAAK,SAAS;gBAAE,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CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;KACxE,CAAA;IAED,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS;QAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAgB,CAAA;IAEvD,OAAO,UAAU,CAAC,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,KAAK,KAAK,WAAW;QACrE,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,mFAAmF;AACnF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAA;AAEnE,6FAA6F;AAC7F,SAAS,KAAK,CAAC,MAAqC;IAClD,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;AACpF,CAAC;AAED,gFAAgF;AAChF,MAAM,QAAQ,GAAG,oCAAoC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const query = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
properties: {
|
|
4
|
+
id: { type: 'string' },
|
|
5
|
+
ids: { type: 'array', uniqueItems: true, minItems: 1, items: { type: 'string' } },
|
|
6
|
+
version: { type: 'integer', minimum: 0 },
|
|
7
|
+
criteria: { type: 'string' },
|
|
8
|
+
search: { type: 'string' },
|
|
9
|
+
sample: { type: 'number' },
|
|
10
|
+
omit: { type: 'integer', minimum: 0 },
|
|
11
|
+
limit: { type: 'integer', minimum: 0 },
|
|
12
|
+
sort: {
|
|
13
|
+
type: 'array',
|
|
14
|
+
uniqueItems: true,
|
|
15
|
+
minItems: 1,
|
|
16
|
+
items: { type: 'string', pattern: '^\\w{1,32}(?::(?:asc|desc))?$' }
|
|
17
|
+
},
|
|
18
|
+
projection: {
|
|
19
|
+
type: 'array',
|
|
20
|
+
uniqueItems: true,
|
|
21
|
+
minItems: 1,
|
|
22
|
+
items: { type: 'string', not: { const: 'id' } }
|
|
23
|
+
},
|
|
24
|
+
deleted: { type: 'boolean' },
|
|
25
|
+
token: { type: 'string', minLength: 1 },
|
|
26
|
+
stop: { type: 'boolean' }
|
|
27
|
+
},
|
|
28
|
+
additionalProperties: false
|
|
29
|
+
};
|
|
30
|
+
export const error = {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
code: { anyOf: [{ type: 'integer' }, { type: 'string' }] },
|
|
34
|
+
message: { type: 'string' }
|
|
35
|
+
},
|
|
36
|
+
required: ['code']
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../source/contract/schemas.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,KAAK,GAAe;IAC/B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACjF,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;QACxC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;QACrC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;QACtC,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,+BAA+B,EAAE;SACpE;QACD,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;SAChD;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACvC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC1B;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAe;IAC/B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE;QAC1D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;IACD,QAAQ,EAAE,CAAC,MAAM,CAAC;CACnB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Entity } from './request.ts';
|
|
2
|
+
import type { JSONSchema } from './schemas.ts';
|
|
3
|
+
/**
|
|
4
|
+
* What the root prototype gives every entity, as `runtime/prototype/manifest.toa.yaml` declares
|
|
5
|
+
* it. Held here because a contract is read where that package is not — a gateway reads one of a
|
|
6
|
+
* component it does not have — and kept the same as the prototype by a test in `@toa.io/norm`,
|
|
7
|
+
* which has both.
|
|
8
|
+
*
|
|
9
|
+
* `id` is apart from the rest: a component may declare its own, and the rest it may not.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ID: JSONSchema;
|
|
12
|
+
export declare const SYSTEM: Record<string, JSONSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Whether one declaration is the other. Compared as written rather than by walking it: a
|
|
15
|
+
* component cannot have written a system property itself — a manifest that redeclares one is
|
|
16
|
+
* refused — so what is there came from the prototype and is identical to it. A comparison that
|
|
17
|
+
* says no costs the property being written out, and nothing else.
|
|
18
|
+
*/
|
|
19
|
+
export declare function same(one: unknown, other: unknown): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The entity without what the runtime gives it, saying that it did. An entity a component
|
|
22
|
+
* declares itself — one whose prototype is `null` — may give four of them, or five, or the same
|
|
23
|
+
* names with other schemas, so it is stated as it stands and says nothing.
|
|
24
|
+
*/
|
|
25
|
+
export declare function pack(entity: Entity): Entity;
|
|
26
|
+
/**
|
|
27
|
+
* The entity as the component declared it, which is what anything reading one is given.
|
|
28
|
+
*
|
|
29
|
+
* What is put back is a copy of it. An entity's schemas were its own before a contract left any
|
|
30
|
+
* of them out, and whoever holds one edits it — a route takes a property out of what it
|
|
31
|
+
* describes — so two components sharing one object is not a thing to start doing here.
|
|
32
|
+
*/
|
|
33
|
+
export declare function unpack(entity: Entity): Entity;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the root prototype gives every entity, as `runtime/prototype/manifest.toa.yaml` declares
|
|
3
|
+
* it. Held here because a contract is read where that package is not — a gateway reads one of a
|
|
4
|
+
* component it does not have — and kept the same as the prototype by a test in `@toa.io/norm`,
|
|
5
|
+
* which has both.
|
|
6
|
+
*
|
|
7
|
+
* `id` is apart from the rest: a component may declare its own, and the rest it may not.
|
|
8
|
+
*/
|
|
9
|
+
export const ID = { type: 'string', pattern: '^[a-fA-F0-9]{32}$' };
|
|
10
|
+
export const SYSTEM = {
|
|
11
|
+
VERSION: { type: 'integer', minimum: 0 },
|
|
12
|
+
CREATED: { type: 'integer', format: 'epoch-millis' },
|
|
13
|
+
UPDATED: { type: 'integer', format: 'epoch-millis' },
|
|
14
|
+
DELETED: { type: 'integer', format: 'epoch-millis', nullable: true },
|
|
15
|
+
REGION: { type: 'integer', minimum: 0 }
|
|
16
|
+
};
|
|
17
|
+
/** What the prototype requires, which is every property it gives. */
|
|
18
|
+
const REQUIRED = ['id', ...Object.keys(SYSTEM)];
|
|
19
|
+
/**
|
|
20
|
+
* Whether one declaration is the other. Compared as written rather than by walking it: a
|
|
21
|
+
* component cannot have written a system property itself — a manifest that redeclares one is
|
|
22
|
+
* refused — so what is there came from the prototype and is identical to it. A comparison that
|
|
23
|
+
* says no costs the property being written out, and nothing else.
|
|
24
|
+
*/
|
|
25
|
+
export function same(one, other) {
|
|
26
|
+
return JSON.stringify(one) === JSON.stringify(other);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The entity without what the runtime gives it, saying that it did. An entity a component
|
|
30
|
+
* declares itself — one whose prototype is `null` — may give four of them, or five, or the same
|
|
31
|
+
* names with other schemas, so it is stated as it stands and says nothing.
|
|
32
|
+
*/
|
|
33
|
+
export function pack(entity) {
|
|
34
|
+
if (!given(entity))
|
|
35
|
+
return entity;
|
|
36
|
+
const properties = {};
|
|
37
|
+
for (const [name, property] of Object.entries(entity.properties))
|
|
38
|
+
if (!(name in SYSTEM) && !(name === 'id' && same(property, ID)))
|
|
39
|
+
properties[name] = property;
|
|
40
|
+
const required = (entity.required ?? []).filter((name) => !REQUIRED.includes(name));
|
|
41
|
+
return {
|
|
42
|
+
properties,
|
|
43
|
+
...(required.length === 0 ? {} : { required }),
|
|
44
|
+
system: true
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The entity as the component declared it, which is what anything reading one is given.
|
|
49
|
+
*
|
|
50
|
+
* What is put back is a copy of it. An entity's schemas were its own before a contract left any
|
|
51
|
+
* of them out, and whoever holds one edits it — a route takes a property out of what it
|
|
52
|
+
* describes — so two components sharing one object is not a thing to start doing here.
|
|
53
|
+
*/
|
|
54
|
+
export function unpack(entity) {
|
|
55
|
+
if (entity.system !== true)
|
|
56
|
+
return entity;
|
|
57
|
+
const declared = {
|
|
58
|
+
...entity,
|
|
59
|
+
properties: {
|
|
60
|
+
...entity.properties,
|
|
61
|
+
...(entity.properties.id === undefined ? { id: structuredClone(ID) } : {}),
|
|
62
|
+
...structuredClone(SYSTEM)
|
|
63
|
+
},
|
|
64
|
+
required: [...(entity.required ?? []), ...REQUIRED]
|
|
65
|
+
};
|
|
66
|
+
delete declared.system;
|
|
67
|
+
return declared;
|
|
68
|
+
}
|
|
69
|
+
/** Whether what the prototype gives is what this entity carries, which is what may be left out. */
|
|
70
|
+
function given(entity) {
|
|
71
|
+
for (const [name, property] of Object.entries(SYSTEM))
|
|
72
|
+
if (!same(entity.properties[name], property))
|
|
73
|
+
return false;
|
|
74
|
+
return REQUIRED.every((name) => entity.required?.includes(name) === true);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../source/contract/system.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,EAAE,GAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAE9E,MAAM,CAAC,MAAM,MAAM,GAA+B;IAChD,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;IACxC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE;IACpD,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE;IACpD,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;IACpE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OA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AM,CAAA;IAEzC,MAAM,QAAQ,GAAW;QACvB,GAAG,MAAM;QACT,UAAU,EAAE;YACV,GAAG,MAAM,CAAC,UAAU;YACpB,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1E,GAAG,eAAe,CAAC,MAAM,CAAC;SAC3B;QACD,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC;KACpD,CAAA;IAED,OAAO,QAAQ,CAAC,MAAM,CAAA;IAEtB,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,mGAAmG;AACnG,SAAS,KAAK,CAAC,MAAc;IAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QACnD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;YAAE,OAAO,KAAK,CAAA;IAE5D,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAA;AAC3E,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The messages this process has taken and not yet finished with.
|
|
3
|
+
*
|
|
4
|
+
* A binding counts one in for as long as it holds a delivery, and that is exactly what its own
|
|
5
|
+
* teardown waits for: a connection cannot close while a message it dispatched is still being
|
|
6
|
+
* handled, and a handler waiting on a call of its own holds it there. So this answers, for the
|
|
7
|
+
* process as a whole, whether a teardown has anything left to wait on.
|
|
8
|
+
*
|
|
9
|
+
* It is not `toa.call.inflight`, which counts the other side — callers waiting. That number is
|
|
10
|
+
* non-zero for a call a gateway made, which blocks no teardown, and zero for a handler held open
|
|
11
|
+
* by a database commit, which blocks one.
|
|
12
|
+
*
|
|
13
|
+
* Ambient, like the instance name and the invocation chain, and for the same reason: a process
|
|
14
|
+
* may carry two copies of this module, and a count kept in one of them answers for half a
|
|
15
|
+
* process.
|
|
16
|
+
*/
|
|
17
|
+
/** One more delivery is being handled. */
|
|
18
|
+
export declare function taken(): void;
|
|
19
|
+
/** One fewer: the handler has returned, however it returned. */
|
|
20
|
+
export declare function done(): void;
|
|
21
|
+
/** How many this process is handling now. */
|
|
22
|
+
export declare function inflight(): number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The messages this process has taken and not yet finished with.
|
|
3
|
+
*
|
|
4
|
+
* A binding counts one in for as long as it holds a delivery, and that is exactly what its own
|
|
5
|
+
* teardown waits for: a connection cannot close while a message it dispatched is still being
|
|
6
|
+
* handled, and a handler waiting on a call of its own holds it there. So this answers, for the
|
|
7
|
+
* process as a whole, whether a teardown has anything left to wait on.
|
|
8
|
+
*
|
|
9
|
+
* It is not `toa.call.inflight`, which counts the other side — callers waiting. That number is
|
|
10
|
+
* non-zero for a call a gateway made, which blocks no teardown, and zero for a handler held open
|
|
11
|
+
* by a database commit, which blocks one.
|
|
12
|
+
*
|
|
13
|
+
* Ambient, like the instance name and the invocation chain, and for the same reason: a process
|
|
14
|
+
* may carry two copies of this module, and a count kept in one of them answers for half a
|
|
15
|
+
* process.
|
|
16
|
+
*/
|
|
17
|
+
const KEY = Symbol.for('toa.core.deliveries');
|
|
18
|
+
const store = (globalThis[KEY] ??= { count: 0 });
|
|
19
|
+
/** One more delivery is being handled. */
|
|
20
|
+
export function taken() {
|
|
21
|
+
store.count++;
|
|
22
|
+
}
|
|
23
|
+
/** One fewer: the handler has returned, however it returned. */
|
|
24
|
+
export function done() {
|
|
25
|
+
store.count--;
|
|
26
|
+
}
|
|
27
|
+
/** How many this process is handling now. */
|
|
28
|
+
export function inflight() {
|
|
29
|
+
return store.count;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=deliveries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deliveries.js","sourceRoot":"","sources":["../source/deliveries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAI7C,MAAM,KAAK,GAAG,CAAE,UAAoB,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;AAE3D,0CAA0C;AAC1C,MAAM,UAAU,KAAK;IACnB,KAAK,CAAC,KAAK,EAAE,CAAA;AACf,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,IAAI;IAClB,KAAK,CAAC,KAAK,EAAE,CAAA;AACf,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,QAAQ;IACtB,OAAO,KAAK,CAAC,KAAK,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Observation } from './observation.ts';
|
|
2
|
+
import type { Store } from './operation.ts';
|
|
3
|
+
export declare class Effect extends Observation {
|
|
4
|
+
/** an effect reads for what it does next, which a projected read would leave short */
|
|
5
|
+
protected projects: boolean;
|
|
6
|
+
protected acquire(store: Store): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Observation } from './observation.js';
|
|
2
|
+
export class Effect extends Observation {
|
|
3
|
+
/** an effect reads for what it does next, which a projected read would leave short */
|
|
4
|
+
projects = false;
|
|
5
|
+
async acquire(store) {
|
|
6
|
+
const { query, entity, input } = store.request;
|
|
7
|
+
if (entity === undefined)
|
|
8
|
+
return super.acquire(store);
|
|
9
|
+
store.scope = await this.scope.ensure(query, entity, input);
|
|
10
|
+
store.state = store.scope.get();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=effect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.js","sourceRoot":"","sources":["../source/effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC,sFAAsF;IACnE,QAAQ,GAAY,KAAK,CAAA;IAEzB,KAAK,CAAC,OAAO,CAAC,KAAY;QAC3C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAA;QAE9C,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAErD,KAAK,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAClE,KAAK,CAAC,KAAK,GAAI,KAAK,CAAC,KAAgB,CAAC,GAAG,EAAE,CAAA;IAC7C,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Connector } from './connector.ts';
|
|
2
|
+
import type { Event } from './event.ts';
|
|
3
|
+
import type { Row } from './types/outbox.ts';
|
|
4
|
+
export declare class Emission extends Connector {
|
|
5
|
+
#private;
|
|
6
|
+
/** what a row is outstanding for while this has not published it */
|
|
7
|
+
readonly name = "events";
|
|
8
|
+
constructor(events: Event[]);
|
|
9
|
+
emit(row: Row): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Connector } from './connector.js';
|
|
2
|
+
export class Emission extends Connector {
|
|
3
|
+
/** what a row is outstanding for while this has not published it */
|
|
4
|
+
name = 'events';
|
|
5
|
+
#events;
|
|
6
|
+
constructor(events) {
|
|
7
|
+
super();
|
|
8
|
+
this.#events = events;
|
|
9
|
+
this.depends(events);
|
|
10
|
+
}
|
|
11
|
+
async emit(row) {
|
|
12
|
+
const emission = this.#events.map((e) => e.emit(row));
|
|
13
|
+
await Promise.all(emission);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=emission.js.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An output a component encoded, which its caller passes on as it is: the bytes of what the
|
|
3
|
+
* operation answered, and what they are encoded in. A caller that writes them somewhere — the
|
|
4
|
+
* gateway writing a response body — spends nothing on reading them.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Encoded {
|
|
7
|
+
readonly bytes: Buffer;
|
|
8
|
+
readonly type: string;
|
|
9
|
+
constructor(bytes: Buffer, type?: string);
|
|
10
|
+
/**
|
|
11
|
+
* Whether a value is an `Encoded`, whichever copy of this package made it. A process may load
|
|
12
|
+
* the package more than once — the gateway image installs it beside the runtime and again beside
|
|
13
|
+
* the extension — and what one copy made is no instance of the other copy's class.
|
|
14
|
+
*/
|
|
15
|
+
static is(value: unknown): value is Encoded;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** What marks an `Encoded` in every copy of this package, which its class does not: see `is`. */
|
|
2
|
+
const KEY = Symbol.for('toa.core.encoded');
|
|
3
|
+
/**
|
|
4
|
+
* An output a component encoded, which its caller passes on as it is: the bytes of what the
|
|
5
|
+
* operation answered, and what they are encoded in. A caller that writes them somewhere — the
|
|
6
|
+
* gateway writing a response body — spends nothing on reading them.
|
|
7
|
+
*/
|
|
8
|
+
export class Encoded {
|
|
9
|
+
bytes;
|
|
10
|
+
type;
|
|
11
|
+
constructor(bytes, type = 'application/json') {
|
|
12
|
+
this.bytes = bytes;
|
|
13
|
+
this.type = type;
|
|
14
|
+
Object.defineProperty(this, KEY, { value: true });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Whether a value is an `Encoded`, whichever copy of this package made it. A process may load
|
|
18
|
+
* the package more than once — the gateway image installs it beside the runtime and again beside
|
|
19
|
+
* the extension — and what one copy made is no instance of the other copy's class.
|
|
20
|
+
*/
|
|
21
|
+
static is(value) {
|
|
22
|
+
return typeof value === 'object' && value !== null && KEY in value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=encoded.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoded.js","sourceRoot":"","sources":["../source/encoded.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAE1C;;;;GAIG;AACH,MAAM,OAAO,OAAO;IACF,KAAK,CAAQ;IACb,IAAI,CAAQ;IAE5B,YAAmB,KAAa,EAAE,IAAI,GAAW,kBAAkB;QACjE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACnD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,EAAE,CAAC,KAAc;QAC7B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,CAAA;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Schema } from '@toa.io/schemas';
|
|
2
|
+
import type { Query, Record } from '../types/storages.ts';
|
|
3
|
+
export declare class Changeset {
|
|
4
|
+
#private;
|
|
5
|
+
readonly query: Query;
|
|
6
|
+
constructor(schema: Schema, query: Query);
|
|
7
|
+
get(): object;
|
|
8
|
+
set(value: Record): void;
|
|
9
|
+
export(): object;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EntityContractException } from '../exceptions.js';
|
|
2
|
+
export class Changeset {
|
|
3
|
+
query;
|
|
4
|
+
/** the changeset schema: the entity's properties, none of them required */
|
|
5
|
+
#schema;
|
|
6
|
+
#state;
|
|
7
|
+
constructor(schema, query) {
|
|
8
|
+
this.query = query;
|
|
9
|
+
this.#schema = schema;
|
|
10
|
+
this.#state = {};
|
|
11
|
+
}
|
|
12
|
+
get() {
|
|
13
|
+
return this.#state;
|
|
14
|
+
}
|
|
15
|
+
set(value) {
|
|
16
|
+
const error = this.#schema.fit(value);
|
|
17
|
+
if (error !== null)
|
|
18
|
+
throw new EntityContractException(error, value);
|
|
19
|
+
delete value.VERSION;
|
|
20
|
+
value.UPDATED = Date.now();
|
|
21
|
+
this.#state = value;
|
|
22
|
+
}
|
|
23
|
+
export() {
|
|
24
|
+
return this.#state;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=changeset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeset.js","sourceRoot":"","sources":["../../source/entities/changeset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAI1D,MAAM,OAAO,SAAS;IACJ,KAAK,CAAO;IAE5B,2EAA2E;IAClE,OAAO,CAAQ;IACxB,MAAM,CAAiB;IAEvB,YAAmB,MAAc,EAAE,KAAY;QAC7C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAElB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;IAClB,CAAC;IAEM,GAAG;QACR,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAEM,GAAG,CAAC,KAAa;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAErC,IAAI,KAAK,KAAK,IAAI;YAAE,MAAM,IAAI,uBAAuB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QAEnE,OAAQ,KAAyB,CAAC,OAAO,CAAA;QACzC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAE1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Schema } from '@toa.io/schemas';
|
|
2
|
+
import type { Guard } from '../guard.ts';
|
|
3
|
+
import type { Record } from '../types/storages.ts';
|
|
4
|
+
import type { Event } from '../types/state.ts';
|
|
5
|
+
export declare class Entity {
|
|
6
|
+
#private;
|
|
7
|
+
deleted: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* A record makes an entity of what a storage holds; a string, or nothing at all, makes a
|
|
10
|
+
* blank one under that identity, out of what the component declared a record starts as.
|
|
11
|
+
*
|
|
12
|
+
* @param blank what the component declares a record holds before anything is written to it
|
|
13
|
+
* @param mutable whether the entity may be modified and committed
|
|
14
|
+
*/
|
|
15
|
+
constructor(schema: Schema, blank: object, argument?: Record | string, guards?: Guard[], mutable?: boolean);
|
|
16
|
+
get(): Record;
|
|
17
|
+
set(value: Record): void;
|
|
18
|
+
event(input?: object): Event;
|
|
19
|
+
}
|