@aguacerowx/javascript-sdk 0.0.0 → 0.0.2
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/AguaceroCore.js +9 -5
- package/dist/index.js +33 -0
- package/package.json +16 -7
- package/src/AguaceroCore.js +788 -0
- package/src/coordinate_configs.js +374 -0
- package/src/default-colormaps.js +2913 -0
- package/src/dictionaries.js +4267 -0
- package/src/events.js +20 -0
- package/src/fill-layer-worker.js +27 -0
- package/src/getBundleId.js +22 -0
- package/src/index.js +15 -0
- package/src/map-styles.js +102 -0
- package/src/unitConversions.js +103 -0
package/dist/AguaceroCore.js
CHANGED
|
@@ -387,9 +387,14 @@ class AguaceroCore extends _events.EventEmitter {
|
|
|
387
387
|
throw new Error('API key is not configured.');
|
|
388
388
|
}
|
|
389
389
|
try {
|
|
390
|
-
const
|
|
390
|
+
const baseUrl = `${this.baseGridUrl}${resourcePath}`;
|
|
391
391
|
|
|
392
|
-
//
|
|
392
|
+
// NEW: Construct the URL with the apiKey as a query parameter
|
|
393
|
+
const urlWithApiKeyParam = `${baseUrl}?apiKey=${this.apiKey}`;
|
|
394
|
+
|
|
395
|
+
// --- END OF MODIFICATION ---
|
|
396
|
+
|
|
397
|
+
// The headers object remains the same, sending the key in the header as well
|
|
393
398
|
const headers = {
|
|
394
399
|
'x-api-key': this.apiKey
|
|
395
400
|
};
|
|
@@ -397,13 +402,12 @@ class AguaceroCore extends _events.EventEmitter {
|
|
|
397
402
|
headers['x-app-identifier'] = this.bundleId;
|
|
398
403
|
}
|
|
399
404
|
|
|
400
|
-
// Use the
|
|
401
|
-
const response = await fetch(
|
|
405
|
+
// Use the NEW url variable in the fetch call
|
|
406
|
+
const response = await fetch(urlWithApiKeyParam, {
|
|
402
407
|
headers: headers,
|
|
403
408
|
signal: abortController.signal
|
|
404
409
|
});
|
|
405
410
|
if (!response.ok) {
|
|
406
|
-
// This is where your error is being thrown from
|
|
407
411
|
throw new Error(`Failed to fetch grid data: ${response.status} ${response.statusText}`);
|
|
408
412
|
}
|
|
409
413
|
const {
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AguaceroCore", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AguaceroCore.AguaceroCore;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DICTIONARIES", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _dictionaries.DICTIONARIES;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "EventEmitter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _events.EventEmitter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "THEME_CONFIGS", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _mapStyles.THEME_CONFIGS;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _AguaceroCore = require("./AguaceroCore.js");
|
|
31
|
+
var _events = require("./events.js");
|
|
32
|
+
var _mapStyles = require("./map-styles.js");
|
|
33
|
+
var _dictionaries = require("./dictionaries.js");
|
package/package.json
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aguacerowx/javascript-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"description": "Core SDK for fetching and processing Aguacero weather data.",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
|
+
"module": "src/index.js",
|
|
11
|
+
"react-native": "dist/index.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./src/index.js",
|
|
15
|
+
"require": "./dist/index.js",
|
|
16
|
+
"react-native": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
10
19
|
"files": [
|
|
11
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"src"
|
|
12
22
|
],
|
|
13
23
|
"scripts": {
|
|
14
24
|
"build": "babel src -d dist"
|
|
@@ -16,8 +26,8 @@
|
|
|
16
26
|
"author": "Your Name",
|
|
17
27
|
"license": "MIT",
|
|
18
28
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
29
|
+
"proj4": "^2.11.0",
|
|
30
|
+
"fzstd": "^0.1.1"
|
|
21
31
|
},
|
|
22
32
|
"peerDependencies": {
|
|
23
33
|
"react": "*",
|
|
@@ -34,6 +44,5 @@
|
|
|
34
44
|
"react-native-device-info": {
|
|
35
45
|
"optional": true
|
|
36
46
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
47
|
+
}
|
|
48
|
+
}
|