@voucherify/sdk 2.9.2 → 2.9.4
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/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,134 +1,145 @@
|
|
|
1
|
-
import { CustomerRequest, CustomersCreateBody,
|
|
2
|
-
import {
|
|
3
|
-
import { DiscountAmount, DiscountPercent,
|
|
4
|
-
import {
|
|
5
|
-
import { ConsentsListResponse } from './Consents';
|
|
6
|
-
import { DistributionsPublicationsCreateResponse } from './Distributions';
|
|
7
|
-
import { SimplePromotionTier } from './PromotionTiers';
|
|
8
|
-
import { ValidationSessionReleaseParams } from './ValidateSession';
|
|
9
|
-
import { ApplicableToResultList } from './ApplicableTo';
|
|
10
|
-
import { ValidationsValidateStackableParams, ValidationValidateStackableResponse } from './Validations';
|
|
11
|
-
import { RedemptionsRedeemStackableParams, RedemptionsRedeemStackableResponse } from './Redemptions';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
import { CustomerRequest, CustomersCreateBody, CustomersUpdateConsentsBody, CustomersCreateResponse } from './Customers.js';
|
|
2
|
+
import { VouchersResponse, VouchersListParams } from './Vouchers.js';
|
|
3
|
+
import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
|
|
4
|
+
import { OrdersItem, OrdersCreateResponse } from './Orders.js';
|
|
5
|
+
import { ConsentsListResponse } from './Consents.js';
|
|
6
|
+
import { DistributionsPublicationsCreateResponse } from './Distributions.js';
|
|
7
|
+
import { SimplePromotionTier } from './PromotionTiers.js';
|
|
8
|
+
import { ValidationSessionReleaseParams } from './ValidateSession.js';
|
|
9
|
+
import { ApplicableToResultList } from './ApplicableTo.js';
|
|
10
|
+
import { ValidationsValidateStackableParams, ValidationValidateStackableResponse } from './Validations.js';
|
|
11
|
+
import { RedemptionsRedeemStackableParams, RedemptionsRedeemStackableResponse } from './Redemptions.js';
|
|
12
|
+
import './ValidationRules.js';
|
|
13
|
+
import './Stackable.js';
|
|
14
|
+
import './Rewards.js';
|
|
15
|
+
import './Gift.js';
|
|
16
|
+
import './Products.js';
|
|
17
|
+
import './Loyalties.js';
|
|
18
|
+
import './Categories.js';
|
|
19
|
+
import './ValidationError.js';
|
|
20
|
+
import './Promotions.js';
|
|
21
|
+
|
|
22
|
+
type ClientSideItem = Pick<OrdersItem, 'source_id' | 'sku_id' | 'product_id' | 'sku' | 'quantity' | 'related_object' | 'amount'>;
|
|
23
|
+
type ClientSideCustomersUpdateConsentsBody = CustomersUpdateConsentsBody;
|
|
24
|
+
type ClientSideCustomersCreateParams = CustomersCreateBody;
|
|
25
|
+
type ClientSideCustomersCreateResponse = CustomersCreateResponse;
|
|
26
|
+
interface ClientSideValidateParams {
|
|
27
|
+
code?: string;
|
|
28
|
+
tracking_id?: string;
|
|
29
|
+
amount?: number;
|
|
30
|
+
items?: ClientSideItem[];
|
|
31
|
+
orderMetadata?: Record<string, any>;
|
|
32
|
+
customer?: Pick<CustomerRequest, 'source_id' | 'metadata'>;
|
|
33
|
+
reward?: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
metadata?: Record<string, any>;
|
|
37
|
+
session_type?: 'LOCK';
|
|
38
|
+
session_key?: string;
|
|
39
|
+
session_ttl?: number;
|
|
40
|
+
session_ttl_unit?: 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS' | 'DAYS';
|
|
41
|
+
}
|
|
42
|
+
type ClientSideListVouchersParams = VouchersListParams;
|
|
43
|
+
type ClientSideVoucherListing = Pick<VouchersResponse, 'active' | 'code' | 'metadata' | 'assets' | 'object' | 'expiration_date' | 'start_date' | 'created_at'>;
|
|
44
|
+
interface ClientSideListVouchersResponse {
|
|
45
|
+
object: 'list';
|
|
46
|
+
total: number;
|
|
47
|
+
data_ref: 'vouchers';
|
|
48
|
+
vouchers: ClientSideVoucherListing[];
|
|
49
|
+
}
|
|
50
|
+
interface ClientSideValidateResponse {
|
|
51
|
+
code?: string;
|
|
52
|
+
valid: boolean;
|
|
53
|
+
discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
|
|
54
|
+
applicable_to?: ApplicableToResultList;
|
|
55
|
+
order?: {
|
|
56
|
+
amount: number;
|
|
57
|
+
discount_amount: number;
|
|
58
|
+
total_discount_amount: number;
|
|
59
|
+
total_amount: number;
|
|
60
|
+
items?: ClientSideItem[];
|
|
61
|
+
};
|
|
62
|
+
tracking_id?: string;
|
|
63
|
+
campaign_id?: string;
|
|
64
|
+
loyalty?: {
|
|
65
|
+
points_cost: number;
|
|
66
|
+
};
|
|
67
|
+
gift?: {
|
|
68
|
+
amount: number;
|
|
69
|
+
balance: number;
|
|
70
|
+
};
|
|
71
|
+
promotions?: SimplePromotionTier[];
|
|
72
|
+
}
|
|
73
|
+
interface ClientSideRedeemPayload {
|
|
74
|
+
tracking_id?: string;
|
|
75
|
+
customer?: CustomerRequest;
|
|
76
|
+
order?: ClientSideRedeemOrder;
|
|
77
|
+
metadata?: Record<string, any>;
|
|
78
|
+
reward?: {
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
81
|
+
session?: ValidationSessionReleaseParams;
|
|
82
|
+
}
|
|
83
|
+
interface ClientSideRedeemResponse {
|
|
84
|
+
id: string;
|
|
85
|
+
object: 'redemption';
|
|
86
|
+
date?: string;
|
|
87
|
+
customer_id?: string;
|
|
88
|
+
tracking_id?: string;
|
|
89
|
+
order?: OrdersCreateResponse;
|
|
90
|
+
metadata?: Record<string, any>;
|
|
91
|
+
result: 'SUCCESS' | 'FAILURE';
|
|
92
|
+
voucher?: VouchersResponse;
|
|
93
|
+
}
|
|
94
|
+
interface ClientSidePublishPayload {
|
|
95
|
+
source_id?: string;
|
|
96
|
+
channel?: 'Voucherify.js' | string;
|
|
97
|
+
customer?: CustomerRequest;
|
|
98
|
+
voucher?: string;
|
|
99
|
+
metadata?: Record<string, any>;
|
|
100
|
+
}
|
|
101
|
+
type ClientSidePublishPreparedPayload = ClientSidePublishPayload;
|
|
102
|
+
interface ClientSidePublishQueryParams {
|
|
103
|
+
join_once?: boolean;
|
|
104
|
+
campaign?: string;
|
|
105
|
+
}
|
|
106
|
+
interface ClientSidePublishCampaign {
|
|
107
|
+
name: string;
|
|
108
|
+
count?: number;
|
|
109
|
+
}
|
|
110
|
+
type ClientSidePublishResponse = DistributionsPublicationsCreateResponse & {
|
|
111
|
+
vouchers_id?: string[];
|
|
112
|
+
};
|
|
113
|
+
interface ClientSideTrackLoyalty {
|
|
114
|
+
code?: string;
|
|
115
|
+
}
|
|
116
|
+
interface ClientSideTrackReferral {
|
|
117
|
+
code?: string;
|
|
118
|
+
}
|
|
119
|
+
interface ClientSideTrackPayload {
|
|
120
|
+
event: string;
|
|
121
|
+
metadata?: Record<string, any>;
|
|
122
|
+
customer: CustomerRequest;
|
|
123
|
+
loyalty?: ClientSideTrackLoyalty;
|
|
124
|
+
referral?: ClientSideTrackReferral;
|
|
125
|
+
}
|
|
126
|
+
interface ClientSideTrackResponse {
|
|
127
|
+
object: 'event';
|
|
128
|
+
type: string;
|
|
129
|
+
}
|
|
130
|
+
type ClientSideRedeemOrder = Partial<Pick<OrdersCreateResponse, 'id' | 'source_id' | 'metadata' | 'amount'>> & {
|
|
131
|
+
items?: ClientSideItem[];
|
|
132
|
+
};
|
|
133
|
+
interface ClientSideRedeemWidgetPayload {
|
|
134
|
+
order?: {
|
|
135
|
+
amount?: number;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
type ClientSideTrackCustomer = CustomerRequest;
|
|
139
|
+
type ClientSideConsentsListResponse = ConsentsListResponse;
|
|
140
|
+
type ClientSideValidationsValidateStackableParams = ValidationsValidateStackableParams;
|
|
141
|
+
type ClientSideValidationValidateStackableResponse = ValidationValidateStackableResponse;
|
|
142
|
+
type ClientSideRedemptionsRedeemStackableParams = RedemptionsRedeemStackableParams;
|
|
143
|
+
type ClientSideRedemptionsRedeemStackableResponse = RedemptionsRedeemStackableResponse;
|
|
144
|
+
|
|
145
|
+
export type { ClientSideConsentsListResponse, ClientSideCustomersCreateParams, ClientSideCustomersCreateResponse, ClientSideCustomersUpdateConsentsBody, ClientSideListVouchersParams, ClientSideListVouchersResponse, ClientSidePublishCampaign, ClientSidePublishPayload, ClientSidePublishPreparedPayload, ClientSidePublishQueryParams, ClientSidePublishResponse, ClientSideRedeemOrder, ClientSideRedeemPayload, ClientSideRedeemResponse, ClientSideRedeemWidgetPayload, ClientSideRedemptionsRedeemStackableParams, ClientSideRedemptionsRedeemStackableResponse, ClientSideTrackCustomer, ClientSideTrackLoyalty, ClientSideTrackPayload, ClientSideTrackReferral, ClientSideTrackResponse, ClientSideValidateParams, ClientSideValidateResponse, ClientSideValidationValidateStackableResponse, ClientSideValidationsValidateStackableParams, ClientSideVoucherListing };
|
package/dist/types/Consents.d.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
interface ConsentGroup {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
consents: string[];
|
|
6
|
-
created_at: string;
|
|
7
|
-
updated_at?: string;
|
|
8
|
-
object: 'consent_group';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
category: string;
|
|
15
|
-
created_at: string;
|
|
16
|
-
updated_at?: string;
|
|
17
|
-
object: 'consent';
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
groups: {
|
|
21
|
-
object: 'list';
|
|
22
|
-
total: number;
|
|
23
|
-
data_ref: 'data';
|
|
24
|
-
data: ConsentGroup[];
|
|
25
|
-
};
|
|
26
|
-
consents: {
|
|
27
|
-
object: 'list';
|
|
28
|
-
total: number;
|
|
29
|
-
data_ref: 'data';
|
|
30
|
-
data: Consent[];
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
1
|
+
interface ConsentGroup {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
consents: string[];
|
|
6
|
+
created_at: string;
|
|
7
|
+
updated_at?: string;
|
|
8
|
+
object: 'consent_group';
|
|
9
|
+
}
|
|
10
|
+
interface Consent {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
category: string;
|
|
15
|
+
created_at: string;
|
|
16
|
+
updated_at?: string;
|
|
17
|
+
object: 'consent';
|
|
18
|
+
}
|
|
19
|
+
interface ConsentsListResponse {
|
|
20
|
+
groups: {
|
|
21
|
+
object: 'list';
|
|
22
|
+
total: number;
|
|
23
|
+
data_ref: 'data';
|
|
24
|
+
data: ConsentGroup[];
|
|
25
|
+
};
|
|
26
|
+
consents: {
|
|
27
|
+
object: 'list';
|
|
28
|
+
total: number;
|
|
29
|
+
data_ref: 'data';
|
|
30
|
+
data: Consent[];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type { Consent, ConsentsListResponse };
|