@andev2005/movie-glu-sdk 1.0.2 → 1.0.4
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/index.js +1 -6
- package/dist/index.mjs +1 -6
- package/package.json +1 -1
- package/src/index.ts +1 -6
package/dist/index.js
CHANGED
|
@@ -253,16 +253,11 @@ function createMovieGluClient(config) {
|
|
|
253
253
|
var _a;
|
|
254
254
|
const geolocationHeader = (_a = options == null ? void 0 : options.headers) == null ? void 0 : _a.geolocation;
|
|
255
255
|
const geolocation = geolocationHeader ?? client.geolocation;
|
|
256
|
-
if (!geolocation) {
|
|
257
|
-
throw new TypeError(
|
|
258
|
-
"geolocation header is required for cinemas.nearby. Pass nearby(..., { headers: { geolocation } }) or createMovieGluClient({ geolocation })."
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
256
|
return httpRequest(client, ENDPOINT_PATH.CINEMA_NEARBY, {
|
|
262
257
|
queryParams: toListQuery(params),
|
|
263
258
|
headers: {
|
|
264
259
|
...options == null ? void 0 : options.headers,
|
|
265
|
-
geolocation: formatGeolocationHeader(geolocation)
|
|
260
|
+
...geolocation ? { geolocation: formatGeolocationHeader(geolocation) } : {}
|
|
266
261
|
}
|
|
267
262
|
});
|
|
268
263
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -224,16 +224,11 @@ function createMovieGluClient(config) {
|
|
|
224
224
|
var _a;
|
|
225
225
|
const geolocationHeader = (_a = options == null ? void 0 : options.headers) == null ? void 0 : _a.geolocation;
|
|
226
226
|
const geolocation = geolocationHeader ?? client.geolocation;
|
|
227
|
-
if (!geolocation) {
|
|
228
|
-
throw new TypeError(
|
|
229
|
-
"geolocation header is required for cinemas.nearby. Pass nearby(..., { headers: { geolocation } }) or createMovieGluClient({ geolocation })."
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
227
|
return httpRequest(client, ENDPOINT_PATH.CINEMA_NEARBY, {
|
|
233
228
|
queryParams: toListQuery(params),
|
|
234
229
|
headers: {
|
|
235
230
|
...options == null ? void 0 : options.headers,
|
|
236
|
-
geolocation: formatGeolocationHeader(geolocation)
|
|
231
|
+
...geolocation ? { geolocation: formatGeolocationHeader(geolocation) } : {}
|
|
237
232
|
}
|
|
238
233
|
});
|
|
239
234
|
},
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -173,17 +173,12 @@ export function createMovieGluClient(config: MovieGluClientConfig): MovieGluSdk
|
|
|
173
173
|
nearby(params: CinemasNearbyParams, options?: CinemasNearbyRequestOptions): Promise<CinemasNearbyResponse> {
|
|
174
174
|
const geolocationHeader = options?.headers?.geolocation;
|
|
175
175
|
const geolocation = geolocationHeader ?? client.geolocation;
|
|
176
|
-
if (!geolocation) {
|
|
177
|
-
throw new TypeError(
|
|
178
|
-
'geolocation header is required for cinemas.nearby. Pass nearby(..., { headers: { geolocation } }) or createMovieGluClient({ geolocation }).',
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
176
|
|
|
182
177
|
return httpRequest<CinemasNearbyResponse>(client, ENDPOINT_PATH.CINEMA_NEARBY, {
|
|
183
178
|
queryParams: toListQuery(params),
|
|
184
179
|
headers: {
|
|
185
180
|
...options?.headers,
|
|
186
|
-
geolocation: formatGeolocationHeader(geolocation),
|
|
181
|
+
...(geolocation ? { geolocation: formatGeolocationHeader(geolocation) } : {}),
|
|
187
182
|
},
|
|
188
183
|
});
|
|
189
184
|
},
|