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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Query params for GET /document-types (btrz-api-inventory).
|
|
4
|
+
* Query params for GET /document-types (btrz-api-inventory).
|
|
5
5
|
* @typedef {Object} DocumentTypesListQuery
|
|
6
6
|
* @property {string} [providerIds] - Comma-separated provider IDs to get document types for
|
|
7
7
|
*/
|
|
@@ -15,99 +15,100 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
15
15
|
*/
|
|
16
16
|
function documentTypesFactory({client, internalAuthTokenProvider}) {
|
|
17
17
|
/**
|
|
18
|
-
* GET /document-types - list document types.
|
|
18
|
+
* GET /document-types - list document types (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
|
-
* @param {DocumentTypesListQuery} [opts.query] - Query params (providerIds)
|
|
23
|
-
* @param {string} [opts.providerId] - Provider id (added to query if set)
|
|
22
|
+
* @param {DocumentTypesListQuery} [opts.query] - Query params (providerIds)
|
|
24
23
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
24
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttypes: Array, next?: string, previous?: string, count: number }>>}
|
|
25
|
+
* @throws When response is 4xx/5xx (401 Unauthorized, 500)
|
|
26
26
|
*/
|
|
27
|
-
function all({token, jwtToken, query = {}, headers
|
|
28
|
-
const query_ = providerId ? {...query, providerId} : query;
|
|
27
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
29
28
|
return client({
|
|
30
29
|
url: "/document-types",
|
|
31
30
|
method: "get",
|
|
32
31
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
33
|
-
params:
|
|
32
|
+
params: query
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
|
-
* GET /document-types/:
|
|
37
|
+
* GET /document-types/:documenttypeId - get document type by id.
|
|
39
38
|
* @param {Object} opts
|
|
40
39
|
* @param {string} [opts.token] - API key
|
|
41
40
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
42
|
-
* @param {string} opts.id - Document type id
|
|
43
|
-
* @param {string} [opts.providerId] - Provider id (added to query if set)
|
|
41
|
+
* @param {string} opts.id - Document type id (24 hex characters)
|
|
44
42
|
* @param {Object} [opts.headers] - Optional headers
|
|
45
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
43
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
44
|
+
* @throws When response is 4xx/5xx (400, 401, 404 DOCUMENTTYPE_NOT_FOUND, 500)
|
|
46
45
|
*/
|
|
47
|
-
function get({token, jwtToken, id,
|
|
48
|
-
const query_ = providerId ? {...query, providerId} : query;
|
|
46
|
+
function get({token, jwtToken, id, headers}) {
|
|
49
47
|
return client({
|
|
50
48
|
url: `/document-types/${id}`,
|
|
51
49
|
method: "get",
|
|
52
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
53
|
-
params: query_
|
|
50
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
54
51
|
});
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
/**
|
|
58
|
-
* PUT /document-types/:
|
|
55
|
+
* PUT /document-types/:documenttypeId - update document type.
|
|
59
56
|
* @param {Object} opts
|
|
60
57
|
* @param {string} [opts.token] - API key
|
|
61
58
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
62
59
|
* @param {string} opts.id - Document type id
|
|
63
|
-
* @param {Object} opts.
|
|
60
|
+
* @param {Object} [opts.documenttype] - Document type payload (DocumentTypePutData)
|
|
61
|
+
* @param {Object} [opts.data] - Alias for documenttype (deprecated, use documenttype)
|
|
64
62
|
* @param {Object} [opts.headers] - Optional headers
|
|
65
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
63
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
64
|
+
* @throws When response is 4xx/5xx (400, 401, 404, 409 CANNOT_UPDATE_LEXICON_ENTRIES, 500)
|
|
66
65
|
*/
|
|
67
|
-
function update({token, jwtToken, id,
|
|
66
|
+
function update({token, jwtToken, id, documenttype, data, headers}) {
|
|
67
|
+
const payload = documenttype || data;
|
|
68
68
|
return client({
|
|
69
69
|
url: `/document-types/${id}`,
|
|
70
70
|
method: "put",
|
|
71
71
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
72
|
-
|
|
73
|
-
data
|
|
72
|
+
data: {documenttype: payload}
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
/**
|
|
78
|
-
* DELETE /document-types/:
|
|
77
|
+
* DELETE /document-types/:documenttypeId - remove document type.
|
|
79
78
|
* @param {Object} opts
|
|
80
79
|
* @param {string} [opts.token] - API key
|
|
81
80
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
82
81
|
* @param {string} opts.id - Document type id
|
|
83
82
|
* @param {Object} [opts.headers] - Optional headers
|
|
84
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
83
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttypeId: string }>>}
|
|
84
|
+
* @throws When response is 4xx/5xx (400, 401, 404 DOCUMENTTYPE_NOT_FOUND, 500)
|
|
85
85
|
*/
|
|
86
|
-
function remove({token, jwtToken, id,
|
|
86
|
+
function remove({token, jwtToken, id, headers}) {
|
|
87
87
|
return client({
|
|
88
88
|
url: `/document-types/${id}`,
|
|
89
89
|
method: "delete",
|
|
90
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
91
|
-
params: query
|
|
90
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
|
-
* POST /document-types - create document type.
|
|
95
|
+
* POST /document-types - create document type.
|
|
97
96
|
* @param {Object} opts
|
|
98
97
|
* @param {string} [opts.token] - API key
|
|
99
98
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
100
|
-
* @param {Object} opts.
|
|
99
|
+
* @param {Object} [opts.documenttype] - Document type payload (DocumentTypePostData)
|
|
100
|
+
* @param {Object} [opts.data] - Alias for documenttype (deprecated, use documenttype)
|
|
101
101
|
* @param {Object} [opts.headers] - Optional headers
|
|
102
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
102
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
103
|
+
* @throws When response is 4xx/5xx (400, 401, 409 CANNOT_CREATE_LEXICON_ENTRIES, 500)
|
|
103
104
|
*/
|
|
104
|
-
function create({token, jwtToken,
|
|
105
|
+
function create({token, jwtToken, documenttype, data, headers}) {
|
|
106
|
+
const payload = documenttype || data;
|
|
105
107
|
return client({
|
|
106
108
|
url: "/document-types",
|
|
107
109
|
method: "post",
|
|
108
110
|
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
109
|
-
|
|
110
|
-
data
|
|
111
|
+
data: {documenttype: payload}
|
|
111
112
|
});
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -3,22 +3,24 @@ const {
|
|
|
3
3
|
} = require("../endpoints_helpers.js");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Factory for external-wallets API (btrz-api-inventory).
|
|
6
|
+
* Factory for external-wallets API (btrz-api-inventory). SaldoMax external wallets only.
|
|
7
7
|
* @param {Object} deps
|
|
8
8
|
* @param {import("axios").AxiosInstance} deps.client
|
|
9
9
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
10
|
-
* @returns {{ saldoMax:
|
|
10
|
+
* @returns {{ saldoMax: { all: function, get: function, create: function, update: function, movements: { create: function } } }}
|
|
11
11
|
*/
|
|
12
12
|
function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
13
13
|
/** @type {{ all: function, create: function, get: function, update: function, movements: object }} */
|
|
14
14
|
const saldoMax = {
|
|
15
15
|
/**
|
|
16
|
-
* GET /external-wallets/saldo-max - list
|
|
16
|
+
* GET /external-wallets/saldo-max - list SaldoMax external wallets (paginated).
|
|
17
17
|
* @param {Object} opts
|
|
18
18
|
* @param {string} [opts.token] - API key
|
|
19
19
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
20
|
+
* @param {Object} [opts.query] - Pagination query params
|
|
20
21
|
* @param {Object} [opts.headers] - Optional headers
|
|
21
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
22
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallets: Array, next?: string, previous?: string, count: number }>>}
|
|
23
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
22
24
|
*/
|
|
23
25
|
all: ({token, jwtToken, query = {}, headers}) => {
|
|
24
26
|
return client.get("/external-wallets/saldo-max", {
|
|
@@ -27,13 +29,14 @@ function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
|
27
29
|
});
|
|
28
30
|
},
|
|
29
31
|
/**
|
|
30
|
-
* POST /external-wallets/saldo-max - create
|
|
32
|
+
* POST /external-wallets/saldo-max - create SaldoMax external wallet.
|
|
31
33
|
* @param {Object} opts
|
|
32
34
|
* @param {string} [opts.token] - API key
|
|
33
35
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
34
|
-
* @param {Object} opts.externalWallet - External wallet payload
|
|
36
|
+
* @param {Object} opts.externalWallet - External wallet payload (ExternalWalletData: firstName, lastName, email, tel, dob, nip)
|
|
35
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
36
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
39
|
+
* @throws When response is 4xx/5xx (400, 401, 409 DUPLICATE_EXTERNAL_WALLET_EMAIL/TEL, 500)
|
|
37
40
|
*/
|
|
38
41
|
create: ({token, jwtToken, externalWallet, headers}) => {
|
|
39
42
|
return client({
|
|
@@ -44,13 +47,14 @@ function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
|
44
47
|
});
|
|
45
48
|
},
|
|
46
49
|
/**
|
|
47
|
-
* GET /external-wallets/saldo-max/:walletId - get
|
|
50
|
+
* GET /external-wallets/saldo-max/:walletId - get SaldoMax external wallet by id.
|
|
48
51
|
* @param {Object} opts
|
|
49
52
|
* @param {string} [opts.token] - API key
|
|
50
53
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
51
|
-
* @param {string} opts.walletId - Wallet id
|
|
54
|
+
* @param {string} opts.walletId - Wallet id (24 hex characters)
|
|
52
55
|
* @param {Object} [opts.headers] - Optional headers
|
|
53
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
56
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
57
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
54
58
|
*/
|
|
55
59
|
get: ({token, jwtToken, walletId, headers}) => {
|
|
56
60
|
return client.get(`/external-wallets/saldo-max/${walletId}`, {
|
|
@@ -58,13 +62,14 @@ function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
|
58
62
|
});
|
|
59
63
|
},
|
|
60
64
|
/**
|
|
61
|
-
* PUT /external-wallets/saldo-max/:
|
|
65
|
+
* PUT /external-wallets/saldo-max/:walletId - update SaldoMax external wallet.
|
|
62
66
|
* @param {Object} opts
|
|
63
67
|
* @param {string} [opts.token] - API key
|
|
64
68
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
65
69
|
* @param {Object} opts.externalWallet - External wallet payload (must include _id)
|
|
66
70
|
* @param {Object} [opts.headers] - Optional headers
|
|
67
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
71
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
72
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
68
73
|
*/
|
|
69
74
|
update: ({token, jwtToken, externalWallet, headers}) => {
|
|
70
75
|
const externalWalletFieldsToUpdate = {
|
|
@@ -85,22 +90,22 @@ function externalWalletsFactory({client, internalAuthTokenProvider}) {
|
|
|
85
90
|
/** @type {{ create: function }} */
|
|
86
91
|
movements: {
|
|
87
92
|
/**
|
|
88
|
-
* PUT /external-wallets/saldo-max/:walletId/movements -
|
|
93
|
+
* PUT /external-wallets/saldo-max/:walletId/movements - add movement to wallet.
|
|
89
94
|
* @param {Object} opts
|
|
90
95
|
* @param {string} [opts.token] - API key
|
|
91
96
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
92
97
|
* @param {string} opts.walletId - Wallet id
|
|
93
|
-
* @param {Object} opts.movement - Movement payload
|
|
94
|
-
* @
|
|
98
|
+
* @param {Object} opts.movement - Movement payload (amount, type: payment|refund|manual, reason, nip)
|
|
99
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
100
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
101
|
+
* @throws When response is 4xx/5xx (400, 401, 403 INVALID_NIP/WALLET_BLOCKED/WALLET_NOT_ACTIVE, 404, 500)
|
|
95
102
|
*/
|
|
96
|
-
create: ({token, jwtToken, walletId, movement}) => {
|
|
103
|
+
create: ({token, jwtToken, walletId, movement, headers}) => {
|
|
97
104
|
return client({
|
|
98
105
|
url: `/external-wallets/saldo-max/${walletId}/movements`,
|
|
99
106
|
method: "put",
|
|
100
|
-
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider}),
|
|
101
|
-
data: {
|
|
102
|
-
movement
|
|
103
|
-
}
|
|
107
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers}),
|
|
108
|
+
data: {movement}
|
|
104
109
|
});
|
|
105
110
|
}
|
|
106
111
|
}
|
|
@@ -18,28 +18,31 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
18
18
|
*/
|
|
19
19
|
function feesFactory({client, internalAuthTokenProvider}) {
|
|
20
20
|
/**
|
|
21
|
-
* GET /fees - list fees.
|
|
21
|
+
* GET /fees - list fees (paginated).
|
|
22
22
|
* @param {Object} opts
|
|
23
23
|
* @param {string} [opts.token] - API key
|
|
24
|
-
* @param {
|
|
24
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
25
|
+
* @param {InventoryFeesQuery} [opts.query] - Query params (providerIds, rules, productId, internalId)
|
|
25
26
|
* @param {Object} [opts.headers] - Optional headers
|
|
26
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
27
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fees: Array, next?: string, previous?: string, count: number }>>}
|
|
28
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
27
29
|
*/
|
|
28
|
-
function all({token, query = {}, headers}) {
|
|
30
|
+
function all({token, jwtToken, query = {}, headers}) {
|
|
29
31
|
return client.get("/fees", {
|
|
30
32
|
params: query,
|
|
31
|
-
headers: authorizationHeaders({token, internalAuthTokenProvider, headers})
|
|
33
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
|
-
* GET /fees/:feeId - get fee by id.
|
|
38
|
+
* GET /fees/:feeId - get fee by id.
|
|
37
39
|
* @param {Object} opts
|
|
38
40
|
* @param {string} [opts.token] - API key
|
|
39
41
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
40
|
-
* @param {string} opts.feeId - Fee id
|
|
42
|
+
* @param {string} opts.feeId - Fee id (24 hex characters)
|
|
41
43
|
* @param {Object} [opts.headers] - Optional headers
|
|
42
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
44
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
45
|
+
* @throws When response is 4xx/5xx (400, 401, 404 FEE_NOT_FOUND, 500)
|
|
43
46
|
*/
|
|
44
47
|
function get({token, jwtToken, feeId, headers}) {
|
|
45
48
|
return client.get(`/fees/${feeId}`, {
|
|
@@ -48,13 +51,14 @@ function feesFactory({client, internalAuthTokenProvider}) {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
|
-
* POST /fees - create fee.
|
|
54
|
+
* POST /fees - create fee.
|
|
52
55
|
* @param {Object} opts
|
|
53
56
|
* @param {string} [opts.token] - API key
|
|
54
57
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
55
|
-
* @param {Object} opts.fee - Fee payload
|
|
58
|
+
* @param {Object} opts.fee - Fee payload (FeePostData: name, internalId, valueType, value, rules, products, lexiconKeys, etc.)
|
|
56
59
|
* @param {Object} [opts.headers] - Optional headers
|
|
57
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
60
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
61
|
+
* @throws When response is 4xx/5xx (400, 401, 409 CANNOT_CREATE_LEXICON_ENTRIES, 500)
|
|
58
62
|
*/
|
|
59
63
|
function create({token, jwtToken, fee, headers}) {
|
|
60
64
|
return client({
|
|
@@ -66,14 +70,15 @@ function feesFactory({client, internalAuthTokenProvider}) {
|
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
/**
|
|
69
|
-
* PUT /fees/:feeId - update fee.
|
|
73
|
+
* PUT /fees/:feeId - update fee.
|
|
70
74
|
* @param {Object} opts
|
|
71
75
|
* @param {string} [opts.token] - API key
|
|
72
76
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
77
|
* @param {string} opts.feeId - Fee id
|
|
74
|
-
* @param {Object} opts.fee - Fee payload
|
|
78
|
+
* @param {Object} opts.fee - Fee payload (partial FeePostData)
|
|
75
79
|
* @param {Object} [opts.headers] - Optional headers
|
|
76
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
80
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
81
|
+
* @throws When response is 4xx/5xx (400, 401, 404 FEE_NOT_FOUND, 409 CANNOT_UPDATE_LEXICON_ENTRIES, 500)
|
|
77
82
|
*/
|
|
78
83
|
function update({token, jwtToken, feeId, fee, headers}) {
|
|
79
84
|
return client({
|
|
@@ -17,17 +17,18 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
17
17
|
* @param {Object} deps
|
|
18
18
|
* @param {import("axios").AxiosInstance} deps.client
|
|
19
19
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
20
|
-
* @returns {{ all: function, create: function }}
|
|
20
|
+
* @returns {{ all: function, create: function, remove: function }}
|
|
21
21
|
*/
|
|
22
22
|
function filteredTripsFactory({client, internalAuthTokenProvider}) {
|
|
23
23
|
/**
|
|
24
|
-
* GET /filtered-trips - list filtered trips.
|
|
24
|
+
* GET /filtered-trips - list filtered trips (paginated).
|
|
25
25
|
* @param {Object} opts
|
|
26
26
|
* @param {string} [opts.token] - API key
|
|
27
27
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
28
|
-
* @param {FilteredTripsListQuery} [opts.query] - Query params
|
|
28
|
+
* @param {FilteredTripsListQuery} [opts.query] - Query params
|
|
29
29
|
* @param {Object} [opts.headers] - Optional headers
|
|
30
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
30
|
+
* @returns {Promise<import("axios").AxiosResponse<{ filteredTrips: Array, next?: string, previous?: string, count: number }>>}
|
|
31
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
31
32
|
*/
|
|
32
33
|
function all({token, jwtToken, query = {}, headers}) {
|
|
33
34
|
return client.get("/filtered-trips", {
|
|
@@ -37,13 +38,14 @@ function filteredTripsFactory({client, internalAuthTokenProvider}) {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* POST /filtered-trips -
|
|
41
|
+
* POST /filtered-trips - add a trip to the blacklist (filtered trips).
|
|
41
42
|
* @param {Object} opts
|
|
42
43
|
* @param {string} [opts.token] - API key
|
|
43
44
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
44
|
-
* @param {
|
|
45
|
+
* @param {string} opts.tripSegmentsId - Base64-encoded JSON (FilteredTripRequest: productId, segments)
|
|
45
46
|
* @param {Object} [opts.headers] - Optional headers
|
|
46
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
47
|
+
* @returns {Promise<import("axios").AxiosResponse<{ filteredTrip: Object }>>}
|
|
48
|
+
* @throws When response is 4xx/5xx (400, 401, 409 TRIP_ALREADY_FILTERED, 500)
|
|
47
49
|
*/
|
|
48
50
|
function create({token, jwtToken, tripSegmentsId, headers}) {
|
|
49
51
|
return client({
|
|
@@ -54,9 +56,28 @@ function filteredTripsFactory({client, internalAuthTokenProvider}) {
|
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
/**
|
|
60
|
+
* DELETE /filtered-trip/:filteredTripId - remove a filtered trip from the blacklist.
|
|
61
|
+
* @param {Object} opts
|
|
62
|
+
* @param {string} [opts.token] - API key
|
|
63
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
64
|
+
* @param {string} opts.filteredTripId - Filtered trip id (24 hex characters)
|
|
65
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
66
|
+
* @returns {Promise<import("axios").AxiosResponse<void>>}
|
|
67
|
+
* @throws When response is 4xx/5xx (400, 401, 500)
|
|
68
|
+
*/
|
|
69
|
+
function remove({token, jwtToken, filteredTripId, headers}) {
|
|
70
|
+
return client({
|
|
71
|
+
url: `/filtered-trip/${filteredTripId}`,
|
|
72
|
+
method: "delete",
|
|
73
|
+
headers: authorizationHeaders({token, jwtToken, internalAuthTokenProvider, headers})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
return {
|
|
58
78
|
all,
|
|
59
|
-
create
|
|
79
|
+
create,
|
|
80
|
+
remove
|
|
60
81
|
};
|
|
61
82
|
}
|
|
62
83
|
|
|
@@ -24,13 +24,14 @@ const {
|
|
|
24
24
|
*/
|
|
25
25
|
function financingCostsFactory({client, internalAuthTokenProvider}) {
|
|
26
26
|
/**
|
|
27
|
-
* GET /financing-costs - list financing costs.
|
|
27
|
+
* GET /financing-costs - list financing costs (paginated).
|
|
28
28
|
* @param {Object} opts
|
|
29
29
|
* @param {string} [opts.token] - API key
|
|
30
30
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
31
31
|
* @param {FinancingCostsListQuery} [opts.query] - Query params (page, providerId)
|
|
32
32
|
* @param {Object} [opts.headers] - Optional headers
|
|
33
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
33
|
+
* @returns {Promise<import("axios").AxiosResponse<{ financingcosts: Array, next: string, previous: string, count: number }>>}
|
|
34
|
+
* @throws When response is 4xx/5xx (400 INVALID_PAGE, 401, 500)
|
|
34
35
|
*/
|
|
35
36
|
function all({
|
|
36
37
|
token,
|
|
@@ -49,10 +50,11 @@ function financingCostsFactory({client, internalAuthTokenProvider}) {
|
|
|
49
50
|
* @param {Object} opts
|
|
50
51
|
* @param {string} [opts.token] - API key
|
|
51
52
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
52
|
-
* @param {string} opts.id - Financing cost id
|
|
53
|
+
* @param {string} opts.id - Financing cost id (24 hex characters)
|
|
53
54
|
* @param {FinancingCostGetQuery} [opts.query] - Query params (providerId)
|
|
54
55
|
* @param {Object} [opts.headers] - Optional headers
|
|
55
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
56
|
+
* @returns {Promise<import("axios").AxiosResponse<{ financingcost: Object }>>}
|
|
57
|
+
* @throws When response is 4xx/5xx (400 INVALID_FINANCINGCOST_ID, 401, 404 FINANCINGCOST_NOT_FOUND, 500)
|
|
56
58
|
*/
|
|
57
59
|
function get({
|
|
58
60
|
id,
|
|
@@ -68,13 +70,14 @@ function financingCostsFactory({client, internalAuthTokenProvider}) {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
/**
|
|
71
|
-
* POST /financing-costs - create financing cost.
|
|
73
|
+
* POST /financing-costs - create financing cost.
|
|
72
74
|
* @param {Object} opts
|
|
73
75
|
* @param {string} [opts.token] - API key
|
|
74
76
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
75
|
-
* @param {Object} opts.financingCost - Financing cost
|
|
77
|
+
* @param {Object} opts.financingCost - Financing cost (name, internalId, currencyCode, dow, creditCard, maxQuota, interest, enabled)
|
|
76
78
|
* @param {Object} [opts.headers] - Optional headers
|
|
77
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
79
|
+
* @returns {Promise<import("axios").AxiosResponse<{ financingcost: Object }>>}
|
|
80
|
+
* @throws When response is 4xx/5xx (400 WRONG_DATA, 401, 409 duplicated internalId, 500)
|
|
78
81
|
*/
|
|
79
82
|
function create({jwtToken, token, financingCost, headers}) {
|
|
80
83
|
return client({
|
|
@@ -88,13 +91,14 @@ function financingCostsFactory({client, internalAuthTokenProvider}) {
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
/**
|
|
91
|
-
* DELETE /financing-costs/:id - remove financing cost.
|
|
94
|
+
* DELETE /financing-costs/:id - remove financing cost.
|
|
92
95
|
* @param {Object} opts
|
|
93
96
|
* @param {string} [opts.token] - API key
|
|
94
97
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
95
|
-
* @param {string} opts.id - Financing cost id
|
|
98
|
+
* @param {string} opts.id - Financing cost id (24 hex characters)
|
|
96
99
|
* @param {Object} [opts.headers] - Optional headers
|
|
97
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
100
|
+
* @returns {Promise<import("axios").AxiosResponse<{ financingcostId: string }>>}
|
|
101
|
+
* @throws When response is 4xx/5xx (400 INVALID_FINANCINGCOST_ID, 401, 404 FINANCINGCOST_NOT_FOUND, 500)
|
|
98
102
|
*/
|
|
99
103
|
function remove({jwtToken, id, token, headers, query = {}}) {
|
|
100
104
|
return client({
|
|
@@ -106,14 +110,15 @@ function financingCostsFactory({client, internalAuthTokenProvider}) {
|
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
/**
|
|
109
|
-
* PUT /financing-costs/:id - update financing cost.
|
|
113
|
+
* PUT /financing-costs/:id - update financing cost.
|
|
110
114
|
* @param {Object} opts
|
|
111
115
|
* @param {string} [opts.token] - API key
|
|
112
116
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
113
|
-
* @param {string} opts.id - Financing cost id
|
|
114
|
-
* @param {Object} opts.financingCost - Financing cost
|
|
117
|
+
* @param {string} opts.id - Financing cost id (24 hex characters)
|
|
118
|
+
* @param {Object} opts.financingCost - Financing cost (name, internalId, currencyCode, dow, creditCard, maxQuota, interest, enabled)
|
|
115
119
|
* @param {Object} [opts.headers] - Optional headers
|
|
116
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
120
|
+
* @returns {Promise<import("axios").AxiosResponse<{ financingcost: Object }>>}
|
|
121
|
+
* @throws When response is 4xx/5xx (400 WRONG_DATA, 401, 404 not found, 409 duplicated internalId, 500)
|
|
117
122
|
*/
|
|
118
123
|
function update({jwtToken, token, id, financingCost, headers}) {
|
|
119
124
|
return client({
|
|
@@ -16,13 +16,14 @@ const {authorizationHeaders} = require("./../endpoints_helpers.js");
|
|
|
16
16
|
*/
|
|
17
17
|
function garagesFactory({client, internalAuthTokenProvider}) {
|
|
18
18
|
/**
|
|
19
|
-
* GET /garages - list garages.
|
|
19
|
+
* GET /garages - list garages (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 {GaragesQuery} [opts.query] - Query params (location, stationId)
|
|
24
24
|
* @param {Object} [opts.headers] - Optional headers
|
|
25
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
25
|
+
* @returns {Promise<import("axios").AxiosResponse<{ garages: Array, next?: string, previous?: string, count: number }>>}
|
|
26
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
26
27
|
*/
|
|
27
28
|
function all({token, jwtToken, query = {}, headers}) {
|
|
28
29
|
return client.get("/garages", {
|
|
@@ -32,13 +33,14 @@ function garagesFactory({client, internalAuthTokenProvider}) {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
|
-
* GET /garages/:garageId - get garage by id.
|
|
36
|
+
* GET /garages/:garageId - get garage by id.
|
|
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.garageId - Garage id
|
|
40
|
+
* @param {string} opts.garageId - Garage id (24 hex characters)
|
|
40
41
|
* @param {Object} [opts.headers] - Optional headers
|
|
41
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
42
|
+
* @returns {Promise<import("axios").AxiosResponse<{ garage: Object }>>}
|
|
43
|
+
* @throws When response is 4xx/5xx (400 INVALID_GARAGE_ID, 401, 404 GARAGE_NOT_FOUND, 500)
|
|
42
44
|
*/
|
|
43
45
|
function get({token, jwtToken, garageId, headers}) {
|
|
44
46
|
return client.get(`/garages/${garageId}`, {
|
|
@@ -47,13 +49,14 @@ function garagesFactory({client, internalAuthTokenProvider}) {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
|
-
* POST /garages - create garage.
|
|
52
|
+
* POST /garages - create garage.
|
|
51
53
|
* @param {Object} opts
|
|
52
54
|
* @param {string} [opts.token] - API key
|
|
53
55
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
54
|
-
* @param {Object} opts.data - Garage payload
|
|
56
|
+
* @param {Object} opts.data - Garage payload (name, location, stationId)
|
|
55
57
|
* @param {Object} [opts.headers] - Optional headers
|
|
56
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
58
|
+
* @returns {Promise<import("axios").AxiosResponse<{ garage: Object }>>}
|
|
59
|
+
* @throws When response is 4xx/5xx (400 WRONG_DATA, 401, 500)
|
|
57
60
|
*/
|
|
58
61
|
function create({token, jwtToken, data, headers}) {
|
|
59
62
|
return client({
|
|
@@ -71,10 +74,11 @@ function garagesFactory({client, internalAuthTokenProvider}) {
|
|
|
71
74
|
* @param {Object} opts
|
|
72
75
|
* @param {string} [opts.token] - API key
|
|
73
76
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
74
|
-
* @param {string} opts.garageId - Garage id
|
|
75
|
-
* @param {Object} opts.data - Garage payload
|
|
77
|
+
* @param {string} opts.garageId - Garage id (24 hex characters)
|
|
78
|
+
* @param {Object} opts.data - Garage payload (name, location, stationId)
|
|
76
79
|
* @param {Object} [opts.headers] - Optional headers
|
|
77
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
80
|
+
* @returns {Promise<import("axios").AxiosResponse<{ garage: Object }>>}
|
|
81
|
+
* @throws When response is 4xx/5xx (400, 401, 404 GARAGE_NOT_FOUND/STATION_NOT_FOUND, 500)
|
|
78
82
|
*/
|
|
79
83
|
function update({token, jwtToken, garageId, data, headers}) {
|
|
80
84
|
return client({
|
|
@@ -88,13 +92,14 @@ function garagesFactory({client, internalAuthTokenProvider}) {
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
/**
|
|
91
|
-
* DELETE /garages/:garageId - remove garage.
|
|
95
|
+
* DELETE /garages/:garageId - remove garage.
|
|
92
96
|
* @param {Object} opts
|
|
93
97
|
* @param {string} [opts.token] - API key
|
|
94
98
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
95
|
-
* @param {string} opts.garageId - Garage id
|
|
99
|
+
* @param {string} opts.garageId - Garage id (24 hex characters)
|
|
96
100
|
* @param {Object} [opts.headers] - Optional headers
|
|
97
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
101
|
+
* @returns {Promise<import("axios").AxiosResponse<{ success: boolean }>>}
|
|
102
|
+
* @throws When response is 4xx/5xx (400 INVALID_GARAGE_ID or GARAGE_WITH_VEHICLES, 401, 404, 500)
|
|
98
103
|
*/
|
|
99
104
|
function remove({token, jwtToken, garageId, headers}) {
|
|
100
105
|
return client({
|