btrz-api-client 8.31.0 → 8.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/jsdoc-endpoints.mdc +1 -1
- package/lib/client-standalone-min.js +3 -3
- package/lib/client.js +3 -0
- package/lib/endpoints/accounts/agencies.js +52 -0
- package/lib/endpoints/accounts/application-settings.js +19 -18
- package/lib/endpoints/accounts/applications.js +8 -7
- package/lib/endpoints/accounts/customers.js +27 -24
- package/lib/endpoints/accounts/domains.js +16 -11
- package/lib/endpoints/accounts/email-settings.js +22 -18
- package/lib/endpoints/accounts/email-templates.js +8 -4
- package/lib/endpoints/accounts/exchange-rates.js +12 -7
- package/lib/endpoints/accounts/exchange-receipts.js +10 -6
- package/lib/endpoints/accounts/external-customers.js +50 -0
- package/lib/endpoints/accounts/goal-settings.js +8 -6
- package/lib/endpoints/accounts/images.js +14 -13
- package/lib/endpoints/accounts/interline.js +35 -27
- package/lib/endpoints/accounts/journey-prices-settings.js +8 -6
- package/lib/endpoints/accounts/lexicons.js +13 -13
- package/lib/endpoints/accounts/market-pricing-settings.js +7 -6
- package/lib/endpoints/accounts/multiproduct-sales-settings.js +7 -6
- package/lib/endpoints/accounts/network.js +28 -13
- package/lib/endpoints/accounts/operation-settings.js +8 -6
- package/lib/endpoints/accounts/people-lookups.js +17 -17
- package/lib/endpoints/accounts/point-to-point-settings.js +6 -6
- package/lib/endpoints/accounts/print-settings.js +9 -6
- package/lib/endpoints/accounts/print-templates.js +37 -21
- package/lib/endpoints/accounts/printers.js +10 -4
- package/lib/endpoints/accounts/rms-settings.js +19 -11
- package/lib/endpoints/accounts/salesforce-settings.js +8 -6
- package/lib/endpoints/accounts/shift-settings.js +7 -6
- package/lib/endpoints/accounts/shifts.js +13 -9
- package/lib/endpoints/accounts/sms-templates.js +28 -19
- package/lib/endpoints/accounts/sub-print-templates.js +5 -3
- package/lib/endpoints/accounts/ticket-movement-settings.js +8 -5
- package/lib/endpoints/accounts/travellers.js +18 -12
- package/lib/endpoints/accounts/trusted-machines.js +11 -8
- package/lib/endpoints/accounts/twilio-settings.js +8 -5
- package/lib/endpoints/accounts/users.js +105 -63
- package/lib/endpoints/accounts/verified-emails.js +130 -0
- package/lib/endpoints/accounts/websales-config.js +7 -5
- package/package.json +1 -1
- package/src/client.js +3 -0
- package/src/endpoints/accounts/agencies.js +40 -0
- package/src/endpoints/accounts/application-settings.js +19 -18
- package/src/endpoints/accounts/applications.js +8 -7
- package/src/endpoints/accounts/customers.js +27 -24
- package/src/endpoints/accounts/domains.js +16 -11
- package/src/endpoints/accounts/email-settings.js +22 -18
- package/src/endpoints/accounts/email-templates.js +8 -4
- package/src/endpoints/accounts/exchange-rates.js +12 -7
- package/src/endpoints/accounts/exchange-receipts.js +10 -6
- package/src/endpoints/accounts/external-customers.js +37 -0
- package/src/endpoints/accounts/goal-settings.js +8 -6
- package/src/endpoints/accounts/images.js +14 -13
- package/src/endpoints/accounts/interline.js +35 -28
- package/src/endpoints/accounts/journey-prices-settings.js +8 -6
- package/src/endpoints/accounts/lexicons.js +13 -13
- package/src/endpoints/accounts/market-pricing-settings.js +7 -6
- package/src/endpoints/accounts/multiproduct-sales-settings.js +7 -6
- package/src/endpoints/accounts/network.js +28 -14
- package/src/endpoints/accounts/operation-settings.js +8 -6
- package/src/endpoints/accounts/people-lookups.js +17 -17
- package/src/endpoints/accounts/point-to-point-settings.js +6 -6
- package/src/endpoints/accounts/print-settings.js +9 -7
- package/src/endpoints/accounts/print-templates.js +31 -19
- package/src/endpoints/accounts/printers.js +10 -5
- package/src/endpoints/accounts/rms-settings.js +19 -11
- package/src/endpoints/accounts/salesforce-settings.js +8 -6
- package/src/endpoints/accounts/shift-settings.js +7 -6
- package/src/endpoints/accounts/shifts.js +13 -9
- package/src/endpoints/accounts/sms-templates.js +28 -19
- package/src/endpoints/accounts/sub-print-templates.js +5 -3
- package/src/endpoints/accounts/ticket-movement-settings.js +8 -5
- package/src/endpoints/accounts/travellers.js +18 -12
- package/src/endpoints/accounts/trusted-machines.js +11 -8
- package/src/endpoints/accounts/twilio-settings.js +8 -5
- package/src/endpoints/accounts/users.js +42 -5
- package/src/endpoints/accounts/verified-emails.js +100 -0
- package/src/endpoints/accounts/websales-config.js +7 -5
- package/test/endpoints/accounts/agencies.test.js +58 -0
- package/test/endpoints/accounts/external-customers.test.js +62 -0
- package/test/endpoints/accounts/users.js +10 -0
- package/test/endpoints/accounts/verified-emails.test.js +35 -0
- package/types/endpoints/accounts/users.d.ts +2 -1
- package/types/endpoints/accounts/verified-emails.d.ts +19 -0
|
@@ -13,6 +13,7 @@ var _require = require("../endpoints_helpers.js"),
|
|
|
13
13
|
* @property {string} [sort] - relevance | natural | createdAsc | createdDesc | updatedAsc | updatedDesc
|
|
14
14
|
* @property {string} [templateCollectionId] - default | custom
|
|
15
15
|
* @property {string} [status] - draft | published
|
|
16
|
+
* @property {string} [agencyId] - Filter sub-templates for this agency (ObjectId)
|
|
16
17
|
* @property {string} [mainTemplateAccountId] - Filter by source provider (ObjectId)
|
|
17
18
|
* @property {string} [lang] - ISO language code (e.g. en-us)
|
|
18
19
|
* @property {number} [page] - 1-based page for pagination
|
|
@@ -47,12 +48,13 @@ function smsTemplatesFactory(_ref) {
|
|
|
47
48
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
* GET /sms-templates/types - returns available template types.
|
|
51
|
+
* GET /sms-templates/types - returns available template types.
|
|
51
52
|
* @param {Object} opts
|
|
52
53
|
* @param {string} [opts.token] - API key
|
|
53
54
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
54
55
|
* @param {Object} [opts.headers] - Optional headers
|
|
55
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
56
|
+
* @returns {Promise<import("axios").AxiosResponse<{ types: string[] }>>}
|
|
57
|
+
* @throws {import("axios").AxiosError} 401, 500
|
|
56
58
|
*/
|
|
57
59
|
function getTypes(_ref2) {
|
|
58
60
|
var token = _ref2.token,
|
|
@@ -66,13 +68,14 @@ function smsTemplatesFactory(_ref) {
|
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
/**
|
|
69
|
-
* GET /sms-templates - list SMS templates.
|
|
71
|
+
* GET /sms-templates - list SMS templates (paginated when page is provided).
|
|
70
72
|
* @param {Object} opts
|
|
71
73
|
* @param {string} [opts.token] - API key
|
|
72
74
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
|
-
* @param {SmsTemplatesListQuery} [opts.query] - Query params (providerId, type, channel, sort, etc.)
|
|
75
|
+
* @param {SmsTemplatesListQuery} [opts.query] - Query params (providerId, type, channel, sort, agencyId, etc.)
|
|
74
76
|
* @param {Object} [opts.headers] - Optional headers
|
|
75
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
77
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplates: object[], next?: string, previous?: string, totalRecords?: number, page?: number }>>}
|
|
78
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA, 401, 500
|
|
76
79
|
*/
|
|
77
80
|
function all(_ref3) {
|
|
78
81
|
var token = _ref3.token,
|
|
@@ -96,7 +99,8 @@ function smsTemplatesFactory(_ref) {
|
|
|
96
99
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
97
100
|
* @param {SmsTemplateGetByIdQuery} [opts.query] - Query params (providerId, superUserId, superUserHash)
|
|
98
101
|
* @param {Object} [opts.headers] - Optional headers
|
|
99
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
102
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
103
|
+
* @throws {import("axios").AxiosError} 400 INVALID_SMS_TEMPLATE_ID / INVALID_PROVIDER_ID, 401, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
100
104
|
*/
|
|
101
105
|
function get(_ref4) {
|
|
102
106
|
var token = _ref4.token,
|
|
@@ -114,13 +118,14 @@ function smsTemplatesFactory(_ref) {
|
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
|
-
* POST /sms-templates - create an SMS template.
|
|
121
|
+
* POST /sms-templates - create an SMS template. Body: smsTemplate (name, type, lang, txtTemplate required).
|
|
118
122
|
* @param {Object} opts
|
|
119
123
|
* @param {string} [opts.token] - API key
|
|
120
124
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
121
|
-
* @param {Object} opts.data - Request body
|
|
125
|
+
* @param {Object} opts.data - Request body (smsTemplate or root with name, type, lang, txtTemplate)
|
|
122
126
|
* @param {Object} [opts.headers] - Optional headers
|
|
123
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
127
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
128
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / TEMPLATE_* / LANG_* / TXT_TEMPLATE_REQUIRED, 401 NOT_SUPER_USER, 500
|
|
124
129
|
*/
|
|
125
130
|
function create(_ref5) {
|
|
126
131
|
var token = _ref5.token,
|
|
@@ -137,14 +142,15 @@ function smsTemplatesFactory(_ref) {
|
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
/**
|
|
140
|
-
* PUT /sms-templates/:smsTemplateId - update an SMS template.
|
|
145
|
+
* PUT /sms-templates/:smsTemplateId - update an SMS template. Body: smsTemplate (name, type, txtTemplate required; lang read-only).
|
|
141
146
|
* @param {Object} opts
|
|
142
147
|
* @param {string} [opts.token] - API key
|
|
143
148
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
144
149
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
145
|
-
* @param {Object} opts.data - Request body
|
|
150
|
+
* @param {Object} opts.data - Request body (smsTemplate or root)
|
|
146
151
|
* @param {Object} [opts.headers] - Optional headers
|
|
147
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
152
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
153
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / TEMPLATE_* / TXT_TEMPLATE_REQUIRED, 401 NOT_SUPER_USER, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
148
154
|
*/
|
|
149
155
|
function update(_ref6) {
|
|
150
156
|
var token = _ref6.token,
|
|
@@ -162,13 +168,14 @@ function smsTemplatesFactory(_ref) {
|
|
|
162
168
|
}
|
|
163
169
|
|
|
164
170
|
/**
|
|
165
|
-
* DELETE /sms-templates/:smsTemplateId - delete an SMS template.
|
|
171
|
+
* DELETE /sms-templates/:smsTemplateId - delete an SMS template.
|
|
166
172
|
* @param {Object} opts
|
|
167
173
|
* @param {string} [opts.token] - API key
|
|
168
174
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
169
175
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
170
176
|
* @param {Object} [opts.headers] - Optional headers
|
|
171
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
177
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplateId: string }>>}
|
|
178
|
+
* @throws {import("axios").AxiosError} 400 SMS_TEMPLATE_ID, 401, 404 SMS_TEMPLATE_NOT_FOUND, 500
|
|
172
179
|
*/
|
|
173
180
|
function remove(_ref7) {
|
|
174
181
|
var token = _ref7.token,
|
|
@@ -184,14 +191,15 @@ function smsTemplatesFactory(_ref) {
|
|
|
184
191
|
}
|
|
185
192
|
|
|
186
193
|
/**
|
|
187
|
-
* POST /sub-sms-templates - create a sub SMS template from a main template.
|
|
194
|
+
* POST /sub-sms-templates - create a sub SMS template from a main template.
|
|
188
195
|
* @param {Object} opts
|
|
189
196
|
* @param {string} [opts.token] - API key
|
|
190
197
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
191
198
|
* @param {string} opts.mainTemplateId - Main template id (ObjectId)
|
|
192
199
|
* @param {string} opts.agencyId - Agency id (ObjectId)
|
|
193
200
|
* @param {Object} [opts.headers] - Optional headers
|
|
194
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
201
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
202
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / MAIN_TEMPLATE_IS_NOT_CUSTOM, 401 MAIN_TEMPLATE_ACCOUNT_MISMATCH / MAIN_TEMPLATE_NOT_FROM_PROVIDER, 404 MAIN_TEMPLATE_NOT_FOUND, 500
|
|
195
203
|
*/
|
|
196
204
|
function createSub(_ref8) {
|
|
197
205
|
var token = _ref8.token,
|
|
@@ -210,15 +218,16 @@ function smsTemplatesFactory(_ref) {
|
|
|
210
218
|
|
|
211
219
|
var versions = {
|
|
212
220
|
/**
|
|
213
|
-
* PUT /sms-templates/:smsTemplateId/versions/:versionId - roll back
|
|
221
|
+
* PUT /sms-templates/:smsTemplateId/versions/:versionId - roll back SMS template to a saved version (versionId = zero-based index).
|
|
214
222
|
* @param {Object} opts
|
|
215
223
|
* @param {string} [opts.token] - API key
|
|
216
224
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
217
225
|
* @param {string} opts.smsTemplateId - Template id (ObjectId)
|
|
218
226
|
* @param {string} opts.versionId - Zero-based version index (e.g. "0", "1")
|
|
219
|
-
* @param {SmsTemplateVersionUpdateQuery} [opts.query] - Query params (superUserId, superUserHash)
|
|
227
|
+
* @param {SmsTemplateVersionUpdateQuery} [opts.query] - Query params (superUserId, superUserHash for default templates)
|
|
220
228
|
* @param {Object} [opts.headers] - Optional headers
|
|
221
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
229
|
+
* @returns {Promise<import("axios").AxiosResponse<{ smsTemplate: object }>>}
|
|
230
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA, 401 NOT_SUPER_USER, 404 SMS_TEMPLATE_NOT_FOUND / SMS_TEMPLATE_VERSION_NOT_FOUND, 500
|
|
222
231
|
*/
|
|
223
232
|
update: function update(_ref9) {
|
|
224
233
|
var token = _ref9.token,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-len */
|
|
3
4
|
var _require = require("./../endpoints_helpers.js"),
|
|
4
5
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
6
|
|
|
@@ -17,13 +18,14 @@ function subPrintTemplatesFactory(_ref) {
|
|
|
17
18
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* POST /sub-print-templates - create a sub print template
|
|
21
|
+
* POST /sub-print-templates - create a sub print template from a main template (body: agencyId, mainTemplateId).
|
|
21
22
|
* @param {Object} opts
|
|
22
23
|
* @param {string} [opts.token] - API key
|
|
23
24
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
24
|
-
* @param {Object} opts.subPrintTemplate -
|
|
25
|
+
* @param {Object} opts.subPrintTemplate - Payload with agencyId and mainTemplateId (both ObjectIds)
|
|
25
26
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
27
|
+
* @returns {Promise<import("axios").AxiosResponse<{ printTemplate: object }>>}
|
|
28
|
+
* @throws {import("axios").AxiosError} 400 WRONG_DATA / MAIN_TEMPLATE_IS_NOT_CUSTOM, 401 MAIN_TEMPLATE_ACCOUNT_MISMATCH / MAIN_TEMPLATE_NOT_FROM_PROVIDER, 404 MAIN_TEMPLATE_NOT_FOUND, 500
|
|
27
29
|
*/
|
|
28
30
|
function create(_ref2) {
|
|
29
31
|
var jwtToken = _ref2.jwtToken,
|
|
@@ -17,12 +17,13 @@ function ticketMovementSettingsFactory(_ref) {
|
|
|
17
17
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* GET /ticket-movement-settings - get ticket movement settings
|
|
20
|
+
* GET /ticket-movement-settings - get ticket movement settings for the account.
|
|
21
|
+
* No query or path parameters. See get-handler getSpec() in btrz-api-accounts for response schema.
|
|
21
22
|
* @param {Object} opts
|
|
22
23
|
* @param {string} [opts.token] - API key
|
|
23
24
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
24
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<Object>>} Response body: ticket movement settings object. Errors: 401, 500
|
|
26
27
|
*/
|
|
27
28
|
function get(_ref2) {
|
|
28
29
|
var token = _ref2.token,
|
|
@@ -36,13 +37,15 @@ function ticketMovementSettingsFactory(_ref) {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
* PUT /ticket-movement-settings - update ticket movement settings
|
|
40
|
+
* PUT /ticket-movement-settings - update ticket movement settings for the account.
|
|
41
|
+
* Body must include all required fields (see put-handler getSpec() in btrz-api-accounts).
|
|
42
|
+
* Side effect: persists to account.preferences.ticketMovements.
|
|
40
43
|
* @param {Object} opts
|
|
41
44
|
* @param {string} [opts.token] - API key
|
|
42
45
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
43
|
-
* @param {Object} opts.ticketMovementSettings -
|
|
46
|
+
* @param {Object} opts.ticketMovementSettings - Full settings payload (see put-handler getSpec())
|
|
44
47
|
* @param {Object} [opts.headers] - Optional headers
|
|
45
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
48
|
+
* @returns {Promise<import("axios").AxiosResponse<Object>>} Updated settings. Errors: 400, 401, 500
|
|
46
49
|
*/
|
|
47
50
|
function update(_ref3) {
|
|
48
51
|
var token = _ref3.token,
|
|
@@ -31,13 +31,14 @@ function travellersFactory(_ref) {
|
|
|
31
31
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* GET /travellers - list travellers.
|
|
34
|
+
* GET /travellers - list travellers for the account. See get-handler getSpec() in btrz-api-accounts.
|
|
35
35
|
* @param {Object} opts
|
|
36
36
|
* @param {string} [opts.token] - API key
|
|
37
37
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
38
38
|
* @param {TravellersListQuery} [opts.query] - Query params (customerId, page, providerIds)
|
|
39
39
|
* @param {Object} [opts.headers] - Optional headers
|
|
40
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
40
|
+
* @returns {Promise<import("axios").AxiosResponse<{ travellers: Array, page?: number, count?: number }>>}
|
|
41
|
+
* Errors: 401, 404 (CUSTOMER_NOT_FOUND), 500
|
|
41
42
|
*/
|
|
42
43
|
function all(_ref2) {
|
|
43
44
|
var token = _ref2.token,
|
|
@@ -53,13 +54,15 @@ function travellersFactory(_ref) {
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
/**
|
|
56
|
-
* GET /travellers/:id - get a traveller.
|
|
57
|
+
* GET /travellers/:id - get a traveller by id. See get-by-id-handler getSpec() in btrz-api-accounts.
|
|
57
58
|
* @param {Object} opts
|
|
58
59
|
* @param {string} [opts.token] - API key
|
|
59
60
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
60
61
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
62
|
+
* @param {Object} [opts.query] - Optional query params
|
|
61
63
|
* @param {Object} [opts.headers] - Optional headers
|
|
62
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
64
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
65
|
+
* Errors: 400, 401, 404 (TRAVELLER_NOT_FOUND), 500
|
|
63
66
|
*/
|
|
64
67
|
function get(_ref3) {
|
|
65
68
|
var token = _ref3.token,
|
|
@@ -78,15 +81,16 @@ function travellersFactory(_ref) {
|
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
/**
|
|
81
|
-
* PUT /travellers/:id - update a traveller.
|
|
84
|
+
* PUT /travellers/:id - update a traveller. See put-handler getSpec() in btrz-api-accounts.
|
|
82
85
|
* @param {Object} opts
|
|
83
86
|
* @param {string} [opts.token] - API key
|
|
84
87
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
85
88
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
86
|
-
* @param {Object} opts.data - Traveller payload
|
|
89
|
+
* @param {Object} opts.data - Traveller payload (TravellerPutData)
|
|
87
90
|
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
88
91
|
* @param {Object} [opts.headers] - Optional headers
|
|
89
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
92
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
93
|
+
* Errors: 400, 401, 404, 409, 500
|
|
90
94
|
*/
|
|
91
95
|
function update(_ref4) {
|
|
92
96
|
var token = _ref4.token,
|
|
@@ -107,14 +111,15 @@ function travellersFactory(_ref) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
|
-
* DELETE /travellers/:id - remove a traveller.
|
|
114
|
+
* DELETE /travellers/:id - remove a traveller. Returns 204 No Content. See delete-handler getSpec().
|
|
111
115
|
* @param {Object} opts
|
|
112
116
|
* @param {string} [opts.token] - API key
|
|
113
117
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
114
118
|
* @param {string} opts.id - Traveller id (ObjectId)
|
|
115
119
|
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
116
120
|
* @param {Object} [opts.headers] - Optional headers
|
|
117
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
121
|
+
* @returns {Promise<import("axios").AxiosResponse<void>>}
|
|
122
|
+
* Errors: 400, 401, 404 (TRAVELLER_NOT_FOUND), 500
|
|
118
123
|
*/
|
|
119
124
|
function remove(_ref5) {
|
|
120
125
|
var token = _ref5.token,
|
|
@@ -133,14 +138,15 @@ function travellersFactory(_ref) {
|
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
/**
|
|
136
|
-
* POST /travellers - create a traveller.
|
|
141
|
+
* POST /travellers - create a traveller. Returns 201. See post-handler getSpec() in btrz-api-accounts.
|
|
137
142
|
* @param {Object} opts
|
|
138
143
|
* @param {string} [opts.token] - API key
|
|
139
144
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
140
|
-
* @param {Object} opts.data - Traveller payload
|
|
145
|
+
* @param {Object} opts.data - Traveller payload (TravellerPostData: customerId, fareId, cards, etc.)
|
|
141
146
|
* @param {TravellerProviderIdsQuery} [opts.query] - Query params (providerIds)
|
|
142
147
|
* @param {Object} [opts.headers] - Optional headers
|
|
143
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
148
|
+
* @returns {Promise<import("axios").AxiosResponse<{ traveller: Object }>>}
|
|
149
|
+
* Errors: 400, 401, 404, 409, 500
|
|
144
150
|
*/
|
|
145
151
|
function create(_ref6) {
|
|
146
152
|
var token = _ref6.token,
|
|
@@ -25,13 +25,14 @@ function trustedMachinesFactory(_ref) {
|
|
|
25
25
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* POST /trusted-machines -
|
|
28
|
+
* POST /trusted-machines - trust the machine (hideInDocumentation: true in API). Sets cookie via Set-Cookie.
|
|
29
29
|
* @param {Object} opts
|
|
30
30
|
* @param {string} [opts.token] - API key
|
|
31
31
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
32
|
-
* @param {Object} opts.data -
|
|
32
|
+
* @param {Object} opts.data - Body (NewTrustedMachine: expirationDays, browserFingerprint, etc.)
|
|
33
33
|
* @param {Object} [opts.headers] - Optional headers
|
|
34
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
34
|
+
* @returns {Promise<import("axios").AxiosResponse<{ result: string, trustedMachine: Object }>>}
|
|
35
|
+
* Errors: 400, 401, 409, 500
|
|
35
36
|
*/
|
|
36
37
|
function create(_ref2) {
|
|
37
38
|
var token = _ref2.token,
|
|
@@ -49,13 +50,14 @@ function trustedMachinesFactory(_ref) {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
|
-
* GET /trusted-machines/:id - get a trusted machine.
|
|
53
|
+
* GET /trusted-machines/:id - get a trusted machine by id. See get-by-id-handler getSpec() in btrz-api-accounts.
|
|
53
54
|
* @param {Object} opts
|
|
54
55
|
* @param {string} [opts.token] - API key
|
|
55
56
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
56
57
|
* @param {string} opts.id - Trusted machine id (ObjectId)
|
|
57
58
|
* @param {Object} [opts.headers] - Optional headers
|
|
58
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
59
|
+
* @returns {Promise<import("axios").AxiosResponse<{ trustedmachine: Object }>>}
|
|
60
|
+
* Errors: 400, 401, 404 (TRUSTED_MACHINE_NOT_FOUND), 500
|
|
59
61
|
*/
|
|
60
62
|
function get(_ref3) {
|
|
61
63
|
var token = _ref3.token,
|
|
@@ -71,13 +73,14 @@ function trustedMachinesFactory(_ref) {
|
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
/**
|
|
74
|
-
* GET /trusted-machines - list trusted machines.
|
|
76
|
+
* GET /trusted-machines - list enabled trusted machines for the account. See get-handler getSpec().
|
|
75
77
|
* @param {Object} opts
|
|
76
78
|
* @param {string} [opts.token] - API key
|
|
77
79
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
78
|
-
* @param {TrustedMachinesListQuery} [opts.query] - Query params (userId, page, recordsPerPage)
|
|
80
|
+
* @param {TrustedMachinesListQuery} [opts.query] - Query params (userId, page, recordsPerPage max 100)
|
|
79
81
|
* @param {Object} [opts.headers] - Optional headers
|
|
80
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse<{ trustedmachines: Array }>>}
|
|
83
|
+
* Paginated. Errors: 401, 500
|
|
81
84
|
*/
|
|
82
85
|
function all(_ref4) {
|
|
83
86
|
var token = _ref4.token,
|
|
@@ -17,12 +17,14 @@ function twilioSettingsFactory(_ref) {
|
|
|
17
17
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* GET /twilio-settings - get Twilio settings.
|
|
20
|
+
* GET /twilio-settings - get Twilio settings for the account. See get-handler getSpec() in btrz-api-accounts.
|
|
21
21
|
* @param {Object} opts
|
|
22
22
|
* @param {string} [opts.token] - API key
|
|
23
23
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
24
|
+
* @param {Object} [opts.query] - Optional query params
|
|
24
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<{ twilioSettings: Object }>>}
|
|
27
|
+
* Errors: 401, 404 (TWILIO_SETTINGS_NOT_FOUND), 500
|
|
26
28
|
*/
|
|
27
29
|
function get(_ref2) {
|
|
28
30
|
var jwtToken = _ref2.jwtToken,
|
|
@@ -38,13 +40,14 @@ function twilioSettingsFactory(_ref) {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* PUT /twilio-settings - update Twilio settings.
|
|
43
|
+
* PUT /twilio-settings - update Twilio settings. See put-handler getSpec() in btrz-api-accounts.
|
|
42
44
|
* @param {Object} opts
|
|
43
45
|
* @param {string} [opts.token] - API key
|
|
44
46
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
45
|
-
* @param {Object} opts.twilioSettings - Settings payload
|
|
47
|
+
* @param {Object} opts.twilioSettings - Settings payload (TwilioSettingsPayload: enabled, sendingNumber, etc.)
|
|
46
48
|
* @param {Object} [opts.headers] - Optional headers
|
|
47
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
49
|
+
* @returns {Promise<import("axios").AxiosResponse<{ twilioSettings: Object }>>}
|
|
50
|
+
* Errors: 401, 404, 409, 500
|
|
48
51
|
*/
|
|
49
52
|
function update(_ref3) {
|
|
50
53
|
var jwtToken = _ref3.jwtToken,
|