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,7 +1,8 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Factory for applications
|
|
5
|
+
* Factory for applications API (btrz-api-accounts): get by id or by name. Requires BETTEREZ_APP or MOBILE_SCANNER (get by id); get by name requires authentication.
|
|
5
6
|
* @param {Object} deps
|
|
6
7
|
* @param {import("axios").AxiosInstance} deps.client
|
|
7
8
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -9,13 +10,13 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
9
10
|
*/
|
|
10
11
|
function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
11
12
|
/**
|
|
12
|
-
* GET /applications/:id - get an application by id.
|
|
13
|
+
* GET /applications/:id - get an application by id. Application must belong to the authenticated account.
|
|
13
14
|
* @param {Object} opts
|
|
14
15
|
* @param {string} [opts.token] - API key
|
|
15
16
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
16
|
-
* @param {string} opts.id - Application id (ObjectId)
|
|
17
|
+
* @param {string} opts.id - Application id (24-char hex ObjectId)
|
|
17
18
|
* @param {Object} [opts.headers] - Optional headers
|
|
18
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
19
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application } (full application document including privateKey)
|
|
19
20
|
*/
|
|
20
21
|
function get({token, id, jwtToken, headers}) {
|
|
21
22
|
return client.get(`/applications/${id}`, {
|
|
@@ -23,13 +24,13 @@ function applicationsFactory({client, internalAuthTokenProvider}) {
|
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* GET /applications/name/:appName - get an application by name.
|
|
27
|
+
* GET /applications/name/:appName - get an application by name. Returns non-internal, non-deleted application for the account; response excludes privateKey.
|
|
27
28
|
* @param {Object} opts
|
|
28
29
|
* @param {string} [opts.token] - API key
|
|
29
30
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
30
|
-
* @param {string} opts.appName - Application name
|
|
31
|
+
* @param {string} opts.appName - Application name (exact match)
|
|
31
32
|
* @param {Object} [opts.headers] - Optional headers
|
|
32
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
33
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application } (application document without privateKey)
|
|
33
34
|
*/
|
|
34
35
|
function getByName({token, appName, jwtToken, headers}) {
|
|
35
36
|
return client.get(`/applications/name/${appName}`, {
|
|
@@ -2,6 +2,11 @@ const {
|
|
|
2
2
|
authorizationHeaders
|
|
3
3
|
} = require("./../endpoints_helpers.js");
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {Object} CurrentShiftsQuery
|
|
7
|
+
* @property {string} [includeActivity] - Set to 'false' to avoid returning sales activity data for the shift (default 'true')
|
|
8
|
+
*/
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* Factory for current-shift (per user) API (btrz-api-accounts).
|
|
7
12
|
* @param {Object} deps
|
|
@@ -15,7 +20,7 @@ function currentShiftsFactory({client, internalAuthTokenProvider}) {
|
|
|
15
20
|
* @param {Object} opts
|
|
16
21
|
* @param {string} [opts.token] - API key
|
|
17
22
|
* @param {string} opts.userId - User id (ObjectId)
|
|
18
|
-
* @param {
|
|
23
|
+
* @param {CurrentShiftsQuery} [opts.query] - Query params
|
|
19
24
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
25
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
21
26
|
*/
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
const base64 = require("base-64");
|
|
2
3
|
const {
|
|
3
4
|
authorizationHeaders
|
|
4
5
|
} = require("./../endpoints_helpers.js");
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Query params for GET /customers (btrz-api-accounts). Response is paginated (customers array + pagination).
|
|
9
|
+
* @typedef {Object} CustomersQuery
|
|
10
|
+
* @property {string} [customerNumber] - Filter: only that customer will be listed
|
|
11
|
+
* @property {string} [externalId] - Filter: same format as when creating the customer; only that customer listed
|
|
12
|
+
* @property {string} [providerIds] - Filter: provider ids to get customers from (comma-separated)
|
|
13
|
+
* @property {string} [lookupSearchParams] - Lookup search in format "documentTypeId|DNI,documentNumber|1234567" (documentNumber required)
|
|
14
|
+
*/
|
|
15
|
+
|
|
6
16
|
/**
|
|
7
17
|
* Factory for customers API (btrz-api-accounts).
|
|
8
18
|
* @param {Object} deps
|
|
@@ -12,14 +22,14 @@ const {
|
|
|
12
22
|
*/
|
|
13
23
|
function customersFactory({client, internalAuthTokenProvider}) {
|
|
14
24
|
/**
|
|
15
|
-
* PUT /customers/:customerId - update a customer (full replace).
|
|
25
|
+
* PUT /customers/:customerId - update a customer (full replace). Requires BETTEREZ_APP or CUSTOMER audience; customer token may only update own record. Side effect: may emit customer.updated webhook.
|
|
16
26
|
* @param {Object} opts
|
|
17
27
|
* @param {string} [opts.token] - API key
|
|
18
28
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
19
|
-
* @param {string} opts.customerId - Customer id (ObjectId)
|
|
20
|
-
* @param {Object} opts.customer - Customer payload
|
|
29
|
+
* @param {string} opts.customerId - Customer id (24-char hex ObjectId)
|
|
30
|
+
* @param {Object} opts.customer - Customer payload (CustomerData)
|
|
21
31
|
* @param {Object} [opts.headers] - Optional headers
|
|
22
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
32
|
+
* @returns {Promise<import("axios").AxiosResponse<{ _id: string, customerNumber: string, ... }>>}
|
|
23
33
|
*/
|
|
24
34
|
function put({customerId, customer, token, jwtToken, headers}) {
|
|
25
35
|
return client({
|
|
@@ -31,14 +41,14 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
/**
|
|
34
|
-
* GET /customers - list customers.
|
|
44
|
+
* GET /customers - list customers (paginated). Optional filters: customerNumber, externalId, providerIds, lookupSearchParams.
|
|
35
45
|
* @param {Object} opts
|
|
36
46
|
* @param {string} [opts.token] - API key
|
|
37
47
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {string} [opts.providerId] -
|
|
48
|
+
* @param {CustomersQuery} [opts.query] - Query params; API expects providerIds (comma-separated). Use providerId to send a single id.
|
|
49
|
+
* @param {string} [opts.providerId] - Convenience: added to query as providerId (single provider)
|
|
40
50
|
* @param {Object} [opts.headers] - Optional headers
|
|
41
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
51
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customers: Array<object>, total: number, ... }>>}
|
|
42
52
|
*/
|
|
43
53
|
function all({token, jwtToken, query = {}, headers, providerId}) {
|
|
44
54
|
const query_ = providerId ? {...query, providerId} : query;
|
|
@@ -50,14 +60,14 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
/**
|
|
53
|
-
* POST /customer - create a customer.
|
|
63
|
+
* POST /customer - create a customer. Body: { customer }. If password is included, activation token is created and activation email sent. Side effect: may emit customer.created webhook.
|
|
54
64
|
* @param {Object} opts
|
|
55
65
|
* @param {string} [opts.token] - API key
|
|
56
66
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
57
|
-
* @param {Object} opts.customer - Customer payload
|
|
58
|
-
* @param {Object} [opts.query] -
|
|
67
|
+
* @param {Object} opts.customer - Customer payload (CustomerPost); email, firstName, lastName required
|
|
68
|
+
* @param {Object} [opts.query] - Optional: uniqueEmail, lang, channel, platform, appVersion, appName, activateIfExists
|
|
59
69
|
* @param {Object} [opts.headers] - Optional headers
|
|
60
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
70
|
+
* @returns {Promise<import("axios").AxiosResponse<{ _id: string, customerNumber: string, ... }>>}
|
|
61
71
|
*/
|
|
62
72
|
function create({customer, token, jwtToken, query, headers}) {
|
|
63
73
|
return client({
|
|
@@ -117,15 +127,15 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
/**
|
|
120
|
-
* PATCH /customers/:customerId -
|
|
130
|
+
* PATCH /customers/:customerId - apply operations (activate, reset password, activateEmailAndPwd). Body: { operations } array of PatchCustomerOperation. Returns Customer and auth tokens. Side effect: may emit customer.updated webhook.
|
|
121
131
|
* @param {Object} opts
|
|
122
132
|
* @param {string} [opts.token] - API key
|
|
123
133
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
124
|
-
* @param {string} opts.customerId - Customer id (ObjectId)
|
|
125
|
-
* @param {Object} opts.data -
|
|
126
|
-
* @param {Object} [opts.query] -
|
|
134
|
+
* @param {string} opts.customerId - Customer id (24-char hex ObjectId)
|
|
135
|
+
* @param {Object} opts.data - Body: { operations } or array of { op, path, value }
|
|
136
|
+
* @param {Object} [opts.query] - Optional query
|
|
127
137
|
* @param {Object} [opts.headers] - Optional headers
|
|
128
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
138
|
+
* @returns {Promise<import("axios").AxiosResponse<CustomerWithAuthToken>>}
|
|
129
139
|
*/
|
|
130
140
|
function update({customerId, token, jwtToken, data, query, headers}) {
|
|
131
141
|
return client({
|
|
@@ -138,13 +148,13 @@ function customersFactory({client, internalAuthTokenProvider}) {
|
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
/**
|
|
141
|
-
* POST /customers/merge - merge source customers into destination.
|
|
151
|
+
* POST /customers/merge - merge source customers into destination. Requires BETTEREZ_APP. Side effect: emits customers.merged webhook.
|
|
142
152
|
* @param {Object} opts
|
|
143
153
|
* @param {string} [opts.token] - API key
|
|
144
154
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
145
|
-
* @param {string} opts.destinationCustomerId - Destination customer id (ObjectId)
|
|
146
|
-
* @param {Array<string>} opts.sourceCustomerIds - Source customer ids (ObjectIds)
|
|
147
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
155
|
+
* @param {string} opts.destinationCustomerId - Destination customer id (24-char hex ObjectId)
|
|
156
|
+
* @param {Array<string>} opts.sourceCustomerIds - Source customer ids (24-char hex ObjectIds)
|
|
157
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customerMerge: object }>>}
|
|
148
158
|
*/
|
|
149
159
|
function merge({destinationCustomerId, sourceCustomerIds, jwtToken, token}) {
|
|
150
160
|
return client({
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Factory for domains API (btrz-api-accounts).
|
|
7
|
+
* Endpoints manage subdomains for the account: list, create (with DNS and websales config), and delete.
|
|
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 domainsFactory({client, internalAuthTokenProvider}) {
|
|
13
14
|
/**
|
|
14
|
-
* GET /domains
|
|
15
|
+
* GET /domains – List all domain names for the current account.
|
|
16
|
+
* Response body is an array of strings (primary domain first, then secondary domains). No query parameters.
|
|
15
17
|
* @param {Object} opts
|
|
16
|
-
* @param {string} [opts.token] - API key
|
|
17
|
-
* @param {Object} [opts.query] - Query params
|
|
18
|
+
* @param {string} [opts.token] - API key (X-API-KEY)
|
|
18
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<string[]>>} response.data is string[]
|
|
20
21
|
*/
|
|
21
22
|
function all({token, query = {}, headers}) {
|
|
22
23
|
return client({
|
|
@@ -27,13 +28,14 @@ function domainsFactory({client, internalAuthTokenProvider}) {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
|
-
* POST /domains
|
|
31
|
+
* POST /domains – Create a new subdomain for the account.
|
|
32
|
+
* Adds DNS CNAME and default websales config. Requires BETTEREZ_APP JWT. Emits domains.created (and websalesConfig.created) webhooks.
|
|
31
33
|
* @param {Object} opts
|
|
32
34
|
* @param {string} [opts.token] - API key
|
|
33
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
34
|
-
* @param {Object} opts.data -
|
|
35
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
36
|
+
* @param {Object} opts.data - Body: { domain } or { domainInfo: { domain } }. domain must match pattern (no dots, no underscores).
|
|
35
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<{ domain: string }>>} response.data is AddedDomainResponse
|
|
37
39
|
*/
|
|
38
40
|
function create({data, token, jwtToken, headers}) {
|
|
39
41
|
return client({
|
|
@@ -45,13 +47,15 @@ function domainsFactory({client, internalAuthTokenProvider}) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
* DELETE /domains/:domain
|
|
50
|
+
* DELETE /domains/:domain – Remove a subdomain from the account.
|
|
51
|
+
* Removes DNS entry, websales config, and domain from payment methods and inventory products.
|
|
52
|
+
* Primary domain cannot be deleted. Emits domains.deleted and websalesConfig.deleted.
|
|
49
53
|
* @param {Object} opts
|
|
50
54
|
* @param {string} [opts.token] - API key
|
|
51
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
52
|
-
* @param {string} opts.domain - Domain name
|
|
55
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
56
|
+
* @param {string} opts.domain - Domain name (path parameter)
|
|
53
57
|
* @param {Object} [opts.headers] - Optional headers
|
|
54
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
58
|
+
* @returns {Promise<import("axios").AxiosResponse<{ domain: string }>>} response.data is DeletedDomainResponse
|
|
55
59
|
*/
|
|
56
60
|
function remove({domain, token, jwtToken, headers}) {
|
|
57
61
|
return client({
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
const {authorizationHeaders} = require("../endpoints_helpers.js");
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Query params for GET /dynamic-forms (btrz-api-accounts). See get-handler getSpec().
|
|
6
|
+
* @typedef {Object} DynamicFormsQuery
|
|
7
|
+
* @property {string} [dynamicFormFieldId] - Get all dynamic forms for the given field id (ObjectId)
|
|
8
|
+
* @property {string} [providerId] - Get all dynamic forms for the given provider id (ObjectId)
|
|
9
|
+
* @property {string} [type] - Filter by type: "reservation" | "parcel" | "checkin" | "paid_in" | "pay_on_account"
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Query params for GET /dynamic-forms/:dynamicFormId (btrz-api-accounts). See get-by-id-handler getSpec().
|
|
14
|
+
* @typedef {Object} DynamicFormByIdQuery
|
|
15
|
+
* @property {string} [providerId] - Fetch the dynamic form for the given providerId (ObjectId)
|
|
16
|
+
*/
|
|
17
|
+
|
|
4
18
|
/**
|
|
5
19
|
* Factory for dynamic-forms API (btrz-api-accounts).
|
|
6
20
|
* @param {Object} deps
|
|
@@ -15,8 +29,8 @@ function dynamicFormsFactory({client, internalAuthTokenProvider}) {
|
|
|
15
29
|
* @param {string} [opts.token] - API key
|
|
16
30
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
17
31
|
* @param {string} opts.dynamicFormId - Dynamic form id (ObjectId)
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {string} [opts.providerId] - Provider id (
|
|
32
|
+
* @param {DynamicFormByIdQuery} [opts.query] - Query params (providerId)
|
|
33
|
+
* @param {string} [opts.providerId] - Provider id; if set, added to query (convenience)
|
|
20
34
|
* @param {Object} [opts.headers] - Optional headers
|
|
21
35
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
22
36
|
*/
|
|
@@ -34,7 +48,7 @@ function dynamicFormsFactory({client, internalAuthTokenProvider}) {
|
|
|
34
48
|
* @param {Object} opts
|
|
35
49
|
* @param {string} [opts.token] - API key
|
|
36
50
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
37
|
-
* @param {
|
|
51
|
+
* @param {DynamicFormsQuery} [opts.query] - Query params (dynamicFormFieldId, providerId, type)
|
|
38
52
|
* @param {Object} [opts.headers] - Optional headers
|
|
39
53
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
40
54
|
*/
|
|
@@ -51,7 +65,6 @@ function dynamicFormsFactory({client, internalAuthTokenProvider}) {
|
|
|
51
65
|
* @param {Object} opts
|
|
52
66
|
* @param {string} [opts.token] - API key
|
|
53
67
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
54
|
-
* @param {Object} [opts.query] - Query params
|
|
55
68
|
* @param {Object} opts.data - Form payload
|
|
56
69
|
* @param {Object} [opts.headers] - Optional headers
|
|
57
70
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
@@ -123,7 +136,6 @@ function dynamicFormsFactory({client, internalAuthTokenProvider}) {
|
|
|
123
136
|
* @param {Object} opts
|
|
124
137
|
* @param {string} [opts.token] - API key
|
|
125
138
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
126
|
-
* @param {Object} [opts.query] - Query params
|
|
127
139
|
* @param {Object} [opts.headers] - Optional headers
|
|
128
140
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
129
141
|
*/
|
|
@@ -3,6 +3,7 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Factory for email-settings API (btrz-api-accounts).
|
|
6
|
+
* Manage account email settings (identity/verified senders). Path parameter is email address.
|
|
6
7
|
* @param {Object} deps
|
|
7
8
|
* @param {import("axios").AxiosInstance} deps.client
|
|
8
9
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -10,13 +11,13 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
10
11
|
*/
|
|
11
12
|
function emailSettingsFactory({client, internalAuthTokenProvider}) {
|
|
12
13
|
/**
|
|
13
|
-
* GET /email-settings
|
|
14
|
+
* GET /email-settings – List all email settings for the account.
|
|
15
|
+
* Response may trigger AWS verification and commIdentity updates. No query params.
|
|
14
16
|
* @param {Object} opts
|
|
15
17
|
* @param {string} [opts.token] - API key
|
|
16
18
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
17
|
-
* @param {Object} [opts.query] - Query params
|
|
18
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSettings: object[] }>>}
|
|
20
21
|
*/
|
|
21
22
|
function all({token, jwtToken, query = {}, headers}) {
|
|
22
23
|
return client({
|
|
@@ -26,14 +27,13 @@ function emailSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
|
-
* GET /email-settings/:email
|
|
30
|
+
* GET /email-settings/:email – Get one email setting by email address (path param).
|
|
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 {string} opts.email - Email address
|
|
34
|
-
* @param {Object} [opts.query] - Query params
|
|
34
|
+
* @param {string} opts.email - Email address (path parameter; must match email pattern)
|
|
35
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
36
|
+
* @returns {Promise<import("axios").AxiosResponse<object>>} response.data is EmailSetting
|
|
37
37
|
*/
|
|
38
38
|
function getByEmail({token, jwtToken, email, query = {}, headers}) {
|
|
39
39
|
return client({
|
|
@@ -44,13 +44,14 @@ function emailSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* POST /email-settings
|
|
47
|
+
* POST /email-settings – Create an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.created.
|
|
48
|
+
* Body: { emailSetting } or { name, email, active }. Email and domain are verified in AWS.
|
|
48
49
|
* @param {Object} opts
|
|
49
50
|
* @param {string} [opts.token] - API key
|
|
50
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
51
|
-
* @param {Object} opts.data -
|
|
51
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
52
|
+
* @param {Object} opts.data - Body: { name, email, active? } or { emailSetting: { name, email, active? } }
|
|
52
53
|
* @param {Object} [opts.headers] - Optional headers
|
|
53
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
54
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
54
55
|
*/
|
|
55
56
|
function create({data, token, jwtToken, headers}) {
|
|
56
57
|
return client({
|
|
@@ -62,14 +63,14 @@ function emailSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
|
-
* PUT /email-settings/:email
|
|
66
|
+
* PUT /email-settings/:email – Update an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.updated.
|
|
66
67
|
* @param {Object} opts
|
|
67
68
|
* @param {string} [opts.token] - API key
|
|
68
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
69
|
-
* @param {string} opts.email - Email address
|
|
70
|
-
* @param {Object} opts.data -
|
|
69
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
70
|
+
* @param {string} opts.email - Email address (path parameter)
|
|
71
|
+
* @param {Object} opts.data - Body: { name, email, active?, ... } or { emailSetting: { ... } }
|
|
71
72
|
* @param {Object} [opts.headers] - Optional headers
|
|
72
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
73
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
73
74
|
*/
|
|
74
75
|
function update({token, jwtToken, email, data, headers}) {
|
|
75
76
|
return client({
|
|
@@ -81,13 +82,14 @@ function emailSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
|
-
* DELETE /email-settings/:email
|
|
85
|
+
* DELETE /email-settings/:email – Remove an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.deleted.
|
|
86
|
+
* Fails with 400 if the email is currently active.
|
|
85
87
|
* @param {Object} opts
|
|
86
88
|
* @param {string} [opts.token] - API key
|
|
87
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
88
|
-
* @param {string} opts.email - Email address
|
|
89
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
90
|
+
* @param {string} opts.email - Email address (path parameter)
|
|
89
91
|
* @param {Object} [opts.headers] - Optional headers
|
|
90
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
92
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
91
93
|
*/
|
|
92
94
|
function remove({email, token, jwtToken, headers}) {
|
|
93
95
|
return client({
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
} = require("../endpoints_helpers.js");
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Query params for GET /email-templates (btrz-api-accounts). See get-handler getSpec().
|
|
7
8
|
* @typedef {Object} EmailTemplatesListQuery
|
|
8
9
|
* @property {string} [providerId] - Filter by provider account (ObjectId)
|
|
9
10
|
* @property {string} [type] - Filter by template type
|
|
@@ -11,11 +12,20 @@ const {
|
|
|
11
12
|
* @property {string} [sort] - relevance | natural | createdAsc | createdDesc | updatedAsc | updatedDesc
|
|
12
13
|
* @property {string} [templateCollectionId] - default | custom
|
|
13
14
|
* @property {string} [status] - draft | published
|
|
15
|
+
* @property {string} [agencyId] - Filter sub-templates for this agency (ObjectId)
|
|
14
16
|
* @property {string} [mainTemplateAccountId] - Filter by source provider (ObjectId)
|
|
15
17
|
* @property {string} [lang] - ISO language code (e.g. en-us)
|
|
16
18
|
* @property {number} [page] - 1-based page for pagination
|
|
17
19
|
*/
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Query params for GET /email-templates/:emailTemplateId (btrz-api-accounts). See get-by-id-handler getSpec().
|
|
23
|
+
* @typedef {Object} EmailTemplateGetByIdQuery
|
|
24
|
+
* @property {string} [providerId] - Filter by provider; template must belong to this account, current account, or be global (ObjectId)
|
|
25
|
+
* @property {string} [superUserId] - Super user ID for authentication (ObjectId)
|
|
26
|
+
* @property {string} [superUserHash] - Super user hash for authentication
|
|
27
|
+
*/
|
|
28
|
+
|
|
19
29
|
/**
|
|
20
30
|
* @typedef {Object} EmailTemplatePostData
|
|
21
31
|
* @property {string} name - Template name
|
|
@@ -76,7 +86,7 @@ function emailTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
76
86
|
* @param {string} [opts.token] - API key
|
|
77
87
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
78
88
|
* @param {string} opts.emailTemplateId - Template id (ObjectId)
|
|
79
|
-
* @param {
|
|
89
|
+
* @param {EmailTemplateGetByIdQuery} [opts.query] - Query params (providerId, superUserId, superUserHash)
|
|
80
90
|
* @param {Object} [opts.headers] - Optional headers
|
|
81
91
|
* @returns {Promise<import("axios").AxiosResponse<{ emailTemplate: object }>>}
|
|
82
92
|
*/
|
|
@@ -150,7 +160,8 @@ function emailTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
150
160
|
* @param {string} opts.mainTemplateId - Main template id (ObjectId)
|
|
151
161
|
* @param {string} opts.agencyId - Agency id (ObjectId)
|
|
152
162
|
* @param {Object} [opts.headers] - Optional headers
|
|
153
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
163
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailTemplate: object }>>}
|
|
164
|
+
* @throws {import("axios").AxiosError} 400 validation (WRONG_DATA, MAIN_TEMPLATE_IS_NOT_CUSTOM), 401 (MAIN_TEMPLATE_ACCOUNT_MISMATCH, MAIN_TEMPLATE_NOT_FROM_PROVIDER), 404 MAIN_TEMPLATE_NOT_FOUND, 500
|
|
154
165
|
*/
|
|
155
166
|
function createSub({token, jwtToken, mainTemplateId, agencyId, headers}) {
|
|
156
167
|
return client({
|
|
@@ -163,15 +174,16 @@ function emailTemplatesFactory({client, internalAuthTokenProvider}) {
|
|
|
163
174
|
|
|
164
175
|
const versions = {
|
|
165
176
|
/**
|
|
166
|
-
* PUT /email-templates/:emailTemplateId/versions/:versionId -
|
|
177
|
+
* PUT /email-templates/:emailTemplateId/versions/:versionId - roll back template to a saved version (versionId is zero-based index in versions array).
|
|
167
178
|
* @param {Object} opts
|
|
168
179
|
* @param {string} [opts.token] - API key
|
|
169
180
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
170
181
|
* @param {string} opts.emailTemplateId - Template id (ObjectId)
|
|
171
|
-
* @param {string} opts.versionId -
|
|
172
|
-
* @param {Object} [opts.query] - Optional query
|
|
182
|
+
* @param {string} opts.versionId - Zero-based version index (e.g. "0", "1")
|
|
183
|
+
* @param {Object} [opts.query] - Optional query (superUserId, superUserHash for default templates)
|
|
173
184
|
* @param {Object} [opts.headers] - Optional headers
|
|
174
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
185
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailTemplate: object }>>}
|
|
186
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA, 401 NOT_SUPER_USER, 404 EMAIL_TEMPLATE_NOT_FOUND / EMAIL_TEMPLATE_VERSION_NOT_FOUND, 500
|
|
175
187
|
*/
|
|
176
188
|
update({token, jwtToken, emailTemplateId, versionId, query = {}, headers}) {
|
|
177
189
|
return client({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
1
2
|
/* eslint-disable import/extensions */
|
|
2
3
|
const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Factory for exchange-rates API (btrz-api-accounts).
|
|
7
|
+
* Manage account exchange rates by currency ISO code. GET returns paginated list; POST creates a rate and updates account preferences.
|
|
6
8
|
* @param {Object} deps
|
|
7
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
8
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -10,14 +12,15 @@ const {authorizationHeaders} = require("./../endpoints_helpers");
|
|
|
10
12
|
*/
|
|
11
13
|
function exchangeRatesFactory({client, internalAuthTokenProvider}) {
|
|
12
14
|
/**
|
|
13
|
-
* GET /exchange-rates/:isoCode
|
|
15
|
+
* GET /exchange-rates/:isoCode – List exchange rates for the account filtered by currency ISO code (3 letters).
|
|
16
|
+
* Response is paginated (exchangeRates array + totalRecords, page, etc.).
|
|
14
17
|
* @param {Object} opts
|
|
15
18
|
* @param {string} [opts.token] - API key
|
|
16
19
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
17
|
-
* @param {string} opts.isoCode - Currency ISO code
|
|
18
|
-
* @param {Object} [opts.query] -
|
|
20
|
+
* @param {string} opts.isoCode - Currency ISO code (3 uppercase letters, e.g. USD, MXN)
|
|
21
|
+
* @param {Object} [opts.query] - Optional query (e.g. page for pagination)
|
|
19
22
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
23
|
+
* @returns {Promise<import("axios").AxiosResponse<{ exchangeRates: object[], totalRecords: number, ... }>>}
|
|
21
24
|
*/
|
|
22
25
|
function allByIsoCode({token, jwtToken, isoCode, query = {}, headers}) {
|
|
23
26
|
return client({
|
|
@@ -28,13 +31,15 @@ function exchangeRatesFactory({client, internalAuthTokenProvider}) {
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
* POST /exchange-rates
|
|
34
|
+
* POST /exchange-rates – Create an exchange rate. Requires BETTEREZ_APP JWT. Currency must be in account preferences and enabled.
|
|
35
|
+
* Updates account preferences.supportedCurrencies for that currency. Emits exchangeRates.created.
|
|
36
|
+
* Body: { exchangeRate } or { isoCode, buy, sell }. buy and sell must be > 0.
|
|
32
37
|
* @param {Object} opts
|
|
33
38
|
* @param {string} [opts.token] - API key
|
|
34
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
35
|
-
* @param {Object} opts.data -
|
|
39
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
40
|
+
* @param {Object} opts.data - Body: { isoCode, buy, sell } or { exchangeRate: { isoCode, buy, sell } }
|
|
36
41
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
42
|
+
* @returns {Promise<import("axios").AxiosResponse<{ exchangeRate: object }>>}
|
|
38
43
|
*/
|
|
39
44
|
function create({data, token, jwtToken, headers}) {
|
|
40
45
|
return client({
|
|
@@ -3,6 +3,7 @@ const {authorizationHeaders} = require("../endpoints_helpers");
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Factory for exchange-receipt-settings API (btrz-api-accounts).
|
|
6
|
+
* Get or update account exchange receipt settings (CNBV-related fields). Requires BETTEREZ_APP audience.
|
|
6
7
|
* @param {Object} deps
|
|
7
8
|
* @param {import("axios").AxiosInstance} deps.client
|
|
8
9
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -10,13 +11,15 @@ const {authorizationHeaders} = require("../endpoints_helpers");
|
|
|
10
11
|
*/
|
|
11
12
|
function exchangeReceiptsFactory({client, internalAuthTokenProvider}) {
|
|
12
13
|
/**
|
|
13
|
-
* PUT /exchange-receipt-settings
|
|
14
|
+
* PUT /exchange-receipt-settings – Update exchange receipt settings. Requires BETTEREZ_APP JWT.
|
|
15
|
+
* Body: { exchangeReceipt } or ExchangeReceipt fields at root. All fields must be strings.
|
|
16
|
+
* Emits exchangeReceipt.updated.
|
|
14
17
|
* @param {Object} opts
|
|
15
18
|
* @param {string} [opts.token] - API key
|
|
16
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
17
|
-
* @param {Object} opts.data -
|
|
19
|
+
* @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
|
|
20
|
+
* @param {Object} opts.data - Body: { exchangeReceipt } or required ExchangeReceipt fields
|
|
18
21
|
* @param {Object} [opts.headers] - Optional headers
|
|
19
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
22
|
+
* @returns {Promise<import("axios").AxiosResponse<{ exchangeReceipt: object }>>}
|
|
20
23
|
*/
|
|
21
24
|
function update({data, token, jwtToken, headers}) {
|
|
22
25
|
return client({
|
|
@@ -28,12 +31,13 @@ function exchangeReceiptsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
|
-
* GET /exchange-receipt-settings
|
|
34
|
+
* GET /exchange-receipt-settings – Get exchange receipt settings. Requires BETTEREZ_APP JWT.
|
|
35
|
+
* Returns empty object if not set.
|
|
32
36
|
* @param {Object} opts
|
|
33
37
|
* @param {string} [opts.token] - API key
|
|
34
38
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
35
39
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
40
|
+
* @returns {Promise<import("axios").AxiosResponse<{ exchangeReceipt: object }>>}
|
|
37
41
|
*/
|
|
38
42
|
function get({token, jwtToken, headers}) {
|
|
39
43
|
return client({
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
const {authorizationHeaders} = require("../endpoints_helpers");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Factory for external-customers API (btrz-api-accounts). Saldo Max (ADO) registration proxy.
|
|
6
|
+
* @param {Object} deps
|
|
7
|
+
* @param {import("axios").AxiosInstance} deps.client
|
|
8
|
+
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
9
|
+
* @returns {{ registerSaldoMax: function }}
|
|
10
|
+
*/
|
|
11
|
+
function externalCustomersFactory({client, internalAuthTokenProvider}) {
|
|
12
|
+
/**
|
|
13
|
+
* POST /external-customers/ado – Register a user with Saldo Max (ADO). Requires BETTEREZ_APP JWT.
|
|
14
|
+
* Body: SaldoMaxRegistrationRequest at root or { body: SaldoMaxRegistrationRequest }.
|
|
15
|
+
* Required: firstName, lastName, email, password (Base64), verificationCode, isoCode (2-letter).
|
|
16
|
+
* @param {Object} opts
|
|
17
|
+
* @param {string} [opts.token] - API key
|
|
18
|
+
* @param {string} [opts.jwtToken] - JWT (BETTEREZ_APP audience)
|
|
19
|
+
* @param {Object} opts.data - Request body (or { body: SaldoMaxRegistrationRequest })
|
|
20
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
21
|
+
* @returns {Promise<import("axios").AxiosResponse<{ code: string }>>}
|
|
22
|
+
*/
|
|
23
|
+
function registerSaldoMax({data, token, jwtToken, headers}) {
|
|
24
|
+
return client({
|
|
25
|
+
url: "/external-customers/ado",
|
|
26
|
+
method: "post",
|
|
27
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
28
|
+
data
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
registerSaldoMax
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
module.exports = externalCustomersFactory;
|
|
@@ -3,7 +3,7 @@ const {
|
|
|
3
3
|
} = require("./../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for goal-settings API (btrz-api-accounts).
|
|
6
|
+
* Factory for goal-settings API (btrz-api-accounts). Goal API integration settings.
|
|
7
7
|
* @param {Object} deps
|
|
8
8
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
9
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -11,13 +11,13 @@ const {
|
|
|
11
11
|
*/
|
|
12
12
|
function goalSettingsFactory({client, internalAuthTokenProvider}) {
|
|
13
13
|
/**
|
|
14
|
-
* GET /goal-settings
|
|
14
|
+
* GET /goal-settings – Get goal settings for the account. Requires BETTEREZ_APP JWT.
|
|
15
|
+
* If user lacks read permission for /admin/integrations/goal, returns 200 with empty goalSettings.
|
|
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.query] - Query params
|
|
19
19
|
* @param {Object} [opts.headers] - Optional headers
|
|
20
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
20
|
+
* @returns {Promise<import("axios").AxiosResponse<{ goalSettings: object }>>}
|
|
21
21
|
*/
|
|
22
22
|
function get({token, jwtToken, query, headers}) {
|
|
23
23
|
return client({
|
|
@@ -28,13 +28,14 @@ function goalSettingsFactory({client, internalAuthTokenProvider}) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* PUT /goal-settings
|
|
31
|
+
* PUT /goal-settings – Update goal settings. Requires BETTEREZ_APP and update permission for
|
|
32
|
+
* /admin/integrations/goal. Emits goalsettings.updated. Body: { goalSettings }.
|
|
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.goalSettings -
|
|
36
|
+
* @param {Object} opts.goalSettings - Required: baseUrl, clientId, clientSecret, pushOnManifestStatus
|
|
36
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
37
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<{ goalSettings: object }>>}
|
|
38
39
|
*/
|
|
39
40
|
function update({jwtToken, token, goalSettings, headers}) {
|
|
40
41
|
return client({
|