@saber-usa/node-common 1.7.20 → 1.7.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.20",
3
+ "version": "1.7.22",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -23,8 +23,8 @@
23
23
  "author": "Saber USA",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@aws-sdk/client-s3": "^3.1036.0",
27
- "date-fns": "^4.1.0",
26
+ "@aws-sdk/client-s3": "^3.1062.0",
27
+ "date-fns": "^4.4.0",
28
28
  "lodash": "4.18.1",
29
29
  "mathjs": "^15.2.0",
30
30
  "pious-squid": "^2.3.0",
@@ -35,12 +35,12 @@
35
35
  "winston": "3.19.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@babel/preset-env": "^7.29.2",
38
+ "@babel/preset-env": "^7.29.7",
39
39
  "@eslint/js": "^10.0.1",
40
40
  "@jest/globals": "^30.3.0",
41
41
  "@sonar/scan": "^4.3.6",
42
42
  "cross-env": "^10.1.0",
43
- "eslint": "^10.2.1",
43
+ "eslint": "^10.4.1",
44
44
  "eslint-plugin-jest": "^29.15.2",
45
45
  "globals": "^17.5.0",
46
46
  "jest": "^30.3.0",
package/src/udl.js CHANGED
@@ -103,6 +103,83 @@ const udlToNpsGroundSite = (udlRow) => ({
103
103
  createdAt: fixDate(_.get(udlRow, "createdAt")),
104
104
  });
105
105
 
106
+ const udlToNpsConjunction = (udlRow) => {
107
+ const satno1 = udlRow.idOnOrbit1
108
+ ? _.get(udlRow, "idOnOrbit1", null)
109
+ : _.get(udlRow, "satNo1", null);
110
+ const satno2 = udlRow.idOnOrbit2
111
+ ? _.get(udlRow, "idOnOrbit2", null)
112
+ : _.get(udlRow, "satNo2", null);
113
+ const origin = udlRow.origin
114
+ ? _.get(udlRow, "origin", null)
115
+ : _.get(udlRow, "originator", null);
116
+
117
+ return lowerCaseObjectKeys({
118
+ IdUdl: _.get(udlRow, "id", null),
119
+ ClassificationMarking: _.get(udlRow, "classificationMarking", null),
120
+ SatNo1: satno1,
121
+ SatNo2: satno2,
122
+ Type: _.get(udlRow, "type", null),
123
+ Tca: fixDate(_.get(udlRow, "tca", null)),
124
+ MissDistance: _.get(udlRow, "missDistance", null),
125
+ CollisionProb: _.get(udlRow, "collisionProb", null),
126
+ CollisionProbMethod: _.get(udlRow, "collisionProbMethod", null),
127
+ IdStateVector1: _.get(udlRow, "idStateVector1", null),
128
+ IdStateVector2: _.get(udlRow, "idStateVector2", null),
129
+ IdElset1: _.get(udlRow, "idElset1", null),
130
+ IdElset2: _.get(udlRow, "idElset2", null),
131
+ EphemName1: _.get(udlRow, "ephemName1", null),
132
+ IdEphemerisSet1: _.get(udlRow, "idEphemerisSet1", null),
133
+ EphemName2: _.get(udlRow, "ephemName2", null),
134
+ IdEphemerisSet2: _.get(udlRow, "idEphemerisSet2", null),
135
+ RelPosR: _.get(udlRow, "relPosR", null),
136
+ RelPosT: _.get(udlRow, "relPosT", null),
137
+ RelPosN: _.get(udlRow, "relPosN", null),
138
+ RelVelMag: _.get(udlRow, "relVelMag", null),
139
+ RelVelR: _.get(udlRow, "relVelR", null),
140
+ RelVelT: _.get(udlRow, "relVelT", null),
141
+ RelVelN: _.get(udlRow, "relVelN", null),
142
+ HardBodyRadius: _.get(udlRow, "hardBodyRadius", null),
143
+ HardBodyRadiusShape: _.get(udlRow, "hardBodyRadiusShape", null),
144
+ PocDilution: _.get(udlRow, "pocDilution", null),
145
+ ScreenEntryTime: fixDate(_.get(udlRow, "screenEntryTime", null)),
146
+ ScreenExitTime: fixDate(_.get(udlRow, "screenExitTime", null)),
147
+ ScreenVolumeX: _.get(udlRow, "screenVolumeX", null),
148
+ ScreenVolumeY: _.get(udlRow, "screenVolumeY", null),
149
+ ScreenVolumeZ: _.get(udlRow, "screenVolumeZ", null),
150
+ VolShape: _.get(udlRow, "volShape", null),
151
+ VolEntryTime: fixDate(_.get(udlRow, "volEntryTime", null)),
152
+ VolExitTime: fixDate(_.get(udlRow, "volExitTime", null)),
153
+ PenetrationLevelSigma: _.get(udlRow, "penetrationLevelSigma", null),
154
+ CdAoM1: _.get(udlRow, "cdAoM1", null),
155
+ CrAoM1: _.get(udlRow, "crAoM1", null),
156
+ ThrustAccel1: _.get(udlRow, "thrustAccel1", null),
157
+ CdAoM2: _.get(udlRow, "cdAoM2", null),
158
+ CrAoM2: _.get(udlRow, "crAoM2", null),
159
+ ThrustAccel2: _.get(udlRow, "thrustAccel2", null),
160
+ Comments: _.get(udlRow, "comments", null),
161
+ Ccir: _.get(udlRow, "ccir", null),
162
+ ConcernNotes: _.get(udlRow, "concernNotes", null),
163
+ StateDeptNotified: _.get(udlRow, "stateDeptNotified", null),
164
+ OwnerContacted: _.get(udlRow, "ownerContacted", null),
165
+ MessageFor: _.get(udlRow, "messageFor", null),
166
+ MessageId: _.get(udlRow, "messageId", null),
167
+ UvwWarn: _.get(udlRow, "uvwWarn", null),
168
+ SmallRelVelWarning: _.get(udlRow, "smallRelVelWarning", null),
169
+ LargeRelPosWarning: _.get(udlRow, "largeRelPosWarning", null),
170
+ SmallCovWarning: _.get(udlRow, "smallCovWarning", null),
171
+ LargeCovWarning: _.get(udlRow, "largeCovWarning", null),
172
+ Source: _.get(udlRow, "source", null),
173
+ Origin: origin,
174
+ EventId: _.get(udlRow, "eventId", null),
175
+ Descriptor: _.get(udlRow, "descriptor", null),
176
+ DataMode: _.get(udlRow, "dataMode", null),
177
+ CreatedAt: fixDate(_.get(udlRow, "createdAt", null)),
178
+ CreatedBy: _.get(udlRow, "createdBy", null),
179
+ OrigNetwork: _.get(udlRow, "origNetwork", null),
180
+ });
181
+ };
182
+
106
183
  /**
107
184
  * Formats the response data based on the topic
108
185
  *
@@ -233,4 +310,4 @@ const enrichUdlFields = (npsOb) => {
233
310
  return npsOb;
234
311
  };
235
312
 
236
- export {udlToNpsElset, udlToNpsGroundSite, enrichUdlFields};
313
+ export {udlToNpsElset, udlToNpsGroundSite, udlToNpsConjunction, enrichUdlFields};
@@ -97,7 +97,9 @@ const getLeoRpoDataBulk = async (line1, line2, sats, startTime, endTime, include
97
97
  * @param {Number} [lonTime] datetime to analyze longitude and lon drift at, Unix ms
98
98
  * @return {Promise<Array<Object>>}
99
99
  */
100
- const getGeoRpoDataBulk = async (line1, line2, sats, startTime, endTime, lonTime, includeRIC=false) => {
100
+ const getGeoRpoDataBulk = async (
101
+ line1, line2, sats, startTime, endTime, lonTime, includeRIC=false,
102
+ ) => {
101
103
  const results = [];
102
104
  const start = new Date(startTime).getTime();
103
105
  const end = new Date(endTime).getTime();