gis.ph-sdk 1.0.0 → 1.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/README.md CHANGED
@@ -16,7 +16,7 @@ pnpm add gis.ph-sdk
16
16
 
17
17
  ## Getting Started
18
18
 
19
- Initialize the client with your API key or access token.
19
+ Initialize the client with your API key or access token. You can obtain an API key by signing up at [https://gis.ph](https://gis.ph).
20
20
 
21
21
  ```typescript
22
22
  import { GisPh } from 'gis.ph-sdk';
package/dist/index.cjs CHANGED
@@ -65,6 +65,8 @@ var Fetcher = class {
65
65
  };
66
66
  if (this.config.accessToken) {
67
67
  headers["Authorization"] = `Bearer ${this.config.accessToken}`;
68
+ } else if (this.config.apiKey) {
69
+ headers["Authorization"] = `Bearer ${this.config.apiKey}`;
68
70
  }
69
71
  if (this.config.apiKey) {
70
72
  headers["X-API-Key"] = this.config.apiKey;
@@ -89,9 +91,6 @@ var Fetcher = class {
89
91
  data?.error?.issues
90
92
  );
91
93
  }
92
- if (data && typeof data === "object" && "data" in data) {
93
- return data.data;
94
- }
95
94
  return data;
96
95
  } catch (error) {
97
96
  if (error instanceof GisPhError) {
package/dist/index.js CHANGED
@@ -36,6 +36,8 @@ var Fetcher = class {
36
36
  };
37
37
  if (this.config.accessToken) {
38
38
  headers["Authorization"] = `Bearer ${this.config.accessToken}`;
39
+ } else if (this.config.apiKey) {
40
+ headers["Authorization"] = `Bearer ${this.config.apiKey}`;
39
41
  }
40
42
  if (this.config.apiKey) {
41
43
  headers["X-API-Key"] = this.config.apiKey;
@@ -60,9 +62,6 @@ var Fetcher = class {
60
62
  data?.error?.issues
61
63
  );
62
64
  }
63
- if (data && typeof data === "object" && "data" in data) {
64
- return data.data;
65
- }
66
65
  return data;
67
66
  } catch (error) {
68
67
  if (error instanceof GisPhError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gis.ph-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Official JavaScript/TypeScript SDK for api.gis.ph - Access Philippine geographical data (Provinces, Barangays, LGUs) and more.",
5
5
  "type": "module",
6
6
  "files": [