@toa.io/extensions.cadence 1.0.0-alpha.291 → 1.0.0-alpha.293
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 +15 -6
- package/transpiled/Dispatcher.js +5 -2
- package/transpiled/Dispatcher.js.map +1 -1
- package/transpiled/Factory.js +1 -1
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/index.d.ts +2 -5
- package/transpiled/index.js +2 -4
- package/transpiled/index.js.map +1 -1
- package/CHANGELOG.md +0 -37
- package/schemas/annotation.cos.yaml +0 -9
- package/schemas/declaration.cos.yaml +0 -20
- package/source/Aspect.ts +0 -73
- package/source/Composition.ts +0 -47
- package/source/Dispatcher.test.ts +0 -479
- package/source/Dispatcher.ts +0 -334
- package/source/Factory.ts +0 -76
- package/source/Local.ts +0 -40
- package/source/Pulse.test.ts +0 -303
- package/source/Pulse.ts +0 -211
- package/source/const.ts +0 -31
- package/source/context.ts +0 -10
- package/source/deployment.ts +0 -38
- package/source/index.ts +0 -8
- package/source/manifest.test.ts +0 -61
- package/source/manifest.ts +0 -64
- package/source/schemas.ts +0 -10
- package/source/types.ts +0 -41
- package/transpiled/const.d.ts +0 -21
- package/transpiled/const.js +0 -26
- package/transpiled/const.js.map +0 -1
- package/transpiled/context.d.ts +0 -3
- package/transpiled/context.js +0 -9
- package/transpiled/context.js.map +0 -1
- package/transpiled/deployment.d.ts +0 -9
- package/transpiled/deployment.js +0 -29
- package/transpiled/deployment.js.map +0 -1
- package/transpiled/manifest.d.ts +0 -11
- package/transpiled/manifest.js +0 -42
- package/transpiled/manifest.js.map +0 -1
- package/transpiled/schemas.d.ts +0 -4
- package/transpiled/schemas.js +0 -7
- package/transpiled/schemas.js.map +0 -1
- package/transpiled/types.d.ts +0 -34
- package/transpiled/types.js +0 -2
- package/transpiled/types.js.map +0 -1
- package/tsconfig.json +0 -13
- package/tsconfig.tsbuildinfo +0 -1
package/source/manifest.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as schemas from './schemas.js'
|
|
2
|
-
import type { Declaration } from './types.js'
|
|
3
|
-
import type { Manifest } from '@toa.io/norm'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The `cadence:` block of a component manifest: the operations called on a cadence, by the
|
|
7
|
-
* operation each one calls. Norm hands over the whole manifest, so what the declaration refers
|
|
8
|
-
* to is checked here rather than left to fail at boot.
|
|
9
|
-
*
|
|
10
|
-
* A component that declares nothing still has a declaration. `cadence: ~` is how one that only
|
|
11
|
-
* delays calls says so, and it has to produce a value or norm rejects the extension.
|
|
12
|
-
*/
|
|
13
|
-
export function manifest(
|
|
14
|
-
declaration: Declaration | null | undefined,
|
|
15
|
-
component: Manifest
|
|
16
|
-
): Declaration {
|
|
17
|
-
const normalized: Record<string, unknown> = expand(declaration)
|
|
18
|
-
|
|
19
|
-
schemas.declaration.validate<Declaration>(normalized, 'Invalid cadence declaration')
|
|
20
|
-
|
|
21
|
-
for (const [endpoint, pulse] of Object.entries(normalized)) {
|
|
22
|
-
const operation = component.operations?.[endpoint]
|
|
23
|
-
|
|
24
|
-
if (operation === undefined)
|
|
25
|
-
throw new Error(`Pulse refers to undefined operation '${endpoint}'`)
|
|
26
|
-
|
|
27
|
-
if (!TYPES.has(operation.type))
|
|
28
|
-
throw new Error(
|
|
29
|
-
`Pulse '${endpoint}' must refer to an operation of the allowed types: ` +
|
|
30
|
-
[...TYPES].join(', ')
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
if (pulse.intervals > pulse.cycle)
|
|
34
|
-
throw new Error(
|
|
35
|
-
`Pulse '${endpoint}' splits a cycle of ${pulse.cycle} seconds into ` +
|
|
36
|
-
`${pulse.intervals} intervals, which is less than a second each`
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return normalized
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** A pulse whose cycle is not split has nothing to state but the cycle. */
|
|
44
|
-
function expand(declaration: Declaration | null | undefined): Record<string, unknown> {
|
|
45
|
-
if (declaration === null || declaration === undefined) return {}
|
|
46
|
-
|
|
47
|
-
// a cycle nothing splits is one interval, which is what the shorthand declares
|
|
48
|
-
return Object.fromEntries(
|
|
49
|
-
Object.entries(declaration).map(([endpoint, pulse]) => {
|
|
50
|
-
const declared: Record<string, unknown> =
|
|
51
|
-
typeof pulse === 'number' ? { cycle: pulse } : { ...pulse }
|
|
52
|
-
|
|
53
|
-
declared.intervals ??= 1
|
|
54
|
-
|
|
55
|
-
return [endpoint, declared]
|
|
56
|
-
})
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The types a receiver may refer to. An operation that produces no side effects has nothing to
|
|
62
|
-
* be called periodically for.
|
|
63
|
-
*/
|
|
64
|
-
const TYPES = new Set(['transition', 'assignment', 'effect', 'unmanaged'])
|
package/source/schemas.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path'
|
|
2
|
-
import * as schemas from '@toa.io/schemas'
|
|
3
|
-
import type { Schema } from '@toa.io/schemas'
|
|
4
|
-
import type { Annotation, Declaration } from './types.js'
|
|
5
|
-
|
|
6
|
-
const path = resolve(import.meta.dirname, '../schemas')
|
|
7
|
-
const namespace = schemas.namespace(path)
|
|
8
|
-
|
|
9
|
-
export const declaration: Schema<Declaration> = namespace.schema('declaration')
|
|
10
|
-
export const annotation: Schema<Annotation> = namespace.schema('annotation')
|
package/source/types.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** What one component declares under `cadence:`, by the operation each one calls. */
|
|
2
|
-
export type Declaration = Record<string, Pulse>
|
|
3
|
-
|
|
4
|
-
export interface Pulse {
|
|
5
|
-
/** seconds one whole cycle takes */
|
|
6
|
-
cycle: number
|
|
7
|
-
|
|
8
|
-
/** intervals the cycle is split into; the gap between calls is `cycle / intervals` */
|
|
9
|
-
intervals: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** `context.delay` — a call to be made later, answering the id that cancels it. */
|
|
13
|
-
export interface Delay {
|
|
14
|
-
(endpoint: string, request: object | null, options: Options): Promise<string>
|
|
15
|
-
|
|
16
|
-
/** Raises where the id was never issued. */
|
|
17
|
-
cancel: (id: string) => Promise<void>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface Options {
|
|
21
|
-
/** milliseconds from now */
|
|
22
|
-
interval: number
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Milliseconds the call may be late and still be made, or `null` for no bound at all.
|
|
26
|
-
*
|
|
27
|
-
* Stated rather than defaulted, because only the caller knows whether a late call is still
|
|
28
|
-
* the right call: an unpaid order expires on time or not at all, and a report is wanted
|
|
29
|
-
* whenever it can be had. Nothing else in the system can tell those apart.
|
|
30
|
-
*
|
|
31
|
-
* An upper bound on lateness, not a promise of timeliness. It is bounded below by how often
|
|
32
|
-
* a dispatcher scans, so a bound shorter than that is one nothing can honour.
|
|
33
|
-
*/
|
|
34
|
-
overdue: number | null
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** What an application states under `cadence:` in its context. */
|
|
38
|
-
export interface Annotation {
|
|
39
|
-
/** seconds between passes over the calls waiting to be made */
|
|
40
|
-
discreteness?: number
|
|
41
|
-
}
|
package/transpiled/const.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** The component the extension ships to hold delayed calls. */
|
|
2
|
-
export declare const NAMESPACE = "cadence";
|
|
3
|
-
export declare const COMPONENT = "metronome";
|
|
4
|
-
/**
|
|
5
|
-
* Constant, never configuration: a row carries its lane, so lowering this would leave rows in
|
|
6
|
-
* lanes nobody reads any more. It is also the ceiling on replicas dispatching, and a power of
|
|
7
|
-
* two so that the common replica counts divide evenly. The outbox says the same of its own.
|
|
8
|
-
*
|
|
9
|
-
* A scan asks for its lanes as a set and sorts on `due`, which is the index's second key, so
|
|
10
|
-
* the plan that serves it explodes the set into one scan per lane and merges them in order.
|
|
11
|
-
* MongoDB stops exploding past `internalQueryMaxScansToExplode`, 200 by default, and falls
|
|
12
|
-
* back to sorting the whole result in memory — so this staying well under that is not
|
|
13
|
-
* incidental.
|
|
14
|
-
*/
|
|
15
|
-
export declare const LANES = 128;
|
|
16
|
-
/** seconds between passes over the calls waiting to be made, and how far ahead each reaches */
|
|
17
|
-
export declare const DISCRETENESS = 60;
|
|
18
|
-
/** rows one scan brings back */
|
|
19
|
-
export declare const BATCH = 200;
|
|
20
|
-
/** A number from the environment, where a deployment or a test suite states one. */
|
|
21
|
-
export declare function number(variable: string, fallback: number): number;
|
package/transpiled/const.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { environment } from '@toa.io/generic';
|
|
2
|
-
/** The component the extension ships to hold delayed calls. */
|
|
3
|
-
export const NAMESPACE = 'cadence';
|
|
4
|
-
export const COMPONENT = 'metronome';
|
|
5
|
-
/**
|
|
6
|
-
* Constant, never configuration: a row carries its lane, so lowering this would leave rows in
|
|
7
|
-
* lanes nobody reads any more. It is also the ceiling on replicas dispatching, and a power of
|
|
8
|
-
* two so that the common replica counts divide evenly. The outbox says the same of its own.
|
|
9
|
-
*
|
|
10
|
-
* A scan asks for its lanes as a set and sorts on `due`, which is the index's second key, so
|
|
11
|
-
* the plan that serves it explodes the set into one scan per lane and merges them in order.
|
|
12
|
-
* MongoDB stops exploding past `internalQueryMaxScansToExplode`, 200 by default, and falls
|
|
13
|
-
* back to sorting the whole result in memory — so this staying well under that is not
|
|
14
|
-
* incidental.
|
|
15
|
-
*/
|
|
16
|
-
export const LANES = 128;
|
|
17
|
-
/** seconds between passes over the calls waiting to be made, and how far ahead each reaches */
|
|
18
|
-
export const DISCRETENESS = 60;
|
|
19
|
-
/** rows one scan brings back */
|
|
20
|
-
export const BATCH = 200;
|
|
21
|
-
/** A number from the environment, where a deployment or a test suite states one. */
|
|
22
|
-
export function number(variable, fallback) {
|
|
23
|
-
const value = Number(environment.get(variable));
|
|
24
|
-
return Number.isNaN(value) || value <= 0 ? fallback : value;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=const.js.map
|
package/transpiled/const.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../source/const.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAA;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAA;AAE9B,gCAAgC;AAChC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB,oFAAoF;AACpF,MAAM,UAAU,MAAM,CAAC,QAAgB,EAAE,QAAgB;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE/C,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7D,CAAC"}
|
package/transpiled/context.d.ts
DELETED
package/transpiled/context.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../source/context.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,UAAU,OAAO;IACrB,OAAO;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,EAAE,4BAA4B,EAAE,CAAC,OAAO,CAAC,EAAE;KACrD,CAAA;AACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Annotation } from './types.js';
|
|
2
|
-
import type { Dependency } from '@toa.io/operations';
|
|
3
|
-
/**
|
|
4
|
-
* The component that keeps delayed calls runs in a service of its own, the way the identity
|
|
5
|
-
* components run in the gateway. A composition may claim it and run it in its own pods instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare function deployment(_: unknown, annotation?: Annotation | null): Dependency;
|
|
8
|
-
/** The extension is deployed for the sake of `delay`, which nothing has to declare to use. */
|
|
9
|
-
export declare const standalone = true;
|
package/transpiled/deployment.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { components } from './Composition.js';
|
|
3
|
-
import { DISCRETENESS, NAMESPACE } from './const.js';
|
|
4
|
-
import * as schemas from './schemas.js';
|
|
5
|
-
/**
|
|
6
|
-
* The component that keeps delayed calls runs in a service of its own, the way the identity
|
|
7
|
-
* components run in the gateway. A composition may claim it and run it in its own pods instead.
|
|
8
|
-
*/
|
|
9
|
-
export function deployment(_, annotation) {
|
|
10
|
-
schemas.annotation.validate(annotation ?? null, 'Invalid cadence annotation');
|
|
11
|
-
// stated in seconds and carried in milliseconds, so that what an application writes is what
|
|
12
|
-
// the rest of a manifest is written in
|
|
13
|
-
const discreteness = (annotation?.discreteness ?? DISCRETENESS) * 1000;
|
|
14
|
-
const variables = [
|
|
15
|
-
{ name: 'TOA_CADENCE_DISCRETENESS', value: String(discreteness) }
|
|
16
|
-
];
|
|
17
|
-
const service = {
|
|
18
|
-
group: NAMESPACE,
|
|
19
|
-
name: 'metronome',
|
|
20
|
-
version: JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'))
|
|
21
|
-
.version,
|
|
22
|
-
components: components().labels,
|
|
23
|
-
variables
|
|
24
|
-
};
|
|
25
|
-
return { services: [service] };
|
|
26
|
-
}
|
|
27
|
-
/** The extension is deployed for the sake of `delay`, which nothing has to declare to use. */
|
|
28
|
-
export const standalone = true;
|
|
29
|
-
//# sourceMappingURL=deployment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../source/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAIvC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,UAA8B;IACnE,OAAO,CAAC,UAAU,CAAC,QAAQ,CACzB,UAAU,IAAI,IAAI,EAClB,4BAA4B,CAC7B,CAAA;IAED,4FAA4F;IAC5F,uCAAuC;IACvC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,YAAY,IAAI,YAAY,CAAC,GAAG,IAAI,CAAA;IACtE,MAAM,SAAS,GAAe;QAC5B,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;KAClE,CAAA;IAED,MAAM,OAAO,GAAY;QACvB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;aACnF,OAAO;QACV,UAAU,EAAE,UAAU,EAAE,CAAC,MAAM;QAC/B,SAAS;KACV,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAA;AAChC,CAAC;AAED,8FAA8F;AAC9F,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA"}
|
package/transpiled/manifest.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Declaration } from './types.js';
|
|
2
|
-
import type { Manifest } from '@toa.io/norm';
|
|
3
|
-
/**
|
|
4
|
-
* The `cadence:` block of a component manifest: the operations called on a cadence, by the
|
|
5
|
-
* operation each one calls. Norm hands over the whole manifest, so what the declaration refers
|
|
6
|
-
* to is checked here rather than left to fail at boot.
|
|
7
|
-
*
|
|
8
|
-
* A component that declares nothing still has a declaration. `cadence: ~` is how one that only
|
|
9
|
-
* delays calls says so, and it has to produce a value or norm rejects the extension.
|
|
10
|
-
*/
|
|
11
|
-
export declare function manifest(declaration: Declaration | null | undefined, component: Manifest): Declaration;
|
package/transpiled/manifest.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as schemas from './schemas.js';
|
|
2
|
-
/**
|
|
3
|
-
* The `cadence:` block of a component manifest: the operations called on a cadence, by the
|
|
4
|
-
* operation each one calls. Norm hands over the whole manifest, so what the declaration refers
|
|
5
|
-
* to is checked here rather than left to fail at boot.
|
|
6
|
-
*
|
|
7
|
-
* A component that declares nothing still has a declaration. `cadence: ~` is how one that only
|
|
8
|
-
* delays calls says so, and it has to produce a value or norm rejects the extension.
|
|
9
|
-
*/
|
|
10
|
-
export function manifest(declaration, component) {
|
|
11
|
-
const normalized = expand(declaration);
|
|
12
|
-
schemas.declaration.validate(normalized, 'Invalid cadence declaration');
|
|
13
|
-
for (const [endpoint, pulse] of Object.entries(normalized)) {
|
|
14
|
-
const operation = component.operations?.[endpoint];
|
|
15
|
-
if (operation === undefined)
|
|
16
|
-
throw new Error(`Pulse refers to undefined operation '${endpoint}'`);
|
|
17
|
-
if (!TYPES.has(operation.type))
|
|
18
|
-
throw new Error(`Pulse '${endpoint}' must refer to an operation of the allowed types: ` +
|
|
19
|
-
[...TYPES].join(', '));
|
|
20
|
-
if (pulse.intervals > pulse.cycle)
|
|
21
|
-
throw new Error(`Pulse '${endpoint}' splits a cycle of ${pulse.cycle} seconds into ` +
|
|
22
|
-
`${pulse.intervals} intervals, which is less than a second each`);
|
|
23
|
-
}
|
|
24
|
-
return normalized;
|
|
25
|
-
}
|
|
26
|
-
/** A pulse whose cycle is not split has nothing to state but the cycle. */
|
|
27
|
-
function expand(declaration) {
|
|
28
|
-
if (declaration === null || declaration === undefined)
|
|
29
|
-
return {};
|
|
30
|
-
// a cycle nothing splits is one interval, which is what the shorthand declares
|
|
31
|
-
return Object.fromEntries(Object.entries(declaration).map(([endpoint, pulse]) => {
|
|
32
|
-
const declared = typeof pulse === 'number' ? { cycle: pulse } : { ...pulse };
|
|
33
|
-
declared.intervals ??= 1;
|
|
34
|
-
return [endpoint, declared];
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The types a receiver may refer to. An operation that produces no side effects has nothing to
|
|
39
|
-
* be called periodically for.
|
|
40
|
-
*/
|
|
41
|
-
const TYPES = new Set(['transition', 'assignment', 'effect', 'unmanaged']);
|
|
42
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../source/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAIvC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,WAA2C,EAC3C,SAAmB;IAEnB,MAAM,UAAU,GAA4B,MAAM,CAAC,WAAW,CAAC,CAAA;IAE/D,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAc,UAAU,EAAE,6BAA6B,CAAC,CAAA;IAEpF,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAA;QAElD,IAAI,SAAS,KAAK,SAAS;YACzB,MAAM,IAAI,KAAK,CAAC,wCAAwC,QAAQ,GAAG,CAAC,CAAA;QAEtE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,UAAU,QAAQ,qDAAqD;gBACrE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAA;QAEH,IAAI,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK;YAC/B,MAAM,IAAI,KAAK,CACb,UAAU,QAAQ,uBAAuB,KAAK,CAAC,KAAK,gBAAgB;gBAClE,GAAG,KAAK,CAAC,SAAS,8CAA8C,CACnE,CAAA;IACL,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,2EAA2E;AAC3E,SAAS,MAAM,CAAC,WAA2C;IACzD,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IAEhE,+EAA+E;IAC/E,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE;QACpD,MAAM,QAAQ,GACZ,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAA;QAE7D,QAAQ,CAAC,SAAS,KAAK,CAAC,CAAA;QAExB,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC7B,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA"}
|
package/transpiled/schemas.d.ts
DELETED
package/transpiled/schemas.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'node:path';
|
|
2
|
-
import * as schemas from '@toa.io/schemas';
|
|
3
|
-
const path = resolve(import.meta.dirname, '../schemas');
|
|
4
|
-
const namespace = schemas.namespace(path);
|
|
5
|
-
export const declaration = namespace.schema('declaration');
|
|
6
|
-
export const annotation = namespace.schema('annotation');
|
|
7
|
-
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../source/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAI1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;AACvD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAwB,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AAC/E,MAAM,CAAC,MAAM,UAAU,GAAuB,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA"}
|
package/transpiled/types.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** What one component declares under `cadence:`, by the operation each one calls. */
|
|
2
|
-
export type Declaration = Record<string, Pulse>;
|
|
3
|
-
export interface Pulse {
|
|
4
|
-
/** seconds one whole cycle takes */
|
|
5
|
-
cycle: number;
|
|
6
|
-
/** intervals the cycle is split into; the gap between calls is `cycle / intervals` */
|
|
7
|
-
intervals: number;
|
|
8
|
-
}
|
|
9
|
-
/** `context.delay` — a call to be made later, answering the id that cancels it. */
|
|
10
|
-
export interface Delay {
|
|
11
|
-
(endpoint: string, request: object | null, options: Options): Promise<string>;
|
|
12
|
-
/** Raises where the id was never issued. */
|
|
13
|
-
cancel: (id: string) => Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export interface Options {
|
|
16
|
-
/** milliseconds from now */
|
|
17
|
-
interval: number;
|
|
18
|
-
/**
|
|
19
|
-
* Milliseconds the call may be late and still be made, or `null` for no bound at all.
|
|
20
|
-
*
|
|
21
|
-
* Stated rather than defaulted, because only the caller knows whether a late call is still
|
|
22
|
-
* the right call: an unpaid order expires on time or not at all, and a report is wanted
|
|
23
|
-
* whenever it can be had. Nothing else in the system can tell those apart.
|
|
24
|
-
*
|
|
25
|
-
* An upper bound on lateness, not a promise of timeliness. It is bounded below by how often
|
|
26
|
-
* a dispatcher scans, so a bound shorter than that is one nothing can honour.
|
|
27
|
-
*/
|
|
28
|
-
overdue: number | null;
|
|
29
|
-
}
|
|
30
|
-
/** What an application states under `cadence:` in its context. */
|
|
31
|
-
export interface Annotation {
|
|
32
|
-
/** seconds between passes over the calls waiting to be made */
|
|
33
|
-
discreteness?: number;
|
|
34
|
-
}
|
package/transpiled/types.js
DELETED
package/transpiled/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../source/types.ts"],"names":[],"mappings":""}
|