@toa.io/extensions.exposition 0.8.3-dev.9 → 0.20.0-alpha.0
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/components/context.toa.yaml +15 -0
- package/components/identity.bans/manifest.toa.yaml +18 -0
- package/components/identity.basic/events/principal.js +9 -0
- package/components/identity.basic/manifest.toa.yaml +50 -0
- package/components/identity.basic/source/authenticate.ts +29 -0
- package/components/identity.basic/source/create.ts +19 -0
- package/components/identity.basic/source/transit.ts +64 -0
- package/components/identity.basic/source/types.ts +42 -0
- package/components/identity.basic/tsconfig.json +9 -0
- package/components/identity.roles/manifest.toa.yaml +31 -0
- package/components/identity.roles/source/list.ts +7 -0
- package/components/identity.roles/source/principal.ts +20 -0
- package/components/identity.roles/tsconfig.json +9 -0
- package/components/identity.tokens/manifest.toa.yaml +39 -0
- package/components/identity.tokens/receivers/identity.bans.updated.js +3 -0
- package/components/identity.tokens/source/authenticate.test.ts +56 -0
- package/components/identity.tokens/source/authenticate.ts +38 -0
- package/components/identity.tokens/source/decrypt.test.ts +59 -0
- package/components/identity.tokens/source/decrypt.ts +25 -0
- package/components/identity.tokens/source/encrypt.test.ts +35 -0
- package/components/identity.tokens/source/encrypt.ts +25 -0
- package/components/identity.tokens/source/revoke.ts +5 -0
- package/components/identity.tokens/source/types.ts +48 -0
- package/components/identity.tokens/tsconfig.json +9 -0
- package/cucumber.js +9 -0
- package/documentation/.assets/ia3-dark.jpg +0 -0
- package/documentation/.assets/ia3-light.jpg +0 -0
- package/documentation/.assets/overview-dark.jpg +0 -0
- package/documentation/.assets/overview-light.jpg +0 -0
- package/documentation/.assets/role-scopes-dark.jpg +0 -0
- package/documentation/.assets/role-scopes-light.jpg +0 -0
- package/documentation/.assets/rtd-dark.jpg +0 -0
- package/documentation/.assets/rtd-light.jpg +0 -0
- package/documentation/access.md +256 -0
- package/documentation/components.md +276 -0
- package/documentation/identity.md +156 -0
- package/documentation/protocol.md +15 -0
- package/documentation/query.md +226 -0
- package/documentation/tree.md +169 -0
- package/features/access.feature +442 -0
- package/features/annotation.feature +28 -0
- package/features/body.feature +21 -0
- package/features/directives.feature +56 -0
- package/features/dynamic.feature +89 -0
- package/features/errors.feature +208 -0
- package/features/identity.basic.feature +235 -0
- package/features/identity.feature +61 -0
- package/features/identity.roles.feature +51 -0
- package/features/identity.tokens.feature +116 -0
- package/features/queries.feature +214 -0
- package/features/routes.feature +49 -0
- package/features/steps/Common.ts +10 -0
- package/features/steps/Components.ts +43 -0
- package/features/steps/Database.ts +58 -0
- package/features/steps/Gateway.ts +105 -0
- package/features/steps/HTTP.ts +71 -0
- package/features/steps/Parameters.ts +12 -0
- package/features/steps/Workspace.ts +40 -0
- package/features/steps/components/greeter/manifest.toa.yaml +9 -0
- package/features/steps/components/greeter/operations/greet.js +7 -0
- package/features/steps/components/pots/manifest.toa.yaml +20 -0
- package/features/steps/components/users/manifest.toa.yaml +11 -0
- package/features/steps/tsconfig.json +9 -0
- package/package.json +31 -17
- package/readme.md +181 -0
- package/schemas/annotation.cos.yaml +4 -0
- package/schemas/directive.cos.yaml +3 -0
- package/schemas/method.cos.yaml +9 -0
- package/schemas/node.cos.yaml +5 -0
- package/schemas/query.cos.yaml +16 -0
- package/schemas/querystring.cos.yaml +5 -0
- package/schemas/range.cos.yaml +2 -0
- package/schemas/route.cos.yaml +2 -0
- package/source/Annotation.ts +6 -0
- package/source/Branch.ts +8 -0
- package/source/Composition.ts +58 -0
- package/source/Context.ts +6 -0
- package/source/Directive.test.ts +91 -0
- package/source/Directive.ts +120 -0
- package/source/Endpoint.ts +57 -0
- package/source/Factory.ts +53 -0
- package/source/Gateway.ts +93 -0
- package/source/HTTP/Server.fixtures.ts +45 -0
- package/source/HTTP/Server.test.ts +221 -0
- package/source/HTTP/Server.ts +135 -0
- package/source/HTTP/exceptions.ts +77 -0
- package/source/HTTP/formats/index.ts +19 -0
- package/source/HTTP/formats/json.ts +13 -0
- package/source/HTTP/formats/msgpack.ts +10 -0
- package/source/HTTP/formats/text.ts +9 -0
- package/source/HTTP/formats/yaml.ts +14 -0
- package/source/HTTP/index.ts +3 -0
- package/source/HTTP/messages.test.ts +116 -0
- package/source/HTTP/messages.ts +77 -0
- package/source/Mapping.ts +48 -0
- package/source/Query.test.ts +37 -0
- package/source/Query.ts +105 -0
- package/source/RTD/Context.ts +16 -0
- package/source/RTD/Directives.ts +9 -0
- package/source/RTD/Endpoint.ts +11 -0
- package/source/RTD/Match.ts +16 -0
- package/source/RTD/Method.ts +24 -0
- package/source/RTD/Node.ts +85 -0
- package/source/RTD/Route.ts +58 -0
- package/source/RTD/Tree.ts +57 -0
- package/source/RTD/factory.ts +47 -0
- package/source/RTD/index.ts +8 -0
- package/source/RTD/segment.test.ts +32 -0
- package/source/RTD/segment.ts +25 -0
- package/source/RTD/syntax/index.ts +2 -0
- package/source/RTD/syntax/parse.test.ts +188 -0
- package/source/RTD/syntax/parse.ts +153 -0
- package/source/RTD/syntax/types.ts +48 -0
- package/source/Remotes.test.ts +41 -0
- package/source/Remotes.ts +20 -0
- package/source/Tenant.ts +38 -0
- package/source/deployment.ts +42 -0
- package/source/directives/auth/Anonymous.ts +14 -0
- package/source/directives/auth/Echo.ts +12 -0
- package/source/directives/auth/Family.ts +145 -0
- package/source/directives/auth/Id.ts +19 -0
- package/source/directives/auth/Incept.ts +42 -0
- package/source/directives/auth/Role.test.ts +62 -0
- package/source/directives/auth/Role.ts +56 -0
- package/source/directives/auth/Rule.ts +28 -0
- package/source/directives/auth/Scheme.ts +26 -0
- package/source/directives/auth/index.ts +3 -0
- package/source/directives/auth/schemes.ts +8 -0
- package/source/directives/auth/split.ts +15 -0
- package/source/directives/auth/types.ts +37 -0
- package/source/directives/dev/Family.ts +34 -0
- package/source/directives/dev/Stub.ts +14 -0
- package/source/directives/dev/index.ts +3 -0
- package/source/directives/dev/types.ts +5 -0
- package/source/directives/index.ts +5 -0
- package/source/discovery.ts +1 -0
- package/source/exceptions.ts +17 -0
- package/source/index.test.ts +9 -0
- package/source/index.ts +6 -0
- package/source/manifest.test.ts +57 -0
- package/source/manifest.ts +35 -0
- package/source/root.ts +38 -0
- package/source/schemas.ts +9 -0
- package/transpiled/Annotation.d.ts +6 -0
- package/transpiled/Annotation.js +3 -0
- package/transpiled/Annotation.js.map +1 -0
- package/transpiled/Branch.d.ts +7 -0
- package/transpiled/Branch.js +3 -0
- package/transpiled/Branch.js.map +1 -0
- package/transpiled/Composition.d.ts +14 -0
- package/transpiled/Composition.js +43 -0
- package/transpiled/Composition.js.map +1 -0
- package/transpiled/Context.d.ts +5 -0
- package/transpiled/Context.js +3 -0
- package/transpiled/Context.js.map +1 -0
- package/transpiled/Directive.d.ts +32 -0
- package/transpiled/Directive.js +76 -0
- package/transpiled/Directive.js.map +1 -0
- package/transpiled/Endpoint.d.ts +20 -0
- package/transpiled/Endpoint.js +44 -0
- package/transpiled/Endpoint.js.map +1 -0
- package/transpiled/Factory.d.ts +11 -0
- package/transpiled/Factory.js +67 -0
- package/transpiled/Factory.js.map +1 -0
- package/transpiled/Gateway.d.ts +19 -0
- package/transpiled/Gateway.js +90 -0
- package/transpiled/Gateway.js.map +1 -0
- package/transpiled/HTTP/Server.d.ts +22 -0
- package/transpiled/HTTP/Server.fixtures.d.ts +12 -0
- package/transpiled/HTTP/Server.fixtures.js +36 -0
- package/transpiled/HTTP/Server.fixtures.js.map +1 -0
- package/transpiled/HTTP/Server.js +111 -0
- package/transpiled/HTTP/Server.js.map +1 -0
- package/transpiled/HTTP/exceptions.d.ts +39 -0
- package/transpiled/HTTP/exceptions.js +78 -0
- package/transpiled/HTTP/exceptions.js.map +1 -0
- package/transpiled/HTTP/formats/index.d.ts +8 -0
- package/transpiled/HTTP/formats/index.js +38 -0
- package/transpiled/HTTP/formats/index.js.map +1 -0
- package/transpiled/HTTP/formats/json.d.ts +4 -0
- package/transpiled/HTTP/formats/json.js +15 -0
- package/transpiled/HTTP/formats/json.js.map +1 -0
- package/transpiled/HTTP/formats/msgpack.d.ts +4 -0
- package/transpiled/HTTP/formats/msgpack.js +36 -0
- package/transpiled/HTTP/formats/msgpack.js.map +1 -0
- package/transpiled/HTTP/formats/text.d.ts +4 -0
- package/transpiled/HTTP/formats/text.js +13 -0
- package/transpiled/HTTP/formats/text.js.map +1 -0
- package/transpiled/HTTP/formats/yaml.d.ts +4 -0
- package/transpiled/HTTP/formats/yaml.js +39 -0
- package/transpiled/HTTP/formats/yaml.js.map +1 -0
- package/transpiled/HTTP/index.d.ts +3 -0
- package/transpiled/HTTP/index.js +20 -0
- package/transpiled/HTTP/index.js.map +1 -0
- package/transpiled/HTTP/messages.d.ts +27 -0
- package/transpiled/HTTP/messages.js +49 -0
- package/transpiled/HTTP/messages.js.map +1 -0
- package/transpiled/Mapping.d.ts +8 -0
- package/transpiled/Mapping.js +35 -0
- package/transpiled/Mapping.js.map +1 -0
- package/transpiled/Query.d.ts +13 -0
- package/transpiled/Query.js +107 -0
- package/transpiled/Query.js.map +1 -0
- package/transpiled/RTD/Context.d.ts +11 -0
- package/transpiled/RTD/Context.js +3 -0
- package/transpiled/RTD/Context.js.map +1 -0
- package/transpiled/RTD/Directives.d.ts +7 -0
- package/transpiled/RTD/Directives.js +3 -0
- package/transpiled/RTD/Directives.js.map +1 -0
- package/transpiled/RTD/Endpoint.d.ts +9 -0
- package/transpiled/RTD/Endpoint.js +3 -0
- package/transpiled/RTD/Endpoint.js.map +1 -0
- package/transpiled/RTD/Match.d.ts +11 -0
- package/transpiled/RTD/Match.js +3 -0
- package/transpiled/RTD/Match.js.map +1 -0
- package/transpiled/RTD/Method.d.ts +9 -0
- package/transpiled/RTD/Method.js +16 -0
- package/transpiled/RTD/Method.js.map +1 -0
- package/transpiled/RTD/Node.d.ts +21 -0
- package/transpiled/RTD/Node.js +61 -0
- package/transpiled/RTD/Node.js.map +1 -0
- package/transpiled/RTD/Route.d.ts +14 -0
- package/transpiled/RTD/Route.js +48 -0
- package/transpiled/RTD/Route.js.map +1 -0
- package/transpiled/RTD/Tree.d.ts +14 -0
- package/transpiled/RTD/Tree.js +45 -0
- package/transpiled/RTD/Tree.js.map +1 -0
- package/transpiled/RTD/factory.d.ts +6 -0
- package/transpiled/RTD/factory.js +36 -0
- package/transpiled/RTD/factory.js.map +1 -0
- package/transpiled/RTD/index.d.ts +8 -0
- package/transpiled/RTD/index.js +38 -0
- package/transpiled/RTD/index.js.map +1 -0
- package/transpiled/RTD/segment.d.ts +8 -0
- package/transpiled/RTD/segment.js +23 -0
- package/transpiled/RTD/segment.js.map +1 -0
- package/transpiled/RTD/syntax/index.d.ts +2 -0
- package/transpiled/RTD/syntax/index.js +19 -0
- package/transpiled/RTD/syntax/index.js.map +1 -0
- package/transpiled/RTD/syntax/parse.d.ts +4 -0
- package/transpiled/RTD/syntax/parse.js +128 -0
- package/transpiled/RTD/syntax/parse.js.map +1 -0
- package/transpiled/RTD/syntax/types.d.ts +41 -0
- package/transpiled/RTD/syntax/types.js +5 -0
- package/transpiled/RTD/syntax/types.js.map +1 -0
- package/transpiled/Remotes.d.ts +7 -0
- package/transpiled/Remotes.js +19 -0
- package/transpiled/Remotes.js.map +1 -0
- package/transpiled/Tenant.d.ts +12 -0
- package/transpiled/Tenant.js +30 -0
- package/transpiled/Tenant.js.map +1 -0
- package/transpiled/deployment.d.ts +3 -0
- package/transpiled/deployment.js +61 -0
- package/transpiled/deployment.js.map +1 -0
- package/transpiled/directives/auth/Anonymous.d.ts +6 -0
- package/transpiled/directives/auth/Anonymous.js +17 -0
- package/transpiled/directives/auth/Anonymous.js.map +1 -0
- package/transpiled/directives/auth/Echo.d.ts +6 -0
- package/transpiled/directives/auth/Echo.js +13 -0
- package/transpiled/directives/auth/Echo.js.map +1 -0
- package/transpiled/directives/auth/Family.d.ts +20 -0
- package/transpiled/directives/auth/Family.js +125 -0
- package/transpiled/directives/auth/Family.js.map +1 -0
- package/transpiled/directives/auth/Id.d.ts +7 -0
- package/transpiled/directives/auth/Id.js +17 -0
- package/transpiled/directives/auth/Id.js.map +1 -0
- package/transpiled/directives/auth/Incept.d.ts +10 -0
- package/transpiled/directives/auth/Incept.js +59 -0
- package/transpiled/directives/auth/Incept.js.map +1 -0
- package/transpiled/directives/auth/Role.d.ts +11 -0
- package/transpiled/directives/auth/Role.js +44 -0
- package/transpiled/directives/auth/Role.js.map +1 -0
- package/transpiled/directives/auth/Rule.d.ts +9 -0
- package/transpiled/directives/auth/Rule.js +22 -0
- package/transpiled/directives/auth/Rule.js.map +1 -0
- package/transpiled/directives/auth/Scheme.d.ts +7 -0
- package/transpiled/directives/auth/Scheme.js +47 -0
- package/transpiled/directives/auth/Scheme.js.map +1 -0
- package/transpiled/directives/auth/index.d.ts +2 -0
- package/transpiled/directives/auth/index.js +7 -0
- package/transpiled/directives/auth/index.js.map +1 -0
- package/transpiled/directives/auth/schemes.d.ts +3 -0
- package/transpiled/directives/auth/schemes.js +9 -0
- package/transpiled/directives/auth/schemes.js.map +1 -0
- package/transpiled/directives/auth/split.d.ts +2 -0
- package/transpiled/directives/auth/split.js +38 -0
- package/transpiled/directives/auth/split.js.map +1 -0
- package/transpiled/directives/auth/types.d.ts +31 -0
- package/transpiled/directives/auth/types.js +3 -0
- package/transpiled/directives/auth/types.js.map +1 -0
- package/transpiled/directives/dev/Family.d.ts +10 -0
- package/transpiled/directives/dev/Family.js +25 -0
- package/transpiled/directives/dev/Family.js.map +1 -0
- package/transpiled/directives/dev/Stub.d.ts +7 -0
- package/transpiled/directives/dev/Stub.js +14 -0
- package/transpiled/directives/dev/Stub.js.map +1 -0
- package/transpiled/directives/dev/index.d.ts +2 -0
- package/transpiled/directives/dev/index.js +7 -0
- package/transpiled/directives/dev/index.js.map +1 -0
- package/transpiled/directives/dev/types.d.ts +4 -0
- package/transpiled/directives/dev/types.js +3 -0
- package/transpiled/directives/dev/types.js.map +1 -0
- package/transpiled/directives/index.d.ts +2 -0
- package/transpiled/directives/index.js +10 -0
- package/transpiled/directives/index.js.map +1 -0
- package/transpiled/discovery.d.ts +1 -0
- package/transpiled/discovery.js +3 -0
- package/transpiled/discovery.js.map +1 -0
- package/transpiled/exceptions.d.ts +2 -0
- package/transpiled/exceptions.js +39 -0
- package/transpiled/exceptions.js.map +1 -0
- package/transpiled/index.d.ts +5 -0
- package/transpiled/index.js +12 -0
- package/transpiled/index.js.map +1 -0
- package/transpiled/manifest.d.ts +3 -0
- package/transpiled/manifest.js +30 -0
- package/transpiled/manifest.js.map +1 -0
- package/transpiled/root.d.ts +2 -0
- package/transpiled/root.js +39 -0
- package/transpiled/root.js.map +1 -0
- package/transpiled/schemas.d.ts +3 -0
- package/transpiled/schemas.js +14 -0
- package/transpiled/schemas.js.map +1 -0
- package/transpiled/tsconfig.tsbuildinfo +1 -0
- package/tsconfig.json +12 -0
- package/src/.manifest/index.js +0 -7
- package/src/.manifest/normalize.js +0 -58
- package/src/.manifest/schema.yaml +0 -69
- package/src/.manifest/validate.js +0 -17
- package/src/constants.js +0 -3
- package/src/deployment.js +0 -23
- package/src/exposition.js +0 -68
- package/src/factory.js +0 -76
- package/src/index.js +0 -9
- package/src/manifest.js +0 -12
- package/src/query/criteria.js +0 -55
- package/src/query/enum.js +0 -35
- package/src/query/index.js +0 -17
- package/src/query/query.js +0 -60
- package/src/query/range.js +0 -28
- package/src/query/sort.js +0 -19
- package/src/remote.js +0 -88
- package/src/server.js +0 -83
- package/src/tenant.js +0 -29
- package/src/translate/etag.js +0 -14
- package/src/translate/index.js +0 -7
- package/src/translate/request.js +0 -68
- package/src/translate/response.js +0 -62
- package/src/tree.js +0 -109
- package/test/manifest.normalize.fixtures.js +0 -37
- package/test/manifest.normalize.test.js +0 -37
- package/test/manifest.validate.test.js +0 -40
- package/test/query.range.test.js +0 -18
- package/test/tree.fixtures.js +0 -21
- package/test/tree.test.js +0 -44
- package/types/annotations.d.ts +0 -10
- package/types/declarations.d.ts +0 -31
- package/types/exposition.d.ts +0 -13
- package/types/http.d.ts +0 -13
- package/types/query.d.ts +0 -16
- package/types/remote.d.ts +0 -19
- package/types/server.d.ts +0 -13
- package/types/tree.d.ts +0 -33
package/source/root.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { decode, merge } from '@toa.io/generic'
|
|
2
|
+
import { syntax } from './RTD'
|
|
3
|
+
|
|
4
|
+
export function resolve (): syntax.Node {
|
|
5
|
+
const value = process.env.TOA_EXPOSITION
|
|
6
|
+
const root = value !== undefined ? decode<syntax.Node>(value) : syntax.createNode()
|
|
7
|
+
|
|
8
|
+
merge(root, PREDEFINED)
|
|
9
|
+
|
|
10
|
+
return root
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const PREDEFINED: syntax.Node = {
|
|
14
|
+
routes: [
|
|
15
|
+
{
|
|
16
|
+
path: '/identity',
|
|
17
|
+
node: {
|
|
18
|
+
isolated: true,
|
|
19
|
+
routes: [],
|
|
20
|
+
methods: [
|
|
21
|
+
{
|
|
22
|
+
verb: 'GET',
|
|
23
|
+
directives: [
|
|
24
|
+
{
|
|
25
|
+
family: 'auth',
|
|
26
|
+
name: 'echo',
|
|
27
|
+
value: null
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
directives: []
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
methods: [],
|
|
37
|
+
directives: []
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { resolve } from 'node:path'
|
|
2
|
+
import schemas from '@toa.io/schemas'
|
|
3
|
+
|
|
4
|
+
const path = resolve(__dirname, '../schemas')
|
|
5
|
+
const namespace = schemas.namespace(path)
|
|
6
|
+
|
|
7
|
+
export const querystring = namespace.schema('querystring')
|
|
8
|
+
export const annotaion = namespace.schema('annotation')
|
|
9
|
+
export const node = namespace.schema('node')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Annotation.js","sourceRoot":"","sources":["../source/Annotation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../source/Branch.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Connector } from '@toa.io/core';
|
|
2
|
+
import { type Bootloader } from './Factory';
|
|
3
|
+
export declare class Composition extends Connector {
|
|
4
|
+
private readonly boot;
|
|
5
|
+
constructor(boot: Bootloader);
|
|
6
|
+
protected open(): Promise<void>;
|
|
7
|
+
protected dispose(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function components(): Components;
|
|
10
|
+
interface Components {
|
|
11
|
+
labels: string[];
|
|
12
|
+
paths: string[];
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.components = exports.Composition = void 0;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const core_1 = require("@toa.io/core");
|
|
7
|
+
class Composition extends core_1.Connector {
|
|
8
|
+
boot;
|
|
9
|
+
constructor(boot) {
|
|
10
|
+
super();
|
|
11
|
+
this.boot = boot;
|
|
12
|
+
}
|
|
13
|
+
async open() {
|
|
14
|
+
const paths = find();
|
|
15
|
+
const composition = await this.boot.composition(paths);
|
|
16
|
+
await composition.connect();
|
|
17
|
+
this.depends(composition);
|
|
18
|
+
console.info('Composition complete.');
|
|
19
|
+
}
|
|
20
|
+
dispose() {
|
|
21
|
+
console.info('Composition shutdown complete.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Composition = Composition;
|
|
25
|
+
function find() {
|
|
26
|
+
return entries().map((entry) => (0, node_path_1.resolve)(ROOT, entry.name));
|
|
27
|
+
}
|
|
28
|
+
function entries() {
|
|
29
|
+
const entries = (0, node_fs_1.readdirSync)(ROOT, { withFileTypes: true });
|
|
30
|
+
return entries.filter((entry) => entry.isDirectory());
|
|
31
|
+
}
|
|
32
|
+
function components() {
|
|
33
|
+
const labels = [];
|
|
34
|
+
const paths = [];
|
|
35
|
+
for (const entry of entries()) {
|
|
36
|
+
labels.push(entry.name.replace('.', '-'));
|
|
37
|
+
paths.push((0, node_path_1.resolve)(ROOT, entry.name));
|
|
38
|
+
}
|
|
39
|
+
return { labels, paths };
|
|
40
|
+
}
|
|
41
|
+
exports.components = components;
|
|
42
|
+
const ROOT = (0, node_path_1.resolve)(__dirname, '../components/');
|
|
43
|
+
//# sourceMappingURL=Composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Composition.js","sourceRoot":"","sources":["../source/Composition.ts"],"names":[],"mappings":";;;AAAA,qCAAqC;AACrC,yCAAmC;AAEnC,uCAAwC;AAGxC,MAAa,WAAY,SAAQ,gBAAS;IACvB,IAAI,CAAY;IAEjC,YAAoB,IAAgB;QAClC,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEkB,KAAK,CAAC,IAAI;QAC3B,MAAM,KAAK,GAAG,IAAI,EAAE,CAAA;QACpB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QAEtD,MAAM,WAAW,CAAC,OAAO,EAAE,CAAA;QAE3B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAEzB,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;IACvC,CAAC;IAEkB,OAAO;QACxB,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;IAChD,CAAC;CACF;AAtBD,kCAsBC;AAED,SAAS,IAAI;IACX,OAAO,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,OAAO;IACd,MAAM,OAAO,GAAG,IAAA,qBAAW,EAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;IAE1D,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;AACvD,CAAC;AAED,SAAgB,UAAU;IACxB,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QACzC,KAAK,CAAC,IAAI,CAAC,IAAA,mBAAO,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;KACtC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AAC1B,CAAC;AAVD,gCAUC;AAOD,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,SAAS,EAAE,gBAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../source/Context.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type IncomingMessage, type OutgoingMessage } from './HTTP';
|
|
2
|
+
import { type Remotes } from './Remotes';
|
|
3
|
+
import type * as RTD from './RTD';
|
|
4
|
+
export declare class Directives implements RTD.Directives<Directives> {
|
|
5
|
+
private readonly directives;
|
|
6
|
+
constructor(directives: DirectiveSet[]);
|
|
7
|
+
preflight(request: IncomingMessage, parameters: RTD.Parameter[]): Promise<Output>;
|
|
8
|
+
settle(request: IncomingMessage, response: OutgoingMessage): Promise<void>;
|
|
9
|
+
merge(directives: Directives): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class DirectivesFactory implements RTD.DirectivesFactory<Directives> {
|
|
12
|
+
private readonly remtoes;
|
|
13
|
+
private readonly families;
|
|
14
|
+
private readonly mandatory;
|
|
15
|
+
constructor(families: Family[], remotes: Remotes);
|
|
16
|
+
create(declarations: RTD.syntax.Directive[]): Directives;
|
|
17
|
+
}
|
|
18
|
+
export declare const shortcuts: RTD.syntax.Shortcuts;
|
|
19
|
+
export interface Family<TDirective = any, TExtension = any> {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly mandatory: boolean;
|
|
22
|
+
create: (name: string, value: any, remotes: Remotes) => TDirective;
|
|
23
|
+
preflight: (directives: TDirective[], request: IncomingMessage & TExtension, parameters: RTD.Parameter[]) => Output | Promise<Output>;
|
|
24
|
+
settle?: (directives: TDirective[], request: IncomingMessage & TExtension, response: OutgoingMessage) => void | Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
interface DirectiveSet {
|
|
27
|
+
family: Family;
|
|
28
|
+
directives: any[];
|
|
29
|
+
}
|
|
30
|
+
export type Input = IncomingMessage;
|
|
31
|
+
export type Output = OutgoingMessage | null;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shortcuts = exports.DirectivesFactory = exports.Directives = void 0;
|
|
4
|
+
class Directives {
|
|
5
|
+
directives;
|
|
6
|
+
constructor(directives) {
|
|
7
|
+
this.directives = directives;
|
|
8
|
+
}
|
|
9
|
+
async preflight(request, parameters) {
|
|
10
|
+
for (const directive of this.directives) {
|
|
11
|
+
const output = await directive.family.preflight(directive.directives, request, parameters);
|
|
12
|
+
if (output !== null) {
|
|
13
|
+
await this.settle(request, output);
|
|
14
|
+
return output;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
async settle(request, response) {
|
|
20
|
+
for (const directive of this.directives)
|
|
21
|
+
if (directive.family.settle !== undefined)
|
|
22
|
+
await directive.family.settle(directive.directives, request, response);
|
|
23
|
+
}
|
|
24
|
+
merge(directives) {
|
|
25
|
+
this.directives.push(...directives.directives);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Directives = Directives;
|
|
29
|
+
class DirectivesFactory {
|
|
30
|
+
remtoes;
|
|
31
|
+
families = {};
|
|
32
|
+
mandatory = [];
|
|
33
|
+
constructor(families, remotes) {
|
|
34
|
+
for (const family of families) {
|
|
35
|
+
this.families[family.name] = family;
|
|
36
|
+
if (family.mandatory)
|
|
37
|
+
this.mandatory.push(family.name);
|
|
38
|
+
}
|
|
39
|
+
this.remtoes = remotes;
|
|
40
|
+
}
|
|
41
|
+
create(declarations) {
|
|
42
|
+
const groups = {};
|
|
43
|
+
const mandatory = new Set(this.mandatory);
|
|
44
|
+
declarations.sort((a, b) => (mandatory.has(b.family) ? 1 : 0) - (mandatory.has(a.family) ? 1 : 0));
|
|
45
|
+
for (const declaration of declarations) {
|
|
46
|
+
const family = this.families[declaration.family];
|
|
47
|
+
if (family === undefined)
|
|
48
|
+
throw new Error(`Directive family '${declaration.family}' not found.`);
|
|
49
|
+
const directive = family.create(declaration.name, declaration.value, this.remtoes);
|
|
50
|
+
groups[family.name] ??= [];
|
|
51
|
+
groups[family.name].push(directive);
|
|
52
|
+
mandatory.delete(family.name);
|
|
53
|
+
}
|
|
54
|
+
const sets = [];
|
|
55
|
+
for (const family of mandatory)
|
|
56
|
+
sets.push({
|
|
57
|
+
family: this.families[family],
|
|
58
|
+
directives: []
|
|
59
|
+
});
|
|
60
|
+
for (const [family, directives] of Object.entries(groups))
|
|
61
|
+
sets.push({
|
|
62
|
+
family: this.families[family],
|
|
63
|
+
directives
|
|
64
|
+
});
|
|
65
|
+
return new Directives(sets);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DirectivesFactory = DirectivesFactory;
|
|
69
|
+
exports.shortcuts = new Map([
|
|
70
|
+
['anonymous', 'auth:anonymous'],
|
|
71
|
+
['id', 'auth:id'],
|
|
72
|
+
['role', 'auth:role'],
|
|
73
|
+
['rule', 'auth:rule'],
|
|
74
|
+
['incept', 'auth:incept']
|
|
75
|
+
]);
|
|
76
|
+
//# sourceMappingURL=Directive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Directive.js","sourceRoot":"","sources":["../source/Directive.ts"],"names":[],"mappings":";;;AAIA,MAAa,UAAU;IACJ,UAAU,CAAgB;IAE3C,YAAoB,UAA0B;QAC5C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAEM,KAAK,CAAC,SAAS,CAAE,OAAwB,EAAE,UAA2B;QAC3E,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;YACvC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;YAE1F,IAAI,MAAM,KAAK,IAAI,EAAE;gBACnB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAElC,OAAO,MAAM,CAAA;aACd;SACF;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,KAAK,CAAC,MAAM,CAAE,OAAwB,EAAE,QAAyB;QACtE,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU;YACrC,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS;gBACvC,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IAC5E,CAAC;IAEM,KAAK,CAAE,UAAsB;QAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IAChD,CAAC;CACF;AA9BD,gCA8BC;AAED,MAAa,iBAAiB;IACX,OAAO,CAAS;IAChB,QAAQ,GAA2B,EAAE,CAAA;IACrC,SAAS,GAAa,EAAE,C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I,CAAC,SAAS,CAAC,CAAA;YACnC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;SAC9B;QAED,MAAM,IAAI,GAAmB,EAAE,CAAA;QAE/B,KAAK,MAAM,MAAM,IAAI,SAAS;YAC5B,IAAI,CAAC,IAAI,CAAC;gBACR,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC7B,UAAU,EAAE,EAAE;aACf,CAAC,CAAA;QAEJ,KAAK,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YACvD,IAAI,CAAC,IAAI,CAAC;gBACR,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC7B,UAAU;aACX,CAAC,CAAA;QAEJ,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;CACF;AApDD,8CAoDC;AAEY,QAAA,SAAS,GAAyB,IAAI,GAAG,CAAC;IACrD,CAAC,WAAW,EAAE,gBAAgB,CAAC;IAC/B,CAAC,IAAI,EAAE,SAAS,CAAC;IACjB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,QAAQ,EAAE,aAAa,CAAC;CAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Component, type Reply } from '@toa.io/core';
|
|
2
|
+
import { type Remotes } from './Remotes';
|
|
3
|
+
import { Mapping } from './Mapping';
|
|
4
|
+
import { type Context } from './Context';
|
|
5
|
+
import type * as RTD from './RTD';
|
|
6
|
+
import type * as http from './HTTP';
|
|
7
|
+
export declare class Endpoint implements RTD.Endpoint<Endpoint> {
|
|
8
|
+
private readonly endpoint;
|
|
9
|
+
private readonly mapping;
|
|
10
|
+
private readonly discovery;
|
|
11
|
+
private remote;
|
|
12
|
+
constructor(endpoint: string, mapping: Mapping, discovery: Promise<Component>);
|
|
13
|
+
call(body: any, query: http.Query, parameters: RTD.Parameter[]): Promise<Reply>;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare class EndpointFactory implements RTD.EndpointsFactory<Endpoint> {
|
|
17
|
+
private readonly remotes;
|
|
18
|
+
constructor(remotes: Remotes);
|
|
19
|
+
create(method: RTD.syntax.Method, context: Context): Endpoint;
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EndpointFactory = exports.Endpoint = void 0;
|
|
4
|
+
const Mapping_1 = require("./Mapping");
|
|
5
|
+
class Endpoint {
|
|
6
|
+
endpoint;
|
|
7
|
+
mapping;
|
|
8
|
+
discovery;
|
|
9
|
+
remote = null;
|
|
10
|
+
constructor(endpoint, mapping, discovery) {
|
|
11
|
+
this.endpoint = endpoint;
|
|
12
|
+
this.mapping = mapping;
|
|
13
|
+
this.discovery = discovery;
|
|
14
|
+
}
|
|
15
|
+
async call(body, query, parameters) {
|
|
16
|
+
const request = this.mapping.fit(body, query, parameters);
|
|
17
|
+
this.remote ??= await this.discovery;
|
|
18
|
+
return await this.remote.invoke(this.endpoint, request);
|
|
19
|
+
}
|
|
20
|
+
async close() {
|
|
21
|
+
this.remote ??= await this.discovery;
|
|
22
|
+
await this.remote.disconnect();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.Endpoint = Endpoint;
|
|
26
|
+
class EndpointFactory {
|
|
27
|
+
remotes;
|
|
28
|
+
constructor(remotes) {
|
|
29
|
+
this.remotes = remotes;
|
|
30
|
+
}
|
|
31
|
+
create(method, context) {
|
|
32
|
+
if (method.mapping === undefined)
|
|
33
|
+
throw new Error('Cannot create Endpoint without mapping.');
|
|
34
|
+
const mapping = Mapping_1.Mapping.create(method.verb, method.mapping.query);
|
|
35
|
+
const namespace = method.mapping.namespace ?? context.extension?.namespace;
|
|
36
|
+
const component = method.mapping.component ?? context.extension?.component;
|
|
37
|
+
if (namespace === undefined || component === undefined)
|
|
38
|
+
throw new Error('Annotation endpoints must be fully qualified.');
|
|
39
|
+
const discovery = this.remotes.discover(namespace, component);
|
|
40
|
+
return new Endpoint(method.mapping.endpoint, mapping, discovery);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.EndpointFactory = EndpointFactory;
|
|
44
|
+
//# sourceMappingURL=Endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Endpoint.js","sourceRoot":"","sources":["../source/Endpoint.ts"],"names":[],"mappings":";;;AAEA,uCAAmC;AAKnC,MAAa,QAAQ;IACF,QAAQ,CAAQ;IAChB,OAAO,CAAS;IAChB,SAAS,CAAoB;IACtC,MAAM,GAAqB,IAAI,CAAA;IAEvC,YAAoB,QAAgB,EAAE,OAAgB,EAAE,SAA6B;QACnF,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAEM,KAAK,CAAC,IAAI,CAAE,IAAS,EAAE,KAAiB,EAAE,UAA2B;QAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAA;QAEzD,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,SAAS,CAAA;QAEpC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,SAAS,CAAA;QAEpC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;IAChC,CAAC;CACF;AAzBD,4BAyBC;AAED,MAAa,eAAe;IACT,OAAO,CAAS;IAEjC,YAAoB,OAAgB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEM,MAAM,CAAE,MAAyB,EAAE,OAAgB;QACxD,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;YAC9B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAE5D,MAAM,OAAO,GAAG,iBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACjE,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,EAAE,SAAS,CAAA;QAC1E,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,EAAE,SAAS,CAAA;QAE1E,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS;YACpD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;QAElE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAE7D,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;IAClE,CAAC;CACF;AAtBD,0CAsBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { syntax } from './RTD';
|
|
2
|
+
import type { Connector, Locator, extensions } from '@toa.io/core';
|
|
3
|
+
export declare class Factory implements extensions.Factory {
|
|
4
|
+
private readonly boot;
|
|
5
|
+
private readonly families;
|
|
6
|
+
constructor(boot: Bootloader);
|
|
7
|
+
tenant(locator: Locator, manifest: syntax.Node): Connector;
|
|
8
|
+
service(): Connector | null;
|
|
9
|
+
private gateway;
|
|
10
|
+
}
|
|
11
|
+
export type Bootloader = typeof import('@toa.io/boot');
|
|
@@ -0,0 +1,67 @@
|
|
|
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.Factory = void 0;
|
|
27
|
+
const Tenant_1 = require("./Tenant");
|
|
28
|
+
const Gateway_1 = require("./Gateway");
|
|
29
|
+
const Remotes_1 = require("./Remotes");
|
|
30
|
+
const RTD_1 = require("./RTD");
|
|
31
|
+
const HTTP_1 = require("./HTTP");
|
|
32
|
+
const Endpoint_1 = require("./Endpoint");
|
|
33
|
+
const directives = __importStar(require("./directives"));
|
|
34
|
+
const Directive_1 = require("./Directive");
|
|
35
|
+
const Composition_1 = require("./Composition");
|
|
36
|
+
const root = __importStar(require("./root"));
|
|
37
|
+
class Factory {
|
|
38
|
+
boot;
|
|
39
|
+
families;
|
|
40
|
+
constructor(boot) {
|
|
41
|
+
this.boot = boot;
|
|
42
|
+
this.families = directives.families;
|
|
43
|
+
}
|
|
44
|
+
tenant(locator, manifest) {
|
|
45
|
+
const broadcast = this.boot.bindings.broadcast(CHANNEL, locator.id);
|
|
46
|
+
return new Tenant_1.Tenant(broadcast, locator, manifest);
|
|
47
|
+
}
|
|
48
|
+
service() {
|
|
49
|
+
return this.gateway();
|
|
50
|
+
}
|
|
51
|
+
gateway() {
|
|
52
|
+
const broadcast = this.boot.bindings.broadcast(CHANNEL);
|
|
53
|
+
const server = HTTP_1.Server.create({ methods: RTD_1.syntax.verbs });
|
|
54
|
+
const remotes = new Remotes_1.Remotes(this.boot);
|
|
55
|
+
const methods = new Endpoint_1.EndpointFactory(remotes);
|
|
56
|
+
const directives = new Directive_1.DirectivesFactory(this.families, remotes);
|
|
57
|
+
const node = root.resolve();
|
|
58
|
+
const tree = new RTD_1.Tree(node, methods, directives);
|
|
59
|
+
const composition = new Composition_1.Composition(this.boot);
|
|
60
|
+
const gateway = new Gateway_1.Gateway(broadcast, server, tree);
|
|
61
|
+
gateway.depends(composition);
|
|
62
|
+
return gateway;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Factory = Factory;
|
|
66
|
+
const CHANNEL = 'exposition';
|
|
67
|
+
//# sourceMappingURL=Factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAiC;AACjC,uCAAmC;AACnC,uCAAmC;AACnC,+BAAoC;AACpC,iCAA+B;AAC/B,yCAA2D;AAC3D,yDAA0C;AAC1C,2CAA6E;AAC7E,+CAA2C;AAC3C,6CAA8B;AAG9B,MAAa,OAAO;IACD,IAAI,CAAY;IAChB,QAAQ,CAAU;IAEnC,YAAoB,IAAg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AAC;CACF;AAnCD,0BAmCC;AAED,MAAM,OAAO,GAAG,YAAY,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type bindings, Connector } from '@toa.io/core';
|
|
2
|
+
import * as http from './HTTP';
|
|
3
|
+
import { type Tree } from './RTD';
|
|
4
|
+
import { type Label } from './discovery';
|
|
5
|
+
import { type Endpoint } from './Endpoint';
|
|
6
|
+
import { type Directives } from './Directive';
|
|
7
|
+
export declare class Gateway extends Connector {
|
|
8
|
+
private readonly broadcast;
|
|
9
|
+
private readonly tree;
|
|
10
|
+
constructor(broadcast: Broadcast, server: http.Server, tree: Tree<Endpoint, Directives>);
|
|
11
|
+
protected open(): Promise<void>;
|
|
12
|
+
protected dispose(): void;
|
|
13
|
+
private process;
|
|
14
|
+
private call;
|
|
15
|
+
private discover;
|
|
16
|
+
private merge;
|
|
17
|
+
}
|
|
18
|
+
type Broadcast = bindings.Broadcast<Label>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
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.Gateway = void 0;
|
|
27
|
+
const core_1 = require("@toa.io/core");
|
|
28
|
+
const nopeable_1 = require("nopeable");
|
|
29
|
+
const http = __importStar(require("./HTTP"));
|
|
30
|
+
const exceptions_1 = require("./exceptions");
|
|
31
|
+
class Gateway extends core_1.Connector {
|
|
32
|
+
broadcast;
|
|
33
|
+
tree;
|
|
34
|
+
constructor(broadcast, server, tree) {
|
|
35
|
+
super();
|
|
36
|
+
this.broadcast = broadcast;
|
|
37
|
+
this.tree = tree;
|
|
38
|
+
this.depends(broadcast);
|
|
39
|
+
this.depends(server);
|
|
40
|
+
server.attach(this.process.bind(this));
|
|
41
|
+
}
|
|
42
|
+
async open() {
|
|
43
|
+
await this.discover();
|
|
44
|
+
console.info('Gateway has started and is awaiting resource branches.');
|
|
45
|
+
}
|
|
46
|
+
dispose() {
|
|
47
|
+
console.info('Gateway is closed.');
|
|
48
|
+
}
|
|
49
|
+
async process(request) {
|
|
50
|
+
if (request.path[request.path.length - 1] !== '/')
|
|
51
|
+
throw new http.NotFound('Trailing slash is required.');
|
|
52
|
+
const match = this.tree.match(request.path);
|
|
53
|
+
if (match === null)
|
|
54
|
+
throw new http.NotFound();
|
|
55
|
+
const { node, parameters } = match;
|
|
56
|
+
if (!(request.method in node.methods))
|
|
57
|
+
throw new http.MethodNotAllowed();
|
|
58
|
+
const method = node.methods[request.method];
|
|
59
|
+
const interruption = await method.directives.preflight(request, parameters);
|
|
60
|
+
const response = interruption ?? await this.call(method, request, parameters);
|
|
61
|
+
await method.directives.settle(request, response);
|
|
62
|
+
return response;
|
|
63
|
+
}
|
|
64
|
+
async call(method, request, parameters) {
|
|
65
|
+
if (method.endpoint === null)
|
|
66
|
+
throw new http.MethodNotAllowed();
|
|
67
|
+
const reply = await method.endpoint
|
|
68
|
+
.call(request.body, request.query, parameters)
|
|
69
|
+
.catch(exceptions_1.rethrow);
|
|
70
|
+
if (reply instanceof nopeable_1.Nope)
|
|
71
|
+
throw new http.Conflict(reply);
|
|
72
|
+
return { body: reply };
|
|
73
|
+
}
|
|
74
|
+
async discover() {
|
|
75
|
+
await this.broadcast.receive('expose', this.merge.bind(this));
|
|
76
|
+
await this.broadcast.transmit('ping', null);
|
|
77
|
+
}
|
|
78
|
+
merge(branch) {
|
|
79
|
+
try {
|
|
80
|
+
this.tree.merge(branch.node, branch);
|
|
81
|
+
console.info('Resource branch of ' +
|
|
82
|
+
`'${branch.namespace}.${branch.component}' has been merged.`);
|
|
83
|
+
}
|
|
84
|
+
catch (exception) {
|
|
85
|
+
console.error(exception);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.Gateway = Gateway;
|
|
90
|
+
//# sourceMappingURL=Gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gateway.js","sourceRoot":"","sources":["../source/Gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAuD;AACvD,uCAA8C;AAC9C,6CAA8B;AAC9B,6CAAsC;AAOtC,MAAa,OAAQ,SAAQ,gBAAS;IACnB,SAAS,CAAW;IACpB,IAAI,CAA4B;IAEjD,YAAoB,SAAoB,EAAE,MAAmB,EAAE,IAAgC;QAC7F,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACvB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA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declare class Server extends Connector {
|
|
4
|
+
private readonly debug;
|
|
5
|
+
private readonly app;
|
|
6
|
+
private server?;
|
|
7
|
+
private constructor();
|
|
8
|
+
static create(options?: Partial<Properties>): Server;
|
|
9
|
+
attach(process: Processing): void;
|
|
10
|
+
protected open(): Promise<void>;
|
|
11
|
+
protected close(): Promise<void>;
|
|
12
|
+
protected dispose(): void;
|
|
13
|
+
private read;
|
|
14
|
+
private success;
|
|
15
|
+
private fail;
|
|
16
|
+
}
|
|
17
|
+
interface Properties {
|
|
18
|
+
methods: Set<string>;
|
|
19
|
+
debug: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type Processing = (input: IncomingMessage) => Promise<OutgoingMessage>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="jest" />
|
|
3
|
+
import { Buffer } from 'buffer';
|
|
4
|
+
import type { IncomingMessage } from './messages';
|
|
5
|
+
import type { NextFunction, Response, Express, Request } from 'express';
|
|
6
|
+
import type { CorsOptions } from 'cors';
|
|
7
|
+
export declare function createRequest(req?: Partial<Request>, content?: string | Buffer): jest.MockedObject<Request>;
|
|
8
|
+
export declare function createIncomingMessage(path: string, method?: string): IncomingMessage;
|
|
9
|
+
export declare const res: jest.MockedObject<Response<any, Record<string, any>>>;
|
|
10
|
+
export declare const next: NextFunction;
|
|
11
|
+
export declare const express: jest.Mock<jest.Mock<Express, any, any>, [], any>;
|
|
12
|
+
export declare const cors: jest.Mock<() => undefined, [_: CorsOptions], any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cors = exports.express = exports.next = exports.res = exports.createIncomingMessage = exports.createRequest = void 0;
|
|
4
|
+
const buffer_1 = require("buffer");
|
|
5
|
+
const stream_1 = require("stream");
|
|
6
|
+
const server = {
|
|
7
|
+
close: jest.fn()
|
|
8
|
+
};
|
|
9
|
+
const app = {
|
|
10
|
+
enable: jest.fn(),
|
|
11
|
+
disable: jest.fn(),
|
|
12
|
+
use: jest.fn(),
|
|
13
|
+
listen: jest.fn(() => server)
|
|
14
|
+
};
|
|
15
|
+
function createRequest(req = {}, content = '') {
|
|
16
|
+
const buffer = buffer_1.Buffer.isBuffer(content) ? content : buffer_1.Buffer.from(content);
|
|
17
|
+
const stream = stream_1.Readable.from(buffer);
|
|
18
|
+
Object.assign(stream, { headers: {} }, req);
|
|
19
|
+
return stream;
|
|
20
|
+
}
|
|
21
|
+
exports.createRequest = createRequest;
|
|
22
|
+
function createIncomingMessage(path, method = 'GET') {
|
|
23
|
+
return { method, path, headers: {}, body: undefined, query: {} };
|
|
24
|
+
}
|
|
25
|
+
exports.createIncomingMessage = createIncomingMessage;
|
|
26
|
+
exports.res = {
|
|
27
|
+
status: jest.fn(() => exports.res),
|
|
28
|
+
sendStatus: jest.fn(() => exports.res),
|
|
29
|
+
set: jest.fn(() => exports.res),
|
|
30
|
+
send: jest.fn(() => exports.res),
|
|
31
|
+
end: jest.fn(() => exports.res)
|
|
32
|
+
};
|
|
33
|
+
exports.next = jest.fn();
|
|
34
|
+
exports.express = jest.fn(() => app);
|
|
35
|
+
exports.cors = jest.fn((_) => () => undefined);
|
|
36
|
+
//# sourceMappingURL=Server.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Server.fixtures.js","sourceRoot":"","sources":["../../source/HTTP/Server.fixtures.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAC/B,mCAAiC;AAMjC,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;CACoB,CAAA;AAEtC,MAAM,GAAG,GAAG;IACV,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;IACjB,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;IAClB,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;IACd,MAAM,EAAE,IAAI,CAAC,E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