skikrumb-api 2.1.3 → 2.1.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.d.ts CHANGED
@@ -33,6 +33,7 @@ export declare const skiKrumb: (options?: {
33
33
  readApiKeys: () => Promise<apiKeys>;
34
34
  readDeviceDailyDistance: (deviceSerialNumber: string) => Promise<unknown>;
35
35
  readDeviceData: (deviceSerialNumber: string, limit?: number) => Promise<unknown>;
36
+ readDataForDevices: (query: QueryDevice) => Promise<Device[]>;
36
37
  readGateways: () => Promise<Gateways>;
37
38
  readShippingRates: (rateRequest: RateRequest) => Promise<Rates>;
38
39
  sendMobileLocation: (payload: {
package/dist/index.js CHANGED
@@ -279,6 +279,15 @@ export const skiKrumb = (options = {
279
279
  throw error;
280
280
  }
281
281
  };
282
+ const readDataForDevices = async (query) => {
283
+ if (!query.serial_numbers)
284
+ throw new Error('Serial number is required');
285
+ return request
286
+ .get('devices/data', {
287
+ searchParams: new URLSearchParams({ ...query }),
288
+ })
289
+ .json();
290
+ };
282
291
  const readGateways = async () => {
283
292
  try {
284
293
  const response = await request.get('gateways').json();
@@ -392,6 +401,7 @@ export const skiKrumb = (options = {
392
401
  readApiKeys,
393
402
  readDeviceDailyDistance,
394
403
  readDeviceData,
404
+ readDataForDevices,
395
405
  readGateways,
396
406
  readShippingRates,
397
407
  sendMobileLocation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skikrumb-api",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "Wrapper for the skiKrumb API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",