@kard-financial/sdk 0.0.1 → 0.0.2
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 +12 -22
- package/dist/cjs/Client.d.ts +0 -6
- package/dist/cjs/Client.js +6 -16
- package/dist/cjs/api/resources/commons/types/CommissionValue.d.ts +10 -0
- package/dist/cjs/api/resources/commons/types/CommissionValueType.d.ts +10 -0
- package/dist/cjs/api/resources/{notifications/types/CommissionEarnedType.js → commons/types/CommissionValueType.js} +2 -2
- package/dist/cjs/api/resources/commons/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/commons/types/index.js +3 -0
- package/dist/cjs/api/resources/index.d.ts +0 -5
- package/dist/cjs/api/resources/index.js +1 -6
- package/dist/cjs/api/resources/notifications/client/Client.d.ts +3 -39
- package/dist/cjs/api/resources/notifications/client/Client.js +4 -137
- package/dist/cjs/api/resources/notifications/index.d.ts +1 -0
- package/dist/cjs/api/resources/notifications/index.js +1 -0
- package/dist/cjs/api/resources/notifications/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/notifications/resources/index.js +41 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.d.ts +56 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +150 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/CreateSubscriptionUnion.d.ts +10 -0
- package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionsResponseObject.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/CreatedSubscription.d.ts +8 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/SubscriptionRequest.d.ts +7 -0
- package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestAttributes.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestBody.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/SubscriptionRequestUnion.d.ts +10 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/index.d.ts +7 -0
- package/dist/cjs/api/resources/notifications/resources/subscriptions/types/index.js +23 -0
- package/dist/cjs/api/resources/notifications/types/BrokerOperationHours.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/types/BrokerRewardType.d.ts +2 -2
- package/dist/cjs/api/resources/notifications/types/BrokerRewardType.js +1 -1
- package/dist/cjs/api/resources/notifications/types/EarnedRewardSettledAttributes.d.ts +7 -0
- package/dist/cjs/api/resources/notifications/types/EarnedRewardSettledData.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/types/LocationStatus.d.ts +8 -0
- package/dist/cjs/api/resources/notifications/types/LocationStatus.js +10 -0
- package/dist/cjs/api/resources/notifications/types/MerchantSource.d.ts +8 -0
- package/dist/cjs/api/resources/notifications/types/MerchantSource.js +10 -0
- package/dist/cjs/api/resources/notifications/types/NotificationMetadata.d.ts +7 -0
- package/dist/cjs/api/resources/notifications/types/NotificationPayload.d.ts +68 -67
- package/dist/cjs/api/resources/notifications/types/OfferStatus.d.ts +1 -3
- package/dist/cjs/api/resources/notifications/types/OfferStatus.js +0 -2
- package/dist/cjs/api/resources/notifications/types/OfferType.d.ts +7 -0
- package/dist/cjs/api/resources/notifications/types/OfferType.js +9 -0
- package/dist/cjs/api/resources/notifications/types/ValidTransactionAttributes.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/types/ValidTransactionCommissionEarned.d.ts +8 -0
- package/dist/cjs/api/resources/notifications/types/WebhookLocationsAttributes.d.ts +9 -1
- package/dist/cjs/api/resources/notifications/types/WebhookLocationsRelationships.d.ts +0 -1
- package/dist/cjs/api/resources/notifications/types/WebhookMerchantAttributes.d.ts +12 -5
- package/dist/cjs/api/resources/notifications/types/WebhookMerchantRelationships.d.ts +1 -2
- package/dist/cjs/api/resources/notifications/types/WebhookOfferAttributes.d.ts +10 -6
- package/dist/cjs/api/resources/notifications/types/WebhookOfferRelationships.d.ts +0 -1
- package/dist/cjs/api/resources/notifications/types/WebhookUserOfferAttributes.d.ts +2 -0
- package/dist/cjs/api/resources/notifications/types/WebhookUserOfferRelationships.d.ts +1 -1
- package/dist/cjs/api/resources/notifications/types/index.d.ts +6 -10
- package/dist/cjs/api/resources/notifications/types/index.js +6 -10
- package/dist/cjs/api/resources/transactions/client/Client.d.ts +50 -6
- package/dist/cjs/api/resources/transactions/client/Client.js +52 -8
- package/dist/cjs/api/resources/transactions/types/MatchedTransactionsAttributes.d.ts +6 -2
- package/dist/cjs/api/resources/transactions/types/ProcessorMid.d.ts +10 -0
- package/dist/cjs/api/resources/transactions/types/ReceiptMediumType.d.ts +8 -0
- package/dist/cjs/api/resources/transactions/types/ReceiptMediumType.js +10 -0
- package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +4 -0
- package/dist/cjs/api/resources/transactions/types/TransactionsRequestBody.d.ts +46 -2
- package/dist/cjs/api/resources/{eligibility/types/CategoryData.d.ts → transactions/types/VisaMid.d.ts} +3 -1
- package/dist/cjs/api/resources/transactions/types/VisaMidDetails.d.ts +9 -0
- package/dist/cjs/api/resources/transactions/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/transactions/types/index.js +4 -0
- package/dist/cjs/api/resources/users/client/Client.d.ts +19 -13
- package/dist/cjs/api/resources/users/client/Client.js +35 -25
- package/dist/cjs/api/resources/users/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/index.js +1 -0
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/client/Client.d.ts +15 -7
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/client/Client.js +23 -12
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/CreateAttributionRequestObject.d.ts +14 -6
- package/dist/cjs/api/resources/users/resources/attributions/types/CreateAttributionRequestUnion.d.ts +13 -0
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/CreateAttributionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/NotificationAttributionAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/NotificationAttributionRequest.d.ts +2 -2
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/OfferAttributionAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/OfferAttributionRequest.d.ts +2 -2
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/OfferMedium.d.ts +2 -1
- package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/OfferMedium.js +1 -0
- package/dist/cjs/api/resources/users/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/users/resources/index.js +44 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/Client.d.ts +18 -18
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/Client.js +27 -24
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/requests/GetLocationsByUserRequest.d.ts +2 -2
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/requests/GetOffersByUserRequest.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/users/resources/rewards/index.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/rewards/index.js +18 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/Amount.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/CategoryData.d.ts +6 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/CategoryFields.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/CategoryIncluded.d.ts +7 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/CategoryRelationship.d.ts +2 -2
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/CategoryRelationshipObject.d.ts +2 -2
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/Commission.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/EligibilityLocationIncluded.d.ts +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/EligibilityOfferIncluded.d.ts +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/EligibilityOfferRelationship.d.ts +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/LocationAttributes.d.ts +11 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/LocationData.d.ts +3 -3
- package/dist/cjs/api/resources/users/resources/rewards/types/LocationRelationships.d.ts +6 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/LocationsResponseObject.d.ts +7 -7
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OfferCommonFields.d.ts +7 -7
- package/dist/cjs/api/resources/users/resources/rewards/types/OfferDataUnion.d.ts +10 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OfferRelationship.d.ts +1 -1
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OffersResponseObject.d.ts +7 -7
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OperationHours.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/OperationHours.js +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/OperationPeriod.d.ts +8 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/OperationPeriod.js +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/OperationTime.js +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOffer.d.ts +7 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOffer.js +5 -0
- package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/StandardOfferCore.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOfferCore.js +5 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOfferFields.d.ts +6 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/StandardOfferFields.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +0 -6
- package/dist/esm/Client.mjs +0 -10
- package/dist/esm/api/resources/commons/types/CommissionValue.d.mts +10 -0
- package/dist/esm/api/resources/commons/types/CommissionValueType.d.mts +10 -0
- package/dist/esm/api/resources/{notifications/types/CommissionEarnedType.mjs → commons/types/CommissionValueType.mjs} +1 -1
- package/dist/esm/api/resources/commons/types/index.d.mts +3 -0
- package/dist/esm/api/resources/commons/types/index.mjs +3 -0
- package/dist/esm/api/resources/index.d.mts +0 -5
- package/dist/esm/api/resources/index.mjs +0 -5
- package/dist/esm/api/resources/notifications/client/Client.d.mts +3 -39
- package/dist/esm/api/resources/notifications/client/Client.mjs +4 -101
- package/dist/esm/api/resources/notifications/index.d.mts +1 -0
- package/dist/esm/api/resources/notifications/index.mjs +1 -0
- package/dist/esm/api/resources/notifications/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/notifications/resources/index.mjs +2 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.d.mts +56 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +110 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/CreateSubscriptionUnion.d.mts +10 -0
- package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionsResponseObject.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/CreatedSubscription.d.mts +8 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/SubscriptionRequest.d.mts +7 -0
- package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestAttributes.d.mts +1 -1
- package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestBody.d.mts +2 -2
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/SubscriptionRequestUnion.d.mts +10 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/index.d.mts +7 -0
- package/dist/esm/api/resources/notifications/resources/subscriptions/types/index.mjs +7 -0
- package/dist/esm/api/resources/notifications/types/BrokerOperationHours.d.mts +1 -1
- package/dist/esm/api/resources/notifications/types/BrokerRewardType.d.mts +2 -2
- package/dist/esm/api/resources/notifications/types/BrokerRewardType.mjs +1 -1
- package/dist/esm/api/resources/notifications/types/EarnedRewardSettledAttributes.d.mts +7 -0
- package/dist/esm/api/resources/notifications/types/EarnedRewardSettledData.d.mts +1 -1
- package/dist/esm/api/resources/notifications/types/LocationStatus.d.mts +8 -0
- package/dist/esm/api/resources/notifications/types/LocationStatus.mjs +7 -0
- package/dist/esm/api/resources/notifications/types/MerchantSource.d.mts +8 -0
- package/dist/esm/api/resources/notifications/types/MerchantSource.mjs +7 -0
- package/dist/esm/api/resources/notifications/types/NotificationMetadata.d.mts +7 -0
- package/dist/esm/api/resources/notifications/types/NotificationPayload.d.mts +68 -67
- package/dist/esm/api/resources/notifications/types/OfferStatus.d.mts +1 -3
- package/dist/esm/api/resources/notifications/types/OfferStatus.mjs +0 -2
- package/dist/esm/api/resources/notifications/types/OfferType.d.mts +7 -0
- package/dist/esm/api/resources/notifications/types/OfferType.mjs +6 -0
- package/dist/esm/api/resources/notifications/types/ValidTransactionAttributes.d.mts +1 -1
- package/dist/esm/api/resources/notifications/types/ValidTransactionCommissionEarned.d.mts +8 -0
- package/dist/esm/api/resources/notifications/types/WebhookLocationsAttributes.d.mts +9 -1
- package/dist/esm/api/resources/notifications/types/WebhookLocationsRelationships.d.mts +0 -1
- package/dist/esm/api/resources/notifications/types/WebhookMerchantAttributes.d.mts +12 -5
- package/dist/esm/api/resources/notifications/types/WebhookMerchantRelationships.d.mts +1 -2
- package/dist/esm/api/resources/notifications/types/WebhookOfferAttributes.d.mts +10 -6
- package/dist/esm/api/resources/notifications/types/WebhookOfferRelationships.d.mts +0 -1
- package/dist/esm/api/resources/notifications/types/WebhookUserOfferAttributes.d.mts +2 -0
- package/dist/esm/api/resources/notifications/types/WebhookUserOfferRelationships.d.mts +1 -1
- package/dist/esm/api/resources/notifications/types/index.d.mts +6 -10
- package/dist/esm/api/resources/notifications/types/index.mjs +6 -10
- package/dist/esm/api/resources/transactions/client/Client.d.mts +50 -6
- package/dist/esm/api/resources/transactions/client/Client.mjs +52 -8
- package/dist/esm/api/resources/transactions/types/MatchedTransactionsAttributes.d.mts +6 -2
- package/dist/esm/api/resources/transactions/types/ProcessorMid.d.mts +10 -0
- package/dist/esm/api/resources/transactions/types/ReceiptMediumType.d.mts +8 -0
- package/dist/esm/api/resources/transactions/types/ReceiptMediumType.mjs +7 -0
- package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +4 -0
- package/dist/esm/api/resources/transactions/types/TransactionsRequestBody.d.mts +46 -2
- package/dist/esm/api/resources/{eligibility/types/CategoryData.d.mts → transactions/types/VisaMid.d.mts} +3 -1
- package/dist/esm/api/resources/transactions/types/VisaMidDetails.d.mts +9 -0
- package/dist/esm/api/resources/transactions/types/index.d.mts +4 -0
- package/dist/esm/api/resources/transactions/types/index.mjs +4 -0
- package/dist/esm/api/resources/users/client/Client.d.mts +19 -13
- package/dist/esm/api/resources/users/client/Client.mjs +35 -25
- package/dist/esm/api/resources/users/index.d.mts +1 -0
- package/dist/esm/api/resources/users/index.mjs +1 -0
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/client/Client.d.mts +15 -7
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/client/Client.mjs +23 -12
- package/dist/esm/api/resources/users/resources/attributions/client/index.d.mts +1 -0
- package/dist/esm/api/resources/users/resources/attributions/client/index.mjs +1 -0
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/CreateAttributionRequestObject.d.mts +14 -6
- package/dist/esm/api/resources/users/resources/attributions/types/CreateAttributionRequestUnion.d.mts +13 -0
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/CreateAttributionResponse.d.mts +1 -1
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/NotificationAttributionAttributes.d.mts +3 -3
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/NotificationAttributionRequest.d.mts +2 -2
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/OfferAttributionAttributes.d.mts +3 -3
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/OfferAttributionRequest.d.mts +2 -2
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/OfferMedium.d.mts +2 -1
- package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/OfferMedium.mjs +1 -0
- package/dist/esm/api/resources/users/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/users/resources/index.mjs +5 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/Client.d.mts +18 -18
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/Client.mjs +25 -22
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/requests/GetLocationsByUserRequest.d.mts +2 -2
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/requests/GetOffersByUserRequest.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/users/resources/rewards/index.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/rewards/index.mjs +2 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/Amount.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/CategoryData.d.mts +6 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/CategoryFields.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/CategoryIncluded.d.mts +7 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/CategoryRelationship.d.mts +2 -2
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/CategoryRelationshipObject.d.mts +2 -2
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/Commission.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/EligibilityLocationIncluded.d.mts +5 -0
- package/dist/esm/api/resources/users/resources/rewards/types/EligibilityOfferIncluded.d.mts +5 -0
- package/dist/esm/api/resources/users/resources/rewards/types/EligibilityOfferRelationship.d.mts +5 -0
- package/dist/esm/api/resources/users/resources/rewards/types/LocationAttributes.d.mts +11 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/LocationData.d.mts +3 -3
- package/dist/esm/api/resources/users/resources/rewards/types/LocationRelationships.d.mts +6 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/LocationsResponseObject.d.mts +7 -7
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OfferCommonFields.d.mts +7 -7
- package/dist/esm/api/resources/users/resources/rewards/types/OfferDataUnion.d.mts +10 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OfferRelationship.d.mts +1 -1
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OffersResponseObject.d.mts +7 -7
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OperationHours.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/OperationHours.mjs +4 -0
- package/dist/esm/api/resources/users/resources/rewards/types/OperationPeriod.d.mts +8 -0
- package/dist/esm/api/resources/users/resources/rewards/types/OperationPeriod.mjs +4 -0
- package/dist/esm/api/resources/users/resources/rewards/types/OperationTime.mjs +4 -0
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOffer.d.mts +7 -0
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOffer.mjs +4 -0
- package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/StandardOfferCore.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOfferCore.mjs +4 -0
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOfferFields.d.mts +6 -0
- package/dist/esm/api/resources/users/resources/rewards/types/StandardOfferFields.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +205 -189
- package/dist/cjs/api/resources/attributions/types/CreateAttributionRequestUnion.d.ts +0 -13
- package/dist/cjs/api/resources/eligibility/types/CategoryIncluded.d.ts +0 -7
- package/dist/cjs/api/resources/eligibility/types/EligibilityLocationIncluded.d.ts +0 -5
- package/dist/cjs/api/resources/eligibility/types/EligibilityOfferIncluded.d.ts +0 -5
- package/dist/cjs/api/resources/eligibility/types/EligibilityOfferRelationship.d.ts +0 -5
- package/dist/cjs/api/resources/eligibility/types/LocationAttributes.d.ts +0 -11
- package/dist/cjs/api/resources/eligibility/types/LocationRelationships.d.ts +0 -6
- package/dist/cjs/api/resources/eligibility/types/OfferDataUnion.d.ts +0 -10
- package/dist/cjs/api/resources/eligibility/types/OperationPeriod.d.ts +0 -8
- package/dist/cjs/api/resources/eligibility/types/StandardOffer.d.ts +0 -7
- package/dist/cjs/api/resources/eligibility/types/StandardOfferFields.d.ts +0 -6
- package/dist/cjs/api/resources/notifications/types/CommissionEarned.d.ts +0 -10
- package/dist/cjs/api/resources/notifications/types/CommissionEarnedType.d.ts +0 -7
- package/dist/cjs/api/resources/notifications/types/CreateSubscriptionUnion.d.ts +0 -10
- package/dist/cjs/api/resources/notifications/types/CreatedSubscription.d.ts +0 -8
- package/dist/cjs/api/resources/notifications/types/SubscriptionRequest.d.ts +0 -7
- package/dist/cjs/api/resources/notifications/types/SubscriptionRequestUnion.d.ts +0 -10
- package/dist/esm/api/resources/attributions/types/CreateAttributionRequestUnion.d.mts +0 -13
- package/dist/esm/api/resources/eligibility/types/CategoryIncluded.d.mts +0 -7
- package/dist/esm/api/resources/eligibility/types/EligibilityLocationIncluded.d.mts +0 -5
- package/dist/esm/api/resources/eligibility/types/EligibilityOfferIncluded.d.mts +0 -5
- package/dist/esm/api/resources/eligibility/types/EligibilityOfferRelationship.d.mts +0 -5
- package/dist/esm/api/resources/eligibility/types/LocationAttributes.d.mts +0 -11
- package/dist/esm/api/resources/eligibility/types/LocationRelationships.d.mts +0 -6
- package/dist/esm/api/resources/eligibility/types/OfferDataUnion.d.mts +0 -10
- package/dist/esm/api/resources/eligibility/types/OperationPeriod.d.mts +0 -8
- package/dist/esm/api/resources/eligibility/types/StandardOffer.d.mts +0 -7
- package/dist/esm/api/resources/eligibility/types/StandardOfferFields.d.mts +0 -6
- package/dist/esm/api/resources/notifications/types/CommissionEarned.d.mts +0 -10
- package/dist/esm/api/resources/notifications/types/CommissionEarnedType.d.mts +0 -7
- package/dist/esm/api/resources/notifications/types/CreateSubscriptionUnion.d.mts +0 -10
- package/dist/esm/api/resources/notifications/types/CreatedSubscription.d.mts +0 -8
- package/dist/esm/api/resources/notifications/types/SubscriptionRequest.d.mts +0 -7
- package/dist/esm/api/resources/notifications/types/SubscriptionRequestUnion.d.mts +0 -10
- /package/dist/cjs/api/resources/{attributions/types/CreateAttributionRequestObject.js → commons/types/CommissionValue.js} +0 -0
- /package/dist/cjs/api/resources/{notifications → commons}/types/NotificationType.d.ts +0 -0
- /package/dist/cjs/api/resources/{notifications → commons}/types/NotificationType.js +0 -0
- /package/dist/cjs/api/resources/{attributions → notifications/resources/subscriptions}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{attributions → notifications/resources/subscriptions}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{attributions → notifications/resources/subscriptions}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{attributions → notifications/resources/subscriptions}/index.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionUnion.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionsResponseObject.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/CreatedSubscription.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequest.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestAttributes.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestBody.js +0 -0
- /package/dist/cjs/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestUnion.js +0 -0
- /package/dist/cjs/api/resources/{attributions/types/CreateAttributionRequestUnion.js → notifications/types/EarnedRewardSettledAttributes.js} +0 -0
- /package/dist/cjs/api/resources/{attributions/types/CreateAttributionResponse.js → notifications/types/NotificationMetadata.js} +0 -0
- /package/dist/cjs/api/resources/{attributions/types/NotificationAttributionAttributes.js → notifications/types/ValidTransactionCommissionEarned.js} +0 -0
- /package/dist/cjs/api/resources/{attributions/types/NotificationAttributionRequest.js → transactions/types/ProcessorMid.js} +0 -0
- /package/dist/cjs/api/resources/{attributions/types/OfferAttributionAttributes.js → transactions/types/VisaMid.js} +0 -0
- /package/dist/cjs/api/resources/{attributions/types/OfferAttributionRequest.js → transactions/types/VisaMidDetails.js} +0 -0
- /package/dist/{esm/api/resources/attributions/client/index.d.mts → cjs/api/resources/users/resources/attributions/client/index.d.ts} +0 -0
- /package/dist/cjs/api/resources/{eligibility/client/requests → users/resources/attributions/client}/index.js +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/attributions}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/attributions}/index.js +0 -0
- /package/dist/cjs/api/resources/{eligibility/client/requests/GetLocationsByUserRequest.js → users/resources/attributions/types/CreateAttributionRequestObject.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/client/requests/GetOffersByUserRequest.js → users/resources/attributions/types/CreateAttributionRequestUnion.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/Amount.js → users/resources/attributions/types/CreateAttributionResponse.js} +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/EventCode.d.ts +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/EventCode.js +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/Asset.js → users/resources/attributions/types/NotificationAttributionAttributes.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryData.js → users/resources/attributions/types/NotificationAttributionRequest.js} +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/NotificationMedium.d.ts +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/NotificationMedium.js +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryFields.js → users/resources/attributions/types/OfferAttributionAttributes.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryIdentifier.js → users/resources/attributions/types/OfferAttributionRequest.js} +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{attributions → users/resources/attributions}/types/index.js +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryIncluded.js → users/resources/rewards/client/requests/GetLocationsByUserRequest.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryRelationship.js → users/resources/rewards/client/requests/GetOffersByUserRequest.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/client/requests/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/CategoryRelationshipObject.js → users/resources/rewards/types/Amount.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/AmountType.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/AmountType.js +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/Asset.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/Commission.js → users/resources/rewards/types/Asset.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/Coordinates.js → users/resources/rewards/types/CategoryData.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/EligibilityLocationAddress.js → users/resources/rewards/types/CategoryFields.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/CategoryIdentifier.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/EligibilityLocationIncluded.js → users/resources/rewards/types/CategoryIdentifier.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/EligibilityOfferIncluded.js → users/resources/rewards/types/CategoryIncluded.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/EligibilityOfferRelationship.js → users/resources/rewards/types/CategoryRelationship.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/LocationAttributes.js → users/resources/rewards/types/CategoryRelationshipObject.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/LocationData.js → users/resources/rewards/types/Commission.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/Coordinates.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/LocationRelationships.js → users/resources/rewards/types/Coordinates.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/EligibilityLocationAddress.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/LocationsResponseObject.js → users/resources/rewards/types/EligibilityLocationAddress.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OfferCommonFields.js → users/resources/rewards/types/EligibilityLocationIncluded.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OfferDataUnion.js → users/resources/rewards/types/EligibilityOfferIncluded.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OfferRelationship.js → users/resources/rewards/types/EligibilityOfferRelationship.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OffersResponseObject.js → users/resources/rewards/types/LocationAttributes.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OperationHours.js → users/resources/rewards/types/LocationData.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OperationPeriod.js → users/resources/rewards/types/LocationRelationships.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/LocationSortOptions.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/LocationSortOptions.js +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/OperationTime.js → users/resources/rewards/types/LocationsResponseObject.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/StandardOffer.js → users/resources/rewards/types/OfferCommonFields.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/StandardOfferCore.js → users/resources/rewards/types/OfferDataUnion.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility/types/StandardOfferFields.js → users/resources/rewards/types/OfferRelationship.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OfferSortOptions.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OfferSortOptions.js +0 -0
- /package/dist/cjs/api/resources/{notifications/types/CommissionEarned.js → users/resources/rewards/types/OffersResponseObject.js} +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/OperationTime.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{eligibility → users/resources/rewards}/types/index.js +0 -0
- /package/dist/esm/api/resources/{attributions/types/CreateAttributionRequestObject.mjs → commons/types/CommissionValue.mjs} +0 -0
- /package/dist/esm/api/resources/{notifications → commons}/types/NotificationType.d.mts +0 -0
- /package/dist/esm/api/resources/{notifications → commons}/types/NotificationType.mjs +0 -0
- /package/dist/esm/api/resources/{attributions/client/index.mjs → notifications/resources/subscriptions/client/index.d.mts} +0 -0
- /package/dist/esm/api/resources/{eligibility/client/requests → notifications/resources/subscriptions/client}/index.mjs +0 -0
- /package/dist/esm/api/resources/{attributions → notifications/resources/subscriptions}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{attributions → notifications/resources/subscriptions}/index.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionUnion.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/CreateSubscriptionsResponseObject.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/CreatedSubscription.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequest.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestAttributes.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestBody.mjs +0 -0
- /package/dist/esm/api/resources/notifications/{types → resources/subscriptions/types}/SubscriptionRequestUnion.mjs +0 -0
- /package/dist/esm/api/resources/{attributions/types/CreateAttributionRequestUnion.mjs → notifications/types/EarnedRewardSettledAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions/types/CreateAttributionResponse.mjs → notifications/types/NotificationMetadata.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions/types/NotificationAttributionAttributes.mjs → notifications/types/ValidTransactionCommissionEarned.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions/types/NotificationAttributionRequest.mjs → transactions/types/ProcessorMid.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions/types/OfferAttributionAttributes.mjs → transactions/types/VisaMid.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions/types/OfferAttributionRequest.mjs → transactions/types/VisaMidDetails.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/attributions}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/attributions}/index.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility/client/requests/GetLocationsByUserRequest.mjs → users/resources/attributions/types/CreateAttributionRequestObject.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/client/requests/GetOffersByUserRequest.mjs → users/resources/attributions/types/CreateAttributionRequestUnion.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/Amount.mjs → users/resources/attributions/types/CreateAttributionResponse.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/EventCode.d.mts +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/EventCode.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility/types/Asset.mjs → users/resources/attributions/types/NotificationAttributionAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryData.mjs → users/resources/attributions/types/NotificationAttributionRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/NotificationMedium.d.mts +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/NotificationMedium.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryFields.mjs → users/resources/attributions/types/OfferAttributionAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryIdentifier.mjs → users/resources/attributions/types/OfferAttributionRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/index.d.mts +0 -0
- /package/dist/esm/api/resources/{attributions → users/resources/attributions}/types/index.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryIncluded.mjs → users/resources/rewards/client/requests/GetLocationsByUserRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryRelationship.mjs → users/resources/rewards/client/requests/GetOffersByUserRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/client/requests/index.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility/types/CategoryRelationshipObject.mjs → users/resources/rewards/types/Amount.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/AmountType.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/AmountType.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/Asset.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility/types/Commission.mjs → users/resources/rewards/types/Asset.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/Coordinates.mjs → users/resources/rewards/types/CategoryData.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/EligibilityLocationAddress.mjs → users/resources/rewards/types/CategoryFields.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/CategoryIdentifier.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility/types/EligibilityLocationIncluded.mjs → users/resources/rewards/types/CategoryIdentifier.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/EligibilityOfferIncluded.mjs → users/resources/rewards/types/CategoryIncluded.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/EligibilityOfferRelationship.mjs → users/resources/rewards/types/CategoryRelationship.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/LocationAttributes.mjs → users/resources/rewards/types/CategoryRelationshipObject.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/LocationData.mjs → users/resources/rewards/types/Commission.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/Coordinates.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility/types/LocationRelationships.mjs → users/resources/rewards/types/Coordinates.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/EligibilityLocationAddress.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility/types/LocationsResponseObject.mjs → users/resources/rewards/types/EligibilityLocationAddress.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OfferCommonFields.mjs → users/resources/rewards/types/EligibilityLocationIncluded.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OfferDataUnion.mjs → users/resources/rewards/types/EligibilityOfferIncluded.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OfferRelationship.mjs → users/resources/rewards/types/EligibilityOfferRelationship.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OffersResponseObject.mjs → users/resources/rewards/types/LocationAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OperationHours.mjs → users/resources/rewards/types/LocationData.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OperationPeriod.mjs → users/resources/rewards/types/LocationRelationships.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/LocationSortOptions.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/LocationSortOptions.mjs +0 -0
- /package/dist/esm/api/resources/{eligibility/types/OperationTime.mjs → users/resources/rewards/types/LocationsResponseObject.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/StandardOffer.mjs → users/resources/rewards/types/OfferCommonFields.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/StandardOfferCore.mjs → users/resources/rewards/types/OfferDataUnion.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility/types/StandardOfferFields.mjs → users/resources/rewards/types/OfferRelationship.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OfferSortOptions.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OfferSortOptions.mjs +0 -0
- /package/dist/esm/api/resources/{notifications/types/CommissionEarned.mjs → users/resources/rewards/types/OffersResponseObject.mjs} +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/OperationTime.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/index.d.mts +0 -0
- /package/dist/esm/api/resources/{eligibility → users/resources/rewards}/types/index.mjs +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FKardFinancial%2Fkard-node-sdk)
|
|
4
4
|
[](https://www.npmjs.com/package/@kard-financial/sdk)
|
|
5
5
|
|
|
6
|
-
The Kard TypeScript library provides convenient access to the Kard
|
|
6
|
+
The Kard TypeScript library provides convenient access to the Kard APIs from TypeScript.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
@@ -23,24 +23,14 @@ Instantiate and use the client with the following:
|
|
|
23
23
|
import { KardApiClient } from "@kard-financial/sdk";
|
|
24
24
|
|
|
25
25
|
const client = new KardApiClient({ token: "YOUR_TOKEN" });
|
|
26
|
-
await client.
|
|
26
|
+
await client.notifications.subscriptions.create("organization-123", {
|
|
27
27
|
data: [
|
|
28
28
|
{
|
|
29
|
-
type: "
|
|
29
|
+
type: "subscription",
|
|
30
30
|
attributes: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
eventDate: "2025-01-01T00:00:00Z",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: "notificationAttribution",
|
|
39
|
-
attributes: {
|
|
40
|
-
entityId: "60e4ba1da31c5a22a144c076",
|
|
41
|
-
eventCode: "IMPRESSION",
|
|
42
|
-
medium: "PUSH",
|
|
43
|
-
eventDate: "2025-01-01T00:00:00Z",
|
|
31
|
+
eventName: "earnedRewardApproved",
|
|
32
|
+
webhookUrl: "https://webhookUrl.com/post",
|
|
33
|
+
enabled: true,
|
|
44
34
|
},
|
|
45
35
|
},
|
|
46
36
|
],
|
|
@@ -69,7 +59,7 @@ will be thrown.
|
|
|
69
59
|
import { KardApiError } from "@kard-financial/sdk";
|
|
70
60
|
|
|
71
61
|
try {
|
|
72
|
-
await client.
|
|
62
|
+
await client.notifications.subscriptions.create(...);
|
|
73
63
|
} catch (err) {
|
|
74
64
|
if (err instanceof KardApiError) {
|
|
75
65
|
console.log(err.statusCode);
|
|
@@ -87,7 +77,7 @@ try {
|
|
|
87
77
|
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
88
78
|
|
|
89
79
|
```typescript
|
|
90
|
-
const response = await client.
|
|
80
|
+
const response = await client.notifications.subscriptions.create(..., {
|
|
91
81
|
headers: {
|
|
92
82
|
'X-Custom-Header': 'custom value'
|
|
93
83
|
}
|
|
@@ -109,7 +99,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
109
99
|
Use the `maxRetries` request option to configure this behavior.
|
|
110
100
|
|
|
111
101
|
```typescript
|
|
112
|
-
const response = await client.
|
|
102
|
+
const response = await client.notifications.subscriptions.create(..., {
|
|
113
103
|
maxRetries: 0 // override maxRetries at the request level
|
|
114
104
|
});
|
|
115
105
|
```
|
|
@@ -119,7 +109,7 @@ const response = await client.attributions.createAttributionEvents(..., {
|
|
|
119
109
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
120
110
|
|
|
121
111
|
```typescript
|
|
122
|
-
const response = await client.
|
|
112
|
+
const response = await client.notifications.subscriptions.create(..., {
|
|
123
113
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
124
114
|
});
|
|
125
115
|
```
|
|
@@ -130,7 +120,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
130
120
|
|
|
131
121
|
```typescript
|
|
132
122
|
const controller = new AbortController();
|
|
133
|
-
const response = await client.
|
|
123
|
+
const response = await client.notifications.subscriptions.create(..., {
|
|
134
124
|
abortSignal: controller.signal
|
|
135
125
|
});
|
|
136
126
|
controller.abort(); // aborts the request
|
|
@@ -142,7 +132,7 @@ The SDK provides access to raw response data, including headers, through the `.w
|
|
|
142
132
|
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
143
133
|
|
|
144
134
|
```typescript
|
|
145
|
-
const { data, rawResponse } = await client.
|
|
135
|
+
const { data, rawResponse } = await client.notifications.subscriptions.create(...).withRawResponse();
|
|
146
136
|
|
|
147
137
|
console.log(data);
|
|
148
138
|
console.log(rawResponse.headers['X-My-Header']);
|
package/dist/cjs/Client.d.ts
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments.js";
|
|
5
5
|
import * as core from "./core/index.js";
|
|
6
|
-
import { Attributions } from "./api/resources/attributions/client/Client.js";
|
|
7
|
-
import { Eligibility } from "./api/resources/eligibility/client/Client.js";
|
|
8
6
|
import { Notifications } from "./api/resources/notifications/client/Client.js";
|
|
9
7
|
import { Transactions } from "./api/resources/transactions/client/Client.js";
|
|
10
8
|
import { Users } from "./api/resources/users/client/Client.js";
|
|
@@ -28,14 +26,10 @@ export declare namespace KardApiClient {
|
|
|
28
26
|
}
|
|
29
27
|
export declare class KardApiClient {
|
|
30
28
|
protected readonly _options: KardApiClient.Options;
|
|
31
|
-
protected _attributions: Attributions | undefined;
|
|
32
|
-
protected _eligibility: Eligibility | undefined;
|
|
33
29
|
protected _notifications: Notifications | undefined;
|
|
34
30
|
protected _transactions: Transactions | undefined;
|
|
35
31
|
protected _users: Users | undefined;
|
|
36
32
|
constructor(_options: KardApiClient.Options);
|
|
37
|
-
get attributions(): Attributions;
|
|
38
|
-
get eligibility(): Eligibility;
|
|
39
33
|
get notifications(): Notifications;
|
|
40
34
|
get transactions(): Transactions;
|
|
41
35
|
get users(): Users;
|
package/dist/cjs/Client.js
CHANGED
|
@@ -4,34 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.KardApiClient = void 0;
|
|
7
|
-
const Client_js_1 = require("./api/resources/
|
|
8
|
-
const Client_js_2 = require("./api/resources/
|
|
9
|
-
const Client_js_3 = require("./api/resources/
|
|
10
|
-
const Client_js_4 = require("./api/resources/transactions/client/Client.js");
|
|
11
|
-
const Client_js_5 = require("./api/resources/users/client/Client.js");
|
|
7
|
+
const Client_js_1 = require("./api/resources/notifications/client/Client.js");
|
|
8
|
+
const Client_js_2 = require("./api/resources/transactions/client/Client.js");
|
|
9
|
+
const Client_js_3 = require("./api/resources/users/client/Client.js");
|
|
12
10
|
class KardApiClient {
|
|
13
11
|
constructor(_options) {
|
|
14
12
|
this._options = _options;
|
|
15
13
|
}
|
|
16
|
-
get attributions() {
|
|
17
|
-
var _a;
|
|
18
|
-
return ((_a = this._attributions) !== null && _a !== void 0 ? _a : (this._attributions = new Client_js_1.Attributions(this._options)));
|
|
19
|
-
}
|
|
20
|
-
get eligibility() {
|
|
21
|
-
var _a;
|
|
22
|
-
return ((_a = this._eligibility) !== null && _a !== void 0 ? _a : (this._eligibility = new Client_js_2.Eligibility(this._options)));
|
|
23
|
-
}
|
|
24
14
|
get notifications() {
|
|
25
15
|
var _a;
|
|
26
|
-
return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new
|
|
16
|
+
return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Client_js_1.Notifications(this._options)));
|
|
27
17
|
}
|
|
28
18
|
get transactions() {
|
|
29
19
|
var _a;
|
|
30
|
-
return ((_a = this._transactions) !== null && _a !== void 0 ? _a : (this._transactions = new
|
|
20
|
+
return ((_a = this._transactions) !== null && _a !== void 0 ? _a : (this._transactions = new Client_js_2.Transactions(this._options)));
|
|
31
21
|
}
|
|
32
22
|
get users() {
|
|
33
23
|
var _a;
|
|
34
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
24
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_js_3.Users(this._options)));
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
27
|
exports.KardApiClient = KardApiClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as KardApi from "../../../index.js";
|
|
5
|
+
export interface CommissionValue {
|
|
6
|
+
/** The type of commission */
|
|
7
|
+
type: KardApi.CommissionValueType;
|
|
8
|
+
/** The commission value. */
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.CommissionValueType = void 0;
|
|
7
|
+
exports.CommissionValueType = {
|
|
8
8
|
Cents: "cents",
|
|
9
9
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
export * from "./NotificationType.js";
|
|
1
2
|
export * from "./CategoryOption.js";
|
|
2
3
|
export * from "./CommissionType.js";
|
|
4
|
+
export * from "./CommissionValueType.js";
|
|
5
|
+
export * from "./CommissionValue.js";
|
|
3
6
|
export * from "./State.js";
|
|
4
7
|
export * from "./EnrolledRewardsType.js";
|
|
5
8
|
export * from "./PurchaseChannel.js";
|
|
@@ -14,8 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./NotificationType.js"), exports);
|
|
17
18
|
__exportStar(require("./CategoryOption.js"), exports);
|
|
18
19
|
__exportStar(require("./CommissionType.js"), exports);
|
|
20
|
+
__exportStar(require("./CommissionValueType.js"), exports);
|
|
21
|
+
__exportStar(require("./CommissionValue.js"), exports);
|
|
19
22
|
__exportStar(require("./State.js"), exports);
|
|
20
23
|
__exportStar(require("./EnrolledRewardsType.js"), exports);
|
|
21
24
|
__exportStar(require("./PurchaseChannel.js"), exports);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export * as attributions from "./attributions/index.js";
|
|
2
|
-
export * from "./attributions/types/index.js";
|
|
3
1
|
export * as commons from "./commons/index.js";
|
|
4
2
|
export * from "./commons/types/index.js";
|
|
5
|
-
export * as eligibility from "./eligibility/index.js";
|
|
6
|
-
export * from "./eligibility/types/index.js";
|
|
7
3
|
export * as notifications from "./notifications/index.js";
|
|
8
4
|
export * from "./notifications/types/index.js";
|
|
9
5
|
export * as transactions from "./transactions/index.js";
|
|
@@ -13,4 +9,3 @@ export * from "./users/types/index.js";
|
|
|
13
9
|
export * from "./commons/errors/index.js";
|
|
14
10
|
export * from "./transactions/errors/index.js";
|
|
15
11
|
export * from "./users/errors/index.js";
|
|
16
|
-
export * from "./eligibility/client/requests/index.js";
|
|
@@ -36,13 +36,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.users = exports.transactions = exports.notifications = exports.
|
|
40
|
-
exports.attributions = __importStar(require("./attributions/index.js"));
|
|
41
|
-
__exportStar(require("./attributions/types/index.js"), exports);
|
|
39
|
+
exports.users = exports.transactions = exports.notifications = exports.commons = void 0;
|
|
42
40
|
exports.commons = __importStar(require("./commons/index.js"));
|
|
43
41
|
__exportStar(require("./commons/types/index.js"), exports);
|
|
44
|
-
exports.eligibility = __importStar(require("./eligibility/index.js"));
|
|
45
|
-
__exportStar(require("./eligibility/types/index.js"), exports);
|
|
46
42
|
exports.notifications = __importStar(require("./notifications/index.js"));
|
|
47
43
|
__exportStar(require("./notifications/types/index.js"), exports);
|
|
48
44
|
exports.transactions = __importStar(require("./transactions/index.js"));
|
|
@@ -52,4 +48,3 @@ __exportStar(require("./users/types/index.js"), exports);
|
|
|
52
48
|
__exportStar(require("./commons/errors/index.js"), exports);
|
|
53
49
|
__exportStar(require("./transactions/errors/index.js"), exports);
|
|
54
50
|
__exportStar(require("./users/errors/index.js"), exports);
|
|
55
|
-
__exportStar(require("./eligibility/client/requests/index.js"), exports);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
|
-
import
|
|
6
|
+
import { Subscriptions } from "../resources/subscriptions/client/Client.js";
|
|
7
7
|
export declare namespace Notifications {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.KardApiEnvironment | string>;
|
|
@@ -11,46 +11,10 @@ export declare namespace Notifications {
|
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
token: core.Supplier<core.BearerToken>;
|
|
13
13
|
}
|
|
14
|
-
interface RequestOptions {
|
|
15
|
-
/** The maximum time to wait for a response in seconds. */
|
|
16
|
-
timeoutInSeconds?: number;
|
|
17
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
18
|
-
maxRetries?: number;
|
|
19
|
-
/** A hook to abort the request. */
|
|
20
|
-
abortSignal?: AbortSignal;
|
|
21
|
-
/** Additional headers to include in the request. */
|
|
22
|
-
headers?: Record<string, string>;
|
|
23
|
-
}
|
|
24
14
|
}
|
|
25
15
|
export declare class Notifications {
|
|
26
16
|
protected readonly _options: Notifications.Options;
|
|
17
|
+
protected _subscriptions: Subscriptions | undefined;
|
|
27
18
|
constructor(_options: Notifications.Options);
|
|
28
|
-
|
|
29
|
-
* Call this endpoint to subscribe to notification events.<br/>
|
|
30
|
-
* <b>Required scopes:</b> `notifications:write`
|
|
31
|
-
*
|
|
32
|
-
* @param {KardApi.OrganizationId} organizationId
|
|
33
|
-
* @param {KardApi.SubscriptionRequestBody} request
|
|
34
|
-
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
-
*
|
|
36
|
-
* @throws {@link KardApi.UnauthorizedError}
|
|
37
|
-
* @throws {@link KardApi.InternalServerError}
|
|
38
|
-
* @throws {@link KardApi.InvalidRequest}
|
|
39
|
-
* @throws {@link KardApi.ConflictError}
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.notifications.createSubscriptions("organization-123", {
|
|
43
|
-
* data: [{
|
|
44
|
-
* type: "subscription",
|
|
45
|
-
* attributes: {
|
|
46
|
-
* eventName: "earnedRewardApproved",
|
|
47
|
-
* webhookUrl: "https://webhookUrl.com/post",
|
|
48
|
-
* enabled: true
|
|
49
|
-
* }
|
|
50
|
-
* }]
|
|
51
|
-
* })
|
|
52
|
-
*/
|
|
53
|
-
createSubscriptions(organizationId: KardApi.OrganizationId, request: KardApi.SubscriptionRequestBody, requestOptions?: Notifications.RequestOptions): core.HttpResponsePromise<KardApi.CreateSubscriptionsResponseObject>;
|
|
54
|
-
private __createSubscriptions;
|
|
55
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
19
|
+
get subscriptions(): Subscriptions;
|
|
56
20
|
}
|
|
@@ -2,149 +2,16 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
-
};
|
|
50
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
6
|
exports.Notifications = void 0;
|
|
52
|
-
const
|
|
53
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
54
|
-
const KardApi = __importStar(require("../../../index.js"));
|
|
55
|
-
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
-
const errors = __importStar(require("../../../../errors/index.js"));
|
|
7
|
+
const Client_js_1 = require("../resources/subscriptions/client/Client.js");
|
|
57
8
|
class Notifications {
|
|
58
9
|
constructor(_options) {
|
|
59
10
|
this._options = _options;
|
|
60
11
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
* @param {KardApi.OrganizationId} organizationId
|
|
66
|
-
* @param {KardApi.SubscriptionRequestBody} request
|
|
67
|
-
* @param {Notifications.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
|
-
*
|
|
69
|
-
* @throws {@link KardApi.UnauthorizedError}
|
|
70
|
-
* @throws {@link KardApi.InternalServerError}
|
|
71
|
-
* @throws {@link KardApi.InvalidRequest}
|
|
72
|
-
* @throws {@link KardApi.ConflictError}
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* await client.notifications.createSubscriptions("organization-123", {
|
|
76
|
-
* data: [{
|
|
77
|
-
* type: "subscription",
|
|
78
|
-
* attributes: {
|
|
79
|
-
* eventName: "earnedRewardApproved",
|
|
80
|
-
* webhookUrl: "https://webhookUrl.com/post",
|
|
81
|
-
* enabled: true
|
|
82
|
-
* }
|
|
83
|
-
* }]
|
|
84
|
-
* })
|
|
85
|
-
*/
|
|
86
|
-
createSubscriptions(organizationId, request, requestOptions) {
|
|
87
|
-
return core.HttpResponsePromise.fromPromise(this.__createSubscriptions(organizationId, request, requestOptions));
|
|
88
|
-
}
|
|
89
|
-
__createSubscriptions(organizationId, request, requestOptions) {
|
|
90
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
var _a, _b;
|
|
92
|
-
const _response = yield core.fetcher({
|
|
93
|
-
url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.KardApiEnvironment.Production, `/v2/issuers/${encodeURIComponent(organizationId)}/subscriptions`),
|
|
94
|
-
method: "POST",
|
|
95
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@kard-financial/sdk", "X-Fern-SDK-Version": "0.0.1", "User-Agent": "@kard-financial/sdk/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
96
|
-
contentType: "application/json",
|
|
97
|
-
requestType: "json",
|
|
98
|
-
body: request,
|
|
99
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
100
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
101
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
-
});
|
|
103
|
-
if (_response.ok) {
|
|
104
|
-
return {
|
|
105
|
-
data: _response.body,
|
|
106
|
-
rawResponse: _response.rawResponse,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
if (_response.error.reason === "status-code") {
|
|
110
|
-
switch (_response.error.statusCode) {
|
|
111
|
-
case 401:
|
|
112
|
-
throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
113
|
-
case 500:
|
|
114
|
-
throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
115
|
-
case 400:
|
|
116
|
-
throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
|
|
117
|
-
case 409:
|
|
118
|
-
throw new KardApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
119
|
-
default:
|
|
120
|
-
throw new errors.KardApiError({
|
|
121
|
-
statusCode: _response.error.statusCode,
|
|
122
|
-
body: _response.error.body,
|
|
123
|
-
rawResponse: _response.rawResponse,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
switch (_response.error.reason) {
|
|
128
|
-
case "non-json":
|
|
129
|
-
throw new errors.KardApiError({
|
|
130
|
-
statusCode: _response.error.statusCode,
|
|
131
|
-
body: _response.error.rawBody,
|
|
132
|
-
rawResponse: _response.rawResponse,
|
|
133
|
-
});
|
|
134
|
-
case "timeout":
|
|
135
|
-
throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/subscriptions.");
|
|
136
|
-
case "unknown":
|
|
137
|
-
throw new errors.KardApiError({
|
|
138
|
-
message: _response.error.errorMessage,
|
|
139
|
-
rawResponse: _response.rawResponse,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
_getAuthorizationHeader() {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
147
|
-
});
|
|
12
|
+
get subscriptions() {
|
|
13
|
+
var _a;
|
|
14
|
+
return ((_a = this._subscriptions) !== null && _a !== void 0 ? _a : (this._subscriptions = new Client_js_1.Subscriptions(this._options)));
|
|
148
15
|
}
|
|
149
16
|
}
|
|
150
17
|
exports.Notifications = Notifications;
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types/index.js"), exports);
|
|
18
|
+
__exportStar(require("./resources/index.js"), exports);
|
|
18
19
|
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.subscriptions = void 0;
|
|
40
|
+
exports.subscriptions = __importStar(require("./subscriptions/index.js"));
|
|
41
|
+
__exportStar(require("./subscriptions/types/index.js"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../../../core/index.js";
|
|
6
|
+
import * as KardApi from "../../../../../index.js";
|
|
7
|
+
export declare namespace Subscriptions {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.KardApiEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
token: core.Supplier<core.BearerToken>;
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions {
|
|
15
|
+
/** The maximum time to wait for a response in seconds. */
|
|
16
|
+
timeoutInSeconds?: number;
|
|
17
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
|
+
maxRetries?: number;
|
|
19
|
+
/** A hook to abort the request. */
|
|
20
|
+
abortSignal?: AbortSignal;
|
|
21
|
+
/** Additional headers to include in the request. */
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export declare class Subscriptions {
|
|
26
|
+
protected readonly _options: Subscriptions.Options;
|
|
27
|
+
constructor(_options: Subscriptions.Options);
|
|
28
|
+
/**
|
|
29
|
+
* Call this endpoint to subscribe to notification events.<br/>
|
|
30
|
+
* <b>Required scopes:</b> `notifications:write`
|
|
31
|
+
*
|
|
32
|
+
* @param {KardApi.OrganizationId} organizationId
|
|
33
|
+
* @param {KardApi.notifications.SubscriptionRequestBody} request
|
|
34
|
+
* @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link KardApi.UnauthorizedError}
|
|
37
|
+
* @throws {@link KardApi.InternalServerError}
|
|
38
|
+
* @throws {@link KardApi.InvalidRequest}
|
|
39
|
+
* @throws {@link KardApi.ConflictError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.notifications.subscriptions.create("organization-123", {
|
|
43
|
+
* data: [{
|
|
44
|
+
* type: "subscription",
|
|
45
|
+
* attributes: {
|
|
46
|
+
* eventName: "earnedRewardApproved",
|
|
47
|
+
* webhookUrl: "https://webhookUrl.com/post",
|
|
48
|
+
* enabled: true
|
|
49
|
+
* }
|
|
50
|
+
* }]
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
create(organizationId: KardApi.OrganizationId, request: KardApi.notifications.SubscriptionRequestBody, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<KardApi.notifications.CreateSubscriptionsResponseObject>;
|
|
54
|
+
private __create;
|
|
55
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
56
|
+
}
|