btrz-api-client 3.36.0 → 3.42.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/lib/client-standalone-min.js +1 -1
- package/lib/client.js +1 -1
- package/lib/endpoints/accounts/accounts.js +3 -2
- package/lib/endpoints/accounts/application-settings.js +15 -10
- package/lib/endpoints/accounts/application.js +3 -2
- package/lib/endpoints/accounts/applications.js +6 -4
- package/lib/endpoints/accounts/current-shifts.js +3 -2
- package/lib/endpoints/accounts/customers.js +15 -10
- package/lib/endpoints/accounts/domains.js +9 -6
- package/lib/endpoints/accounts/email-settings.js +15 -10
- package/lib/endpoints/accounts/exchange-rates.js +6 -4
- package/lib/endpoints/accounts/interline.js +27 -18
- package/lib/endpoints/accounts/lexicons.js +12 -8
- package/lib/endpoints/accounts/print-settings.js +12 -8
- package/lib/endpoints/accounts/printers.js +3 -2
- package/lib/endpoints/accounts/shifts.js +3 -2
- package/lib/endpoints/accounts/travellers.js +15 -10
- package/lib/endpoints/accounts/trusted-machines.js +3 -2
- package/lib/endpoints/accounts/users.js +6 -4
- package/lib/endpoints/btrzpay/customerCards.js +12 -8
- package/lib/endpoints/btrzpay/customers.js +9 -7
- package/lib/endpoints/btrzpay/payment-methods.js +18 -12
- package/lib/endpoints/btrzpay/payments.js +6 -4
- package/lib/endpoints/btrzpay/reference-numbers.js +3 -2
- package/lib/endpoints/btrzpay/referenced-payments.js +6 -4
- package/lib/endpoints/btrzpay/square.js +6 -4
- package/lib/endpoints/coltrane/paths.js +3 -2
- package/lib/endpoints/gps/scanner-app-location.js +3 -2
- package/lib/endpoints/inventory/amenities.js +12 -8
- package/lib/endpoints/inventory/amenity-groups.js +12 -8
- package/lib/endpoints/inventory/bare-routes.js +6 -4
- package/lib/endpoints/inventory/brands.js +12 -8
- package/lib/endpoints/inventory/bundle-fares.js +3 -2
- package/lib/endpoints/inventory/bundles.js +6 -4
- package/lib/endpoints/inventory/companies.js +3 -2
- package/lib/endpoints/inventory/countries.js +3 -2
- package/lib/endpoints/inventory/custom-content.js +15 -10
- package/lib/endpoints/inventory/fare-classes.js +9 -6
- package/lib/endpoints/inventory/fares.js +6 -4
- package/lib/endpoints/inventory/fees.js +3 -2
- package/lib/endpoints/inventory/filtered-trips-v2.js +3 -2
- package/lib/endpoints/inventory/filtered-trips.js +3 -2
- package/lib/endpoints/inventory/gift-certificate-definitions.js +3 -2
- package/lib/endpoints/inventory/healthcheck.js +22 -0
- package/lib/endpoints/inventory/insurances.js +15 -10
- package/lib/endpoints/inventory/insurancesCost.js +3 -2
- package/lib/endpoints/inventory/items.js +3 -2
- package/lib/endpoints/inventory/journey-prices.js +9 -6
- package/lib/endpoints/inventory/marketplace-modifiers.js +15 -10
- package/lib/endpoints/inventory/operating-companies.js +12 -8
- package/lib/endpoints/inventory/operation-messages.js +18 -12
- package/lib/endpoints/inventory/parcel-zones.js +9 -6
- package/lib/endpoints/inventory/payment-terminals.js +15 -10
- package/lib/endpoints/inventory/products.js +6 -4
- package/lib/endpoints/inventory/promos.js +21 -14
- package/lib/endpoints/inventory/routes.js +21 -14
- package/lib/endpoints/inventory/schedules.js +3 -2
- package/lib/endpoints/inventory/seatfees.js +12 -8
- package/lib/endpoints/inventory/seatmaps.js +3 -2
- package/lib/endpoints/inventory/service-numbers.js +12 -8
- package/lib/endpoints/inventory/service-types.js +15 -10
- package/lib/endpoints/inventory/ssrs.js +3 -2
- package/lib/endpoints/inventory/station-groups.js +3 -2
- package/lib/endpoints/inventory/stations-zones.js +3 -2
- package/lib/endpoints/inventory/stations.js +6 -4
- package/lib/endpoints/inventory/taxes.js +12 -8
- package/lib/endpoints/inventory/traveller-card-providers-types.js +3 -2
- package/lib/endpoints/inventory/traveller-card-providers.js +12 -8
- package/lib/endpoints/inventory/traveller-card-types.js +15 -10
- package/lib/endpoints/inventory/trips.js +6 -4
- package/lib/endpoints/inventory/zone-price-overages.js +15 -10
- package/lib/endpoints/inventory/zone-prices.js +15 -10
- package/lib/endpoints/invoices/emails.js +3 -2
- package/lib/endpoints/invoices/infile.js +3 -2
- package/lib/endpoints/invoices/pdfs.js +3 -2
- package/lib/endpoints/invoices/providers.js +15 -10
- package/lib/endpoints/invoices/tax-ids.js +3 -2
- package/lib/endpoints/loyalty/movements.js +9 -6
- package/lib/endpoints/loyalty/programs.js +9 -6
- package/lib/endpoints/notifications/customers.js +3 -2
- package/lib/endpoints/notifications/email.js +3 -2
- package/lib/endpoints/notifications/manifest-notifications.js +7 -4
- package/lib/endpoints/notifications/printed-tickets.js +3 -2
- package/lib/endpoints/operations/accounting_items.js +8 -4
- package/lib/endpoints/operations/applied_insurance.js +3 -2
- package/lib/endpoints/operations/calendar_entries.js +3 -2
- package/lib/endpoints/operations/flexpasses.js +3 -2
- package/lib/endpoints/operations/loans.js +8 -4
- package/lib/endpoints/operations/manifest.js +58 -20
- package/lib/endpoints/operations/movements.js +3 -2
- package/lib/endpoints/operations/outlook-trips.js +3 -2
- package/lib/endpoints/operations/parcels.js +9 -6
- package/lib/endpoints/operations/redemption.js +6 -4
- package/lib/endpoints/operations/scheduled_notifications.js +15 -10
- package/lib/endpoints/operations/segments.js +3 -2
- package/lib/endpoints/operations/tickets.js +9 -6
- package/lib/endpoints/operations/transaction.js +3 -2
- package/lib/endpoints/operations/transactions.js +21 -14
- package/lib/endpoints/operations/trip_change_info.js +3 -2
- package/lib/endpoints/operations/waitlists.js +12 -9
- package/lib/endpoints/reports/custom-reports.js +9 -6
- package/lib/endpoints/reports/report-types.js +6 -4
- package/lib/endpoints/sales/bundles.js +3 -2
- package/lib/endpoints/sales/cart-promo.js +6 -4
- package/lib/endpoints/sales/cart.js +18 -12
- package/lib/endpoints/sales/custom-fields.js +3 -2
- package/lib/endpoints/sales/flexpasses.js +3 -2
- package/lib/endpoints/sales/gift-certificates.js +3 -2
- package/lib/endpoints/sales/order.js +6 -4
- package/lib/endpoints/sales/payment-providers.js +3 -2
- package/lib/endpoints/sales/redeemable-items.js +6 -4
- package/lib/endpoints/sales/sync-entry.js +3 -2
- package/lib/endpoints/sales/voucher.js +3 -2
- package/lib/endpoints/seatmaps/access-ticket.js +3 -2
- package/lib/endpoints/seatmaps/seat.js +3 -2
- package/lib/endpoints/uploads/files.js +3 -2
- package/lib/endpoints/uploads/images.js +3 -2
- package/lib/endpoints/webhooks/events.js +3 -2
- package/lib/endpoints/webhooks/subscriptions.js +15 -10
- package/lib/endpoints/webhooks/undelivered.js +15 -10
- package/lib/endpoints/webhooks/webhooks.js +3 -2
- package/lib/initializedClient.js +6 -0
- package/package.json +2 -1
- package/src/client.js +1 -1
- package/src/endpoints/accounts/accounts.js +2 -2
- package/src/endpoints/accounts/application-settings.js +10 -10
- package/src/endpoints/accounts/application.js +2 -2
- package/src/endpoints/accounts/applications.js +4 -4
- package/src/endpoints/accounts/current-shifts.js +2 -2
- package/src/endpoints/accounts/customers.js +10 -10
- package/src/endpoints/accounts/domains.js +6 -6
- package/src/endpoints/accounts/email-settings.js +10 -10
- package/src/endpoints/accounts/exchange-rates.js +4 -4
- package/src/endpoints/accounts/interline.js +18 -18
- package/src/endpoints/accounts/lexicons.js +12 -8
- package/src/endpoints/accounts/print-settings.js +8 -8
- package/src/endpoints/accounts/printers.js +2 -2
- package/src/endpoints/accounts/shifts.js +2 -2
- package/src/endpoints/accounts/travellers.js +10 -10
- package/src/endpoints/accounts/trusted-machines.js +2 -2
- package/src/endpoints/accounts/users.js +4 -4
- package/src/endpoints/btrzpay/customerCards.js +8 -8
- package/src/endpoints/btrzpay/customers.js +6 -7
- package/src/endpoints/btrzpay/payment-methods.js +12 -12
- package/src/endpoints/btrzpay/payments.js +4 -4
- package/src/endpoints/btrzpay/reference-numbers.js +2 -2
- package/src/endpoints/btrzpay/referenced-payments.js +4 -4
- package/src/endpoints/btrzpay/square.js +4 -4
- package/src/endpoints/coltrane/paths.js +2 -2
- package/src/endpoints/gps/scanner-app-location.js +2 -2
- package/src/endpoints/inventory/amenities.js +8 -8
- package/src/endpoints/inventory/amenity-groups.js +8 -8
- package/src/endpoints/inventory/bare-routes.js +4 -4
- package/src/endpoints/inventory/brands.js +8 -8
- package/src/endpoints/inventory/bundle-fares.js +2 -2
- package/src/endpoints/inventory/bundles.js +4 -4
- package/src/endpoints/inventory/companies.js +2 -2
- package/src/endpoints/inventory/countries.js +2 -2
- package/src/endpoints/inventory/custom-content.js +11 -10
- package/src/endpoints/inventory/fare-classes.js +6 -6
- package/src/endpoints/inventory/fares.js +4 -4
- package/src/endpoints/inventory/fees.js +2 -2
- package/src/endpoints/inventory/filtered-trips-v2.js +2 -2
- package/src/endpoints/inventory/filtered-trips.js +2 -2
- package/src/endpoints/inventory/gift-certificate-definitions.js +2 -2
- package/src/endpoints/inventory/healthcheck.js +16 -0
- package/src/endpoints/inventory/insurances.js +10 -10
- package/src/endpoints/inventory/insurancesCost.js +2 -2
- package/src/endpoints/inventory/items.js +2 -2
- package/src/endpoints/inventory/journey-prices.js +6 -6
- package/src/endpoints/inventory/marketplace-modifiers.js +11 -10
- package/src/endpoints/inventory/operating-companies.js +8 -8
- package/src/endpoints/inventory/operation-messages.js +12 -12
- package/src/endpoints/inventory/parcel-zones.js +6 -6
- package/src/endpoints/inventory/payment-terminals.js +11 -10
- package/src/endpoints/inventory/products.js +4 -4
- package/src/endpoints/inventory/promos.js +14 -14
- package/src/endpoints/inventory/routes.js +14 -14
- package/src/endpoints/inventory/schedules.js +2 -2
- package/src/endpoints/inventory/seatfees.js +9 -8
- package/src/endpoints/inventory/seatmaps.js +2 -2
- package/src/endpoints/inventory/service-numbers.js +8 -8
- package/src/endpoints/inventory/service-types.js +11 -10
- package/src/endpoints/inventory/ssrs.js +2 -2
- package/src/endpoints/inventory/station-groups.js +2 -2
- package/src/endpoints/inventory/stations-zones.js +2 -2
- package/src/endpoints/inventory/stations.js +4 -4
- package/src/endpoints/inventory/taxes.js +8 -8
- package/src/endpoints/inventory/traveller-card-providers-types.js +2 -2
- package/src/endpoints/inventory/traveller-card-providers.js +8 -8
- package/src/endpoints/inventory/traveller-card-types.js +10 -10
- package/src/endpoints/inventory/trips.js +4 -4
- package/src/endpoints/inventory/zone-price-overages.js +11 -10
- package/src/endpoints/inventory/zone-prices.js +11 -10
- package/src/endpoints/invoices/emails.js +2 -2
- package/src/endpoints/invoices/infile.js +2 -2
- package/src/endpoints/invoices/pdfs.js +2 -2
- package/src/endpoints/invoices/providers.js +10 -10
- package/src/endpoints/invoices/tax-ids.js +2 -2
- package/src/endpoints/loyalty/movements.js +6 -6
- package/src/endpoints/loyalty/programs.js +6 -6
- package/src/endpoints/notifications/customers.js +2 -2
- package/src/endpoints/notifications/email.js +2 -2
- package/src/endpoints/notifications/manifest-notifications.js +6 -4
- package/src/endpoints/notifications/printed-tickets.js +2 -2
- package/src/endpoints/operations/accounting_items.js +7 -4
- package/src/endpoints/operations/applied_insurance.js +2 -2
- package/src/endpoints/operations/calendar_entries.js +2 -2
- package/src/endpoints/operations/flexpasses.js +2 -2
- package/src/endpoints/operations/loans.js +7 -4
- package/src/endpoints/operations/manifest.js +62 -22
- package/src/endpoints/operations/movements.js +2 -2
- package/src/endpoints/operations/outlook-trips.js +2 -2
- package/src/endpoints/operations/parcels.js +6 -6
- package/src/endpoints/operations/redemption.js +4 -4
- package/src/endpoints/operations/scheduled_notifications.js +10 -10
- package/src/endpoints/operations/segments.js +2 -2
- package/src/endpoints/operations/tickets.js +6 -6
- package/src/endpoints/operations/transaction.js +2 -2
- package/src/endpoints/operations/transactions.js +14 -14
- package/src/endpoints/operations/trip_change_info.js +2 -2
- package/src/endpoints/operations/waitlists.js +8 -9
- package/src/endpoints/reports/custom-reports.js +6 -6
- package/src/endpoints/reports/report-types.js +4 -4
- package/src/endpoints/sales/bundles.js +2 -2
- package/src/endpoints/sales/cart-promo.js +4 -4
- package/src/endpoints/sales/cart.js +12 -12
- package/src/endpoints/sales/custom-fields.js +2 -2
- package/src/endpoints/sales/flexpasses.js +2 -2
- package/src/endpoints/sales/gift-certificates.js +2 -2
- package/src/endpoints/sales/order.js +4 -4
- package/src/endpoints/sales/payment-providers.js +2 -2
- package/src/endpoints/sales/redeemable-items.js +4 -4
- package/src/endpoints/sales/sync-entry.js +2 -2
- package/src/endpoints/sales/voucher.js +2 -2
- package/src/endpoints/seatmaps/access-ticket.js +2 -2
- package/src/endpoints/seatmaps/seat.js +2 -2
- package/src/endpoints/uploads/files.js +2 -2
- package/src/endpoints/uploads/images.js +2 -2
- package/src/endpoints/webhooks/events.js +2 -2
- package/src/endpoints/webhooks/subscriptions.js +10 -10
- package/src/endpoints/webhooks/undelivered.js +10 -10
- package/src/endpoints/webhooks/webhooks.js +2 -2
- package/src/initializedClient.js +3 -0
- package/test/endpoints/operations/manifest.test.js +66 -17
|
@@ -12,12 +12,13 @@ function flexpassesEndpointsFactory(_ref) {
|
|
|
12
12
|
jwtToken = _ref2.jwtToken,
|
|
13
13
|
flexpassId = _ref2.flexpassId,
|
|
14
14
|
_ref2$query = _ref2.query,
|
|
15
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
15
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
16
|
+
headers = _ref2.headers;
|
|
16
17
|
|
|
17
18
|
return client({
|
|
18
19
|
url: "/flexpasses/" + flexpassId,
|
|
19
20
|
params: query,
|
|
20
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
21
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -11,12 +11,13 @@ function giftCertificatesFactory(_ref) {
|
|
|
11
11
|
var token = _ref2.token,
|
|
12
12
|
GCNumber = _ref2.GCNumber,
|
|
13
13
|
_ref2$query = _ref2.query,
|
|
14
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
14
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
15
|
+
headers = _ref2.headers;
|
|
15
16
|
|
|
16
17
|
return client({
|
|
17
18
|
url: "/gift-certificates/" + GCNumber,
|
|
18
19
|
params: query,
|
|
19
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
20
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -10,12 +10,13 @@ function orderFactory(_ref) {
|
|
|
10
10
|
function create(_ref2) {
|
|
11
11
|
var token = _ref2.token,
|
|
12
12
|
order = _ref2.order,
|
|
13
|
-
jwtToken = _ref2.jwtToken
|
|
13
|
+
jwtToken = _ref2.jwtToken,
|
|
14
|
+
headers = _ref2.headers;
|
|
14
15
|
|
|
15
16
|
return client({
|
|
16
17
|
url: "/order",
|
|
17
18
|
method: "post",
|
|
18
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
19
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
19
20
|
data: order
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -24,12 +25,13 @@ function orderFactory(_ref) {
|
|
|
24
25
|
var token = _ref3.token,
|
|
25
26
|
orderId = _ref3.orderId,
|
|
26
27
|
_ref3$query = _ref3.query,
|
|
27
|
-
query = _ref3$query === undefined ? {} : _ref3$query
|
|
28
|
+
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
29
|
+
headers = _ref3.headers;
|
|
28
30
|
|
|
29
31
|
return client({
|
|
30
32
|
url: "/order/" + orderId,
|
|
31
33
|
params: query,
|
|
32
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
34
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -12,11 +12,12 @@ function paymentProvidersFactory(_ref) {
|
|
|
12
12
|
var token = _ref2.token,
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
14
|
_ref2$query = _ref2.query,
|
|
15
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
15
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
16
|
+
headers = _ref2.headers;
|
|
16
17
|
|
|
17
18
|
return client.get("/payment-providers", {
|
|
18
19
|
params: query,
|
|
19
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
20
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -12,12 +12,13 @@ function redeemableItemsFactory(_ref) {
|
|
|
12
12
|
var token = _ref2.token,
|
|
13
13
|
redeemableItemId = _ref2.redeemableItemId,
|
|
14
14
|
_ref2$query = _ref2.query,
|
|
15
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
15
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
16
|
+
headers = _ref2.headers;
|
|
16
17
|
|
|
17
18
|
return client({
|
|
18
19
|
url: "/redeemable-items/" + redeemableItemId,
|
|
19
20
|
params: query,
|
|
20
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
21
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -25,12 +26,13 @@ function redeemableItemsFactory(_ref) {
|
|
|
25
26
|
var token = _ref3.token,
|
|
26
27
|
jwtToken = _ref3.jwtToken,
|
|
27
28
|
_ref3$query = _ref3.query,
|
|
28
|
-
query = _ref3$query === undefined ? {} : _ref3$query
|
|
29
|
+
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
30
|
+
headers = _ref3.headers;
|
|
29
31
|
|
|
30
32
|
return client({
|
|
31
33
|
url: "/redeemable-items",
|
|
32
34
|
params: query,
|
|
33
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken })
|
|
35
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, headers: headers })
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -11,12 +11,13 @@ function syncEntryFactory(_ref) {
|
|
|
11
11
|
function patch(_ref2) {
|
|
12
12
|
var token = _ref2.token,
|
|
13
13
|
data = _ref2.data,
|
|
14
|
-
jwtToken = _ref2.jwtToken
|
|
14
|
+
jwtToken = _ref2.jwtToken,
|
|
15
|
+
headers = _ref2.headers;
|
|
15
16
|
|
|
16
17
|
return client({
|
|
17
18
|
url: "/sync-entry",
|
|
18
19
|
method: "patch",
|
|
19
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
20
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
20
21
|
data: data
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -9,12 +9,13 @@ function voucherFactory(_ref) {
|
|
|
9
9
|
|
|
10
10
|
function get(_ref2) {
|
|
11
11
|
var token = _ref2.token,
|
|
12
|
-
voucher = _ref2.voucher
|
|
12
|
+
voucher = _ref2.voucher,
|
|
13
|
+
headers = _ref2.headers;
|
|
13
14
|
|
|
14
15
|
return client({
|
|
15
16
|
// eslint-disable-next-line max-len
|
|
16
17
|
url: "/vouchers/" + voucher.number + "?cartId=" + voucher.cartId + "&firstName=" + voucher.firstName + "&lastName=" + voucher.lastName + "&displayCurrencyCode=" + (voucher.displayCurrencyCode || ""),
|
|
17
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
18
|
+
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -10,12 +10,13 @@ function accessTicketFactory(_ref) {
|
|
|
10
10
|
|
|
11
11
|
function create(_ref2) {
|
|
12
12
|
var token = _ref2.token,
|
|
13
|
-
jwtToken = _ref2.jwtToken
|
|
13
|
+
jwtToken = _ref2.jwtToken,
|
|
14
|
+
headers = _ref2.headers;
|
|
14
15
|
|
|
15
16
|
return client({
|
|
16
17
|
url: "/access-ticket",
|
|
17
18
|
method: "post",
|
|
18
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
19
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -11,12 +11,13 @@ function seatFactory(_ref) {
|
|
|
11
11
|
function update(_ref2) {
|
|
12
12
|
var token = _ref2.token,
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
|
-
params = _ref2.params
|
|
14
|
+
params = _ref2.params,
|
|
15
|
+
headers = _ref2.headers;
|
|
15
16
|
|
|
16
17
|
return client({
|
|
17
18
|
url: "/seat",
|
|
18
19
|
method: "post",
|
|
19
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
20
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
20
21
|
params: params
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -12,7 +12,8 @@ function filesFactory(_ref) {
|
|
|
12
12
|
|
|
13
13
|
function upload(_ref2) {
|
|
14
14
|
var token = _ref2.token,
|
|
15
|
-
formData = _ref2.formData
|
|
15
|
+
formData = _ref2.formData,
|
|
16
|
+
headers = _ref2.headers;
|
|
16
17
|
|
|
17
18
|
// Only required to support integration tests
|
|
18
19
|
var formHeaders = typeof formData.getHeaders === "function" ? formData.getHeaders() : {};
|
|
@@ -20,7 +21,7 @@ function filesFactory(_ref) {
|
|
|
20
21
|
return client({
|
|
21
22
|
url: "/files",
|
|
22
23
|
method: "post",
|
|
23
|
-
headers: _extends({}, authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider }), formHeaders),
|
|
24
|
+
headers: _extends({}, authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }), formHeaders),
|
|
24
25
|
data: formData
|
|
25
26
|
});
|
|
26
27
|
}
|
|
@@ -12,7 +12,8 @@ function imagesFactory(_ref) {
|
|
|
12
12
|
|
|
13
13
|
function create(_ref2) {
|
|
14
14
|
var token = _ref2.token,
|
|
15
|
-
formData = _ref2.formData
|
|
15
|
+
formData = _ref2.formData,
|
|
16
|
+
headers = _ref2.headers;
|
|
16
17
|
|
|
17
18
|
// Only required to support integration tests
|
|
18
19
|
var formHeaders = typeof formData.getHeaders === "function" ? formData.getHeaders() : {};
|
|
@@ -20,7 +21,7 @@ function imagesFactory(_ref) {
|
|
|
20
21
|
return client({
|
|
21
22
|
url: "/images",
|
|
22
23
|
method: "post",
|
|
23
|
-
headers: _extends({}, authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider }), formHeaders),
|
|
24
|
+
headers: _extends({}, authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }), formHeaders),
|
|
24
25
|
data: formData
|
|
25
26
|
});
|
|
26
27
|
}
|
|
@@ -13,14 +13,15 @@ function eventsFactory(_ref) {
|
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
14
|
context = _ref2.context,
|
|
15
15
|
_ref2$query = _ref2.query,
|
|
16
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
16
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
17
|
+
headers = _ref2.headers;
|
|
17
18
|
|
|
18
19
|
var queryObj = Object.assign({}, query, { context: context });
|
|
19
20
|
|
|
20
21
|
return client({
|
|
21
22
|
url: "/events",
|
|
22
23
|
params: queryObj,
|
|
23
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
24
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -13,38 +13,41 @@ function subscriptionsFactory(_ref) {
|
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
14
|
context = _ref2.context,
|
|
15
15
|
_ref2$query = _ref2.query,
|
|
16
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
16
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
17
|
+
headers = _ref2.headers;
|
|
17
18
|
|
|
18
19
|
var queryObj = Object.assign({}, query, { context: context });
|
|
19
20
|
|
|
20
21
|
return client({
|
|
21
22
|
url: "/subscriptions",
|
|
22
23
|
params: queryObj,
|
|
23
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
24
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function getById(_ref3) {
|
|
28
29
|
var token = _ref3.token,
|
|
29
30
|
jwtToken = _ref3.jwtToken,
|
|
30
|
-
id = _ref3.id
|
|
31
|
+
id = _ref3.id,
|
|
32
|
+
headers = _ref3.headers;
|
|
31
33
|
|
|
32
34
|
return client({
|
|
33
35
|
url: "/subscriptions/" + id,
|
|
34
36
|
method: "get",
|
|
35
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
37
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function create(_ref4) {
|
|
40
42
|
var token = _ref4.token,
|
|
41
43
|
jwtToken = _ref4.jwtToken,
|
|
42
|
-
subscription = _ref4.subscription
|
|
44
|
+
subscription = _ref4.subscription,
|
|
45
|
+
headers = _ref4.headers;
|
|
43
46
|
|
|
44
47
|
return client({
|
|
45
48
|
url: "/subscriptions",
|
|
46
49
|
method: "post",
|
|
47
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
50
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
48
51
|
data: subscription
|
|
49
52
|
});
|
|
50
53
|
}
|
|
@@ -53,12 +56,13 @@ function subscriptionsFactory(_ref) {
|
|
|
53
56
|
var token = _ref5.token,
|
|
54
57
|
jwtToken = _ref5.jwtToken,
|
|
55
58
|
id = _ref5.id,
|
|
56
|
-
subscription = _ref5.subscription
|
|
59
|
+
subscription = _ref5.subscription,
|
|
60
|
+
headers = _ref5.headers;
|
|
57
61
|
|
|
58
62
|
return client({
|
|
59
63
|
url: "/subscriptions/" + id,
|
|
60
64
|
method: "put",
|
|
61
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
65
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
62
66
|
data: subscription
|
|
63
67
|
});
|
|
64
68
|
}
|
|
@@ -66,12 +70,13 @@ function subscriptionsFactory(_ref) {
|
|
|
66
70
|
function deleteById(_ref6) {
|
|
67
71
|
var token = _ref6.token,
|
|
68
72
|
jwtToken = _ref6.jwtToken,
|
|
69
|
-
id = _ref6.id
|
|
73
|
+
id = _ref6.id,
|
|
74
|
+
headers = _ref6.headers;
|
|
70
75
|
|
|
71
76
|
return client({
|
|
72
77
|
url: "/subscriptions/" + id,
|
|
73
78
|
method: "delete",
|
|
74
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
79
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -13,38 +13,41 @@ function undeliveredFactory(_ref) {
|
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
14
|
context = _ref2.context,
|
|
15
15
|
_ref2$query = _ref2.query,
|
|
16
|
-
query = _ref2$query === undefined ? {} : _ref2$query
|
|
16
|
+
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
17
|
+
headers = _ref2.headers;
|
|
17
18
|
|
|
18
19
|
var queryObj = Object.assign({}, query, { context: context });
|
|
19
20
|
|
|
20
21
|
return client({
|
|
21
22
|
url: "/undelivered",
|
|
22
23
|
params: queryObj,
|
|
23
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
24
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function getById(_ref3) {
|
|
28
29
|
var token = _ref3.token,
|
|
29
30
|
jwtToken = _ref3.jwtToken,
|
|
30
|
-
id = _ref3.id
|
|
31
|
+
id = _ref3.id,
|
|
32
|
+
headers = _ref3.headers;
|
|
31
33
|
|
|
32
34
|
return client({
|
|
33
35
|
url: "/undelivered/" + id,
|
|
34
36
|
method: "get",
|
|
35
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
37
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function patch(_ref4) {
|
|
40
42
|
var token = _ref4.token,
|
|
41
43
|
jwtToken = _ref4.jwtToken,
|
|
42
|
-
operation = _ref4.operation
|
|
44
|
+
operation = _ref4.operation,
|
|
45
|
+
headers = _ref4.headers;
|
|
43
46
|
|
|
44
47
|
return client({
|
|
45
48
|
url: "/undelivered",
|
|
46
49
|
method: "patch",
|
|
47
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
50
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
48
51
|
data: operation
|
|
49
52
|
});
|
|
50
53
|
}
|
|
@@ -52,23 +55,25 @@ function undeliveredFactory(_ref) {
|
|
|
52
55
|
function resend(_ref5) {
|
|
53
56
|
var token = _ref5.token,
|
|
54
57
|
jwtToken = _ref5.jwtToken,
|
|
55
|
-
id = _ref5.id
|
|
58
|
+
id = _ref5.id,
|
|
59
|
+
headers = _ref5.headers;
|
|
56
60
|
|
|
57
61
|
return client({
|
|
58
62
|
url: "/undelivered/" + id + "/retry",
|
|
59
63
|
method: "put",
|
|
60
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
64
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
function resendAll(_ref6) {
|
|
65
69
|
var token = _ref6.token,
|
|
66
|
-
jwtToken = _ref6.jwtToken
|
|
70
|
+
jwtToken = _ref6.jwtToken,
|
|
71
|
+
headers = _ref6.headers;
|
|
67
72
|
|
|
68
73
|
return client({
|
|
69
74
|
url: "/undelivered/retry-all",
|
|
70
75
|
method: "put",
|
|
71
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider })
|
|
76
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
72
77
|
});
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -11,12 +11,13 @@ function webhooksFactory(_ref) {
|
|
|
11
11
|
function emit(_ref2) {
|
|
12
12
|
var token = _ref2.token,
|
|
13
13
|
jwtToken = _ref2.jwtToken,
|
|
14
|
-
webhook = _ref2.webhook
|
|
14
|
+
webhook = _ref2.webhook,
|
|
15
|
+
headers = _ref2.headers;
|
|
15
16
|
|
|
16
17
|
return client({
|
|
17
18
|
url: "/emit",
|
|
18
19
|
method: "post",
|
|
19
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
20
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
20
21
|
data: webhook
|
|
21
22
|
});
|
|
22
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "btrz-api-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.42.1",
|
|
4
4
|
"description": "Api client for Betterez endpoints",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"browserify": "browserify lib/client.js --standalone BtrzApiClient -p tinyify -o lib/client-standalone-min.js",
|
|
11
11
|
"commit-transpile": "git add lib/ && (git diff-index --quiet HEAD || git commit -m \"transpiled src\")",
|
|
12
12
|
"pretranspile": "rm -rf lib/",
|
|
13
|
+
"types": "npx -p typescript tsc src/**.js --declaration --allowJs --emitDeclarationOnly --outDir types",
|
|
13
14
|
"transpile": "babel --presets es2015 -d lib/ src/",
|
|
14
15
|
"preversion": "npm test && npm run transpile && npm run browserify && npm run commit-transpile",
|
|
15
16
|
"postversion": "git push origin master && git push --tags",
|
package/src/client.js
CHANGED
|
@@ -83,6 +83,7 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
|
|
|
83
83
|
travellerCardProvidersTypes: require("./endpoints/inventory/traveller-card-providers-types.js")({client, internalAuthTokenProvider}),
|
|
84
84
|
travellerCardTypes: require("./endpoints/inventory/traveller-card-types.js")({client, internalAuthTokenProvider}),
|
|
85
85
|
marketplaceModifiers: require("./endpoints/inventory/marketplace-modifiers.js")({client, internalAuthTokenProvider}),
|
|
86
|
+
healthCheck: require("./endpoints/inventory/healthcheck.js")({client, internalAuthTokenProvider}),
|
|
86
87
|
__test: {
|
|
87
88
|
client
|
|
88
89
|
}
|
|
@@ -332,7 +333,6 @@ function createGPS({baseURL, headers, timeout, overrideFn, internalAuthTokenProv
|
|
|
332
333
|
* returns an authorization token that's valid for making service-to-service API calls.
|
|
333
334
|
* @param {Function} options.internalAuthTokenProvider.getToken
|
|
334
335
|
* @param {{httpAgent: import("http").Agent, httpsAgent: import("https").Agent}} options.agents - An object containg one or both http agents
|
|
335
|
-
* @returns {Object} An object with a client for every "module" (needed to override baseURL)
|
|
336
336
|
*/
|
|
337
337
|
function createApiClient(options) {
|
|
338
338
|
const {baseURL, baseURLOverride = {}, headers, timeout = 0, internalAuthTokenProvider, agents} = options || productionOptions;
|
|
@@ -3,10 +3,10 @@ const {
|
|
|
3
3
|
} = require("./../endpoints_helpers");
|
|
4
4
|
|
|
5
5
|
function accountsFactory({client, internalAuthTokenProvider}) {
|
|
6
|
-
function get({jwtToken, accountId}) {
|
|
6
|
+
function get({jwtToken, accountId, headers}) {
|
|
7
7
|
return client({
|
|
8
8
|
url: `/accounts/${accountId}`,
|
|
9
|
-
headers: authorizationHeaders({jwtToken, internalAuthTokenProvider})
|
|
9
|
+
headers: authorizationHeaders({jwtToken, internalAuthTokenProvider, headers})
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function applicationSettingsFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function get({token, providerId, jwtToken, query = {}}) {
|
|
4
|
+
function get({token, providerId, jwtToken, query = {}, headers}) {
|
|
5
5
|
return client.get(`/application-settings/${providerId}`, {
|
|
6
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
6
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
7
7
|
params: query
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function update({jwtToken, token, id, application}) {
|
|
11
|
+
function update({jwtToken, token, id, application, headers}) {
|
|
12
12
|
return client({
|
|
13
13
|
url: `/application-settings/${id}`,
|
|
14
14
|
method: "put",
|
|
15
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
15
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
16
16
|
data: {application}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function remove({jwtToken, token, id}) {
|
|
20
|
+
function remove({jwtToken, token, id, headers}) {
|
|
21
21
|
return client({
|
|
22
22
|
url: `/application-settings/${id}`,
|
|
23
23
|
method: "delete",
|
|
24
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
24
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function regenerateKeys({jwtToken, token, id}) {
|
|
28
|
+
function regenerateKeys({jwtToken, token, id, headers}) {
|
|
29
29
|
return client({
|
|
30
30
|
url: `/application-settings/${id}/keys`,
|
|
31
31
|
method: "post",
|
|
32
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
32
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function create({jwtToken, token, application}) {
|
|
36
|
+
function create({jwtToken, token, application, headers}) {
|
|
37
37
|
return client({
|
|
38
38
|
url: "/application-settings",
|
|
39
39
|
method: "post",
|
|
40
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
40
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
41
41
|
data: {application}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function get({token, jwtToken}) {
|
|
4
|
+
function get({token, jwtToken, headers}) {
|
|
5
5
|
return client.get("/application", {
|
|
6
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
6
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function get({token, id, jwtToken}) {
|
|
4
|
+
function get({token, id, jwtToken, headers}) {
|
|
5
5
|
return client.get(`/applications/${id}`, {
|
|
6
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
6
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
|
-
function getByName({token, appName, jwtToken}) {
|
|
9
|
+
function getByName({token, appName, jwtToken, headers}) {
|
|
10
10
|
return client.get(`/applications/name/${appName}`, {
|
|
11
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
11
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -2,9 +2,9 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function currentShiftsFactory({client, internalAuthTokenProvider}) {
|
|
4
4
|
|
|
5
|
-
function get({token, userId, query = {}}) {
|
|
5
|
+
function get({token, userId, query = {}, headers}) {
|
|
6
6
|
return client.get(`/users/${userId}/current-shift`, {
|
|
7
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider}),
|
|
7
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers}),
|
|
8
8
|
params: query
|
|
9
9
|
});
|
|
10
10
|
}
|
|
@@ -4,28 +4,28 @@ const {
|
|
|
4
4
|
} = require("./../endpoints_helpers");
|
|
5
5
|
|
|
6
6
|
function customersFactory({client, internalAuthTokenProvider}) {
|
|
7
|
-
function put({customerId, customer, token, jwtToken}) {
|
|
7
|
+
function put({customerId, customer, token, jwtToken, headers}) {
|
|
8
8
|
return client({
|
|
9
9
|
url: `/customers/${customerId}`,
|
|
10
10
|
method: "put",
|
|
11
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
11
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
12
12
|
data: customer
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function all({token, jwtToken, query = {}}) {
|
|
16
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
17
17
|
return client({
|
|
18
18
|
url: "/customers",
|
|
19
19
|
params: query,
|
|
20
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
20
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function create({customer, token, jwtToken, query}) {
|
|
24
|
+
function create({customer, token, jwtToken, query, headers}) {
|
|
25
25
|
return client({
|
|
26
26
|
url: "/customer",
|
|
27
27
|
method: "post",
|
|
28
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
28
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
29
29
|
data: {customer},
|
|
30
30
|
params: query,
|
|
31
31
|
});
|
|
@@ -47,11 +47,11 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function signInCas({service, ticket, token}) {
|
|
50
|
+
function signInCas({service, ticket, token, headers}) {
|
|
51
51
|
return client({
|
|
52
52
|
url: "/customers/cas",
|
|
53
53
|
headers: authorizationHeaders({
|
|
54
|
-
token, internalAuthTokenProvider
|
|
54
|
+
token, internalAuthTokenProvider, headers
|
|
55
55
|
}),
|
|
56
56
|
method: "post",
|
|
57
57
|
data: {
|
|
@@ -61,12 +61,12 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function update({customerId, token, jwtToken, data, query}) {
|
|
64
|
+
function update({customerId, token, jwtToken, data, query, headers}) {
|
|
65
65
|
return client({
|
|
66
66
|
url: `/customers/${customerId}`,
|
|
67
67
|
method: "patch",
|
|
68
68
|
params: query,
|
|
69
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
69
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
70
70
|
data
|
|
71
71
|
});
|
|
72
72
|
}
|