@kard-financial/sdk 12.3.0 → 13.0.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 +16 -115
- package/dist/cjs/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.ts +3 -0
- 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/GetEarnedRewardsMeta.d.ts +4 -0
- package/dist/cjs/api/resources/transactions/types/GetEarnedRewardsMeta.js +3 -0
- package/dist/cjs/api/resources/transactions/types/GetEarnedRewardsResponse.d.ts +50 -2
- 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/RewardedTransactionStatus.d.ts +1 -0
- package/dist/cjs/api/resources/transactions/types/RewardedTransactionStatus.js +1 -0
- package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +18 -18
- package/dist/cjs/api/resources/transactions/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/transactions/types/index.js +1 -0
- 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 +16 -115
- package/dist/esm/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.mts +3 -0
- 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/GetEarnedRewardsMeta.d.mts +4 -0
- package/dist/esm/api/resources/transactions/types/GetEarnedRewardsMeta.mjs +2 -0
- package/dist/esm/api/resources/transactions/types/GetEarnedRewardsResponse.d.mts +50 -2
- 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/RewardedTransactionStatus.d.mts +1 -0
- package/dist/esm/api/resources/transactions/types/RewardedTransactionStatus.mjs +1 -0
- package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +18 -18
- package/dist/esm/api/resources/transactions/types/index.d.mts +1 -0
- package/dist/esm/api/resources/transactions/types/index.mjs +1 -0
- 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
|
@@ -48,6 +48,7 @@ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
|
48
48
|
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
49
|
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
50
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
51
52
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
52
53
|
const KardApi = __importStar(require("../../../../../index.js"));
|
|
53
54
|
class AttributionsClient {
|
|
@@ -141,26 +142,7 @@ class AttributionsClient {
|
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
case "non-json":
|
|
146
|
-
throw new errors.KardApiError({
|
|
147
|
-
statusCode: _response.error.statusCode,
|
|
148
|
-
body: _response.error.rawBody,
|
|
149
|
-
rawResponse: _response.rawResponse,
|
|
150
|
-
});
|
|
151
|
-
case "body-is-null":
|
|
152
|
-
throw new errors.KardApiError({
|
|
153
|
-
statusCode: _response.error.statusCode,
|
|
154
|
-
rawResponse: _response.rawResponse,
|
|
155
|
-
});
|
|
156
|
-
case "timeout":
|
|
157
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/attributions.");
|
|
158
|
-
case "unknown":
|
|
159
|
-
throw new errors.KardApiError({
|
|
160
|
-
message: _response.error.errorMessage,
|
|
161
|
-
rawResponse: _response.rawResponse,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
145
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/users/{userId}/attributions");
|
|
164
146
|
});
|
|
165
147
|
}
|
|
166
148
|
/**
|
|
@@ -187,23 +169,14 @@ class AttributionsClient {
|
|
|
187
169
|
return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
|
|
188
170
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
189
171
|
const { supportedComponents, include } = request;
|
|
190
|
-
const _queryParams = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
if (include != null) {
|
|
200
|
-
if (Array.isArray(include)) {
|
|
201
|
-
_queryParams.include = include.map((item) => item);
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
_queryParams.include = include;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
172
|
+
const _queryParams = {
|
|
173
|
+
supportedComponents: Array.isArray(supportedComponents)
|
|
174
|
+
? supportedComponents.map((item) => item)
|
|
175
|
+
: supportedComponents != null
|
|
176
|
+
? supportedComponents
|
|
177
|
+
: undefined,
|
|
178
|
+
include: Array.isArray(include) ? include.map((item) => item) : include != null ? include : undefined,
|
|
179
|
+
};
|
|
207
180
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
208
181
|
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);
|
|
209
182
|
const _response = yield core.fetcher({
|
|
@@ -236,26 +209,7 @@ class AttributionsClient {
|
|
|
236
209
|
});
|
|
237
210
|
}
|
|
238
211
|
}
|
|
239
|
-
|
|
240
|
-
case "non-json":
|
|
241
|
-
throw new errors.KardApiError({
|
|
242
|
-
statusCode: _response.error.statusCode,
|
|
243
|
-
body: _response.error.rawBody,
|
|
244
|
-
rawResponse: _response.rawResponse,
|
|
245
|
-
});
|
|
246
|
-
case "body-is-null":
|
|
247
|
-
throw new errors.KardApiError({
|
|
248
|
-
statusCode: _response.error.statusCode,
|
|
249
|
-
rawResponse: _response.rawResponse,
|
|
250
|
-
});
|
|
251
|
-
case "timeout":
|
|
252
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/offers/{offerId}/activate.");
|
|
253
|
-
case "unknown":
|
|
254
|
-
throw new errors.KardApiError({
|
|
255
|
-
message: _response.error.errorMessage,
|
|
256
|
-
rawResponse: _response.rawResponse,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
212
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/users/{userId}/offers/{offerId}/activate");
|
|
259
213
|
});
|
|
260
214
|
}
|
|
261
215
|
/**
|
|
@@ -282,23 +236,14 @@ class AttributionsClient {
|
|
|
282
236
|
return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
|
|
283
237
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
284
238
|
const { supportedComponents, include } = request;
|
|
285
|
-
const _queryParams = {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
if (include != null) {
|
|
295
|
-
if (Array.isArray(include)) {
|
|
296
|
-
_queryParams.include = include.map((item) => item);
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
_queryParams.include = include;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
239
|
+
const _queryParams = {
|
|
240
|
+
supportedComponents: Array.isArray(supportedComponents)
|
|
241
|
+
? supportedComponents.map((item) => item)
|
|
242
|
+
: supportedComponents != null
|
|
243
|
+
? supportedComponents
|
|
244
|
+
: undefined,
|
|
245
|
+
include: Array.isArray(include) ? include.map((item) => item) : include != null ? include : undefined,
|
|
246
|
+
};
|
|
302
247
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
303
248
|
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);
|
|
304
249
|
const _response = yield core.fetcher({
|
|
@@ -331,26 +276,7 @@ class AttributionsClient {
|
|
|
331
276
|
});
|
|
332
277
|
}
|
|
333
278
|
}
|
|
334
|
-
|
|
335
|
-
case "non-json":
|
|
336
|
-
throw new errors.KardApiError({
|
|
337
|
-
statusCode: _response.error.statusCode,
|
|
338
|
-
body: _response.error.rawBody,
|
|
339
|
-
rawResponse: _response.rawResponse,
|
|
340
|
-
});
|
|
341
|
-
case "body-is-null":
|
|
342
|
-
throw new errors.KardApiError({
|
|
343
|
-
statusCode: _response.error.statusCode,
|
|
344
|
-
rawResponse: _response.rawResponse,
|
|
345
|
-
});
|
|
346
|
-
case "timeout":
|
|
347
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/offers/{offerId}/boost.");
|
|
348
|
-
case "unknown":
|
|
349
|
-
throw new errors.KardApiError({
|
|
350
|
-
message: _response.error.errorMessage,
|
|
351
|
-
rawResponse: _response.rawResponse,
|
|
352
|
-
});
|
|
353
|
-
}
|
|
279
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/users/{userId}/offers/{offerId}/boost");
|
|
354
280
|
});
|
|
355
281
|
}
|
|
356
282
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AttributionsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "AttributionsClient", { enumerable: true, get: function () { return Client_js_1.AttributionsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export interface ActivateOfferResponse {
|
|
18
18
|
data: KardApi.users.ActivateOfferResponseData;
|
|
19
|
-
included?: KardApi.users.ActivateOfferIncluded[];
|
|
19
|
+
included?: KardApi.users.ActivateOfferIncluded[] | undefined;
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as KardApi from "../../../../../index.js";
|
|
2
2
|
export interface AttributionState {
|
|
3
3
|
/** The position of the offer in the list shown to the user (1-indexed) */
|
|
4
|
-
rank?: number;
|
|
4
|
+
rank?: number | undefined;
|
|
5
5
|
/** The active filters when the user saw the offer */
|
|
6
|
-
filters?: KardApi.users.AttributionFilter[];
|
|
6
|
+
filters?: KardApi.users.AttributionFilter[] | undefined;
|
|
7
7
|
}
|
|
@@ -16,5 +16,5 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export interface BoostOfferResponse {
|
|
18
18
|
data: KardApi.users.BoostOfferResponseData;
|
|
19
|
-
included?: KardApi.users.BoostOfferIncluded[];
|
|
19
|
+
included?: KardApi.users.BoostOfferIncluded[] | undefined;
|
|
20
20
|
}
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
|
|
|
3
3
|
import * as core from "../../../../../../core/index.js";
|
|
4
4
|
import * as KardApi from "../../../../../index.js";
|
|
5
5
|
export declare namespace AuthClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -48,6 +48,7 @@ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
|
|
|
48
48
|
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
49
49
|
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
50
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
51
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
51
52
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
52
53
|
const KardApi = __importStar(require("../../../../../index.js"));
|
|
53
54
|
class AuthClient {
|
|
@@ -103,26 +104,7 @@ class AuthClient {
|
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
case "non-json":
|
|
108
|
-
throw new errors.KardApiError({
|
|
109
|
-
statusCode: _response.error.statusCode,
|
|
110
|
-
body: _response.error.rawBody,
|
|
111
|
-
rawResponse: _response.rawResponse,
|
|
112
|
-
});
|
|
113
|
-
case "body-is-null":
|
|
114
|
-
throw new errors.KardApiError({
|
|
115
|
-
statusCode: _response.error.statusCode,
|
|
116
|
-
rawResponse: _response.rawResponse,
|
|
117
|
-
});
|
|
118
|
-
case "timeout":
|
|
119
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/auth/issuers/{organizationId}/users/{userId}/token.");
|
|
120
|
-
case "unknown":
|
|
121
|
-
throw new errors.KardApiError({
|
|
122
|
-
message: _response.error.errorMessage,
|
|
123
|
-
rawResponse: _response.rawResponse,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
107
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/auth/issuers/{organizationId}/users/{userId}/token");
|
|
126
108
|
});
|
|
127
109
|
}
|
|
128
110
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AuthClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function () { return Client_js_1.AuthClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
|
|
|
3
3
|
import * as core from "../../../../../../core/index.js";
|
|
4
4
|
import * as KardApi from "../../../../../index.js";
|
|
5
5
|
export declare namespace RewardsClient {
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
type Options = BaseClientOptions;
|
|
8
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
9
8
|
}
|
|
10
9
|
}
|
|
@@ -49,6 +49,7 @@ const headers_js_1 = require("../../../../../../core/headers.js");
|
|
|
49
49
|
const core = __importStar(require("../../../../../../core/index.js"));
|
|
50
50
|
const json_js_1 = require("../../../../../../core/json.js");
|
|
51
51
|
const environments = __importStar(require("../../../../../../environments.js"));
|
|
52
|
+
const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
|
|
52
53
|
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
54
|
const KardApi = __importStar(require("../../../../../index.js"));
|
|
54
55
|
class RewardsClient {
|
|
@@ -85,52 +86,22 @@ class RewardsClient {
|
|
|
85
86
|
return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
|
|
86
87
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
88
|
const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[search]": filterSearch, "filter[purchaseChannel]": filterPurchaseChannel, "filter[category]": filterCategory, "filter[isTargeted]": filterIsTargeted, sort, include, supportedComponents, } = request;
|
|
88
|
-
const _queryParams = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
if (filterCategory != null) {
|
|
105
|
-
_queryParams["filter[category]"] = filterCategory;
|
|
106
|
-
}
|
|
107
|
-
if (filterIsTargeted != null) {
|
|
108
|
-
_queryParams["filter[isTargeted]"] = filterIsTargeted.toString();
|
|
109
|
-
}
|
|
110
|
-
if (sort != null) {
|
|
111
|
-
if (Array.isArray(sort)) {
|
|
112
|
-
_queryParams.sort = sort.map((item) => item);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
_queryParams.sort = sort;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (include != null) {
|
|
119
|
-
if (Array.isArray(include)) {
|
|
120
|
-
_queryParams.include = include.map((item) => item);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
_queryParams.include = include;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (supportedComponents != null) {
|
|
127
|
-
if (Array.isArray(supportedComponents)) {
|
|
128
|
-
_queryParams.supportedComponents = supportedComponents.map((item) => item);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
_queryParams.supportedComponents = supportedComponents;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
89
|
+
const _queryParams = {
|
|
90
|
+
"page[size]": pageSize,
|
|
91
|
+
"page[after]": pageAfter,
|
|
92
|
+
"page[before]": pageBefore,
|
|
93
|
+
"filter[search]": filterSearch,
|
|
94
|
+
"filter[purchaseChannel]": filterPurchaseChannel != null ? (0, json_js_1.toJson)(filterPurchaseChannel) : undefined,
|
|
95
|
+
"filter[category]": filterCategory != null ? filterCategory : undefined,
|
|
96
|
+
"filter[isTargeted]": filterIsTargeted,
|
|
97
|
+
sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
|
|
98
|
+
include,
|
|
99
|
+
supportedComponents: Array.isArray(supportedComponents)
|
|
100
|
+
? supportedComponents.map((item) => item)
|
|
101
|
+
: supportedComponents != null
|
|
102
|
+
? supportedComponents
|
|
103
|
+
: undefined,
|
|
104
|
+
};
|
|
134
105
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
135
106
|
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);
|
|
136
107
|
const _response = yield core.fetcher({
|
|
@@ -165,26 +136,7 @@ class RewardsClient {
|
|
|
165
136
|
});
|
|
166
137
|
}
|
|
167
138
|
}
|
|
168
|
-
|
|
169
|
-
case "non-json":
|
|
170
|
-
throw new errors.KardApiError({
|
|
171
|
-
statusCode: _response.error.statusCode,
|
|
172
|
-
body: _response.error.rawBody,
|
|
173
|
-
rawResponse: _response.rawResponse,
|
|
174
|
-
});
|
|
175
|
-
case "body-is-null":
|
|
176
|
-
throw new errors.KardApiError({
|
|
177
|
-
statusCode: _response.error.statusCode,
|
|
178
|
-
rawResponse: _response.rawResponse,
|
|
179
|
-
});
|
|
180
|
-
case "timeout":
|
|
181
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/users/{userId}/offers.");
|
|
182
|
-
case "unknown":
|
|
183
|
-
throw new errors.KardApiError({
|
|
184
|
-
message: _response.error.errorMessage,
|
|
185
|
-
rawResponse: _response.rawResponse,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
139
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/offers");
|
|
188
140
|
});
|
|
189
141
|
}
|
|
190
142
|
/**
|
|
@@ -221,64 +173,26 @@ class RewardsClient {
|
|
|
221
173
|
return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
|
|
222
174
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
223
175
|
const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[name]": filterName, "filter[city]": filterCity, "filter[zipCode]": filterZipCode, "filter[state]": filterState, "filter[category]": filterCategory, "filter[longitude]": filterLongitude, "filter[latitude]": filterLatitude, "filter[radius]": filterRadius, sort, include, supportedComponents, } = request;
|
|
224
|
-
const _queryParams = {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
_queryParams["filter[state]"] = filterState;
|
|
245
|
-
}
|
|
246
|
-
if (filterCategory != null) {
|
|
247
|
-
_queryParams["filter[category]"] = filterCategory;
|
|
248
|
-
}
|
|
249
|
-
if (filterLongitude != null) {
|
|
250
|
-
_queryParams["filter[longitude]"] = filterLongitude.toString();
|
|
251
|
-
}
|
|
252
|
-
if (filterLatitude != null) {
|
|
253
|
-
_queryParams["filter[latitude]"] = filterLatitude.toString();
|
|
254
|
-
}
|
|
255
|
-
if (filterRadius != null) {
|
|
256
|
-
_queryParams["filter[radius]"] = filterRadius.toString();
|
|
257
|
-
}
|
|
258
|
-
if (sort != null) {
|
|
259
|
-
if (Array.isArray(sort)) {
|
|
260
|
-
_queryParams.sort = sort.map((item) => item);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
_queryParams.sort = sort;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (include != null) {
|
|
267
|
-
if (Array.isArray(include)) {
|
|
268
|
-
_queryParams.include = include.map((item) => item);
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
_queryParams.include = include;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (supportedComponents != null) {
|
|
275
|
-
if (Array.isArray(supportedComponents)) {
|
|
276
|
-
_queryParams.supportedComponents = supportedComponents.map((item) => item);
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
_queryParams.supportedComponents = supportedComponents;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
176
|
+
const _queryParams = {
|
|
177
|
+
"page[size]": pageSize,
|
|
178
|
+
"page[after]": pageAfter,
|
|
179
|
+
"page[before]": pageBefore,
|
|
180
|
+
"filter[name]": filterName,
|
|
181
|
+
"filter[city]": filterCity,
|
|
182
|
+
"filter[zipCode]": filterZipCode,
|
|
183
|
+
"filter[state]": filterState != null ? filterState : undefined,
|
|
184
|
+
"filter[category]": filterCategory != null ? filterCategory : undefined,
|
|
185
|
+
"filter[longitude]": filterLongitude,
|
|
186
|
+
"filter[latitude]": filterLatitude,
|
|
187
|
+
"filter[radius]": filterRadius,
|
|
188
|
+
sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
|
|
189
|
+
include,
|
|
190
|
+
supportedComponents: Array.isArray(supportedComponents)
|
|
191
|
+
? supportedComponents.map((item) => item)
|
|
192
|
+
: supportedComponents != null
|
|
193
|
+
? supportedComponents
|
|
194
|
+
: undefined,
|
|
195
|
+
};
|
|
282
196
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
283
197
|
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);
|
|
284
198
|
const _response = yield core.fetcher({
|
|
@@ -316,26 +230,7 @@ class RewardsClient {
|
|
|
316
230
|
});
|
|
317
231
|
}
|
|
318
232
|
}
|
|
319
|
-
|
|
320
|
-
case "non-json":
|
|
321
|
-
throw new errors.KardApiError({
|
|
322
|
-
statusCode: _response.error.statusCode,
|
|
323
|
-
body: _response.error.rawBody,
|
|
324
|
-
rawResponse: _response.rawResponse,
|
|
325
|
-
});
|
|
326
|
-
case "body-is-null":
|
|
327
|
-
throw new errors.KardApiError({
|
|
328
|
-
statusCode: _response.error.statusCode,
|
|
329
|
-
rawResponse: _response.rawResponse,
|
|
330
|
-
});
|
|
331
|
-
case "timeout":
|
|
332
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/users/{userId}/locations.");
|
|
333
|
-
case "unknown":
|
|
334
|
-
throw new errors.KardApiError({
|
|
335
|
-
message: _response.error.errorMessage,
|
|
336
|
-
rawResponse: _response.rawResponse,
|
|
337
|
-
});
|
|
338
|
-
}
|
|
233
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/locations");
|
|
339
234
|
});
|
|
340
235
|
}
|
|
341
236
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.RewardsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "RewardsClient", { enumerable: true, get: function () { return Client_js_1.RewardsClient; } });
|
|
21
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -8,7 +8,7 @@ export interface CtaComponent {
|
|
|
8
8
|
/** Style of the button */
|
|
9
9
|
buttonStyle: KardApi.users.ButtonStyle;
|
|
10
10
|
/** Action to perform when the button is clicked */
|
|
11
|
-
action?: KardApi.users.CtaAction;
|
|
11
|
+
action?: KardApi.users.CtaAction | undefined;
|
|
12
12
|
/** Icon identifier to display on the button */
|
|
13
|
-
startIcon?: string;
|
|
13
|
+
startIcon?: string | undefined;
|
|
14
14
|
}
|
|
@@ -142,5 +142,5 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
142
142
|
export interface LocationsResponseObject {
|
|
143
143
|
data: KardApi.users.LocationData[];
|
|
144
144
|
links: KardApi.Links;
|
|
145
|
-
included?: KardApi.users.EligibilityLocationIncluded[];
|
|
145
|
+
included?: KardApi.users.EligibilityLocationIncluded[] | undefined;
|
|
146
146
|
}
|
|
@@ -3,7 +3,7 @@ export interface OfferCommonFields {
|
|
|
3
3
|
/** Terms and conditions on offer */
|
|
4
4
|
terms: string;
|
|
5
5
|
/** Maximum times cardholder can redeem offer, if applicable */
|
|
6
|
-
maxRedemptions?: number;
|
|
6
|
+
maxRedemptions?: number | undefined;
|
|
7
7
|
/** Name of offer */
|
|
8
8
|
name: string;
|
|
9
9
|
purchaseChannel: KardApi.PurchaseChannel[];
|
|
@@ -17,17 +17,17 @@ export interface OfferCommonFields {
|
|
|
17
17
|
/** True returns only targeted offers, false returns only non-targeted offers */
|
|
18
18
|
isTargeted: boolean;
|
|
19
19
|
/** Minimum Transaction Amount required to redeem offer, if available on offer */
|
|
20
|
-
minTransactionAmount?: KardApi.users.Amount;
|
|
20
|
+
minTransactionAmount?: KardApi.users.Amount | undefined;
|
|
21
21
|
/** Maximum Transaction Amount allowed to redeem offer, if available on offer */
|
|
22
|
-
maxTransactionAmount?: KardApi.users.Amount;
|
|
22
|
+
maxTransactionAmount?: KardApi.users.Amount | undefined;
|
|
23
23
|
/** Minimum Reward Amount, if available on offer */
|
|
24
|
-
minRewardAmount?: KardApi.users.Amount;
|
|
24
|
+
minRewardAmount?: KardApi.users.Amount | undefined;
|
|
25
25
|
/** Maximum Reward Amount, if available on offer */
|
|
26
|
-
maxRewardAmount?: KardApi.users.Amount;
|
|
26
|
+
maxRewardAmount?: KardApi.users.Amount | undefined;
|
|
27
27
|
/** URL to the website of the offer provider */
|
|
28
|
-
websiteUrl?: string;
|
|
28
|
+
websiteUrl?: string | undefined;
|
|
29
29
|
/** Description of the offer */
|
|
30
|
-
description?: string;
|
|
30
|
+
description?: string | undefined;
|
|
31
31
|
/** UI component data for the offer, returned when supportedComponents query parameter is provided */
|
|
32
|
-
components?: KardApi.users.OfferComponents;
|
|
32
|
+
components?: KardApi.users.OfferComponents | undefined;
|
|
33
33
|
}
|