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
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Query params for GET /shifts (btrz-api-accounts). See get-shifts handler getSpec().
|
|
6
|
+
* @typedef {Object} ShiftsListQuery
|
|
7
|
+
* @property {string} [includeActivity] - 'true'|'false'; default 'true' (include sales activity)
|
|
8
|
+
* @property {string} [status] - open | closed (ignored if pendingShiftClosure is true)
|
|
9
|
+
* @property {string} [pendingShiftClosure] - 'true'|'false'; return shifts that need shift closure
|
|
10
|
+
* @property {string} [locationId] - Filter by location (ObjectId)
|
|
11
|
+
* @property {string} [providerId] - Provider for payments (ObjectId)
|
|
12
|
+
* @property {string} [sort] - closedAsc | closedDesc | openedAsc
|
|
13
|
+
* @property {string} [fromDate] - Start date (YYYY-MM-DD); requires toDate
|
|
14
|
+
* @property {string} [toDate] - End date (YYYY-MM-DD); requires fromDate
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Query params for GET /shifts/location-closures (btrz-api-accounts). See get-location-closures handler getSpec().
|
|
19
|
+
* @typedef {Object} LocationClosuresListQuery
|
|
20
|
+
* @property {string} [sort] - createdAsc | createdDesc | updatedAsc | updatedDesc
|
|
21
|
+
* @property {number} [page] - Page number
|
|
22
|
+
* @property {string} [fromDate] - Start date (YYYY-MM-DD); requires toDate
|
|
23
|
+
* @property {string} [toDate] - End date (YYYY-MM-DD); requires fromDate
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Query params for GET /shifts/:locationId/purchase-limit-payments (btrz-api-accounts). See getSpec().
|
|
28
|
+
* @typedef {Object} PurchaseLimitPaymentsQuery
|
|
29
|
+
* @property {string} day - Date of payments (YYYY-MM-DD). Required.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Query params for GET /shifts/:shiftId/sales-summary (btrz-api-accounts). See get-shift-sales-summary getSpec().
|
|
34
|
+
* @typedef {Object} ShiftSalesSummaryQuery
|
|
35
|
+
* @property {string} [type] - 'revenueOperatingCompany' to aggregate by revenue operating company
|
|
36
|
+
* @property {boolean} [depositable] - Get only depositable payment types
|
|
37
|
+
* @property {boolean} [paymentsAndRefundsDetails] - Include payments and refunds details per payment type and currency
|
|
38
|
+
*/
|
|
39
|
+
|
|
4
40
|
/**
|
|
5
41
|
* Factory for shifts API (btrz-api-accounts).
|
|
6
42
|
* @param {Object} deps
|
|
@@ -10,13 +46,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
10
46
|
*/
|
|
11
47
|
function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
12
48
|
/**
|
|
13
|
-
* GET /shifts - list shifts.
|
|
49
|
+
* GET /shifts - list shifts for the account. Returns shifts filtered by query params.
|
|
50
|
+
* See get-shifts handler getSpec() in btrz-api-accounts for full API details.
|
|
14
51
|
* @param {Object} opts
|
|
15
52
|
* @param {string} [opts.token] - API key
|
|
16
53
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
17
|
-
* @param {
|
|
54
|
+
* @param {ShiftsListQuery} [opts.query] - Query params (includeActivity, status, pendingShiftClosure, locationId, providerId, sort, fromDate, toDate)
|
|
18
55
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
56
|
+
* @returns {Promise<import("axios").AxiosResponse<{ shifts: Array }>>} Response body: { shifts }. Errors: 400 (validation), 401, 500
|
|
20
57
|
*/
|
|
21
58
|
function all({jwtToken, token, query, headers}) {
|
|
22
59
|
return client.get("/shifts", {
|
|
@@ -28,7 +65,7 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
65
|
}
|
|
29
66
|
|
|
30
67
|
/**
|
|
31
|
-
* GET /shift/user/:userId - get shift for user.
|
|
68
|
+
* GET /shift/user/:userId - get shift for user. API does not accept query params.
|
|
32
69
|
* @param {Object} opts
|
|
33
70
|
* @param {string} [opts.token] - API key
|
|
34
71
|
* @param {string} opts.userId - User id (ObjectId)
|
|
@@ -42,13 +79,14 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
42
79
|
}
|
|
43
80
|
|
|
44
81
|
/**
|
|
45
|
-
* POST /shifts -
|
|
82
|
+
* POST /shifts - open a shift for a user. Body: PostShiftRequest (stationId, userId, counterNumber).
|
|
83
|
+
* See post-shift handler getSpec() in btrz-api-accounts for full API details.
|
|
46
84
|
* @param {Object} opts
|
|
47
85
|
* @param {string} [opts.token] - API key
|
|
48
86
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
49
|
-
* @param {Object} opts.shiftData - Shift payload
|
|
87
|
+
* @param {Object} opts.shiftData - Shift payload (stationId, userId, counterNumber)
|
|
50
88
|
* @param {Object} [opts.headers] - Optional headers
|
|
51
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
89
|
+
* @returns {Promise<import("axios").AxiosResponse<{ shift: Object }>>} Response body: { shift }. Errors: 400, 401, 404 (USER_NOT_FOUND, STATION_NOT_FOUND), 409 (SHIFT_ALREADY_OPEN_FOR_USER, USER_WITHOUT_SHIFT_ENABLED), 500
|
|
52
90
|
*/
|
|
53
91
|
function create({jwtToken, token, shiftData, headers}) {
|
|
54
92
|
return client({
|
|
@@ -62,15 +100,16 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
62
100
|
}
|
|
63
101
|
|
|
64
102
|
/**
|
|
65
|
-
* PATCH /shifts/:shiftId -
|
|
103
|
+
* PATCH /shifts/:shiftId - close a shift. Body: PatchShiftRequest (operations array with comment).
|
|
104
|
+
* See patch-shift handler getSpec() in btrz-api-accounts for full API details.
|
|
66
105
|
* @param {Object} opts
|
|
67
106
|
* @param {string} [opts.token] - API key
|
|
68
107
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
69
108
|
* @param {string} opts.shiftId - Shift id (ObjectId)
|
|
70
|
-
* @param {Object} opts.operations - Operations payload
|
|
71
|
-
* @param {Object} [opts.query] - Query params
|
|
109
|
+
* @param {Object} opts.operations - Operations payload (e.g. [{ comment }] for close)
|
|
72
110
|
* @param {Object} [opts.headers] - Optional headers
|
|
73
|
-
* @
|
|
111
|
+
* @param {Object} [opts.query] - Optional query params
|
|
112
|
+
* @returns {Promise<import("axios").AxiosResponse<{ shift: Object }>>} Response body: { shift }. Errors: 401, 404 (SHIFT_NOT_FOUND, USER_NOT_FOUND), 409 (SHIFT_ALREADY_CLOSED, COMMENT_IS_MANDATORY_WHEN_VARIANCE_EXISTS, TOTAL_CHANGED), 500
|
|
74
113
|
*/
|
|
75
114
|
function update({jwtToken, token, shiftId, operations, headers, query}) {
|
|
76
115
|
return client({
|
|
@@ -157,7 +196,7 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
157
196
|
* @param {Object} opts
|
|
158
197
|
* @param {string} [opts.token] - API key
|
|
159
198
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
160
|
-
* @param {
|
|
199
|
+
* @param {ShiftsListQuery} [opts.query] - Query params
|
|
161
200
|
* @param {Object} [opts.headers] - Optional headers
|
|
162
201
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
163
202
|
*/
|
|
@@ -170,7 +209,7 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
170
209
|
});
|
|
171
210
|
},
|
|
172
211
|
/**
|
|
173
|
-
* GET /shifts/location-closures/:locationClosureId - get a location closure.
|
|
212
|
+
* GET /shifts/location-closures/:locationClosureId - get a location closure. API does not accept query params.
|
|
174
213
|
* @param {Object} opts
|
|
175
214
|
* @param {string} [opts.token] - API key
|
|
176
215
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -458,7 +497,7 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
458
497
|
* @param {string} [opts.token] - API key
|
|
459
498
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
460
499
|
* @param {string} opts.locationId - Location id (ObjectId)
|
|
461
|
-
* @param {
|
|
500
|
+
* @param {PurchaseLimitPaymentsQuery} [opts.query] - Query params; day (YYYY-MM-DD) is required
|
|
462
501
|
* @param {Object} [opts.headers] - Optional headers
|
|
463
502
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
464
503
|
*/
|
|
@@ -478,7 +517,7 @@ function shiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
478
517
|
* @param {string} [opts.token] - API key
|
|
479
518
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
480
519
|
* @param {string} opts.shiftId - Shift id (ObjectId)
|
|
481
|
-
* @param {
|
|
520
|
+
* @param {ShiftSalesSummaryQuery} [opts.query] - Query params (type, depositable, paymentsAndRefundsDetails)
|
|
482
521
|
* @param {Object} [opts.headers] - Optional headers
|
|
483
522
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
484
523
|
*/
|
|
@@ -3,6 +3,36 @@ const {
|
|
|
3
3
|
authorizationHeaders
|
|
4
4
|
} = require("../endpoints_helpers.js");
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Query params for GET /sms-templates (btrz-api-accounts). See get-handler getSpec().
|
|
8
|
+
* @typedef {Object} SmsTemplatesListQuery
|
|
9
|
+
* @property {string} [providerId] - Filter by provider account (ObjectId)
|
|
10
|
+
* @property {string} [type] - Filter by template type
|
|
11
|
+
* @property {string} [channel] - backoffice | agency-backoffice | websales | agency-websales | any
|
|
12
|
+
* @property {string} [sort] - relevance | natural | createdAsc | createdDesc | updatedAsc | updatedDesc
|
|
13
|
+
* @property {string} [templateCollectionId] - default | custom
|
|
14
|
+
* @property {string} [status] - draft | published
|
|
15
|
+
* @property {string} [agencyId] - Filter sub-templates for this agency (ObjectId)
|
|
16
|
+
* @property {string} [mainTemplateAccountId] - Filter by source provider (ObjectId)
|
|
17
|
+
* @property {string} [lang] - ISO language code (e.g. en-us)
|
|
18
|
+
* @property {number} [page] - 1-based page for pagination
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Query params for GET /sms-templates/:smsTemplateId (btrz-api-accounts). See get-by-id-handler getSpec().
|
|
23
|
+
* @typedef {Object} SmsTemplateGetByIdQuery
|
|
24
|
+
* @property {string} [providerId] - Filter by provider; template must belong to this account, current, or global (ObjectId)
|
|
25
|
+
* @property {string} [superUserId] - Super user ID for authentication (ObjectId)
|
|
26
|
+
* @property {string} [superUserHash] - Super user hash for authentication
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Query params for PUT /sms-templates/:smsTemplateId/versions/:versionId (btrz-api-accounts). See put-version-handler getSpec().
|
|
31
|
+
* @typedef {Object} SmsTemplateVersionUpdateQuery
|
|
32
|
+
* @property {string} [superUserId] - Super user ID (ObjectId)
|
|
33
|
+
* @property {string} [superUserHash] - Super user hash for authentication
|
|
34
|
+
*/
|
|
35
|
+
|
|
6
36
|
/**
|
|
7
37
|
* Factory for sms-templates API (btrz-api-accounts).
|
|
8
38
|
* @param {Object} deps
|
|
@@ -17,7 +47,8 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
17
47
|
* @param {string} [opts.token] - API key
|
|
18
48
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
19
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
50
|
+
* @returns {Promise<import("axios").AxiosResponse<{ types: string[] }>>}
|
|
51
|
+
* @throws {import("axios").AxiosError} 401, 500
|
|
21
52
|
*/
|
|
22
53
|
function getTypes({token, jwtToken, headers}) {
|
|
23
54
|
return client({
|
|
@@ -27,13 +58,14 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
/**
|
|
30
|
-
* GET /sms-templates - list SMS templates.
|
|
61
|
+
* GET /sms-templates - list SMS templates (paginated when page is provided).
|
|
31
62
|
* @param {Object} opts
|
|
32
63
|
* @param {string} [opts.token] - API key
|
|
33
64
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
34
|
-
* @param {
|
|
65
|
+
* @param {SmsTemplatesListQuery} [opts.query] - Query params (providerId, type, channel, sort, agencyId, etc.)
|
|
35
66
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
67
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplates: object[], next?: string, previous?: string, totalRecords?: number, page?: number }>>}
|
|
68
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA, 401, 500
|
|
37
69
|
*/
|
|
38
70
|
function all({token, jwtToken, query = {}, headers}) {
|
|
39
71
|
return client({
|
|
@@ -49,9 +81,10 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
49
81
|
* @param {string} [opts.token] - API key
|
|
50
82
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
51
83
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
52
|
-
* @param {
|
|
84
|
+
* @param {SmsTemplateGetByIdQuery} [opts.query] - Query params (providerId, superUserId, superUserHash)
|
|
53
85
|
* @param {Object} [opts.headers] - Optional headers
|
|
54
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
86
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
87
|
+
* @throws {import("axios").AxiosError} 400 INVALID_SMS_TEMPLATE_ID / INVALID_PROVIDER_ID, 401, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
55
88
|
*/
|
|
56
89
|
function get({token, jwtToken, smsTemplateId, query = {}, headers}) {
|
|
57
90
|
return client({
|
|
@@ -62,13 +95,14 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
62
95
|
}
|
|
63
96
|
|
|
64
97
|
/**
|
|
65
|
-
* POST /sms-templates - create an SMS template.
|
|
98
|
+
* POST /sms-templates - create an SMS template. Body: smsTemplate (name, type, lang, txtTemplate required).
|
|
66
99
|
* @param {Object} opts
|
|
67
100
|
* @param {string} [opts.token] - API key
|
|
68
101
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
69
|
-
* @param {Object} opts.data - Request body
|
|
102
|
+
* @param {Object} opts.data - Request body (smsTemplate or root with name, type, lang, txtTemplate)
|
|
70
103
|
* @param {Object} [opts.headers] - Optional headers
|
|
71
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
104
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
105
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / TEMPLATE_* / LANG_* / TXT_TEMPLATE_REQUIRED, 401 NOT_SUPER_USER, 500
|
|
72
106
|
*/
|
|
73
107
|
function create({token, jwtToken, data, headers}) {
|
|
74
108
|
return client({
|
|
@@ -80,14 +114,15 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
80
114
|
}
|
|
81
115
|
|
|
82
116
|
/**
|
|
83
|
-
* PUT /sms-templates/:smsTemplateId - update an SMS template.
|
|
117
|
+
* PUT /sms-templates/:smsTemplateId - update an SMS template. Body: smsTemplate (name, type, txtTemplate required; lang read-only).
|
|
84
118
|
* @param {Object} opts
|
|
85
119
|
* @param {string} [opts.token] - API key
|
|
86
120
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
87
121
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
88
|
-
* @param {Object} opts.data - Request body
|
|
122
|
+
* @param {Object} opts.data - Request body (smsTemplate or root)
|
|
89
123
|
* @param {Object} [opts.headers] - Optional headers
|
|
90
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
124
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
125
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / TEMPLATE_* / TXT_TEMPLATE_REQUIRED, 401 NOT_SUPER_USER, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
91
126
|
*/
|
|
92
127
|
function update({token, jwtToken, smsTemplateId, data, headers}) {
|
|
93
128
|
return client({
|
|
@@ -105,7 +140,8 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
105
140
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
106
141
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
107
142
|
* @param {Object} [opts.headers] - Optional headers
|
|
108
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
143
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplateId: string }>>}
|
|
144
|
+
* @throws {import("axios").AxiosError} 400 SMS_TEMPLATE_ID, 401, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
109
145
|
*/
|
|
110
146
|
function remove({token, jwtToken, smsTemplateId, headers}) {
|
|
111
147
|
return client({
|
|
@@ -123,7 +159,8 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
123
159
|
* @param {string} opts.mainTemplateId - Main template id (ObjectId)
|
|
124
160
|
* @param {string} opts.agencyId - Agency id (ObjectId)
|
|
125
161
|
* @param {Object} [opts.headers] - Optional headers
|
|
126
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
162
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
163
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / MAIN_TEMPLATE_IS_NOT_CUSTOM, 401 MAIN_TEMPLATE_ACCOUNT_MISMATCH / MAIN_TEMPLATE_NOT_FROM_PROVIDER, 404 MAIN_TEMPLATE_NOT_FOUND, 500
|
|
127
164
|
*/
|
|
128
165
|
function createSub({token, jwtToken, mainTemplateId, agencyId, headers}) {
|
|
129
166
|
return client({
|
|
@@ -136,15 +173,16 @@ function smsTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
136
173
|
|
|
137
174
|
const versions = {
|
|
138
175
|
/**
|
|
139
|
-
* PUT /sms-templates/:smsTemplateId/versions/:versionId -
|
|
176
|
+
* PUT /sms-templates/:smsTemplateId/versions/:versionId - roll back SMS template to a saved version (versionId = zero-based index).
|
|
140
177
|
* @param {Object} opts
|
|
141
178
|
* @param {string} [opts.token] - API key
|
|
142
179
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
143
180
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
144
|
-
* @param {string} opts.versionId -
|
|
145
|
-
* @param {
|
|
181
|
+
* @param {string} opts.versionId - Zero-based version index (e.g. "0", "1")
|
|
182
|
+
* @param {SmsTemplateVersionUpdateQuery} [opts.query] - Query params (superUserId, superUserHash for default templates)
|
|
146
183
|
* @param {Object} [opts.headers] - Optional headers
|
|
147
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
184
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
185
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA, 401 NOT_SUPER_USER, 404 SMS_TEMPLATE_NOT_FOUND / SMS_TEMPLATE_VERSION_NOT_FOUND, 500
|
|
148
186
|
*/
|
|
149
187
|
update({token, jwtToken, smsTemplateId, versionId, query = {}, headers}) {
|
|
150
188
|
return client({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
const {
|
|
2
3
|
authorizationHeaders
|
|
3
4
|
} = require("./../endpoints_helpers.js");
|
|
@@ -11,13 +12,14 @@ const {
|
|
|
11
12
|
*/
|
|
12
13
|
function subPrintTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
/**
|
|
14
|
-
* POST /sub-print-templates - create a sub print template.
|
|
15
|
+
* POST /sub-print-templates - create a sub print template from a main template (body: agencyId, mainTemplateId).
|
|
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
|
-
* @param {Object} opts.subPrintTemplate -
|
|
19
|
+
* @param {Object} opts.subPrintTemplate - Payload with agencyId and mainTemplateId (both ObjectIds)
|
|
19
20
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
21
|
+
* @returns {Promise<import("axios").AxiosResponse<{ printTemplate: object }>>}
|
|
22
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / MAIN_TEMPLATE_IS_NOT_CUSTOM, 401 MAIN_TEMPLATE_ACCOUNT_MISMATCH / MAIN_TEMPLATE_NOT_FROM_PROVIDER, 404 MAIN_TEMPLATE_NOT_FOUND, 500
|
|
21
23
|
*/
|
|
22
24
|
function create({jwtToken, token, subPrintTemplate, headers}) {
|
|
23
25
|
return client({
|
|
@@ -11,12 +11,13 @@ const {
|
|
|
11
11
|
*/
|
|
12
12
|
function ticketMovementSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
13
|
/**
|
|
14
|
-
* GET /ticket-movement-settings - get ticket movement settings.
|
|
14
|
+
* GET /ticket-movement-settings - get ticket movement settings for the account.
|
|
15
|
+
* No query or path parameters. See get-handler getSpec() in btrz-api-accounts for response schema.
|
|
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<Object>>} Response body: ticket movement settings object. Errors: 401, 500
|
|
20
21
|
*/
|
|
21
22
|
function get({token, jwtToken, headers}) {
|
|
22
23
|
return client({
|
|
@@ -26,13 +27,15 @@ function ticketMovementSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* PUT /ticket-movement-settings - update ticket movement settings.
|
|
30
|
+
* PUT /ticket-movement-settings - update ticket movement settings for the account.
|
|
31
|
+
* Body must include all required fields (see put-handler getSpec() in btrz-api-accounts).
|
|
32
|
+
* Side effect: persists to account.preferences.ticketMovements.
|
|
30
33
|
* @param {Object} opts
|
|
31
34
|
* @param {string} [opts.token] - API key
|
|
32
35
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
33
|
-
* @param {Object} opts.ticketMovementSettings -
|
|
36
|
+
* @param {Object} opts.ticketMovementSettings - Full settings payload (see put-handler getSpec())
|
|
34
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
35
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<Object>>} Updated settings. Errors: 400, 401, 500
|
|
36
39
|
*/
|
|
37
40
|
function update({token, jwtToken, ticketMovementSettings, headers}) {
|
|
38
41
|
return client({
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Query params for GET /tokens (btrz-api-accounts). See get-tokens handler getSpec().
|
|
5
|
+
* @typedef {Object} TokensGetQuery
|
|
6
|
+
* @property {string} token - Token ID (required)
|
|
7
|
+
* @property {string} type - Token type (required; see API Token.getTypes())
|
|
8
|
+
*/
|
|
9
|
+
|
|
3
10
|
/**
|
|
4
11
|
* Factory for tokens (applications) API (btrz-api-accounts).
|
|
5
12
|
* @param {Object} deps
|
|
@@ -9,11 +16,11 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
9
16
|
*/
|
|
10
17
|
function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
11
18
|
/**
|
|
12
|
-
* GET /tokens - get
|
|
19
|
+
* GET /tokens - get a token by ID and type.
|
|
13
20
|
* @param {Object} opts
|
|
14
21
|
* @param {string} [opts.token] - API key
|
|
15
22
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
16
|
-
* @param {
|
|
23
|
+
* @param {TokensGetQuery} [opts.query] - Query params: token (id), type (required)
|
|
17
24
|
* @param {Object} [opts.headers] - Optional headers
|
|
18
25
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
19
26
|
*/
|
|
@@ -25,7 +32,7 @@ function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
/**
|
|
28
|
-
* POST /tokens - create a token (application).
|
|
35
|
+
* POST /tokens - create a token (application). API does not accept query params.
|
|
29
36
|
* @param {Object} opts
|
|
30
37
|
* @param {string} [opts.token] - API key
|
|
31
38
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
*/
|
|
12
12
|
function transportRegulationSettingsForCNRT({client, internalAuthTokenProvider}) {
|
|
13
13
|
/**
|
|
14
|
-
* GET /transport-regulation-settings/cnrt - get CNRT transport regulation settings.
|
|
14
|
+
* GET /transport-regulation-settings/cnrt - get CNRT transport regulation settings. API does not accept query params.
|
|
15
15
|
* @param {Object} opts
|
|
16
16
|
* @param {string} [opts.token] - API key
|
|
17
17
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -26,7 +26,7 @@ function transportRegulationSettingsForCNRT({client, internalAuthTokenProvider})
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* PUT /transport-regulation-settings/cnrt - update CNRT transport regulation settings.
|
|
29
|
+
* PUT /transport-regulation-settings/cnrt - update CNRT transport regulation settings. API does not accept query params.
|
|
30
30
|
* @param {Object} opts
|
|
31
31
|
* @param {string} [opts.token] - API key
|
|
32
32
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Query params for GET /travellers (btrz-api-accounts). See get-handler getSpec().
|
|
5
|
+
* @typedef {Object} TravellersListQuery
|
|
6
|
+
* @property {string} [customerId] - Filter by customer (ObjectId)
|
|
7
|
+
* @property {number} [page] - Page number (1-based); if omitted results are not paginated
|
|
8
|
+
* @property {string} [providerIds] - Provider ids for traveller card types
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Query for PUT/DELETE/POST travellers (btrz-api-accounts). See put/delete/post handlers getSpec().
|
|
13
|
+
* @typedef {Object} TravellerProviderIdsQuery
|
|
14
|
+
* @property {string} [providerIds] - Provider ids to seek for customer, cards and fares
|
|
15
|
+
*/
|
|
16
|
+
|
|
3
17
|
/**
|
|
4
18
|
* Factory for travellers API (btrz-api-accounts).
|
|
5
19
|
* @param {Object} deps
|
|
@@ -9,13 +23,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
9
23
|
*/
|
|
10
24
|
function travellersFactory({client, internalAuthTokenProvider}) {
|
|
11
25
|
/**
|
|
12
|
-
* GET /travellers - list travellers.
|
|
26
|
+
* GET /travellers - list travellers for the account. See get-handler getSpec() in btrz-api-accounts.
|
|
13
27
|
* @param {Object} opts
|
|
14
28
|
* @param {string} [opts.token] - API key
|
|
15
29
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
16
|
-
* @param {
|
|
30
|
+
* @param {TravellersListQuery} [opts.query] - Query params (customerId, page, providerIds)
|
|
17
31
|
* @param {Object} [opts.headers] - Optional headers
|
|
18
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
32
|
+
* @returns {Promise<import("axios").AxiosResponse<{ travellers: Array, page?: number, count?: number }>>}
|
|
33
|
+
* Errors: 401, 404 (CUSTOMER_NOT_FOUND), 500
|
|
19
34
|
*/
|
|
20
35
|
function all({token, jwtToken, query, headers}) {
|
|
21
36
|
return client({
|
|
@@ -26,14 +41,15 @@ function travellersFactory({client, internalAuthTokenProvider}) {
|
|
|
26
41
|
}
|
|
27
42
|
|
|
28
43
|
/**
|
|
29
|
-
* GET /travellers/:id - get a traveller.
|
|
44
|
+
* GET /travellers/:id - get a traveller by id. See get-by-id-handler getSpec() in btrz-api-accounts.
|
|
30
45
|
* @param {Object} opts
|
|
31
46
|
* @param {string} [opts.token] - API key
|
|
32
47
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
33
48
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
34
|
-
* @param {Object} [opts.query] -
|
|
49
|
+
* @param {Object} [opts.query] - Optional query params
|
|
35
50
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
51
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
52
|
+
* Errors: 400, 401, 404 (TRAVELLER_NOT_FOUND), 500
|
|
37
53
|
*/
|
|
38
54
|
function get({token, jwtToken, id, query = {}, headers}) {
|
|
39
55
|
return client({
|
|
@@ -45,15 +61,16 @@ function travellersFactory({client, internalAuthTokenProvider}) {
|
|
|
45
61
|
}
|
|
46
62
|
|
|
47
63
|
/**
|
|
48
|
-
* PUT /travellers/:id - update a traveller.
|
|
64
|
+
* PUT /travellers/:id - update a traveller. See put-handler getSpec() in btrz-api-accounts.
|
|
49
65
|
* @param {Object} opts
|
|
50
66
|
* @param {string} [opts.token] - API key
|
|
51
67
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
52
68
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
53
|
-
* @param {Object} opts.data - Traveller payload
|
|
54
|
-
* @param {
|
|
69
|
+
* @param {Object} opts.data - Traveller payload (TravellerPutData)
|
|
70
|
+
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
55
71
|
* @param {Object} [opts.headers] - Optional headers
|
|
56
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
72
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
73
|
+
* Errors: 400, 401, 404, 409, 500
|
|
57
74
|
*/
|
|
58
75
|
function update({token, jwtToken, id, data, query = {}, headers}) {
|
|
59
76
|
return client({
|
|
@@ -66,14 +83,15 @@ function travellersFactory({client, internalAuthTokenProvider}) {
|
|
|
66
83
|
}
|
|
67
84
|
|
|
68
85
|
/**
|
|
69
|
-
* DELETE /travellers/:id - remove a traveller.
|
|
86
|
+
* DELETE /travellers/:id - remove a traveller. Returns 204 No Content. See delete-handler getSpec().
|
|
70
87
|
* @param {Object} opts
|
|
71
88
|
* @param {string} [opts.token] - API key
|
|
72
89
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
90
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
74
|
-
* @param {
|
|
91
|
+
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
75
92
|
* @param {Object} [opts.headers] - Optional headers
|
|
76
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
93
|
+
* @returns {Promise<import("axios").AxiosResponse<void>>}
|
|
94
|
+
* Errors: 400, 401, 404 (TRAVELLER_NOT_FOUND), 500
|
|
77
95
|
*/
|
|
78
96
|
function remove({token, jwtToken, id, query = {}, headers}) {
|
|
79
97
|
return client({
|
|
@@ -85,14 +103,15 @@ function travellersFactory({client, internalAuthTokenProvider}) {
|
|
|
85
103
|
}
|
|
86
104
|
|
|
87
105
|
/**
|
|
88
|
-
* POST /travellers - create a traveller.
|
|
106
|
+
* POST /travellers - create a traveller. Returns 201. See post-handler getSpec() in btrz-api-accounts.
|
|
89
107
|
* @param {Object} opts
|
|
90
108
|
* @param {string} [opts.token] - API key
|
|
91
109
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
92
|
-
* @param {Object}
|
|
93
|
-
* @param {
|
|
110
|
+
* @param {Object} opts.data - Traveller payload (TravellerPostData: customerId, fareId, cards, etc.)
|
|
111
|
+
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
94
112
|
* @param {Object} [opts.headers] - Optional headers
|
|
95
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
113
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
114
|
+
* Errors: 400, 401, 404, 409, 500
|
|
96
115
|
*/
|
|
97
116
|
function create({token, jwtToken, query = {}, data, headers}) {
|
|
98
117
|
return client({
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Query params for GET /trusted-machines (btrz-api-accounts). See get-handler getSpec().
|
|
5
|
+
* @typedef {Object} TrustedMachinesListQuery
|
|
6
|
+
* @property {string} [userId] - Filter by user id (ObjectId)
|
|
7
|
+
* @property {number} [page] - Page to return
|
|
8
|
+
* @property {number} [recordsPerPage] - Records per page (max 100)
|
|
9
|
+
*/
|
|
10
|
+
|
|
3
11
|
/**
|
|
4
12
|
* Factory for trusted-machines API (btrz-api-accounts).
|
|
5
13
|
* @param {Object} deps
|
|
@@ -9,13 +17,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
9
17
|
*/
|
|
10
18
|
function trustedMachinesFactory({client, internalAuthTokenProvider}) {
|
|
11
19
|
/**
|
|
12
|
-
* POST /trusted-machines -
|
|
20
|
+
* POST /trusted-machines - trust the machine (hideInDocumentation: true in API). Sets cookie via Set-Cookie.
|
|
13
21
|
* @param {Object} opts
|
|
14
22
|
* @param {string} [opts.token] - API key
|
|
15
23
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
16
|
-
* @param {Object} opts.data -
|
|
24
|
+
* @param {Object} opts.data - Body (NewTrustedMachine: expirationDays, browserFingerprint, etc.)
|
|
17
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
18
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<{ result: string, trustedMachine: Object }>>}
|
|
27
|
+
* Errors: 400, 401, 409, 500
|
|
19
28
|
*/
|
|
20
29
|
function create({token, jwtToken, data, headers}) {
|
|
21
30
|
return client({
|
|
@@ -28,13 +37,14 @@ function trustedMachinesFactory({client, internalAuthTokenProvider}) {
|
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
/**
|
|
31
|
-
* GET /trusted-machines/:id - get a trusted machine.
|
|
40
|
+
* GET /trusted-machines/:id - get a trusted machine by id. See get-by-id-handler getSpec() in btrz-api-accounts.
|
|
32
41
|
* @param {Object} opts
|
|
33
42
|
* @param {string} [opts.token] - API key
|
|
34
43
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
35
44
|
* @param {string} opts.id - Trusted machine id (ObjectId)
|
|
36
45
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
46
|
+
* @returns {Promise<import("axios").AxiosResponse<{ trustedmachine: Object }>>}
|
|
47
|
+
* Errors: 400, 401, 404 (TRUSTED_MACHINE_NOT_FOUND), 500
|
|
38
48
|
*/
|
|
39
49
|
function get({token, jwtToken, id, headers}) {
|
|
40
50
|
return client({
|
|
@@ -45,13 +55,14 @@ function trustedMachinesFactory({client, internalAuthTokenProvider}) {
|
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
/**
|
|
48
|
-
* GET /trusted-machines - list trusted machines.
|
|
58
|
+
* GET /trusted-machines - list enabled trusted machines for the account. See get-handler getSpec().
|
|
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
|
-
* @param {
|
|
62
|
+
* @param {TrustedMachinesListQuery} [opts.query] - Query params (userId, page, recordsPerPage max 100)
|
|
53
63
|
* @param {Object} [opts.headers] - Optional headers
|
|
54
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
64
|
+
* @returns {Promise<import("axios").AxiosResponse<{ trustedmachines: Array }>>}
|
|
65
|
+
* Paginated. Errors: 401, 500
|
|
55
66
|
*/
|
|
56
67
|
function all({token, jwtToken, query = {}, headers}) {
|
|
57
68
|
return client({
|
|
@@ -11,13 +11,14 @@ const {
|
|
|
11
11
|
*/
|
|
12
12
|
function twilioSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
13
|
/**
|
|
14
|
-
* GET /twilio-settings - get Twilio settings.
|
|
14
|
+
* GET /twilio-settings - get Twilio settings for the account. See get-handler getSpec() in btrz-api-accounts.
|
|
15
15
|
* @param {Object} opts
|
|
16
16
|
* @param {string} [opts.token] - API key
|
|
17
17
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
18
|
-
* @param {Object} [opts.query] -
|
|
18
|
+
* @param {Object} [opts.query] - Optional query params
|
|
19
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ twilioSettings: Object }>>}
|
|
21
|
+
* Errors: 401, 404 (TWILIO_SETTINGS_NOT_FOUND), 500
|
|
21
22
|
*/
|
|
22
23
|
function get({jwtToken, token, query, headers}) {
|
|
23
24
|
return client({
|
|
@@ -28,13 +29,14 @@ function twilioSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* PUT /twilio-settings - update Twilio settings.
|
|
32
|
+
* PUT /twilio-settings - update Twilio settings. See put-handler getSpec() in btrz-api-accounts.
|
|
32
33
|
* @param {Object} opts
|
|
33
34
|
* @param {string} [opts.token] - API key
|
|
34
35
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
35
|
-
* @param {Object} opts.twilioSettings - Settings payload
|
|
36
|
+
* @param {Object} opts.twilioSettings - Settings payload (TwilioSettingsPayload: enabled, sendingNumber, etc.)
|
|
36
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<{ twilioSettings: Object }>>}
|
|
39
|
+
* Errors: 401, 404, 409, 500
|
|
38
40
|
*/
|
|
39
41
|
function update({jwtToken, token, twilioSettings, headers}) {
|
|
40
42
|
return client({
|