btrz-api-client 8.33.0 → 8.35.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/lib/client-standalone-min.js +3 -3
- package/lib/client.js +10 -2
- package/lib/endpoints/btrzpay/adyen.js +58 -0
- package/lib/endpoints/btrzpay/cardpointe.js +6 -3
- package/lib/endpoints/btrzpay/customerCards.js +19 -19
- package/lib/endpoints/btrzpay/customers.js +13 -13
- package/lib/endpoints/btrzpay/cybersource3ds.js +142 -0
- package/lib/endpoints/btrzpay/datalogic.js +64 -28
- package/lib/endpoints/btrzpay/oxxo.js +54 -28
- package/lib/endpoints/btrzpay/prismaTerminals.js +24 -15
- package/lib/endpoints/btrzpay/referenced-payments.js +4 -4
- package/lib/endpoints/btrzpay/square.js +8 -8
- package/lib/endpoints/btrzpay/stripe-terminals.js +16 -11
- package/lib/endpoints/btrzpay/stripe3ds.js +54 -0
- package/lib/endpoints/btrzpay/terminalPayments.js +19 -19
- package/lib/endpoints/inventory/banks.js +39 -21
- package/lib/endpoints/inventory/change-requests.js +59 -31
- package/lib/endpoints/inventory/control-classes.js +39 -20
- package/lib/endpoints/inventory/countries.js +25 -9
- package/lib/endpoints/inventory/custom-content.js +39 -21
- package/lib/endpoints/inventory/custom-fields.js +25 -17
- package/lib/endpoints/inventory/document-types.js +33 -42
- package/lib/endpoints/inventory/external-wallets.js +26 -20
- package/lib/endpoints/inventory/fees.js +19 -13
- package/lib/endpoints/inventory/filtered-trips.js +34 -8
- package/lib/endpoints/inventory/financing-costs.js +19 -14
- package/lib/endpoints/inventory/garages.js +19 -14
- package/lib/endpoints/inventory/getnet-terminals.js +20 -15
- package/lib/endpoints/inventory/gift-certificate-definitions.js +10 -5
- package/lib/endpoints/inventory/holidays.js +158 -0
- package/lib/endpoints/inventory/insurances.js +17 -13
- package/lib/endpoints/inventory/items.js +13 -9
- package/lib/endpoints/inventory/labels.js +16 -11
- package/lib/endpoints/inventory/marital-status.js +16 -11
- package/lib/endpoints/inventory/marketplace-modifiers.js +16 -11
- package/lib/endpoints/inventory/mit-terminal-settings.js +15 -10
- package/lib/endpoints/inventory/mit-terminals.js +16 -11
- package/lib/endpoints/inventory/operation-messages.js +18 -12
- package/lib/endpoints/inventory/operation-reasons.js +15 -10
- package/lib/endpoints/inventory/pay-on-accounts.js +5 -4
- package/lib/endpoints/inventory/payment-terminals.js +15 -10
- package/lib/endpoints/inventory/products.js +22 -10
- package/lib/endpoints/inventory/promos.js +27 -18
- package/lib/endpoints/inventory/segments-information-tables.js +13 -7
- package/lib/endpoints/inventory/station-groups.js +2 -4
- package/lib/endpoints/inventory/taxes.js +11 -2
- package/lib/endpoints/inventory/traveller-card-providers-types.js +6 -6
- package/lib/endpoints/inventory/trip-ids.js +67 -0
- package/lib/endpoints/inventory/trips.js +60 -13
- package/lib/endpoints/inventory/vehicle-types.js +2 -5
- package/lib/endpoints/inventory/vehicles.js +4 -2
- package/lib/endpoints/invoices/emails.js +15 -5
- package/lib/endpoints/invoices/invoices.js +46 -25
- package/lib/endpoints/invoices/pdfs.js +15 -8
- package/lib/endpoints/invoices/providers.js +42 -25
- package/lib/endpoints/invoices/tax-ids.js +11 -7
- package/lib/endpoints/notifications/customers.js +1 -1
- package/lib/endpoints/notifications/external-customers.js +54 -0
- package/lib/endpoints/notifications/pdfs.js +0 -3
- package/lib/endpoints/operations/accounting_items.js +7 -1
- package/lib/endpoints/operations/flexpasses.js +9 -7
- package/lib/endpoints/operations/gift-certificates.js +53 -0
- package/lib/endpoints/operations/loans.js +16 -10
- package/lib/endpoints/operations/movements.js +17 -6
- package/lib/endpoints/operations/pago-express.js +96 -0
- package/lib/endpoints/operations/parcels.js +11 -11
- package/lib/endpoints/operations/parcels_manifests.js +7 -4
- package/lib/endpoints/sales/cancellations.js +43 -31
- package/lib/endpoints/sales/cart.js +21 -18
- package/lib/endpoints/sales/flexpasses.js +2 -5
- package/lib/endpoints/sales/order.js +41 -7
- package/lib/endpoints/sales/parcel-quotes.js +2 -2
- package/package.json +1 -1
- package/src/client.js +10 -2
- package/src/endpoints/btrzpay/adyen.js +44 -0
- package/src/endpoints/btrzpay/cardpointe.js +6 -4
- package/src/endpoints/btrzpay/customerCards.js +19 -19
- package/src/endpoints/btrzpay/customers.js +13 -13
- package/src/endpoints/btrzpay/cybersource3ds.js +114 -0
- package/src/endpoints/btrzpay/datalogic.js +63 -28
- package/src/endpoints/btrzpay/oxxo.js +53 -26
- package/src/endpoints/btrzpay/prismaTerminals.js +24 -15
- package/src/endpoints/btrzpay/referenced-payments.js +4 -4
- package/src/endpoints/btrzpay/square.js +8 -8
- package/src/endpoints/btrzpay/stripe-terminals.js +17 -10
- package/src/endpoints/btrzpay/stripe3ds.js +40 -0
- package/src/endpoints/btrzpay/terminalPayments.js +19 -19
- package/src/endpoints/inventory/banks.js +39 -21
- package/src/endpoints/inventory/change-requests.js +59 -31
- package/src/endpoints/inventory/control-classes.js +39 -20
- package/src/endpoints/inventory/countries.js +25 -10
- package/src/endpoints/inventory/custom-content.js +39 -22
- package/src/endpoints/inventory/custom-fields.js +25 -19
- package/src/endpoints/inventory/document-types.js +34 -33
- package/src/endpoints/inventory/external-wallets.js +25 -20
- package/src/endpoints/inventory/fees.js +19 -14
- package/src/endpoints/inventory/filtered-trips.js +29 -8
- package/src/endpoints/inventory/financing-costs.js +19 -14
- package/src/endpoints/inventory/garages.js +19 -14
- package/src/endpoints/inventory/getnet-terminals.js +20 -15
- package/src/endpoints/inventory/gift-certificate-definitions.js +10 -5
- package/src/endpoints/inventory/holidays.js +121 -0
- package/src/endpoints/inventory/insurances.js +17 -13
- package/src/endpoints/inventory/items.js +13 -9
- package/src/endpoints/inventory/labels.js +16 -11
- package/src/endpoints/inventory/marital-status.js +16 -11
- package/src/endpoints/inventory/marketplace-modifiers.js +16 -11
- package/src/endpoints/inventory/mit-terminal-settings.js +15 -10
- package/src/endpoints/inventory/mit-terminals.js +16 -11
- package/src/endpoints/inventory/operation-messages.js +18 -12
- package/src/endpoints/inventory/operation-reasons.js +15 -10
- package/src/endpoints/inventory/pay-on-accounts.js +5 -4
- package/src/endpoints/inventory/payment-terminals.js +15 -10
- package/src/endpoints/inventory/products.js +22 -10
- package/src/endpoints/inventory/promos.js +27 -18
- package/src/endpoints/inventory/segments-information-tables.js +13 -7
- package/src/endpoints/inventory/station-groups.js +2 -4
- package/src/endpoints/inventory/taxes.js +11 -2
- package/src/endpoints/inventory/traveller-card-providers-types.js +6 -5
- package/src/endpoints/inventory/trip-ids.js +54 -0
- package/src/endpoints/inventory/trips.js +52 -14
- package/src/endpoints/inventory/vehicle-types.js +3 -4
- package/src/endpoints/inventory/vehicles.js +4 -3
- package/src/endpoints/invoices/emails.js +15 -5
- package/src/endpoints/invoices/invoices.js +46 -25
- package/src/endpoints/invoices/pdfs.js +15 -8
- package/src/endpoints/invoices/providers.js +42 -25
- package/src/endpoints/invoices/tax-ids.js +11 -7
- package/src/endpoints/notifications/customers.js +1 -1
- package/src/endpoints/notifications/external-customers.js +41 -0
- package/src/endpoints/notifications/pdfs.js +0 -3
- package/src/endpoints/operations/accounting_items.js +7 -2
- package/src/endpoints/operations/flexpasses.js +9 -7
- package/src/endpoints/operations/gift-certificates.js +39 -0
- package/src/endpoints/operations/loans.js +16 -11
- package/src/endpoints/operations/movements.js +17 -6
- package/src/endpoints/operations/pago-express.js +73 -0
- package/src/endpoints/operations/parcels.js +11 -11
- package/src/endpoints/operations/parcels_manifests.js +7 -5
- package/src/endpoints/sales/cancellations.js +43 -31
- package/src/endpoints/sales/cart.js +20 -18
- package/src/endpoints/sales/flexpasses.js +3 -4
- package/src/endpoints/sales/order.js +34 -7
- package/src/endpoints/sales/parcel-quotes.js +2 -2
- package/test/endpoints/btrzpay/adyen.tests.js +27 -0
- package/test/endpoints/btrzpay/carpointe.tests.js +14 -0
- package/test/endpoints/btrzpay/customerCards.test.js +9 -6
- package/test/endpoints/btrzpay/cybersource3ds.tests.js +55 -0
- package/test/endpoints/btrzpay/stripe-terminals.tests.js +5 -6
- package/test/endpoints/btrzpay/stripe3ds.tests.js +31 -0
- package/test/endpoints/inventory/banks.test.js +8 -10
- package/test/endpoints/inventory/filtered-trips.test.js +6 -0
- package/test/endpoints/inventory/holidays.test.js +52 -0
- package/test/endpoints/inventory/traveller-card-providers-types.test.js +3 -2
- package/test/endpoints/inventory/trip-ids.test.js +27 -0
- package/test/endpoints/inventory/trips.test.js +19 -14
- package/test/endpoints/notifications/external-customers.test.js +30 -0
- package/test/endpoints/operations/gift_certificates.test.js +37 -0
- package/test/endpoints/operations/operations.test.js +30 -0
- package/test/endpoints/sales/order.test.js +7 -1
|
@@ -25,13 +25,16 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
25
25
|
*/
|
|
26
26
|
function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
27
27
|
/**
|
|
28
|
-
* GET /change-requests
|
|
28
|
+
* GET /change-requests — List change requests with optional filters and pagination.
|
|
29
29
|
* @param {Object} opts
|
|
30
|
-
* @param {string} [opts.token] - API key
|
|
31
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
32
|
-
* @param {ChangeRequestsListQuery} [opts.query] - Query params
|
|
30
|
+
* @param {string} [opts.token] - API key (X-API-KEY)
|
|
31
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth (Authorization: Bearer)
|
|
32
|
+
* @param {ChangeRequestsListQuery} [opts.query] - Query params (type, status, createdBy, from, to, etc.)
|
|
33
33
|
* @param {Object} [opts.headers] - Optional headers
|
|
34
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
34
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequests: Object[], count: number, next: string, previous: string }>>}
|
|
35
|
+
* @throws 400 INVALID_PAGE, INVALID_TYPE_PARAMETER, INVALID_STATUS_PARAMETER, etc.
|
|
36
|
+
* @throws 401 Unauthorized
|
|
37
|
+
* @throws 500 Internal server error
|
|
35
38
|
*/
|
|
36
39
|
function all({token, jwtToken, query = {}, headers}) {
|
|
37
40
|
return client.get("/change-requests", {
|
|
@@ -41,13 +44,18 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
/**
|
|
44
|
-
* GET /change-requests/:changerequestId/manifests
|
|
47
|
+
* GET /change-requests/:changerequestId/manifests — Get manifest change request by ID. Requires multipleManifestEditing.
|
|
45
48
|
* @param {Object} opts
|
|
46
49
|
* @param {string} [opts.token] - API key
|
|
47
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
48
|
-
* @param {string} opts.changerequestId - Change request id
|
|
50
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
51
|
+
* @param {string} opts.changerequestId - Change request id (24 hex characters)
|
|
49
52
|
* @param {Object} [opts.headers] - Optional headers
|
|
50
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
53
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
54
|
+
* @throws 400 INVALID_CHANGEREQUEST_ID, FAILED_TO_FETCH_OPERATION_SETTINGS
|
|
55
|
+
* @throws 401 Unauthorized
|
|
56
|
+
* @throws 403 MULTIPLE_MANIFEST_EDIT_NOT_ALLOWED
|
|
57
|
+
* @throws 404 CHANGEREQUEST_NOT_FOUND
|
|
58
|
+
* @throws 500 Internal server error
|
|
51
59
|
*/
|
|
52
60
|
function get({changerequestId, token, jwtToken, query = {}, headers}) {
|
|
53
61
|
return client({
|
|
@@ -58,13 +66,17 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
/**
|
|
61
|
-
* POST /change-requests/manifests
|
|
69
|
+
* POST /change-requests/manifests — Create manifest change request. Emits changeRequests.manifests.created.
|
|
62
70
|
* @param {Object} opts
|
|
63
71
|
* @param {string} [opts.token] - API key
|
|
64
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
65
|
-
* @param {Object} opts.data - Manifest payload
|
|
72
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
73
|
+
* @param {Object} opts.data - Manifest change request payload (manifestId, request, routeId, scheduleId, date, etc.)
|
|
66
74
|
* @param {Object} [opts.headers] - Optional headers
|
|
67
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
75
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
76
|
+
* @throws 400 WRONG_DATA, FAILED_TO_FETCH_OPERATION_SETTINGS, MANIFEST_NOT_FOUND, etc.
|
|
77
|
+
* @throws 401 Unauthorized
|
|
78
|
+
* @throws 403 MULTIPLE_MANIFEST_EDIT_NOT_ALLOWED
|
|
79
|
+
* @throws 500 Internal server error
|
|
68
80
|
*/
|
|
69
81
|
function create({data, token, jwtToken, headers}) {
|
|
70
82
|
return client({
|
|
@@ -76,14 +88,19 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
76
88
|
}
|
|
77
89
|
|
|
78
90
|
/**
|
|
79
|
-
* PUT /change-requests/:changerequestId/manifests
|
|
91
|
+
* PUT /change-requests/:changerequestId/manifests — Update manifest change request. Emits changeRequests.manifests.updated.
|
|
80
92
|
* @param {Object} opts
|
|
81
93
|
* @param {string} [opts.token] - API key
|
|
82
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
83
|
-
* @param {string} opts.changerequestId - Change request id
|
|
84
|
-
* @param {Object} opts.data -
|
|
94
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
95
|
+
* @param {string} opts.changerequestId - Change request id (24 hex characters)
|
|
96
|
+
* @param {Object} opts.data - Update payload (status: 'approved' or 'rejected')
|
|
85
97
|
* @param {Object} [opts.headers] - Optional headers
|
|
86
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
98
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
99
|
+
* @throws 400 WRONG_DATA, CHANGEREQUEST_STATUS_NOT_PENDING, etc.
|
|
100
|
+
* @throws 401 Unauthorized
|
|
101
|
+
* @throws 403 MULTIPLE_MANIFEST_EDIT_NOT_ALLOWED
|
|
102
|
+
* @throws 404 CHANGEREQUEST_NOT_FOUND
|
|
103
|
+
* @throws 500 Internal server error
|
|
87
104
|
*/
|
|
88
105
|
function update({changerequestId, data, token, jwtToken, headers}) {
|
|
89
106
|
return client({
|
|
@@ -97,13 +114,17 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
97
114
|
/** @type {{ get: function, create: function, update: function }} */
|
|
98
115
|
const schedules = {
|
|
99
116
|
/**
|
|
100
|
-
* GET /change-requests/:changeRequestId/schedules
|
|
117
|
+
* GET /change-requests/:changeRequestId/schedules — Get schedule change request by ID.
|
|
101
118
|
* @param {Object} opts
|
|
102
119
|
* @param {string} [opts.token] - API key
|
|
103
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
104
|
-
* @param {string} opts.changeRequestId - Change request id
|
|
120
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
121
|
+
* @param {string} opts.changeRequestId - Change request id (24 hex characters)
|
|
105
122
|
* @param {Object} [opts.headers] - Optional headers
|
|
106
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
123
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
124
|
+
* @throws 400 INVALID_CHANGEREQUEST_ID, FAILED_TO_FETCH_OPERATION_SETTINGS, etc.
|
|
125
|
+
* @throws 401 Unauthorized
|
|
126
|
+
* @throws 404 CHANGEREQUEST_NOT_FOUND
|
|
127
|
+
* @throws 500 Internal server error
|
|
107
128
|
*/
|
|
108
129
|
get({changeRequestId, token, jwtToken, query = {}, headers}) {
|
|
109
130
|
return client({
|
|
@@ -114,13 +135,16 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
114
135
|
},
|
|
115
136
|
|
|
116
137
|
/**
|
|
117
|
-
* POST /change-requests/schedules
|
|
138
|
+
* POST /change-requests/schedules — Create a schedule change request. Emits webhook changeRequests.schedules.created.
|
|
118
139
|
* @param {Object} opts
|
|
119
140
|
* @param {string} [opts.token] - API key
|
|
120
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
121
|
-
* @param {Object} opts.data - Schedule payload
|
|
141
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
142
|
+
* @param {Object} opts.data - Schedule change request payload (request, routeId, scheduleId, legs, etc.)
|
|
122
143
|
* @param {Object} [opts.headers] - Optional headers
|
|
123
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
144
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
145
|
+
* @throws 400 WRONG_DATA, FAILED_TO_FETCH_OPERATION_SETTINGS, etc.
|
|
146
|
+
* @throws 401 Unauthorized
|
|
147
|
+
* @throws 500 Internal server error
|
|
124
148
|
*/
|
|
125
149
|
create({data, token, jwtToken, headers}) {
|
|
126
150
|
return client({
|
|
@@ -132,14 +156,18 @@ function changeRequestsFactory({client, internalAuthTokenProvider}) {
|
|
|
132
156
|
},
|
|
133
157
|
|
|
134
158
|
/**
|
|
135
|
-
* PUT
|
|
159
|
+
* PUT .../schedules — Update schedule change request (approve/reject). Emits changeRequests.schedules.updated.
|
|
136
160
|
* @param {Object} opts
|
|
137
161
|
* @param {string} [opts.token] - API key
|
|
138
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
139
|
-
* @param {string} opts.changeRequestId - Change request id
|
|
140
|
-
* @param {Object} opts.data -
|
|
162
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
163
|
+
* @param {string} opts.changeRequestId - Change request id (24 hex characters)
|
|
164
|
+
* @param {Object} opts.data - Update payload (status: 'approved' or 'rejected')
|
|
141
165
|
* @param {Object} [opts.headers] - Optional headers
|
|
142
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
166
|
+
* @returns {Promise<import("axios").AxiosResponse<{ changeRequest: Object }>>}
|
|
167
|
+
* @throws 400 WRONG_DATA, CHANGEREQUEST_STATUS_NOT_PENDING, etc.
|
|
168
|
+
* @throws 401 Unauthorized
|
|
169
|
+
* @throws 404 CHANGEREQUEST_NOT_FOUND
|
|
170
|
+
* @throws 500 Internal server error
|
|
143
171
|
*/
|
|
144
172
|
update({changeRequestId, data, token, jwtToken, headers}) {
|
|
145
173
|
return client({
|
|
@@ -41,13 +41,17 @@ const {
|
|
|
41
41
|
*/
|
|
42
42
|
function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
43
43
|
/**
|
|
44
|
-
* GET /control-classes
|
|
44
|
+
* GET /control-classes — List control class roots (paginated). Emits no webhooks.
|
|
45
45
|
* @param {Object} opts
|
|
46
46
|
* @param {string} [opts.token] - API key
|
|
47
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
47
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
48
48
|
* @param {ControlClassesListQuery} [opts.query] - Query params
|
|
49
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
50
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
50
|
+
* @returns {Promise<import("axios").AxiosResponse<{ controlClasses: Object[], authorizationsEnabled?: boolean }>>}
|
|
51
|
+
* @throws 400 INVALID_PAGE, INVALID_SCHEDULE_ID, INVALID_ASSIGNED_SCHEDULE_ID
|
|
52
|
+
* @throws 401 Unauthorized
|
|
53
|
+
* @throws 404 SCHEDULE_NOT_FOUND
|
|
54
|
+
* @throws 500 Internal server error
|
|
51
55
|
*/
|
|
52
56
|
function all({
|
|
53
57
|
token,
|
|
@@ -62,14 +66,18 @@ function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
/**
|
|
65
|
-
* GET /control-classes/:controlClassId
|
|
69
|
+
* GET /control-classes/:controlClassId — Get one control class (optional tree, schedules).
|
|
66
70
|
* @param {Object} opts
|
|
67
71
|
* @param {string} [opts.token] - API key
|
|
68
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
69
|
-
* @param {string} opts.controlClassId - Control class id
|
|
72
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
73
|
+
* @param {string} opts.controlClassId - Control class id (24 hex)
|
|
70
74
|
* @param {ControlClassGetQuery} [opts.query] - Query params (tree, scheduleId, etc.)
|
|
71
75
|
* @param {Object} [opts.headers] - Optional headers
|
|
72
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
76
|
+
* @returns {Promise<import("axios").AxiosResponse<{ controlClass, root?, parent?, siblings?, children?, schedules?, tree? }>>}
|
|
77
|
+
* @throws 400 INVALID_CONTROLCLASS_ID
|
|
78
|
+
* @throws 401 Unauthorized
|
|
79
|
+
* @throws 404 CONTROLCLASS_NOT_FOUND
|
|
80
|
+
* @throws 500 Internal server error
|
|
73
81
|
*/
|
|
74
82
|
function get({controlClassId, token, headers, jwtToken, query = {}}) {
|
|
75
83
|
return client.get(`/control-classes/${controlClassId}`, {
|
|
@@ -79,13 +87,16 @@ function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
/**
|
|
82
|
-
* POST /control-classes
|
|
90
|
+
* POST /control-classes — Create control class. Body: { controlClass }. Emits controlclasses.created.
|
|
83
91
|
* @param {Object} opts
|
|
84
92
|
* @param {string} [opts.token] - API key
|
|
85
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
86
|
-
* @param {Object} opts.controlClass -
|
|
93
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
94
|
+
* @param {Object} opts.controlClass - ControlClassData (name, props required)
|
|
87
95
|
* @param {Object} [opts.headers] - Optional headers
|
|
88
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
96
|
+
* @returns {Promise<import("axios").AxiosResponse<{ controlClass: Object }>>}
|
|
97
|
+
* @throws 400 WRONG_DATA, DUPLICATE_CLASS_NAME, NO_ROOT_PROPS, PARENT_CLASS_NOT_FOUND, etc.
|
|
98
|
+
* @throws 401 Unauthorized
|
|
99
|
+
* @throws 500 Internal server error
|
|
89
100
|
*/
|
|
90
101
|
function create({jwtToken, token, controlClass, headers}) {
|
|
91
102
|
return client({
|
|
@@ -99,13 +110,17 @@ function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
|
99
110
|
}
|
|
100
111
|
|
|
101
112
|
/**
|
|
102
|
-
* DELETE /control-classes/:controlClassId
|
|
113
|
+
* DELETE /control-classes/:controlClassId — Delete control class. Emits controlclasses.deleted.
|
|
103
114
|
* @param {Object} opts
|
|
104
115
|
* @param {string} [opts.token] - API key
|
|
105
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
106
|
-
* @param {string} opts.controlClassId - Control class id
|
|
116
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
117
|
+
* @param {string} opts.controlClassId - Control class id (24 hex)
|
|
107
118
|
* @param {Object} [opts.headers] - Optional headers
|
|
108
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
119
|
+
* @returns {Promise<import("axios").AxiosResponse<{ controlClassId: string }>>}
|
|
120
|
+
* @throws 400 INVALID_CONTROLCLASS_ID, CANNOT_DELETE_CLASS_WITH_CHILDREN
|
|
121
|
+
* @throws 401 Unauthorized
|
|
122
|
+
* @throws 404 CONTROLCLASS_NOT_FOUND
|
|
123
|
+
* @throws 500 Internal server error
|
|
109
124
|
*/
|
|
110
125
|
function remove({jwtToken, controlClassId, token, headers}) {
|
|
111
126
|
return client({
|
|
@@ -116,14 +131,18 @@ function controlClassesFactory({client, internalAuthTokenProvider}) {
|
|
|
116
131
|
}
|
|
117
132
|
|
|
118
133
|
/**
|
|
119
|
-
* PUT /control-classes/:controlClassId
|
|
134
|
+
* PUT /control-classes/:controlClassId — Update control class. Body: { controlClass }. Emits controlclasses.updated.
|
|
120
135
|
* @param {Object} opts
|
|
121
136
|
* @param {string} [opts.token] - API key
|
|
122
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
123
|
-
* @param {string} opts.controlClassId - Control class id
|
|
124
|
-
* @param {Object} opts.controlClass -
|
|
137
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
138
|
+
* @param {string} opts.controlClassId - Control class id (24 hex)
|
|
139
|
+
* @param {Object} opts.controlClass - ControlClassData (name, props required)
|
|
125
140
|
* @param {Object} [opts.headers] - Optional headers
|
|
126
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
141
|
+
* @returns {Promise<import("axios").AxiosResponse<{ controlClass: Object }>>}
|
|
142
|
+
* @throws 400 WRONG_DATA, INVALID_CONTROLCLASS_ID, DUPLICATE_CLASS_NAME, etc.
|
|
143
|
+
* @throws 401 Unauthorized
|
|
144
|
+
* @throws 404 CONTROLCLASS_NOT_FOUND
|
|
145
|
+
* @throws 500 Internal server error
|
|
127
146
|
*/
|
|
128
147
|
function update({jwtToken, token, controlClassId, controlClass, headers}) {
|
|
129
148
|
return client({
|
|
@@ -3,7 +3,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
3
3
|
/**
|
|
4
4
|
* Query params for GET /countries (btrz-api-inventory). See get-countries getSpec().
|
|
5
5
|
* @typedef {Object} CountriesListQuery
|
|
6
|
-
* @property {string} [isoCode] - Country 2 or 3
|
|
6
|
+
* @property {string} [isoCode] - Country 2- or 3-letter ISO code (must be 2 or 3 chars if provided)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Query params for GET /countries/:countryId (btrz-api-inventory). See getCountryById getSpec().
|
|
11
|
+
* @typedef {Object} CountryGetQuery
|
|
12
|
+
* @property {string} [include] - Address level to include: "provinces" (default), "counties", "cities", "neighborhoods"
|
|
13
|
+
* @property {string} [parentKey] - Parent address level to filter by when include is not provinces
|
|
7
14
|
*/
|
|
8
15
|
|
|
9
16
|
/**
|
|
@@ -15,30 +22,38 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
15
22
|
*/
|
|
16
23
|
function countriesFactory({client, internalAuthTokenProvider}) {
|
|
17
24
|
/**
|
|
18
|
-
* GET /countries
|
|
25
|
+
* GET /countries — List countries. Optional filter by isoCode (2 or 3 characters).
|
|
19
26
|
* @param {Object} opts
|
|
20
27
|
* @param {string} [opts.token] - API key
|
|
21
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
28
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
22
29
|
* @param {CountriesListQuery} [opts.query] - Query params (isoCode)
|
|
23
30
|
* @param {Object} [opts.headers] - Optional headers
|
|
24
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
31
|
+
* @returns {Promise<import("axios").AxiosResponse<{ countries: Object[] }>>}
|
|
32
|
+
* @throws 400 Validation failure (e.g. invalid isoCode length)
|
|
33
|
+
* @throws 401 Unauthorized
|
|
34
|
+
* @throws 500 Internal server error
|
|
25
35
|
*/
|
|
26
|
-
function all({token, query = {}, headers}) {
|
|
36
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
27
37
|
return client({
|
|
28
38
|
url: "/countries",
|
|
29
39
|
params: query,
|
|
30
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
40
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
31
41
|
});
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/**
|
|
35
|
-
* GET /countries/:id
|
|
45
|
+
* GET /countries/:id — Get country by id. Optional include (provinces/counties/cities/neighborhoods) and parentKey.
|
|
36
46
|
* @param {Object} opts
|
|
37
47
|
* @param {string} [opts.token] - API key
|
|
38
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
39
|
-
* @param {string} opts.id - Country id
|
|
48
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
49
|
+
* @param {string} opts.id - Country id (24 hex)
|
|
50
|
+
* @param {CountryGetQuery} [opts.query] - Query params (include, parentKey)
|
|
40
51
|
* @param {Object} [opts.headers] - Optional headers
|
|
41
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
52
|
+
* @returns {Promise<import("axios").AxiosResponse<{ country: Object }>>}
|
|
53
|
+
* @throws 400 INVALID_COUNTRY_ID
|
|
54
|
+
* @throws 401 Unauthorized
|
|
55
|
+
* @throws 404 COUNTRY_NOT_FOUND
|
|
56
|
+
* @throws 500 Internal server error
|
|
42
57
|
*/
|
|
43
58
|
function get({token, jwtToken, id, query = {}, headers}) {
|
|
44
59
|
return client({
|
|
@@ -18,13 +18,15 @@ const {
|
|
|
18
18
|
*/
|
|
19
19
|
function customContentFactory({client, internalAuthTokenProvider}) {
|
|
20
20
|
/**
|
|
21
|
-
* GET /custom-content
|
|
21
|
+
* GET /custom-content — List custom content (paginated). Query: enabled, pageId.
|
|
22
22
|
* @param {Object} opts
|
|
23
23
|
* @param {string} [opts.token] - API key
|
|
24
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
24
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
25
25
|
* @param {InventoryCustomContentQuery} [opts.query] - Query params (enabled, pageId)
|
|
26
26
|
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
27
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customContent: Object[] }>>}
|
|
28
|
+
* @throws 401 Unauthorized
|
|
29
|
+
* @throws 500 Internal server error
|
|
28
30
|
*/
|
|
29
31
|
function all({
|
|
30
32
|
token,
|
|
@@ -38,28 +40,35 @@ function customContentFactory({client, internalAuthTokenProvider}) {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* GET /custom-content/:customContentId
|
|
43
|
+
* GET /custom-content/:customContentId — Get custom content by id.
|
|
42
44
|
* @param {Object} opts
|
|
43
45
|
* @param {string} [opts.token] - API key
|
|
44
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
45
|
-
* @param {string} opts.customContentId - Custom content id
|
|
46
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
47
|
+
* @param {string} opts.customContentId - Custom content id (24 hex)
|
|
46
48
|
* @param {Object} [opts.headers] - Optional headers
|
|
47
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
49
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customContent: Object }>>}
|
|
50
|
+
* @throws 400 INVALID_CUSTOMCONTENT_ID
|
|
51
|
+
* @throws 401 Unauthorized
|
|
52
|
+
* @throws 404 CUSTOMCONTENT_NOT_FOUND
|
|
53
|
+
* @throws 500 Internal server error
|
|
48
54
|
*/
|
|
49
|
-
function get({customContentId, token, headers}) {
|
|
55
|
+
function get({customContentId, token, jwtToken, headers}) {
|
|
50
56
|
return client.get(`/custom-content/${customContentId}`, {
|
|
51
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
57
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
52
58
|
});
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
|
-
* POST /custom-content
|
|
62
|
+
* POST /custom-content — Create custom content. Body: { customContent }. Emits customContent.created.
|
|
57
63
|
* @param {Object} opts
|
|
58
64
|
* @param {string} [opts.token] - API key
|
|
59
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
60
|
-
* @param {Object} opts.customContent -
|
|
65
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
66
|
+
* @param {Object} opts.customContent - CustomContentPost (name, pageId, lang required; at least one of title, text, imgUrl, mainUrl)
|
|
61
67
|
* @param {Object} [opts.headers] - Optional headers
|
|
62
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
68
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customContent: Object }>>}
|
|
69
|
+
* @throws 400 WRONG_DATA, INVALID_CUSTOMCONTENT
|
|
70
|
+
* @throws 401 Unauthorized
|
|
71
|
+
* @throws 500 Internal server error
|
|
63
72
|
*/
|
|
64
73
|
function create({jwtToken, token, customContent, headers}) {
|
|
65
74
|
return client({
|
|
@@ -73,13 +82,17 @@ function customContentFactory({client, internalAuthTokenProvider}) {
|
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
/**
|
|
76
|
-
* DELETE /custom-content/:customContentId
|
|
85
|
+
* DELETE /custom-content/:customContentId — Delete custom content. Emits customContent.deleted.
|
|
77
86
|
* @param {Object} opts
|
|
78
87
|
* @param {string} [opts.token] - API key
|
|
79
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
80
|
-
* @param {string} opts.customContentId - Custom content id
|
|
88
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
89
|
+
* @param {string} opts.customContentId - Custom content id (24 hex)
|
|
81
90
|
* @param {Object} [opts.headers] - Optional headers
|
|
82
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
91
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customContentId: string }>>}
|
|
92
|
+
* @throws 400 CUSTOMCONTENT_TERMINAL_ID, WRONG_DATA
|
|
93
|
+
* @throws 401 Unauthorized
|
|
94
|
+
* @throws 404 CUSTOMCONTENT_NOT_FOUND
|
|
95
|
+
* @throws 500 Internal server error
|
|
83
96
|
*/
|
|
84
97
|
function remove({jwtToken, customContentId, token, headers}) {
|
|
85
98
|
return client({
|
|
@@ -90,14 +103,18 @@ function customContentFactory({client, internalAuthTokenProvider}) {
|
|
|
90
103
|
}
|
|
91
104
|
|
|
92
105
|
/**
|
|
93
|
-
* PUT /custom-content/:customContentId
|
|
106
|
+
* PUT /custom-content/:customContentId — Update custom content. Body: { customContent }. Emits customContent.updated.
|
|
94
107
|
* @param {Object} opts
|
|
95
108
|
* @param {string} [opts.token] - API key
|
|
96
|
-
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
97
|
-
* @param {string} opts.customContentId - Custom content id
|
|
98
|
-
* @param {Object} opts.customContent -
|
|
109
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth
|
|
110
|
+
* @param {string} opts.customContentId - Custom content id (24 hex)
|
|
111
|
+
* @param {Object} opts.customContent - CustomContentPost (at least one of title, text, imgUrl for update)
|
|
99
112
|
* @param {Object} [opts.headers] - Optional headers
|
|
100
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
113
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customContent: Object }>>}
|
|
114
|
+
* @throws 400 WRONG_DATA, INVALID_CUSTOMCONTENT_UPDATE
|
|
115
|
+
* @throws 401 Unauthorized
|
|
116
|
+
* @throws 404 CUSTOMCONTENT_NOT_FOUND
|
|
117
|
+
* @throws 500 Internal server error
|
|
101
118
|
*/
|
|
102
119
|
function update({jwtToken, token, customContentId, customContent, headers}) {
|
|
103
120
|
return client({
|
|
@@ -13,34 +13,36 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
13
13
|
* @param {Object} deps
|
|
14
14
|
* @param {import("axios").AxiosInstance} deps.client
|
|
15
15
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
16
|
-
* @returns {{ all: function, get: function, create: function, update: function, types:
|
|
16
|
+
* @returns {{ all: function, get: function, create: function, update: function, types: { all: function } }}
|
|
17
17
|
*/
|
|
18
18
|
function customFieldsFactory({client, internalAuthTokenProvider}) {
|
|
19
19
|
/**
|
|
20
|
-
* GET /custom-fields - list custom fields.
|
|
20
|
+
* GET /custom-fields - list custom fields (btrz-api-inventory).
|
|
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
24
|
* @param {InventoryCustomFieldsQuery} [opts.query] - Query params (enabled, required, modelName)
|
|
25
25
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
26
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfields: Array }>>}
|
|
27
|
+
* @throws When response is 4xx/5xx (e.g. 400 INVALID_MODEL_NAME, 401 Unauthorized, 500)
|
|
27
28
|
*/
|
|
28
|
-
function all({token, query = {}, headers}) {
|
|
29
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
29
30
|
return client({
|
|
30
31
|
url: "/custom-fields",
|
|
31
32
|
params: query,
|
|
32
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
33
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
|
-
* GET /custom-fields/:
|
|
38
|
+
* GET /custom-fields/:customfieldId - get custom field by id (btrz-api-inventory). No query params.
|
|
38
39
|
* @param {Object} opts
|
|
39
40
|
* @param {string} [opts.token] - API key
|
|
40
41
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
41
|
-
* @param {string} opts.fieldId -
|
|
42
|
+
* @param {string} opts.fieldId - Custom field id (24 hex chars; must start with accountId)
|
|
42
43
|
* @param {Object} [opts.headers] - Optional headers
|
|
43
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
44
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
45
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND, 500)
|
|
44
46
|
*/
|
|
45
47
|
function get({fieldId, token, jwtToken, query = {}, headers}) {
|
|
46
48
|
return client({
|
|
@@ -51,13 +53,14 @@ function customFieldsFactory({client, internalAuthTokenProvider}) {
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
|
-
* POST /custom-fields - create custom field.
|
|
56
|
+
* POST /custom-fields - create custom field (btrz-api-inventory). No query params.
|
|
55
57
|
* @param {Object} opts
|
|
56
58
|
* @param {string} [opts.token] - API key
|
|
57
59
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
58
|
-
* @param {Object} opts.field - Field payload
|
|
60
|
+
* @param {Object} opts.field - Field payload (FieldPutData: text, type, required, disabled, options when type List)
|
|
59
61
|
* @param {Object} [opts.headers] - Optional headers
|
|
60
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
62
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
63
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND/FIELD_NOT_FOUND, 500)
|
|
61
64
|
*/
|
|
62
65
|
function create({token, jwtToken, field, headers}) {
|
|
63
66
|
return client({
|
|
@@ -69,14 +72,15 @@ function customFieldsFactory({client, internalAuthTokenProvider}) {
|
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
/**
|
|
72
|
-
* PUT /custom-fields/:fieldId - update custom field.
|
|
75
|
+
* PUT /custom-fields/:fieldId - update custom field (btrz-api-inventory). No query params.
|
|
73
76
|
* @param {Object} opts
|
|
74
77
|
* @param {string} [opts.token] - API key
|
|
75
78
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
76
|
-
* @param {string} opts.fieldId - Field id
|
|
77
|
-
* @param {Object} opts.field - Field payload
|
|
79
|
+
* @param {string} opts.fieldId - Field id (24 hex chars)
|
|
80
|
+
* @param {Object} opts.field - Field payload (FieldPutData)
|
|
78
81
|
* @param {Object} [opts.headers] - Optional headers
|
|
79
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
83
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND/FIELD_NOT_FOUND/WRONG_DATA_OPTIONS, 500)
|
|
80
84
|
*/
|
|
81
85
|
function update({token, jwtToken, fieldId, field, headers}) {
|
|
82
86
|
return client({
|
|
@@ -90,16 +94,18 @@ function customFieldsFactory({client, internalAuthTokenProvider}) {
|
|
|
90
94
|
/** @type {{ all: function }} */
|
|
91
95
|
const types = {
|
|
92
96
|
/**
|
|
93
|
-
* GET /custom-fields/types - list custom field types.
|
|
97
|
+
* GET /custom-fields/types - list custom field types (btrz-api-inventory). No query params.
|
|
94
98
|
* @param {Object} opts
|
|
95
99
|
* @param {string} [opts.token] - API key
|
|
100
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
96
101
|
* @param {Object} [opts.headers] - Optional headers
|
|
97
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
102
|
+
* @returns {Promise<import("axios").AxiosResponse<{ types: Array }>>}
|
|
103
|
+
* @throws When response is 4xx/5xx (e.g. 401 Unauthorized, 500)
|
|
98
104
|
*/
|
|
99
|
-
all({token, headers}) {
|
|
105
|
+
all({token, jwtToken, headers}) {
|
|
100
106
|
return client({
|
|
101
107
|
url: "/custom-fields/types",
|
|
102
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
108
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
103
109
|
});
|
|
104
110
|
}
|
|
105
111
|
};
|