@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,127 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SimpleCustomer } from './Customers';
|
|
4
|
-
import { ValidationRulesListAssignmentsResponse } from './ValidationRules';
|
|
5
|
-
import { ValidationSessionReleaseParams } from './ValidateSession';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
import { DiscountUnit, DiscountPercent, DiscountAmount, DiscountFixed } from './DiscountVoucher.js';
|
|
2
|
+
import { OrdersItem, OrdersCreateResponse } from './Orders.js';
|
|
3
|
+
import { SimpleCustomer } from './Customers.js';
|
|
4
|
+
import { ValidationRulesListAssignmentsResponse } from './ValidationRules.js';
|
|
5
|
+
import { ValidationSessionReleaseParams } from './ValidateSession.js';
|
|
6
|
+
import './ApplicableTo.js';
|
|
7
|
+
|
|
8
|
+
interface SimplePromotionTier {
|
|
9
|
+
tracking_id: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
valid: boolean;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
banner?: string;
|
|
15
|
+
discount: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
|
|
16
|
+
hierarchy: number;
|
|
17
|
+
object: 'promotion_tier';
|
|
18
|
+
}
|
|
19
|
+
interface PromotionTier {
|
|
20
|
+
id: string;
|
|
21
|
+
object: 'promotion_tier';
|
|
22
|
+
name: string;
|
|
23
|
+
banner?: string;
|
|
24
|
+
campaign: {
|
|
25
|
+
id: string;
|
|
26
|
+
object: 'campaign';
|
|
27
|
+
start_date?: string;
|
|
28
|
+
expiration_date?: string;
|
|
29
|
+
active: boolean;
|
|
30
|
+
};
|
|
31
|
+
validation_rule_assignments: ValidationRulesListAssignmentsResponse;
|
|
32
|
+
action: {
|
|
33
|
+
discount: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
|
|
34
|
+
};
|
|
35
|
+
hierarchy: number;
|
|
36
|
+
metadata?: Record<string, any>;
|
|
37
|
+
active?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface PromotionTiersListAllParams {
|
|
40
|
+
is_available?: boolean;
|
|
41
|
+
limit?: number;
|
|
42
|
+
page?: number;
|
|
43
|
+
}
|
|
44
|
+
interface PromotionTiersListAllResponse {
|
|
45
|
+
object: 'list';
|
|
46
|
+
data_ref: 'tiers';
|
|
47
|
+
tiers: PromotionTier[];
|
|
48
|
+
has_more: boolean;
|
|
49
|
+
}
|
|
50
|
+
type PromotionTiersListResponse = PromotionTiersListAllResponse;
|
|
51
|
+
type PromotionTierGetResponse = PromotionTier;
|
|
52
|
+
interface PromotionTiersCreateParams {
|
|
53
|
+
name?: string;
|
|
54
|
+
banner?: string;
|
|
55
|
+
action?: {
|
|
56
|
+
discount?: DiscountUnit | DiscountPercent | DiscountAmount | DiscountFixed;
|
|
57
|
+
};
|
|
58
|
+
metadata?: Record<string, any>;
|
|
59
|
+
}
|
|
60
|
+
type PromotionTiersCreateResponse = PromotionTier;
|
|
61
|
+
interface PromotionTiersRedeemParams {
|
|
62
|
+
customer?: Omit<SimpleCustomer, 'object'> & {
|
|
63
|
+
description?: string;
|
|
64
|
+
};
|
|
65
|
+
order?: {
|
|
66
|
+
id?: string;
|
|
67
|
+
source_id?: string;
|
|
68
|
+
amount?: number;
|
|
69
|
+
items?: OrdersItem[];
|
|
70
|
+
status?: 'CREATED' | 'PAID' | 'CANCELED' | 'FULFILLED';
|
|
71
|
+
metadata?: Record<string, any>;
|
|
72
|
+
};
|
|
73
|
+
metadata?: Record<string, any>;
|
|
74
|
+
session?: ValidationSessionReleaseParams;
|
|
75
|
+
}
|
|
76
|
+
interface PromotionTiersRedeemResponse {
|
|
77
|
+
id: string;
|
|
78
|
+
object: 'redemption';
|
|
79
|
+
date: string;
|
|
80
|
+
customer_id?: string;
|
|
81
|
+
tracking_id?: string;
|
|
82
|
+
order: Omit<OrdersCreateResponse, 'object' | 'customer'> & {
|
|
83
|
+
customer: {
|
|
84
|
+
id: string;
|
|
85
|
+
object: 'customer';
|
|
86
|
+
referrals: {
|
|
87
|
+
campaigns: any[];
|
|
88
|
+
total: number;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
total_discount_amount?: number;
|
|
92
|
+
total_amount?: number;
|
|
93
|
+
};
|
|
94
|
+
result?: string;
|
|
95
|
+
promotion_tier: PromotionTier & {
|
|
96
|
+
summary: {
|
|
97
|
+
redemptions: {
|
|
98
|
+
total_redeemed: number;
|
|
99
|
+
};
|
|
100
|
+
orders: {
|
|
101
|
+
total_amount: number;
|
|
102
|
+
total_discount_amount: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
interface PromotionTierRedeemDetailsSimple {
|
|
108
|
+
id: string;
|
|
109
|
+
name: string;
|
|
110
|
+
banner?: string;
|
|
111
|
+
campaign: {
|
|
112
|
+
id: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
type PromotionTierRedeemDetails = PromotionTier & {
|
|
116
|
+
summary: {
|
|
117
|
+
redemptions: {
|
|
118
|
+
total_redeemed: number;
|
|
119
|
+
};
|
|
120
|
+
orders: {
|
|
121
|
+
total_amount: number;
|
|
122
|
+
total_discount_amount: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
type PromotionTiersUpdateParams = PromotionTiersCreateParams & {
|
|
127
|
+
id: string;
|
|
128
|
+
};
|
|
129
|
+
type PromotionTiersUpdateResponse = PromotionTier;
|
|
130
|
+
|
|
131
|
+
export type { PromotionTier, PromotionTierGetResponse, PromotionTierRedeemDetails, PromotionTierRedeemDetailsSimple, PromotionTiersCreateParams, PromotionTiersCreateResponse, PromotionTiersListAllParams, PromotionTiersListAllResponse, PromotionTiersListResponse, PromotionTiersRedeemParams, PromotionTiersRedeemResponse, PromotionTiersUpdateParams, PromotionTiersUpdateResponse, SimplePromotionTier };
|
|
@@ -1,108 +1,113 @@
|
|
|
1
|
-
import { DiscountAmount, DiscountPercent,
|
|
2
|
-
import { OrdersItem } from './Orders';
|
|
3
|
-
import { PromotionTier } from './PromotionTiers';
|
|
4
|
-
import { SimpleCustomer } from './Customers';
|
|
5
|
-
import { ValidationRulesCreateAssignmentResponse } from './ValidationRules';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
id?: string;
|
|
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
|
-
|
|
1
|
+
import { DiscountUnit, DiscountAmount, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
|
|
2
|
+
import { OrdersItem } from './Orders.js';
|
|
3
|
+
import { PromotionTier } from './PromotionTiers.js';
|
|
4
|
+
import { SimpleCustomer } from './Customers.js';
|
|
5
|
+
import { ValidationRulesCreateAssignmentResponse } from './ValidationRules.js';
|
|
6
|
+
import './ValidateSession.js';
|
|
7
|
+
import './ApplicableTo.js';
|
|
8
|
+
|
|
9
|
+
interface PromotionsCreateResponse {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
campaign_type?: 'PROMOTION';
|
|
13
|
+
type: 'STATIC';
|
|
14
|
+
description?: string;
|
|
15
|
+
start_date?: string;
|
|
16
|
+
expiration_date?: string;
|
|
17
|
+
promotion: {
|
|
18
|
+
object: 'list';
|
|
19
|
+
data_ref: 'tiers';
|
|
20
|
+
tiers?: PromotionTier[];
|
|
21
|
+
has_more: boolean;
|
|
22
|
+
};
|
|
23
|
+
category?: string;
|
|
24
|
+
auto_join: boolean;
|
|
25
|
+
join_once: boolean;
|
|
26
|
+
validation_rules_assignments: {
|
|
27
|
+
data?: ValidationRulesCreateAssignmentResponse[];
|
|
28
|
+
object: 'list';
|
|
29
|
+
total: number;
|
|
30
|
+
data_ref: 'data';
|
|
31
|
+
};
|
|
32
|
+
activity_duration_after_publishing?: string;
|
|
33
|
+
validity_timeframe?: {
|
|
34
|
+
interval?: string;
|
|
35
|
+
duration?: string;
|
|
36
|
+
};
|
|
37
|
+
validity_day_of_week?: number[];
|
|
38
|
+
metadata?: Record<string, string>;
|
|
39
|
+
created_at: string;
|
|
40
|
+
vouchers_generation_status: 'DONE';
|
|
41
|
+
active: boolean;
|
|
42
|
+
use_voucher_metadata_schema: boolean;
|
|
43
|
+
protected: boolean;
|
|
44
|
+
object: 'campaign';
|
|
45
|
+
}
|
|
46
|
+
interface PromotionsCreate {
|
|
47
|
+
name: string;
|
|
48
|
+
campaign_type: 'PROMOTION';
|
|
49
|
+
start_date?: string;
|
|
50
|
+
expiration_date?: string;
|
|
51
|
+
promotion?: {
|
|
52
|
+
tiers: {
|
|
53
|
+
name: string;
|
|
54
|
+
banner: string;
|
|
55
|
+
action: {
|
|
56
|
+
discount: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
|
|
57
|
+
};
|
|
58
|
+
metadata?: Record<string, any>;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
interface PromotionsValidateParams {
|
|
63
|
+
customer?: Omit<SimpleCustomer, 'id' | 'object'> & {
|
|
64
|
+
description?: string;
|
|
65
|
+
id?: string;
|
|
66
|
+
};
|
|
67
|
+
order?: {
|
|
68
|
+
id?: string;
|
|
69
|
+
source_id?: string;
|
|
70
|
+
items?: OrdersItem[];
|
|
71
|
+
amount?: number;
|
|
72
|
+
metadata?: Record<string, any>;
|
|
73
|
+
};
|
|
74
|
+
metadata?: Record<string, any>;
|
|
75
|
+
}
|
|
76
|
+
interface PromotionsValidateQueryParams {
|
|
77
|
+
audienceRulesOnly?: boolean;
|
|
78
|
+
filters?: Record<string, any>;
|
|
79
|
+
}
|
|
80
|
+
interface PromotionsValidateResponse {
|
|
81
|
+
valid: boolean;
|
|
82
|
+
promotions?: {
|
|
83
|
+
id: string;
|
|
84
|
+
object: 'promotion_tier';
|
|
85
|
+
banner?: string;
|
|
86
|
+
name: string;
|
|
87
|
+
start_date?: string;
|
|
88
|
+
expiration_date?: string;
|
|
89
|
+
discount?: DiscountUnit | DiscountAmount | DiscountPercent | DiscountFixed;
|
|
90
|
+
discount_amount?: number;
|
|
91
|
+
applied_discount_amount?: number;
|
|
92
|
+
metadata?: Record<string, any>;
|
|
93
|
+
order?: {
|
|
94
|
+
id?: string;
|
|
95
|
+
source_id?: string;
|
|
96
|
+
amount: number;
|
|
97
|
+
initial_amount?: number;
|
|
98
|
+
items_discount_amount?: number;
|
|
99
|
+
items_applied_discount_amount?: number;
|
|
100
|
+
items?: OrdersItem[];
|
|
101
|
+
metadata?: Record<string, any>;
|
|
102
|
+
discount_amount?: number;
|
|
103
|
+
total_discount_amount?: number;
|
|
104
|
+
total_amount?: number;
|
|
105
|
+
applied_discount_amount?: number;
|
|
106
|
+
total_applied_discount_amount?: number;
|
|
107
|
+
};
|
|
108
|
+
hierarchy?: number;
|
|
109
|
+
}[];
|
|
110
|
+
tracking_id?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type { PromotionsCreate, PromotionsCreateResponse, PromotionsValidateParams, PromotionsValidateQueryParams, PromotionsValidateResponse };
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { Category } from './Categories';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
1
|
+
import { Category } from './Categories.js';
|
|
2
|
+
|
|
3
|
+
interface PromotionsStacksListInCampaignResponseBody {
|
|
4
|
+
object: 'list';
|
|
5
|
+
data_ref: 'data';
|
|
6
|
+
data: PromotionStack[];
|
|
7
|
+
total: number;
|
|
8
|
+
}
|
|
9
|
+
interface PromotionsStacksListResponseBody {
|
|
10
|
+
object: 'list';
|
|
11
|
+
data_ref: 'data';
|
|
12
|
+
data: PromotionStack[];
|
|
13
|
+
total: number;
|
|
14
|
+
}
|
|
15
|
+
interface PromotionsStacksListRequestQuery {
|
|
16
|
+
limit?: number;
|
|
17
|
+
page?: number;
|
|
18
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at' | 'name' | '-name';
|
|
19
|
+
created_at?: {
|
|
20
|
+
before?: string;
|
|
21
|
+
after?: string;
|
|
22
|
+
};
|
|
23
|
+
updated_at?: {
|
|
24
|
+
before?: string;
|
|
25
|
+
after?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
type PromotionsStacksGetResponseBody = PromotionStack;
|
|
29
|
+
type PromotionsStacksUpdateRequestBody = {
|
|
30
|
+
name: string;
|
|
31
|
+
tiers?: {
|
|
32
|
+
ids?: string[];
|
|
33
|
+
hierarchy_mode?: 'MANUAL';
|
|
34
|
+
};
|
|
35
|
+
category_id?: string;
|
|
36
|
+
};
|
|
37
|
+
type PromotionsStacksUpdateResponseBody = PromotionStackBase & {
|
|
38
|
+
id: string;
|
|
39
|
+
created_at: string;
|
|
40
|
+
updated_at: string;
|
|
41
|
+
campaign_id: string;
|
|
42
|
+
object: 'promotion_stack';
|
|
43
|
+
category_id: string | null;
|
|
44
|
+
categories: Category[];
|
|
45
|
+
};
|
|
46
|
+
type PromotionsStacksCreateInCampaignRequestBody = PromotionStackBase & {
|
|
47
|
+
category_id?: string;
|
|
48
|
+
};
|
|
49
|
+
type PromotionsStacksCreateInCampaignResponseBody = PromotionStackBase & {
|
|
50
|
+
id: string;
|
|
51
|
+
created_at: string;
|
|
52
|
+
campaign_id: string;
|
|
53
|
+
object: 'promotion_stack';
|
|
54
|
+
category_id: string | null;
|
|
55
|
+
categories: Category[];
|
|
56
|
+
};
|
|
57
|
+
interface PromotionStackBase {
|
|
58
|
+
name: string;
|
|
59
|
+
tiers: {
|
|
60
|
+
ids: string[];
|
|
61
|
+
hierarchy_mode?: 'MANUAL';
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
type PromotionStack = PromotionStackBase & {
|
|
65
|
+
id: string;
|
|
66
|
+
created_at: string;
|
|
67
|
+
updated_at?: string;
|
|
68
|
+
campaign_id: string;
|
|
69
|
+
object: 'promotion_stack';
|
|
70
|
+
category_id: string | null;
|
|
71
|
+
categories: Category[];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type { PromotionStack, PromotionStackBase, PromotionsStacksCreateInCampaignRequestBody, PromotionsStacksCreateInCampaignResponseBody, PromotionsStacksGetResponseBody, PromotionsStacksListInCampaignResponseBody, PromotionsStacksListRequestQuery, PromotionsStacksListResponseBody, PromotionsStacksUpdateRequestBody, PromotionsStacksUpdateResponseBody };
|