btrz-api-client 7.4.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.
@@ -24,6 +24,19 @@ function terminalPaymentsFactory(_ref) {
24
24
  params: query,
25
25
  data: { terminalPayment: terminalPayment }
26
26
  });
27
+ },
28
+ get: function get(_ref3) {
29
+ var token = _ref3.token,
30
+ jwtToken = _ref3.jwtToken,
31
+ id = _ref3.id,
32
+ _ref3$query = _ref3.query,
33
+ query = _ref3$query === undefined ? {} : _ref3$query,
34
+ headers = _ref3.headers;
35
+
36
+ return client.get("/terminal-payments/mit/" + id, {
37
+ params: query,
38
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
39
+ });
27
40
  }
28
41
  };
29
42
 
@@ -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.4.0",
3
+ "version": "7.6.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,6 +12,12 @@ function terminalPaymentsFactory({client, internalAuthTokenProvider}) {
12
12
  params: query,
13
13
  data: {terminalPayment}
14
14
  });
15
+ },
16
+ get({token, jwtToken, id, query = {}, headers}) {
17
+ return client.get(`/terminal-payments/mit/${id}`, {
18
+ params: query,
19
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
20
+ });
15
21
  }
16
22
  };
17
23
 
@@ -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
 
@@ -32,4 +32,16 @@ describe("btrzpay/terminal-payments", () => {
32
32
  }
33
33
  });
34
34
  });
35
+
36
+ it("should get the MIT terminal payment", () => {
37
+ axiosMock.onGet("/terminal-payments/mit/1", {params: query}).reply(expectRequest({
38
+ statusCode: 200, token, jwtToken, query
39
+ }));
40
+ return api.btrzpay.terminalPayments.mit.get({
41
+ token,
42
+ jwtToken,
43
+ query,
44
+ id: 1
45
+ });
46
+ });
35
47
  });
@@ -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 }: {
@@ -4703,6 +4712,13 @@ export function createApiClient(options: {
4703
4712
  query?: {};
4704
4713
  headers: any;
4705
4714
  }): any;
4715
+ get({ token, jwtToken, id, query, headers }: {
4716
+ token: any;
4717
+ jwtToken: any;
4718
+ id: any;
4719
+ query?: {};
4720
+ headers: any;
4721
+ }): any;
4706
4722
  };
4707
4723
  };
4708
4724
  __test: {
@@ -12,5 +12,12 @@ declare function terminalPaymentsFactory({ client, internalAuthTokenProvider }:
12
12
  query?: {};
13
13
  headers: any;
14
14
  }): any;
15
+ get({ token, jwtToken, id, query, headers }: {
16
+ token: any;
17
+ jwtToken: any;
18
+ id: any;
19
+ query?: {};
20
+ headers: any;
21
+ }): any;
15
22
  };
16
23
  };
@@ -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 }: {
@@ -4657,6 +4666,13 @@ declare const _exports: {
4657
4666
  query?: {};
4658
4667
  headers: any;
4659
4668
  }): any;
4669
+ get({ token, jwtToken, id, query, headers }: {
4670
+ token: any;
4671
+ jwtToken: any;
4672
+ id: any;
4673
+ query?: {};
4674
+ headers: any;
4675
+ }): any;
4660
4676
  };
4661
4677
  };
4662
4678
  __test: {