@justair/justair-library 7.13.0 → 7.14.0-alpha.445fc43
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/constants/index.d.ts +1 -0
- package/dist/constants/pollutants.d.ts +31 -31
- package/dist/constants/suppliers.d.ts +28 -0
- package/dist/constants/suppliers.d.ts.map +1 -0
- package/dist/constants/tests/suppliers.test.d.ts +2 -0
- package/dist/constants/tests/suppliers.test.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants/index.js +1 -0
- package/src/constants/pollutants.js +168 -164
- package/src/constants/suppliers.js +61 -0
- package/src/constants/tests/pollutants.test.js +12 -0
- package/src/constants/tests/suppliers.test.js +59 -0
- package/src/index.js +8 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export namespace PARAMETERS {
|
|
2
|
-
namespace
|
|
2
|
+
namespace BC {
|
|
3
3
|
let id: string;
|
|
4
4
|
let label: string;
|
|
5
5
|
let name: string;
|
|
@@ -9,7 +9,7 @@ export namespace PARAMETERS {
|
|
|
9
9
|
let origin: string;
|
|
10
10
|
let impacts: string;
|
|
11
11
|
}
|
|
12
|
-
namespace
|
|
12
|
+
namespace BRC {
|
|
13
13
|
let id_1: string;
|
|
14
14
|
export { id_1 as id };
|
|
15
15
|
let label_1: string;
|
|
@@ -27,7 +27,7 @@ export namespace PARAMETERS {
|
|
|
27
27
|
let impacts_1: string;
|
|
28
28
|
export { impacts_1 as impacts };
|
|
29
29
|
}
|
|
30
|
-
namespace
|
|
30
|
+
namespace PM1 {
|
|
31
31
|
let id_2: string;
|
|
32
32
|
export { id_2 as id };
|
|
33
33
|
let label_2: string;
|
|
@@ -81,7 +81,7 @@ export namespace PARAMETERS {
|
|
|
81
81
|
let impacts_4: string;
|
|
82
82
|
export { impacts_4 as impacts };
|
|
83
83
|
}
|
|
84
|
-
namespace
|
|
84
|
+
namespace UFP {
|
|
85
85
|
let id_5: string;
|
|
86
86
|
export { id_5 as id };
|
|
87
87
|
let label_5: string;
|
|
@@ -99,7 +99,7 @@ export namespace PARAMETERS {
|
|
|
99
99
|
let impacts_5: string;
|
|
100
100
|
export { impacts_5 as impacts };
|
|
101
101
|
}
|
|
102
|
-
namespace
|
|
102
|
+
namespace CO {
|
|
103
103
|
let id_6: string;
|
|
104
104
|
export { id_6 as id };
|
|
105
105
|
let label_6: string;
|
|
@@ -117,7 +117,7 @@ export namespace PARAMETERS {
|
|
|
117
117
|
let impacts_6: string;
|
|
118
118
|
export { impacts_6 as impacts };
|
|
119
119
|
}
|
|
120
|
-
namespace
|
|
120
|
+
namespace CO2 {
|
|
121
121
|
let id_7: string;
|
|
122
122
|
export { id_7 as id };
|
|
123
123
|
let label_7: string;
|
|
@@ -135,7 +135,7 @@ export namespace PARAMETERS {
|
|
|
135
135
|
let impacts_7: string;
|
|
136
136
|
export { impacts_7 as impacts };
|
|
137
137
|
}
|
|
138
|
-
namespace
|
|
138
|
+
namespace H2S {
|
|
139
139
|
let id_8: string;
|
|
140
140
|
export { id_8 as id };
|
|
141
141
|
let label_8: string;
|
|
@@ -153,7 +153,7 @@ export namespace PARAMETERS {
|
|
|
153
153
|
let impacts_8: string;
|
|
154
154
|
export { impacts_8 as impacts };
|
|
155
155
|
}
|
|
156
|
-
namespace
|
|
156
|
+
namespace NO {
|
|
157
157
|
let id_9: string;
|
|
158
158
|
export { id_9 as id };
|
|
159
159
|
let label_9: string;
|
|
@@ -171,7 +171,7 @@ export namespace PARAMETERS {
|
|
|
171
171
|
let impacts_9: string;
|
|
172
172
|
export { impacts_9 as impacts };
|
|
173
173
|
}
|
|
174
|
-
namespace
|
|
174
|
+
namespace NO2 {
|
|
175
175
|
let id_10: string;
|
|
176
176
|
export { id_10 as id };
|
|
177
177
|
let label_10: string;
|
|
@@ -189,7 +189,7 @@ export namespace PARAMETERS {
|
|
|
189
189
|
let impacts_10: string;
|
|
190
190
|
export { impacts_10 as impacts };
|
|
191
191
|
}
|
|
192
|
-
namespace
|
|
192
|
+
namespace CH4 {
|
|
193
193
|
let id_11: string;
|
|
194
194
|
export { id_11 as id };
|
|
195
195
|
let label_11: string;
|
|
@@ -207,7 +207,7 @@ export namespace PARAMETERS {
|
|
|
207
207
|
let impacts_11: string;
|
|
208
208
|
export { impacts_11 as impacts };
|
|
209
209
|
}
|
|
210
|
-
namespace
|
|
210
|
+
namespace O3 {
|
|
211
211
|
let id_12: string;
|
|
212
212
|
export { id_12 as id };
|
|
213
213
|
let label_12: string;
|
|
@@ -218,14 +218,14 @@ export namespace PARAMETERS {
|
|
|
218
218
|
export { unit_12 as unit };
|
|
219
219
|
let type_12: string;
|
|
220
220
|
export { type_12 as type };
|
|
221
|
-
let rfc_12:
|
|
221
|
+
let rfc_12: any;
|
|
222
222
|
export { rfc_12 as rfc };
|
|
223
223
|
let origin_12: string;
|
|
224
224
|
export { origin_12 as origin };
|
|
225
225
|
let impacts_12: string;
|
|
226
226
|
export { impacts_12 as impacts };
|
|
227
227
|
}
|
|
228
|
-
namespace
|
|
228
|
+
namespace RN {
|
|
229
229
|
let id_13: string;
|
|
230
230
|
export { id_13 as id };
|
|
231
231
|
let label_13: string;
|
|
@@ -236,14 +236,14 @@ export namespace PARAMETERS {
|
|
|
236
236
|
export { unit_13 as unit };
|
|
237
237
|
let type_13: string;
|
|
238
238
|
export { type_13 as type };
|
|
239
|
-
let rfc_13:
|
|
239
|
+
let rfc_13: number;
|
|
240
240
|
export { rfc_13 as rfc };
|
|
241
241
|
let origin_13: string;
|
|
242
242
|
export { origin_13 as origin };
|
|
243
243
|
let impacts_13: string;
|
|
244
244
|
export { impacts_13 as impacts };
|
|
245
245
|
}
|
|
246
|
-
namespace
|
|
246
|
+
namespace SO2 {
|
|
247
247
|
let id_14: string;
|
|
248
248
|
export { id_14 as id };
|
|
249
249
|
let label_14: string;
|
|
@@ -279,7 +279,7 @@ export namespace PARAMETERS {
|
|
|
279
279
|
let impacts_15: string;
|
|
280
280
|
export { impacts_15 as impacts };
|
|
281
281
|
}
|
|
282
|
-
namespace
|
|
282
|
+
namespace ARH {
|
|
283
283
|
let id_16: string;
|
|
284
284
|
export { id_16 as id };
|
|
285
285
|
let label_16: string;
|
|
@@ -297,7 +297,7 @@ export namespace PARAMETERS {
|
|
|
297
297
|
let impacts_16: any;
|
|
298
298
|
export { impacts_16 as impacts };
|
|
299
299
|
}
|
|
300
|
-
namespace
|
|
300
|
+
namespace ARD {
|
|
301
301
|
let id_17: string;
|
|
302
302
|
export { id_17 as id };
|
|
303
303
|
let label_17: string;
|
|
@@ -315,7 +315,7 @@ export namespace PARAMETERS {
|
|
|
315
315
|
let impacts_17: any;
|
|
316
316
|
export { impacts_17 as impacts };
|
|
317
317
|
}
|
|
318
|
-
namespace
|
|
318
|
+
namespace ARW {
|
|
319
319
|
let id_18: string;
|
|
320
320
|
export { id_18 as id };
|
|
321
321
|
let label_18: string;
|
|
@@ -333,7 +333,7 @@ export namespace PARAMETERS {
|
|
|
333
333
|
let impacts_18: any;
|
|
334
334
|
export { impacts_18 as impacts };
|
|
335
335
|
}
|
|
336
|
-
namespace
|
|
336
|
+
namespace ARM {
|
|
337
337
|
let id_19: string;
|
|
338
338
|
export { id_19 as id };
|
|
339
339
|
let label_19: string;
|
|
@@ -351,7 +351,7 @@ export namespace PARAMETERS {
|
|
|
351
351
|
let impacts_19: any;
|
|
352
352
|
export { impacts_19 as impacts };
|
|
353
353
|
}
|
|
354
|
-
namespace
|
|
354
|
+
namespace DP {
|
|
355
355
|
let id_20: string;
|
|
356
356
|
export { id_20 as id };
|
|
357
357
|
let label_20: string;
|
|
@@ -369,7 +369,7 @@ export namespace PARAMETERS {
|
|
|
369
369
|
let impacts_20: any;
|
|
370
370
|
export { impacts_20 as impacts };
|
|
371
371
|
}
|
|
372
|
-
namespace
|
|
372
|
+
namespace DP_AMB {
|
|
373
373
|
let id_21: string;
|
|
374
374
|
export { id_21 as id };
|
|
375
375
|
let label_21: string;
|
|
@@ -387,7 +387,7 @@ export namespace PARAMETERS {
|
|
|
387
387
|
let impacts_21: any;
|
|
388
388
|
export { impacts_21 as impacts };
|
|
389
389
|
}
|
|
390
|
-
namespace
|
|
390
|
+
namespace RH {
|
|
391
391
|
let id_22: string;
|
|
392
392
|
export { id_22 as id };
|
|
393
393
|
let label_22: string;
|
|
@@ -405,7 +405,7 @@ export namespace PARAMETERS {
|
|
|
405
405
|
let impacts_22: any;
|
|
406
406
|
export { impacts_22 as impacts };
|
|
407
407
|
}
|
|
408
|
-
namespace
|
|
408
|
+
namespace RH_AMB {
|
|
409
409
|
let id_23: string;
|
|
410
410
|
export { id_23 as id };
|
|
411
411
|
let label_23: string;
|
|
@@ -423,7 +423,7 @@ export namespace PARAMETERS {
|
|
|
423
423
|
let impacts_23: any;
|
|
424
424
|
export { impacts_23 as impacts };
|
|
425
425
|
}
|
|
426
|
-
namespace
|
|
426
|
+
namespace PAR {
|
|
427
427
|
let id_24: string;
|
|
428
428
|
export { id_24 as id };
|
|
429
429
|
let label_24: string;
|
|
@@ -441,7 +441,7 @@ export namespace PARAMETERS {
|
|
|
441
441
|
let impacts_24: any;
|
|
442
442
|
export { impacts_24 as impacts };
|
|
443
443
|
}
|
|
444
|
-
namespace
|
|
444
|
+
namespace P {
|
|
445
445
|
let id_25: string;
|
|
446
446
|
export { id_25 as id };
|
|
447
447
|
let label_25: string;
|
|
@@ -495,7 +495,7 @@ export namespace PARAMETERS {
|
|
|
495
495
|
let impacts_27: any;
|
|
496
496
|
export { impacts_27 as impacts };
|
|
497
497
|
}
|
|
498
|
-
namespace
|
|
498
|
+
namespace T {
|
|
499
499
|
let id_28: string;
|
|
500
500
|
export { id_28 as id };
|
|
501
501
|
let label_28: string;
|
|
@@ -513,7 +513,7 @@ export namespace PARAMETERS {
|
|
|
513
513
|
let impacts_28: any;
|
|
514
514
|
export { impacts_28 as impacts };
|
|
515
515
|
}
|
|
516
|
-
namespace
|
|
516
|
+
namespace T_AMB {
|
|
517
517
|
let id_29: string;
|
|
518
518
|
export { id_29 as id };
|
|
519
519
|
let label_29: string;
|
|
@@ -531,7 +531,7 @@ export namespace PARAMETERS {
|
|
|
531
531
|
let impacts_29: any;
|
|
532
532
|
export { impacts_29 as impacts };
|
|
533
533
|
}
|
|
534
|
-
namespace
|
|
534
|
+
namespace WD {
|
|
535
535
|
let id_30: string;
|
|
536
536
|
export { id_30 as id };
|
|
537
537
|
let label_30: string;
|
|
@@ -549,7 +549,7 @@ export namespace PARAMETERS {
|
|
|
549
549
|
let impacts_30: any;
|
|
550
550
|
export { impacts_30 as impacts };
|
|
551
551
|
}
|
|
552
|
-
namespace
|
|
552
|
+
namespace WS {
|
|
553
553
|
let id_31: string;
|
|
554
554
|
export { id_31 as id };
|
|
555
555
|
let label_31: string;
|
|
@@ -567,7 +567,7 @@ export namespace PARAMETERS {
|
|
|
567
567
|
let impacts_31: any;
|
|
568
568
|
export { impacts_31 as impacts };
|
|
569
569
|
}
|
|
570
|
-
namespace
|
|
570
|
+
namespace GS {
|
|
571
571
|
let id_32: string;
|
|
572
572
|
export { id_32 as id };
|
|
573
573
|
let label_32: string;
|
|
@@ -585,7 +585,7 @@ export namespace PARAMETERS {
|
|
|
585
585
|
let impacts_32: any;
|
|
586
586
|
export { impacts_32 as impacts };
|
|
587
587
|
}
|
|
588
|
-
namespace
|
|
588
|
+
namespace HI {
|
|
589
589
|
let id_33: string;
|
|
590
590
|
export { id_33 as id };
|
|
591
591
|
let label_33: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the user-facing name for a stored monitorSupplier value.
|
|
3
|
+
* Unknown values come back unchanged; null/undefined come back as-is.
|
|
4
|
+
*
|
|
5
|
+
* @param {string | null | undefined} supplier
|
|
6
|
+
* @returns {string | null | undefined}
|
|
7
|
+
*/
|
|
8
|
+
export function getSupplierDisplayName(supplier: string | null | undefined): string | null | undefined;
|
|
9
|
+
export const SUPPLIER_DISPLAY_NAMES: Readonly<{
|
|
10
|
+
aeroqual: "Aeroqual";
|
|
11
|
+
airGradient: "AirGradient";
|
|
12
|
+
airsence: "AirSense";
|
|
13
|
+
aqMesh: "AQMesh";
|
|
14
|
+
atmotube: "Atmotube";
|
|
15
|
+
"blue sky": "BlueSky";
|
|
16
|
+
clarity: "Clarity";
|
|
17
|
+
dasberry: "Dasberry";
|
|
18
|
+
davis: "Davis Instruments";
|
|
19
|
+
ecosense: "Ecosense";
|
|
20
|
+
hobolink: "HOBOlink";
|
|
21
|
+
kunak: "Kunak";
|
|
22
|
+
metOne: "Met One";
|
|
23
|
+
"purple air": "PurpleAir";
|
|
24
|
+
"quant aq": "QuantAQ";
|
|
25
|
+
"reference monitor": "Reference Monitors";
|
|
26
|
+
sensit: "SENSIT";
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=suppliers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppliers.d.ts","sourceRoot":"","sources":["../../src/constants/suppliers.js"],"names":[],"mappings":"AA8CA;;;;;;GAMG;AACH,iDAHW,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,MAAM,GAAG,IAAI,GAAG,SAAS,CASrC;AA3CD;;;;;;;;;;;;;;;;;;GAkBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suppliers.test.d.ts","sourceRoot":"","sources":["../../../src/constants/tests/suppliers.test.js"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -110,6 +110,8 @@ import { isAqiCapableDeviceType } from "./constants/deviceTypes.js";
|
|
|
110
110
|
import { AQI_CAPABLE_DEVICE_TYPES } from "./constants/deviceTypes.js";
|
|
111
111
|
import { JOB_CATEGORIES } from "./constants/jobCategories.js";
|
|
112
112
|
import { JOB_CATEGORY_VALUES } from "./constants/jobCategories.js";
|
|
113
|
+
import { SUPPLIER_DISPLAY_NAMES } from "./constants/suppliers.js";
|
|
114
|
+
import { getSupplierDisplayName } from "./constants/suppliers.js";
|
|
113
115
|
import { projectSubscribedMonitors } from "./utils/subscribedDevices.js";
|
|
114
116
|
import { resolveSubscribedMonitorIdsByUser } from "./utils/subscribedDevices.js";
|
|
115
117
|
import { VISIBLE_SITE_MONITOR_FILTER } from "./utils/subscribedDevices.js";
|
|
@@ -124,5 +126,5 @@ import { validateQuietHours } from "./utils/quietHours.js";
|
|
|
124
126
|
import { getZoneMinutes } from "./utils/quietHours.js";
|
|
125
127
|
import { isInQuietWindow } from "./utils/quietHours.js";
|
|
126
128
|
import { resolveQuietHours } from "./utils/quietHours.js";
|
|
127
|
-
export { Database, adminSchema, Admin, configurationsSchema, Configurations, measurementsSchema, Measurements, monitorRequestsSchema, MonitorRequests, monitorsSchema, Monitors, organizationsSchema, Organizations, usersSchema, Users, COOKIE_CONSENT_CATEGORIES, COOKIE_CONSENT_VALUES, validateCookieConsent, eventsSchema, Events, lightMonitorSchema, LightMonitors, monitorSuppliersSchema, MonitorSuppliers, contextsSchema, Contexts, parametersSchema, Parameters, announcementSchema, Announcements, jobsSchema, Jobs, apiKeySchema, ApiKey, UsageMetrics, usageMetricsSchema, Audit, auditSchema, EventsAudit, eventsAuditSchema, MonitorAudit, monitorAuditSchema, parametersEnum, deploymentTypesEnum, AlertsAudit, Alerts, alertsSchema, alertsAuditSchema, Features, featuresSchema, dataCompletenessSchema, DataCompleteness, networkMetricsSchema, NetworkMetrics, rateOfChangeSchema, RateOfChange, changeStreamCheckpointsSchema, ChangeStreamCheckpoints, sitesSchema, Sites, sampleSitesSchema, SampleSites, sampleSiteAuditSchema, SampleSiteAudit, sampleParametersEnum, samplesSchema, Samples, samplesAuditSchema, SamplesAudit, sampleParameterReferenceConcentrations, passwordResetTokenSchema, PasswordResetToken, monitorEpisodesSchema, MonitorEpisode, userNotificationsSchema, UserNotification, AqiAlertNotification, DeviceOfflineNotification, WeeklyDigestNotification, AccountNotification, NOTIFICATION_KINDS, NOTIFICATION_CHANNELS, DELIVERY_STATUSES, DATA_DOWNLOAD_TYPES, dataDownloadSchema, DataDownloads, AqiDataDownload, SampleDataDownload, DATA_DOWNLOAD_MAX_RANGE_DAYS, DATA_DOWNLOAD_ERRORS, validateDataDownloadDateOrder, validateDataDownloadMaxDateRange, validateDataDownloadEmail, normalizeDataDownloadEmail, validateDataDownloadTimezone, normalizeDataDownloadTimezone, PARAMETERS, HEAVY_METALS, ALERT_LEVEL_WEIGHTS, getAlertWeight, TERMS_VERSION_MAX_LENGTH, DEVICE_TYPES, DEVICE_TYPE_VALUES, isAqiCapableDeviceType, AQI_CAPABLE_DEVICE_TYPES, JOB_CATEGORIES, JOB_CATEGORY_VALUES, projectSubscribedMonitors, resolveSubscribedMonitorIdsByUser, VISIBLE_SITE_MONITOR_FILTER, SUBSCRIBED_DEVICES_ERRORS, splitName, DEFAULT_QUIET_HOURS, DEFAULT_TIMEZONE, QUIET_HOURS_ERRORS, isValidTimeString, isValidIANATimezone, validateQuietHours, getZoneMinutes, isInQuietWindow, resolveQuietHours };
|
|
129
|
+
export { Database, adminSchema, Admin, configurationsSchema, Configurations, measurementsSchema, Measurements, monitorRequestsSchema, MonitorRequests, monitorsSchema, Monitors, organizationsSchema, Organizations, usersSchema, Users, COOKIE_CONSENT_CATEGORIES, COOKIE_CONSENT_VALUES, validateCookieConsent, eventsSchema, Events, lightMonitorSchema, LightMonitors, monitorSuppliersSchema, MonitorSuppliers, contextsSchema, Contexts, parametersSchema, Parameters, announcementSchema, Announcements, jobsSchema, Jobs, apiKeySchema, ApiKey, UsageMetrics, usageMetricsSchema, Audit, auditSchema, EventsAudit, eventsAuditSchema, MonitorAudit, monitorAuditSchema, parametersEnum, deploymentTypesEnum, AlertsAudit, Alerts, alertsSchema, alertsAuditSchema, Features, featuresSchema, dataCompletenessSchema, DataCompleteness, networkMetricsSchema, NetworkMetrics, rateOfChangeSchema, RateOfChange, changeStreamCheckpointsSchema, ChangeStreamCheckpoints, sitesSchema, Sites, sampleSitesSchema, SampleSites, sampleSiteAuditSchema, SampleSiteAudit, sampleParametersEnum, samplesSchema, Samples, samplesAuditSchema, SamplesAudit, sampleParameterReferenceConcentrations, passwordResetTokenSchema, PasswordResetToken, monitorEpisodesSchema, MonitorEpisode, userNotificationsSchema, UserNotification, AqiAlertNotification, DeviceOfflineNotification, WeeklyDigestNotification, AccountNotification, NOTIFICATION_KINDS, NOTIFICATION_CHANNELS, DELIVERY_STATUSES, DATA_DOWNLOAD_TYPES, dataDownloadSchema, DataDownloads, AqiDataDownload, SampleDataDownload, DATA_DOWNLOAD_MAX_RANGE_DAYS, DATA_DOWNLOAD_ERRORS, validateDataDownloadDateOrder, validateDataDownloadMaxDateRange, validateDataDownloadEmail, normalizeDataDownloadEmail, validateDataDownloadTimezone, normalizeDataDownloadTimezone, PARAMETERS, HEAVY_METALS, ALERT_LEVEL_WEIGHTS, getAlertWeight, TERMS_VERSION_MAX_LENGTH, DEVICE_TYPES, DEVICE_TYPE_VALUES, isAqiCapableDeviceType, AQI_CAPABLE_DEVICE_TYPES, JOB_CATEGORIES, JOB_CATEGORY_VALUES, SUPPLIER_DISPLAY_NAMES, getSupplierDisplayName, projectSubscribedMonitors, resolveSubscribedMonitorIdsByUser, VISIBLE_SITE_MONITOR_FILTER, SUBSCRIBED_DEVICES_ERRORS, splitName, DEFAULT_QUIET_HOURS, DEFAULT_TIMEZONE, QUIET_HOURS_ERRORS, isValidTimeString, isValidIANATimezone, validateQuietHours, getZoneMinutes, isInQuietWindow, resolveQuietHours };
|
|
128
130
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AA+KA;;;iBAEC;yBA5GwB,oBAAoB;qBADxB,gBAAgB;4BApEF,mBAAmB;sBAAnB,mBAAmB;qCAI/C,4BAA4B;+BAA5B,4BAA4B;mCAM5B,0BAA0B;6BAA1B,0BAA0B;sCAI1B,6BAA6B;gCAA7B,6BAA6B;+BAQ7B,sBAAsB;yBAAtB,sBAAsB;oCACsB,2BAA2B;8BAA3B,2BAA2B;4BAcvE,mBAAmB;sBAAnB,mBAAmB;0CAAnB,mBAAmB;sCAAnB,mBAAmB;sCAAnB,mBAAmB;6BAMnB,oBAAoB;uBAApB,oBAAoB;mCAnBuB,2BAA2B;8BAA3B,2BAA2B;uCAItE,8BAA8B;iCAA9B,8BAA8B;+BACI,sBAAsB;yBAAtB,sBAAsB;iCAClB,wBAAwB;2BAAxB,wBAAwB;mCAcnB,2BAA2B;8BAA3B,2BAA2B;2BAC5C,kBAAkB;qBAAlB,kBAAkB;6BACd,oBAAoB;uBAApB,oBAAoB;6BACR,0BAA0B;mCAA1B,0BAA0B;sBArCpE,0BAA0B;4BAA1B,0BAA0B;4BAiC1B,oBAAoB;kCAApB,oBAAoB;6BArBpB,sBAAsB;mCAAtB,sBAAsB;+BAAtB,sBAAsB;oCAAtB,sBAAsB;4BA+BtB,oBAAoB;uBAApB,oBAAoB;6BAApB,oBAAoB;kCAApB,oBAAoB;yBACc,sBAAsB;+BAAtB,sBAAsB;uCAIxD,8BAA8B;iCAA9B,8BAA8B;qCAI9B,4BAA4B;+BAA5B,4BAA4B;mCACc,0BAA0B;6BAA1B,0BAA0B;8CAIpE,qCAAqC;wCAArC,qCAAqC;4BAwDT,mBAAmB;sBAAnB,mBAAmB;kCAS/C,yBAAyB;4BAAzB,yBAAyB;sCAAzB,yBAAyB;gCAAzB,yBAAyB;qCAAzB,yBAAyB;8BASzB,qBAAqB;wBAArB,qBAAqB;mCAArB,qBAAqB;6BAArB,qBAAqB;uDAArB,qBAAqB;yCAIrB,gCAAgC;mCAAhC,gCAAgC;sCArDhC,6BAA6B;+BAA7B,6BAA6B;wCAW7B,+BAA+B;iCAA/B,+BAA+B;qCAA/B,+BAA+B;0CAA/B,+BAA+B;yCAA/B,+BAA+B;oCAA/B,+BAA+B;mCAA/B,+BAA+B;sCAA/B,+BAA+B;kCAA/B,+BAA+B;oCA3BF,8BAA8B;mCA2E3D,2BAA2B;8BAA3B,2BAA2B;gCAA3B,2BAA2B;mCAA3B,2BAA2B;+DAsB3B,mCAAmC;qCAAnC,mCAAmC;mEAAnC,mCAAmC;yEAAnC,mCAAmC;mEAAnC,mCAAmC;qEAAnC,mCAAmC;yEAAnC,mCAAmC;2EAAnC,mCAAmC;2BAvGD,2BAA2B;6BAA3B,2BAA2B;oCAI7D,4BAA4B;+BAA5B,4BAA4B;yCAGM,sBAAsB;6BAMxD,4BAA4B;mCAA5B,4BAA4B;uCAA5B,4BAA4B;yCAA5B,4BAA4B;+BACiB,8BAA8B;oCAA9B,8BAA8B;uCAI3E,0BAA0B;uCAA1B,0BAA0B;0CAgC1B,8BAA8B;kDAA9B,8BAA8B;4CAA9B,8BAA8B;0CAA9B,8BAA8B;0BAhBX,sBAAsB;oCASzC,uBAAuB;iCAtCG,0BAA0B;mCAsCpD,uBAAuB;kCAAvB,uBAAuB;oCACM,qBAAqB;mCADlD,uBAAuB;+BAAvB,uBAAuB;gCAAvB,uBAAuB;kCAAvB,uBAAuB"}
|
package/package.json
CHANGED
package/src/constants/index.js
CHANGED
|
@@ -3,36 +3,39 @@
|
|
|
3
3
|
// Most entries are read off a sensor channel. HI and DP are always derived during normalization,
|
|
4
4
|
// and DP_AMB is derived when the supplier does not report dew point. See "Ambient vs internal met
|
|
5
5
|
// parameters" in CLAUDE.md.
|
|
6
|
+
// Order is the display order from Centralized Constants (JA-3220): particulates, gases, met data,
|
|
7
|
+
// each roughly alphabetical. Consumers that list PARAMETERS in key order inherit it.
|
|
6
8
|
export const PARAMETERS = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
// ---- Particulates ----
|
|
10
|
+
BC: {
|
|
11
|
+
id: "BC",
|
|
12
|
+
label: "Black Carbon",
|
|
13
|
+
name: "Total Black Carbon (BC)",
|
|
14
|
+
unit: "ng/m³",
|
|
15
|
+
type: "Particulate Matter",
|
|
13
16
|
rfc: null,
|
|
14
|
-
origin: "
|
|
15
|
-
impacts: "
|
|
17
|
+
origin: "Black, sooty particles from burning fuel. Comes mostly from diesel and gas engines, coal power plants, and cookstoves that burn wood or coal. A major part of fine particle matter (PM₂.₅) in the air.",
|
|
18
|
+
impacts: "Can cause respiratory and cardiovascular disease, including asthma, heart attacks, and lung cancer.",
|
|
16
19
|
},
|
|
17
|
-
|
|
18
|
-
id: "
|
|
19
|
-
label: "
|
|
20
|
-
name: "
|
|
21
|
-
unit: "
|
|
22
|
-
type: "
|
|
20
|
+
BRC: {
|
|
21
|
+
id: "BRC",
|
|
22
|
+
label: "Brown Carbon",
|
|
23
|
+
name: "Total Brown Carbon (BrC)",
|
|
24
|
+
unit: "ng/m³",
|
|
25
|
+
type: "Particulate Matter",
|
|
23
26
|
rfc: null,
|
|
24
|
-
origin: "
|
|
25
|
-
impacts: "Can cause respiratory
|
|
27
|
+
origin: "Organic particles released by burning wood and plants, especially in wildfire smoke and wood fires at home.",
|
|
28
|
+
impacts: "Can cause respiratory and cardiovascular illnesses, exacerbate asthma, and increase mortality risk with prolonged exposure.",
|
|
26
29
|
},
|
|
27
|
-
|
|
28
|
-
id: "
|
|
29
|
-
label: "
|
|
30
|
-
name: "
|
|
31
|
-
unit: "
|
|
32
|
-
type: "
|
|
30
|
+
PM1: {
|
|
31
|
+
id: "PM1",
|
|
32
|
+
label: "PM₁",
|
|
33
|
+
name: "Particulate Matter 1 (PM₁)",
|
|
34
|
+
unit: "µg/m³",
|
|
35
|
+
type: "Particulate Matter",
|
|
33
36
|
rfc: null,
|
|
34
|
-
origin: "
|
|
35
|
-
impacts: "Can
|
|
37
|
+
origin: "Very fine particles that can penetrate deep into lungs and bloodstream, originating from vehicle emissions, industrial processes, and wildfires.",
|
|
38
|
+
impacts: "Can cause respiratory and cardiovascular illnesses, exacerbate asthma, and increase mortality risk with prolonged exposure.",
|
|
36
39
|
},
|
|
37
40
|
PM2_5: {
|
|
38
41
|
id: "PM2_5",
|
|
@@ -54,35 +57,26 @@ export const PARAMETERS = {
|
|
|
54
57
|
origin: "Larger particles including dust, dirt, soot, and smoke from various sources like construction and natural activities.",
|
|
55
58
|
impacts: "Can worsen respiratory diseases including asthma and COPD, particularly with short-term exposure.",
|
|
56
59
|
},
|
|
57
|
-
|
|
58
|
-
id: "
|
|
59
|
-
label: "
|
|
60
|
-
name: "
|
|
61
|
-
unit: "
|
|
62
|
-
type: "Gas",
|
|
63
|
-
rfc: null,
|
|
64
|
-
origin: "Comes mostly from burning fossil fuels at power plants and factories. Smaller amounts come from metal processing and volcanoes. Smells sharp or pungent.",
|
|
65
|
-
impacts: "Can make it hard to breathe and irritate the lungs, especially for people with asthma. Also helps form fine particle pollution and acid rain.",
|
|
66
|
-
},
|
|
67
|
-
BC: {
|
|
68
|
-
id: "BC",
|
|
69
|
-
label: "Black Carbon",
|
|
70
|
-
name: "Total Black Carbon (BC)",
|
|
71
|
-
unit: "ng/m³",
|
|
60
|
+
UFP: {
|
|
61
|
+
id: "UFP",
|
|
62
|
+
label: "Ultra Fine Particles",
|
|
63
|
+
name: "Ultra Fine Particles (UFP)",
|
|
64
|
+
unit: "pt/cm³",
|
|
72
65
|
type: "Particulate Matter",
|
|
73
66
|
rfc: null,
|
|
74
|
-
origin: "
|
|
75
|
-
impacts: "Can
|
|
67
|
+
origin: "Very tiny particles from burning fuel, especially from cars, trucks, factories, power plants, and home heating.",
|
|
68
|
+
impacts: "Can raise the risk of lung and heart disease.",
|
|
76
69
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
// ---- Gases (VOC is typed separately but grouped here, per Centralized Constants) ----
|
|
71
|
+
CO: {
|
|
72
|
+
id: "CO",
|
|
73
|
+
label: "CO",
|
|
74
|
+
name: "Carbon Monoxide (CO)",
|
|
75
|
+
unit: "ppm",
|
|
76
|
+
type: "Gas",
|
|
83
77
|
rfc: null,
|
|
84
|
-
origin: "
|
|
85
|
-
impacts: "
|
|
78
|
+
origin: "Made when fuel burns without enough oxygen. Comes mostly from car exhaust outdoors, and from heaters, furnaces, and gas stoves indoors. Has no color or smell.",
|
|
79
|
+
impacts: "Makes it harder for blood to carry oxygen to the heart and brain. High indoor levels can cause confusion, passing out, or death.",
|
|
86
80
|
},
|
|
87
81
|
CO2: {
|
|
88
82
|
id: "CO2",
|
|
@@ -104,6 +98,26 @@ export const PARAMETERS = {
|
|
|
104
98
|
origin: "Found naturally in crude oil, natural gas, and volcanic gas. Also released by oil refineries, wastewater plants, farms with livestock, and landfills. Smells of rotten-eggs.",
|
|
105
99
|
impacts: "Low levels over a long time can irritate eyes and airways and cause headaches or nausea. Very high levels can cause someone to pass out or die.",
|
|
106
100
|
},
|
|
101
|
+
NO: {
|
|
102
|
+
id: "NO",
|
|
103
|
+
label: "NO",
|
|
104
|
+
name: "Nitric Oxide (NO)",
|
|
105
|
+
unit: "ppb",
|
|
106
|
+
type: "Gas",
|
|
107
|
+
rfc: null,
|
|
108
|
+
origin: "Made when fuel burns in car engines, power plants, and factories. Turns into NO₂ once it's in the air. Smells sharp and sweet.",
|
|
109
|
+
impacts: "Can irritate the eyes, nose, throat, and lungs at low levels, and cause serious airway damage, fluid buildup in the lungs, and death at high levels.",
|
|
110
|
+
},
|
|
111
|
+
NO2: {
|
|
112
|
+
id: "NO2",
|
|
113
|
+
label: "NO₂",
|
|
114
|
+
name: "Nitrogen Dioxide (NO₂)",
|
|
115
|
+
unit: "ppb",
|
|
116
|
+
type: "Gas",
|
|
117
|
+
rfc: null,
|
|
118
|
+
origin: "Harmful gas from cars, power plants, and industrial equipment that contributes to smog and acid rain. Smells sharp and bitter.",
|
|
119
|
+
impacts: "Can cause respiratory problems, worsen asthma and bronchitis, and increase heart-related health risks.",
|
|
120
|
+
},
|
|
107
121
|
CH4: {
|
|
108
122
|
id: "CH4",
|
|
109
123
|
label: "CH₄",
|
|
@@ -114,15 +128,15 @@ export const PARAMETERS = {
|
|
|
114
128
|
origin: "Comes from landfills, oil and gas drilling, livestock and farming, coal mines, and wastewater treatment. Has no natural smell, sometimes it is added to detect leaks.",
|
|
115
129
|
impacts: "Not harmful to breathe at normal outdoor levels. In a closed space, high levels can push out oxygen and cause dizziness or passing out. It also heats the planet, since it traps heat in the air like other gases that cause climate change.",
|
|
116
130
|
},
|
|
117
|
-
|
|
118
|
-
id: "
|
|
119
|
-
label: "
|
|
120
|
-
name: "
|
|
121
|
-
unit: "
|
|
131
|
+
O3: {
|
|
132
|
+
id: "O3",
|
|
133
|
+
label: "O₃",
|
|
134
|
+
name: "Ozone (O₃)",
|
|
135
|
+
unit: "ppm",
|
|
122
136
|
type: "Gas",
|
|
123
137
|
rfc: null,
|
|
124
|
-
origin: "
|
|
125
|
-
impacts: "Can irritate
|
|
138
|
+
origin: "Harmful smog component formed when pollution reacts with sunlight, especially problematic on hot, sunny days. Smell described as fresh or clean.",
|
|
139
|
+
impacts: "Can irritate lungs, intensify asthma and chronic bronchitis, and increase heart problems and mortality rates.",
|
|
126
140
|
},
|
|
127
141
|
RN: {
|
|
128
142
|
id: "RN",
|
|
@@ -134,25 +148,15 @@ export const PARAMETERS = {
|
|
|
134
148
|
origin: "A radioactive gas that comes naturally from uranium breaking down in rock, soil, and water. It can leak into buildings through cracks in the foundation. Has no color or smell.",
|
|
135
149
|
impacts: "The second leading cause of lung cancer in the US, after smoking. Linked to about 21,000 lung cancer deaths a year.",
|
|
136
150
|
},
|
|
137
|
-
|
|
138
|
-
id: "
|
|
139
|
-
label: "
|
|
140
|
-
name: "
|
|
141
|
-
unit: "
|
|
142
|
-
type: "
|
|
143
|
-
rfc: null,
|
|
144
|
-
origin: "Very fine particles that can penetrate deep into lungs and bloodstream, originating from vehicle emissions, industrial processes, and wildfires.",
|
|
145
|
-
impacts: "Can cause respiratory and cardiovascular illnesses, exacerbate asthma, and increase mortality risk with prolonged exposure.",
|
|
146
|
-
},
|
|
147
|
-
UFP: {
|
|
148
|
-
id: "UFP",
|
|
149
|
-
label: "Ultra Fine Particles",
|
|
150
|
-
name: "Ultra Fine Particles (UFP)",
|
|
151
|
-
unit: "pt/cm³",
|
|
152
|
-
type: "Particulate Matter",
|
|
151
|
+
SO2: {
|
|
152
|
+
id: "SO2",
|
|
153
|
+
label: "SO₂",
|
|
154
|
+
name: "Sulfur Dioxide (SO₂)",
|
|
155
|
+
unit: "ppb",
|
|
156
|
+
type: "Gas",
|
|
153
157
|
rfc: null,
|
|
154
|
-
origin: "
|
|
155
|
-
impacts: "Can
|
|
158
|
+
origin: "Comes mostly from burning fossil fuels at power plants and factories. Smaller amounts come from metal processing and volcanoes. Smells sharp or pungent.",
|
|
159
|
+
impacts: "Can make it hard to breathe and irritate the lungs, especially for people with asthma. Also helps form fine particle pollution and acid rain.",
|
|
156
160
|
},
|
|
157
161
|
VOC: {
|
|
158
162
|
id: "VOC",
|
|
@@ -164,113 +168,106 @@ export const PARAMETERS = {
|
|
|
164
168
|
origin: "Released when making or using everyday products like paint, cleaning supplies, solvents, and fuel.",
|
|
165
169
|
impacts: "Can harm health when breathed in indoors. Outdoors, reacts with sunlight to form smog. Some VOCs can cause cancer.",
|
|
166
170
|
},
|
|
167
|
-
// ----
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
// ---- Met data ----
|
|
172
|
+
// T/RH/DP each have an _AMB pair, kept directly after the bare id (JA-3058). Bare ids are
|
|
173
|
+
// enclosure-internal, for corrections and fog detection only. The _AMB ids are true ambient
|
|
174
|
+
// and the only ones safe for public display or Heat Index. Never substitute one for the
|
|
175
|
+
// other. See "Ambient vs internal met parameters" in CLAUDE.md before wiring up.
|
|
176
|
+
ARH: {
|
|
177
|
+
id: "ARH",
|
|
178
|
+
label: "Accumulated Rain - Hourly",
|
|
179
|
+
name: "Accumulated Rain - Hourly (ARH)",
|
|
180
|
+
unit: "in",
|
|
176
181
|
type: "Weather",
|
|
177
182
|
rfc: null,
|
|
178
183
|
origin: null,
|
|
179
184
|
impacts: null,
|
|
180
185
|
},
|
|
181
|
-
|
|
182
|
-
id: "
|
|
183
|
-
label: "
|
|
184
|
-
name: "
|
|
185
|
-
unit: "
|
|
186
|
+
ARD: {
|
|
187
|
+
id: "ARD",
|
|
188
|
+
label: "Accumulated Rain - Daily",
|
|
189
|
+
name: "Accumulated Rain - Daily (ARD)",
|
|
190
|
+
unit: "in",
|
|
186
191
|
type: "Weather",
|
|
187
192
|
rfc: null,
|
|
188
193
|
origin: null,
|
|
189
194
|
impacts: null,
|
|
190
195
|
},
|
|
191
|
-
|
|
192
|
-
id: "
|
|
193
|
-
label: "
|
|
194
|
-
name: "
|
|
195
|
-
unit: "
|
|
196
|
+
ARW: {
|
|
197
|
+
id: "ARW",
|
|
198
|
+
label: "Accumulated Rain - Weekly",
|
|
199
|
+
name: "Accumulated Rain - Weekly (ARW)",
|
|
200
|
+
unit: "in",
|
|
196
201
|
type: "Weather",
|
|
197
202
|
rfc: null,
|
|
198
203
|
origin: null,
|
|
199
204
|
impacts: null,
|
|
200
205
|
},
|
|
201
|
-
|
|
202
|
-
id: "
|
|
203
|
-
label: "
|
|
204
|
-
name: "
|
|
205
|
-
unit: "
|
|
206
|
+
ARM: {
|
|
207
|
+
id: "ARM",
|
|
208
|
+
label: "Accumulated Rain - Monthly",
|
|
209
|
+
name: "Accumulated Rain - Monthly (ARM)",
|
|
210
|
+
unit: "in",
|
|
206
211
|
type: "Weather",
|
|
207
212
|
rfc: null,
|
|
208
213
|
origin: null,
|
|
209
214
|
impacts: null,
|
|
210
215
|
},
|
|
211
|
-
|
|
212
|
-
id: "
|
|
213
|
-
label: "
|
|
214
|
-
name: "
|
|
216
|
+
DP: {
|
|
217
|
+
id: "DP",
|
|
218
|
+
label: "Dew Point",
|
|
219
|
+
name: "Dew Point (DP)",
|
|
215
220
|
unit: "°F",
|
|
216
221
|
type: "Weather",
|
|
217
222
|
rfc: null,
|
|
218
223
|
origin: null,
|
|
219
224
|
impacts: null,
|
|
220
225
|
},
|
|
221
|
-
|
|
222
|
-
id: "
|
|
223
|
-
label: "Ambient
|
|
224
|
-
name: "Ambient
|
|
226
|
+
DP_AMB: {
|
|
227
|
+
id: "DP_AMB",
|
|
228
|
+
label: "Ambient Dew Point",
|
|
229
|
+
name: "Ambient Dew Point (DP_AMB)",
|
|
225
230
|
unit: "°F",
|
|
226
231
|
type: "Weather",
|
|
227
232
|
rfc: null,
|
|
228
233
|
origin: null,
|
|
229
234
|
impacts: null,
|
|
230
235
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
unit: "°",
|
|
236
|
+
RH: {
|
|
237
|
+
id: "RH",
|
|
238
|
+
label: "Humidity",
|
|
239
|
+
name: "Relative Humidity (RH)",
|
|
240
|
+
unit: "%",
|
|
237
241
|
type: "Weather",
|
|
238
242
|
rfc: null,
|
|
239
243
|
origin: null,
|
|
240
244
|
impacts: null,
|
|
241
245
|
},
|
|
242
|
-
|
|
243
|
-
id: "
|
|
244
|
-
label: "
|
|
245
|
-
name: "
|
|
246
|
-
unit: "
|
|
246
|
+
RH_AMB: {
|
|
247
|
+
id: "RH_AMB",
|
|
248
|
+
label: "Ambient Humidity",
|
|
249
|
+
name: "Ambient Relative Humidity (RH_AMB)",
|
|
250
|
+
unit: "%",
|
|
247
251
|
type: "Weather",
|
|
248
252
|
rfc: null,
|
|
249
253
|
origin: null,
|
|
250
254
|
impacts: null,
|
|
251
255
|
},
|
|
252
|
-
|
|
253
|
-
id: "
|
|
254
|
-
label: "
|
|
255
|
-
name: "
|
|
256
|
-
unit: "
|
|
256
|
+
PAR: {
|
|
257
|
+
id: "PAR",
|
|
258
|
+
label: "PAR",
|
|
259
|
+
name: "Photosynthetically Active Radiation (PAR)",
|
|
260
|
+
unit: "µmol/m²/s",
|
|
257
261
|
type: "Weather",
|
|
258
262
|
rfc: null,
|
|
259
263
|
origin: null,
|
|
260
264
|
impacts: null,
|
|
261
265
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
// there is no internal counterpart to tell it apart from — an enclosure Heat Index would
|
|
268
|
-
// describe the inside of a plastic box.
|
|
269
|
-
HI: {
|
|
270
|
-
id: "HI",
|
|
271
|
-
label: "Heat Index",
|
|
272
|
-
name: "Heat Index (HI)",
|
|
273
|
-
unit: "°F",
|
|
266
|
+
P: {
|
|
267
|
+
id: "P",
|
|
268
|
+
label: "Pressure",
|
|
269
|
+
name: "Air Pressure (P)",
|
|
270
|
+
unit: "inHg",
|
|
274
271
|
type: "Weather",
|
|
275
272
|
rfc: null,
|
|
276
273
|
origin: null,
|
|
@@ -296,61 +293,68 @@ export const PARAMETERS = {
|
|
|
296
293
|
origin: null,
|
|
297
294
|
impacts: null,
|
|
298
295
|
},
|
|
299
|
-
|
|
300
|
-
id: "
|
|
301
|
-
label: "
|
|
302
|
-
name: "
|
|
303
|
-
unit: "
|
|
296
|
+
T: {
|
|
297
|
+
id: "T",
|
|
298
|
+
label: "Temperature",
|
|
299
|
+
name: "Temperature (T)",
|
|
300
|
+
unit: "°F",
|
|
304
301
|
type: "Weather",
|
|
305
302
|
rfc: null,
|
|
306
303
|
origin: null,
|
|
307
304
|
impacts: null,
|
|
308
305
|
},
|
|
309
|
-
|
|
310
|
-
id: "
|
|
311
|
-
label: "
|
|
312
|
-
name: "
|
|
313
|
-
unit: "
|
|
306
|
+
T_AMB: {
|
|
307
|
+
id: "T_AMB",
|
|
308
|
+
label: "Ambient Temperature",
|
|
309
|
+
name: "Ambient Temperature (T_AMB)",
|
|
310
|
+
unit: "°F",
|
|
314
311
|
type: "Weather",
|
|
315
312
|
rfc: null,
|
|
316
313
|
origin: null,
|
|
317
314
|
impacts: null,
|
|
318
315
|
},
|
|
319
|
-
|
|
320
|
-
id: "
|
|
321
|
-
label: "
|
|
322
|
-
name: "
|
|
323
|
-
unit: "
|
|
316
|
+
WD: {
|
|
317
|
+
id: "WD",
|
|
318
|
+
label: "Wind Direction",
|
|
319
|
+
name: "Wind Direction (WD)",
|
|
320
|
+
unit: "°",
|
|
324
321
|
type: "Weather",
|
|
325
322
|
rfc: null,
|
|
326
323
|
origin: null,
|
|
327
324
|
impacts: null,
|
|
328
325
|
},
|
|
329
|
-
|
|
330
|
-
id: "
|
|
331
|
-
label: "
|
|
332
|
-
name: "
|
|
333
|
-
unit: "
|
|
326
|
+
WS: {
|
|
327
|
+
id: "WS",
|
|
328
|
+
label: "Wind Speed",
|
|
329
|
+
name: "Wind Speed (WS)",
|
|
330
|
+
unit: "mph",
|
|
334
331
|
type: "Weather",
|
|
335
332
|
rfc: null,
|
|
336
333
|
origin: null,
|
|
337
334
|
impacts: null,
|
|
338
335
|
},
|
|
339
|
-
|
|
340
|
-
id: "
|
|
341
|
-
label: "
|
|
342
|
-
name: "
|
|
343
|
-
unit: "
|
|
336
|
+
GS: {
|
|
337
|
+
id: "GS",
|
|
338
|
+
label: "Gust Speed",
|
|
339
|
+
name: "Wind Gust Speed (GS)",
|
|
340
|
+
unit: "mph",
|
|
344
341
|
type: "Weather",
|
|
345
342
|
rfc: null,
|
|
346
343
|
origin: null,
|
|
347
344
|
impacts: null,
|
|
348
345
|
},
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
346
|
+
// Derived, not measured. Processing-Engine computes HI from the T_AMB/RH_AMB pair on each
|
|
347
|
+
// reading (JA-3120, NOAA/Rothfusz); no supplier reports it, so nothing should ever map a raw
|
|
348
|
+
// channel onto this id. Deliberately kept apart from the T/T_AMB pair, after GS, so it never
|
|
349
|
+
// reads as a sibling of the enclosure-internal T, and wiring HI to the internal T/RH pair is
|
|
350
|
+
// the one mistake that must not happen. It takes no _AMB suffix because there is no internal
|
|
351
|
+
// counterpart to tell it apart from — an enclosure Heat Index would describe the inside of a
|
|
352
|
+
// plastic box.
|
|
353
|
+
HI: {
|
|
354
|
+
id: "HI",
|
|
355
|
+
label: "Heat Index",
|
|
356
|
+
name: "Heat Index (HI)",
|
|
357
|
+
unit: "°F",
|
|
354
358
|
type: "Weather",
|
|
355
359
|
rfc: null,
|
|
356
360
|
origin: null,
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// User-facing supplier names (JA-3220), from the Suppliers table on the
|
|
2
|
+
// Centralized Constants Confluence page.
|
|
3
|
+
//
|
|
4
|
+
// Keys are the values actually stored in Monitors.monitorSupplier, NOT a new
|
|
5
|
+
// vocabulary. One deliberate deviation from the Confluence table: it lists the
|
|
6
|
+
// system-facing AirSense value as "airsense", but the schema enum and every
|
|
7
|
+
// stored document use "airsence" (Processing-Engine switches on it too), so the
|
|
8
|
+
// key here is "airsence". Keying on the Confluence spelling would leave every
|
|
9
|
+
// real AirSense monitor unmapped.
|
|
10
|
+
//
|
|
11
|
+
// Stored values with no row on the Confluence page ("earthview", "aq mesh",
|
|
12
|
+
// "oizom", "airThings", "tisch") are intentionally absent until a display name
|
|
13
|
+
// is agreed; getSupplierDisplayName falls back to the raw value for them.
|
|
14
|
+
//
|
|
15
|
+
// Display labels only. Never persist or compare against these strings.
|
|
16
|
+
//
|
|
17
|
+
// Frozen: every importer in a process shares this instance. Matches DEVICE_TYPES.
|
|
18
|
+
export const SUPPLIER_DISPLAY_NAMES = Object.freeze({
|
|
19
|
+
aeroqual: "Aeroqual",
|
|
20
|
+
airGradient: "AirGradient",
|
|
21
|
+
airsence: "AirSense",
|
|
22
|
+
aqMesh: "AQMesh",
|
|
23
|
+
atmotube: "Atmotube",
|
|
24
|
+
"blue sky": "BlueSky",
|
|
25
|
+
clarity: "Clarity",
|
|
26
|
+
dasberry: "Dasberry",
|
|
27
|
+
davis: "Davis Instruments",
|
|
28
|
+
ecosense: "Ecosense",
|
|
29
|
+
hobolink: "HOBOlink",
|
|
30
|
+
kunak: "Kunak",
|
|
31
|
+
metOne: "Met One",
|
|
32
|
+
"purple air": "PurpleAir",
|
|
33
|
+
"quant aq": "QuantAQ",
|
|
34
|
+
"reference monitor": "Reference Monitors",
|
|
35
|
+
sensit: "SENSIT",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Case-insensitive index, so callers holding a lowercased value (the V2
|
|
39
|
+
// client's existing map lowercases before lookup) resolve the same label.
|
|
40
|
+
const DISPLAY_NAMES_BY_LOWERCASE = new Map(
|
|
41
|
+
Object.entries(SUPPLIER_DISPLAY_NAMES).map(([key, label]) => [
|
|
42
|
+
key.toLowerCase(),
|
|
43
|
+
label,
|
|
44
|
+
])
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Returns the user-facing name for a stored monitorSupplier value.
|
|
49
|
+
* Unknown values come back unchanged; null/undefined come back as-is.
|
|
50
|
+
*
|
|
51
|
+
* @param {string | null | undefined} supplier
|
|
52
|
+
* @returns {string | null | undefined}
|
|
53
|
+
*/
|
|
54
|
+
export function getSupplierDisplayName(supplier) {
|
|
55
|
+
if (typeof supplier !== "string") return supplier;
|
|
56
|
+
return (
|
|
57
|
+
SUPPLIER_DISPLAY_NAMES[supplier] ??
|
|
58
|
+
DISPLAY_NAMES_BY_LOWERCASE.get(supplier.toLowerCase()) ??
|
|
59
|
+
supplier
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -134,3 +134,15 @@ describe("HEAVY_METALS", () => {
|
|
|
134
134
|
expect(HEAVY_METALS.PB.rfc).toBe(0);
|
|
135
135
|
});
|
|
136
136
|
});
|
|
137
|
+
|
|
138
|
+
// Display order from the Centralized Constants page (JA-3220). Consumers that
|
|
139
|
+
// list PARAMETERS in key order render it as-is, so pin it. _AMB ids sit right
|
|
140
|
+
// after their bare pair; HI is not on the page and stays last, away from T.
|
|
141
|
+
test("PARAMETERS keys follow the Centralized Constants display order", () => {
|
|
142
|
+
expect(Object.keys(PARAMETERS)).toEqual([
|
|
143
|
+
"BC", "BRC", "PM1", "PM2_5", "PM10", "UFP",
|
|
144
|
+
"CO", "CO2", "H2S", "NO", "NO2", "CH4", "O3", "RN", "SO2", "VOC",
|
|
145
|
+
"ARH", "ARD", "ARW", "ARM", "DP", "DP_AMB", "RH", "RH_AMB", "PAR", "P", "R", "SR",
|
|
146
|
+
"T", "T_AMB", "WD", "WS", "GS", "HI",
|
|
147
|
+
]);
|
|
148
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Pins the supplier display names from the Centralized Constants page (JA-3220).
|
|
2
|
+
// Keys must be values the Monitors.monitorSupplier enum actually accepts, or the
|
|
3
|
+
// label can never be reached from a stored document.
|
|
4
|
+
import * as barrel from '../index.js';
|
|
5
|
+
import * as library from '../../index.js';
|
|
6
|
+
import { SUPPLIER_DISPLAY_NAMES, getSupplierDisplayName } from '../suppliers.js';
|
|
7
|
+
import { monitorsSchema } from '../../models/monitors.js';
|
|
8
|
+
|
|
9
|
+
test('barrel and main entry export the supplier constants', () => {
|
|
10
|
+
expect(barrel.SUPPLIER_DISPLAY_NAMES).toBe(SUPPLIER_DISPLAY_NAMES);
|
|
11
|
+
expect(barrel.getSupplierDisplayName).toBe(getSupplierDisplayName);
|
|
12
|
+
expect(library.SUPPLIER_DISPLAY_NAMES).toBe(SUPPLIER_DISPLAY_NAMES);
|
|
13
|
+
expect(library.getSupplierDisplayName).toBe(getSupplierDisplayName);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('SUPPLIER_DISPLAY_NAMES matches the Confluence Suppliers table exactly', () => {
|
|
17
|
+
expect(Object.isFrozen(SUPPLIER_DISPLAY_NAMES)).toBe(true);
|
|
18
|
+
expect(SUPPLIER_DISPLAY_NAMES).toEqual({
|
|
19
|
+
aeroqual: 'Aeroqual',
|
|
20
|
+
airGradient: 'AirGradient',
|
|
21
|
+
airsence: 'AirSense',
|
|
22
|
+
aqMesh: 'AQMesh',
|
|
23
|
+
atmotube: 'Atmotube',
|
|
24
|
+
'blue sky': 'BlueSky',
|
|
25
|
+
clarity: 'Clarity',
|
|
26
|
+
dasberry: 'Dasberry',
|
|
27
|
+
davis: 'Davis Instruments',
|
|
28
|
+
ecosense: 'Ecosense',
|
|
29
|
+
hobolink: 'HOBOlink',
|
|
30
|
+
kunak: 'Kunak',
|
|
31
|
+
metOne: 'Met One',
|
|
32
|
+
'purple air': 'PurpleAir',
|
|
33
|
+
'quant aq': 'QuantAQ',
|
|
34
|
+
'reference monitor': 'Reference Monitors',
|
|
35
|
+
sensit: 'SENSIT',
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('every key is a value the monitorSupplier enum accepts', () => {
|
|
40
|
+
const enumValues = monitorsSchema.path('monitorSupplier').enumValues;
|
|
41
|
+
for (const key of Object.keys(SUPPLIER_DISPLAY_NAMES)) {
|
|
42
|
+
expect(enumValues).toContain(key);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('getSupplierDisplayName resolves stored values, case-insensitively', () => {
|
|
47
|
+
expect(getSupplierDisplayName('purple air')).toBe('PurpleAir');
|
|
48
|
+
expect(getSupplierDisplayName('airGradient')).toBe('AirGradient');
|
|
49
|
+
expect(getSupplierDisplayName('airgradient')).toBe('AirGradient');
|
|
50
|
+
expect(getSupplierDisplayName('METONE')).toBe('Met One');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('getSupplierDisplayName falls back to the raw value for unmapped suppliers', () => {
|
|
54
|
+
expect(getSupplierDisplayName('oizom')).toBe('oizom');
|
|
55
|
+
expect(getSupplierDisplayName('aq mesh')).toBe('aq mesh');
|
|
56
|
+
expect(getSupplierDisplayName('')).toBe('');
|
|
57
|
+
expect(getSupplierDisplayName(undefined)).toBeUndefined();
|
|
58
|
+
expect(getSupplierDisplayName(null)).toBeNull();
|
|
59
|
+
});
|
package/src/index.js
CHANGED
|
@@ -83,6 +83,10 @@ import {
|
|
|
83
83
|
AQI_CAPABLE_DEVICE_TYPES,
|
|
84
84
|
} from "./constants/deviceTypes.js";
|
|
85
85
|
import { JOB_CATEGORIES, JOB_CATEGORY_VALUES } from "./constants/jobCategories.js";
|
|
86
|
+
import {
|
|
87
|
+
SUPPLIER_DISPLAY_NAMES,
|
|
88
|
+
getSupplierDisplayName,
|
|
89
|
+
} from "./constants/suppliers.js";
|
|
86
90
|
import {
|
|
87
91
|
monitorEpisodesSchema,
|
|
88
92
|
MonitorEpisode,
|
|
@@ -297,6 +301,10 @@ export {
|
|
|
297
301
|
// and JustAirService import the strings instead of retyping them
|
|
298
302
|
JOB_CATEGORIES,
|
|
299
303
|
JOB_CATEGORY_VALUES,
|
|
304
|
+
// User-facing supplier names keyed by stored monitorSupplier value (JA-3220).
|
|
305
|
+
// Display only; never persist or compare against the labels.
|
|
306
|
+
SUPPLIER_DISPLAY_NAMES,
|
|
307
|
+
getSupplierDisplayName,
|
|
300
308
|
// subscribedDevices → monitor ids, resolved at READ time (JA-3110 / JA-3335).
|
|
301
309
|
// Users.subscribedDevices is the source of truth; Users.subscribedMonitors is
|
|
302
310
|
// being retired rather than kept in step with it. Nothing should store this
|