@voucherify/sdk 2.7.4 → 2.8.0
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 +6 -0
- package/README.md +10 -8
- package/dist/Consents.d.ts +1 -1
- package/dist/Customers.d.ts +6 -2
- package/dist/types/Customers.d.ts +18 -0
- package/dist/types/Validations.d.ts +2 -2
- package/dist/voucherifysdk.esm.js +13 -5
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +13 -5
- 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,11 @@
|
|
|
1
1
|
# @voucherify/sdk
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2ddd6ec`](https://github.com/voucherifyio/voucherify-js-sdk/commit/2ddd6ec688f3dbc35b301e05f0fa5f6d20bdc410) [#277](https://github.com/voucherifyio/voucherify-js-sdk/pull/277) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Added support for `v1/customers/{customerId}/activity` (method `listActivity`) and fix type `ValidationValidateStackableResponse`
|
|
8
|
+
|
|
3
9
|
## 2.7.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -729,13 +729,19 @@ You can optionally define scrolling cursor based on customer creation date using
|
|
|
729
729
|
|
|
730
730
|
Keep in mind this operation may drain your API call limits fairly quickly - each api call fetches 100 customers. So if you have 100.000 customers, you will use 1000 API calls.
|
|
731
731
|
|
|
732
|
-
####
|
|
732
|
+
#### Update Customer's Consents - Deprecated
|
|
733
733
|
|
|
734
734
|
```javascript
|
|
735
735
|
client.customers.updateConsents(customer, consents)
|
|
736
736
|
```
|
|
737
737
|
|
|
738
|
-
#### [List
|
|
738
|
+
#### [List Customer's Activity](https://docs.voucherify.io/reference/list-customer-activity)
|
|
739
|
+
|
|
740
|
+
```javascript
|
|
741
|
+
client.customers.listActivity(customerIdOrSourceId, params)
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
#### List Customers Activities - Deprecated - use listActivity
|
|
739
745
|
|
|
740
746
|
```javascript
|
|
741
747
|
client.customers.listActivities(customerId)
|
|
@@ -768,15 +774,11 @@ client.customers.listRedeemables(id, params)
|
|
|
768
774
|
|
|
769
775
|
---
|
|
770
776
|
|
|
771
|
-
### Consents
|
|
777
|
+
### Consents - Deprecated
|
|
772
778
|
|
|
773
779
|
Methods are provided within `client.consents.*` namespace.
|
|
774
780
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
You can [update Customer's consents](#update-customers-consents) in `client.customer.*` namespace.
|
|
778
|
-
|
|
779
|
-
#### [Get Consents](https://docs.voucherify.io/reference/get-consents)
|
|
781
|
+
#### Get Consents - Deprecated
|
|
780
782
|
|
|
781
783
|
```javascript
|
|
782
784
|
client.consents.list()
|
package/dist/Consents.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class Consents {
|
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: RequestController);
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
8
8
|
*/
|
|
9
9
|
list(): Promise<T.ConsentsListResponse>;
|
|
10
10
|
}
|
package/dist/Customers.d.ts
CHANGED
|
@@ -49,11 +49,15 @@ declare class Customers {
|
|
|
49
49
|
*/
|
|
50
50
|
deletePermanently(customerId: string): Promise<T.CustomersDeletePermanentlyResponseBody>;
|
|
51
51
|
/**
|
|
52
|
-
* @see https://docs.voucherify.io/reference/
|
|
52
|
+
* @see https://docs.voucherify.io/reference/list-customer-activity
|
|
53
|
+
*/
|
|
54
|
+
listActivity(customerIdOrSourceId: string, params?: T.CustomerActivityListQueryParams): Promise<T.CustomerActivityListResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
53
57
|
*/
|
|
54
58
|
updateConsents(idOrSourceId: string, consents: T.CustomersUpdateConsentsBody): Promise<undefined>;
|
|
55
59
|
/**
|
|
56
|
-
* @
|
|
60
|
+
* @deprecated This method is deprecated in favor of the `listActivity` method. We’re removing this method in next major version.
|
|
57
61
|
*/
|
|
58
62
|
listActivities(customerId: string, params?: T.CustomerActivitiesListQueryParams): Promise<T.CustomerActivitiesListResponse>;
|
|
59
63
|
/**
|
|
@@ -97,6 +97,24 @@ export interface CustomersCommonListResponse {
|
|
|
97
97
|
customers: CustomerObject[];
|
|
98
98
|
has_more?: boolean;
|
|
99
99
|
}
|
|
100
|
+
export interface CustomerActivityListQueryParams {
|
|
101
|
+
limit?: number;
|
|
102
|
+
order?: 'created_at' | '-created_at';
|
|
103
|
+
starting_after_id?: string;
|
|
104
|
+
campaign_type?: 'LOYALTY_PROGRAM' | 'PROMOTION' | 'DISCOUNT_COUPONS' | 'GIFT_VOUCHERS' | 'REFERRAL_PROGRAM';
|
|
105
|
+
campaign_id?: string;
|
|
106
|
+
category?: 'ACTION' | 'EFFECT';
|
|
107
|
+
type?: string;
|
|
108
|
+
start_date?: string;
|
|
109
|
+
end_date?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface CustomerActivityListResponse {
|
|
112
|
+
object: 'list';
|
|
113
|
+
data_ref: 'data';
|
|
114
|
+
data: Record<string, unknown>[];
|
|
115
|
+
has_more: boolean;
|
|
116
|
+
more_starting_after?: string;
|
|
117
|
+
}
|
|
100
118
|
export interface CustomerActivitiesListQueryParams {
|
|
101
119
|
limit?: number;
|
|
102
120
|
order?: 'created_at' | '-created_at';
|
|
@@ -79,8 +79,8 @@ export interface ValidationValidateStackableResponse {
|
|
|
79
79
|
session?: ValidationSessionResponse;
|
|
80
80
|
order?: OrdersCreateResponse;
|
|
81
81
|
redeemables?: StackableRedeemableResponse[];
|
|
82
|
-
skipped_redeemables?: StackableRedeemableSkippedResponse;
|
|
83
|
-
inapplicable_redeemables?: StackableRedeemableInapplicableResponse;
|
|
82
|
+
skipped_redeemables?: StackableRedeemableSkippedResponse[];
|
|
83
|
+
inapplicable_redeemables?: StackableRedeemableInapplicableResponse[];
|
|
84
84
|
stacking_rules: ValidationsStackingRules;
|
|
85
85
|
}
|
|
86
86
|
export declare type ValidationsStackingRules = {
|
|
@@ -942,7 +942,15 @@ class Customers {
|
|
|
942
942
|
return this.client.post(`/customers/${encode(customerId)}/permanent-deletion`, {});
|
|
943
943
|
}
|
|
944
944
|
/**
|
|
945
|
-
* @see https://docs.voucherify.io/reference/
|
|
945
|
+
* @see https://docs.voucherify.io/reference/list-customer-activity
|
|
946
|
+
*/
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
listActivity(customerIdOrSourceId, params) {
|
|
950
|
+
return this.client.get(`/customers/${encode(customerIdOrSourceId)}/activity`, params);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
946
954
|
*/
|
|
947
955
|
|
|
948
956
|
|
|
@@ -950,7 +958,7 @@ class Customers {
|
|
|
950
958
|
return this.client.put(`/customers/${encode(idOrSourceId)}/consents`, consents);
|
|
951
959
|
}
|
|
952
960
|
/**
|
|
953
|
-
* @
|
|
961
|
+
* @deprecated This method is deprecated in favor of the `listActivity` method. We’re removing this method in next major version.
|
|
954
962
|
*/
|
|
955
963
|
|
|
956
964
|
|
|
@@ -990,7 +998,7 @@ class Consents {
|
|
|
990
998
|
this.client = client;
|
|
991
999
|
}
|
|
992
1000
|
/**
|
|
993
|
-
* @
|
|
1001
|
+
* @deprecated This method is deprecated. We’re removing this method in next major version.
|
|
994
1002
|
*/
|
|
995
1003
|
|
|
996
1004
|
|
|
@@ -1952,7 +1960,7 @@ function VoucherifyServerSide(options) {
|
|
|
1952
1960
|
let headers = {
|
|
1953
1961
|
'X-App-Id': options.applicationId,
|
|
1954
1962
|
'X-App-Token': options.secretKey,
|
|
1955
|
-
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.
|
|
1963
|
+
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.8.0"}`,
|
|
1956
1964
|
'Content-Type': 'application/json'
|
|
1957
1965
|
};
|
|
1958
1966
|
|
|
@@ -2218,7 +2226,7 @@ function VoucherifyClientSide(options) {
|
|
|
2218
2226
|
let headers = {
|
|
2219
2227
|
'X-Client-Application-Id': options.clientApplicationId,
|
|
2220
2228
|
'X-Client-Token': options.clientSecretKey,
|
|
2221
|
-
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.
|
|
2229
|
+
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.8.0"}`
|
|
2222
2230
|
};
|
|
2223
2231
|
|
|
2224
2232
|
if (environment().startsWith('Node')) {
|