btrz-api-client 3.34.0 → 3.41.0
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 +8 -5
- 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 +57 -0
- 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/endpoints_helpers.js +28 -6
- 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 +30 -0
- 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/package.json +1 -1
- package/src/client.js +8 -5
- 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 +38 -0
- 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/endpoints_helpers.js +25 -6
- 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 +18 -0
- 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/test/endpoints/accounts/domains.test.js +61 -0
- package/test/endpoints/endpoints_helpers.test.js +54 -0
- package/test/endpoints/operations/manifest.test.js +66 -17
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function usersFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function get({token, jwtToken, id} = {}) {
|
|
4
|
+
function get({token, jwtToken, id, headers} = {}) {
|
|
5
5
|
return client({
|
|
6
6
|
url: `/user/${id}`,
|
|
7
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
7
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function all({token, jwtToken, query = {}}) {
|
|
11
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
12
12
|
return client({
|
|
13
13
|
url: "/users",
|
|
14
14
|
params: query,
|
|
15
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
15
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("../endpoints_helpers");
|
|
2
2
|
function customerCardsFactory({client, internalAuthTokenProvider}) {
|
|
3
3
|
|
|
4
|
-
function get({token, jwtToken, paymentMethodId, customerId, customerCardId}) {
|
|
4
|
+
function get({token, jwtToken, paymentMethodId, customerId, customerCardId, headers}) {
|
|
5
5
|
return client.get(`/payment-methods/${paymentMethodId}/customers/${customerId}/cards/${customerCardId}`, {
|
|
6
6
|
params: {},
|
|
7
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
7
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function all({token, jwtToken, paymentMethodId, customerId}) {
|
|
11
|
+
function all({token, jwtToken, paymentMethodId, customerId, headers}) {
|
|
12
12
|
return client.get(`/payment-methods/${paymentMethodId}/customers/${customerId}/cards`, {
|
|
13
13
|
params: {},
|
|
14
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
14
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function create({token, jwtToken, paymentMethodId, customerId, customerCard}) {
|
|
18
|
+
function create({token, jwtToken, paymentMethodId, customerId, customerCard, headers}) {
|
|
19
19
|
return client({
|
|
20
20
|
url: `/payment-methods/${paymentMethodId}/customers/${customerId}/cards`,
|
|
21
21
|
method: "post",
|
|
22
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
22
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
23
23
|
data: {customerCard}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function remove({token, jwtToken, paymentMethodId, customerId, customerCardId}) {
|
|
27
|
+
function remove({token, jwtToken, paymentMethodId, customerId, customerCardId, headers}) {
|
|
28
28
|
return client({
|
|
29
29
|
url: `/payment-methods/${paymentMethodId}/customers/${customerId}/cards/${customerCardId}`,
|
|
30
30
|
method: "delete",
|
|
31
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
31
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("../endpoints_helpers");
|
|
2
2
|
function customersFactory({client, internalAuthTokenProvider}) {
|
|
3
|
-
|
|
4
|
-
function get({token, jwtToken, paymentMethodId, customerId}) {
|
|
3
|
+
function get({token, jwtToken, paymentMethodId, customerId, headers}) {
|
|
5
4
|
return client.get(`/payment-methods/${paymentMethodId}/customers/${customerId}`, {
|
|
6
5
|
params: {},
|
|
7
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
6
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
8
7
|
});
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
function create({token, jwtToken, paymentMethodId, customer}) {
|
|
10
|
+
function create({token, jwtToken, paymentMethodId, customer, headers}) {
|
|
12
11
|
return client({
|
|
13
12
|
url: `/payment-methods/${paymentMethodId}/customers`,
|
|
14
13
|
method: "post",
|
|
15
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
14
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
16
15
|
data: {customer}
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
function remove({token, jwtToken, paymentMethodId, customerId}) {
|
|
19
|
+
function remove({token, jwtToken, paymentMethodId, customerId, headers}) {
|
|
21
20
|
return client({
|
|
22
21
|
url: `/payment-methods/${paymentMethodId}/customers/${customerId}`,
|
|
23
22
|
method: "delete",
|
|
24
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
23
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function paymentMethodsFactory({ client, internalAuthTokenProvider }) {
|
|
4
|
-
function all({token, jwtToken, query = {}}) {
|
|
4
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
5
5
|
return client.get("/payment-methods", {
|
|
6
6
|
params: query,
|
|
7
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
7
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function getByProviderName({ token, jwtToken, providerName }) { //deprecated
|
|
11
|
+
function getByProviderName({ token, jwtToken, providerName, headers }) { //deprecated
|
|
12
12
|
return client({
|
|
13
13
|
url: `/payment-methods?providerName=${providerName}`,
|
|
14
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
14
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function create({ token, jwtToken, paymentMethod }) {
|
|
18
|
+
function create({ token, jwtToken, paymentMethod, headers }) {
|
|
19
19
|
return client({
|
|
20
20
|
url: "/payment-methods",
|
|
21
21
|
method: "post",
|
|
22
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
22
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
23
23
|
data: { paymentMethod }
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function get({ token, jwtToken, paymentMethodId }) {
|
|
27
|
+
function get({ token, jwtToken, paymentMethodId, headers }) {
|
|
28
28
|
return client.get(`/payment-methods/${paymentMethodId}`, {
|
|
29
29
|
params: {},
|
|
30
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
30
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function update({ token, jwtToken, paymentMethodId, paymentMethod }) {
|
|
34
|
+
function update({ token, jwtToken, paymentMethodId, paymentMethod, headers }) {
|
|
35
35
|
return client({
|
|
36
36
|
url: `/payment-methods/${paymentMethodId}`,
|
|
37
37
|
method: "put",
|
|
38
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
38
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
39
39
|
data: { paymentMethod }
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function setToAgency({token, jwtToken, agencyId, providerId, paymentMethodNames}) {
|
|
43
|
+
function setToAgency({token, jwtToken, agencyId, providerId, paymentMethodNames, headers}) {
|
|
44
44
|
return client({
|
|
45
45
|
url: "/payment-methods-to-agencies",
|
|
46
46
|
method: "post",
|
|
47
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
47
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
48
48
|
data: {providerId, agencyId, paymentMethodNames}
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -2,19 +2,19 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function paymentsFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function create({ token, jwtToken, payments }) {
|
|
5
|
+
function create({ token, jwtToken, payments, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/payments",
|
|
8
8
|
method: "post",
|
|
9
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
10
10
|
data: { payments }
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function get({ token, jwtToken, transactionId }) {
|
|
14
|
+
function get({ token, jwtToken, transactionId, headers }) {
|
|
15
15
|
return client.get(`/transactions/${transactionId}`, {
|
|
16
16
|
params: {},
|
|
17
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
17
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -2,11 +2,11 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function referenceNumbersFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function create({ token, jwtToken, referenceNumberRequest }) {
|
|
5
|
+
function create({ token, jwtToken, referenceNumberRequest, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/reference-numbers",
|
|
8
8
|
method: "post",
|
|
9
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
10
10
|
data: { referenceNumberRequest }
|
|
11
11
|
});
|
|
12
12
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function referencedPaymentsFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function getStatus({token, jwtToken, transactionId, referenceNumber}) {
|
|
4
|
+
function getStatus({token, jwtToken, transactionId, referenceNumber, headers}) {
|
|
5
5
|
return client.get(`/referenced-payments/${transactionId}/${referenceNumber}/status`, {
|
|
6
6
|
params: {},
|
|
7
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
7
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function update({token, jwtToken, externalType, referenceNumber, paymentResult}) {
|
|
11
|
+
function update({token, jwtToken, externalType, referenceNumber, paymentResult, headers}) {
|
|
12
12
|
return client({
|
|
13
13
|
url: `/referenced-payments/${externalType}/${referenceNumber}/results`,
|
|
14
14
|
method: "post",
|
|
15
|
-
headers: authorizationHeaders({token, jwtToken}),
|
|
15
|
+
headers: authorizationHeaders({token, jwtToken, headers}),
|
|
16
16
|
data: {paymentResult}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
@@ -3,11 +3,11 @@ const {
|
|
|
3
3
|
} = require("./../endpoints_helpers");
|
|
4
4
|
|
|
5
5
|
function squareWebhooksFactory({client, internalAuthTokenProvider}) {
|
|
6
|
-
function create({token, jwtToken, data, providerId}) {
|
|
6
|
+
function create({token, jwtToken, data, providerId, headers}) {
|
|
7
7
|
return client({
|
|
8
8
|
url: `/square-webhooks/${providerId}`,
|
|
9
9
|
method: "post",
|
|
10
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
10
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
11
11
|
data
|
|
12
12
|
});
|
|
13
13
|
}
|
|
@@ -18,11 +18,11 @@ function squareWebhooksFactory({client, internalAuthTokenProvider}) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function squareTerminalsFactory({client, internalAuthTokenProvider}) {
|
|
21
|
-
function get({token, jwtToken}) {
|
|
21
|
+
function get({token, jwtToken, headers}) {
|
|
22
22
|
return client.get("/square-terminals", {
|
|
23
23
|
params: {},
|
|
24
24
|
headers: authorizationHeaders({
|
|
25
|
-
token, jwtToken, internalAuthTokenProvider
|
|
25
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
26
26
|
})
|
|
27
27
|
});
|
|
28
28
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function coltraneFactory({ client, internalAuthTokenProvider }) {
|
|
4
|
-
function all({ token, query = {} }) {
|
|
4
|
+
function all({ token, query = {}, headers }) {
|
|
5
5
|
return client({
|
|
6
6
|
url: "/paths",
|
|
7
7
|
params: query,
|
|
8
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
8
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const constants = require("../constants");
|
|
2
2
|
|
|
3
3
|
function authorizationHeaders({
|
|
4
|
-
token, jwtToken, internalAuthTokenProvider
|
|
4
|
+
token, jwtToken, internalAuthTokenProvider, headers
|
|
5
5
|
}) {
|
|
6
|
-
const
|
|
6
|
+
const _headers = {};
|
|
7
7
|
|
|
8
8
|
if (token) {
|
|
9
|
-
|
|
9
|
+
_headers["x-api-key"] = `${token}`;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
if (jwtToken && jwtToken === constants.INTERNAL_AUTH_TOKEN_SYMBOL) {
|
|
@@ -14,12 +14,31 @@ function authorizationHeaders({
|
|
|
14
14
|
throw new Error("Tried to make an internal API request, but no 'internalAuthTokenProvider' with a 'getToken' function " +
|
|
15
15
|
"was supplied to the API client");
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
_headers.authorization = `Bearer ${internalAuthTokenProvider.getToken()}`;
|
|
18
18
|
} else if (jwtToken) {
|
|
19
|
-
|
|
19
|
+
_headers.authorization = `Bearer ${jwtToken}`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
try {
|
|
23
|
+
if (headers && typeof headers === "object" && !Array.isArray(headers)) {
|
|
24
|
+
Object.keys(headers).forEach((key) => {
|
|
25
|
+
if (_headers[key]) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (key === "x-amzn-trace-id") {
|
|
29
|
+
if (headers[key]) {
|
|
30
|
+
_headers[key] = headers[key];
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
_headers[key] = headers[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.log(e);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return _headers;
|
|
23
42
|
}
|
|
24
43
|
|
|
25
44
|
module.exports = {
|
|
@@ -2,10 +2,10 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
2
2
|
|
|
3
3
|
//TODO: add docs function when docs published
|
|
4
4
|
function scannerAppLocationFactory({client}) {
|
|
5
|
-
function get({token, query = {}}) {
|
|
5
|
+
function get({token, query = {}, headers}) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/scanner-app-location",
|
|
8
|
-
headers: authorizationHeaders({token}),
|
|
8
|
+
headers: authorizationHeaders({token, headers}),
|
|
9
9
|
params: query
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -2,34 +2,34 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function amenitiesFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, query = {} }) {
|
|
5
|
+
function all({ token, query = {}, headers }) {
|
|
6
6
|
return client.get("/amenities", {
|
|
7
7
|
params: query,
|
|
8
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
8
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function get({ token, amenityId, query = {} }) {
|
|
12
|
+
function get({ token, amenityId, query = {}, headers }) {
|
|
13
13
|
return client.get(`/amenities/${amenityId}`, {
|
|
14
14
|
params: query,
|
|
15
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
15
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function create({ token, jwtToken, amenity }) {
|
|
19
|
+
function create({ token, jwtToken, amenity, headers }) {
|
|
20
20
|
return client({
|
|
21
21
|
url: "/amenities",
|
|
22
22
|
method: "post",
|
|
23
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
23
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
24
24
|
data: { amenity }
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function update({ token, jwtToken, amenityId, amenity }) {
|
|
28
|
+
function update({ token, jwtToken, amenityId, amenity, headers }) {
|
|
29
29
|
return client({
|
|
30
30
|
url: `/amenities/${amenityId}`,
|
|
31
31
|
method: "put",
|
|
32
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
32
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
33
33
|
data: { amenity }
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -2,34 +2,34 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function amenityGroupsFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, query = {} }) {
|
|
5
|
+
function all({ token, query = {}, headers }) {
|
|
6
6
|
return client.get("/amenity-groups", {
|
|
7
7
|
params: query,
|
|
8
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
8
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function get({ token, amenityGroupId, query = {} }) {
|
|
12
|
+
function get({ token, amenityGroupId, query = {}, headers }) {
|
|
13
13
|
return client.get(`/amenity-groups/${amenityGroupId}`, {
|
|
14
14
|
params: query,
|
|
15
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
15
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function create({ token, jwtToken, amenityGroup }) {
|
|
19
|
+
function create({ token, jwtToken, amenityGroup, headers }) {
|
|
20
20
|
return client({
|
|
21
21
|
url: "/amenity-groups",
|
|
22
22
|
method: "post",
|
|
23
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
23
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
24
24
|
data: { amenityGroup }
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function update({ token, jwtToken, amenityGroupId, amenityGroup }) {
|
|
28
|
+
function update({ token, jwtToken, amenityGroupId, amenityGroup, headers }) {
|
|
29
29
|
return client({
|
|
30
30
|
url: `/amenity-groups/${amenityGroupId}`,
|
|
31
31
|
method: "put",
|
|
32
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
32
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
33
33
|
data: { amenityGroup }
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
2
2
|
|
|
3
3
|
function bareRoutesFactory({client, internalAuthTokenProvider}) {
|
|
4
|
-
function all({token, query = {}}) {
|
|
4
|
+
function all({token, query = {}, headers}) {
|
|
5
5
|
return client({
|
|
6
6
|
url: "/bare-routes",
|
|
7
7
|
params: query,
|
|
8
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
8
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function get({routeId, token, query = {}}) {
|
|
12
|
+
function get({routeId, token, query = {}, headers}) {
|
|
13
13
|
return client({
|
|
14
14
|
url: `/bare-routes/${routeId}`,
|
|
15
15
|
params: query,
|
|
16
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
16
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -2,37 +2,37 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function brandsFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, jwtToken, query = {} }) {
|
|
5
|
+
function all({ token, jwtToken, query = {}, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/brands",
|
|
8
8
|
params: query,
|
|
9
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function create({ token, jwtToken, brand }) {
|
|
13
|
+
function create({ token, jwtToken, brand, headers }) {
|
|
14
14
|
return client({
|
|
15
15
|
url: "/brands",
|
|
16
16
|
method: "post",
|
|
17
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
17
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
18
18
|
data: { brand }
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function update({ jwtToken, token, brandId, brand }) {
|
|
22
|
+
function update({ jwtToken, token, brandId, brand, headers }) {
|
|
23
23
|
return client({
|
|
24
24
|
url: `/brands/${brandId}`,
|
|
25
25
|
method: "put",
|
|
26
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
26
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
27
27
|
data: { brand }
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function get({token, brandId, jwtToken}) {
|
|
31
|
+
function get({token, brandId, jwtToken, headers}) {
|
|
32
32
|
return client({
|
|
33
33
|
url: `/brands/${brandId}`,
|
|
34
34
|
method: "get",
|
|
35
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken}),
|
|
35
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken, headers}),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -2,10 +2,10 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function bundleFaresFactory({client, internalAuthTokenProvider}) {
|
|
4
4
|
|
|
5
|
-
function all({ token, bundleId, productId, query = {} }) {
|
|
5
|
+
function all({ token, bundleId, productId, query = {}, headers }) {
|
|
6
6
|
return client.get(`/bundle/${bundleId}/product/${productId}`, {
|
|
7
7
|
params: query,
|
|
8
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
8
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -2,19 +2,19 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function bundlesFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, jwtToken, query = {} }) {
|
|
5
|
+
function all({ token, jwtToken, query = {}, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/bundles",
|
|
8
8
|
params: query,
|
|
9
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function get({token, jwtToken, bundleId}) {
|
|
13
|
+
function get({token, jwtToken, bundleId, headers}) {
|
|
14
14
|
return client({
|
|
15
15
|
url: `/bundles/${bundleId}`,
|
|
16
16
|
method: "get",
|
|
17
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken})
|
|
17
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, jwtToken, headers})
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -2,11 +2,11 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function companiesFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, jwtToken, query = {} }) {
|
|
5
|
+
function all({ token, jwtToken, query = {}, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/companies",
|
|
8
8
|
params: query,
|
|
9
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
9
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -2,11 +2,11 @@ const { authorizationHeaders } = require("./../endpoints_helpers");
|
|
|
2
2
|
|
|
3
3
|
function countriesFactory({ client, internalAuthTokenProvider }) {
|
|
4
4
|
|
|
5
|
-
function all({ token, query = {} }) {
|
|
5
|
+
function all({ token, query = {}, headers }) {
|
|
6
6
|
return client({
|
|
7
7
|
url: "/countries",
|
|
8
8
|
params: query,
|
|
9
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
9
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -5,44 +5,45 @@ const {
|
|
|
5
5
|
function customContentFactory({client, internalAuthTokenProvider}) {
|
|
6
6
|
function all({
|
|
7
7
|
token,
|
|
8
|
-
query = {}
|
|
8
|
+
query = {},
|
|
9
|
+
headers
|
|
9
10
|
}) {
|
|
10
11
|
return client.get("/custom-content", {
|
|
11
12
|
params: query,
|
|
12
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
13
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
function get({customContentId, token}) {
|
|
17
|
+
function get({customContentId, token, headers}) {
|
|
17
18
|
return client.get(`/custom-content/${customContentId}`, {
|
|
18
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider})
|
|
19
|
+
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function create({ jwtToken, token, customContent }) {
|
|
23
|
+
function create({ jwtToken, token, customContent, headers }) {
|
|
23
24
|
return client({
|
|
24
25
|
url: "/custom-content",
|
|
25
26
|
method: "post",
|
|
26
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
27
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
27
28
|
data: {
|
|
28
29
|
customContent
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
function remove({ jwtToken, customContentId, token }) {
|
|
34
|
+
function remove({ jwtToken, customContentId, token, headers }) {
|
|
34
35
|
return client({
|
|
35
36
|
url: `/custom-content/${customContentId}`,
|
|
36
37
|
method: "delete",
|
|
37
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider})
|
|
38
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
function update({jwtToken, token, customContentId, customContent}) {
|
|
42
|
+
function update({jwtToken, token, customContentId, customContent, headers}) {
|
|
42
43
|
return client({
|
|
43
44
|
url: `/custom-content/${customContentId}`,
|
|
44
45
|
method: "put",
|
|
45
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
46
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
46
47
|
data: {
|
|
47
48
|
customContent
|
|
48
49
|
}
|