btrz-api-client 8.75.1 → 9.0.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 (249) hide show
  1. package/.babelrc +2 -1
  2. package/eslint.config.mjs +48 -0
  3. package/lib/client-standalone-min.js +19 -5
  4. package/lib/client.js +1363 -473
  5. package/lib/constants.js +1 -4
  6. package/lib/endpoints/accounts/accounts.js +36 -33
  7. package/lib/endpoints/accounts/agencies.js +53 -43
  8. package/lib/endpoints/accounts/agency-types.js +78 -59
  9. package/lib/endpoints/accounts/application-settings.js +84 -61
  10. package/lib/endpoints/accounts/application.js +19 -19
  11. package/lib/endpoints/accounts/applications.js +35 -30
  12. package/lib/endpoints/accounts/control-classes-settings.js +30 -27
  13. package/lib/endpoints/accounts/current-shifts.js +20 -22
  14. package/lib/endpoints/accounts/customers.js +119 -90
  15. package/lib/endpoints/accounts/docs.js +4 -8
  16. package/lib/endpoints/accounts/domains.js +46 -38
  17. package/lib/endpoints/accounts/dynamic-forms.js +176 -130
  18. package/lib/endpoints/accounts/email-settings.js +79 -61
  19. package/lib/endpoints/accounts/email-templates.js +126 -92
  20. package/lib/endpoints/accounts/exchange-rates.js +36 -32
  21. package/lib/endpoints/accounts/exchange-receipts.js +33 -28
  22. package/lib/endpoints/accounts/external-customers.js +61 -47
  23. package/lib/endpoints/accounts/goal-settings.js +32 -29
  24. package/lib/endpoints/accounts/images.js +59 -50
  25. package/lib/endpoints/accounts/interline.js +131 -102
  26. package/lib/endpoints/accounts/journey-prices-settings.js +30 -27
  27. package/lib/endpoints/accounts/lexicons.js +160 -124
  28. package/lib/endpoints/accounts/market-pricing-settings.js +30 -27
  29. package/lib/endpoints/accounts/multiproduct-sales-settings.js +33 -28
  30. package/lib/endpoints/accounts/network.js +97 -80
  31. package/lib/endpoints/accounts/operation-settings.js +32 -29
  32. package/lib/endpoints/accounts/people-lookups.js +94 -72
  33. package/lib/endpoints/accounts/point-to-point-settings.js +30 -27
  34. package/lib/endpoints/accounts/print-settings.js +32 -29
  35. package/lib/endpoints/accounts/print-templates.js +89 -75
  36. package/lib/endpoints/accounts/printers.js +20 -20
  37. package/lib/endpoints/accounts/rms-settings.js +30 -27
  38. package/lib/endpoints/accounts/s3buckets.js +49 -39
  39. package/lib/endpoints/accounts/salesforce-settings.js +32 -29
  40. package/lib/endpoints/accounts/shift-settings.js +32 -29
  41. package/lib/endpoints/accounts/shifts.js +431 -317
  42. package/lib/endpoints/accounts/sms-templates.js +126 -92
  43. package/lib/endpoints/accounts/sub-print-templates.js +19 -20
  44. package/lib/endpoints/accounts/system-model-settings.js +51 -45
  45. package/lib/endpoints/accounts/ticket-movement-settings.js +30 -27
  46. package/lib/endpoints/accounts/tokens.js +34 -29
  47. package/lib/endpoints/accounts/transport-regulation-settings.js +30 -27
  48. package/lib/endpoints/accounts/travellers.js +82 -66
  49. package/lib/endpoints/accounts/trusted-machines.js +48 -39
  50. package/lib/endpoints/accounts/twilio-settings.js +32 -29
  51. package/lib/endpoints/accounts/users.js +262 -184
  52. package/lib/endpoints/accounts/verified-emails.js +64 -50
  53. package/lib/endpoints/accounts/websales-config.js +35 -31
  54. package/lib/endpoints/bpes/configuration.js +51 -37
  55. package/lib/endpoints/btrzpay/adyen.js +34 -31
  56. package/lib/endpoints/btrzpay/cardpointe.js +84 -62
  57. package/lib/endpoints/btrzpay/customerCards.js +73 -56
  58. package/lib/endpoints/btrzpay/customers.js +55 -43
  59. package/lib/endpoints/btrzpay/cybersource3ds.js +59 -44
  60. package/lib/endpoints/btrzpay/datalogic.js +84 -69
  61. package/lib/endpoints/btrzpay/docs.js +4 -8
  62. package/lib/endpoints/btrzpay/oxxo.js +66 -59
  63. package/lib/endpoints/btrzpay/payment-methods.js +141 -96
  64. package/lib/endpoints/btrzpay/payments.js +37 -30
  65. package/lib/endpoints/btrzpay/prismaTerminals.js +203 -160
  66. package/lib/endpoints/btrzpay/reference-numbers.js +23 -21
  67. package/lib/endpoints/btrzpay/referenced-payments.js +41 -36
  68. package/lib/endpoints/btrzpay/square.js +39 -36
  69. package/lib/endpoints/btrzpay/stripe-terminals.js +36 -31
  70. package/lib/endpoints/btrzpay/stripe3ds.js +25 -22
  71. package/lib/endpoints/btrzpay/terminalPayments.js +58 -52
  72. package/lib/endpoints/coltrane/docs.js +4 -8
  73. package/lib/endpoints/coltrane/healthcheck.js +7 -12
  74. package/lib/endpoints/coltrane/info.js +7 -12
  75. package/lib/endpoints/coltrane/merged-fare-tables.js +22 -22
  76. package/lib/endpoints/coltrane/paths.js +18 -20
  77. package/lib/endpoints/endpoints_helpers.js +14 -30
  78. package/lib/endpoints/gps/scanner-app-location.js +16 -19
  79. package/lib/endpoints/inventory/amenities.js +65 -50
  80. package/lib/endpoints/inventory/amenity-groups.js +65 -50
  81. package/lib/endpoints/inventory/banks.js +78 -59
  82. package/lib/endpoints/inventory/bare-routes.js +31 -30
  83. package/lib/endpoints/inventory/brands.js +68 -50
  84. package/lib/endpoints/inventory/bundle-fares.js +21 -23
  85. package/lib/endpoints/inventory/bundles.js +34 -30
  86. package/lib/endpoints/inventory/change-requests.js +109 -86
  87. package/lib/endpoints/inventory/companies.js +20 -21
  88. package/lib/endpoints/inventory/control-classes.js +112 -85
  89. package/lib/endpoints/inventory/countries.js +35 -32
  90. package/lib/endpoints/inventory/custom-content.js +76 -58
  91. package/lib/endpoints/inventory/custom-fields.js +82 -60
  92. package/lib/endpoints/inventory/docs.js +4 -8
  93. package/lib/endpoints/inventory/document-types.js +96 -69
  94. package/lib/endpoints/inventory/external-passes.js +34 -30
  95. package/lib/endpoints/inventory/external-wallets.js +133 -90
  96. package/lib/endpoints/inventory/fallback-codes.js +66 -49
  97. package/lib/endpoints/inventory/fare-classes.js +54 -41
  98. package/lib/endpoints/inventory/fare-type-modifiers.js +78 -59
  99. package/lib/endpoints/inventory/fares.js +95 -72
  100. package/lib/endpoints/inventory/fees.js +68 -50
  101. package/lib/endpoints/inventory/filtered-trips-v2.js +23 -21
  102. package/lib/endpoints/inventory/filtered-trips.js +50 -39
  103. package/lib/endpoints/inventory/financing-costs.js +78 -61
  104. package/lib/endpoints/inventory/garages.js +72 -59
  105. package/lib/endpoints/inventory/getnet-terminals.js +78 -60
  106. package/lib/endpoints/inventory/gift-certificate-definitions.js +84 -66
  107. package/lib/endpoints/inventory/healthcheck.js +4 -8
  108. package/lib/endpoints/inventory/holidays.js +83 -61
  109. package/lib/endpoints/inventory/insurances.js +68 -57
  110. package/lib/endpoints/inventory/insurancesCost.js +24 -24
  111. package/lib/endpoints/inventory/items.js +86 -64
  112. package/lib/endpoints/inventory/journey-prices.js +83 -61
  113. package/lib/endpoints/inventory/labels.js +83 -61
  114. package/lib/endpoints/inventory/marital-status.js +82 -67
  115. package/lib/endpoints/inventory/marketplace-modifiers.js +74 -57
  116. package/lib/endpoints/inventory/mit-terminal-settings.js +78 -59
  117. package/lib/endpoints/inventory/mit-terminals.js +74 -57
  118. package/lib/endpoints/inventory/operating-companies.js +126 -91
  119. package/lib/endpoints/inventory/operation-messages.js +85 -63
  120. package/lib/endpoints/inventory/operation-reasons.js +86 -67
  121. package/lib/endpoints/inventory/parcel-zones.js +52 -40
  122. package/lib/endpoints/inventory/pay-on-accounts.js +22 -24
  123. package/lib/endpoints/inventory/payment-terminals.js +74 -57
  124. package/lib/endpoints/inventory/prisma-terminals.js +78 -59
  125. package/lib/endpoints/inventory/products.js +90 -70
  126. package/lib/endpoints/inventory/promos.js +138 -95
  127. package/lib/endpoints/inventory/regions.js +78 -59
  128. package/lib/endpoints/inventory/routes.js +323 -262
  129. package/lib/endpoints/inventory/schedule-groups.js +69 -52
  130. package/lib/endpoints/inventory/schedules.js +171 -143
  131. package/lib/endpoints/inventory/seatclasses.js +82 -67
  132. package/lib/endpoints/inventory/seatfees.js +60 -48
  133. package/lib/endpoints/inventory/seatmaps.js +108 -84
  134. package/lib/endpoints/inventory/segments-information-tables.js +22 -23
  135. package/lib/endpoints/inventory/segments-information.js +78 -59
  136. package/lib/endpoints/inventory/service-numbers.js +64 -50
  137. package/lib/endpoints/inventory/service-types.js +74 -57
  138. package/lib/endpoints/inventory/ssrs.js +18 -20
  139. package/lib/endpoints/inventory/station-classes.js +79 -61
  140. package/lib/endpoints/inventory/station-groups.js +18 -20
  141. package/lib/endpoints/inventory/stations-provinces.js +18 -20
  142. package/lib/endpoints/inventory/stations-zones.js +18 -20
  143. package/lib/endpoints/inventory/stations.js +61 -47
  144. package/lib/endpoints/inventory/taxes.js +137 -98
  145. package/lib/endpoints/inventory/travel-routes.js +64 -50
  146. package/lib/endpoints/inventory/traveller-card-providers-types.js +19 -19
  147. package/lib/endpoints/inventory/traveller-card-providers.js +68 -50
  148. package/lib/endpoints/inventory/traveller-card-types.js +82 -59
  149. package/lib/endpoints/inventory/trip-ids.js +21 -21
  150. package/lib/endpoints/inventory/trips.js +48 -41
  151. package/lib/endpoints/inventory/vehicle-types.js +19 -19
  152. package/lib/endpoints/inventory/vehicles.js +111 -83
  153. package/lib/endpoints/inventory/zone-price-overages.js +74 -57
  154. package/lib/endpoints/inventory/zone-prices.js +74 -57
  155. package/lib/endpoints/invoices/dlink.js +37 -34
  156. package/lib/endpoints/invoices/docs.js +4 -8
  157. package/lib/endpoints/invoices/emails.js +22 -23
  158. package/lib/endpoints/invoices/gti.js +37 -34
  159. package/lib/endpoints/invoices/infile.js +37 -34
  160. package/lib/endpoints/invoices/infileJson.js +37 -34
  161. package/lib/endpoints/invoices/invoices.js +78 -63
  162. package/lib/endpoints/invoices/pdfs.js +22 -24
  163. package/lib/endpoints/invoices/providers.js +82 -67
  164. package/lib/endpoints/invoices/providersSequences.js +89 -74
  165. package/lib/endpoints/invoices/system.js +37 -34
  166. package/lib/endpoints/invoices/tax-ids.js +20 -21
  167. package/lib/endpoints/loyalty/movements.js +55 -49
  168. package/lib/endpoints/loyalty/programs.js +50 -41
  169. package/lib/endpoints/notifications/customers.js +33 -31
  170. package/lib/endpoints/notifications/email.js +20 -21
  171. package/lib/endpoints/notifications/external-customers.js +35 -30
  172. package/lib/endpoints/notifications/manifest-notifications.js +31 -33
  173. package/lib/endpoints/notifications/notify.js +112 -81
  174. package/lib/endpoints/notifications/orders-rules-validations.js +22 -22
  175. package/lib/endpoints/notifications/pdf-data.js +56 -64
  176. package/lib/endpoints/notifications/pdfs.js +48 -55
  177. package/lib/endpoints/notifications/printed-tickets.js +31 -27
  178. package/lib/endpoints/notifications/salesforce.js +19 -19
  179. package/lib/endpoints/notifications/short-urls.js +38 -33
  180. package/lib/endpoints/notifications/twilio.js +57 -46
  181. package/lib/endpoints/operations/accounting_items.js +30 -36
  182. package/lib/endpoints/operations/applied_insurance.js +25 -20
  183. package/lib/endpoints/operations/calendar_entries.js +18 -20
  184. package/lib/endpoints/operations/cancellation_settings.js +33 -28
  185. package/lib/endpoints/operations/docs.js +5 -9
  186. package/lib/endpoints/operations/external-bookings.js +35 -31
  187. package/lib/endpoints/operations/flexpasses.js +22 -22
  188. package/lib/endpoints/operations/gift-certificates.js +25 -23
  189. package/lib/endpoints/operations/loans.js +30 -36
  190. package/lib/endpoints/operations/manifest.js +469 -372
  191. package/lib/endpoints/operations/manifest_leg_for_tickets.js +23 -23
  192. package/lib/endpoints/operations/movements.js +21 -22
  193. package/lib/endpoints/operations/outlook-trips.js +20 -21
  194. package/lib/endpoints/operations/pago-express.js +55 -39
  195. package/lib/endpoints/operations/parcels.js +96 -67
  196. package/lib/endpoints/operations/parcels_manifests.js +102 -81
  197. package/lib/endpoints/operations/passenger_check_in_info.js +66 -52
  198. package/lib/endpoints/operations/redemption.js +52 -40
  199. package/lib/endpoints/operations/rms.js +35 -33
  200. package/lib/endpoints/operations/scheduled_notifications.js +80 -61
  201. package/lib/endpoints/operations/segments.js +24 -24
  202. package/lib/endpoints/operations/sold-items-fulfillment.js +20 -21
  203. package/lib/endpoints/operations/sold-items.js +35 -30
  204. package/lib/endpoints/operations/tickets.js +109 -78
  205. package/lib/endpoints/operations/transaction.js +22 -22
  206. package/lib/endpoints/operations/transactions.js +178 -135
  207. package/lib/endpoints/operations/transport_regulations.js +22 -22
  208. package/lib/endpoints/operations/trip_change_info.js +23 -23
  209. package/lib/endpoints/operations/vehicle_assignments.js +60 -48
  210. package/lib/endpoints/operations/vouchers.js +32 -35
  211. package/lib/endpoints/operations/waitlists.js +62 -47
  212. package/lib/endpoints/ratality/auth.js +10 -14
  213. package/lib/endpoints/ratality/clients.js +30 -28
  214. package/lib/endpoints/ratality/integrations.js +43 -36
  215. package/lib/endpoints/reports/custom-reports.js +50 -39
  216. package/lib/endpoints/reports/email.js +20 -19
  217. package/lib/endpoints/reports/report-types.js +35 -30
  218. package/lib/endpoints/reports/trip-manifests.js +20 -21
  219. package/lib/endpoints/sales/bundles.js +18 -20
  220. package/lib/endpoints/sales/cancellations.js +48 -34
  221. package/lib/endpoints/sales/cart-promo.js +37 -34
  222. package/lib/endpoints/sales/cart.js +218 -166
  223. package/lib/endpoints/sales/check-in-info.js +22 -23
  224. package/lib/endpoints/sales/custom-fields.js +18 -20
  225. package/lib/endpoints/sales/docs.js +4 -8
  226. package/lib/endpoints/sales/flexpasses.js +21 -21
  227. package/lib/endpoints/sales/gift-certificates.js +20 -22
  228. package/lib/endpoints/sales/order.js +66 -53
  229. package/lib/endpoints/sales/parcel-quotes.js +20 -20
  230. package/lib/endpoints/sales/payment-providers.js +20 -21
  231. package/lib/endpoints/sales/redeemable-items.js +32 -31
  232. package/lib/endpoints/sales/sync-entry.js +21 -21
  233. package/lib/endpoints/sales/voucher.js +19 -20
  234. package/lib/endpoints/seatmaps/access-ticket.js +19 -19
  235. package/lib/endpoints/seatmaps/seat.js +21 -21
  236. package/lib/endpoints/uploads/files.js +26 -24
  237. package/lib/endpoints/uploads/images.js +26 -24
  238. package/lib/endpoints/webhooks/events.js +24 -24
  239. package/lib/endpoints/webhooks/subscriptions.js +80 -60
  240. package/lib/endpoints/webhooks/undelivered.js +103 -73
  241. package/lib/endpoints/webhooks/webhooks.js +20 -20
  242. package/lib/initializedClient.js +3 -5
  243. package/lib/productionDefaults.js +6 -8
  244. package/package.json +18 -18
  245. package/src/client.js +1 -1
  246. package/src/endpoints/operations/transactions.js +1 -1
  247. package/tools/build-standalone.mjs +15 -0
  248. package/.eslintignore +0 -2
  249. package/.eslintrc.js +0 -3
@@ -1,8 +1,7 @@
1
- "use strict";
2
-
3
1
  /* eslint-disable max-len */
4
- var _require = require("./../endpoints_helpers.js"),
5
- authorizationHeaders = _require.authorizationHeaders;
2
+ const {
3
+ authorizationHeaders
4
+ } = require("./../endpoints_helpers.js");
6
5
 
7
6
  /**
8
7
  * Query params for GET /users (btrz-api-accounts). See get-users getSpec().
@@ -36,12 +35,10 @@ var _require = require("./../endpoints_helpers.js"),
36
35
  * @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
37
36
  * @returns {{ get: function, getV2: function, all: function, create: function, login: function, update: function, delete: function, createOrUpdateMany: function, impersonate: function, startMfa: function, confirmMfa: function, disableMfa: function, sequences: { get: function, all: function, create: function, update: function, transfer: function } }}
38
37
  */
39
-
40
-
41
- function usersFactory(_ref) {
42
- var client = _ref.client,
43
- internalAuthTokenProvider = _ref.internalAuthTokenProvider;
44
-
38
+ function usersFactory({
39
+ client,
40
+ internalAuthTokenProvider
41
+ }) {
45
42
  /**
46
43
  * GET /user/:id - get a user by id (legacy). API does not accept query params.
47
44
  * @param {Object} opts
@@ -51,16 +48,20 @@ function usersFactory(_ref) {
51
48
  * @param {Object} [opts.headers] - Optional headers
52
49
  * @returns {Promise<import("axios").AxiosResponse>}
53
50
  */
54
- function get() {
55
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
56
- token = _ref2.token,
57
- jwtToken = _ref2.jwtToken,
58
- id = _ref2.id,
59
- headers = _ref2.headers;
60
-
51
+ function get({
52
+ token,
53
+ jwtToken,
54
+ id,
55
+ headers
56
+ } = {}) {
61
57
  return client({
62
- url: "/user/" + id,
63
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
58
+ url: `/user/${id}`,
59
+ headers: authorizationHeaders({
60
+ token,
61
+ jwtToken,
62
+ internalAuthTokenProvider,
63
+ headers
64
+ })
64
65
  });
65
66
  }
66
67
 
@@ -73,16 +74,20 @@ function usersFactory(_ref) {
73
74
  * @param {Object} [opts.headers] - Optional headers
74
75
  * @returns {Promise<import("axios").AxiosResponse>}
75
76
  */
76
- function getV2() {
77
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
78
- token = _ref3.token,
79
- jwtToken = _ref3.jwtToken,
80
- id = _ref3.id,
81
- headers = _ref3.headers;
82
-
77
+ function getV2({
78
+ token,
79
+ jwtToken,
80
+ id,
81
+ headers
82
+ } = {}) {
83
83
  return client({
84
- url: "/users/" + id,
85
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
84
+ url: `/users/${id}`,
85
+ headers: authorizationHeaders({
86
+ token,
87
+ jwtToken,
88
+ internalAuthTokenProvider,
89
+ headers
90
+ })
86
91
  });
87
92
  }
88
93
 
@@ -95,17 +100,21 @@ function usersFactory(_ref) {
95
100
  * @param {Object} [opts.headers] - Optional headers
96
101
  * @returns {Promise<import("axios").AxiosResponse>}
97
102
  */
98
- function all(_ref4) {
99
- var token = _ref4.token,
100
- jwtToken = _ref4.jwtToken,
101
- _ref4$query = _ref4.query,
102
- query = _ref4$query === undefined ? {} : _ref4$query,
103
- headers = _ref4.headers;
104
-
103
+ function all({
104
+ token,
105
+ jwtToken,
106
+ query = {},
107
+ headers
108
+ }) {
105
109
  return client({
106
110
  url: "/users",
107
111
  params: query,
108
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
112
+ headers: authorizationHeaders({
113
+ token,
114
+ jwtToken,
115
+ internalAuthTokenProvider,
116
+ headers
117
+ })
109
118
  });
110
119
  }
111
120
 
@@ -118,20 +127,24 @@ function usersFactory(_ref) {
118
127
  * @param {Object} [opts.headers] - Optional headers
119
128
  * @returns {Promise<import("axios").AxiosResponse>}
120
129
  */
121
- function login(_ref5) {
122
- var token = _ref5.token,
123
- jwtToken = _ref5.jwtToken,
124
- _ref5$query = _ref5.query,
125
- query = _ref5$query === undefined ? {} : _ref5$query,
126
- data = _ref5.data,
127
- headers = _ref5.headers;
128
-
130
+ function login({
131
+ token,
132
+ jwtToken,
133
+ query = {},
134
+ data,
135
+ headers
136
+ }) {
129
137
  return client({
130
138
  url: "/users",
131
139
  method: "post",
132
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
140
+ headers: authorizationHeaders({
141
+ token,
142
+ jwtToken,
143
+ internalAuthTokenProvider,
144
+ headers
145
+ }),
133
146
  params: query,
134
- data: data
147
+ data
135
148
  });
136
149
  }
137
150
 
@@ -144,15 +157,20 @@ function usersFactory(_ref) {
144
157
  * @param {Object} [opts.headers] - Optional headers
145
158
  * @returns {Promise<import("axios").AxiosResponse>}
146
159
  */
147
- function create(_ref6) {
148
- var token = _ref6.token,
149
- jwtToken = _ref6.jwtToken,
150
- _ref6$query = _ref6.query,
151
- query = _ref6$query === undefined ? {} : _ref6$query,
152
- data = _ref6.data,
153
- headers = _ref6.headers;
154
-
155
- return login({ token: token, jwtToken: jwtToken, query: query, data: data, headers: headers });
160
+ function create({
161
+ token,
162
+ jwtToken,
163
+ query = {},
164
+ data,
165
+ headers
166
+ }) {
167
+ return login({
168
+ token,
169
+ jwtToken,
170
+ query,
171
+ data,
172
+ headers
173
+ });
156
174
  }
157
175
 
158
176
  /**
@@ -165,18 +183,25 @@ function usersFactory(_ref) {
165
183
  * @param {Object} [opts.headers] - Optional headers
166
184
  * @returns {Promise<import("axios").AxiosResponse<{ user: Object }>>}
167
185
  */
168
- function update(_ref7) {
169
- var token = _ref7.token,
170
- jwtToken = _ref7.jwtToken,
171
- userId = _ref7.userId,
172
- user = _ref7.user,
173
- headers = _ref7.headers;
174
-
186
+ function update({
187
+ token,
188
+ jwtToken,
189
+ userId,
190
+ user,
191
+ headers
192
+ }) {
175
193
  return client({
176
- url: "/users/" + userId,
194
+ url: `/users/${userId}`,
177
195
  method: "put",
178
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
179
- data: { user: user }
196
+ headers: authorizationHeaders({
197
+ token,
198
+ jwtToken,
199
+ internalAuthTokenProvider,
200
+ headers
201
+ }),
202
+ data: {
203
+ user
204
+ }
180
205
  });
181
206
  }
182
207
 
@@ -189,16 +214,21 @@ function usersFactory(_ref) {
189
214
  * @param {Object} [opts.headers] - Optional headers
190
215
  * @returns {Promise<import("axios").AxiosResponse>}
191
216
  */
192
- function deleteUser(_ref8) {
193
- var token = _ref8.token,
194
- jwtToken = _ref8.jwtToken,
195
- id = _ref8.id,
196
- headers = _ref8.headers;
197
-
217
+ function deleteUser({
218
+ token,
219
+ jwtToken,
220
+ id,
221
+ headers
222
+ }) {
198
223
  return client({
199
- url: "/users/" + id,
224
+ url: `/users/${id}`,
200
225
  method: "delete",
201
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
226
+ headers: authorizationHeaders({
227
+ token,
228
+ jwtToken,
229
+ internalAuthTokenProvider,
230
+ headers
231
+ })
202
232
  });
203
233
  }
204
234
 
@@ -211,17 +241,24 @@ function usersFactory(_ref) {
211
241
  * @param {Object} [opts.headers] - Optional headers
212
242
  * @returns {Promise<import("axios").AxiosResponse>}
213
243
  */
214
- function createOrUpdateMany(_ref9) {
215
- var token = _ref9.token,
216
- jwtToken = _ref9.jwtToken,
217
- users = _ref9.users,
218
- headers = _ref9.headers;
219
-
244
+ function createOrUpdateMany({
245
+ token,
246
+ jwtToken,
247
+ users,
248
+ headers
249
+ }) {
220
250
  return client({
221
251
  url: "/users/import",
222
252
  method: "post",
223
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
224
- data: { users: users }
253
+ headers: authorizationHeaders({
254
+ token,
255
+ jwtToken,
256
+ internalAuthTokenProvider,
257
+ headers
258
+ }),
259
+ data: {
260
+ users
261
+ }
225
262
  });
226
263
  }
227
264
 
@@ -234,17 +271,24 @@ function usersFactory(_ref) {
234
271
  * @param {Object} [opts.headers] - Optional headers
235
272
  * @returns {Promise<import("axios").AxiosResponse>}
236
273
  */
237
- function impersonate(_ref10) {
238
- var token = _ref10.token,
239
- jwtToken = _ref10.jwtToken,
240
- offlineUserId = _ref10.offlineUserId,
241
- headers = _ref10.headers;
242
-
274
+ function impersonate({
275
+ token,
276
+ jwtToken,
277
+ offlineUserId,
278
+ headers
279
+ }) {
243
280
  return client({
244
281
  url: "/users/impersonate",
245
282
  method: "post",
246
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
247
- data: { offlineUserId: offlineUserId }
283
+ headers: authorizationHeaders({
284
+ token,
285
+ jwtToken,
286
+ internalAuthTokenProvider,
287
+ headers
288
+ }),
289
+ data: {
290
+ offlineUserId
291
+ }
248
292
  });
249
293
  }
250
294
 
@@ -257,16 +301,21 @@ function usersFactory(_ref) {
257
301
  * @param {Object} [opts.headers] - Optional headers
258
302
  * @returns {Promise<import("axios").AxiosResponse>}
259
303
  */
260
- function startMfa(_ref11) {
261
- var token = _ref11.token,
262
- jwtToken = _ref11.jwtToken,
263
- userId = _ref11.userId,
264
- headers = _ref11.headers;
265
-
304
+ function startMfa({
305
+ token,
306
+ jwtToken,
307
+ userId,
308
+ headers
309
+ }) {
266
310
  return client({
267
- url: "/users/" + userId + "/mfa",
311
+ url: `/users/${userId}/mfa`,
268
312
  method: "post",
269
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
313
+ headers: authorizationHeaders({
314
+ token,
315
+ jwtToken,
316
+ internalAuthTokenProvider,
317
+ headers
318
+ })
270
319
  });
271
320
  }
272
321
 
@@ -280,18 +329,25 @@ function usersFactory(_ref) {
280
329
  * @param {Object} [opts.headers] - Optional headers
281
330
  * @returns {Promise<import("axios").AxiosResponse>}
282
331
  */
283
- function confirmMfa(_ref12) {
284
- var token = _ref12.token,
285
- jwtToken = _ref12.jwtToken,
286
- userId = _ref12.userId,
287
- totpToken = _ref12.totpToken,
288
- headers = _ref12.headers;
289
-
332
+ function confirmMfa({
333
+ token,
334
+ jwtToken,
335
+ userId,
336
+ totpToken,
337
+ headers
338
+ }) {
290
339
  return client({
291
- url: "/users/" + userId + "/mfa",
340
+ url: `/users/${userId}/mfa`,
292
341
  method: "put",
293
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
294
- data: { token: totpToken }
342
+ headers: authorizationHeaders({
343
+ token,
344
+ jwtToken,
345
+ internalAuthTokenProvider,
346
+ headers
347
+ }),
348
+ data: {
349
+ token: totpToken
350
+ }
295
351
  });
296
352
  }
297
353
 
@@ -304,20 +360,24 @@ function usersFactory(_ref) {
304
360
  * @param {Object} [opts.headers] - Optional headers
305
361
  * @returns {Promise<import("axios").AxiosResponse>}
306
362
  */
307
- function disableMfa(_ref13) {
308
- var token = _ref13.token,
309
- jwtToken = _ref13.jwtToken,
310
- userId = _ref13.userId,
311
- headers = _ref13.headers;
312
-
363
+ function disableMfa({
364
+ token,
365
+ jwtToken,
366
+ userId,
367
+ headers
368
+ }) {
313
369
  return client({
314
- url: "/users/" + userId + "/mfa",
370
+ url: `/users/${userId}/mfa`,
315
371
  method: "delete",
316
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
372
+ headers: authorizationHeaders({
373
+ token,
374
+ jwtToken,
375
+ internalAuthTokenProvider,
376
+ headers
377
+ })
317
378
  });
318
379
  }
319
-
320
- var sequences = {
380
+ const sequences = {
321
381
  /**
322
382
  * GET /users/:userId/sequences/:sequenceId - get a sequence. API does not accept query params.
323
383
  * @param {Object} opts
@@ -328,19 +388,23 @@ function usersFactory(_ref) {
328
388
  * @param {Object} [opts.headers] - Optional headers
329
389
  * @returns {Promise<import("axios").AxiosResponse>}
330
390
  */
331
- get: function get(_ref14) {
332
- var token = _ref14.token,
333
- jwtToken = _ref14.jwtToken,
334
- userId = _ref14.userId,
335
- sequenceId = _ref14.sequenceId,
336
- headers = _ref14.headers;
337
-
391
+ get({
392
+ token,
393
+ jwtToken,
394
+ userId,
395
+ sequenceId,
396
+ headers
397
+ }) {
338
398
  return client({
339
- url: "/users/" + userId + "/sequences/" + sequenceId,
340
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
399
+ url: `/users/${userId}/sequences/${sequenceId}`,
400
+ headers: authorizationHeaders({
401
+ token,
402
+ jwtToken,
403
+ internalAuthTokenProvider,
404
+ headers
405
+ })
341
406
  });
342
407
  },
343
-
344
408
  /**
345
409
  * GET /users/:userId/sequences - list sequences for user.
346
410
  * @param {Object} opts
@@ -351,21 +415,24 @@ function usersFactory(_ref) {
351
415
  * @param {Object} [opts.headers] - Optional headers
352
416
  * @returns {Promise<import("axios").AxiosResponse>}
353
417
  */
354
- all: function all(_ref15) {
355
- var token = _ref15.token,
356
- jwtToken = _ref15.jwtToken,
357
- userId = _ref15.userId,
358
- _ref15$query = _ref15.query,
359
- query = _ref15$query === undefined ? {} : _ref15$query,
360
- headers = _ref15.headers;
361
-
418
+ all({
419
+ token,
420
+ jwtToken,
421
+ userId,
422
+ query = {},
423
+ headers
424
+ }) {
362
425
  return client({
363
- url: "/users/" + userId + "/sequences",
426
+ url: `/users/${userId}/sequences`,
364
427
  params: query,
365
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
428
+ headers: authorizationHeaders({
429
+ token,
430
+ jwtToken,
431
+ internalAuthTokenProvider,
432
+ headers
433
+ })
366
434
  });
367
435
  },
368
-
369
436
  /**
370
437
  * POST /users/:userId/sequences - create a sequence.
371
438
  * @param {Object} opts
@@ -376,21 +443,25 @@ function usersFactory(_ref) {
376
443
  * @param {Object} [opts.headers] - Optional headers
377
444
  * @returns {Promise<import("axios").AxiosResponse>}
378
445
  */
379
- create: function create(_ref16) {
380
- var jwtToken = _ref16.jwtToken,
381
- token = _ref16.token,
382
- userId = _ref16.userId,
383
- sequence = _ref16.sequence,
384
- headers = _ref16.headers;
385
-
446
+ create({
447
+ jwtToken,
448
+ token,
449
+ userId,
450
+ sequence,
451
+ headers
452
+ }) {
386
453
  return client({
387
- url: "/users/" + userId + "/sequences",
454
+ url: `/users/${userId}/sequences`,
388
455
  method: "post",
389
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
456
+ headers: authorizationHeaders({
457
+ token,
458
+ jwtToken,
459
+ internalAuthTokenProvider,
460
+ headers
461
+ }),
390
462
  data: sequence
391
463
  });
392
464
  },
393
-
394
465
  /**
395
466
  * PUT /users/:userId/sequences/:sequenceId - update a sequence.
396
467
  * @param {Object} opts
@@ -402,22 +473,26 @@ function usersFactory(_ref) {
402
473
  * @param {Object} [opts.headers] - Optional headers
403
474
  * @returns {Promise<import("axios").AxiosResponse>}
404
475
  */
405
- update: function update(_ref17) {
406
- var jwtToken = _ref17.jwtToken,
407
- token = _ref17.token,
408
- userId = _ref17.userId,
409
- sequenceId = _ref17.sequenceId,
410
- sequence = _ref17.sequence,
411
- headers = _ref17.headers;
412
-
476
+ update({
477
+ jwtToken,
478
+ token,
479
+ userId,
480
+ sequenceId,
481
+ sequence,
482
+ headers
483
+ }) {
413
484
  return client({
414
- url: "/users/" + userId + "/sequences/" + sequenceId,
485
+ url: `/users/${userId}/sequences/${sequenceId}`,
415
486
  method: "put",
416
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
487
+ headers: authorizationHeaders({
488
+ token,
489
+ jwtToken,
490
+ internalAuthTokenProvider,
491
+ headers
492
+ }),
417
493
  data: sequence
418
494
  });
419
495
  },
420
-
421
496
  /**
422
497
  * PATCH /users/:userId/sequences/:sequenceId - transfer sequence to another user.
423
498
  * @param {Object} opts
@@ -429,41 +504,44 @@ function usersFactory(_ref) {
429
504
  * @param {Object} [opts.headers] - Optional headers
430
505
  * @returns {Promise<import("axios").AxiosResponse>}
431
506
  */
432
- transfer: function transfer(_ref18) {
433
- var jwtToken = _ref18.jwtToken,
434
- token = _ref18.token,
435
- userId = _ref18.userId,
436
- sequenceId = _ref18.sequenceId,
437
- newUserId = _ref18.newUserId,
438
- headers = _ref18.headers;
439
-
507
+ transfer({
508
+ jwtToken,
509
+ token,
510
+ userId,
511
+ sequenceId,
512
+ newUserId,
513
+ headers
514
+ }) {
440
515
  return client({
441
- url: "/users/" + userId + "/sequences/" + sequenceId,
516
+ url: `/users/${userId}/sequences/${sequenceId}`,
442
517
  method: "patch",
443
- headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
518
+ headers: authorizationHeaders({
519
+ token,
520
+ jwtToken,
521
+ internalAuthTokenProvider,
522
+ headers
523
+ }),
444
524
  data: {
445
525
  operation: "transfer",
446
- newUserId: newUserId
526
+ newUserId
447
527
  }
448
528
  });
449
529
  }
450
530
  };
451
-
452
531
  return {
453
- get: get,
454
- getV2: getV2,
455
- all: all,
456
- create: create,
457
- login: login,
458
- update: update,
532
+ get,
533
+ getV2,
534
+ all,
535
+ create,
536
+ login,
537
+ update,
459
538
  delete: deleteUser,
460
- createOrUpdateMany: createOrUpdateMany,
461
- impersonate: impersonate,
462
- startMfa: startMfa,
463
- confirmMfa: confirmMfa,
464
- disableMfa: disableMfa,
465
- sequences: sequences
539
+ createOrUpdateMany,
540
+ impersonate,
541
+ startMfa,
542
+ confirmMfa,
543
+ disableMfa,
544
+ sequences
466
545
  };
467
546
  }
468
-
469
547
  module.exports = usersFactory;