btrz-api-client 8.75.1 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -1
- package/eslint.config.mjs +48 -0
- package/lib/client-standalone-min.js +19 -5
- package/lib/client.js +1363 -473
- package/lib/constants.js +1 -4
- package/lib/endpoints/accounts/accounts.js +36 -33
- package/lib/endpoints/accounts/agencies.js +53 -43
- package/lib/endpoints/accounts/agency-types.js +78 -59
- package/lib/endpoints/accounts/application-settings.js +84 -61
- package/lib/endpoints/accounts/application.js +19 -19
- package/lib/endpoints/accounts/applications.js +35 -30
- package/lib/endpoints/accounts/control-classes-settings.js +30 -27
- package/lib/endpoints/accounts/current-shifts.js +20 -22
- package/lib/endpoints/accounts/customers.js +119 -90
- package/lib/endpoints/accounts/docs.js +4 -8
- package/lib/endpoints/accounts/domains.js +46 -38
- package/lib/endpoints/accounts/dynamic-forms.js +176 -130
- package/lib/endpoints/accounts/email-settings.js +79 -61
- package/lib/endpoints/accounts/email-templates.js +126 -92
- package/lib/endpoints/accounts/exchange-rates.js +36 -32
- package/lib/endpoints/accounts/exchange-receipts.js +33 -28
- package/lib/endpoints/accounts/external-customers.js +61 -47
- package/lib/endpoints/accounts/goal-settings.js +32 -29
- package/lib/endpoints/accounts/images.js +59 -50
- package/lib/endpoints/accounts/interline.js +131 -102
- package/lib/endpoints/accounts/journey-prices-settings.js +30 -27
- package/lib/endpoints/accounts/lexicons.js +160 -124
- package/lib/endpoints/accounts/market-pricing-settings.js +30 -27
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +33 -28
- package/lib/endpoints/accounts/network.js +97 -80
- package/lib/endpoints/accounts/operation-settings.js +32 -29
- package/lib/endpoints/accounts/people-lookups.js +94 -72
- package/lib/endpoints/accounts/point-to-point-settings.js +30 -27
- package/lib/endpoints/accounts/print-settings.js +32 -29
- package/lib/endpoints/accounts/print-templates.js +89 -75
- package/lib/endpoints/accounts/printers.js +20 -20
- package/lib/endpoints/accounts/rms-settings.js +30 -27
- package/lib/endpoints/accounts/s3buckets.js +49 -39
- package/lib/endpoints/accounts/salesforce-settings.js +32 -29
- package/lib/endpoints/accounts/shift-settings.js +32 -29
- package/lib/endpoints/accounts/shifts.js +431 -317
- package/lib/endpoints/accounts/sms-templates.js +126 -92
- package/lib/endpoints/accounts/sub-print-templates.js +19 -20
- package/lib/endpoints/accounts/system-model-settings.js +51 -45
- package/lib/endpoints/accounts/ticket-movement-settings.js +30 -27
- package/lib/endpoints/accounts/tokens.js +34 -29
- package/lib/endpoints/accounts/transport-regulation-settings.js +30 -27
- package/lib/endpoints/accounts/travellers.js +82 -66
- package/lib/endpoints/accounts/trusted-machines.js +48 -39
- package/lib/endpoints/accounts/twilio-settings.js +32 -29
- package/lib/endpoints/accounts/users.js +262 -184
- package/lib/endpoints/accounts/verified-emails.js +64 -50
- package/lib/endpoints/accounts/websales-config.js +35 -31
- package/lib/endpoints/bpes/configuration.js +51 -37
- package/lib/endpoints/btrzpay/adyen.js +34 -31
- package/lib/endpoints/btrzpay/cardpointe.js +84 -62
- package/lib/endpoints/btrzpay/customerCards.js +73 -56
- package/lib/endpoints/btrzpay/customers.js +55 -43
- package/lib/endpoints/btrzpay/cybersource3ds.js +59 -44
- package/lib/endpoints/btrzpay/datalogic.js +84 -69
- package/lib/endpoints/btrzpay/docs.js +4 -8
- package/lib/endpoints/btrzpay/oxxo.js +66 -59
- package/lib/endpoints/btrzpay/payment-methods.js +141 -96
- package/lib/endpoints/btrzpay/payments.js +37 -30
- package/lib/endpoints/btrzpay/prismaTerminals.js +203 -160
- package/lib/endpoints/btrzpay/reference-numbers.js +23 -21
- package/lib/endpoints/btrzpay/referenced-payments.js +41 -36
- package/lib/endpoints/btrzpay/square.js +39 -36
- package/lib/endpoints/btrzpay/stripe-terminals.js +36 -31
- package/lib/endpoints/btrzpay/stripe3ds.js +25 -22
- package/lib/endpoints/btrzpay/terminalPayments.js +58 -52
- package/lib/endpoints/coltrane/docs.js +4 -8
- package/lib/endpoints/coltrane/healthcheck.js +7 -12
- package/lib/endpoints/coltrane/info.js +7 -12
- package/lib/endpoints/coltrane/merged-fare-tables.js +22 -22
- package/lib/endpoints/coltrane/paths.js +18 -20
- package/lib/endpoints/endpoints_helpers.js +14 -30
- package/lib/endpoints/gps/scanner-app-location.js +16 -19
- package/lib/endpoints/inventory/amenities.js +65 -50
- package/lib/endpoints/inventory/amenity-groups.js +65 -50
- package/lib/endpoints/inventory/banks.js +78 -59
- package/lib/endpoints/inventory/bare-routes.js +31 -30
- package/lib/endpoints/inventory/brands.js +68 -50
- package/lib/endpoints/inventory/bundle-fares.js +21 -23
- package/lib/endpoints/inventory/bundles.js +34 -30
- package/lib/endpoints/inventory/change-requests.js +109 -86
- package/lib/endpoints/inventory/companies.js +20 -21
- package/lib/endpoints/inventory/control-classes.js +112 -85
- package/lib/endpoints/inventory/countries.js +35 -32
- package/lib/endpoints/inventory/custom-content.js +76 -58
- package/lib/endpoints/inventory/custom-fields.js +82 -60
- package/lib/endpoints/inventory/docs.js +4 -8
- package/lib/endpoints/inventory/document-types.js +96 -69
- package/lib/endpoints/inventory/external-passes.js +34 -30
- package/lib/endpoints/inventory/external-wallets.js +133 -90
- package/lib/endpoints/inventory/fallback-codes.js +66 -49
- package/lib/endpoints/inventory/fare-classes.js +54 -41
- package/lib/endpoints/inventory/fare-type-modifiers.js +78 -59
- package/lib/endpoints/inventory/fares.js +95 -72
- package/lib/endpoints/inventory/fees.js +68 -50
- package/lib/endpoints/inventory/filtered-trips-v2.js +23 -21
- package/lib/endpoints/inventory/filtered-trips.js +50 -39
- package/lib/endpoints/inventory/financing-costs.js +78 -61
- package/lib/endpoints/inventory/garages.js +72 -59
- package/lib/endpoints/inventory/getnet-terminals.js +78 -60
- package/lib/endpoints/inventory/gift-certificate-definitions.js +84 -66
- package/lib/endpoints/inventory/healthcheck.js +4 -8
- package/lib/endpoints/inventory/holidays.js +83 -61
- package/lib/endpoints/inventory/insurances.js +68 -57
- package/lib/endpoints/inventory/insurancesCost.js +24 -24
- package/lib/endpoints/inventory/items.js +86 -64
- package/lib/endpoints/inventory/journey-prices.js +83 -61
- package/lib/endpoints/inventory/labels.js +83 -61
- package/lib/endpoints/inventory/marital-status.js +82 -67
- package/lib/endpoints/inventory/marketplace-modifiers.js +74 -57
- package/lib/endpoints/inventory/mit-terminal-settings.js +78 -59
- package/lib/endpoints/inventory/mit-terminals.js +74 -57
- package/lib/endpoints/inventory/operating-companies.js +126 -91
- package/lib/endpoints/inventory/operation-messages.js +85 -63
- package/lib/endpoints/inventory/operation-reasons.js +86 -67
- package/lib/endpoints/inventory/parcel-zones.js +52 -40
- package/lib/endpoints/inventory/pay-on-accounts.js +22 -24
- package/lib/endpoints/inventory/payment-terminals.js +74 -57
- package/lib/endpoints/inventory/prisma-terminals.js +78 -59
- package/lib/endpoints/inventory/products.js +90 -70
- package/lib/endpoints/inventory/promos.js +138 -95
- package/lib/endpoints/inventory/regions.js +78 -59
- package/lib/endpoints/inventory/routes.js +323 -262
- package/lib/endpoints/inventory/schedule-groups.js +69 -52
- package/lib/endpoints/inventory/schedules.js +171 -143
- package/lib/endpoints/inventory/seatclasses.js +82 -67
- package/lib/endpoints/inventory/seatfees.js +60 -48
- package/lib/endpoints/inventory/seatmaps.js +108 -84
- package/lib/endpoints/inventory/segments-information-tables.js +22 -23
- package/lib/endpoints/inventory/segments-information.js +78 -59
- package/lib/endpoints/inventory/service-numbers.js +64 -50
- package/lib/endpoints/inventory/service-types.js +74 -57
- package/lib/endpoints/inventory/ssrs.js +18 -20
- package/lib/endpoints/inventory/station-classes.js +79 -61
- package/lib/endpoints/inventory/station-groups.js +18 -20
- package/lib/endpoints/inventory/stations-provinces.js +18 -20
- package/lib/endpoints/inventory/stations-zones.js +18 -20
- package/lib/endpoints/inventory/stations.js +61 -47
- package/lib/endpoints/inventory/taxes.js +137 -98
- package/lib/endpoints/inventory/travel-routes.js +64 -50
- package/lib/endpoints/inventory/traveller-card-providers-types.js +19 -19
- package/lib/endpoints/inventory/traveller-card-providers.js +68 -50
- package/lib/endpoints/inventory/traveller-card-types.js +82 -59
- package/lib/endpoints/inventory/trip-ids.js +21 -21
- package/lib/endpoints/inventory/trips.js +48 -41
- package/lib/endpoints/inventory/vehicle-types.js +19 -19
- package/lib/endpoints/inventory/vehicles.js +111 -83
- package/lib/endpoints/inventory/zone-price-overages.js +74 -57
- package/lib/endpoints/inventory/zone-prices.js +74 -57
- package/lib/endpoints/invoices/dlink.js +37 -34
- package/lib/endpoints/invoices/docs.js +4 -8
- package/lib/endpoints/invoices/emails.js +22 -23
- package/lib/endpoints/invoices/gti.js +37 -34
- package/lib/endpoints/invoices/infile.js +37 -34
- package/lib/endpoints/invoices/infileJson.js +37 -34
- package/lib/endpoints/invoices/invoices.js +78 -63
- package/lib/endpoints/invoices/pdfs.js +22 -24
- package/lib/endpoints/invoices/providers.js +82 -67
- package/lib/endpoints/invoices/providersSequences.js +89 -74
- package/lib/endpoints/invoices/system.js +37 -34
- package/lib/endpoints/invoices/tax-ids.js +20 -21
- package/lib/endpoints/loyalty/movements.js +55 -49
- package/lib/endpoints/loyalty/programs.js +50 -41
- package/lib/endpoints/notifications/customers.js +33 -31
- package/lib/endpoints/notifications/email.js +20 -21
- package/lib/endpoints/notifications/external-customers.js +35 -30
- package/lib/endpoints/notifications/manifest-notifications.js +31 -33
- package/lib/endpoints/notifications/notify.js +112 -81
- package/lib/endpoints/notifications/orders-rules-validations.js +22 -22
- package/lib/endpoints/notifications/pdf-data.js +56 -64
- package/lib/endpoints/notifications/pdfs.js +48 -55
- package/lib/endpoints/notifications/printed-tickets.js +31 -27
- package/lib/endpoints/notifications/salesforce.js +19 -19
- package/lib/endpoints/notifications/short-urls.js +38 -33
- package/lib/endpoints/notifications/twilio.js +57 -46
- package/lib/endpoints/operations/accounting_items.js +30 -36
- package/lib/endpoints/operations/applied_insurance.js +25 -20
- package/lib/endpoints/operations/calendar_entries.js +18 -20
- package/lib/endpoints/operations/cancellation_settings.js +33 -28
- package/lib/endpoints/operations/docs.js +5 -9
- package/lib/endpoints/operations/external-bookings.js +35 -31
- package/lib/endpoints/operations/flexpasses.js +22 -22
- package/lib/endpoints/operations/gift-certificates.js +25 -23
- package/lib/endpoints/operations/loans.js +30 -36
- package/lib/endpoints/operations/manifest.js +469 -372
- package/lib/endpoints/operations/manifest_leg_for_tickets.js +23 -23
- package/lib/endpoints/operations/movements.js +21 -22
- package/lib/endpoints/operations/outlook-trips.js +20 -21
- package/lib/endpoints/operations/pago-express.js +55 -39
- package/lib/endpoints/operations/parcels.js +96 -67
- package/lib/endpoints/operations/parcels_manifests.js +102 -81
- package/lib/endpoints/operations/passenger_check_in_info.js +66 -52
- package/lib/endpoints/operations/redemption.js +52 -40
- package/lib/endpoints/operations/rms.js +35 -33
- package/lib/endpoints/operations/scheduled_notifications.js +80 -61
- package/lib/endpoints/operations/segments.js +24 -24
- package/lib/endpoints/operations/sold-items-fulfillment.js +20 -21
- package/lib/endpoints/operations/sold-items.js +35 -30
- package/lib/endpoints/operations/tickets.js +109 -78
- package/lib/endpoints/operations/transaction.js +22 -22
- package/lib/endpoints/operations/transactions.js +178 -135
- package/lib/endpoints/operations/transport_regulations.js +22 -22
- package/lib/endpoints/operations/trip_change_info.js +23 -23
- package/lib/endpoints/operations/vehicle_assignments.js +60 -48
- package/lib/endpoints/operations/vouchers.js +32 -35
- package/lib/endpoints/operations/waitlists.js +62 -47
- package/lib/endpoints/ratality/auth.js +10 -14
- package/lib/endpoints/ratality/clients.js +30 -28
- package/lib/endpoints/ratality/integrations.js +43 -36
- package/lib/endpoints/reports/custom-reports.js +50 -39
- package/lib/endpoints/reports/email.js +20 -19
- package/lib/endpoints/reports/report-types.js +35 -30
- package/lib/endpoints/reports/trip-manifests.js +20 -21
- package/lib/endpoints/sales/bundles.js +18 -20
- package/lib/endpoints/sales/cancellations.js +48 -34
- package/lib/endpoints/sales/cart-promo.js +37 -34
- package/lib/endpoints/sales/cart.js +258 -166
- package/lib/endpoints/sales/check-in-info.js +22 -23
- package/lib/endpoints/sales/custom-fields.js +18 -20
- package/lib/endpoints/sales/docs.js +4 -8
- package/lib/endpoints/sales/flexpasses.js +21 -21
- package/lib/endpoints/sales/gift-certificates.js +20 -22
- package/lib/endpoints/sales/order.js +66 -53
- package/lib/endpoints/sales/parcel-quotes.js +20 -20
- package/lib/endpoints/sales/payment-providers.js +20 -21
- package/lib/endpoints/sales/redeemable-items.js +32 -31
- package/lib/endpoints/sales/sync-entry.js +21 -21
- package/lib/endpoints/sales/voucher.js +19 -20
- package/lib/endpoints/seatmaps/access-ticket.js +19 -19
- package/lib/endpoints/seatmaps/seat.js +21 -21
- package/lib/endpoints/uploads/files.js +26 -24
- package/lib/endpoints/uploads/images.js +26 -24
- package/lib/endpoints/webhooks/events.js +24 -24
- package/lib/endpoints/webhooks/subscriptions.js +80 -60
- package/lib/endpoints/webhooks/undelivered.js +103 -73
- package/lib/endpoints/webhooks/webhooks.js +20 -20
- package/lib/initializedClient.js +3 -5
- package/lib/productionDefaults.js +6 -8
- package/package.json +18 -18
- package/src/client.js +1 -1
- package/src/endpoints/operations/transactions.js +1 -1
- package/src/endpoints/sales/cart.js +31 -1
- package/test/endpoints/sales/cart.test.js +6 -0
- package/tools/build-standalone.mjs +15 -0
- package/.eslint-report.json +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -3
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
/* eslint-disable max-len */
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
function get({
|
|
52
|
+
token,
|
|
53
|
+
jwtToken,
|
|
54
|
+
id,
|
|
55
|
+
headers
|
|
56
|
+
} = {}) {
|
|
61
57
|
return client({
|
|
62
|
-
url:
|
|
63
|
-
headers: authorizationHeaders({
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
function getV2({
|
|
78
|
+
token,
|
|
79
|
+
jwtToken,
|
|
80
|
+
id,
|
|
81
|
+
headers
|
|
82
|
+
} = {}) {
|
|
83
83
|
return client({
|
|
84
|
-
url:
|
|
85
|
-
headers: authorizationHeaders({
|
|
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(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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({
|
|
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(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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({
|
|
140
|
+
headers: authorizationHeaders({
|
|
141
|
+
token,
|
|
142
|
+
jwtToken,
|
|
143
|
+
internalAuthTokenProvider,
|
|
144
|
+
headers
|
|
145
|
+
}),
|
|
133
146
|
params: query,
|
|
134
|
-
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(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
186
|
+
function update({
|
|
187
|
+
token,
|
|
188
|
+
jwtToken,
|
|
189
|
+
userId,
|
|
190
|
+
user,
|
|
191
|
+
headers
|
|
192
|
+
}) {
|
|
175
193
|
return client({
|
|
176
|
-
url:
|
|
194
|
+
url: `/users/${userId}`,
|
|
177
195
|
method: "put",
|
|
178
|
-
headers: authorizationHeaders({
|
|
179
|
-
|
|
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(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
function deleteUser({
|
|
218
|
+
token,
|
|
219
|
+
jwtToken,
|
|
220
|
+
id,
|
|
221
|
+
headers
|
|
222
|
+
}) {
|
|
198
223
|
return client({
|
|
199
|
-
url:
|
|
224
|
+
url: `/users/${id}`,
|
|
200
225
|
method: "delete",
|
|
201
|
-
headers: authorizationHeaders({
|
|
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(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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({
|
|
224
|
-
|
|
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(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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({
|
|
247
|
-
|
|
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(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
304
|
+
function startMfa({
|
|
305
|
+
token,
|
|
306
|
+
jwtToken,
|
|
307
|
+
userId,
|
|
308
|
+
headers
|
|
309
|
+
}) {
|
|
266
310
|
return client({
|
|
267
|
-
url:
|
|
311
|
+
url: `/users/${userId}/mfa`,
|
|
268
312
|
method: "post",
|
|
269
|
-
headers: authorizationHeaders({
|
|
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(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
332
|
+
function confirmMfa({
|
|
333
|
+
token,
|
|
334
|
+
jwtToken,
|
|
335
|
+
userId,
|
|
336
|
+
totpToken,
|
|
337
|
+
headers
|
|
338
|
+
}) {
|
|
290
339
|
return client({
|
|
291
|
-
url:
|
|
340
|
+
url: `/users/${userId}/mfa`,
|
|
292
341
|
method: "put",
|
|
293
|
-
headers: authorizationHeaders({
|
|
294
|
-
|
|
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(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
363
|
+
function disableMfa({
|
|
364
|
+
token,
|
|
365
|
+
jwtToken,
|
|
366
|
+
userId,
|
|
367
|
+
headers
|
|
368
|
+
}) {
|
|
313
369
|
return client({
|
|
314
|
-
url:
|
|
370
|
+
url: `/users/${userId}/mfa`,
|
|
315
371
|
method: "delete",
|
|
316
|
-
headers: authorizationHeaders({
|
|
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
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
391
|
+
get({
|
|
392
|
+
token,
|
|
393
|
+
jwtToken,
|
|
394
|
+
userId,
|
|
395
|
+
sequenceId,
|
|
396
|
+
headers
|
|
397
|
+
}) {
|
|
338
398
|
return client({
|
|
339
|
-
url:
|
|
340
|
-
headers: authorizationHeaders({
|
|
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
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
418
|
+
all({
|
|
419
|
+
token,
|
|
420
|
+
jwtToken,
|
|
421
|
+
userId,
|
|
422
|
+
query = {},
|
|
423
|
+
headers
|
|
424
|
+
}) {
|
|
362
425
|
return client({
|
|
363
|
-
url:
|
|
426
|
+
url: `/users/${userId}/sequences`,
|
|
364
427
|
params: query,
|
|
365
|
-
headers: authorizationHeaders({
|
|
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
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
446
|
+
create({
|
|
447
|
+
jwtToken,
|
|
448
|
+
token,
|
|
449
|
+
userId,
|
|
450
|
+
sequence,
|
|
451
|
+
headers
|
|
452
|
+
}) {
|
|
386
453
|
return client({
|
|
387
|
-
url:
|
|
454
|
+
url: `/users/${userId}/sequences`,
|
|
388
455
|
method: "post",
|
|
389
|
-
headers: authorizationHeaders({
|
|
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
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
476
|
+
update({
|
|
477
|
+
jwtToken,
|
|
478
|
+
token,
|
|
479
|
+
userId,
|
|
480
|
+
sequenceId,
|
|
481
|
+
sequence,
|
|
482
|
+
headers
|
|
483
|
+
}) {
|
|
413
484
|
return client({
|
|
414
|
-
url:
|
|
485
|
+
url: `/users/${userId}/sequences/${sequenceId}`,
|
|
415
486
|
method: "put",
|
|
416
|
-
headers: authorizationHeaders({
|
|
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
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
507
|
+
transfer({
|
|
508
|
+
jwtToken,
|
|
509
|
+
token,
|
|
510
|
+
userId,
|
|
511
|
+
sequenceId,
|
|
512
|
+
newUserId,
|
|
513
|
+
headers
|
|
514
|
+
}) {
|
|
440
515
|
return client({
|
|
441
|
-
url:
|
|
516
|
+
url: `/users/${userId}/sequences/${sequenceId}`,
|
|
442
517
|
method: "patch",
|
|
443
|
-
headers: authorizationHeaders({
|
|
518
|
+
headers: authorizationHeaders({
|
|
519
|
+
token,
|
|
520
|
+
jwtToken,
|
|
521
|
+
internalAuthTokenProvider,
|
|
522
|
+
headers
|
|
523
|
+
}),
|
|
444
524
|
data: {
|
|
445
525
|
operation: "transfer",
|
|
446
|
-
newUserId
|
|
526
|
+
newUserId
|
|
447
527
|
}
|
|
448
528
|
});
|
|
449
529
|
}
|
|
450
530
|
};
|
|
451
|
-
|
|
452
531
|
return {
|
|
453
|
-
get
|
|
454
|
-
getV2
|
|
455
|
-
all
|
|
456
|
-
create
|
|
457
|
-
login
|
|
458
|
-
update
|
|
532
|
+
get,
|
|
533
|
+
getV2,
|
|
534
|
+
all,
|
|
535
|
+
create,
|
|
536
|
+
login,
|
|
537
|
+
update,
|
|
459
538
|
delete: deleteUser,
|
|
460
|
-
createOrUpdateMany
|
|
461
|
-
impersonate
|
|
462
|
-
startMfa
|
|
463
|
-
confirmMfa
|
|
464
|
-
disableMfa
|
|
465
|
-
sequences
|
|
539
|
+
createOrUpdateMany,
|
|
540
|
+
impersonate,
|
|
541
|
+
startMfa,
|
|
542
|
+
confirmMfa,
|
|
543
|
+
disableMfa,
|
|
544
|
+
sequences
|
|
466
545
|
};
|
|
467
546
|
}
|
|
468
|
-
|
|
469
547
|
module.exports = usersFactory;
|