@gisatcz/ptr-be-core 0.0.1-dev.5 → 0.0.1-dev.6

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.
@@ -0,0 +1,58 @@
1
+ import { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels } from "../panther/enums.panther";
2
+ import { OneOfEdgeProperties } from "../panther/models.edges.properties";
3
+ import { FullPantherEntity } from "../panther/models.nodes";
4
+ /**
5
+ * Represents a node in the Arrows diagram/model.
6
+ *
7
+ * @remarks
8
+ * This interface describes the minimal and optional data used to render and
9
+ * identify a node inside an Arrows-based diagram or graph. Fields marked
10
+ * optional may be omitted when not required by the renderer or business logic.
11
+ *
12
+ * @property id - A unique string identifier for the node. Required.
13
+ * @property caption - An optional human-readable title or label for the node.
14
+ * @property labels - Labels associated with the node. Can be one of:
15
+ * - string[]: plain text labels,
16
+ * - UsedNodeLabels[]: typed node label objects (see UsedNodeLabels),
17
+ * - UsedDatasourceLabels[]: typed datasource label objects (see UsedDatasourceLabels).
18
+ * Labels are typically used for filtering, categorization, or display.
19
+ * @property properties - Optional arbitrary metadata for the node. Free-form object
20
+ * consumed by application logic (e.g., domain attributes, IDs, flags).
21
+ * @property position - Optional position of the node in diagram coordinate space.
22
+ * - x: horizontal coordinate (number)
23
+ * - y: vertical coordinate (number)
24
+ * @property style - Optional rendering/style overrides (e.g., shape, color, CSS classes).
25
+ * This is a renderer-specific, free-form object.
26
+ */
27
+ export interface ArrowsNode {
28
+ id: string;
29
+ caption?: string;
30
+ labels: string[] | UsedNodeLabels[] | UsedDatasourceLabels[];
31
+ properties: FullPantherEntity;
32
+ position?: {
33
+ x: number;
34
+ y: number;
35
+ };
36
+ style?: object;
37
+ }
38
+ /**
39
+ * Describes a directed edge between two nodes used by the Arrows model.
40
+ *
41
+ * The interface captures identity, connectivity, semantic typing and optional
42
+ * metadata or rendering hints for an edge.
43
+ *
44
+ * @property id - Unique identifier for the edge.
45
+ * @property fromId - Identifier of the source node (edge origin).
46
+ * @property toId - Identifier of the target node (edge destination).
47
+ * @property type - Semantic label or type for the edge; can be a free-form string or one of the predefined UsedEdgeLabels.
48
+ * @property properties - Optional arbitrary metadata for the edge (key/value map) used for domain-specific data.
49
+ * @property style - Optional presentation/visualization overrides (for example color, width, dash pattern) applied when rendering the edge.
50
+ */
51
+ export interface ArrowsEdge {
52
+ id: string;
53
+ fromId: string;
54
+ toId: string;
55
+ type: string | UsedEdgeLabels;
56
+ properties?: Partial<OneOfEdgeProperties>;
57
+ style?: object;
58
+ }
@@ -0,0 +1,43 @@
1
+ import { GraphEdge } from "./models.edges";
2
+ /**
3
+ * Represents an object that exposes a collection of neighbouring items.
4
+ *
5
+ * The `neighbours` array contains zero or more related elements of type `T`.
6
+ * Implementations should document whether the array is ordered, whether duplicates
7
+ * are allowed, and whether `null`/`undefined` values may appear. Modifying the array
8
+ * (e.g. pushing or splicing) mutates the host object and may affect other consumers
9
+ * that hold a reference to the same instance.
10
+ *
11
+ * @typeParam T - The element type stored in the `neighbours` array.
12
+ * @property neighbours - An array of neighbouring items of type `T`.
13
+ */
14
+ export interface HasNeighbours<T> {
15
+ neighbours: T[];
16
+ }
17
+ /**
18
+ * Represents a construct that exposes a collection of graph connections.
19
+ *
20
+ * Implementations provide an array of GraphEdge instances that describe the relationships
21
+ * (edges) associated with the entity — for example, connections from or to a graph node.
22
+ *
23
+ * Remarks:
24
+ * - The array may be empty to indicate no connections.
25
+ * - Implementations are responsible for keeping the array consistent when edges are added,
26
+ * removed or updated.
27
+ *
28
+ * @property edges - The list of GraphEdge objects representing this entity's connections.
29
+ */
30
+ export interface HasEdges {
31
+ edges: GraphEdge[];
32
+ }
33
+ /**
34
+ * Represents a node and its neighbouring nodes.
35
+ *
36
+ * @typeParam T - The type of the node and its neighbours.
37
+ * @property node - The main node, or `null` if not present.
38
+ * @property neighbours - An array of neighbouring nodes.
39
+ * @property edges - An array of edges connecting the node to its neighbours.
40
+ */
41
+ export interface NodeWithNeighbours<T> extends HasNeighbours<T>, HasEdges {
42
+ node: T;
43
+ }
@@ -5,3 +5,5 @@ export { type EdgeForPostgisLocationProperties, type EdgePropertiesBasic, type O
5
5
  export { type GraphEdge, type GraphRelation } from "./globals/panther/models.edges.js";
6
6
  export { type HasBands, type HasColor, type HasConfiguration, type HasGeometry, type HasInterval, type HasLevels, type HasSpecificName, type HasUrl, type HasUnits } from "./globals/panther/models.nodes.properties.js";
7
7
  export { type Place, type Period, type AreaTreeLevel, type Datasource, type ApplicationNode, type Attribute, type FullPantherEntity, type MapStyle, type PantherEntity } from "./globals/panther/models.nodes.js";
8
+ export { type HasEdges, type HasNeighbours, type NodeWithNeighbours } from "./globals/panther/models.nodes.structure.js";
9
+ export { type ArrowsNode, type ArrowsEdge } from "./globals/arrows/models.arrows.js";
@@ -1,10 +1,4 @@
1
- export { enumCombineValuesToString, enumValuesToArray, enumValuesToString, flattenObject, isInEnum, notEmptyString, randomNumberBetween, removeDuplicitiesFromArray, sortStringArray } from "./globals/coding/code.formating.js";
2
- export { type Nullable, type Nullish, type Unsure, type UsurePromise } from "./globals/coding/code.types.js";
3
- export { UsedDatasourceLabels, UsedEdgeLabels, UsedNodeLabels } from "./globals/panther/enums.panther.js";
4
- export { type GraphEdge, type GraphRelation } from "./globals/panther/models.edges.js";
5
- export { type EdgeForPostgisLocationProperties, type EdgePropertiesBasic, type OneOfEdgeProperties } from "./globals/panther/models.edges.properties.js";
6
- export { type HasBands, type HasColor, type HasConfiguration, type HasGeometry, type HasInterval, type HasLevels, type HasSpecificName, type HasUrl, type HasUnits } from "./globals/panther/models.nodes.properties.js";
7
- export { type Place, type Period, type AreaTreeLevel, type Datasource, type ApplicationNode, type Attribute, type FullPantherEntity, type MapStyle, type PantherEntity } from "./globals/panther/models.nodes.js";
1
+ export * from "./index.browser.js";
8
2
  export { messageFromError, InvalidRequestError, AuthorizationError } from "./node/api/errors.api.js";
9
3
  export { type ApiEndpointResponse } from "./node/api/models.api.js";
10
4
  export { type AppLogOptions } from "./node/logging/logger.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisatcz/ptr-be-core",
3
- "version": "0.0.1-dev.5",
3
+ "version": "0.0.1-dev.6",
4
4
  "description": "Shared core library for PTR BE services",
5
5
  "type": "module",
6
6
  "files": [