@toa.io/extensions.introspection 1.0.0-alpha.262
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/CHANGELOG.md +61 -0
- package/components/introspection.edges/manifest.toa.yaml +48 -0
- package/components/introspection.edges/operations/lib/types.d.ts +28 -0
- package/components/introspection.edges/operations/lib/types.js +3 -0
- package/components/introspection.edges/operations/lib/types.js.map +1 -0
- package/components/introspection.edges/operations/merge.d.ts +9 -0
- package/components/introspection.edges/operations/merge.js +25 -0
- package/components/introspection.edges/operations/merge.js.map +1 -0
- package/components/introspection.edges/source/lib/types.ts +33 -0
- package/components/introspection.edges/source/merge.ts +26 -0
- package/components/introspection.edges/tsconfig.json +9 -0
- package/components/introspection.nodes/manifest.toa.yaml +49 -0
- package/components/introspection.nodes/operations/lib/types.d.ts +16 -0
- package/components/introspection.nodes/operations/lib/types.js +3 -0
- package/components/introspection.nodes/operations/lib/types.js.map +1 -0
- package/components/introspection.nodes/operations/merge.d.ts +9 -0
- package/components/introspection.nodes/operations/merge.js +21 -0
- package/components/introspection.nodes/operations/merge.js.map +1 -0
- package/components/introspection.nodes/source/lib/types.ts +18 -0
- package/components/introspection.nodes/source/merge.ts +21 -0
- package/components/introspection.nodes/tsconfig.json +9 -0
- package/cucumber.js +8 -0
- package/features/calls.feature +123 -0
- package/features/nodes.feature +70 -0
- package/features/samples.feature +75 -0
- package/features/shutdown.feature +37 -0
- package/features/site/_app/immutable/asset.js +1 -0
- package/features/site/index.html +6 -0
- package/features/steps/Map.ts +151 -0
- package/features/steps/UI.ts +88 -0
- package/features/steps/components/probe.discreet/manifest.toa.yaml +12 -0
- package/features/steps/components/probe.discreet/operations/ping.js +7 -0
- package/features/steps/components/probe.quiet/manifest.toa.yaml +11 -0
- package/features/steps/components/probe.quiet/operations/ping.js +7 -0
- package/features/steps/components/probe.source/manifest.toa.yaml +27 -0
- package/features/steps/components/probe.source/operations/crash.js +7 -0
- package/features/steps/components/probe.source/operations/fail.js +12 -0
- package/features/steps/components/probe.source/operations/relay.js +7 -0
- package/features/steps/components/probe.target/manifest.toa.yaml +24 -0
- package/features/steps/components/probe.target/operations/compute.js +7 -0
- package/features/steps/components/probe.target/operations/count.js +9 -0
- package/features/steps/config.ts +20 -0
- package/features/steps/tsconfig.json +9 -0
- package/features/ui.feature +85 -0
- package/package.json +31 -0
- package/readme.md +141 -0
- package/schemas/annotation.cos.yaml +16 -0
- package/schemas/declaration.cos.yaml +2 -0
- package/source/Composition.ts +61 -0
- package/source/Explorer.ts +16 -0
- package/source/Factory.ts +119 -0
- package/source/Reporter.ts +210 -0
- package/source/Tenant.ts +47 -0
- package/source/UI.ts +197 -0
- package/source/annotation.ts +83 -0
- package/source/const.ts +32 -0
- package/source/describe.ts +68 -0
- package/source/extension.ts +45 -0
- package/source/index.ts +7 -0
- package/source/keys.ts +0 -0
- package/source/manifest.ts +19 -0
- package/source/model.ts +82 -0
- package/source/sample.ts +49 -0
- package/source/schemas.ts +10 -0
- package/transpiled/Composition.d.ts +21 -0
- package/transpiled/Composition.js +48 -0
- package/transpiled/Composition.js.map +1 -0
- package/transpiled/Explorer.d.ts +9 -0
- package/transpiled/Explorer.js +19 -0
- package/transpiled/Explorer.js.map +1 -0
- package/transpiled/Factory.d.ts +22 -0
- package/transpiled/Factory.js +93 -0
- package/transpiled/Factory.js.map +1 -0
- package/transpiled/Reporter.d.ts +44 -0
- package/transpiled/Reporter.js +187 -0
- package/transpiled/Reporter.js.map +1 -0
- package/transpiled/Tenant.d.ts +18 -0
- package/transpiled/Tenant.js +40 -0
- package/transpiled/Tenant.js.map +1 -0
- package/transpiled/UI.d.ts +25 -0
- package/transpiled/UI.js +186 -0
- package/transpiled/UI.js.map +1 -0
- package/transpiled/annotation.d.ts +40 -0
- package/transpiled/annotation.js +46 -0
- package/transpiled/annotation.js.map +1 -0
- package/transpiled/const.d.ts +23 -0
- package/transpiled/const.js +27 -0
- package/transpiled/const.js.map +1 -0
- package/transpiled/contracts.d.ts +51 -0
- package/transpiled/contracts.js +53 -0
- package/transpiled/contracts.js.map +1 -0
- package/transpiled/describe.d.ts +9 -0
- package/transpiled/describe.js +64 -0
- package/transpiled/describe.js.map +1 -0
- package/transpiled/extension.d.ts +11 -0
- package/transpiled/extension.js +64 -0
- package/transpiled/extension.js.map +1 -0
- package/transpiled/index.d.ts +6 -0
- package/transpiled/index.js +25 -0
- package/transpiled/index.js.map +1 -0
- package/transpiled/keys.d.ts +9 -0
- package/transpiled/keys.js +0 -0
- package/transpiled/keys.js.map +1 -0
- package/transpiled/manifest.d.ts +9 -0
- package/transpiled/manifest.js +43 -0
- package/transpiled/manifest.js.map +1 -0
- package/transpiled/model.d.ts +71 -0
- package/transpiled/model.js +3 -0
- package/transpiled/model.js.map +1 -0
- package/transpiled/sample.d.ts +7 -0
- package/transpiled/sample.js +44 -0
- package/transpiled/sample.js.map +1 -0
- package/transpiled/schemas.d.ts +4 -0
- package/transpiled/schemas.js +13 -0
- package/transpiled/schemas.js.map +1 -0
- package/tsconfig.json +12 -0
- package/ui/dist/_app/env.js +1 -0
- package/ui/dist/_app/immutable/assets/0.fg2cP6bO.css +2 -0
- package/ui/dist/_app/immutable/assets/2.BghF56l_.css +1 -0
- package/ui/dist/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
- package/ui/dist/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
- package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/ui/dist/_app/immutable/chunks/CIvRtvVA.js +1 -0
- package/ui/dist/_app/immutable/chunks/D1jNriZ8.js +1 -0
- package/ui/dist/_app/immutable/chunks/DINmginf.js +1 -0
- package/ui/dist/_app/immutable/chunks/DKZCAkrF.js +1 -0
- package/ui/dist/_app/immutable/chunks/DLG2JvyF.js +6 -0
- package/ui/dist/_app/immutable/chunks/DSi-FjwI.js +2 -0
- package/ui/dist/_app/immutable/chunks/DdoZuyU1.js +1 -0
- package/ui/dist/_app/immutable/chunks/O9IjE_TH.js +1 -0
- package/ui/dist/_app/immutable/chunks/PUjOYRcs.js +3 -0
- package/ui/dist/_app/immutable/chunks/QKD4Mgck.js +5 -0
- package/ui/dist/_app/immutable/chunks/Ux-r8C9U.js +1 -0
- package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/ui/dist/_app/immutable/entry/app.CTY34L35.js +2 -0
- package/ui/dist/_app/immutable/entry/start.Bq2Gn1Ax.js +1 -0
- package/ui/dist/_app/immutable/nodes/0.lOXtBRjQ.js +1 -0
- package/ui/dist/_app/immutable/nodes/1.r8ESZdgM.js +1 -0
- package/ui/dist/_app/immutable/nodes/2.DuVj0loz.js +8 -0
- package/ui/dist/_app/immutable/nodes/3.DhdkQ2Q1.js +1 -0
- package/ui/dist/_app/immutable/nodes/4.DUAEZdRr.js +1 -0
- package/ui/dist/_app/immutable/nodes/5.CIVn_xgq.js +1 -0
- package/ui/dist/_app/version.json +1 -0
- package/ui/dist/index.html +48 -0
- package/ui/dist/robots.txt +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UI.js","sourceRoot":"","sources":["../source/UI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6B;AAC7B,gDAAiC;AACjC,gDAAiC;AACjC,uCAAwC;AACxC,uCAAkC;AAClC,mCAAiC;AAEjC;;;;;;GAMG;AACH,MAAa,EAAG,SAAQ,gBAAS;I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D,gBAkJC;AAED,SAAS,MAAM,CAAE,GAAW;IAC1B,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAE,IAAY;IAC3B,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;AAC1D,CAAC;AAED,mFAAmF;AACnF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AAExD,mEAAmE;AACnE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAChD,MAAM,OAAO,GAAG,qCAAqC,CAAA;AAErD,MAAM,KAAK,GAA2B;IACpC,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,0BAA0B;IACnC,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,gCAAgC;IACvC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,iCAAiC;IACzC,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,2BAA2B;IACnC,cAAc,EAAE,2BAA2B;IAC3C,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,YAAY;CACvB,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Resources } from '@toa.io/operations';
|
|
2
|
+
/** `context.toa.yaml` */
|
|
3
|
+
export type Annotation = false | {
|
|
4
|
+
/** Capture real payloads. Off by default: this is production data. */
|
|
5
|
+
samples?: boolean;
|
|
6
|
+
/** Flush period, seconds. */
|
|
7
|
+
interval?: number;
|
|
8
|
+
/** Flush as soon as this many distinct edges are buffered. */
|
|
9
|
+
threshold?: number;
|
|
10
|
+
/** Publish the UI. On by default. */
|
|
11
|
+
ui?: boolean;
|
|
12
|
+
resources?: Resources;
|
|
13
|
+
};
|
|
14
|
+
/** `manifest.toa.yaml` */
|
|
15
|
+
export type Declaration = false | {
|
|
16
|
+
samples?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/** What `deployment()` encodes into the environment. */
|
|
19
|
+
export interface Options {
|
|
20
|
+
samples: boolean;
|
|
21
|
+
interval: number;
|
|
22
|
+
threshold: number;
|
|
23
|
+
ui: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** The effective per-component decision. */
|
|
26
|
+
export interface Settings {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
samples: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const DISABLED: Settings;
|
|
31
|
+
export declare function options(annotation?: Annotation): Options;
|
|
32
|
+
/** Reads what `deployment()` has put into the environment. */
|
|
33
|
+
export declare function environment(): Options | null;
|
|
34
|
+
export declare function component(declaration: Declaration | null | undefined): Declaration;
|
|
35
|
+
/**
|
|
36
|
+
* Both levels must agree, and either can veto: the context is the environment
|
|
37
|
+
* ceiling, the manifest is the component's own call. A component handling
|
|
38
|
+
* personal data opts out for good, and no context flag overrides that.
|
|
39
|
+
*/
|
|
40
|
+
export declare function settings(namespace: string, declaration: Declaration, opts: Options | null): Settings;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.settings = exports.component = exports.environment = exports.options = exports.DISABLED = void 0;
|
|
4
|
+
const generic_1 = require("@toa.io/generic");
|
|
5
|
+
const const_1 = require("./const");
|
|
6
|
+
exports.DISABLED = { enabled: false, samples: false };
|
|
7
|
+
function options(annotation) {
|
|
8
|
+
const declaration = annotation === undefined || annotation === false ? {} : annotation;
|
|
9
|
+
return {
|
|
10
|
+
samples: declaration.samples === true,
|
|
11
|
+
interval: declaration.interval ?? const_1.DEFAULT_INTERVAL,
|
|
12
|
+
threshold: declaration.threshold ?? const_1.DEFAULT_THRESHOLD,
|
|
13
|
+
ui: declaration.ui !== false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.options = options;
|
|
17
|
+
/** Reads what `deployment()` has put into the environment. */
|
|
18
|
+
function environment() {
|
|
19
|
+
const value = process.env[const_1.ENV];
|
|
20
|
+
if (value === undefined)
|
|
21
|
+
return null;
|
|
22
|
+
return (0, generic_1.decode)(value);
|
|
23
|
+
}
|
|
24
|
+
exports.environment = environment;
|
|
25
|
+
function component(declaration) {
|
|
26
|
+
if (declaration === false)
|
|
27
|
+
return false;
|
|
28
|
+
// predefined extensions arrive as null for components that say nothing
|
|
29
|
+
if (declaration === null || declaration === undefined)
|
|
30
|
+
return {};
|
|
31
|
+
return declaration.samples === undefined ? {} : { samples: declaration.samples };
|
|
32
|
+
}
|
|
33
|
+
exports.component = component;
|
|
34
|
+
/**
|
|
35
|
+
* Both levels must agree, and either can veto: the context is the environment
|
|
36
|
+
* ceiling, the manifest is the component's own call. A component handling
|
|
37
|
+
* personal data opts out for good, and no context flag overrides that.
|
|
38
|
+
*/
|
|
39
|
+
function settings(namespace, declaration, opts) {
|
|
40
|
+
if (opts === null || declaration === false)
|
|
41
|
+
return exports.DISABLED;
|
|
42
|
+
const samples = opts.samples && declaration.samples !== false && !const_1.DENIED.has(namespace);
|
|
43
|
+
return { enabled: true, samples };
|
|
44
|
+
}
|
|
45
|
+
exports.settings = settings;
|
|
46
|
+
//# sourceMappingURL=annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.js","sourceRoot":"","sources":["../source/annotation.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,mCAA0E;AAmC7D,QAAA,QAAQ,GAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE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AAG,CAAC,SAAS,CAAC,CAAA;IAEvF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AACnC,CAAC;AAPD,4BAOC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const ID = "introspection";
|
|
2
|
+
export declare const NAMESPACE = "introspection";
|
|
3
|
+
export declare const ENV = "TOA_INTROSPECTION";
|
|
4
|
+
export declare const NODES = "nodes";
|
|
5
|
+
export declare const EDGES = "edges";
|
|
6
|
+
/** Where the UI is mounted; `/introspection/*` belongs to the components' own API. */
|
|
7
|
+
export declare const UI_PATH = "/.introspection";
|
|
8
|
+
export declare const UI_PORT = 8002;
|
|
9
|
+
export declare const DEFAULT_INTERVAL = 15;
|
|
10
|
+
export declare const DEFAULT_THRESHOLD = 256;
|
|
11
|
+
/** How often a component re-announces its description, so that removed components fade out. */
|
|
12
|
+
export declare const ANNOUNCE_INTERVAL = 1800000;
|
|
13
|
+
/**
|
|
14
|
+
* `source` arrives over the wire, so the number of distinct edges a process
|
|
15
|
+
* can hold must be bounded regardless of what peers send.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MAX_EDGES = 4096;
|
|
18
|
+
/** Never capture samples for these namespaces, whatever the annotation says. */
|
|
19
|
+
export declare const DENIED: Set<string>;
|
|
20
|
+
/** Keys never stored in a sample, even when sampling is on. */
|
|
21
|
+
export declare const REDACTED: RegExp;
|
|
22
|
+
/** Serialized size cap of a single sample. */
|
|
23
|
+
export declare const SAMPLE_LIMIT = 4096;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SAMPLE_LIMIT = exports.REDACTED = exports.DENIED = exports.MAX_EDGES = exports.ANNOUNCE_INTERVAL = exports.DEFAULT_THRESHOLD = exports.DEFAULT_INTERVAL = exports.UI_PORT = exports.UI_PATH = exports.EDGES = exports.NODES = exports.ENV = exports.NAMESPACE = exports.ID = void 0;
|
|
4
|
+
exports.ID = 'introspection';
|
|
5
|
+
exports.NAMESPACE = 'introspection';
|
|
6
|
+
exports.ENV = 'TOA_INTROSPECTION';
|
|
7
|
+
exports.NODES = 'nodes';
|
|
8
|
+
exports.EDGES = 'edges';
|
|
9
|
+
/** Where the UI is mounted; `/introspection/*` belongs to the components' own API. */
|
|
10
|
+
exports.UI_PATH = '/.introspection';
|
|
11
|
+
exports.UI_PORT = 8002;
|
|
12
|
+
exports.DEFAULT_INTERVAL = 15;
|
|
13
|
+
exports.DEFAULT_THRESHOLD = 256;
|
|
14
|
+
/** How often a component re-announces its description, so that removed components fade out. */
|
|
15
|
+
exports.ANNOUNCE_INTERVAL = 1_800_000;
|
|
16
|
+
/**
|
|
17
|
+
* `source` arrives over the wire, so the number of distinct edges a process
|
|
18
|
+
* can hold must be bounded regardless of what peers send.
|
|
19
|
+
*/
|
|
20
|
+
exports.MAX_EDGES = 4096;
|
|
21
|
+
/** Never capture samples for these namespaces, whatever the annotation says. */
|
|
22
|
+
exports.DENIED = new Set(['identity', 'introspection']);
|
|
23
|
+
/** Keys never stored in a sample, even when sampling is on. */
|
|
24
|
+
exports.REDACTED = /^(password|secret|token|credentials?|key|authorization|cookie)$/i;
|
|
25
|
+
/** Serialized size cap of a single sample. */
|
|
26
|
+
exports.SAMPLE_LIMIT = 4096;
|
|
27
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../source/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,EAAE,GAAG,eAAe,CAAA;AACpB,QAAA,SAAS,GAAG,eAAe,CAAA;AAE3B,QAAA,GAAG,GAAG,mBAAmB,CAAA;AAEzB,QAAA,KAAK,GAAG,OAAO,CAAA;AACf,QAAA,KAAK,GAAG,OAAO,CAAA;AAE5B,sFAAsF;AACzE,QAAA,OAAO,GAAG,iBAAiB,CAAA;AAC3B,QAAA,OAAO,GAAG,IAAI,CAAA;AAEd,QAAA,gBAAgB,GAAG,EAAE,CAAA;AACrB,QAAA,iBAAiB,GAAG,GAAG,CAAA;AAEpC,+FAA+F;AAClF,QAAA,iBAAiB,GAAG,SAAS,CAAA;AAE1C;;;GAGG;AACU,QAAA,SAAS,GAAG,IAAI,CAAA;AAE7B,gFAAgF;AACnE,QAAA,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC,CAAA;AAE5D,+DAA+D;AAClD,QAAA,QAAQ,GAAG,kEAAkE,CAAA;AAE1F,8CAA8C;AACjC,QAAA,YAAY,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const NODES_CONTRACT: {
|
|
2
|
+
entity: {
|
|
3
|
+
schema: {
|
|
4
|
+
properties: {
|
|
5
|
+
id: {
|
|
6
|
+
type: string;
|
|
7
|
+
pattern: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
operations: {
|
|
13
|
+
transit: {
|
|
14
|
+
bindings: string[];
|
|
15
|
+
type: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
input: {
|
|
18
|
+
type: string;
|
|
19
|
+
additionalProperties: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const EDGES_CONTRACT: {
|
|
25
|
+
entity: {
|
|
26
|
+
schema: {
|
|
27
|
+
properties: {
|
|
28
|
+
id: {
|
|
29
|
+
type: string;
|
|
30
|
+
pattern: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
operations: {
|
|
36
|
+
merge: {
|
|
37
|
+
bindings: string[];
|
|
38
|
+
type: string;
|
|
39
|
+
scope: string;
|
|
40
|
+
input: {
|
|
41
|
+
type: string;
|
|
42
|
+
properties: {
|
|
43
|
+
edges: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EDGES_CONTRACT = exports.NODES_CONTRACT = void 0;
|
|
4
|
+
const const_1 = require("./const");
|
|
5
|
+
/**
|
|
6
|
+
* The request contracts of the components this extension ships.
|
|
7
|
+
*
|
|
8
|
+
* Discovery waits for a peer indefinitely, which is right for a dependency and
|
|
9
|
+
* wrong for a sink — an application must run whether or not anyone collects its
|
|
10
|
+
* map, and `toa invoke` must exit. The extension owns both components, so their
|
|
11
|
+
* contracts are known here and no lookup is needed.
|
|
12
|
+
*
|
|
13
|
+
* Keep in step with `components/introspection.nodes/manifest.toa.yaml` and
|
|
14
|
+
* `components/introspection.edges/manifest.toa.yaml`; `nodes.feature` and
|
|
15
|
+
* `calls.feature` fail on a mismatch.
|
|
16
|
+
*/
|
|
17
|
+
const BINDINGS = ['@toa.io/bindings.amqp'];
|
|
18
|
+
/** Both components are `associated`, so an id is enough to address an object. */
|
|
19
|
+
const ENTITY = {
|
|
20
|
+
schema: {
|
|
21
|
+
properties: {
|
|
22
|
+
id: { type: 'string', pattern: '^[a-fA-F0-9]{32}$' }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const ANY = { type: 'object', additionalProperties: true };
|
|
27
|
+
exports.NODES_CONTRACT = {
|
|
28
|
+
entity: ENTITY,
|
|
29
|
+
operations: {
|
|
30
|
+
[const_1.TRANSIT]: {
|
|
31
|
+
bindings: BINDINGS,
|
|
32
|
+
type: 'transition',
|
|
33
|
+
scope: 'object',
|
|
34
|
+
input: ANY
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.EDGES_CONTRACT = {
|
|
39
|
+
entity: ENTITY,
|
|
40
|
+
operations: {
|
|
41
|
+
[const_1.MERGE]: {
|
|
42
|
+
bindings: BINDINGS,
|
|
43
|
+
type: 'transition',
|
|
44
|
+
scope: 'objects',
|
|
45
|
+
input: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: { edges: { type: 'object' } },
|
|
48
|
+
required: ['edges']
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../source/contracts.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC;;;;;;;;;;;GAWG;AAEH,MAAM,QAAQ,GAAG,CAAC,uBAAuB,CAAC,CAAA;AAE1C,iFAAiF;AACjF,MAAM,MAAM,GAAG;IACb,MAAM,EAAE;QACN,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE;SACrD;KACF;CACF,CAAA;AAED,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAA;AAE7C,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE;QACV,CAAC,eAAO,CAAC,EAAE;YACT,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,GAAG;SACX;KACF;CACF,CAAA;AAEY,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE;QACV,CAAC,aAAK,CAAC,EAAE;YACP,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBACzC,QAAQ,EAAE,CAAC,OAAO,CAAC;aACpB;SACF;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from './model';
|
|
2
|
+
import type { Manifest } from '@toa.io/norm';
|
|
3
|
+
/**
|
|
4
|
+
* Turns a normalized component manifest into the node of the map.
|
|
5
|
+
*
|
|
6
|
+
* Everything here is already expanded by norm: concise schemas are resolved and
|
|
7
|
+
* the prototype chain is collapsed, so this is the shape the runtime actually runs.
|
|
8
|
+
*/
|
|
9
|
+
export declare function describe(manifest: Manifest): Node;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describe = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Turns a normalized component manifest into the node of the map.
|
|
6
|
+
*
|
|
7
|
+
* Everything here is already expanded by norm: concise schemas are resolved and
|
|
8
|
+
* the prototype chain is collapsed, so this is the shape the runtime actually runs.
|
|
9
|
+
*/
|
|
10
|
+
function describe(manifest) {
|
|
11
|
+
return {
|
|
12
|
+
namespace: manifest.namespace,
|
|
13
|
+
component: manifest.name,
|
|
14
|
+
version: manifest.version,
|
|
15
|
+
entity: entity(manifest),
|
|
16
|
+
operations: operations(manifest),
|
|
17
|
+
events: events(manifest),
|
|
18
|
+
receivers: receivers(manifest),
|
|
19
|
+
// names only: extension declarations carry configuration and secrets
|
|
20
|
+
extensions: Object.keys(manifest.extensions ?? {})
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.describe = describe;
|
|
24
|
+
function entity(manifest) {
|
|
25
|
+
if (manifest.entity === undefined)
|
|
26
|
+
return null;
|
|
27
|
+
return {
|
|
28
|
+
schema: manifest.entity.schema,
|
|
29
|
+
storage: manifest.entity.storage,
|
|
30
|
+
associated: manifest.entity.associated === true
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function operations(manifest) {
|
|
34
|
+
return Object.entries(manifest.operations ?? {})
|
|
35
|
+
.map(([endpoint, definition]) => ({
|
|
36
|
+
endpoint,
|
|
37
|
+
type: definition.type,
|
|
38
|
+
scope: definition.scope,
|
|
39
|
+
query: definition.query,
|
|
40
|
+
input: definition.input ?? null,
|
|
41
|
+
output: definition.output ?? null,
|
|
42
|
+
errors: definition.errors ?? []
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
function events(manifest) {
|
|
46
|
+
return Object.entries(manifest.events ?? {})
|
|
47
|
+
.map(([label, definition]) => ({ label, binding: definition.binding }));
|
|
48
|
+
}
|
|
49
|
+
/*
|
|
50
|
+
* Receiver labels contain dots (`identity.bans.created`), which is why nodes keep
|
|
51
|
+
* these as arrays rather than maps — a dot in a document key is a hazard in Mongo.
|
|
52
|
+
*/
|
|
53
|
+
function receivers(manifest) {
|
|
54
|
+
return Object.entries(manifest.receivers ?? {})
|
|
55
|
+
.map(([label, definition]) => ({
|
|
56
|
+
label,
|
|
57
|
+
source: definition.source ?? label.split('.').slice(0, 2).join('.'),
|
|
58
|
+
event: label.split('.').pop(),
|
|
59
|
+
operation: definition.operation,
|
|
60
|
+
conditioned: definition.conditioned === true,
|
|
61
|
+
adaptive: definition.adaptive === true
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=describe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../source/describe.ts"],"names":[],"mappings":";;;AAGA;;;;;GAKG;AACH,SAAgB,QAAQ,CAAE,QAAkB;IAC1C,OAAO;QACL,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,SAAS,EAAE,QAAQ,CAAC,IAAI;QACxB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;QACxB,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;QACxB,SAAS,EA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,SAAS,CAAE,QAAkB;IACpC,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;SAC5C,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAgB,EAAE,EAAE,CAAC,CAAC;QAC5C,KAAK;QACL,MAAM,EAAE,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACnE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG;QAC9B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,WAAW,EAAE,UAAU,CAAC,WAAW,KAAK,IAAI;QAC5C,QAAQ,EAAE,UAAU,CAAC,QAAQ,KAAK,IAAI;KACvC,CAAC,CAAC,CAAA;AACP,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Annotation } from './annotation';
|
|
2
|
+
import type { Dependency, Instances } from '@toa.io/operations';
|
|
3
|
+
export declare const standalone = true;
|
|
4
|
+
/**
|
|
5
|
+
* The explorer hosts the introspection components, exactly as the exposition
|
|
6
|
+
* gateway hosts the identity ones. Collection is on unless the context says
|
|
7
|
+
* `introspection: false`, and the environment variable is emitted together
|
|
8
|
+
* with the service — never on its own, or tasks would pile up in a queue
|
|
9
|
+
* nothing consumes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deployment(_: Instances<unknown>, annotation?: Annotation): Dependency;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.deployment = exports.standalone = void 0;
|
|
27
|
+
const generic_1 = require("@toa.io/generic");
|
|
28
|
+
const annotation_1 = require("./annotation");
|
|
29
|
+
const Composition_1 = require("./Composition");
|
|
30
|
+
const const_1 = require("./const");
|
|
31
|
+
const schemas = __importStar(require("./schemas"));
|
|
32
|
+
exports.standalone = true;
|
|
33
|
+
/**
|
|
34
|
+
* The explorer hosts the introspection components, exactly as the exposition
|
|
35
|
+
* gateway hosts the identity ones. Collection is on unless the context says
|
|
36
|
+
* `introspection: false`, and the environment variable is emitted together
|
|
37
|
+
* with the service — never on its own, or tasks would pile up in a queue
|
|
38
|
+
* nothing consumes.
|
|
39
|
+
*/
|
|
40
|
+
function deployment(_, annotation) {
|
|
41
|
+
if (annotation === false)
|
|
42
|
+
return {};
|
|
43
|
+
if (annotation !== undefined)
|
|
44
|
+
schemas.annotation.validate(annotation);
|
|
45
|
+
const opts = (0, annotation_1.options)(annotation);
|
|
46
|
+
const service = {
|
|
47
|
+
group: 'introspection',
|
|
48
|
+
name: 'explorer',
|
|
49
|
+
version: require('../package.json').version,
|
|
50
|
+
components: (0, Composition_1.components)().labels,
|
|
51
|
+
resources: annotation?.resources,
|
|
52
|
+
variables: []
|
|
53
|
+
};
|
|
54
|
+
if (opts.ui) {
|
|
55
|
+
service.port = const_1.UI_PORT;
|
|
56
|
+
service.ingress = { path: const_1.UI_PATH };
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
services: [service],
|
|
60
|
+
variables: { global: [{ name: const_1.ENV, value: (0, generic_1.encode)(opts) }] }
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
exports.deployment = deployment;
|
|
64
|
+
//# sourceMappingURL=extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../source/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,6CAAsC;AACtC,+CAA0C;AAC1C,mCAA+C;AAC/C,mDAAoC;AAIvB,QAAA,UAAU,GAAG,IAAI,CAAA;AAE9B;;;;;;GAMG;AACH,SAAgB,UAAU,CAAE,CAAqB,EAAE,UAAuB;IACxE,IAAI,UAAU,KAAK,KAAK;QACtB,OAAO,EAAE,CAAA;IAEX,IAAI,UAAU,KAAK,SAAS;QAC1B,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEzC,MAAM,IAAI,GAAG,IAAA,oBAAO,EAAC,UAAU,CAAC,CAAA;IAEhC,MAAM,OAAO,GAAY;QACvB,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO;QAC3C,UAAU,EAAE,IAAA,wBAAU,GAAE,CAAC,MAAM;QAC/B,SAAS,EAAE,UAAU,EAAE,SAAS;QAChC,SAAS,EAAE,EAAE;KACd,CAAA;IAED,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,GAAG,eAAO,CAAA;QACtB,OAAO,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,eAAO,EAAE,CAAA;IACrC,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,WAAG,EAAE,KAAK,EAAE,IAAA,gBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE;KAC5D,CAAA;AACH,CAAC;AA3BD,gCA2BC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.components = exports.manifest = exports.Factory = void 0;
|
|
18
|
+
var Factory_1 = require("./Factory");
|
|
19
|
+
Object.defineProperty(exports, "Factory", { enumerable: true, get: function () { return Factory_1.Factory; } });
|
|
20
|
+
var manifest_1 = require("./manifest");
|
|
21
|
+
Object.defineProperty(exports, "manifest", { enumerable: true, get: function () { return manifest_1.manifest; } });
|
|
22
|
+
var Composition_1 = require("./Composition");
|
|
23
|
+
Object.defineProperty(exports, "components", { enumerable: true, get: function () { return Composition_1.components; } });
|
|
24
|
+
__exportStar(require("./extension"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,8CAA2B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Origin, Target } from './model';
|
|
2
|
+
/**
|
|
3
|
+
* Entity ids must match `^[a-fA-F0-9]{32}$`, and both nodes and edges are
|
|
4
|
+
* addressed by a value derived from their identity, so that every replica
|
|
5
|
+
* of a component updates the very same object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function digest(...parts: Array<string | undefined>): string;
|
|
8
|
+
export declare function node(namespace: string, component: string): string;
|
|
9
|
+
export declare function edge(src: Origin, dst: Target): string;
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../source/keys.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAGxC;;;;GAIG;AACH,SAAgB,MAAM,CAAE,GAAG,KAAgC;IACzD,OAAO,IAAA,wBAAU,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAChE,CAAC;AAFD,wBAEC;AAED,SAAgB,IAAI,CAAE,SAAiB,EAAE,SAAiB;IACxD,OAAO,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAC7C,CAAC;AAFD,oBAEC;AAED,SAAgB,IAAI,CAAE,GAAW,EAAE,GAAW;IAC5C,OAAO,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;AACnF,CAAC;AAFD,oBAEC;AAED,SAAS,KAAK,CAAE,MAAc;IAC5B,IAAI,SAAS,IAAI,MAAM;QACrB,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAEpC,OAAO;QACL,WAAW;QACX,MAAM,CAAC,SAAS;QAChB,MAAM,CAAC,SAAS;QAChB,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACpD,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;KAC7C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Declaration } from './annotation';
|
|
2
|
+
/**
|
|
3
|
+
* The component level of the annotation.
|
|
4
|
+
*
|
|
5
|
+
* The extension is predefined, so most components say nothing and the
|
|
6
|
+
* declaration arrives as `null` — which still has to produce a value,
|
|
7
|
+
* or norm rejects the extension.
|
|
8
|
+
*/
|
|
9
|
+
export declare function manifest(declaration: Declaration | null | undefined): Declaration;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.manifest = void 0;
|
|
27
|
+
const annotation_1 = require("./annotation");
|
|
28
|
+
const schemas = __importStar(require("./schemas"));
|
|
29
|
+
/**
|
|
30
|
+
* The component level of the annotation.
|
|
31
|
+
*
|
|
32
|
+
* The extension is predefined, so most components say nothing and the
|
|
33
|
+
* declaration arrives as `null` — which still has to produce a value,
|
|
34
|
+
* or norm rejects the extension.
|
|
35
|
+
*/
|
|
36
|
+
function manifest(declaration) {
|
|
37
|
+
const normalized = (0, annotation_1.component)(declaration);
|
|
38
|
+
if (normalized !== false)
|
|
39
|
+
schemas.declaration.validate(normalized);
|
|
40
|
+
return normalized;
|
|
41
|
+
}
|
|
42
|
+
exports.manifest = manifest;
|
|
43
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../source/manifest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,mDAAoC;AAGpC;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAE,WAA2C;IACnE,MAAM,UAAU,GAAG,IAAA,sBAAS,EAAC,WAAW,CAAC,CAAA;IAEzC,IAAI,UAAU,KAAK,KAAK;QACtB,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IAE1C,OAAO,UAAU,CAAA;AACnB,CAAC;AAPD,4BAOC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Source } from '@toa.io/core';
|
|
2
|
+
export type { Source };
|
|
3
|
+
/**
|
|
4
|
+
* The caller side of an edge: the operation that made the call, the event that
|
|
5
|
+
* caused it, or the service the call came from.
|
|
6
|
+
*/
|
|
7
|
+
export type Origin = Source;
|
|
8
|
+
/** The callee side of an edge. */
|
|
9
|
+
export interface Target {
|
|
10
|
+
namespace: string;
|
|
11
|
+
component: string;
|
|
12
|
+
operation: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Operation {
|
|
15
|
+
endpoint: string;
|
|
16
|
+
type: string;
|
|
17
|
+
scope?: string;
|
|
18
|
+
query?: boolean;
|
|
19
|
+
input?: object | null;
|
|
20
|
+
output?: object | null;
|
|
21
|
+
errors?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface Event {
|
|
24
|
+
label: string;
|
|
25
|
+
binding?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Receiver {
|
|
28
|
+
label: string;
|
|
29
|
+
source: string;
|
|
30
|
+
event: string;
|
|
31
|
+
operation: string;
|
|
32
|
+
conditioned: boolean;
|
|
33
|
+
adaptive: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface Entity {
|
|
36
|
+
schema: object;
|
|
37
|
+
storage?: string;
|
|
38
|
+
associated: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The static description of a component, derived from its manifest.
|
|
42
|
+
* Sent to `introspection.nodes`.
|
|
43
|
+
*/
|
|
44
|
+
export interface Node {
|
|
45
|
+
namespace: string;
|
|
46
|
+
component: string;
|
|
47
|
+
version: string;
|
|
48
|
+
entity: Entity | null;
|
|
49
|
+
operations: Operation[];
|
|
50
|
+
events: Event[];
|
|
51
|
+
receivers: Receiver[];
|
|
52
|
+
extensions: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface Sample {
|
|
55
|
+
at: number;
|
|
56
|
+
input?: unknown;
|
|
57
|
+
outcome: Outcome;
|
|
58
|
+
}
|
|
59
|
+
export type Outcome = 'ok' | 'error' | 'exception';
|
|
60
|
+
/**
|
|
61
|
+
* A call observed in a process between flushes. What the application declares —
|
|
62
|
+
* which events exist, and which receiver takes which — is a node's business;
|
|
63
|
+
* an edge is what actually happened.
|
|
64
|
+
*
|
|
65
|
+
* Sent to `introspection.edges`.
|
|
66
|
+
*/
|
|
67
|
+
export interface Edge {
|
|
68
|
+
src: Origin;
|
|
69
|
+
dst: Target;
|
|
70
|
+
sample?: Sample;
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../source/model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Outcome, Sample } from './model';
|
|
2
|
+
/**
|
|
3
|
+
* Captures the payload of a call. Only reached when both the context and the
|
|
4
|
+
* component have opted in, and never for a denied namespace.
|
|
5
|
+
*/
|
|
6
|
+
export declare function capture(input: unknown, outcome: Outcome): Sample;
|
|
7
|
+
export declare function samplable(input: unknown): boolean;
|