@kard-financial/sdk 12.2.1 → 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 +3 -3
- package/dist/cjs/api/resources/transactions/client/Client.js +15 -112
- package/dist/cjs/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.ts +4 -1
- 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 +3 -3
- package/dist/esm/api/resources/transactions/client/Client.mjs +15 -112
- package/dist/esm/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.mts +4 -1
- 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 +3 -1
|
@@ -8,6 +8,10 @@ export class InvalidRequest extends errors.KardApiError {
|
|
|
8
8
|
body: body,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -8,6 +8,10 @@ export class UnauthorizedError extends errors.KardApiError {
|
|
|
8
8
|
body: body,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.mjs";
|
|
@@ -7,7 +7,7 @@ export interface ErrorObject {
|
|
|
7
7
|
/** Description of the specific occurance of the error */
|
|
8
8
|
detail: string;
|
|
9
9
|
/** An object containing a reference to the primary source of the error */
|
|
10
|
-
source?: KardApi.ErrorSource;
|
|
10
|
+
source?: KardApi.ErrorSource | undefined;
|
|
11
11
|
/** The id of the resource which caused the error. Always returned for multi-status errors. */
|
|
12
|
-
id?: string;
|
|
12
|
+
id?: string | undefined;
|
|
13
13
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface ErrorSource {
|
|
2
2
|
/** A JSON pointer to the value in the request document that caused the error */
|
|
3
|
-
pointer?: string;
|
|
3
|
+
pointer?: string | undefined;
|
|
4
4
|
/** A string indicating which URI query parameter caused the error */
|
|
5
|
-
parameter?: string;
|
|
5
|
+
parameter?: string | undefined;
|
|
6
6
|
/** A string indicating the name of a single request header which caused the error */
|
|
7
|
-
header?: string;
|
|
7
|
+
header?: string | undefined;
|
|
8
8
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as KardApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace FilesClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -12,6 +12,7 @@ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
16
17
|
import * as KardApi from "../../../index.mjs";
|
|
17
18
|
export class FilesClient {
|
|
@@ -49,33 +50,15 @@ export class FilesClient {
|
|
|
49
50
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
50
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
51
52
|
const { "filter[dateFrom]": filterDateFrom, "filter[dateTo]": filterDateTo, "filter[fileType]": filterFileType, "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, sort, } = request;
|
|
52
|
-
const _queryParams = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (pageSize != null) {
|
|
63
|
-
_queryParams["page[size]"] = pageSize.toString();
|
|
64
|
-
}
|
|
65
|
-
if (pageAfter != null) {
|
|
66
|
-
_queryParams["page[after]"] = pageAfter;
|
|
67
|
-
}
|
|
68
|
-
if (pageBefore != null) {
|
|
69
|
-
_queryParams["page[before]"] = pageBefore;
|
|
70
|
-
}
|
|
71
|
-
if (sort != null) {
|
|
72
|
-
if (Array.isArray(sort)) {
|
|
73
|
-
_queryParams.sort = sort.map((item) => item);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
_queryParams.sort = sort;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
53
|
+
const _queryParams = {
|
|
54
|
+
"filter[dateFrom]": filterDateFrom,
|
|
55
|
+
"filter[dateTo]": filterDateTo,
|
|
56
|
+
"filter[fileType]": filterFileType != null ? filterFileType : undefined,
|
|
57
|
+
"page[size]": pageSize,
|
|
58
|
+
"page[after]": pageAfter,
|
|
59
|
+
"page[before]": pageBefore,
|
|
60
|
+
sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
|
|
61
|
+
};
|
|
79
62
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
80
63
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
81
64
|
const _response = yield core.fetcher({
|
|
@@ -110,26 +93,7 @@ export class FilesClient {
|
|
|
110
93
|
});
|
|
111
94
|
}
|
|
112
95
|
}
|
|
113
|
-
|
|
114
|
-
case "non-json":
|
|
115
|
-
throw new errors.KardApiError({
|
|
116
|
-
statusCode: _response.error.statusCode,
|
|
117
|
-
body: _response.error.rawBody,
|
|
118
|
-
rawResponse: _response.rawResponse,
|
|
119
|
-
});
|
|
120
|
-
case "body-is-null":
|
|
121
|
-
throw new errors.KardApiError({
|
|
122
|
-
statusCode: _response.error.statusCode,
|
|
123
|
-
rawResponse: _response.rawResponse,
|
|
124
|
-
});
|
|
125
|
-
case "timeout":
|
|
126
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/files/metadata.");
|
|
127
|
-
case "unknown":
|
|
128
|
-
throw new errors.KardApiError({
|
|
129
|
-
message: _response.error.errorMessage,
|
|
130
|
-
rawResponse: _response.rawResponse,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
96
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/files/metadata");
|
|
133
97
|
});
|
|
134
98
|
}
|
|
135
99
|
}
|
|
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.mjs";
|
|
|
2
2
|
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import { SubscriptionsClient } from "../resources/subscriptions/client/Client.mjs";
|
|
4
4
|
export declare namespace NotificationsClient {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
type Options = BaseClientOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare class NotificationsClient {
|
|
9
8
|
protected readonly _options: NormalizedClientOptionsWithAuth<NotificationsClient.Options>;
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
|
|
|
3
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
4
4
|
import * as KardApi from "../../../../../index.mjs";
|
|
5
5
|
export declare namespace SubscriptionsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -12,6 +12,7 @@ import { normalizeClientOptionsWithAuth } from "../../../../../../BaseClient.mjs
|
|
|
12
12
|
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
16
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
16
17
|
import * as KardApi from "../../../../../index.mjs";
|
|
17
18
|
export class SubscriptionsClient {
|
|
@@ -40,10 +41,9 @@ export class SubscriptionsClient {
|
|
|
40
41
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
41
42
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
42
43
|
const { "filter[eventName]": filterEventName } = request;
|
|
43
|
-
const _queryParams = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
44
|
+
const _queryParams = {
|
|
45
|
+
"filter[eventName]": filterEventName != null ? filterEventName : undefined,
|
|
46
|
+
};
|
|
47
47
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
48
48
|
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
49
|
const _response = yield core.fetcher({
|
|
@@ -79,26 +79,7 @@ export class SubscriptionsClient {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
case "non-json":
|
|
84
|
-
throw new errors.KardApiError({
|
|
85
|
-
statusCode: _response.error.statusCode,
|
|
86
|
-
body: _response.error.rawBody,
|
|
87
|
-
rawResponse: _response.rawResponse,
|
|
88
|
-
});
|
|
89
|
-
case "body-is-null":
|
|
90
|
-
throw new errors.KardApiError({
|
|
91
|
-
statusCode: _response.error.statusCode,
|
|
92
|
-
rawResponse: _response.rawResponse,
|
|
93
|
-
});
|
|
94
|
-
case "timeout":
|
|
95
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/subscriptions.");
|
|
96
|
-
case "unknown":
|
|
97
|
-
throw new errors.KardApiError({
|
|
98
|
-
message: _response.error.errorMessage,
|
|
99
|
-
rawResponse: _response.rawResponse,
|
|
100
|
-
});
|
|
101
|
-
}
|
|
82
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/subscriptions");
|
|
102
83
|
});
|
|
103
84
|
}
|
|
104
85
|
/**
|
|
@@ -172,26 +153,7 @@ export class SubscriptionsClient {
|
|
|
172
153
|
});
|
|
173
154
|
}
|
|
174
155
|
}
|
|
175
|
-
|
|
176
|
-
case "non-json":
|
|
177
|
-
throw new errors.KardApiError({
|
|
178
|
-
statusCode: _response.error.statusCode,
|
|
179
|
-
body: _response.error.rawBody,
|
|
180
|
-
rawResponse: _response.rawResponse,
|
|
181
|
-
});
|
|
182
|
-
case "body-is-null":
|
|
183
|
-
throw new errors.KardApiError({
|
|
184
|
-
statusCode: _response.error.statusCode,
|
|
185
|
-
rawResponse: _response.rawResponse,
|
|
186
|
-
});
|
|
187
|
-
case "timeout":
|
|
188
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/subscriptions.");
|
|
189
|
-
case "unknown":
|
|
190
|
-
throw new errors.KardApiError({
|
|
191
|
-
message: _response.error.errorMessage,
|
|
192
|
-
rawResponse: _response.rawResponse,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
156
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/subscriptions");
|
|
195
157
|
});
|
|
196
158
|
}
|
|
197
159
|
/**
|
|
@@ -266,26 +228,7 @@ export class SubscriptionsClient {
|
|
|
266
228
|
});
|
|
267
229
|
}
|
|
268
230
|
}
|
|
269
|
-
|
|
270
|
-
case "non-json":
|
|
271
|
-
throw new errors.KardApiError({
|
|
272
|
-
statusCode: _response.error.statusCode,
|
|
273
|
-
body: _response.error.rawBody,
|
|
274
|
-
rawResponse: _response.rawResponse,
|
|
275
|
-
});
|
|
276
|
-
case "body-is-null":
|
|
277
|
-
throw new errors.KardApiError({
|
|
278
|
-
statusCode: _response.error.statusCode,
|
|
279
|
-
rawResponse: _response.rawResponse,
|
|
280
|
-
});
|
|
281
|
-
case "timeout":
|
|
282
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling PATCH /v2/issuers/{organizationId}/subscriptions/{subscriptionId}.");
|
|
283
|
-
case "unknown":
|
|
284
|
-
throw new errors.KardApiError({
|
|
285
|
-
message: _response.error.errorMessage,
|
|
286
|
-
rawResponse: _response.rawResponse,
|
|
287
|
-
});
|
|
288
|
-
}
|
|
231
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v2/issuers/{organizationId}/subscriptions/{subscriptionId}");
|
|
289
232
|
});
|
|
290
233
|
}
|
|
291
234
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as KardApi from "../../../../../index.mjs";
|
|
2
2
|
export interface UpdateSubscriptionRequestAttributes {
|
|
3
3
|
/** The name of the event for the subscription */
|
|
4
|
-
eventName?: KardApi.NotificationType;
|
|
4
|
+
eventName?: KardApi.NotificationType | undefined;
|
|
5
5
|
/** The URL where notifications will be delivered */
|
|
6
|
-
webhookUrl?: string;
|
|
6
|
+
webhookUrl?: string | undefined;
|
|
7
7
|
/** Indicates whether the subscription is active */
|
|
8
|
-
enabled?: boolean;
|
|
8
|
+
enabled?: boolean | undefined;
|
|
9
9
|
}
|
|
@@ -36,9 +36,9 @@ export interface AuditUpdateAttributes {
|
|
|
36
36
|
* <li>`9005` : Transaction not captured</li>
|
|
37
37
|
* </ul>
|
|
38
38
|
*/
|
|
39
|
-
resolutionCode?: number;
|
|
39
|
+
resolutionCode?: number | undefined;
|
|
40
40
|
/** The resolution description; field is available when audit is status CLOSED */
|
|
41
|
-
resolutionDescription?: string;
|
|
41
|
+
resolutionDescription?: string | undefined;
|
|
42
42
|
/** The resolution timestamp of when the audit was marked as status CLOSED in ISO format; available when audit is closed. */
|
|
43
|
-
resolutionTimeStamp?: string;
|
|
43
|
+
resolutionTimeStamp?: string | undefined;
|
|
44
44
|
}
|
|
@@ -252,6 +252,6 @@ import type * as KardApi from "../../../index.mjs";
|
|
|
252
252
|
*/
|
|
253
253
|
export interface NotificationPayload {
|
|
254
254
|
data: KardApi.NotificationDataUnion;
|
|
255
|
-
meta?: KardApi.NotificationMetadata;
|
|
256
|
-
errors?: KardApi.ErrorObject[];
|
|
255
|
+
meta?: KardApi.NotificationMetadata | undefined;
|
|
256
|
+
errors?: KardApi.ErrorObject[] | undefined;
|
|
257
257
|
}
|
|
@@ -6,7 +6,7 @@ export interface RewardNotificationAttributes {
|
|
|
6
6
|
/** The attribution URL to track user's interactions with the notification */
|
|
7
7
|
attributionUrl: string;
|
|
8
8
|
/** Post experience survey URL, if available. This will be present for rewards associated with local offers. */
|
|
9
|
-
surveyUrl?: string;
|
|
9
|
+
surveyUrl?: string | undefined;
|
|
10
10
|
/** The ID of the card product */
|
|
11
|
-
cardProductId?: string;
|
|
11
|
+
cardProductId?: string | undefined;
|
|
12
12
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as KardApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace PingClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -12,6 +12,7 @@ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
16
17
|
import * as KardApi from "../../../index.mjs";
|
|
17
18
|
export class PingClient {
|
|
@@ -61,26 +62,7 @@ export class PingClient {
|
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
case "non-json":
|
|
66
|
-
throw new errors.KardApiError({
|
|
67
|
-
statusCode: _response.error.statusCode,
|
|
68
|
-
body: _response.error.rawBody,
|
|
69
|
-
rawResponse: _response.rawResponse,
|
|
70
|
-
});
|
|
71
|
-
case "body-is-null":
|
|
72
|
-
throw new errors.KardApiError({
|
|
73
|
-
statusCode: _response.error.statusCode,
|
|
74
|
-
rawResponse: _response.rawResponse,
|
|
75
|
-
});
|
|
76
|
-
case "timeout":
|
|
77
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/ping.");
|
|
78
|
-
case "unknown":
|
|
79
|
-
throw new errors.KardApiError({
|
|
80
|
-
message: _response.error.errorMessage,
|
|
81
|
-
rawResponse: _response.rawResponse,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
65
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/ping");
|
|
84
66
|
});
|
|
85
67
|
}
|
|
86
68
|
}
|
|
@@ -8,6 +8,10 @@ export class NetworkBlockedError extends errors.KardApiError {
|
|
|
8
8
|
body: body,
|
|
9
9
|
rawResponse: rawResponse,
|
|
10
10
|
});
|
|
11
|
-
Object.setPrototypeOf(this,
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs
|
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as KardApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace TransactionsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -287,7 +286,8 @@ export declare class TransactionsClient {
|
|
|
287
286
|
*
|
|
288
287
|
* @example
|
|
289
288
|
* await client.transactions.getEarnedRewards("org-123", "user-456", {
|
|
290
|
-
* "page[size]": 10
|
|
289
|
+
* "page[size]": 10,
|
|
290
|
+
* include: "merchant,offer"
|
|
291
291
|
* })
|
|
292
292
|
*/
|
|
293
293
|
getEarnedRewards(organizationId: KardApi.OrganizationId, userId: string, request?: KardApi.GetEarnedRewardsRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<KardApi.GetEarnedRewardsResponse>;
|