btrz-api-client 7.5.0 → 7.6.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.
@@ -464,15 +464,33 @@ function manifestFactory(_ref) {
464
464
  }
465
465
  };
466
466
 
467
- var driverRelays = {
468
- update: function update(_ref27) {
467
+ var tripClose = {
468
+ add: function add(_ref27) {
469
469
  var token = _ref27.token,
470
470
  jwtToken = _ref27.jwtToken,
471
471
  manifestId = _ref27.manifestId,
472
472
  _ref27$query = _ref27.query,
473
- query = _ref27$query === undefined ? { bypassValidation: false } : _ref27$query,
474
- headers = _ref27.headers,
475
- data = _ref27.data;
473
+ query = _ref27$query === undefined ? {} : _ref27$query,
474
+ headers = _ref27.headers;
475
+
476
+ return client({
477
+ url: "/manifests/" + manifestId + "/trip-close",
478
+ method: "post",
479
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
480
+ params: query
481
+ });
482
+ }
483
+ };
484
+
485
+ var driverRelays = {
486
+ update: function update(_ref28) {
487
+ var token = _ref28.token,
488
+ jwtToken = _ref28.jwtToken,
489
+ manifestId = _ref28.manifestId,
490
+ _ref28$query = _ref28.query,
491
+ query = _ref28$query === undefined ? { bypassValidation: false } : _ref28$query,
492
+ headers = _ref28.headers,
493
+ data = _ref28.data;
476
494
 
477
495
  return client({
478
496
  url: "/manifests/" + manifestId + "/driver-relays",
@@ -505,7 +523,8 @@ function manifestFactory(_ref) {
505
523
  legs: legs,
506
524
  reports: reports,
507
525
  labels: labels,
508
- driverRelays: driverRelays
526
+ driverRelays: driverRelays,
527
+ tripClose: tripClose
509
528
  };
510
529
  }
511
530
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -303,6 +303,17 @@ function manifestFactory({
303
303
  }
304
304
  };
305
305
 
306
+ const tripClose = {
307
+ add({token, jwtToken, manifestId, query = {}, headers}) {
308
+ return client({
309
+ url: `/manifests/${manifestId}/trip-close`,
310
+ method: "post",
311
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
312
+ params: query
313
+ });
314
+ }
315
+ };
316
+
306
317
  const driverRelays = {
307
318
  update({token, jwtToken, manifestId, query = {bypassValidation: false}, headers, data}) {
308
319
  return client({
@@ -336,7 +347,8 @@ function manifestFactory({
336
347
  legs,
337
348
  reports,
338
349
  labels,
339
- driverRelays
350
+ driverRelays,
351
+ tripClose
340
352
  };
341
353
  }
342
354
 
@@ -316,7 +316,28 @@ describe("operations/manifest/legs/tickets/noshow", () => {
316
316
  });
317
317
  });
318
318
 
319
- describe("operations/manifest/:manifestId/labels", () => {
319
+ describe("operations/manifests/:manifestId/trip-close", () => {
320
+ const token = "I owe you a token";
321
+ const jwtToken = "I owe you a JWT token";
322
+
323
+ afterEach(() => {
324
+ axiosMock.reset();
325
+ });
326
+ it("should add a label to a manifest", async () => {
327
+ const manifestId = "manifestId";
328
+ const query = {
329
+ routeId: "labelId",
330
+ schedule: "schedule",
331
+ date: "2020-12-01"
332
+ };
333
+ axiosMock.onPost(`/manifests/${manifestId}/trip-close`).reply(expectRequest({
334
+ statusCode: 200, token, jwtToken
335
+ }));
336
+ return api.operations.manifest.tripClose.add({token, jwtToken, manifestId, query});
337
+ });
338
+ });
339
+
340
+ describe("operations/manifests/:manifestId/labels", () => {
320
341
  const token = "I owe you a token";
321
342
  const jwtToken = "I owe you a JWT token";
322
343
 
package/types/client.d.ts CHANGED
@@ -3503,6 +3503,15 @@ export function createApiClient(options: {
3503
3503
  data: any;
3504
3504
  }): any;
3505
3505
  };
3506
+ tripClose: {
3507
+ add({ token, jwtToken, manifestId, query, headers }: {
3508
+ token: any;
3509
+ jwtToken: any;
3510
+ manifestId: any;
3511
+ query?: {};
3512
+ headers: any;
3513
+ }): any;
3514
+ };
3506
3515
  };
3507
3516
  manifestLegForTickets: {
3508
3517
  get: ({ token, jwtToken, ticketId, params, headers }: {
@@ -214,4 +214,13 @@ declare function manifestFactory({ client, internalAuthTokenProvider }: {
214
214
  data: any;
215
215
  }): any;
216
216
  };
217
+ tripClose: {
218
+ add({ token, jwtToken, manifestId, query, headers }: {
219
+ token: any;
220
+ jwtToken: any;
221
+ manifestId: any;
222
+ query?: {};
223
+ headers: any;
224
+ }): any;
225
+ };
217
226
  };
@@ -3457,6 +3457,15 @@ declare const _exports: {
3457
3457
  data: any;
3458
3458
  }): any;
3459
3459
  };
3460
+ tripClose: {
3461
+ add({ token, jwtToken, manifestId, query, headers }: {
3462
+ token: any;
3463
+ jwtToken: any;
3464
+ manifestId: any;
3465
+ query?: {};
3466
+ headers: any;
3467
+ }): any;
3468
+ };
3460
3469
  };
3461
3470
  manifestLegForTickets: {
3462
3471
  get: ({ token, jwtToken, ticketId, params, headers }: {