raain-model 2.6.10 → 2.6.11

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.
Files changed (210) hide show
  1. package/README.md +2 -12
  2. package/RELEASE_PROCESS.md +11 -6
  3. package/cartesian/CartesianMeasureValue.d.ts +40 -0
  4. package/{src/cartesian/CartesianMeasureValue.ts → cartesian/CartesianMeasureValue.js} +41 -73
  5. package/cartesian/CartesianMeasureValue.js.map +1 -0
  6. package/cartesian/CartesianTools.d.ts +32 -0
  7. package/{src/cartesian/CartesianTools.ts → cartesian/CartesianTools.js} +69 -130
  8. package/cartesian/CartesianTools.js.map +1 -0
  9. package/cartesian/CartesianValue.d.ts +14 -0
  10. package/cartesian/CartesianValue.js +17 -0
  11. package/cartesian/CartesianValue.js.map +1 -0
  12. package/cartesian/EarthMap.d.ts +5 -0
  13. package/cartesian/EarthMap.js +3 -0
  14. package/cartesian/EarthMap.js.map +1 -0
  15. package/cartesian/ICartesianMeasureValue.d.ts +23 -0
  16. package/cartesian/ICartesianMeasureValue.js +3 -0
  17. package/cartesian/ICartesianMeasureValue.js.map +1 -0
  18. package/cartesian/LatLng.d.ts +16 -0
  19. package/cartesian/LatLng.js +34 -0
  20. package/cartesian/LatLng.js.map +1 -0
  21. package/cartesian/RadarCartesianMeasureValue.d.ts +17 -0
  22. package/cartesian/RadarCartesianMeasureValue.js +22 -0
  23. package/cartesian/RadarCartesianMeasureValue.js.map +1 -0
  24. package/cartesian/RainCartesianMeasureValue.d.ts +17 -0
  25. package/cartesian/RainCartesianMeasureValue.js +23 -0
  26. package/cartesian/RainCartesianMeasureValue.js.map +1 -0
  27. package/cartesian/index.js +25 -0
  28. package/cartesian/index.js.map +1 -0
  29. package/gauge/GaugeMeasure.d.ts +20 -0
  30. package/gauge/GaugeMeasure.js +30 -0
  31. package/gauge/GaugeMeasure.js.map +1 -0
  32. package/gauge/GaugeNode.d.ts +85 -0
  33. package/{src/gauge/GaugeNode.ts → gauge/GaugeNode.js} +20 -48
  34. package/gauge/GaugeNode.js.map +1 -0
  35. package/gauge/GaugeNodeMap.d.ts +24 -0
  36. package/gauge/GaugeNodeMap.js +40 -0
  37. package/gauge/GaugeNodeMap.js.map +1 -0
  38. package/gauge/index.js +20 -0
  39. package/gauge/index.js.map +1 -0
  40. package/index.js +24 -0
  41. package/index.js.map +1 -0
  42. package/organization/EventNode.d.ts +22 -0
  43. package/organization/EventNode.js +30 -0
  44. package/organization/EventNode.js.map +1 -0
  45. package/organization/IVersion.js +3 -0
  46. package/organization/IVersion.js.map +1 -0
  47. package/organization/Link.d.ts +16 -0
  48. package/{src/organization/Link.ts → organization/Link.js} +15 -15
  49. package/organization/Link.js.map +1 -0
  50. package/organization/Measure.d.ts +22 -0
  51. package/organization/Measure.js +45 -0
  52. package/organization/Measure.js.map +1 -0
  53. package/organization/PeopleNode.d.ts +18 -0
  54. package/{src/organization/PeopleNode.ts → organization/PeopleNode.js} +10 -20
  55. package/organization/PeopleNode.js.map +1 -0
  56. package/organization/RaainNode.d.ts +91 -0
  57. package/{src/organization/RaainNode.ts → organization/RaainNode.js} +38 -63
  58. package/organization/RaainNode.js.map +1 -0
  59. package/organization/TeamNode.d.ts +63 -0
  60. package/{src/organization/TeamNode.ts → organization/TeamNode.js} +13 -36
  61. package/organization/TeamNode.js.map +1 -0
  62. package/organization/index.js +24 -0
  63. package/organization/index.js.map +1 -0
  64. package/package.json +1 -1
  65. package/polar/AbstractPolarMeasureValue.d.ts +29 -0
  66. package/{src/polar/AbstractPolarMeasureValue.ts → polar/AbstractPolarMeasureValue.js} +32 -58
  67. package/polar/AbstractPolarMeasureValue.js.map +1 -0
  68. package/polar/IPolarMeasureValue.d.ts +19 -0
  69. package/polar/IPolarMeasureValue.js +3 -0
  70. package/polar/IPolarMeasureValue.js.map +1 -0
  71. package/polar/MeasureValuePolarContainer.d.ts +19 -0
  72. package/{src/polar/MeasureValuePolarContainer.ts → polar/MeasureValuePolarContainer.js} +13 -29
  73. package/polar/MeasureValuePolarContainer.js.map +1 -0
  74. package/polar/PolarFilter.d.ts +16 -0
  75. package/polar/PolarFilter.js +45 -0
  76. package/polar/PolarFilter.js.map +1 -0
  77. package/polar/PolarMeasureValue.d.ts +51 -0
  78. package/{src/polar/PolarMeasureValue.ts → polar/PolarMeasureValue.js} +62 -125
  79. package/polar/PolarMeasureValue.js.map +1 -0
  80. package/polar/PolarMeasureValueMap.d.ts +45 -0
  81. package/{src/polar/PolarMeasureValueMap.ts → polar/PolarMeasureValueMap.js} +88 -165
  82. package/polar/PolarMeasureValueMap.js.map +1 -0
  83. package/polar/PolarValue.d.ts +10 -0
  84. package/polar/PolarValue.js +12 -0
  85. package/polar/PolarValue.js.map +1 -0
  86. package/polar/RadarPolarMeasureValue.d.ts +27 -0
  87. package/{src/polar/RadarPolarMeasureValue.ts → polar/RadarPolarMeasureValue.js} +21 -34
  88. package/polar/RadarPolarMeasureValue.js.map +1 -0
  89. package/polar/RainPolarMeasureValue.d.ts +20 -0
  90. package/polar/RainPolarMeasureValue.js +42 -0
  91. package/polar/RainPolarMeasureValue.js.map +1 -0
  92. package/polar/index.js +25 -0
  93. package/polar/index.js.map +1 -0
  94. package/quality/QualityPoint.d.ts +37 -0
  95. package/{src/quality/QualityPoint.ts → quality/QualityPoint.js} +33 -56
  96. package/quality/QualityPoint.js.map +1 -0
  97. package/quality/SpeedMatrix.d.ts +83 -0
  98. package/{src/quality/SpeedMatrix.ts → quality/SpeedMatrix.js} +76 -117
  99. package/quality/SpeedMatrix.js.map +1 -0
  100. package/quality/SpeedMatrixContainer.d.ts +102 -0
  101. package/{src/quality/SpeedMatrixContainer.ts → quality/SpeedMatrixContainer.js} +103 -210
  102. package/quality/SpeedMatrixContainer.js.map +1 -0
  103. package/quality/history/CartesianGaugeHistory.d.ts +15 -0
  104. package/quality/history/CartesianGaugeHistory.js +14 -0
  105. package/quality/history/CartesianGaugeHistory.js.map +1 -0
  106. package/quality/history/CartesianRainHistory.d.ts +9 -0
  107. package/quality/history/CartesianRainHistory.js +11 -0
  108. package/quality/history/CartesianRainHistory.js.map +1 -0
  109. package/quality/history/PositionHistory.d.ts +20 -0
  110. package/quality/history/PositionHistory.js +17 -0
  111. package/quality/history/PositionHistory.js.map +1 -0
  112. package/{src/quality/index.ts → quality/index.d.ts} +0 -3
  113. package/quality/index.js +26 -0
  114. package/quality/index.js.map +1 -0
  115. package/quality/position/Position.d.ts +22 -0
  116. package/quality/position/Position.js +50 -0
  117. package/quality/position/Position.js.map +1 -0
  118. package/quality/position/PositionValue.d.ts +9 -0
  119. package/quality/position/PositionValue.js +12 -0
  120. package/quality/position/PositionValue.js.map +1 -0
  121. package/quality/tools/QualityTools.d.ts +9 -0
  122. package/{src/quality/tools/QualityTools.ts → quality/tools/QualityTools.js} +17 -18
  123. package/quality/tools/QualityTools.js.map +1 -0
  124. package/radar/RadarMeasure.d.ts +19 -0
  125. package/radar/RadarMeasure.js +30 -0
  126. package/radar/RadarMeasure.js.map +1 -0
  127. package/radar/RadarNode.d.ts +30 -0
  128. package/{src/radar/RadarNode.ts → radar/RadarNode.js} +19 -41
  129. package/radar/RadarNode.js.map +1 -0
  130. package/radar/RadarNodeMap.d.ts +26 -0
  131. package/radar/RadarNodeMap.js +44 -0
  132. package/radar/RadarNodeMap.js.map +1 -0
  133. package/radar/index.js +20 -0
  134. package/radar/index.js.map +1 -0
  135. package/rain/MergeStrategy.d.ts +13 -0
  136. package/rain/MergeStrategy.js +11 -0
  137. package/rain/MergeStrategy.js.map +1 -0
  138. package/rain/RainComputation.d.ts +42 -0
  139. package/rain/RainComputation.js +65 -0
  140. package/rain/RainComputation.js.map +1 -0
  141. package/rain/RainComputationAbstract.d.ts +73 -0
  142. package/{src/rain/RainComputationAbstract.ts → rain/RainComputationAbstract.js} +69 -135
  143. package/rain/RainComputationAbstract.js.map +1 -0
  144. package/rain/RainComputationMap.d.ts +97 -0
  145. package/{src/rain/RainComputationMap.ts → rain/RainComputationMap.js} +22 -55
  146. package/rain/RainComputationMap.js.map +1 -0
  147. package/rain/RainComputationQuality.d.ts +40 -0
  148. package/{src/rain/RainComputationQuality.ts → rain/RainComputationQuality.js} +42 -80
  149. package/rain/RainComputationQuality.js.map +1 -0
  150. package/rain/RainMeasure.d.ts +17 -0
  151. package/rain/RainMeasure.js +18 -0
  152. package/rain/RainMeasure.js.map +1 -0
  153. package/rain/RainNode.d.ts +46 -0
  154. package/{src/rain/RainNode.ts → rain/RainNode.js} +72 -117
  155. package/rain/RainNode.js.map +1 -0
  156. package/rain/index.js +23 -0
  157. package/rain/index.js.map +1 -0
  158. package/.cursorignore +0 -10
  159. package/.github/workflows/ci.yml +0 -29
  160. package/LICENSE +0 -21
  161. package/RELEASE.md +0 -19
  162. package/specs/REQUIREMENTS.md +0 -42
  163. package/specs/TECHNICAL.md +0 -57
  164. package/specs/cartesian/Cartesian.spec.ts +0 -82
  165. package/specs/cartesian/CartesianTools.spec.ts +0 -121
  166. package/specs/gauge/Gauge.spec.ts +0 -39
  167. package/specs/organization/Organization.spec.ts +0 -38
  168. package/specs/polar/Polar.spec.ts +0 -267
  169. package/specs/quality/Position.spec.ts +0 -18
  170. package/specs/quality/QualityPointEdgeCases.spec.ts +0 -215
  171. package/specs/quality/QualityTools.spec.ts +0 -67
  172. package/specs/quality/SpeedMatrix.spec.ts +0 -214
  173. package/specs/radar/Radar.spec.ts +0 -129
  174. package/specs/rain/Rain.spec.ts +0 -334
  175. package/specs/tsconfig.json +0 -12
  176. package/src/cartesian/CartesianValue.ts +0 -26
  177. package/src/cartesian/EarthMap.ts +0 -5
  178. package/src/cartesian/ICartesianMeasureValue.ts +0 -22
  179. package/src/cartesian/LatLng.ts +0 -43
  180. package/src/cartesian/RadarCartesianMeasureValue.ts +0 -32
  181. package/src/cartesian/RainCartesianMeasureValue.ts +0 -32
  182. package/src/gauge/GaugeMeasure.ts +0 -42
  183. package/src/gauge/GaugeNodeMap.ts +0 -55
  184. package/src/organization/EventNode.ts +0 -43
  185. package/src/organization/Measure.ts +0 -61
  186. package/src/polar/IPolarMeasureValue.ts +0 -21
  187. package/src/polar/PolarFilter.ts +0 -46
  188. package/src/polar/PolarValue.ts +0 -16
  189. package/src/polar/RainPolarMeasureValue.ts +0 -57
  190. package/src/quality/history/CartesianGaugeHistory.ts +0 -23
  191. package/src/quality/history/CartesianRainHistory.ts +0 -15
  192. package/src/quality/history/PositionHistory.ts +0 -31
  193. package/src/quality/position/Position.ts +0 -59
  194. package/src/quality/position/PositionValue.ts +0 -15
  195. package/src/radar/RadarMeasure.ts +0 -41
  196. package/src/radar/RadarNodeMap.ts +0 -61
  197. package/src/rain/MergeStrategy.ts +0 -15
  198. package/src/rain/RainComputation.ts +0 -96
  199. package/src/rain/RainMeasure.ts +0 -25
  200. package/tsconfig.json +0 -17
  201. package/tslint.json +0 -79
  202. package/typedoc.json +0 -31
  203. /package/{src/cartesian/index.ts → cartesian/index.d.ts} +0 -0
  204. /package/{src/gauge/index.ts → gauge/index.d.ts} +0 -0
  205. /package/{src/index.ts → index.d.ts} +0 -0
  206. /package/{src/organization/IVersion.ts → organization/IVersion.d.ts} +0 -0
  207. /package/{src/organization/index.ts → organization/index.d.ts} +0 -0
  208. /package/{src/polar/index.ts → polar/index.d.ts} +0 -0
  209. /package/{src/radar/index.ts → radar/index.d.ts} +0 -0
  210. /package/{src/rain/index.ts → rain/index.d.ts} +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * api/teams/:id => contacts
3
+ */
4
+ export declare class PeopleNode {
5
+ id: string;
6
+ roles: string[];
7
+ email: string;
8
+ name: string;
9
+ constructor(json: {
10
+ id: string;
11
+ roles: string[];
12
+ email: string;
13
+ name: string;
14
+ });
15
+ toJSON(): any;
16
+ hasRole(role: string): boolean;
17
+ addRole(role: string): void;
18
+ }
@@ -1,27 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PeopleNode = void 0;
1
4
  /**
2
5
  * api/teams/:id => contacts
3
6
  */
4
- export class PeopleNode {
5
-
6
- public id: string;
7
- public roles: string[];
8
- public email: string;
9
- public name: string;
10
-
11
- constructor(json: {
12
- id: string,
13
- roles: string[],
14
- email: string,
15
- name: string,
16
- }
17
- ) {
7
+ class PeopleNode {
8
+ constructor(json) {
18
9
  this.id = json.id;
19
10
  this.roles = json.roles;
20
11
  this.email = json.email;
21
12
  this.name = json.name;
22
13
  }
23
-
24
- public toJSON(): any {
14
+ toJSON() {
25
15
  return {
26
16
  id: this.id,
27
17
  roles: this.roles,
@@ -29,14 +19,14 @@ export class PeopleNode {
29
19
  name: this.name,
30
20
  };
31
21
  }
32
-
33
- hasRole(role: string): boolean {
22
+ hasRole(role) {
34
23
  return this.roles.indexOf(role) >= 0;
35
24
  }
36
-
37
- addRole(role: string) {
25
+ addRole(role) {
38
26
  if (!this.hasRole(role)) {
39
27
  this.roles.push(role);
40
28
  }
41
29
  }
42
30
  }
31
+ exports.PeopleNode = PeopleNode;
32
+ //# sourceMappingURL=PeopleNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeopleNode.js","sourceRoot":"","sources":["../../src/organization/PeopleNode.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,UAAU;IAOnB,YAAY,IAKC;QAET,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IAC1B,CAAC;IAEM,MAAM;QACT,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC;IACN,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACL,CAAC;CACJ;AAtCD,gCAsCC"}
@@ -0,0 +1,91 @@
1
+ import { Link } from './Link';
2
+ import { IVersion } from './IVersion';
3
+ /**
4
+ * Base class for all RAAIN nodes in the system.
5
+ * Implements versioning and link management functionality.
6
+ *
7
+ * @remarks
8
+ * This is the foundation class for all API entities in the RAAIN system.
9
+ * It provides common functionality for:
10
+ * - Version management
11
+ * - HATEOAS link handling
12
+ * - JSON serialization
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const node = new RaainNode({
17
+ * id: 'node1',
18
+ * version: '1.0.0',
19
+ * links: [
20
+ * new Link('self', '/api/nodes/node1')
21
+ * ]
22
+ * });
23
+ * ```
24
+ */
25
+ export declare class RaainNode implements IVersion {
26
+ /** Unique identifier for the node */
27
+ id: string;
28
+ /** Version string of the node */
29
+ version: string;
30
+ /**
31
+ * Creates a new RaainNode instance.
32
+ *
33
+ * @param json - Configuration object
34
+ * @param json.id - Unique identifier
35
+ * @param json.links - Array of HATEOAS links
36
+ * @param json.version - Version string
37
+ */
38
+ constructor(json: {
39
+ id: string;
40
+ links?: Link[] | RaainNode[];
41
+ version?: string;
42
+ });
43
+ /** Array of HATEOAS links associated with the node */
44
+ protected _links: Link[];
45
+ /**
46
+ * Gets all links associated with the node.
47
+ *
48
+ * @returns Array of HATEOAS links
49
+ */
50
+ get links(): Link[];
51
+ /**
52
+ * Sets the links for the node.
53
+ *
54
+ * @param links - Array of links to set
55
+ */
56
+ set links(links: Link[] | RaainNode[]);
57
+ private static _getPurifiedLinks;
58
+ /**
59
+ * Converts the node to a JSON object.
60
+ *
61
+ * @returns A JSON object containing the node's data
62
+ */
63
+ toJSON(): any;
64
+ getLinks(linkType?: string): Link[];
65
+ getLink(linkType: string, index?: number): Link;
66
+ /**
67
+ * Gets all link IDs associated with the node.
68
+ *
69
+ * @returns Array of link IDs
70
+ */
71
+ getLinkIds(): string[];
72
+ /**
73
+ * Gets the count of links, optionally filtered by type.
74
+ *
75
+ * @param linkType - Optional type of links to count
76
+ * @returns The number of links
77
+ */
78
+ getLinksCount(linkType?: string): number;
79
+ /**
80
+ * Adds new links to the node.
81
+ *
82
+ * @param links - Array of links to add
83
+ */
84
+ addLinks(links: Link[] | RaainNode[]): void;
85
+ /**
86
+ * Gets the version string of the node.
87
+ *
88
+ * @returns The version string
89
+ */
90
+ getVersion(): string | undefined;
91
+ }
@@ -1,6 +1,7 @@
1
- import {Link} from './Link';
2
- import {IVersion} from './IVersion';
3
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RaainNode = void 0;
4
+ const Link_1 = require("./Link");
4
5
  /**
5
6
  * Base class for all RAAIN nodes in the system.
6
7
  * Implements versioning and link management functionality.
@@ -23,12 +24,7 @@ import {IVersion} from './IVersion';
23
24
  * });
24
25
  * ```
25
26
  */
26
- export class RaainNode implements IVersion {
27
- /** Unique identifier for the node */
28
- public id: string;
29
- /** Version string of the node */
30
- public version: string;
31
-
27
+ class RaainNode {
32
28
  /**
33
29
  * Creates a new RaainNode instance.
34
30
  *
@@ -37,69 +33,58 @@ export class RaainNode implements IVersion {
37
33
  * @param json.links - Array of HATEOAS links
38
34
  * @param json.version - Version string
39
35
  */
40
- constructor(json: {
41
- id: string,
42
- links?: Link[] | RaainNode[],
43
- version?: string,
44
- }) {
45
- if (!json?.id) {
36
+ constructor(json) {
37
+ if (!(json === null || json === void 0 ? void 0 : json.id)) {
46
38
  throw new Error('RaainNode needs a valid Object or ID');
47
39
  }
48
-
49
40
  this.id = json.id;
50
41
  this.links = json.links ? json.links : [];
51
42
  this.version = json.version ? json.version : undefined;
52
43
  }
53
-
54
- /** Array of HATEOAS links associated with the node */
55
- protected _links: Link[];
56
-
57
44
  /**
58
45
  * Gets all links associated with the node.
59
46
  *
60
47
  * @returns Array of HATEOAS links
61
48
  */
62
- public get links(): Link[] {
49
+ get links() {
63
50
  return this._links;
64
51
  }
65
-
66
52
  /**
67
53
  * Sets the links for the node.
68
54
  *
69
55
  * @param links - Array of links to set
70
56
  */
71
- public set links(links: Link[] | RaainNode[]) {
57
+ set links(links) {
72
58
  this._links = RaainNode._getPurifiedLinks(links);
73
59
  }
74
-
75
- private static _getPurifiedLinks(linksToPurify: any[]): Link[] {
60
+ static _getPurifiedLinks(linksToPurify) {
76
61
  if (!linksToPurify || linksToPurify.length === 0) {
77
62
  return [];
78
63
  }
79
-
80
64
  const linksPurified = linksToPurify
81
65
  .filter(l => l !== null && l !== undefined)
82
66
  .map(l => {
83
- if (l instanceof Link || Link.isCloneable(l)) {
84
- return Link.clone(l);
85
- } else if (l && typeof l.getLinkType === 'function' && l.id) {
86
- const linkType = l.getLinkType();
87
- let href = '../' + linkType + 's';
88
- const l2 = l;
89
- if (l2.date?.toISOString) {
90
- href += '/' + l2.date.toISOString();
91
- if (l2.version) {
92
- href += '/' + l2.version;
93
- }
67
+ var _a;
68
+ if (l instanceof Link_1.Link || Link_1.Link.isCloneable(l)) {
69
+ return Link_1.Link.clone(l);
70
+ }
71
+ else if (l && typeof l.getLinkType === 'function' && l.id) {
72
+ const linkType = l.getLinkType();
73
+ let href = '../' + linkType + 's';
74
+ const l2 = l;
75
+ if ((_a = l2.date) === null || _a === void 0 ? void 0 : _a.toISOString) {
76
+ href += '/' + l2.date.toISOString();
77
+ if (l2.version) {
78
+ href += '/' + l2.version;
94
79
  }
95
- href += '/' + l2.id;
96
- return new Link(linkType, href);
97
80
  }
98
- return null;
99
- })
81
+ href += '/' + l2.id;
82
+ return new Link_1.Link(linkType, href);
83
+ }
84
+ return null;
85
+ })
100
86
  .filter(l => l !== null);
101
-
102
- function uniqBy(a: Link[], key: (a: any) => string) {
87
+ function uniqBy(a, key) {
103
88
  const seen = {};
104
89
  return a.filter((item) => {
105
90
  if (!item) {
@@ -113,29 +98,24 @@ export class RaainNode implements IVersion {
113
98
  return true;
114
99
  });
115
100
  }
116
-
117
101
  return uniqBy(linksPurified, JSON.stringify);
118
102
  }
119
-
120
103
  /**
121
104
  * Converts the node to a JSON object.
122
105
  *
123
106
  * @returns A JSON object containing the node's data
124
107
  */
125
- public toJSON(): any {
126
- const json: any = {
108
+ toJSON() {
109
+ const json = {
127
110
  id: this.id,
128
111
  links: this.links
129
112
  };
130
-
131
113
  if (this.version) {
132
114
  json.version = this.version;
133
115
  }
134
-
135
116
  return json;
136
117
  }
137
-
138
- public getLinks(linkType?: string): Link[] {
118
+ getLinks(linkType) {
139
119
  if (!this._links) {
140
120
  return [];
141
121
  }
@@ -144,10 +124,8 @@ export class RaainNode implements IVersion {
144
124
  }
145
125
  // return this.links.filter(l => l && l.rel && linkType === l.rel);
146
126
  return this._links.filter(l => l.getLinkType() === linkType);
147
-
148
127
  }
149
-
150
- public getLink(linkType: string, index?: number): Link {
128
+ getLink(linkType, index) {
151
129
  index = !index ? 0 : index;
152
130
  const linksFound = this.getLinks(linkType);
153
131
  if (linksFound.length <= index) {
@@ -155,23 +133,21 @@ export class RaainNode implements IVersion {
155
133
  }
156
134
  return linksFound[index];
157
135
  }
158
-
159
136
  /**
160
137
  * Gets all link IDs associated with the node.
161
138
  *
162
139
  * @returns Array of link IDs
163
140
  */
164
- public getLinkIds(): string[] {
141
+ getLinkIds() {
165
142
  return this._links.map(l => l.getId());
166
143
  }
167
-
168
144
  /**
169
145
  * Gets the count of links, optionally filtered by type.
170
146
  *
171
147
  * @param linkType - Optional type of links to count
172
148
  * @returns The number of links
173
149
  */
174
- public getLinksCount(linkType?: string): number {
150
+ getLinksCount(linkType) {
175
151
  if (!this._links) {
176
152
  return 0;
177
153
  }
@@ -180,26 +156,25 @@ export class RaainNode implements IVersion {
180
156
  }
181
157
  return this._links.filter(l => l.getLinkType() === linkType).length;
182
158
  }
183
-
184
159
  /**
185
160
  * Adds new links to the node.
186
161
  *
187
162
  * @param links - Array of links to add
188
163
  */
189
- public addLinks(links: Link[] | RaainNode[]) {
164
+ addLinks(links) {
190
165
  if (!links) {
191
166
  return;
192
167
  }
193
-
194
168
  this._links = RaainNode._getPurifiedLinks([...this._links, ...links]);
195
169
  }
196
-
197
170
  /**
198
171
  * Gets the version string of the node.
199
172
  *
200
173
  * @returns The version string
201
174
  */
202
- public getVersion(): string | undefined {
175
+ getVersion() {
203
176
  return this.version;
204
177
  }
205
178
  }
179
+ exports.RaainNode = RaainNode;
180
+ //# sourceMappingURL=RaainNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RaainNode.js","sourceRoot":"","sources":["../../src/organization/RaainNode.ts"],"names":[],"mappings":";;;AAAA,iCAA4B;AAG5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,SAAS;IAMlB;;;;;;;OAOG;IACH,YAAY,IAIX;QACG,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAA,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC5D,CAAC;QAED,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,CAAC;IAKD;;;;OAIG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAA2B;QACxC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,iBAAiB,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system.
5
+ * This class manages team members and their contracts.
6
+ *
7
+ * @remarks
8
+ * Used in the API endpoint: api/teams?name=customerTeam
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const teamNode = new TeamNode({
13
+ * id: 'team1',
14
+ * name: 'Customer Team',
15
+ * description: 'Main customer support team',
16
+ * contracts: ['basic', 'premium'],
17
+ * contacts: [peopleNode1, peopleNode2]
18
+ * });
19
+ * ```
20
+ */
21
+ export declare class TeamNode extends RaainNode {
22
+ /** Type identifier for team nodes */
23
+ static TYPE: string;
24
+ /** Unique identifier for the team */
25
+ id: any | string;
26
+ /** Name of the team */
27
+ name: string;
28
+ /** Description of the team */
29
+ description: string;
30
+ /** Array of contract types associated with the team */
31
+ contracts: string[];
32
+ /** Array of team members */
33
+ contacts: PeopleNode[];
34
+ /**
35
+ * Creates a new TeamNode instance.
36
+ *
37
+ * @param json - Configuration object
38
+ * @param json.id - Unique identifier
39
+ * @param json.name - Optional name of the team
40
+ * @param json.description - Optional description
41
+ * @param json.contracts - Optional array of contract types
42
+ * @param json.contacts - Optional array of team members
43
+ */
44
+ constructor(json: {
45
+ id: any | string;
46
+ name?: string;
47
+ description?: string;
48
+ contracts?: string[];
49
+ contacts?: PeopleNode[];
50
+ });
51
+ /**
52
+ * Converts the team node to a JSON object.
53
+ *
54
+ * @returns A JSON object containing the team's data
55
+ */
56
+ toJSON(): any;
57
+ /**
58
+ * Returns the link type for team nodes.
59
+ *
60
+ * @returns The string 'team'
61
+ */
62
+ protected getLinkType(): string;
63
+ }
@@ -1,6 +1,7 @@
1
- import {PeopleNode} from './PeopleNode';
2
- import {RaainNode} from './RaainNode';
3
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamNode = void 0;
4
+ const RaainNode_1 = require("./RaainNode");
4
5
  /**
5
6
  * Represents a team in the RAAIN system.
6
7
  * This class manages team members and their contracts.
@@ -19,26 +20,7 @@ import {RaainNode} from './RaainNode';
19
20
  * });
20
21
  * ```
21
22
  */
22
- export class TeamNode extends RaainNode {
23
-
24
- /** Type identifier for team nodes */
25
- public static TYPE = 'team';
26
-
27
- /** Unique identifier for the team */
28
- public id: any | string;
29
-
30
- /** Name of the team */
31
- public name: string;
32
-
33
- /** Description of the team */
34
- public description: string;
35
-
36
- /** Array of contract types associated with the team */
37
- public contracts: string[];
38
-
39
- /** Array of team members */
40
- public contacts: PeopleNode[];
41
-
23
+ class TeamNode extends RaainNode_1.RaainNode {
42
24
  /**
43
25
  * Creates a new TeamNode instance.
44
26
  *
@@ -49,43 +31,38 @@ export class TeamNode extends RaainNode {
49
31
  * @param json.contracts - Optional array of contract types
50
32
  * @param json.contacts - Optional array of team members
51
33
  */
52
- constructor(json: {
53
- id: any | string,
54
- name?: string,
55
- description?: string,
56
- contracts?: string[],
57
- contacts?: PeopleNode[]
58
- }) {
34
+ constructor(json) {
59
35
  super(json);
60
-
61
36
  this.id = json.id;
62
37
  this.name = json.name;
63
38
  this.description = json.description;
64
39
  this.contracts = json.contracts;
65
40
  this.contacts = json.contacts;
66
41
  }
67
-
68
42
  /**
69
43
  * Converts the team node to a JSON object.
70
44
  *
71
45
  * @returns A JSON object containing the team's data
72
46
  */
73
- public toJSON(): any {
47
+ toJSON() {
74
48
  return {
75
49
  id: this.id,
76
50
  name: this.name,
77
51
  description: this.description,
78
52
  contracts: this.contracts,
79
53
  contacts: this.contacts,
80
- } as any;
54
+ };
81
55
  }
82
-
83
56
  /**
84
57
  * Returns the link type for team nodes.
85
58
  *
86
59
  * @returns The string 'team'
87
60
  */
88
- protected getLinkType(): string {
61
+ getLinkType() {
89
62
  return TeamNode.TYPE;
90
63
  }
91
64
  }
65
+ exports.TeamNode = TeamNode;
66
+ /** Type identifier for team nodes */
67
+ TeamNode.TYPE = 'team';
68
+ //# sourceMappingURL=TeamNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TeamNode.js","sourceRoot":"","sources":["../../src/organization/TeamNode.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAS,SAAQ,qBAAS;IAoBnC;;;;;;;;;OASG;IACH,YAAY,IAMX;QACG,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM;QACT,OAAO;YACH,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACnB,CAAC;IACb,CAAC;IAED;;;;OAIG;IACO,WAAW;QACjB,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;;AApEL,4BAqEC;AAnEG,qCAAqC;AACvB,aAAI,GAAG,MAAM,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Measure"), exports);
18
+ __exportStar(require("./EventNode"), exports);
19
+ __exportStar(require("./PeopleNode"), exports);
20
+ __exportStar(require("./Link"), exports);
21
+ __exportStar(require("./RaainNode"), exports);
22
+ __exportStar(require("./TeamNode"), exports);
23
+ __exportStar(require("./IVersion"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organization/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,6CAA2B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raain-model",
3
- "version": "2.6.10",
3
+ "version": "2.6.11",
4
4
  "author": "contact@radartorain.com",
5
5
  "homepage": "https://github.com/raainio/raain-model",
6
6
  "description": "radartorain.com api model",
@@ -0,0 +1,29 @@
1
+ import { MeasureValuePolarContainer } from './MeasureValuePolarContainer';
2
+ import { IPolarMeasureValue } from './IPolarMeasureValue';
3
+ import { PolarMeasureValue } from './PolarMeasureValue';
4
+ import { PolarValue } from './PolarValue';
5
+ export declare class AbstractPolarMeasureValue implements IPolarMeasureValue {
6
+ polarMeasureValue: PolarMeasureValue;
7
+ constructor(json: {
8
+ polarMeasureValue: AbstractPolarMeasureValue | PolarMeasureValue | string;
9
+ });
10
+ getPolarsStringified(): string;
11
+ getPolars(): MeasureValuePolarContainer[];
12
+ setPolarsAsString(measureValuePolarContainers: string, azimuthsCount: number, polarEdgesCount: number): void;
13
+ setPolarsAsContainer(measureValuePolarContainers: MeasureValuePolarContainer[], azimuthsCount: number, polarEdgesCount: number): void;
14
+ getPolarValue(json: {
15
+ azimuthInDegrees: number;
16
+ distanceInMeters: number;
17
+ }): PolarValue;
18
+ setPolarValue(json: {
19
+ azimuthInDegrees: number;
20
+ distanceInMeters: number;
21
+ value: number;
22
+ }): void;
23
+ getAzimuthsCount(): number;
24
+ getPolarEdgesCount(): number;
25
+ toJSON(options?: {
26
+ stringify: boolean;
27
+ }): any;
28
+ toJSONWithPolarStringified(): any;
29
+ }