@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.
@@ -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 directUrl = `${this.baseGridUrl}${resourcePath}`;
390
+ const baseUrl = `${this.baseGridUrl}${resourcePath}`;
391
391
 
392
- // --- START OF LOGGING CODE ---
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 headers object we just logged
401
- const response = await fetch(directUrl, {
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.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
- "fzstd": "^0.1.1",
20
- "proj4": "^2.11.0"
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
- "gitHead": "663adc461119282cdf39fc0e264929d5648345cb"
39
- }
47
+ }
48
+ }