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,18 +1,17 @@
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/bundle-fares', function() {
5
- const token = 'I owe you a token';
4
+ describe("inventory/bundle-fares", () => {
5
+ const token = "I owe you a token";
6
6
 
7
- afterEach(function() {
7
+ afterEach(() => {
8
8
  axiosMock.reset();
9
9
  });
10
10
 
11
- it("should list fares for a bundle", function() {
12
- const bundleId = "bundleId1",
13
- productId = "productId1";
14
- axiosMock.onGet(`/bundle/${bundleId}/product/${productId}`).reply(expectRequest({ statusCode: 200, token }));
15
- return api.inventory.bundleFares.all({ token, bundleId, productId });
11
+ it("should list fares for a bundle", () => {
12
+ const bundleId = "bundleId1";
13
+ const productId = "productId1";
14
+ axiosMock.onGet(`/bundle/${bundleId}/product/${productId}`).reply(expectRequest({statusCode: 200, token}));
15
+ return api.inventory.bundleFares.all({token, bundleId, productId});
16
16
  });
17
-
18
17
  });
@@ -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/bundles', () => {
5
- const token = 'I owe you a token',
6
- jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/bundles", () => {
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 get all bundles", () => {
13
- axiosMock.onGet("/bundles").reply(expectRequest({ statusCode: 200, token, jwtToken }));
13
+ axiosMock.onGet("/bundles").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
14
  return api.inventory.bundles.all({
15
15
  jwtToken,
16
16
  token,
@@ -21,12 +21,12 @@ describe('inventory/bundles', () => {
21
21
  });
22
22
 
23
23
  it("should get a bundle by ID", () => {
24
- const bundleId = "bundleId"
25
- axiosMock.onGet(`/bundles/${bundleId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
24
+ const bundleId = "bundleId";
25
+ axiosMock.onGet(`/bundles/${bundleId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
26
26
  return api.inventory.bundles.get({
27
27
  jwtToken,
28
28
  token,
29
29
  bundleId
30
30
  });
31
31
  });
32
- });
32
+ });
@@ -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/companies', () => {
5
- const token = 'I owe you a token',
6
- jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/companies", () => {
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 get all companies", () => {
13
- axiosMock.onGet(`/companies`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
13
+ axiosMock.onGet("/companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
14
  return api.inventory.companies.all({
15
15
  jwtToken,
16
16
  token,
@@ -12,7 +12,7 @@ describe("inventory/custom-content", () => {
12
12
  });
13
13
 
14
14
  it("should create a custom content", () => {
15
- axiosMock.onPost("/custom-content").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.customContent.create({
17
17
  jwtToken,
18
18
  token,
@@ -23,7 +23,7 @@ describe("inventory/custom-content", () => {
23
23
  });
24
24
 
25
25
  it("should get all pieces of custom content", () => {
26
- axiosMock.onGet("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/custom-content").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.customContent.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/custom-content", () => {
33
33
 
34
34
  it("should update a piece of custom content", () => {
35
35
  const customContentId = "1234";
36
- axiosMock.onPut(`/custom-content/${customContentId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/custom-content/${customContentId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.customContent.update({
38
38
  jwtToken,
39
39
  token,
@@ -46,7 +46,7 @@ describe("inventory/custom-content", () => {
46
46
 
47
47
  it("should get a piece of custom content", () => {
48
48
  const customContentId = "1234";
49
- axiosMock.onGet(`/custom-content/${customContentId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
49
+ axiosMock.onGet(`/custom-content/${customContentId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
50
  return api.inventory.customContent.get({
51
51
  jwtToken,
52
52
  token,
@@ -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/custom-fields", () => {
6
6
  const token = "I owe you a token";
@@ -1,5 +1,5 @@
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
4
  describe("inventory/document-types", () => {
5
5
  const token = "I owe you a token";
@@ -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/fare-classes', () => {
5
- const token = 'I owe you a token',
6
- jwtToken = 'I owe you a JWT token';
4
+ describe("inventory/fare-classes", () => {
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 create a fare class", () => {
13
- axiosMock.onPost(`/fare-classes`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
13
+ axiosMock.onPost("/fare-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
14
  return api.inventory.fareClasses.create({
15
15
  jwtToken,
16
16
  token,
@@ -25,14 +25,14 @@ describe('inventory/fare-classes', () => {
25
25
  lexiconKeys: {
26
26
  name: "fare-class-name-97ba4o9al2837g0w9",
27
27
  description: "fare-class-description-97ba4o9al2837g0w9",
28
- terms: "fare-class-terms-97ba4o9al2837g0w9",
28
+ terms: "fare-class-terms-97ba4o9al2837g0w9"
29
29
  }
30
30
  }
31
31
  });
32
32
  });
33
33
 
34
34
  it("should get all fare classes", () => {
35
- axiosMock.onGet(`/fare-classes`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
35
+ axiosMock.onGet("/fare-classes").reply(expectRequest({statusCode: 200, token, jwtToken}));
36
36
  return api.inventory.fareClasses.all({
37
37
  jwtToken,
38
38
  token,
@@ -44,7 +44,7 @@ describe('inventory/fare-classes', () => {
44
44
 
45
45
  it("should update a fare class", () => {
46
46
  const fareClassId = "5ad7804216b426412c19f06f";
47
- axiosMock.onPatch(`/fare-classes/${fareClassId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
47
+ axiosMock.onPatch(`/fare-classes/${fareClassId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
48
48
 
49
49
  return api.inventory.fareClasses.update({
50
50
  jwtToken,
@@ -61,7 +61,7 @@ describe('inventory/fare-classes', () => {
61
61
  lexiconKeys: {
62
62
  name: "fare-class-name-97ba4o9al2837g0w9",
63
63
  description: "fare-class-description-97ba4o9al2837g0w9",
64
- terms: "fare-class-terms-97ba4o9al2837g0w9",
64
+ terms: "fare-class-terms-97ba4o9al2837g0w9"
65
65
  }
66
66
  }
67
67
  });
@@ -1,28 +1,28 @@
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/fares', function() {
5
- const token = 'I owe you a token';
4
+ describe("inventory/fares", () => {
5
+ const token = "I owe you a token";
6
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 fares", function() {
13
- axiosMock.onGet(`/fares`).reply(expectRequest({ statusCode: 200, token }));
14
- return api.inventory.fares.all({ token });
12
+ it("should list fares", () => {
13
+ axiosMock.onGet("/fares").reply(expectRequest({statusCode: 200, token}));
14
+ return api.inventory.fares.all({token});
15
15
  });
16
16
 
17
- it("should get a fare by id", function() {
17
+ it("should get a fare by id", () => {
18
18
  const id = "fareId1";
19
- axiosMock.onGet(`/fare/${id}`).reply(expectRequest({ statusCode: 200, token }));
20
- return api.inventory.fares.get({ token, id });
19
+ axiosMock.onGet(`/fare/${id}`).reply(expectRequest({statusCode: 200, token}));
20
+ return api.inventory.fares.get({token, id});
21
21
  });
22
22
 
23
23
  it("should create a fare", () => {
24
24
  const fare = {
25
- name: "newFare",
25
+ name: "newFare"
26
26
  };
27
27
 
28
28
  axiosMock.onPost("/fares").reply(expectRequest({statusCode: 200, token, jwtToken}));
@@ -36,7 +36,7 @@ describe('inventory/fares', function() {
36
36
  it("should update a fare", () => {
37
37
  const fareId = "123123123123";
38
38
  const fare = {
39
- name: "newFare",
39
+ name: "newFare"
40
40
  };
41
41
  axiosMock.onPut(`/fare/${fareId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
42
42
  return api.inventory.fares.update({jwtToken, token, fareId, fare});
@@ -45,7 +45,7 @@ describe('inventory/fares', function() {
45
45
  it("should create an adjustment", () => {
46
46
  const fareId = "123123123123";
47
47
  const adjustmentsOverride = {
48
- name: "newAdjustment",
48
+ name: "newAdjustment"
49
49
  };
50
50
 
51
51
  axiosMock.onPost(`/fares/${fareId}/adjustments-overrides`).reply(expectRequest({statusCode: 200, token, jwtToken}));
@@ -69,6 +69,4 @@ describe('inventory/fares', function() {
69
69
  adjustmentId
70
70
  });
71
71
  });
72
-
73
-
74
72
  });
@@ -1,23 +1,23 @@
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/fees', function() {
4
+ describe("inventory/fees", () => {
5
5
  const token = "I owe you a token";
6
6
  const jwtToken = "I owe you a JWT token";
7
-
8
- afterEach(function() {
7
+
8
+ afterEach(() => {
9
9
  axiosMock.reset();
10
10
  });
11
11
 
12
- it("should list fees", function() {
13
- axiosMock.onGet(`/fees`).reply(expectRequest({ statusCode: 200, token }));
14
- return api.inventory.fees.all({ token });
12
+ it("should list fees", () => {
13
+ axiosMock.onGet("/fees").reply(expectRequest({statusCode: 200, token}));
14
+ return api.inventory.fees.all({token});
15
15
  });
16
16
 
17
- it("should get a fee by id", function() {
17
+ it("should get a fee by id", () => {
18
18
  const feeId = "feeId1";
19
- axiosMock.onGet(`/fees/${feeId}`).reply(expectRequest({ statusCode: 200, token }));
20
- return api.inventory.fees.get({ token, feeId });
19
+ axiosMock.onGet(`/fees/${feeId}`).reply(expectRequest({statusCode: 200, token}));
20
+ return api.inventory.fees.get({token, feeId});
21
21
  });
22
22
 
23
23
  it("should create a fee", () => {
@@ -26,7 +26,7 @@ describe('inventory/fees', function() {
26
26
  jwtToken,
27
27
  token,
28
28
  data: {
29
- name: "fee",
29
+ name: "fee"
30
30
  }
31
31
  });
32
32
  });
@@ -34,10 +34,9 @@ describe('inventory/fees', function() {
34
34
  it("should update a fee", () => {
35
35
  const feeId = "123123123123";
36
36
  const data = {
37
- name: "newFee",
37
+ name: "newFee"
38
38
  };
39
39
  axiosMock.onPut(`/fees/${feeId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
40
40
  return api.inventory.fees.update({jwtToken, token, feeId, data});
41
41
  });
42
-
43
- });
42
+ });
@@ -1,15 +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/v2/filtered-trips", function () {
4
+ describe("inventory/v2/filtered-trips", () => {
5
5
  const token = "I owe you a token";
6
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 create a filtered trip", function () {
12
+ it("should create a filtered trip", () => {
13
13
  axiosMock.onPost("/v2/filtered-trips").reply(expectRequest({statusCode: 200, token, jwtToken}));
14
14
  return api.inventory.filteredTripsV2.create({token, jwtToken, filteredTrip: {someProperty: "some value"}});
15
15
  });
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("./../../test-helpers");
4
- const api = require("./../../../src/client").createApiClient({
3
+ } = require("./../../test-helpers.js");
4
+ const api = require("./../../../src/client.js").createApiClient({
5
5
  baseURL: "http://test.com"
6
6
  });
7
7
 
@@ -1,7 +1,7 @@
1
1
  const {
2
2
  axiosMock, expectRequest
3
- } = require("../../test-helpers");
4
- const api = require("../../../src/client").createApiClient({
3
+ } = require("../../test-helpers.js");
4
+ const api = require("../../../src/client.js").createApiClient({
5
5
  baseURL: "http://test.com"
6
6
  });
7
7
 
@@ -1,17 +1,17 @@
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
4
 
5
- describe('inventory/journey-prices', () => {
6
- const token = 'I owe you a token',
7
- jwtToken = 'I owe you a JWT token';
5
+ describe("inventory/journey-prices", () => {
6
+ const token = "I owe you a token";
7
+ const jwtToken = "I owe you a JWT token";
8
8
 
9
9
  afterEach(() => {
10
10
  axiosMock.reset();
11
11
  });
12
12
 
13
13
  it("should get all journey prices that match the provided query", () => {
14
- axiosMock.onGet(`/journey-prices`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
14
+ axiosMock.onGet("/journey-prices").reply(expectRequest({statusCode: 200, token, jwtToken}));
15
15
  return api.inventory.journeyPrices.all({
16
16
  jwtToken,
17
17
  token,
@@ -32,7 +32,7 @@ describe('inventory/journey-prices', () => {
32
32
 
33
33
  it("should delete the journey price with the specified ID", () => {
34
34
  const id = "1234567890";
35
- axiosMock.onDelete(`/journey-prices/${id}`).reply(expectRequest({ statusCode: 204, token, jwtToken }));
35
+ axiosMock.onDelete(`/journey-prices/${id}`).reply(expectRequest({statusCode: 204, token, jwtToken}));
36
36
  return api.inventory.journeyPrices.deleteById({
37
37
  jwtToken,
38
38
  token,
@@ -42,14 +42,14 @@ describe('inventory/journey-prices', () => {
42
42
 
43
43
 
44
44
  it("should create a Journey Pricing rule", () => {
45
- axiosMock.onPost(`/journey-prices`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
45
+ axiosMock.onPost("/journey-prices").reply(expectRequest({statusCode: 200, token, jwtToken}));
46
46
  return api.inventory.journeyPrices.create({
47
47
  jwtToken,
48
48
  token,
49
49
  journeyPrice: {
50
- price: '75000000',
51
- originId: '112312-123123-121321-13123',
52
- destinationId: '112312-123123-121321-13123'
50
+ price: "75000000",
51
+ originId: "112312-123123-121321-13123",
52
+ destinationId: "112312-123123-121321-13123"
53
53
 
54
54
  }
55
55
  });
@@ -57,17 +57,15 @@ describe('inventory/journey-prices', () => {
57
57
 
58
58
  it("should update a Journey Pricing rule", () => {
59
59
  const journeyPriceId = "5ad7804216b426412c19f06f";
60
- axiosMock.onPatch(`/journey-prices/${journeyPriceId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
60
+ axiosMock.onPatch(`/journey-prices/${journeyPriceId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
61
61
 
62
62
  return api.inventory.journeyPrices.update({
63
63
  jwtToken,
64
64
  token,
65
65
  journeyPriceId,
66
66
  "journeyPrice": {
67
- "price": "englishName",
67
+ "price": "englishName"
68
68
  }
69
69
  });
70
70
  });
71
-
72
-
73
71
  });
@@ -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/labels", () => {
7
7
  const token = "I owe you a token";
@@ -1,5 +1,5 @@
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
4
  describe("inventory/marital-status", () => {
5
5
  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/mit-terminals-settings", () => {
7
7
  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/mit-terminals", () => {
7
7
  const token = "I owe you a token";
@@ -12,7 +12,7 @@ describe("inventory/mit-terminals", () => {
12
12
  });
13
13
 
14
14
  it("should create a MIT terminal", () => {
15
- axiosMock.onPost("/mit-terminals").reply(expectRequest({ statusCode: 200, token, jwtToken }));
15
+ axiosMock.onPost("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
16
16
  return api.inventory.mitTerminals.create({
17
17
  jwtToken,
18
18
  token,
@@ -23,7 +23,7 @@ describe("inventory/mit-terminals", () => {
23
23
  });
24
24
 
25
25
  it("should get all MIT terminals", () => {
26
- axiosMock.onGet("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/mit-terminals").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.mitTerminals.all({
28
28
  jwtToken,
29
29
  token,
@@ -33,7 +33,7 @@ describe("inventory/mit-terminals", () => {
33
33
 
34
34
  it("should update a MIT terminal", () => {
35
35
  const mitTerminalId = "1234";
36
- axiosMock.onPut(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
36
+ axiosMock.onPut(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
37
37
  return api.inventory.mitTerminals.update({
38
38
  jwtToken,
39
39
  token,
@@ -46,7 +46,7 @@ describe("inventory/mit-terminals", () => {
46
46
 
47
47
  it("should get a MIT terminal", () => {
48
48
  const mitTerminalId = "1234";
49
- axiosMock.onGet(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
49
+ axiosMock.onGet(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
50
50
  return api.inventory.mitTerminals.get({
51
51
  jwtToken,
52
52
  token,
@@ -56,7 +56,7 @@ describe("inventory/mit-terminals", () => {
56
56
 
57
57
  it("should delete a MIT terminal", () => {
58
58
  const mitTerminalId = "1234";
59
- axiosMock.onDelete(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
59
+ axiosMock.onDelete(`/mit-terminals/${mitTerminalId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
60
60
  return api.inventory.mitTerminals.remove({
61
61
  jwtToken,
62
62
  token,
@@ -1,17 +1,17 @@
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
- describe('inventory/operating-companies', () => {
6
- const token = 'I owe you a token',
7
- jwtToken = 'I owe you a JWT token';
5
+ describe("inventory/operating-companies", () => {
6
+ const token = "I owe you a token";
7
+ const jwtToken = "I owe you a JWT token";
8
8
 
9
9
  afterEach(() => {
10
10
  axiosMock.reset();
11
11
  });
12
12
 
13
13
  it("should create an operatingCompany", () => {
14
- axiosMock.onPost(`/operating-companies`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
14
+ axiosMock.onPost("/operating-companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
15
15
  return api.inventory.operatingCompanies.create({
16
16
  jwtToken,
17
17
  token,
@@ -23,7 +23,7 @@ describe('inventory/operating-companies', () => {
23
23
  });
24
24
 
25
25
  it("should get all operatingCompanies", () => {
26
- axiosMock.onGet(`/operating-companies`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
26
+ axiosMock.onGet("/operating-companies").reply(expectRequest({statusCode: 200, token, jwtToken}));
27
27
  return api.inventory.operatingCompanies.all({
28
28
  jwtToken,
29
29
  token,
@@ -35,7 +35,7 @@ describe('inventory/operating-companies', () => {
35
35
 
36
36
  it("should update an operatingCompany", () => {
37
37
  const operatingCompanyId = "1234";
38
- axiosMock.onPut(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
38
+ axiosMock.onPut(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
39
39
  return api.inventory.operatingCompanies.update({
40
40
  jwtToken,
41
41
  token,
@@ -49,7 +49,7 @@ describe('inventory/operating-companies', () => {
49
49
 
50
50
  it("should get an operatingCompany", () => {
51
51
  const operatingCompanyId = "1234";
52
- axiosMock.onGet(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({ statusCode: 200, token, jwtToken }));
52
+ axiosMock.onGet(`/operating-companies/${operatingCompanyId}`).reply(expectRequest({statusCode: 200, token, jwtToken}));
53
53
  return api.inventory.operatingCompanies.get({
54
54
  jwtToken,
55
55
  token,
@@ -68,7 +68,7 @@ describe('inventory/operating-companies', () => {
68
68
  operatingCompanyId,
69
69
  sequence: operatingCompanySequenceData
70
70
  }).then((httpResponse) => {
71
- expect(httpResponse.status).eql(200);
71
+ assert.deepStrictEqual(httpResponse.status, 200);
72
72
  });
73
73
  });
74
74
 
@@ -80,7 +80,7 @@ describe('inventory/operating-companies', () => {
80
80
  token,
81
81
  operatingCompanyId
82
82
  }).then((httpResponse) => {
83
- expect(httpResponse.status).eql(200);
83
+ assert.deepStrictEqual(httpResponse.status, 200);
84
84
  });
85
85
  });
86
86
 
@@ -95,7 +95,7 @@ describe('inventory/operating-companies', () => {
95
95
  operatingCompanyId,
96
96
  sequenceId
97
97
  }).then((httpResponse) => {
98
- expect(httpResponse.status).eql(200);
98
+ assert.deepStrictEqual(httpResponse.status, 200);
99
99
  });
100
100
  });
101
101
 
@@ -112,7 +112,7 @@ describe('inventory/operating-companies', () => {
112
112
  sequenceId,
113
113
  sequence: operatingCompanySequenceData
114
114
  }).then((httpResponse) => {
115
- expect(httpResponse.status).eql(200);
115
+ assert.deepStrictEqual(httpResponse.status, 200);
116
116
  });
117
117
  });
118
118
  });