@voucherify/sdk 2.8.0 → 2.9.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 +12 -0
- package/dist/Loyalties.d.ts +6 -2
- package/dist/types/Loyalties.d.ts +25 -10
- package/dist/types/ProductCollections.d.ts +4 -3
- package/dist/types/Vouchers.d.ts +6 -0
- package/dist/voucherifysdk.esm.js +12 -4
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +12 -4
- 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.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`deb0b79`](https://github.com/voucherifyio/voucherify-js-sdk/commit/deb0b79b0e3da2ec5ad9457ba505ec2818f06347) [#282](https://github.com/voucherifyio/voucherify-js-sdk/pull/282) Thanks [@p-zielinski](https://github.com/p-zielinski)! - Support for new endpoints: List Member Activity
|
|
8
|
+
|
|
9
|
+
## 2.8.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a9ba013`](https://github.com/voucherifyio/voucherify-js-sdk/commit/a9ba013062c560a3a663b1f219f2dcb7ae9a8a7e) [#280](https://github.com/voucherifyio/voucherify-js-sdk/pull/280) Thanks [@p-zielinski](https://github.com/p-zielinski)! - TS fixes (VouchersListTransactionsRequestQuery, LoyaltiesListCardTransactionsRequestQuery, ProductCollectionsCreateRequestBody) - backwards compatible
|
|
14
|
+
|
|
3
15
|
## 2.8.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/Loyalties.d.ts
CHANGED
|
@@ -85,8 +85,12 @@ export declare class Loyalties {
|
|
|
85
85
|
*/
|
|
86
86
|
getMember(campaignId: string | null, memberId: string): Promise<T.LoyaltiesVoucherResponse>;
|
|
87
87
|
/**
|
|
88
|
-
* @see https://docs.voucherify.io/reference/
|
|
89
|
-
* @see https://docs.voucherify.io/reference/
|
|
88
|
+
* @see https://docs.voucherify.io/reference/list-member-activity
|
|
89
|
+
* @see https://docs.voucherify.io/reference/list-member-activity-1
|
|
90
|
+
*/
|
|
91
|
+
listMemberActivity(campaignId: string | null, memberId: string, params?: T.LoyaltiesListMemberActivityParams): Promise<T.LoyaltiesListMemberActivityResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated This method is deprecated in favor of the `listMemberActivity` method. We’re removing this method in next major version.
|
|
90
94
|
*/
|
|
91
95
|
getMemberActivities(campaignId: string | null, memberId: string): Promise<T.LoyaltiesGetMemberActivitiesResponse>;
|
|
92
96
|
/**
|
|
@@ -282,6 +282,24 @@ export interface LoyaltiesCreateMember {
|
|
|
282
282
|
}
|
|
283
283
|
export declare type LoyaltiesCreateMemberResponse = LoyaltiesVoucherResponse;
|
|
284
284
|
export declare type LoyaltiesGetMemberResponse = LoyaltiesCreateMemberResponse;
|
|
285
|
+
export declare type LoyaltiesListMemberActivityParams = {
|
|
286
|
+
order?: 'created_at' | '-created_at';
|
|
287
|
+
starting_after_id?: string;
|
|
288
|
+
limit?: number;
|
|
289
|
+
};
|
|
290
|
+
export declare type LoyaltiesListMemberActivityResponse = {
|
|
291
|
+
object: 'list';
|
|
292
|
+
data_ref: 'data';
|
|
293
|
+
data: {
|
|
294
|
+
id: string;
|
|
295
|
+
type: string;
|
|
296
|
+
data: any;
|
|
297
|
+
created_at: string;
|
|
298
|
+
group_id: string;
|
|
299
|
+
}[];
|
|
300
|
+
has_more: boolean;
|
|
301
|
+
more_starting_after?: string;
|
|
302
|
+
};
|
|
285
303
|
export interface LoyaltiesGetMemberActivitiesResponse {
|
|
286
304
|
object: 'list';
|
|
287
305
|
data_ref: 'activities';
|
|
@@ -551,6 +569,11 @@ export interface LoyaltiesGetPointsExpirationResponseBody {
|
|
|
551
569
|
}
|
|
552
570
|
export interface LoyaltiesListCardTransactionsRequestQuery {
|
|
553
571
|
limit?: number;
|
|
572
|
+
starting_after_id?: string;
|
|
573
|
+
order?: 'id' | '-id';
|
|
574
|
+
/**
|
|
575
|
+
* @deprecated Use starting_after_id
|
|
576
|
+
*/
|
|
554
577
|
page?: number;
|
|
555
578
|
}
|
|
556
579
|
export interface LoyaltiesListCardTransactionsResponseBody {
|
|
@@ -558,6 +581,7 @@ export interface LoyaltiesListCardTransactionsResponseBody {
|
|
|
558
581
|
data_ref: 'data';
|
|
559
582
|
data: LoyaltyCardTransaction[];
|
|
560
583
|
has_more: boolean;
|
|
584
|
+
more_starting_after?: string;
|
|
561
585
|
}
|
|
562
586
|
export declare type LoyaltiesExportCardTransactionsRequestBody = VouchersExportTransactionsRequestBody;
|
|
563
587
|
export interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
@@ -644,16 +668,6 @@ export interface LoyaltiesGetPointsExpirationResponseBody {
|
|
|
644
668
|
}[];
|
|
645
669
|
total: number;
|
|
646
670
|
}
|
|
647
|
-
export interface LoyaltiesListCardTransactionsRequestQuery {
|
|
648
|
-
limit?: number;
|
|
649
|
-
page?: number;
|
|
650
|
-
}
|
|
651
|
-
export interface LoyaltiesListCardTransactionsResponseBody {
|
|
652
|
-
object: 'list';
|
|
653
|
-
data_ref: 'data';
|
|
654
|
-
data: LoyaltyCardTransaction[];
|
|
655
|
-
has_more: boolean;
|
|
656
|
-
}
|
|
657
671
|
export declare type LoyaltiesExportCardTransactionsResponseBody = VouchersExportTransactionsResponseBody;
|
|
658
672
|
export interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
659
673
|
points: number;
|
|
@@ -799,6 +813,7 @@ export interface LoyaltyCardTransaction {
|
|
|
799
813
|
type: 'loyalty_card';
|
|
800
814
|
total: number;
|
|
801
815
|
object: 'balance';
|
|
816
|
+
operation_type: 'MANUAL' | 'AUTOMATIC';
|
|
802
817
|
points: number;
|
|
803
818
|
balance: number;
|
|
804
819
|
related_object: {
|
|
@@ -57,12 +57,13 @@ export interface DynamicProductCollectionBase {
|
|
|
57
57
|
filter?: Filter;
|
|
58
58
|
}
|
|
59
59
|
export declare type ProductCollection = ProductCollectionBase & ProductCollectionIdentity & ProductCollectionSaved;
|
|
60
|
-
export declare type Filter = {
|
|
61
|
-
junction: Junction;
|
|
62
|
-
} & Partial<Record<AllowedFiltersKeys, {
|
|
60
|
+
export declare type Filter = Partial<Record<string, Junction | {
|
|
63
61
|
conditions: Partial<Record<FiltersCondition, unknown>>;
|
|
64
62
|
}>>;
|
|
65
63
|
export declare type Junction = 'and' | 'AND' | 'or' | 'OR';
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*/
|
|
66
67
|
export declare type AllowedFiltersKeys = 'id' | 'name' | 'attributes' | 'source_id' | 'price' | 'image_url' | 'product_id' | 'skus' | 'created_at' | 'updated_at' | 'object' | `metadata.${string}`;
|
|
67
68
|
export declare type FiltersCondition = '$in' | '$not_in' | '$is' | '$is_days_ago' | '$is_days_in_future' | '$is_not' | '$has_value' | '$is_unknown' | '$contains' | '$not_contain' | '$starts_with' | '$ends_with' | '$more_than' | '$less_than' | '$more_than_ago' | '$less_than_ago' | '$more_than_future' | '$less_than_future' | '$more_than_equal' | '$less_than_equal' | '$after' | '$before' | '$count' | '$count_less' | '$count_more';
|
|
68
69
|
export declare type ProductCollectionsCreateRequestBody = WithRequiredProperty<StaticProductCollectionBase, 'name' | 'type'> | Required<DynamicProductCollectionBase>;
|
package/dist/types/Vouchers.d.ts
CHANGED
|
@@ -318,6 +318,11 @@ export declare type VoucherTransaction = GiftCardTransaction | LoyaltyCardTransa
|
|
|
318
318
|
export declare type VoucherTransactionsExportFields = 'id' | 'campaign_id' | 'voucher_id' | 'type' | 'source_id' | 'reason' | 'source' | 'balance' | 'amount' | 'related_transaction_id' | 'created_at' | 'details';
|
|
319
319
|
export interface VouchersListTransactionsRequestQuery {
|
|
320
320
|
limit?: number;
|
|
321
|
+
starting_after_id?: string;
|
|
322
|
+
order?: 'id' | '-id';
|
|
323
|
+
/**
|
|
324
|
+
* @deprecated Use starting_after_id
|
|
325
|
+
*/
|
|
321
326
|
page?: number;
|
|
322
327
|
}
|
|
323
328
|
export interface VouchersListTransactionsResponseBody {
|
|
@@ -325,6 +330,7 @@ export interface VouchersListTransactionsResponseBody {
|
|
|
325
330
|
data_ref: 'data';
|
|
326
331
|
data: VoucherTransaction[];
|
|
327
332
|
has_more: boolean;
|
|
333
|
+
more_starting_after?: string;
|
|
328
334
|
}
|
|
329
335
|
export interface VouchersExportTransactionsRequestBody {
|
|
330
336
|
parameters?: {
|
|
@@ -1443,8 +1443,16 @@ class Loyalties {
|
|
|
1443
1443
|
return this.client.get(campaignId ? `/loyalties/${encode(campaignId)}/members/${memberId}` : `/loyalties/members/${memberId}`);
|
|
1444
1444
|
}
|
|
1445
1445
|
/**
|
|
1446
|
-
* @see https://docs.voucherify.io/reference/
|
|
1447
|
-
* @see https://docs.voucherify.io/reference/
|
|
1446
|
+
* @see https://docs.voucherify.io/reference/list-member-activity
|
|
1447
|
+
* @see https://docs.voucherify.io/reference/list-member-activity-1
|
|
1448
|
+
*/
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
listMemberActivity(campaignId, memberId, params) {
|
|
1452
|
+
return this.client.get(campaignId ? `/loyalties/${encode(campaignId)}/members/${memberId}/activity` : `/loyalties/members/${memberId}/activity`, params);
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* @deprecated This method is deprecated in favor of the `listMemberActivity` method. We’re removing this method in next major version.
|
|
1448
1456
|
*/
|
|
1449
1457
|
|
|
1450
1458
|
|
|
@@ -1960,7 +1968,7 @@ function VoucherifyServerSide(options) {
|
|
|
1960
1968
|
let headers = {
|
|
1961
1969
|
'X-App-Id': options.applicationId,
|
|
1962
1970
|
'X-App-Token': options.secretKey,
|
|
1963
|
-
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.
|
|
1971
|
+
'X-Voucherify-Channel': options.channel || `${environment()}-SDK-v${"2.9.0"}`,
|
|
1964
1972
|
'Content-Type': 'application/json'
|
|
1965
1973
|
};
|
|
1966
1974
|
|
|
@@ -2226,7 +2234,7 @@ function VoucherifyClientSide(options) {
|
|
|
2226
2234
|
let headers = {
|
|
2227
2235
|
'X-Client-Application-Id': options.clientApplicationId,
|
|
2228
2236
|
'X-Client-Token': options.clientSecretKey,
|
|
2229
|
-
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.
|
|
2237
|
+
'X-Voucherify-Channel': `${environment()}-ClientSide-SDK-v${"2.9.0"}`
|
|
2230
2238
|
};
|
|
2231
2239
|
|
|
2232
2240
|
if (environment().startsWith('Node')) {
|