@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,395 @@
|
|
|
1
|
+
export { SegmentListInputSchema, SegmentCreateInputSchema, SegmentGetInputSchema, SegmentUpdateInputSchema, SegmentDeleteInputSchema, SegmentGetMembersInputSchema, SegmentActivateInputSchema, SegmentDeactivateInputSchema, SegmentGetResourcesInputSchema, } from "./schemas.js";
|
|
2
|
+
export { segmentList, segmentCreate, segmentGet, segmentUpdate, segmentDelete, segmentGetMembers, segmentActivate, segmentDeactivate, segmentGetResources, } from "./handlers.js";
|
|
3
|
+
import { segmentList, segmentCreate, segmentGet, segmentUpdate, segmentDelete, segmentGetMembers, segmentActivate, segmentDeactivate, segmentGetResources } from "./handlers.js";
|
|
4
|
+
export declare const segmentToolDefinitions: readonly [{
|
|
5
|
+
readonly name: "ol_segment_list";
|
|
6
|
+
readonly title: "List Segments";
|
|
7
|
+
readonly description: "List customer segments. Segments group members by criteria (purchase behavior, tier, location, etc). Use for campaign targeting and analytics.";
|
|
8
|
+
readonly readOnly: true;
|
|
9
|
+
readonly inputSchema: {
|
|
10
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
12
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
active: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
14
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
};
|
|
16
|
+
readonly handler: typeof segmentList;
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "ol_segment_create";
|
|
19
|
+
readonly title: "Create Segment";
|
|
20
|
+
readonly description: string;
|
|
21
|
+
readonly readOnly: false;
|
|
22
|
+
readonly inputSchema: {
|
|
23
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
24
|
+
name: import("zod").ZodString;
|
|
25
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
26
|
+
active: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
27
|
+
parts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
28
|
+
segmentPartId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
criteria: import("zod").ZodArray<import("zod").ZodObject<{
|
|
30
|
+
type: import("zod").ZodString;
|
|
31
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
33
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
34
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
36
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
37
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
38
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
39
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
40
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
41
|
+
key: import("zod").ZodString;
|
|
42
|
+
value: import("zod").ZodString;
|
|
43
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
44
|
+
value: string;
|
|
45
|
+
key: string;
|
|
46
|
+
}, {
|
|
47
|
+
value: string;
|
|
48
|
+
key: string;
|
|
49
|
+
}>, "many">>;
|
|
50
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
51
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
52
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
53
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
56
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
57
|
+
type: import("zod").ZodString;
|
|
58
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
60
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
61
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
62
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
63
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
64
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
65
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
66
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
67
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
68
|
+
key: import("zod").ZodString;
|
|
69
|
+
value: import("zod").ZodString;
|
|
70
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
71
|
+
value: string;
|
|
72
|
+
key: string;
|
|
73
|
+
}, {
|
|
74
|
+
value: string;
|
|
75
|
+
key: string;
|
|
76
|
+
}>, "many">>;
|
|
77
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
78
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
80
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
81
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
82
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
83
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
84
|
+
type: import("zod").ZodString;
|
|
85
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
86
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
87
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
88
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
89
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
90
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
91
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
92
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
93
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
94
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
95
|
+
key: import("zod").ZodString;
|
|
96
|
+
value: import("zod").ZodString;
|
|
97
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
98
|
+
value: string;
|
|
99
|
+
key: string;
|
|
100
|
+
}, {
|
|
101
|
+
value: string;
|
|
102
|
+
key: string;
|
|
103
|
+
}>, "many">>;
|
|
104
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
105
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
106
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
107
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
110
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
111
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
112
|
+
criteria: import("zod").objectOutputType<{
|
|
113
|
+
type: import("zod").ZodString;
|
|
114
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
115
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
116
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
117
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
118
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
119
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
120
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
121
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
122
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
123
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
124
|
+
key: import("zod").ZodString;
|
|
125
|
+
value: import("zod").ZodString;
|
|
126
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
127
|
+
value: string;
|
|
128
|
+
key: string;
|
|
129
|
+
}, {
|
|
130
|
+
value: string;
|
|
131
|
+
key: string;
|
|
132
|
+
}>, "many">>;
|
|
133
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
134
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
135
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
136
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
137
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
138
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
139
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
140
|
+
segmentPartId?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
criteria: import("zod").objectInputType<{
|
|
143
|
+
type: import("zod").ZodString;
|
|
144
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
145
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
146
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
147
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
148
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
149
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
150
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
151
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
152
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
153
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
154
|
+
key: import("zod").ZodString;
|
|
155
|
+
value: import("zod").ZodString;
|
|
156
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
157
|
+
value: string;
|
|
158
|
+
key: string;
|
|
159
|
+
}, {
|
|
160
|
+
value: string;
|
|
161
|
+
key: string;
|
|
162
|
+
}>, "many">>;
|
|
163
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
164
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
165
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
166
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
167
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
168
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
169
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
170
|
+
segmentPartId?: string | undefined;
|
|
171
|
+
}>, "many">;
|
|
172
|
+
};
|
|
173
|
+
readonly handler: typeof segmentCreate;
|
|
174
|
+
}, {
|
|
175
|
+
readonly name: "ol_segment_get";
|
|
176
|
+
readonly title: "Get Segment Details";
|
|
177
|
+
readonly description: "Get full segment details including all parts and criteria configurations.";
|
|
178
|
+
readonly readOnly: true;
|
|
179
|
+
readonly inputSchema: {
|
|
180
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
181
|
+
segmentId: import("zod").ZodString;
|
|
182
|
+
};
|
|
183
|
+
readonly handler: typeof segmentGet;
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "ol_segment_update";
|
|
186
|
+
readonly title: "Update Segment";
|
|
187
|
+
readonly description: "Update segment configuration. Requires full segment definition (name, parts with criteria). Use segment_get first to retrieve current configuration.";
|
|
188
|
+
readonly readOnly: false;
|
|
189
|
+
readonly inputSchema: {
|
|
190
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
191
|
+
segmentId: import("zod").ZodString;
|
|
192
|
+
name: import("zod").ZodString;
|
|
193
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
194
|
+
active: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
195
|
+
parts: import("zod").ZodArray<import("zod").ZodObject<{
|
|
196
|
+
segmentPartId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
197
|
+
criteria: import("zod").ZodArray<import("zod").ZodObject<{
|
|
198
|
+
type: import("zod").ZodString;
|
|
199
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
200
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
201
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
202
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
203
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
204
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
205
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
206
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
207
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
208
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
209
|
+
key: import("zod").ZodString;
|
|
210
|
+
value: import("zod").ZodString;
|
|
211
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
212
|
+
value: string;
|
|
213
|
+
key: string;
|
|
214
|
+
}, {
|
|
215
|
+
value: string;
|
|
216
|
+
key: string;
|
|
217
|
+
}>, "many">>;
|
|
218
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
219
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
220
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
221
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
222
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
223
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
224
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
225
|
+
type: import("zod").ZodString;
|
|
226
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
227
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
228
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
229
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
230
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
231
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
232
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
233
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
234
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
235
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
236
|
+
key: import("zod").ZodString;
|
|
237
|
+
value: import("zod").ZodString;
|
|
238
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
239
|
+
value: string;
|
|
240
|
+
key: string;
|
|
241
|
+
}, {
|
|
242
|
+
value: string;
|
|
243
|
+
key: string;
|
|
244
|
+
}>, "many">>;
|
|
245
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
246
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
247
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
248
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
249
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
250
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
251
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
252
|
+
type: import("zod").ZodString;
|
|
253
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
254
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
255
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
256
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
257
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
258
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
259
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
260
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
261
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
262
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
263
|
+
key: import("zod").ZodString;
|
|
264
|
+
value: import("zod").ZodString;
|
|
265
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
266
|
+
value: string;
|
|
267
|
+
key: string;
|
|
268
|
+
}, {
|
|
269
|
+
value: string;
|
|
270
|
+
key: string;
|
|
271
|
+
}>, "many">>;
|
|
272
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
273
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
274
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
275
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
276
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
277
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
278
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
279
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
280
|
+
criteria: import("zod").objectOutputType<{
|
|
281
|
+
type: import("zod").ZodString;
|
|
282
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
283
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
284
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
285
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
286
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
287
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
288
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
289
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
290
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
291
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
292
|
+
key: import("zod").ZodString;
|
|
293
|
+
value: import("zod").ZodString;
|
|
294
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
295
|
+
value: string;
|
|
296
|
+
key: string;
|
|
297
|
+
}, {
|
|
298
|
+
value: string;
|
|
299
|
+
key: string;
|
|
300
|
+
}>, "many">>;
|
|
301
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
302
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
303
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
304
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
305
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
306
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
307
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
308
|
+
segmentPartId?: string | undefined;
|
|
309
|
+
}, {
|
|
310
|
+
criteria: import("zod").objectInputType<{
|
|
311
|
+
type: import("zod").ZodString;
|
|
312
|
+
criterionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
313
|
+
days: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
314
|
+
fromDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
315
|
+
toDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
316
|
+
min: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
317
|
+
max: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
318
|
+
posIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
319
|
+
skus: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
320
|
+
makers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
321
|
+
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
|
|
322
|
+
key: import("zod").ZodString;
|
|
323
|
+
value: import("zod").ZodString;
|
|
324
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
325
|
+
value: string;
|
|
326
|
+
key: string;
|
|
327
|
+
}, {
|
|
328
|
+
value: string;
|
|
329
|
+
key: string;
|
|
330
|
+
}>, "many">>;
|
|
331
|
+
tierIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
332
|
+
campaignId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
333
|
+
countries: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
334
|
+
anniversaryType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
335
|
+
customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
336
|
+
customAttributeValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
337
|
+
}, import("zod").ZodTypeAny, "passthrough">[];
|
|
338
|
+
segmentPartId?: string | undefined;
|
|
339
|
+
}>, "many">;
|
|
340
|
+
};
|
|
341
|
+
readonly handler: typeof segmentUpdate;
|
|
342
|
+
}, {
|
|
343
|
+
readonly name: "ol_segment_delete";
|
|
344
|
+
readonly title: "Delete Segment (Permanent)";
|
|
345
|
+
readonly description: "Permanently delete a segment. Cannot be undone. Check segment_get_resources first to see what uses this segment.";
|
|
346
|
+
readonly readOnly: false;
|
|
347
|
+
readonly destructive: true;
|
|
348
|
+
readonly inputSchema: {
|
|
349
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
350
|
+
segmentId: import("zod").ZodString;
|
|
351
|
+
};
|
|
352
|
+
readonly handler: typeof segmentDelete;
|
|
353
|
+
}, {
|
|
354
|
+
readonly name: "ol_segment_get_members";
|
|
355
|
+
readonly title: "Get Segment Members";
|
|
356
|
+
readonly description: "Get members belonging to a segment. Returns paginated list of member details. Use for verifying segment criteria or exporting member lists.";
|
|
357
|
+
readonly readOnly: true;
|
|
358
|
+
readonly inputSchema: {
|
|
359
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
360
|
+
segmentId: import("zod").ZodString;
|
|
361
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
362
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
363
|
+
};
|
|
364
|
+
readonly handler: typeof segmentGetMembers;
|
|
365
|
+
}, {
|
|
366
|
+
readonly name: "ol_segment_activate";
|
|
367
|
+
readonly title: "Activate Segment";
|
|
368
|
+
readonly description: "Activate a segment. Active segments are used for campaign targeting and can be queried for members.";
|
|
369
|
+
readonly readOnly: false;
|
|
370
|
+
readonly inputSchema: {
|
|
371
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
372
|
+
segmentId: import("zod").ZodString;
|
|
373
|
+
};
|
|
374
|
+
readonly handler: typeof segmentActivate;
|
|
375
|
+
}, {
|
|
376
|
+
readonly name: "ol_segment_deactivate";
|
|
377
|
+
readonly title: "Deactivate Segment";
|
|
378
|
+
readonly description: "Deactivate a segment. Deactivated segments are not used for campaign targeting but retain their configuration.";
|
|
379
|
+
readonly readOnly: false;
|
|
380
|
+
readonly inputSchema: {
|
|
381
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
382
|
+
segmentId: import("zod").ZodString;
|
|
383
|
+
};
|
|
384
|
+
readonly handler: typeof segmentDeactivate;
|
|
385
|
+
}, {
|
|
386
|
+
readonly name: "ol_segment_get_resources";
|
|
387
|
+
readonly title: "Get Segment Resources";
|
|
388
|
+
readonly description: string;
|
|
389
|
+
readonly readOnly: true;
|
|
390
|
+
readonly inputSchema: {
|
|
391
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
392
|
+
segmentId: import("zod").ZodString;
|
|
393
|
+
};
|
|
394
|
+
readonly handler: typeof segmentGetResources;
|
|
395
|
+
}];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Re-export schemas
|
|
2
|
+
export { SegmentListInputSchema, SegmentCreateInputSchema, SegmentGetInputSchema, SegmentUpdateInputSchema, SegmentDeleteInputSchema, SegmentGetMembersInputSchema, SegmentActivateInputSchema, SegmentDeactivateInputSchema, SegmentGetResourcesInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { segmentList, segmentCreate, segmentGet, segmentUpdate, segmentDelete, segmentGetMembers, segmentActivate, segmentDeactivate, segmentGetResources, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { SegmentListInputSchema, SegmentCreateInputSchema, SegmentGetInputSchema, SegmentUpdateInputSchema, SegmentDeleteInputSchema, SegmentGetMembersInputSchema, SegmentActivateInputSchema, SegmentDeactivateInputSchema, SegmentGetResourcesInputSchema, } from "./schemas.js";
|
|
7
|
+
import { segmentList, segmentCreate, segmentGet, segmentUpdate, segmentDelete, segmentGetMembers, segmentActivate, segmentDeactivate, segmentGetResources, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const segmentToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_segment_list",
|
|
12
|
+
title: "List Segments",
|
|
13
|
+
description: "List customer segments. Segments group members by criteria (purchase behavior, tier, location, etc). Use for campaign targeting and analytics.",
|
|
14
|
+
readOnly: true,
|
|
15
|
+
inputSchema: SegmentListInputSchema,
|
|
16
|
+
handler: segmentList,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "ol_segment_create",
|
|
20
|
+
title: "Create Segment",
|
|
21
|
+
description: "Create segment to group members. " +
|
|
22
|
+
"⚠️ ONLY 'transaction_count' criterion type works reliably. 'tier' and 'points_balance' are REJECTED by the API. " +
|
|
23
|
+
"REQUIRED: name, parts array with criteria. " +
|
|
24
|
+
"Example for 5+ purchases: { name: 'Frequent Buyers', parts: [{ criteria: [{ type: 'transaction_count', min: 5 }] }], active: true }. " +
|
|
25
|
+
"Parts use OR logic (ANY part matches), criteria within parts use AND logic (ALL criteria must match).",
|
|
26
|
+
readOnly: false,
|
|
27
|
+
inputSchema: SegmentCreateInputSchema,
|
|
28
|
+
handler: segmentCreate,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "ol_segment_get",
|
|
32
|
+
title: "Get Segment Details",
|
|
33
|
+
description: "Get full segment details including all parts and criteria configurations.",
|
|
34
|
+
readOnly: true,
|
|
35
|
+
inputSchema: SegmentGetInputSchema,
|
|
36
|
+
handler: segmentGet,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "ol_segment_update",
|
|
40
|
+
title: "Update Segment",
|
|
41
|
+
description: "Update segment configuration. Requires full segment definition (name, parts with criteria). Use segment_get first to retrieve current configuration.",
|
|
42
|
+
readOnly: false,
|
|
43
|
+
inputSchema: SegmentUpdateInputSchema,
|
|
44
|
+
handler: segmentUpdate,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "ol_segment_delete",
|
|
48
|
+
title: "Delete Segment (Permanent)",
|
|
49
|
+
description: "Permanently delete a segment. Cannot be undone. Check segment_get_resources first to see what uses this segment.",
|
|
50
|
+
readOnly: false,
|
|
51
|
+
destructive: true,
|
|
52
|
+
inputSchema: SegmentDeleteInputSchema,
|
|
53
|
+
handler: segmentDelete,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ol_segment_get_members",
|
|
57
|
+
title: "Get Segment Members",
|
|
58
|
+
description: "Get members belonging to a segment. Returns paginated list of member details. Use for verifying segment criteria or exporting member lists.",
|
|
59
|
+
readOnly: true,
|
|
60
|
+
inputSchema: SegmentGetMembersInputSchema,
|
|
61
|
+
handler: segmentGetMembers,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "ol_segment_activate",
|
|
65
|
+
title: "Activate Segment",
|
|
66
|
+
description: "Activate a segment. Active segments are used for campaign targeting and can be queried for members.",
|
|
67
|
+
readOnly: false,
|
|
68
|
+
inputSchema: SegmentActivateInputSchema,
|
|
69
|
+
handler: segmentActivate,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "ol_segment_deactivate",
|
|
73
|
+
title: "Deactivate Segment",
|
|
74
|
+
description: "Deactivate a segment. Deactivated segments are not used for campaign targeting but retain their configuration.",
|
|
75
|
+
readOnly: false,
|
|
76
|
+
inputSchema: SegmentDeactivateInputSchema,
|
|
77
|
+
handler: segmentDeactivate,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "ol_segment_get_resources",
|
|
81
|
+
title: "Get Segment Resources",
|
|
82
|
+
description: "Get resources (campaigns, rewards, etc.) that use this segment for targeting. Check before deleting a segment. " +
|
|
83
|
+
"NOTE: This endpoint may not be available in all API versions - if it returns NOT_FOUND, manually check campaigns and rewards that reference this segment.",
|
|
84
|
+
readOnly: true,
|
|
85
|
+
inputSchema: SegmentGetResourcesInputSchema,
|
|
86
|
+
handler: segmentGetResources,
|
|
87
|
+
},
|
|
88
|
+
];
|