@aguacerowx/javascript-sdk 0.0.27 → 0.0.28

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/events.js CHANGED
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EventEmitter = void 0;
7
7
  // aguacero-api/src/events.js
8
8
 
9
- /**
10
- * A simple class for emitting and listening to events.
9
+ /**
10
+ * A simple class for emitting and listening to events.
11
11
  */
12
12
  class EventEmitter {
13
13
  constructor() {
@@ -4,12 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getBundleId = void 0;
7
- /**
8
- * Default implementation for web and Node bundlers (Vite, webpack).
9
- * Do not import react-native-device-info here: static analysis would pull in
10
- * `react-native` (Flow sources) and break esbuild.
11
- *
12
- * Metro resolves `getBundleId.native.js` on iOS/Android instead of this file.
13
- */
14
- const getBundleId = () => null;
15
- exports.getBundleId = getBundleId;
7
+ // This module acts as a platform-agnostic proxy.
8
+
9
+ let getBundleIdImpl;
10
+ try {
11
+ // This line will ONLY succeed in a React Native environment where the
12
+ // 'react-native-device-info' module is installed.
13
+ const DeviceInfo = require('react-native-device-info');
14
+
15
+ // If the above line doesn't throw an error, we set the implementation
16
+ // to the native version.
17
+ getBundleIdImpl = () => DeviceInfo.getBundleId();
18
+ } catch (e) {
19
+ // If require() fails, we know we are in a non-React Native environment
20
+ // (like the web). We set the implementation to a "dummy" function
21
+ // that does nothing and returns null.
22
+ getBundleIdImpl = () => null;
23
+ }
24
+
25
+ // Export the chosen implementation.
26
+ const getBundleId = exports.getBundleId = getBundleIdImpl;
package/dist/index.js CHANGED
@@ -3,43 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- AguaceroCore: true,
8
- EventEmitter: true,
9
- THEME_CONFIGS: true,
10
- DICTIONARIES: true,
11
- DEFAULT_COLORMAPS: true,
12
- getUnitConversionFunction: true,
13
- SATELLITE_FRAMES_URL: true,
14
- GOES_EAST_SATELLITE_SECTORS: true,
15
- GOES_SATELLITE_CHANNELS: true,
16
- GOES_SATELLITE_CHANNEL_LABELS: true,
17
- SATELLITE_DURATION_CONFIG: true,
18
- TIMELINE_DURATION_MAX_HOURS: true,
19
- TIMELINE_DURATION_HOUR_VALUES: true,
20
- formatTimelineDurationValue: true,
21
- normalizeTimelineDurationValue: true,
22
- parseTimelineDurationHours: true,
23
- resolveSatelliteDurationOption: true,
24
- getDefaultSatelliteDurationOption: true,
25
- buildSatelliteTimelineForSelection: true,
26
- getAllGoesEastSatelliteSelections: true,
27
- calculateUnixTimeFromSatelliteKey: true,
28
- resolveSatelliteS3FileName: true,
29
- resolveSatelliteSectorLabel: true
30
- };
31
6
  Object.defineProperty(exports, "AguaceroCore", {
32
7
  enumerable: true,
33
8
  get: function () {
34
9
  return _AguaceroCore.AguaceroCore;
35
10
  }
36
11
  });
37
- Object.defineProperty(exports, "DEFAULT_COLORMAPS", {
38
- enumerable: true,
39
- get: function () {
40
- return _defaultColormaps.DEFAULT_COLORMAPS;
41
- }
42
- });
43
12
  Object.defineProperty(exports, "DICTIONARIES", {
44
13
  enumerable: true,
45
14
  get: function () {
@@ -52,160 +21,20 @@ Object.defineProperty(exports, "EventEmitter", {
52
21
  return _events.EventEmitter;
53
22
  }
54
23
  });
55
- Object.defineProperty(exports, "GOES_EAST_SATELLITE_SECTORS", {
56
- enumerable: true,
57
- get: function () {
58
- return _satellite_support.GOES_EAST_SATELLITE_SECTORS;
59
- }
60
- });
61
- Object.defineProperty(exports, "GOES_SATELLITE_CHANNELS", {
62
- enumerable: true,
63
- get: function () {
64
- return _satellite_support.GOES_SATELLITE_CHANNELS;
65
- }
66
- });
67
- Object.defineProperty(exports, "GOES_SATELLITE_CHANNEL_LABELS", {
68
- enumerable: true,
69
- get: function () {
70
- return _satellite_support.GOES_SATELLITE_CHANNEL_LABELS;
71
- }
72
- });
73
- Object.defineProperty(exports, "SATELLITE_DURATION_CONFIG", {
74
- enumerable: true,
75
- get: function () {
76
- return _satellite_support.SATELLITE_DURATION_CONFIG;
77
- }
78
- });
79
- Object.defineProperty(exports, "SATELLITE_FRAMES_URL", {
80
- enumerable: true,
81
- get: function () {
82
- return _satellite_support.SATELLITE_FRAMES_URL;
83
- }
84
- });
85
24
  Object.defineProperty(exports, "THEME_CONFIGS", {
86
25
  enumerable: true,
87
26
  get: function () {
88
27
  return _mapStyles.THEME_CONFIGS;
89
28
  }
90
29
  });
91
- Object.defineProperty(exports, "TIMELINE_DURATION_HOUR_VALUES", {
92
- enumerable: true,
93
- get: function () {
94
- return _satellite_support.TIMELINE_DURATION_HOUR_VALUES;
95
- }
96
- });
97
- Object.defineProperty(exports, "TIMELINE_DURATION_MAX_HOURS", {
98
- enumerable: true,
99
- get: function () {
100
- return _satellite_support.TIMELINE_DURATION_MAX_HOURS;
101
- }
102
- });
103
- Object.defineProperty(exports, "buildSatelliteTimelineForSelection", {
104
- enumerable: true,
105
- get: function () {
106
- return _satellite_support.buildSatelliteTimelineForSelection;
107
- }
108
- });
109
- Object.defineProperty(exports, "calculateUnixTimeFromSatelliteKey", {
110
- enumerable: true,
111
- get: function () {
112
- return _satellite_support.calculateUnixTimeFromSatelliteKey;
113
- }
114
- });
115
- Object.defineProperty(exports, "formatTimelineDurationValue", {
116
- enumerable: true,
117
- get: function () {
118
- return _satellite_support.formatTimelineDurationValue;
119
- }
120
- });
121
- Object.defineProperty(exports, "getAllGoesEastSatelliteSelections", {
122
- enumerable: true,
123
- get: function () {
124
- return _satellite_support.getAllGoesEastSatelliteSelections;
125
- }
126
- });
127
- Object.defineProperty(exports, "getDefaultSatelliteDurationOption", {
128
- enumerable: true,
129
- get: function () {
130
- return _satellite_support.getDefaultSatelliteDurationOption;
131
- }
132
- });
133
30
  Object.defineProperty(exports, "getUnitConversionFunction", {
134
31
  enumerable: true,
135
32
  get: function () {
136
33
  return _unitConversions.getUnitConversionFunction;
137
34
  }
138
35
  });
139
- Object.defineProperty(exports, "normalizeTimelineDurationValue", {
140
- enumerable: true,
141
- get: function () {
142
- return _satellite_support.normalizeTimelineDurationValue;
143
- }
144
- });
145
- Object.defineProperty(exports, "parseTimelineDurationHours", {
146
- enumerable: true,
147
- get: function () {
148
- return _satellite_support.parseTimelineDurationHours;
149
- }
150
- });
151
- Object.defineProperty(exports, "resolveSatelliteDurationOption", {
152
- enumerable: true,
153
- get: function () {
154
- return _satellite_support.resolveSatelliteDurationOption;
155
- }
156
- });
157
- Object.defineProperty(exports, "resolveSatelliteS3FileName", {
158
- enumerable: true,
159
- get: function () {
160
- return _satellite_support.resolveSatelliteS3FileName;
161
- }
162
- });
163
- Object.defineProperty(exports, "resolveSatelliteSectorLabel", {
164
- enumerable: true,
165
- get: function () {
166
- return _satellite_support.resolveSatelliteSectorLabel;
167
- }
168
- });
169
36
  var _AguaceroCore = require("./AguaceroCore.js");
170
37
  var _events = require("./events.js");
171
38
  var _mapStyles = require("./map-styles.js");
172
39
  var _dictionaries = require("./dictionaries.js");
173
- var _defaultColormaps = require("./default-colormaps.js");
174
- var _unitConversions = require("./unitConversions.js");
175
- var _satellite_support = require("./satellite_support.js");
176
- var _nexradTilts = require("./nexradTilts.js");
177
- Object.keys(_nexradTilts).forEach(function (key) {
178
- if (key === "default" || key === "__esModule") return;
179
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
180
- if (key in exports && exports[key] === _nexradTilts[key]) return;
181
- Object.defineProperty(exports, key, {
182
- enumerable: true,
183
- get: function () {
184
- return _nexradTilts[key];
185
- }
186
- });
187
- });
188
- var _nexradTiltCoalesce = require("./nexradTiltCoalesce.js");
189
- Object.keys(_nexradTiltCoalesce).forEach(function (key) {
190
- if (key === "default" || key === "__esModule") return;
191
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
192
- if (key in exports && exports[key] === _nexradTiltCoalesce[key]) return;
193
- Object.defineProperty(exports, key, {
194
- enumerable: true,
195
- get: function () {
196
- return _nexradTiltCoalesce[key];
197
- }
198
- });
199
- });
200
- var _nexrad_support = require("./nexrad_support.js");
201
- Object.keys(_nexrad_support).forEach(function (key) {
202
- if (key === "default" || key === "__esModule") return;
203
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
204
- if (key in exports && exports[key] === _nexrad_support[key]) return;
205
- Object.defineProperty(exports, key, {
206
- enumerable: true,
207
- get: function () {
208
- return _nexrad_support[key];
209
- }
210
- });
211
- });
40
+ var _unitConversions = require("./unitConversions.js");
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getUnitConversionFunction = getUnitConversionFunction;
7
7
  exports.unitConversions = void 0;
8
- /**
9
- * A utility module for converting between different physical units.
10
- * Contains a comprehensive object of conversion functions and a helper
11
- * to retrieve the correct function based on unit names.
8
+ /**
9
+ * A utility module for converting between different physical units.
10
+ * Contains a comprehensive object of conversion functions and a helper
11
+ * to retrieve the correct function based on unit names.
12
12
  */
13
13
 
14
14
  // The main object containing all the raw conversion functions.
@@ -68,12 +68,12 @@ const unitConversions = exports.unitConversions = {
68
68
  cm_hr_to_mm_hr: data => data * 10
69
69
  };
70
70
 
71
- /**
72
- * Finds and returns the correct conversion function based on "from" and "to" unit strings.
73
- * It normalizes common unit abbreviations to a consistent key.
74
- * @param {string} fromUnit - The starting unit (e.g., 'kelvin', '°C', 'kts').
75
- * @param {string} toUnit - The target unit (e.g., 'fahrenheit', '°F', 'mph').
76
- * @returns {function(number): number | null} The conversion function, or null if not found.
71
+ /**
72
+ * Finds and returns the correct conversion function based on "from" and "to" unit strings.
73
+ * It normalizes common unit abbreviations to a consistent key.
74
+ * @param {string} fromUnit - The starting unit (e.g., 'kelvin', '°C', 'kts').
75
+ * @param {string} toUnit - The target unit (e.g., 'fahrenheit', '°F', 'mph').
76
+ * @returns {function(number): number | null} The conversion function, or null if not found.
77
77
  */
78
78
  function getUnitConversionFunction(fromUnit, toUnit) {
79
79
  // A map to standardize various unit string formats to a single key format.
package/package.json CHANGED
@@ -1,99 +1,99 @@
1
- {
2
- "name": "@aguacerowx/javascript-sdk",
3
- "version": "0.0.27",
4
- "type": "module",
5
- "private": false,
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
- "description": "Core SDK for fetching and processing Aguacero weather data.",
10
- "main": "src/index.js",
11
- "module": "src/index.js",
12
- "react-native": "src/index.js",
13
- "exports": {
14
- ".": {
15
- "import": "./src/index.js",
16
- "require": "./src/index.js",
17
- "react-native": "./src/index.js",
18
- "default": "./src/index.js"
19
- },
20
- "./nexradTilts.js": {
21
- "import": "./src/nexradTilts.js",
22
- "require": "./src/nexradTilts.js",
23
- "default": "./src/nexradTilts.js"
24
- },
25
- "./nexrad_support.js": {
26
- "import": "./src/nexrad_support.js",
27
- "require": "./src/nexrad_support.js",
28
- "default": "./src/nexrad_support.js"
29
- },
30
- "./nexradTiltCoalesce.js": {
31
- "import": "./src/nexradTiltCoalesce.js",
32
- "require": "./src/nexradTiltCoalesce.js",
33
- "default": "./src/nexradTiltCoalesce.js"
34
- },
35
- "./satellite_support.js": {
36
- "import": "./src/satellite_support.js",
37
- "require": "./src/satellite_support.js",
38
- "react-native": "./src/satellite_support.js",
39
- "default": "./src/satellite_support.js"
40
- },
41
- "./nws/NwsWatchesWarningsOverlay.js": {
42
- "import": "./src/nws/NwsWatchesWarningsOverlay.js",
43
- "require": "./src/nws/NwsWatchesWarningsOverlay.js",
44
- "react-native": "./src/nws/NwsWatchesWarningsOverlay.js",
45
- "default": "./src/nws/NwsWatchesWarningsOverlay.js"
46
- },
47
- "./nws/nwsSdkConstants.js": {
48
- "import": "./src/nws/nwsSdkConstants.js",
49
- "require": "./src/nws/nwsSdkConstants.js",
50
- "react-native": "./src/nws/nwsSdkConstants.js",
51
- "default": "./src/nws/nwsSdkConstants.js"
52
- },
53
- "./nws/nwsAlertsSupport.js": {
54
- "import": "./src/nws/nwsAlertsSupport.js",
55
- "require": "./src/nws/nwsAlertsSupport.js",
56
- "react-native": "./src/nws/nwsAlertsSupport.js",
57
- "default": "./src/nws/nwsAlertsSupport.js"
58
- },
59
- "./nws/nwsAlertsFetchSpec.js": {
60
- "import": "./src/nws/nwsAlertsFetchSpec.js",
61
- "require": "./src/nws/nwsAlertsFetchSpec.js",
62
- "react-native": "./src/nws/nwsAlertsFetchSpec.js",
63
- "default": "./src/nws/nwsAlertsFetchSpec.js"
64
- }
65
- },
66
- "files": [
67
- "dist",
68
- "src"
69
- ],
70
- "scripts": {
71
- "build": "babel src -d dist",
72
- "gen:nws-key": "esbuild ../../../aguacero-frontend/src/components/WarningsMenu/nwsWarningCustomizationKey.ts --bundle --format=esm --platform=neutral --outfile=src/nws/nwsWarningCustomizationKey.gen.js"
73
- },
74
- "author": "Your Name",
75
- "license": "MIT",
76
- "devDependencies": {
77
- "esbuild": "^0.21.5"
78
- },
79
- "dependencies": {
80
- "proj4": "^2.11.0",
81
- "fzstd": "^0.1.1"
82
- },
83
- "peerDependencies": {
84
- "react": "*",
85
- "react-native": "*",
86
- "react-native-device-info": ">=10.0.0"
87
- },
88
- "peerDependenciesMeta": {
89
- "react": {
90
- "optional": true
91
- },
92
- "react-native": {
93
- "optional": true
94
- },
95
- "react-native-device-info": {
96
- "optional": true
97
- }
98
- }
99
- }
1
+ {
2
+ "name": "@aguacerowx/javascript-sdk",
3
+ "version": "0.0.28",
4
+ "type": "module",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "description": "Core SDK for fetching and processing Aguacero weather data.",
10
+ "main": "src/index.js",
11
+ "module": "src/index.js",
12
+ "react-native": "src/index.js",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./src/index.js",
16
+ "require": "./src/index.js",
17
+ "react-native": "./src/index.js",
18
+ "default": "./src/index.js"
19
+ },
20
+ "./nexradTilts.js": {
21
+ "import": "./src/nexradTilts.js",
22
+ "require": "./src/nexradTilts.js",
23
+ "default": "./src/nexradTilts.js"
24
+ },
25
+ "./nexrad_support.js": {
26
+ "import": "./src/nexrad_support.js",
27
+ "require": "./src/nexrad_support.js",
28
+ "default": "./src/nexrad_support.js"
29
+ },
30
+ "./nexradTiltCoalesce.js": {
31
+ "import": "./src/nexradTiltCoalesce.js",
32
+ "require": "./src/nexradTiltCoalesce.js",
33
+ "default": "./src/nexradTiltCoalesce.js"
34
+ },
35
+ "./satellite_support.js": {
36
+ "import": "./src/satellite_support.js",
37
+ "require": "./src/satellite_support.js",
38
+ "react-native": "./src/satellite_support.js",
39
+ "default": "./src/satellite_support.js"
40
+ },
41
+ "./nws/NwsWatchesWarningsOverlay.js": {
42
+ "import": "./src/nws/NwsWatchesWarningsOverlay.js",
43
+ "require": "./src/nws/NwsWatchesWarningsOverlay.js",
44
+ "react-native": "./src/nws/NwsWatchesWarningsOverlay.js",
45
+ "default": "./src/nws/NwsWatchesWarningsOverlay.js"
46
+ },
47
+ "./nws/nwsSdkConstants.js": {
48
+ "import": "./src/nws/nwsSdkConstants.js",
49
+ "require": "./src/nws/nwsSdkConstants.js",
50
+ "react-native": "./src/nws/nwsSdkConstants.js",
51
+ "default": "./src/nws/nwsSdkConstants.js"
52
+ },
53
+ "./nws/nwsAlertsSupport.js": {
54
+ "import": "./src/nws/nwsAlertsSupport.js",
55
+ "require": "./src/nws/nwsAlertsSupport.js",
56
+ "react-native": "./src/nws/nwsAlertsSupport.js",
57
+ "default": "./src/nws/nwsAlertsSupport.js"
58
+ },
59
+ "./nws/nwsAlertsFetchSpec.js": {
60
+ "import": "./src/nws/nwsAlertsFetchSpec.js",
61
+ "require": "./src/nws/nwsAlertsFetchSpec.js",
62
+ "react-native": "./src/nws/nwsAlertsFetchSpec.js",
63
+ "default": "./src/nws/nwsAlertsFetchSpec.js"
64
+ }
65
+ },
66
+ "files": [
67
+ "dist",
68
+ "src"
69
+ ],
70
+ "scripts": {
71
+ "build": "babel src -d dist --config-file ./babel.build.config.js",
72
+ "gen:nws-key": "esbuild ../../../aguacero-frontend/src/components/WarningsMenu/nwsWarningCustomizationKey.ts --bundle --format=esm --platform=neutral --outfile=src/nws/nwsWarningCustomizationKey.gen.js"
73
+ },
74
+ "author": "Your Name",
75
+ "license": "MIT",
76
+ "devDependencies": {
77
+ "esbuild": "^0.21.5"
78
+ },
79
+ "dependencies": {
80
+ "proj4": "^2.11.0",
81
+ "fzstd": "^0.1.1"
82
+ },
83
+ "peerDependencies": {
84
+ "react": "*",
85
+ "react-native": "*",
86
+ "react-native-device-info": ">=10.0.0"
87
+ },
88
+ "peerDependenciesMeta": {
89
+ "react": {
90
+ "optional": true
91
+ },
92
+ "react-native": {
93
+ "optional": true
94
+ },
95
+ "react-native-device-info": {
96
+ "optional": true
97
+ }
98
+ }
99
+ }