apple-maps-server-sdk 1.0.1 → 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/lib/index.d.ts CHANGED
@@ -3,7 +3,9 @@ declare class AppleMaps {
3
3
  accessToken: string;
4
4
  authorizationToken: string;
5
5
  apiClient: AxiosInstance;
6
- constructor(authorizationToken: string);
6
+ constructor({ authorizationToken }: {
7
+ authorizationToken: string;
8
+ });
7
9
  getAccessToken(): Promise<undefined>;
8
10
  geocode(input: GeocodeInput): Promise<GeocodeResponse>;
9
11
  reverseGeocode(input: ReverseGeocodeInput): Promise<ReverseGeocodeResponse>;
package/lib/index.js CHANGED
@@ -38,9 +38,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
38
  const axios_1 = __importStar(require("axios"));
39
39
  const qs_1 = __importDefault(require("qs"));
40
40
  class AppleMaps {
41
- constructor(authorizationToken) {
41
+ constructor({ authorizationToken }) {
42
42
  this.accessToken = "";
43
43
  this.authorizationToken = authorizationToken;
44
+ if (!authorizationToken) {
45
+ throw new Error("'authorizationToken' param is required");
46
+ }
44
47
  this.apiClient = axios_1.default.create({
45
48
  baseURL: "https://maps-api.apple.com/v1",
46
49
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-maps-server-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "An SDK for the Apple Maps Server API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/index.ts CHANGED
@@ -6,9 +6,14 @@ class AppleMaps {
6
6
  authorizationToken: string;
7
7
  apiClient: AxiosInstance;
8
8
 
9
- constructor(authorizationToken: string) {
9
+ constructor({ authorizationToken }: { authorizationToken: string }) {
10
10
  this.accessToken = "";
11
11
  this.authorizationToken = authorizationToken;
12
+
13
+ if (!authorizationToken) {
14
+ throw new Error("'authorizationToken' param is required");
15
+ }
16
+
12
17
  this.apiClient = axios.create({
13
18
  baseURL: "https://maps-api.apple.com/v1",
14
19
  });