raain-model 2.6.10 → 3.0.1

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 (215) hide show
  1. package/CHANGELOG.md +94 -7
  2. package/README.md +14 -13
  3. package/RELEASE_PROCESS.md +91 -4
  4. package/cartesian/CartesianMeasureValue.d.ts +46 -0
  5. package/{src/cartesian/CartesianMeasureValue.ts → cartesian/CartesianMeasureValue.js} +41 -73
  6. package/cartesian/CartesianMeasureValue.js.map +1 -0
  7. package/cartesian/CartesianTools.d.ts +32 -0
  8. package/{src/cartesian/CartesianTools.ts → cartesian/CartesianTools.js} +69 -130
  9. package/cartesian/CartesianTools.js.map +1 -0
  10. package/cartesian/CartesianValue.d.ts +14 -0
  11. package/cartesian/CartesianValue.js +17 -0
  12. package/cartesian/CartesianValue.js.map +1 -0
  13. package/cartesian/EarthMap.d.ts +5 -0
  14. package/cartesian/EarthMap.js +3 -0
  15. package/cartesian/EarthMap.js.map +1 -0
  16. package/cartesian/ICartesianMeasureValue.d.ts +23 -0
  17. package/cartesian/ICartesianMeasureValue.js +3 -0
  18. package/cartesian/ICartesianMeasureValue.js.map +1 -0
  19. package/cartesian/LatLng.d.ts +16 -0
  20. package/cartesian/LatLng.js +34 -0
  21. package/cartesian/LatLng.js.map +1 -0
  22. package/cartesian/RadarCartesianMeasureValue.d.ts +27 -0
  23. package/cartesian/RadarCartesianMeasureValue.js +24 -0
  24. package/cartesian/RadarCartesianMeasureValue.js.map +1 -0
  25. package/cartesian/RainCartesianMeasureValue.d.ts +25 -0
  26. package/cartesian/RainCartesianMeasureValue.js +25 -0
  27. package/cartesian/RainCartesianMeasureValue.js.map +1 -0
  28. package/cartesian/index.js +25 -0
  29. package/cartesian/index.js.map +1 -0
  30. package/gauge/GaugeMeasure.d.ts +30 -0
  31. package/gauge/GaugeMeasure.js +30 -0
  32. package/gauge/GaugeMeasure.js.map +1 -0
  33. package/gauge/GaugeNode.d.ts +95 -0
  34. package/{src/gauge/GaugeNode.ts → gauge/GaugeNode.js} +28 -54
  35. package/gauge/GaugeNode.js.map +1 -0
  36. package/gauge/GaugeNodeMap.d.ts +35 -0
  37. package/gauge/GaugeNodeMap.js +42 -0
  38. package/gauge/GaugeNodeMap.js.map +1 -0
  39. package/gauge/index.js +20 -0
  40. package/gauge/index.js.map +1 -0
  41. package/index.js +24 -0
  42. package/index.js.map +1 -0
  43. package/organization/EventNode.d.ts +30 -0
  44. package/organization/EventNode.js +30 -0
  45. package/organization/EventNode.js.map +1 -0
  46. package/organization/IVersion.js +3 -0
  47. package/organization/IVersion.js.map +1 -0
  48. package/organization/Link.d.ts +16 -0
  49. package/{src/organization/Link.ts → organization/Link.js} +15 -15
  50. package/organization/Link.js.map +1 -0
  51. package/organization/Measure.d.ts +30 -0
  52. package/organization/Measure.js +51 -0
  53. package/organization/Measure.js.map +1 -0
  54. package/organization/PeopleNode.d.ts +23 -0
  55. package/{src/organization/PeopleNode.ts → organization/PeopleNode.js} +10 -20
  56. package/organization/PeopleNode.js.map +1 -0
  57. package/organization/RaainNode.d.ts +95 -0
  58. package/{src/organization/RaainNode.ts → organization/RaainNode.js} +38 -63
  59. package/organization/RaainNode.js.map +1 -0
  60. package/organization/TeamNode.d.ts +51 -0
  61. package/organization/TeamNode.js +52 -0
  62. package/organization/TeamNode.js.map +1 -0
  63. package/organization/index.js +24 -0
  64. package/organization/index.js.map +1 -0
  65. package/package.json +4 -2
  66. package/polar/AbstractPolarMeasureValue.d.ts +31 -0
  67. package/{src/polar/AbstractPolarMeasureValue.ts → polar/AbstractPolarMeasureValue.js} +34 -62
  68. package/polar/AbstractPolarMeasureValue.js.map +1 -0
  69. package/polar/IPolarMeasureValue.d.ts +19 -0
  70. package/polar/IPolarMeasureValue.js +3 -0
  71. package/polar/IPolarMeasureValue.js.map +1 -0
  72. package/polar/MeasureValuePolarContainer.d.ts +24 -0
  73. package/{src/polar/MeasureValuePolarContainer.ts → polar/MeasureValuePolarContainer.js} +13 -29
  74. package/polar/MeasureValuePolarContainer.js.map +1 -0
  75. package/polar/PolarFilter.d.ts +16 -0
  76. package/polar/PolarFilter.js +45 -0
  77. package/polar/PolarFilter.js.map +1 -0
  78. package/polar/PolarMeasureValue.d.ts +51 -0
  79. package/{src/polar/PolarMeasureValue.ts → polar/PolarMeasureValue.js} +62 -125
  80. package/polar/PolarMeasureValue.js.map +1 -0
  81. package/polar/PolarMeasureValueMap.d.ts +45 -0
  82. package/{src/polar/PolarMeasureValueMap.ts → polar/PolarMeasureValueMap.js} +88 -165
  83. package/polar/PolarMeasureValueMap.js.map +1 -0
  84. package/polar/PolarValue.d.ts +10 -0
  85. package/polar/PolarValue.js +12 -0
  86. package/polar/PolarValue.js.map +1 -0
  87. package/polar/RadarPolarMeasureValue.d.ts +33 -0
  88. package/{src/polar/RadarPolarMeasureValue.ts → polar/RadarPolarMeasureValue.js} +31 -39
  89. package/polar/RadarPolarMeasureValue.js.map +1 -0
  90. package/polar/RainPolarMeasureValue.d.ts +24 -0
  91. package/polar/RainPolarMeasureValue.js +46 -0
  92. package/polar/RainPolarMeasureValue.js.map +1 -0
  93. package/polar/index.js +25 -0
  94. package/polar/index.js.map +1 -0
  95. package/quality/QualityPoint.d.ts +37 -0
  96. package/{src/quality/QualityPoint.ts → quality/QualityPoint.js} +33 -56
  97. package/quality/QualityPoint.js.map +1 -0
  98. package/quality/SpeedMatrix.d.ts +83 -0
  99. package/{src/quality/SpeedMatrix.ts → quality/SpeedMatrix.js} +76 -117
  100. package/quality/SpeedMatrix.js.map +1 -0
  101. package/quality/SpeedMatrixContainer.d.ts +102 -0
  102. package/{src/quality/SpeedMatrixContainer.ts → quality/SpeedMatrixContainer.js} +103 -210
  103. package/quality/SpeedMatrixContainer.js.map +1 -0
  104. package/quality/history/CartesianGaugeHistory.d.ts +15 -0
  105. package/quality/history/CartesianGaugeHistory.js +14 -0
  106. package/quality/history/CartesianGaugeHistory.js.map +1 -0
  107. package/quality/history/CartesianRainHistory.d.ts +9 -0
  108. package/quality/history/CartesianRainHistory.js +11 -0
  109. package/quality/history/CartesianRainHistory.js.map +1 -0
  110. package/quality/history/PositionHistory.d.ts +20 -0
  111. package/quality/history/PositionHistory.js +17 -0
  112. package/quality/history/PositionHistory.js.map +1 -0
  113. package/{src/quality/index.ts → quality/index.d.ts} +0 -3
  114. package/quality/index.js +26 -0
  115. package/quality/index.js.map +1 -0
  116. package/quality/position/Position.d.ts +22 -0
  117. package/quality/position/Position.js +50 -0
  118. package/quality/position/Position.js.map +1 -0
  119. package/quality/position/PositionValue.d.ts +9 -0
  120. package/quality/position/PositionValue.js +12 -0
  121. package/quality/position/PositionValue.js.map +1 -0
  122. package/quality/tools/QualityTools.d.ts +9 -0
  123. package/{src/quality/tools/QualityTools.ts → quality/tools/QualityTools.js} +17 -18
  124. package/quality/tools/QualityTools.js.map +1 -0
  125. package/radar/RadarMeasure.d.ts +38 -0
  126. package/radar/RadarMeasure.js +33 -0
  127. package/radar/RadarMeasure.js.map +1 -0
  128. package/radar/RadarNode.d.ts +41 -0
  129. package/radar/RadarNode.js +58 -0
  130. package/radar/RadarNode.js.map +1 -0
  131. package/radar/RadarNodeMap.d.ts +51 -0
  132. package/radar/RadarNodeMap.js +50 -0
  133. package/radar/RadarNodeMap.js.map +1 -0
  134. package/radar/index.js +20 -0
  135. package/radar/index.js.map +1 -0
  136. package/rain/MergeStrategy.d.ts +13 -0
  137. package/rain/MergeStrategy.js +11 -0
  138. package/rain/MergeStrategy.js.map +1 -0
  139. package/rain/RainComputation.d.ts +59 -0
  140. package/rain/RainComputation.js +68 -0
  141. package/rain/RainComputation.js.map +1 -0
  142. package/rain/RainComputationAbstract.d.ts +89 -0
  143. package/rain/RainComputationAbstract.js +207 -0
  144. package/rain/RainComputationAbstract.js.map +1 -0
  145. package/rain/RainComputationMap.d.ts +113 -0
  146. package/{src/rain/RainComputationMap.ts → rain/RainComputationMap.js} +26 -60
  147. package/rain/RainComputationMap.js.map +1 -0
  148. package/rain/RainComputationQuality.d.ts +58 -0
  149. package/{src/rain/RainComputationQuality.ts → rain/RainComputationQuality.js} +52 -89
  150. package/rain/RainComputationQuality.js.map +1 -0
  151. package/rain/RainMeasure.d.ts +17 -0
  152. package/rain/RainMeasure.js +18 -0
  153. package/rain/RainMeasure.js.map +1 -0
  154. package/rain/RainNode.d.ts +60 -0
  155. package/rain/RainNode.js +198 -0
  156. package/rain/RainNode.js.map +1 -0
  157. package/{src/rain/index.ts → rain/index.d.ts} +1 -0
  158. package/rain/index.js +24 -0
  159. package/rain/index.js.map +1 -0
  160. package/.cursorignore +0 -10
  161. package/.github/workflows/ci.yml +0 -29
  162. package/LICENSE +0 -21
  163. package/RELEASE.md +0 -19
  164. package/specs/REQUIREMENTS.md +0 -42
  165. package/specs/TECHNICAL.md +0 -57
  166. package/specs/cartesian/Cartesian.spec.ts +0 -82
  167. package/specs/cartesian/CartesianTools.spec.ts +0 -121
  168. package/specs/gauge/Gauge.spec.ts +0 -39
  169. package/specs/organization/Organization.spec.ts +0 -38
  170. package/specs/polar/Polar.spec.ts +0 -267
  171. package/specs/quality/Position.spec.ts +0 -18
  172. package/specs/quality/QualityPointEdgeCases.spec.ts +0 -215
  173. package/specs/quality/QualityTools.spec.ts +0 -67
  174. package/specs/quality/SpeedMatrix.spec.ts +0 -214
  175. package/specs/radar/Radar.spec.ts +0 -129
  176. package/specs/rain/Rain.spec.ts +0 -334
  177. package/specs/tsconfig.json +0 -12
  178. package/src/cartesian/CartesianValue.ts +0 -26
  179. package/src/cartesian/EarthMap.ts +0 -5
  180. package/src/cartesian/ICartesianMeasureValue.ts +0 -22
  181. package/src/cartesian/LatLng.ts +0 -43
  182. package/src/cartesian/RadarCartesianMeasureValue.ts +0 -32
  183. package/src/cartesian/RainCartesianMeasureValue.ts +0 -32
  184. package/src/gauge/GaugeMeasure.ts +0 -42
  185. package/src/gauge/GaugeNodeMap.ts +0 -55
  186. package/src/organization/EventNode.ts +0 -43
  187. package/src/organization/Measure.ts +0 -61
  188. package/src/organization/TeamNode.ts +0 -91
  189. package/src/polar/IPolarMeasureValue.ts +0 -21
  190. package/src/polar/PolarFilter.ts +0 -46
  191. package/src/polar/PolarValue.ts +0 -16
  192. package/src/polar/RainPolarMeasureValue.ts +0 -57
  193. package/src/quality/history/CartesianGaugeHistory.ts +0 -23
  194. package/src/quality/history/CartesianRainHistory.ts +0 -15
  195. package/src/quality/history/PositionHistory.ts +0 -31
  196. package/src/quality/position/Position.ts +0 -59
  197. package/src/quality/position/PositionValue.ts +0 -15
  198. package/src/radar/RadarMeasure.ts +0 -41
  199. package/src/radar/RadarNode.ts +0 -78
  200. package/src/radar/RadarNodeMap.ts +0 -61
  201. package/src/rain/MergeStrategy.ts +0 -15
  202. package/src/rain/RainComputation.ts +0 -96
  203. package/src/rain/RainComputationAbstract.ts +0 -262
  204. package/src/rain/RainMeasure.ts +0 -25
  205. package/src/rain/RainNode.ts +0 -235
  206. package/tsconfig.json +0 -17
  207. package/tslint.json +0 -79
  208. package/typedoc.json +0 -31
  209. /package/{src/cartesian/index.ts → cartesian/index.d.ts} +0 -0
  210. /package/{src/gauge/index.ts → gauge/index.d.ts} +0 -0
  211. /package/{src/index.ts → index.d.ts} +0 -0
  212. /package/{src/organization/IVersion.ts → organization/IVersion.d.ts} +0 -0
  213. /package/{src/organization/index.ts → organization/index.d.ts} +0 -0
  214. /package/{src/polar/index.ts → polar/index.d.ts} +0 -0
  215. /package/{src/radar/index.ts → radar/index.d.ts} +0 -0
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Link = void 0;
1
4
  /**
2
5
  * Hateoas Links :
3
6
  * [ {
@@ -5,34 +8,31 @@
5
8
  * href: string // like "https://../rains/2"
6
9
  * },...]
7
10
  */
8
- export class Link {
9
- constructor(
10
- public rel: string,
11
- public href: string
12
- ) {
11
+ class Link {
12
+ constructor(rel, href) {
13
+ this.rel = rel;
14
+ this.href = href;
13
15
  }
14
-
15
- public static isCloneable(object: any): boolean {
16
- return object?.rel && object?.href;
16
+ static isCloneable(object) {
17
+ return (object === null || object === void 0 ? void 0 : object.rel) && (object === null || object === void 0 ? void 0 : object.href);
17
18
  }
18
-
19
- public static clone(object: any): Link | null {
20
- if (!object?.rel || !object?.href) {
19
+ static clone(object) {
20
+ if (!(object === null || object === void 0 ? void 0 : object.rel) || !(object === null || object === void 0 ? void 0 : object.href)) {
21
21
  return null;
22
22
  }
23
23
  return new Link(object.rel, object.href);
24
24
  }
25
-
26
- public getId(): string {
25
+ getId() {
27
26
  const urls = this.href.split('/');
28
27
  // can be enforced : verify rel in -2 urls ?...
29
28
  return urls[urls.length - 1];
30
29
  }
31
-
32
- public getLinkType(): string {
30
+ getLinkType() {
33
31
  // const urls = this.href.split('/');
34
32
  // can be enforced : verify rel in -2 urls ?...
35
33
  // return urls[1].substring(0, urls[1].length - 1);
36
34
  return this.rel;
37
35
  }
38
36
  }
37
+ exports.Link = Link;
38
+ //# sourceMappingURL=Link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/organization/Link.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,IAAI;IACb,YACW,GAAW,EACX,IAAY;QADZ,QAAG,GAAH,GAAG,CAAQ;QACX,SAAI,GAAJ,IAAI,CAAQ;IAEvB,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,MAAW;QACjC,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,CAAC;IACvC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAW;QAC3B,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAA,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK;QACR,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,+CAA+C;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC;IAEM,WAAW;QACd,qCAAqC;QACrC,+CAA+C;QAC/C,mDAAmD;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;CACJ;AA9BD,oBA8BC"}
@@ -0,0 +1,30 @@
1
+ import { IPolarMeasureValue } from '../polar';
2
+ import { RaainNode } from './RaainNode';
3
+ import { ICartesianMeasureValue } from '../cartesian';
4
+ export declare class Measure extends RaainNode {
5
+ date: Date;
6
+ values: IPolarMeasureValue[] | ICartesianMeasureValue[] | number[];
7
+ validity: number;
8
+ private configurationAsJSON;
9
+ constructor(json: {
10
+ id: string;
11
+ values: IPolarMeasureValue[] | ICartesianMeasureValue[] | number[];
12
+ date?: Date;
13
+ validity?: number;
14
+ configurationAsJSON?: string;
15
+ version?: string;
16
+ });
17
+ setConfiguration(configuration: string | any): void;
18
+ toJSON(options?: {
19
+ removeValues?: boolean;
20
+ }): {
21
+ date: Date;
22
+ validity: number;
23
+ configurationAsJSON: string;
24
+ values: number[] | IPolarMeasureValue[] | ICartesianMeasureValue[];
25
+ id: string;
26
+ links: import("./Link").Link[];
27
+ version?: string;
28
+ };
29
+ getConfiguration(): any;
30
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Measure = void 0;
4
+ const RaainNode_1 = require("./RaainNode");
5
+ class Measure extends RaainNode_1.RaainNode {
6
+ constructor(json) {
7
+ super(json);
8
+ this.values = json.values ? json.values : [];
9
+ this.date = json.date ? new Date(json.date) : undefined;
10
+ this.validity = json.validity >= 0 ? json.validity : -1;
11
+ this.setConfiguration(json.configurationAsJSON);
12
+ }
13
+ setConfiguration(configuration) {
14
+ let conf = configuration;
15
+ try {
16
+ conf = JSON.parse(configuration);
17
+ }
18
+ catch (ignored) {
19
+ }
20
+ if (conf) {
21
+ this.configurationAsJSON = JSON.stringify(conf);
22
+ }
23
+ }
24
+ toJSON(options = {}) {
25
+ const json = super.toJSON();
26
+ const extendedJson = {
27
+ ...json,
28
+ date: this.date,
29
+ validity: this.validity,
30
+ configurationAsJSON: this.configurationAsJSON,
31
+ values: []
32
+ };
33
+ if (options === null || options === void 0 ? void 0 : options.removeValues) {
34
+ return extendedJson;
35
+ }
36
+ return {
37
+ ...extendedJson,
38
+ values: this.values
39
+ };
40
+ }
41
+ getConfiguration() {
42
+ try {
43
+ return JSON.parse(this.configurationAsJSON);
44
+ }
45
+ catch (e) {
46
+ }
47
+ return null;
48
+ }
49
+ }
50
+ exports.Measure = Measure;
51
+ //# sourceMappingURL=Measure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Measure.js","sourceRoot":"","sources":["../../src/organization/Measure.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAGtC,MAAa,OAAQ,SAAQ,qBAAS;IASlC,YAAY,IAOC;QAET,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;IAEM,gBAAgB,CAAC,aAA2B;QAC/C,IAAI,IAAI,GAAG,aAAa,CAAC;QACzB,IAAI,CAAC;YACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,UAAsC,EAAE;QAClD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,YAAY,GAAG;YACjB,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,MAAM,EAAE,EAAgE;SAC3E,CAAA;QAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE,CAAC;YACxB,OAAO,YAAY,CAAC;QACxB,CAAC;QAED,OAAO;YACH,GAAG,YAAY;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC;IACN,CAAC;IAEM,gBAAgB;QACnB,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;QACb,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAhED,0BAgEC"}
@@ -0,0 +1,23 @@
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(): {
16
+ id: string;
17
+ roles: string[];
18
+ email: string;
19
+ name: string;
20
+ };
21
+ hasRole(role: string): boolean;
22
+ addRole(role: string): void;
23
+ }
@@ -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,95 @@
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(): {
64
+ id: string;
65
+ links: Link[];
66
+ version?: string;
67
+ };
68
+ getLinks(linkType?: string): Link[];
69
+ getLink(linkType: string, index?: number): Link;
70
+ /**
71
+ * Gets all link IDs associated with the node.
72
+ *
73
+ * @returns Array of link IDs
74
+ */
75
+ getLinkIds(): string[];
76
+ /**
77
+ * Gets the count of links, optionally filtered by type.
78
+ *
79
+ * @param linkType - Optional type of links to count
80
+ * @returns The number of links
81
+ */
82
+ getLinksCount(linkType?: string): number;
83
+ /**
84
+ * Adds new links to the node.
85
+ *
86
+ * @param links - Array of links to add
87
+ */
88
+ addLinks(links: Link[] | RaainNode[]): void;
89
+ /**
90
+ * Gets the version string of the node.
91
+ *
92
+ * @returns The version string
93
+ */
94
+ getVersion(): string | undefined;
95
+ }
@@ -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,I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AC,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACI,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ;AAvLD,8BAuLC"}
@@ -0,0 +1,51 @@
1
+ import { PeopleNode } from './PeopleNode';
2
+ import { RaainNode } from './RaainNode';
3
+ export interface ITeamNode {
4
+ }
5
+ /**
6
+ * Represents a team in the RAAIN system.
7
+ * This class manages team members and their contracts.
8
+ *
9
+ * @remarks
10
+ * Used in the API endpoint: api/teams?name=customerTeam
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const teamNode = new TeamNode({
15
+ * id: 'team1',
16
+ * name: 'Customer Team',
17
+ * description: 'Main customer support team',
18
+ * contracts: ['basic', 'premium'],
19
+ * contacts: [peopleNode1, peopleNode2]
20
+ * });
21
+ * ```
22
+ */
23
+ export declare class TeamNode extends RaainNode {
24
+ static readonly TYPE = "team";
25
+ name: string;
26
+ description: string;
27
+ contracts: string[];
28
+ contacts: PeopleNode[];
29
+ constructor(json: {
30
+ id: any | string;
31
+ name?: string;
32
+ description?: string;
33
+ contracts?: string[];
34
+ contacts?: PeopleNode[];
35
+ });
36
+ toJSON(): {
37
+ name: string;
38
+ description: string;
39
+ contracts: string[];
40
+ contacts: PeopleNode[];
41
+ id: string;
42
+ links: import("./Link").Link[];
43
+ version?: string;
44
+ };
45
+ /**
46
+ * Returns the link type for team nodes.
47
+ *
48
+ * @returns The string 'team'
49
+ */
50
+ protected getLinkType(): string;
51
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamNode = void 0;
4
+ const RaainNode_1 = require("./RaainNode");
5
+ /**
6
+ * Represents a team in the RAAIN system.
7
+ * This class manages team members and their contracts.
8
+ *
9
+ * @remarks
10
+ * Used in the API endpoint: api/teams?name=customerTeam
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const teamNode = new TeamNode({
15
+ * id: 'team1',
16
+ * name: 'Customer Team',
17
+ * description: 'Main customer support team',
18
+ * contracts: ['basic', 'premium'],
19
+ * contacts: [peopleNode1, peopleNode2]
20
+ * });
21
+ * ```
22
+ */
23
+ class TeamNode extends RaainNode_1.RaainNode {
24
+ constructor(json) {
25
+ super(json);
26
+ this.name = json.name;
27
+ this.description = json.description;
28
+ this.contracts = json.contracts;
29
+ this.contacts = json.contacts;
30
+ }
31
+ toJSON() {
32
+ const json = super.toJSON();
33
+ return {
34
+ ...json,
35
+ name: this.name,
36
+ description: this.description,
37
+ contracts: this.contracts,
38
+ contacts: this.contacts,
39
+ };
40
+ }
41
+ /**
42
+ * Returns the link type for team nodes.
43
+ *
44
+ * @returns The string 'team'
45
+ */
46
+ getLinkType() {
47
+ return TeamNode.TYPE;
48
+ }
49
+ }
50
+ exports.TeamNode = TeamNode;
51
+ TeamNode.TYPE = 'team';
52
+ //# sourceMappingURL=TeamNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TeamNode.js","sourceRoot":"","sources":["../../src/organization/TeamNode.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAMtC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,QAAS,SAAQ,qBAAS;IASnC,YAAY,IAMX;QACG,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,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;IAEM,MAAM;QACT,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5B,OAAO;YACH,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAC;IACN,CAAC;IAED;;;;OAIG;IACO,WAAW;QACjB,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;;AA1CL,4BA2CC;AAzC0B,aAAI,GAAG,MAAM,CAAC"}