@open-loyalty/mcp-server 1.1.0 → 1.3.3
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/README.md +180 -177
- package/dist/auth/provider.js +2 -14
- package/dist/auth/storage.js +22 -0
- package/dist/client/http.js +10 -0
- package/dist/config.d.ts +0 -13
- package/dist/config.js +0 -14
- package/dist/http.js +35 -3
- package/dist/instructions.d.ts +5 -0
- package/dist/instructions.js +440 -0
- package/dist/prompts/fan-engagement-setup.d.ts +107 -0
- package/dist/prompts/fan-engagement-setup.js +492 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +60 -273
- package/dist/tools/achievement/handlers.d.ts +117 -0
- package/dist/tools/achievement/handlers.js +161 -0
- package/dist/tools/achievement/index.d.ts +479 -0
- package/dist/tools/achievement/index.js +74 -0
- package/dist/tools/achievement/schemas.d.ts +433 -0
- package/dist/tools/achievement/schemas.js +142 -0
- package/dist/tools/achievement.d.ts +141 -121
- package/dist/tools/achievement.js +60 -24
- package/dist/tools/admin.d.ts +6 -6
- package/dist/tools/admin.js +12 -12
- package/dist/tools/analytics.d.ts +11 -11
- package/dist/tools/analytics.js +30 -29
- package/dist/tools/apikey.d.ts +3 -3
- package/dist/tools/apikey.js +6 -6
- package/dist/tools/audit.d.ts +2 -2
- package/dist/tools/audit.js +4 -4
- package/dist/tools/badge.d.ts +6 -6
- package/dist/tools/badge.js +23 -18
- package/dist/tools/campaign/handlers.d.ts +42 -0
- package/dist/tools/campaign/handlers.js +223 -0
- package/dist/tools/campaign/index.d.ts +783 -0
- package/dist/tools/campaign/index.js +117 -0
- package/dist/tools/campaign/member-handlers.d.ts +60 -0
- package/dist/tools/campaign/member-handlers.js +159 -0
- package/dist/tools/campaign/schemas.d.ts +704 -0
- package/dist/tools/campaign/schemas.js +259 -0
- package/dist/tools/campaign/types.d.ts +161 -0
- package/dist/tools/campaign/types.js +2 -0
- package/dist/tools/custom-event.d.ts +315 -0
- package/dist/tools/custom-event.js +270 -0
- package/dist/tools/export.d.ts +4 -4
- package/dist/tools/export.js +12 -12
- package/dist/tools/import.d.ts +3 -3
- package/dist/tools/import.js +23 -15
- package/dist/tools/index.js +13 -5
- package/dist/tools/member/handlers.d.ts +111 -0
- package/dist/tools/member/handlers.js +206 -0
- package/dist/tools/member/index.d.ts +169 -0
- package/dist/tools/member/index.js +92 -0
- package/dist/tools/member/schemas.d.ts +89 -0
- package/dist/tools/member/schemas.js +65 -0
- package/dist/tools/points.d.ts +7 -6
- package/dist/tools/points.js +21 -20
- package/dist/tools/referral/handlers.d.ts +47 -0
- package/dist/tools/referral/handlers.js +115 -0
- package/dist/tools/referral/index.d.ts +44 -0
- package/dist/tools/referral/index.js +44 -0
- package/dist/tools/referral/schemas.d.ts +34 -0
- package/dist/tools/referral/schemas.js +52 -0
- package/dist/tools/reward/handlers.d.ts +110 -0
- package/dist/tools/reward/handlers.js +289 -0
- package/dist/tools/reward/index.d.ts +177 -0
- package/dist/tools/reward/index.js +93 -0
- package/dist/tools/reward/schemas.d.ts +116 -0
- package/dist/tools/reward/schemas.js +92 -0
- package/dist/tools/role.d.ts +6 -6
- package/dist/tools/role.js +12 -12
- package/dist/tools/segment/handlers.d.ts +87 -0
- package/dist/tools/segment/handlers.js +174 -0
- package/dist/tools/segment/index.d.ts +395 -0
- package/dist/tools/segment/index.js +88 -0
- package/dist/tools/segment/schemas.d.ts +337 -0
- package/dist/tools/segment/schemas.js +79 -0
- package/dist/tools/segment.d.ts +10 -10
- package/dist/tools/segment.js +55 -31
- package/dist/tools/store.d.ts +4 -4
- package/dist/tools/store.js +8 -8
- package/dist/tools/tierset.d.ts +10 -10
- package/dist/tools/tierset.js +69 -37
- package/dist/tools/transaction.d.ts +4 -4
- package/dist/tools/transaction.js +12 -12
- package/dist/tools/wallet-type.d.ts +221 -16
- package/dist/tools/wallet-type.js +248 -17
- package/dist/tools/webhook.d.ts +6 -6
- package/dist/tools/webhook.js +90 -31
- package/dist/types/schemas/achievement.d.ts +18 -18
- package/dist/types/schemas/campaign.d.ts +64 -184
- package/dist/types/schemas/campaign.js +2 -7
- package/dist/types/schemas/common.d.ts +5 -0
- package/dist/types/schemas/common.js +5 -0
- package/dist/types/schemas/member.d.ts +2 -2
- package/dist/types/schemas/reward.d.ts +94 -18
- package/dist/types/schemas/reward.js +8 -3
- package/dist/types/schemas/wallet-type.d.ts +306 -8
- package/dist/types/schemas/wallet-type.js +82 -1
- package/dist/utils/errors.js +32 -5
- package/dist/workflows/app-login-streak.d.ts +39 -0
- package/dist/workflows/app-login-streak.js +298 -0
- package/dist/workflows/early-arrival.d.ts +33 -0
- package/dist/workflows/early-arrival.js +148 -0
- package/dist/workflows/index.d.ts +101 -0
- package/dist/workflows/index.js +208 -0
- package/dist/workflows/match-attendance.d.ts +45 -0
- package/dist/workflows/match-attendance.js +308 -0
- package/dist/workflows/sportsbar-visit.d.ts +41 -0
- package/dist/workflows/sportsbar-visit.js +284 -0
- package/dist/workflows/vod-watching.d.ts +43 -0
- package/dist/workflows/vod-watching.js +326 -0
- package/package.json +8 -2
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SegmentListInputSchema: {
|
|
3
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
export declare const SegmentCreateInputSchema: {
|
|
10
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
description: z.ZodOptional<z.ZodString>;
|
|
13
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
15
|
+
segmentPartId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
17
|
+
type: z.ZodString;
|
|
18
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
21
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
22
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
25
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
key: z.ZodString;
|
|
29
|
+
value: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
value: string;
|
|
32
|
+
key: string;
|
|
33
|
+
}, {
|
|
34
|
+
value: string;
|
|
35
|
+
key: string;
|
|
36
|
+
}>, "many">>;
|
|
37
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
41
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
42
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
48
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
49
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
53
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
54
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
key: z.ZodString;
|
|
56
|
+
value: z.ZodString;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
value: string;
|
|
59
|
+
key: string;
|
|
60
|
+
}, {
|
|
61
|
+
value: string;
|
|
62
|
+
key: string;
|
|
63
|
+
}>, "many">>;
|
|
64
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
65
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
66
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
68
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
69
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
71
|
+
type: z.ZodString;
|
|
72
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
75
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
76
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
key: z.ZodString;
|
|
83
|
+
value: z.ZodString;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
value: string;
|
|
86
|
+
key: string;
|
|
87
|
+
}, {
|
|
88
|
+
value: string;
|
|
89
|
+
key: string;
|
|
90
|
+
}>, "many">>;
|
|
91
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
92
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
94
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
95
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
96
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
criteria: z.objectOutputType<{
|
|
100
|
+
type: z.ZodString;
|
|
101
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
102
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
104
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
105
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
108
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
110
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
111
|
+
key: z.ZodString;
|
|
112
|
+
value: z.ZodString;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
value: string;
|
|
115
|
+
key: string;
|
|
116
|
+
}, {
|
|
117
|
+
value: string;
|
|
118
|
+
key: string;
|
|
119
|
+
}>, "many">>;
|
|
120
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
123
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
124
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
125
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
127
|
+
segmentPartId?: string | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
criteria: z.objectInputType<{
|
|
130
|
+
type: z.ZodString;
|
|
131
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
134
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
135
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
138
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
140
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
key: z.ZodString;
|
|
142
|
+
value: z.ZodString;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
value: string;
|
|
145
|
+
key: string;
|
|
146
|
+
}, {
|
|
147
|
+
value: string;
|
|
148
|
+
key: string;
|
|
149
|
+
}>, "many">>;
|
|
150
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
151
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
153
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
154
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
155
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
156
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
157
|
+
segmentPartId?: string | undefined;
|
|
158
|
+
}>, "many">;
|
|
159
|
+
};
|
|
160
|
+
export declare const SegmentGetInputSchema: {
|
|
161
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
162
|
+
segmentId: z.ZodString;
|
|
163
|
+
};
|
|
164
|
+
export declare const SegmentUpdateInputSchema: {
|
|
165
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
166
|
+
segmentId: z.ZodString;
|
|
167
|
+
name: z.ZodString;
|
|
168
|
+
description: z.ZodOptional<z.ZodString>;
|
|
169
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
171
|
+
segmentPartId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
173
|
+
type: z.ZodString;
|
|
174
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
177
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
178
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
181
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
182
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
183
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
key: z.ZodString;
|
|
185
|
+
value: z.ZodString;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
value: string;
|
|
188
|
+
key: string;
|
|
189
|
+
}, {
|
|
190
|
+
value: string;
|
|
191
|
+
key: string;
|
|
192
|
+
}>, "many">>;
|
|
193
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
194
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
195
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
196
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
197
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
198
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
200
|
+
type: z.ZodString;
|
|
201
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
204
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
205
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
208
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
209
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
210
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
211
|
+
key: z.ZodString;
|
|
212
|
+
value: z.ZodString;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
value: string;
|
|
215
|
+
key: string;
|
|
216
|
+
}, {
|
|
217
|
+
value: string;
|
|
218
|
+
key: string;
|
|
219
|
+
}>, "many">>;
|
|
220
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
221
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
222
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
223
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
224
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
225
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
226
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
227
|
+
type: z.ZodString;
|
|
228
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
229
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
231
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
232
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
235
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
236
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
237
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
238
|
+
key: z.ZodString;
|
|
239
|
+
value: z.ZodString;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
value: string;
|
|
242
|
+
key: string;
|
|
243
|
+
}, {
|
|
244
|
+
value: string;
|
|
245
|
+
key: string;
|
|
246
|
+
}>, "many">>;
|
|
247
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
248
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
249
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
250
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
251
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
252
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
253
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
criteria: z.objectOutputType<{
|
|
256
|
+
type: z.ZodString;
|
|
257
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
258
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
260
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
261
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
264
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
265
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
266
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
key: z.ZodString;
|
|
268
|
+
value: z.ZodString;
|
|
269
|
+
}, "strip", z.ZodTypeAny, {
|
|
270
|
+
value: string;
|
|
271
|
+
key: string;
|
|
272
|
+
}, {
|
|
273
|
+
value: string;
|
|
274
|
+
key: string;
|
|
275
|
+
}>, "many">>;
|
|
276
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
277
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
278
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
279
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
280
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
281
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
282
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
283
|
+
segmentPartId?: string | undefined;
|
|
284
|
+
}, {
|
|
285
|
+
criteria: z.objectInputType<{
|
|
286
|
+
type: z.ZodString;
|
|
287
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
288
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
fromDate: z.ZodOptional<z.ZodString>;
|
|
290
|
+
toDate: z.ZodOptional<z.ZodString>;
|
|
291
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
posIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
294
|
+
skus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
295
|
+
makers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
296
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
297
|
+
key: z.ZodString;
|
|
298
|
+
value: z.ZodString;
|
|
299
|
+
}, "strip", z.ZodTypeAny, {
|
|
300
|
+
value: string;
|
|
301
|
+
key: string;
|
|
302
|
+
}, {
|
|
303
|
+
value: string;
|
|
304
|
+
key: string;
|
|
305
|
+
}>, "many">>;
|
|
306
|
+
tierIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
307
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
308
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
309
|
+
anniversaryType: z.ZodOptional<z.ZodString>;
|
|
310
|
+
customAttributeKey: z.ZodOptional<z.ZodString>;
|
|
311
|
+
customAttributeValue: z.ZodOptional<z.ZodString>;
|
|
312
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
313
|
+
segmentPartId?: string | undefined;
|
|
314
|
+
}>, "many">;
|
|
315
|
+
};
|
|
316
|
+
export declare const SegmentDeleteInputSchema: {
|
|
317
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
318
|
+
segmentId: z.ZodString;
|
|
319
|
+
};
|
|
320
|
+
export declare const SegmentGetMembersInputSchema: {
|
|
321
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
322
|
+
segmentId: z.ZodString;
|
|
323
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
};
|
|
326
|
+
export declare const SegmentActivateInputSchema: {
|
|
327
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
328
|
+
segmentId: z.ZodString;
|
|
329
|
+
};
|
|
330
|
+
export declare const SegmentDeactivateInputSchema: {
|
|
331
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
332
|
+
segmentId: z.ZodString;
|
|
333
|
+
};
|
|
334
|
+
export declare const SegmentGetResourcesInputSchema: {
|
|
335
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
336
|
+
segmentId: z.ZodString;
|
|
337
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Input Schemas
|
|
3
|
+
export const SegmentListInputSchema = {
|
|
4
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
5
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
6
|
+
perPage: z.number().optional().describe("Items per page (default: 10)."),
|
|
7
|
+
active: z.boolean().optional().describe("Filter by active status."),
|
|
8
|
+
name: z.string().optional().describe("Filter by segment name."),
|
|
9
|
+
};
|
|
10
|
+
// Criterion input schema - flexible to support all criterion types
|
|
11
|
+
// NOTE: Only certain criterion types are supported by the API.
|
|
12
|
+
// WORKING: transaction_count (requires both min AND max; MCP will auto-fill max if omitted)
|
|
13
|
+
// NOT WORKING: tier, points_balance (rejected by API despite being documented)
|
|
14
|
+
const SegmentCriterionInputSchema = z.object({
|
|
15
|
+
type: z.string().describe("Criterion type. WORKING: 'transaction_count' (requires both min AND max; MCP auto-fills max if omitted). NOT WORKING: 'tier', 'points_balance' are rejected by the API."),
|
|
16
|
+
criterionId: z.string().optional().describe("Criterion ID (optional, generated if not provided)."),
|
|
17
|
+
// Common criterion data fields
|
|
18
|
+
days: z.number().optional().describe("Days for time-based criteria."),
|
|
19
|
+
fromDate: z.string().optional().describe("Start date (ISO format)."),
|
|
20
|
+
toDate: z.string().optional().describe("End date (ISO format)."),
|
|
21
|
+
min: z.number().optional().describe("Minimum value."),
|
|
22
|
+
max: z.number().optional().describe("Maximum value."),
|
|
23
|
+
posIds: z.array(z.string()).optional().describe("POS IDs."),
|
|
24
|
+
skus: z.array(z.string()).optional().describe("SKU codes."),
|
|
25
|
+
makers: z.array(z.string()).optional().describe("Maker/brand names."),
|
|
26
|
+
labels: z.array(z.object({ key: z.string(), value: z.string() })).optional().describe("Label key-value pairs."),
|
|
27
|
+
tierIds: z.array(z.string()).optional().describe("Tier level IDs."),
|
|
28
|
+
campaignId: z.string().optional().describe("Campaign ID for campaign_completion criterion."),
|
|
29
|
+
countries: z.array(z.string()).optional().describe("Country codes."),
|
|
30
|
+
anniversaryType: z.string().optional().describe("Anniversary type."),
|
|
31
|
+
customAttributeKey: z.string().optional().describe("Custom attribute key."),
|
|
32
|
+
customAttributeValue: z.string().optional().describe("Custom attribute value."),
|
|
33
|
+
}).passthrough();
|
|
34
|
+
// Part input schema
|
|
35
|
+
const SegmentPartInputSchema = z.object({
|
|
36
|
+
segmentPartId: z.string().optional().describe("Part ID (optional)."),
|
|
37
|
+
criteria: z.array(SegmentCriterionInputSchema).describe("Criteria for this part (AND logic)."),
|
|
38
|
+
});
|
|
39
|
+
export const SegmentCreateInputSchema = {
|
|
40
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
41
|
+
name: z.string().describe("Segment name (required)."),
|
|
42
|
+
description: z.string().optional().describe("Segment description."),
|
|
43
|
+
active: z.boolean().optional().describe("Whether segment is active (default: false)."),
|
|
44
|
+
parts: z.array(SegmentPartInputSchema).describe("Segment parts. Parts use OR logic (ANY part matches), criteria within parts use AND logic (ALL criteria must match)."),
|
|
45
|
+
};
|
|
46
|
+
export const SegmentGetInputSchema = {
|
|
47
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
48
|
+
segmentId: z.string().describe("The segment ID (UUID) to retrieve."),
|
|
49
|
+
};
|
|
50
|
+
export const SegmentUpdateInputSchema = {
|
|
51
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
52
|
+
segmentId: z.string().describe("The segment ID (UUID) to update."),
|
|
53
|
+
name: z.string().describe("Segment name."),
|
|
54
|
+
description: z.string().optional().describe("Segment description."),
|
|
55
|
+
active: z.boolean().optional().describe("Whether segment is active."),
|
|
56
|
+
parts: z.array(SegmentPartInputSchema).describe("Segment parts."),
|
|
57
|
+
};
|
|
58
|
+
export const SegmentDeleteInputSchema = {
|
|
59
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
60
|
+
segmentId: z.string().describe("The segment ID (UUID) to delete."),
|
|
61
|
+
};
|
|
62
|
+
export const SegmentGetMembersInputSchema = {
|
|
63
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
64
|
+
segmentId: z.string().describe("The segment ID (UUID) to get members for."),
|
|
65
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
66
|
+
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
67
|
+
};
|
|
68
|
+
export const SegmentActivateInputSchema = {
|
|
69
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
70
|
+
segmentId: z.string().describe("The segment ID (UUID) to activate."),
|
|
71
|
+
};
|
|
72
|
+
export const SegmentDeactivateInputSchema = {
|
|
73
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
74
|
+
segmentId: z.string().describe("The segment ID (UUID) to deactivate."),
|
|
75
|
+
};
|
|
76
|
+
export const SegmentGetResourcesInputSchema = {
|
|
77
|
+
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
78
|
+
segmentId: z.string().describe("The segment ID (UUID) to get associated resources for."),
|
|
79
|
+
};
|
package/dist/tools/segment.d.ts
CHANGED
|
@@ -422,7 +422,7 @@ export declare function segmentGetResources(input: {
|
|
|
422
422
|
resources: SegmentResource[];
|
|
423
423
|
}>;
|
|
424
424
|
export declare const segmentToolDefinitions: readonly [{
|
|
425
|
-
readonly name: "
|
|
425
|
+
readonly name: "ol_segment_list";
|
|
426
426
|
readonly title: "List Segments";
|
|
427
427
|
readonly description: "List customer segments. Segments group members by criteria (purchase behavior, tier, location, etc). Use for campaign targeting and analytics.";
|
|
428
428
|
readonly readOnly: true;
|
|
@@ -435,9 +435,9 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
435
435
|
};
|
|
436
436
|
readonly handler: typeof segmentList;
|
|
437
437
|
}, {
|
|
438
|
-
readonly name: "
|
|
438
|
+
readonly name: "ol_segment_create";
|
|
439
439
|
readonly title: "Create Segment";
|
|
440
|
-
readonly description:
|
|
440
|
+
readonly description: string;
|
|
441
441
|
readonly readOnly: false;
|
|
442
442
|
readonly inputSchema: {
|
|
443
443
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
@@ -592,7 +592,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
592
592
|
};
|
|
593
593
|
readonly handler: typeof segmentCreate;
|
|
594
594
|
}, {
|
|
595
|
-
readonly name: "
|
|
595
|
+
readonly name: "ol_segment_get";
|
|
596
596
|
readonly title: "Get Segment Details";
|
|
597
597
|
readonly description: "Get full segment details including all parts and criteria configurations.";
|
|
598
598
|
readonly readOnly: true;
|
|
@@ -602,7 +602,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
602
602
|
};
|
|
603
603
|
readonly handler: typeof segmentGet;
|
|
604
604
|
}, {
|
|
605
|
-
readonly name: "
|
|
605
|
+
readonly name: "ol_segment_update";
|
|
606
606
|
readonly title: "Update Segment";
|
|
607
607
|
readonly description: "Update segment configuration. Requires full segment definition (name, parts with criteria). Use segment_get first to retrieve current configuration.";
|
|
608
608
|
readonly readOnly: false;
|
|
@@ -760,7 +760,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
760
760
|
};
|
|
761
761
|
readonly handler: typeof segmentUpdate;
|
|
762
762
|
}, {
|
|
763
|
-
readonly name: "
|
|
763
|
+
readonly name: "ol_segment_delete";
|
|
764
764
|
readonly title: "Delete Segment (Permanent)";
|
|
765
765
|
readonly description: "Permanently delete a segment. Cannot be undone. Check segment_get_resources first to see what uses this segment.";
|
|
766
766
|
readonly readOnly: false;
|
|
@@ -771,7 +771,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
771
771
|
};
|
|
772
772
|
readonly handler: typeof segmentDelete;
|
|
773
773
|
}, {
|
|
774
|
-
readonly name: "
|
|
774
|
+
readonly name: "ol_segment_get_members";
|
|
775
775
|
readonly title: "Get Segment Members";
|
|
776
776
|
readonly description: "Get members belonging to a segment. Returns paginated list of member details. Use for verifying segment criteria or exporting member lists.";
|
|
777
777
|
readonly readOnly: true;
|
|
@@ -783,7 +783,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
783
783
|
};
|
|
784
784
|
readonly handler: typeof segmentGetMembers;
|
|
785
785
|
}, {
|
|
786
|
-
readonly name: "
|
|
786
|
+
readonly name: "ol_segment_activate";
|
|
787
787
|
readonly title: "Activate Segment";
|
|
788
788
|
readonly description: "Activate a segment. Active segments are used for campaign targeting and can be queried for members.";
|
|
789
789
|
readonly readOnly: false;
|
|
@@ -793,7 +793,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
793
793
|
};
|
|
794
794
|
readonly handler: typeof segmentActivate;
|
|
795
795
|
}, {
|
|
796
|
-
readonly name: "
|
|
796
|
+
readonly name: "ol_segment_deactivate";
|
|
797
797
|
readonly title: "Deactivate Segment";
|
|
798
798
|
readonly description: "Deactivate a segment. Deactivated segments are not used for campaign targeting but retain their configuration.";
|
|
799
799
|
readonly readOnly: false;
|
|
@@ -803,7 +803,7 @@ export declare const segmentToolDefinitions: readonly [{
|
|
|
803
803
|
};
|
|
804
804
|
readonly handler: typeof segmentDeactivate;
|
|
805
805
|
}, {
|
|
806
|
-
readonly name: "
|
|
806
|
+
readonly name: "ol_segment_get_resources";
|
|
807
807
|
readonly title: "Get Segment Resources";
|
|
808
808
|
readonly description: "Get resources (campaigns, rewards, etc.) that use this segment for targeting. Check before deleting a segment.";
|
|
809
809
|
readonly readOnly: true;
|