btrz-api-client 7.34.0 → 8.0.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _require = require("./../endpoints_helpers"),
3
+ var _require = require("./../endpoints_helpers.js"),
4
4
  authorizationHeaders = _require.authorizationHeaders;
5
5
 
6
6
  function transactionsFactory(_ref) {
@@ -75,8 +75,7 @@ function transactionsFactory(_ref) {
75
75
  }
76
76
 
77
77
  function expireAll(_ref7) {
78
- var internalAuthTokenProvider = _ref7.internalAuthTokenProvider,
79
- jwtToken = _ref7.jwtToken,
78
+ var jwtToken = _ref7.jwtToken,
80
79
  transactionId = _ref7.transactionId,
81
80
  avoidEmail = _ref7.avoidEmail,
82
81
  token = _ref7.token,
@@ -108,7 +107,7 @@ function transactionsFactory(_ref) {
108
107
  return client({
109
108
  url: "/transactions/" + transactionId + "/cancellable-items",
110
109
  params: {
111
- displayAll: displayAll ? true : false,
110
+ displayAll: !!displayAll,
112
111
  channel: channel || ""
113
112
  },
114
113
  headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "7.34.0",
3
+ "version": "8.0.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- const {authorizationHeaders} = require("./../endpoints_helpers");
1
+ const {authorizationHeaders} = require("./../endpoints_helpers.js");
2
2
 
3
3
  function transactionsFactory({client, internalAuthTokenProvider}) {
4
4
  function get({token, jwtToken, trxId, query, headers}) {
@@ -41,7 +41,7 @@ function transactionsFactory({client, internalAuthTokenProvider}) {
41
41
  });
42
42
  }
43
43
 
44
- function expireAll({internalAuthTokenProvider, jwtToken, transactionId, avoidEmail, token, headers}) {
44
+ function expireAll({jwtToken, transactionId, avoidEmail, token, headers}) {
45
45
  return client({
46
46
  url: "/transactions/status",
47
47
  method: "patch",
@@ -61,7 +61,7 @@ function transactionsFactory({client, internalAuthTokenProvider}) {
61
61
  return client({
62
62
  url: `/transactions/${transactionId}/cancellable-items`,
63
63
  params: {
64
- displayAll: displayAll ? true : false,
64
+ displayAll: !!displayAll,
65
65
  channel: channel || ""
66
66
  },
67
67
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
@@ -1,19 +1,17 @@
1
1
  /* eslint-disable prefer-arrow-callback */
2
2
  /* eslint-disable func-names */
3
3
 
4
- const {axiosMock, expectRequest} = require("./../../test-helpers");
5
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
6
-
7
- const expect = require("chai").expect;
8
-
9
4
  describe("operations/transactions", function () {
10
- const token = "validToken";
11
- const jwtToken = "validJWTtoken";
5
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
12
6
  const internalAuthTokenProvider = {
13
7
  getToken: () => {
14
8
  return "internalToken";
15
9
  }
16
10
  };
11
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com", internalAuthTokenProvider});
12
+ const expect = require("chai").expect;
13
+ const token = "validToken";
14
+ const jwtToken = "validJWTtoken";
17
15
 
18
16
  afterEach(function () {
19
17
  axiosMock.reset();
@@ -118,7 +116,6 @@ describe("operations/transactions", function () {
118
116
  jwtToken: "internal_auth_token"
119
117
  }));
120
118
  return api.operations.transactions.expireAll({
121
- internalAuthTokenProvider,
122
119
  transactionId,
123
120
  jwtToken: "internal_auth_token"
124
121
  });
@@ -6,7 +6,7 @@ const port = process.env.OPERATIONS_API_PORT;
6
6
  const token = process.env.API_TOKEN;
7
7
  const jwtToken = process.env.JWT_TOKEN;
8
8
 
9
- const api = require("./../../../src/client").createApiClient({
9
+ const api = require("./../../../src/client.js").createApiClient({
10
10
  baseURL: `http://localhost:${port}`,
11
11
  baseURLOverride: {
12
12
  operations: (baseUrl) => {
@@ -32,12 +32,7 @@ describe("operations/transactions", function () {
32
32
  describe("expireAll", () => {
33
33
  it("should expire all", () => {
34
34
  const transactionId = "5ce2d7d4c16f0e5827069f13";
35
- const internalAuthTokenProvider = {
36
- getToken: () => {
37
- return process.env.INTERNAL_TOKEN;
38
- }
39
- };
40
- return api.operations.transactions.expireAll({jwtToken, internalAuthTokenProvider, transactionId})
35
+ return api.operations.transactions.expireAll({jwtToken, transactionId})
41
36
  .then((res) => {
42
37
  expect(res.data.transactionIds).to.have.length(1);
43
38
  });
package/types/client.d.ts CHANGED
@@ -4119,8 +4119,7 @@ export function createApiClient(options: {
4119
4119
  ticketIds: any;
4120
4120
  headers: any;
4121
4121
  }) => any;
4122
- expireAll: ({ internalAuthTokenProvider, jwtToken, transactionId, avoidEmail, token, headers }: {
4123
- internalAuthTokenProvider: any;
4122
+ expireAll: ({ jwtToken, transactionId, avoidEmail, token, headers }: {
4124
4123
  jwtToken: any;
4125
4124
  transactionId: any;
4126
4125
  avoidEmail: any;
@@ -35,8 +35,7 @@ declare function transactionsFactory({ client, internalAuthTokenProvider }: {
35
35
  ticketIds: any;
36
36
  headers: any;
37
37
  }) => any;
38
- expireAll: ({ internalAuthTokenProvider, jwtToken, transactionId, avoidEmail, token, headers }: {
39
- internalAuthTokenProvider: any;
38
+ expireAll: ({ jwtToken, transactionId, avoidEmail, token, headers }: {
40
39
  jwtToken: any;
41
40
  transactionId: any;
42
41
  avoidEmail: any;
@@ -4073,8 +4073,7 @@ declare const _exports: {
4073
4073
  ticketIds: any;
4074
4074
  headers: any;
4075
4075
  }) => any;
4076
- expireAll: ({ internalAuthTokenProvider, jwtToken, transactionId, avoidEmail, token, headers }: {
4077
- internalAuthTokenProvider: any;
4076
+ expireAll: ({ jwtToken, transactionId, avoidEmail, token, headers }: {
4078
4077
  jwtToken: any;
4079
4078
  transactionId: any;
4080
4079
  avoidEmail: any;