@voucherify/sdk 2.2.4 → 2.2.5

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,11 @@
1
1
  # @voucherify/sdk
2
2
 
3
+ ## 2.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d5751ea`](https://github.com/voucherifyio/voucherify-js-sdk/commit/d5751ea57c46f32275c4630bd4d2b6d41f3506b2) [#216](https://github.com/voucherifyio/voucherify-js-sdk/pull/216) Thanks [@Davies-Owen](https://github.com/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
8
+
3
9
  ## 2.2.4
4
10
 
5
11
  ### Patch Changes
@@ -23,6 +23,7 @@ interface SimpleProductDiscountUnit {
23
23
  export interface DiscountUnit {
24
24
  type?: DiscountVouchersTypesEnum.UNIT;
25
25
  unit_off?: number;
26
+ unit_off_formula?: string;
26
27
  effect?: DiscountUnitVouchersEffectTypes;
27
28
  unit_type?: string;
28
29
  product?: SimpleProductDiscountUnit;
@@ -31,17 +32,20 @@ export interface DiscountUnit {
31
32
  export interface DiscountAmount {
32
33
  type?: DiscountVouchersTypesEnum.AMOUNT;
33
34
  amount_off?: number;
35
+ amount_off_formula?: string;
34
36
  effect?: DiscountAmountVouchersEffectTypes;
35
37
  }
36
38
  export interface DiscountPercent {
37
39
  type?: DiscountVouchersTypesEnum.PERCENT;
38
40
  percent_off?: number;
41
+ percent_off_formula?: string;
39
42
  amount_limit?: number;
40
43
  effect?: DiscountPercentVouchersEffectTypes;
41
44
  }
42
45
  export interface DiscountFixed {
43
46
  type?: DiscountVouchersTypesEnum.FIXED;
44
47
  fixed_amount?: number;
48
+ fixed_amount_formula?: string;
45
49
  effect?: DiscountFixedVouchersEffectTypes;
46
50
  }
47
51
  export {};
@@ -4,9 +4,12 @@ declare type OrderType = 'id' | '-id' | 'voucher_code' | '-voucher_code' | 'trac
4
4
  export interface VoucherDiscount {
5
5
  type: 'UNIT' | 'AMOUNT' | 'DISCOUNT';
6
6
  unit_off?: number;
7
+ unit_off_formula?: string;
7
8
  effect?: string;
8
9
  amount_off?: number;
10
+ amount_off_formula?: string;
9
11
  percent_off?: number;
12
+ percent_off_formula?: string;
10
13
  amount_limit?: number;
11
14
  }
12
15
  interface DistributionsPublicationsVoucher {
@@ -29,10 +29,14 @@ export interface StackableRedeemableResultDiscount {
29
29
  type: DiscountVouchersTypes;
30
30
  effect: DiscountVouchersEffectTypes;
31
31
  amount_off?: number;
32
+ amount_off_formula?: string;
32
33
  percent_off?: number;
34
+ percent_off_formula?: string;
33
35
  amount_limit?: number;
34
36
  fixed_amount?: number;
37
+ fixed_amount_formula?: string;
35
38
  unit_off?: number;
39
+ unit_off_formula?: string;
36
40
  unit_type?: string;
37
41
  sku?: SimpleSku;
38
42
  product?: SimpleProduct;
@@ -1457,7 +1457,7 @@ function VoucherifyServerSide(options) {
1457
1457
  let headers = {
1458
1458
  'X-App-Id': options.applicationId,
1459
1459
  'X-App-Token': options.secretKey,
1460
- 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.2.4"}`,
1460
+ 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.2.5"}`,
1461
1461
  'Content-Type': 'application/json'
1462
1462
  };
1463
1463
 
@@ -1707,7 +1707,7 @@ function VoucherifyClientSide(options) {
1707
1707
  let headers = {
1708
1708
  'X-Client-Application-Id': options.clientApplicationId,
1709
1709
  'X-Client-Token': options.clientSecretKey,
1710
- 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.2.4"}`
1710
+ 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.2.5"}`
1711
1711
  };
1712
1712
 
1713
1713
  if (environment().startsWith('Node')) {