btrz-api-client 8.30.0 → 8.32.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/.cursor/rules/jsdoc-endpoints.mdc +1 -1
- package/lib/client-standalone-min.js +3 -3
- package/lib/client.js +3 -0
- package/lib/endpoints/accounts/agencies.js +52 -0
- package/lib/endpoints/accounts/application-settings.js +23 -17
- package/lib/endpoints/accounts/applications.js +8 -7
- package/lib/endpoints/accounts/current-shifts.js +6 -1
- package/lib/endpoints/accounts/customers.js +31 -21
- package/lib/endpoints/accounts/domains.js +16 -12
- package/lib/endpoints/accounts/dynamic-forms.js +17 -5
- package/lib/endpoints/accounts/email-settings.js +22 -20
- package/lib/endpoints/accounts/email-templates.js +18 -6
- package/lib/endpoints/accounts/exchange-rates.js +13 -8
- package/lib/endpoints/accounts/exchange-receipts.js +10 -6
- package/lib/endpoints/accounts/external-customers.js +50 -0
- package/lib/endpoints/accounts/goal-settings.js +8 -7
- package/lib/endpoints/accounts/images.js +14 -15
- package/lib/endpoints/accounts/interline.js +35 -30
- package/lib/endpoints/accounts/journey-prices-settings.js +8 -6
- package/lib/endpoints/accounts/lexicons.js +48 -19
- package/lib/endpoints/accounts/market-pricing-settings.js +7 -6
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +7 -6
- package/lib/endpoints/accounts/network.js +29 -17
- package/lib/endpoints/accounts/operation-settings.js +8 -7
- package/lib/endpoints/accounts/people-lookups.js +39 -21
- package/lib/endpoints/accounts/point-to-point-settings.js +6 -6
- package/lib/endpoints/accounts/print-settings.js +9 -7
- package/lib/endpoints/accounts/print-templates.js +71 -24
- package/lib/endpoints/accounts/printers.js +10 -5
- package/lib/endpoints/accounts/rms-settings.js +19 -11
- package/lib/endpoints/accounts/s3buckets.js +3 -3
- package/lib/endpoints/accounts/salesforce-settings.js +8 -7
- package/lib/endpoints/accounts/shift-settings.js +7 -7
- package/lib/endpoints/accounts/shifts.js +54 -15
- package/lib/endpoints/accounts/sms-templates.js +56 -18
- package/lib/endpoints/accounts/sub-print-templates.js +5 -3
- package/lib/endpoints/accounts/ticket-movement-settings.js +8 -5
- package/lib/endpoints/accounts/tokens.js +10 -3
- package/lib/endpoints/accounts/transport-regulation-settings.js +2 -2
- package/lib/endpoints/accounts/travellers.js +36 -17
- package/lib/endpoints/accounts/trusted-machines.js +19 -8
- package/lib/endpoints/accounts/twilio-settings.js +8 -6
- package/lib/endpoints/accounts/users.js +116 -70
- package/lib/endpoints/accounts/verified-emails.js +130 -0
- package/lib/endpoints/accounts/websales-config.js +15 -6
- package/lib/endpoints/btrzpay/cardpointe.js +5 -5
- package/lib/endpoints/btrzpay/customerCards.js +4 -4
- package/lib/endpoints/btrzpay/customers.js +3 -3
- package/lib/endpoints/btrzpay/datalogic.js +8 -9
- package/lib/endpoints/btrzpay/oxxo.js +5 -13
- package/lib/endpoints/btrzpay/payment-methods.js +25 -11
- package/lib/endpoints/btrzpay/payments.js +2 -2
- package/lib/endpoints/btrzpay/prismaTerminals.js +14 -21
- package/lib/endpoints/btrzpay/reference-numbers.js +1 -1
- package/lib/endpoints/btrzpay/referenced-payments.js +11 -1
- package/lib/endpoints/btrzpay/square.js +2 -2
- package/lib/endpoints/btrzpay/stripe-terminals.js +5 -5
- package/lib/endpoints/btrzpay/terminalPayments.js +15 -5
- package/lib/endpoints/coltrane/merged-fare-tables.js +1 -1
- package/lib/endpoints/coltrane/paths.js +9 -6
- package/lib/endpoints/gps/scanner-app-location.js +3 -2
- package/lib/endpoints/inventory/amenities.js +10 -7
- package/lib/endpoints/inventory/amenity-groups.js +11 -7
- package/lib/endpoints/inventory/banks.js +5 -11
- package/lib/endpoints/inventory/bare-routes.js +12 -4
- package/lib/endpoints/inventory/brands.js +10 -6
- package/lib/endpoints/inventory/bundle-fares.js +4 -2
- package/lib/endpoints/inventory/bundles.js +5 -2
- package/lib/endpoints/inventory/change-requests.js +23 -9
- package/lib/endpoints/inventory/companies.js +5 -2
- package/lib/endpoints/inventory/control-classes.js +34 -4
- package/lib/endpoints/inventory/countries.js +8 -3
- package/lib/endpoints/inventory/custom-content.js +8 -6
- package/lib/endpoints/inventory/custom-fields.js +9 -7
- package/lib/endpoints/inventory/document-types.js +8 -11
- package/lib/endpoints/inventory/external-passes.js +13 -4
- package/lib/endpoints/inventory/external-wallets.js +5 -6
- package/lib/endpoints/inventory/fallback-codes.js +11 -4
- package/lib/endpoints/inventory/fare-classes.js +6 -4
- package/lib/endpoints/inventory/fares.js +13 -7
- package/lib/endpoints/inventory/fees.js +8 -4
- package/lib/endpoints/inventory/filtered-trips-v2.js +1 -1
- package/lib/endpoints/inventory/filtered-trips.js +14 -2
- package/lib/endpoints/inventory/financing-costs.js +15 -8
- package/lib/endpoints/inventory/garages.js +7 -5
- package/lib/endpoints/inventory/getnet-terminals.js +12 -4
- package/lib/endpoints/inventory/gift-certificate-definitions.js +10 -11
- package/lib/endpoints/inventory/insurances.js +10 -7
- package/lib/endpoints/inventory/insurancesCost.js +8 -5
- package/lib/endpoints/inventory/items.js +22 -4
- package/lib/endpoints/inventory/journey-prices.js +36 -7
- package/lib/endpoints/inventory/labels.js +6 -5
- package/lib/endpoints/inventory/marital-status.js +8 -11
- package/lib/endpoints/inventory/marketplace-modifiers.js +16 -7
- package/lib/endpoints/inventory/mit-terminal-settings.js +5 -11
- package/lib/endpoints/inventory/mit-terminals.js +5 -11
- package/lib/endpoints/inventory/operating-companies.js +13 -10
- package/lib/endpoints/inventory/operation-messages.js +16 -7
- package/lib/endpoints/inventory/operation-reasons.js +11 -9
- package/lib/endpoints/inventory/parcel-zones.js +6 -5
- package/lib/endpoints/inventory/pay-on-accounts.js +9 -3
- package/lib/endpoints/inventory/payment-terminals.js +5 -11
- package/lib/endpoints/inventory/prisma-terminals.js +10 -6
- package/lib/endpoints/inventory/products.js +31 -7
- package/lib/endpoints/inventory/promos.js +29 -11
- package/lib/endpoints/inventory/routes.js +50 -31
- package/lib/endpoints/inventory/schedule-groups.js +7 -7
- package/lib/endpoints/inventory/schedules.js +24 -11
- package/lib/endpoints/inventory/seatclasses.js +5 -15
- package/lib/endpoints/inventory/seatfees.js +9 -6
- package/lib/endpoints/inventory/seatmaps.js +37 -10
- package/lib/endpoints/inventory/segments-information-tables.js +5 -4
- package/lib/endpoints/inventory/segments-information.js +4 -2
- package/lib/endpoints/inventory/service-numbers.js +9 -6
- package/lib/endpoints/inventory/service-types.js +5 -11
- package/lib/endpoints/inventory/ssrs.js +11 -3
- package/lib/endpoints/inventory/station-classes.js +12 -6
- package/lib/endpoints/inventory/station-groups.js +4 -3
- package/lib/endpoints/inventory/stations-provinces.js +1 -7
- package/lib/endpoints/inventory/stations-zones.js +3 -2
- package/lib/endpoints/inventory/stations.js +23 -5
- package/lib/endpoints/inventory/taxes.js +5 -6
- package/lib/endpoints/inventory/travel-routes.js +6 -4
- package/lib/endpoints/inventory/traveller-card-providers-types.js +1 -7
- package/lib/endpoints/inventory/traveller-card-providers.js +3 -9
- package/lib/endpoints/inventory/traveller-card-types.js +7 -6
- package/lib/endpoints/inventory/trips.js +2 -8
- package/lib/endpoints/inventory/vehicle-types.js +0 -1
- package/lib/endpoints/inventory/vehicles.js +17 -2
- package/lib/endpoints/inventory/zone-price-overages.js +4 -10
- package/lib/endpoints/inventory/zone-prices.js +12 -7
- package/lib/endpoints/invoices/dlink.js +3 -2
- package/lib/endpoints/invoices/emails.js +1 -7
- package/lib/endpoints/invoices/gti.js +2 -2
- package/lib/endpoints/invoices/infile.js +2 -2
- package/lib/endpoints/invoices/infileJson.js +2 -2
- package/lib/endpoints/invoices/invoices.js +14 -10
- package/lib/endpoints/invoices/pdfs.js +4 -3
- package/lib/endpoints/invoices/providers.js +12 -11
- package/lib/endpoints/invoices/providersSequences.js +5 -15
- package/lib/endpoints/invoices/system.js +2 -2
- package/lib/endpoints/invoices/tax-ids.js +1 -1
- package/lib/endpoints/notifications/customers.js +25 -5
- package/lib/endpoints/notifications/email.js +8 -3
- package/lib/endpoints/notifications/manifest-notifications.js +4 -3
- package/lib/endpoints/notifications/notify.js +20 -5
- package/lib/endpoints/notifications/orders-rules-validations.js +2 -8
- package/lib/endpoints/notifications/pdf-data.js +2 -1
- package/lib/endpoints/notifications/pdfs.js +2 -1
- package/lib/endpoints/notifications/printed-tickets.js +17 -6
- package/lib/endpoints/notifications/twilio.js +1 -7
- package/lib/endpoints/operations/accounting_items.js +9 -4
- package/lib/endpoints/operations/applied_insurance.js +8 -3
- package/lib/endpoints/operations/calendar_entries.js +7 -3
- package/lib/endpoints/operations/external-bookings.js +2 -8
- package/lib/endpoints/operations/flexpasses.js +1 -1
- package/lib/endpoints/operations/loans.js +10 -4
- package/lib/endpoints/operations/manifest.js +83 -33
- package/lib/endpoints/operations/manifest_leg_for_tickets.js +1 -2
- package/lib/endpoints/operations/movements.js +1 -7
- package/lib/endpoints/operations/outlook-trips.js +13 -3
- package/lib/endpoints/operations/parcels.js +20 -6
- package/lib/endpoints/operations/parcels_manifests.js +6 -16
- package/lib/endpoints/operations/passenger_check_in_info.js +3 -10
- package/lib/endpoints/operations/redemption.js +4 -4
- package/lib/endpoints/operations/rms.js +33 -6
- package/lib/endpoints/operations/scheduled_notifications.js +4 -11
- package/lib/endpoints/operations/segments.js +2 -2
- package/lib/endpoints/operations/sold-items-fulfillment.js +4 -3
- package/lib/endpoints/operations/sold-items.js +13 -4
- package/lib/endpoints/operations/tickets.js +4 -4
- package/lib/endpoints/operations/transaction.js +1 -1
- package/lib/endpoints/operations/transactions.js +6 -14
- package/lib/endpoints/operations/transport_regulations.js +1 -1
- package/lib/endpoints/operations/trip_change_info.js +13 -1
- package/lib/endpoints/operations/vehicle_assignments.js +10 -5
- package/lib/endpoints/operations/vouchers.js +2 -9
- package/lib/endpoints/operations/waitlists.js +2 -2
- package/lib/endpoints/sales/bundles.js +4 -2
- package/lib/endpoints/sales/cancellations.js +2 -2
- package/lib/endpoints/sales/cart-promo.js +2 -9
- package/lib/endpoints/sales/cart.js +30 -17
- package/lib/endpoints/sales/check-in-info.js +1 -7
- package/lib/endpoints/sales/custom-fields.js +4 -3
- package/lib/endpoints/sales/flexpasses.js +1 -7
- package/lib/endpoints/sales/gift-certificates.js +4 -2
- package/lib/endpoints/sales/order.js +6 -4
- package/lib/endpoints/sales/parcel-quotes.js +1 -1
- package/lib/endpoints/sales/payment-providers.js +6 -3
- package/lib/endpoints/sales/redeemable-items.js +16 -5
- package/lib/endpoints/sales/sync-entry.js +1 -1
- package/lib/endpoints/sales/voucher.js +1 -1
- package/package.json +1 -1
- package/src/client.js +3 -0
- package/src/endpoints/accounts/agencies.js +40 -0
- package/src/endpoints/accounts/application-settings.js +23 -17
- package/src/endpoints/accounts/applications.js +8 -7
- package/src/endpoints/accounts/current-shifts.js +6 -1
- package/src/endpoints/accounts/customers.js +31 -21
- package/src/endpoints/accounts/domains.js +16 -12
- package/src/endpoints/accounts/dynamic-forms.js +17 -5
- package/src/endpoints/accounts/email-settings.js +22 -20
- package/src/endpoints/accounts/email-templates.js +18 -6
- package/src/endpoints/accounts/exchange-rates.js +13 -8
- package/src/endpoints/accounts/exchange-receipts.js +10 -6
- package/src/endpoints/accounts/external-customers.js +37 -0
- package/src/endpoints/accounts/goal-settings.js +8 -7
- package/src/endpoints/accounts/images.js +14 -15
- package/src/endpoints/accounts/interline.js +35 -31
- package/src/endpoints/accounts/journey-prices-settings.js +8 -6
- package/src/endpoints/accounts/lexicons.js +48 -19
- package/src/endpoints/accounts/market-pricing-settings.js +7 -6
- package/src/endpoints/accounts/multiproduct-sales-settings.js +7 -6
- package/src/endpoints/accounts/network.js +29 -18
- package/src/endpoints/accounts/operation-settings.js +8 -7
- package/src/endpoints/accounts/people-lookups.js +39 -21
- package/src/endpoints/accounts/point-to-point-settings.js +6 -6
- package/src/endpoints/accounts/print-settings.js +9 -8
- package/src/endpoints/accounts/print-templates.js +65 -22
- package/src/endpoints/accounts/printers.js +10 -6
- package/src/endpoints/accounts/rms-settings.js +19 -11
- package/src/endpoints/accounts/s3buckets.js +3 -3
- package/src/endpoints/accounts/salesforce-settings.js +8 -7
- package/src/endpoints/accounts/shift-settings.js +7 -7
- package/src/endpoints/accounts/shifts.js +54 -15
- package/src/endpoints/accounts/sms-templates.js +56 -18
- package/src/endpoints/accounts/sub-print-templates.js +5 -3
- package/src/endpoints/accounts/ticket-movement-settings.js +8 -5
- package/src/endpoints/accounts/tokens.js +10 -3
- package/src/endpoints/accounts/transport-regulation-settings.js +2 -2
- package/src/endpoints/accounts/travellers.js +36 -17
- package/src/endpoints/accounts/trusted-machines.js +19 -8
- package/src/endpoints/accounts/twilio-settings.js +8 -6
- package/src/endpoints/accounts/users.js +53 -12
- package/src/endpoints/accounts/verified-emails.js +100 -0
- package/src/endpoints/accounts/websales-config.js +15 -6
- package/src/endpoints/btrzpay/cardpointe.js +5 -5
- package/src/endpoints/btrzpay/customerCards.js +4 -4
- package/src/endpoints/btrzpay/customers.js +3 -3
- package/src/endpoints/btrzpay/datalogic.js +8 -9
- package/src/endpoints/btrzpay/oxxo.js +5 -13
- package/src/endpoints/btrzpay/payment-methods.js +25 -11
- package/src/endpoints/btrzpay/payments.js +2 -2
- package/src/endpoints/btrzpay/prismaTerminals.js +14 -21
- package/src/endpoints/btrzpay/reference-numbers.js +1 -1
- package/src/endpoints/btrzpay/referenced-payments.js +10 -2
- package/src/endpoints/btrzpay/square.js +2 -2
- package/src/endpoints/btrzpay/stripe-terminals.js +5 -5
- package/src/endpoints/btrzpay/terminalPayments.js +15 -5
- package/src/endpoints/coltrane/merged-fare-tables.js +1 -1
- package/src/endpoints/coltrane/paths.js +9 -6
- package/src/endpoints/gps/scanner-app-location.js +3 -2
- package/src/endpoints/inventory/amenities.js +10 -7
- package/src/endpoints/inventory/amenity-groups.js +11 -7
- package/src/endpoints/inventory/banks.js +5 -11
- package/src/endpoints/inventory/bare-routes.js +12 -4
- package/src/endpoints/inventory/brands.js +10 -6
- package/src/endpoints/inventory/bundle-fares.js +4 -2
- package/src/endpoints/inventory/bundles.js +5 -2
- package/src/endpoints/inventory/change-requests.js +23 -9
- package/src/endpoints/inventory/companies.js +5 -2
- package/src/endpoints/inventory/control-classes.js +34 -4
- package/src/endpoints/inventory/countries.js +8 -3
- package/src/endpoints/inventory/custom-content.js +8 -6
- package/src/endpoints/inventory/custom-fields.js +9 -7
- package/src/endpoints/inventory/document-types.js +8 -11
- package/src/endpoints/inventory/external-passes.js +13 -4
- package/src/endpoints/inventory/external-wallets.js +5 -6
- package/src/endpoints/inventory/fallback-codes.js +11 -4
- package/src/endpoints/inventory/fare-classes.js +6 -4
- package/src/endpoints/inventory/fares.js +13 -7
- package/src/endpoints/inventory/fees.js +8 -4
- package/src/endpoints/inventory/filtered-trips-v2.js +1 -1
- package/src/endpoints/inventory/filtered-trips.js +14 -2
- package/src/endpoints/inventory/financing-costs.js +15 -8
- package/src/endpoints/inventory/garages.js +7 -5
- package/src/endpoints/inventory/getnet-terminals.js +12 -4
- package/src/endpoints/inventory/gift-certificate-definitions.js +10 -11
- package/src/endpoints/inventory/insurances.js +10 -7
- package/src/endpoints/inventory/insurancesCost.js +8 -5
- package/src/endpoints/inventory/items.js +22 -4
- package/src/endpoints/inventory/journey-prices.js +36 -7
- package/src/endpoints/inventory/labels.js +6 -5
- package/src/endpoints/inventory/marital-status.js +8 -11
- package/src/endpoints/inventory/marketplace-modifiers.js +16 -7
- package/src/endpoints/inventory/mit-terminal-settings.js +5 -11
- package/src/endpoints/inventory/mit-terminals.js +5 -11
- package/src/endpoints/inventory/operating-companies.js +13 -10
- package/src/endpoints/inventory/operation-messages.js +16 -7
- package/src/endpoints/inventory/operation-reasons.js +11 -9
- package/src/endpoints/inventory/parcel-zones.js +6 -5
- package/src/endpoints/inventory/pay-on-accounts.js +9 -3
- package/src/endpoints/inventory/payment-terminals.js +5 -11
- package/src/endpoints/inventory/prisma-terminals.js +10 -6
- package/src/endpoints/inventory/products.js +31 -7
- package/src/endpoints/inventory/promos.js +29 -11
- package/src/endpoints/inventory/routes.js +50 -31
- package/src/endpoints/inventory/schedule-groups.js +7 -7
- package/src/endpoints/inventory/schedules.js +24 -11
- package/src/endpoints/inventory/seatclasses.js +5 -15
- package/src/endpoints/inventory/seatfees.js +9 -6
- package/src/endpoints/inventory/seatmaps.js +37 -10
- package/src/endpoints/inventory/segments-information-tables.js +5 -4
- package/src/endpoints/inventory/segments-information.js +4 -2
- package/src/endpoints/inventory/service-numbers.js +9 -6
- package/src/endpoints/inventory/service-types.js +5 -11
- package/src/endpoints/inventory/ssrs.js +11 -3
- package/src/endpoints/inventory/station-classes.js +12 -6
- package/src/endpoints/inventory/station-groups.js +4 -3
- package/src/endpoints/inventory/stations-provinces.js +1 -7
- package/src/endpoints/inventory/stations-zones.js +3 -2
- package/src/endpoints/inventory/stations.js +23 -5
- package/src/endpoints/inventory/taxes.js +5 -6
- package/src/endpoints/inventory/travel-routes.js +6 -4
- package/src/endpoints/inventory/traveller-card-providers-types.js +1 -7
- package/src/endpoints/inventory/traveller-card-providers.js +3 -9
- package/src/endpoints/inventory/traveller-card-types.js +7 -6
- package/src/endpoints/inventory/trips.js +2 -8
- package/src/endpoints/inventory/vehicle-types.js +0 -1
- package/src/endpoints/inventory/vehicles.js +17 -2
- package/src/endpoints/inventory/zone-price-overages.js +4 -10
- package/src/endpoints/inventory/zone-prices.js +12 -7
- package/src/endpoints/invoices/dlink.js +3 -2
- package/src/endpoints/invoices/emails.js +1 -7
- package/src/endpoints/invoices/gti.js +2 -2
- package/src/endpoints/invoices/infile.js +2 -2
- package/src/endpoints/invoices/infileJson.js +2 -2
- package/src/endpoints/invoices/invoices.js +14 -10
- package/src/endpoints/invoices/pdfs.js +4 -3
- package/src/endpoints/invoices/providers.js +12 -11
- package/src/endpoints/invoices/providersSequences.js +5 -15
- package/src/endpoints/invoices/system.js +2 -2
- package/src/endpoints/invoices/tax-ids.js +1 -1
- package/src/endpoints/notifications/customers.js +25 -5
- package/src/endpoints/notifications/email.js +8 -3
- package/src/endpoints/notifications/manifest-notifications.js +4 -3
- package/src/endpoints/notifications/notify.js +20 -5
- package/src/endpoints/notifications/orders-rules-validations.js +2 -8
- package/src/endpoints/notifications/pdf-data.js +2 -1
- package/src/endpoints/notifications/pdfs.js +2 -1
- package/src/endpoints/notifications/printed-tickets.js +17 -7
- package/src/endpoints/notifications/twilio.js +1 -7
- package/src/endpoints/operations/accounting_items.js +9 -4
- package/src/endpoints/operations/applied_insurance.js +9 -2
- package/src/endpoints/operations/calendar_entries.js +7 -3
- package/src/endpoints/operations/external-bookings.js +2 -8
- package/src/endpoints/operations/flexpasses.js +1 -1
- package/src/endpoints/operations/loans.js +10 -4
- package/src/endpoints/operations/manifest.js +83 -33
- package/src/endpoints/operations/manifest_leg_for_tickets.js +1 -2
- package/src/endpoints/operations/movements.js +1 -7
- package/src/endpoints/operations/outlook-trips.js +13 -3
- package/src/endpoints/operations/parcels.js +20 -6
- package/src/endpoints/operations/parcels_manifests.js +6 -16
- package/src/endpoints/operations/passenger_check_in_info.js +3 -10
- package/src/endpoints/operations/redemption.js +4 -4
- package/src/endpoints/operations/rms.js +33 -6
- package/src/endpoints/operations/scheduled_notifications.js +4 -11
- package/src/endpoints/operations/segments.js +2 -2
- package/src/endpoints/operations/sold-items-fulfillment.js +4 -3
- package/src/endpoints/operations/sold-items.js +13 -4
- package/src/endpoints/operations/tickets.js +4 -4
- package/src/endpoints/operations/transaction.js +1 -1
- package/src/endpoints/operations/transactions.js +6 -14
- package/src/endpoints/operations/transport_regulations.js +1 -1
- package/src/endpoints/operations/trip_change_info.js +13 -1
- package/src/endpoints/operations/vehicle_assignments.js +10 -5
- package/src/endpoints/operations/vouchers.js +2 -9
- package/src/endpoints/operations/waitlists.js +2 -2
- package/src/endpoints/sales/bundles.js +4 -2
- package/src/endpoints/sales/cancellations.js +2 -2
- package/src/endpoints/sales/cart-promo.js +2 -9
- package/src/endpoints/sales/cart.js +30 -17
- package/src/endpoints/sales/check-in-info.js +1 -7
- package/src/endpoints/sales/custom-fields.js +4 -3
- package/src/endpoints/sales/flexpasses.js +1 -7
- package/src/endpoints/sales/gift-certificates.js +4 -2
- package/src/endpoints/sales/order.js +6 -4
- package/src/endpoints/sales/parcel-quotes.js +1 -1
- package/src/endpoints/sales/payment-providers.js +6 -3
- package/src/endpoints/sales/redeemable-items.js +16 -5
- package/src/endpoints/sales/sync-entry.js +1 -1
- package/src/endpoints/sales/voucher.js +1 -1
- package/test/endpoints/accounts/agencies.test.js +58 -0
- package/test/endpoints/accounts/external-customers.test.js +62 -0
- package/test/endpoints/accounts/users.js +10 -0
- package/test/endpoints/accounts/verified-emails.test.js +35 -0
- package/types/endpoints/accounts/users.d.ts +2 -1
- package/types/endpoints/accounts/verified-emails.d.ts +19 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Factory for images API (btrz-api-accounts).
|
|
5
|
+
* Factory for images API (btrz-api-accounts). Account images (url-based). POST/DELETE require BETTEREZ_APP.
|
|
6
6
|
* @param {Object} deps
|
|
7
7
|
* @param {import("axios").AxiosInstance} deps.client
|
|
8
8
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -10,13 +10,13 @@ const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
|
10
10
|
*/
|
|
11
11
|
function ImagesFactory({client, internalAuthTokenProvider}) {
|
|
12
12
|
/**
|
|
13
|
-
* GET /images
|
|
13
|
+
* GET /images – List images for the account (paginated). Query: page.
|
|
14
14
|
* @param {Object} opts
|
|
15
15
|
* @param {string} [opts.token] - API key
|
|
16
16
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
17
|
-
* @param {Object} [opts.query] -
|
|
17
|
+
* @param {Object} [opts.query] - Optional query (e.g. page for pagination)
|
|
18
18
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
19
|
+
* @returns {Promise<import("axios").AxiosResponse<{ images: object[], totalRecords: number, ... }>>}
|
|
20
20
|
*/
|
|
21
21
|
function all({token, jwtToken, query = {}, headers}) {
|
|
22
22
|
return client({
|
|
@@ -27,14 +27,13 @@ function ImagesFactory({client, internalAuthTokenProvider}) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* GET /images/:imageId
|
|
30
|
+
* GET /images/:imageId – Get a single image by id (24 hex ObjectId).
|
|
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 {
|
|
35
|
-
* @param {string} opts.imageId - Image id (ObjectId)
|
|
34
|
+
* @param {string} opts.imageId - Image id (24 hex characters)
|
|
36
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
36
|
+
* @returns {Promise<import("axios").AxiosResponse<{ image: object }>>}
|
|
38
37
|
*/
|
|
39
38
|
function get({token, jwtToken, query = {}, headers, imageId}) {
|
|
40
39
|
return client({
|
|
@@ -45,13 +44,13 @@ function ImagesFactory({client, internalAuthTokenProvider}) {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
|
-
* POST /images
|
|
47
|
+
* POST /images – Create an image. Requires BETTEREZ_APP JWT. Body: { image } with url required. Emits images.created.
|
|
49
48
|
* @param {Object} opts
|
|
50
49
|
* @param {string} [opts.token] - API key
|
|
51
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
52
|
-
* @param {Object} opts.image -
|
|
50
|
+
* @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
|
|
51
|
+
* @param {Object} opts.image - { url } (required)
|
|
53
52
|
* @param {Object} [opts.headers] - Optional headers
|
|
54
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
53
|
+
* @returns {Promise<import("axios").AxiosResponse<{ image: object }>>}
|
|
55
54
|
*/
|
|
56
55
|
function create({jwtToken, token, image, headers}) {
|
|
57
56
|
return client({
|
|
@@ -67,13 +66,13 @@ function ImagesFactory({client, internalAuthTokenProvider}) {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
/**
|
|
70
|
-
* DELETE /images/:imageId
|
|
69
|
+
* DELETE /images/:imageId – Delete an image. Requires BETTEREZ_APP JWT. Emits images.deleted (data: { imageId }).
|
|
71
70
|
* @param {Object} opts
|
|
72
71
|
* @param {string} [opts.token] - API key
|
|
73
72
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
74
|
-
* @param {string} opts.imageId - Image id (ObjectId)
|
|
73
|
+
* @param {string} opts.imageId - Image id (24 hex ObjectId)
|
|
75
74
|
* @param {Object} [opts.headers] - Optional headers
|
|
76
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
75
|
+
* @returns {Promise<import("axios").AxiosResponse<{ imageId: string }>>}
|
|
77
76
|
*/
|
|
78
77
|
function remove({imageId, token, jwtToken, headers}) {
|
|
79
78
|
return client({
|
|
@@ -3,7 +3,8 @@ const {
|
|
|
3
3
|
} = require("../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for interline API (btrz-api-accounts).
|
|
6
|
+
* Factory for interline API (btrz-api-accounts). Interline invitations, consumers, providers, network.
|
|
7
|
+
* POST/PUT/DELETE require BETTEREZ_APP.
|
|
7
8
|
* @param {Object} deps
|
|
8
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -12,13 +13,13 @@ const {
|
|
|
12
13
|
function interlineFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
const invitations = {
|
|
14
15
|
/**
|
|
15
|
-
* GET /interline/invitations
|
|
16
|
+
* GET /interline/invitations – List interline invitations (paginated). Query: page.
|
|
16
17
|
* @param {Object} opts
|
|
17
18
|
* @param {string} [opts.token] - API key
|
|
18
19
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
19
|
-
* @param {Object} [opts.query] -
|
|
20
|
+
* @param {Object} [opts.query] - Optional query (e.g. page)
|
|
20
21
|
* @param {Object} [opts.headers] - Optional headers
|
|
21
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
22
|
+
* @returns {Promise<import("axios").AxiosResponse<{ invitations: object[], totalRecords: number, ... }>>}
|
|
22
23
|
*/
|
|
23
24
|
all({token, jwtToken, query = {}, headers}) {
|
|
24
25
|
return client({
|
|
@@ -28,12 +29,12 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
28
29
|
});
|
|
29
30
|
},
|
|
30
31
|
/**
|
|
31
|
-
* GET /interline/invitations/:invitationId
|
|
32
|
+
* GET /interline/invitations/:invitationId – Get a single invitation by id (24 hex ObjectId).
|
|
32
33
|
* @param {Object} opts
|
|
33
34
|
* @param {string} [opts.token] - API key
|
|
34
|
-
* @param {string} opts.invitationId - Invitation id (
|
|
35
|
+
* @param {string} opts.invitationId - Invitation id (24 hex characters)
|
|
35
36
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
37
|
+
* @returns {Promise<import("axios").AxiosResponse<{ invitation: object }>>}
|
|
37
38
|
*/
|
|
38
39
|
get({token, invitationId, headers}) {
|
|
39
40
|
return client.get(`/interline/invitations/${invitationId}`, {
|
|
@@ -41,13 +42,14 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
41
42
|
});
|
|
42
43
|
},
|
|
43
44
|
/**
|
|
44
|
-
* POST /interline/invitations
|
|
45
|
+
* POST /interline/invitations – Create an invitation. Requires BETTEREZ_APP JWT. Emits interlineinvitation.created.
|
|
46
|
+
* Body: { interline } or InterlineInvitationPost at root.
|
|
45
47
|
* @param {Object} opts
|
|
46
48
|
* @param {string} [opts.token] - API key
|
|
47
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
49
|
+
* @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
|
|
48
50
|
* @param {Object} opts.data - Invitation payload
|
|
49
51
|
* @param {Object} [opts.headers] - Optional headers
|
|
50
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
52
|
+
* @returns {Promise<import("axios").AxiosResponse<{ invitation: object }>>}
|
|
51
53
|
*/
|
|
52
54
|
create({data, token, jwtToken, headers}) {
|
|
53
55
|
return client({
|
|
@@ -58,14 +60,15 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
58
60
|
});
|
|
59
61
|
},
|
|
60
62
|
/**
|
|
61
|
-
* PUT /interline/invitations/:invitationId
|
|
63
|
+
* PUT /interline/invitations/:invitationId – Update invitation (e.g. accept/reject). Requires BETTEREZ_APP.
|
|
64
|
+
* Emits interlineinvitation.updated.
|
|
62
65
|
* @param {Object} opts
|
|
63
66
|
* @param {string} [opts.token] - API key
|
|
64
67
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
65
|
-
* @param {string} opts.invitationId - Invitation id (ObjectId)
|
|
66
|
-
* @param {Object} opts.data -
|
|
68
|
+
* @param {string} opts.invitationId - Invitation id (24 hex ObjectId)
|
|
69
|
+
* @param {Object} opts.data - Body (InterlineInvitePutData)
|
|
67
70
|
* @param {Object} [opts.headers] - Optional headers
|
|
68
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
71
|
+
* @returns {Promise<import("axios").AxiosResponse<{ invitation: object }>>}
|
|
69
72
|
*/
|
|
70
73
|
update({invitationId, data, token, jwtToken, headers}) {
|
|
71
74
|
return client({
|
|
@@ -79,13 +82,13 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
79
82
|
|
|
80
83
|
const consumers = {
|
|
81
84
|
/**
|
|
82
|
-
* GET /interline/consumers
|
|
85
|
+
* GET /interline/consumers – List interline consumers (paginated). Query: page.
|
|
83
86
|
* @param {Object} opts
|
|
84
87
|
* @param {string} [opts.token] - API key
|
|
85
88
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
86
|
-
* @param {Object} [opts.query] -
|
|
89
|
+
* @param {Object} [opts.query] - Optional query (e.g. page)
|
|
87
90
|
* @param {Object} [opts.headers] - Optional headers
|
|
88
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
91
|
+
* @returns {Promise<import("axios").AxiosResponse<{ consumers: object[], totalRecords: number, ... }>>}
|
|
89
92
|
*/
|
|
90
93
|
all({token, jwtToken, query = {}, headers}) {
|
|
91
94
|
return client({
|
|
@@ -98,13 +101,13 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
98
101
|
|
|
99
102
|
const providers = {
|
|
100
103
|
/**
|
|
101
|
-
* GET /interline/providers
|
|
104
|
+
* GET /interline/providers – List interline providers (paginated). Query: page.
|
|
102
105
|
* @param {Object} opts
|
|
103
106
|
* @param {string} [opts.token] - API key
|
|
104
107
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
105
|
-
* @param {Object} [opts.query] -
|
|
108
|
+
* @param {Object} [opts.query] - Optional query (e.g. page)
|
|
106
109
|
* @param {Object} [opts.headers] - Optional headers
|
|
107
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
110
|
+
* @returns {Promise<import("axios").AxiosResponse<{ providers: object[], totalRecords: number, ... }>>}
|
|
108
111
|
*/
|
|
109
112
|
all({token, jwtToken, query = {}, headers}) {
|
|
110
113
|
return client({
|
|
@@ -117,27 +120,28 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
117
120
|
|
|
118
121
|
const network = {
|
|
119
122
|
/**
|
|
120
|
-
* GET /interline/:interlineId/network
|
|
123
|
+
* GET /interline/:interlineId/network – Get interline network by interline id (24 hex ObjectId).
|
|
121
124
|
* @param {Object} opts
|
|
122
125
|
* @param {string} [opts.token] - API key
|
|
123
|
-
* @param {string} opts.
|
|
126
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
127
|
+
* @param {string} opts.interlineId - Interline id (24 hex ObjectId)
|
|
124
128
|
* @param {Object} [opts.headers] - Optional headers
|
|
125
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
129
|
+
* @returns {Promise<import("axios").AxiosResponse<{ network: object }>>}
|
|
126
130
|
*/
|
|
127
|
-
get({token, interlineId, headers}) {
|
|
131
|
+
get({token, jwtToken, interlineId, headers}) {
|
|
128
132
|
return client.get(`/interline/${interlineId}/network`, {
|
|
129
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
133
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
130
134
|
});
|
|
131
135
|
},
|
|
132
136
|
/**
|
|
133
|
-
* PUT /interline/:interlineId/network
|
|
137
|
+
* PUT /interline/:interlineId/network – Update interline network. Requires BETTEREZ_APP. Emits interlinenetwork.updated.
|
|
134
138
|
* @param {Object} opts
|
|
135
139
|
* @param {string} [opts.token] - API key
|
|
136
140
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
137
|
-
* @param {string} opts.interlineId - Interline id (ObjectId)
|
|
138
|
-
* @param {Object} opts.data - Network payload
|
|
141
|
+
* @param {string} opts.interlineId - Interline id (24 hex ObjectId)
|
|
142
|
+
* @param {Object} opts.data - Network payload (InterlinePutData)
|
|
139
143
|
* @param {Object} [opts.headers] - Optional headers
|
|
140
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
144
|
+
* @returns {Promise<import("axios").AxiosResponse<{ network: object }>>}
|
|
141
145
|
*/
|
|
142
146
|
update({interlineId, data, token, jwtToken, headers}) {
|
|
143
147
|
return client({
|
|
@@ -155,11 +159,11 @@ function interlineFactory({client, internalAuthTokenProvider}) {
|
|
|
155
159
|
providers,
|
|
156
160
|
network,
|
|
157
161
|
/**
|
|
158
|
-
* DELETE /interline/:interlineId
|
|
162
|
+
* DELETE /interline/:interlineId – Remove an interline. Requires BETTEREZ_APP. Emits interlinenetwork.deleted.
|
|
159
163
|
* @param {Object} opts
|
|
160
164
|
* @param {string} [opts.token] - API key
|
|
161
165
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
162
|
-
* @param {string} opts.interlineId - Interline id (ObjectId)
|
|
166
|
+
* @param {string} opts.interlineId - Interline id (24 hex ObjectId)
|
|
163
167
|
* @param {Object} [opts.headers] - Optional headers
|
|
164
168
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
165
169
|
*/
|
|
@@ -3,7 +3,8 @@ const {
|
|
|
3
3
|
} = require("../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for journey-prices-settings API (btrz-api-accounts).
|
|
6
|
+
* Factory for journey-prices-settings API (btrz-api-accounts). Journey pricing settings (record protection rules, pricing parameters).
|
|
7
|
+
* Requires user logged in to backoffice app.
|
|
7
8
|
* @param {Object} deps
|
|
8
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -11,12 +12,12 @@ const {
|
|
|
11
12
|
*/
|
|
12
13
|
function journeyPricesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
/**
|
|
14
|
-
* GET /journey-prices-settings
|
|
15
|
+
* GET /journey-prices-settings – Get journey prices settings for the account.
|
|
15
16
|
* @param {Object} opts
|
|
16
17
|
* @param {string} [opts.token] - API key
|
|
17
18
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
18
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ journeyPricesSettings: object }>>}
|
|
20
21
|
*/
|
|
21
22
|
function get({token, jwtToken, headers}) {
|
|
22
23
|
return client({
|
|
@@ -26,13 +27,14 @@ function journeyPricesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* PUT /journey-prices-settings
|
|
30
|
+
* PUT /journey-prices-settings – Update journey prices settings. Body: JourneyPricesSettings at root.
|
|
31
|
+
* Required: recordProtectionRules. Optional: pricingParameters, allowEachTripSegmentToBePricedIndividually.
|
|
30
32
|
* @param {Object} opts
|
|
31
33
|
* @param {string} [opts.token] - API key
|
|
32
34
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
33
|
-
* @param {Object} opts.journeyPricesSettings -
|
|
35
|
+
* @param {Object} opts.journeyPricesSettings - { recordProtectionRules, pricingParameters?, allowEachTripSegmentToBePricedIndividually? }
|
|
34
36
|
* @param {Object} [opts.headers] - Optional headers
|
|
35
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
37
|
+
* @returns {Promise<import("axios").AxiosResponse<{ journeyPricesSettings: object }>>}
|
|
36
38
|
*/
|
|
37
39
|
function update({token, jwtToken, journeyPricesSettings, headers}) {
|
|
38
40
|
return client({
|
|
@@ -3,6 +3,35 @@ const {
|
|
|
3
3
|
authorizationHeaders
|
|
4
4
|
} = require("./../endpoints_helpers.js");
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Query params for GET /lexicons/:lexiconCollectionId (btrz-api-accounts). See get-lexicons handler getSpec().
|
|
8
|
+
* @typedef {Object} LexiconsListQuery
|
|
9
|
+
* @property {string} [providerIds] - Provider ids to get lexicons for
|
|
10
|
+
* @property {string} [context] - Context of the lexicons to search
|
|
11
|
+
* @property {boolean} [accountOnly] - Filter lexicons only for the given providerIds; context ignored when true
|
|
12
|
+
* @property {string} [key] - Specific lexicon key to search for
|
|
13
|
+
* @property {string} [keys] - Comma-separated list of keys to search for
|
|
14
|
+
* @property {string} [lang] - ISO language code to filter values
|
|
15
|
+
* @property {string} [langs] - Comma-separated ISO language codes to filter values
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Query params for GET /lexicons/suggestions (btrz-api-accounts). See get-lexicons-suggestions handler getSpec().
|
|
20
|
+
* @typedef {Object} LexiconSuggestionsListQuery
|
|
21
|
+
* @property {string} [status] - Filter by status: under review | accepted | rejected
|
|
22
|
+
* @property {string} [lang] - Filter by language code (e.g. en-us, pt-br)
|
|
23
|
+
* @property {string} [key] - Filter by lexicon key
|
|
24
|
+
* @property {string} [superUserId] - Super user id; with superUserHash returns suggestions for all accounts
|
|
25
|
+
* @property {string} [superUserHash] - Super user hash; with superUserId returns suggestions for all accounts
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Query params for GET /lexicons/suggestions/:id (btrz-api-accounts). See get-lexicons-suggestion-by-id handler getSpec().
|
|
30
|
+
* @typedef {Object} LexiconSuggestionGetByIdQuery
|
|
31
|
+
* @property {string} [superUserId] - Super user id; with superUserHash any suggestion can be retrieved
|
|
32
|
+
* @property {string} [superUserHash] - Super user hash; with superUserId any suggestion can be retrieved
|
|
33
|
+
*/
|
|
34
|
+
|
|
6
35
|
/**
|
|
7
36
|
* Factory for lexicons API (btrz-api-accounts).
|
|
8
37
|
* @param {Object} deps
|
|
@@ -14,13 +43,13 @@ function lexiconsFactory({
|
|
|
14
43
|
client, internalAuthTokenProvider
|
|
15
44
|
}) {
|
|
16
45
|
/**
|
|
17
|
-
* GET lexicons/buscompany
|
|
46
|
+
* GET /lexicons/buscompany – list account translations from buscompany collection. Query params from get-lexicons getSpec().
|
|
18
47
|
* @param {Object} opts
|
|
19
48
|
* @param {string} [opts.token] - API key
|
|
20
|
-
* @param {string} opts.context - Context (
|
|
21
|
-
* @param {
|
|
49
|
+
* @param {string} [opts.context] - Context of the lexicons to search (merged into query)
|
|
50
|
+
* @param {LexiconsListQuery} [opts.query] - Query params: providerIds, context, accountOnly, key, keys, lang, langs
|
|
22
51
|
* @param {Object} [opts.headers] - Optional headers
|
|
23
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
52
|
+
* @returns {Promise<import("axios").AxiosResponse<{ lexicons: Array }>>}
|
|
24
53
|
*/
|
|
25
54
|
function all({
|
|
26
55
|
token,
|
|
@@ -38,13 +67,13 @@ function lexiconsFactory({
|
|
|
38
67
|
}
|
|
39
68
|
|
|
40
69
|
/**
|
|
41
|
-
* POST /lexicons
|
|
70
|
+
* POST /lexicons – create lexicon entries. Body: { entries }. Requires BETTEREZ_APP audience.
|
|
42
71
|
* @param {Object} opts
|
|
43
72
|
* @param {string} [opts.token] - API key
|
|
44
73
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
45
|
-
* @param {Array} opts.lexiconEntries - Entries to create
|
|
74
|
+
* @param {Array} opts.lexiconEntries - Entries to create (accountId, name, values, context per item)
|
|
46
75
|
* @param {Object} [opts.headers] - Optional headers
|
|
47
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
76
|
+
* @returns {Promise<import("axios").AxiosResponse<{ successes: Array, failures: Array }>>}
|
|
48
77
|
*/
|
|
49
78
|
function create({
|
|
50
79
|
token,
|
|
@@ -63,13 +92,13 @@ function lexiconsFactory({
|
|
|
63
92
|
}
|
|
64
93
|
|
|
65
94
|
/**
|
|
66
|
-
* PUT /lexicons
|
|
95
|
+
* PUT /lexicons – create or update many lexicon entries. Body: { entries }. Emits webhook lexicons.updated. Requires BETTEREZ_APP audience.
|
|
67
96
|
* @param {Object} opts
|
|
68
97
|
* @param {string} [opts.token] - API key
|
|
69
98
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
70
|
-
* @param {Array} opts.entries - Entries to create or update
|
|
99
|
+
* @param {Array} opts.entries - Entries to create or update (key, values per item)
|
|
71
100
|
* @param {Object} [opts.headers] - Optional headers
|
|
72
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
101
|
+
* @returns {Promise<import("axios").AxiosResponse<{ status: string, entries: Array }>>}
|
|
73
102
|
*/
|
|
74
103
|
function createOrUpdateMany({
|
|
75
104
|
token,
|
|
@@ -90,13 +119,13 @@ function lexiconsFactory({
|
|
|
90
119
|
}
|
|
91
120
|
|
|
92
121
|
/**
|
|
93
|
-
* PATCH /lexicons
|
|
122
|
+
* PATCH /lexicons – update many lexicon entries. Body: { updates } (key, accountId, values and/or context). Requires BETTEREZ_APP audience.
|
|
94
123
|
* @param {Object} opts
|
|
95
124
|
* @param {string} [opts.token] - API key
|
|
96
125
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
97
|
-
* @param {Array} opts.updates - Updates to apply
|
|
126
|
+
* @param {Array} opts.updates - Updates to apply (key, accountId, values?, context?)
|
|
98
127
|
* @param {Object} [opts.headers] - Optional headers
|
|
99
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
128
|
+
* @returns {Promise<import("axios").AxiosResponse<{ entries: Array }>>}
|
|
100
129
|
*/
|
|
101
130
|
function updateMany({
|
|
102
131
|
token,
|
|
@@ -115,14 +144,14 @@ function lexiconsFactory({
|
|
|
115
144
|
}
|
|
116
145
|
|
|
117
146
|
/**
|
|
118
|
-
*
|
|
147
|
+
* GET /lexicons/:lang/content – search global lexicons (no account) by partial match on translation value. Requires BETTEREZ_APP audience.
|
|
119
148
|
* @param {Object} opts
|
|
120
149
|
* @param {string} opts.lang - Language code (e.g. en-us, pt-br). Must be a supported language.
|
|
121
150
|
* @param {string} opts.txt - Text to search for (partial, case-insensitive). Required.
|
|
122
151
|
* @param {string} [opts.token] - API key
|
|
123
152
|
* @param {string} [opts.jwtToken] - JWT
|
|
124
153
|
* @param {Object} [opts.headers] - Optional request headers
|
|
125
|
-
* @returns {Promise<{
|
|
154
|
+
* @returns {Promise<import("axios").AxiosResponse<{ lexiconTextContentItems: Array }>>}
|
|
126
155
|
*/
|
|
127
156
|
function getByText({token, jwtToken, headers, lang, txt}) {
|
|
128
157
|
return client({
|
|
@@ -134,12 +163,12 @@ function lexiconsFactory({
|
|
|
134
163
|
|
|
135
164
|
const suggestions = {
|
|
136
165
|
/**
|
|
137
|
-
*
|
|
166
|
+
* GET /lexicons/suggestions - list lexicon suggestions (or all accounts when super user params provided).
|
|
138
167
|
* @param {Object} opts
|
|
139
168
|
* @param {string} [opts.token] - API key (x-api-key)
|
|
140
169
|
* @param {string} [opts.jwtToken] - JWT or constants.INTERNAL_AUTH_TOKEN_SYMBOL for internal auth
|
|
141
170
|
* @param {Object} [opts.headers] - Optional request headers
|
|
142
|
-
* @param {
|
|
171
|
+
* @param {LexiconSuggestionsListQuery} [opts.params] - Query params: status, lang, key, superUserId, superUserHash
|
|
143
172
|
* @returns {Promise<{data: { suggestions: Array }}>}
|
|
144
173
|
*/
|
|
145
174
|
list({token, jwtToken, headers, params = {}}) {
|
|
@@ -151,13 +180,13 @@ function lexiconsFactory({
|
|
|
151
180
|
},
|
|
152
181
|
|
|
153
182
|
/**
|
|
154
|
-
*
|
|
183
|
+
* GET /lexicons/suggestions/:id - get a single lexicon suggestion by id.
|
|
155
184
|
* @param {Object} opts
|
|
156
185
|
* @param {string} opts.suggestionId - MongoDB ObjectId of the suggestion
|
|
157
186
|
* @param {string} [opts.token] - API key
|
|
158
187
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
159
188
|
* @param {Object} [opts.headers] - Optional request headers
|
|
160
|
-
* @param {
|
|
189
|
+
* @param {LexiconSuggestionGetByIdQuery} [opts.params] - Query params: superUserId, superUserHash (to access any account's suggestion)
|
|
161
190
|
* @returns {Promise<{data: Object}>}
|
|
162
191
|
*/
|
|
163
192
|
getById({token, jwtToken, headers, suggestionId, params = {}}) {
|
|
@@ -3,7 +3,8 @@ const {
|
|
|
3
3
|
} = require("../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for market-pricing-settings API (btrz-api-accounts).
|
|
6
|
+
* Factory for market-pricing-settings API (btrz-api-accounts). Market pricing configuration (e.g. useOnlySpecificFareTable).
|
|
7
|
+
* Requires user logged in to backoffice app.
|
|
7
8
|
* @param {Object} deps
|
|
8
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -11,12 +12,12 @@ const {
|
|
|
11
12
|
*/
|
|
12
13
|
function marketPricingSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
/**
|
|
14
|
-
* GET /market-pricing-settings
|
|
15
|
+
* GET /market-pricing-settings – Get market pricing settings for the account.
|
|
15
16
|
* @param {Object} opts
|
|
16
17
|
* @param {string} [opts.token] - API key
|
|
17
18
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
18
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: { useOnlySpecificFareTable: boolean } }>>}
|
|
20
21
|
*/
|
|
21
22
|
function get({token, jwtToken, headers}) {
|
|
22
23
|
return client({
|
|
@@ -26,13 +27,13 @@ function marketPricingSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* PUT /market-pricing-settings
|
|
30
|
+
* PUT /market-pricing-settings – Update market pricing settings. Body: MarketPricingSettings at root (useOnlySpecificFareTable required).
|
|
30
31
|
* @param {Object} opts
|
|
31
32
|
* @param {string} [opts.token] - API key
|
|
32
33
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
33
|
-
* @param {Object} opts.marketPricingSettings -
|
|
34
|
+
* @param {Object} opts.marketPricingSettings - { useOnlySpecificFareTable: boolean }
|
|
34
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
35
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
36
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketPricingSettings: object }>>}
|
|
36
37
|
*/
|
|
37
38
|
function update({token, jwtToken, marketPricingSettings, headers}) {
|
|
38
39
|
return client({
|
|
@@ -3,7 +3,8 @@ const {
|
|
|
3
3
|
} = require("../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for multiproduct-sales-settings API (btrz-api-accounts).
|
|
6
|
+
* Factory for multiproduct-sales-settings API (btrz-api-accounts). Multi-product sales settings (product/station/fare/fareClass mappings).
|
|
7
|
+
* Requires BETTEREZ_APP audience. PUT emits webhooks networks.created or networks.updated.
|
|
7
8
|
* @param {Object} deps
|
|
8
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -11,12 +12,12 @@ const {
|
|
|
11
12
|
*/
|
|
12
13
|
function multiproductSalesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
/**
|
|
14
|
-
* GET /multiproduct-sales-settings
|
|
15
|
+
* GET /multiproduct-sales-settings – Get multi-product sales settings for the account.
|
|
15
16
|
* @param {Object} opts
|
|
16
17
|
* @param {string} [opts.token] - API key
|
|
17
18
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
18
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ multiProductSettings: object }>>}
|
|
20
21
|
*/
|
|
21
22
|
function get({token, jwtToken, headers}) {
|
|
22
23
|
return client({
|
|
@@ -26,13 +27,13 @@ function multiproductSalesSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* PUT /multiproduct-sales-settings
|
|
30
|
+
* PUT /multiproduct-sales-settings – Create or update multi-product sales settings (upsert). Body: MultiProductSettingsPayload (productsMapping, stationsMapping, faresMapping, fareClassesMapping). Emits networks.created or networks.updated.
|
|
30
31
|
* @param {Object} opts
|
|
31
32
|
* @param {string} [opts.token] - API key
|
|
32
33
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
33
|
-
* @param {Object} opts.data -
|
|
34
|
+
* @param {Object} opts.data - multiProductSettings payload (productsMapping, stationsMapping, faresMapping, fareClassesMapping; each key ObjectId, each value array of ObjectIds)
|
|
34
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
35
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
36
|
+
* @returns {Promise<import("axios").AxiosResponse<{ multiProductSettings: object }>>}
|
|
36
37
|
*/
|
|
37
38
|
function update({token, jwtToken, data, headers}) {
|
|
38
39
|
return client({
|
|
@@ -3,6 +3,13 @@ const {
|
|
|
3
3
|
authorizationHeaders
|
|
4
4
|
} = require("../endpoints_helpers.js");
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Query params for GET /network/agencies (btrz-api-accounts). See get-agencies-handler getSpec().
|
|
8
|
+
* @typedef {Object} NetworkAgenciesListQuery
|
|
9
|
+
* @property {string} [name] - Filter by agency/seller name (prefix, case-insensitive)
|
|
10
|
+
* @property {number} [page] - Page number (1-based)
|
|
11
|
+
*/
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* Factory for network API (btrz-api-accounts).
|
|
8
15
|
* @param {Object} deps
|
|
@@ -13,13 +20,14 @@ const {
|
|
|
13
20
|
function networkFactory({client, internalAuthTokenProvider}) {
|
|
14
21
|
const agencies = {
|
|
15
22
|
/**
|
|
16
|
-
* GET /network/agencies - list agencies.
|
|
23
|
+
* GET /network/agencies - list agencies (paginated). Query: name, page.
|
|
17
24
|
* @param {Object} opts
|
|
18
25
|
* @param {string} [opts.token] - API key
|
|
19
26
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
20
|
-
* @param {
|
|
27
|
+
* @param {NetworkAgenciesListQuery} [opts.query] - Query params (name, page)
|
|
21
28
|
* @param {Object} [opts.headers] - Optional headers
|
|
22
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
29
|
+
* @returns {Promise<import("axios").AxiosResponse<{ agencies: Array, next?: string, previous?: string, count?: number }>>}
|
|
30
|
+
* Errors: 401, 500
|
|
23
31
|
*/
|
|
24
32
|
all({token, jwtToken, query = {}, headers}) {
|
|
25
33
|
return client({
|
|
@@ -29,29 +37,30 @@ function networkFactory({client, internalAuthTokenProvider}) {
|
|
|
29
37
|
});
|
|
30
38
|
},
|
|
31
39
|
/**
|
|
32
|
-
* GET /network/agencies/:
|
|
40
|
+
* GET /network/agencies/:agencyId - get an agency by id.
|
|
33
41
|
* @param {Object} opts
|
|
34
42
|
* @param {string} [opts.token] - API key
|
|
35
|
-
* @param {string} opts.
|
|
36
|
-
* @param {
|
|
43
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
44
|
+
* @param {string} opts.sellerId - Seller/agency id (ObjectId), path param agencyId
|
|
45
|
+
* @param {Object} [opts.query] - Optional query params
|
|
37
46
|
* @param {Object} [opts.headers] - Optional headers
|
|
38
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
47
|
+
* @returns {Promise<import("axios").AxiosResponse<{ agency: Object }>>}
|
|
48
|
+
* Errors: 400 (INVALID_AGENCY_ID), 401, 404 (AGENCY_NOT_FOUND), 500
|
|
39
49
|
*/
|
|
40
|
-
get({token, query, headers, sellerId}) {
|
|
50
|
+
get({token, jwtToken, query, headers, sellerId}) {
|
|
41
51
|
return client({
|
|
42
52
|
url: `/network/agencies/${sellerId}`,
|
|
43
|
-
params: query,
|
|
44
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
53
|
+
params: query || {},
|
|
54
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
45
55
|
});
|
|
46
56
|
},
|
|
47
57
|
/**
|
|
48
|
-
* PUT /network/agencies/:sellerId - update an agency.
|
|
58
|
+
* PUT /network/agencies/:sellerId - update an agency. API does not accept query params.
|
|
49
59
|
* @param {Object} opts
|
|
50
60
|
* @param {string} [opts.token] - API key
|
|
51
61
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
52
62
|
* @param {string} opts.sellerId - Seller/agency id (ObjectId)
|
|
53
63
|
* @param {Object} opts.agency - Agency payload
|
|
54
|
-
* @param {Object} [opts.query] - Query params
|
|
55
64
|
* @param {Object} [opts.headers] - Optional headers
|
|
56
65
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
57
66
|
*/
|
|
@@ -90,13 +99,14 @@ function networkFactory({client, internalAuthTokenProvider}) {
|
|
|
90
99
|
});
|
|
91
100
|
},
|
|
92
101
|
/**
|
|
93
|
-
* PUT /network/agencies/remove-product - remove
|
|
102
|
+
* PUT /network/agencies/remove-product - remove productId from all agencies for the account.
|
|
94
103
|
* @param {Object} opts
|
|
95
104
|
* @param {string} [opts.token] - API key
|
|
96
105
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
97
|
-
* @param {string} opts.productId - Product id (
|
|
106
|
+
* @param {string} opts.productId - Product id (non-empty string)
|
|
98
107
|
* @param {Object} [opts.headers] - Optional headers
|
|
99
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
108
|
+
* @returns {Promise<import("axios").AxiosResponse<{}>>}
|
|
109
|
+
* Errors: 400 (WRONG_DATA), 401, 500
|
|
100
110
|
*/
|
|
101
111
|
removeProduct({token, jwtToken, productId, headers}) {
|
|
102
112
|
return client({
|
|
@@ -111,13 +121,14 @@ function networkFactory({client, internalAuthTokenProvider}) {
|
|
|
111
121
|
});
|
|
112
122
|
},
|
|
113
123
|
/**
|
|
114
|
-
* PUT /network/agencies/remove-fare - remove
|
|
124
|
+
* PUT /network/agencies/remove-fare - remove fareId from all agencies for the account.
|
|
115
125
|
* @param {Object} opts
|
|
116
126
|
* @param {string} [opts.token] - API key
|
|
117
127
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
118
|
-
* @param {string} opts.fareId - Fare id (
|
|
128
|
+
* @param {string} opts.fareId - Fare id (non-empty string)
|
|
119
129
|
* @param {Object} [opts.headers] - Optional headers
|
|
120
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
130
|
+
* @returns {Promise<import("axios").AxiosResponse<{}>>}
|
|
131
|
+
* Errors: 400 (WRONG_DATA), 401, 500
|
|
121
132
|
*/
|
|
122
133
|
removeFare({token, jwtToken, fareId, headers}) {
|
|
123
134
|
return client({
|