btrz-api-client 8.34.0 → 8.36.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 +4 -0
- 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 +38 -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 +24 -17
- 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/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/vehicle-types.js +2 -5
- package/lib/endpoints/inventory/vehicles.js +4 -2
- 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/package.json +1 -1
- package/src/client.js +4 -0
- 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 +38 -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 +24 -18
- 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/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/vehicle-types.js +3 -4
- package/src/endpoints/inventory/vehicles.js +4 -3
- 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/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/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
|
@@ -16,7 +16,7 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
16
16
|
* @param {Object} deps
|
|
17
17
|
* @param {import("axios").AxiosInstance} deps.client
|
|
18
18
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
19
|
-
* @returns {{ all: function, get: function, create: function, update: function, types:
|
|
19
|
+
* @returns {{ all: function, get: function, create: function, update: function, types: { all: function } }}
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
|
|
@@ -25,16 +25,18 @@ function customFieldsFactory(_ref) {
|
|
|
25
25
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* GET /custom-fields - list custom fields.
|
|
28
|
+
* GET /custom-fields - list custom fields (btrz-api-inventory).
|
|
29
29
|
* @param {Object} opts
|
|
30
30
|
* @param {string} [opts.token] - API key
|
|
31
31
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
32
32
|
* @param {InventoryCustomFieldsQuery} [opts.query] - Query params (enabled, required, modelName)
|
|
33
33
|
* @param {Object} [opts.headers] - Optional headers
|
|
34
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
34
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfields: Array }>>}
|
|
35
|
+
* @throws When response is 4xx/5xx (e.g. 400 INVALID_MODEL_NAME, 401 Unauthorized, 500)
|
|
35
36
|
*/
|
|
36
37
|
function all(_ref2) {
|
|
37
38
|
var token = _ref2.token,
|
|
39
|
+
jwtToken = _ref2.jwtToken,
|
|
38
40
|
_ref2$query = _ref2.query,
|
|
39
41
|
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
40
42
|
headers = _ref2.headers;
|
|
@@ -42,18 +44,19 @@ function customFieldsFactory(_ref) {
|
|
|
42
44
|
return client({
|
|
43
45
|
url: "/custom-fields",
|
|
44
46
|
params: query,
|
|
45
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
47
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
|
-
* GET /custom-fields/:
|
|
52
|
+
* GET /custom-fields/:customfieldId - get custom field by id (btrz-api-inventory). No query params.
|
|
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 {string} opts.fieldId -
|
|
56
|
+
* @param {string} opts.fieldId - Custom field id (24 hex chars; must start with accountId)
|
|
55
57
|
* @param {Object} [opts.headers] - Optional headers
|
|
56
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
58
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
59
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND, 500)
|
|
57
60
|
*/
|
|
58
61
|
function get(_ref3) {
|
|
59
62
|
var fieldId = _ref3.fieldId,
|
|
@@ -71,13 +74,14 @@ function customFieldsFactory(_ref) {
|
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
/**
|
|
74
|
-
* POST /custom-fields - create custom field.
|
|
77
|
+
* POST /custom-fields - create custom field (btrz-api-inventory). No query params.
|
|
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 {Object} opts.field - Field payload
|
|
81
|
+
* @param {Object} opts.field - Field payload (FieldPutData: text, type, required, disabled, options when type List)
|
|
79
82
|
* @param {Object} [opts.headers] - Optional headers
|
|
80
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
83
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
84
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND/FIELD_NOT_FOUND, 500)
|
|
81
85
|
*/
|
|
82
86
|
function create(_ref4) {
|
|
83
87
|
var token = _ref4.token,
|
|
@@ -94,14 +98,15 @@ function customFieldsFactory(_ref) {
|
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
/**
|
|
97
|
-
* PUT /custom-fields/:fieldId - update custom field.
|
|
101
|
+
* PUT /custom-fields/:fieldId - update custom field (btrz-api-inventory). No query params.
|
|
98
102
|
* @param {Object} opts
|
|
99
103
|
* @param {string} [opts.token] - API key
|
|
100
104
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
101
|
-
* @param {string} opts.fieldId - Field id
|
|
102
|
-
* @param {Object} opts.field - Field payload
|
|
105
|
+
* @param {string} opts.fieldId - Field id (24 hex chars)
|
|
106
|
+
* @param {Object} opts.field - Field payload (FieldPutData)
|
|
103
107
|
* @param {Object} [opts.headers] - Optional headers
|
|
104
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
108
|
+
* @returns {Promise<import("axios").AxiosResponse<{ customfield: Object }>>}
|
|
109
|
+
* @throws When response is 4xx/5xx (400, 401, 404 CUSTOMFIELD_NOT_FOUND/FIELD_NOT_FOUND/WRONG_DATA_OPTIONS, 500)
|
|
105
110
|
*/
|
|
106
111
|
function update(_ref5) {
|
|
107
112
|
var token = _ref5.token,
|
|
@@ -121,19 +126,22 @@ function customFieldsFactory(_ref) {
|
|
|
121
126
|
/** @type {{ all: function }} */
|
|
122
127
|
var types = {
|
|
123
128
|
/**
|
|
124
|
-
* GET /custom-fields/types - list custom field types.
|
|
129
|
+
* GET /custom-fields/types - list custom field types (btrz-api-inventory). No query params.
|
|
125
130
|
* @param {Object} opts
|
|
126
131
|
* @param {string} [opts.token] - API key
|
|
132
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
127
133
|
* @param {Object} [opts.headers] - Optional headers
|
|
128
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
134
|
+
* @returns {Promise<import("axios").AxiosResponse<{ types: Array }>>}
|
|
135
|
+
* @throws When response is 4xx/5xx (e.g. 401 Unauthorized, 500)
|
|
129
136
|
*/
|
|
130
137
|
all: function all(_ref6) {
|
|
131
138
|
var token = _ref6.token,
|
|
139
|
+
jwtToken = _ref6.jwtToken,
|
|
132
140
|
headers = _ref6.headers;
|
|
133
141
|
|
|
134
142
|
return client({
|
|
135
143
|
url: "/custom-fields/types",
|
|
136
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
144
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
137
145
|
});
|
|
138
146
|
}
|
|
139
147
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
4
|
-
|
|
5
3
|
var _require = require("./../endpoints_helpers.js"),
|
|
6
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
|
-
* Query params for GET /document-types (btrz-api-inventory).
|
|
7
|
+
* Query params for GET /document-types (btrz-api-inventory).
|
|
10
8
|
* @typedef {Object} DocumentTypesListQuery
|
|
11
9
|
* @property {string} [providerIds] - Comma-separated provider IDs to get document types for
|
|
12
10
|
*/
|
|
@@ -25,136 +23,129 @@ function documentTypesFactory(_ref) {
|
|
|
25
23
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
|
-
* GET /document-types - list document types.
|
|
26
|
+
* GET /document-types - list document types (paginated).
|
|
29
27
|
* @param {Object} opts
|
|
30
28
|
* @param {string} [opts.token] - API key
|
|
31
29
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
32
|
-
* @param {DocumentTypesListQuery} [opts.query] - Query params (providerIds)
|
|
33
|
-
* @param {string} [opts.providerId] - Provider id (added to query if set)
|
|
30
|
+
* @param {DocumentTypesListQuery} [opts.query] - Query params (providerIds)
|
|
34
31
|
* @param {Object} [opts.headers] - Optional headers
|
|
35
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
32
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttypes: Array, next?: string, previous?: string, count: number }>>}
|
|
33
|
+
* @throws When response is 4xx/5xx (401 Unauthorized, 500)
|
|
36
34
|
*/
|
|
37
35
|
function all(_ref2) {
|
|
38
36
|
var token = _ref2.token,
|
|
39
37
|
jwtToken = _ref2.jwtToken,
|
|
40
38
|
_ref2$query = _ref2.query,
|
|
41
39
|
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
42
|
-
headers = _ref2.headers
|
|
43
|
-
providerId = _ref2.providerId;
|
|
40
|
+
headers = _ref2.headers;
|
|
44
41
|
|
|
45
|
-
var query_ = providerId ? _extends({}, query, { providerId: providerId }) : query;
|
|
46
42
|
return client({
|
|
47
43
|
url: "/document-types",
|
|
48
44
|
method: "get",
|
|
49
45
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
50
|
-
params:
|
|
46
|
+
params: query
|
|
51
47
|
});
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
/**
|
|
55
|
-
* GET /document-types/:
|
|
51
|
+
* GET /document-types/:documenttypeId - get document type by id.
|
|
56
52
|
* @param {Object} opts
|
|
57
53
|
* @param {string} [opts.token] - API key
|
|
58
54
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
59
|
-
* @param {string} opts.id - Document type id
|
|
60
|
-
* @param {string} [opts.providerId] - Provider id (added to query if set)
|
|
55
|
+
* @param {string} opts.id - Document type id (24 hex characters)
|
|
61
56
|
* @param {Object} [opts.headers] - Optional headers
|
|
62
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
57
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
58
|
+
* @throws When response is 4xx/5xx (400, 401, 404 DOCUMENTTYPE_NOT_FOUND, 500)
|
|
63
59
|
*/
|
|
64
60
|
function get(_ref3) {
|
|
65
61
|
var token = _ref3.token,
|
|
66
62
|
jwtToken = _ref3.jwtToken,
|
|
67
63
|
id = _ref3.id,
|
|
68
|
-
|
|
69
|
-
query = _ref3$query === undefined ? {} : _ref3$query,
|
|
70
|
-
headers = _ref3.headers,
|
|
71
|
-
providerId = _ref3.providerId;
|
|
64
|
+
headers = _ref3.headers;
|
|
72
65
|
|
|
73
|
-
var query_ = providerId ? _extends({}, query, { providerId: providerId }) : query;
|
|
74
66
|
return client({
|
|
75
67
|
url: "/document-types/" + id,
|
|
76
68
|
method: "get",
|
|
77
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
78
|
-
params: query_
|
|
69
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
79
70
|
});
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
/**
|
|
83
|
-
* PUT /document-types/:
|
|
74
|
+
* PUT /document-types/:documenttypeId - update document type.
|
|
84
75
|
* @param {Object} opts
|
|
85
76
|
* @param {string} [opts.token] - API key
|
|
86
77
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
87
78
|
* @param {string} opts.id - Document type id
|
|
88
|
-
* @param {Object} opts.
|
|
79
|
+
* @param {Object} [opts.documenttype] - Document type payload (DocumentTypePutData)
|
|
80
|
+
* @param {Object} [opts.data] - Alias for documenttype (deprecated, use documenttype)
|
|
89
81
|
* @param {Object} [opts.headers] - Optional headers
|
|
90
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
82
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
83
|
+
* @throws When response is 4xx/5xx (400, 401, 404, 409 CANNOT_UPDATE_LEXICON_ENTRIES, 500)
|
|
91
84
|
*/
|
|
92
85
|
function update(_ref4) {
|
|
93
86
|
var token = _ref4.token,
|
|
94
87
|
jwtToken = _ref4.jwtToken,
|
|
95
88
|
id = _ref4.id,
|
|
89
|
+
documenttype = _ref4.documenttype,
|
|
96
90
|
data = _ref4.data,
|
|
97
|
-
_ref4$query = _ref4.query,
|
|
98
|
-
query = _ref4$query === undefined ? {} : _ref4$query,
|
|
99
91
|
headers = _ref4.headers;
|
|
100
92
|
|
|
93
|
+
var payload = documenttype || data;
|
|
101
94
|
return client({
|
|
102
95
|
url: "/document-types/" + id,
|
|
103
96
|
method: "put",
|
|
104
97
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
105
|
-
|
|
106
|
-
data: data
|
|
98
|
+
data: { documenttype: payload }
|
|
107
99
|
});
|
|
108
100
|
}
|
|
109
101
|
|
|
110
102
|
/**
|
|
111
|
-
* DELETE /document-types/:
|
|
103
|
+
* DELETE /document-types/:documenttypeId - remove document type.
|
|
112
104
|
* @param {Object} opts
|
|
113
105
|
* @param {string} [opts.token] - API key
|
|
114
106
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
115
107
|
* @param {string} opts.id - Document type id
|
|
116
108
|
* @param {Object} [opts.headers] - Optional headers
|
|
117
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
109
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttypeId: string }>>}
|
|
110
|
+
* @throws When response is 4xx/5xx (400, 401, 404 DOCUMENTTYPE_NOT_FOUND, 500)
|
|
118
111
|
*/
|
|
119
112
|
function remove(_ref5) {
|
|
120
113
|
var token = _ref5.token,
|
|
121
114
|
jwtToken = _ref5.jwtToken,
|
|
122
115
|
id = _ref5.id,
|
|
123
|
-
_ref5$query = _ref5.query,
|
|
124
|
-
query = _ref5$query === undefined ? {} : _ref5$query,
|
|
125
116
|
headers = _ref5.headers;
|
|
126
117
|
|
|
127
118
|
return client({
|
|
128
119
|
url: "/document-types/" + id,
|
|
129
120
|
method: "delete",
|
|
130
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
131
|
-
params: query
|
|
121
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
132
122
|
});
|
|
133
123
|
}
|
|
134
124
|
|
|
135
125
|
/**
|
|
136
|
-
* POST /document-types - create document type.
|
|
126
|
+
* POST /document-types - create document type.
|
|
137
127
|
* @param {Object} opts
|
|
138
128
|
* @param {string} [opts.token] - API key
|
|
139
129
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
140
|
-
* @param {Object} opts.
|
|
130
|
+
* @param {Object} [opts.documenttype] - Document type payload (DocumentTypePostData)
|
|
131
|
+
* @param {Object} [opts.data] - Alias for documenttype (deprecated, use documenttype)
|
|
141
132
|
* @param {Object} [opts.headers] - Optional headers
|
|
142
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
133
|
+
* @returns {Promise<import("axios").AxiosResponse<{ documenttype: Object }>>}
|
|
134
|
+
* @throws When response is 4xx/5xx (400, 401, 409 CANNOT_CREATE_LEXICON_ENTRIES, 500)
|
|
143
135
|
*/
|
|
144
136
|
function create(_ref6) {
|
|
145
137
|
var token = _ref6.token,
|
|
146
138
|
jwtToken = _ref6.jwtToken,
|
|
139
|
+
documenttype = _ref6.documenttype,
|
|
147
140
|
data = _ref6.data,
|
|
148
|
-
_ref6$query = _ref6.query,
|
|
149
|
-
query = _ref6$query === undefined ? {} : _ref6$query,
|
|
150
141
|
headers = _ref6.headers;
|
|
151
142
|
|
|
143
|
+
var payload = documenttype || data;
|
|
152
144
|
return client({
|
|
153
145
|
url: "/document-types",
|
|
154
146
|
method: "post",
|
|
155
147
|
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
156
|
-
|
|
157
|
-
data: data
|
|
148
|
+
data: { documenttype: payload }
|
|
158
149
|
});
|
|
159
150
|
}
|
|
160
151
|
|
|
@@ -4,11 +4,11 @@ var _require = require("../endpoints_helpers.js"),
|
|
|
4
4
|
authorizationHeaders = _require.authorizationHeaders;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Factory for external-wallets API (btrz-api-inventory).
|
|
7
|
+
* Factory for external-wallets API (btrz-api-inventory). SaldoMax external wallets only.
|
|
8
8
|
* @param {Object} deps
|
|
9
9
|
* @param {import("axios").AxiosInstance} deps.client
|
|
10
10
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
11
|
-
* @returns {{ saldoMax:
|
|
11
|
+
* @returns {{ saldoMax: { all: function, get: function, create: function, update: function, movements: { create: function } } }}
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
|
|
@@ -19,12 +19,14 @@ function externalWalletsFactory(_ref) {
|
|
|
19
19
|
/** @type {{ all: function, create: function, get: function, update: function, movements: object }} */
|
|
20
20
|
var saldoMax = {
|
|
21
21
|
/**
|
|
22
|
-
* GET /external-wallets/saldo-max - list
|
|
22
|
+
* GET /external-wallets/saldo-max - list SaldoMax external wallets (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 {Object} [opts.query] - Pagination query params
|
|
26
27
|
* @param {Object} [opts.headers] - Optional headers
|
|
27
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
28
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallets: Array, next?: string, previous?: string, count: number }>>}
|
|
29
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
28
30
|
*/
|
|
29
31
|
all: function all(_ref2) {
|
|
30
32
|
var token = _ref2.token,
|
|
@@ -39,13 +41,14 @@ function externalWalletsFactory(_ref) {
|
|
|
39
41
|
});
|
|
40
42
|
},
|
|
41
43
|
/**
|
|
42
|
-
* POST /external-wallets/saldo-max - create
|
|
44
|
+
* POST /external-wallets/saldo-max - create SaldoMax external wallet.
|
|
43
45
|
* @param {Object} opts
|
|
44
46
|
* @param {string} [opts.token] - API key
|
|
45
47
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
46
|
-
* @param {Object} opts.externalWallet - External wallet payload
|
|
48
|
+
* @param {Object} opts.externalWallet - External wallet payload (ExternalWalletData: firstName, lastName, email, tel, dob, nip)
|
|
47
49
|
* @param {Object} [opts.headers] - Optional headers
|
|
48
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
50
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
51
|
+
* @throws When response is 4xx/5xx (400, 401, 409 DUPLICATE_EXTERNAL_WALLET_EMAIL/TEL, 500)
|
|
49
52
|
*/
|
|
50
53
|
create: function create(_ref3) {
|
|
51
54
|
var token = _ref3.token,
|
|
@@ -61,13 +64,14 @@ function externalWalletsFactory(_ref) {
|
|
|
61
64
|
});
|
|
62
65
|
},
|
|
63
66
|
/**
|
|
64
|
-
* GET /external-wallets/saldo-max/:walletId - get
|
|
67
|
+
* GET /external-wallets/saldo-max/:walletId - get SaldoMax external wallet by id.
|
|
65
68
|
* @param {Object} opts
|
|
66
69
|
* @param {string} [opts.token] - API key
|
|
67
70
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
68
|
-
* @param {string} opts.walletId - Wallet id
|
|
71
|
+
* @param {string} opts.walletId - Wallet id (24 hex characters)
|
|
69
72
|
* @param {Object} [opts.headers] - Optional headers
|
|
70
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
73
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
74
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
71
75
|
*/
|
|
72
76
|
get: function get(_ref4) {
|
|
73
77
|
var token = _ref4.token,
|
|
@@ -80,13 +84,14 @@ function externalWalletsFactory(_ref) {
|
|
|
80
84
|
});
|
|
81
85
|
},
|
|
82
86
|
/**
|
|
83
|
-
* PUT /external-wallets/saldo-max/:
|
|
87
|
+
* PUT /external-wallets/saldo-max/:walletId - update SaldoMax external wallet.
|
|
84
88
|
* @param {Object} opts
|
|
85
89
|
* @param {string} [opts.token] - API key
|
|
86
90
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
87
91
|
* @param {Object} opts.externalWallet - External wallet payload (must include _id)
|
|
88
92
|
* @param {Object} [opts.headers] - Optional headers
|
|
89
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
93
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
94
|
+
* @throws When response is 4xx/5xx (400, 401, 404 EXTERNAL_WALLET_NOT_FOUND, 500)
|
|
90
95
|
*/
|
|
91
96
|
update: function update(_ref5) {
|
|
92
97
|
var token = _ref5.token,
|
|
@@ -112,27 +117,28 @@ function externalWalletsFactory(_ref) {
|
|
|
112
117
|
/** @type {{ create: function }} */
|
|
113
118
|
movements: {
|
|
114
119
|
/**
|
|
115
|
-
* PUT /external-wallets/saldo-max/:walletId/movements -
|
|
120
|
+
* PUT /external-wallets/saldo-max/:walletId/movements - add movement to wallet.
|
|
116
121
|
* @param {Object} opts
|
|
117
122
|
* @param {string} [opts.token] - API key
|
|
118
123
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
119
124
|
* @param {string} opts.walletId - Wallet id
|
|
120
|
-
* @param {Object} opts.movement - Movement payload
|
|
121
|
-
* @
|
|
125
|
+
* @param {Object} opts.movement - Movement payload (amount, type: payment|refund|manual, reason, nip)
|
|
126
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
127
|
+
* @returns {Promise<import("axios").AxiosResponse<{ externalWallet: Object }>>}
|
|
128
|
+
* @throws When response is 4xx/5xx (400, 401, 403 INVALID_NIP/WALLET_BLOCKED/WALLET_NOT_ACTIVE, 404, 500)
|
|
122
129
|
*/
|
|
123
130
|
create: function create(_ref6) {
|
|
124
131
|
var token = _ref6.token,
|
|
125
132
|
jwtToken = _ref6.jwtToken,
|
|
126
133
|
walletId = _ref6.walletId,
|
|
127
|
-
movement = _ref6.movement
|
|
134
|
+
movement = _ref6.movement,
|
|
135
|
+
headers = _ref6.headers;
|
|
128
136
|
|
|
129
137
|
return client({
|
|
130
138
|
url: "/external-wallets/saldo-max/" + walletId + "/movements",
|
|
131
139
|
method: "put",
|
|
132
|
-
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }),
|
|
133
|
-
data: {
|
|
134
|
-
movement: movement
|
|
135
|
-
}
|
|
140
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers }),
|
|
141
|
+
data: { movement: movement }
|
|
136
142
|
});
|
|
137
143
|
}
|
|
138
144
|
}
|
|
@@ -6,10 +6,11 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
6
6
|
/**
|
|
7
7
|
* Query params for GET /fees (btrz-api-inventory). See fees get-handler getSpec().
|
|
8
8
|
* @typedef {Object} InventoryFeesQuery
|
|
9
|
-
* @property {string} [providerIds] -
|
|
10
|
-
* @property {string} [rules] -
|
|
11
|
-
* @property {string} [productId] - Product ID
|
|
12
|
-
* @property {string} [internalId] - Fee internal id
|
|
9
|
+
* @property {string} [providerIds] - Comma-separated provider (account) IDs to get fees for
|
|
10
|
+
* @property {string} [rules] - Comma-separated rules where the fees apply (e.g. cancel, ticket, transaction)
|
|
11
|
+
* @property {string} [productId] - Product ID to filter fees by
|
|
12
|
+
* @property {string} [internalId] - Fee internal id to filter by
|
|
13
|
+
* @property {string} [page] - Page number for pagination (1-based). Response includes next, previous, count
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -26,33 +27,37 @@ function feesFactory(_ref) {
|
|
|
26
27
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* GET /fees - list fees.
|
|
30
|
+
* GET /fees - list fees (paginated).
|
|
30
31
|
* @param {Object} opts
|
|
31
32
|
* @param {string} [opts.token] - API key
|
|
32
|
-
* @param {
|
|
33
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
34
|
+
* @param {InventoryFeesQuery} [opts.query] - Query params (providerIds, rules, productId, internalId)
|
|
33
35
|
* @param {Object} [opts.headers] - Optional headers
|
|
34
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
36
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fees: Array, next: string, previous: string, count: number }>>}
|
|
37
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
35
38
|
*/
|
|
36
39
|
function all(_ref2) {
|
|
37
40
|
var token = _ref2.token,
|
|
41
|
+
jwtToken = _ref2.jwtToken,
|
|
38
42
|
_ref2$query = _ref2.query,
|
|
39
43
|
query = _ref2$query === undefined ? {} : _ref2$query,
|
|
40
44
|
headers = _ref2.headers;
|
|
41
45
|
|
|
42
46
|
return client.get("/fees", {
|
|
43
47
|
params: query,
|
|
44
|
-
headers: authorizationHeaders({ token: token, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
48
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
|
-
* GET /fees/:feeId - get fee by id.
|
|
53
|
+
* GET /fees/:feeId - get fee by id.
|
|
50
54
|
* @param {Object} opts
|
|
51
55
|
* @param {string} [opts.token] - API key
|
|
52
56
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
53
|
-
* @param {string} opts.feeId - Fee id
|
|
57
|
+
* @param {string} opts.feeId - Fee id (24 hex characters)
|
|
54
58
|
* @param {Object} [opts.headers] - Optional headers
|
|
55
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
59
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
60
|
+
* @throws When response is 4xx/5xx (400, 401, 404 FEE_NOT_FOUND, 500)
|
|
56
61
|
*/
|
|
57
62
|
function get(_ref3) {
|
|
58
63
|
var token = _ref3.token,
|
|
@@ -66,13 +71,14 @@ function feesFactory(_ref) {
|
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
/**
|
|
69
|
-
* POST /fees - create fee.
|
|
74
|
+
* POST /fees - create fee.
|
|
70
75
|
* @param {Object} opts
|
|
71
76
|
* @param {string} [opts.token] - API key
|
|
72
77
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
73
|
-
* @param {Object} opts.fee - Fee payload
|
|
78
|
+
* @param {Object} opts.fee - Fee payload (FeePostData: name, internalId, valueType, value, rules, products, lexiconKeys, etc.)
|
|
74
79
|
* @param {Object} [opts.headers] - Optional headers
|
|
75
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
80
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
81
|
+
* @throws When response is 4xx/5xx (400, 401, 409 CANNOT_CREATE_LEXICON_ENTRIES, 500)
|
|
76
82
|
*/
|
|
77
83
|
function create(_ref4) {
|
|
78
84
|
var token = _ref4.token,
|
|
@@ -89,14 +95,15 @@ function feesFactory(_ref) {
|
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
/**
|
|
92
|
-
* PUT /fees/:feeId - update fee.
|
|
98
|
+
* PUT /fees/:feeId - update fee.
|
|
93
99
|
* @param {Object} opts
|
|
94
100
|
* @param {string} [opts.token] - API key
|
|
95
101
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
96
102
|
* @param {string} opts.feeId - Fee id
|
|
97
|
-
* @param {Object} opts.fee - Fee payload
|
|
103
|
+
* @param {Object} opts.fee - Fee payload (partial FeePostData)
|
|
98
104
|
* @param {Object} [opts.headers] - Optional headers
|
|
99
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
105
|
+
* @returns {Promise<import("axios").AxiosResponse<{ fee: Object }>>}
|
|
106
|
+
* @throws When response is 4xx/5xx (400, 401, 404 FEE_NOT_FOUND, 409 CANNOT_UPDATE_LEXICON_ENTRIES, 500)
|
|
100
107
|
*/
|
|
101
108
|
function update(_ref5) {
|
|
102
109
|
var token = _ref5.token,
|
|
@@ -20,7 +20,7 @@ var _require = require("./../endpoints_helpers.js"),
|
|
|
20
20
|
* @param {Object} deps
|
|
21
21
|
* @param {import("axios").AxiosInstance} deps.client
|
|
22
22
|
* @param {{ getToken: function(): string }} [deps.internalAuthTokenProvider]
|
|
23
|
-
* @returns {{ all: function, create: function }}
|
|
23
|
+
* @returns {{ all: function, create: function, remove: function }}
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
|
|
@@ -29,13 +29,14 @@ function filteredTripsFactory(_ref) {
|
|
|
29
29
|
internalAuthTokenProvider = _ref.internalAuthTokenProvider;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* GET /filtered-trips - list filtered trips.
|
|
32
|
+
* GET /filtered-trips - list filtered trips (paginated).
|
|
33
33
|
* @param {Object} opts
|
|
34
34
|
* @param {string} [opts.token] - API key
|
|
35
35
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
36
|
-
* @param {FilteredTripsListQuery} [opts.query] - Query params
|
|
36
|
+
* @param {FilteredTripsListQuery} [opts.query] - Query params
|
|
37
37
|
* @param {Object} [opts.headers] - Optional headers
|
|
38
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
38
|
+
* @returns {Promise<import("axios").AxiosResponse<{ filteredTrips: Array, next?: string, previous?: string, count: number }>>}
|
|
39
|
+
* @throws When response is 4xx/5xx (401, 500)
|
|
39
40
|
*/
|
|
40
41
|
function all(_ref2) {
|
|
41
42
|
var token = _ref2.token,
|
|
@@ -51,13 +52,14 @@ function filteredTripsFactory(_ref) {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
|
-
* POST /filtered-trips -
|
|
55
|
+
* POST /filtered-trips - add a trip to the blacklist (filtered trips).
|
|
55
56
|
* @param {Object} opts
|
|
56
57
|
* @param {string} [opts.token] - API key
|
|
57
58
|
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
58
|
-
* @param {
|
|
59
|
+
* @param {string} opts.tripSegmentsId - Base64-encoded JSON (FilteredTripRequest: productId, segments)
|
|
59
60
|
* @param {Object} [opts.headers] - Optional headers
|
|
60
|
-
* @returns {Promise<import("axios").AxiosResponse
|
|
61
|
+
* @returns {Promise<import("axios").AxiosResponse<{ filteredTrip: Object }>>}
|
|
62
|
+
* @throws When response is 4xx/5xx (400, 401, 409 TRIP_ALREADY_FILTERED, 500)
|
|
61
63
|
*/
|
|
62
64
|
function create(_ref3) {
|
|
63
65
|
var token = _ref3.token,
|
|
@@ -73,9 +75,33 @@ function filteredTripsFactory(_ref) {
|
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
77
|
|
|
78
|
+
/**
|
|
79
|
+
* DELETE /filtered-trip/:filteredTripId - remove a filtered trip from the blacklist.
|
|
80
|
+
* @param {Object} opts
|
|
81
|
+
* @param {string} [opts.token] - API key
|
|
82
|
+
* @param {string} [opts.jwtToken] - JWT or internal auth symbol
|
|
83
|
+
* @param {string} opts.filteredTripId - Filtered trip id (24 hex characters)
|
|
84
|
+
* @param {Object} [opts.headers] - Optional headers
|
|
85
|
+
* @returns {Promise<import("axios").AxiosResponse<void>>}
|
|
86
|
+
* @throws When response is 4xx/5xx (400, 401, 500)
|
|
87
|
+
*/
|
|
88
|
+
function remove(_ref4) {
|
|
89
|
+
var token = _ref4.token,
|
|
90
|
+
jwtToken = _ref4.jwtToken,
|
|
91
|
+
filteredTripId = _ref4.filteredTripId,
|
|
92
|
+
headers = _ref4.headers;
|
|
93
|
+
|
|
94
|
+
return client({
|
|
95
|
+
url: "/filtered-trip/" + filteredTripId,
|
|
96
|
+
method: "delete",
|
|
97
|
+
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider, headers: headers })
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
76
101
|
return {
|
|
77
102
|
all: all,
|
|
78
|
-
create: create
|
|
103
|
+
create: create,
|
|
104
|
+
remove: remove
|
|
79
105
|
};
|
|
80
106
|
}
|
|
81
107
|
|