btrz-api-client 8.64.0 → 8.66.1

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.
Files changed (244) hide show
  1. package/.eslint-report.json +1 -0
  2. package/.eslintignore +2 -0
  3. package/fetch-test.js +5 -6
  4. package/index.js +2 -2
  5. package/lib/client-standalone-min.js +3 -3
  6. package/lib/client.js +50 -38
  7. package/lib/endpoints/accounts/journey-prices-settings.js +2 -2
  8. package/lib/endpoints/accounts/market-pricing-settings.js +3 -3
  9. package/lib/endpoints/accounts/multiproduct-sales-settings.js +6 -2
  10. package/lib/endpoints/accounts/operation-settings.js +3 -1
  11. package/lib/endpoints/btrzpay/referenced-payments.js +6 -2
  12. package/lib/endpoints/btrzpay/square.js +12 -3
  13. package/lib/endpoints/btrzpay/stripe-terminals.js +9 -3
  14. package/lib/endpoints/btrzpay/terminalPayments.js +14 -4
  15. package/lib/endpoints/inventory/document-types.js +2 -1
  16. package/lib/endpoints/inventory/products.js +1 -0
  17. package/lib/endpoints/notifications/pdf-data.js +3 -6
  18. package/lib/endpoints/operations/movements.js +7 -2
  19. package/lib/endpoints/operations/pago-express.js +9 -3
  20. package/lib/endpoints/operations/parcels.js +3 -1
  21. package/lib/endpoints/sales/cancellations.js +31 -8
  22. package/package.json +6 -8
  23. package/src/client.js +0 -1
  24. package/src/endpoints/accounts/journey-prices-settings.js +2 -2
  25. package/src/endpoints/accounts/market-pricing-settings.js +3 -3
  26. package/src/endpoints/accounts/multiproduct-sales-settings.js +6 -2
  27. package/src/endpoints/accounts/operation-settings.js +3 -1
  28. package/src/endpoints/btrzpay/referenced-payments.js +6 -2
  29. package/src/endpoints/btrzpay/square.js +12 -3
  30. package/src/endpoints/btrzpay/stripe-terminals.js +9 -3
  31. package/src/endpoints/btrzpay/terminalPayments.js +14 -4
  32. package/src/endpoints/inventory/document-types.js +2 -1
  33. package/src/endpoints/inventory/products.js +1 -0
  34. package/src/endpoints/notifications/pdf-data.js +3 -6
  35. package/src/endpoints/operations/movements.js +7 -2
  36. package/src/endpoints/operations/pago-express.js +9 -3
  37. package/src/endpoints/operations/parcels.js +3 -1
  38. package/src/endpoints/sales/cancellations.js +31 -8
  39. package/test/all.test.js +218 -0
  40. package/test/client.test.js +58 -44
  41. package/test/endpoints/accounts/application-settings.test.js +2 -2
  42. package/test/endpoints/accounts/applications.test.js +2 -2
  43. package/test/endpoints/accounts/current-shifts.test.js +2 -2
  44. package/test/endpoints/accounts/customers.js +17 -17
  45. package/test/endpoints/accounts/domains.test.js +6 -8
  46. package/test/endpoints/accounts/exchange-rates.test.js +3 -3
  47. package/test/endpoints/accounts/exchange-receipts.test.js +3 -3
  48. package/test/endpoints/accounts/images.test.js +2 -2
  49. package/test/endpoints/accounts/interline.test.js +10 -12
  50. package/test/endpoints/accounts/network.test.js +3 -5
  51. package/test/endpoints/accounts/people-lookups.test.js +13 -13
  52. package/test/endpoints/accounts/print-templates.test.js +3 -3
  53. package/test/endpoints/accounts/printers.test.js +2 -2
  54. package/test/endpoints/accounts/tokens.js +2 -2
  55. package/test/endpoints/accounts/trusted-machines.test.js +2 -2
  56. package/test/endpoints/accounts/websales-config.test.js +47 -50
  57. package/test/endpoints/btrzpay/carpointe.tests.js +2 -2
  58. package/test/endpoints/btrzpay/datalogicPayments.tests.js +2 -2
  59. package/test/endpoints/btrzpay/datalogicReferenceNumber.tests.js +2 -2
  60. package/test/endpoints/btrzpay/oxxoPayments.tests.js +2 -2
  61. package/test/endpoints/btrzpay/oxxoToken.tests.js +2 -2
  62. package/test/endpoints/btrzpay/payment-methods.test.js +3 -3
  63. package/test/endpoints/btrzpay/payments.tests.js +6 -6
  64. package/test/endpoints/btrzpay/reference-numbers.test.js +5 -5
  65. package/test/endpoints/btrzpay/referenced-payments.test.js +2 -2
  66. package/test/endpoints/btrzpay/square.tests.js +2 -2
  67. package/test/endpoints/btrzpay/terminalPayments.tests.js +2 -2
  68. package/test/endpoints/endpoints_helpers.test.js +28 -24
  69. package/test/endpoints/inventory/amenities.test.js +20 -20
  70. package/test/endpoints/inventory/amenity-groups.test.js +15 -15
  71. package/test/endpoints/inventory/bare-routes.test.js +2 -2
  72. package/test/endpoints/inventory/brands.test.js +9 -9
  73. package/test/endpoints/inventory/bundle-fares.test.js +10 -11
  74. package/test/endpoints/inventory/bundles.test.js +9 -9
  75. package/test/endpoints/inventory/companies.test.js +6 -6
  76. package/test/endpoints/inventory/custom-content.test.js +4 -4
  77. package/test/endpoints/inventory/custom-fields.test.js +2 -2
  78. package/test/endpoints/inventory/document-types.test.js +2 -2
  79. package/test/endpoints/inventory/fare-classes.test.js +10 -10
  80. package/test/endpoints/inventory/fares.test.js +14 -16
  81. package/test/endpoints/inventory/fees.test.js +14 -15
  82. package/test/endpoints/inventory/filtered-trips-v2.test.js +5 -5
  83. package/test/endpoints/inventory/insurances.test.js +2 -2
  84. package/test/endpoints/inventory/insurancesCost.test.js +2 -2
  85. package/test/endpoints/inventory/journey-prices.test.js +13 -15
  86. package/test/endpoints/inventory/labels.test.js +2 -2
  87. package/test/endpoints/inventory/marital-status.test.js +2 -2
  88. package/test/endpoints/inventory/mit-terminal-settings.test.js +2 -2
  89. package/test/endpoints/inventory/mit-terminals.test.js +7 -7
  90. package/test/endpoints/inventory/operating-companies.test.js +14 -14
  91. package/test/endpoints/inventory/operation-messages.test.js +10 -10
  92. package/test/endpoints/inventory/parcel-zones.test.js +12 -13
  93. package/test/endpoints/inventory/payment-terminals.test.js +7 -7
  94. package/test/endpoints/inventory/prisma-terminals.test.js +2 -2
  95. package/test/endpoints/inventory/products.test.js +25 -20
  96. package/test/endpoints/inventory/promos.test.js +50 -50
  97. package/test/endpoints/inventory/seatclasses.test.js +2 -2
  98. package/test/endpoints/inventory/seatfees.test.js +6 -6
  99. package/test/endpoints/inventory/seatmaps.test.js +7 -7
  100. package/test/endpoints/inventory/segments-information.test.js +2 -2
  101. package/test/endpoints/inventory/service-numbers.test.js +6 -6
  102. package/test/endpoints/inventory/service-types.test.js +7 -7
  103. package/test/endpoints/inventory/shift-settings.test.js +2 -2
  104. package/test/endpoints/inventory/ssrs.test.js +10 -11
  105. package/test/endpoints/inventory/stations-zones.test.js +8 -9
  106. package/test/endpoints/inventory/stations.test.js +2 -2
  107. package/test/endpoints/inventory/travel-routes.test.js +2 -2
  108. package/test/endpoints/inventory/traveller-car-types.test.js +8 -8
  109. package/test/endpoints/inventory/traveller-card-providers-types.test.js +2 -2
  110. package/test/endpoints/inventory/traveller-card-providers.test.js +7 -7
  111. package/test/endpoints/inventory/vehicles.test.js +2 -2
  112. package/test/endpoints/inventory/zone-price-overages.test.js +2 -2
  113. package/test/endpoints/inventory/zone-prices.test.js +2 -2
  114. package/test/endpoints/invoices/dlink.test.js +2 -2
  115. package/test/endpoints/invoices/gti.test.js +2 -2
  116. package/test/endpoints/invoices/infile.test.js +2 -2
  117. package/test/endpoints/invoices/infileJson.test.js +2 -2
  118. package/test/endpoints/invoices/providers.test.js +4 -4
  119. package/test/endpoints/invoices/providersSequences.test.js +2 -2
  120. package/test/endpoints/invoices/system.test.js +2 -2
  121. package/test/endpoints/loyalty/movements.test.js +11 -11
  122. package/test/endpoints/loyalty/programs.test.js +21 -21
  123. package/test/endpoints/notifications/customers.test.js +6 -6
  124. package/test/endpoints/notifications/external-customers.test.js +10 -10
  125. package/test/endpoints/notifications/manifet-notifications.test.js +3 -3
  126. package/test/endpoints/notifications/notify.test.js +5 -5
  127. package/test/endpoints/notifications/orders-rules-validations.test.js +5 -6
  128. package/test/endpoints/notifications/pdf-data.test.js +4 -4
  129. package/test/endpoints/notifications/pdfs.test.js +4 -4
  130. package/test/endpoints/notifications/printed-tickets.test.js +17 -18
  131. package/test/endpoints/notifications/short-urls.test.js +9 -9
  132. package/test/endpoints/operations/applied_insurance.test.js +10 -14
  133. package/test/endpoints/operations/calendar_entries.test.js +8 -9
  134. package/test/endpoints/operations/cancellation_settings.test.js +2 -2
  135. package/test/endpoints/operations/loans.test.js +2 -2
  136. package/test/endpoints/operations/manifest.test.js +11 -9
  137. package/test/endpoints/operations/operations.test.js +42 -25
  138. package/test/endpoints/operations/parcel_manifests.test.js +3 -3
  139. package/test/endpoints/operations/parcels.test.js +27 -22
  140. package/test/endpoints/operations/passenger_check_in_info.test.js +2 -2
  141. package/test/endpoints/operations/redemption.test.js +2 -2
  142. package/test/endpoints/operations/sold-items-fulfillment.test.js +2 -2
  143. package/test/endpoints/operations/sold_items.test.js +3 -3
  144. package/test/endpoints/operations/tickets.test.js +4 -4
  145. package/test/endpoints/operations/transaction.test.js +12 -15
  146. package/test/endpoints/operations/transactions.test.js +11 -11
  147. package/test/endpoints/operations/transport_regulations.js +2 -4
  148. package/test/endpoints/operations/trip_change_info.test.js +9 -10
  149. package/test/endpoints/operations/vehicle-assignments.test.js +5 -7
  150. package/test/endpoints/operations/waitlists.test.js +3 -3
  151. package/test/endpoints/ratality/auth.test.js +5 -5
  152. package/test/endpoints/ratality/client.test.js +4 -4
  153. package/test/endpoints/ratality/integrations.test.js +15 -9
  154. package/test/endpoints/reports/custom-reports.test.js +12 -12
  155. package/test/endpoints/reports/email.test.js +3 -3
  156. package/test/endpoints/reports/report-types.test.js +6 -6
  157. package/test/endpoints/reports/trip-manifests.test.js +5 -6
  158. package/test/endpoints/sales/bundles.test.js +9 -10
  159. package/test/endpoints/sales/cart-promo.test.js +15 -16
  160. package/test/endpoints/sales/cart.test.js +7 -7
  161. package/test/endpoints/sales/check-in-info.test.js +3 -3
  162. package/test/endpoints/sales/custom-fields.test.js +10 -13
  163. package/test/endpoints/sales/flexpasses.test.js +2 -2
  164. package/test/endpoints/sales/git-certificates.test.js +10 -13
  165. package/test/endpoints/sales/order.test.js +19 -21
  166. package/test/endpoints/sales/payment-providers.test.js +14 -15
  167. package/test/endpoints/sales/redeemable-items.test.js +14 -15
  168. package/test/endpoints/sales/sync-entry.test.js +9 -11
  169. package/test/endpoints/sales/voucher.test.js +19 -17
  170. package/test/endpoints/seatmaps/access-ticket.test.js +6 -6
  171. package/test/endpoints/seatmaps/seat.test.js +6 -6
  172. package/test/endpoints/uploads/files.test.js +8 -7
  173. package/test/endpoints/uploads/images.test.js +8 -7
  174. package/test/endpoints/webhooks/subscriptions.test.js +27 -27
  175. package/test/endpoints/webhooks/undelivered.test.js +22 -22
  176. package/test/endpoints/webhooks/webhooks.test.js +7 -7
  177. package/test/node-test-globals.js +19 -0
  178. package/test/test-helpers.js +4 -4
  179. package/test-integration/all.test.js +63 -0
  180. package/test-integration/endpoints/accounts/current-shifts.test.js +4 -4
  181. package/test-integration/endpoints/accounts/docs.test.js +6 -6
  182. package/test-integration/endpoints/accounts/lexicons.test.js +42 -37
  183. package/test-integration/endpoints/accounts/shifts.test.js +5 -8
  184. package/test-integration/endpoints/accounts/users.test.js +4 -4
  185. package/test-integration/endpoints/btrzpay/customerCards.test.js +24 -48
  186. package/test-integration/endpoints/btrzpay/customers.test.js +20 -34
  187. package/test-integration/endpoints/btrzpay/payment-methods.test.js +34 -34
  188. package/test-integration/endpoints/btrzpay/payments.test.js +21 -21
  189. package/test-integration/endpoints/btrzpay/reference-numbers.test.js +15 -15
  190. package/test-integration/endpoints/btrzpay/referenced-payments.test.js +5 -5
  191. package/test-integration/endpoints/client.test.js +6 -10
  192. package/test-integration/endpoints/inventory/amenities.test.js +34 -34
  193. package/test-integration/endpoints/inventory/amenity-groups.test.js +30 -31
  194. package/test-integration/endpoints/inventory/bundle-fares.test.js +10 -12
  195. package/test-integration/endpoints/inventory/companies.test.js +7 -8
  196. package/test-integration/endpoints/inventory/countries.test.js +10 -12
  197. package/test-integration/endpoints/inventory/custom-fields.test.js +2 -2
  198. package/test-integration/endpoints/inventory/docs.test.js +5 -7
  199. package/test-integration/endpoints/inventory/fare-classes.test.js +12 -13
  200. package/test-integration/endpoints/inventory/fares.test.js +7 -9
  201. package/test-integration/endpoints/inventory/fees.test.js +8 -10
  202. package/test-integration/endpoints/inventory/filtered-trips.test.js +15 -12
  203. package/test-integration/endpoints/inventory/gift-certificate-definitions.test.js +5 -5
  204. package/test-integration/endpoints/inventory/insurances.test.js +36 -34
  205. package/test-integration/endpoints/inventory/items.js +10 -12
  206. package/test-integration/endpoints/inventory/journey-prices.test.js +11 -11
  207. package/test-integration/endpoints/inventory/parcel-zones.test.js +15 -18
  208. package/test-integration/endpoints/inventory/products.test.js +12 -14
  209. package/test-integration/endpoints/inventory/promos.test.js +46 -42
  210. package/test-integration/endpoints/inventory/routes.test.js +13 -15
  211. package/test-integration/endpoints/inventory/schedule-groups.test.js +23 -23
  212. package/test-integration/endpoints/inventory/ssrs.test.js +16 -11
  213. package/test-integration/endpoints/inventory/stations-zones.test.js +5 -6
  214. package/test-integration/endpoints/inventory/stations.test.js +17 -20
  215. package/test-integration/endpoints/inventory/trips.test.js +30 -16
  216. package/test-integration/endpoints/notifications/printed-tickets.test.js +2 -2
  217. package/test-integration/endpoints/operations/applied_insurance.test.js +9 -11
  218. package/test-integration/endpoints/operations/manifest.test.js +32 -34
  219. package/test-integration/endpoints/operations/parcel.test.js +36 -38
  220. package/test-integration/endpoints/operations/redemption.test.js +9 -12
  221. package/test-integration/endpoints/operations/segments.js +8 -10
  222. package/test-integration/endpoints/operations/tickets.test.js +11 -11
  223. package/test-integration/endpoints/operations/transaction.test.js +1 -1
  224. package/test-integration/endpoints/operations/transactions.test.js +2 -2
  225. package/test-integration/endpoints/operations/trip_change_info.test.js +11 -13
  226. package/test-integration/endpoints/reports/custom-reports.test.js +21 -21
  227. package/test-integration/endpoints/reports/report-types.test.js +22 -22
  228. package/test-integration/endpoints/sales/bundles.test.js +5 -5
  229. package/test-integration/endpoints/sales/cart-promo.test.js +17 -32
  230. package/test-integration/endpoints/sales/cart.test.js +45 -51
  231. package/test-integration/endpoints/sales/check-in-info.test.js +2 -2
  232. package/test-integration/endpoints/sales/custom-fields.test.js +8 -10
  233. package/test-integration/endpoints/sales/flexpasses.test.js +2 -2
  234. package/test-integration/endpoints/sales/gift-certificates.test.js +14 -18
  235. package/test-integration/endpoints/sales/order.test.js +42 -50
  236. package/test-integration/endpoints/sales/payment-providers.test.js +7 -9
  237. package/test-integration/endpoints/sales/redeemable-items.test.js +17 -19
  238. package/test-integration/endpoints/sales/voucher.test.js +12 -14
  239. package/test-integration/endpoints/seatmaps/access-ticket.test.js +7 -9
  240. package/test-integration/endpoints/seatmaps/seat.test.js +7 -9
  241. package/test-integration/endpoints/uploads/files.test.js +14 -14
  242. package/test-integration/endpoints/uploads/images.test.js +3 -5
  243. package/test-integration/ports.js +4 -4
  244. package/test-integration/test-integration-helpers.js +13 -9
@@ -1,16 +1,16 @@
1
- const { axiosMock, expectRequest } = require("../../test-helpers");
2
- const api = require("../../../src/client").createApiClient({ baseURL: "http://test.com" });
1
+ const {axiosMock, expectRequest} = require("../../test-helpers.js");
2
+ const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
3
3
 
4
- describe('inventory/operation-messages', () => {
5
- const token = 'I owe you a token',
6
- jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/operation-messages", () => {
5
+ const token = "I owe you a token";
6
+ const jwtToken = "I owe you a JWT token";
7
7
 
8
8
  afterEach(() => {
9
9
  axiosMock.reset();
10
10
  });
11
11
 
12
12
  it("should define a create method for an operation message", () => {
13
- axiosMock.onPost(`/operation-messages`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
13
+ axiosMock.onPost("/operation-messages").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
14
  return api.inventory.operationMessages.create({
15
15
  jwtToken,
16
16
  token,
@@ -23,7 +23,7 @@ describe('inventory/operation-messages', () => {
23
23
  });
24
24
 
25
25
  it("should define a get method for listing all operation messages", () => {
26
- axiosMock.onGet(`/operation-messages`).reply(expectRequest({ statusCode: 200, token }));
26
+ axiosMock.onGet("/operation-messages").reply(expectRequest({statusCode: 200, token}));
27
27
  return api.inventory.operationMessages.all({
28
28
  token
29
29
  });
@@ -31,7 +31,7 @@ describe('inventory/operation-messages', () => {
31
31
 
32
32
  it("should define an update method for an operation message", () => {
33
33
  const operationMessageId = "1234";
34
- axiosMock.onPut(`/operation-messages/${operationMessageId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
34
+ axiosMock.onPut(`/operation-messages/${operationMessageId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
35
35
  return api.inventory.operationMessages.update({
36
36
  jwtToken,
37
37
  token,
@@ -45,7 +45,7 @@ describe('inventory/operation-messages', () => {
45
45
 
46
46
  it("should define a deletion method for an operation message", () => {
47
47
  const operationMessageId = "1234";
48
- axiosMock.onDelete(`/operation-messages/${operationMessageId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
48
+ axiosMock.onDelete(`/operation-messages/${operationMessageId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
49
49
  return api.inventory.operationMessages.remove({
50
50
  jwtToken,
51
51
  token,
@@ -55,7 +55,7 @@ describe('inventory/operation-messages', () => {
55
55
 
56
56
  it("should define a get method for an operation message", () => {
57
57
  const operationMessageId = "1234";
58
- axiosMock.onGet(`/operation-messages/${operationMessageId}`).reply(expectRequest({ statusCode: 200, token }));
58
+ axiosMock.onGet(`/operation-messages/${operationMessageId}`).reply(expectRequest({statusCode: 200, token}));
59
59
  return api.inventory.operationMessages.get({
60
60
  token,
61
61
  operationMessageId
@@ -1,28 +1,27 @@
1
- const { axiosMock, expectRequest } = require("./../../test-helpers");
2
- const api = require("./../../../src/client").createApiClient({ baseURL: "http://test.com" });
1
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
2
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
3
3
 
4
- describe('inventory/parcel-zones', () => {
5
- const token = 'I owe you a token',
6
- jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/parcel-zones", () => {
5
+ const token = "I owe you a token";
6
+ const jwtToken = "I owe you a JWT token";
7
7
 
8
8
  afterEach(() => {
9
9
  axiosMock.reset();
10
10
  });
11
11
 
12
12
  it("should list parcel zones", () => {
13
- axiosMock.onGet(`/parcel-zones`).reply(expectRequest({ statusCode: 200, token }));
14
- return api.inventory.parcelZones.all({ token });
13
+ axiosMock.onGet("/parcel-zones").reply(expectRequest({statusCode: 200, token}));
14
+ return api.inventory.parcelZones.all({token});
15
15
  });
16
16
 
17
17
  it("should create parcel zones", () => {
18
- axiosMock.onPost(`/parcel-zones`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
19
- return api.inventory.parcelZones.create({ jwtToken, token, parcelZone: { productId: "6789" } });
18
+ axiosMock.onPost("/parcel-zones").reply(expectRequest({statusCode: 200, token, jwtToken}));
19
+ return api.inventory.parcelZones.create({jwtToken, token, parcelZone: {productId: "6789"}});
20
20
  });
21
21
 
22
22
  it("should update a parcel zone", () => {
23
23
  const parcelZoneId = "1234";
24
- axiosMock.onPut(`/parcel-zone/${parcelZoneId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
25
- return api.inventory.parcelZones.update({ jwtToken, token, parcelZoneId, parcelZone: { productId: "6789" } });
24
+ axiosMock.onPut(`/parcel-zone/${parcelZoneId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
25
+ return api.inventory.parcelZones.update({jwtToken, token, parcelZoneId, parcelZone: {productId: "6789"}});
26
26
  });
27
-
28
- });
27
+ });
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("./../../test-helpers");
4
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
5
 
6
6
  describe("inventory/payment-terminals", () => {
7
7
  const token = "I owe you a token";
@@ -12,7 +12,7 @@ describe("inventory/payment-terminals", () => {
12
12
  });
13
13
 
14
14
  it("should create a payment terminal", () => {
15
- axiosMock.onPost("/payment-terminals").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/payment-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.paymentTerminals.create({
17
17
  jwtToken,
18
18
  token,
@@ -23,7 +23,7 @@ describe("inventory/payment-terminals", () => {
23
23
  });
24
24
 
25
25
  it("should get all payment terminals", () => {
26
- axiosMock.onGet("/payment-terminals").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/payment-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.paymentTerminals.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/payment-terminals", () => {
33
33
 
34
34
  it("should update a payment terminal", () => {
35
35
  const paymentTerminalId = "1234";
36
- axiosMock.onPut(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.paymentTerminals.update({
38
38
  jwtToken,
39
39
  token,
@@ -46,7 +46,7 @@ describe("inventory/payment-terminals", () => {
46
46
 
47
47
  it("should get a payment terminal", () => {
48
48
  const paymentTerminalId = "1234";
49
- axiosMock.onGet(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
49
+ axiosMock.onGet(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
50
  return api.inventory.paymentTerminals.get({
51
51
  jwtToken,
52
52
  token,
@@ -56,7 +56,7 @@ describe("inventory/payment-terminals", () => {
56
56
 
57
57
  it("should delete a payment terminal", () => {
58
58
  const paymentTerminalId = "1234";
59
- axiosMock.onDelete(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
59
+ axiosMock.onDelete(`/payment-terminals/${paymentTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
60
60
  return api.inventory.paymentTerminals.remove({
61
61
  jwtToken,
62
62
  token,
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("../../test-helpers");
4
- const api = require("../../../src/client").createApiClient({baseURL: "http://test.com"});
3
+ } = require("../../test-helpers.js");
4
+ const api = require("../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
5
 
6
6
  describe("inventory/prisma-terminals", () => {
7
7
  const token = "I owe you a token";
@@ -1,41 +1,47 @@
1
- const { axiosMock, expectRequest } = require("./../../test-helpers");
2
- const api = require("./../../../src/client").createApiClient({ baseURL: "http://test.com" });
1
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
2
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
3
3
 
4
- describe('inventory/products', function() {
5
- const token = 'I owe you a token';
6
- const jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/products", () => {
5
+ const token = "I owe you a token";
6
+ const jwtToken = "I owe you a JWT token";
7
7
 
8
- afterEach(function() {
8
+ afterEach(() => {
9
9
  axiosMock.reset();
10
10
  });
11
11
 
12
- it("should list products", function() {
13
- axiosMock.onGet(`/products`).reply(expectRequest({ statusCode: 200, token }));
14
- return api.inventory.products.all({ token });
12
+ it("should list products", () => {
13
+ axiosMock.onGet("/products").reply(expectRequest({statusCode: 200, token}));
14
+ return api.inventory.products.all({token});
15
15
  });
16
16
 
17
- it("should get product by id without jwtToken", function() {
18
- axiosMock.onGet(`/products/1`).reply(expectRequest({ statusCode: 200, token }));
19
- return api.inventory.products.get({ token, productId: 1 });
17
+ it("should list products with type query", () => {
18
+ const query = {type: "ticket"};
19
+ axiosMock.onGet("/products").reply(expectRequest({statusCode: 200, token, query}));
20
+ return api.inventory.products.all({token, query});
20
21
  });
21
22
 
22
- it("should get product by id when called with jwtToken", function() {
23
- axiosMock.onGet(`/products/1`).reply(expectRequest({ statusCode: 200, token, jwtToken, requireJwtTokenOnGet:true }));
24
- return api.inventory.products.get({ token, productId: 1, jwtToken });
23
+ it("should get product by id without jwtToken", () => {
24
+ axiosMock.onGet("/products/1").reply(expectRequest({statusCode: 200, token}));
25
+ return api.inventory.products.get({token, productId: 1});
26
+ });
27
+
28
+ it("should get product by id when called with jwtToken", () => {
29
+ axiosMock.onGet("/products/1").reply(expectRequest({statusCode: 200, token, jwtToken, requireJwtTokenOnGet: true}));
30
+ return api.inventory.products.get({token, productId: 1, jwtToken});
25
31
  });
26
32
 
27
33
  it("should get the product families", () => {
28
- axiosMock.onGet(`/products/families`).reply(expectRequest({ statusCode: 200, token }));
29
- return api.inventory.products.families.all({ token });
34
+ axiosMock.onGet("/products/families").reply(expectRequest({statusCode: 200, token}));
35
+ return api.inventory.products.families.all({token});
30
36
  });
31
37
 
32
- it("should create a product", function() {
38
+ it("should create a product", () => {
33
39
  const data = {name: "Test Product"};
34
40
  axiosMock.onPost("/products").reply(expectRequest({statusCode: 200, token, jwtToken}));
35
41
  return api.inventory.products.create({token, jwtToken, data});
36
42
  });
37
43
 
38
- it("should update a product", function() {
44
+ it("should update a product", () => {
39
45
  const data = {name: "Test Product"};
40
46
  const productId = 1;
41
47
  axiosMock.onPut(`/products/${productId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
@@ -56,5 +62,4 @@ describe('inventory/products', function() {
56
62
  domain
57
63
  });
58
64
  });
59
-
60
65
  });
@@ -1,54 +1,54 @@
1
- const { axiosMock, expectRequest } = require("./../../test-helpers");
2
- const api = require("./../../../src/client").createApiClient({ baseURL: "http://test.com" });
1
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
2
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
3
3
 
4
- describe('inventory/promos', function() {
5
- const token = 'I owe you a token',
6
- promoId = '5a959a4aa7114ffd7f000001',
7
- accountId = '4f74a235b0dffc0210000015',
8
- ruleId = '',
9
- jwtToken = 'I owe you a JWT token',
10
- promo = {
11
- "accountId": "4f74a235b0dffc0210000015",
12
- "internalId": "patchTEST",
13
- "name": "patchTEST"
14
- },
15
- updatePromoData = {
16
- "internalId": "createTESTmod",
17
- "campaign":"patchTEST",
18
- "name":"patchTESTmod",
19
- "disabled": false
20
- },
21
- rule = {
22
- "valueType": "%",
23
- "value": 100
24
- };
4
+ describe("inventory/promos", () => {
5
+ const token = "I owe you a token";
6
+ const promoId = "5a959a4aa7114ffd7f000001";
7
+ const accountId = "4f74a235b0dffc0210000015";
8
+ const ruleId = "";
9
+ const jwtToken = "I owe you a JWT token";
10
+ const promo = {
11
+ "accountId": "4f74a235b0dffc0210000015",
12
+ "internalId": "patchTEST",
13
+ "name": "patchTEST"
14
+ };
15
+ const updatePromoData = {
16
+ "internalId": "createTESTmod",
17
+ "campaign": "patchTEST",
18
+ "name": "patchTESTmod",
19
+ "disabled": false
20
+ };
21
+ const rule = {
22
+ "valueType": "%",
23
+ "value": 100
24
+ };
25
25
 
26
- afterEach(function() {
26
+ afterEach(() => {
27
27
  axiosMock.reset();
28
28
  });
29
29
 
30
- it("should list promos", function() {
31
- axiosMock.onGet(`/promos`).reply(expectRequest({ statusCode: 200, token }));
32
- return api.inventory.promos.all({ token });
30
+ it("should list promos", () => {
31
+ axiosMock.onGet("/promos").reply(expectRequest({statusCode: 200, token}));
32
+ return api.inventory.promos.all({token});
33
33
  });
34
34
 
35
- it("should send jwt token when listing promos", function() {
36
- axiosMock.onGet(`/promos`).reply(expectRequest({
35
+ it("should send jwt token when listing promos", () => {
36
+ axiosMock.onGet("/promos").reply(expectRequest({
37
37
  statusCode: 200,
38
38
  token,
39
39
  jwtToken,
40
40
  requireJwtTokenOnGet: true
41
41
  }));
42
- return api.inventory.promos.all({ token, jwtToken });
42
+ return api.inventory.promos.all({token, jwtToken});
43
43
  });
44
44
 
45
- it("should get single promo", function() {
46
- axiosMock.onGet(`/promos/${promoId}`).reply(expectRequest({ statusCode: 200, token }));
45
+ it("should get single promo", () => {
46
+ axiosMock.onGet(`/promos/${promoId}`).reply(expectRequest({statusCode: 200, token}));
47
47
  const query = {accountId};
48
- return api.inventory.promos.get({ promoId, accountId, token, query });
48
+ return api.inventory.promos.get({promoId, accountId, token, query});
49
49
  });
50
50
 
51
- it("should send jwt token when getting a promo by id", function() {
51
+ it("should send jwt token when getting a promo by id", () => {
52
52
  axiosMock.onGet(`/promos/${promoId}`).reply(expectRequest({
53
53
  statusCode: 200,
54
54
  token,
@@ -56,31 +56,31 @@ describe('inventory/promos', function() {
56
56
  requireJwtTokenOnGet: true
57
57
  }));
58
58
  const query = {accountId};
59
- return api.inventory.promos.get({ promoId, accountId, token, jwtToken, query });
59
+ return api.inventory.promos.get({promoId, accountId, token, jwtToken, query});
60
60
  });
61
61
 
62
- it("should create new promo", function() {
63
- axiosMock.onPost(`/promos`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
64
- return api.inventory.promos.create({ jwtToken, promo, token });
62
+ it("should create new promo", () => {
63
+ axiosMock.onPost("/promos").reply(expectRequest({statusCode: 200, token, jwtToken}));
64
+ return api.inventory.promos.create({jwtToken, promo, token});
65
65
  });
66
66
 
67
- it("should remove promo with given id", function() {
68
- axiosMock.onDelete(`/promos/${promoId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
69
- return api.inventory.promos.remove({ jwtToken, promoId, token });
67
+ it("should remove promo with given id", () => {
68
+ axiosMock.onDelete(`/promos/${promoId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
69
+ return api.inventory.promos.remove({jwtToken, promoId, token});
70
70
  });
71
71
 
72
- it("should update existing promo", function() {
73
- axiosMock.onPatch(`/promos/${promoId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
74
- return api.inventory.promos.update({ token, jwtToken, promoId, updatePromoData });
72
+ it("should update existing promo", () => {
73
+ axiosMock.onPatch(`/promos/${promoId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
74
+ return api.inventory.promos.update({token, jwtToken, promoId, updatePromoData});
75
75
  });
76
76
 
77
- it("should add rule to a promo", function() {
78
- axiosMock.onPost(`/promos/${promoId}/rules`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
79
- return api.inventory.promos.addRule({ token, jwtToken, promoId, updatePromoData });
77
+ it("should add rule to a promo", () => {
78
+ axiosMock.onPost(`/promos/${promoId}/rules`).reply(expectRequest({statusCode: 200, token, jwtToken}));
79
+ return api.inventory.promos.addRule({token, jwtToken, promoId, updatePromoData});
80
80
  });
81
81
 
82
- it("should update a rule", function() {
83
- axiosMock.onPut(`/promos/${promoId}/rules/${ruleId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
84
- return api.inventory.promos.updateRule({ token, jwtToken, promoId, ruleId, rule });
82
+ it("should update a rule", () => {
83
+ axiosMock.onPut(`/promos/${promoId}/rules/${ruleId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
84
+ return api.inventory.promos.updateRule({token, jwtToken, promoId, ruleId, rule});
85
85
  });
86
86
  });
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable import/extensions */
2
- const {axiosMock, expectRequest} = require("./../../test-helpers");
3
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
2
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
3
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
4
4
 
5
5
  describe("inventory/seatclasses", () => {
6
6
  const token = "I owe you a token";
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("./../../test-helpers");
4
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
5
 
6
6
  describe("inventory/seat-fees", () => {
7
7
  const token = "I owe you a token";
@@ -12,7 +12,7 @@ describe("inventory/seat-fees", () => {
12
12
  });
13
13
 
14
14
  it("should create a seatfee", () => {
15
- axiosMock.onPost("/seat-fees").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/seat-fees").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.seatfees.create({
17
17
  jwtToken,
18
18
  token,
@@ -23,7 +23,7 @@ describe("inventory/seat-fees", () => {
23
23
  });
24
24
 
25
25
  it("should get all the seatfees", () => {
26
- axiosMock.onGet("/seat-fees").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/seat-fees").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.seatfees.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/seat-fees", () => {
33
33
 
34
34
  it("should update a seatfee", () => {
35
35
  const seatfeeId = "1234";
36
- axiosMock.onPut(`/seat-fees/${seatfeeId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/seat-fees/${seatfeeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.seatfees.update({
38
38
  jwtToken,
39
39
  token,
@@ -46,7 +46,7 @@ describe("inventory/seat-fees", () => {
46
46
 
47
47
  it("should get a seatfee", () => {
48
48
  const seatfeeId = "1234";
49
- axiosMock.onGet(`/seat-fees/${seatfeeId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
49
+ axiosMock.onGet(`/seat-fees/${seatfeeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
50
  return api.inventory.seatfees.get({
51
51
  jwtToken,
52
52
  token,
@@ -1,6 +1,6 @@
1
- const {axiosMock, expectRequest} = require("./../../test-helpers");
2
- const {expect} = require("chai");
3
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
1
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
2
+ const assert = require("node:assert/strict");
3
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
4
4
 
5
5
  describe("inventory/seatmaps", () => {
6
6
  const token = "I owe you a token";
@@ -41,16 +41,16 @@ describe("inventory/seatmaps", () => {
41
41
  };
42
42
 
43
43
  axiosMock.onGet(`/seatmaps/${seatmapId}/available-seats/${routeId}/${scheduleId}/${manifestDate}`).reply((config) => {
44
- expect(config.params).eql(query);
45
- expect(config.headers["x-api-key"]).eql(token);
44
+ assert.deepStrictEqual(config.params, query);
45
+ assert.deepStrictEqual(config.headers["x-api-key"], token);
46
46
  return [200, response];
47
47
  });
48
48
 
49
49
 
50
50
  return api.inventory.seatmaps.get({seatmapId, routeId, scheduleId, manifestDate, query, token})
51
51
  .then((httpResponse) => {
52
- expect(httpResponse.status).eql(200);
53
- expect(httpResponse.data).eql(response);
52
+ assert.deepStrictEqual(httpResponse.status, 200);
53
+ assert.deepStrictEqual(httpResponse.data, response);
54
54
  });
55
55
  });
56
56
 
@@ -23,7 +23,7 @@ describe("inventory/segments-information", () => {
23
23
  });
24
24
 
25
25
  it("should get all pieces of segment information", () => {
26
- axiosMock.onGet("/segments-information").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/segments-information").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.segmentsInformation.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/segments-information", () => {
33
33
 
34
34
  it("should update a piece of segment information", () => {
35
35
  const segmentInformationId = "1234";
36
- axiosMock.onPut(`/segments-information/${segmentInformationId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/segments-information/${segmentInformationId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.segmentsInformation.update({
38
38
  jwtToken,
39
39
  token,
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("./../../test-helpers");
4
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
5
 
6
6
  describe("inventory/service-numbers", () => {
7
7
  const token = "I owe you a token";
@@ -12,7 +12,7 @@ describe("inventory/service-numbers", () => {
12
12
  });
13
13
 
14
14
  it("should create a service number", () => {
15
- axiosMock.onPost("/service-numbers").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/service-numbers").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.serviceNumbers.create({
17
17
  jwtToken,
18
18
  token,
@@ -24,7 +24,7 @@ describe("inventory/service-numbers", () => {
24
24
  });
25
25
 
26
26
  it("should get all service numbers", () => {
27
- axiosMock.onGet("/service-numbers").reply(expectRequest({statusCode: 200, token, jwtToken }));
27
+ axiosMock.onGet("/service-numbers").reply(expectRequest({statusCode: 200, token, jwtToken}));
28
28
  return api.inventory.serviceNumbers.all({
29
29
  jwtToken,
30
30
  token,
@@ -36,7 +36,7 @@ describe("inventory/service-numbers", () => {
36
36
 
37
37
  it("should update a service number", () => {
38
38
  const serviceNumberId = "1234";
39
- axiosMock.onPut(`/service-numbers/${serviceNumberId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
39
+ axiosMock.onPut(`/service-numbers/${serviceNumberId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
40
40
  return api.inventory.serviceNumbers.update({
41
41
  jwtToken,
42
42
  token,
@@ -50,7 +50,7 @@ describe("inventory/service-numbers", () => {
50
50
 
51
51
  it("should get a service number", () => {
52
52
  const serviceNumberId = "1234";
53
- axiosMock.onGet(`/service-numbers/${serviceNumberId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
53
+ axiosMock.onGet(`/service-numbers/${serviceNumberId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
54
54
  return api.inventory.serviceNumbers.get({
55
55
  jwtToken,
56
56
  token,
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("./../../test-helpers");
4
- const api = require("./../../../src/client").createApiClient({baseURL: "http://test.com"});
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
5
5
 
6
6
  describe("inventory/service-types", () => {
7
7
  const token = "I owe you a token";
@@ -12,7 +12,7 @@ describe("inventory/service-types", () => {
12
12
  });
13
13
 
14
14
  it("should create a service type", () => {
15
- axiosMock.onPost("/service-types").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/service-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.serviceTypes.create({
17
17
  jwtToken,
18
18
  token,
@@ -23,7 +23,7 @@ describe("inventory/service-types", () => {
23
23
  });
24
24
 
25
25
  it("should get all service types", () => {
26
- axiosMock.onGet("/service-types").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/service-types").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.serviceTypes.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/service-types", () => {
33
33
 
34
34
  it("should update a service type", () => {
35
35
  const serviceTypeId = "1234";
36
- axiosMock.onPut(`/service-types/${serviceTypeId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/service-types/${serviceTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.serviceTypes.update({
38
38
  jwtToken,
39
39
  token,
@@ -46,7 +46,7 @@ describe("inventory/service-types", () => {
46
46
 
47
47
  it("should get a service type", () => {
48
48
  const serviceTypeId = "1234";
49
- axiosMock.onGet(`/service-types/${serviceTypeId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
49
+ axiosMock.onGet(`/service-types/${serviceTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
50
  return api.inventory.serviceTypes.get({
51
51
  jwtToken,
52
52
  token,
@@ -56,7 +56,7 @@ describe("inventory/service-types", () => {
56
56
 
57
57
  it("should delete a service type", () => {
58
58
  const serviceTypeId = "1234";
59
- axiosMock.onDelete(`/service-types/${serviceTypeId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
59
+ axiosMock.onDelete(`/service-types/${serviceTypeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
60
60
  return api.inventory.serviceTypes.remove({
61
61
  jwtToken,
62
62
  token,
@@ -23,7 +23,7 @@ describe("accounts/banks", () => {
23
23
  });
24
24
 
25
25
  it("should get all pieces of custom content", () => {
26
- axiosMock.onGet("/banks").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/banks").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.banks.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("accounts/banks", () => {
33
33
 
34
34
  it("should update a piece of custom content", () => {
35
35
  const bankId = "1234";
36
- axiosMock.onPut(`/banks/${bankId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/banks/${bankId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.banks.update({
38
38
  jwtToken,
39
39
  token,
@@ -1,16 +1,15 @@
1
- const { axiosMock, expectRequest } = require("./../../test-helpers");
2
- const api = require("./../../../src/client").createApiClient({ baseURL: "http://test.com" });
1
+ const {axiosMock, expectRequest} = require("./../../test-helpers.js");
2
+ const api = require("./../../../src/client.js").createApiClient({baseURL: "http://test.com"});
3
3
 
4
- describe('inventory/ssrs', function() {
5
- const token = 'I owe you a token';
6
-
7
- afterEach(function() {
4
+ describe("inventory/ssrs", () => {
5
+ const token = "I owe you a token";
6
+
7
+ afterEach(() => {
8
8
  axiosMock.reset();
9
9
  });
10
10
 
11
- it("should list ssrs", function() {
12
- axiosMock.onGet(`/ssrs`).reply(expectRequest({ statusCode: 200, token }));
13
- return api.inventory.ssrs.all({ token });
11
+ it("should list ssrs", () => {
12
+ axiosMock.onGet("/ssrs").reply(expectRequest({statusCode: 200, token}));
13
+ return api.inventory.ssrs.all({token});
14
14
  });
15
-
16
- });
15
+ });