btrz-api-client 7.2.0 → 7.2.2

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.
@@ -81,12 +81,28 @@ function ticketsFactory(_ref) {
81
81
  });
82
82
  }
83
83
 
84
+ function updatePassenger(_ref7) {
85
+ var token = _ref7.token,
86
+ jwtToken = _ref7.jwtToken,
87
+ ticketId = _ref7.ticketId,
88
+ data = _ref7.data,
89
+ headers = _ref7.headers;
90
+
91
+ return client({
92
+ url: "/tickets/" + ticketId + "/passenger",
93
+ method: "put",
94
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
95
+ data: data
96
+ });
97
+ }
98
+
84
99
  return {
85
100
  get: get,
86
101
  all: all,
87
102
  patch: patch,
88
103
  companionTickets: companionTickets,
89
- updateDelivery: updateDelivery
104
+ updateDelivery: updateDelivery,
105
+ updatePassenger: updatePassenger
90
106
  };
91
107
  }
92
108
 
@@ -86,13 +86,15 @@ function cartFactory(_ref) {
86
86
  function deletePaidInItems(_ref7) {
87
87
  var token = _ref7.token,
88
88
  cartId = _ref7.cartId,
89
+ params = _ref7.params,
89
90
  jwtToken = _ref7.jwtToken,
90
91
  headers = _ref7.headers;
91
92
 
92
93
  return client({
93
94
  url: "/carts/" + cartId + "/paid-in-items",
94
95
  method: "delete",
95
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
96
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
97
+ params: params
96
98
  });
97
99
  }
98
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "7.2.0",
3
+ "version": "7.2.2",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -43,12 +43,22 @@ function ticketsFactory({client, internalAuthTokenProvider}) {
43
43
  });
44
44
  }
45
45
 
46
+ function updatePassenger({token, jwtToken, ticketId, data, headers}) {
47
+ return client({
48
+ url: `/tickets/${ticketId}/passenger`,
49
+ method: "put",
50
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
51
+ data
52
+ });
53
+ }
54
+
46
55
  return {
47
56
  get,
48
57
  all,
49
58
  patch,
50
59
  companionTickets,
51
- updateDelivery
60
+ updateDelivery,
61
+ updatePassenger
52
62
  };
53
63
  }
54
64
 
@@ -49,11 +49,12 @@ function cartFactory({client, internalAuthTokenProvider}) {
49
49
  });
50
50
  }
51
51
 
52
- function deletePaidInItems({token, cartId, jwtToken, headers}) {
52
+ function deletePaidInItems({token, cartId, params, jwtToken, headers}) {
53
53
  return client({
54
54
  url: `/carts/${cartId}/paid-in-items`,
55
55
  method: "delete",
56
- headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
56
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
57
+ params
57
58
  });
58
59
  }
59
60
 
@@ -61,4 +61,27 @@ describe("operations/tickets", () => {
61
61
  expect(httpResponse.status).eql(200);
62
62
  });
63
63
  });
64
+
65
+ it("should PUT and update a ticket passenger information", () => {
66
+ const ticketId = "123456";
67
+ const data = {
68
+ ticketNumber: "t123",
69
+ firstName: "joe",
70
+ lastName: "joe"
71
+ };
72
+ console.log(api.operations.tickets);
73
+ axiosMock.onPut(`/tickets/${ticketId}/passenger`).reply(expectRequest({
74
+ statusCode: 200,
75
+ token,
76
+ jwtToken
77
+ }));
78
+ return api.operations.tickets.updatePassenger({
79
+ ticketId,
80
+ token,
81
+ jwtToken,
82
+ data
83
+ }).then((httpResponse) => {
84
+ expect(httpResponse.status).eql(200);
85
+ });
86
+ });
64
87
  });
package/types/client.d.ts CHANGED
@@ -3013,9 +3013,10 @@ export function createApiClient(options: {
3013
3013
  jwtToken: any;
3014
3014
  headers: any;
3015
3015
  }) => any;
3016
- deletePaidInItems: ({ token, cartId, jwtToken, headers }: {
3016
+ deletePaidInItems: ({ token, cartId, params, jwtToken, headers }: {
3017
3017
  token: any;
3018
3018
  cartId: any;
3019
+ params: any;
3019
3020
  jwtToken: any;
3020
3021
  headers: any;
3021
3022
  }) => any;
@@ -3767,6 +3768,13 @@ export function createApiClient(options: {
3767
3768
  data: any;
3768
3769
  headers: any;
3769
3770
  }) => any;
3771
+ updatePassenger: ({ token, jwtToken, ticketId, data, headers }: {
3772
+ token: any;
3773
+ jwtToken: any;
3774
+ ticketId: any;
3775
+ data: any;
3776
+ headers: any;
3777
+ }) => any;
3770
3778
  };
3771
3779
  transaction: {
3772
3780
  get: ({ token, jwtToken, id, providerId, headers }: {
@@ -37,4 +37,11 @@ declare function ticketsFactory({ client, internalAuthTokenProvider }: {
37
37
  data: any;
38
38
  headers: any;
39
39
  }) => any;
40
+ updatePassenger: ({ token, jwtToken, ticketId, data, headers }: {
41
+ token: any;
42
+ jwtToken: any;
43
+ ticketId: any;
44
+ data: any;
45
+ headers: any;
46
+ }) => any;
40
47
  };
@@ -36,9 +36,10 @@ declare function cartFactory({ client, internalAuthTokenProvider }: {
36
36
  jwtToken: any;
37
37
  headers: any;
38
38
  }) => any;
39
- deletePaidInItems: ({ token, cartId, jwtToken, headers }: {
39
+ deletePaidInItems: ({ token, cartId, params, jwtToken, headers }: {
40
40
  token: any;
41
41
  cartId: any;
42
+ params: any;
42
43
  jwtToken: any;
43
44
  headers: any;
44
45
  }) => any;
@@ -2967,9 +2967,10 @@ declare const _exports: {
2967
2967
  jwtToken: any;
2968
2968
  headers: any;
2969
2969
  }) => any;
2970
- deletePaidInItems: ({ token, cartId, jwtToken, headers }: {
2970
+ deletePaidInItems: ({ token, cartId, params, jwtToken, headers }: {
2971
2971
  token: any;
2972
2972
  cartId: any;
2973
+ params: any;
2973
2974
  jwtToken: any;
2974
2975
  headers: any;
2975
2976
  }) => any;
@@ -3721,6 +3722,13 @@ declare const _exports: {
3721
3722
  data: any;
3722
3723
  headers: any;
3723
3724
  }) => any;
3725
+ updatePassenger: ({ token, jwtToken, ticketId, data, headers }: {
3726
+ token: any;
3727
+ jwtToken: any;
3728
+ ticketId: any;
3729
+ data: any;
3730
+ headers: any;
3731
+ }) => any;
3724
3732
  };
3725
3733
  transaction: {
3726
3734
  get: ({ token, jwtToken, id, providerId, headers }: {