@open-loyalty/mcp-server 1.0.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/LICENSE +21 -0
- package/README.md +654 -0
- package/dist/client/http.d.ts +8 -0
- package/dist/client/http.js +69 -0
- package/dist/config.d.ts +17 -0
- package/dist/config.js +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +334 -0
- package/dist/tools/achievement.d.ts +983 -0
- package/dist/tools/achievement.js +311 -0
- package/dist/tools/admin.d.ts +153 -0
- package/dist/tools/admin.js +193 -0
- package/dist/tools/analytics.d.ts +162 -0
- package/dist/tools/analytics.js +245 -0
- package/dist/tools/apikey.d.ts +72 -0
- package/dist/tools/apikey.js +78 -0
- package/dist/tools/audit.d.ts +107 -0
- package/dist/tools/audit.js +90 -0
- package/dist/tools/badge.d.ts +135 -0
- package/dist/tools/badge.js +165 -0
- package/dist/tools/campaign.d.ts +1775 -0
- package/dist/tools/campaign.js +724 -0
- package/dist/tools/export.d.ts +110 -0
- package/dist/tools/export.js +147 -0
- package/dist/tools/import.d.ts +110 -0
- package/dist/tools/import.js +126 -0
- package/dist/tools/index.d.ts +22 -0
- package/dist/tools/index.js +527 -0
- package/dist/tools/member.d.ts +345 -0
- package/dist/tools/member.js +358 -0
- package/dist/tools/member.test.d.ts +1 -0
- package/dist/tools/member.test.js +213 -0
- package/dist/tools/points.d.ts +188 -0
- package/dist/tools/points.js +306 -0
- package/dist/tools/points.test.d.ts +1 -0
- package/dist/tools/points.test.js +292 -0
- package/dist/tools/reward.d.ts +261 -0
- package/dist/tools/reward.js +371 -0
- package/dist/tools/reward.test.d.ts +1 -0
- package/dist/tools/reward.test.js +240 -0
- package/dist/tools/role.d.ts +161 -0
- package/dist/tools/role.js +160 -0
- package/dist/tools/segment.d.ts +797 -0
- package/dist/tools/segment.js +299 -0
- package/dist/tools/store.d.ts +101 -0
- package/dist/tools/store.js +117 -0
- package/dist/tools/tierset.d.ts +288 -0
- package/dist/tools/tierset.js +244 -0
- package/dist/tools/transaction.d.ts +357 -0
- package/dist/tools/transaction.js +242 -0
- package/dist/tools/transaction.test.d.ts +1 -0
- package/dist/tools/transaction.test.js +235 -0
- package/dist/tools/wallet-type.d.ts +32 -0
- package/dist/tools/wallet-type.js +58 -0
- package/dist/tools/webhook.d.ts +179 -0
- package/dist/tools/webhook.js +171 -0
- package/dist/types/schemas/achievement.d.ts +1116 -0
- package/dist/types/schemas/achievement.js +172 -0
- package/dist/types/schemas/admin.d.ts +263 -0
- package/dist/types/schemas/admin.js +99 -0
- package/dist/types/schemas/analytics.d.ts +542 -0
- package/dist/types/schemas/analytics.js +130 -0
- package/dist/types/schemas/badge.d.ts +131 -0
- package/dist/types/schemas/badge.js +48 -0
- package/dist/types/schemas/campaign.d.ts +2005 -0
- package/dist/types/schemas/campaign.js +189 -0
- package/dist/types/schemas/common.d.ts +52 -0
- package/dist/types/schemas/common.js +26 -0
- package/dist/types/schemas/export.d.ts +127 -0
- package/dist/types/schemas/export.js +43 -0
- package/dist/types/schemas/import.d.ts +344 -0
- package/dist/types/schemas/import.js +68 -0
- package/dist/types/schemas/member.d.ts +443 -0
- package/dist/types/schemas/member.js +92 -0
- package/dist/types/schemas/points.d.ts +188 -0
- package/dist/types/schemas/points.js +54 -0
- package/dist/types/schemas/reward.d.ts +278 -0
- package/dist/types/schemas/reward.js +69 -0
- package/dist/types/schemas/role.d.ts +260 -0
- package/dist/types/schemas/role.js +75 -0
- package/dist/types/schemas/segment.d.ts +592 -0
- package/dist/types/schemas/segment.js +114 -0
- package/dist/types/schemas/tierset.d.ts +552 -0
- package/dist/types/schemas/tierset.js +87 -0
- package/dist/types/schemas/transaction.d.ts +1022 -0
- package/dist/types/schemas/transaction.js +63 -0
- package/dist/types/schemas/wallet-type.d.ts +99 -0
- package/dist/types/schemas/wallet-type.js +17 -0
- package/dist/types/schemas/webhook.d.ts +195 -0
- package/dist/types/schemas/webhook.js +39 -0
- package/dist/utils/cursor.d.ts +84 -0
- package/dist/utils/cursor.js +117 -0
- package/dist/utils/errors.d.ts +12 -0
- package/dist/utils/errors.js +69 -0
- package/dist/utils/pagination.d.ts +39 -0
- package/dist/utils/pagination.js +77 -0
- package/package.json +65 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Segment Criterion Type Enum.
|
|
4
|
+
* Common criterion types for defining segment membership rules.
|
|
5
|
+
*/
|
|
6
|
+
export const SegmentCriterionTypeEnum = z.enum([
|
|
7
|
+
"anniversary",
|
|
8
|
+
"average_transaction_amount",
|
|
9
|
+
"bought_in_pos",
|
|
10
|
+
"bought_labels",
|
|
11
|
+
"bought_makers",
|
|
12
|
+
"bought_skus",
|
|
13
|
+
"campaign_completion",
|
|
14
|
+
"country",
|
|
15
|
+
"custom_attribute",
|
|
16
|
+
"first_purchase",
|
|
17
|
+
"last_purchase",
|
|
18
|
+
"points_balance",
|
|
19
|
+
"points_earned",
|
|
20
|
+
"points_spent",
|
|
21
|
+
"purchase_period",
|
|
22
|
+
"purchased_item_labels",
|
|
23
|
+
"registration_date",
|
|
24
|
+
"tier",
|
|
25
|
+
"transaction_amount",
|
|
26
|
+
"transaction_count",
|
|
27
|
+
"transaction_percent_in_pos",
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Segment Criterion Schema.
|
|
31
|
+
* A criterion defines one condition for segment membership.
|
|
32
|
+
* The 'data' field contains type-specific configuration.
|
|
33
|
+
*/
|
|
34
|
+
export const SegmentCriterionSchema = z.object({
|
|
35
|
+
type: z.string().describe("Criterion type (e.g., 'anniversary', 'tier', 'transaction_count')."),
|
|
36
|
+
criterionId: z.string().optional().describe("Criterion ID (generated on creation)."),
|
|
37
|
+
// Type-specific data fields - varies by criterion type
|
|
38
|
+
data: z.record(z.unknown()).optional().describe("Type-specific criterion configuration."),
|
|
39
|
+
// Common data fields found across criterion types
|
|
40
|
+
days: z.number().optional().describe("Number of days for time-based criteria."),
|
|
41
|
+
fromDate: z.string().optional().describe("Start date for date range criteria."),
|
|
42
|
+
toDate: z.string().optional().describe("End date for date range criteria."),
|
|
43
|
+
min: z.number().optional().describe("Minimum value for range criteria."),
|
|
44
|
+
max: z.number().optional().describe("Maximum value for range criteria."),
|
|
45
|
+
posIds: z.array(z.string()).optional().describe("POS IDs for POS-based criteria."),
|
|
46
|
+
skus: z.array(z.string()).optional().describe("SKU codes for SKU-based criteria."),
|
|
47
|
+
makers: z.array(z.string()).optional().describe("Maker names for maker-based criteria."),
|
|
48
|
+
labels: z.array(z.object({
|
|
49
|
+
key: z.string(),
|
|
50
|
+
value: z.string(),
|
|
51
|
+
})).optional().describe("Labels for label-based criteria."),
|
|
52
|
+
tierIds: z.array(z.string()).optional().describe("Tier level IDs for tier-based criteria."),
|
|
53
|
+
campaignId: z.string().optional().describe("Campaign ID for campaign completion criteria."),
|
|
54
|
+
countries: z.array(z.string()).optional().describe("Country codes for country criteria."),
|
|
55
|
+
anniversaryType: z.string().optional().describe("Anniversary type for anniversary criteria."),
|
|
56
|
+
customAttributeKey: z.string().optional().describe("Custom attribute key."),
|
|
57
|
+
customAttributeValue: z.string().optional().describe("Custom attribute value."),
|
|
58
|
+
}).passthrough(); // Allow additional fields for flexibility
|
|
59
|
+
/**
|
|
60
|
+
* Segment Part Schema.
|
|
61
|
+
* A part contains multiple criteria that use AND logic.
|
|
62
|
+
* Parts themselves use OR logic within the segment.
|
|
63
|
+
*/
|
|
64
|
+
export const SegmentPartSchema = z.object({
|
|
65
|
+
segmentPartId: z.string().optional().describe("Part ID (generated on creation)."),
|
|
66
|
+
criteria: z.array(SegmentCriterionSchema).describe("Array of criteria (ALL must match - AND logic)."),
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Main Segment Schema.
|
|
70
|
+
* Represents a complete segment with all parts and criteria.
|
|
71
|
+
*/
|
|
72
|
+
export const SegmentSchema = z.object({
|
|
73
|
+
segmentId: z.string().describe("Segment ID (UUID)."),
|
|
74
|
+
name: z.string().describe("Segment name."),
|
|
75
|
+
description: z.string().optional().describe("Segment description."),
|
|
76
|
+
active: z.boolean().describe("Whether segment is active."),
|
|
77
|
+
customersCount: z.number().optional().describe("Number of members in segment."),
|
|
78
|
+
calculatedAt: z.string().optional().describe("When membership was last calculated."),
|
|
79
|
+
parts: z.array(SegmentPartSchema).describe("Segment parts (ANY must match - OR logic)."),
|
|
80
|
+
createdAt: z.string().optional().describe("Creation timestamp."),
|
|
81
|
+
// Analytics fields
|
|
82
|
+
averageTransactionAmount: z.union([z.string(), z.number()]).optional().describe("Average transaction amount of segment members."),
|
|
83
|
+
averageTransactions: z.union([z.string(), z.number()]).optional().describe("Average number of transactions."),
|
|
84
|
+
averageClv: z.union([z.string(), z.number()]).optional().describe("Average customer lifetime value."),
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* Segment List Item Schema.
|
|
88
|
+
* Simplified representation for list responses.
|
|
89
|
+
*/
|
|
90
|
+
export const SegmentListItemSchema = z.object({
|
|
91
|
+
segmentId: z.string(),
|
|
92
|
+
name: z.string(),
|
|
93
|
+
description: z.string().optional(),
|
|
94
|
+
active: z.boolean(),
|
|
95
|
+
customersCount: z.number().optional(),
|
|
96
|
+
createdAt: z.string().optional(),
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Segment Create Input Schema.
|
|
100
|
+
* Matches the POST /api/{storeCode}/segment body structure.
|
|
101
|
+
* IMPORTANT: Request must be wrapped as { segment: {...} }
|
|
102
|
+
*/
|
|
103
|
+
export const SegmentCreateInputSchema = z.object({
|
|
104
|
+
name: z.string().describe("Segment name (required)."),
|
|
105
|
+
description: z.string().optional().describe("Segment description."),
|
|
106
|
+
active: z.boolean().optional().describe("Whether segment is active (default: false)."),
|
|
107
|
+
parts: z.array(z.object({
|
|
108
|
+
segmentPartId: z.string().optional().describe("Part ID (optional, generated if not provided)."),
|
|
109
|
+
criteria: z.array(z.object({
|
|
110
|
+
type: z.string().describe("Criterion type."),
|
|
111
|
+
criterionId: z.string().optional().describe("Criterion ID (optional)."),
|
|
112
|
+
}).passthrough()).describe("Criteria for this part."),
|
|
113
|
+
})).describe("Segment parts. Parts use OR logic, criteria within parts use AND logic."),
|
|
114
|
+
});
|
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TierSetAttributeEnum: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
3
|
+
export declare const TierSetConditionSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
6
|
+
walletType: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
id: string;
|
|
9
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
10
|
+
walletType?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
id: string;
|
|
13
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
14
|
+
walletType?: string | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const TierConditionSchema: z.ZodObject<{
|
|
17
|
+
conditionId: z.ZodString;
|
|
18
|
+
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
19
|
+
value: z.ZodNumber;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
value: number;
|
|
22
|
+
conditionId: string;
|
|
23
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
value: number;
|
|
26
|
+
conditionId: string;
|
|
27
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const TierInSetSchema: z.ZodObject<{
|
|
30
|
+
levelId: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodOptional<z.ZodString>;
|
|
33
|
+
active: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
description: string;
|
|
37
|
+
}, {
|
|
38
|
+
description: string;
|
|
39
|
+
}>]>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
name: string;
|
|
42
|
+
active: boolean | {
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
levelId: string;
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
name: string;
|
|
49
|
+
active: boolean | {
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
levelId: string;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const TierSchema: z.ZodObject<{
|
|
56
|
+
levelId: z.ZodString;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
description: z.ZodOptional<z.ZodString>;
|
|
59
|
+
active: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
60
|
+
description: z.ZodString;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
description: string;
|
|
63
|
+
}, {
|
|
64
|
+
description: string;
|
|
65
|
+
}>]>;
|
|
66
|
+
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
67
|
+
conditionId: z.ZodString;
|
|
68
|
+
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
69
|
+
value: z.ZodNumber;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
value: number;
|
|
72
|
+
conditionId: string;
|
|
73
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
value: number;
|
|
76
|
+
conditionId: string;
|
|
77
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
78
|
+
}>, "many">>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
name: string;
|
|
81
|
+
active: boolean | {
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
levelId: string;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
conditions?: {
|
|
87
|
+
value: number;
|
|
88
|
+
conditionId: string;
|
|
89
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
name: string;
|
|
93
|
+
active: boolean | {
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
levelId: string;
|
|
97
|
+
description?: string | undefined;
|
|
98
|
+
conditions?: {
|
|
99
|
+
value: number;
|
|
100
|
+
conditionId: string;
|
|
101
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
102
|
+
}[] | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
export declare const TierSetSchema: z.ZodObject<{
|
|
105
|
+
tierSetId: z.ZodString;
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
description: z.ZodOptional<z.ZodString>;
|
|
108
|
+
active: z.ZodBoolean;
|
|
109
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
112
|
+
walletType: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
id: string;
|
|
115
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
116
|
+
walletType?: string | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
id: string;
|
|
119
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
120
|
+
walletType?: string | undefined;
|
|
121
|
+
}>, "many">;
|
|
122
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
123
|
+
levelId: z.ZodString;
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
description: z.ZodOptional<z.ZodString>;
|
|
126
|
+
active: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
127
|
+
description: z.ZodString;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
description: string;
|
|
130
|
+
}, {
|
|
131
|
+
description: string;
|
|
132
|
+
}>]>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
name: string;
|
|
135
|
+
active: boolean | {
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
levelId: string;
|
|
139
|
+
description?: string | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
name: string;
|
|
142
|
+
active: boolean | {
|
|
143
|
+
description: string;
|
|
144
|
+
};
|
|
145
|
+
levelId: string;
|
|
146
|
+
description?: string | undefined;
|
|
147
|
+
}>, "many">;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
name: string;
|
|
150
|
+
active: boolean;
|
|
151
|
+
conditions: {
|
|
152
|
+
id: string;
|
|
153
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
154
|
+
walletType?: string | undefined;
|
|
155
|
+
}[];
|
|
156
|
+
tierSetId: string;
|
|
157
|
+
tiers: {
|
|
158
|
+
name: string;
|
|
159
|
+
active: boolean | {
|
|
160
|
+
description: string;
|
|
161
|
+
};
|
|
162
|
+
levelId: string;
|
|
163
|
+
description?: string | undefined;
|
|
164
|
+
}[];
|
|
165
|
+
description?: string | undefined;
|
|
166
|
+
}, {
|
|
167
|
+
name: string;
|
|
168
|
+
active: boolean;
|
|
169
|
+
conditions: {
|
|
170
|
+
id: string;
|
|
171
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
172
|
+
walletType?: string | undefined;
|
|
173
|
+
}[];
|
|
174
|
+
tierSetId: string;
|
|
175
|
+
tiers: {
|
|
176
|
+
name: string;
|
|
177
|
+
active: boolean | {
|
|
178
|
+
description: string;
|
|
179
|
+
};
|
|
180
|
+
levelId: string;
|
|
181
|
+
description?: string | undefined;
|
|
182
|
+
}[];
|
|
183
|
+
description?: string | undefined;
|
|
184
|
+
}>;
|
|
185
|
+
export declare const TierListResponseSchema: z.ZodObject<{
|
|
186
|
+
items: z.ZodArray<z.ZodObject<{
|
|
187
|
+
levelId: z.ZodString;
|
|
188
|
+
name: z.ZodString;
|
|
189
|
+
description: z.ZodOptional<z.ZodString>;
|
|
190
|
+
active: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
191
|
+
description: z.ZodString;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
description: string;
|
|
194
|
+
}, {
|
|
195
|
+
description: string;
|
|
196
|
+
}>]>;
|
|
197
|
+
conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
198
|
+
conditionId: z.ZodString;
|
|
199
|
+
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
200
|
+
value: z.ZodNumber;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
value: number;
|
|
203
|
+
conditionId: string;
|
|
204
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
205
|
+
}, {
|
|
206
|
+
value: number;
|
|
207
|
+
conditionId: string;
|
|
208
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
209
|
+
}>, "many">>;
|
|
210
|
+
}, "strip", z.ZodTypeAny, {
|
|
211
|
+
name: string;
|
|
212
|
+
active: boolean | {
|
|
213
|
+
description: string;
|
|
214
|
+
};
|
|
215
|
+
levelId: string;
|
|
216
|
+
description?: string | undefined;
|
|
217
|
+
conditions?: {
|
|
218
|
+
value: number;
|
|
219
|
+
conditionId: string;
|
|
220
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
221
|
+
}[] | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
name: string;
|
|
224
|
+
active: boolean | {
|
|
225
|
+
description: string;
|
|
226
|
+
};
|
|
227
|
+
levelId: string;
|
|
228
|
+
description?: string | undefined;
|
|
229
|
+
conditions?: {
|
|
230
|
+
value: number;
|
|
231
|
+
conditionId: string;
|
|
232
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
233
|
+
}[] | undefined;
|
|
234
|
+
}>, "many">;
|
|
235
|
+
total: z.ZodObject<{
|
|
236
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
237
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
238
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
239
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
240
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
241
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
242
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
243
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
244
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
245
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
246
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
247
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
items: {
|
|
250
|
+
name: string;
|
|
251
|
+
active: boolean | {
|
|
252
|
+
description: string;
|
|
253
|
+
};
|
|
254
|
+
levelId: string;
|
|
255
|
+
description?: string | undefined;
|
|
256
|
+
conditions?: {
|
|
257
|
+
value: number;
|
|
258
|
+
conditionId: string;
|
|
259
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
260
|
+
}[] | undefined;
|
|
261
|
+
}[];
|
|
262
|
+
total: {
|
|
263
|
+
all?: number | boolean | undefined;
|
|
264
|
+
filtered?: string | number | boolean | undefined;
|
|
265
|
+
estimated?: string | number | boolean | undefined;
|
|
266
|
+
} & {
|
|
267
|
+
[k: string]: unknown;
|
|
268
|
+
};
|
|
269
|
+
}, {
|
|
270
|
+
items: {
|
|
271
|
+
name: string;
|
|
272
|
+
active: boolean | {
|
|
273
|
+
description: string;
|
|
274
|
+
};
|
|
275
|
+
levelId: string;
|
|
276
|
+
description?: string | undefined;
|
|
277
|
+
conditions?: {
|
|
278
|
+
value: number;
|
|
279
|
+
conditionId: string;
|
|
280
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
281
|
+
}[] | undefined;
|
|
282
|
+
}[];
|
|
283
|
+
total: {
|
|
284
|
+
all?: number | boolean | undefined;
|
|
285
|
+
filtered?: string | number | boolean | undefined;
|
|
286
|
+
estimated?: string | number | boolean | undefined;
|
|
287
|
+
} & {
|
|
288
|
+
[k: string]: unknown;
|
|
289
|
+
};
|
|
290
|
+
}>;
|
|
291
|
+
export declare const TierSetListItemSchema: z.ZodObject<{
|
|
292
|
+
tierSetId: z.ZodString;
|
|
293
|
+
name: z.ZodString;
|
|
294
|
+
active: z.ZodBoolean;
|
|
295
|
+
tiersCount: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
name: string;
|
|
298
|
+
active: boolean;
|
|
299
|
+
tierSetId: string;
|
|
300
|
+
tiersCount?: number | undefined;
|
|
301
|
+
}, {
|
|
302
|
+
name: string;
|
|
303
|
+
active: boolean;
|
|
304
|
+
tierSetId: string;
|
|
305
|
+
tiersCount?: number | undefined;
|
|
306
|
+
}>;
|
|
307
|
+
export declare const TierSetListResponseSchema: z.ZodObject<{
|
|
308
|
+
items: z.ZodArray<z.ZodObject<{
|
|
309
|
+
tierSetId: z.ZodString;
|
|
310
|
+
name: z.ZodString;
|
|
311
|
+
active: z.ZodBoolean;
|
|
312
|
+
tiersCount: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
name: string;
|
|
315
|
+
active: boolean;
|
|
316
|
+
tierSetId: string;
|
|
317
|
+
tiersCount?: number | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
name: string;
|
|
320
|
+
active: boolean;
|
|
321
|
+
tierSetId: string;
|
|
322
|
+
tiersCount?: number | undefined;
|
|
323
|
+
}>, "many">;
|
|
324
|
+
total: z.ZodObject<{
|
|
325
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
326
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
327
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
328
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
329
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
330
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
331
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
332
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
333
|
+
all: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
334
|
+
filtered: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
335
|
+
estimated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber]>>;
|
|
336
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
items: {
|
|
339
|
+
name: string;
|
|
340
|
+
active: boolean;
|
|
341
|
+
tierSetId: string;
|
|
342
|
+
tiersCount?: number | undefined;
|
|
343
|
+
}[];
|
|
344
|
+
total: {
|
|
345
|
+
all?: number | boolean | undefined;
|
|
346
|
+
filtered?: string | number | boolean | undefined;
|
|
347
|
+
estimated?: string | number | boolean | undefined;
|
|
348
|
+
} & {
|
|
349
|
+
[k: string]: unknown;
|
|
350
|
+
};
|
|
351
|
+
}, {
|
|
352
|
+
items: {
|
|
353
|
+
name: string;
|
|
354
|
+
active: boolean;
|
|
355
|
+
tierSetId: string;
|
|
356
|
+
tiersCount?: number | undefined;
|
|
357
|
+
}[];
|
|
358
|
+
total: {
|
|
359
|
+
all?: number | boolean | undefined;
|
|
360
|
+
filtered?: string | number | boolean | undefined;
|
|
361
|
+
estimated?: string | number | boolean | undefined;
|
|
362
|
+
} & {
|
|
363
|
+
[k: string]: unknown;
|
|
364
|
+
};
|
|
365
|
+
}>;
|
|
366
|
+
export declare const TierSetConditionInputSchema: z.ZodObject<{
|
|
367
|
+
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
368
|
+
walletType: z.ZodOptional<z.ZodString>;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
371
|
+
walletType?: string | undefined;
|
|
372
|
+
}, {
|
|
373
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
374
|
+
walletType?: string | undefined;
|
|
375
|
+
}>;
|
|
376
|
+
export declare const DowngradeModeEnum: z.ZodEnum<["none", "automatic", "x_days"]>;
|
|
377
|
+
export declare const TierSetCreateInputSchema: z.ZodObject<{
|
|
378
|
+
storeCode: z.ZodString;
|
|
379
|
+
name: z.ZodString;
|
|
380
|
+
description: z.ZodOptional<z.ZodString>;
|
|
381
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
382
|
+
attribute: z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>;
|
|
383
|
+
walletType: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, "strip", z.ZodTypeAny, {
|
|
385
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
386
|
+
walletType?: string | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
389
|
+
walletType?: string | undefined;
|
|
390
|
+
}>, "many">;
|
|
391
|
+
downgrade: z.ZodOptional<z.ZodObject<{
|
|
392
|
+
mode: z.ZodEnum<["none", "automatic", "x_days"]>;
|
|
393
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
394
|
+
}, "strip", z.ZodTypeAny, {
|
|
395
|
+
mode: "none" | "automatic" | "x_days";
|
|
396
|
+
days?: number | undefined;
|
|
397
|
+
}, {
|
|
398
|
+
mode: "none" | "automatic" | "x_days";
|
|
399
|
+
days?: number | undefined;
|
|
400
|
+
}>>;
|
|
401
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
name: string;
|
|
404
|
+
conditions: {
|
|
405
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
406
|
+
walletType?: string | undefined;
|
|
407
|
+
}[];
|
|
408
|
+
storeCode: string;
|
|
409
|
+
active?: boolean | undefined;
|
|
410
|
+
description?: string | undefined;
|
|
411
|
+
downgrade?: {
|
|
412
|
+
mode: "none" | "automatic" | "x_days";
|
|
413
|
+
days?: number | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
}, {
|
|
416
|
+
name: string;
|
|
417
|
+
conditions: {
|
|
418
|
+
attribute: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits";
|
|
419
|
+
walletType?: string | undefined;
|
|
420
|
+
}[];
|
|
421
|
+
storeCode: string;
|
|
422
|
+
active?: boolean | undefined;
|
|
423
|
+
description?: string | undefined;
|
|
424
|
+
downgrade?: {
|
|
425
|
+
mode: "none" | "automatic" | "x_days";
|
|
426
|
+
days?: number | undefined;
|
|
427
|
+
} | undefined;
|
|
428
|
+
}>;
|
|
429
|
+
export declare const TierInputSchema: z.ZodObject<{
|
|
430
|
+
levelId: z.ZodOptional<z.ZodString>;
|
|
431
|
+
name: z.ZodString;
|
|
432
|
+
description: z.ZodOptional<z.ZodString>;
|
|
433
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
435
|
+
conditionId: z.ZodString;
|
|
436
|
+
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
437
|
+
value: z.ZodNumber;
|
|
438
|
+
}, "strip", z.ZodTypeAny, {
|
|
439
|
+
value: number;
|
|
440
|
+
conditionId: string;
|
|
441
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
442
|
+
}, {
|
|
443
|
+
value: number;
|
|
444
|
+
conditionId: string;
|
|
445
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
446
|
+
}>, "many">;
|
|
447
|
+
}, "strip", z.ZodTypeAny, {
|
|
448
|
+
name: string;
|
|
449
|
+
conditions: {
|
|
450
|
+
value: number;
|
|
451
|
+
conditionId: string;
|
|
452
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
453
|
+
}[];
|
|
454
|
+
active?: boolean | undefined;
|
|
455
|
+
description?: string | undefined;
|
|
456
|
+
levelId?: string | undefined;
|
|
457
|
+
}, {
|
|
458
|
+
name: string;
|
|
459
|
+
conditions: {
|
|
460
|
+
value: number;
|
|
461
|
+
conditionId: string;
|
|
462
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
463
|
+
}[];
|
|
464
|
+
active?: boolean | undefined;
|
|
465
|
+
description?: string | undefined;
|
|
466
|
+
levelId?: string | undefined;
|
|
467
|
+
}>;
|
|
468
|
+
export declare const TierSetUpdateTiersInputSchema: z.ZodObject<{
|
|
469
|
+
storeCode: z.ZodString;
|
|
470
|
+
tierSetId: z.ZodString;
|
|
471
|
+
tiers: z.ZodArray<z.ZodObject<{
|
|
472
|
+
levelId: z.ZodOptional<z.ZodString>;
|
|
473
|
+
name: z.ZodString;
|
|
474
|
+
description: z.ZodOptional<z.ZodString>;
|
|
475
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
477
|
+
conditionId: z.ZodString;
|
|
478
|
+
attribute: z.ZodOptional<z.ZodEnum<["activeUnits", "totalEarnedUnits", "totalSpending", "monthsSinceJoiningProgram", "cumulatedEarnedUnits"]>>;
|
|
479
|
+
value: z.ZodNumber;
|
|
480
|
+
}, "strip", z.ZodTypeAny, {
|
|
481
|
+
value: number;
|
|
482
|
+
conditionId: string;
|
|
483
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
484
|
+
}, {
|
|
485
|
+
value: number;
|
|
486
|
+
conditionId: string;
|
|
487
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
488
|
+
}>, "many">;
|
|
489
|
+
}, "strip", z.ZodTypeAny, {
|
|
490
|
+
name: string;
|
|
491
|
+
conditions: {
|
|
492
|
+
value: number;
|
|
493
|
+
conditionId: string;
|
|
494
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
495
|
+
}[];
|
|
496
|
+
active?: boolean | undefined;
|
|
497
|
+
description?: string | undefined;
|
|
498
|
+
levelId?: string | undefined;
|
|
499
|
+
}, {
|
|
500
|
+
name: string;
|
|
501
|
+
conditions: {
|
|
502
|
+
value: number;
|
|
503
|
+
conditionId: string;
|
|
504
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
505
|
+
}[];
|
|
506
|
+
active?: boolean | undefined;
|
|
507
|
+
description?: string | undefined;
|
|
508
|
+
levelId?: string | undefined;
|
|
509
|
+
}>, "many">;
|
|
510
|
+
}, "strip", z.ZodTypeAny, {
|
|
511
|
+
tierSetId: string;
|
|
512
|
+
tiers: {
|
|
513
|
+
name: string;
|
|
514
|
+
conditions: {
|
|
515
|
+
value: number;
|
|
516
|
+
conditionId: string;
|
|
517
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
518
|
+
}[];
|
|
519
|
+
active?: boolean | undefined;
|
|
520
|
+
description?: string | undefined;
|
|
521
|
+
levelId?: string | undefined;
|
|
522
|
+
}[];
|
|
523
|
+
storeCode: string;
|
|
524
|
+
}, {
|
|
525
|
+
tierSetId: string;
|
|
526
|
+
tiers: {
|
|
527
|
+
name: string;
|
|
528
|
+
conditions: {
|
|
529
|
+
value: number;
|
|
530
|
+
conditionId: string;
|
|
531
|
+
attribute?: "activeUnits" | "totalEarnedUnits" | "totalSpending" | "monthsSinceJoiningProgram" | "cumulatedEarnedUnits" | undefined;
|
|
532
|
+
}[];
|
|
533
|
+
active?: boolean | undefined;
|
|
534
|
+
description?: string | undefined;
|
|
535
|
+
levelId?: string | undefined;
|
|
536
|
+
}[];
|
|
537
|
+
storeCode: string;
|
|
538
|
+
}>;
|
|
539
|
+
export type TierSetAttribute = z.infer<typeof TierSetAttributeEnum>;
|
|
540
|
+
export type TierSetCondition = z.infer<typeof TierSetConditionSchema>;
|
|
541
|
+
export type TierCondition = z.infer<typeof TierConditionSchema>;
|
|
542
|
+
export type Tier = z.infer<typeof TierSchema>;
|
|
543
|
+
export type TierInSet = z.infer<typeof TierInSetSchema>;
|
|
544
|
+
export type TierSet = z.infer<typeof TierSetSchema>;
|
|
545
|
+
export type TierSetListItem = z.infer<typeof TierSetListItemSchema>;
|
|
546
|
+
export type TierSetListResponse = z.infer<typeof TierSetListResponseSchema>;
|
|
547
|
+
export type TierListResponse = z.infer<typeof TierListResponseSchema>;
|
|
548
|
+
export type TierSetConditionInput = z.infer<typeof TierSetConditionInputSchema>;
|
|
549
|
+
export type TierSetCreateInput = z.infer<typeof TierSetCreateInputSchema>;
|
|
550
|
+
export type TierInput = z.infer<typeof TierInputSchema>;
|
|
551
|
+
export type TierSetUpdateTiersInput = z.infer<typeof TierSetUpdateTiersInputSchema>;
|
|
552
|
+
export type DowngradeMode = z.infer<typeof DowngradeModeEnum>;
|