@justair/justair-library 7.13.0 → 7.14.0-alpha.dd3a492

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.
@@ -6,4 +6,5 @@ export * from "./timezones.js";
6
6
  export * from "./dataDownloads.js";
7
7
  export * from "./terms.js";
8
8
  export * from "./jobCategories.js";
9
+ export * from "./suppliers.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  export namespace PARAMETERS {
2
- namespace CO {
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 NO2 {
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 O3 {
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 SO2 {
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 BC {
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 BRC {
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 CO2 {
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 H2S {
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 CH4 {
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 NO {
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 RN {
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: number;
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 PM1 {
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: any;
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 UFP {
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 DP {
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 DP_AMB {
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 RH {
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 RH_AMB {
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 T {
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 T_AMB {
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 WD {
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 WS {
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 GS {
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 HI {
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 P {
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 PAR {
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 ARM {
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 ARW {
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 ARD {
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 ARH {
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,29 @@
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
+ airThings: "Airthings";
14
+ aqMesh: "AQMesh";
15
+ atmotube: "Atmotube";
16
+ "blue sky": "BlueSky";
17
+ clarity: "Clarity";
18
+ dasberry: "Dasberry";
19
+ davis: "Davis Instruments";
20
+ ecosense: "Ecosense";
21
+ hobolink: "HOBOlink";
22
+ kunak: "Kunak";
23
+ metOne: "Met One";
24
+ "purple air": "PurpleAir";
25
+ "quant aq": "QuantAQ";
26
+ "reference monitor": "Reference Monitors";
27
+ sensit: "SENSIT";
28
+ }>;
29
+ //# sourceMappingURL=suppliers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suppliers.d.ts","sourceRoot":"","sources":["../../src/constants/suppliers.js"],"names":[],"mappings":"AAgDA;;;;;;GAMG;AACH,iDAHW,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,MAAM,GAAG,IAAI,GAAG,SAAS,CASrC;AA5CD;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=suppliers.test.d.ts.map
@@ -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.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AmC;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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "7.13.0",
3
+ "version": "7.14.0-alpha.dd3a492",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -15,3 +15,4 @@ export * from "./timezones.js";
15
15
  export * from "./dataDownloads.js";
16
16
  export * from "./terms.js";
17
17
  export * from "./jobCategories.js";
18
+ export * from "./suppliers.js";
@@ -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
- CO: {
8
- id: "CO",
9
- label: "CO",
10
- name: "Carbon Monoxide (CO)",
11
- unit: "ppm",
12
- type: "Gas",
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: "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.",
15
- impacts: "Makes it harder for blood to carry oxygen to the heart and brain. High indoor levels can cause confusion, passing out, or death.",
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
- NO2: {
18
- id: "NO2",
19
- label: "NO₂",
20
- name: "Nitrogen Dioxide (NO₂)",
21
- unit: "ppb",
22
- type: "Gas",
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: "Harmful gas from cars, power plants, and industrial equipment that contributes to smog and acid rain. Smells sharp and bitter.",
25
- impacts: "Can cause respiratory problems, worsen asthma and bronchitis, and increase heart-related health risks.",
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
- O3: {
28
- id: "O3",
29
- label: "O₃",
30
- name: "Ozone (O₃)",
31
- unit: "ppm",
32
- type: "Gas",
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: "Harmful smog component formed when pollution reacts with sunlight, especially problematic on hot, sunny days. Smell described as fresh or clean.",
35
- impacts: "Can irritate lungs, intensify asthma and chronic bronchitis, and increase heart problems and mortality rates.",
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
- SO2: {
58
- id: "SO2",
59
- label: "SO₂",
60
- name: "Sulfur Dioxide (SO₂)",
61
- unit: "ppb",
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: "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.",
75
- impacts: "Can cause respiratory and cardiovascular disease, including asthma, heart attacks, and lung cancer.",
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
- BRC: {
78
- id: "BRC",
79
- label: "Brown Carbon",
80
- name: "Total Brown Carbon (BrC)",
81
- unit: "ng/m³",
82
- type: "Particulate Matter",
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: "Organic particles released by burning wood and plants, especially in wildfire smoke and wood fires at home.",
85
- impacts: "Can cause respiratory and cardiovascular illnesses, exacerbate asthma, and increase mortality risk with prolonged exposure.",
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
- NO: {
118
- id: "NO",
119
- label: "NO",
120
- name: "Nitric Oxide (NO)",
121
- unit: "ppb",
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: "Made when fuel burns in car engines, power plants, and factories. Turns into NO₂ once it's in the air. Smells sharp and sweet.",
125
- 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.",
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
- PM1: {
138
- id: "PM1",
139
- label: "PM₁",
140
- name: "Particulate Matter 1 (PM₁)",
141
- unit: "µg/m³",
142
- type: "Particulate Matter",
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: "Very tiny particles from burning fuel, especially from cars, trucks, factories, power plants, and home heating.",
155
- impacts: "Can raise the risk of lung and heart disease.",
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
- // ---- T/RH/DP and their _AMB pairs (JA-3058). Does not apply to WD/WS below. ----
168
- // Bare ids (T/RH/DP) are enclosure-internal, for corrections and fog detection only. The _AMB
169
- // ids are true ambient and the only ones safe for public display or Heat Index. Never substitute
170
- // one for the other. See "Ambient vs internal met parameters" in CLAUDE.md before wiring up.
171
- DP: {
172
- id: "DP",
173
- label: "Dew Point",
174
- name: "Dew Point (DP)",
175
- unit: "°F",
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
- DP_AMB: {
182
- id: "DP_AMB",
183
- label: "Ambient Dew Point",
184
- name: "Ambient Dew Point (DP_AMB)",
185
- unit: "°F",
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
- RH: {
192
- id: "RH",
193
- label: "Humidity",
194
- name: "Relative Humidity (RH)",
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
- RH_AMB: {
202
- id: "RH_AMB",
203
- label: "Ambient Humidity",
204
- name: "Ambient Relative Humidity (RH_AMB)",
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
- T: {
212
- id: "T",
213
- label: "Temperature",
214
- name: "Temperature (T)",
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
- T_AMB: {
222
- id: "T_AMB",
223
- label: "Ambient Temperature",
224
- name: "Ambient Temperature (T_AMB)",
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
- // ---- end of the T/RH/DP pairs. Everything below is unpaired. ----
232
- WD: {
233
- id: "WD",
234
- label: "Wind Direction",
235
- name: "Wind Direction (WD)",
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
- WS: {
243
- id: "WS",
244
- label: "Wind Speed",
245
- name: "Wind Speed (WS)",
246
- unit: "mph",
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
- GS: {
253
- id: "GS",
254
- label: "Gust Speed",
255
- name: "Wind Gust Speed (GS)",
256
- unit: "mph",
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
- // Derived, not measured. Processing-Engine computes HI from the T_AMB/RH_AMB pair on each
263
- // reading (JA-3120, NOAA/Rothfusz); no supplier reports it, so nothing should ever map a raw
264
- // channel onto this id. Deliberately sits BELOW the T/RH/DP block rather than next to T_AMB:
265
- // a bare id under that block's header reads as "enclosure-internal", and wiring HI to the
266
- // internal T/RH pair is the one mistake that must not happen. It takes no _AMB suffix because
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
- P: {
300
- id: "P",
301
- label: "Pressure",
302
- name: "Air Pressure (P)",
303
- unit: "inHg",
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
- PAR: {
310
- id: "PAR",
311
- label: "PAR",
312
- name: "Photosynthetically Active Radiation (PAR)",
313
- unit: "µmol/m²/s",
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
- ARM: {
320
- id: "ARM",
321
- label: "Accumulated Rain - Monthly",
322
- name: "Accumulated Rain - Monthly (ARM)",
323
- unit: "in",
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
- ARW: {
330
- id: "ARW",
331
- label: "Accumulated Rain - Weekly",
332
- name: "Accumulated Rain - Weekly (ARW)",
333
- unit: "in",
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
- ARD: {
340
- id: "ARD",
341
- label: "Accumulated Rain - Daily",
342
- name: "Accumulated Rain - Daily (ARD)",
343
- unit: "in",
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
- ARH: {
350
- id: "ARH",
351
- label: "Accumulated Rain - Hourly",
352
- name: "Accumulated Rain - Hourly (ARH)",
353
- unit: "in",
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,63 @@
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
+ // airThings is not on the Confluence page; its label was chosen during
12
+ // JA-3220. Stored values with no agreed display name ("earthview",
13
+ // "aq mesh", "oizom", "tisch") are intentionally absent;
14
+ // getSupplierDisplayName falls back to the raw value for them.
15
+ //
16
+ // Display labels only. Never persist or compare against these strings.
17
+ //
18
+ // Frozen: every importer in a process shares this instance. Matches DEVICE_TYPES.
19
+ export const SUPPLIER_DISPLAY_NAMES = Object.freeze({
20
+ aeroqual: "Aeroqual",
21
+ airGradient: "AirGradient",
22
+ airsence: "AirSense",
23
+ airThings: "Airthings",
24
+ aqMesh: "AQMesh",
25
+ atmotube: "Atmotube",
26
+ "blue sky": "BlueSky",
27
+ clarity: "Clarity",
28
+ dasberry: "Dasberry",
29
+ davis: "Davis Instruments",
30
+ ecosense: "Ecosense",
31
+ hobolink: "HOBOlink",
32
+ kunak: "Kunak",
33
+ metOne: "Met One",
34
+ "purple air": "PurpleAir",
35
+ "quant aq": "QuantAQ",
36
+ "reference monitor": "Reference Monitors",
37
+ sensit: "SENSIT",
38
+ });
39
+
40
+ // Case-insensitive index, so callers holding a lowercased value (the V2
41
+ // client's existing map lowercases before lookup) resolve the same label.
42
+ const DISPLAY_NAMES_BY_LOWERCASE = new Map(
43
+ Object.entries(SUPPLIER_DISPLAY_NAMES).map(([key, label]) => [
44
+ key.toLowerCase(),
45
+ label,
46
+ ])
47
+ );
48
+
49
+ /**
50
+ * Returns the user-facing name for a stored monitorSupplier value.
51
+ * Unknown values come back unchanged; null/undefined come back as-is.
52
+ *
53
+ * @param {string | null | undefined} supplier
54
+ * @returns {string | null | undefined}
55
+ */
56
+ export function getSupplierDisplayName(supplier) {
57
+ if (typeof supplier !== "string") return supplier;
58
+ return (
59
+ SUPPLIER_DISPLAY_NAMES[supplier] ??
60
+ DISPLAY_NAMES_BY_LOWERCASE.get(supplier.toLowerCase()) ??
61
+ supplier
62
+ );
63
+ }
@@ -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,61 @@
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 pins every display name', () => {
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
+ airThings: 'Airthings',
23
+ aqMesh: 'AQMesh',
24
+ atmotube: 'Atmotube',
25
+ 'blue sky': 'BlueSky',
26
+ clarity: 'Clarity',
27
+ dasberry: 'Dasberry',
28
+ davis: 'Davis Instruments',
29
+ ecosense: 'Ecosense',
30
+ hobolink: 'HOBOlink',
31
+ kunak: 'Kunak',
32
+ metOne: 'Met One',
33
+ 'purple air': 'PurpleAir',
34
+ 'quant aq': 'QuantAQ',
35
+ 'reference monitor': 'Reference Monitors',
36
+ sensit: 'SENSIT',
37
+ });
38
+ });
39
+
40
+ test('every key is a value the monitorSupplier enum accepts', () => {
41
+ const enumValues = monitorsSchema.path('monitorSupplier').enumValues;
42
+ for (const key of Object.keys(SUPPLIER_DISPLAY_NAMES)) {
43
+ expect(enumValues).toContain(key);
44
+ }
45
+ });
46
+
47
+ test('getSupplierDisplayName resolves stored values, case-insensitively', () => {
48
+ expect(getSupplierDisplayName('purple air')).toBe('PurpleAir');
49
+ expect(getSupplierDisplayName('airGradient')).toBe('AirGradient');
50
+ expect(getSupplierDisplayName('airgradient')).toBe('AirGradient');
51
+ expect(getSupplierDisplayName('METONE')).toBe('Met One');
52
+ expect(getSupplierDisplayName('airthings')).toBe('Airthings');
53
+ });
54
+
55
+ test('getSupplierDisplayName falls back to the raw value for unmapped suppliers', () => {
56
+ expect(getSupplierDisplayName('earthview')).toBe('earthview');
57
+ expect(getSupplierDisplayName('aq mesh')).toBe('aq mesh');
58
+ expect(getSupplierDisplayName('')).toBe('');
59
+ expect(getSupplierDisplayName(undefined)).toBeUndefined();
60
+ expect(getSupplierDisplayName(null)).toBeNull();
61
+ });
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