@kard-financial/sdk 12.3.0 → 12.4.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/README.md +106 -15
- package/dist/cjs/BaseClient.d.ts +7 -8
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/Client.d.ts +13 -2
- package/dist/cjs/Client.js +67 -0
- package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/auth/client/Client.js +3 -23
- package/dist/cjs/api/resources/auth/exports.d.ts +2 -0
- package/dist/cjs/api/resources/auth/exports.js +21 -0
- package/dist/cjs/api/resources/commons/errors/ConflictError.js +5 -1
- package/dist/cjs/api/resources/commons/errors/DoesNotExistError.js +5 -1
- package/dist/cjs/api/resources/commons/errors/ForbiddenError.js +5 -1
- package/dist/cjs/api/resources/commons/errors/InternalServerError.js +5 -1
- package/dist/cjs/api/resources/commons/errors/InvalidRequest.js +5 -1
- package/dist/cjs/api/resources/commons/errors/UnauthorizedError.js +5 -1
- package/dist/cjs/api/resources/commons/exports.d.ts +1 -0
- package/dist/cjs/api/resources/commons/exports.js +18 -0
- package/dist/cjs/api/resources/commons/types/ErrorObject.d.ts +2 -2
- package/dist/cjs/api/resources/commons/types/ErrorSource.d.ts +3 -3
- package/dist/cjs/api/resources/commons/types/Links.d.ts +2 -2
- package/dist/cjs/api/resources/files/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/files/client/Client.js +11 -47
- package/dist/cjs/api/resources/files/exports.d.ts +2 -0
- package/dist/cjs/api/resources/files/exports.js +21 -0
- package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/notifications/exports.d.ts +3 -0
- package/dist/cjs/api/resources/notifications/exports.js +22 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +7 -64
- package/dist/cjs/api/resources/notifications/resources/subscriptions/exports.d.ts +2 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/exports.js +21 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/UpdateSubscriptionRequestAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/notifications/types/AuditUpdateAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/notifications/types/FailedTransactionAttributes.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/types/NotificationPayload.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/types/RewardNotificationAttributes.d.ts +2 -2
- package/dist/cjs/api/resources/ping/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/ping/client/Client.js +2 -20
- package/dist/cjs/api/resources/ping/errors/NetworkBlockedError.js +5 -1
- package/dist/cjs/api/resources/ping/exports.d.ts +2 -0
- package/dist/cjs/api/resources/ping/exports.js +21 -0
- package/dist/cjs/api/resources/transactions/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/transactions/client/Client.js +12 -113
- package/dist/cjs/api/resources/transactions/errors/CreateAuditMultiStatus.js +5 -1
- package/dist/cjs/api/resources/transactions/errors/CreateIncomingTransactionsMultiStatus.js +5 -1
- package/dist/cjs/api/resources/transactions/errors/FraudMultiStatus.js +5 -1
- package/dist/cjs/api/resources/transactions/exports.d.ts +2 -0
- package/dist/cjs/api/resources/transactions/exports.js +21 -0
- package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/transactions/types/CreateAuditMultiStatusResponse.d.ts +1 -1
- package/dist/cjs/api/resources/transactions/types/GetEarnedRewardsResponse.d.ts +1 -1
- package/dist/cjs/api/resources/transactions/types/MatchedTransactionsAttributes.d.ts +14 -14
- package/dist/cjs/api/resources/transactions/types/Merchant.d.ts +9 -9
- package/dist/cjs/api/resources/transactions/types/RewardedTransactionAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +18 -18
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/client/Client.js +5 -80
- package/dist/cjs/api/resources/users/errors/MultiStatus.js +5 -1
- package/dist/cjs/api/resources/users/exports.d.ts +3 -0
- package/dist/cjs/api/resources/users/exports.js +22 -0
- package/dist/cjs/api/resources/users/resources/attributions/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +20 -94
- package/dist/cjs/api/resources/users/resources/attributions/exports.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/attributions/exports.js +21 -0
- package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/attributions/types/AttributionState.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/attributions/types/BoostOfferResponse.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/attributions/types/NotificationAttributionAttributes.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/attributions/types/OfferAttributionAttributes.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/auth/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/resources/auth/client/Client.js +2 -20
- package/dist/cjs/api/resources/users/resources/auth/exports.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/auth/exports.js +21 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +39 -144
- package/dist/cjs/api/resources/users/resources/rewards/exports.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/rewards/exports.js +21 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/CtaComponent.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/LocationData.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/LocationsResponseObject.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/LogoFlare.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/OfferCommonFields.d.ts +8 -8
- package/dist/cjs/api/resources/users/resources/rewards/types/OfferComponents.d.ts +9 -9
- package/dist/cjs/api/resources/users/resources/rewards/types/OffersMeta.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/OffersResponseObject.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBar.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarLabelPair.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarLabels.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarSegment.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarSegments.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOffer.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/uploads/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +4 -60
- package/dist/cjs/api/resources/users/resources/uploads/errors/UploadPartMultiStatus.js +5 -1
- package/dist/cjs/api/resources/users/resources/uploads/exports.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/uploads/exports.js +21 -0
- package/dist/cjs/api/resources/users/resources/uploads/types/CreateUploadPartMultiStatusResponse.d.ts +1 -1
- package/dist/cjs/api/resources/users/types/CreateUsersMultiStatusResponse.d.ts +1 -1
- package/dist/cjs/api/resources/users/types/UpdateUserRequestAttributes.d.ts +5 -5
- package/dist/cjs/api/resources/users/types/UserRequestAttributes.d.ts +6 -6
- package/dist/cjs/auth/OAuthAuthProvider.d.ts +36 -14
- package/dist/cjs/auth/OAuthAuthProvider.js +108 -40
- package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
- package/dist/cjs/core/auth/BasicAuth.js +7 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +3 -2
- package/dist/cjs/core/fetcher/Fetcher.js +12 -2
- package/dist/cjs/core/fetcher/index.d.ts +2 -0
- package/dist/cjs/core/fetcher/index.js +3 -1
- package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/runtime/runtime.js +8 -7
- package/dist/cjs/errors/KardApiError.d.ts +3 -1
- package/dist/cjs/errors/KardApiError.js +9 -2
- package/dist/cjs/errors/KardApiTimeoutError.d.ts +4 -1
- package/dist/cjs/errors/KardApiTimeoutError.js +9 -2
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +68 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +7 -8
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/Client.d.mts +13 -2
- package/dist/esm/Client.mjs +34 -0
- package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/auth/client/Client.mjs +3 -23
- package/dist/esm/api/resources/auth/exports.d.mts +2 -0
- package/dist/esm/api/resources/auth/exports.mjs +3 -0
- package/dist/esm/api/resources/commons/errors/ConflictError.mjs +5 -1
- package/dist/esm/api/resources/commons/errors/DoesNotExistError.mjs +5 -1
- package/dist/esm/api/resources/commons/errors/ForbiddenError.mjs +5 -1
- package/dist/esm/api/resources/commons/errors/InternalServerError.mjs +5 -1
- package/dist/esm/api/resources/commons/errors/InvalidRequest.mjs +5 -1
- package/dist/esm/api/resources/commons/errors/UnauthorizedError.mjs +5 -1
- package/dist/esm/api/resources/commons/exports.d.mts +1 -0
- package/dist/esm/api/resources/commons/exports.mjs +2 -0
- package/dist/esm/api/resources/commons/types/ErrorObject.d.mts +2 -2
- package/dist/esm/api/resources/commons/types/ErrorSource.d.mts +3 -3
- package/dist/esm/api/resources/commons/types/Links.d.mts +2 -2
- package/dist/esm/api/resources/files/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/files/client/Client.mjs +11 -47
- package/dist/esm/api/resources/files/exports.d.mts +2 -0
- package/dist/esm/api/resources/files/exports.mjs +3 -0
- package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/notifications/exports.d.mts +3 -0
- package/dist/esm/api/resources/notifications/exports.mjs +4 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +7 -64
- package/dist/esm/api/resources/notifications/resources/subscriptions/exports.d.mts +2 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/exports.mjs +3 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/UpdateSubscriptionRequestAttributes.d.mts +3 -3
- package/dist/esm/api/resources/notifications/types/AuditUpdateAttributes.d.mts +3 -3
- package/dist/esm/api/resources/notifications/types/FailedTransactionAttributes.d.mts +1 -1
- package/dist/esm/api/resources/notifications/types/NotificationPayload.d.mts +2 -2
- package/dist/esm/api/resources/notifications/types/RewardNotificationAttributes.d.mts +2 -2
- package/dist/esm/api/resources/ping/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/ping/client/Client.mjs +2 -20
- package/dist/esm/api/resources/ping/errors/NetworkBlockedError.mjs +5 -1
- package/dist/esm/api/resources/ping/exports.d.mts +2 -0
- package/dist/esm/api/resources/ping/exports.mjs +3 -0
- package/dist/esm/api/resources/transactions/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/transactions/client/Client.mjs +12 -113
- package/dist/esm/api/resources/transactions/errors/CreateAuditMultiStatus.mjs +5 -1
- package/dist/esm/api/resources/transactions/errors/CreateIncomingTransactionsMultiStatus.mjs +5 -1
- package/dist/esm/api/resources/transactions/errors/FraudMultiStatus.mjs +5 -1
- package/dist/esm/api/resources/transactions/exports.d.mts +2 -0
- package/dist/esm/api/resources/transactions/exports.mjs +3 -0
- package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +3 -3
- package/dist/esm/api/resources/transactions/types/CreateAuditMultiStatusResponse.d.mts +1 -1
- package/dist/esm/api/resources/transactions/types/GetEarnedRewardsResponse.d.mts +1 -1
- package/dist/esm/api/resources/transactions/types/MatchedTransactionsAttributes.d.mts +14 -14
- package/dist/esm/api/resources/transactions/types/Merchant.d.mts +9 -9
- package/dist/esm/api/resources/transactions/types/RewardedTransactionAttributes.d.mts +3 -3
- package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +18 -18
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/client/Client.mjs +5 -80
- package/dist/esm/api/resources/users/errors/MultiStatus.mjs +5 -1
- package/dist/esm/api/resources/users/exports.d.mts +3 -0
- package/dist/esm/api/resources/users/exports.mjs +4 -0
- package/dist/esm/api/resources/users/resources/attributions/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +20 -94
- package/dist/esm/api/resources/users/resources/attributions/exports.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/attributions/exports.mjs +3 -0
- package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/attributions/types/AttributionState.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/attributions/types/BoostOfferResponse.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/attributions/types/NotificationAttributionAttributes.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/attributions/types/OfferAttributionAttributes.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/auth/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +2 -20
- package/dist/esm/api/resources/users/resources/auth/exports.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/auth/exports.mjs +3 -0
- package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +39 -144
- package/dist/esm/api/resources/users/resources/rewards/exports.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/rewards/exports.mjs +3 -0
- package/dist/esm/api/resources/users/resources/rewards/types/CtaComponent.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/LocationData.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/LocationsResponseObject.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/LogoFlare.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/OfferCommonFields.d.mts +8 -8
- package/dist/esm/api/resources/users/resources/rewards/types/OfferComponents.d.mts +9 -9
- package/dist/esm/api/resources/users/resources/rewards/types/OffersMeta.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/OffersResponseObject.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBar.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarLabelPair.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarLabels.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarSegment.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarSegments.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOffer.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/uploads/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +4 -60
- package/dist/esm/api/resources/users/resources/uploads/errors/UploadPartMultiStatus.mjs +5 -1
- package/dist/esm/api/resources/users/resources/uploads/exports.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/uploads/exports.mjs +3 -0
- package/dist/esm/api/resources/users/resources/uploads/types/CreateUploadPartMultiStatusResponse.d.mts +1 -1
- package/dist/esm/api/resources/users/types/CreateUsersMultiStatusResponse.d.mts +1 -1
- package/dist/esm/api/resources/users/types/UpdateUserRequestAttributes.d.mts +5 -5
- package/dist/esm/api/resources/users/types/UserRequestAttributes.d.mts +6 -6
- package/dist/esm/auth/OAuthAuthProvider.d.mts +36 -14
- package/dist/esm/auth/OAuthAuthProvider.mjs +106 -39
- package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
- package/dist/esm/core/auth/BasicAuth.mjs +7 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +3 -2
- package/dist/esm/core/fetcher/Fetcher.mjs +12 -2
- package/dist/esm/core/fetcher/index.d.mts +2 -0
- package/dist/esm/core/fetcher/index.mjs +1 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
- package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/runtime/runtime.mjs +8 -7
- package/dist/esm/errors/KardApiError.d.mts +3 -1
- package/dist/esm/errors/KardApiError.mjs +9 -2
- package/dist/esm/errors/KardApiTimeoutError.d.mts +4 -1
- package/dist/esm/errors/KardApiTimeoutError.mjs +9 -2
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +32 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +134 -10
- package/reference.md +1 -0
|
@@ -81,17 +81,18 @@ function evaluateRuntime() {
|
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
84
|
+
*
|
|
85
|
+
* We assign `process` to a local variable first to avoid being flagged by
|
|
86
|
+
* bundlers that perform static analysis on `process.versions` (e.g. Next.js
|
|
87
|
+
* Edge Runtime warns about Node.js APIs even when they are guarded).
|
|
84
88
|
*/
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
!!process.version &&
|
|
88
|
-
"versions" in process &&
|
|
89
|
-
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
89
|
+
const _process = typeof process !== "undefined" ? process : undefined;
|
|
90
|
+
const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
|
|
90
91
|
if (isNode) {
|
|
91
92
|
return {
|
|
92
93
|
type: "node",
|
|
93
|
-
version:
|
|
94
|
-
parsedVersion: Number(
|
|
94
|
+
version: _process.versions.node,
|
|
95
|
+
parsedVersion: Number(_process.versions.node.split(".")[0]),
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
return {
|
|
@@ -3,10 +3,12 @@ export declare class KardApiError extends Error {
|
|
|
3
3
|
readonly statusCode?: number;
|
|
4
4
|
readonly body?: unknown;
|
|
5
5
|
readonly rawResponse?: core.RawResponse;
|
|
6
|
-
|
|
6
|
+
readonly cause?: unknown;
|
|
7
|
+
constructor({ message, statusCode, body, rawResponse, cause, }: {
|
|
7
8
|
message?: string;
|
|
8
9
|
statusCode?: number;
|
|
9
10
|
body?: unknown;
|
|
10
11
|
rawResponse?: core.RawResponse;
|
|
12
|
+
cause?: unknown;
|
|
11
13
|
});
|
|
12
14
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
import { toJson } from "../core/json.mjs";
|
|
3
3
|
export class KardApiError extends Error {
|
|
4
|
-
constructor({ message, statusCode, body, rawResponse, }) {
|
|
4
|
+
constructor({ message, statusCode, body, rawResponse, cause, }) {
|
|
5
5
|
super(buildMessage({ message, statusCode, body }));
|
|
6
|
-
Object.setPrototypeOf(this,
|
|
6
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
7
|
+
if (Error.captureStackTrace) {
|
|
8
|
+
Error.captureStackTrace(this, this.constructor);
|
|
9
|
+
}
|
|
10
|
+
this.name = this.constructor.name;
|
|
7
11
|
this.statusCode = statusCode;
|
|
8
12
|
this.body = body;
|
|
9
13
|
this.rawResponse = rawResponse;
|
|
14
|
+
if (cause != null) {
|
|
15
|
+
this.cause = cause;
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
18
|
}
|
|
12
19
|
function buildMessage({ message, statusCode, body, }) {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
export class KardApiTimeoutError extends Error {
|
|
3
|
-
constructor(message) {
|
|
3
|
+
constructor(message, opts) {
|
|
4
4
|
super(message);
|
|
5
|
-
Object.setPrototypeOf(this,
|
|
5
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
6
|
+
if (Error.captureStackTrace) {
|
|
7
|
+
Error.captureStackTrace(this, this.constructor);
|
|
8
|
+
}
|
|
9
|
+
this.name = this.constructor.name;
|
|
10
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
|
|
11
|
+
this.cause = opts.cause;
|
|
12
|
+
}
|
|
6
13
|
}
|
|
7
14
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "./index.mjs";
|
|
3
|
+
export function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
4
|
+
switch (error.reason) {
|
|
5
|
+
case "non-json":
|
|
6
|
+
throw new errors.KardApiError({
|
|
7
|
+
statusCode: error.statusCode,
|
|
8
|
+
body: error.rawBody,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
case "body-is-null":
|
|
12
|
+
throw new errors.KardApiError({
|
|
13
|
+
statusCode: error.statusCode,
|
|
14
|
+
rawResponse: rawResponse,
|
|
15
|
+
});
|
|
16
|
+
case "timeout":
|
|
17
|
+
throw new errors.KardApiTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
18
|
+
cause: error.cause,
|
|
19
|
+
});
|
|
20
|
+
case "unknown":
|
|
21
|
+
throw new errors.KardApiError({
|
|
22
|
+
message: error.errorMessage,
|
|
23
|
+
rawResponse: rawResponse,
|
|
24
|
+
cause: error.cause,
|
|
25
|
+
});
|
|
26
|
+
default:
|
|
27
|
+
throw new errors.KardApiError({
|
|
28
|
+
message: "Unknown error",
|
|
29
|
+
rawResponse: rawResponse,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "12.
|
|
1
|
+
export declare const SDK_VERSION = "12.4.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "12.
|
|
1
|
+
export const SDK_VERSION = "12.4.0";
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kard-financial/sdk",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"repository":
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/KardFinancial/kard-node-sdk.git"
|
|
8
|
+
},
|
|
6
9
|
"type": "commonjs",
|
|
7
10
|
"main": "./dist/cjs/index.js",
|
|
8
11
|
"module": "./dist/esm/index.mjs",
|
|
9
12
|
"types": "./dist/cjs/index.d.ts",
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
|
-
"types": "./dist/cjs/index.d.ts",
|
|
13
15
|
"import": {
|
|
14
16
|
"types": "./dist/esm/index.d.mts",
|
|
15
17
|
"default": "./dist/esm/index.mjs"
|
|
@@ -20,6 +22,127 @@
|
|
|
20
22
|
},
|
|
21
23
|
"default": "./dist/cjs/index.js"
|
|
22
24
|
},
|
|
25
|
+
"./auth": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/esm/api/resources/auth/exports.d.mts",
|
|
28
|
+
"default": "./dist/esm/api/resources/auth/exports.mjs"
|
|
29
|
+
},
|
|
30
|
+
"require": {
|
|
31
|
+
"types": "./dist/cjs/api/resources/auth/exports.d.ts",
|
|
32
|
+
"default": "./dist/cjs/api/resources/auth/exports.js"
|
|
33
|
+
},
|
|
34
|
+
"default": "./dist/cjs/api/resources/auth/exports.js"
|
|
35
|
+
},
|
|
36
|
+
"./files": {
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/esm/api/resources/files/exports.d.mts",
|
|
39
|
+
"default": "./dist/esm/api/resources/files/exports.mjs"
|
|
40
|
+
},
|
|
41
|
+
"require": {
|
|
42
|
+
"types": "./dist/cjs/api/resources/files/exports.d.ts",
|
|
43
|
+
"default": "./dist/cjs/api/resources/files/exports.js"
|
|
44
|
+
},
|
|
45
|
+
"default": "./dist/cjs/api/resources/files/exports.js"
|
|
46
|
+
},
|
|
47
|
+
"./notifications": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/esm/api/resources/notifications/exports.d.mts",
|
|
50
|
+
"default": "./dist/esm/api/resources/notifications/exports.mjs"
|
|
51
|
+
},
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./dist/cjs/api/resources/notifications/exports.d.ts",
|
|
54
|
+
"default": "./dist/cjs/api/resources/notifications/exports.js"
|
|
55
|
+
},
|
|
56
|
+
"default": "./dist/cjs/api/resources/notifications/exports.js"
|
|
57
|
+
},
|
|
58
|
+
"./notifications/subscriptions": {
|
|
59
|
+
"import": {
|
|
60
|
+
"types": "./dist/esm/api/resources/notifications/resources/subscriptions/exports.d.mts",
|
|
61
|
+
"default": "./dist/esm/api/resources/notifications/resources/subscriptions/exports.mjs"
|
|
62
|
+
},
|
|
63
|
+
"require": {
|
|
64
|
+
"types": "./dist/cjs/api/resources/notifications/resources/subscriptions/exports.d.ts",
|
|
65
|
+
"default": "./dist/cjs/api/resources/notifications/resources/subscriptions/exports.js"
|
|
66
|
+
},
|
|
67
|
+
"default": "./dist/cjs/api/resources/notifications/resources/subscriptions/exports.js"
|
|
68
|
+
},
|
|
69
|
+
"./ping": {
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/esm/api/resources/ping/exports.d.mts",
|
|
72
|
+
"default": "./dist/esm/api/resources/ping/exports.mjs"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/cjs/api/resources/ping/exports.d.ts",
|
|
76
|
+
"default": "./dist/cjs/api/resources/ping/exports.js"
|
|
77
|
+
},
|
|
78
|
+
"default": "./dist/cjs/api/resources/ping/exports.js"
|
|
79
|
+
},
|
|
80
|
+
"./transactions": {
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./dist/esm/api/resources/transactions/exports.d.mts",
|
|
83
|
+
"default": "./dist/esm/api/resources/transactions/exports.mjs"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./dist/cjs/api/resources/transactions/exports.d.ts",
|
|
87
|
+
"default": "./dist/cjs/api/resources/transactions/exports.js"
|
|
88
|
+
},
|
|
89
|
+
"default": "./dist/cjs/api/resources/transactions/exports.js"
|
|
90
|
+
},
|
|
91
|
+
"./users": {
|
|
92
|
+
"import": {
|
|
93
|
+
"types": "./dist/esm/api/resources/users/exports.d.mts",
|
|
94
|
+
"default": "./dist/esm/api/resources/users/exports.mjs"
|
|
95
|
+
},
|
|
96
|
+
"require": {
|
|
97
|
+
"types": "./dist/cjs/api/resources/users/exports.d.ts",
|
|
98
|
+
"default": "./dist/cjs/api/resources/users/exports.js"
|
|
99
|
+
},
|
|
100
|
+
"default": "./dist/cjs/api/resources/users/exports.js"
|
|
101
|
+
},
|
|
102
|
+
"./users/attributions": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/esm/api/resources/users/resources/attributions/exports.d.mts",
|
|
105
|
+
"default": "./dist/esm/api/resources/users/resources/attributions/exports.mjs"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/cjs/api/resources/users/resources/attributions/exports.d.ts",
|
|
109
|
+
"default": "./dist/cjs/api/resources/users/resources/attributions/exports.js"
|
|
110
|
+
},
|
|
111
|
+
"default": "./dist/cjs/api/resources/users/resources/attributions/exports.js"
|
|
112
|
+
},
|
|
113
|
+
"./users/auth": {
|
|
114
|
+
"import": {
|
|
115
|
+
"types": "./dist/esm/api/resources/users/resources/auth/exports.d.mts",
|
|
116
|
+
"default": "./dist/esm/api/resources/users/resources/auth/exports.mjs"
|
|
117
|
+
},
|
|
118
|
+
"require": {
|
|
119
|
+
"types": "./dist/cjs/api/resources/users/resources/auth/exports.d.ts",
|
|
120
|
+
"default": "./dist/cjs/api/resources/users/resources/auth/exports.js"
|
|
121
|
+
},
|
|
122
|
+
"default": "./dist/cjs/api/resources/users/resources/auth/exports.js"
|
|
123
|
+
},
|
|
124
|
+
"./users/rewards": {
|
|
125
|
+
"import": {
|
|
126
|
+
"types": "./dist/esm/api/resources/users/resources/rewards/exports.d.mts",
|
|
127
|
+
"default": "./dist/esm/api/resources/users/resources/rewards/exports.mjs"
|
|
128
|
+
},
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/cjs/api/resources/users/resources/rewards/exports.d.ts",
|
|
131
|
+
"default": "./dist/cjs/api/resources/users/resources/rewards/exports.js"
|
|
132
|
+
},
|
|
133
|
+
"default": "./dist/cjs/api/resources/users/resources/rewards/exports.js"
|
|
134
|
+
},
|
|
135
|
+
"./users/uploads": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/esm/api/resources/users/resources/uploads/exports.d.mts",
|
|
138
|
+
"default": "./dist/esm/api/resources/users/resources/uploads/exports.mjs"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/cjs/api/resources/users/resources/uploads/exports.d.ts",
|
|
142
|
+
"default": "./dist/cjs/api/resources/users/resources/uploads/exports.js"
|
|
143
|
+
},
|
|
144
|
+
"default": "./dist/cjs/api/resources/users/resources/uploads/exports.js"
|
|
145
|
+
},
|
|
23
146
|
"./package.json": "./package.json",
|
|
24
147
|
"./helpers/hem": {
|
|
25
148
|
"types": "./dist/cjs/helpers/hem.d.ts",
|
|
@@ -54,20 +177,21 @@
|
|
|
54
177
|
},
|
|
55
178
|
"dependencies": {},
|
|
56
179
|
"devDependencies": {
|
|
57
|
-
"webpack": "^5.
|
|
58
|
-
"ts-loader": "^9.5.
|
|
59
|
-
"vitest": "^
|
|
180
|
+
"webpack": "^5.105.4",
|
|
181
|
+
"ts-loader": "^9.5.4",
|
|
182
|
+
"vitest": "^4.1.1",
|
|
60
183
|
"@types/node": "^18.19.70",
|
|
61
|
-
"typescript": "~5.
|
|
62
|
-
"@biomejs/biome": "2.
|
|
184
|
+
"typescript": "~5.9.3",
|
|
185
|
+
"@biomejs/biome": "2.4.10"
|
|
63
186
|
},
|
|
64
187
|
"browser": {
|
|
65
188
|
"fs": false,
|
|
66
189
|
"os": false,
|
|
67
190
|
"path": false,
|
|
68
|
-
"stream": false
|
|
191
|
+
"stream": false,
|
|
192
|
+
"crypto": false
|
|
69
193
|
},
|
|
70
|
-
"packageManager": "pnpm@10.
|
|
194
|
+
"packageManager": "pnpm@10.33.0",
|
|
71
195
|
"engines": {
|
|
72
196
|
"node": ">=18.0.0"
|
|
73
197
|
},
|
package/reference.md
CHANGED