@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,98 +1,109 @@
|
|
|
1
|
-
import { DiscountAmount,
|
|
2
|
-
import { CustomersCreateBody } from './Customers';
|
|
3
|
-
import { StackableOptions,
|
|
4
|
-
import { ValidationSessionParams, ValidationSessionResponse } from './ValidateSession';
|
|
5
|
-
import { ApplicableToResultList } from './ApplicableTo';
|
|
6
|
-
import { ValidationError } from './ValidationError';
|
|
7
|
-
import {
|
|
8
|
-
import { PromotionsValidateParams } from './Promotions';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
session?: ValidationSessionParams;
|
|
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
|
-
|
|
1
|
+
import { DiscountAmount, DiscountUnit, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
|
|
2
|
+
import { CustomersCreateBody } from './Customers.js';
|
|
3
|
+
import { StackableOptions, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableSkippedResponse, StackableRedeemableInapplicableResponse } from './Stackable.js';
|
|
4
|
+
import { ValidationSessionParams, ValidationSessionResponse } from './ValidateSession.js';
|
|
5
|
+
import { ApplicableToResultList } from './ApplicableTo.js';
|
|
6
|
+
import { ValidationError } from './ValidationError.js';
|
|
7
|
+
import { OrdersCreate, OrdersCreateResponse, OrdersItem } from './Orders.js';
|
|
8
|
+
import { PromotionsValidateParams } from './Promotions.js';
|
|
9
|
+
import './Rewards.js';
|
|
10
|
+
import './Gift.js';
|
|
11
|
+
import './Products.js';
|
|
12
|
+
import './Loyalties.js';
|
|
13
|
+
import './ValidationRules.js';
|
|
14
|
+
import './Vouchers.js';
|
|
15
|
+
import './Categories.js';
|
|
16
|
+
import './PromotionTiers.js';
|
|
17
|
+
|
|
18
|
+
interface ValidationsValidateVoucherParams {
|
|
19
|
+
customer?: {
|
|
20
|
+
id?: string;
|
|
21
|
+
source_id?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
metadata?: Record<string, any>;
|
|
26
|
+
};
|
|
27
|
+
order?: {
|
|
28
|
+
id?: string;
|
|
29
|
+
source_id?: string;
|
|
30
|
+
amount?: number;
|
|
31
|
+
items?: OrdersItem[];
|
|
32
|
+
metadata?: Record<string, any>;
|
|
33
|
+
};
|
|
34
|
+
gift?: {
|
|
35
|
+
credits: number;
|
|
36
|
+
};
|
|
37
|
+
reward?: {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
session?: ValidationSessionParams;
|
|
41
|
+
}
|
|
42
|
+
interface ValidationsValidateVoucherResponse {
|
|
43
|
+
applicable_to?: ApplicableToResultList;
|
|
44
|
+
inapplicable_to?: ApplicableToResultList;
|
|
45
|
+
campaign?: string;
|
|
46
|
+
campaign_id?: string;
|
|
47
|
+
metadata?: Record<string, any>;
|
|
48
|
+
code?: string;
|
|
49
|
+
valid?: boolean;
|
|
50
|
+
discount?: DiscountAmount | DiscountUnit | DiscountPercent | DiscountFixed;
|
|
51
|
+
gift?: {
|
|
52
|
+
amount: number;
|
|
53
|
+
balance: number;
|
|
54
|
+
};
|
|
55
|
+
loyalty?: {
|
|
56
|
+
points_cost: number;
|
|
57
|
+
};
|
|
58
|
+
order?: {
|
|
59
|
+
amount: number;
|
|
60
|
+
discount_amount: number;
|
|
61
|
+
total_discount_amount: number;
|
|
62
|
+
total_amount: number;
|
|
63
|
+
applied_discount_amount?: number;
|
|
64
|
+
total_applied_discount_amount?: number;
|
|
65
|
+
items?: OrdersItem[];
|
|
66
|
+
initial_amount?: number;
|
|
67
|
+
items_discount_amount?: number;
|
|
68
|
+
items_applied_discount_amount?: number;
|
|
69
|
+
metadata?: Record<string, any>;
|
|
70
|
+
};
|
|
71
|
+
session?: ValidationSessionParams;
|
|
72
|
+
start_date?: string;
|
|
73
|
+
expiration_date?: string;
|
|
74
|
+
tracking_id: string;
|
|
75
|
+
error?: ValidationError;
|
|
76
|
+
}
|
|
77
|
+
interface ValidationsValidateStackableParams {
|
|
78
|
+
options?: StackableOptions;
|
|
79
|
+
redeemables: StackableRedeemableParams[];
|
|
80
|
+
session?: ValidationSessionParams;
|
|
81
|
+
order?: OrdersCreate;
|
|
82
|
+
customer?: CustomersCreateBody;
|
|
83
|
+
metadata?: Record<string, any>;
|
|
84
|
+
}
|
|
85
|
+
interface ValidationValidateStackableResponse {
|
|
86
|
+
valid: boolean;
|
|
87
|
+
tracking_id?: string;
|
|
88
|
+
session?: ValidationSessionResponse;
|
|
89
|
+
order?: OrdersCreateResponse;
|
|
90
|
+
redeemables?: StackableRedeemableResponse[];
|
|
91
|
+
skipped_redeemables?: StackableRedeemableSkippedResponse[];
|
|
92
|
+
inapplicable_redeemables?: StackableRedeemableInapplicableResponse[];
|
|
93
|
+
stacking_rules: ValidationsStackingRules;
|
|
94
|
+
}
|
|
95
|
+
type ValidationsStackingRules = {
|
|
96
|
+
redeemables_limit: number;
|
|
97
|
+
applicable_redeemables_limit: number;
|
|
98
|
+
applicable_redeemables_per_category_limit?: number;
|
|
99
|
+
applicable_exclusive_redeemables_limit: number;
|
|
100
|
+
applicable_exclusive_redeemables_per_category_limit?: number;
|
|
101
|
+
exclusive_categories: string[];
|
|
102
|
+
joint_categories: string[];
|
|
103
|
+
redeemables_application_mode: 'ALL' | 'PARTIAL';
|
|
104
|
+
redeemables_sorting_rule: 'CATEGORY_HIERARCHY' | 'REQUESTED_ORDER';
|
|
105
|
+
};
|
|
106
|
+
type ValidationsValidateCode = PromotionsValidateParams;
|
|
107
|
+
type ValidationsValidateContext = ValidationsValidateVoucherParams;
|
|
108
|
+
|
|
109
|
+
export type { ValidationValidateStackableResponse, ValidationsStackingRules, ValidationsValidateCode, ValidationsValidateContext, ValidationsValidateStackableParams, ValidationsValidateVoucherParams, ValidationsValidateVoucherResponse };
|