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
|
@@ -19,13 +19,14 @@ const {
|
|
|
19
19
|
*/
|
|
20
20
|
function getnetTerminalFactory({client, internalAuthTokenProvider}) {
|
|
21
21
|
/**
|
|
22
|
-
* GET /getnet-terminals - list getnet terminals.
|
|
22
|
+
* GET /getnet-terminals - list getnet terminals (paginated).
|
|
23
23
|
* @param {Object} opts
|
|
24
24
|
* @param {string} [opts.token] - API key
|
|
25
25
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
26
|
-
* @param {GetnetTerminalsQuery} [opts.query] - Query params
|
|
26
|
+
* @param {GetnetTerminalsQuery} [opts.query] - Query params (page, stationId, serialNumber)
|
|
27
27
|
* @param {Object} [opts.headers] - Optional headers
|
|
28
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
28
|
+
* @returns {Promise<import("axios").AxiosResponse<{ getnetTerminals: Array, next?: string, previous?: string, count: number }>>}
|
|
29
|
+
* @throws When response is 4xx/5xx (400 INVALID_PAGE, 401, 500)
|
|
29
30
|
*/
|
|
30
31
|
function all({
|
|
31
32
|
token,
|
|
@@ -40,13 +41,14 @@ function getnetTerminalFactory({client, internalAuthTokenProvider}) {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* GET /getnet-terminals/:getnetTerminalId - get a getnet terminal
|
|
44
|
+
* GET /getnet-terminals/:getnetTerminalId - get a getnet terminal by id.
|
|
44
45
|
* @param {Object} opts
|
|
45
46
|
* @param {string} [opts.token] - API key
|
|
46
47
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
47
|
-
* @param {string} opts.getnetTerminalId - Getnet terminal id
|
|
48
|
+
* @param {string} opts.getnetTerminalId - Getnet terminal id (24 hex characters)
|
|
48
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
49
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
50
|
+
* @returns {Promise<import("axios").AxiosResponse<{ getnetTerminal: Object }>>}
|
|
51
|
+
* @throws When response is 4xx/5xx (400 INVALID_GETNET_TERMINAL_ID, 401, 404 GETNET_TERMINAL_NOT_FOUND, 500)
|
|
50
52
|
*/
|
|
51
53
|
function get({
|
|
52
54
|
getnetTerminalId,
|
|
@@ -64,9 +66,10 @@ function getnetTerminalFactory({client, internalAuthTokenProvider}) {
|
|
|
64
66
|
* @param {Object} opts
|
|
65
67
|
* @param {string} [opts.token] - API key
|
|
66
68
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
67
|
-
* @param {Object} opts.getnetTerminal - Getnet terminal payload
|
|
69
|
+
* @param {Object} opts.getnetTerminal - Getnet terminal payload (name, serialNumber, stationId optional)
|
|
68
70
|
* @param {Object} [opts.headers] - Optional headers
|
|
69
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
71
|
+
* @returns {Promise<import("axios").AxiosResponse<{ getnetTerminal: Object }>>}
|
|
72
|
+
* @throws When response is 4xx/5xx (400 WRONG_DATA/INVALID_STATION_ID/STATION_NOT_FOUND, 401, 409 duplicate serial, 500)
|
|
70
73
|
*/
|
|
71
74
|
function create({
|
|
72
75
|
jwtToken,
|
|
@@ -85,13 +88,14 @@ function getnetTerminalFactory({client, internalAuthTokenProvider}) {
|
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
/**
|
|
88
|
-
* DELETE /getnet-terminals/:getnetTerminalId - remove getnet terminal.
|
|
91
|
+
* DELETE /getnet-terminals/:getnetTerminalId - remove getnet terminal.
|
|
89
92
|
* @param {Object} opts
|
|
90
93
|
* @param {string} [opts.token] - API key
|
|
91
94
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
92
|
-
* @param {string} opts.getnetTerminalId - Getnet terminal id
|
|
95
|
+
* @param {string} opts.getnetTerminalId - Getnet terminal id (24 hex characters)
|
|
93
96
|
* @param {Object} [opts.headers] - Optional headers
|
|
94
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
97
|
+
* @returns {Promise<import("axios").AxiosResponse<{ getnetTerminalId: string }>>}
|
|
98
|
+
* @throws When response is 4xx/5xx (400 INVALID_GETNET_TERMINAL_ID, 401, 404 GETNET_TERMINAL_NOT_FOUND, 500)
|
|
95
99
|
*/
|
|
96
100
|
function remove({
|
|
97
101
|
jwtToken,
|
|
@@ -107,14 +111,15 @@ function getnetTerminalFactory({client, internalAuthTokenProvider}) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
|
-
* PUT /getnet-terminals/:getnetTerminalId - update getnet terminal.
|
|
114
|
+
* PUT /getnet-terminals/:getnetTerminalId - update getnet terminal.
|
|
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
|
-
* @param {string} opts.getnetTerminalId - Getnet terminal id
|
|
115
|
-
* @param {Object} opts.getnetTerminal - Getnet terminal payload
|
|
118
|
+
* @param {string} opts.getnetTerminalId - Getnet terminal id (24 hex characters)
|
|
119
|
+
* @param {Object} opts.getnetTerminal - Getnet terminal payload (name, serialNumber, stationId)
|
|
116
120
|
* @param {Object} [opts.headers] - Optional headers
|
|
117
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
121
|
+
* @returns {Promise<import("axios").AxiosResponse<{ getnetTerminal: Object }>>}
|
|
122
|
+
* @throws When response is 4xx/5xx (400, 401, 404 GETNET_TERMINAL_NOT_FOUND, 409 duplicate serial, 500)
|
|
118
123
|
*/
|
|
119
124
|
function update({
|
|
120
125
|
jwtToken,
|
|
@@ -22,7 +22,8 @@ function giftCertificateDefinitionsFactory({client, internalAuthTokenProvider})
|
|
|
22
22
|
* @param {string} [opts.token] - API key
|
|
23
23
|
* @param {GiftCertificateDefinitionsListQuery} [opts.query] - Query params (channels, currencies, providerId)
|
|
24
24
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
25
|
+
* @returns {Promise<import("axios").AxiosResponse<{ giftCertificates: Object[], next?: string, previous?: string, count: number }>>}
|
|
26
|
+
* @throws 400 WRONG_DATA, PROVIDER_ID; 401 Unauthorized; 500.
|
|
26
27
|
*/
|
|
27
28
|
function all({token, query = {}, headers}) {
|
|
28
29
|
return client.get("/gift-certificate-definitions", {
|
|
@@ -38,7 +39,8 @@ function giftCertificateDefinitionsFactory({client, internalAuthTokenProvider})
|
|
|
38
39
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
39
40
|
* @param {string} opts.giftcertificateId - Gift certificate definition id
|
|
40
41
|
* @param {Object} [opts.headers] - Optional headers
|
|
41
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
42
|
+
* @returns {Promise<import("axios").AxiosResponse<{ giftcertificate: Object }>>}
|
|
43
|
+
* @throws When the API returns an error. 400 INVALID_GIFTCERTIFICATE_ID; 401 Unauthorized; 404 GIFTCERTIFICATE_NOT_FOUND; 500.
|
|
42
44
|
*/
|
|
43
45
|
function get({token, jwtToken, giftcertificateId, query = {}, headers}) {
|
|
44
46
|
return client({
|
|
@@ -56,7 +58,8 @@ function giftCertificateDefinitionsFactory({client, internalAuthTokenProvider})
|
|
|
56
58
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
57
59
|
* @param {Object} opts.giftcertificate - Gift certificate payload
|
|
58
60
|
* @param {Object} [opts.headers] - Optional headers
|
|
59
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
61
|
+
* @returns {Promise<import("axios").AxiosResponse<{ giftcertificate: Object }>>}
|
|
62
|
+
* @throws When the API returns an error. 400 WRONG_DATA; 401 Unauthorized; 500.
|
|
60
63
|
*/
|
|
61
64
|
function create({token, jwtToken, giftcertificate, query = {}, headers}) {
|
|
62
65
|
return client({
|
|
@@ -76,7 +79,8 @@ function giftCertificateDefinitionsFactory({client, internalAuthTokenProvider})
|
|
|
76
79
|
* @param {string} opts.giftcertificateId - Gift certificate definition id
|
|
77
80
|
* @param {Object} opts.giftcertificate - Gift certificate payload
|
|
78
81
|
* @param {Object} [opts.headers] - Optional headers
|
|
79
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse<{ giftcertificate: Object }>>}
|
|
83
|
+
* @throws 400 WRONG_DATA, GIFTCERTIFICATE_ID; 401; 404 GIFTCERTIFICATE_NOT_FOUND; 500.
|
|
80
84
|
*/
|
|
81
85
|
function update({token, jwtToken, giftcertificateId, giftcertificate, query = {}, headers}) {
|
|
82
86
|
return client({
|
|
@@ -95,7 +99,8 @@ function giftCertificateDefinitionsFactory({client, internalAuthTokenProvider})
|
|
|
95
99
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
96
100
|
* @param {string} opts.giftcertificateId - Gift certificate definition id
|
|
97
101
|
* @param {Object} [opts.headers] - Optional headers
|
|
98
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
102
|
+
* @returns {Promise<import("axios").AxiosResponse<{ giftcertificateId: string }>>}
|
|
103
|
+
* @throws 400 WRONG_DATA, GIFTCERTIFICATE_ID, GIFT_CERTIFICATE_DEFINITION_ALREADY_IMPLEMENTED; 401; 404; 500.
|
|
99
104
|
*/
|
|
100
105
|
function remove({token, jwtToken, giftcertificateId, query = {}, headers}) {
|
|
101
106
|
return client({
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const {authorizationHeaders} = require("../endpoints_helpers.js");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Query params for GET /holidays (btrz-api-inventory). See get-handler getSpec().
|
|
5
|
+
* @typedef {Object} HolidaysListQuery
|
|
6
|
+
* @property {number} [page] - The page number to retrieve
|
|
7
|
+
* @property {string} [providerId] - Provider (account) id to list holidays for
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Factory for holidays API (btrz-api-inventory).
|
|
12
|
+
* @param {Object} deps
|
|
13
|
+
* @param {import("axios").AxiosInstance} deps.client
|
|
14
|
+
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
15
|
+
* @returns {{ all: function, get: function, create: function, update: function, remove: function }}
|
|
16
|
+
*/
|
|
17
|
+
function holidaysFactory({client, internalAuthTokenProvider}) {
|
|
18
|
+
/**
|
|
19
|
+
* GET /holidays - list holidays (paginated).
|
|
20
|
+
* @param {Object} opts
|
|
21
|
+
* @param {string} [opts.token] - API key
|
|
22
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
23
|
+
* @param {HolidaysListQuery} [opts.query] - Query params (page, providerId)
|
|
24
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
+
* @returns {Promise<import("axios").AxiosResponse<{ holidays: Object[], next?: string, previous?: string, count: number }>>}
|
|
26
|
+
* @throws 400 INVALID_PAGE; 401; 500.
|
|
27
|
+
*/
|
|
28
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
29
|
+
return client.get("/holidays", {
|
|
30
|
+
params: query,
|
|
31
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* GET /holidays/:holidayId - get holiday by id.
|
|
37
|
+
* @param {Object} opts
|
|
38
|
+
* @param {string} [opts.token] - API key
|
|
39
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
40
|
+
* @param {string} opts.holidayId - Holiday id (24 hex characters)
|
|
41
|
+
* @param {{ providerId?: string }} [opts.query] - Optional providerId
|
|
42
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
43
|
+
* @returns {Promise<import("axios").AxiosResponse<{ holiday: Object }>>}
|
|
44
|
+
* @throws 400 INVALID_HOLIDAY_ID, INVALID_PROVIDER_ID; 401; 404 HOLIDAY_NOT_FOUND; 500.
|
|
45
|
+
*/
|
|
46
|
+
function get({token, jwtToken, holidayId, query = {}, headers}) {
|
|
47
|
+
return client({
|
|
48
|
+
url: `/holidays/${holidayId}`,
|
|
49
|
+
method: "get",
|
|
50
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
51
|
+
params: query
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* POST /holidays - create holiday.
|
|
57
|
+
* @param {Object} opts
|
|
58
|
+
* @param {string} [opts.token] - API key
|
|
59
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
60
|
+
* @param {Object} opts.holiday - Holiday payload (day, month, year required; name, blackout, recurring, externalId optional)
|
|
61
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
62
|
+
* @returns {Promise<import("axios").AxiosResponse<{ holiday: Object }>>}
|
|
63
|
+
* @throws 400 WRONG_DATA; 401; 500.
|
|
64
|
+
*/
|
|
65
|
+
function create({token, jwtToken, holiday, headers}) {
|
|
66
|
+
return client({
|
|
67
|
+
url: "/holidays",
|
|
68
|
+
method: "post",
|
|
69
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
70
|
+
data: {holiday}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* PUT /holidays/:holidayId - update holiday.
|
|
76
|
+
* @param {Object} opts
|
|
77
|
+
* @param {string} [opts.token] - API key
|
|
78
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
79
|
+
* @param {string} opts.holidayId - Holiday id
|
|
80
|
+
* @param {Object} opts.holiday - Holiday payload
|
|
81
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse<{ holiday: Object }>>}
|
|
83
|
+
* @throws 400 WRONG_DATA, INVALID_HOLIDAY_ID; 401; 404 HOLIDAY_NOT_FOUND; 500.
|
|
84
|
+
*/
|
|
85
|
+
function update({token, jwtToken, holidayId, holiday, headers}) {
|
|
86
|
+
return client({
|
|
87
|
+
url: `/holidays/${holidayId}`,
|
|
88
|
+
method: "put",
|
|
89
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
90
|
+
data: {holiday}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* DELETE /holidays/:holidayId - remove holiday.
|
|
96
|
+
* @param {Object} opts
|
|
97
|
+
* @param {string} [opts.token] - API key
|
|
98
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
99
|
+
* @param {string} opts.holidayId - Holiday id
|
|
100
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
101
|
+
* @returns {Promise<import("axios").AxiosResponse<{ holidayId: string }>>}
|
|
102
|
+
* @throws 400 INVALID_HOLIDAY_ID; 401; 404 HOLIDAY_NOT_FOUND; 500.
|
|
103
|
+
*/
|
|
104
|
+
function remove({token, jwtToken, holidayId, headers}) {
|
|
105
|
+
return client({
|
|
106
|
+
url: `/holidays/${holidayId}`,
|
|
107
|
+
method: "delete",
|
|
108
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
all,
|
|
114
|
+
get,
|
|
115
|
+
create,
|
|
116
|
+
update,
|
|
117
|
+
remove
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
module.exports = holidaysFactory;
|
|
@@ -5,9 +5,9 @@ const {
|
|
|
5
5
|
/**
|
|
6
6
|
* Query params for GET /insurances (btrz-api-inventory). See get-insurances getSpec().
|
|
7
7
|
* @typedef {Object} InsurancesListQuery
|
|
8
|
-
* @property {string} [productId] -
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {string
|
|
8
|
+
* @property {string} [productId] - The ids of the products to get insurances for
|
|
9
|
+
* @property {string} [enabled] - Filter insurances if they are enabled or not [true, false]
|
|
10
|
+
* @property {string} [providerIds] - The ids of the providers to get products for
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -21,12 +21,13 @@ function insurancesFactory({
|
|
|
21
21
|
client, internalAuthTokenProvider
|
|
22
22
|
}) {
|
|
23
23
|
/**
|
|
24
|
-
* GET /insurances - list insurances.
|
|
24
|
+
* GET /insurances - list insurances for the account and product provided.
|
|
25
25
|
* @param {Object} opts
|
|
26
26
|
* @param {string} [opts.token] - API key
|
|
27
27
|
* @param {InsurancesListQuery} [opts.query] - Query params (productId, enabled, providerIds)
|
|
28
28
|
* @param {Object} [opts.headers] - Optional headers
|
|
29
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
29
|
+
* @returns {Promise<import("axios").AxiosResponse<{ insurances: Object[] }>>}
|
|
30
|
+
* @throws 400 INVALID_PRODUCTIDS; 401; 500.
|
|
30
31
|
*/
|
|
31
32
|
function all({
|
|
32
33
|
token, query = {}, headers
|
|
@@ -40,12 +41,13 @@ function insurancesFactory({
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
|
-
* GET /insurances/:insuranceId - get insurance by id.
|
|
44
|
+
* GET /insurances/:insuranceId - get insurance by id.
|
|
44
45
|
* @param {Object} opts
|
|
45
46
|
* @param {string} [opts.token] - API key
|
|
46
|
-
* @param {string} opts.insuranceId - Insurance id
|
|
47
|
+
* @param {string} opts.insuranceId - Insurance id (24 hex characters)
|
|
47
48
|
* @param {Object} [opts.headers] - Optional headers
|
|
48
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
49
|
+
* @returns {Promise<import("axios").AxiosResponse<{ insurance: Object }>>}
|
|
50
|
+
* @throws 400 INVALID_INSURANCE_ID; 401; 404 INSURANCE_NOT_FOUND; 500.
|
|
49
51
|
*/
|
|
50
52
|
function get({
|
|
51
53
|
token, insuranceId, headers
|
|
@@ -80,14 +82,15 @@ function insurancesFactory({
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
/**
|
|
83
|
-
* PUT /insurances/:insuranceId - update insurance.
|
|
85
|
+
* PUT /insurances/:insuranceId - update insurance.
|
|
84
86
|
* @param {Object} opts
|
|
85
87
|
* @param {string} [opts.token] - API key
|
|
86
88
|
* @param {Object} opts.insurance - Insurance payload
|
|
87
89
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
88
90
|
* @param {string} opts.insuranceId - Insurance id
|
|
89
91
|
* @param {Object} [opts.headers] - Optional headers
|
|
90
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
92
|
+
* @returns {Promise<import("axios").AxiosResponse<{ insurance: Object }>>}
|
|
93
|
+
* @throws 400 WRONG_DATA; 401; 404 INSURANCE_NOT_FOUND; 500.
|
|
91
94
|
*/
|
|
92
95
|
function update({
|
|
93
96
|
token, insurance, jwtToken, insuranceId, headers
|
|
@@ -103,13 +106,14 @@ function insurancesFactory({
|
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
/**
|
|
106
|
-
* DELETE /insurances/:insuranceId - remove insurance.
|
|
109
|
+
* DELETE /insurances/:insuranceId - remove insurance.
|
|
107
110
|
* @param {Object} opts
|
|
108
111
|
* @param {string} [opts.token] - API key
|
|
109
112
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
110
|
-
* @param {string} opts.insuranceId - Insurance id
|
|
113
|
+
* @param {string} opts.insuranceId - Insurance id (24 hex characters)
|
|
111
114
|
* @param {Object} [opts.headers] - Optional headers
|
|
112
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
115
|
+
* @returns {Promise<import("axios").AxiosResponse<{ insuranceId: string }>>}
|
|
116
|
+
* @throws 400 INVALID_INSURANCE_ID; 401; 404 INSURANCE_NOT_FOUND; 500.
|
|
113
117
|
*/
|
|
114
118
|
function remove({
|
|
115
119
|
token, jwtToken, insuranceId, headers
|
|
@@ -30,13 +30,14 @@ const {
|
|
|
30
30
|
*/
|
|
31
31
|
function itemsFactory({client, internalAuthTokenProvider}) {
|
|
32
32
|
/**
|
|
33
|
-
* GET /items - list items.
|
|
33
|
+
* GET /items - list items (paginated).
|
|
34
34
|
* @param {Object} opts
|
|
35
35
|
* @param {string} [opts.token] - API key
|
|
36
36
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
37
37
|
* @param {ItemsQuery} [opts.query] - Query params (productId, disabled, type, providerIds, channels, currency, etc.)
|
|
38
38
|
* @param {Object} [opts.headers] - Optional headers
|
|
39
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
39
|
+
* @returns {Promise<import("axios").AxiosResponse<{ items: Object[], next?: string, previous?: string, count: number }>>}
|
|
40
|
+
* @throws 401; 500.
|
|
40
41
|
*/
|
|
41
42
|
function all({
|
|
42
43
|
token,
|
|
@@ -56,10 +57,11 @@ function itemsFactory({client, internalAuthTokenProvider}) {
|
|
|
56
57
|
* @param {Object} opts
|
|
57
58
|
* @param {string} [opts.token] - API key
|
|
58
59
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
59
|
-
* @param {string} opts.itemId - Item id (
|
|
60
|
+
* @param {string} opts.itemId - Item id (24 hex characters)
|
|
60
61
|
* @param {ItemByIdQuery} [opts.query] - Query params (currency)
|
|
61
62
|
* @param {Object} [opts.headers] - Optional headers
|
|
62
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
63
|
+
* @returns {Promise<import("axios").AxiosResponse<{ item: Object }>>}
|
|
64
|
+
* @throws 400 INVALID_ITEM_ID; 401; 404 ITEM_NOT_FOUND; 500.
|
|
63
65
|
*/
|
|
64
66
|
function get({itemId, token, jwtToken, query = {}, headers}) {
|
|
65
67
|
return client.get(`/items/${itemId}`, {
|
|
@@ -73,9 +75,10 @@ function itemsFactory({client, internalAuthTokenProvider}) {
|
|
|
73
75
|
* @param {Object} opts
|
|
74
76
|
* @param {string} [opts.token] - API key
|
|
75
77
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
76
|
-
* @param {Object} opts.item - Item payload
|
|
78
|
+
* @param {Object} opts.item - Item payload (ItemPostData: name, productId, type, amount, valueType, order, etc.)
|
|
77
79
|
* @param {Object} [opts.headers] - Optional headers
|
|
78
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
80
|
+
* @returns {Promise<import("axios").AxiosResponse<{ item: Object }>>}
|
|
81
|
+
* @throws 400 WRONG_DATA, PRODUCT_ID_INVALID, etc.; 401; 404 PRODUCT_NOT_FOUND, etc.; 500.
|
|
79
82
|
*/
|
|
80
83
|
function create({jwtToken, item, token, headers}) {
|
|
81
84
|
return client({
|
|
@@ -91,10 +94,11 @@ function itemsFactory({client, internalAuthTokenProvider}) {
|
|
|
91
94
|
* @param {Object} opts
|
|
92
95
|
* @param {string} [opts.token] - API key
|
|
93
96
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
94
|
-
* @param {string} opts.itemId - Item id
|
|
95
|
-
* @param {Object} opts.item - Item payload
|
|
97
|
+
* @param {string} opts.itemId - Item id (24 hex characters)
|
|
98
|
+
* @param {Object} opts.item - Item payload (ItemPostData)
|
|
96
99
|
* @param {Object} [opts.headers] - Optional headers
|
|
97
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
100
|
+
* @returns {Promise<import("axios").AxiosResponse<{ item: Object }>>}
|
|
101
|
+
* @throws 400 WRONG_DATA, INVALID ids; 401; 404 ITEM_NOT_FOUND, PRODUCT_NOT_FOUND, etc.; 500.
|
|
98
102
|
*/
|
|
99
103
|
function update({jwtToken, token, itemId, item, headers}) {
|
|
100
104
|
return client({
|
|
@@ -16,13 +16,14 @@ const {authorizationHeaders} = require("../endpoints_helpers.js");
|
|
|
16
16
|
*/
|
|
17
17
|
function labelsFactory({client, internalAuthTokenProvider}) {
|
|
18
18
|
/**
|
|
19
|
-
* GET /labels - list labels.
|
|
19
|
+
* GET /labels - list labels (paginated).
|
|
20
20
|
* @param {Object} opts
|
|
21
21
|
* @param {string} [opts.token] - API key
|
|
22
22
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
23
23
|
* @param {LabelsQuery} [opts.query] - Query params (name, page)
|
|
24
24
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
25
|
+
* @returns {Promise<import("axios").AxiosResponse<{ labels: Object[], count: number, next?: string, previous?: string }>>}
|
|
26
|
+
* @throws 401; 500.
|
|
26
27
|
*/
|
|
27
28
|
function all({token, jwtToken, query = {}, headers}) {
|
|
28
29
|
return client.get("/labels", {
|
|
@@ -36,9 +37,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
|
|
|
36
37
|
* @param {Object} opts
|
|
37
38
|
* @param {string} [opts.token] - API key
|
|
38
39
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
39
|
-
* @param {string} opts.labelId - Label id (
|
|
40
|
+
* @param {string} opts.labelId - Label id (24 hex characters)
|
|
40
41
|
* @param {Object} [opts.headers] - Optional headers
|
|
41
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
42
|
+
* @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
|
|
43
|
+
* @throws 400 WRONG_DATA, INVALID_LABEL_ID; 401; 404 LABEL_NOT_FOUND; 500.
|
|
42
44
|
*/
|
|
43
45
|
function get({labelId, token, jwtToken, query = {}, headers}) {
|
|
44
46
|
return client.get(`/labels/${labelId}`, {
|
|
@@ -52,9 +54,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
|
|
|
52
54
|
* @param {Object} opts
|
|
53
55
|
* @param {string} [opts.token] - API key
|
|
54
56
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
55
|
-
* @param {Object} opts.label - Label payload
|
|
57
|
+
* @param {Object} opts.label - Label payload (name, description, color required; type: ticket|manifest)
|
|
56
58
|
* @param {Object} [opts.headers] - Optional headers
|
|
57
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
59
|
+
* @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
|
|
60
|
+
* @throws 400 WRONG_DATA (name/description/color required), INVALID_TYPE; 401; 500.
|
|
58
61
|
*/
|
|
59
62
|
function create({jwtToken, label, token, headers}) {
|
|
60
63
|
return client({
|
|
@@ -70,10 +73,11 @@ function labelsFactory({client, internalAuthTokenProvider}) {
|
|
|
70
73
|
* @param {Object} opts
|
|
71
74
|
* @param {string} [opts.token] - API key
|
|
72
75
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
|
-
* @param {string} opts.labelId - Label id
|
|
74
|
-
* @param {Object} opts.label - Label payload
|
|
76
|
+
* @param {string} opts.labelId - Label id (24 hex characters)
|
|
77
|
+
* @param {Object} opts.label - Label payload (LabelData)
|
|
75
78
|
* @param {Object} [opts.headers] - Optional headers
|
|
76
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
79
|
+
* @returns {Promise<import("axios").AxiosResponse<{ label: Object }>>}
|
|
80
|
+
* @throws 400 WRONG_DATA, INVALID_TYPE, LABEL_ALREADY_USED; 401; 404 LABEL_NOT_FOUND; 500.
|
|
77
81
|
*/
|
|
78
82
|
function update({jwtToken, token, labelId, label, headers}) {
|
|
79
83
|
return client({
|
|
@@ -90,9 +94,10 @@ function labelsFactory({client, internalAuthTokenProvider}) {
|
|
|
90
94
|
* @param {Object} opts
|
|
91
95
|
* @param {string} [opts.token] - API key
|
|
92
96
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
93
|
-
* @param {string} opts.labelId - Label id
|
|
97
|
+
* @param {string} opts.labelId - Label id (24 hex characters)
|
|
94
98
|
* @param {Object} [opts.headers] - Optional headers
|
|
95
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
99
|
+
* @returns {Promise<import("axios").AxiosResponse<{ labelId: string }>>}
|
|
100
|
+
* @throws 400 LABEL_ID (invalid format), LABEL_ALREADY_USED; 401; 404 LABEL_NOT_FOUND; 500.
|
|
96
101
|
*/
|
|
97
102
|
function remove({jwtToken, token, labelId, headers}) {
|
|
98
103
|
return client({
|
|
@@ -15,13 +15,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
15
15
|
*/
|
|
16
16
|
function maritalStatusFactory({client, internalAuthTokenProvider}) {
|
|
17
17
|
/**
|
|
18
|
-
* GET /marital-status - list marital statuses.
|
|
18
|
+
* GET /marital-status - list marital statuses (paginated).
|
|
19
19
|
* @param {Object} opts
|
|
20
20
|
* @param {string} [opts.token] - API key
|
|
21
21
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
22
22
|
* @param {MaritalStatusListQuery} [opts.query] - Query params (providerIds)
|
|
23
23
|
* @param {Object} [opts.headers] - Optional headers
|
|
24
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
24
|
+
* @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object[], next?: string, previous?: string, count: number }>>}
|
|
25
|
+
* @throws 401; 500.
|
|
25
26
|
*/
|
|
26
27
|
function all({token, jwtToken, query = {}, headers}) {
|
|
27
28
|
return client({
|
|
@@ -37,9 +38,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
|
|
|
37
38
|
* @param {Object} opts
|
|
38
39
|
* @param {string} [opts.token] - API key
|
|
39
40
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
40
|
-
* @param {string} opts.id - Marital status id
|
|
41
|
+
* @param {string} opts.id - Marital status id (24 hex characters)
|
|
41
42
|
* @param {Object} [opts.headers] - Optional headers
|
|
42
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
43
|
+
* @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
|
|
44
|
+
* @throws 400 WRONG_DATA, INVALID_MARITALSTATUS_ID; 401; 404 MARITALSTATUS_NOT_FOUND; 500.
|
|
43
45
|
*/
|
|
44
46
|
function get({token, jwtToken, id, query = {}, headers}) {
|
|
45
47
|
return client({
|
|
@@ -55,10 +57,11 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
|
|
|
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 {string} opts.id - Marital status id
|
|
59
|
-
* @param {Object} opts.data - Request body
|
|
60
|
+
* @param {string} opts.id - Marital status id (24 hex characters)
|
|
61
|
+
* @param {Object} opts.data - Request body (MaritalStatusPutData: name, ord, lexiconKeys)
|
|
60
62
|
* @param {Object} [opts.headers] - Optional headers
|
|
61
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
63
|
+
* @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
|
|
64
|
+
* @throws 400 WRONG_DATA; 401; 404 MARITALSTATUS_NOT_FOUND; 409 CANNOT_UPDATE_LEXICON_ENTRIES; 500.
|
|
62
65
|
*/
|
|
63
66
|
function update({token, jwtToken, id, data, query = {}, headers}) {
|
|
64
67
|
return client({
|
|
@@ -75,9 +78,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
|
|
|
75
78
|
* @param {Object} opts
|
|
76
79
|
* @param {string} [opts.token] - API key
|
|
77
80
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
78
|
-
* @param {string} opts.id - Marital status id
|
|
81
|
+
* @param {string} opts.id - Marital status id (24 hex characters)
|
|
79
82
|
* @param {Object} [opts.headers] - Optional headers
|
|
80
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
83
|
+
* @returns {Promise<import("axios").AxiosResponse<{ maritalstatusId: string }>>}
|
|
84
|
+
* @throws 400 WRONG_DATA, INVALID_MARITALSTATUS_ID; 401; 404 MARITALSTATUS_NOT_FOUND; 500.
|
|
81
85
|
*/
|
|
82
86
|
function remove({token, jwtToken, id, query = {}, headers}) {
|
|
83
87
|
return client({
|
|
@@ -93,9 +97,10 @@ function maritalStatusFactory({client, internalAuthTokenProvider}) {
|
|
|
93
97
|
* @param {Object} opts
|
|
94
98
|
* @param {string} [opts.token] - API key
|
|
95
99
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
96
|
-
* @param {Object} opts.data - Request body
|
|
100
|
+
* @param {Object} opts.data - Request body (MaritalStatusPostData: name, ord, lexiconKeys required)
|
|
97
101
|
* @param {Object} [opts.headers] - Optional headers
|
|
98
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
102
|
+
* @returns {Promise<import("axios").AxiosResponse<{ maritalstatus: Object }>>}
|
|
103
|
+
* @throws 400 WRONG_DATA (maritalstatus/name/ord/lexiconKeys required); 401; 409 CANNOT_CREATE_LEXICON_ENTRIES; 500.
|
|
99
104
|
*/
|
|
100
105
|
function create({token, jwtToken, data, query = {}, headers}) {
|
|
101
106
|
return client({
|
|
@@ -25,12 +25,13 @@ const {
|
|
|
25
25
|
*/
|
|
26
26
|
function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
|
|
27
27
|
/**
|
|
28
|
-
* GET /marketplace-modifiers - list marketplace modifiers.
|
|
28
|
+
* GET /marketplace-modifiers - list marketplace modifiers (paginated).
|
|
29
29
|
* @param {Object} opts
|
|
30
30
|
* @param {string} [opts.token] - API key
|
|
31
31
|
* @param {MarketplaceModifiersListQuery} [opts.query] - Query params
|
|
32
32
|
* @param {Object} [opts.headers] - Optional headers
|
|
33
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
33
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifiers: Object[], next?: string, previous?: string, count: number }>>}
|
|
34
|
+
* @throws 401; 500 MISSING_ACCOUNT.
|
|
34
35
|
*/
|
|
35
36
|
function all({
|
|
36
37
|
token,
|
|
@@ -46,10 +47,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
|
|
|
46
47
|
/**
|
|
47
48
|
* GET /marketplace-modifiers/:marketplaceModifierId - get marketplace modifier by id. API does not accept query params.
|
|
48
49
|
* @param {Object} opts
|
|
49
|
-
* @param {string} opts.marketplaceModifierId - Marketplace modifier id
|
|
50
|
+
* @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
|
|
50
51
|
* @param {string} [opts.token] - API key
|
|
51
52
|
* @param {Object} [opts.headers] - Optional headers
|
|
52
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
53
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
|
|
54
|
+
* @throws 400 WRONG_DATA, INVALID_MARKETPLACEMODIFIER_ID; 401; 404 MARKETPLACE_MODIFIER_NOT_FOUND; 500.
|
|
53
55
|
*/
|
|
54
56
|
function get({marketplaceModifierId, token, headers}) {
|
|
55
57
|
return client.get(`/marketplace-modifiers/${marketplaceModifierId}`, {
|
|
@@ -62,9 +64,10 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
|
|
|
62
64
|
* @param {Object} opts
|
|
63
65
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
64
66
|
* @param {string} [opts.token] - API key
|
|
65
|
-
* @param {Object} opts.marketplaceModifier - Marketplace modifier payload
|
|
67
|
+
* @param {Object} opts.marketplaceModifier - Marketplace modifier payload (MarketplaceModifierPostData)
|
|
66
68
|
* @param {Object} [opts.headers] - Optional headers
|
|
67
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
69
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
|
|
70
|
+
* @throws 400 WRONG_DATA, *_NOT_FOUND, INVALID_*, MODIFIER_*, OANDDS_STATION_NOT_FOUND; 401; 404; 500.
|
|
68
71
|
*/
|
|
69
72
|
function create({jwtToken, token, marketplaceModifier, headers}) {
|
|
70
73
|
return client({
|
|
@@ -81,10 +84,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
|
|
|
81
84
|
* DELETE /marketplace-modifiers/:marketplaceModifierId - remove marketplace modifier. API does not accept query params.
|
|
82
85
|
* @param {Object} opts
|
|
83
86
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
84
|
-
* @param {string} opts.marketplaceModifierId - Marketplace modifier id
|
|
87
|
+
* @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
|
|
85
88
|
* @param {string} [opts.token] - API key
|
|
86
89
|
* @param {Object} [opts.headers] - Optional headers
|
|
87
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
90
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifierId: string }>>}
|
|
91
|
+
* @throws 400 MARKETPLACE_MODIFIER_ID (invalid format); 401; 404 MARKETPLACE_MODIFIER_NOT_FOUND; 500.
|
|
88
92
|
*/
|
|
89
93
|
function remove({jwtToken, marketplaceModifierId, token, headers}) {
|
|
90
94
|
return client({
|
|
@@ -99,10 +103,11 @@ function marketplaceModifierFactory({client, internalAuthTokenProvider}) {
|
|
|
99
103
|
* @param {Object} opts
|
|
100
104
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
101
105
|
* @param {string} [opts.token] - API key
|
|
102
|
-
* @param {string} opts.marketplaceModifierId - Marketplace modifier id
|
|
103
|
-
* @param {Object} opts.marketplaceModifier - Marketplace modifier payload
|
|
106
|
+
* @param {string} opts.marketplaceModifierId - Marketplace modifier id (24 hex characters)
|
|
107
|
+
* @param {Object} opts.marketplaceModifier - Marketplace modifier payload (MarketplaceModifierPutData)
|
|
104
108
|
* @param {Object} [opts.headers] - Optional headers
|
|
105
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
109
|
+
* @returns {Promise<import("axios").AxiosResponse<{ marketplaceModifier: Object }>>}
|
|
110
|
+
* @throws 400 WRONG_DATA, INVALID_MARKETPLACEMODIFIER_ID, *_NOT_FOUND, INVALID_*, MODIFIER_*; 401; 404; 500.
|
|
106
111
|
*/
|
|
107
112
|
function update({jwtToken, token, marketplaceModifierId, marketplaceModifier, headers}) {
|
|
108
113
|
return client({
|