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
package/lib/client.js
CHANGED
|
@@ -212,6 +212,7 @@ function createAccounts(_ref4) {
|
|
|
212
212
|
|
|
213
213
|
return {
|
|
214
214
|
accounts: require("./endpoints/accounts/accounts.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
215
|
+
agencies: require("./endpoints/accounts/agencies.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
215
216
|
application: require("./endpoints/accounts/application.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
216
217
|
applications: require("./endpoints/accounts/applications.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
217
218
|
applicationSettings: require("./endpoints/accounts/application-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -227,6 +228,7 @@ function createAccounts(_ref4) {
|
|
|
227
228
|
smsTemplates: require("./endpoints/accounts/sms-templates.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
228
229
|
exchangeRates: require("./endpoints/accounts/exchange-rates.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
229
230
|
exchangeReceipts: require("./endpoints/accounts/exchange-receipts.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
231
|
+
externalCustomers: require("./endpoints/accounts/external-customers.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
230
232
|
goalSettings: require("./endpoints/accounts/goal-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
231
233
|
images: require("./endpoints/accounts/images.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
232
234
|
interline: require("./endpoints/accounts/interline.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
@@ -265,6 +267,7 @@ function createAccounts(_ref4) {
|
|
|
265
267
|
trustedMachines: require("./endpoints/accounts/trusted-machines.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
266
268
|
twilioSettings: require("./endpoints/accounts/twilio-settings.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
267
269
|
users: require("./endpoints/accounts/users.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
270
|
+
verifiedEmails: require("./endpoints/accounts/verified-emails.js")({ client: client, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
268
271
|
__test: {
|
|
269
272
|
client: client
|
|
270
273
|
},
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable max-len */
|
|
4
|
+
var _require = require("../endpoints_helpers.js"),
|
|
5
|
+
authorizationHeaders = _require.authorizationHeaders;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Factory for agencies endpoints (btrz-api-accounts).
|
|
9
|
+
* @param {Object} deps
|
|
10
|
+
* @param {import("axios").AxiosInstance} deps.client
|
|
11
|
+
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
12
|
+
* @returns {{ putCreditLimit: function }}
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function agenciesFactory(_ref) {
|
|
17
|
+
var client = _ref.client,
|
|
18
|
+
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* PUT /agencies/:agencyId/credit-limit - update credit limit for an agency (seller) in the provider's network.
|
|
22
|
+
* Requires BETTEREZ_APP audience. Request body can be { limitAmount, unlimited } or { creditLimit: { limitAmount, unlimited } }.
|
|
23
|
+
* Side effect: Emits webhook event creditlimit.updated.
|
|
24
|
+
* @param {Object} opts
|
|
25
|
+
* @param {string} [opts.token] - API key
|
|
26
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
27
|
+
* @param {string} opts.agencyId - Agency (seller) ID, 24-char hex ObjectId. Must not be the provider's own accountId.
|
|
28
|
+
* @param {Object} opts.data - Credit limit payload: { limitAmount: number, unlimited: boolean } or { creditLimit: { limitAmount, unlimited } }
|
|
29
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
30
|
+
* @returns {Promise<import("axios").AxiosResponse<{ creditLimit: { _id: string, sellerId: string, providerId: string, unlimited: boolean, overrideLimit: number, currentLimit: number } }>>}
|
|
31
|
+
*/
|
|
32
|
+
function putCreditLimit(_ref2) {
|
|
33
|
+
var token = _ref2.token,
|
|
34
|
+
jwtToken = _ref2.jwtToken,
|
|
35
|
+
agencyId = _ref2.agencyId,
|
|
36
|
+
data = _ref2.data,
|
|
37
|
+
headers = _ref2.headers;
|
|
38
|
+
|
|
39
|
+
return client({
|
|
40
|
+
url: "/agencies/" + agencyId + "/credit-limit",
|
|
41
|
+
method: "put",
|
|
42
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
43
|
+
data: data
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
putCreditLimit: putCreditLimit
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = agenciesFactory;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-len */
|
|
3
4
|
var _require = require("./../endpoints_helpers.js"),
|
|
4
5
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {Object} ApplicationSettingsQuery
|
|
9
|
+
* @property {string} [name] - Optional. Filter by application name. When set, unauthenticated returns one object or 404; authenticated returns array with at most one item.
|
|
10
|
+
*/
|
|
11
|
+
|
|
6
12
|
/**
|
|
7
13
|
* Factory for application-settings API (btrz-api-accounts).
|
|
8
14
|
* @param {Object} deps
|
|
@@ -17,14 +23,14 @@ function applicationSettingsFactory(_ref) {
|
|
|
17
23
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
24
|
|
|
19
25
|
/**
|
|
20
|
-
* GET /application-settings/:providerId - get application settings for provider.
|
|
26
|
+
* GET /application-settings/:providerId - get application settings for a provider (account). Auth is optional: without auth returns one public object { key, settings, requestEndpoint }; with valid token returns array of application documents (see API docs for privateKey handling for internal apps).
|
|
21
27
|
* @param {Object} opts
|
|
22
28
|
* @param {string} [opts.token] - API key
|
|
23
29
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
24
|
-
* @param {string} opts.providerId -
|
|
25
|
-
* @param {
|
|
30
|
+
* @param {string} opts.providerId - Account (provider) ID whose application settings to return
|
|
31
|
+
* @param {ApplicationSettingsQuery} [opts.query] - Optional query; use name to filter by application name
|
|
26
32
|
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
33
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: unauthenticated = { key, settings, requestEndpoint }; authenticated = array of application objects (see API docs)
|
|
28
34
|
*/
|
|
29
35
|
function get(_ref2) {
|
|
30
36
|
var token = _ref2.token,
|
|
@@ -41,14 +47,14 @@ function applicationSettingsFactory(_ref) {
|
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
/**
|
|
44
|
-
* PUT /application-settings/:id - update application settings.
|
|
50
|
+
* PUT /application-settings/:id - update an application. Body can be { application: { name, description?, settings?, requestEndpoint?, enableUserSignOn?, channels?, roles? } } or direct. Emits webhook applications.updated.
|
|
45
51
|
* @param {Object} opts
|
|
46
52
|
* @param {string} [opts.token] - API key
|
|
47
53
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
48
|
-
* @param {string} opts.id - Application
|
|
49
|
-
* @param {Object} opts.application - Application payload
|
|
54
|
+
* @param {string} opts.id - Application id (24-char hex ObjectId)
|
|
55
|
+
* @param {Object} opts.application - Application payload (name required; optional description, settings, requestEndpoint, enableUserSignOn, channels, roles)
|
|
50
56
|
* @param {Object} [opts.headers] - Optional headers
|
|
51
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
57
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application }
|
|
52
58
|
*/
|
|
53
59
|
function update(_ref3) {
|
|
54
60
|
var jwtToken = _ref3.jwtToken,
|
|
@@ -66,13 +72,13 @@ function applicationSettingsFactory(_ref) {
|
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
/**
|
|
69
|
-
* DELETE /application-settings/:id -
|
|
75
|
+
* DELETE /application-settings/:id - soft-delete an application. Emits webhook applications.deleted.
|
|
70
76
|
* @param {Object} opts
|
|
71
77
|
* @param {string} [opts.token] - API key
|
|
72
78
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
|
-
* @param {string} opts.id - Application
|
|
79
|
+
* @param {string} opts.id - Application id (24-char hex ObjectId)
|
|
74
80
|
* @param {Object} [opts.headers] - Optional headers
|
|
75
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
81
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { id } (deleted application id)
|
|
76
82
|
*/
|
|
77
83
|
function remove(_ref4) {
|
|
78
84
|
var jwtToken = _ref4.jwtToken,
|
|
@@ -88,13 +94,13 @@ function applicationSettingsFactory(_ref) {
|
|
|
88
94
|
}
|
|
89
95
|
|
|
90
96
|
/**
|
|
91
|
-
* POST /application-settings/:id/keys - regenerate application keys.
|
|
97
|
+
* POST /application-settings/:id/keys - regenerate application keys; returns new key and privateKey. Emits webhook applications.updated.
|
|
92
98
|
* @param {Object} opts
|
|
93
99
|
* @param {string} [opts.token] - API key
|
|
94
100
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
95
|
-
* @param {string} opts.id - Application
|
|
101
|
+
* @param {string} opts.id - Application id (24-char hex ObjectId)
|
|
96
102
|
* @param {Object} [opts.headers] - Optional headers
|
|
97
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
103
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { keys: { key, privateKey } }
|
|
98
104
|
*/
|
|
99
105
|
function regenerateKeys(_ref5) {
|
|
100
106
|
var jwtToken = _ref5.jwtToken,
|
|
@@ -110,13 +116,13 @@ function applicationSettingsFactory(_ref) {
|
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
/**
|
|
113
|
-
* POST /application-settings - create application settings.
|
|
119
|
+
* POST /application-settings - create an application. Body can be { application: { name, description?, settings?, requestEndpoint?, enableUserSignOn?, channels?, roles? } } or direct. Emits webhook applications.created.
|
|
114
120
|
* @param {Object} opts
|
|
115
121
|
* @param {string} [opts.token] - API key
|
|
116
122
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
117
|
-
* @param {Object} opts.application - Application payload
|
|
123
|
+
* @param {Object} opts.application - Application payload (name required; optional description, settings, requestEndpoint, enableUserSignOn, channels, roles)
|
|
118
124
|
* @param {Object} [opts.headers] - Optional headers
|
|
119
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
125
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application }
|
|
120
126
|
*/
|
|
121
127
|
function create(_ref6) {
|
|
122
128
|
var jwtToken = _ref6.jwtToken,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-len */
|
|
3
4
|
var _require = require("./../endpoints_helpers.js"),
|
|
4
5
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* Factory for applications
|
|
8
|
+
* 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.
|
|
8
9
|
* @param {Object} deps
|
|
9
10
|
* @param {import("axios").AxiosInstance} deps.client
|
|
10
11
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -17,13 +18,13 @@ function applicationsFactory(_ref) {
|
|
|
17
18
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* GET /applications/:id - get an application by id.
|
|
21
|
+
* GET /applications/:id - get an application by id. Application must belong to the authenticated account.
|
|
21
22
|
* @param {Object} opts
|
|
22
23
|
* @param {string} [opts.token] - API key
|
|
23
24
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
24
|
-
* @param {string} opts.id - Application id (ObjectId)
|
|
25
|
+
* @param {string} opts.id - Application id (24-char hex ObjectId)
|
|
25
26
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
27
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application } (full application document including privateKey)
|
|
27
28
|
*/
|
|
28
29
|
function get(_ref2) {
|
|
29
30
|
var token = _ref2.token,
|
|
@@ -36,13 +37,13 @@ function applicationsFactory(_ref) {
|
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
|
-
* GET /applications/name/:appName - get an application by name.
|
|
40
|
+
* GET /applications/name/:appName - get an application by name. Returns non-internal, non-deleted application for the account; response excludes privateKey.
|
|
40
41
|
* @param {Object} opts
|
|
41
42
|
* @param {string} [opts.token] - API key
|
|
42
43
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
43
|
-
* @param {string} opts.appName - Application name
|
|
44
|
+
* @param {string} opts.appName - Application name (exact match)
|
|
44
45
|
* @param {Object} [opts.headers] - Optional headers
|
|
45
|
-
* @returns {Promise<import("axios").AxiosResponse>}
|
|
46
|
+
* @returns {Promise<import("axios").AxiosResponse>} Response data: { application } (application document without privateKey)
|
|
46
47
|
*/
|
|
47
48
|
function getByName(_ref3) {
|
|
48
49
|
var token = _ref3.token,
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
var _require = require("./../endpoints_helpers.js"),
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} CurrentShiftsQuery
|
|
8
|
+
* @property {string} [includeActivity] - Set to 'false' to avoid returning sales activity data for the shift (default 'true')
|
|
9
|
+
*/
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Factory for current-shift (per user) API (btrz-api-accounts).
|
|
8
13
|
* @param {Object} deps
|
|
@@ -21,7 +26,7 @@ function currentShiftsFactory(_ref) {
|
|
|
21
26
|
* @param {Object} opts
|
|
22
27
|
* @param {string} [opts.token] - API key
|
|
23
28
|
* @param {string} opts.userId - User id (ObjectId)
|
|
24
|
-
* @param {
|
|
29
|
+
* @param {CurrentShiftsQuery} [opts.query] - Query params
|
|
25
30
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
31
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
27
32
|
*/
|
|
@@ -2,11 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4
4
|
|
|
5
|
+
/* eslint-disable max-len */
|
|
5
6
|
var base64 = require("base-64");
|
|
6
7
|
|
|
7
8
|
var _require = require("./../endpoints_helpers.js"),
|
|
8
9
|
authorizationHeaders = _require.authorizationHeaders;
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Query params for GET /customers (btrz-api-accounts). Response is paginated (customers array + pagination).
|
|
13
|
+
* @typedef {Object} CustomersQuery
|
|
14
|
+
* @property {string} [customerNumber] - Filter: only that customer will be listed
|
|
15
|
+
* @property {string} [externalId] - Filter: same format as when creating the customer; only that customer listed
|
|
16
|
+
* @property {string} [providerIds] - Filter: provider ids to get customers from (comma-separated)
|
|
17
|
+
* @property {string} [lookupSearchParams] - Lookup search in format "documentTypeId|DNI,documentNumber|1234567" (documentNumber required)
|
|
18
|
+
*/
|
|
19
|
+
|
|
10
20
|
/**
|
|
11
21
|
* Factory for customers API (btrz-api-accounts).
|
|
12
22
|
* @param {Object} deps
|
|
@@ -21,14 +31,14 @@ function customersFactory(_ref) {
|
|
|
21
31
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
22
32
|
|
|
23
33
|
/**
|
|
24
|
-
* PUT /customers/:customerId - update a customer (full replace).
|
|
34
|
+
* 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.
|
|
25
35
|
* @param {Object} opts
|
|
26
36
|
* @param {string} [opts.token] - API key
|
|
27
37
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
28
|
-
* @param {string} opts.customerId - Customer id (ObjectId)
|
|
29
|
-
* @param {Object} opts.customer - Customer payload
|
|
38
|
+
* @param {string} opts.customerId - Customer id (24-char hex ObjectId)
|
|
39
|
+
* @param {Object} opts.customer - Customer payload (CustomerData)
|
|
30
40
|
* @param {Object} [opts.headers] - Optional headers
|
|
31
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
41
|
+
* @returns {Promise<import("axios").AxiosResponse<{ _id: string, customerNumber: string, ... }>>}
|
|
32
42
|
*/
|
|
33
43
|
function put(_ref2) {
|
|
34
44
|
var customerId = _ref2.customerId,
|
|
@@ -46,14 +56,14 @@ function customersFactory(_ref) {
|
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
/**
|
|
49
|
-
* GET /customers - list customers.
|
|
59
|
+
* GET /customers - list customers (paginated). Optional filters: customerNumber, externalId, providerIds, lookupSearchParams.
|
|
50
60
|
* @param {Object} opts
|
|
51
61
|
* @param {string} [opts.token] - API key
|
|
52
62
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
53
|
-
* @param {
|
|
54
|
-
* @param {string} [opts.providerId] -
|
|
63
|
+
* @param {CustomersQuery} [opts.query] - Query params; API expects providerIds (comma-separated). Use providerId to send a single id.
|
|
64
|
+
* @param {string} [opts.providerId] - Convenience: added to query as providerId (single provider)
|
|
55
65
|
* @param {Object} [opts.headers] - Optional headers
|
|
56
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
66
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customers: Array<object>, total: number, ... }>>}
|
|
57
67
|
*/
|
|
58
68
|
function all(_ref3) {
|
|
59
69
|
var token = _ref3.token,
|
|
@@ -72,14 +82,14 @@ function customersFactory(_ref) {
|
|
|
72
82
|
}
|
|
73
83
|
|
|
74
84
|
/**
|
|
75
|
-
* POST /customer - create a customer.
|
|
85
|
+
* 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.
|
|
76
86
|
* @param {Object} opts
|
|
77
87
|
* @param {string} [opts.token] - API key
|
|
78
88
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
79
|
-
* @param {Object} opts.customer - Customer payload
|
|
80
|
-
* @param {Object} [opts.query] -
|
|
89
|
+
* @param {Object} opts.customer - Customer payload (CustomerPost); email, firstName, lastName required
|
|
90
|
+
* @param {Object} [opts.query] - Optional: uniqueEmail, lang, channel, platform, appVersion, appName, activateIfExists
|
|
81
91
|
* @param {Object} [opts.headers] - Optional headers
|
|
82
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
92
|
+
* @returns {Promise<import("axios").AxiosResponse<{ _id: string, customerNumber: string, ... }>>}
|
|
83
93
|
*/
|
|
84
94
|
function create(_ref4) {
|
|
85
95
|
var customer = _ref4.customer,
|
|
@@ -154,15 +164,15 @@ function customersFactory(_ref) {
|
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
/**
|
|
157
|
-
* PATCH /customers/:customerId -
|
|
167
|
+
* 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.
|
|
158
168
|
* @param {Object} opts
|
|
159
169
|
* @param {string} [opts.token] - API key
|
|
160
170
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
161
|
-
* @param {string} opts.customerId - Customer id (ObjectId)
|
|
162
|
-
* @param {Object} opts.data -
|
|
163
|
-
* @param {Object} [opts.query] -
|
|
171
|
+
* @param {string} opts.customerId - Customer id (24-char hex ObjectId)
|
|
172
|
+
* @param {Object} opts.data - Body: { operations } or array of { op, path, value }
|
|
173
|
+
* @param {Object} [opts.query] - Optional query
|
|
164
174
|
* @param {Object} [opts.headers] - Optional headers
|
|
165
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
175
|
+
* @returns {Promise<import("axios").AxiosResponse<CustomerWithAuthToken>>}
|
|
166
176
|
*/
|
|
167
177
|
function update(_ref7) {
|
|
168
178
|
var customerId = _ref7.customerId,
|
|
@@ -182,13 +192,13 @@ function customersFactory(_ref) {
|
|
|
182
192
|
}
|
|
183
193
|
|
|
184
194
|
/**
|
|
185
|
-
* POST /customers/merge - merge source customers into destination.
|
|
195
|
+
* POST /customers/merge - merge source customers into destination. Requires BETTEREZ_APP. Side effect: emits customers.merged webhook.
|
|
186
196
|
* @param {Object} opts
|
|
187
197
|
* @param {string} [opts.token] - API key
|
|
188
198
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
189
|
-
* @param {string} opts.destinationCustomerId - Destination customer id (ObjectId)
|
|
190
|
-
* @param {Array<string>} opts.sourceCustomerIds - Source customer ids (ObjectIds)
|
|
191
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
199
|
+
* @param {string} opts.destinationCustomerId - Destination customer id (24-char hex ObjectId)
|
|
200
|
+
* @param {Array<string>} opts.sourceCustomerIds - Source customer ids (24-char hex ObjectIds)
|
|
201
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customerMerge: object }>>}
|
|
192
202
|
*/
|
|
193
203
|
function merge(_ref8) {
|
|
194
204
|
var destinationCustomerId = _ref8.destinationCustomerId,
|
|
@@ -5,6 +5,7 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Factory for domains API (btrz-api-accounts).
|
|
8
|
+
* Endpoints manage subdomains for the account: list, create (with DNS and websales config), and delete.
|
|
8
9
|
* @param {Object} deps
|
|
9
10
|
* @param {import("axios").AxiosInstance} deps.client
|
|
10
11
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -17,12 +18,12 @@ function domainsFactory(_ref) {
|
|
|
17
18
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* GET /domains
|
|
21
|
+
* GET /domains – List all domain names for the current account.
|
|
22
|
+
* Response body is an array of strings (primary domain first, then secondary domains). No query parameters.
|
|
21
23
|
* @param {Object} opts
|
|
22
|
-
* @param {string} [opts.token] - API key
|
|
23
|
-
* @param {Object} [opts.query] - Query params
|
|
24
|
+
* @param {string} [opts.token] - API key (X-API-KEY)
|
|
24
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<string[]>>} response.data is string[]
|
|
26
27
|
*/
|
|
27
28
|
function all(_ref2) {
|
|
28
29
|
var token = _ref2.token,
|
|
@@ -38,13 +39,14 @@ function domainsFactory(_ref) {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
* POST /domains
|
|
42
|
+
* POST /domains – Create a new subdomain for the account.
|
|
43
|
+
* Adds DNS CNAME and default websales config. Requires BETTEREZ_APP JWT. Emits domains.created (and websalesConfig.created) webhooks.
|
|
42
44
|
* @param {Object} opts
|
|
43
45
|
* @param {string} [opts.token] - API key
|
|
44
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
45
|
-
* @param {Object} opts.data -
|
|
46
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
47
|
+
* @param {Object} opts.data - Body: { domain } or { domainInfo: { domain } }. domain must match pattern (no dots, no underscores).
|
|
46
48
|
* @param {Object} [opts.headers] - Optional headers
|
|
47
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
49
|
+
* @returns {Promise<import("axios").AxiosResponse<{ domain: string }>>} response.data is AddedDomainResponse
|
|
48
50
|
*/
|
|
49
51
|
function create(_ref3) {
|
|
50
52
|
var data = _ref3.data,
|
|
@@ -61,13 +63,15 @@ function domainsFactory(_ref) {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
|
-
* DELETE /domains/:domain
|
|
66
|
+
* DELETE /domains/:domain – Remove a subdomain from the account.
|
|
67
|
+
* Removes DNS entry, websales config, and domain from payment methods and inventory products.
|
|
68
|
+
* Primary domain cannot be deleted. Emits domains.deleted and websalesConfig.deleted.
|
|
65
69
|
* @param {Object} opts
|
|
66
70
|
* @param {string} [opts.token] - API key
|
|
67
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
68
|
-
* @param {string} opts.domain - Domain name
|
|
71
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
72
|
+
* @param {string} opts.domain - Domain name (path parameter)
|
|
69
73
|
* @param {Object} [opts.headers] - Optional headers
|
|
70
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
74
|
+
* @returns {Promise<import("axios").AxiosResponse<{ domain: string }>>} response.data is DeletedDomainResponse
|
|
71
75
|
*/
|
|
72
76
|
function remove(_ref4) {
|
|
73
77
|
var domain = _ref4.domain,
|
|
@@ -6,6 +6,20 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
|
|
|
6
6
|
var _require = require("../endpoints_helpers.js"),
|
|
7
7
|
authorizationHeaders = _require.authorizationHeaders;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Query params for GET /dynamic-forms (btrz-api-accounts). See get-handler getSpec().
|
|
11
|
+
* @typedef {Object} DynamicFormsQuery
|
|
12
|
+
* @property {string} [dynamicFormFieldId] - Get all dynamic forms for the given field id (ObjectId)
|
|
13
|
+
* @property {string} [providerId] - Get all dynamic forms for the given provider id (ObjectId)
|
|
14
|
+
* @property {string} [type] - Filter by type: "reservation" | "parcel" | "checkin" | "paid_in" | "pay_on_account"
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Query params for GET /dynamic-forms/:dynamicFormId (btrz-api-accounts). See get-by-id-handler getSpec().
|
|
19
|
+
* @typedef {Object} DynamicFormByIdQuery
|
|
20
|
+
* @property {string} [providerId] - Fetch the dynamic form for the given providerId (ObjectId)
|
|
21
|
+
*/
|
|
22
|
+
|
|
9
23
|
/**
|
|
10
24
|
* Factory for dynamic-forms API (btrz-api-accounts).
|
|
11
25
|
* @param {Object} deps
|
|
@@ -25,8 +39,8 @@ function dynamicFormsFactory(_ref) {
|
|
|
25
39
|
* @param {string} [opts.token] - API key
|
|
26
40
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
27
41
|
* @param {string} opts.dynamicFormId - Dynamic form id (ObjectId)
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {string} [opts.providerId] - Provider id (
|
|
42
|
+
* @param {DynamicFormByIdQuery} [opts.query] - Query params (providerId)
|
|
43
|
+
* @param {string} [opts.providerId] - Provider id; if set, added to query (convenience)
|
|
30
44
|
* @param {Object} [opts.headers] - Optional headers
|
|
31
45
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
32
46
|
*/
|
|
@@ -52,7 +66,7 @@ function dynamicFormsFactory(_ref) {
|
|
|
52
66
|
* @param {Object} opts
|
|
53
67
|
* @param {string} [opts.token] - API key
|
|
54
68
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
55
|
-
* @param {
|
|
69
|
+
* @param {DynamicFormsQuery} [opts.query] - Query params (dynamicFormFieldId, providerId, type)
|
|
56
70
|
* @param {Object} [opts.headers] - Optional headers
|
|
57
71
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
58
72
|
*/
|
|
@@ -75,7 +89,6 @@ function dynamicFormsFactory(_ref) {
|
|
|
75
89
|
* @param {Object} opts
|
|
76
90
|
* @param {string} [opts.token] - API key
|
|
77
91
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
78
|
-
* @param {Object} [opts.query] - Query params
|
|
79
92
|
* @param {Object} opts.data - Form payload
|
|
80
93
|
* @param {Object} [opts.headers] - Optional headers
|
|
81
94
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
@@ -172,7 +185,6 @@ function dynamicFormsFactory(_ref) {
|
|
|
172
185
|
* @param {Object} opts
|
|
173
186
|
* @param {string} [opts.token] - API key
|
|
174
187
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
175
|
-
* @param {Object} [opts.query] - Query params
|
|
176
188
|
* @param {Object} [opts.headers] - Optional headers
|
|
177
189
|
* @returns {Promise<import("axios").AxiosResponse>}
|
|
178
190
|
*/
|
|
@@ -6,6 +6,7 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Factory for email-settings API (btrz-api-accounts).
|
|
9
|
+
* Manage account email settings (identity/verified senders). Path parameter is email address.
|
|
9
10
|
* @param {Object} deps
|
|
10
11
|
* @param {import("axios").AxiosInstance} deps.client
|
|
11
12
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
@@ -18,13 +19,13 @@ function emailSettingsFactory(_ref) {
|
|
|
18
19
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* GET /email-settings
|
|
22
|
+
* GET /email-settings – List all email settings for the account.
|
|
23
|
+
* Response may trigger AWS verification and commIdentity updates. No query params.
|
|
22
24
|
* @param {Object} opts
|
|
23
25
|
* @param {string} [opts.token] - API key
|
|
24
26
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
25
|
-
* @param {Object} [opts.query] - Query params
|
|
26
27
|
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
28
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSettings: object[] }>>}
|
|
28
29
|
*/
|
|
29
30
|
function all(_ref2) {
|
|
30
31
|
var token = _ref2.token,
|
|
@@ -40,14 +41,13 @@ function emailSettingsFactory(_ref) {
|
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
* GET /email-settings/:email
|
|
44
|
+
* GET /email-settings/:email – Get one email setting by email address (path param).
|
|
44
45
|
* @param {Object} opts
|
|
45
46
|
* @param {string} [opts.token] - API key
|
|
46
47
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
47
|
-
* @param {string} opts.email - Email address
|
|
48
|
-
* @param {Object} [opts.query] - Query params
|
|
48
|
+
* @param {string} opts.email - Email address (path parameter; must match email pattern)
|
|
49
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
50
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
50
|
+
* @returns {Promise<import("axios").AxiosResponse<object>>} response.data is EmailSetting
|
|
51
51
|
*/
|
|
52
52
|
function getByEmail(_ref3) {
|
|
53
53
|
var token = _ref3.token,
|
|
@@ -65,13 +65,14 @@ function emailSettingsFactory(_ref) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* POST /email-settings
|
|
68
|
+
* POST /email-settings – Create an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.created.
|
|
69
|
+
* Body: { emailSetting } or { name, email, active }. Email and domain are verified in AWS.
|
|
69
70
|
* @param {Object} opts
|
|
70
71
|
* @param {string} [opts.token] - API key
|
|
71
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
72
|
-
* @param {Object} opts.data -
|
|
72
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
73
|
+
* @param {Object} opts.data - Body: { name, email, active? } or { emailSetting: { name, email, active? } }
|
|
73
74
|
* @param {Object} [opts.headers] - Optional headers
|
|
74
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
75
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
75
76
|
*/
|
|
76
77
|
function create(_ref4) {
|
|
77
78
|
var data = _ref4.data,
|
|
@@ -88,14 +89,14 @@ function emailSettingsFactory(_ref) {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
|
-
* PUT /email-settings/:email
|
|
92
|
+
* PUT /email-settings/:email – Update an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.updated.
|
|
92
93
|
* @param {Object} opts
|
|
93
94
|
* @param {string} [opts.token] - API key
|
|
94
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
95
|
-
* @param {string} opts.email - Email address
|
|
96
|
-
* @param {Object} opts.data -
|
|
95
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
96
|
+
* @param {string} opts.email - Email address (path parameter)
|
|
97
|
+
* @param {Object} opts.data - Body: { name, email, active?, ... } or { emailSetting: { ... } }
|
|
97
98
|
* @param {Object} [opts.headers] - Optional headers
|
|
98
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
99
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
99
100
|
*/
|
|
100
101
|
function update(_ref5) {
|
|
101
102
|
var token = _ref5.token,
|
|
@@ -113,13 +114,14 @@ function emailSettingsFactory(_ref) {
|
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
/**
|
|
116
|
-
* DELETE /email-settings/:email
|
|
117
|
+
* DELETE /email-settings/:email – Remove an email setting. Requires BETTEREZ_APP JWT. Emits emailSetting.deleted.
|
|
118
|
+
* Fails with 400 if the email is currently active.
|
|
117
119
|
* @param {Object} opts
|
|
118
120
|
* @param {string} [opts.token] - API key
|
|
119
|
-
* @param {string} [opts.jwtToken] - JWT
|
|
120
|
-
* @param {string} opts.email - Email address
|
|
121
|
+
* @param {string} [opts.jwtToken] - JWT (required for BETTEREZ_APP audience)
|
|
122
|
+
* @param {string} opts.email - Email address (path parameter)
|
|
121
123
|
* @param {Object} [opts.headers] - Optional headers
|
|
122
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
124
|
+
* @returns {Promise<import("axios").AxiosResponse<{ emailSetting: object }>>}
|
|
123
125
|
*/
|
|
124
126
|
function remove(_ref6) {
|
|
125
127
|
var email = _ref6.email,
|