btrz-api-client 5.188.0 → 5.190.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.
package/lib/client.js CHANGED
@@ -114,6 +114,7 @@ function createInventory(_ref) {
114
114
  seatClasses: require("./endpoints/inventory/seatclasses.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
115
115
  segmentsInformation: require("./endpoints/inventory/segments-information.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
116
116
  mitTerminalsSettings: require("./endpoints/inventory/mit-terminal-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
117
+ financingCosts: require("./endpoints/inventory/financing-costs.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
117
118
  __test: {
118
119
  client: client
119
120
  }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ var _require = require("./../endpoints_helpers.js"),
4
+ authorizationHeaders = _require.authorizationHeaders;
5
+
6
+ function financingCostsFactory(_ref) {
7
+ var client = _ref.client,
8
+ internalAuthTokenProvider = _ref.internalAuthTokenProvider;
9
+
10
+ function all(_ref2) {
11
+ var token = _ref2.token,
12
+ jwtToken = _ref2.jwtToken,
13
+ _ref2$query = _ref2.query,
14
+ query = _ref2$query === undefined ? {} : _ref2$query,
15
+ headers = _ref2.headers;
16
+
17
+ return client.get("/financing-costs", {
18
+ params: query,
19
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
20
+ });
21
+ }
22
+
23
+ function get(_ref3) {
24
+ var id = _ref3.id,
25
+ token = _ref3.token,
26
+ headers = _ref3.headers,
27
+ jwtToken = _ref3.jwtToken;
28
+
29
+ return client.get("/financing-costs/" + id, {
30
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
31
+ });
32
+ }
33
+
34
+ function create(_ref4) {
35
+ var jwtToken = _ref4.jwtToken,
36
+ token = _ref4.token,
37
+ financingCost = _ref4.financingCost,
38
+ headers = _ref4.headers;
39
+
40
+ return client({
41
+ url: "/financing-costs",
42
+ method: "post",
43
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
44
+ data: {
45
+ financingCost: financingCost
46
+ }
47
+ });
48
+ }
49
+
50
+ function remove(_ref5) {
51
+ var jwtToken = _ref5.jwtToken,
52
+ id = _ref5.id,
53
+ token = _ref5.token,
54
+ headers = _ref5.headers;
55
+
56
+ return client({
57
+ url: "/financing-costs/" + id,
58
+ method: "delete",
59
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
60
+ });
61
+ }
62
+
63
+ function update(_ref6) {
64
+ var jwtToken = _ref6.jwtToken,
65
+ token = _ref6.token,
66
+ id = _ref6.id,
67
+ financingCost = _ref6.financingCost,
68
+ headers = _ref6.headers;
69
+
70
+ return client({
71
+ url: "/financing-costs/" + id,
72
+ method: "put",
73
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
74
+ data: {
75
+ financingCost: financingCost
76
+ }
77
+ });
78
+ }
79
+
80
+ return {
81
+ all: all,
82
+ get: get,
83
+ create: create,
84
+ update: update,
85
+ remove: remove
86
+ };
87
+ }
88
+
89
+ module.exports = financingCostsFactory;
@@ -90,13 +90,26 @@ function undeliveredFactory(_ref) {
90
90
  });
91
91
  }
92
92
 
93
+ function deleteAll(_ref8) {
94
+ var token = _ref8.token,
95
+ jwtToken = _ref8.jwtToken,
96
+ headers = _ref8.headers;
97
+
98
+ return client({
99
+ url: "/undelivered/batch-all",
100
+ method: "delete",
101
+ headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
102
+ });
103
+ }
104
+
93
105
  return {
94
106
  all: all,
95
107
  getById: getById,
96
108
  patch: patch,
97
109
  resend: resend,
98
110
  resendAll: resendAll,
99
- deleteById: deleteById
111
+ deleteById: deleteById,
112
+ deleteAll: deleteAll
100
113
  };
101
114
  }
102
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "btrz-api-client",
3
- "version": "5.188.0",
3
+ "version": "5.190.0",
4
4
  "description": "Api client for Betterez endpoints",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/client.js CHANGED
@@ -101,6 +101,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
101
101
  seatClasses: require("./endpoints/inventory/seatclasses.js")({client, internalAuthTokenProvider}),
102
102
  segmentsInformation: require("./endpoints/inventory/segments-information.js")({client, internalAuthTokenProvider}),
103
103
  mitTerminalsSettings: require("./endpoints/inventory/mit-terminal-settings.js")({client, internalAuthTokenProvider}),
104
+ financingCosts: require("./endpoints/inventory/financing-costs.js")({client, internalAuthTokenProvider}),
104
105
  __test: {
105
106
  client
106
107
  }
@@ -0,0 +1,63 @@
1
+ const {
2
+ authorizationHeaders
3
+ } = require("./../endpoints_helpers.js");
4
+
5
+ function financingCostsFactory({client, internalAuthTokenProvider}) {
6
+ function all({
7
+ token,
8
+ jwtToken,
9
+ query = {},
10
+ headers
11
+ }) {
12
+ return client.get("/financing-costs", {
13
+ params: query,
14
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
15
+ });
16
+ }
17
+
18
+ function get({id, token, headers, jwtToken}) {
19
+ return client.get(`/financing-costs/${id}`, {
20
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
21
+ });
22
+ }
23
+
24
+ function create({jwtToken, token, financingCost, headers}) {
25
+ return client({
26
+ url: "/financing-costs",
27
+ method: "post",
28
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
29
+ data: {
30
+ financingCost
31
+ }
32
+ });
33
+ }
34
+
35
+ function remove({jwtToken, id, token, headers}) {
36
+ return client({
37
+ url: `/financing-costs/${id}`,
38
+ method: "delete",
39
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
40
+ });
41
+ }
42
+
43
+ function update({jwtToken, token, id, financingCost, headers}) {
44
+ return client({
45
+ url: `/financing-costs/${id}`,
46
+ method: "put",
47
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
48
+ data: {
49
+ financingCost
50
+ }
51
+ });
52
+ }
53
+
54
+ return {
55
+ all,
56
+ get,
57
+ create,
58
+ update,
59
+ remove
60
+ };
61
+ }
62
+
63
+ module.exports = financingCostsFactory;
@@ -53,15 +53,23 @@ function undeliveredFactory({ client, internalAuthTokenProvider }) {
53
53
  });
54
54
  }
55
55
 
56
+ function deleteAll({token, jwtToken, headers}) {
57
+ return client({
58
+ url: "/undelivered/batch-all",
59
+ method: "delete",
60
+ headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
61
+ });
62
+ }
63
+
56
64
  return {
57
65
  all,
58
66
  getById,
59
67
  patch,
60
68
  resend,
61
69
  resendAll,
62
- deleteById
70
+ deleteById,
71
+ deleteAll
63
72
  };
64
-
65
73
  }
66
74
 
67
75
  module.exports = undeliveredFactory;
@@ -0,0 +1,66 @@
1
+ const {
2
+ axiosMock, expectRequest
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
+
6
+ describe("inventory/financing-costs", () => {
7
+ const token = "I owe you a token";
8
+ const jwtToken = "I owe you a JWT token";
9
+
10
+ afterEach(() => {
11
+ axiosMock.reset();
12
+ });
13
+
14
+ it("should create a financing cost", () => {
15
+ axiosMock.onPost("/financing-costs").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
+ return api.inventory.financingCosts.create({
17
+ jwtToken,
18
+ token,
19
+ financingCost: {
20
+ name: "My financingCost"
21
+ }
22
+ });
23
+ });
24
+
25
+ it("should get all financing costs", () => {
26
+ axiosMock.onGet("/financing-costs").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
+ return api.inventory.financingCosts.all({
28
+ jwtToken,
29
+ token,
30
+ query: {}
31
+ });
32
+ });
33
+
34
+ it("should update a financing cost", () => {
35
+ const id = "1234";
36
+ axiosMock.onPut(`/financing-costs/${id}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
+ return api.inventory.financingCosts.update({
38
+ jwtToken,
39
+ token,
40
+ id,
41
+ financingCost: {
42
+ name: "My Updated financing costs"
43
+ }
44
+ });
45
+ });
46
+
47
+ it("should get a financing cost", () => {
48
+ const id = "1234";
49
+ axiosMock.onGet(`/financing-costs/${id}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
+ return api.inventory.financingCosts.get({
51
+ jwtToken,
52
+ token,
53
+ id
54
+ });
55
+ });
56
+
57
+ it("should delete a financing cost", () => {
58
+ const id = "1234";
59
+ axiosMock.onDelete(`/financing-costs/${id}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
60
+ return api.inventory.financingCosts.remove({
61
+ jwtToken,
62
+ token,
63
+ id
64
+ });
65
+ });
66
+ });
@@ -26,6 +26,11 @@ describe("webhooks/undelivered", () => {
26
26
  return api.webhooks.undelivered.deleteById({ token, jwtToken, id });
27
27
  });
28
28
 
29
+ it("should delete all undelivered webhooks", () => {
30
+ axiosMock.onDelete("/undelivered/batch-all").reply(expectRequest({statusCode: 204, token, jwtToken}));
31
+ return api.webhooks.undelivered.deleteAll({token, jwtToken});
32
+ });
33
+
29
34
  it("should patch an undelivered", function() {
30
35
  axiosMock.onPatch("/undelivered").reply(expectRequest({ statusCode: 200, token, jwtToken }));
31
36
  return api.webhooks.undelivered.patch({ jwtToken, token, operation: {} });
package/types/client.d.ts CHANGED
@@ -1664,6 +1664,39 @@ export function createApiClient(options: {
1664
1664
  headers: any;
1665
1665
  }) => any;
1666
1666
  };
1667
+ financingCosts: {
1668
+ all: ({ token, jwtToken, query, headers }: {
1669
+ token: any;
1670
+ jwtToken: any;
1671
+ query?: {};
1672
+ headers: any;
1673
+ }) => any;
1674
+ get: ({ id, token, headers, jwtToken }: {
1675
+ id: any;
1676
+ token: any;
1677
+ headers: any;
1678
+ jwtToken: any;
1679
+ }) => any;
1680
+ create: ({ jwtToken, token, financingCost, headers }: {
1681
+ jwtToken: any;
1682
+ token: any;
1683
+ financingCost: any;
1684
+ headers: any;
1685
+ }) => any;
1686
+ update: ({ jwtToken, token, id, financingCost, headers }: {
1687
+ jwtToken: any;
1688
+ token: any;
1689
+ id: any;
1690
+ financingCost: any;
1691
+ headers: any;
1692
+ }) => any;
1693
+ remove: ({ jwtToken, id, token, headers }: {
1694
+ jwtToken: any;
1695
+ id: any;
1696
+ token: any;
1697
+ headers: any;
1698
+ }) => any;
1699
+ };
1667
1700
  __test: {
1668
1701
  client: axios.AxiosInstance;
1669
1702
  };
@@ -1826,12 +1859,7 @@ export function createApiClient(options: {
1826
1859
  };
1827
1860
  dynamicForms: {
1828
1861
  fields: {
1829
- get({ token, jwtToken, dynamicFormFieldId, headers }?: {
1830
- token: any;
1831
- jwtToken: any;
1832
- dynamicFormFieldId: any;
1833
- headers: any;
1834
- }): any;
1862
+ get({ token, jwtToken, dynamicFormFieldId, headers }?: {}): any;
1835
1863
  all({ token, jwtToken, query, headers }: {
1836
1864
  token: any;
1837
1865
  jwtToken: any;
@@ -2533,12 +2561,7 @@ export function createApiClient(options: {
2533
2561
  }) => any;
2534
2562
  };
2535
2563
  users: {
2536
- get: ({ token, jwtToken, id, headers }?: {
2537
- token: any;
2538
- jwtToken: any;
2539
- id: any;
2540
- headers: any;
2541
- }) => any;
2564
+ get: ({ token, jwtToken, id, headers }?: {}) => any;
2542
2565
  all: ({ token, jwtToken, query, headers }: {
2543
2566
  token: any;
2544
2567
  jwtToken: any;
@@ -2838,7 +2861,7 @@ export function createApiClient(options: {
2838
2861
  create: ({ token, jwtToken, cancelData, headers }: {
2839
2862
  token: string;
2840
2863
  jwtToken: string;
2841
- cancelData: import("./endpoints/sales/cancellations.js").CancelSetData;
2864
+ cancelData: CancelSetData;
2842
2865
  headers: any;
2843
2866
  }) => Promise<any>;
2844
2867
  };
@@ -3667,7 +3690,7 @@ export function createApiClient(options: {
3667
3690
  jwtToken: any;
3668
3691
  phoneNumberData?: {};
3669
3692
  headers: any;
3670
- }): any; /** @type {import("axios").AxiosRequestConfig} */
3693
+ }): any;
3671
3694
  };
3672
3695
  sms: {
3673
3696
  create({ token, jwtToken, smsMsg, headers }: {
@@ -3854,6 +3877,11 @@ export function createApiClient(options: {
3854
3877
  id: any;
3855
3878
  headers: any;
3856
3879
  }) => any;
3880
+ deleteAll: ({ token, jwtToken, headers }: {
3881
+ token: any;
3882
+ jwtToken: any;
3883
+ headers: any;
3884
+ }) => any;
3857
3885
  };
3858
3886
  webhooks: {
3859
3887
  emit: ({ token, jwtToken, webhook, headers }: {
@@ -4,12 +4,7 @@ declare function dynamicFormsFactory({ client, internalAuthTokenProvider }: {
4
4
  internalAuthTokenProvider: any;
5
5
  }): {
6
6
  fields: {
7
- get({ token, jwtToken, dynamicFormFieldId, headers }?: {
8
- token: any;
9
- jwtToken: any;
10
- dynamicFormFieldId: any;
11
- headers: any;
12
- }): any;
7
+ get({ token, jwtToken, dynamicFormFieldId, headers }?: {}): any;
13
8
  all({ token, jwtToken, query, headers }: {
14
9
  token: any;
15
10
  jwtToken: any;
@@ -3,12 +3,7 @@ declare function usersFactory({ client, internalAuthTokenProvider }: {
3
3
  client: any;
4
4
  internalAuthTokenProvider: any;
5
5
  }): {
6
- get: ({ token, jwtToken, id, headers }?: {
7
- token: any;
8
- jwtToken: any;
9
- id: any;
10
- headers: any;
11
- }) => any;
6
+ get: ({ token, jwtToken, id, headers }?: {}) => any;
12
7
  all: ({ token, jwtToken, query, headers }: {
13
8
  token: any;
14
9
  jwtToken: any;
@@ -0,0 +1,37 @@
1
+ export = financingCostsFactory;
2
+ declare function financingCostsFactory({ client, internalAuthTokenProvider }: {
3
+ client: any;
4
+ internalAuthTokenProvider: any;
5
+ }): {
6
+ all: ({ token, jwtToken, query, headers }: {
7
+ token: any;
8
+ jwtToken: any;
9
+ query?: {};
10
+ headers: any;
11
+ }) => any;
12
+ get: ({ id, token, headers, jwtToken }: {
13
+ id: any;
14
+ token: any;
15
+ headers: any;
16
+ jwtToken: any;
17
+ }) => any;
18
+ create: ({ jwtToken, token, financingCost, headers }: {
19
+ jwtToken: any;
20
+ token: any;
21
+ financingCost: any;
22
+ headers: any;
23
+ }) => any;
24
+ update: ({ jwtToken, token, id, financingCost, headers }: {
25
+ jwtToken: any;
26
+ token: any;
27
+ id: any;
28
+ financingCost: any;
29
+ headers: any;
30
+ }) => any;
31
+ remove: ({ jwtToken, id, token, headers }: {
32
+ jwtToken: any;
33
+ id: any;
34
+ token: any;
35
+ headers: any;
36
+ }) => any;
37
+ };
@@ -39,4 +39,9 @@ declare function undeliveredFactory({ client, internalAuthTokenProvider }: {
39
39
  id: any;
40
40
  headers: any;
41
41
  }) => any;
42
+ deleteAll: ({ token, jwtToken, headers }: {
43
+ token: any;
44
+ jwtToken: any;
45
+ headers: any;
46
+ }) => any;
42
47
  };
@@ -1618,6 +1618,39 @@ declare const _exports: {
1618
1618
  headers: any;
1619
1619
  }) => any;
1620
1620
  };
1621
+ financingCosts: {
1622
+ all: ({ token, jwtToken, query, headers }: {
1623
+ token: any;
1624
+ jwtToken: any;
1625
+ query?: {};
1626
+ headers: any;
1627
+ }) => any;
1628
+ get: ({ id, token, headers, jwtToken }: {
1629
+ id: any;
1630
+ token: any;
1631
+ headers: any;
1632
+ jwtToken: any;
1633
+ }) => any;
1634
+ create: ({ jwtToken, token, financingCost, headers }: {
1635
+ jwtToken: any;
1636
+ token: any;
1637
+ financingCost: any;
1638
+ headers: any;
1639
+ }) => any;
1640
+ update: ({ jwtToken, token, id, financingCost, headers }: {
1641
+ jwtToken: any;
1642
+ token: any;
1643
+ id: any;
1644
+ financingCost: any;
1645
+ headers: any;
1646
+ }) => any;
1647
+ remove: ({ jwtToken, id, token, headers }: {
1648
+ jwtToken: any;
1649
+ id: any;
1650
+ token: any;
1651
+ headers: any;
1652
+ }) => any;
1653
+ };
1621
1654
  __test: {
1622
1655
  client: import("axios").AxiosInstance;
1623
1656
  };
@@ -1780,12 +1813,7 @@ declare const _exports: {
1780
1813
  };
1781
1814
  dynamicForms: {
1782
1815
  fields: {
1783
- get({ token, jwtToken, dynamicFormFieldId, headers }?: {
1784
- token: any;
1785
- jwtToken: any;
1786
- dynamicFormFieldId: any;
1787
- headers: any;
1788
- }): any;
1816
+ get({ token, jwtToken, dynamicFormFieldId, headers }?: {}): any;
1789
1817
  all({ token, jwtToken, query, headers }: {
1790
1818
  token: any;
1791
1819
  jwtToken: any;
@@ -2487,12 +2515,7 @@ declare const _exports: {
2487
2515
  }) => any;
2488
2516
  };
2489
2517
  users: {
2490
- get: ({ token, jwtToken, id, headers }?: {
2491
- token: any;
2492
- jwtToken: any;
2493
- id: any;
2494
- headers: any;
2495
- }) => any;
2518
+ get: ({ token, jwtToken, id, headers }?: {}) => any;
2496
2519
  all: ({ token, jwtToken, query, headers }: {
2497
2520
  token: any;
2498
2521
  jwtToken: any;
@@ -2792,7 +2815,7 @@ declare const _exports: {
2792
2815
  create: ({ token, jwtToken, cancelData, headers }: {
2793
2816
  token: string;
2794
2817
  jwtToken: string;
2795
- cancelData: import("./endpoints/sales/cancellations.js").CancelSetData;
2818
+ cancelData: CancelSetData;
2796
2819
  headers: any;
2797
2820
  }) => Promise<any>;
2798
2821
  };
@@ -3808,6 +3831,11 @@ declare const _exports: {
3808
3831
  id: any;
3809
3832
  headers: any;
3810
3833
  }) => any;
3834
+ deleteAll: ({ token, jwtToken, headers }: {
3835
+ token: any;
3836
+ jwtToken: any;
3837
+ headers: any;
3838
+ }) => any;
3811
3839
  };
3812
3840
  webhooks: {
3813
3841
  emit: ({ token, jwtToken, webhook, headers }: {