btrz-api-client 5.233.0 → 5.234.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.
@@ -22,6 +22,7 @@ function countriesFactory(_ref) {
22
22
 
23
23
  function get(_ref3) {
24
24
  var token = _ref3.token,
25
+ jwtToken = _ref3.jwtToken,
25
26
  id = _ref3.id,
26
27
  _ref3$query = _ref3.query,
27
28
  query = _ref3$query === undefined ? {} : _ref3$query,
@@ -30,7 +31,7 @@ function countriesFactory(_ref) {
30
31
  return client({
31
32
  url: "/countries/" + id,
32
33
  params: query,
33
- headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
34
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
34
35
  });
35
36
  }
36
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "5.233.0",
3
+ "version": "5.234.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,11 +9,11 @@ function countriesFactory({client, internalAuthTokenProvider}) {
9
9
  });
10
10
  }
11
11
 
12
- function get({token, id, query = {}, headers}) {
12
+ function get({token, jwtToken, id, query = {}, headers}) {
13
13
  return client({
14
14
  url: `/countries/${id}`,
15
15
  params: query,
16
- headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
16
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
17
17
  });
18
18
  }
19
19
 
@@ -3,6 +3,7 @@ const api = require("./../../../src/client.js").createApiClient({baseURL: "http:
3
3
 
4
4
  describe("inventory/countries", () => {
5
5
  const token = "I owe you a token";
6
+ const jwtToken = "I owe you a JWT token";
6
7
 
7
8
  afterEach(() => {
8
9
  axiosMock.restore();
@@ -15,15 +16,15 @@ describe("inventory/countries", () => {
15
16
 
16
17
  it("should get a country by id", () => {
17
18
  const countryId = "countryId";
18
- axiosMock.onGet(`/countries/${countryId}`).reply(expectRequest({statusCode: 200, token}));
19
- return api.inventory.countries.get({id: countryId, token});
19
+ axiosMock.onGet(`/countries/${countryId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
20
+ return api.inventory.countries.get({id: countryId, token, jwtToken});
20
21
  });
21
22
 
22
23
  it("should get a country by id and support query parameters", () => {
23
24
  const countryId = "countryId";
24
25
  const query = {param1: "value1"};
25
26
 
26
- axiosMock.onGet(`/countries/${countryId}?param1=value1`).reply(expectRequest({statusCode: 200, token}));
27
- return api.inventory.countries.get({id: countryId, query, token});
27
+ axiosMock.onGet(`/countries/${countryId}?param1=value1`).reply(expectRequest({statusCode: 200, token, jwtToken}));
28
+ return api.inventory.countries.get({id: countryId, query, token, jwtToken});
28
29
  });
29
30
  });
package/types/client.d.ts CHANGED
@@ -265,8 +265,9 @@ export function createApiClient(options: {
265
265
  query?: {};
266
266
  headers: any;
267
267
  }) => any;
268
- get: ({ token, id, query, headers }: {
268
+ get: ({ token, jwtToken, id, query, headers }: {
269
269
  token: any;
270
+ jwtToken: any;
270
271
  id: any;
271
272
  query?: {};
272
273
  headers: any;
@@ -8,8 +8,9 @@ declare function countriesFactory({ client, internalAuthTokenProvider }: {
8
8
  query?: {};
9
9
  headers: any;
10
10
  }) => any;
11
- get: ({ token, id, query, headers }: {
11
+ get: ({ token, jwtToken, id, query, headers }: {
12
12
  token: any;
13
+ jwtToken: any;
13
14
  id: any;
14
15
  query?: {};
15
16
  headers: any;
@@ -219,8 +219,9 @@ declare const _exports: {
219
219
  query?: {};
220
220
  headers: any;
221
221
  }) => any;
222
- get: ({ token, id, query, headers }: {
222
+ get: ({ token, jwtToken, id, query, headers }: {
223
223
  token: any;
224
+ jwtToken: any;
224
225
  id: any;
225
226
  query?: {};
226
227
  headers: any;