@toa.io/definitions 1.0.0-alpha.292 → 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/digest/extensions.exposition.json +1 -1
- package/package.json +24 -7
- package/readme.md +1 -0
- package/transpiled/bridges.node/exports.js +25 -2
- package/transpiled/bridges.node/exports.js.map +1 -1
- package/transpiled/digest/generate.js +23 -3
- package/transpiled/digest/generate.js.map +1 -1
- package/transpiled/digest/read.d.ts +8 -0
- package/transpiled/digest/read.js +11 -0
- package/transpiled/digest/read.js.map +1 -1
- package/transpiled/extensions.exposition/index.d.ts +1 -0
- package/transpiled/extensions.exposition/index.js +1 -0
- package/transpiled/extensions.exposition/index.js.map +1 -1
- package/transpiled/extensions.exposition/packages.d.ts +11 -0
- package/transpiled/extensions.exposition/packages.js +17 -0
- package/transpiled/extensions.exposition/packages.js.map +1 -0
- package/transpiled/extensions.storages/index.d.ts +1 -0
- package/transpiled/extensions.storages/index.js +1 -0
- package/transpiled/extensions.storages/index.js.map +1 -1
- package/transpiled/extensions.storages/packages.d.ts +19 -0
- package/transpiled/extensions.storages/packages.js +41 -0
- package/transpiled/extensions.storages/packages.js.map +1 -0
- package/CHANGELOG.md +0 -13
- package/source/bindings.amqp/annotation.ts +0 -26
- package/source/bindings.amqp/context.ts +0 -68
- package/source/bindings.amqp/deployment.ts +0 -14
- package/source/bindings.amqp/index.ts +0 -9
- package/source/bindings.amqp/instance.ts +0 -3
- package/source/bindings.amqp/sources.ts +0 -39
- package/source/bindings.loop/index.ts +0 -3
- package/source/bridges.bash/const.ts +0 -2
- package/source/bridges.bash/define.ts +0 -38
- package/source/bridges.bash/index.ts +0 -2
- package/source/bridges.node/define.ts +0 -69
- package/source/bridges.node/exports.ts +0 -175
- package/source/bridges.node/index.ts +0 -6
- package/source/bridges.node/operations.ts +0 -127
- package/source/bridges.node/sources.ts +0 -44
- package/source/definition.ts +0 -38
- package/source/digest/generate.ts +0 -77
- package/source/digest/read.ts +0 -39
- package/source/extensions.cadence/components.ts +0 -6
- package/source/extensions.cadence/const.ts +0 -31
- package/source/extensions.cadence/context.ts +0 -10
- package/source/extensions.cadence/deployment.ts +0 -37
- package/source/extensions.cadence/index.ts +0 -8
- package/source/extensions.cadence/manifest.ts +0 -64
- package/source/extensions.cadence/schemas.ts +0 -10
- package/source/extensions.cadence/types.ts +0 -41
- package/source/extensions.configuration/components.ts +0 -6
- package/source/extensions.configuration/const.ts +0 -30
- package/source/extensions.configuration/context.ts +0 -13
- package/source/extensions.configuration/deployment.ts +0 -159
- package/source/extensions.configuration/epoch.ts +0 -22
- package/source/extensions.configuration/index.ts +0 -10
- package/source/extensions.configuration/manifest.ts +0 -12
- package/source/extensions.configuration/schemas.ts +0 -9
- package/source/extensions.exposition/Annotation.ts +0 -91
- package/source/extensions.exposition/components.ts +0 -6
- package/source/extensions.exposition/const.ts +0 -45
- package/source/extensions.exposition/deployment.ts +0 -95
- package/source/extensions.exposition/index.ts +0 -16
- package/source/extensions.exposition/manifest.ts +0 -56
- package/source/extensions.exposition/schemas.ts +0 -16
- package/source/extensions.exposition/shortcuts.ts +0 -14
- package/source/extensions.exposition/syntax/index.ts +0 -2
- package/source/extensions.exposition/syntax/parse.ts +0 -171
- package/source/extensions.exposition/syntax/types.ts +0 -69
- package/source/extensions.fetch/context.ts +0 -10
- package/source/extensions.fetch/index.ts +0 -1
- package/source/extensions.introspection/annotation.ts +0 -87
- package/source/extensions.introspection/components.ts +0 -13
- package/source/extensions.introspection/const.ts +0 -46
- package/source/extensions.introspection/deployment.ts +0 -48
- package/source/extensions.introspection/index.ts +0 -6
- package/source/extensions.introspection/manifest.ts +0 -18
- package/source/extensions.introspection/schemas.ts +0 -12
- package/source/extensions.realtime/components.ts +0 -5
- package/source/extensions.realtime/deployment.ts +0 -89
- package/source/extensions.realtime/index.ts +0 -4
- package/source/extensions.stash/context.ts +0 -10
- package/source/extensions.stash/deployment.ts +0 -22
- package/source/extensions.stash/index.ts +0 -2
- package/source/extensions.state/context.ts +0 -9
- package/source/extensions.state/index.ts +0 -1
- package/source/extensions.storages/Annotation.ts +0 -57
- package/source/extensions.storages/context.ts +0 -14
- package/source/extensions.storages/deployment.ts +0 -91
- package/source/extensions.storages/index.ts +0 -9
- package/source/extensions.storages/manifest.ts +0 -7
- package/source/extensions.storages/schemas.ts +0 -15
- package/source/extensions.storages/secrets.ts +0 -22
- package/source/extensions.telemetry/const.ts +0 -6
- package/source/extensions.telemetry/context.ts +0 -11
- package/source/extensions.telemetry/deployment.ts +0 -91
- package/source/extensions.telemetry/index.ts +0 -5
- package/source/extensions.telemetry/ready.ts +0 -33
- package/source/index.ts +0 -2
- package/source/storages.mongodb/deployment.ts +0 -22
- package/source/storages.mongodb/index.ts +0 -1
- package/source/version.ts +0 -10
- package/transpiled/bindings.amqp/annotation.test.d.ts +0 -1
- package/transpiled/bindings.amqp/annotation.test.js +0 -36
- package/transpiled/bindings.amqp/annotation.test.js.map +0 -1
- package/transpiled/bindings.amqp/properties.test.d.ts +0 -1
- package/transpiled/bindings.amqp/properties.test.js +0 -7
- package/transpiled/bindings.amqp/properties.test.js.map +0 -1
- package/transpiled/bindings.loop/properties.test.d.ts +0 -1
- package/transpiled/bindings.loop/properties.test.js +0 -7
- package/transpiled/bindings.loop/properties.test.js.map +0 -1
- package/transpiled/bridges.node/exports.test.d.ts +0 -1
- package/transpiled/bridges.node/exports.test.js +0 -88
- package/transpiled/bridges.node/exports.test.js.map +0 -1
- package/transpiled/bridges.node/operations.test.d.ts +0 -1
- package/transpiled/bridges.node/operations.test.js +0 -108
- package/transpiled/bridges.node/operations.test.js.map +0 -1
- package/transpiled/extensions.cadence/manifest.test.d.ts +0 -1
- package/transpiled/extensions.cadence/manifest.test.js +0 -41
- package/transpiled/extensions.cadence/manifest.test.js.map +0 -1
- package/transpiled/extensions.configuration/deployment.test.d.ts +0 -1
- package/transpiled/extensions.configuration/deployment.test.js +0 -74
- package/transpiled/extensions.configuration/deployment.test.js.map +0 -1
- package/transpiled/extensions.configuration/manifest.test.d.ts +0 -1
- package/transpiled/extensions.configuration/manifest.test.js +0 -14
- package/transpiled/extensions.configuration/manifest.test.js.map +0 -1
- package/transpiled/extensions.exposition/manifest.test.d.ts +0 -1
- package/transpiled/extensions.exposition/manifest.test.js +0 -38
- package/transpiled/extensions.exposition/manifest.test.js.map +0 -1
- package/transpiled/extensions.exposition/schemas.test.d.ts +0 -1
- package/transpiled/extensions.exposition/schemas.test.js +0 -22
- package/transpiled/extensions.exposition/schemas.test.js.map +0 -1
- package/transpiled/extensions.exposition/syntax/parse.test.d.ts +0 -1
- package/transpiled/extensions.exposition/syntax/parse.test.js +0 -156
- package/transpiled/extensions.exposition/syntax/parse.test.js.map +0 -1
- package/transpiled/extensions.storages/schemas.test.d.ts +0 -1
- package/transpiled/extensions.storages/schemas.test.js +0 -59
- package/transpiled/extensions.storages/schemas.test.js.map +0 -1
- package/tsconfig.json +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/definitions",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.293",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "What Toa packages declare, read without running them",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -20,11 +20,19 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
"transpiled",
|
|
25
|
+
"digest",
|
|
26
|
+
"schemas",
|
|
27
|
+
"readme.md",
|
|
28
|
+
"!**/tsconfig.tsbuildinfo",
|
|
29
|
+
"!**/*.test.*",
|
|
30
|
+
"!**/.env*"
|
|
31
|
+
],
|
|
23
32
|
"dependencies": {
|
|
24
33
|
"@toa.io/generic": "1.0.0-alpha.292",
|
|
25
|
-
"@toa.io/pointer": "1.0.0-alpha.
|
|
26
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
27
|
-
"oxc-parser": "0.149.0"
|
|
34
|
+
"@toa.io/pointer": "1.0.0-alpha.293",
|
|
35
|
+
"@toa.io/schemas": "1.0.0-alpha.293"
|
|
28
36
|
},
|
|
29
37
|
"scripts": {
|
|
30
38
|
"transpile": "tsc",
|
|
@@ -36,8 +44,17 @@
|
|
|
36
44
|
"./*": "./transpiled/*/index.js"
|
|
37
45
|
},
|
|
38
46
|
"devDependencies": {
|
|
39
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
40
|
-
"openspan": "1.0.0-alpha.
|
|
47
|
+
"@toa.io/core": "1.0.0-alpha.293",
|
|
48
|
+
"openspan": "1.0.0-alpha.293",
|
|
49
|
+
"oxc-parser": "0.149.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"oxc-parser": "0.149.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"oxc-parser": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
41
58
|
},
|
|
42
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "1e05b3ab64758324c58c425f1f8e52e9f35f1da8"
|
|
43
60
|
}
|
package/readme.md
CHANGED
|
@@ -19,6 +19,7 @@ is `@toa.io/operations` beside `@toa.io/cli`, with no extension installed at all
|
|
|
19
19
|
| `annotation` | an extension | norm, normalising the context's block |
|
|
20
20
|
| `standalone` | an extension | norm, deploying it whether or not named |
|
|
21
21
|
| `deployment` | an extension, a connector | operations, rendering the chart |
|
|
22
|
+
| `installs` | an extension, a connector | norm, what a deploy installs — for a component's declaration, and, called with no instance, for the workload that runs its service |
|
|
22
23
|
| `image` | an extension | operations, taking a published image |
|
|
23
24
|
| `context` | an extension | `toa types`, what a component's context has |
|
|
24
25
|
| `properties` | a binding | norm and boot, whether it is asynchronous |
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
2
|
/**
|
|
3
3
|
* What a module exports, read from its source: the name, and what the value is declared as.
|
|
4
4
|
* Nothing is imported, so what a module depends on need not be installed to read it.
|
|
5
5
|
*/
|
|
6
6
|
export function exports(path, text) {
|
|
7
|
-
const { program, errors } =
|
|
7
|
+
const { program, errors } = parser()(path, text);
|
|
8
8
|
if (errors.length > 0)
|
|
9
9
|
throw new Error(`${path}: ${errors[0].message}`);
|
|
10
10
|
const locals = declarations(program.body);
|
|
@@ -32,6 +32,29 @@ function named(node, locals, exported) {
|
|
|
32
32
|
exported.set(name(specifier.exported), binding(specifier.local, locals));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The parser, loaded when a module is read and not before.
|
|
37
|
+
*
|
|
38
|
+
* It is an optional peer of this package rather than a dependency: a composition reads the
|
|
39
|
+
* manifest its build normalised and reads no source at all, so an image carries three and a half
|
|
40
|
+
* megabytes of parser for nothing. What normalises — a workspace and a deploy — has it through
|
|
41
|
+
* `@toa.io/operations`.
|
|
42
|
+
*/
|
|
43
|
+
function parser() {
|
|
44
|
+
if (parse !== undefined)
|
|
45
|
+
return parse;
|
|
46
|
+
try {
|
|
47
|
+
parse = require('oxc-parser').parseSync;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new Error('Reading what a module declares needs `oxc-parser`, which is not installed: it comes ' +
|
|
51
|
+
'with `@toa.io/operations`, which a workspace that composes or deploys has.', { cause: error });
|
|
52
|
+
}
|
|
53
|
+
return parse;
|
|
54
|
+
}
|
|
55
|
+
// what `find` returns is a package directory, and the parser is a module of this machine's
|
|
56
|
+
const require = createRequire(import.meta.url);
|
|
57
|
+
let parse;
|
|
35
58
|
/** `module.exports = { … }`, `module.exports.x = …` and `exports.x = …` */
|
|
36
59
|
function assigned(expression, locals, exported) {
|
|
37
60
|
if (expression.type !== 'AssignmentExpression' || expression.operator !== '=')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../source/bridges.node/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../source/bridges.node/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAK3C;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,IAAY;IAChD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAEhD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;IAEvE,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,QAAQ,GAAY,IAAI,GAAG,EAAE,CAAA;IAEnC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,wBAAwB;YAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;aACpE,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B;YAC/C,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAA;aACvD,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB;YAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC3F,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAeD,SAAS,KAAK,CAAC,IAAS,EAAE,MAAc,EAAE,QAAiB;IACzD,IAAI,IAAI,CAAC,UAAU,KAAK,MAAM;QAAE,OAAM;IAEtC,MAAM,WAAW,GAAG,IA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AAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/D,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,sFAAsF;AACtF,SAAS,UAAU,CAAC,MAAa;IAC/B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;QAEvE,OAAO,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC;AAID,MAAM,KAAK,GAAY,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
3
|
-
import { mkdirSync, readdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
/**
|
|
5
5
|
* Writes the digest of the components each extension ships: their manifests as norm reads
|
|
6
6
|
* them, with every path that reaches into a package replaced by that package's name — so the
|
|
@@ -28,11 +28,31 @@ for (const suffix of DIGESTED) {
|
|
|
28
28
|
for (const dirent of readdirSync(directory, { withFileTypes: true })) {
|
|
29
29
|
if (!dirent.isDirectory())
|
|
30
30
|
continue;
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const path = join(directory, dirent.name);
|
|
32
|
+
const manifest = await component(path);
|
|
33
|
+
const entry = {
|
|
34
|
+
label: dirent.name.replace('.', '-'),
|
|
35
|
+
manifest: relativize(manifest)
|
|
36
|
+
};
|
|
37
|
+
const packages = dependencies(path);
|
|
38
|
+
if (packages !== undefined)
|
|
39
|
+
entry.packages = packages;
|
|
40
|
+
entries.push(entry);
|
|
33
41
|
}
|
|
34
42
|
writeFileSync(join(OUT, suffix + '.json'), JSON.stringify(entries));
|
|
35
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* What a component of an extension's own declares in its manifest. A composition that runs the
|
|
46
|
+
* extension's service runs these components in its own process, and a deploy installs what they
|
|
47
|
+
* import without having the extension to read it from.
|
|
48
|
+
*/
|
|
49
|
+
function dependencies(path) {
|
|
50
|
+
const manifest = join(path, 'package.json');
|
|
51
|
+
if (!existsSync(manifest))
|
|
52
|
+
return undefined;
|
|
53
|
+
const { dependencies } = JSON.parse(readFileSync(manifest, 'utf8'));
|
|
54
|
+
return dependencies;
|
|
55
|
+
}
|
|
36
56
|
function root(name) {
|
|
37
57
|
return dirname(require.resolve(name + '/package.json'));
|
|
38
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../source/digest/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../source/digest/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,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AAO,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAEtD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,MAAM,GAA4B,EAAE,CAAA;QAE1C,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAC7C,IAAI,GAAG,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;QAEvD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,KAAK;QACnC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,GAAG,CAAC;YAC1D,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAErF,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* beside it; a running service reads them from the extension, where their code is.
|
|
5
5
|
*/
|
|
6
6
|
export declare function components(suffix: string, filter?: (label: string) => boolean): Components;
|
|
7
|
+
/**
|
|
8
|
+
* What the components an extension ships declare in their manifests, by package name — read
|
|
9
|
+
* from the digest for the reason the manifests are: the extension is not installed beside a
|
|
10
|
+
* deploy, and a composition that runs its service runs these components in its own process.
|
|
11
|
+
*/
|
|
12
|
+
export declare function packages(suffix: string): Record<string, string>;
|
|
7
13
|
export interface Components {
|
|
8
14
|
/** what a chart names each component's workload by: `identity-basic` */
|
|
9
15
|
labels: string[];
|
|
@@ -13,4 +19,6 @@ export interface Components {
|
|
|
13
19
|
export interface Entry {
|
|
14
20
|
label: string;
|
|
15
21
|
manifest: object;
|
|
22
|
+
/** the component's own `dependencies`, where it ships a manifest */
|
|
23
|
+
packages?: Record<string, string>;
|
|
16
24
|
}
|
|
@@ -19,4 +19,15 @@ function digest(suffix) {
|
|
|
19
19
|
const cache = {};
|
|
20
20
|
/** `transpiled/digest/read.js` → `digest/` */
|
|
21
21
|
const ROOT = resolve(import.meta.dirname, '../../digest');
|
|
22
|
+
/**
|
|
23
|
+
* What the components an extension ships declare in their manifests, by package name — read
|
|
24
|
+
* from the digest for the reason the manifests are: the extension is not installed beside a
|
|
25
|
+
* deploy, and a composition that runs its service runs these components in its own process.
|
|
26
|
+
*/
|
|
27
|
+
export function packages(suffix) {
|
|
28
|
+
const packages = {};
|
|
29
|
+
for (const entry of digest(suffix))
|
|
30
|
+
Object.assign(packages, entry.packages);
|
|
31
|
+
return packages;
|
|
32
|
+
}
|
|
22
33
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../source/digest/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,MAAmC;IAC5E,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAA;IAEvF,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;QACnD,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eA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,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;IAEnF,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC;AAED,MAAM,KAAK,GAA4B,EAAE,CAAA;AAEzC,8CAA8C;AAC9C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;AAEzD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,MAAM,QAAQ,GAA2B,EAAE,CAAA;IAE3C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;QAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IAE3E,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.exposition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.exposition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a deploy installs for the exposition.
|
|
3
|
+
*
|
|
4
|
+
* A component that declares the extension needs nothing of its own — what it reaches is the
|
|
5
|
+
* gateway, in another process. The gateway is what brings packages with it: the identity
|
|
6
|
+
* components run inside it, and each declares what it imports in its own manifest. Where the
|
|
7
|
+
* gateway is a service of its own, its image installs them beside the components; where a
|
|
8
|
+
* composition runs it, they are installed beside Toa, which is where the composition's
|
|
9
|
+
* process resolves them from.
|
|
10
|
+
*/
|
|
11
|
+
export declare function installs(instance: unknown): Record<string, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { packages } from '../digest/read.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a deploy installs for the exposition.
|
|
4
|
+
*
|
|
5
|
+
* A component that declares the extension needs nothing of its own — what it reaches is the
|
|
6
|
+
* gateway, in another process. The gateway is what brings packages with it: the identity
|
|
7
|
+
* components run inside it, and each declares what it imports in its own manifest. Where the
|
|
8
|
+
* gateway is a service of its own, its image installs them beside the components; where a
|
|
9
|
+
* composition runs it, they are installed beside Toa, which is where the composition's
|
|
10
|
+
* process resolves them from.
|
|
11
|
+
*/
|
|
12
|
+
export function installs(instance) {
|
|
13
|
+
if (instance !== undefined)
|
|
14
|
+
return {};
|
|
15
|
+
return packages('extensions.exposition');
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../source/extensions.exposition/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAiB;IACxC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IAErC,OAAO,QAAQ,CAAC,uBAAuB,CAAC,CAAA;AAC1C,CAAC"}
|
|
@@ -2,6 +2,7 @@ export { deployment, ENV_PREFIX } from './deployment.js';
|
|
|
2
2
|
export { manifest } from './manifest.js';
|
|
3
3
|
export { validateAnnotation } from './Annotation.js';
|
|
4
4
|
export { secrets } from './secrets.js';
|
|
5
|
+
export { packages, installs } from './packages.js';
|
|
5
6
|
export { context } from './context.js';
|
|
6
7
|
export * as schemas from './schemas.js';
|
|
7
8
|
export type { Annotation, Declaration, Provider } from './Annotation.js';
|
|
@@ -2,6 +2,7 @@ export { deployment, ENV_PREFIX } from './deployment.js';
|
|
|
2
2
|
export { manifest } from './manifest.js';
|
|
3
3
|
export { validateAnnotation } from './Annotation.js';
|
|
4
4
|
export { secrets } from './secrets.js';
|
|
5
|
+
export { packages, installs } from './packages.js';
|
|
5
6
|
export { context } from './context.js';
|
|
6
7
|
export * as schemas from './schemas.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.storages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.storages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Provider } from './secrets.js';
|
|
2
|
+
import type { Instance } from './deployment.js';
|
|
3
|
+
/**
|
|
4
|
+
* What each provider is written against, stated apart from the provider for the reason its
|
|
5
|
+
* secrets are: so that a deploy installs the SDK without loading it, and an image carries no
|
|
6
|
+
* SDK a declaration does not name. These are the extension's optional peers at the versions it
|
|
7
|
+
* declares them — `packages.test.ts` is what keeps the two the same.
|
|
8
|
+
*/
|
|
9
|
+
export declare const packages: Record<Provider, Readonly<Record<string, string>>>;
|
|
10
|
+
/**
|
|
11
|
+
* What a deploy installs so that this component's storages run: the packages of the providers
|
|
12
|
+
* of the storages it declares. A component that declares the extension and names no storage —
|
|
13
|
+
* `storages: ~`, which is what `exposition.octets` declares — reaches every storage there is,
|
|
14
|
+
* and takes every provider with it.
|
|
15
|
+
*
|
|
16
|
+
* A storage is a component's to declare, so there is nothing here for a workload that runs
|
|
17
|
+
* this extension's service, which is what no instance means.
|
|
18
|
+
*/
|
|
19
|
+
export declare function installs(instance: Instance | undefined, annotation: unknown): Record<string, string>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each provider is written against, stated apart from the provider for the reason its
|
|
3
|
+
* secrets are: so that a deploy installs the SDK without loading it, and an image carries no
|
|
4
|
+
* SDK a declaration does not name. These are the extension's optional peers at the versions it
|
|
5
|
+
* declares them — `packages.test.ts` is what keeps the two the same.
|
|
6
|
+
*/
|
|
7
|
+
export const packages = {
|
|
8
|
+
s3: { '@aws-sdk/client-s3': '3.1125.0', '@aws-sdk/lib-storage': '3.1125.0' },
|
|
9
|
+
spaces: { '@aws-sdk/client-s3': '3.1125.0', '@aws-sdk/lib-storage': '3.1125.0' },
|
|
10
|
+
cloudinary: { cloudinary: '2.11.0' },
|
|
11
|
+
fs: {},
|
|
12
|
+
tmp: {},
|
|
13
|
+
test: {}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* What a deploy installs so that this component's storages run: the packages of the providers
|
|
17
|
+
* of the storages it declares. A component that declares the extension and names no storage —
|
|
18
|
+
* `storages: ~`, which is what `exposition.octets` declares — reaches every storage there is,
|
|
19
|
+
* and takes every provider with it.
|
|
20
|
+
*
|
|
21
|
+
* A storage is a component's to declare, so there is nothing here for a workload that runs
|
|
22
|
+
* this extension's service, which is what no instance means.
|
|
23
|
+
*/
|
|
24
|
+
export function installs(instance, annotation) {
|
|
25
|
+
if (instance === undefined || !isAnnotation(annotation))
|
|
26
|
+
return {};
|
|
27
|
+
const declared = instance.manifest ?? [];
|
|
28
|
+
const names = declared.length > 0 ? declared : Object.keys(annotation);
|
|
29
|
+
const required = {};
|
|
30
|
+
for (const name of names) {
|
|
31
|
+
const declaration = annotation[name];
|
|
32
|
+
if (declaration === undefined)
|
|
33
|
+
continue;
|
|
34
|
+
Object.assign(required, packages[declaration.provider] ?? {});
|
|
35
|
+
}
|
|
36
|
+
return required;
|
|
37
|
+
}
|
|
38
|
+
function isAnnotation(value) {
|
|
39
|
+
return typeof value === 'object' && value !== null;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../source/extensions.storages/packages.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAuD;IAC1E,EAAE,EAAE,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE;IAC5E,MAAM,EAAE,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,UAAU,EAAE;IAChF,UAAU,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;IACpC,EAAE,EAAE,EAAE;IACN,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,EAAE;CACT,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CACtB,QAA8B,EAC9B,UAAmB;IAEnB,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAA;IAElE,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAA;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACtE,MAAM,QAAQ,GAA2B,EAAE,CAAA;IAE3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;QAEpC,IAAI,WAAW,KAAK,SAAS;YAAE,SAAQ;QAEvC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAC/D,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAA;AACpD,CAAC"}
|
package/CHANGELOG.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [1.0.0-alpha.292](https://github.com/toa-io/toa/compare/v1.0.0-alpha.291...v1.0.0-alpha.292) (2026-09-07)
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* **cli:** the deployment library is a peer, and the binary is the CLI's ([a923f81](https://github.com/toa-io/toa/commit/a923f8173a55ed1c091213a7c7db1863ca1d0ba6))
|
|
11
|
-
* **definitions:** an operation is read from its source ([56ee048](https://github.com/toa-io/toa/commit/56ee0485e7f00fa52bd9de9a4b0c780127b3ee87))
|
|
12
|
-
* **definitions:** the version of Toa is the definitions package's ([3d0272e](https://github.com/toa-io/toa/commit/3d0272ea0ab862f4b6c2e58a2f003f92d0f8a87f))
|
|
13
|
-
* **definitions:** what a package declares is read from one package ([7052341](https://github.com/toa-io/toa/commit/70523411b5d9e2b204c999aa02365173f3bb518d))
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as pointer from '@toa.io/pointer'
|
|
2
|
-
import { type URIMap } from '@toa.io/pointer'
|
|
3
|
-
|
|
4
|
-
export function normalize(declaration: string | Declaration): Annotation {
|
|
5
|
-
const annotation = expand(declaration)
|
|
6
|
-
const context = pointer.normalize(annotation.context)
|
|
7
|
-
const sources = pointer.normalize(annotation.sources)
|
|
8
|
-
|
|
9
|
-
return { context, sources }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function expand(declaration: string | Declaration): Declaration {
|
|
13
|
-
if (typeof declaration === 'string') return { context: { '.': [declaration] } }
|
|
14
|
-
else if (Array.isArray(declaration)) return { context: { '.': declaration } }
|
|
15
|
-
else return declaration
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface Annotation {
|
|
19
|
-
context: URIMap
|
|
20
|
-
sources?: URIMap
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface Declaration {
|
|
24
|
-
context: string | Record<string, string | string[]>
|
|
25
|
-
sources?: Record<string, string | string[]>
|
|
26
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { type Dependency, type Variable } from '@toa.io/operations'
|
|
2
|
-
import { naming } from '@toa.io/pointer'
|
|
3
|
-
import { type Annotation } from './annotation.js'
|
|
4
|
-
|
|
5
|
-
export function createDependency(context: Context): Dependency {
|
|
6
|
-
const global: Variable[] = []
|
|
7
|
-
const variables = { global }
|
|
8
|
-
|
|
9
|
-
const contextVariables = createVariables(context)
|
|
10
|
-
|
|
11
|
-
global.push(...contextVariables)
|
|
12
|
-
|
|
13
|
-
return { variables }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function createVariables(context: Context): Variable[] {
|
|
17
|
-
const variables: Variable[] = []
|
|
18
|
-
const uris = JSON.stringify(context)
|
|
19
|
-
|
|
20
|
-
const contextVariable: Variable = {
|
|
21
|
-
name: VARIABLE,
|
|
22
|
-
value: uris
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const secrets = createSecrets(context)
|
|
26
|
-
|
|
27
|
-
variables.push(contextVariable, ...secrets)
|
|
28
|
-
|
|
29
|
-
return variables
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function createSecrets(context: Context): Variable[] {
|
|
33
|
-
const secrets: Variable[] = []
|
|
34
|
-
|
|
35
|
-
for (const key of Object.keys(context)) {
|
|
36
|
-
const keySecrets = createKeySecrets(key)
|
|
37
|
-
|
|
38
|
-
secrets.push(...keySecrets)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return secrets
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function createKeySecrets(key: string): Variable[] {
|
|
45
|
-
const username = createSecretVariable(key, 'username')
|
|
46
|
-
const password = createSecretVariable(key, 'password')
|
|
47
|
-
|
|
48
|
-
return [username, password]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function createSecretVariable(key: string, secretKey: string): Variable {
|
|
52
|
-
const varKey = key === '.' ? '' : key
|
|
53
|
-
const varName = naming.nameVariable(ID, varKey, secretKey.toUpperCase())
|
|
54
|
-
const secName = naming.nameSecret(ID, key)
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
name: varName,
|
|
58
|
-
secret: {
|
|
59
|
-
name: secName,
|
|
60
|
-
key: secretKey
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const ID = 'amqp-context'
|
|
66
|
-
export const VARIABLE = 'TOA_AMQP_CONTEXT'
|
|
67
|
-
|
|
68
|
-
type Context = Annotation['context']
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Dependency } from '@toa.io/operations'
|
|
2
|
-
import { merge } from '@toa.io/generic'
|
|
3
|
-
import { type Declaration, normalize } from './annotation.js'
|
|
4
|
-
import * as sources from './sources.js'
|
|
5
|
-
import * as context from './context.js'
|
|
6
|
-
import { type Instance } from './instance.js'
|
|
7
|
-
|
|
8
|
-
export function deployment(instances: Instance[], declaration: Declaration): Dependency {
|
|
9
|
-
const annotation = normalize(declaration)
|
|
10
|
-
const contextDependency = context.createDependency(annotation.context)
|
|
11
|
-
const sourcesDependency = sources.createDependency(annotation.sources, instances)
|
|
12
|
-
|
|
13
|
-
return merge(contextDependency, sourcesDependency)
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { bindings } from '@toa.io/core/types'
|
|
2
|
-
|
|
3
|
-
export const properties: bindings.Properties = { async: true }
|
|
4
|
-
|
|
5
|
-
export { deployment } from './deployment.js'
|
|
6
|
-
export { ID as CONTEXT, VARIABLE as CONTEXT_VARIABLE } from './context.js'
|
|
7
|
-
export { ID as SOURCES } from './sources.js'
|
|
8
|
-
|
|
9
|
-
export type { Annotation, Declaration } from './annotation.js'
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createVariables, type Request } from '@toa.io/pointer'
|
|
2
|
-
import { type Manifest } from '@toa.io/norm'
|
|
3
|
-
import { type Dependency } from '@toa.io/operations'
|
|
4
|
-
import { type Instance } from './instance.js'
|
|
5
|
-
import { type Annotation } from './annotation.js'
|
|
6
|
-
|
|
7
|
-
export function createDependency(sources: Sources, instances: Instance[]): Dependency {
|
|
8
|
-
const requests = []
|
|
9
|
-
|
|
10
|
-
for (const instance of instances) {
|
|
11
|
-
const request = createRequest(instance)
|
|
12
|
-
|
|
13
|
-
if (request !== null) requests.push(request)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const variables = createVariables(ID, sources, requests)
|
|
17
|
-
|
|
18
|
-
return { variables }
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function createRequest(instance: Instance): Request | null {
|
|
22
|
-
const group = instance.locator.label
|
|
23
|
-
const selectors = createSelectors(instance.component)
|
|
24
|
-
|
|
25
|
-
if (selectors === null) return null
|
|
26
|
-
else return { group, selectors }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function createSelectors(component: Manifest): string[] | null {
|
|
30
|
-
if (component.receivers === undefined) return null
|
|
31
|
-
|
|
32
|
-
const sources = Object.values(component.receivers).map((receiver) => receiver.source)
|
|
33
|
-
|
|
34
|
-
return sources.filter((source) => source !== undefined) as string[]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const ID = 'amqp-sources'
|
|
38
|
-
|
|
39
|
-
type Sources = Annotation['sources']
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs/promises'
|
|
2
|
-
import { join, extname } from 'node:path'
|
|
3
|
-
import { DIR, EXT } from './const.js'
|
|
4
|
-
import type { component } from '@toa.io/norm'
|
|
5
|
-
|
|
6
|
-
export async function operations(root: string): Promise<component.Operations> {
|
|
7
|
-
const path = join(root, DIR)
|
|
8
|
-
const names = await list(path)
|
|
9
|
-
|
|
10
|
-
const promises = names.map(async (name) => operation(root, name))
|
|
11
|
-
|
|
12
|
-
const operations = await Promise.all(promises)
|
|
13
|
-
|
|
14
|
-
return operations.reduce<component.Operations>((acc, operation, index) => {
|
|
15
|
-
acc[names[index]] = operation
|
|
16
|
-
|
|
17
|
-
return acc
|
|
18
|
-
}, {})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function operation(
|
|
22
|
-
root: string,
|
|
23
|
-
name: string
|
|
24
|
-
): Promise<component.Operation> {
|
|
25
|
-
const path = join(root, DIR, name + EXT)
|
|
26
|
-
|
|
27
|
-
await fs.access(path, fs.constants.F_OK)
|
|
28
|
-
|
|
29
|
-
return { type: 'computation' }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function list(path: string): Promise<string[]> {
|
|
33
|
-
const files = await fs.readdir(path)
|
|
34
|
-
|
|
35
|
-
return files
|
|
36
|
-
.filter((file) => extname(file) === EXT)
|
|
37
|
-
.map((file) => file.slice(0, -EXT.length))
|
|
38
|
-
}
|