Skip to content

Latest commit

 

History

History
631 lines (403 loc) · 43.9 KB

CHANGELOG.md

File metadata and controls

631 lines (403 loc) · 43.9 KB

@voucherify/sdk

2.7.4

Patch Changes

2.7.3

Patch Changes

  • d532cc4 #270 Thanks @p-zielinski! - Type support for partial redemptions. General update to responses of /validations and /redemptions endpoints.

2.7.2

Patch Changes

2.7.1

Patch Changes

  • 25c3f13 #260 Thanks @jkaliszuk! - Added error object in VoucherifyError. Added validation_rules in VouchersCreateParameters.

2.7.0

Minor Changes

  • 8df2fed #254 Thanks @p-zielinski! - Add support for few endpoints of Loyalties API.
    • Added support for new endpoints: POST /v1/qualifications, POST /client/v1/qualifications (examples of usage available in readme.md)
    • New exported types/interfaces: InapplicableTo, Referrer, ReferrerWithSummaryLoyaltyReferrals, Customer, CustomerWithSummaryLoyaltyReferrals, CustomerSummary, CustomerSummaryRedemptions, CustomerSummaryOrders, CustomerLoyalty, CustomerReferrals, Discount, DiscountAmount_, DiscountUnit_, DiscountUnitBase_, DiscountUnitMultiple_, DiscountPercent_, DiscountFixed_, Order, OrderItem, OrderCalculated, OrderRedemptions, OrderItemCalculated, QualificationsCheckEligibilityRequestBody, QualificationsCheckEligibilityResponseBody, QualificationsFiltersFields, QualificationsFiltersCondition, QualificationsFieldConditions, QualificationsRedeemablesResponse, QualificationsStackingRulesResponse, QualificationsRedeemable, QualificationsRedeemableBase, RedeemableSingleResultResponse, ValidationRulesAssignmentsList,
    • Added optional properties to ApplicableTo: product_id, product_source_id, quantity_limit, aggregated_quantity_limit, amount_limit, aggregated_amount_limit, order_item_indices
    • Added required property: data_ref: 'data' to ApplicableToResultList // NOTE: as this type is only used in responses, this is not a breaking change.
    • Added optional properties to CustomerRequest: birthday and birthdate

2.6.0

Minor Changes

  • 8a3bead #252 Thanks @p-zielinski! - Added support for new endpoints and adding missing types in Rewards API.

    Added support for new endpoints:

    • /loyalties/{campaignId}/rewards/{assignmentId},
    • /loyalties/{campaignId}/tiers/{tierId}/rewards,
    • /rewards/{rewardId}/assignments/{assignmentId} (example available in readme.md)

    New exported types/interfaces in Loyalties.ts: Domain types:

    • LoyaltyTierRewardItemParameters,
    • LoyaltyTierRewardItemCampaignParameters,
    • LoyaltyTierRewardItemCoinParameters,
    • LoyaltyTierRewardItemMaterialParameters,
    • LoyaltyTierRewardItemCampaignDiscountCoupons,
    • LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram

    0-level types:

    • LoyaltiesGetRewardAssignmentResponseBody,
    • LoyaltiesListLoyaltyTierRewardsResponseBody

    New exported types/interfaces in Rewards.ts: Domain types:

    • RewardAssignment (old RewardsAssignmentObject),
    • RewardsAssignmentCampaignOrMaterialReward,
    • RewardsAssignmentCoinReward

    0-level types:

    • RewardsListAssignmentsRequestQuery (old RewardsListAssignmentsParams),
    • RewardsListAssignmentsResponseBody (old RewardsListAssignmentsResponse),
    • RewardsCreateAssignmentRequestBody (old RewardsCreateAssignment),
    • RewardsCreateAssignmentCoinRewardRequestBody,
    • RewardsCreateAssignmentCampaignOrMaterialRewardRequestBody,
    • RewardsCreateAssignmentResponseBody (old RewardsCreateAssignmentResponse),
    • RewardsUpdateAssignmentRequestBody (old RewardsUpdateAssignment),
    • RewardsUpdateAssignmentResponseBody (old RewardsUpdateAssignmentResponse)
    • RewardsGetAssignmentResponseBody (brand new)

    Added support for following endpoints:

    • GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))
    • POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))
    • GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))

    New exported types/interfaces Domain types:

    • GiftCardTransaction
    • GiftCardTransactionBase GiftCardTransactionDetails
    • GiftCardTransactionRedemptionDetails
    • GiftCardTransactionRefundDetails
    • GiftCardTransactionAdditionDetails
    • GiftCardTransactionRemovalDetails
    • VoucherTransaction
    • VoucherTransactionsExportFields
    • ValidationRulesAssignment

    0-level types:

    • VouchersListTransactionsRequestQuery
    • VouchersListTransactionsResponseBody
    • VouchersExportTransactionsRequestBody
    • VouchersExportTransactionsResponseBody
    • ValidationRulesListRulesAssignmentsRequestQuery
    • ValidationRulesListRulesAssignmentsResponseBody

    Other changes

    • Use VouchersExportTransactionsRequestBody as LoyaltiesExportCardTransactionsRequestBody (these types are identical, both related to the export of loyalty card transactions)
    • Use VouchersExportTransactionsResponseBody as LoyaltiesExportCardTransactionsResponseBody (these types are identical, both related to the export of loyalty card transactions)

    New exported types/interfaces in Categories.ts:

    • CategoriesListRequestQuery

    Added support for query parameters(CategoriesListRequestQuery) in /categories (categories.list method)


    Add support for few endpoints of Loyalties API:

    • Added support for new endpoints: GET /promotions/{campaignId}/stacks, GET /promotions/{campaignId}/stacks, GET PUT DELETE /promotions/{campaignId}/stacks/{stackId}, GET /promotions/stacks (examples of usage available in readme.md)
    • New exported types/interfaces: PromotionsStacksListInCampaignResponseBody, PromotionsStacksListResponseBody, PromotionsStacksListRequestQuery, PromotionsStacksGetResponseBody, PromotionsStacksUpdateRequestBody, PromotionsStacksUpdateResponseBody, PromotionsStacksCreateInCampaignRequestBody, PromotionsStacksCreateInCampaignResponseBody, PromotionStackBase, PromotionStack

2.5.0

Minor Changes

  • c33499d #246 Thanks @p-zielinski! - Add support for few endpoints of Loyalties API.
    • Added support for new endpoints: GET /loyalties/{campaignId}/reward-assignments/{assignmentId}, GET /loyalties/{campaignId}/reward-assignments/{assignmentId}/reward, GET /loyalties/{campaignId}/tiers, GET /loyalties/{campaignId}/tiers/{tierId}, POST /loyalties/{campaignId}/tiers, GET /loyalties/{campaignId}/tiers/{tierId}/earning-rules, GET /loyalties/members/{memberId}/tiers (examples of usage available in readme.md)
    • New exported types/interfaces: LoyaltiesGetRewardAssignmentResponseBody, LoyaltiesGetRewardDetailsResponseBody, LoyaltiesListTiersRequestQuery, LoyaltiesListLoyaltyTierEarningRulesRequestQuery, LoyaltiesGetTierResponseBody, LoyaltiesCreateTiersRequestBody, LoyaltiesCreateTiersResponseBody,LoyaltiesListTiersResponseBody, LoyaltiesListMemberLoyaltyTiersResponseBody, LoyaltiesListLoyaltyTierEarningRulesResponseBody, EarningRule, LoyaltyTier, CreateLoyaltyTier, MappingMultiply,MappingFixed`
  • 2d5b050 #238 Thanks @p-zielinski! - Add support for few endpoints of Loyalties API.
    • Added support for new endpoints: GET /loyalties/members/{memberId}, GET /loyalties/members/{memberId}/activities, GET /loyalties/members/{memberId}/rewards, POST /loyalties/{campaignId}/members/{memberId}/transfers, GET /loyalties/{campaignId}/members/{memberId}/points-expiration, GET /loyalties/members/{memberId}/transactions, GET /loyalties/{campaignId}/members/{memberId}/transactions, POST /loyalties/members/{memberId}/transactions/export and POST /loyalties/{campaignId}/members/{memberId}/transactions/export (examples of usage available in readme.md)
    • New exported types/interfaces: LoyaltiesTransferPointsResponseBody, LoyaltiesTransferPointsRequestBody, LoyaltiesListMemberRewardsRequestQuery, LoyaltiesListMemberRewardsResponseBody, LoyaltiesGetPointsExpirationRequestQuery, LoyaltiesGetPointsExpirationResponseBody, LoyaltiesListCardTransactionsRequestQuery, LoyaltiesListCardTransactionsResponseBody, LoyaltiesExportCardTransactionsRequestBody, LoyaltiesExportCardTransactionsResponseBody, LoyaltiesAddOrRemoveCardBalanceRequestBody, LoyaltiesAddOrRemoveCardBalanceResponseBody, LoyaltyCardTransaction, SimpleLoyaltyVoucher, LoyaltiesTransferPoints, LoyaltyCardTransactionsFields, LoyaltyCardTransactionsType, Reward, RewardTypeCampaign, RewardTypeCoin, RewardTypeMaterial, RewardType, RewardAssignment
  • e135b17 #242 Thanks @weronika-kurczyna! - Added missing methods covering Product Collections API.
    • Added support for new endpoints:
    • GET POST /product-collections,
    • GET DELETE /product-collections/{productCollectionId},
    • GET /product-collections/${productCollectionId}/products (examples of usage available in readme.md)
    • New exported types/interfaces in ProductCollections.ts:
      • Domain types:
        • ProductIdentity
        • SkuIdentity
        • ProductBase
        • SkuBase
        • ProductSaved
        • SkuSaved
        • ProductOrSkuIdentity
        • ProductCollectionIdentity
        • ProductCollectionSaved
        • ProductCollectionBase
        • StaticProductCollectionBase
        • DynamicProductCollectionBase
        • Filter
        • Junction
        • AllowedFiltersKeys
        • FiltersCondition
      • 0-level types:
        • ProductCollectionsCreateRequestBody
        • ProductCollectionsCreateResponseBody
        • ProductCollectionsListRequestQuery
        • ProductCollectionsListResponseBody
        • ProductCollectionsGetResponseBody
        • ProductCollectionsListProductsRequestQuery
        • ProductCollectionsListProductsResponseBody
  • 841b6d5 #244 Thanks @p-zielinski! - Add support for endpoint GET /exports.
    • New exported types/interfaces: ExportsListRequestQuery, ExportsListResponseBody, ExportBase, ExportResourceResponse, FieldConditions, ExportVoucher, ExportVoucherFilters, ExportRedemption, ExportRedemptionFilters, ExportCustomer, ExportCustomerFilters, ExportPublication, ExportPublicationFilters, ExportOrder, ExportOrderFilters, ExportPointsExpiration, ExportPointsExpirationFilters, ExportVoucherTransactionsExpiration, ExportVoucherTransactionsFilters, Junction, FiltersCondition, ExportCustomerFields, ExportCustomerOrder, ExportPublicationFields, ExportPublicationOrder, ExportRedemptionFields, ExportRedemptionOrder, ExportVoucherFields, ExportVoucherOrder, ExportOrderFields, ExportOrderOrder, ExportPointsExpirationFields, ExportPointsExpirationOrder, ExportVoucherTransactionsFields, ExportVoucherTransactionsOrder

2.4.0

Minor Changes

  • b11ce2c #241 Thanks @p-zielinski! - Add support for 3 missing endpoints in loyalties api. Corrected a typo in one of loyalties api method.
    • Added support for new endpoints: GET /loyalties/{campaignId}/earning-rules/{earningRuleId}, POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/enable and POST /loyalties/{campaignId}/earning-rules/{earningRuleId}/disable (examples available in readme.md)
    • New exported types/interfaces: LoyaltiesGetEarningRuleResponseBody, LoyaltiesEnableEarningRulesResponseBody, LoyaltiesDisableEarningRulesResponseBody, EarningRuleEvent, EarningRuleBase, EarningRuleFixed, EarningRuleProportionalOrder, EarningRuleProportionalOrderAmount, EarningRuleProportionalOrderTotalAmount, EarningRuleProportionalOrderMetadata, EarningRuleProportionalOrderItems, EarningRuleProportionalOrderItemsQuantity, EarningRuleProportionalOrderItemsAmount, EarningRuleProportionalOrderItemsSubtotalAmount, EarningRuleProportionalCustomerMetadata, EarningRuleProportionalCustomEvent, EarningRuleProportional
    • Added optional parameter calculation_type to LoyaltyProportional
  • 5bb69da #229 Thanks @marcin-slezak! - Add missing methods covering Customers API.
    • Added support for new endpoints:
    • New domain types:
      • CustomerBase
      • CustomerAddress
    • New exported types/interfaces:
      • CustomersUpdateInBulkRequestBody,
      • CustomersUpdateMetadataInBulkRequestBody,
      • CustomersDeletePermanentlyResponseBody

2.3.0

Minor Changes

  • 7720e31 #228 Thanks @marcin-slezak! - Add missing methods covering Categories and Campaigns API.
    • Added support for new endpoints (examples of usage available in readme.md):
      • POST /campaigns/campaignId/enable,
      • POST /campaigns/campaignId/disable,
      • GET, POST DELETE /categories,
      • GET PUT /categories/id.
    • New exported types/interfaces in Categories.ts:
      • ListCategories,
      • CategoryObject,
      • CreateCategory,
      • ResponseCreateCategory,
      • ResponseUpdateCategory,
      • UpdateCategoryRequest.

2.2.6

Patch Changes

  • a266c2a #223 Thanks @darekg11! - Add optional timeoutMs option to VoucherifyServerSide and VoucherifyClientSide classes defiing timeout in miliseconds after which Axios is going to abort the request. By default this is equal to 0 meaining that there is no timeout beside default Voucherify's Load balancer timeout which is set to 3 minutes

2.2.5

Patch Changes

  • d5751ea #216 Thanks @Davies-Owen! - add amount_off_formula, percent_off_formula, unit_off_formula, and fixed_amount_formula fields to Voucher types: DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed, VoucherDiscount, and StackableRedeemableResultDiscount

2.2.4

Patch Changes

  • 2899ae6 #214 Thanks @darekg11! - Added 'metadata' property to 'order' object in 'ValidationsValidateVoucherResponse' inteface. Added 'session' property to 'ValidationsValidateVoucherResponse' interface

2.2.3

Patch Changes

2.2.2

Patch Changes

2.2.1

Patch Changes

  • e7fab63 #207 Thanks @marcin-slezak! - Added missing DiscountFixed type addressing issue #206. Affected types:
    • type ClientSideValidateResponse related to:
      • response for GET /validate
    • type SimplePromotionTier related to:
      • response GET /promotions/validation
    • type PromotionsCreate related to:
      • params for POST /campaigns
    • type PromotionsValidateResponse related to:
      • response for POST /promotions/validation
    • type VouchersResponse related to:
      • response for POST /redeem
      • response for POST /vouchers/qualification
      • params for POST and PUT /vouchers/${encode(voucher.code)}
      • response for GET /vouchers/${encode(code)}
      • response POST loyalties/{campaignId}/members/{memberId}/redemption
      • response POST /vouchers/${encode(code)}/enable
      • response POST /vouchers/${encode(code)}/disable
    • type VouchersImport related to:
      • params for POST /vouchers/import
    • type PromotionTier related to:
      • response for GET /promotions/tiers
      • response for GET /promotions/${encode(promotionId)}/tiers
      • response for POST /promotions/tiers/${encode(promotionsTierId)}/redemption
      • response for POST /vouchers/${encode(code)}/redemption
    • type PromotionTiersCreateParams related to:
      • params for POST /promotions/${encode(promotionId)}/tiers
    • type ValidationsValidateVoucherResponse related to:
      • response for POST /vouchers/${encode(code)}/validate
    • type SimpleVoucher related to:
      • response GET/PUT/POST /campaigns/${encode(name)}
      • response GET /campaigns
      • params POST /campaigns
      • response POST /campaigns/qualification

2.2.0

Minor Changes

  • 4451288 #203 Thanks @darekg11! - Add 'CampaignsListResponse' type to return value of campaigns.list method

2.1.9

Patch Changes

  • d06989b #198 Thanks @darekg11! - Add missing 'filters' property to 'VouchersListParams' interface to allow for advanced filters for fetching resources

2.1.8

Patch Changes

  • 8e7bf47 #195 Thanks @darekg11! - Add 'active' field to 'PromotionTier' interface. Add 'PromotionTierRedeemDetailsSimple' and 'PromotionTierRedeemDetails' types and reuse them in 'RedemptionsRedeemResponse' so that 'RedemptionsRedeemStackableRedemptionResult' can return promotion_tier property

2.1.7

Patch Changes

  • 92ab4fb #188 Thanks @darekg11! - Add explicit properties to VoucherifyError class to make it easier for TypeScript folks. Added examples of proper error handling for both classical Node.JS and for TypeScript. Examples includes different handling for networking and API errors
  • 48a46b9 #190 Thanks @darekg11! - Add missing 'related_object_ids', 'related_object_type' and 'related_object_total' properties to 'VoucherifyError' class. Those properties are returned fmor API in case of 'resource_in_ise' error

2.1.6

Patch Changes

2.1.5

Patch Changes

  • f87ccb7 #181 Thanks @emreler! - Add 'assets' from VouchersResponse to CampaignsAddVoucherResponse type

2.1.4

Patch Changes

  • 03fc326 #179 Thanks @darekg11! - Add new 'ValidationError' type describing error that can be returned upon unsuccessful validation of single voucher or in case of stacked validations. Add this new interface to 'StackableRedeemableResultResponse' and 'ValidationsValidateVoucherResponse' types

2.1.3

Patch Changes

  • 4c4ccf3 #173 Thanks @darekg11! - Bump qs dependency to 6.9.7 version to fix CVE-2022-24999 / GHSA-hrpp-h998-j3pp

2.1.2

Patch Changes

  • 3e5f2ee #165 Thanks @darekg11! - Bumping libraries to mitigiate some of HIGH and CRITICAL vulnerabilities

2.1.1

Patch Changes

2.1.0

Minor Changes

  • eb0f4b1 #160 Thanks @Irene350! - VoucherType input correct enum value DISCOUNT_VOUCHER and GIFT_VOUCHER

2.0.17

Patch Changes

  • 8bb9bb5 #156 Thanks @Davies-Owen! - add missing created_at property to VouchersResponse, LoyaltiesRedeemRewardResponse, CampaignsAddVoucherResponse, and ClientSideVoucherListing interfaces

2.0.16

Patch Changes

2.0.15

Patch Changes

2.0.14

Patch Changes

  • 98629ca #149 Thanks @darekg11! - Drop not required customer id property when running promotion validation. Add missing proeprties to promotion validation response

2.0.13

Patch Changes

  • ff07c8a #144 Thanks @darekg11! - Add missing 'name', 'start_date' and 'expiration_date' properties to PromotionsValidateResponse interface

2.0.12

Patch Changes

  • df19c77 #141 Thanks @darekg11! - Override SimpleCustomer type to make 'id' property not required in 'RedemptionsRedeemBody' interface since passing ID of customer when redeeming is not required by design

2.0.11

Patch Changes

2.0.10

Patch Changes

2.0.9

Patch Changes

  • e52b787 #131 Thanks @tomek-lochmanczyk-rspective! - Add function which return "Retry-After" header from response. The purpose is to get information how long it's needed to wait until new requests can be made, when api limits are reached. This ddition is backward compatible so no changes are needed to be made in older code

2.0.8

Patch Changes

  • e965f61 #129 Thanks @Irene350! - Adding missing discount amounts on order for validate voucher type response

2.0.7

Patch Changes

2.0.6

Patch Changes

  • f8241b7 #125 Thanks @darekg11! - Added support for metadata-schemas API. Allowing to list all metadata schemas in project or retrieve single one via get method by providing schema name

2.0.5

Patch Changes

  • a7811e7 #121 Thanks @jkaliszuk! - Added logic that allow to storage lastResponseHeaders data and get apiLimit through ApiLimitsHandler

2.0.4

Patch Changes

  • f411c1a #119 Thanks @darekg11! - Added support for stackable API methods - validation, redemptions, rollback for both Server Side and Client Side SDKs. Added some missing fields in already existing types definitions and cleaned up other definitions by reusing interfaces

2.0.3

Patch Changes

2.0.2

Patch Changes

  • b5f04fa #112 Thanks @darekg11! - Query params passed to this.client.post method are now correctly stringified. Added possibility to pass query params to voucherify.promotions.validate method in order to allow developers using SDK to pass advanced filters to restrict possible range of promotion campaigns against which validation should be performed.

2.0.1

Patch Changes

2.0.0

Major Changes

  • c5c8b97 #93 Thanks @awilczek! - Support new async API methods

    Changes:

    • Campaign vouchers import
      • added CampaignsVouchersImportResponse
    • Vouchers import
      • added VouchersImportResponse
    • Vouchers bulkUpdate
      • using new API method
      • BREAKING change of VouchersBulkUpdateResponse
      • BREAKING obligatory 'metadata' field in VouchersBulkUpdateObject
    • Vouchers bulkUpdateMetadata
      • using new API method
      • BREAKING change of VouchersBulkUpdateMetadataResponse
      • BREAKING obligatory 'metadata' field in VouchersBulkUpdateMetadata
    • Products bulkUpdate
    • Products bulkUpdateMetadata
      • using new API method
      • BREAKING change of method name
      • BREAKING change of ProductsBulkUpdateMetadataResponse
    • Products getSku
      • using new API method
      • BREAKING change of method params
      • changed in CR fixes

1.3.1

Patch Changes

  • 8ff9b8d #95 Thanks @pannga! - Version 1.3.0 enabled encoding in RequestController - it was used to fix encoding for both server side and client side SDKs. This introduced issue, as we did not notice that ClientSide get methods were explicitly encoding query params (toQueryParams function). That meant the query params were encoded twice and that lead to issues with characters such as %.

1.3.0

Minor Changes

1.2.0

Minor Changes

  • 0425e2b #88 Thanks @darekg11! - Allow to pass additional headers to requests made to Voucherify API. Custom headers can be passed via 'customHeaders' option available in VoucherifyServerSideOptions and VoucherifyClientSideOptions. Such option might prove to be useful when debugging

1.1.0

Minor Changes

1.0.1

Patch Changes

1.0.0

Major Changes

  • 2a00746 #69 Thanks @pannga! - The first major version combines previously maintained Voucherify Node.js SDK and Voucherify.js. See Migration Guide to see what is changed.

Patch Changes

  • 7c491eb #19 Thanks @pannga! - Distributions types

    • Used FixMe convention for unknown types
    • Added Distributions types
    • Removed deprecated method
    • Updated Distribution types
  • dec48a0 #20 Thanks @pannga! - added missing method for publishing a ceratin voucher to selected campaign

0.0.5

Patch Changes

0.0.4

Patch Changes

  • e3285c5 #10 Thanks @eddyw! - Export missing types

    • export missing type CustomerRequest
    • export missing type CustomersCommonListRequest

0.0.3

Patch Changes

0.0.2

Patch Changes