@k8ts/instruments 0.9.4 → 0.11.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/dist/core/graph/entity.d.ts +24 -5
- package/dist/core/graph/entity.d.ts.map +1 -1
- package/dist/core/graph/entity.js +11 -5
- package/dist/core/graph/entity.js.map +1 -1
- package/dist/core/graph/node.d.ts +31 -8
- package/dist/core/graph/node.d.ts.map +1 -1
- package/dist/core/graph/node.js +53 -26
- package/dist/core/graph/node.js.map +1 -1
- package/dist/core/graph/origin/entity.d.ts +9 -4
- package/dist/core/graph/origin/entity.d.ts.map +1 -1
- package/dist/core/graph/origin/entity.js +22 -2
- package/dist/core/graph/origin/entity.js.map +1 -1
- package/dist/core/graph/origin/events.d.ts +6 -6
- package/dist/core/graph/origin/events.d.ts.map +1 -1
- package/dist/core/graph/origin/exporter.d.ts +5 -4
- package/dist/core/graph/origin/exporter.d.ts.map +1 -1
- package/dist/core/graph/origin/exporter.js +9 -5
- package/dist/core/graph/origin/exporter.js.map +1 -1
- package/dist/core/graph/origin/external.d.ts +6 -2
- package/dist/core/graph/origin/external.d.ts.map +1 -1
- package/dist/core/graph/origin/external.js +4 -0
- package/dist/core/graph/origin/external.js.map +1 -1
- package/dist/core/graph/origin/kind-map/index.d.ts +7 -7
- package/dist/core/graph/origin/kind-map/index.d.ts.map +1 -1
- package/dist/core/graph/origin/kind-map/index.js +2 -2
- package/dist/core/graph/origin/kind-map/index.js.map +1 -1
- package/dist/core/graph/origin/node.d.ts +5 -5
- package/dist/core/graph/origin/node.d.ts.map +1 -1
- package/dist/core/graph/origin/origin-events.d.ts +6 -6
- package/dist/core/graph/origin/origin-events.d.ts.map +1 -1
- package/dist/core/graph/origin/tracker.d.ts +1 -1
- package/dist/core/graph/origin/tracker.d.ts.map +1 -1
- package/dist/core/graph/origin/tracker.js +2 -1
- package/dist/core/graph/origin/tracker.js.map +1 -1
- package/dist/core/graph/relation.d.ts +2 -2
- package/dist/core/graph/relation.d.ts.map +1 -1
- package/dist/core/graph/relation.js +1 -0
- package/dist/core/graph/relation.js.map +1 -1
- package/dist/core/graph/resource/api-kind/index.d.ts +51 -57
- package/dist/core/graph/resource/api-kind/index.d.ts.map +1 -1
- package/dist/core/graph/resource/api-kind/index.js +191 -205
- package/dist/core/graph/resource/api-kind/index.js.map +1 -1
- package/dist/core/graph/resource/child.d.ts +7 -6
- package/dist/core/graph/resource/child.d.ts.map +1 -1
- package/dist/core/graph/resource/child.js +3 -3
- package/dist/core/graph/resource/child.js.map +1 -1
- package/dist/core/graph/resource/entity.d.ts +8 -10
- package/dist/core/graph/resource/entity.d.ts.map +1 -1
- package/dist/core/graph/resource/entity.js +21 -11
- package/dist/core/graph/resource/entity.js.map +1 -1
- package/dist/core/graph/resource/external/base.d.ts +4 -9
- package/dist/core/graph/resource/external/base.d.ts.map +1 -1
- package/dist/core/graph/resource/external/base.js +5 -12
- package/dist/core/graph/resource/external/base.js.map +1 -1
- package/dist/core/graph/resource/external/features.d.ts +1 -10
- package/dist/core/graph/resource/external/features.d.ts.map +1 -1
- package/dist/core/graph/resource/external/props.d.ts +2 -2
- package/dist/core/graph/resource/external/props.d.ts.map +1 -1
- package/dist/core/graph/resource/node.d.ts +9 -9
- package/dist/core/graph/resource/node.d.ts.map +1 -1
- package/dist/core/graph/resource/node.js +6 -6
- package/dist/core/graph/resource/node.js.map +1 -1
- package/dist/core/graph/resource/ref-key/ref-key.d.ts +70 -7
- package/dist/core/graph/resource/ref-key/ref-key.d.ts.map +1 -1
- package/dist/core/graph/resource/ref-key/ref-key.js +47 -2
- package/dist/core/graph/resource/ref-key/ref-key.js.map +1 -1
- package/dist/core/graph/resource/reference/fw-ref-exports.d.ts +40 -9
- package/dist/core/graph/resource/reference/fw-ref-exports.d.ts.map +1 -1
- package/dist/core/graph/resource/reference/fw-ref-exports.js +47 -13
- package/dist/core/graph/resource/reference/fw-ref-exports.js.map +1 -1
- package/dist/core/graph/resource/reference/fw-ref.d.ts +41 -12
- package/dist/core/graph/resource/reference/fw-ref.d.ts.map +1 -1
- package/dist/core/graph/resource/reference/fw-ref.js +42 -10
- package/dist/core/graph/resource/reference/fw-ref.js.map +1 -1
- package/dist/core/graph/resource/reference/index.d.ts +2 -2
- package/dist/core/graph/resource/reference/index.d.ts.map +1 -1
- package/dist/core/graph/resource/reference/index.js +3 -3
- package/dist/core/graph/resource/reference/index.js.map +1 -1
- package/dist/core/graph/resource/reference/refable.d.ts +11 -12
- package/dist/core/graph/resource/reference/refable.d.ts.map +1 -1
- package/dist/core/graph/resource/top.d.ts +6 -5
- package/dist/core/graph/resource/top.d.ts.map +1 -1
- package/dist/core/graph/resource/top.js +6 -3
- package/dist/core/graph/resource/top.js.map +1 -1
- package/dist/core/manifest/index.d.ts +2 -2
- package/dist/core/manifest/index.d.ts.map +1 -1
- package/dist/core/manifest/index.js.map +1 -1
- package/dist/expressions/data-sources/base.d.ts +23 -0
- package/dist/expressions/data-sources/base.d.ts.map +1 -1
- package/dist/expressions/data-sources/base.js +22 -0
- package/dist/expressions/data-sources/base.js.map +1 -1
- package/dist/expressions/data-sources/env-var.d.ts +24 -1
- package/dist/expressions/data-sources/env-var.d.ts.map +1 -1
- package/dist/expressions/data-sources/env-var.js +22 -2
- package/dist/expressions/data-sources/env-var.js.map +1 -1
- package/dist/expressions/data-sources/interface.d.ts +30 -0
- package/dist/expressions/data-sources/interface.d.ts.map +1 -1
- package/dist/expressions/data-sources/local-file.d.ts +41 -3
- package/dist/expressions/data-sources/local-file.d.ts.map +1 -1
- package/dist/expressions/data-sources/local-file.js +37 -2
- package/dist/expressions/data-sources/local-file.js.map +1 -1
- package/dist/expressions/network/ports/index.d.ts +6 -6
- package/dist/expressions/network/ports/index.d.ts.map +1 -1
- package/dist/expressions/network/ports/index.js +4 -4
- package/dist/expressions/network/ports/index.js.map +1 -1
- package/dist/expressions/network/ports/map.d.ts +50 -8
- package/dist/expressions/network/ports/map.d.ts.map +1 -1
- package/dist/expressions/network/ports/map.js +34 -5
- package/dist/expressions/network/ports/map.js.map +1 -1
- package/dist/expressions/network/ports/set.d.ts +88 -13
- package/dist/expressions/network/ports/set.d.ts.map +1 -1
- package/dist/expressions/network/ports/set.js +49 -7
- package/dist/expressions/network/ports/set.js.map +1 -1
- package/dist/expressions/network/ports/tools/entry.d.ts +5 -4
- package/dist/expressions/network/ports/tools/entry.d.ts.map +1 -1
- package/dist/expressions/network/ports/tools/entry.js +1 -1
- package/dist/expressions/network/ports/tools/entry.js.map +1 -1
- package/dist/expressions/network/ports/tools/parse.d.ts +2 -2
- package/dist/expressions/network/ports/tools/parse.d.ts.map +1 -1
- package/dist/expressions/network/ports/tools/parse.js.map +1 -1
- package/dist/expressions/network/ports/types.d.ts +13 -22
- package/dist/expressions/network/ports/types.d.ts.map +1 -1
- package/dist/expressions/quantities/reqlem/objects.d.ts +2 -2
- package/dist/expressions/quantities/reqlem/objects.d.ts.map +1 -1
- package/dist/expressions/quantities/reqlem/objects.js +4 -4
- package/dist/expressions/quantities/reqlem/objects.js.map +1 -1
- package/dist/expressions/quantities/units/unit-parser.d.ts.map +1 -1
- package/dist/expressions/quantities/units/unit-parser.js +0 -1
- package/dist/expressions/quantities/units/unit-parser.js.map +1 -1
- package/package.json +5 -5
- package/src/core/graph/entities.md +1 -0
- package/src/core/graph/entity.ts +36 -9
- package/src/core/graph/node.ts +72 -41
- package/src/core/graph/origin/entity.ts +27 -7
- package/src/core/graph/origin/events.ts +6 -6
- package/src/core/graph/origin/exporter.ts +14 -12
- package/src/core/graph/origin/external.ts +6 -3
- package/src/core/graph/origin/kind-map/index.ts +13 -13
- package/src/core/graph/origin/node.ts +3 -3
- package/src/core/graph/origin/origin-events.ts +6 -6
- package/src/core/graph/origin/tracker.ts +2 -2
- package/src/core/graph/readme.md +161 -0
- package/src/core/graph/relation.ts +4 -2
- package/src/core/graph/resource/api-kind/index.ts +139 -160
- package/src/core/graph/resource/child.ts +7 -10
- package/src/core/graph/resource/entity.ts +25 -12
- package/src/core/graph/resource/external/base.ts +4 -12
- package/src/core/graph/resource/external/features.ts +0 -16
- package/src/core/graph/resource/external/props.ts +2 -2
- package/src/core/graph/resource/node.ts +8 -8
- package/src/core/graph/resource/ref-key/ref-key.ts +77 -11
- package/src/core/graph/resource/reference/fw-ref-exports.ts +69 -20
- package/src/core/graph/resource/reference/fw-ref.ts +75 -21
- package/src/core/graph/resource/reference/index.ts +2 -2
- package/src/core/graph/resource/reference/refable.ts +13 -18
- package/src/core/graph/resource/top.ts +8 -5
- package/src/core/manifest/index.ts +2 -2
- package/src/expressions/data-sources/base.ts +24 -0
- package/src/expressions/data-sources/env-var.ts +23 -1
- package/src/expressions/data-sources/interface.ts +32 -0
- package/src/expressions/data-sources/local-file.ts +59 -3
- package/src/expressions/network/ports/index.ts +7 -7
- package/src/expressions/network/ports/map.ts +58 -10
- package/src/expressions/network/ports/set.ts +100 -25
- package/src/expressions/network/ports/tools/entry.ts +9 -14
- package/src/expressions/network/ports/tools/parse.ts +3 -3
- package/src/expressions/network/ports/types.ts +12 -26
- package/src/expressions/quantities/reqlem/objects.ts +3 -3
- package/src/expressions/quantities/units/unit-parser.ts +0 -1
|
@@ -1,13 +1,32 @@
|
|
|
1
|
+
import { type AnyCtor } from "what-are-you";
|
|
1
2
|
import type { Node } from "./node";
|
|
2
3
|
export type LiteralModes = "simple" | "pretty" | "prefix";
|
|
3
|
-
export
|
|
4
|
+
export type RefLike = {
|
|
5
|
+
get ref(): {
|
|
6
|
+
kind: string;
|
|
7
|
+
name: string;
|
|
8
|
+
namespace?: string;
|
|
9
|
+
};
|
|
10
|
+
kind: any;
|
|
11
|
+
name: string;
|
|
12
|
+
assert<Inst extends RefLike>(cls: abstract new (...args: any[]) => Inst): Inst;
|
|
13
|
+
is<Inst extends RefLike>(cls: abstract new (...args: any[]) => Inst): this is Inst;
|
|
14
|
+
};
|
|
15
|
+
export declare abstract class Entity<_Node extends Node<_Node, _Ent> = Node<any, any>, _Ent extends Entity<_Node, _Ent> = Entity<any, any>, _EntRefType extends RefLike = RefLike> {
|
|
16
|
+
abstract get ref(): RefLike["ref"];
|
|
17
|
+
abstract readonly kind: any;
|
|
4
18
|
private readonly _ID;
|
|
5
19
|
abstract readonly node: _Node;
|
|
6
20
|
abstract readonly name: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
assert<Inst extends _EntRefType>(cls: AnyCtor<Inst>): Inst;
|
|
22
|
+
is<K extends this["kind"]>(kind: K): this is {
|
|
23
|
+
kind: K;
|
|
24
|
+
};
|
|
25
|
+
is<Inst extends _EntRefType = _EntRefType>(cls: AnyCtor<Inst>): this is Inst;
|
|
26
|
+
abstract equals(other: any): boolean;
|
|
27
|
+
protected __kids__(): Iterable<_EntRefType>;
|
|
28
|
+
protected __parent__(): _EntRefType | undefined;
|
|
29
|
+
protected __needs__(): Record<string, _EntRefType | undefined | _EntRefType[]>;
|
|
11
30
|
}
|
|
12
31
|
export type Formats = "local" | "source" | undefined;
|
|
13
32
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/core/graph/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/core/graph/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAClC,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAKzD,MAAM,MAAM,OAAO,GAAG;IAClB,IAAI,GAAG,IAAI;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,CAAC,EAAE,MAAM,CAAA;KAC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C,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAEpC,SAAS,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,CAAC;IAI3C,SAAS,CAAC,UAAU,IAAI,WAAW,GAAG,SAAS;IAI/C,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,EAAE,CAAC;CAGjF;AAED,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Entity = void 0;
|
|
4
|
-
const
|
|
4
|
+
const what_are_you_1 = require("what-are-you");
|
|
5
5
|
let globalEntityId = 0;
|
|
6
6
|
class Entity {
|
|
7
7
|
_ID = (() => {
|
|
8
8
|
return globalEntityId++;
|
|
9
9
|
})();
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
return this
|
|
10
|
+
assert(cls) {
|
|
11
|
+
if (this.is(cls)) {
|
|
12
|
+
return this;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
throw new Error(`This Resource ${this} is not compatible with the class ${(0, what_are_you_1.getNiceClassName)(cls)}.`);
|
|
15
|
+
}
|
|
16
|
+
is(cls) {
|
|
17
|
+
if (typeof cls === "function") {
|
|
18
|
+
return this instanceof cls;
|
|
19
|
+
}
|
|
20
|
+
return this.kind.equals(cls);
|
|
15
21
|
}
|
|
16
22
|
__kids__() {
|
|
17
23
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/core/graph/entity.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/core/graph/entity.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAI7D,IAAI,cAAc,GAAG,CAAC,CAAA;AActB,MAAsB,MAAM;IAOP,GAAG,GAAG,CAAC,GAAG,EAAE;QACzB,OAAO,cAAc,EAAE,CAAA;IAC3B,CAAC,CAAC,EAAE,CAAA;IAGJ,MAAM,CAA2B,GAAkB;QAC/C,IAAI,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;YACf,OAAO,IAAmB,CAAA;QAC9B,CAAC;QACD,MAAM,IAAI,KAAK,CACX,iBAAiB,IAAI,qCAAqC,IAAA,+BAAgB,EAAC,GAAG,CAAC,GAAG,CACrF,CAAA;IACL,CAAC;IAGD,EAAE,CAAC,GAAQ;QACP,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;YAC5B,OAAO,IAAI,YAAY,GAAG,CAAA;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;IAGS,QAAQ;QACd,OAAO,EAAE,CAAA;IACb,CAAC;IAES,UAAU;QAChB,OAAO,SAAS,CAAA;IACpB,CAAC;IAES,SAAS;QACf,OAAO,EAAE,CAAA;IACb,CAAC;CACJ;AAzCD,wBAyCC"}
|
|
@@ -1,24 +1,47 @@
|
|
|
1
1
|
import { type Seq } from "doddle";
|
|
2
|
-
import
|
|
2
|
+
import { Entity } from "./entity";
|
|
3
3
|
import { Relation } from "./relation";
|
|
4
|
+
/**
|
|
5
|
+
* The {@link Node} is a wrapper around a {@link Entity} that provides traversal, display, and other
|
|
6
|
+
* utilities. Note that the {@link Node} itself is immutable. Changes only happen to the underlying
|
|
7
|
+
* {@link Entity}.
|
|
8
|
+
*
|
|
9
|
+
* Two {@link Node} instances are considered equal if they wrap the same {@link Entity}, even if
|
|
10
|
+
* they're different instances.
|
|
11
|
+
*
|
|
12
|
+
* Node classes are primarily used for traversal in the graph structure formed by {@link Entity}
|
|
13
|
+
* instances. They provide methods to navigate parent-child relationships, access metadata, and
|
|
14
|
+
* explore dependencies between entities.
|
|
15
|
+
*
|
|
16
|
+
* This is mainly done in the manifestation pipeline, but users can also rely on it to construct
|
|
17
|
+
* resources dynamically.
|
|
18
|
+
*
|
|
19
|
+
* Accessing the `Node` of an `Entity` always forces any `FwRef` instances to resolve.
|
|
20
|
+
*/
|
|
4
21
|
export declare abstract class Node<_Node extends Node<_Node, _Entity> = Node<any, any>, _Entity extends Entity<_Node, _Entity> = Entity<any, any>> {
|
|
5
22
|
readonly entity: _Entity;
|
|
23
|
+
/** The nodes of child entities. */
|
|
24
|
+
private readonly _ID;
|
|
25
|
+
constructor(entity: _Entity);
|
|
6
26
|
get kids(): Seq<_Node>;
|
|
27
|
+
/** The direct **needs** of this this node's entity. */
|
|
7
28
|
get relations(): Seq<Relation<_Node>>;
|
|
29
|
+
/** The node for this node's parent entity. */
|
|
8
30
|
get parent(): _Node | null;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The root node of this node's entity tree. Doesn't cross tree boundaries, so the root of a
|
|
33
|
+
* Resource-level tree.
|
|
34
|
+
*/
|
|
12
35
|
get root(): _Node;
|
|
13
36
|
get name(): string;
|
|
14
37
|
get isRoot(): boolean;
|
|
15
38
|
equals(other: any): boolean;
|
|
16
39
|
readonly ancestors: Seq<_Node>;
|
|
17
40
|
readonly descendants: Seq<_Node>;
|
|
18
|
-
isParentOf(other:
|
|
19
|
-
isChildOf(other:
|
|
20
|
-
hasRelationTo(other:
|
|
41
|
+
isParentOf(other: Node): boolean;
|
|
42
|
+
isChildOf(other: Node): boolean;
|
|
43
|
+
hasRelationTo(other: Node): boolean;
|
|
21
44
|
readonly recursiveRelationsSubtree: Seq<Relation<_Node>>;
|
|
22
|
-
readonly recursiveRelations: Seq<Relation<
|
|
45
|
+
readonly recursiveRelations: Seq<Relation<Node<Node<any, any>, Entity<any, any, import("./entity").RefLike>>>>;
|
|
23
46
|
}
|
|
24
47
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/core/graph/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/core/graph/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,GAAG,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,IAAI,CACtB,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,EACnD,OAAO,SAAS,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;IAK7C,QAAQ,CAAC,MAAM,EAAE,OAAO;IAHpC,mCAAmC;IAEnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBACP,MAAM,EAAE,OAAO;IAGpC,IAAI,IAAI,eAEP;IACD,uDAAuD;IACvD,IAAI,SAAS,yBAyBZ;IAED,8CAA8C;IAC9C,IAAI,MAAM,IAAI,KAAK,GAAG,IAAI,CAEzB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,KAAK,CAEhB;IACD,IAAI,IAAI,WAEP;IACD,IAAI,MAAM,YAET;IACD,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAa3B,QAAQ,CAAC,SAAS,aAWJ;IAEd,QAAQ,CAAC,WAAW,aAcN;IAEd,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IAOhC,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IAO/B,aAAa,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;IAInC,QAAQ,CAAC,yBAAyB,uBAOV;IAExB,QAAQ,CAAC,kBAAkB,oFAmBzB;CACL"}
|
package/dist/core/graph/node.js
CHANGED
|
@@ -2,43 +2,67 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Node = void 0;
|
|
4
4
|
const doddle_1 = require("doddle");
|
|
5
|
+
const entity_1 = require("./entity");
|
|
5
6
|
const relation_1 = require("./relation");
|
|
6
|
-
const
|
|
7
|
+
const fw_ref_1 = require("./resource/reference/fw-ref");
|
|
8
|
+
/**
|
|
9
|
+
* The {@link Node} is a wrapper around a {@link Entity} that provides traversal, display, and other
|
|
10
|
+
* utilities. Note that the {@link Node} itself is immutable. Changes only happen to the underlying
|
|
11
|
+
* {@link Entity}.
|
|
12
|
+
*
|
|
13
|
+
* Two {@link Node} instances are considered equal if they wrap the same {@link Entity}, even if
|
|
14
|
+
* they're different instances.
|
|
15
|
+
*
|
|
16
|
+
* Node classes are primarily used for traversal in the graph structure formed by {@link Entity}
|
|
17
|
+
* instances. They provide methods to navigate parent-child relationships, access metadata, and
|
|
18
|
+
* explore dependencies between entities.
|
|
19
|
+
*
|
|
20
|
+
* This is mainly done in the manifestation pipeline, but users can also rely on it to construct
|
|
21
|
+
* resources dynamically.
|
|
22
|
+
*
|
|
23
|
+
* Accessing the `Node` of an `Entity` always forces any `FwRef` instances to resolve.
|
|
24
|
+
*/
|
|
7
25
|
class Node {
|
|
8
26
|
entity;
|
|
27
|
+
/** The nodes of child entities. */
|
|
28
|
+
_ID;
|
|
29
|
+
constructor(entity) {
|
|
30
|
+
this.entity = entity;
|
|
31
|
+
this._ID = this.entity["_ID"];
|
|
32
|
+
}
|
|
9
33
|
get kids() {
|
|
10
|
-
return (0, doddle_1.seq)(this.entity["__kids__"]()).map(x => x.node);
|
|
34
|
+
return (0, doddle_1.seq)(this.entity["__kids__"]()).map(x => x.assert(entity_1.Entity).node);
|
|
11
35
|
}
|
|
36
|
+
/** The direct **needs** of this this node's entity. */
|
|
12
37
|
get relations() {
|
|
13
|
-
const needs =
|
|
38
|
+
const needs = (0, doddle_1.seq)(() => {
|
|
39
|
+
return doddle_1.seq.fromObject(this.entity["__needs__"]());
|
|
40
|
+
});
|
|
14
41
|
return (0, doddle_1.seq)(function* () {
|
|
15
|
-
for (const [relName, target] of
|
|
42
|
+
for (const [relName, target] of needs) {
|
|
16
43
|
if (Array.isArray(target)) {
|
|
17
44
|
for (const t of target) {
|
|
18
45
|
if (t) {
|
|
19
|
-
yield new relation_1.Relation(relName, t.node);
|
|
46
|
+
yield new relation_1.Relation(relName, t.assert((entity_1.Entity)).node);
|
|
20
47
|
}
|
|
21
48
|
}
|
|
22
49
|
}
|
|
23
50
|
else {
|
|
24
51
|
if (target) {
|
|
25
|
-
yield new relation_1.Relation(relName, target.node);
|
|
52
|
+
yield new relation_1.Relation(relName, target.assert((entity_1.Entity)).node);
|
|
26
53
|
}
|
|
27
54
|
}
|
|
28
55
|
}
|
|
29
56
|
});
|
|
30
57
|
}
|
|
58
|
+
/** The node for this node's parent entity. */
|
|
31
59
|
get parent() {
|
|
32
|
-
return this.entity["__parent__"]()?.node ?? null;
|
|
33
|
-
}
|
|
34
|
-
get _asNode() {
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
_ID;
|
|
38
|
-
constructor(entity) {
|
|
39
|
-
this.entity = entity;
|
|
40
|
-
this._ID = this.entity["_ID"];
|
|
60
|
+
return this.entity["__parent__"]()?.assert(entity_1.Entity).node ?? null;
|
|
41
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The root node of this node's entity tree. Doesn't cross tree boundaries, so the root of a
|
|
64
|
+
* Resource-level tree.
|
|
65
|
+
*/
|
|
42
66
|
get root() {
|
|
43
67
|
return this.ancestors.at(-1).pull() ?? this;
|
|
44
68
|
}
|
|
@@ -49,7 +73,10 @@ class Node {
|
|
|
49
73
|
return this.parent === null;
|
|
50
74
|
}
|
|
51
75
|
equals(other) {
|
|
52
|
-
if (
|
|
76
|
+
if (!other) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
if (fw_ref_1.FwRef.is(other)) {
|
|
53
80
|
return this.equals(other["__pull__"]());
|
|
54
81
|
}
|
|
55
82
|
if (other instanceof Node === false) {
|
|
@@ -66,9 +93,9 @@ class Node {
|
|
|
66
93
|
recurse(parent);
|
|
67
94
|
}
|
|
68
95
|
};
|
|
69
|
-
recurse(this
|
|
96
|
+
recurse(this);
|
|
70
97
|
return seen;
|
|
71
|
-
});
|
|
98
|
+
}).as();
|
|
72
99
|
descendants = (0, doddle_1.seq)(() => {
|
|
73
100
|
const self = this;
|
|
74
101
|
let seen = [];
|
|
@@ -81,18 +108,18 @@ class Node {
|
|
|
81
108
|
recurse(kid);
|
|
82
109
|
}
|
|
83
110
|
};
|
|
84
|
-
recurse(this
|
|
111
|
+
recurse(this);
|
|
85
112
|
return seen;
|
|
86
|
-
});
|
|
113
|
+
}).as();
|
|
87
114
|
isParentOf(other) {
|
|
88
|
-
if (
|
|
89
|
-
return other.isChildOf(this
|
|
115
|
+
if (fw_ref_1.FwRef.is(other)) {
|
|
116
|
+
return other.isChildOf(this);
|
|
90
117
|
}
|
|
91
118
|
return other.equals(this) || other.ancestors.some(x => x.equals(this)).pull();
|
|
92
119
|
}
|
|
93
120
|
isChildOf(other) {
|
|
94
|
-
if (
|
|
95
|
-
return other.isParentOf(this
|
|
121
|
+
if (fw_ref_1.FwRef.is(other)) {
|
|
122
|
+
return other.isParentOf(this);
|
|
96
123
|
}
|
|
97
124
|
return this.equals(other) || this.ancestors.some(x => x.equals(other)).pull();
|
|
98
125
|
}
|
|
@@ -106,7 +133,7 @@ class Node {
|
|
|
106
133
|
yield* child.recursiveRelations;
|
|
107
134
|
}
|
|
108
135
|
});
|
|
109
|
-
});
|
|
136
|
+
}).as();
|
|
110
137
|
recursiveRelations = (0, doddle_1.seq)(() => {
|
|
111
138
|
let resources = [];
|
|
112
139
|
const recurseIntoDependency = function* (root) {
|
|
@@ -120,7 +147,7 @@ class Node {
|
|
|
120
147
|
yield* recurseIntoDependency(needsEdge);
|
|
121
148
|
}
|
|
122
149
|
};
|
|
123
|
-
return (0, doddle_1.seq)(recurseIntoDependency.bind(null, new relation_1.Relation("self", this
|
|
150
|
+
return (0, doddle_1.seq)(recurseIntoDependency.bind(null, new relation_1.Relation("self", this)))
|
|
124
151
|
.after(() => {
|
|
125
152
|
resources = [];
|
|
126
153
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/core/graph/node.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../../src/core/graph/node.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AACtC,qCAAiC;AACjC,yCAAqC;AACrC,wDAAmD;AACnD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAsB,IAAI;IAOD;IAHrB,mCAAmC;IAElB,GAAG,CAAQ;IAC5B,YAAqB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;QAChC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,IAAI;QACJ,OAAO,IAAA,YAAG,EAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,eAAM,CAAC,CAAC,IAAa,CAAC,CAAA;IAClF,CAAC;IACD,uDAAuD;IACvD,IAAI,SAAS;QACT,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,GAAG,EAAE;YACnB,OAAO,YAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;QACF,OAAO,IAAA,YAAG,EAAC,QAAQ,CAAC;YAChB,KAAK,MAAM,CAAC,OAAO,EAAE,MAAM,CAA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AAQ,CAAA;IACb,CAAC,CAAC,CAAC,EAAE,EAAmB,CAAA;IAEf,kBAAkB,GAAG,IAAA,YAAG,EAAC,GAAG,EAAE;QACnC,IAAI,SAAS,GAAG,EAAY,CAAA;QAC5B,MAAM,qBAAqB,GAAG,QAAQ,CAAC,EAAE,IAAoB;YACzD,MAAM,IAAI,CAAA;YACV,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAC7C,OAAM;YACV,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAA;YACrC,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;gBAC9B,KAAK,CAAC,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAA;YAC3C,CAAC;QACL,CAAC,CAAA;QACD,OAAO,IAAA,YAAG,EAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,mBAAQ,CAAQ,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;aAC1E,KAAK,CAAC,GAAG,EAAE;YACR,SAAS,GAAG,EAAE,CAAA;QAClB,CAAC,CAAC;aACD,KAAK,EAAE,CAAA;IAChB,CAAC,CAAC,CAAA;CACL;AApJD,oBAoJC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from "@k8ts/metadata";
|
|
2
2
|
import { Entity } from "../entity";
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
3
|
+
import { Rsc_Entity } from "../resource/entity";
|
|
4
|
+
import type { Rsc_Ref } from "../resource/reference/refable";
|
|
5
5
|
import { type Origin_EventMap } from "./events";
|
|
6
6
|
import { KindMap } from "./kind-map";
|
|
7
7
|
import { OriginNode, type Origin_Props } from "./node";
|
|
@@ -9,11 +9,16 @@ import type { OriginStackBinder } from "./tracker";
|
|
|
9
9
|
export declare abstract class Origin_Entity<Props extends Origin_Props = Origin_Props> extends Entity<OriginNode, Origin_Entity> {
|
|
10
10
|
readonly name: string;
|
|
11
11
|
protected readonly _props: Props;
|
|
12
|
+
get ref(): {
|
|
13
|
+
kind: string;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
12
16
|
abstract get kind(): string;
|
|
13
17
|
private _emitter;
|
|
14
18
|
private readonly _ownResources;
|
|
15
19
|
private readonly _ownKids;
|
|
16
20
|
readonly meta: Meta;
|
|
21
|
+
equals(other: any): boolean;
|
|
17
22
|
constructor(name: string, _props: Props);
|
|
18
23
|
get node(): OriginNode;
|
|
19
24
|
on<EventKey extends keyof Origin_EventMap>(event: EventKey, listener: (data: Origin_EventMap[EventKey]) => void): void;
|
|
@@ -24,9 +29,9 @@ export declare abstract class Origin_Entity<Props extends Origin_Props = Origin_
|
|
|
24
29
|
protected __resource_kinds__(): KindMap;
|
|
25
30
|
get shortFqn(): string;
|
|
26
31
|
protected __attach_kid__(kid: Origin_Entity): void;
|
|
27
|
-
protected __attach_resource__(resources:
|
|
32
|
+
protected __attach_resource__(resources: Rsc_Entity | Iterable<Rsc_Entity>): void;
|
|
28
33
|
protected __kids__(): Iterable<Origin_Entity>;
|
|
29
34
|
protected __binder__(): OriginStackBinder;
|
|
30
|
-
get resources(): Iterable<
|
|
35
|
+
get resources(): Iterable<Rsc_Ref>;
|
|
31
36
|
}
|
|
32
37
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAKrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/entity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,CAAC,IAAI,SAAS,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI;KACvD;IAKD,SAAS,CAAC,QAAQ,CAAC,QAAQ,SAAS,MAAM,eAAe,EACrD,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC;IAQnC,SAAS,CAAC,kBAAkB,IAAI,OAAO;IAMvC,IAAI,QAAQ,WAEX;IAED,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,aAAa;IAQ3C,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IAW1E,SAAS,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAAC;IAI7C,SAAS,CAAC,UAAU,IAAI,iBAAiB;IAMzC,IAAI,SAAS,IAAI,QAAQ,CAAC,OAAO,CAAC,CAUjC;CACJ"}
|
|
@@ -72,10 +72,29 @@ let Origin_Entity = (() => {
|
|
|
72
72
|
}
|
|
73
73
|
name;
|
|
74
74
|
_props;
|
|
75
|
+
get ref() {
|
|
76
|
+
return {
|
|
77
|
+
kind: this.kind,
|
|
78
|
+
name: this.name
|
|
79
|
+
};
|
|
80
|
+
}
|
|
75
81
|
_emitter = (0, events_1.OriginEventsEmitter)();
|
|
76
82
|
_ownResources = [];
|
|
77
83
|
_ownKids = [];
|
|
78
84
|
meta;
|
|
85
|
+
equals(other) {
|
|
86
|
+
const FwRef_Exports = require("../resource/reference/fw-ref-exports").FwRef_Exports;
|
|
87
|
+
if (!other) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (other instanceof Origin_Entity) {
|
|
91
|
+
return Object.is(this, other);
|
|
92
|
+
}
|
|
93
|
+
if (FwRef_Exports.is(other)) {
|
|
94
|
+
return other.equals(this);
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
79
98
|
constructor(name, _props) {
|
|
80
99
|
super();
|
|
81
100
|
this.name = name;
|
|
@@ -96,11 +115,12 @@ let Origin_Entity = (() => {
|
|
|
96
115
|
__emit__(event, data) {
|
|
97
116
|
const values = (0, lodash_1.mapValues)(data, v => `${v}`);
|
|
98
117
|
for (const target of [this.node, ...this.node.ancestors]) {
|
|
99
|
-
target.entity._emitter.emit(event, data);
|
|
118
|
+
target.entity.assert(Origin_Entity)._emitter.emit(event, data);
|
|
100
119
|
}
|
|
101
120
|
}
|
|
102
121
|
__resource_kinds__() {
|
|
103
|
-
const
|
|
122
|
+
const parent = this.__parent__()?.assert(Origin_Entity);
|
|
123
|
+
const parentKindsIfAny = parent?.__resource_kinds__() ?? [];
|
|
104
124
|
return new kind_map_1.KindMap([...(this._props.kinds ?? []), ...parentKindsIfAny]);
|
|
105
125
|
}
|
|
106
126
|
get shortFqn() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../../src/core/graph/origin/entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AACrC,kDAAyB;AACzB,mCAA4B;AAC5B,mCAAkC;AAClC,0DAAsD;AACtD,sCAAkC;AAGlC,qCAAoE;AACpE,yCAAoC;AACpC,iCAAsD;AAEtD,uCAAgD;IAU1B,aAAa;4BARlC,IAAA,uBAAU,EAAC;YACR,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG;YAC9B,MAAM,CAAC,MAAM;gBACT,MAAM,QAAQ,GAAG,eAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBACpD,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBAC1C,OAAO,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAA;YACtC,CAAC;SACJ,CAAC;;;;sBACqF,eAAM;6BAAd,SAAQ,WAGtF;;;;YAHD,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E;QACjE,IAAI,SAAS;YACT,MAAM,IAAI,GAAG,IAAI,CAAA;YACjB,OAAO,IAAA,YAAG,EAAC,QAAQ,CAAC;gBAChB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;oBACxC,MAAM,QAAQ,CAAA;gBAClB,CAAC;gBACD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBAC9B,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,CAAA;gBACxB,CAAC;YACL,CAAC,CAAC,CAAA;QACN,CAAC;;;;AAlHiB,sCAAa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EventEmitter from "eventemitter3";
|
|
2
2
|
import type { Manifest } from "../../manifest";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Rsc_Entity, Rsc_Top } from "../resource";
|
|
4
4
|
import type { Origin_Entity } from "./entity";
|
|
5
5
|
export declare function OriginEventsEmitter(): EventEmitter<Origin_EventMap, any>;
|
|
6
6
|
export declare function SubscribeFn(self: Origin_Entity, em: EventEmitter<Origin_EventMap>): {
|
|
@@ -11,24 +11,24 @@ export declare function SubscribeFn(self: Origin_Entity, em: EventEmitter<Origin
|
|
|
11
11
|
export interface Origin_EventMap {
|
|
12
12
|
"resource/exported": {
|
|
13
13
|
readonly origin: Origin_Entity;
|
|
14
|
-
readonly resource:
|
|
14
|
+
readonly resource: Rsc_Top;
|
|
15
15
|
};
|
|
16
16
|
"resource/attached": {
|
|
17
17
|
readonly origin: Origin_Entity;
|
|
18
|
-
readonly resource:
|
|
18
|
+
readonly resource: Rsc_Entity;
|
|
19
19
|
};
|
|
20
20
|
"resource/manifested": {
|
|
21
21
|
readonly origin: Origin_Entity;
|
|
22
22
|
readonly manifest: Manifest;
|
|
23
|
-
readonly resource:
|
|
23
|
+
readonly resource: Rsc_Top;
|
|
24
24
|
};
|
|
25
25
|
"resource/loaded": {
|
|
26
26
|
readonly origin: Origin_Entity;
|
|
27
|
-
readonly resource:
|
|
27
|
+
readonly resource: Rsc_Top;
|
|
28
28
|
};
|
|
29
29
|
"resource/serialized": {
|
|
30
30
|
readonly origin: Origin_Entity;
|
|
31
|
-
readonly resource:
|
|
31
|
+
readonly resource: Rsc_Top;
|
|
32
32
|
readonly manifest: Manifest;
|
|
33
33
|
content: string;
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/events.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/events.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,wBAAgB,mBAAmB,uCAGlC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC;KAClE,QAAQ,SAAS,MAAM,eAAe,SACvC,QAAQ,YACL,CAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,IAAI,GACpD,IAAI;eAEO,CAAC,QAAQ,SAAS,MAAM,eAAe,EAC7C,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,KAC9B,IAAI,GACV,IAAI;KAEH,CAAC,SAAS,MAAM,eAAe,EAC/B,UAAU,SAAS,GACd,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,IAAI,GACrD,YACO,UAAU,GAAG,IAAI;EAgBhC;AACD,MAAM,WAAW,eAAe;IAC5B,mBAAmB,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;KAC7B,CAAA;IACD,mBAAmB,EAAE;QACjB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAA;KAChC,CAAA;IACD,qBAAqB,EAAE;QACnB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;QAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;KAC7B,CAAA;IACD,iBAAiB,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;KAC7B,CAAA;IACD,qBAAqB,EAAE;QACnB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;QAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;QAC3B,OAAO,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,iBAAiB,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;QAC9B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;KAChC,CAAA;CACJ;AAED,eAAO,MAAM,gBAAgB,2BAWpB,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Rsc_Ref } from "../resource";
|
|
2
2
|
import { Origin_Entity } from "./entity";
|
|
3
3
|
import type { Origin_Props } from "./node";
|
|
4
4
|
export interface Origin_Exporter_Props extends Origin_Props {
|
|
5
5
|
}
|
|
6
|
+
/** Base class for Origins that export resources via the {@link Rsc_FwRef_Exports} mechanism. */
|
|
6
7
|
export declare abstract class Origin_Exporter<Props extends Origin_Exporter_Props = Origin_Exporter_Props> extends Origin_Entity<Props> {
|
|
7
8
|
private readonly _parent;
|
|
8
9
|
constructor(_parent: Origin_Entity, name: string, props: Props);
|
|
9
|
-
protected abstract __exports__(): Iterable<
|
|
10
|
-
protected __parent__(): Origin_Entity<Origin_Props<import("../resource").
|
|
11
|
-
get resources(): Iterable<
|
|
10
|
+
protected abstract __exports__(): Iterable<Rsc_Ref>;
|
|
11
|
+
protected __parent__(): Origin_Entity<Origin_Props<import("../resource").Rsc_Ctor_Of>>;
|
|
12
|
+
get resources(): Iterable<Rsc_Ref>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/exporter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/exporter.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,OAAO,EAAW,MAAM,aAAa,CAAA;AAEjE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,MAAM,WAAW,qBAAsB,SAAQ,YAAY;CAAG;AAE9D,gGAAgG;AAChG,8BAAsB,eAAe,CACjC,KAAK,SAAS,qBAAqB,GAAG,qBAAqB,CAC7D,SAAQ,aAAa,CAAC,KAAK,CAAC;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa,EACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,KAAK;IAOhB,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC;IAEnD,SAAS,CAAC,UAAU;IAIpB,IACI,SAAS,IAAI,QAAQ,CAAC,OAAO,CAAC,CAkCjC;CACJ"}
|
|
@@ -37,7 +37,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
37
|
exports.Origin_Exporter = void 0;
|
|
38
38
|
const doddle_1 = require("doddle");
|
|
39
39
|
const resource_1 = require("../resource");
|
|
40
|
+
const fw_ref_1 = require("../resource/reference/fw-ref");
|
|
40
41
|
const entity_1 = require("./entity");
|
|
42
|
+
/** Base class for Origins that export resources via the {@link Rsc_FwRef_Exports} mechanism. */
|
|
41
43
|
let Origin_Exporter = (() => {
|
|
42
44
|
let _classSuper = entity_1.Origin_Entity;
|
|
43
45
|
let _instanceExtraInitializers = [];
|
|
@@ -62,13 +64,15 @@ let Origin_Exporter = (() => {
|
|
|
62
64
|
const self = this;
|
|
63
65
|
const boundExports = self.__binder__().bind(self.__exports__.bind(self));
|
|
64
66
|
const allEmitted = new Set();
|
|
65
|
-
const
|
|
67
|
+
const attachedResources = (0, doddle_1.seq)(() => super.resources).cache();
|
|
66
68
|
return (0, doddle_1.seq)(function* () {
|
|
67
69
|
for (const em of boundExports()) {
|
|
68
|
-
if (
|
|
69
|
-
throw new Error(`
|
|
70
|
+
if (fw_ref_1.FwRef.is(em)) {
|
|
71
|
+
throw new Error(`FwRef ${em} cannot be directly exported from ChildOrigin ${self.name}`);
|
|
70
72
|
}
|
|
71
|
-
if (em instanceof entity_1.Origin_Entity) {
|
|
73
|
+
if (em instanceof entity_1.Origin_Entity || resource_1.Rsc_FwRef_Exports.is(em)) {
|
|
74
|
+
// Skip Origin entities. Later we go over attachedResources and after evaluating
|
|
75
|
+
// these exports, any resources attached to child Origins will be included.
|
|
72
76
|
continue;
|
|
73
77
|
}
|
|
74
78
|
allEmitted.add(em);
|
|
@@ -81,7 +85,7 @@ let Origin_Exporter = (() => {
|
|
|
81
85
|
}
|
|
82
86
|
yield em;
|
|
83
87
|
}
|
|
84
|
-
for (const resource of
|
|
88
|
+
for (const resource of attachedResources) {
|
|
85
89
|
if (!allEmitted.has(resource)) {
|
|
86
90
|
yield resource;
|
|
87
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../../../src/core/graph/origin/exporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsC;
|
|
1
|
+
{"version":3,"file":"exporter.js","sourceRoot":"","sources":["../../../../src/core/graph/origin/exporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAsC;AACtC,0CAAiE;AACjE,yDAAoD;AACpD,qCAAwC;AAIxC,gGAAgG;IAC1E,eAAe;sBAE3B,sBAAa;;;iBAFD,eAEpB,SAAQ,WAAoB;;;yCAiBzB,iBAAQ;YACT,kLAAI,SAAS,6DAkCZ;;;QAlDoB,OAAO,GAJV,mDAAe;QAGjC,YACqB,OAAsB,EACvC,IAAY,EACZ,KAAY;YAEZ,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;YAJD,YAAO,GAAP,OAAO,CAAe;YAMvC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAA;QACxC,CAAC;QAIS,UAAU;YAChB,OAAO,IAAI,CAAC,OAAO,CAAA;QACvB,CAAC;QAGD,IAAI,SAAS;YACT,MAAM,IAAI,GAAG,IAAI,CAAA;YACjB,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YACxE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAW,CAAA;YACrC,MAAM,iBAAiB,GAAG,IAAA,YAAG,EAAC,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAA;YAC5D,OAAO,IAAA,YAAG,EAAC,QAAQ,CAAC;gBAChB,KAAK,MAAM,EAAE,IAAI,YAAY,EAAe,EAAE,CAAC;oBAC3C,IAAI,cAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CACX,SAAS,EAAE,iDAAiD,IAAI,CAAC,IAAI,EAAE,CAC1E,CAAA;oBACL,CAAC;oBACD,IAAI,EAAE,YAAY,sBAAa,IAAI,4BAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;wBAC1D,gFAAgF;wBAChF,2EAA2E;wBAC3E,SAAQ;oBACZ,CAAC;oBAED,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;oBAClB,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;wBAClC,+CAA+C;wBAC/C,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE;4BAC/B,MAAM,EAAE,IAAI;4BACZ,QAAQ,EAAE,EAAE;yBACf,CAAC,CAAA;oBACN,CAAC;oBACD,MAAM,EAAE,CAAA;gBACZ,CAAC;gBACD,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;oBACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;wBAC5B,MAAM,QAAQ,CAAA;oBAClB,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;QACd,CAAC;;;AAtDiB,0CAAe"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Rsc_Ctor_Of } from "../resource";
|
|
2
2
|
import { Origin_Entity } from "./entity";
|
|
3
3
|
import type { Origin_Props } from "./node";
|
|
4
|
+
/**
|
|
5
|
+
* Used as the Origin of {@link External} resources. These resources are never manifested by k8ts.
|
|
6
|
+
* They're expected to already exist in the target cluster.
|
|
7
|
+
*/
|
|
4
8
|
export declare class Origin_External extends Origin_Entity {
|
|
5
9
|
get kind(): string;
|
|
6
10
|
private constructor();
|
|
7
|
-
protected __parent__(): Origin_Entity<Origin_Props<
|
|
11
|
+
protected __parent__(): Origin_Entity<Origin_Props<Rsc_Ctor_Of>> | undefined;
|
|
8
12
|
static instance: Origin_External;
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=external.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/external.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/origin/external.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,aAAa;IAC9C,IAAI,IAAI,WAEP;IACD,OAAO;IAIP,SAAS,CAAC,UAAU,IAAI,aAAa,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,GAAG,SAAS;IAI5E,MAAM,CAAC,QAAQ,kBAAwB;CAC1C"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Origin_External = void 0;
|
|
4
4
|
const entity_1 = require("./entity");
|
|
5
|
+
/**
|
|
6
|
+
* Used as the Origin of {@link External} resources. These resources are never manifested by k8ts.
|
|
7
|
+
* They're expected to already exist in the target cluster.
|
|
8
|
+
*/
|
|
5
9
|
class Origin_External extends entity_1.Origin_Entity {
|
|
6
10
|
get kind() {
|
|
7
11
|
return "[k8ts] External";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../../src/core/graph/origin/external.ts"],"names":[],"mappings":";;;AACA,qCAAwC;
|
|
1
|
+
{"version":3,"file":"external.js","sourceRoot":"","sources":["../../../../src/core/graph/origin/external.ts"],"names":[],"mappings":";;;AACA,qCAAwC;AAExC;;;GAGG;AACH,MAAa,eAAgB,SAAQ,sBAAa;IAC9C,IAAI,IAAI;QACJ,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IACD;QACI,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IACzB,CAAC;IAES,UAAU;QAChB,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAA;;AAZ3C,0CAaC"}
|