btrz-api-client 8.65.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 (241) 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/operations/movements.js +7 -2
  18. package/lib/endpoints/operations/pago-express.js +9 -3
  19. package/lib/endpoints/operations/parcels.js +3 -1
  20. package/lib/endpoints/sales/cancellations.js +31 -8
  21. package/package.json +6 -8
  22. package/src/client.js +0 -1
  23. package/src/endpoints/accounts/journey-prices-settings.js +2 -2
  24. package/src/endpoints/accounts/market-pricing-settings.js +3 -3
  25. package/src/endpoints/accounts/multiproduct-sales-settings.js +6 -2
  26. package/src/endpoints/accounts/operation-settings.js +3 -1
  27. package/src/endpoints/btrzpay/referenced-payments.js +6 -2
  28. package/src/endpoints/btrzpay/square.js +12 -3
  29. package/src/endpoints/btrzpay/stripe-terminals.js +9 -3
  30. package/src/endpoints/btrzpay/terminalPayments.js +14 -4
  31. package/src/endpoints/inventory/document-types.js +2 -1
  32. package/src/endpoints/inventory/products.js +1 -0
  33. package/src/endpoints/operations/movements.js +7 -2
  34. package/src/endpoints/operations/pago-express.js +9 -3
  35. package/src/endpoints/operations/parcels.js +3 -1
  36. package/src/endpoints/sales/cancellations.js +31 -8
  37. package/test/all.test.js +218 -0
  38. package/test/client.test.js +58 -44
  39. package/test/endpoints/accounts/application-settings.test.js +2 -2
  40. package/test/endpoints/accounts/applications.test.js +2 -2
  41. package/test/endpoints/accounts/current-shifts.test.js +2 -2
  42. package/test/endpoints/accounts/customers.js +17 -17
  43. package/test/endpoints/accounts/domains.test.js +6 -8
  44. package/test/endpoints/accounts/exchange-rates.test.js +3 -3
  45. package/test/endpoints/accounts/exchange-receipts.test.js +3 -3
  46. package/test/endpoints/accounts/images.test.js +2 -2
  47. package/test/endpoints/accounts/interline.test.js +10 -12
  48. package/test/endpoints/accounts/network.test.js +3 -5
  49. package/test/endpoints/accounts/people-lookups.test.js +13 -13
  50. package/test/endpoints/accounts/print-templates.test.js +3 -3
  51. package/test/endpoints/accounts/printers.test.js +2 -2
  52. package/test/endpoints/accounts/tokens.js +2 -2
  53. package/test/endpoints/accounts/trusted-machines.test.js +2 -2
  54. package/test/endpoints/accounts/websales-config.test.js +47 -50
  55. package/test/endpoints/btrzpay/carpointe.tests.js +2 -2
  56. package/test/endpoints/btrzpay/datalogicPayments.tests.js +2 -2
  57. package/test/endpoints/btrzpay/datalogicReferenceNumber.tests.js +2 -2
  58. package/test/endpoints/btrzpay/oxxoPayments.tests.js +2 -2
  59. package/test/endpoints/btrzpay/oxxoToken.tests.js +2 -2
  60. package/test/endpoints/btrzpay/payment-methods.test.js +3 -3
  61. package/test/endpoints/btrzpay/payments.tests.js +6 -6
  62. package/test/endpoints/btrzpay/reference-numbers.test.js +5 -5
  63. package/test/endpoints/btrzpay/referenced-payments.test.js +2 -2
  64. package/test/endpoints/btrzpay/square.tests.js +2 -2
  65. package/test/endpoints/btrzpay/terminalPayments.tests.js +2 -2
  66. package/test/endpoints/endpoints_helpers.test.js +28 -24
  67. package/test/endpoints/inventory/amenities.test.js +20 -20
  68. package/test/endpoints/inventory/amenity-groups.test.js +15 -15
  69. package/test/endpoints/inventory/bare-routes.test.js +2 -2
  70. package/test/endpoints/inventory/brands.test.js +9 -9
  71. package/test/endpoints/inventory/bundle-fares.test.js +10 -11
  72. package/test/endpoints/inventory/bundles.test.js +9 -9
  73. package/test/endpoints/inventory/companies.test.js +6 -6
  74. package/test/endpoints/inventory/custom-content.test.js +4 -4
  75. package/test/endpoints/inventory/custom-fields.test.js +2 -2
  76. package/test/endpoints/inventory/document-types.test.js +2 -2
  77. package/test/endpoints/inventory/fare-classes.test.js +10 -10
  78. package/test/endpoints/inventory/fares.test.js +14 -16
  79. package/test/endpoints/inventory/fees.test.js +14 -15
  80. package/test/endpoints/inventory/filtered-trips-v2.test.js +5 -5
  81. package/test/endpoints/inventory/insurances.test.js +2 -2
  82. package/test/endpoints/inventory/insurancesCost.test.js +2 -2
  83. package/test/endpoints/inventory/journey-prices.test.js +13 -15
  84. package/test/endpoints/inventory/labels.test.js +2 -2
  85. package/test/endpoints/inventory/marital-status.test.js +2 -2
  86. package/test/endpoints/inventory/mit-terminal-settings.test.js +2 -2
  87. package/test/endpoints/inventory/mit-terminals.test.js +7 -7
  88. package/test/endpoints/inventory/operating-companies.test.js +14 -14
  89. package/test/endpoints/inventory/operation-messages.test.js +10 -10
  90. package/test/endpoints/inventory/parcel-zones.test.js +12 -13
  91. package/test/endpoints/inventory/payment-terminals.test.js +7 -7
  92. package/test/endpoints/inventory/prisma-terminals.test.js +2 -2
  93. package/test/endpoints/inventory/products.test.js +25 -20
  94. package/test/endpoints/inventory/promos.test.js +50 -50
  95. package/test/endpoints/inventory/seatclasses.test.js +2 -2
  96. package/test/endpoints/inventory/seatfees.test.js +6 -6
  97. package/test/endpoints/inventory/seatmaps.test.js +7 -7
  98. package/test/endpoints/inventory/segments-information.test.js +2 -2
  99. package/test/endpoints/inventory/service-numbers.test.js +6 -6
  100. package/test/endpoints/inventory/service-types.test.js +7 -7
  101. package/test/endpoints/inventory/shift-settings.test.js +2 -2
  102. package/test/endpoints/inventory/ssrs.test.js +10 -11
  103. package/test/endpoints/inventory/stations-zones.test.js +8 -9
  104. package/test/endpoints/inventory/stations.test.js +2 -2
  105. package/test/endpoints/inventory/travel-routes.test.js +2 -2
  106. package/test/endpoints/inventory/traveller-car-types.test.js +8 -8
  107. package/test/endpoints/inventory/traveller-card-providers-types.test.js +2 -2
  108. package/test/endpoints/inventory/traveller-card-providers.test.js +7 -7
  109. package/test/endpoints/inventory/vehicles.test.js +2 -2
  110. package/test/endpoints/inventory/zone-price-overages.test.js +2 -2
  111. package/test/endpoints/inventory/zone-prices.test.js +2 -2
  112. package/test/endpoints/invoices/dlink.test.js +2 -2
  113. package/test/endpoints/invoices/gti.test.js +2 -2
  114. package/test/endpoints/invoices/infile.test.js +2 -2
  115. package/test/endpoints/invoices/infileJson.test.js +2 -2
  116. package/test/endpoints/invoices/providers.test.js +4 -4
  117. package/test/endpoints/invoices/providersSequences.test.js +2 -2
  118. package/test/endpoints/invoices/system.test.js +2 -2
  119. package/test/endpoints/loyalty/movements.test.js +11 -11
  120. package/test/endpoints/loyalty/programs.test.js +21 -21
  121. package/test/endpoints/notifications/customers.test.js +6 -6
  122. package/test/endpoints/notifications/external-customers.test.js +10 -10
  123. package/test/endpoints/notifications/manifet-notifications.test.js +3 -3
  124. package/test/endpoints/notifications/notify.test.js +5 -5
  125. package/test/endpoints/notifications/orders-rules-validations.test.js +5 -6
  126. package/test/endpoints/notifications/pdfs.test.js +4 -4
  127. package/test/endpoints/notifications/printed-tickets.test.js +17 -18
  128. package/test/endpoints/notifications/short-urls.test.js +9 -9
  129. package/test/endpoints/operations/applied_insurance.test.js +10 -14
  130. package/test/endpoints/operations/calendar_entries.test.js +8 -9
  131. package/test/endpoints/operations/cancellation_settings.test.js +2 -2
  132. package/test/endpoints/operations/loans.test.js +2 -2
  133. package/test/endpoints/operations/manifest.test.js +11 -9
  134. package/test/endpoints/operations/operations.test.js +42 -25
  135. package/test/endpoints/operations/parcel_manifests.test.js +3 -3
  136. package/test/endpoints/operations/parcels.test.js +27 -22
  137. package/test/endpoints/operations/passenger_check_in_info.test.js +2 -2
  138. package/test/endpoints/operations/redemption.test.js +2 -2
  139. package/test/endpoints/operations/sold-items-fulfillment.test.js +2 -2
  140. package/test/endpoints/operations/sold_items.test.js +3 -3
  141. package/test/endpoints/operations/tickets.test.js +4 -4
  142. package/test/endpoints/operations/transaction.test.js +12 -15
  143. package/test/endpoints/operations/transactions.test.js +11 -11
  144. package/test/endpoints/operations/transport_regulations.js +2 -4
  145. package/test/endpoints/operations/trip_change_info.test.js +9 -10
  146. package/test/endpoints/operations/vehicle-assignments.test.js +5 -7
  147. package/test/endpoints/operations/waitlists.test.js +3 -3
  148. package/test/endpoints/ratality/auth.test.js +5 -5
  149. package/test/endpoints/ratality/client.test.js +4 -4
  150. package/test/endpoints/ratality/integrations.test.js +15 -9
  151. package/test/endpoints/reports/custom-reports.test.js +12 -12
  152. package/test/endpoints/reports/email.test.js +3 -3
  153. package/test/endpoints/reports/report-types.test.js +6 -6
  154. package/test/endpoints/reports/trip-manifests.test.js +5 -6
  155. package/test/endpoints/sales/bundles.test.js +9 -10
  156. package/test/endpoints/sales/cart-promo.test.js +15 -16
  157. package/test/endpoints/sales/cart.test.js +7 -7
  158. package/test/endpoints/sales/check-in-info.test.js +3 -3
  159. package/test/endpoints/sales/custom-fields.test.js +10 -13
  160. package/test/endpoints/sales/flexpasses.test.js +2 -2
  161. package/test/endpoints/sales/git-certificates.test.js +10 -13
  162. package/test/endpoints/sales/order.test.js +19 -21
  163. package/test/endpoints/sales/payment-providers.test.js +14 -15
  164. package/test/endpoints/sales/redeemable-items.test.js +14 -15
  165. package/test/endpoints/sales/sync-entry.test.js +9 -11
  166. package/test/endpoints/sales/voucher.test.js +19 -17
  167. package/test/endpoints/seatmaps/access-ticket.test.js +6 -6
  168. package/test/endpoints/seatmaps/seat.test.js +6 -6
  169. package/test/endpoints/uploads/files.test.js +8 -7
  170. package/test/endpoints/uploads/images.test.js +8 -7
  171. package/test/endpoints/webhooks/subscriptions.test.js +27 -27
  172. package/test/endpoints/webhooks/undelivered.test.js +22 -22
  173. package/test/endpoints/webhooks/webhooks.test.js +7 -7
  174. package/test/node-test-globals.js +19 -0
  175. package/test/test-helpers.js +4 -4
  176. package/test-integration/all.test.js +63 -0
  177. package/test-integration/endpoints/accounts/current-shifts.test.js +4 -4
  178. package/test-integration/endpoints/accounts/docs.test.js +6 -6
  179. package/test-integration/endpoints/accounts/lexicons.test.js +42 -37
  180. package/test-integration/endpoints/accounts/shifts.test.js +5 -8
  181. package/test-integration/endpoints/accounts/users.test.js +4 -4
  182. package/test-integration/endpoints/btrzpay/customerCards.test.js +24 -48
  183. package/test-integration/endpoints/btrzpay/customers.test.js +20 -34
  184. package/test-integration/endpoints/btrzpay/payment-methods.test.js +34 -34
  185. package/test-integration/endpoints/btrzpay/payments.test.js +21 -21
  186. package/test-integration/endpoints/btrzpay/reference-numbers.test.js +15 -15
  187. package/test-integration/endpoints/btrzpay/referenced-payments.test.js +5 -5
  188. package/test-integration/endpoints/client.test.js +6 -10
  189. package/test-integration/endpoints/inventory/amenities.test.js +34 -34
  190. package/test-integration/endpoints/inventory/amenity-groups.test.js +30 -31
  191. package/test-integration/endpoints/inventory/bundle-fares.test.js +10 -12
  192. package/test-integration/endpoints/inventory/companies.test.js +7 -8
  193. package/test-integration/endpoints/inventory/countries.test.js +10 -12
  194. package/test-integration/endpoints/inventory/custom-fields.test.js +2 -2
  195. package/test-integration/endpoints/inventory/docs.test.js +5 -7
  196. package/test-integration/endpoints/inventory/fare-classes.test.js +12 -13
  197. package/test-integration/endpoints/inventory/fares.test.js +7 -9
  198. package/test-integration/endpoints/inventory/fees.test.js +8 -10
  199. package/test-integration/endpoints/inventory/filtered-trips.test.js +15 -12
  200. package/test-integration/endpoints/inventory/gift-certificate-definitions.test.js +5 -5
  201. package/test-integration/endpoints/inventory/insurances.test.js +36 -34
  202. package/test-integration/endpoints/inventory/items.js +10 -12
  203. package/test-integration/endpoints/inventory/journey-prices.test.js +11 -11
  204. package/test-integration/endpoints/inventory/parcel-zones.test.js +15 -18
  205. package/test-integration/endpoints/inventory/products.test.js +12 -14
  206. package/test-integration/endpoints/inventory/promos.test.js +46 -42
  207. package/test-integration/endpoints/inventory/routes.test.js +13 -15
  208. package/test-integration/endpoints/inventory/schedule-groups.test.js +23 -23
  209. package/test-integration/endpoints/inventory/ssrs.test.js +16 -11
  210. package/test-integration/endpoints/inventory/stations-zones.test.js +5 -6
  211. package/test-integration/endpoints/inventory/stations.test.js +17 -20
  212. package/test-integration/endpoints/inventory/trips.test.js +30 -16
  213. package/test-integration/endpoints/notifications/printed-tickets.test.js +2 -2
  214. package/test-integration/endpoints/operations/applied_insurance.test.js +9 -11
  215. package/test-integration/endpoints/operations/manifest.test.js +32 -34
  216. package/test-integration/endpoints/operations/parcel.test.js +36 -38
  217. package/test-integration/endpoints/operations/redemption.test.js +9 -12
  218. package/test-integration/endpoints/operations/segments.js +8 -10
  219. package/test-integration/endpoints/operations/tickets.test.js +11 -11
  220. package/test-integration/endpoints/operations/transaction.test.js +1 -1
  221. package/test-integration/endpoints/operations/transactions.test.js +2 -2
  222. package/test-integration/endpoints/operations/trip_change_info.test.js +11 -13
  223. package/test-integration/endpoints/reports/custom-reports.test.js +21 -21
  224. package/test-integration/endpoints/reports/report-types.test.js +22 -22
  225. package/test-integration/endpoints/sales/bundles.test.js +5 -5
  226. package/test-integration/endpoints/sales/cart-promo.test.js +17 -32
  227. package/test-integration/endpoints/sales/cart.test.js +45 -51
  228. package/test-integration/endpoints/sales/check-in-info.test.js +2 -2
  229. package/test-integration/endpoints/sales/custom-fields.test.js +8 -10
  230. package/test-integration/endpoints/sales/flexpasses.test.js +2 -2
  231. package/test-integration/endpoints/sales/gift-certificates.test.js +14 -18
  232. package/test-integration/endpoints/sales/order.test.js +42 -50
  233. package/test-integration/endpoints/sales/payment-providers.test.js +7 -9
  234. package/test-integration/endpoints/sales/redeemable-items.test.js +17 -19
  235. package/test-integration/endpoints/sales/voucher.test.js +12 -14
  236. package/test-integration/endpoints/seatmaps/access-ticket.test.js +7 -9
  237. package/test-integration/endpoints/seatmaps/seat.test.js +7 -9
  238. package/test-integration/endpoints/uploads/files.test.js +14 -14
  239. package/test-integration/endpoints/uploads/images.test.js +3 -5
  240. package/test-integration/ports.js +4 -4
  241. package/test-integration/test-integration-helpers.js +13 -9
@@ -1,24 +1,22 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
- describe("inventory/items", function() {
14
-
15
- it("should list items", function() {
16
- return api.inventory.items.all({ token, query: { isParcel: true } })
17
- .then(matchHeaders('x-api-key'))
13
+ describe("inventory/items", () => {
14
+ it("should list items", () => {
15
+ return api.inventory.items.all({token, query: {isParcel: true}})
16
+ .then(matchHeaders("x-api-key"))
18
17
  .then(statusCode(200))
19
18
  .then((response) => {
20
19
  console.log(response.data.items);
21
- })
20
+ });
22
21
  });
23
-
24
- });
22
+ });
@@ -1,4 +1,4 @@
1
- const { expect } = require("chai");
1
+ const assert = require("node:assert/strict");
2
2
 
3
3
  const port = process.env.INVENTORY_API_PORT;
4
4
  const token = process.env.API_TOKEN;
@@ -6,10 +6,10 @@ const jwtToken = process.env.JWT_TOKEN;
6
6
  const accountId = process.env.ACCOUNT_ID;
7
7
  const journeyPriceId = process.env.JOURNEY_PRICE_ID;
8
8
 
9
- const api = require("./../../../src/client").createApiClient({
9
+ const api = require("./../../../src/client.js").createApiClient({
10
10
  baseURL: `http://localhost:${port}`,
11
11
  baseURLOverride: {
12
- inventory: (baseUrl) => `${baseUrl}/inventory`
12
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
13
13
  }
14
14
  });
15
15
 
@@ -18,25 +18,25 @@ describe("inventory/journey-prices", () => {
18
18
  it("should get all journey prices that match the provided query", () => {
19
19
  return api.inventory.journeyPrices.all({token, jwtToken, query: {providerIds: accountId}})
20
20
  .then(({status, data}) => {
21
- expect(status).to.eql(200);
22
- expect(data.journeyPrices).to.be.an.instanceOf(Array);
21
+ assert.deepStrictEqual(status, 200);
22
+ assert.ok(Array.isArray(data.journeyPrices));
23
23
  });
24
24
  });
25
25
 
26
26
  it("should get journey price by id", () => {
27
27
  return api.inventory.journeyPrices.get({id: journeyPriceId, token, jwtToken})
28
28
  .then(({status, data}) => {
29
- expect(status).to.eql(200);
30
- expect(data.journeyPrices).to.be.an.instanceOf(Array);
31
- expect(data.journeyPrices[0].id).to.eql(journeyPriceId);
29
+ assert.deepStrictEqual(status, 200);
30
+ assert.ok(Array.isArray(data.journeyPrices));
31
+ assert.deepStrictEqual(data.journeyPrices[0].id, journeyPriceId);
32
32
  });
33
33
  });
34
34
 
35
35
 
36
36
  it("should delete the journey price with the specified ID", () => {
37
37
  return api.inventory.journeyPrices.deleteById({token, jwtToken, id: journeyPriceId})
38
- .then(({status, data}) => {
39
- expect(status).to.eql(204);
38
+ .then(({status}) => {
39
+ assert.deepStrictEqual(status, 204);
40
40
  });
41
41
  });
42
- });
42
+ });
@@ -1,53 +1,50 @@
1
- const { expect } = require("chai");
2
1
 
3
2
  const port = process.env.INVENTORY_API_PORT;
4
3
  const token = process.env.API_TOKEN;
5
4
  const jwtToken = process.env.JWT_TOKEN;
6
5
 
7
- const api = require("./../../../src/client").createApiClient({
8
- baseURL: `http://localhost:${port}`,
6
+ const api = require("./../../../src/client.js").createApiClient({
7
+ baseURL: `http://localhost:${port}`,
9
8
  baseURLOverride: {
10
- inventory: (baseUrl) => `${baseUrl}/inventory`
9
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
11
10
  }
12
11
  });
13
12
 
14
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
13
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
15
14
 
16
15
  describe("inventory/parcel-zones", () => {
17
-
18
16
  it("should list parcel zones", () => {
19
- return api.inventory.parcelZones.all({ token })
20
- .then(matchHeaders('x-api-key'))
21
- .then(statusCode(200))
17
+ return api.inventory.parcelZones.all({token})
18
+ .then(matchHeaders("x-api-key"))
19
+ .then(statusCode(200));
22
20
  });
23
21
 
24
22
  it("should create parcel zones", () => {
25
- return api.inventory.products.all({ token, query: { isParcel: true } }).then((res) => {
23
+ return api.inventory.products.all({token, query: {isParcel: true}}).then((res) => {
26
24
  const payload = {
27
- productId: res.data.products[0]._id,
25
+ productId: res.data.products[0]._id,
28
26
  provinces: ["Quebec"],
29
27
  buckets: []
30
28
  };
31
- return api.inventory.parcelZones.create({ token, jwtToken, parcelZone: payload });
29
+ return api.inventory.parcelZones.create({token, jwtToken, parcelZone: payload});
32
30
  });
33
31
  });
34
32
 
35
33
  it("should update a parcel zone", () => {
36
- return api.inventory.products.all({ token, query: { isParcel: true } })
34
+ return api.inventory.products.all({token, query: {isParcel: true}})
37
35
  .then((res) => {
38
36
  const payload = {
39
- productId: res.data.products[0]._id,
37
+ productId: res.data.products[0]._id,
40
38
  provinces: ["Quebec"],
41
39
  buckets: []
42
40
  };
43
- return api.inventory.parcelZones.create({ token, jwtToken, parcelZone: payload });
41
+ return api.inventory.parcelZones.create({token, jwtToken, parcelZone: payload});
44
42
  })
45
43
  .then((resCreate) => {
46
44
  const {_id, productId, buckets, provinces} = resCreate.data.parcelZone;
47
45
  const newParcelZone = {productId, buckets, provinces};
48
46
  newParcelZone.provinces.push("Ontario");
49
- return api.inventory.parcelZones.update({ jwtToken, token, parcelZoneId: _id, parcelZone: newParcelZone });
47
+ return api.inventory.parcelZones.update({jwtToken, token, parcelZoneId: _id, parcelZone: newParcelZone});
50
48
  });
51
49
  });
52
-
53
- });
50
+ });
@@ -1,27 +1,25 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
- describe("inventory/products", function() {
14
-
15
- it("should list products", function() {
16
- return api.inventory.products.all({ token, query: { isParcel: true } })
17
- .then(matchHeaders('x-api-key'))
18
- .then(statusCode(200))
13
+ describe("inventory/products", () => {
14
+ it("should list products", () => {
15
+ return api.inventory.products.all({token, query: {isParcel: true}})
16
+ .then(matchHeaders("x-api-key"))
17
+ .then(statusCode(200));
19
18
  });
20
19
 
21
- it("should get product by id", function() {
20
+ it("should get product by id", () => {
22
21
  return api.inventory.products.get({token, productId: "595f9ce6df9127b11d5e03ba"})
23
- .then(matchHeaders('x-api-key'))
22
+ .then(matchHeaders("x-api-key"))
24
23
  .then(statusCode(200));
25
24
  });
26
-
27
- });
25
+ });
@@ -2,77 +2,81 @@ const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
  const jwtToken = process.env.JWT_TOKEN;
4
4
 
5
- const api = require("./../../../src/client").createApiClient({
6
- baseURL: `http://localhost:${port}`,
7
- baseURLOverride: {
8
- inventory: (baseUrl) => `${baseUrl}/inventory`
9
- }
10
- }),
11
- promo = {
12
- "accountId": "4f74a235b0dffc0210000015",
13
- "internalId": "patchTEST",
14
- "name": "patchTEST"
15
- },
16
- updatePromoData = {
17
- "internalId": "createTESTmod",
18
- "campaign":"patchTEST",
19
- "name":"patchTESTmod",
20
- "disabled": false
21
- },
22
- rule = {
23
- "valueType": "%",
24
- "value": 100
25
- },
26
- updateRuleData = {
27
- "valueType": "%",
28
- "value": 50
29
- };
5
+ const api = require("./../../../src/client.js").createApiClient({
6
+ baseURL: `http://localhost:${port}`,
7
+ baseURLOverride: {
8
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
9
+ }
10
+ });
11
+ const promo = {
12
+ "accountId": "4f74a235b0dffc0210000015",
13
+ "internalId": "patchTEST",
14
+ "name": "patchTEST"
15
+ };
16
+ const updatePromoData = {
17
+ "internalId": "createTESTmod",
18
+ "campaign": "patchTEST",
19
+ "name": "patchTESTmod",
20
+ "disabled": false
21
+ };
22
+ const rule = {
23
+ "valueType": "%",
24
+ "value": 100
25
+ };
26
+ const updateRuleData = {
27
+ "valueType": "%",
28
+ "value": 50
29
+ };
30
30
 
31
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
31
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
32
32
 
33
33
  describe("inventory/promos", () => {
34
-
35
34
  it("should list promos", () => {
36
35
  const query = {channels: "backoffice"};
37
- return api.inventory.promos.all({ token, query })
38
- .then(matchHeaders('x-api-key'))
36
+ return api.inventory.promos.all({token, query})
37
+ .then(matchHeaders("x-api-key"))
39
38
  .then(statusCode(200));
40
39
  });
41
40
 
42
41
  it("should get a promo", () => {
43
- return api.inventory.promos.get({ promoId: "5a959a4aa7114ffd7f000001", accountId: "4f74a235b0dffc0210000015", token })
44
- .then(matchHeaders('x-api-key'))
42
+ return api.inventory.promos.get({promoId: "5a959a4aa7114ffd7f000001", accountId: "4f74a235b0dffc0210000015", token})
43
+ .then(matchHeaders("x-api-key"))
45
44
  .then(statusCode(200));
46
45
  });
47
46
 
48
47
  it("should create a promo", () => {
49
- return api.inventory.promos.create({ jwtToken, promo, token })
50
- .then(matchHeaders('x-api-key'))
48
+ return api.inventory.promos.create({jwtToken, promo, token})
49
+ .then(matchHeaders("x-api-key"))
51
50
  .then(statusCode(200));
52
51
  });
53
52
 
54
53
  it("should disable promos", () => {
55
- return api.inventory.promos.remove({ jwtToken, promoId: "55662844183d59b631000003", token })
56
- .then(matchHeaders('x-api-key'))
54
+ return api.inventory.promos.remove({jwtToken, promoId: "55662844183d59b631000003", token})
55
+ .then(matchHeaders("x-api-key"))
57
56
  .then(statusCode(200));
58
57
  });
59
58
 
60
59
  it("should update a promo", () => {
61
- return api.inventory.promos.update({ jwtToken, promoId: "55662844183d59b631000003", update: updatePromoData, token })
62
- .then(matchHeaders('x-api-key'))
60
+ return api.inventory.promos.update({jwtToken, promoId: "55662844183d59b631000003", update: updatePromoData, token})
61
+ .then(matchHeaders("x-api-key"))
63
62
  .then(statusCode(200));
64
63
  });
65
64
 
66
65
  it("should add rule to a promo", () => {
67
- return api.inventory.promos.addRule({ jwtToken, promoId: "55662844183d59b631000003", rule, token })
68
- .then(matchHeaders('x-api-key'))
66
+ return api.inventory.promos.addRule({jwtToken, promoId: "55662844183d59b631000003", rule, token})
67
+ .then(matchHeaders("x-api-key"))
69
68
  .then(statusCode(200));
70
69
  });
71
70
 
72
71
  it("should update a rule", () => {
73
- return api.inventory.promos.updateRule({ jwtToken, promoId: "55662844183d59b631000003", ruleId: "test #3308-0", rule: updateRuleData, token })
74
- .then(matchHeaders('x-api-key'))
72
+ return api.inventory.promos.updateRule({
73
+ jwtToken,
74
+ promoId: "55662844183d59b631000003",
75
+ ruleId: "test #3308-0",
76
+ rule: updateRuleData,
77
+ token
78
+ })
79
+ .then(matchHeaders("x-api-key"))
75
80
  .then(statusCode(200));
76
81
  });
77
-
78
82
  });
@@ -1,24 +1,23 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
- describe("inventory/routes", function() {
14
-
15
- it("should get route by id", function() {
13
+ describe("inventory/routes", () => {
14
+ it("should get route by id", () => {
16
15
  return api.inventory.routes.get({token, routeId: "5a61f8e366d8da4c42000037"})
17
- .then(matchHeaders('x-api-key'))
16
+ .then(matchHeaders("x-api-key"))
18
17
  .then(statusCode(200));
19
18
  });
20
19
 
21
- it("should get prices", function() {
20
+ it("should get prices", () => {
22
21
  return api.inventory.routes.prices({
23
22
  token,
24
23
  productId: "5b6c7c9d7498b24533000009",
@@ -26,11 +25,10 @@ describe("inventory/routes", function() {
26
25
  destinationId: "599602a01c926ad5506cddc5",
27
26
  channel: "backoffice"
28
27
  })
29
- .then(matchHeaders('x-api-key'))
30
- .then(statusCode(200))
31
- .then((res) => {
32
- console.log(res.data);
33
- })
28
+ .then(matchHeaders("x-api-key"))
29
+ .then(statusCode(200))
30
+ .then((res) => {
31
+ console.log(res.data);
32
+ });
34
33
  });
35
-
36
34
  });
@@ -1,4 +1,4 @@
1
- const {expect} = require("chai");
1
+ const assert = require("node:assert/strict");
2
2
  const port = process.env.INVENTORY_API_PORT;
3
3
  const token = process.env.API_TOKEN;
4
4
  const jwtToken = process.env.JWT_TOKEN;
@@ -7,7 +7,7 @@ const scheduleGroupId = process.env.SCHEDULE_GROUP_ID;
7
7
  const api = require("./../../../src/client.js").createApiClient({
8
8
  baseURL: `http://localhost:${port}`,
9
9
  baseURLOverride: {
10
- inventory: (baseUrl) => `${baseUrl}/inventory`
10
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
11
11
  }
12
12
  });
13
13
 
@@ -19,9 +19,9 @@ describe("inventory/schedule-groups", () => {
19
19
  scheduleGroupId
20
20
  })
21
21
  .then(({status, data}) => {
22
- expect(status).to.equal(200);
23
- expect(data.scheduleGroup).to.exist;
24
- expect(data.scheduleGroup._id).to.eql(scheduleGroupId);
22
+ assert.deepStrictEqual(status, 200);
23
+ assert.ok(data.scheduleGroup);
24
+ assert.deepStrictEqual(data.scheduleGroup._id, scheduleGroupId);
25
25
  });
26
26
  });
27
27
 
@@ -40,15 +40,15 @@ describe("inventory/schedule-groups", () => {
40
40
  }
41
41
  })
42
42
  .then(({status, data}) => {
43
- expect(status).to.equal(200);
44
- expect(data.scheduleGroup).to.exist;
45
- expect(data.scheduleGroup.name).to.eql(newName);
46
- expect(data.scheduleGroup.enabled).to.eql(newState);
47
- expect(data.scheduleGroup.colour).to.eql(newColour);
48
- expect(data.amenityGroup.createdAt).to.exist;
49
- expect(data.amenityGroup.createdBy).to.exist;
50
- expect(data.amenityGroup.updatedAt).to.exist;
51
- expect(data.amenityGroup.updatedBy).to.exist;
43
+ assert.deepStrictEqual(status, 200);
44
+ assert.ok(data.scheduleGroup);
45
+ assert.deepStrictEqual(data.scheduleGroup.name, newName);
46
+ assert.deepStrictEqual(data.scheduleGroup.enabled, newState);
47
+ assert.deepStrictEqual(data.scheduleGroup.colour, newColour);
48
+ assert.ok(data.amenityGroup.createdAt);
49
+ assert.ok(data.amenityGroup.createdBy);
50
+ assert.ok(data.amenityGroup.updatedAt);
51
+ assert.ok(data.amenityGroup.updatedBy);
52
52
  });
53
53
  });
54
54
 
@@ -70,15 +70,15 @@ describe("inventory/schedule-groups", () => {
70
70
  }
71
71
  })
72
72
  .then(({status, data}) => {
73
- expect(status).to.equal(200);
74
- expect(data.amenityGroup).to.exist;
75
- expect(data.amenityGroup.name).to.eql(newName);
76
- expect(data.amenityGroup.enabled).to.eql(newState);
77
- expect(data.amenityGroup.colour).to.eql(newColour);
78
- expect(data.amenityGroup.createdAt).to.exist;
79
- expect(data.amenityGroup.createdBy).to.exist;
80
- expect(data.amenityGroup.updatedAt).to.exist;
81
- expect(data.amenityGroup.updatedBy).to.exist;
73
+ assert.deepStrictEqual(status, 200);
74
+ assert.ok(data.amenityGroup);
75
+ assert.deepStrictEqual(data.amenityGroup.name, newName);
76
+ assert.deepStrictEqual(data.amenityGroup.enabled, newState);
77
+ assert.deepStrictEqual(data.amenityGroup.colour, newColour);
78
+ assert.ok(data.amenityGroup.createdAt);
79
+ assert.ok(data.amenityGroup.createdBy);
80
+ assert.ok(data.amenityGroup.updatedAt);
81
+ assert.ok(data.amenityGroup.updatedBy);
82
82
  });
83
83
  });
84
84
  });
@@ -1,25 +1,30 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
13
  describe("inventory/ssrs", () => {
14
-
15
14
  it("should list ssrs", () => {
16
15
  const query = {
17
16
  productIds: "5a3bfb0c8ac455703e99b526",
18
- tripId: "eyJhY2NvdW50SWQiOiI0Zjc0YTIzNWIwZGZmYzAyMTAwMDAwMTUiLCJwcm9kdWN0SWQiOiI1YTNiZmIwYzhhYzQ1NTcwM2U5OWI1MjYiLCJvcmlnaW5JZCI6IjUxZWQyYWY3Y2YyYzgxOWQ1ZTAwMDAwNSIsImRlc3RpbmF0aW9uSWQiOiI1MWIwYjBmNzMxYzcyOWI3NWMwMDAxNjIiLCJmYXJlSWRzIjoiNGY3NGI3MThiMGRmZmMwMjEwMDAwMDQxOjEiLCJkZXBhcnR1cmVEYXRlIjoiMjAxOC0wMS0xOCIsImRlcGFydHVyZVRpbWUiOiIwOTowMCIsImNoYW5uZWwiOiJ3ZWJzYWxlcyIsInNlZ21lbnRzIjpbeyJyb3V0ZUlkIjoiNTZmYWVhYTdkMmM0YmRjMTFiMDAwMGI0Iiwic2NoZWR1bGVJZCI6IjZmZmY5NjU0LTg5YWQtNDRkOS1hMmU1LTNmNWNhNmE3YmE0NiIsIm9yaWdpbiI6IkR1YmxpbiIsImRlc3RpbmF0aW9uIjoiVG9yb250byJ9XSwidGlja2V0VHlwZSI6Im9uZXdheSJ9"
17
+ tripId: "eyJhY2NvdW50SWQiOiI0Zjc0YTIzNWIwZGZmYzAyMTAwMDAwMTUi" +
18
+ "LCJwcm9kdWN0SWQiOiI1YTNiZmIwYzhhYzQ1NTcwM2U5OWI1MjYiLCJvcmlnaW5JZCI6IjUxZWQy" +
19
+ "YWY3Y2YyYzgxOWQ1ZTAwMDAwNSIsImRlc3RpbmF0aW9uSWQiOiI1MWIwYjBmNzMxYzcyOWI3NWMw" +
20
+ "MDAxNjIiLCJmYXJlSWRzIjoiNGY3NGI3MThiMGRmZmMwMjEwMDAwMDQxOjEiLCJkZXBhcnR1cmVE" +
21
+ "YXRlIjoiMjAxOC0wMS0xOCIsImRlcGFydHVyZVRpbWUiOiIwOTowMCIsImNoYW5uZWwiOiJ3ZWJz" +
22
+ "YWxlcyIsInNlZ21lbnRzIjpbeyJyb3V0ZUlkIjoiNTZmYWVhYTdkMmM0YmRjMTFiMDAwMGI0Iiwic2No" +
23
+ "ZWR1bGVJZCI6IjZmZmY5NjU0LTg5YWQtNDRkOS1hMmU1LTNmNWNhNmE3YmE0NiIsIm9yaWdpbiI6" +
24
+ "IkR1YmxpbiIsImRlc3RpbmF0aW9uIjoiVG9yb250byJ9XSwidGlja2V0VHlwZSI6Im9uZXdheSJ9"
19
25
  };
20
- return api.inventory.ssrs.all({ token, query })
21
- .then(matchHeaders('x-api-key'))
22
- .then(statusCode(200))
26
+ return api.inventory.ssrs.all({token, query})
27
+ .then(matchHeaders("x-api-key"))
28
+ .then(statusCode(200));
23
29
  });
24
-
25
- });
30
+ });
@@ -1,20 +1,19 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
4
+ const api = require("./../../../src/client.js").createApiClient({
5
5
  baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
13
  describe("inventory/stations/zones", () => {
14
-
15
14
  it("should list the zones", () => {
16
- return api.inventory.stationsZones.get({ token })
17
- .then(matchHeaders('x-api-key'))
15
+ return api.inventory.stationsZones.get({token})
16
+ .then(matchHeaders("x-api-key"))
18
17
  .then(statusCode(200));
19
18
  });
20
19
  });
@@ -1,34 +1,31 @@
1
1
  const port = process.env.INVENTORY_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- inventory: (baseUrl) => `${baseUrl}/inventory`
7
+ inventory: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
13
  describe("inventory/stations", () => {
14
-
15
14
  it("should list stations", () => {
16
- return api.inventory.stations.all({ token })
17
- .then(matchHeaders('x-api-key'))
18
- .then(statusCode(200))
15
+ return api.inventory.stations.all({token})
16
+ .then(matchHeaders("x-api-key"))
17
+ .then(statusCode(200));
19
18
  });
20
19
 
21
20
  it("should get the station specified", () => {
22
- return api.inventory.stations.all({ token })
23
- .then((response) => {
24
- if (response.data.stations && response.data.stations.length > 0) {
25
- return api.inventory.stations.get({token, id: response.data.stations[0]._id.toString()})
26
- .then(matchHeaders('x-api-key'))
27
- .then(statusCode(200));
28
- } else {
29
- throw new Error(`No stations were found`);
30
- }
31
- });
21
+ return api.inventory.stations.all({token})
22
+ .then((response) => {
23
+ if (response.data.stations && response.data.stations.length > 0) {
24
+ return api.inventory.stations.get({token, id: response.data.stations[0]._id.toString()})
25
+ .then(matchHeaders("x-api-key"))
26
+ .then(statusCode(200));
27
+ }
28
+ throw new Error("No stations were found");
29
+ });
32
30
  });
33
-
34
- });
31
+ });
@@ -1,37 +1,51 @@
1
1
  const port = process.env.TRIPS_API_PORT;
2
2
  const token = process.env.API_TOKEN;
3
3
 
4
- const api = require("./../../../src/client").createApiClient({
5
- baseURL: `http://localhost:${port}`,
4
+ const api = require("./../../../src/client.js").createApiClient({
5
+ baseURL: `http://localhost:${port}`,
6
6
  baseURLOverride: {
7
- trips: (baseUrl) => `${baseUrl}/inventory`
7
+ trips: (baseUrl) => { return `${baseUrl}/inventory`; }
8
8
  }
9
9
  });
10
10
 
11
- const { matchHeaders, statusCode } = require("./../../test-integration-helpers");
11
+ const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
12
12
 
13
- describe("inventory/trips", function() {
14
-
15
- it("should list trips", function() {
13
+ describe("inventory/trips", () => {
14
+ it("should list trips", () => {
16
15
  const query = {
17
16
  productId: "595f9c7007ee12686d000033",
18
17
  originId: "599602791c926ad5506cddc4",
19
18
  destinationId: "599602a01c926ad5506cddc5",
20
19
  fareIds: "595f9f62df9127b11d5e03bd:1",
21
20
  departureDate: "2017-12-21"
22
- }
23
- return api.inventory.trips.all({ token, query })
24
- .then(matchHeaders('x-api-key'))
21
+ };
22
+ return api.inventory.trips.all({token, query})
23
+ .then(matchHeaders("x-api-key"))
25
24
  .then(statusCode(200))
26
25
  .then((res) => {
27
26
  console.log(JSON.stringify(res.data));
28
- })
27
+ });
29
28
  });
30
29
 
31
- it("should get trip by id", function() {
32
- return api.inventory.trips.get({token, id: "eyJhY2NvdW50SWQiOiI1OTVmOWM3MDA3ZWUxMjY4NmQwMDAwMzIiLCJwcm9kdWN0SWQiOiI1YTcyMTM4YzNjNzA5ZTUyMGYwMDAwMmMiLCJvcmlnaW5JZCI6IjU5OTYwMjc5MWM5MjZhZDU1MDZjZGRjNCIsImRlc3RpbmF0aW9uSWQiOiI1OTk2MDJhMDFjOTI2YWQ1NTA2Y2RkYzUiLCJmYXJlSWRzIjoiNTk1ZjlmNjJkZjkxMjdiMTFkNWUwM2JkOjEiLCJkZXBhcnR1cmVEYXRlIjoiMjAxOS0wNS0zMCIsImRlcGFydHVyZVRpbWUiOiIwODowMCIsInRyaXBEaXJlY3Rpb24iOiJvdXRib3VuZCIsImNoYW5uZWwiOiJiYWNrb2ZmaWNlIiwic2VnbWVudHMiOlt7InJvdXRlSWQiOiI1YTcyMTQ2MDNjNzA5ZTUyMGYwMDAwNDciLCJzY2hlZHVsZUlkIjoiZmQzNGQ2YmItNTFkYS00NTZjLTk3OTQtZmE3MzEyNzViMTkwIiwib3JpZ2luIjoiRHVibGluIiwiZGVzdGluYXRpb24iOiJFZG1vbmQifV0sImZhcmVzIjpbXSwiZmFyZUNsYXNzZXMiOlt7ImlkIjoiNWE3MjFhOTYxNmM0NTEyMjZhZGYyYTc3IiwiZmFyZXMiOlt7ImlkIjoiNTk1ZjlmNjJkZjkxMjdiMTFkNWUwM2JkIiwidmFsdWUiOjcwMDAwMDAsImpvdXJuZXlQcmljZUlkIjoiNWNlNDZiZjg3ZWNjZWQxNTdlMTI4N2RhIiwiam91cm5leVByaWNlVmVyc2lvbklkIjoiNWNlNDZiZjgxNGRiZDQyMjA1OTRkM2JhIn1dfSx7ImlkIjoiNWMxM2M5OTE0ODY1NmU0YTE2NDk5ZjdmIiwiZmFyZXMiOlt7ImlkIjoiNTk1ZjlmNjJkZjkxMjdiMTFkNWUwM2JkIiwidmFsdWUiOjcwMDAwMDAsImpvdXJuZXlQcmljZUlkIjoiNWNlNDZiZjg3ZWNjZWQxNTdlMTI4N2RhIiwiam91cm5leVByaWNlVmVyc2lvbklkIjoiNWNlNDZiZjgxNGRiZDQyMjA1OTRkM2JhIn1dfV0sInRpY2tldFR5cGUiOiJvbmV3YXkifQ"})
33
- .then(matchHeaders('x-api-key'))
30
+ it("should get trip by id", () => {
31
+ const tripId = "eyJhY2NvdW50SWQiOiI1OTVmOWM3MDA3ZWUxMjY4NmQwMDAwMzIi" +
32
+ "LCJwcm9kdWN0SWQiOiI1YTcyMTM4YzNjNzA5ZTUyMGYwMDAwMmMiLCJvcmlnaW5JZCI6IjU5OTYw" +
33
+ "Mjc5MWM5MjZhZDU1MDZjZGRjNCIsImRlc3RpbmF0aW9uSWQiOiI1OTk2MDJhMDFjOTI2YWQ1NTA2" +
34
+ "Y2RkYzUiLCJmYXJlSWRzIjoiNTk1ZjlmNjJkZjkxMjdiMTFkNWUwM2JkOjEiLCJkZXBhcnR1cmVE" +
35
+ "YXRlIjoiMjAxOS0wNS0zMCIsImRlcGFydHVyZVRpbWUiOiIwODowMCIsInRyaXBEaXJlY3Rpb24i" +
36
+ "OiJvdXRib3VuZCIsImNoYW5uZWwiOiJiYWNrb2ZmaWNlIiwic2VnbWVudHMiOlt7InJvdXRlSWQi" +
37
+ "OiI1YTcyMTQ2MDNjNzA5ZTUyMGYwMDAwNDciLCJzY2hlZHVsZUlkIjoiZmQzNGQ2YmItNTFkYS00" +
38
+ "NTZjLTk3OTQtZmE3MzEyNzViMTkwIiwib3JpZ2luIjoiRHVibGluIiwiZGVzdGluYXRpb24iOiJF" +
39
+ "ZG1vbmQifV0sImZhcmVzIjpbXSwiZmFyZUNsYXNzZXMiOlt7ImlkIjoiNWE3MjFhOTYxNmM0NTEy" +
40
+ "MjZhZGYyYTc3IiwiZmFyZXMiOlt7ImlkIjoiNTk1ZjlmNjJkZjkxMjdiMTFkNWUwM2JkIiwidmFs" +
41
+ "dWUiOjcwMDAwMDAsImpvdXJuZXlQcmljZUlkIjoiNWNlNDZiZjg3ZWNjZWQxNTdlMTI4N2RhIiwiam91" +
42
+ "cm5leVByaWNlVmVyc2lvbklkIjoiNWNlNDZiZjgxNGRiZDQyMjA1OTRkM2JhIn1dfSx7ImlkIjoi" +
43
+ "NWMxM2M5OTE0ODY1NmU0YTE2NDk5ZjdmIiwiZmFyZXMiOlt7ImlkIjoiNTk1ZjlmNjJkZjkxMjdi" +
44
+ "MTFkNWUwM2JkIiwidmFsdWUiOjcwMDAwMDAsImpvdXJuZXlQcmljZUlkIjoiNWNlNDZiZjg3ZWNj" +
45
+ "ZWQxNTdlMTI4N2RhIiwiam91cm5leVByaWNlVmVyc2lvbklkIjoiNWNlNDZiZjgxNGRiZDQyMjA1" +
46
+ "OTRkM2JhIn1dfV0sInRpY2tldFR5cGUiOiJvbmV3YXkifQ";
47
+ return api.inventory.trips.get({token, id: tripId})
48
+ .then(matchHeaders("x-api-key"))
34
49
  .then(statusCode(200));
35
50
  });
36
-
37
- });
51
+ });