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
package/lib/client.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4
4
|
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
5
|
var axios = require("axios");
|
|
8
6
|
var productionOptions = require("./productionDefaults.js");
|
|
9
7
|
|
|
@@ -542,8 +540,6 @@ function createSeatmaps(_ref12) {
|
|
|
542
540
|
* @returns {Object} Object with btrzpay endpoint namespaces and __test.client
|
|
543
541
|
*/
|
|
544
542
|
function createBtrzPay(_ref13) {
|
|
545
|
-
var _ref14;
|
|
546
|
-
|
|
547
543
|
var baseURL = _ref13.baseURL,
|
|
548
544
|
headers = _ref13.headers,
|
|
549
545
|
timeout = _ref13.timeout,
|
|
@@ -552,13 +548,29 @@ function createBtrzPay(_ref13) {
|
|
|
552
548
|
agents = _ref13.agents;
|
|
553
549
|
|
|
554
550
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
555
|
-
return
|
|
551
|
+
return {
|
|
556
552
|
adyen: require("./endpoints/btrzpay/adyen.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
557
553
|
cybersource3ds: require("./endpoints/btrzpay/cybersource3ds.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
558
|
-
docs: require("./endpoints/btrzpay/docs.js")({ client: client })
|
|
559
|
-
|
|
560
|
-
client: client
|
|
561
|
-
|
|
554
|
+
docs: require("./endpoints/btrzpay/docs.js")({ client: client }),
|
|
555
|
+
cardpointeTerminals: require("./endpoints/btrzpay/cardpointe.js").cardpointeTerminalsFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
556
|
+
paymentMethods: require("./endpoints/btrzpay/payment-methods.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
557
|
+
referenceNumbers: require("./endpoints/btrzpay/reference-numbers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
558
|
+
payments: require("./endpoints/btrzpay/payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
559
|
+
referencedPayments: require("./endpoints/btrzpay/referenced-payments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
560
|
+
customers: require("./endpoints/btrzpay/customers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
561
|
+
customerCards: require("./endpoints/btrzpay/customerCards.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
562
|
+
squareTerminals: require("./endpoints/btrzpay/square.js").squareTerminalsFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
563
|
+
squareWebhooks: require("./endpoints/btrzpay/square.js").squareWebhooksFactory({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
564
|
+
oxxo: require("./endpoints/btrzpay/oxxo.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
565
|
+
datalogic: require("./endpoints/btrzpay/datalogic.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
566
|
+
prismaTerminals: require("./endpoints/btrzpay/prismaTerminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
567
|
+
terminalPayments: require("./endpoints/btrzpay/terminalPayments.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
568
|
+
stripeTerminals: require("./endpoints/btrzpay/stripe-terminals.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
569
|
+
stripe3ds: require("./endpoints/btrzpay/stripe3ds.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
570
|
+
__test: {
|
|
571
|
+
client: client
|
|
572
|
+
}
|
|
573
|
+
};
|
|
562
574
|
}
|
|
563
575
|
|
|
564
576
|
/**
|
|
@@ -566,13 +578,13 @@ function createBtrzPay(_ref13) {
|
|
|
566
578
|
* @param {CreateModuleOptions} opts - Client options
|
|
567
579
|
* @returns {Object} Object with invoices endpoint namespaces and __test.client
|
|
568
580
|
*/
|
|
569
|
-
function createInvoices(
|
|
570
|
-
var baseURL =
|
|
571
|
-
headers =
|
|
572
|
-
timeout =
|
|
573
|
-
overrideFn =
|
|
574
|
-
internalAuthTokenProvider =
|
|
575
|
-
agents =
|
|
581
|
+
function createInvoices(_ref14) {
|
|
582
|
+
var baseURL = _ref14.baseURL,
|
|
583
|
+
headers = _ref14.headers,
|
|
584
|
+
timeout = _ref14.timeout,
|
|
585
|
+
overrideFn = _ref14.overrideFn,
|
|
586
|
+
internalAuthTokenProvider = _ref14.internalAuthTokenProvider,
|
|
587
|
+
agents = _ref14.agents;
|
|
576
588
|
|
|
577
589
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
578
590
|
|
|
@@ -600,13 +612,13 @@ function createInvoices(_ref15) {
|
|
|
600
612
|
* @param {CreateModuleOptions} opts - Client options
|
|
601
613
|
* @returns {Object} Object with gps endpoint namespaces and __test.client
|
|
602
614
|
*/
|
|
603
|
-
function createGPS(
|
|
604
|
-
var baseURL =
|
|
605
|
-
headers =
|
|
606
|
-
timeout =
|
|
607
|
-
overrideFn =
|
|
608
|
-
internalAuthTokenProvider =
|
|
609
|
-
agents =
|
|
615
|
+
function createGPS(_ref15) {
|
|
616
|
+
var baseURL = _ref15.baseURL,
|
|
617
|
+
headers = _ref15.headers,
|
|
618
|
+
timeout = _ref15.timeout,
|
|
619
|
+
overrideFn = _ref15.overrideFn,
|
|
620
|
+
internalAuthTokenProvider = _ref15.internalAuthTokenProvider,
|
|
621
|
+
agents = _ref15.agents;
|
|
610
622
|
|
|
611
623
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
612
624
|
|
|
@@ -623,12 +635,12 @@ function createGPS(_ref16) {
|
|
|
623
635
|
* @param {Omit<CreateModuleOptions, "internalAuthTokenProvider">} opts - Client options (no internalAuthTokenProvider)
|
|
624
636
|
* @returns {Object} Object with ratality endpoint namespaces and __test.client
|
|
625
637
|
*/
|
|
626
|
-
function createRatality(
|
|
627
|
-
var baseURL =
|
|
628
|
-
headers =
|
|
629
|
-
timeout =
|
|
630
|
-
overrideFn =
|
|
631
|
-
agents =
|
|
638
|
+
function createRatality(_ref16) {
|
|
639
|
+
var baseURL = _ref16.baseURL,
|
|
640
|
+
headers = _ref16.headers,
|
|
641
|
+
timeout = _ref16.timeout,
|
|
642
|
+
overrideFn = _ref16.overrideFn,
|
|
643
|
+
agents = _ref16.agents;
|
|
632
644
|
|
|
633
645
|
var client = clientFactory({ baseURL: baseURL, headers: headers, timeout: timeout, overrideFn: overrideFn, agents: agents });
|
|
634
646
|
var version = "v2";
|
|
@@ -657,15 +669,15 @@ function createRatality(_ref17) {
|
|
|
657
669
|
* @param {{httpAgent: import("http").Agent, httpsAgent: import("https").Agent}} options.agents - An object containg one or both http agents
|
|
658
670
|
*/
|
|
659
671
|
function createApiClient(options) {
|
|
660
|
-
var
|
|
661
|
-
baseURL =
|
|
662
|
-
|
|
663
|
-
baseURLOverride =
|
|
664
|
-
headers =
|
|
665
|
-
|
|
666
|
-
timeout =
|
|
667
|
-
internalAuthTokenProvider =
|
|
668
|
-
agents =
|
|
672
|
+
var _ref17 = options || productionOptions,
|
|
673
|
+
baseURL = _ref17.baseURL,
|
|
674
|
+
_ref17$baseURLOverrid = _ref17.baseURLOverride,
|
|
675
|
+
baseURLOverride = _ref17$baseURLOverrid === undefined ? {} : _ref17$baseURLOverrid,
|
|
676
|
+
headers = _ref17.headers,
|
|
677
|
+
_ref17$timeout = _ref17.timeout,
|
|
678
|
+
timeout = _ref17$timeout === undefined ? 0 : _ref17$timeout,
|
|
679
|
+
internalAuthTokenProvider = _ref17.internalAuthTokenProvider,
|
|
680
|
+
agents = _ref17.agents;
|
|
669
681
|
|
|
670
682
|
return {
|
|
671
683
|
constants: require("./constants.js"),
|
|
@@ -38,11 +38,11 @@ function journeyPricesSettingsFactory(_ref) {
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* PUT /journey-prices-settings – Update journey prices settings. Body: JourneyPricesSettings at root.
|
|
41
|
-
* Required: recordProtectionRules. Optional: pricingParameters, allowEachTripSegmentToBePricedIndividually.
|
|
41
|
+
* Required: recordProtectionRules. Optional: pricingParameters, allowEachTripSegmentToBePricedIndividually, displayExpiredSchedulesInUI.
|
|
42
42
|
* @param {Object} opts
|
|
43
43
|
* @param {string} [opts.token] - API key
|
|
44
44
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
45
|
-
* @param {Object} opts.journeyPricesSettings - { recordProtectionRules, pricingParameters?, allowEachTripSegmentToBePricedIndividually? }
|
|
45
|
+
* @param {Object} opts.journeyPricesSettings - { recordProtectionRules, pricingParameters?, allowEachTripSegmentToBePricedIndividually?, displayExpiredSchedulesInUI? }
|
|
46
46
|
* @param {Object} [opts.headers] - Optional headers
|
|
47
47
|
* @returns {Promise<import("axios").AxiosResponse<{ journeyPricesSettings: object }>>}
|
|
48
48
|
*/
|
|
@@ -23,7 +23,7 @@ function marketPricingSettingsFactory(_ref) {
|
|
|
23
23
|
* @param {string} [opts.token] - API key
|
|
24
24
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
25
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
|
-
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: { useOnlySpecificFareTable: boolean } }>>}
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: { useOnlySpecificFareTable: boolean, displayExpiredSchedulesInUI: boolean } }>>}
|
|
27
27
|
*/
|
|
28
28
|
function get(_ref2) {
|
|
29
29
|
var token = _ref2.token,
|
|
@@ -37,11 +37,11 @@ function marketPricingSettingsFactory(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* PUT /market-pricing-settings – Update market pricing settings. Body: MarketPricingSettings at root (useOnlySpecificFareTable required).
|
|
40
|
+
* PUT /market-pricing-settings – Update market pricing settings. Body: MarketPricingSettings at root (useOnlySpecificFareTable and displayExpiredSchedulesInUI required).
|
|
41
41
|
* @param {Object} opts
|
|
42
42
|
* @param {string} [opts.token] - API key
|
|
43
43
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
44
|
-
* @param {Object} opts.marketPricingSettings - { useOnlySpecificFareTable: boolean }
|
|
44
|
+
* @param {Object} opts.marketPricingSettings - { useOnlySpecificFareTable: boolean, displayExpiredSchedulesInUI: boolean }
|
|
45
45
|
* @param {Object} [opts.headers] - Optional headers
|
|
46
46
|
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: object }>>}
|
|
47
47
|
*/
|
|
@@ -37,11 +37,15 @@ function multiproductSalesSettingsFactory(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* PUT /multiproduct-sales-settings – Create or update multi-product sales settings
|
|
40
|
+
* PUT /multiproduct-sales-settings – Create or update multi-product sales settings
|
|
41
|
+
* (upsert). Body: MultiProductSettingsPayload (productsMapping, stationsMapping,
|
|
42
|
+
* faresMapping, fareClassesMapping). Emits networks.created or networks.updated.
|
|
41
43
|
* @param {Object} opts
|
|
42
44
|
* @param {string} [opts.token] - API key
|
|
43
45
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
44
|
-
* @param {Object} opts.data - multiProductSettings payload
|
|
46
|
+
* @param {Object} opts.data - multiProductSettings payload. Includes
|
|
47
|
+
* productsMapping, stationsMapping, faresMapping, and fareClassesMapping; each
|
|
48
|
+
* key is an ObjectId and each value is an array of ObjectIds.
|
|
45
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
46
50
|
* @returns {Promise<import("axios").AxiosResponse<{ multiProductSettings: object }>>}
|
|
47
51
|
*/
|
|
@@ -40,7 +40,9 @@ function operationSettingsFactory(_ref) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* PUT /operation-settings – Update operation settings. Body:
|
|
43
|
+
* PUT /operation-settings – Update operation settings. Body:
|
|
44
|
+
* { operationSettings } (OperationSettingsPutData). Emits
|
|
45
|
+
* operationsettings.updated.
|
|
44
46
|
* @param {Object} opts
|
|
45
47
|
* @param {string} [opts.token] - API key
|
|
46
48
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -23,14 +23,18 @@ function referencedPaymentsFactory(_ref) {
|
|
|
23
23
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* GET /referenced-payments/:transactionId/:referenceNumber/status - get
|
|
26
|
+
* GET /referenced-payments/:transactionId/:referenceNumber/status - get
|
|
27
|
+
* referenced payment status. Requires backoffice auth. Response body:
|
|
28
|
+
* { paymentResult: { status, result } | null }.
|
|
27
29
|
* @param {Object} opts
|
|
28
30
|
* @param {string} [opts.token] - API key
|
|
29
31
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
30
32
|
* @param {string} opts.transactionId - Transaction ID
|
|
31
33
|
* @param {string} opts.referenceNumber - Reference number of the payment
|
|
32
34
|
* @param {Object} [opts.headers] - Optional headers
|
|
33
|
-
* @returns {Promise<import("axios").AxiosResponse<{
|
|
35
|
+
* @returns {Promise<import("axios").AxiosResponse<{
|
|
36
|
+
* paymentResult: { status: "error"|"pending"|"success"|"review", result: object } | null
|
|
37
|
+
* }>>}
|
|
34
38
|
*/
|
|
35
39
|
function getStatus(_ref2) {
|
|
36
40
|
var token = _ref2.token,
|
|
@@ -17,7 +17,9 @@ function squareWebhooksFactory(_ref) {
|
|
|
17
17
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* POST /square-webhooks/:providerId - send Square webhook payload to the
|
|
20
|
+
* POST /square-webhooks/:providerId - send Square webhook payload to the
|
|
21
|
+
* Payments API. API verifies x-square-signature when present. Body must
|
|
22
|
+
* include type and data (Square webhook format).
|
|
21
23
|
* @param {Object} opts
|
|
22
24
|
* @param {string} [opts.token] - API key
|
|
23
25
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -58,12 +60,19 @@ function squareTerminalsFactory(_ref3) {
|
|
|
58
60
|
internalAuthTokenProvider = _ref3.internalAuthTokenProvider;
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
|
-
* GET /square-terminals - list Square terminals for the account. Requires
|
|
63
|
+
* GET /square-terminals - list Square terminals for the account. Requires
|
|
64
|
+
* JWT (BETTEREZ_APP or MOBILE_SCANNER). Response body: { terminals } with
|
|
65
|
+
* terminal objects (id, name, code, deviceId, productType, locationId,
|
|
66
|
+
* status, pairBy, createdAt, statusChangedAt).
|
|
62
67
|
* @param {Object} opts
|
|
63
68
|
* @param {string} [opts.token] - API key
|
|
64
69
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
65
70
|
* @param {Object} [opts.headers] - Optional headers
|
|
66
|
-
* @returns {Promise<import("axios").AxiosResponse<{ terminals: Array<{
|
|
71
|
+
* @returns {Promise<import("axios").AxiosResponse<{ terminals: Array<{
|
|
72
|
+
* id: string, name: string, code: string, deviceId?: string, productType?: string,
|
|
73
|
+
* locationId: string, status?: string, pairBy?: string,
|
|
74
|
+
* createdAt?: string, statusChangedAt?: string
|
|
75
|
+
* }> }>>}
|
|
67
76
|
*/
|
|
68
77
|
function get(_ref4) {
|
|
69
78
|
var token = _ref4.token,
|
|
@@ -6,7 +6,8 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
6
6
|
/**
|
|
7
7
|
* Query params for GET /stripe-terminals (btrz-api-payments). See get-handler getSpec().
|
|
8
8
|
* @typedef {Object} StripeTerminalsListQuery
|
|
9
|
-
* @property {string} [providerId] - Account provider (operator) ID
|
|
9
|
+
* @property {string} [providerId] - Account provider (operator) ID used by
|
|
10
|
+
* agencies/sellers; when omitted, authenticated account ID is used
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -37,7 +38,9 @@ function stripeTerminalsFactory(_ref) {
|
|
|
37
38
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
38
39
|
* @param {StripeTerminalsListQuery} [opts.query] - Optional providerId
|
|
39
40
|
* @param {Object} [opts.headers] - Optional headers
|
|
40
|
-
* @returns {Promise<import("axios").AxiosResponse<GetStripeTerminalsResponse>>}
|
|
41
|
+
* @returns {Promise<import("axios").AxiosResponse<GetStripeTerminalsResponse>>}
|
|
42
|
+
* Rejects with 400 (STRIPE_SECRET_KEY_INVALID), 401,
|
|
43
|
+
* 404 (PAYMENT_METHOD_NOT_FOUND), 500.
|
|
41
44
|
*/
|
|
42
45
|
function all(_ref2) {
|
|
43
46
|
var token = _ref2.token,
|
|
@@ -62,7 +65,10 @@ function stripeTerminalsFactory(_ref) {
|
|
|
62
65
|
* @param {string} opts.id - Terminal ID (Stripe reader id, e.g. tmr_xxx)
|
|
63
66
|
* @param {{ ccNumber: string }} opts.stripePayment - Payment to simulate; ccNumber required
|
|
64
67
|
* @param {Object} [opts.headers] - Optional headers
|
|
65
|
-
* @returns {Promise<import("axios").AxiosResponse<{ stripeTerminalPayment: Object }>>}
|
|
68
|
+
* @returns {Promise<import("axios").AxiosResponse<{ stripeTerminalPayment: Object }>>}
|
|
69
|
+
* Rejects with 400 (WRONG_DATA), 401,
|
|
70
|
+
* 404 (PAYMENT_METHOD_NOT_FOUND, TRANSACTION_NOT_FOUND),
|
|
71
|
+
* 409 (errorCode/errorMessage), 500.
|
|
66
72
|
*/
|
|
67
73
|
function simulate(_ref3) {
|
|
68
74
|
var token = _ref3.token,
|
|
@@ -38,10 +38,14 @@ function terminalPaymentsFactory(_ref) {
|
|
|
38
38
|
* @param {string} [opts.token] - API key
|
|
39
39
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
40
40
|
* @param {string} opts.id - Terminal payment ID (UUID)
|
|
41
|
-
* @param {{ result?: Object, paymentRequest: Object, orderId: string }} opts.terminalPayment
|
|
41
|
+
* @param {{ result?: Object, paymentRequest: Object, orderId: string }} opts.terminalPayment
|
|
42
|
+
* - Terminal payment data (result, paymentRequest, orderId)
|
|
42
43
|
* @param {TerminalPaymentsMitPutQuery} [opts.query] - Optional providerId
|
|
43
44
|
* @param {Object} [opts.headers] - Optional headers
|
|
44
|
-
* @returns {Promise<import("axios").AxiosResponse<{ terminalPayment: Object }>>}
|
|
45
|
+
* @returns {Promise<import("axios").AxiosResponse<{ terminalPayment: Object }>>}
|
|
46
|
+
* Rejects with 400 (WRONG_DATA, INVALID_TERMINALPAYMENT_ID,
|
|
47
|
+
* INVALID_RESULT_OBJECT, MIT_*), 401, 404 (TERMINALPAYMENT_NOT_FOUND,
|
|
48
|
+
* MIT_PAYMENT_NOT_FOUND), 409 (CANT_UPDATE_ORDER), 500.
|
|
45
49
|
*/
|
|
46
50
|
update: function update(_ref2) {
|
|
47
51
|
var token = _ref2.token,
|
|
@@ -69,7 +73,10 @@ function terminalPaymentsFactory(_ref) {
|
|
|
69
73
|
* @param {string} opts.id - Terminal payment ID (UUID)
|
|
70
74
|
* @param {TerminalPaymentsMitGetQuery} opts.query - branchId, companyId, date (required); optional providerId
|
|
71
75
|
* @param {Object} [opts.headers] - Optional headers
|
|
72
|
-
* @returns {Promise<import("axios").AxiosResponse<{ terminalPayment: Object }>>}
|
|
76
|
+
* @returns {Promise<import("axios").AxiosResponse<{ terminalPayment: Object }>>}
|
|
77
|
+
* Rejects with 400 (WRONG_DATA, INVALID_TERMINALPAYMENT_ID,
|
|
78
|
+
* INVALID_DATE, MIT_*), 401, 404 (TERMINALPAYMENT_NOT_FOUND,
|
|
79
|
+
* MIT_PAYMENT_NOT_FOUND), 500.
|
|
73
80
|
*/
|
|
74
81
|
get: function get(_ref3) {
|
|
75
82
|
var token = _ref3.token,
|
|
@@ -95,7 +102,10 @@ function terminalPaymentsFactory(_ref) {
|
|
|
95
102
|
* @param {Object} [opts.headers] - Optional headers
|
|
96
103
|
* @param {string} [opts.token] - API key (optional when no userId in payload)
|
|
97
104
|
* @param {string} [opts.jwtToken] - JWT or internal auth (required when userId is in payload)
|
|
98
|
-
* @returns {Promise<import("axios").AxiosResponse<{ status: string }>>}
|
|
105
|
+
* @returns {Promise<import("axios").AxiosResponse<{ status: string }>>}
|
|
106
|
+
* Rejects with 400 (INVALID_WEBHOOK_PAYLOAD), 401 (when userId present but
|
|
107
|
+
* not authenticated), 404 (PAYMENT_NOT_FOUND_FOR_WEBHOOK_EVENT,
|
|
108
|
+
* PAYMENT_METHOD_NOT_FOUND, USER_NOT_FOUND), 409 (CANT_UPDATE_ORDER), 500.
|
|
99
109
|
*/
|
|
100
110
|
getnet: function getnet(_ref4) {
|
|
101
111
|
var data = _ref4.data,
|
|
@@ -62,7 +62,8 @@ function documentTypesFactory(_ref) {
|
|
|
62
62
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
63
63
|
* @param {string} opts.id - Document type id (24 hex characters)
|
|
64
64
|
* @param {DocumentTypeGetByIdQuery} [opts.query] - Optional query params (merged with providerId when opts.providerId is set)
|
|
65
|
-
* @param {string} [opts.providerId] - Provider id (ObjectId); merged into
|
|
65
|
+
* @param {string} [opts.providerId] - Provider id (ObjectId); merged into
|
|
66
|
+
* query for provider context (same as peopleLookups.getById / dynamicForms.get)
|
|
66
67
|
* @param {Object} [opts.headers] - Optional headers
|
|
67
68
|
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
68
69
|
* @throws When response is 4xx/5xx (400, 401, 404 DOCUMENTTYPE_NOT_FOUND, 500)
|
|
@@ -18,6 +18,7 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
18
18
|
* @property {string} [domain] - Filter by domain
|
|
19
19
|
* @property {string} [parentProductId] - Child products of this parent
|
|
20
20
|
* @property {string} [dynamicFormId] - Filter by dynamic form
|
|
21
|
+
* @property {string} [type] - Filter by product type
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -6,8 +6,13 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
6
6
|
/**
|
|
7
7
|
* Request body for POST /movements (btrz-api-operations). See MovementPostData in movements models.
|
|
8
8
|
* @typedef {Object} MovementPostData
|
|
9
|
-
* @property {Array<{ _id: string, section?: string, sectionName?: string,
|
|
10
|
-
*
|
|
9
|
+
* @property {Array<{ _id: string, section?: string, sectionName?: string,
|
|
10
|
+
* seat?: string, row?: string, seatId?: string }>} tickets - Tickets to move
|
|
11
|
+
* (same transaction if more than one). Each must have _id; optional seat fields
|
|
12
|
+
* for destination seatmap.
|
|
13
|
+
* @property {{ routeId: string, scheduleId: string, date: string }} newManifest
|
|
14
|
+
* - Destination manifest: routeId (ObjectId), scheduleId (UUID), date
|
|
15
|
+
* (YYYY-MM-DD).
|
|
11
16
|
* @property {string} channel - Channel of the movement (e.g. backoffice). Must be a valid backoffice channel.
|
|
12
17
|
* @property {boolean} [allowsDifferentTrx] - If true, allows moving tickets from different transactions.
|
|
13
18
|
* @property {boolean} [newdesign] - If true, uses new seatmap design for accommodation.
|
|
@@ -22,9 +22,13 @@ function pagoExpressFactory(_ref) {
|
|
|
22
22
|
* @param {Object} opts
|
|
23
23
|
* @param {string} [opts.token] - API key (x-api-key)
|
|
24
24
|
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
25
|
-
* @param {Object} opts.payment - Request body: folio (20-digit string),
|
|
25
|
+
* @param {Object} opts.payment - Request body: folio (20-digit string),
|
|
26
|
+
* id_terminal (number), local_date (string DD/MM/YYYY HH:mm:ss),
|
|
27
|
+
* trx_no (number)
|
|
26
28
|
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
-
* @returns {Promise<import("axios").AxiosResponse>} 200 PostInfoResponse
|
|
29
|
+
* @returns {Promise<import("axios").AxiosResponse>} 200 PostInfoResponse
|
|
30
|
+
* (code, message, result with folio, id_terminal, local_date, saldo,
|
|
31
|
+
* trx_no, responsecode, descriptioncode)
|
|
28
32
|
*/
|
|
29
33
|
function info(_ref2) {
|
|
30
34
|
var token = _ref2.token,
|
|
@@ -47,7 +51,9 @@ function pagoExpressFactory(_ref) {
|
|
|
47
51
|
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
48
52
|
* @param {Object} opts.payment - Request body: folio, id_terminal, local_date, trx_no, amount (string)
|
|
49
53
|
* @param {Object} [opts.headers] - Optional headers
|
|
50
|
-
* @returns {Promise<import("axios").AxiosResponse>} 200 PostPayResponse
|
|
54
|
+
* @returns {Promise<import("axios").AxiosResponse>} 200 PostPayResponse
|
|
55
|
+
* (code, message, result with folio, id_terminal, local_date, trx_no,
|
|
56
|
+
* noauto, amount, responsecode, descriptioncode)
|
|
51
57
|
*/
|
|
52
58
|
function pay(_ref3) {
|
|
53
59
|
var token = _ref3.token,
|
|
@@ -144,7 +144,9 @@ function parcelFactory(_ref) {
|
|
|
144
144
|
* @param {string} opts.id - Parcel id (path parcelId)
|
|
145
145
|
* @param {string} opts.commentId - Comment id (path)
|
|
146
146
|
* @param {Object} [opts.headers] - Optional headers
|
|
147
|
-
* @returns {Promise<import("axios").AxiosResponse>} 200 deleted
|
|
147
|
+
* @returns {Promise<import("axios").AxiosResponse>} 200 deleted
|
|
148
|
+
* ParcelUserComment; 400 MISSING_*; 401; 403;
|
|
149
|
+
* 404 PARCEL_NOT_FOUND, COMMENT_NOT_FOUND; 409
|
|
148
150
|
*/
|
|
149
151
|
function deleteComment(_ref6) {
|
|
150
152
|
var token = _ref6.token,
|
|
@@ -4,7 +4,8 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Request body for POST /cancellations (btrz-api-sales).
|
|
7
|
+
* Request body for POST /cancellations (btrz-api-sales).
|
|
8
|
+
* CancelPostData. Item IDs grouped by family; trxId required.
|
|
8
9
|
* @typedef {{
|
|
9
10
|
* trxId: string,
|
|
10
11
|
* fees: number[],
|
|
@@ -26,7 +27,9 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* Request body for PUT /cancellations (btrz-api-sales). CancelPutData.
|
|
30
|
+
* Request body for PUT /cancellations (btrz-api-sales). CancelPutData.
|
|
31
|
+
* Unmodified cancel set from POST response
|
|
32
|
+
* (must include _id and signature).
|
|
30
33
|
* @typedef {{ _id: string, cancellation: Object, signature: string }} CancelPutData
|
|
31
34
|
*/
|
|
32
35
|
|
|
@@ -50,13 +53,20 @@ function cancellationEndpointsFactory(_ref) {
|
|
|
50
53
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
|
-
* POST /cancellations - creates a cancel set (preview) with calculated
|
|
56
|
+
* POST /cancellations - creates a cancel set (preview) with calculated
|
|
57
|
+
* refunds and signature. Does not execute refunds.
|
|
58
|
+
* API does not accept query params.
|
|
54
59
|
* @param {Object} opts
|
|
55
60
|
* @param {string} [opts.token] - API key
|
|
56
61
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
57
62
|
* @param {CancelPostData} opts.cancelData - Refundable item IDs by family, trxId, channel, penalty (optional), etc.
|
|
58
63
|
* @param {Object} [opts.headers] - Optional headers
|
|
59
|
-
* @returns {Promise<import("axios").AxiosResponse<{ _id: string,
|
|
64
|
+
* @returns {Promise<import("axios").AxiosResponse<{ _id: string,
|
|
65
|
+
* cancellation: Object, signature: string }>>} Cancel set (signed).
|
|
66
|
+
* Rejects with 400 (e.g. MISSING_CANCELLABLE_IDS, INVALID_CANCEL_SET,
|
|
67
|
+
* [itemType]_NOT_REFUNDABLE), 401, 403 (NOT_ALLOWED_FOR_ONLINE,
|
|
68
|
+
* FEE_OVERRIDE_NOT_ALLOWED), 404 ([itemType]_NOT_FOUND),
|
|
69
|
+
* 409 (CURRENCY_EXCHANGE_MISMATCH, AGENCY_CURRENCY_MISMATCH), 500.
|
|
60
70
|
*/
|
|
61
71
|
function createCancelSet(_ref2) {
|
|
62
72
|
var token = _ref2.token,
|
|
@@ -75,13 +85,20 @@ function cancellationEndpointsFactory(_ref) {
|
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
/**
|
|
78
|
-
* PUT /cancellations - executes the refund using the signed cancel set from
|
|
88
|
+
* PUT /cancellations - executes the refund using the signed cancel set from
|
|
89
|
+
* POST. Body is cancelSet (or object with cancelSet key).
|
|
90
|
+
* API does not accept query params. Duplicate submission
|
|
91
|
+
* (same dupKey within 30s) returns 409.
|
|
79
92
|
* @param {Object} opts
|
|
80
93
|
* @param {string} [opts.token] - API key
|
|
81
94
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
82
95
|
* @param {CancelPutData} opts.cancelSet - Unmodified cancel set from createCancelSet response
|
|
83
96
|
* @param {Object} [opts.headers] - Optional headers
|
|
84
|
-
* @returns {Promise<import("axios").AxiosResponse<{ transaction: Object }>>}
|
|
97
|
+
* @returns {Promise<import("axios").AxiosResponse<{ transaction: Object }>>}
|
|
98
|
+
* RefundResponse. Rejects with 400 (e.g. INVALID_SIGNATURE,
|
|
99
|
+
* MISSING_TERMINAL_PAYLOAD, REFUNDED_ITEM), 401,
|
|
100
|
+
* 409 (NOT_FOUND_FOR_REFUND, REFUND_EXECUTION_ERROR,
|
|
101
|
+
* PAYMENT_ROLLBACK_FAILED, CONFLICT duplicate), 500.
|
|
85
102
|
*/
|
|
86
103
|
function createRefund(_ref3) {
|
|
87
104
|
var token = _ref3.token,
|
|
@@ -98,14 +115,20 @@ function cancellationEndpointsFactory(_ref) {
|
|
|
98
115
|
}
|
|
99
116
|
|
|
100
117
|
/**
|
|
101
|
-
* PUT /cancellations/:pendingTransactionId - completes a pending payment
|
|
118
|
+
* PUT /cancellations/:pendingTransactionId - completes a pending payment
|
|
119
|
+
* for a cancellation transaction (e.g. terminal refund).
|
|
120
|
+
* API does not accept query params.
|
|
102
121
|
* @param {Object} opts
|
|
103
122
|
* @param {string} [opts.token] - API key
|
|
104
123
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
105
124
|
* @param {string} opts.pendingTransactionId - Negative (pending) transaction ID (ObjectId)
|
|
106
125
|
* @param {CompletePaymentCancellationData} opts.paymentResult - Payment result from terminal/provider
|
|
107
126
|
* @param {Object} [opts.headers] - Optional headers
|
|
108
|
-
* @returns {Promise<import("axios").AxiosResponse<{ transaction?: Object,
|
|
127
|
+
* @returns {Promise<import("axios").AxiosResponse<{ transaction?: Object,
|
|
128
|
+
* paymentResult?: Object }>>} GetCompletePaymentCancellationResponse.
|
|
129
|
+
* Rejects with 400 (INVALID_PENDING_TRANSACTION_ID,
|
|
130
|
+
* INVALID_TRANSACTION_STATUS, PAYMENT_NOT_PENDING, etc.), 401,
|
|
131
|
+
* 404 (TRANSACTION_NOT_FOUND, PAYMENT_NOT_FOUND, etc.), 500.
|
|
109
132
|
*/
|
|
110
133
|
function updateCompletePayment(_ref4) {
|
|
111
134
|
var token = _ref4.token,
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "btrz-api-client",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.66.1",
|
|
4
4
|
"description": "Api client for Betterez endpoints",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"tdd": "
|
|
8
|
-
"test": "
|
|
9
|
-
"test:
|
|
7
|
+
"tdd": "node --watch --require ./test/node-test-globals.js --test test/all.test.js",
|
|
8
|
+
"test": "node --require ./test/node-test-globals.js --test test/all.test.js",
|
|
9
|
+
"test:only": "node --require ./test/node-test-globals.js --test test/all.test.js --test-only",
|
|
10
|
+
"test:integration": "node --require ./test/node-test-globals.js --require ./test-integration/ports.js --test test-integration/all.test.js",
|
|
10
11
|
"browserify": "browserify lib/client.js --standalone BtrzApiClient -p tinyify -o lib/client-standalone-min.js",
|
|
11
12
|
"commit-transpile": "git add lib/ && (git diff-index --quiet HEAD || git commit -m \"transpiled src\")",
|
|
12
13
|
"pretranspile": "rm -rf lib/",
|
|
@@ -31,21 +32,18 @@
|
|
|
31
32
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
|
32
33
|
"babel-preset-es2015": "^6.24.1",
|
|
33
34
|
"browserify": "^17.0.1",
|
|
34
|
-
"chai": "^4.3.8",
|
|
35
35
|
"confusing-browser-globals": "^1.0.11",
|
|
36
36
|
"eslint": "7.32.0",
|
|
37
37
|
"eslint-config-btrz-base": "^1.0.0",
|
|
38
38
|
"eslint-plugin-chai-friendly": "^0.4.1",
|
|
39
39
|
"eslint-plugin-import": "^2.20.1",
|
|
40
|
-
"eslint-plugin-mocha": "^5.3.0",
|
|
41
40
|
"form-data": "^3.0.0",
|
|
42
|
-
"mocha": "11.7.5",
|
|
43
41
|
"tinyify": "4.0.0",
|
|
44
42
|
"uuid": "14.0.0"
|
|
45
43
|
},
|
|
46
44
|
"dependencies": {
|
|
47
45
|
"axios": "^0.27.2",
|
|
48
46
|
"base-64": "^1.0.0",
|
|
49
|
-
"undici": "
|
|
47
|
+
"undici": "8.2.0"
|
|
50
48
|
}
|
|
51
49
|
}
|
package/src/client.js
CHANGED
|
@@ -455,7 +455,6 @@ function createBtrzPay({baseURL, headers, timeout, overrideFn, internalAuthToken
|
|
|
455
455
|
adyen: require("./endpoints/btrzpay/adyen.js")({client, internalAuthTokenProvider}),
|
|
456
456
|
cybersource3ds: require("./endpoints/btrzpay/cybersource3ds.js")({client, internalAuthTokenProvider}),
|
|
457
457
|
docs: require("./endpoints/btrzpay/docs.js")({client}),
|
|
458
|
-
adyen: require("./endpoints/btrzpay/adyen.js")({client, internalAuthTokenProvider}),
|
|
459
458
|
cardpointeTerminals: require("./endpoints/btrzpay/cardpointe.js").cardpointeTerminalsFactory({client, internalAuthTokenProvider}),
|
|
460
459
|
paymentMethods: require("./endpoints/btrzpay/payment-methods.js")({client, internalAuthTokenProvider}),
|
|
461
460
|
referenceNumbers: require("./endpoints/btrzpay/reference-numbers.js")({client, internalAuthTokenProvider}),
|
|
@@ -28,11 +28,11 @@ function journeyPricesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* PUT /journey-prices-settings – Update journey prices settings. Body: JourneyPricesSettings at root.
|
|
31
|
-
* Required: recordProtectionRules. Optional: pricingParameters, allowEachTripSegmentToBePricedIndividually.
|
|
31
|
+
* Required: recordProtectionRules. Optional: pricingParameters, allowEachTripSegmentToBePricedIndividually, displayExpiredSchedulesInUI.
|
|
32
32
|
* @param {Object} opts
|
|
33
33
|
* @param {string} [opts.token] - API key
|
|
34
34
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
35
|
-
* @param {Object} opts.journeyPricesSettings - { recordProtectionRules, pricingParameters?, allowEachTripSegmentToBePricedIndividually? }
|
|
35
|
+
* @param {Object} opts.journeyPricesSettings - { recordProtectionRules, pricingParameters?, allowEachTripSegmentToBePricedIndividually?, displayExpiredSchedulesInUI? }
|
|
36
36
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
37
|
* @returns {Promise<import("axios").AxiosResponse<{ journeyPricesSettings: object }>>}
|
|
38
38
|
*/
|
|
@@ -17,7 +17,7 @@ function marketPricingSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
17
17
|
* @param {string} [opts.token] - API key
|
|
18
18
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
19
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: { useOnlySpecificFareTable: boolean } }>>}
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: { useOnlySpecificFareTable: boolean, displayExpiredSchedulesInUI: boolean } }>>}
|
|
21
21
|
*/
|
|
22
22
|
function get({token, jwtToken, headers}) {
|
|
23
23
|
return client({
|
|
@@ -27,11 +27,11 @@ function marketPricingSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* PUT /market-pricing-settings – Update market pricing settings. Body: MarketPricingSettings at root (useOnlySpecificFareTable required).
|
|
30
|
+
* PUT /market-pricing-settings – Update market pricing settings. Body: MarketPricingSettings at root (useOnlySpecificFareTable and displayExpiredSchedulesInUI required).
|
|
31
31
|
* @param {Object} opts
|
|
32
32
|
* @param {string} [opts.token] - API key
|
|
33
33
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
34
|
-
* @param {Object} opts.marketPricingSettings - { useOnlySpecificFareTable: boolean }
|
|
34
|
+
* @param {Object} opts.marketPricingSettings - { useOnlySpecificFareTable: boolean, displayExpiredSchedulesInUI: boolean }
|
|
35
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
36
|
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: object }>>}
|
|
37
37
|
*/
|
|
@@ -27,11 +27,15 @@ function multiproductSalesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* PUT /multiproduct-sales-settings – Create or update multi-product sales settings
|
|
30
|
+
* PUT /multiproduct-sales-settings – Create or update multi-product sales settings
|
|
31
|
+
* (upsert). Body: MultiProductSettingsPayload (productsMapping, stationsMapping,
|
|
32
|
+
* faresMapping, fareClassesMapping). Emits networks.created or networks.updated.
|
|
31
33
|
* @param {Object} opts
|
|
32
34
|
* @param {string} [opts.token] - API key
|
|
33
35
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
34
|
-
* @param {Object} opts.data - multiProductSettings payload
|
|
36
|
+
* @param {Object} opts.data - multiProductSettings payload. Includes
|
|
37
|
+
* productsMapping, stationsMapping, faresMapping, and fareClassesMapping; each
|
|
38
|
+
* key is an ObjectId and each value is an array of ObjectIds.
|
|
35
39
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
40
|
* @returns {Promise<import("axios").AxiosResponse<{ multiProductSettings: object }>>}
|
|
37
41
|
*/
|