@findatruck/aggregator-client 1.4.0 → 1.5.0

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.cjs CHANGED
@@ -301,11 +301,12 @@ var AggregatorClient = class {
301
301
  body: JSON.stringify(body)
302
302
  });
303
303
  if (!response.ok) {
304
+ const text = await response.text();
304
305
  let responseBody;
305
306
  try {
306
- responseBody = await response.json();
307
+ responseBody = JSON.parse(text);
307
308
  } catch {
308
- responseBody = await response.text();
309
+ responseBody = text;
309
310
  }
310
311
  throw new AggregatorClientError(
311
312
  `Request to ${path} failed with status ${response.status}`,
@@ -331,11 +332,12 @@ var AggregatorClient = class {
331
332
  }
332
333
  });
333
334
  if (!response.ok) {
335
+ const text = await response.text();
334
336
  let responseBody;
335
337
  try {
336
- responseBody = await response.json();
338
+ responseBody = JSON.parse(text);
337
339
  } catch {
338
- responseBody = await response.text();
340
+ responseBody = text;
339
341
  }
340
342
  throw new AggregatorClientError(
341
343
  `Request to ${path} failed with status ${response.status}`,
package/dist/index.d.cts CHANGED
@@ -190,6 +190,9 @@ declare const endpoints: {
190
190
  location_longitude: z.ZodNumber;
191
191
  location_address: z.ZodOptional<z.ZodString>;
192
192
  vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
193
+ heading: z.ZodOptional<z.ZodNumber>;
194
+ speed_mph: z.ZodOptional<z.ZodNumber>;
195
+ altitude_feet: z.ZodOptional<z.ZodNumber>;
193
196
  }, z.core.$strip>>;
194
197
  }, z.core.$strip>;
195
198
  readonly responseSchema: z.ZodObject<{
@@ -210,6 +213,9 @@ declare const endpoints: {
210
213
  location_address: z.ZodNullable<z.ZodString>;
211
214
  location_state: z.ZodNullable<z.ZodString>;
212
215
  vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
216
+ heading: z.ZodNullable<z.ZodNumber>;
217
+ speed_mph: z.ZodNullable<z.ZodNumber>;
218
+ altitude_feet: z.ZodNullable<z.ZodNumber>;
213
219
  source: z.ZodEnum<{
214
220
  eld: "eld";
215
221
  manual: "manual";
package/dist/index.d.ts CHANGED
@@ -190,6 +190,9 @@ declare const endpoints: {
190
190
  location_longitude: z.ZodNumber;
191
191
  location_address: z.ZodOptional<z.ZodString>;
192
192
  vehicle_odometer_miles: z.ZodOptional<z.ZodNumber>;
193
+ heading: z.ZodOptional<z.ZodNumber>;
194
+ speed_mph: z.ZodOptional<z.ZodNumber>;
195
+ altitude_feet: z.ZodOptional<z.ZodNumber>;
193
196
  }, z.core.$strip>>;
194
197
  }, z.core.$strip>;
195
198
  readonly responseSchema: z.ZodObject<{
@@ -210,6 +213,9 @@ declare const endpoints: {
210
213
  location_address: z.ZodNullable<z.ZodString>;
211
214
  location_state: z.ZodNullable<z.ZodString>;
212
215
  vehicle_odometer_miles: z.ZodNullable<z.ZodNumber>;
216
+ heading: z.ZodNullable<z.ZodNumber>;
217
+ speed_mph: z.ZodNullable<z.ZodNumber>;
218
+ altitude_feet: z.ZodNullable<z.ZodNumber>;
213
219
  source: z.ZodEnum<{
214
220
  eld: "eld";
215
221
  manual: "manual";
package/dist/index.js CHANGED
@@ -267,11 +267,12 @@ var AggregatorClient = class {
267
267
  body: JSON.stringify(body)
268
268
  });
269
269
  if (!response.ok) {
270
+ const text = await response.text();
270
271
  let responseBody;
271
272
  try {
272
- responseBody = await response.json();
273
+ responseBody = JSON.parse(text);
273
274
  } catch {
274
- responseBody = await response.text();
275
+ responseBody = text;
275
276
  }
276
277
  throw new AggregatorClientError(
277
278
  `Request to ${path} failed with status ${response.status}`,
@@ -297,11 +298,12 @@ var AggregatorClient = class {
297
298
  }
298
299
  });
299
300
  if (!response.ok) {
301
+ const text = await response.text();
300
302
  let responseBody;
301
303
  try {
302
- responseBody = await response.json();
304
+ responseBody = JSON.parse(text);
303
305
  } catch {
304
- responseBody = await response.text();
306
+ responseBody = text;
305
307
  }
306
308
  throw new AggregatorClientError(
307
309
  `Request to ${path} failed with status ${response.status}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@findatruck/aggregator-client",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@findatruck/shared-schemas": "^2.14.0"
26
+ "@findatruck/shared-schemas": "^2.15.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "zod": "^4.1.11"