@voucherify/sdk 2.2.2 → 2.2.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @voucherify/sdk
2
2
 
3
+ ## 2.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2899ae6`](https://github.com/voucherifyio/voucherify-js-sdk/commit/2899ae6a1044388f4a5426ef22b8b52e00b747a4) [#214](https://github.com/voucherifyio/voucherify-js-sdk/pull/214) Thanks [@darekg11](https://github.com/darekg11)! - Added 'metadata' property to 'order' object in 'ValidationsValidateVoucherResponse' inteface. Added 'session' property to 'ValidationsValidateVoucherResponse' interface
8
+
9
+ ## 2.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`312d4a8`](https://github.com/voucherifyio/voucherify-js-sdk/commit/312d4a891a9b5da7543aff1ae3294961043efb92) [#205](https://github.com/voucherifyio/voucherify-js-sdk/pull/205) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Added support for get promotion tier endpoint
14
+
3
15
  ## 2.2.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -494,6 +494,14 @@ client.promotions.tiers.list(promotionCampaignId)
494
494
 
495
495
  Check [promotion's tier object](https://docs.voucherify.io/reference/the-promotion-object)
496
496
 
497
+ #### [Get Promotion Tier](https://docs.voucherify.io/reference/get-promotion-tier)
498
+
499
+ ```javascript
500
+ client.promotions.tiers.get(tierId)
501
+ ```
502
+
503
+ Check [promotion's tier object](https://docs.voucherify.io/reference/the-promotion-object)
504
+
497
505
  #### [List All Promotion Tiers](https://docs.voucherify.io/reference/list-promotion-tiers)
498
506
 
499
507
  ```javascript
@@ -11,6 +11,10 @@ export declare class PromotionTiers {
11
11
  * @see https://docs.voucherify.io/reference/get-promotions
12
12
  */
13
13
  list(promotionId: string): Promise<T.PromotionTiersListAllResponse>;
14
+ /**
15
+ * @see https://docs.voucherify.io/reference/get-promotion-tier
16
+ */
17
+ get(tierId: string): Promise<T.PromotionTier>;
14
18
  /**
15
19
  * @see https://docs.voucherify.io/reference/add-promotion-tier-to-campaign
16
20
  */
@@ -46,6 +46,7 @@ export interface PromotionTiersListAllResponse {
46
46
  has_more: boolean;
47
47
  }
48
48
  export declare type PromotionTiersListResponse = PromotionTiersListAllResponse;
49
+ export declare type PromotionTierGetResponse = PromotionTier;
49
50
  export interface PromotionTiersCreateParams {
50
51
  name?: string;
51
52
  banner?: string;
@@ -57,7 +57,9 @@ export interface ValidationsValidateVoucherResponse {
57
57
  initial_amount?: number;
58
58
  items_discount_amount?: number;
59
59
  items_applied_discount_amount?: number;
60
+ metadata?: Record<string, any>;
60
61
  };
62
+ session?: ValidationSessionParams;
61
63
  start_date?: string;
62
64
  expiration_date?: string;
63
65
  tracking_id: string;
@@ -671,6 +671,14 @@ class PromotionTiers {
671
671
  list(promotionId) {
672
672
  return this.client.get(`/promotions/${encode(promotionId)}/tiers`);
673
673
  }
674
+ /**
675
+ * @see https://docs.voucherify.io/reference/get-promotion-tier
676
+ */
677
+
678
+
679
+ get(tierId) {
680
+ return this.client.get(`/promotions/tiers/${encode(tierId)}`);
681
+ }
674
682
  /**
675
683
  * @see https://docs.voucherify.io/reference/add-promotion-tier-to-campaign
676
684
  */
@@ -1449,7 +1457,7 @@ function VoucherifyServerSide(options) {
1449
1457
  let headers = {
1450
1458
  'X-App-Id': options.applicationId,
1451
1459
  'X-App-Token': options.secretKey,
1452
- 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.2.2"}`,
1460
+ 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.2.4"}`,
1453
1461
  'Content-Type': 'application/json'
1454
1462
  };
1455
1463
 
@@ -1699,7 +1707,7 @@ function VoucherifyClientSide(options) {
1699
1707
  let headers = {
1700
1708
  'X-Client-Application-Id': options.clientApplicationId,
1701
1709
  'X-Client-Token': options.clientSecretKey,
1702
- 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.2.2"}`
1710
+ 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.2.4"}`
1703
1711
  };
1704
1712
 
1705
1713
  if (environment().startsWith('Node')) {