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.
- package/.eslint-report.json +1 -0
- package/.eslintignore +2 -0
- package/fetch-test.js +5 -6
- package/index.js +2 -2
- package/lib/client-standalone-min.js +3 -3
- package/lib/client.js +50 -38
- package/lib/endpoints/accounts/journey-prices-settings.js +2 -2
- package/lib/endpoints/accounts/market-pricing-settings.js +3 -3
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +6 -2
- package/lib/endpoints/accounts/operation-settings.js +3 -1
- package/lib/endpoints/btrzpay/referenced-payments.js +6 -2
- package/lib/endpoints/btrzpay/square.js +12 -3
- package/lib/endpoints/btrzpay/stripe-terminals.js +9 -3
- package/lib/endpoints/btrzpay/terminalPayments.js +14 -4
- package/lib/endpoints/inventory/document-types.js +2 -1
- package/lib/endpoints/inventory/products.js +1 -0
- package/lib/endpoints/operations/movements.js +7 -2
- package/lib/endpoints/operations/pago-express.js +9 -3
- package/lib/endpoints/operations/parcels.js +3 -1
- package/lib/endpoints/sales/cancellations.js +31 -8
- package/package.json +6 -8
- package/src/client.js +0 -1
- package/src/endpoints/accounts/journey-prices-settings.js +2 -2
- package/src/endpoints/accounts/market-pricing-settings.js +3 -3
- package/src/endpoints/accounts/multiproduct-sales-settings.js +6 -2
- package/src/endpoints/accounts/operation-settings.js +3 -1
- package/src/endpoints/btrzpay/referenced-payments.js +6 -2
- package/src/endpoints/btrzpay/square.js +12 -3
- package/src/endpoints/btrzpay/stripe-terminals.js +9 -3
- package/src/endpoints/btrzpay/terminalPayments.js +14 -4
- package/src/endpoints/inventory/document-types.js +2 -1
- package/src/endpoints/inventory/products.js +1 -0
- package/src/endpoints/operations/movements.js +7 -2
- package/src/endpoints/operations/pago-express.js +9 -3
- package/src/endpoints/operations/parcels.js +3 -1
- package/src/endpoints/sales/cancellations.js +31 -8
- package/test/all.test.js +218 -0
- package/test/client.test.js +58 -44
- package/test/endpoints/accounts/application-settings.test.js +2 -2
- package/test/endpoints/accounts/applications.test.js +2 -2
- package/test/endpoints/accounts/current-shifts.test.js +2 -2
- package/test/endpoints/accounts/customers.js +17 -17
- package/test/endpoints/accounts/domains.test.js +6 -8
- package/test/endpoints/accounts/exchange-rates.test.js +3 -3
- package/test/endpoints/accounts/exchange-receipts.test.js +3 -3
- package/test/endpoints/accounts/images.test.js +2 -2
- package/test/endpoints/accounts/interline.test.js +10 -12
- package/test/endpoints/accounts/network.test.js +3 -5
- package/test/endpoints/accounts/people-lookups.test.js +13 -13
- package/test/endpoints/accounts/print-templates.test.js +3 -3
- package/test/endpoints/accounts/printers.test.js +2 -2
- package/test/endpoints/accounts/tokens.js +2 -2
- package/test/endpoints/accounts/trusted-machines.test.js +2 -2
- package/test/endpoints/accounts/websales-config.test.js +47 -50
- package/test/endpoints/btrzpay/carpointe.tests.js +2 -2
- package/test/endpoints/btrzpay/datalogicPayments.tests.js +2 -2
- package/test/endpoints/btrzpay/datalogicReferenceNumber.tests.js +2 -2
- package/test/endpoints/btrzpay/oxxoPayments.tests.js +2 -2
- package/test/endpoints/btrzpay/oxxoToken.tests.js +2 -2
- package/test/endpoints/btrzpay/payment-methods.test.js +3 -3
- package/test/endpoints/btrzpay/payments.tests.js +6 -6
- package/test/endpoints/btrzpay/reference-numbers.test.js +5 -5
- package/test/endpoints/btrzpay/referenced-payments.test.js +2 -2
- package/test/endpoints/btrzpay/square.tests.js +2 -2
- package/test/endpoints/btrzpay/terminalPayments.tests.js +2 -2
- package/test/endpoints/endpoints_helpers.test.js +28 -24
- package/test/endpoints/inventory/amenities.test.js +20 -20
- package/test/endpoints/inventory/amenity-groups.test.js +15 -15
- package/test/endpoints/inventory/bare-routes.test.js +2 -2
- package/test/endpoints/inventory/brands.test.js +9 -9
- package/test/endpoints/inventory/bundle-fares.test.js +10 -11
- package/test/endpoints/inventory/bundles.test.js +9 -9
- package/test/endpoints/inventory/companies.test.js +6 -6
- package/test/endpoints/inventory/custom-content.test.js +4 -4
- package/test/endpoints/inventory/custom-fields.test.js +2 -2
- package/test/endpoints/inventory/document-types.test.js +2 -2
- package/test/endpoints/inventory/fare-classes.test.js +10 -10
- package/test/endpoints/inventory/fares.test.js +14 -16
- package/test/endpoints/inventory/fees.test.js +14 -15
- package/test/endpoints/inventory/filtered-trips-v2.test.js +5 -5
- package/test/endpoints/inventory/insurances.test.js +2 -2
- package/test/endpoints/inventory/insurancesCost.test.js +2 -2
- package/test/endpoints/inventory/journey-prices.test.js +13 -15
- package/test/endpoints/inventory/labels.test.js +2 -2
- package/test/endpoints/inventory/marital-status.test.js +2 -2
- package/test/endpoints/inventory/mit-terminal-settings.test.js +2 -2
- package/test/endpoints/inventory/mit-terminals.test.js +7 -7
- package/test/endpoints/inventory/operating-companies.test.js +14 -14
- package/test/endpoints/inventory/operation-messages.test.js +10 -10
- package/test/endpoints/inventory/parcel-zones.test.js +12 -13
- package/test/endpoints/inventory/payment-terminals.test.js +7 -7
- package/test/endpoints/inventory/prisma-terminals.test.js +2 -2
- package/test/endpoints/inventory/products.test.js +25 -20
- package/test/endpoints/inventory/promos.test.js +50 -50
- package/test/endpoints/inventory/seatclasses.test.js +2 -2
- package/test/endpoints/inventory/seatfees.test.js +6 -6
- package/test/endpoints/inventory/seatmaps.test.js +7 -7
- package/test/endpoints/inventory/segments-information.test.js +2 -2
- package/test/endpoints/inventory/service-numbers.test.js +6 -6
- package/test/endpoints/inventory/service-types.test.js +7 -7
- package/test/endpoints/inventory/shift-settings.test.js +2 -2
- package/test/endpoints/inventory/ssrs.test.js +10 -11
- package/test/endpoints/inventory/stations-zones.test.js +8 -9
- package/test/endpoints/inventory/stations.test.js +2 -2
- package/test/endpoints/inventory/travel-routes.test.js +2 -2
- package/test/endpoints/inventory/traveller-car-types.test.js +8 -8
- package/test/endpoints/inventory/traveller-card-providers-types.test.js +2 -2
- package/test/endpoints/inventory/traveller-card-providers.test.js +7 -7
- package/test/endpoints/inventory/vehicles.test.js +2 -2
- package/test/endpoints/inventory/zone-price-overages.test.js +2 -2
- package/test/endpoints/inventory/zone-prices.test.js +2 -2
- package/test/endpoints/invoices/dlink.test.js +2 -2
- package/test/endpoints/invoices/gti.test.js +2 -2
- package/test/endpoints/invoices/infile.test.js +2 -2
- package/test/endpoints/invoices/infileJson.test.js +2 -2
- package/test/endpoints/invoices/providers.test.js +4 -4
- package/test/endpoints/invoices/providersSequences.test.js +2 -2
- package/test/endpoints/invoices/system.test.js +2 -2
- package/test/endpoints/loyalty/movements.test.js +11 -11
- package/test/endpoints/loyalty/programs.test.js +21 -21
- package/test/endpoints/notifications/customers.test.js +6 -6
- package/test/endpoints/notifications/external-customers.test.js +10 -10
- package/test/endpoints/notifications/manifet-notifications.test.js +3 -3
- package/test/endpoints/notifications/notify.test.js +5 -5
- package/test/endpoints/notifications/orders-rules-validations.test.js +5 -6
- package/test/endpoints/notifications/pdfs.test.js +4 -4
- package/test/endpoints/notifications/printed-tickets.test.js +17 -18
- package/test/endpoints/notifications/short-urls.test.js +9 -9
- package/test/endpoints/operations/applied_insurance.test.js +10 -14
- package/test/endpoints/operations/calendar_entries.test.js +8 -9
- package/test/endpoints/operations/cancellation_settings.test.js +2 -2
- package/test/endpoints/operations/loans.test.js +2 -2
- package/test/endpoints/operations/manifest.test.js +11 -9
- package/test/endpoints/operations/operations.test.js +42 -25
- package/test/endpoints/operations/parcel_manifests.test.js +3 -3
- package/test/endpoints/operations/parcels.test.js +27 -22
- package/test/endpoints/operations/passenger_check_in_info.test.js +2 -2
- package/test/endpoints/operations/redemption.test.js +2 -2
- package/test/endpoints/operations/sold-items-fulfillment.test.js +2 -2
- package/test/endpoints/operations/sold_items.test.js +3 -3
- package/test/endpoints/operations/tickets.test.js +4 -4
- package/test/endpoints/operations/transaction.test.js +12 -15
- package/test/endpoints/operations/transactions.test.js +11 -11
- package/test/endpoints/operations/transport_regulations.js +2 -4
- package/test/endpoints/operations/trip_change_info.test.js +9 -10
- package/test/endpoints/operations/vehicle-assignments.test.js +5 -7
- package/test/endpoints/operations/waitlists.test.js +3 -3
- package/test/endpoints/ratality/auth.test.js +5 -5
- package/test/endpoints/ratality/client.test.js +4 -4
- package/test/endpoints/ratality/integrations.test.js +15 -9
- package/test/endpoints/reports/custom-reports.test.js +12 -12
- package/test/endpoints/reports/email.test.js +3 -3
- package/test/endpoints/reports/report-types.test.js +6 -6
- package/test/endpoints/reports/trip-manifests.test.js +5 -6
- package/test/endpoints/sales/bundles.test.js +9 -10
- package/test/endpoints/sales/cart-promo.test.js +15 -16
- package/test/endpoints/sales/cart.test.js +7 -7
- package/test/endpoints/sales/check-in-info.test.js +3 -3
- package/test/endpoints/sales/custom-fields.test.js +10 -13
- package/test/endpoints/sales/flexpasses.test.js +2 -2
- package/test/endpoints/sales/git-certificates.test.js +10 -13
- package/test/endpoints/sales/order.test.js +19 -21
- package/test/endpoints/sales/payment-providers.test.js +14 -15
- package/test/endpoints/sales/redeemable-items.test.js +14 -15
- package/test/endpoints/sales/sync-entry.test.js +9 -11
- package/test/endpoints/sales/voucher.test.js +19 -17
- package/test/endpoints/seatmaps/access-ticket.test.js +6 -6
- package/test/endpoints/seatmaps/seat.test.js +6 -6
- package/test/endpoints/uploads/files.test.js +8 -7
- package/test/endpoints/uploads/images.test.js +8 -7
- package/test/endpoints/webhooks/subscriptions.test.js +27 -27
- package/test/endpoints/webhooks/undelivered.test.js +22 -22
- package/test/endpoints/webhooks/webhooks.test.js +7 -7
- package/test/node-test-globals.js +19 -0
- package/test/test-helpers.js +4 -4
- package/test-integration/all.test.js +63 -0
- package/test-integration/endpoints/accounts/current-shifts.test.js +4 -4
- package/test-integration/endpoints/accounts/docs.test.js +6 -6
- package/test-integration/endpoints/accounts/lexicons.test.js +42 -37
- package/test-integration/endpoints/accounts/shifts.test.js +5 -8
- package/test-integration/endpoints/accounts/users.test.js +4 -4
- package/test-integration/endpoints/btrzpay/customerCards.test.js +24 -48
- package/test-integration/endpoints/btrzpay/customers.test.js +20 -34
- package/test-integration/endpoints/btrzpay/payment-methods.test.js +34 -34
- package/test-integration/endpoints/btrzpay/payments.test.js +21 -21
- package/test-integration/endpoints/btrzpay/reference-numbers.test.js +15 -15
- package/test-integration/endpoints/btrzpay/referenced-payments.test.js +5 -5
- package/test-integration/endpoints/client.test.js +6 -10
- package/test-integration/endpoints/inventory/amenities.test.js +34 -34
- package/test-integration/endpoints/inventory/amenity-groups.test.js +30 -31
- package/test-integration/endpoints/inventory/bundle-fares.test.js +10 -12
- package/test-integration/endpoints/inventory/companies.test.js +7 -8
- package/test-integration/endpoints/inventory/countries.test.js +10 -12
- package/test-integration/endpoints/inventory/custom-fields.test.js +2 -2
- package/test-integration/endpoints/inventory/docs.test.js +5 -7
- package/test-integration/endpoints/inventory/fare-classes.test.js +12 -13
- package/test-integration/endpoints/inventory/fares.test.js +7 -9
- package/test-integration/endpoints/inventory/fees.test.js +8 -10
- package/test-integration/endpoints/inventory/filtered-trips.test.js +15 -12
- package/test-integration/endpoints/inventory/gift-certificate-definitions.test.js +5 -5
- package/test-integration/endpoints/inventory/insurances.test.js +36 -34
- package/test-integration/endpoints/inventory/items.js +10 -12
- package/test-integration/endpoints/inventory/journey-prices.test.js +11 -11
- package/test-integration/endpoints/inventory/parcel-zones.test.js +15 -18
- package/test-integration/endpoints/inventory/products.test.js +12 -14
- package/test-integration/endpoints/inventory/promos.test.js +46 -42
- package/test-integration/endpoints/inventory/routes.test.js +13 -15
- package/test-integration/endpoints/inventory/schedule-groups.test.js +23 -23
- package/test-integration/endpoints/inventory/ssrs.test.js +16 -11
- package/test-integration/endpoints/inventory/stations-zones.test.js +5 -6
- package/test-integration/endpoints/inventory/stations.test.js +17 -20
- package/test-integration/endpoints/inventory/trips.test.js +30 -16
- package/test-integration/endpoints/notifications/printed-tickets.test.js +2 -2
- package/test-integration/endpoints/operations/applied_insurance.test.js +9 -11
- package/test-integration/endpoints/operations/manifest.test.js +32 -34
- package/test-integration/endpoints/operations/parcel.test.js +36 -38
- package/test-integration/endpoints/operations/redemption.test.js +9 -12
- package/test-integration/endpoints/operations/segments.js +8 -10
- package/test-integration/endpoints/operations/tickets.test.js +11 -11
- package/test-integration/endpoints/operations/transaction.test.js +1 -1
- package/test-integration/endpoints/operations/transactions.test.js +2 -2
- package/test-integration/endpoints/operations/trip_change_info.test.js +11 -13
- package/test-integration/endpoints/reports/custom-reports.test.js +21 -21
- package/test-integration/endpoints/reports/report-types.test.js +22 -22
- package/test-integration/endpoints/sales/bundles.test.js +5 -5
- package/test-integration/endpoints/sales/cart-promo.test.js +17 -32
- package/test-integration/endpoints/sales/cart.test.js +45 -51
- package/test-integration/endpoints/sales/check-in-info.test.js +2 -2
- package/test-integration/endpoints/sales/custom-fields.test.js +8 -10
- package/test-integration/endpoints/sales/flexpasses.test.js +2 -2
- package/test-integration/endpoints/sales/gift-certificates.test.js +14 -18
- package/test-integration/endpoints/sales/order.test.js +42 -50
- package/test-integration/endpoints/sales/payment-providers.test.js +7 -9
- package/test-integration/endpoints/sales/redeemable-items.test.js +17 -19
- package/test-integration/endpoints/sales/voucher.test.js +12 -14
- package/test-integration/endpoints/seatmaps/access-ticket.test.js +7 -9
- package/test-integration/endpoints/seatmaps/seat.test.js +7 -9
- package/test-integration/endpoints/uploads/files.test.js +14 -14
- package/test-integration/endpoints/uploads/images.test.js +3 -5
- package/test-integration/ports.js +4 -4
- 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 {
|
|
11
|
+
const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
|
|
12
12
|
|
|
13
|
-
describe("inventory/items",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
39
|
-
|
|
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 {
|
|
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({
|
|
20
|
-
.then(matchHeaders(
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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 {
|
|
11
|
+
const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
|
|
12
12
|
|
|
13
|
-
describe("inventory/products",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.then(
|
|
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",
|
|
20
|
+
it("should get product by id", () => {
|
|
22
21
|
return api.inventory.products.get({token, productId: "595f9ce6df9127b11d5e03ba"})
|
|
23
|
-
.then(matchHeaders(
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 {
|
|
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({
|
|
38
|
-
.then(matchHeaders(
|
|
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({
|
|
44
|
-
.then(matchHeaders(
|
|
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({
|
|
50
|
-
.then(matchHeaders(
|
|
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({
|
|
56
|
-
.then(matchHeaders(
|
|
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({
|
|
62
|
-
.then(matchHeaders(
|
|
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({
|
|
68
|
-
.then(matchHeaders(
|
|
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({
|
|
74
|
-
|
|
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 {
|
|
11
|
+
const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
|
|
12
12
|
|
|
13
|
-
describe("inventory/routes",
|
|
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(
|
|
16
|
+
.then(matchHeaders("x-api-key"))
|
|
18
17
|
.then(statusCode(200));
|
|
19
18
|
});
|
|
20
19
|
|
|
21
|
-
it("should get prices",
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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 {
|
|
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: "
|
|
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({
|
|
21
|
-
.then(matchHeaders(
|
|
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 {
|
|
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({
|
|
17
|
-
.then(matchHeaders(
|
|
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 {
|
|
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({
|
|
17
|
-
.then(matchHeaders(
|
|
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({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 {
|
|
11
|
+
const {matchHeaders, statusCode} = require("./../../test-integration-helpers.js");
|
|
12
12
|
|
|
13
|
-
describe("inventory/trips",
|
|
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({
|
|
24
|
-
.then(matchHeaders(
|
|
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",
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
});
|