@payabli/sdk-node 0.0.116 → 0.0.117
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/README.md +24 -7
- package/dist/cjs/BaseClient.d.ts +10 -1
- package/dist/cjs/BaseClient.js +57 -0
- package/dist/cjs/Client.d.ts +87 -86
- package/dist/cjs/Client.js +31 -72
- package/dist/cjs/api/resources/bill/client/Client.d.ts +33 -33
- package/dist/cjs/api/resources/bill/client/Client.js +69 -216
- package/dist/cjs/api/resources/boarding/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
- package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +17 -15
- package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
- package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
- package/dist/cjs/api/resources/cloud/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
- package/dist/cjs/api/resources/customer/client/Client.d.ts +17 -17
- package/dist/cjs/api/resources/customer/client/Client.js +31 -113
- package/dist/cjs/api/resources/export/client/Client.d.ts +93 -89
- package/dist/cjs/api/resources/export/client/Client.js +205 -582
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
- package/dist/cjs/api/resources/import/client/Client.d.ts +11 -11
- package/dist/cjs/api/resources/import/client/Client.js +19 -62
- package/dist/cjs/api/resources/invoice/client/Client.d.ts +31 -31
- package/dist/cjs/api/resources/invoice/client/Client.js +62 -209
- package/dist/cjs/api/resources/lineItem/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
- package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +39 -39
- package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
- package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +43 -26
- package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
- package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
- package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
- package/dist/cjs/api/resources/notification/client/Client.d.ts +16 -16
- package/dist/cjs/api/resources/notification/client/Client.js +32 -101
- package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
- package/dist/cjs/api/resources/ocr/client/Client.d.ts +13 -9
- package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
- package/dist/cjs/api/resources/organization/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/organization/client/Client.js +35 -130
- package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +23 -23
- package/dist/cjs/api/resources/paymentLink/client/Client.js +43 -164
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +19 -19
- package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
- package/dist/cjs/api/resources/paypoint/client/Client.d.ts +22 -22
- package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
- package/dist/cjs/api/resources/query/client/Client.d.ts +71 -71
- package/dist/cjs/api/resources/query/client/Client.js +137 -572
- package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
- package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
- package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/statistic/client/Client.d.ts +50 -50
- package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
- package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
- package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
- package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/statistic/types/index.js +1 -0
- package/dist/cjs/api/resources/subscription/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
- package/dist/cjs/api/resources/templates/client/Client.d.ts +15 -15
- package/dist/cjs/api/resources/templates/client/Client.js +28 -84
- package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
- package/dist/cjs/api/resources/user/client/Client.d.ts +54 -32
- package/dist/cjs/api/resources/user/client/Client.js +84 -222
- package/dist/cjs/api/resources/vendor/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
- package/dist/cjs/api/resources/wallet/client/Client.d.ts +13 -13
- package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
- package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
- package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
- package/dist/cjs/api/types/NotificationContent.js +1 -0
- package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
- package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
- package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/{version.js → core/auth/AuthProvider.js} +0 -2
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
- package/dist/cjs/core/fetcher/Fetcher.js +42 -24
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/core/logging/logger.js +1 -1
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/esm/BaseClient.d.mts +10 -1
- package/dist/esm/BaseClient.mjs +22 -1
- package/dist/esm/Client.d.mts +87 -86
- package/dist/esm/Client.mjs +59 -67
- package/dist/esm/api/resources/bill/client/Client.d.mts +33 -33
- package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
- package/dist/esm/api/resources/boarding/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
- package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +17 -15
- package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
- package/dist/esm/api/resources/checkCapture/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
- package/dist/esm/api/resources/cloud/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
- package/dist/esm/api/resources/customer/client/Client.d.mts +17 -17
- package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
- package/dist/esm/api/resources/export/client/Client.d.mts +93 -89
- package/dist/esm/api/resources/export/client/Client.mjs +204 -581
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
- package/dist/esm/api/resources/import/client/Client.d.mts +11 -11
- package/dist/esm/api/resources/import/client/Client.mjs +17 -60
- package/dist/esm/api/resources/invoice/client/Client.d.mts +31 -31
- package/dist/esm/api/resources/invoice/client/Client.mjs +60 -207
- package/dist/esm/api/resources/lineItem/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
- package/dist/esm/api/resources/moneyIn/client/Client.d.mts +39 -39
- package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
- package/dist/esm/api/resources/moneyOut/client/Client.d.mts +43 -26
- package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
- package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
- package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
- package/dist/esm/api/resources/notification/client/Client.d.mts +16 -16
- package/dist/esm/api/resources/notification/client/Client.mjs +31 -100
- package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
- package/dist/esm/api/resources/ocr/client/Client.d.mts +13 -9
- package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
- package/dist/esm/api/resources/organization/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
- package/dist/esm/api/resources/paymentLink/client/Client.d.mts +23 -23
- package/dist/esm/api/resources/paymentLink/client/Client.mjs +41 -162
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +19 -19
- package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
- package/dist/esm/api/resources/paypoint/client/Client.d.mts +22 -22
- package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
- package/dist/esm/api/resources/query/client/Client.d.mts +71 -71
- package/dist/esm/api/resources/query/client/Client.mjs +136 -571
- package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
- package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
- package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
- package/dist/esm/api/resources/statistic/client/Client.d.mts +50 -50
- package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
- package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
- package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
- package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
- package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
- package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
- package/dist/esm/api/resources/subscription/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
- package/dist/esm/api/resources/templates/client/Client.d.mts +15 -15
- package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
- package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
- package/dist/esm/api/resources/user/client/Client.d.mts +54 -32
- package/dist/esm/api/resources/user/client/Client.mjs +83 -221
- package/dist/esm/api/resources/vendor/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
- package/dist/esm/api/resources/wallet/client/Client.d.mts +13 -13
- package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
- package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
- package/dist/esm/api/types/NotificationContent.d.mts +1 -0
- package/dist/esm/api/types/NotificationContent.mjs +1 -0
- package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
- package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
- package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
- package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/logging/logger.mjs +1 -1
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/package.json +4 -4
- package/reference.md +761 -473
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/cjs/version.d.ts +0 -1
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
- package/dist/esm/version.d.mts +0 -1
- package/dist/esm/version.mjs +0 -1
|
@@ -43,19 +43,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.UserClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
50
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
53
|
const Payabli = __importStar(require("../../../index.js"));
|
|
52
|
-
class
|
|
53
|
-
constructor(
|
|
54
|
-
this._options =
|
|
54
|
+
class UserClient {
|
|
55
|
+
constructor(options = {}) {
|
|
56
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
59
|
+
* Use this endpoint to add a new user to an organization.
|
|
60
|
+
*
|
|
57
61
|
* @param {Payabli.UserData} request
|
|
58
|
-
* @param {
|
|
62
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
63
|
*
|
|
60
64
|
* @throws {@link Payabli.BadRequestError}
|
|
61
65
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -71,7 +75,8 @@ class User {
|
|
|
71
75
|
__addUser(request, requestOptions) {
|
|
72
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
77
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
74
|
-
const
|
|
78
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
79
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
75
80
|
const _response = yield core.fetcher({
|
|
76
81
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User"),
|
|
77
82
|
method: "POST",
|
|
@@ -107,25 +112,13 @@ class User {
|
|
|
107
112
|
});
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
|
-
|
|
111
|
-
case "non-json":
|
|
112
|
-
throw new errors.PayabliError({
|
|
113
|
-
statusCode: _response.error.statusCode,
|
|
114
|
-
body: _response.error.rawBody,
|
|
115
|
-
rawResponse: _response.rawResponse,
|
|
116
|
-
});
|
|
117
|
-
case "timeout":
|
|
118
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User.");
|
|
119
|
-
case "unknown":
|
|
120
|
-
throw new errors.PayabliError({
|
|
121
|
-
message: _response.error.errorMessage,
|
|
122
|
-
rawResponse: _response.rawResponse,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
115
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User");
|
|
125
116
|
});
|
|
126
117
|
}
|
|
127
118
|
/**
|
|
128
|
-
*
|
|
119
|
+
* Use this endpoint to refresh the authentication token for a user within an organization.
|
|
120
|
+
*
|
|
121
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
122
|
*
|
|
130
123
|
* @throws {@link Payabli.BadRequestError}
|
|
131
124
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -141,7 +134,8 @@ class User {
|
|
|
141
134
|
__authRefreshUser(requestOptions) {
|
|
142
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
136
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
144
|
-
const
|
|
137
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
138
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
145
139
|
const _response = yield core.fetcher({
|
|
146
140
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User/authrefresh"),
|
|
147
141
|
method: "POST",
|
|
@@ -174,26 +168,14 @@ class User {
|
|
|
174
168
|
});
|
|
175
169
|
}
|
|
176
170
|
}
|
|
177
|
-
|
|
178
|
-
case "non-json":
|
|
179
|
-
throw new errors.PayabliError({
|
|
180
|
-
statusCode: _response.error.statusCode,
|
|
181
|
-
body: _response.error.rawBody,
|
|
182
|
-
rawResponse: _response.rawResponse,
|
|
183
|
-
});
|
|
184
|
-
case "timeout":
|
|
185
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User/authrefresh.");
|
|
186
|
-
case "unknown":
|
|
187
|
-
throw new errors.PayabliError({
|
|
188
|
-
message: _response.error.errorMessage,
|
|
189
|
-
rawResponse: _response.rawResponse,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
171
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User/authrefresh");
|
|
192
172
|
});
|
|
193
173
|
}
|
|
194
174
|
/**
|
|
175
|
+
* Use this endpoint to initiate a password reset for a user within an organization.
|
|
176
|
+
*
|
|
195
177
|
* @param {Payabli.UserAuthResetRequest} request
|
|
196
|
-
* @param {
|
|
178
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
197
179
|
*
|
|
198
180
|
* @throws {@link Payabli.BadRequestError}
|
|
199
181
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -209,7 +191,8 @@ class User {
|
|
|
209
191
|
__authResetUser() {
|
|
210
192
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
211
193
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
212
|
-
const
|
|
194
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
195
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
213
196
|
const _response = yield core.fetcher({
|
|
214
197
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User/authreset"),
|
|
215
198
|
method: "POST",
|
|
@@ -245,21 +228,7 @@ class User {
|
|
|
245
228
|
});
|
|
246
229
|
}
|
|
247
230
|
}
|
|
248
|
-
|
|
249
|
-
case "non-json":
|
|
250
|
-
throw new errors.PayabliError({
|
|
251
|
-
statusCode: _response.error.statusCode,
|
|
252
|
-
body: _response.error.rawBody,
|
|
253
|
-
rawResponse: _response.rawResponse,
|
|
254
|
-
});
|
|
255
|
-
case "timeout":
|
|
256
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User/authreset.");
|
|
257
|
-
case "unknown":
|
|
258
|
-
throw new errors.PayabliError({
|
|
259
|
-
message: _response.error.errorMessage,
|
|
260
|
-
rawResponse: _response.rawResponse,
|
|
261
|
-
});
|
|
262
|
-
}
|
|
231
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User/authreset");
|
|
263
232
|
});
|
|
264
233
|
}
|
|
265
234
|
/**
|
|
@@ -267,7 +236,7 @@ class User {
|
|
|
267
236
|
*
|
|
268
237
|
* @param {string} provider - Auth provider. This fields is optional and defaults to null for the built-in provider.
|
|
269
238
|
* @param {Payabli.UserAuthRequest} request
|
|
270
|
-
* @param {
|
|
239
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
271
240
|
*
|
|
272
241
|
* @throws {@link Payabli.BadRequestError}
|
|
273
242
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -283,7 +252,8 @@ class User {
|
|
|
283
252
|
__authUser(provider_1) {
|
|
284
253
|
return __awaiter(this, arguments, void 0, function* (provider, request = {}, requestOptions) {
|
|
285
254
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
286
|
-
const
|
|
255
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
256
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
287
257
|
const _response = yield core.fetcher({
|
|
288
258
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/auth/${core.url.encodePathParam(provider)}`),
|
|
289
259
|
method: "POST",
|
|
@@ -319,26 +289,14 @@ class User {
|
|
|
319
289
|
});
|
|
320
290
|
}
|
|
321
291
|
}
|
|
322
|
-
|
|
323
|
-
case "non-json":
|
|
324
|
-
throw new errors.PayabliError({
|
|
325
|
-
statusCode: _response.error.statusCode,
|
|
326
|
-
body: _response.error.rawBody,
|
|
327
|
-
rawResponse: _response.rawResponse,
|
|
328
|
-
});
|
|
329
|
-
case "timeout":
|
|
330
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User/auth/{provider}.");
|
|
331
|
-
case "unknown":
|
|
332
|
-
throw new errors.PayabliError({
|
|
333
|
-
message: _response.error.errorMessage,
|
|
334
|
-
rawResponse: _response.rawResponse,
|
|
335
|
-
});
|
|
336
|
-
}
|
|
292
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User/auth/{provider}");
|
|
337
293
|
});
|
|
338
294
|
}
|
|
339
295
|
/**
|
|
296
|
+
* Use this endpoint to change the password for a user within an organization.
|
|
297
|
+
*
|
|
340
298
|
* @param {Payabli.UserAuthPswResetRequest} request
|
|
341
|
-
* @param {
|
|
299
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
342
300
|
*
|
|
343
301
|
* @throws {@link Payabli.BadRequestError}
|
|
344
302
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -354,7 +312,8 @@ class User {
|
|
|
354
312
|
__changePswUser() {
|
|
355
313
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
356
314
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
357
|
-
const
|
|
315
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
316
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
358
317
|
const _response = yield core.fetcher({
|
|
359
318
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User/authpsw"),
|
|
360
319
|
method: "PUT",
|
|
@@ -390,26 +349,14 @@ class User {
|
|
|
390
349
|
});
|
|
391
350
|
}
|
|
392
351
|
}
|
|
393
|
-
|
|
394
|
-
case "non-json":
|
|
395
|
-
throw new errors.PayabliError({
|
|
396
|
-
statusCode: _response.error.statusCode,
|
|
397
|
-
body: _response.error.rawBody,
|
|
398
|
-
rawResponse: _response.rawResponse,
|
|
399
|
-
});
|
|
400
|
-
case "timeout":
|
|
401
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /User/authpsw.");
|
|
402
|
-
case "unknown":
|
|
403
|
-
throw new errors.PayabliError({
|
|
404
|
-
message: _response.error.errorMessage,
|
|
405
|
-
rawResponse: _response.rawResponse,
|
|
406
|
-
});
|
|
407
|
-
}
|
|
352
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/User/authpsw");
|
|
408
353
|
});
|
|
409
354
|
}
|
|
410
355
|
/**
|
|
356
|
+
* Use this endpoint to delete a specific user within an organization.
|
|
357
|
+
*
|
|
411
358
|
* @param {number} userId - The Payabli-generated `userId` value.
|
|
412
|
-
* @param {
|
|
359
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
413
360
|
*
|
|
414
361
|
* @throws {@link Payabli.BadRequestError}
|
|
415
362
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -425,7 +372,8 @@ class User {
|
|
|
425
372
|
__deleteUser(userId, requestOptions) {
|
|
426
373
|
return __awaiter(this, void 0, void 0, function* () {
|
|
427
374
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
428
|
-
const
|
|
375
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
376
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
429
377
|
const _response = yield core.fetcher({
|
|
430
378
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/${core.url.encodePathParam(userId)}`),
|
|
431
379
|
method: "DELETE",
|
|
@@ -458,27 +406,15 @@ class User {
|
|
|
458
406
|
});
|
|
459
407
|
}
|
|
460
408
|
}
|
|
461
|
-
|
|
462
|
-
case "non-json":
|
|
463
|
-
throw new errors.PayabliError({
|
|
464
|
-
statusCode: _response.error.statusCode,
|
|
465
|
-
body: _response.error.rawBody,
|
|
466
|
-
rawResponse: _response.rawResponse,
|
|
467
|
-
});
|
|
468
|
-
case "timeout":
|
|
469
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling DELETE /User/{userId}.");
|
|
470
|
-
case "unknown":
|
|
471
|
-
throw new errors.PayabliError({
|
|
472
|
-
message: _response.error.errorMessage,
|
|
473
|
-
rawResponse: _response.rawResponse,
|
|
474
|
-
});
|
|
475
|
-
}
|
|
409
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/User/{userId}");
|
|
476
410
|
});
|
|
477
411
|
}
|
|
478
412
|
/**
|
|
413
|
+
* Use this endpoint to enable or disable multi-factor authentication (MFA) for a user within an organization.
|
|
414
|
+
*
|
|
479
415
|
* @param {number} userId - User Identifier
|
|
480
416
|
* @param {Payabli.MfaData} request
|
|
481
|
-
* @param {
|
|
417
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
482
418
|
*
|
|
483
419
|
* @throws {@link Payabli.BadRequestError}
|
|
484
420
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -494,7 +430,8 @@ class User {
|
|
|
494
430
|
__editMfaUser(userId, request, requestOptions) {
|
|
495
431
|
return __awaiter(this, void 0, void 0, function* () {
|
|
496
432
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
497
|
-
const
|
|
433
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
434
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
498
435
|
const _response = yield core.fetcher({
|
|
499
436
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/mfa/${core.url.encodePathParam(userId)}`),
|
|
500
437
|
method: "PUT",
|
|
@@ -530,27 +467,15 @@ class User {
|
|
|
530
467
|
});
|
|
531
468
|
}
|
|
532
469
|
}
|
|
533
|
-
|
|
534
|
-
case "non-json":
|
|
535
|
-
throw new errors.PayabliError({
|
|
536
|
-
statusCode: _response.error.statusCode,
|
|
537
|
-
body: _response.error.rawBody,
|
|
538
|
-
rawResponse: _response.rawResponse,
|
|
539
|
-
});
|
|
540
|
-
case "timeout":
|
|
541
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /User/mfa/{userId}.");
|
|
542
|
-
case "unknown":
|
|
543
|
-
throw new errors.PayabliError({
|
|
544
|
-
message: _response.error.errorMessage,
|
|
545
|
-
rawResponse: _response.rawResponse,
|
|
546
|
-
});
|
|
547
|
-
}
|
|
470
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/User/mfa/{userId}");
|
|
548
471
|
});
|
|
549
472
|
}
|
|
550
473
|
/**
|
|
474
|
+
* Use this endpoint to modify the details of a specific user within an organization.
|
|
475
|
+
*
|
|
551
476
|
* @param {number} userId - User Identifier
|
|
552
477
|
* @param {Payabli.UserData} request
|
|
553
|
-
* @param {
|
|
478
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
554
479
|
*
|
|
555
480
|
* @throws {@link Payabli.BadRequestError}
|
|
556
481
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -566,7 +491,8 @@ class User {
|
|
|
566
491
|
__editUser(userId, request, requestOptions) {
|
|
567
492
|
return __awaiter(this, void 0, void 0, function* () {
|
|
568
493
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
569
|
-
const
|
|
494
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
495
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
570
496
|
const _response = yield core.fetcher({
|
|
571
497
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/${core.url.encodePathParam(userId)}`),
|
|
572
498
|
method: "PUT",
|
|
@@ -602,27 +528,15 @@ class User {
|
|
|
602
528
|
});
|
|
603
529
|
}
|
|
604
530
|
}
|
|
605
|
-
|
|
606
|
-
case "non-json":
|
|
607
|
-
throw new errors.PayabliError({
|
|
608
|
-
statusCode: _response.error.statusCode,
|
|
609
|
-
body: _response.error.rawBody,
|
|
610
|
-
rawResponse: _response.rawResponse,
|
|
611
|
-
});
|
|
612
|
-
case "timeout":
|
|
613
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /User/{userId}.");
|
|
614
|
-
case "unknown":
|
|
615
|
-
throw new errors.PayabliError({
|
|
616
|
-
message: _response.error.errorMessage,
|
|
617
|
-
rawResponse: _response.rawResponse,
|
|
618
|
-
});
|
|
619
|
-
}
|
|
531
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/User/{userId}");
|
|
620
532
|
});
|
|
621
533
|
}
|
|
622
534
|
/**
|
|
535
|
+
* Use this endpoint to retrieve information about a specific user within an organization.
|
|
536
|
+
*
|
|
623
537
|
* @param {number} userId - The Payabli-generated `userId` value.
|
|
624
538
|
* @param {Payabli.GetUserRequest} request
|
|
625
|
-
* @param {
|
|
539
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
626
540
|
*
|
|
627
541
|
* @throws {@link Payabli.BadRequestError}
|
|
628
542
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -648,7 +562,8 @@ class User {
|
|
|
648
562
|
if (level != null) {
|
|
649
563
|
_queryParams.level = level.toString();
|
|
650
564
|
}
|
|
651
|
-
const
|
|
565
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
566
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
652
567
|
const _response = yield core.fetcher({
|
|
653
568
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/${core.url.encodePathParam(userId)}`),
|
|
654
569
|
method: "GET",
|
|
@@ -681,25 +596,13 @@ class User {
|
|
|
681
596
|
});
|
|
682
597
|
}
|
|
683
598
|
}
|
|
684
|
-
|
|
685
|
-
case "non-json":
|
|
686
|
-
throw new errors.PayabliError({
|
|
687
|
-
statusCode: _response.error.statusCode,
|
|
688
|
-
body: _response.error.rawBody,
|
|
689
|
-
rawResponse: _response.rawResponse,
|
|
690
|
-
});
|
|
691
|
-
case "timeout":
|
|
692
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /User/{userId}.");
|
|
693
|
-
case "unknown":
|
|
694
|
-
throw new errors.PayabliError({
|
|
695
|
-
message: _response.error.errorMessage,
|
|
696
|
-
rawResponse: _response.rawResponse,
|
|
697
|
-
});
|
|
698
|
-
}
|
|
599
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/User/{userId}");
|
|
699
600
|
});
|
|
700
601
|
}
|
|
701
602
|
/**
|
|
702
|
-
*
|
|
603
|
+
* Use this endpoint to log a user out from the system.
|
|
604
|
+
*
|
|
605
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
703
606
|
*
|
|
704
607
|
* @throws {@link Payabli.BadRequestError}
|
|
705
608
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -715,7 +618,8 @@ class User {
|
|
|
715
618
|
__logoutUser(requestOptions) {
|
|
716
619
|
return __awaiter(this, void 0, void 0, function* () {
|
|
717
620
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
718
|
-
const
|
|
621
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
622
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
719
623
|
const _response = yield core.fetcher({
|
|
720
624
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User/authlogout"),
|
|
721
625
|
method: "GET",
|
|
@@ -748,28 +652,16 @@ class User {
|
|
|
748
652
|
});
|
|
749
653
|
}
|
|
750
654
|
}
|
|
751
|
-
|
|
752
|
-
case "non-json":
|
|
753
|
-
throw new errors.PayabliError({
|
|
754
|
-
statusCode: _response.error.statusCode,
|
|
755
|
-
body: _response.error.rawBody,
|
|
756
|
-
rawResponse: _response.rawResponse,
|
|
757
|
-
});
|
|
758
|
-
case "timeout":
|
|
759
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /User/authlogout.");
|
|
760
|
-
case "unknown":
|
|
761
|
-
throw new errors.PayabliError({
|
|
762
|
-
message: _response.error.errorMessage,
|
|
763
|
-
rawResponse: _response.rawResponse,
|
|
764
|
-
});
|
|
765
|
-
}
|
|
655
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/User/authlogout");
|
|
766
656
|
});
|
|
767
657
|
}
|
|
768
658
|
/**
|
|
769
|
-
*
|
|
770
|
-
*
|
|
659
|
+
* Resends the MFA code to the user via the selected MFA mode (email or SMS).
|
|
660
|
+
*
|
|
771
661
|
* @param {string} usrname -
|
|
772
|
-
* @param {
|
|
662
|
+
* @param {string} Entry -
|
|
663
|
+
* @param {number} EntryType -
|
|
664
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
773
665
|
*
|
|
774
666
|
* @throws {@link Payabli.BadRequestError}
|
|
775
667
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -777,17 +669,18 @@ class User {
|
|
|
777
669
|
* @throws {@link Payabli.ServiceUnavailableError}
|
|
778
670
|
*
|
|
779
671
|
* @example
|
|
780
|
-
* await client.user.resendMfaCode("Entry", 1
|
|
672
|
+
* await client.user.resendMfaCode("usrname", "Entry", 1)
|
|
781
673
|
*/
|
|
782
|
-
resendMfaCode(
|
|
783
|
-
return core.HttpResponsePromise.fromPromise(this.__resendMfaCode(
|
|
674
|
+
resendMfaCode(usrname, Entry, EntryType, requestOptions) {
|
|
675
|
+
return core.HttpResponsePromise.fromPromise(this.__resendMfaCode(usrname, Entry, EntryType, requestOptions));
|
|
784
676
|
}
|
|
785
|
-
__resendMfaCode(
|
|
677
|
+
__resendMfaCode(usrname, Entry, EntryType, requestOptions) {
|
|
786
678
|
return __awaiter(this, void 0, void 0, function* () {
|
|
787
679
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
788
|
-
const
|
|
680
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
681
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
789
682
|
const _response = yield core.fetcher({
|
|
790
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/resendmfa/${core.url.encodePathParam(usrname)}/${core.url.encodePathParam(
|
|
683
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `User/resendmfa/${core.url.encodePathParam(usrname)}/${core.url.encodePathParam(Entry)}/${core.url.encodePathParam(EntryType)}`),
|
|
791
684
|
method: "POST",
|
|
792
685
|
headers: _headers,
|
|
793
686
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -818,26 +711,14 @@ class User {
|
|
|
818
711
|
});
|
|
819
712
|
}
|
|
820
713
|
}
|
|
821
|
-
|
|
822
|
-
case "non-json":
|
|
823
|
-
throw new errors.PayabliError({
|
|
824
|
-
statusCode: _response.error.statusCode,
|
|
825
|
-
body: _response.error.rawBody,
|
|
826
|
-
rawResponse: _response.rawResponse,
|
|
827
|
-
});
|
|
828
|
-
case "timeout":
|
|
829
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User/resendmfa/{usrname}/{Entry}/{EntryType}.");
|
|
830
|
-
case "unknown":
|
|
831
|
-
throw new errors.PayabliError({
|
|
832
|
-
message: _response.error.errorMessage,
|
|
833
|
-
rawResponse: _response.rawResponse,
|
|
834
|
-
});
|
|
835
|
-
}
|
|
714
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User/resendmfa/{usrname}/{Entry}/{EntryType}");
|
|
836
715
|
});
|
|
837
716
|
}
|
|
838
717
|
/**
|
|
718
|
+
* Use this endpoint to validate the multi-factor authentication (MFA) code for a user within an organization.
|
|
719
|
+
*
|
|
839
720
|
* @param {Payabli.MfaValidationData} request
|
|
840
|
-
* @param {
|
|
721
|
+
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
841
722
|
*
|
|
842
723
|
* @throws {@link Payabli.BadRequestError}
|
|
843
724
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -853,7 +734,8 @@ class User {
|
|
|
853
734
|
__validateMfaUser() {
|
|
854
735
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
855
736
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
856
|
-
const
|
|
737
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
738
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
857
739
|
const _response = yield core.fetcher({
|
|
858
740
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "User/mfa"),
|
|
859
741
|
method: "POST",
|
|
@@ -889,28 +771,8 @@ class User {
|
|
|
889
771
|
});
|
|
890
772
|
}
|
|
891
773
|
}
|
|
892
|
-
|
|
893
|
-
case "non-json":
|
|
894
|
-
throw new errors.PayabliError({
|
|
895
|
-
statusCode: _response.error.statusCode,
|
|
896
|
-
body: _response.error.rawBody,
|
|
897
|
-
rawResponse: _response.rawResponse,
|
|
898
|
-
});
|
|
899
|
-
case "timeout":
|
|
900
|
-
throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /User/mfa.");
|
|
901
|
-
case "unknown":
|
|
902
|
-
throw new errors.PayabliError({
|
|
903
|
-
message: _response.error.errorMessage,
|
|
904
|
-
rawResponse: _response.rawResponse,
|
|
905
|
-
});
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
_getCustomAuthorizationHeaders() {
|
|
910
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
911
|
-
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
912
|
-
return { requestToken: apiKeyValue };
|
|
774
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/User/mfa");
|
|
913
775
|
});
|
|
914
776
|
}
|
|
915
777
|
}
|
|
916
|
-
exports.
|
|
778
|
+
exports.UserClient = UserClient;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
2
3
|
import * as core from "../../../../core/index.js";
|
|
3
4
|
import * as Payabli from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
5
|
+
export declare namespace VendorClient {
|
|
5
6
|
interface Options extends BaseClientOptions {
|
|
6
7
|
}
|
|
7
8
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
11
|
+
export declare class VendorClient {
|
|
12
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<VendorClient.Options>;
|
|
13
|
+
constructor(options?: VendorClient.Options);
|
|
13
14
|
/**
|
|
14
15
|
* Creates a vendor in an entrypoint.
|
|
15
16
|
*
|
|
16
17
|
* @param {string} entry - Entrypoint identifier.
|
|
17
18
|
* @param {Payabli.VendorData} request
|
|
18
|
-
* @param {
|
|
19
|
+
* @param {VendorClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
20
|
*
|
|
20
21
|
* @throws {@link Payabli.BadRequestError}
|
|
21
22
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -68,13 +69,13 @@ export declare class Vendor {
|
|
|
68
69
|
* internalReferenceId: 123
|
|
69
70
|
* })
|
|
70
71
|
*/
|
|
71
|
-
addVendor(entry: string, request: Payabli.VendorData, requestOptions?:
|
|
72
|
+
addVendor(entry: string, request: Payabli.VendorData, requestOptions?: VendorClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseVendors>;
|
|
72
73
|
private __addVendor;
|
|
73
74
|
/**
|
|
74
75
|
* Delete a vendor.
|
|
75
76
|
*
|
|
76
77
|
* @param {number} idVendor - Vendor ID.
|
|
77
|
-
* @param {
|
|
78
|
+
* @param {VendorClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
79
|
*
|
|
79
80
|
* @throws {@link Payabli.BadRequestError}
|
|
80
81
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -84,14 +85,14 @@ export declare class Vendor {
|
|
|
84
85
|
* @example
|
|
85
86
|
* await client.vendor.deleteVendor(1)
|
|
86
87
|
*/
|
|
87
|
-
deleteVendor(idVendor: number, requestOptions?:
|
|
88
|
+
deleteVendor(idVendor: number, requestOptions?: VendorClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseVendors>;
|
|
88
89
|
private __deleteVendor;
|
|
89
90
|
/**
|
|
90
91
|
* Updates a vendor's information. Send only the fields you need to update.
|
|
91
92
|
*
|
|
92
93
|
* @param {number} idVendor - Vendor ID.
|
|
93
94
|
* @param {Payabli.VendorData} request
|
|
94
|
-
* @param {
|
|
95
|
+
* @param {VendorClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
96
|
*
|
|
96
97
|
* @throws {@link Payabli.BadRequestError}
|
|
97
98
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -103,13 +104,13 @@ export declare class Vendor {
|
|
|
103
104
|
* name1: "Theodore's Janitorial"
|
|
104
105
|
* })
|
|
105
106
|
*/
|
|
106
|
-
editVendor(idVendor: number, request: Payabli.VendorData, requestOptions?:
|
|
107
|
+
editVendor(idVendor: number, request: Payabli.VendorData, requestOptions?: VendorClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseVendors>;
|
|
107
108
|
private __editVendor;
|
|
108
109
|
/**
|
|
109
110
|
* Retrieves a vendor's details.
|
|
110
111
|
*
|
|
111
112
|
* @param {number} idVendor - Vendor ID.
|
|
112
|
-
* @param {
|
|
113
|
+
* @param {VendorClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
113
114
|
*
|
|
114
115
|
* @throws {@link Payabli.BadRequestError}
|
|
115
116
|
* @throws {@link Payabli.UnauthorizedError}
|
|
@@ -119,7 +120,6 @@ export declare class Vendor {
|
|
|
119
120
|
* @example
|
|
120
121
|
* await client.vendor.getVendor(1)
|
|
121
122
|
*/
|
|
122
|
-
getVendor(idVendor: number, requestOptions?:
|
|
123
|
+
getVendor(idVendor: number, requestOptions?: VendorClient.RequestOptions): core.HttpResponsePromise<Payabli.VendorQueryRecord>;
|
|
123
124
|
private __getVendor;
|
|
124
|
-
protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
|
|
125
125
|
}
|