@voucherify/sdk 2.9.0 → 2.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @voucherify/sdk
2
2
 
3
+ ## 2.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fe14c58`](https://github.com/voucherifyio/voucherify-js-sdk/commit/fe14c5857f6db5d8b7ebc1f48ffbc07ed5902122) [#291](https://github.com/voucherifyio/voucherify-js-sdk/pull/291) Thanks [@patryksmolarz](https://github.com/patryksmolarz)! - Missing parameters in Add voucher balance endpoint.
8
+
9
+ ## 2.9.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`2378764`](https://github.com/voucherifyio/voucherify-js-sdk/commit/23787647c22b31d5ca00908100d941ed27b1cea6) [#288](https://github.com/voucherifyio/voucherify-js-sdk/pull/288) Thanks [@awilczek](https://github.com/awilczek)! - Upgrade axios (CVE)
14
+
15
+ * [`8c843a8`](https://github.com/voucherifyio/voucherify-js-sdk/commit/8c843a82eb8720dc68f9c49baf02ebda1d24999f) [#286](https://github.com/voucherifyio/voucherify-js-sdk/pull/286) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Added missing type properties in voucher.loyalty_card - for example for requesting voucher/loyalty member
16
+
3
17
  ## 2.9.0
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -1745,7 +1745,7 @@ Check our [MIGRATION GUIDE](./MIGRATION.md) to learn more about switching to our
1745
1745
 
1746
1746
  Voucherify JS SDK includes TypeScript declarations for our latest API. We recommend using TypeScript Version 4.2.
1747
1747
 
1748
- You can find TS example in [examples/with-nodejs-typescript](/examples/with-nodejs).
1748
+ Explore also [Voucherify TS examples](../../examples/sdk/with-nodejs-typescript "TypeScript examples").
1749
1749
 
1750
1750
  # <a name="error-handling"></a>😨 Error handling
1751
1751
 
@@ -1,5 +1,7 @@
1
1
  export interface BalanceCreateParams {
2
2
  amount: number;
3
+ source_id?: string;
4
+ reason?: string;
3
5
  }
4
6
  export interface BalanceCreateResponse {
5
7
  amount: number;
@@ -236,6 +236,8 @@ export interface LoyaltiesVoucherResponse {
236
236
  loyalty_card: {
237
237
  points: number;
238
238
  balance: number;
239
+ next_expiration_date?: string;
240
+ next_expiration_points?: number;
239
241
  };
240
242
  start_date?: string;
241
243
  expiration_date?: string;
@@ -143,7 +143,7 @@ export declare type OrderCalculated = {
143
143
  items_applied_discount_amount?: number;
144
144
  total_applied_discount_amount?: number;
145
145
  items?: OrderItemCalculated[];
146
- metadata: Record<string, unknown>;
146
+ metadata?: Record<string, unknown>;
147
147
  customer?: CustomerId | CustomerWithSummaryLoyaltyReferrals;
148
148
  customer_id: string | null;
149
149
  referrer?: ReferrerId | ReferrerWithSummaryLoyaltyReferrals;
@@ -35,6 +35,9 @@ export interface VouchersResponse {
35
35
  };
36
36
  loyalty_card?: {
37
37
  points: number;
38
+ balance: number;
39
+ next_expiration_date?: string;
40
+ next_expiration_points?: number;
38
41
  };
39
42
  start_date?: string;
40
43
  expiration_date?: string;
@@ -81,6 +81,7 @@ class RequestController {
81
81
  this.timeoutMs = timeoutMs;
82
82
  this.request = axios.create({
83
83
  baseURL: `${this.baseURL}/${this.basePath}/`,
84
+ allowAbsoluteUrls: false,
84
85
  headers: this.headers,
85
86
  responseType: 'json'
86
87
  });
@@ -1968,7 +1969,7 @@ function VoucherifyServerSide(options) {
1968
1969
  let headers = {
1969
1970
  'X-App-Id': options.applicationId,
1970
1971
  'X-App-Token': options.secretKey,
1971
- 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.9.0"}`,
1972
+ 'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.9.2"}`,
1972
1973
  'Content-Type': 'application/json'
1973
1974
  };
1974
1975
 
@@ -2234,7 +2235,7 @@ function VoucherifyClientSide(options) {
2234
2235
  let headers = {
2235
2236
  'X-Client-Application-Id': options.clientApplicationId,
2236
2237
  'X-Client-Token': options.clientSecretKey,
2237
- 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.9.0"}`
2238
+ 'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.9.2"}`
2238
2239
  };
2239
2240
 
2240
2241
  if (environment().startsWith('Node')) {