btrz-api-client 8.29.0 → 8.31.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.
Files changed (658) hide show
  1. package/.cursor/rules/jsdoc-endpoints.mdc +23 -0
  2. package/docs/plans/2026-03-05-btrz-api-client-jsdoc.md +110 -0
  3. package/lib/client-standalone-min.js +2 -2
  4. package/lib/client.js +90 -0
  5. package/lib/constants.js +4 -0
  6. package/lib/endpoints/accounts/accounts.js +28 -1
  7. package/lib/endpoints/accounts/application-settings.js +62 -1
  8. package/lib/endpoints/accounts/application.js +18 -1
  9. package/lib/endpoints/accounts/applications.js +28 -1
  10. package/lib/endpoints/accounts/current-shifts.js +24 -2
  11. package/lib/endpoints/accounts/customers.js +84 -1
  12. package/lib/endpoints/accounts/docs.js +10 -0
  13. package/lib/endpoints/accounts/domains.js +35 -1
  14. package/lib/endpoints/accounts/dynamic-forms.js +121 -0
  15. package/lib/endpoints/accounts/email-settings.js +55 -1
  16. package/lib/endpoints/accounts/email-templates.js +121 -0
  17. package/lib/endpoints/accounts/exchange-rates.js +28 -0
  18. package/lib/endpoints/accounts/exchange-receipts.js +26 -0
  19. package/lib/endpoints/accounts/goal-settings.js +26 -0
  20. package/lib/endpoints/accounts/images.js +46 -1
  21. package/lib/endpoints/accounts/interline.js +91 -0
  22. package/lib/endpoints/accounts/journey-prices-settings.js +26 -0
  23. package/lib/endpoints/accounts/lexicons.js +79 -4
  24. package/lib/endpoints/accounts/market-pricing-settings.js +26 -0
  25. package/lib/endpoints/accounts/multiproduct-sales-settings.js +26 -0
  26. package/lib/endpoints/accounts/network.js +68 -0
  27. package/lib/endpoints/accounts/operation-settings.js +26 -0
  28. package/lib/endpoints/accounts/people-lookups.js +78 -0
  29. package/lib/endpoints/accounts/point-to-point-settings.js +26 -0
  30. package/lib/endpoints/accounts/print-settings.js +26 -1
  31. package/lib/endpoints/accounts/print-templates.js +98 -1
  32. package/lib/endpoints/accounts/printers.js +17 -1
  33. package/lib/endpoints/accounts/rms-settings.js +26 -0
  34. package/lib/endpoints/accounts/s3buckets.js +37 -0
  35. package/lib/endpoints/accounts/salesforce-settings.js +26 -0
  36. package/lib/endpoints/accounts/shift-settings.js +26 -0
  37. package/lib/endpoints/accounts/shifts.js +319 -0
  38. package/lib/endpoints/accounts/sms-templates.js +115 -0
  39. package/lib/endpoints/accounts/sub-print-templates.js +19 -2
  40. package/lib/endpoints/accounts/ticket-movement-settings.js +26 -0
  41. package/lib/endpoints/accounts/tokens.js +35 -1
  42. package/lib/endpoints/accounts/transport-regulation-settings.js +26 -0
  43. package/lib/endpoints/accounts/travellers.js +73 -1
  44. package/lib/endpoints/accounts/trusted-machines.js +45 -1
  45. package/lib/endpoints/accounts/twilio-settings.js +26 -0
  46. package/lib/endpoints/accounts/users.js +173 -1
  47. package/lib/endpoints/accounts/websales-config.js +36 -1
  48. package/lib/endpoints/btrzpay/cardpointe.js +57 -0
  49. package/lib/endpoints/btrzpay/customerCards.js +53 -2
  50. package/lib/endpoints/btrzpay/customers.js +40 -1
  51. package/lib/endpoints/btrzpay/datalogic.js +63 -1
  52. package/lib/endpoints/btrzpay/docs.js +11 -0
  53. package/lib/endpoints/btrzpay/oxxo.js +62 -4
  54. package/lib/endpoints/btrzpay/payment-methods.js +115 -2
  55. package/lib/endpoints/btrzpay/payments.js +28 -2
  56. package/lib/endpoints/btrzpay/prismaTerminals.js +140 -0
  57. package/lib/endpoints/btrzpay/reference-numbers.js +19 -2
  58. package/lib/endpoints/btrzpay/referenced-payments.js +41 -1
  59. package/lib/endpoints/btrzpay/square.js +35 -1
  60. package/lib/endpoints/btrzpay/stripe-terminals.js +34 -0
  61. package/lib/endpoints/btrzpay/terminalPayments.js +56 -0
  62. package/lib/endpoints/coltrane/docs.js +10 -0
  63. package/lib/endpoints/coltrane/merged-fare-tables.js +20 -0
  64. package/lib/endpoints/coltrane/paths.js +30 -0
  65. package/lib/endpoints/endpoints_helpers.js +11 -1
  66. package/lib/endpoints/gps/scanner-app-location.js +25 -1
  67. package/lib/endpoints/inventory/amenities.js +56 -2
  68. package/lib/endpoints/inventory/amenity-groups.js +57 -2
  69. package/lib/endpoints/inventory/banks.js +54 -0
  70. package/lib/endpoints/inventory/bare-routes.js +42 -1
  71. package/lib/endpoints/inventory/brands.js +56 -2
  72. package/lib/endpoints/inventory/bundle-fares.js +28 -2
  73. package/lib/endpoints/inventory/bundles.js +36 -2
  74. package/lib/endpoints/inventory/change-requests.js +95 -0
  75. package/lib/endpoints/inventory/companies.js +27 -2
  76. package/lib/endpoints/inventory/control-classes.js +86 -0
  77. package/lib/endpoints/inventory/countries.js +33 -0
  78. package/lib/endpoints/inventory/custom-content.js +63 -1
  79. package/lib/endpoints/inventory/custom-fields.js +63 -1
  80. package/lib/endpoints/inventory/docs.js +10 -0
  81. package/lib/endpoints/inventory/document-types.js +64 -1
  82. package/lib/endpoints/inventory/external-passes.js +41 -0
  83. package/lib/endpoints/inventory/external-wallets.js +55 -0
  84. package/lib/endpoints/inventory/fallback-codes.js +52 -0
  85. package/lib/endpoints/inventory/fare-classes.js +46 -2
  86. package/lib/endpoints/inventory/fares.js +78 -2
  87. package/lib/endpoints/inventory/fees.js +55 -2
  88. package/lib/endpoints/inventory/filtered-trips-v2.js +19 -2
  89. package/lib/endpoints/inventory/filtered-trips.js +39 -0
  90. package/lib/endpoints/inventory/financing-costs.js +69 -0
  91. package/lib/endpoints/inventory/garages.js +63 -1
  92. package/lib/endpoints/inventory/getnet-terminals.js +63 -0
  93. package/lib/endpoints/inventory/gift-certificate-definitions.js +62 -0
  94. package/lib/endpoints/inventory/healthcheck.js +11 -5
  95. package/lib/endpoints/inventory/insurances.js +62 -1
  96. package/lib/endpoints/inventory/insurancesCost.js +28 -1
  97. package/lib/endpoints/inventory/items.js +77 -0
  98. package/lib/endpoints/inventory/journey-prices.js +91 -2
  99. package/lib/endpoints/inventory/labels.js +62 -0
  100. package/lib/endpoints/inventory/marital-status.js +62 -1
  101. package/lib/endpoints/inventory/marketplace-modifiers.js +67 -0
  102. package/lib/endpoints/inventory/mit-terminal-settings.js +54 -0
  103. package/lib/endpoints/inventory/mit-terminals.js +54 -0
  104. package/lib/endpoints/inventory/operating-companies.js +99 -2
  105. package/lib/endpoints/inventory/operation-messages.js +77 -3
  106. package/lib/endpoints/inventory/operation-reasons.js +61 -0
  107. package/lib/endpoints/inventory/parcel-zones.js +43 -2
  108. package/lib/endpoints/inventory/pay-on-accounts.js +30 -0
  109. package/lib/endpoints/inventory/payment-terminals.js +53 -2
  110. package/lib/endpoints/inventory/prisma-terminals.js +64 -0
  111. package/lib/endpoints/inventory/products.js +91 -0
  112. package/lib/endpoints/inventory/promos.js +113 -1
  113. package/lib/endpoints/inventory/routes.js +282 -0
  114. package/lib/endpoints/inventory/schedule-groups.js +52 -0
  115. package/lib/endpoints/inventory/schedules.js +126 -0
  116. package/lib/endpoints/inventory/seatclasses.js +54 -0
  117. package/lib/endpoints/inventory/seatfees.js +53 -2
  118. package/lib/endpoints/inventory/seatmaps.js +113 -1
  119. package/lib/endpoints/inventory/segments-information-tables.js +25 -0
  120. package/lib/endpoints/inventory/segments-information.js +62 -0
  121. package/lib/endpoints/inventory/service-numbers.js +55 -1
  122. package/lib/endpoints/inventory/service-types.js +53 -2
  123. package/lib/endpoints/inventory/ssrs.js +31 -2
  124. package/lib/endpoints/inventory/station-classes.js +62 -0
  125. package/lib/endpoints/inventory/station-groups.js +24 -0
  126. package/lib/endpoints/inventory/stations-provinces.js +17 -0
  127. package/lib/endpoints/inventory/stations-zones.js +24 -0
  128. package/lib/endpoints/inventory/stations.js +70 -1
  129. package/lib/endpoints/inventory/taxes.js +103 -2
  130. package/lib/endpoints/inventory/travel-routes.js +54 -1
  131. package/lib/endpoints/inventory/traveller-card-providers-types.js +17 -1
  132. package/lib/endpoints/inventory/traveller-card-providers.js +46 -1
  133. package/lib/endpoints/inventory/traveller-card-types.js +62 -1
  134. package/lib/endpoints/inventory/trips.js +26 -1
  135. package/lib/endpoints/inventory/vehicle-types.js +14 -6
  136. package/lib/endpoints/inventory/vehicles.js +100 -1
  137. package/lib/endpoints/inventory/zone-price-overages.js +53 -2
  138. package/lib/endpoints/inventory/zone-prices.js +64 -2
  139. package/lib/endpoints/invoices/dlink.js +38 -1
  140. package/lib/endpoints/invoices/docs.js +10 -0
  141. package/lib/endpoints/invoices/emails.js +20 -1
  142. package/lib/endpoints/invoices/gti.js +37 -1
  143. package/lib/endpoints/invoices/infile.js +37 -1
  144. package/lib/endpoints/invoices/infileJson.js +37 -1
  145. package/lib/endpoints/invoices/invoices.js +68 -1
  146. package/lib/endpoints/invoices/pdfs.js +27 -1
  147. package/lib/endpoints/invoices/providers.js +67 -1
  148. package/lib/endpoints/invoices/providersSequences.js +61 -1
  149. package/lib/endpoints/invoices/system.js +37 -1
  150. package/lib/endpoints/invoices/tax-ids.js +29 -1
  151. package/lib/endpoints/loyalty/movements.js +50 -1
  152. package/lib/endpoints/loyalty/programs.js +45 -2
  153. package/lib/endpoints/notifications/customers.js +53 -1
  154. package/lib/endpoints/notifications/email.js +29 -1
  155. package/lib/endpoints/notifications/manifest-notifications.js +34 -1
  156. package/lib/endpoints/notifications/notify.js +71 -0
  157. package/lib/endpoints/notifications/orders-rules-validations.js +19 -1
  158. package/lib/endpoints/notifications/pdf-data.js +57 -5
  159. package/lib/endpoints/notifications/pdfs.js +28 -0
  160. package/lib/endpoints/notifications/printed-tickets.js +34 -2
  161. package/lib/endpoints/notifications/salesforce.js +19 -2
  162. package/lib/endpoints/notifications/twilio.js +47 -2
  163. package/lib/endpoints/operations/accounting_items.js +35 -0
  164. package/lib/endpoints/operations/applied_insurance.js +24 -2
  165. package/lib/endpoints/operations/calendar_entries.js +27 -2
  166. package/lib/endpoints/operations/docs.js +13 -1
  167. package/lib/endpoints/operations/external-bookings.js +27 -0
  168. package/lib/endpoints/operations/flexpasses.js +20 -1
  169. package/lib/endpoints/operations/loans.js +37 -1
  170. package/lib/endpoints/operations/manifest.js +378 -0
  171. package/lib/endpoints/operations/manifest_leg_for_tickets.js +19 -2
  172. package/lib/endpoints/operations/movements.js +19 -1
  173. package/lib/endpoints/operations/outlook-trips.js +37 -2
  174. package/lib/endpoints/operations/parcels.js +79 -2
  175. package/lib/endpoints/operations/parcels_manifests.js +84 -0
  176. package/lib/endpoints/operations/passenger_check_in_info.js +55 -1
  177. package/lib/endpoints/operations/redemption.js +38 -1
  178. package/lib/endpoints/operations/rms.js +61 -0
  179. package/lib/endpoints/operations/scheduled_notifications.js +62 -1
  180. package/lib/endpoints/operations/segments.js +27 -2
  181. package/lib/endpoints/operations/sold-items-fulfillment.js +24 -0
  182. package/lib/endpoints/operations/sold-items.js +42 -0
  183. package/lib/endpoints/operations/tickets.js +74 -0
  184. package/lib/endpoints/operations/transaction.js +20 -2
  185. package/lib/endpoints/operations/transactions.js +117 -0
  186. package/lib/endpoints/operations/transport_regulations.js +19 -1
  187. package/lib/endpoints/operations/trip_change_info.js +32 -2
  188. package/lib/endpoints/operations/vehicle_assignments.js +59 -0
  189. package/lib/endpoints/operations/vouchers.js +28 -0
  190. package/lib/endpoints/operations/waitlists.js +56 -1
  191. package/lib/endpoints/ratality/auth.js +14 -0
  192. package/lib/endpoints/ratality/clients.js +25 -0
  193. package/lib/endpoints/ratality/integrations.js +33 -0
  194. package/lib/endpoints/reports/custom-reports.js +45 -1
  195. package/lib/endpoints/reports/email.js +19 -0
  196. package/lib/endpoints/reports/report-types.js +31 -3
  197. package/lib/endpoints/reports/trip-manifests.js +27 -1
  198. package/lib/endpoints/sales/bundles.js +26 -2
  199. package/lib/endpoints/sales/cancellations.js +2 -2
  200. package/lib/endpoints/sales/cart-promo.js +29 -2
  201. package/lib/endpoints/sales/cart.js +167 -0
  202. package/lib/endpoints/sales/check-in-info.js +20 -1
  203. package/lib/endpoints/sales/custom-fields.js +25 -2
  204. package/lib/endpoints/sales/docs.js +10 -0
  205. package/lib/endpoints/sales/flexpasses.js +20 -1
  206. package/lib/endpoints/sales/gift-certificates.js +27 -1
  207. package/lib/endpoints/sales/order.js +52 -0
  208. package/lib/endpoints/sales/parcel-quotes.js +19 -0
  209. package/lib/endpoints/sales/payment-providers.js +28 -2
  210. package/lib/endpoints/sales/redeemable-items.js +45 -2
  211. package/lib/endpoints/sales/sync-entry.js +20 -2
  212. package/lib/endpoints/sales/voucher.js +44 -1
  213. package/lib/endpoints/seatmaps/access-ticket.js +18 -2
  214. package/lib/endpoints/seatmaps/seat.js +19 -2
  215. package/lib/endpoints/uploads/files.js +20 -2
  216. package/lib/endpoints/uploads/images.js +20 -2
  217. package/lib/endpoints/webhooks/events.js +26 -2
  218. package/lib/endpoints/webhooks/subscriptions.js +63 -2
  219. package/lib/endpoints/webhooks/undelivered.js +79 -2
  220. package/lib/endpoints/webhooks/webhooks.js +19 -2
  221. package/lib/productionDefaults.js +4 -0
  222. package/package.json +5 -7
  223. package/src/client.js +90 -0
  224. package/src/constants.js +4 -0
  225. package/src/endpoints/accounts/accounts.js +26 -1
  226. package/src/endpoints/accounts/application-settings.js +60 -1
  227. package/src/endpoints/accounts/application.js +17 -2
  228. package/src/endpoints/accounts/applications.js +26 -1
  229. package/src/endpoints/accounts/current-shifts.js +24 -2
  230. package/src/endpoints/accounts/customers.js +83 -2
  231. package/src/endpoints/accounts/docs.js +10 -0
  232. package/src/endpoints/accounts/domains.js +33 -1
  233. package/src/endpoints/accounts/dynamic-forms.js +115 -0
  234. package/src/endpoints/accounts/email-settings.js +53 -1
  235. package/src/endpoints/accounts/email-templates.js +119 -0
  236. package/src/endpoints/accounts/exchange-rates.js +26 -0
  237. package/src/endpoints/accounts/exchange-receipts.js +24 -0
  238. package/src/endpoints/accounts/goal-settings.js +24 -0
  239. package/src/endpoints/accounts/images.js +44 -1
  240. package/src/endpoints/accounts/interline.js +85 -0
  241. package/src/endpoints/accounts/journey-prices-settings.js +24 -0
  242. package/src/endpoints/accounts/lexicons.js +77 -4
  243. package/src/endpoints/accounts/market-pricing-settings.js +24 -0
  244. package/src/endpoints/accounts/multiproduct-sales-settings.js +24 -0
  245. package/src/endpoints/accounts/network.js +61 -0
  246. package/src/endpoints/accounts/operation-settings.js +24 -0
  247. package/src/endpoints/accounts/people-lookups.js +76 -0
  248. package/src/endpoints/accounts/point-to-point-settings.js +24 -0
  249. package/src/endpoints/accounts/print-settings.js +24 -1
  250. package/src/endpoints/accounts/print-templates.js +98 -3
  251. package/src/endpoints/accounts/printers.js +15 -1
  252. package/src/endpoints/accounts/rms-settings.js +24 -0
  253. package/src/endpoints/accounts/s3buckets.js +35 -0
  254. package/src/endpoints/accounts/salesforce-settings.js +24 -0
  255. package/src/endpoints/accounts/shift-settings.js +24 -0
  256. package/src/endpoints/accounts/shifts.js +313 -0
  257. package/src/endpoints/accounts/sms-templates.js +113 -0
  258. package/src/endpoints/accounts/sub-print-templates.js +17 -2
  259. package/src/endpoints/accounts/ticket-movement-settings.js +24 -0
  260. package/src/endpoints/accounts/tokens.js +33 -1
  261. package/src/endpoints/accounts/transport-regulation-settings.js +24 -0
  262. package/src/endpoints/accounts/travellers.js +71 -1
  263. package/src/endpoints/accounts/trusted-machines.js +43 -1
  264. package/src/endpoints/accounts/twilio-settings.js +24 -0
  265. package/src/endpoints/accounts/users.js +167 -1
  266. package/src/endpoints/accounts/websales-config.js +34 -1
  267. package/src/endpoints/btrzpay/cardpointe.js +56 -2
  268. package/src/endpoints/btrzpay/customerCards.js +52 -2
  269. package/src/endpoints/btrzpay/customers.js +39 -1
  270. package/src/endpoints/btrzpay/datalogic.js +59 -1
  271. package/src/endpoints/btrzpay/docs.js +11 -0
  272. package/src/endpoints/btrzpay/oxxo.js +58 -4
  273. package/src/endpoints/btrzpay/payment-methods.js +120 -9
  274. package/src/endpoints/btrzpay/payments.js +30 -6
  275. package/src/endpoints/btrzpay/prismaTerminals.js +130 -0
  276. package/src/endpoints/btrzpay/reference-numbers.js +20 -5
  277. package/src/endpoints/btrzpay/referenced-payments.js +38 -2
  278. package/src/endpoints/btrzpay/square.js +33 -1
  279. package/src/endpoints/btrzpay/stripe-terminals.js +32 -0
  280. package/src/endpoints/btrzpay/terminalPayments.js +53 -0
  281. package/src/endpoints/coltrane/docs.js +10 -0
  282. package/src/endpoints/coltrane/merged-fare-tables.js +18 -0
  283. package/src/endpoints/coltrane/paths.js +28 -0
  284. package/src/endpoints/endpoints_helpers.js +11 -1
  285. package/src/endpoints/gps/scanner-app-location.js +25 -1
  286. package/src/endpoints/inventory/amenities.js +60 -8
  287. package/src/endpoints/inventory/amenity-groups.js +61 -8
  288. package/src/endpoints/inventory/banks.js +52 -0
  289. package/src/endpoints/inventory/bare-routes.js +40 -1
  290. package/src/endpoints/inventory/brands.js +62 -10
  291. package/src/endpoints/inventory/bundle-fares.js +27 -4
  292. package/src/endpoints/inventory/bundles.js +37 -5
  293. package/src/endpoints/inventory/change-requests.js +89 -0
  294. package/src/endpoints/inventory/companies.js +27 -4
  295. package/src/endpoints/inventory/control-classes.js +84 -0
  296. package/src/endpoints/inventory/countries.js +31 -0
  297. package/src/endpoints/inventory/custom-content.js +63 -3
  298. package/src/endpoints/inventory/custom-fields.js +61 -1
  299. package/src/endpoints/inventory/docs.js +10 -0
  300. package/src/endpoints/inventory/document-types.js +62 -1
  301. package/src/endpoints/inventory/external-passes.js +39 -0
  302. package/src/endpoints/inventory/external-wallets.js +53 -0
  303. package/src/endpoints/inventory/fallback-codes.js +50 -0
  304. package/src/endpoints/inventory/fare-classes.js +50 -8
  305. package/src/endpoints/inventory/fares.js +86 -15
  306. package/src/endpoints/inventory/fees.js +62 -12
  307. package/src/endpoints/inventory/filtered-trips-v2.js +17 -2
  308. package/src/endpoints/inventory/filtered-trips.js +37 -0
  309. package/src/endpoints/inventory/financing-costs.js +67 -0
  310. package/src/endpoints/inventory/garages.js +61 -1
  311. package/src/endpoints/inventory/getnet-terminals.js +61 -0
  312. package/src/endpoints/inventory/gift-certificate-definitions.js +60 -0
  313. package/src/endpoints/inventory/healthcheck.js +11 -3
  314. package/src/endpoints/inventory/insurances.js +61 -2
  315. package/src/endpoints/inventory/insurancesCost.js +26 -1
  316. package/src/endpoints/inventory/items.js +75 -0
  317. package/src/endpoints/inventory/journey-prices.js +98 -12
  318. package/src/endpoints/inventory/labels.js +60 -0
  319. package/src/endpoints/inventory/marital-status.js +60 -1
  320. package/src/endpoints/inventory/marketplace-modifiers.js +65 -0
  321. package/src/endpoints/inventory/mit-terminal-settings.js +52 -0
  322. package/src/endpoints/inventory/mit-terminals.js +52 -0
  323. package/src/endpoints/inventory/operating-companies.js +101 -9
  324. package/src/endpoints/inventory/operation-messages.js +81 -9
  325. package/src/endpoints/inventory/operation-reasons.js +59 -0
  326. package/src/endpoints/inventory/parcel-zones.js +50 -11
  327. package/src/endpoints/inventory/pay-on-accounts.js +28 -0
  328. package/src/endpoints/inventory/payment-terminals.js +53 -4
  329. package/src/endpoints/inventory/prisma-terminals.js +62 -0
  330. package/src/endpoints/inventory/products.js +89 -0
  331. package/src/endpoints/inventory/promos.js +111 -1
  332. package/src/endpoints/inventory/routes.js +270 -0
  333. package/src/endpoints/inventory/schedule-groups.js +50 -0
  334. package/src/endpoints/inventory/schedules.js +124 -0
  335. package/src/endpoints/inventory/seatclasses.js +52 -0
  336. package/src/endpoints/inventory/seatfees.js +52 -3
  337. package/src/endpoints/inventory/seatmaps.js +111 -1
  338. package/src/endpoints/inventory/segments-information-tables.js +23 -0
  339. package/src/endpoints/inventory/segments-information.js +60 -0
  340. package/src/endpoints/inventory/service-numbers.js +55 -3
  341. package/src/endpoints/inventory/service-types.js +52 -3
  342. package/src/endpoints/inventory/ssrs.js +33 -7
  343. package/src/endpoints/inventory/station-classes.js +60 -0
  344. package/src/endpoints/inventory/station-groups.js +22 -0
  345. package/src/endpoints/inventory/stations-provinces.js +15 -0
  346. package/src/endpoints/inventory/stations-zones.js +22 -0
  347. package/src/endpoints/inventory/stations.js +71 -4
  348. package/src/endpoints/inventory/taxes.js +97 -2
  349. package/src/endpoints/inventory/travel-routes.js +52 -1
  350. package/src/endpoints/inventory/traveller-card-providers-types.js +15 -1
  351. package/src/endpoints/inventory/traveller-card-providers.js +45 -2
  352. package/src/endpoints/inventory/traveller-card-types.js +60 -1
  353. package/src/endpoints/inventory/trips.js +26 -3
  354. package/src/endpoints/inventory/vehicle-types.js +12 -6
  355. package/src/endpoints/inventory/vehicles.js +97 -1
  356. package/src/endpoints/inventory/zone-price-overages.js +51 -2
  357. package/src/endpoints/inventory/zone-prices.js +62 -2
  358. package/src/endpoints/invoices/dlink.js +36 -1
  359. package/src/endpoints/invoices/docs.js +10 -0
  360. package/src/endpoints/invoices/emails.js +18 -1
  361. package/src/endpoints/invoices/gti.js +35 -1
  362. package/src/endpoints/invoices/infile.js +35 -1
  363. package/src/endpoints/invoices/infileJson.js +35 -1
  364. package/src/endpoints/invoices/invoices.js +66 -1
  365. package/src/endpoints/invoices/pdfs.js +25 -1
  366. package/src/endpoints/invoices/providers.js +65 -1
  367. package/src/endpoints/invoices/providersSequences.js +59 -1
  368. package/src/endpoints/invoices/system.js +35 -1
  369. package/src/endpoints/invoices/tax-ids.js +27 -1
  370. package/src/endpoints/loyalty/movements.js +52 -6
  371. package/src/endpoints/loyalty/programs.js +49 -9
  372. package/src/endpoints/notifications/customers.js +51 -1
  373. package/src/endpoints/notifications/email.js +27 -1
  374. package/src/endpoints/notifications/manifest-notifications.js +32 -1
  375. package/src/endpoints/notifications/notify.js +69 -0
  376. package/src/endpoints/notifications/orders-rules-validations.js +17 -1
  377. package/src/endpoints/notifications/pdf-data.js +60 -5
  378. package/src/endpoints/notifications/pdfs.js +26 -0
  379. package/src/endpoints/notifications/printed-tickets.js +32 -3
  380. package/src/endpoints/notifications/salesforce.js +17 -2
  381. package/src/endpoints/notifications/twilio.js +44 -2
  382. package/src/endpoints/operations/accounting_items.js +33 -0
  383. package/src/endpoints/operations/applied_insurance.js +28 -6
  384. package/src/endpoints/operations/calendar_entries.js +28 -5
  385. package/src/endpoints/operations/docs.js +12 -1
  386. package/src/endpoints/operations/external-bookings.js +25 -0
  387. package/src/endpoints/operations/flexpasses.js +18 -1
  388. package/src/endpoints/operations/loans.js +35 -1
  389. package/src/endpoints/operations/manifest.js +372 -0
  390. package/src/endpoints/operations/manifest_leg_for_tickets.js +20 -5
  391. package/src/endpoints/operations/movements.js +20 -5
  392. package/src/endpoints/operations/outlook-trips.js +34 -3
  393. package/src/endpoints/operations/parcels.js +82 -7
  394. package/src/endpoints/operations/parcels_manifests.js +81 -0
  395. package/src/endpoints/operations/passenger_check_in_info.js +53 -1
  396. package/src/endpoints/operations/redemption.js +36 -1
  397. package/src/endpoints/operations/rms.js +58 -0
  398. package/src/endpoints/operations/scheduled_notifications.js +65 -6
  399. package/src/endpoints/operations/segments.js +27 -4
  400. package/src/endpoints/operations/sold-items-fulfillment.js +22 -0
  401. package/src/endpoints/operations/sold-items.js +40 -0
  402. package/src/endpoints/operations/tickets.js +72 -0
  403. package/src/endpoints/operations/transaction.js +22 -6
  404. package/src/endpoints/operations/transactions.js +115 -0
  405. package/src/endpoints/operations/transport_regulations.js +17 -1
  406. package/src/endpoints/operations/trip_change_info.js +32 -4
  407. package/src/endpoints/operations/vehicle_assignments.js +54 -0
  408. package/src/endpoints/operations/vouchers.js +26 -0
  409. package/src/endpoints/operations/waitlists.js +58 -5
  410. package/src/endpoints/ratality/auth.js +14 -0
  411. package/src/endpoints/ratality/clients.js +23 -0
  412. package/src/endpoints/ratality/integrations.js +31 -0
  413. package/src/endpoints/reports/custom-reports.js +47 -5
  414. package/src/endpoints/reports/email.js +17 -0
  415. package/src/endpoints/reports/report-types.js +31 -5
  416. package/src/endpoints/reports/trip-manifests.js +27 -3
  417. package/src/endpoints/sales/bundles.js +26 -4
  418. package/src/endpoints/sales/cancellations.js +2 -2
  419. package/src/endpoints/sales/cart-promo.js +33 -8
  420. package/src/endpoints/sales/cart.js +163 -0
  421. package/src/endpoints/sales/check-in-info.js +22 -5
  422. package/src/endpoints/sales/custom-fields.js +25 -4
  423. package/src/endpoints/sales/docs.js +10 -0
  424. package/src/endpoints/sales/flexpasses.js +18 -1
  425. package/src/endpoints/sales/gift-certificates.js +25 -1
  426. package/src/endpoints/sales/order.js +50 -0
  427. package/src/endpoints/sales/parcel-quotes.js +18 -1
  428. package/src/endpoints/sales/payment-providers.js +29 -6
  429. package/src/endpoints/sales/redeemable-items.js +44 -3
  430. package/src/endpoints/sales/sync-entry.js +20 -5
  431. package/src/endpoints/sales/voucher.js +42 -1
  432. package/src/endpoints/seatmaps/access-ticket.js +20 -6
  433. package/src/endpoints/seatmaps/seat.js +20 -5
  434. package/src/endpoints/uploads/files.js +21 -5
  435. package/src/endpoints/uploads/images.js +21 -7
  436. package/src/endpoints/webhooks/events.js +28 -6
  437. package/src/endpoints/webhooks/subscriptions.js +73 -15
  438. package/src/endpoints/webhooks/undelivered.js +92 -17
  439. package/src/endpoints/webhooks/webhooks.js +21 -7
  440. package/src/productionDefaults.js +10 -2
  441. package/types/client.d.ts +46 -5670
  442. package/types/constants.d.ts +8 -1
  443. package/types/endpoints/accounts/accounts.d.ts +13 -14
  444. package/types/endpoints/accounts/application-settings.d.ts +16 -34
  445. package/types/endpoints/accounts/application.d.ts +12 -7
  446. package/types/endpoints/accounts/applications.d.ts +13 -14
  447. package/types/endpoints/accounts/current-shifts.d.ts +12 -8
  448. package/types/endpoints/accounts/customers.d.ts +18 -48
  449. package/types/endpoints/accounts/docs.d.ts +8 -2
  450. package/types/endpoints/accounts/domains.d.ts +14 -19
  451. package/types/endpoints/accounts/dynamic-forms.d.ts +21 -62
  452. package/types/endpoints/accounts/email-settings.d.ts +16 -34
  453. package/types/endpoints/accounts/email-templates.d.ts +127 -54
  454. package/types/endpoints/accounts/exchange-rates.d.ts +13 -15
  455. package/types/endpoints/accounts/exchange-receipts.d.ts +13 -13
  456. package/types/endpoints/accounts/goal-settings.d.ts +13 -14
  457. package/types/endpoints/accounts/images.d.ts +15 -27
  458. package/types/endpoints/accounts/interline.d.ts +16 -64
  459. package/types/endpoints/accounts/journey-prices-settings.d.ts +13 -13
  460. package/types/endpoints/accounts/lexicons.d.ts +21 -136
  461. package/types/endpoints/accounts/market-pricing-settings.d.ts +13 -13
  462. package/types/endpoints/accounts/multiproduct-sales-settings.d.ts +13 -13
  463. package/types/endpoints/accounts/network.d.ts +17 -40
  464. package/types/endpoints/accounts/operation-settings.d.ts +13 -14
  465. package/types/endpoints/accounts/people-lookups.d.ts +16 -38
  466. package/types/endpoints/accounts/point-to-point-settings.d.ts +13 -13
  467. package/types/endpoints/accounts/print-settings.d.ts +13 -13
  468. package/types/endpoints/accounts/print-templates.d.ts +17 -41
  469. package/types/endpoints/accounts/printers.d.ts +12 -7
  470. package/types/endpoints/accounts/rms-settings.d.ts +13 -13
  471. package/types/endpoints/accounts/s3buckets.d.ts +14 -21
  472. package/types/endpoints/accounts/salesforce-settings.d.ts +13 -14
  473. package/types/endpoints/accounts/shift-settings.d.ts +13 -14
  474. package/types/endpoints/accounts/shifts.d.ts +34 -227
  475. package/types/endpoints/accounts/sms-templates.d.ts +19 -54
  476. package/types/endpoints/accounts/sub-print-templates.d.ts +12 -8
  477. package/types/endpoints/accounts/ticket-movement-settings.d.ts +13 -13
  478. package/types/endpoints/accounts/tokens.d.ts +13 -14
  479. package/types/endpoints/accounts/transport-regulation-settings.d.ts +13 -13
  480. package/types/endpoints/accounts/travellers.d.ts +16 -37
  481. package/types/endpoints/accounts/trusted-machines.d.ts +14 -20
  482. package/types/endpoints/accounts/twilio-settings.d.ts +13 -14
  483. package/types/endpoints/accounts/users.d.ts +27 -99
  484. package/types/endpoints/accounts/websales-config.d.ts +13 -15
  485. package/types/endpoints/btrzpay/cardpointe.d.ts +15 -36
  486. package/types/endpoints/btrzpay/customerCards.d.ts +15 -33
  487. package/types/endpoints/btrzpay/customers.d.ts +14 -23
  488. package/types/endpoints/btrzpay/datalogic.d.ts +27 -44
  489. package/types/endpoints/btrzpay/docs.d.ts +12 -2
  490. package/types/endpoints/btrzpay/oxxo.d.ts +41 -38
  491. package/types/endpoints/btrzpay/payment-methods.d.ts +29 -58
  492. package/types/endpoints/btrzpay/payments.d.ts +13 -14
  493. package/types/endpoints/btrzpay/prismaTerminals.d.ts +31 -98
  494. package/types/endpoints/btrzpay/reference-numbers.d.ts +12 -8
  495. package/types/endpoints/btrzpay/referenced-payments.d.ts +13 -17
  496. package/types/endpoints/btrzpay/square.d.ts +24 -16
  497. package/types/endpoints/btrzpay/stripe-terminals.d.ts +26 -16
  498. package/types/endpoints/btrzpay/terminalPayments.d.ts +26 -28
  499. package/types/endpoints/coltrane/docs.d.ts +8 -2
  500. package/types/endpoints/coltrane/merged-fare-tables.d.ts +12 -9
  501. package/types/endpoints/coltrane/paths.d.ts +44 -7
  502. package/types/endpoints/endpoints_helpers.d.ts +16 -9
  503. package/types/endpoints/gps/scanner-app-location.d.ts +44 -6
  504. package/types/endpoints/inventory/amenities.d.ts +28 -26
  505. package/types/endpoints/inventory/amenity-groups.d.ts +28 -26
  506. package/types/endpoints/inventory/banks.d.ts +29 -33
  507. package/types/endpoints/inventory/bare-routes.d.ts +26 -13
  508. package/types/endpoints/inventory/brands.d.ts +28 -27
  509. package/types/endpoints/inventory/bundle-fares.d.ts +25 -9
  510. package/types/endpoints/inventory/bundles.d.ts +26 -14
  511. package/types/endpoints/inventory/change-requests.d.ts +16 -50
  512. package/types/endpoints/inventory/companies.d.ts +23 -8
  513. package/types/endpoints/inventory/control-classes.d.ts +16 -34
  514. package/types/endpoints/inventory/countries.d.ts +13 -14
  515. package/types/endpoints/inventory/custom-content.d.ts +27 -31
  516. package/types/endpoints/inventory/custom-fields.d.ts +27 -33
  517. package/types/endpoints/inventory/docs.d.ts +8 -2
  518. package/types/endpoints/inventory/document-types.d.ts +29 -39
  519. package/types/endpoints/inventory/external-passes.d.ts +26 -14
  520. package/types/endpoints/inventory/external-wallets.d.ts +12 -36
  521. package/types/endpoints/inventory/fallback-codes.d.ts +15 -26
  522. package/types/endpoints/inventory/fare-classes.d.ts +25 -21
  523. package/types/endpoints/inventory/fares.d.ts +28 -39
  524. package/types/endpoints/inventory/fees.d.ts +26 -26
  525. package/types/endpoints/inventory/filtered-trips-v2.d.ts +12 -8
  526. package/types/endpoints/inventory/filtered-trips.d.ts +13 -14
  527. package/types/endpoints/inventory/financing-costs.d.ts +29 -35
  528. package/types/endpoints/inventory/garages.d.ts +29 -33
  529. package/types/endpoints/inventory/getnet-terminals.d.ts +16 -33
  530. package/types/endpoints/inventory/gift-certificate-definitions.d.ts +27 -36
  531. package/types/endpoints/inventory/healthcheck.d.ts +9 -4
  532. package/types/endpoints/inventory/insurances.d.ts +27 -31
  533. package/types/endpoints/inventory/insurancesCost.d.ts +23 -9
  534. package/types/endpoints/inventory/items.d.ts +16 -38
  535. package/types/endpoints/inventory/journey-prices.d.ts +27 -34
  536. package/types/endpoints/inventory/labels.d.ts +29 -34
  537. package/types/endpoints/inventory/marital-status.d.ts +27 -37
  538. package/types/endpoints/inventory/marketplace-modifiers.d.ts +27 -31
  539. package/types/endpoints/inventory/mit-terminal-settings.d.ts +29 -33
  540. package/types/endpoints/inventory/mit-terminals.d.ts +29 -31
  541. package/types/endpoints/inventory/operating-companies.d.ts +29 -57
  542. package/types/endpoints/inventory/operation-messages.d.ts +28 -37
  543. package/types/endpoints/inventory/operation-reasons.d.ts +16 -37
  544. package/types/endpoints/inventory/parcel-zones.d.ts +25 -20
  545. package/types/endpoints/inventory/pay-on-accounts.d.ts +25 -9
  546. package/types/endpoints/inventory/payment-terminals.d.ts +27 -31
  547. package/types/endpoints/inventory/prisma-terminals.d.ts +29 -33
  548. package/types/endpoints/inventory/products.d.ts +17 -42
  549. package/types/endpoints/inventory/promos.d.ts +30 -54
  550. package/types/endpoints/inventory/routes.d.ts +24 -174
  551. package/types/endpoints/inventory/schedule-groups.d.ts +28 -28
  552. package/types/endpoints/inventory/schedules.d.ts +18 -75
  553. package/types/endpoints/inventory/seatclasses.d.ts +27 -37
  554. package/types/endpoints/inventory/seatfees.d.ts +26 -25
  555. package/types/endpoints/inventory/seatmaps.d.ts +31 -49
  556. package/types/endpoints/inventory/segments-information-tables.d.ts +25 -9
  557. package/types/endpoints/inventory/segments-information.d.ts +29 -33
  558. package/types/endpoints/inventory/service-numbers.d.ts +26 -27
  559. package/types/endpoints/inventory/service-types.d.ts +27 -31
  560. package/types/endpoints/inventory/ssrs.d.ts +23 -7
  561. package/types/endpoints/inventory/station-classes.d.ts +16 -34
  562. package/types/endpoints/inventory/station-groups.d.ts +25 -7
  563. package/types/endpoints/inventory/stations-provinces.d.ts +25 -7
  564. package/types/endpoints/inventory/stations-zones.d.ts +25 -7
  565. package/types/endpoints/inventory/stations.d.ts +28 -25
  566. package/types/endpoints/inventory/taxes.d.ts +29 -59
  567. package/types/endpoints/inventory/travel-routes.d.ts +28 -27
  568. package/types/endpoints/inventory/traveller-card-providers-types.d.ts +23 -7
  569. package/types/endpoints/inventory/traveller-card-providers.d.ts +26 -27
  570. package/types/endpoints/inventory/traveller-card-types.d.ts +27 -33
  571. package/types/endpoints/inventory/trips.d.ts +24 -13
  572. package/types/endpoints/inventory/vehicle-types.d.ts +12 -14
  573. package/types/endpoints/inventory/vehicles.d.ts +30 -49
  574. package/types/endpoints/inventory/zone-price-overages.d.ts +27 -31
  575. package/types/endpoints/inventory/zone-prices.d.ts +27 -31
  576. package/types/endpoints/invoices/dlink.d.ts +30 -16
  577. package/types/endpoints/invoices/docs.d.ts +8 -2
  578. package/types/endpoints/invoices/emails.d.ts +23 -9
  579. package/types/endpoints/invoices/gti.d.ts +30 -16
  580. package/types/endpoints/invoices/infile.d.ts +30 -16
  581. package/types/endpoints/invoices/infileJson.d.ts +30 -16
  582. package/types/endpoints/invoices/invoices.d.ts +27 -35
  583. package/types/endpoints/invoices/pdfs.d.ts +23 -9
  584. package/types/endpoints/invoices/providers.d.ts +27 -37
  585. package/types/endpoints/invoices/providersSequences.d.ts +27 -42
  586. package/types/endpoints/invoices/system.d.ts +30 -16
  587. package/types/endpoints/invoices/tax-ids.d.ts +44 -8
  588. package/types/endpoints/loyalty/movements.d.ts +36 -27
  589. package/types/endpoints/loyalty/programs.d.ts +36 -21
  590. package/types/endpoints/notifications/customers.d.ts +24 -14
  591. package/types/endpoints/notifications/email.d.ts +23 -8
  592. package/types/endpoints/notifications/manifest-notifications.d.ts +24 -14
  593. package/types/endpoints/notifications/notify.d.ts +26 -31
  594. package/types/endpoints/notifications/orders-rules-validations.d.ts +23 -9
  595. package/types/endpoints/notifications/pdf-data.d.ts +30 -9
  596. package/types/endpoints/notifications/pdfs.d.ts +30 -10
  597. package/types/endpoints/notifications/printed-tickets.d.ts +12 -11
  598. package/types/endpoints/notifications/salesforce.d.ts +12 -8
  599. package/types/endpoints/notifications/twilio.d.ts +26 -27
  600. package/types/endpoints/operations/accounting_items.d.ts +24 -13
  601. package/types/endpoints/operations/applied_insurance.d.ts +12 -10
  602. package/types/endpoints/operations/calendar_entries.d.ts +24 -8
  603. package/types/endpoints/operations/docs.d.ts +13 -5
  604. package/types/endpoints/operations/external-bookings.d.ts +24 -16
  605. package/types/endpoints/operations/flexpasses.d.ts +12 -11
  606. package/types/endpoints/operations/loans.d.ts +24 -13
  607. package/types/endpoints/operations/manifest.d.ts +23 -240
  608. package/types/endpoints/operations/manifest_leg_for_tickets.d.ts +12 -11
  609. package/types/endpoints/operations/movements.d.ts +24 -10
  610. package/types/endpoints/operations/outlook-trips.d.ts +25 -8
  611. package/types/endpoints/operations/parcels.d.ts +24 -38
  612. package/types/endpoints/operations/parcels_manifests.d.ts +72 -48
  613. package/types/endpoints/operations/passenger_check_in_info.d.ts +46 -30
  614. package/types/endpoints/operations/redemption.d.ts +12 -23
  615. package/types/endpoints/operations/rms.d.ts +23 -17
  616. package/types/endpoints/operations/scheduled_notifications.d.ts +36 -36
  617. package/types/endpoints/operations/segments.d.ts +28 -11
  618. package/types/endpoints/operations/sold-items-fulfillment.d.ts +24 -9
  619. package/types/endpoints/operations/sold-items.d.ts +24 -16
  620. package/types/endpoints/operations/tickets.d.ts +24 -45
  621. package/types/endpoints/operations/transaction.d.ts +12 -11
  622. package/types/endpoints/operations/transactions.d.ts +23 -85
  623. package/types/endpoints/operations/transport_regulations.d.ts +11 -11
  624. package/types/endpoints/operations/trip_change_info.d.ts +12 -11
  625. package/types/endpoints/operations/vehicle_assignments.d.ts +24 -28
  626. package/types/endpoints/operations/vouchers.d.ts +23 -18
  627. package/types/endpoints/operations/waitlists.d.ts +43 -27
  628. package/types/endpoints/ratality/auth.d.ts +12 -5
  629. package/types/endpoints/ratality/clients.d.ts +15 -11
  630. package/types/endpoints/ratality/integrations.d.ts +16 -16
  631. package/types/endpoints/reports/custom-reports.d.ts +36 -20
  632. package/types/endpoints/reports/email.d.ts +12 -8
  633. package/types/endpoints/reports/report-types.d.ts +13 -14
  634. package/types/endpoints/reports/trip-manifests.d.ts +34 -8
  635. package/types/endpoints/sales/bundles.d.ts +25 -7
  636. package/types/endpoints/sales/cart-promo.d.ts +26 -16
  637. package/types/endpoints/sales/cart.d.ts +36 -107
  638. package/types/endpoints/sales/check-in-info.d.ts +25 -9
  639. package/types/endpoints/sales/custom-fields.d.ts +25 -7
  640. package/types/endpoints/sales/docs.d.ts +8 -2
  641. package/types/endpoints/sales/flexpasses.d.ts +25 -9
  642. package/types/endpoints/sales/gift-certificates.d.ts +25 -8
  643. package/types/endpoints/sales/order.d.ts +42 -22
  644. package/types/endpoints/sales/parcel-quotes.d.ts +12 -8
  645. package/types/endpoints/sales/payment-providers.d.ts +25 -8
  646. package/types/endpoints/sales/redeemable-items.d.ts +26 -14
  647. package/types/endpoints/sales/sync-entry.d.ts +12 -8
  648. package/types/endpoints/sales/voucher.d.ts +103 -7
  649. package/types/endpoints/seatmaps/access-ticket.d.ts +12 -7
  650. package/types/endpoints/seatmaps/seat.d.ts +12 -8
  651. package/types/endpoints/uploads/files.d.ts +12 -8
  652. package/types/endpoints/uploads/images.d.ts +12 -8
  653. package/types/endpoints/webhooks/events.d.ts +29 -9
  654. package/types/endpoints/webhooks/subscriptions.d.ts +33 -34
  655. package/types/endpoints/webhooks/undelivered.d.ts +35 -43
  656. package/types/endpoints/webhooks/webhooks.d.ts +12 -8
  657. package/types/initializedClient.d.ts +15 -5670
  658. package/types/productionDefaults.d.ts +9 -6
package/src/client.js CHANGED
@@ -38,6 +38,21 @@ function clientFactory(opts) {
38
38
 
39
39
  /** MODULES */
40
40
 
41
+ /**
42
+ * @typedef {Object} CreateModuleOptions
43
+ * @property {string} [baseURL] - Base URL for the HTTP client
44
+ * @property {Object} [headers] - Optional headers (e.g. x-amzn-trace-id)
45
+ * @property {number} [timeout] - Request timeout in ms
46
+ * @property {function(string): string} [overrideFn] - Optional function to override baseURL per request
47
+ * @property {{ getToken: function(): string }} [internalAuthTokenProvider] - Provider for service-to-service auth token
48
+ * @property {{ httpAgent?: import("http").Agent, httpsAgent?: import("https").Agent }} [agents] - Optional HTTP/HTTPS agents
49
+ */
50
+
51
+ /**
52
+ * Creates the inventory API client with all inventory endpoint namespaces (amenities, banks, routes, products, etc.).
53
+ * @param {CreateModuleOptions} opts - Client options
54
+ * @returns {Object} Object with inventory endpoint namespaces and __test.client
55
+ */
41
56
  function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
42
57
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
43
58
 
@@ -118,6 +133,11 @@ function createInventory({baseURL, headers, timeout, overrideFn, internalAuthTok
118
133
  };
119
134
  }
120
135
 
136
+ /**
137
+ * Creates the trips API client (trips, segmentsInformationTables). Uses inventory base path.
138
+ * @param {CreateModuleOptions} opts - Client options
139
+ * @returns {Object} Object with trips and segmentsInformationTables endpoint namespaces and __test_trips.client
140
+ */
121
141
  function createTrips({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
122
142
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
123
143
 
@@ -130,6 +150,11 @@ function createTrips({baseURL, headers, timeout, overrideFn, internalAuthTokenPr
130
150
  };
131
151
  }
132
152
 
153
+ /**
154
+ * Creates the Coltrane API client (docs, paths, mergedFareTables).
155
+ * @param {CreateModuleOptions} opts - Client options
156
+ * @returns {Object} Object with coltrane endpoint namespaces and __test.client
157
+ */
133
158
  function createColtrane({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
134
159
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
135
160
 
@@ -143,6 +168,11 @@ function createColtrane({baseURL, headers, timeout, overrideFn, internalAuthToke
143
168
  };
144
169
  }
145
170
 
171
+ /**
172
+ * Creates the accounts API client (accounts, emailTemplates, users, lexicons, shifts, etc.).
173
+ * @param {CreateModuleOptions} opts - Client options
174
+ * @returns {Object} Object with accounts endpoint namespaces and __test.client
175
+ */
146
176
  function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
147
177
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
148
178
 
@@ -212,6 +242,11 @@ function createAccounts({baseURL, headers, timeout, overrideFn, internalAuthToke
212
242
  };
213
243
  }
214
244
 
245
+ /**
246
+ * Creates the sales API client (cart, order, cancellations, parcelQuotes, etc.).
247
+ * @param {CreateModuleOptions} opts - Client options
248
+ * @returns {Object} Object with sales endpoint namespaces and __test.client
249
+ */
215
250
  function createSales({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
216
251
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
217
252
 
@@ -237,6 +272,11 @@ function createSales({baseURL, headers, timeout, overrideFn, internalAuthTokenPr
237
272
  };
238
273
  }
239
274
 
275
+ /**
276
+ * Creates the operations API client (manifest, tickets, transactions, vouchers, parcels, etc.).
277
+ * @param {CreateModuleOptions} opts - Client options
278
+ * @returns {Object} Object with operations endpoint namespaces and __test.client
279
+ */
240
280
  function createOperations({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
241
281
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
242
282
 
@@ -275,6 +315,11 @@ function createOperations({baseURL, headers, timeout, overrideFn, internalAuthTo
275
315
  };
276
316
  }
277
317
 
318
+ /**
319
+ * Creates the reports API client (reportTypes, customReports, reportEmail, tripManifests).
320
+ * @param {CreateModuleOptions} opts - Client options
321
+ * @returns {Object} Object with reports endpoint namespaces and __test.client
322
+ */
278
323
  function createReports({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
279
324
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
280
325
 
@@ -290,6 +335,11 @@ function createReports({baseURL, headers, timeout, overrideFn, internalAuthToken
290
335
  };
291
336
  }
292
337
 
338
+ /**
339
+ * Creates the notifications API client (pdfs, pdfData, email, twilio, notify, etc.).
340
+ * @param {CreateModuleOptions} opts - Client options
341
+ * @returns {Object} Object with notifications endpoint namespaces and __test.client
342
+ */
293
343
  function createNotifications({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
294
344
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
295
345
 
@@ -310,6 +360,11 @@ function createNotifications({baseURL, headers, timeout, overrideFn, internalAut
310
360
  };
311
361
  }
312
362
 
363
+ /**
364
+ * Creates the uploads API client (files, images).
365
+ * @param {CreateModuleOptions} opts - Client options
366
+ * @returns {Object} Object with uploads endpoint namespaces and __test.client
367
+ */
313
368
  function createUploads({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
314
369
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
315
370
 
@@ -322,6 +377,11 @@ function createUploads({baseURL, headers, timeout, overrideFn, internalAuthToken
322
377
  };
323
378
  }
324
379
 
380
+ /**
381
+ * Creates the loyalty API client (programs, movements).
382
+ * @param {CreateModuleOptions} opts - Client options
383
+ * @returns {Object} Object with loyalty endpoint namespaces and __test.client
384
+ */
325
385
  function createLoyalty({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
326
386
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
327
387
 
@@ -334,6 +394,11 @@ function createLoyalty({baseURL, headers, timeout, overrideFn, internalAuthToken
334
394
  };
335
395
  }
336
396
 
397
+ /**
398
+ * Creates the webhooks API client (subscriptions, events, undelivered, webhooks).
399
+ * @param {CreateModuleOptions} opts - Client options
400
+ * @returns {Object} Object with webhooks endpoint namespaces and __test.client
401
+ */
337
402
  function createWebhooks({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
338
403
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
339
404
 
@@ -348,6 +413,11 @@ function createWebhooks({baseURL, headers, timeout, overrideFn, internalAuthToke
348
413
  };
349
414
  }
350
415
 
416
+ /**
417
+ * Creates the seatmaps API client (accessTicket, seat).
418
+ * @param {CreateModuleOptions} opts - Client options
419
+ * @returns {Object} Object with seatmaps endpoint namespaces and __test.client
420
+ */
351
421
  function createSeatmaps({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
352
422
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
353
423
 
@@ -360,6 +430,11 @@ function createSeatmaps({baseURL, headers, timeout, overrideFn, internalAuthToke
360
430
  };
361
431
  }
362
432
 
433
+ /**
434
+ * Creates the BtrzPay API client (paymentMethods, terminals, payments, oxxo, etc.).
435
+ * @param {CreateModuleOptions} opts - Client options
436
+ * @returns {Object} Object with btrzpay endpoint namespaces and __test.client
437
+ */
363
438
  function createBtrzPay({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
364
439
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
365
440
 
@@ -385,6 +460,11 @@ function createBtrzPay({baseURL, headers, timeout, overrideFn, internalAuthToken
385
460
  };
386
461
  }
387
462
 
463
+ /**
464
+ * Creates the invoices API client (providers, infile, system, invoices, etc.).
465
+ * @param {CreateModuleOptions} opts - Client options
466
+ * @returns {Object} Object with invoices endpoint namespaces and __test.client
467
+ */
388
468
  function createInvoices({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
389
469
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
390
470
 
@@ -407,6 +487,11 @@ function createInvoices({baseURL, headers, timeout, overrideFn, internalAuthToke
407
487
  };
408
488
  }
409
489
 
490
+ /**
491
+ * Creates the GPS API client (scannerAppLocation).
492
+ * @param {CreateModuleOptions} opts - Client options
493
+ * @returns {Object} Object with gps endpoint namespaces and __test.client
494
+ */
410
495
  function createGPS({baseURL, headers, timeout, overrideFn, internalAuthTokenProvider, agents}) {
411
496
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
412
497
 
@@ -418,6 +503,11 @@ function createGPS({baseURL, headers, timeout, overrideFn, internalAuthTokenProv
418
503
  };
419
504
  }
420
505
 
506
+ /**
507
+ * Creates the Ratality API client (auth, clients, integrations). Does not use internalAuthTokenProvider.
508
+ * @param {Omit<CreateModuleOptions, "internalAuthTokenProvider">} opts - Client options (no internalAuthTokenProvider)
509
+ * @returns {Object} Object with ratality endpoint namespaces and __test.client
510
+ */
421
511
  function createRatality({baseURL, headers, timeout, overrideFn, agents}) {
422
512
  const client = clientFactory({baseURL, headers, timeout, overrideFn, agents});
423
513
  const version = "v2";
package/src/constants.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Shared constants for the API client.
3
+ * @type {{ INTERNAL_AUTH_TOKEN_SYMBOL: string }}
4
+ */
1
5
  const constants = {
2
6
  INTERNAL_AUTH_TOKEN_SYMBOL: "internal_auth_token"
3
7
  };
@@ -1,8 +1,23 @@
1
1
  const {
2
2
  authorizationHeaders
3
- } = require("./../endpoints_helpers");
3
+ } = require("./../endpoints_helpers.js");
4
4
 
5
+ /**
6
+ * Factory for accounts API (btrz-api-accounts).
7
+ * @param {Object} deps
8
+ * @param {import("axios").AxiosInstance} deps.client
9
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
10
+ * @returns {{ get: function, defaultUsers: { create: function } }}
11
+ */
5
12
  function accountsFactory({client, internalAuthTokenProvider}) {
13
+ /**
14
+ * GET /accounts/:accountId - get an account by id.
15
+ * @param {Object} opts
16
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
17
+ * @param {string} opts.accountId - Account id (ObjectId)
18
+ * @param {Object} [opts.headers] - Optional headers
19
+ * @returns {Promise<import("axios").AxiosResponse>}
20
+ */
6
21
  function get({jwtToken, accountId, headers}) {
7
22
  return client({
8
23
  url: `/accounts/${accountId}`,
@@ -11,6 +26,16 @@ function accountsFactory({client, internalAuthTokenProvider}) {
11
26
  }
12
27
 
13
28
  const defaultUsers = {
29
+ /**
30
+ * POST /accounts/:accountId/default-users - create default users for account.
31
+ * @param {Object} opts
32
+ * @param {string} [opts.token] - API key
33
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
34
+ * @param {string} opts.accountId - Account id (ObjectId)
35
+ * @param {Object} opts.data - Default users payload
36
+ * @param {Object} [opts.headers] - Optional headers
37
+ * @returns {Promise<import("axios").AxiosResponse>}
38
+ */
14
39
  create({token, jwtToken, accountId, data, headers}) {
15
40
  return client({
16
41
  url: `/accounts/${accountId}/default-users`,
@@ -1,6 +1,28 @@
1
- const {authorizationHeaders} = require("./../endpoints_helpers");
1
+ const {authorizationHeaders} = require("./../endpoints_helpers.js");
2
2
 
3
+ /**
4
+ * @typedef {Object} ApplicationSettingsQuery
5
+ * @property {string} [name] - The application name
6
+ */
7
+
8
+ /**
9
+ * Factory for application-settings API (btrz-api-accounts).
10
+ * @param {Object} deps
11
+ * @param {import("axios").AxiosInstance} deps.client
12
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
13
+ * @returns {{ get: function, update: function, remove: function, regenerateKeys: function, create: function }}
14
+ */
3
15
  function applicationSettingsFactory({client, internalAuthTokenProvider}) {
16
+ /**
17
+ * GET /application-settings/:providerId - get application settings for provider.
18
+ * @param {Object} opts
19
+ * @param {string} [opts.token] - API key
20
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
21
+ * @param {string} opts.providerId - Provider id (ObjectId)
22
+ * @param {ApplicationSettingsQuery} [opts.query] - Query params
23
+ * @param {Object} [opts.headers] - Optional headers
24
+ * @returns {Promise<import("axios").AxiosResponse>}
25
+ */
4
26
  function get({token, providerId, jwtToken, query = {}, headers}) {
5
27
  return client.get(`/application-settings/${providerId}`, {
6
28
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
@@ -8,6 +30,16 @@ function applicationSettingsFactory({client, internalAuthTokenProvider}) {
8
30
  });
9
31
  }
10
32
 
33
+ /**
34
+ * PUT /application-settings/:id - update application settings.
35
+ * @param {Object} opts
36
+ * @param {string} [opts.token] - API key
37
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
38
+ * @param {string} opts.id - Application settings id (ObjectId)
39
+ * @param {Object} opts.application - Application payload
40
+ * @param {Object} [opts.headers] - Optional headers
41
+ * @returns {Promise<import("axios").AxiosResponse>}
42
+ */
11
43
  function update({jwtToken, token, id, application, headers}) {
12
44
  return client({
13
45
  url: `/application-settings/${id}`,
@@ -17,6 +49,15 @@ function applicationSettingsFactory({client, internalAuthTokenProvider}) {
17
49
  });
18
50
  }
19
51
 
52
+ /**
53
+ * DELETE /application-settings/:id - remove application settings.
54
+ * @param {Object} opts
55
+ * @param {string} [opts.token] - API key
56
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
57
+ * @param {string} opts.id - Application settings id (ObjectId)
58
+ * @param {Object} [opts.headers] - Optional headers
59
+ * @returns {Promise<import("axios").AxiosResponse>}
60
+ */
20
61
  function remove({jwtToken, token, id, headers}) {
21
62
  return client({
22
63
  url: `/application-settings/${id}`,
@@ -25,6 +66,15 @@ function applicationSettingsFactory({client, internalAuthTokenProvider}) {
25
66
  });
26
67
  }
27
68
 
69
+ /**
70
+ * POST /application-settings/:id/keys - regenerate application keys.
71
+ * @param {Object} opts
72
+ * @param {string} [opts.token] - API key
73
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
74
+ * @param {string} opts.id - Application settings id (ObjectId)
75
+ * @param {Object} [opts.headers] - Optional headers
76
+ * @returns {Promise<import("axios").AxiosResponse>}
77
+ */
28
78
  function regenerateKeys({jwtToken, token, id, headers}) {
29
79
  return client({
30
80
  url: `/application-settings/${id}/keys`,
@@ -33,6 +83,15 @@ function applicationSettingsFactory({client, internalAuthTokenProvider}) {
33
83
  });
34
84
  }
35
85
 
86
+ /**
87
+ * POST /application-settings - create application settings.
88
+ * @param {Object} opts
89
+ * @param {string} [opts.token] - API key
90
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
91
+ * @param {Object} opts.application - Application payload
92
+ * @param {Object} [opts.headers] - Optional headers
93
+ * @returns {Promise<import("axios").AxiosResponse>}
94
+ */
36
95
  function create({jwtToken, token, application, headers}) {
37
96
  return client({
38
97
  url: "/application-settings",
@@ -1,6 +1,21 @@
1
- const {authorizationHeaders} = require("./../endpoints_helpers");
1
+ const {authorizationHeaders} = require("./../endpoints_helpers.js");
2
2
 
3
+ /**
4
+ * Factory for current application (single) API (btrz-api-accounts).
5
+ * @param {Object} deps
6
+ * @param {import("axios").AxiosInstance} deps.client
7
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
8
+ * @returns {{ get: function }}
9
+ */
3
10
  function applicationsFactory({client, internalAuthTokenProvider}) {
11
+ /**
12
+ * GET /application - get current application.
13
+ * @param {Object} opts
14
+ * @param {string} [opts.token] - API key
15
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
16
+ * @param {Object} [opts.headers] - Optional headers
17
+ * @returns {Promise<import("axios").AxiosResponse>}
18
+ */
4
19
  function get({token, jwtToken, headers}) {
5
20
  return client.get("/application", {
6
21
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
@@ -12,4 +27,4 @@ function applicationsFactory({client, internalAuthTokenProvider}) {
12
27
  };
13
28
  }
14
29
 
15
- module.exports = applicationsFactory;
30
+ module.exports = applicationsFactory;
@@ -1,11 +1,36 @@
1
- const {authorizationHeaders} = require("./../endpoints_helpers");
1
+ const {authorizationHeaders} = require("./../endpoints_helpers.js");
2
2
 
3
+ /**
4
+ * Factory for applications (by id/name) API (btrz-api-accounts).
5
+ * @param {Object} deps
6
+ * @param {import("axios").AxiosInstance} deps.client
7
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
8
+ * @returns {{ get: function, getByName: function }}
9
+ */
3
10
  function applicationsFactory({client, internalAuthTokenProvider}) {
11
+ /**
12
+ * GET /applications/:id - get an application by id.
13
+ * @param {Object} opts
14
+ * @param {string} [opts.token] - API key
15
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
16
+ * @param {string} opts.id - Application id (ObjectId)
17
+ * @param {Object} [opts.headers] - Optional headers
18
+ * @returns {Promise<import("axios").AxiosResponse>}
19
+ */
4
20
  function get({token, id, jwtToken, headers}) {
5
21
  return client.get(`/applications/${id}`, {
6
22
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
7
23
  });
8
24
  }
25
+ /**
26
+ * GET /applications/name/:appName - get an application by name.
27
+ * @param {Object} opts
28
+ * @param {string} [opts.token] - API key
29
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
30
+ * @param {string} opts.appName - Application name
31
+ * @param {Object} [opts.headers] - Optional headers
32
+ * @returns {Promise<import("axios").AxiosResponse>}
33
+ */
9
34
  function getByName({token, appName, jwtToken, headers}) {
10
35
  return client.get(`/applications/name/${appName}`, {
11
36
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
@@ -1,7 +1,29 @@
1
- const { authorizationHeaders } = require("./../endpoints_helpers");
1
+ const {
2
+ authorizationHeaders
3
+ } = require("./../endpoints_helpers.js");
2
4
 
3
- function currentShiftsFactory({client, internalAuthTokenProvider}) {
5
+ /**
6
+ * @typedef {Object} CurrentShiftsQuery
7
+ * @property {string} [includeActivity] - Set to 'false' to avoid returning sales activity data for the shift (default 'true')
8
+ */
4
9
 
10
+ /**
11
+ * Factory for current-shift (per user) API (btrz-api-accounts).
12
+ * @param {Object} deps
13
+ * @param {import("axios").AxiosInstance} deps.client
14
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
15
+ * @returns {{ get: function }}
16
+ */
17
+ function currentShiftsFactory({client, internalAuthTokenProvider}) {
18
+ /**
19
+ * GET /users/:userId/current-shift - get current shift for user.
20
+ * @param {Object} opts
21
+ * @param {string} [opts.token] - API key
22
+ * @param {string} opts.userId - User id (ObjectId)
23
+ * @param {CurrentShiftsQuery} [opts.query] - Query params
24
+ * @param {Object} [opts.headers] - Optional headers
25
+ * @returns {Promise<import("axios").AxiosResponse>}
26
+ */
5
27
  function get({token, userId, query = {}, headers}) {
6
28
  return client.get(`/users/${userId}/current-shift`, {
7
29
  headers: authorizationHeaders({token, internalAuthTokenProvider, headers}),
@@ -1,9 +1,35 @@
1
1
  const base64 = require("base-64");
2
2
  const {
3
3
  authorizationHeaders
4
- } = require("./../endpoints_helpers");
4
+ } = require("./../endpoints_helpers.js");
5
5
 
6
+ /**
7
+ * Query params for GET /customers (btrz-api-accounts). See get-customers getSpec().
8
+ * @typedef {Object} CustomersQuery
9
+ * @property {string} [customerNumber] - A particular customer number; only that customer will be listed
10
+ * @property {string} [externalId] - A particular externalId (same format as when creating the customer)
11
+ * @property {string} [providerIds] - Provider ids to get customers from (comma-separated if more than one)
12
+ * @property {string} [lookupSearchParams] - Lookup search data in format "documentTypeId|DNI,documentNumber|1234567"
13
+ */
14
+
15
+ /**
16
+ * Factory for customers API (btrz-api-accounts).
17
+ * @param {Object} deps
18
+ * @param {import("axios").AxiosInstance} deps.client
19
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
20
+ * @returns {{ put: function, all: function, create: function, signIn: function, signInCas: function, update: function, merge: function }}
21
+ */
6
22
  function customersFactory({client, internalAuthTokenProvider}) {
23
+ /**
24
+ * PUT /customers/:customerId - update a customer (full replace).
25
+ * @param {Object} opts
26
+ * @param {string} [opts.token] - API key
27
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
28
+ * @param {string} opts.customerId - Customer id (ObjectId)
29
+ * @param {Object} opts.customer - Customer payload
30
+ * @param {Object} [opts.headers] - Optional headers
31
+ * @returns {Promise<import("axios").AxiosResponse>}
32
+ */
7
33
  function put({customerId, customer, token, jwtToken, headers}) {
8
34
  return client({
9
35
  url: `/customers/${customerId}`,
@@ -13,6 +39,16 @@ function customersFactory({client, internalAuthTokenProvider}) {
13
39
  });
14
40
  }
15
41
 
42
+ /**
43
+ * GET /customers - list customers.
44
+ * @param {Object} opts
45
+ * @param {string} [opts.token] - API key
46
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
47
+ * @param {CustomersQuery} [opts.query] - Query params (customerNumber, externalId, providerIds, lookupSearchParams)
48
+ * @param {string} [opts.providerId] - Provider id; if set, added to query (convenience for single provider)
49
+ * @param {Object} [opts.headers] - Optional headers
50
+ * @returns {Promise<import("axios").AxiosResponse>}
51
+ */
16
52
  function all({token, jwtToken, query = {}, headers, providerId}) {
17
53
  const query_ = providerId ? {...query, providerId} : query;
18
54
  return client({
@@ -22,16 +58,33 @@ function customersFactory({client, internalAuthTokenProvider}) {
22
58
  });
23
59
  }
24
60
 
61
+ /**
62
+ * POST /customer - create a customer.
63
+ * @param {Object} opts
64
+ * @param {string} [opts.token] - API key
65
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
66
+ * @param {Object} opts.customer - Customer payload
67
+ * @param {Object} [opts.headers] - Optional headers
68
+ * @returns {Promise<import("axios").AxiosResponse>}
69
+ */
25
70
  function create({customer, token, jwtToken, query, headers}) {
26
71
  return client({
27
72
  url: "/customer",
28
73
  method: "post",
29
74
  headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
30
75
  data: {customer},
31
- params: query,
76
+ params: query
32
77
  });
33
78
  }
34
79
 
80
+ /**
81
+ * POST /customers - sign in with email/password (Basic auth).
82
+ * @param {Object} opts
83
+ * @param {string} opts.email - Customer email
84
+ * @param {string} opts.password - Customer password
85
+ * @param {string} opts.apiKey - API key (x-api-key)
86
+ * @returns {Promise<import("axios").AxiosResponse>}
87
+ */
35
88
  function signIn({email, password, apiKey}) {
36
89
  const encodedCredentials = base64.encode(`${email}:${password}`);
37
90
  const headers = {
@@ -48,6 +101,15 @@ function customersFactory({client, internalAuthTokenProvider}) {
48
101
  });
49
102
  }
50
103
 
104
+ /**
105
+ * POST /customers/cas - sign in via CAS (ticket).
106
+ * @param {Object} opts
107
+ * @param {string} opts.service - CAS service URL
108
+ * @param {string} opts.ticket - CAS ticket
109
+ * @param {string} [opts.token] - API key
110
+ * @param {Object} [opts.headers] - Optional headers
111
+ * @returns {Promise<import("axios").AxiosResponse>}
112
+ */
51
113
  function signInCas({service, ticket, token, headers}) {
52
114
  return client({
53
115
  url: "/customers/cas",
@@ -62,6 +124,16 @@ function customersFactory({client, internalAuthTokenProvider}) {
62
124
  });
63
125
  }
64
126
 
127
+ /**
128
+ * PATCH /customers/:customerId - partial update a customer.
129
+ * @param {Object} opts
130
+ * @param {string} [opts.token] - API key
131
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
132
+ * @param {string} opts.customerId - Customer id (ObjectId)
133
+ * @param {Object} opts.data - Partial customer payload
134
+ * @param {Object} [opts.headers] - Optional headers
135
+ * @returns {Promise<import("axios").AxiosResponse>}
136
+ */
65
137
  function update({customerId, token, jwtToken, data, query, headers}) {
66
138
  return client({
67
139
  url: `/customers/${customerId}`,
@@ -72,6 +144,15 @@ function customersFactory({client, internalAuthTokenProvider}) {
72
144
  });
73
145
  }
74
146
 
147
+ /**
148
+ * POST /customers/merge - merge source customers into destination.
149
+ * @param {Object} opts
150
+ * @param {string} [opts.token] - API key
151
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
152
+ * @param {string} opts.destinationCustomerId - Destination customer id (ObjectId)
153
+ * @param {Array<string>} opts.sourceCustomerIds - Source customer ids (ObjectIds)
154
+ * @returns {Promise<import("axios").AxiosResponse>}
155
+ */
75
156
  function merge({destinationCustomerId, sourceCustomerIds, jwtToken, token}) {
76
157
  return client({
77
158
  url: "/customers/merge",
@@ -1,4 +1,14 @@
1
+ /**
2
+ * Factory for API docs (btrz-api-accounts).
3
+ * @param {Object} deps
4
+ * @param {import("axios").AxiosInstance} deps.client
5
+ * @returns {{ get: function }}
6
+ */
1
7
  function docsFactory({client}) {
8
+ /**
9
+ * GET /api-docs-v2 - get API documentation.
10
+ * @returns {Promise<import("axios").AxiosResponse>}
11
+ */
2
12
  function get() {
3
13
  return client.get("/api-docs-v2", {});
4
14
  }
@@ -1,8 +1,22 @@
1
1
  const {
2
2
  authorizationHeaders
3
- } = require("../endpoints_helpers");
3
+ } = require("./../endpoints_helpers.js");
4
4
 
5
+ /**
6
+ * Factory for domains API (btrz-api-accounts).
7
+ * @param {Object} deps
8
+ * @param {import("axios").AxiosInstance} deps.client
9
+ * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
10
+ * @returns {{ all: function, create: function, remove: function }}
11
+ */
5
12
  function domainsFactory({client, internalAuthTokenProvider}) {
13
+ /**
14
+ * GET /domains - list domains. API does not accept query params.
15
+ * @param {Object} opts
16
+ * @param {string} [opts.token] - API key
17
+ * @param {Object} [opts.headers] - Optional headers
18
+ * @returns {Promise<import("axios").AxiosResponse>}
19
+ */
6
20
  function all({token, query = {}, headers}) {
7
21
  return client({
8
22
  params: query,
@@ -11,6 +25,15 @@ function domainsFactory({client, internalAuthTokenProvider}) {
11
25
  });
12
26
  }
13
27
 
28
+ /**
29
+ * POST /domains - create a domain.
30
+ * @param {Object} opts
31
+ * @param {string} [opts.token] - API key
32
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
33
+ * @param {Object} opts.data - Domain payload
34
+ * @param {Object} [opts.headers] - Optional headers
35
+ * @returns {Promise<import("axios").AxiosResponse>}
36
+ */
14
37
  function create({data, token, jwtToken, headers}) {
15
38
  return client({
16
39
  url: "/domains",
@@ -20,6 +43,15 @@ function domainsFactory({client, internalAuthTokenProvider}) {
20
43
  });
21
44
  }
22
45
 
46
+ /**
47
+ * DELETE /domains/:domain - remove a domain.
48
+ * @param {Object} opts
49
+ * @param {string} [opts.token] - API key
50
+ * @param {string} [opts.jwtToken] - JWT or internal auth symbol
51
+ * @param {string} opts.domain - Domain name
52
+ * @param {Object} [opts.headers] - Optional headers
53
+ * @returns {Promise<import("axios").AxiosResponse>}
54
+ */
23
55
  function remove({domain, token, jwtToken, headers}) {
24
56
  return client({
25
57
  url: `/domains/${domain}`,