@voucherify/sdk 2.2.1 → 2.2.3
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 +12 -0
- package/README.md +8 -0
- package/dist/PromotionTiers.d.ts +4 -0
- package/dist/types/Orders.d.ts +2 -2
- package/dist/types/PromotionTiers.d.ts +2 -1
- package/dist/voucherifysdk.esm.js +10 -2
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +10 -2
- package/dist/voucherifysdk.umd.development.js.map +1 -1
- package/dist/voucherifysdk.umd.production.min.js +1 -1
- package/dist/voucherifysdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @voucherify/sdk
|
|
2
2
|
|
|
3
|
+
## 2.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`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
|
|
8
|
+
|
|
9
|
+
## 2.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`dd1601d`](https://github.com/voucherifyio/voucherify-js-sdk/commit/dd1601d1f3f0651433f20cf2067d96bc1f5164dc) [#209](https://github.com/voucherifyio/voucherify-js-sdk/pull/209) Thanks [@ateev](https://github.com/ateev)! - Fixed minor typos in types for Order
|
|
14
|
+
|
|
3
15
|
## 2.2.1
|
|
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
|
package/dist/PromotionTiers.d.ts
CHANGED
|
@@ -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
|
*/
|
package/dist/types/Orders.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface OrdersItem {
|
|
|
33
33
|
}
|
|
34
34
|
export interface OrdersCreate {
|
|
35
35
|
source_id?: string;
|
|
36
|
-
status?: 'CREATED' | 'PAID' | '
|
|
36
|
+
status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
|
|
37
37
|
customer?: CustomerRequest;
|
|
38
38
|
amount?: number;
|
|
39
39
|
discount_amount?: number;
|
|
@@ -64,7 +64,7 @@ export declare type OrdersGetResponse = OrdersCreateResponse;
|
|
|
64
64
|
export interface OrdersUpdate {
|
|
65
65
|
id: string;
|
|
66
66
|
source_id?: string;
|
|
67
|
-
status?: 'CREATED' | 'PAID' | '
|
|
67
|
+
status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
|
|
68
68
|
items?: OrdersItem[];
|
|
69
69
|
amount?: number;
|
|
70
70
|
discount_amount?: number;
|
|
@@ -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;
|
|
@@ -64,7 +65,7 @@ export interface PromotionTiersRedeemParams {
|
|
|
64
65
|
source_id?: string;
|
|
65
66
|
amount?: number;
|
|
66
67
|
items?: OrdersItem[];
|
|
67
|
-
status?: 'CREATED' | 'PAID' | '
|
|
68
|
+
status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
|
|
68
69
|
metadata?: Record<string, any>;
|
|
69
70
|
};
|
|
70
71
|
metadata?: Record<string, any>;
|
|
@@ -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.
|
|
1460
|
+
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.2.3"}`,
|
|
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.
|
|
1710
|
+
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.2.3"}`
|
|
1703
1711
|
};
|
|
1704
1712
|
|
|
1705
1713
|
if (environment().startsWith('Node')) {
|