@open-loyalty/mcp-server 1.3.7 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +18 -5
- package/dist/tools/reward/handlers.d.ts +2 -0
- package/dist/tools/reward/handlers.js +52 -6
- package/dist/tools/reward/index.d.ts +2 -0
- package/dist/tools/reward/index.js +13 -7
- package/dist/tools/reward/schemas.d.ts +2 -0
- package/dist/tools/reward/schemas.js +15 -5
- package/dist/tools/tierset.d.ts +1 -1
- package/dist/tools/tierset.js +49 -25
- package/dist/tools/transaction.js +5 -2
- package/dist/tools/wallet-type.js +26 -17
- package/dist/types/schemas/admin.d.ts +6 -6
- package/dist/types/schemas/role.d.ts +4 -4
- package/package.json +1 -1
- package/dist/prompts/fan-engagement-setup.d.ts +0 -107
- package/dist/prompts/fan-engagement-setup.js +0 -492
- package/dist/tools/achievement.d.ts +0 -1017
- package/dist/tools/achievement.js +0 -354
- package/dist/tools/campaign.d.ts +0 -1800
- package/dist/tools/campaign.js +0 -737
- package/dist/tools/member.d.ts +0 -366
- package/dist/tools/member.js +0 -352
- package/dist/tools/reward.d.ts +0 -279
- package/dist/tools/reward.js +0 -361
- package/dist/tools/segment.d.ts +0 -816
- package/dist/tools/segment.js +0 -333
- package/dist/workflows/app-login-streak.d.ts +0 -39
- package/dist/workflows/app-login-streak.js +0 -298
- package/dist/workflows/early-arrival.d.ts +0 -33
- package/dist/workflows/early-arrival.js +0 -148
- package/dist/workflows/index.d.ts +0 -101
- package/dist/workflows/index.js +0 -208
- package/dist/workflows/match-attendance.d.ts +0 -45
- package/dist/workflows/match-attendance.js +0 -308
- package/dist/workflows/sportsbar-visit.d.ts +0 -41
- package/dist/workflows/sportsbar-visit.js +0 -284
- package/dist/workflows/vod-watching.d.ts +0 -43
- package/dist/workflows/vod-watching.js +0 -326
package/dist/tools/member.js
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { apiGet, apiPost, apiPut, apiDelete } from "../client/http.js";
|
|
3
|
-
import { MemberSchema, } from "../types/schemas/member.js";
|
|
4
|
-
import { formatApiError } from "../utils/errors.js";
|
|
5
|
-
import { getStoreCode } from "../config.js";
|
|
6
|
-
import { buildPaginationParams } from "../utils/pagination.js";
|
|
7
|
-
import { omitUndefined } from "../utils/payload.js";
|
|
8
|
-
// Input Schemas
|
|
9
|
-
export const MemberCreateInputSchema = {
|
|
10
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
11
|
-
email: z.string().describe("Member email address (required, must be unique)."),
|
|
12
|
-
firstName: z.string().optional().describe("Member first name."),
|
|
13
|
-
lastName: z.string().optional().describe("Member last name."),
|
|
14
|
-
phone: z.string().optional().describe("Member phone number."),
|
|
15
|
-
birthDate: z.string().optional().describe("Member birth date (YYYY-MM-DD format)."),
|
|
16
|
-
gender: z.enum(["male", "female", "not_disclosed"]).optional().describe("Member gender."),
|
|
17
|
-
loyaltyCardNumber: z.string().optional().describe("Loyalty card number. Auto-generated if not provided."),
|
|
18
|
-
agreement1: z.boolean().optional().describe("Terms acceptance."),
|
|
19
|
-
agreement2: z.boolean().optional().describe("Marketing consent."),
|
|
20
|
-
agreement3: z.boolean().optional().describe("Additional agreement."),
|
|
21
|
-
address: z.object({
|
|
22
|
-
street: z.string().optional(),
|
|
23
|
-
city: z.string().optional(),
|
|
24
|
-
postal: z.string().optional(),
|
|
25
|
-
country: z.string().optional(),
|
|
26
|
-
province: z.string().optional(),
|
|
27
|
-
}).optional().describe("Member address."),
|
|
28
|
-
};
|
|
29
|
-
export const MemberGetInputSchema = {
|
|
30
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
31
|
-
memberId: z.string().describe("The member ID (UUID) to retrieve."),
|
|
32
|
-
};
|
|
33
|
-
export const MemberListInputSchema = {
|
|
34
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
35
|
-
cursor: z.string().optional().describe("Pagination cursor from previous response. If provided, page/perPage are ignored."),
|
|
36
|
-
page: z.number().optional().describe("Page number (default: 1)."),
|
|
37
|
-
perPage: z.number().optional().describe("Items per page (default: 10)."),
|
|
38
|
-
email: z.string().optional().describe("Filter by email address."),
|
|
39
|
-
firstName: z.string().optional().describe("Filter by first name."),
|
|
40
|
-
lastName: z.string().optional().describe("Filter by last name."),
|
|
41
|
-
phone: z.string().optional().describe("Filter by phone number."),
|
|
42
|
-
loyaltyCardNumber: z.string().optional().describe("Filter by loyalty card number."),
|
|
43
|
-
active: z.boolean().optional().describe("Filter by active status."),
|
|
44
|
-
};
|
|
45
|
-
export const MemberUpdateInputSchema = {
|
|
46
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
47
|
-
memberId: z.string().describe("The member ID (UUID) to update."),
|
|
48
|
-
firstName: z.string().optional().describe("Member first name."),
|
|
49
|
-
lastName: z.string().optional().describe("Member last name."),
|
|
50
|
-
phone: z.string().optional().describe("Member phone number."),
|
|
51
|
-
birthDate: z.string().optional().describe("Member birth date (YYYY-MM-DD format)."),
|
|
52
|
-
gender: z.enum(["male", "female", "not_disclosed"]).optional().describe("Member gender."),
|
|
53
|
-
address: z.object({
|
|
54
|
-
street: z.string().optional(),
|
|
55
|
-
city: z.string().optional(),
|
|
56
|
-
postal: z.string().optional(),
|
|
57
|
-
country: z.string().optional(),
|
|
58
|
-
province: z.string().optional(),
|
|
59
|
-
}).optional().describe("Member address."),
|
|
60
|
-
agreement1: z.boolean().optional().describe("Terms acceptance."),
|
|
61
|
-
agreement2: z.boolean().optional().describe("Marketing consent."),
|
|
62
|
-
agreement3: z.boolean().optional().describe("Additional agreement."),
|
|
63
|
-
};
|
|
64
|
-
export const MemberIdInputSchema = {
|
|
65
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
66
|
-
memberId: z.string().describe("The member ID (UUID)."),
|
|
67
|
-
};
|
|
68
|
-
export const MemberAssignTierInputSchema = {
|
|
69
|
-
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
70
|
-
memberId: z.string().describe("The member ID (UUID)."),
|
|
71
|
-
levelId: z.string().describe("The tier level ID (UUID) to assign."),
|
|
72
|
-
};
|
|
73
|
-
// Handler functions
|
|
74
|
-
export async function memberCreate(input) {
|
|
75
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
76
|
-
const payload = omitUndefined({
|
|
77
|
-
email: input.email,
|
|
78
|
-
firstName: input.firstName,
|
|
79
|
-
lastName: input.lastName,
|
|
80
|
-
phone: input.phone,
|
|
81
|
-
birthDate: input.birthDate,
|
|
82
|
-
gender: input.gender,
|
|
83
|
-
loyaltyCardNumber: input.loyaltyCardNumber,
|
|
84
|
-
agreement1: input.agreement1,
|
|
85
|
-
agreement2: input.agreement2,
|
|
86
|
-
agreement3: input.agreement3,
|
|
87
|
-
address: input.address,
|
|
88
|
-
});
|
|
89
|
-
try {
|
|
90
|
-
const response = await apiPost(`/${storeCode}/member`, { customer: payload });
|
|
91
|
-
return {
|
|
92
|
-
memberId: response.customerId,
|
|
93
|
-
loyaltyCardNumber: response.loyaltyCardNumber || "",
|
|
94
|
-
email: response.email,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
throw formatApiError(error, "openloyalty_member_create");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
export async function memberGet(input) {
|
|
102
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
103
|
-
try {
|
|
104
|
-
const response = await apiGet(`/${storeCode}/member/${input.memberId}`);
|
|
105
|
-
// Map API response to our schema
|
|
106
|
-
const data = response;
|
|
107
|
-
const mapped = {
|
|
108
|
-
memberId: data.customerId || data.memberId,
|
|
109
|
-
email: data.email,
|
|
110
|
-
firstName: data.firstName,
|
|
111
|
-
lastName: data.lastName,
|
|
112
|
-
phone: data.phone,
|
|
113
|
-
birthDate: data.birthDate,
|
|
114
|
-
gender: data.gender,
|
|
115
|
-
loyaltyCardNumber: data.loyaltyCardNumber,
|
|
116
|
-
active: data.active ?? true,
|
|
117
|
-
createdAt: data.createdAt,
|
|
118
|
-
address: data.address,
|
|
119
|
-
agreement1: data.agreement1,
|
|
120
|
-
agreement2: data.agreement2,
|
|
121
|
-
agreement3: data.agreement3,
|
|
122
|
-
levelId: data.levelId || data.level?.levelId,
|
|
123
|
-
levelName: data.levelName || data.level?.name,
|
|
124
|
-
points: data.points,
|
|
125
|
-
};
|
|
126
|
-
return MemberSchema.parse(mapped);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
throw formatApiError(error, "openloyalty_member_get");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
export async function memberList(input) {
|
|
133
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
134
|
-
const params = new URLSearchParams();
|
|
135
|
-
// Use buildPaginationParams for cursor/page handling
|
|
136
|
-
buildPaginationParams({ cursor: input.cursor, page: input.page, perPage: input.perPage }, params);
|
|
137
|
-
if (input.email)
|
|
138
|
-
params.append("email", input.email);
|
|
139
|
-
if (input.firstName)
|
|
140
|
-
params.append("firstName", input.firstName);
|
|
141
|
-
if (input.lastName)
|
|
142
|
-
params.append("lastName", input.lastName);
|
|
143
|
-
if (input.phone)
|
|
144
|
-
params.append("phone", input.phone);
|
|
145
|
-
if (input.loyaltyCardNumber)
|
|
146
|
-
params.append("loyaltyCardNumber", input.loyaltyCardNumber);
|
|
147
|
-
if (input.active !== undefined)
|
|
148
|
-
params.append("active", String(input.active));
|
|
149
|
-
const queryString = params.toString();
|
|
150
|
-
const url = `/${storeCode}/member${queryString ? `?${queryString}` : ""}`;
|
|
151
|
-
try {
|
|
152
|
-
const response = await apiGet(url);
|
|
153
|
-
const members = (response.items || []).map((c) => {
|
|
154
|
-
const customer = c;
|
|
155
|
-
return {
|
|
156
|
-
memberId: (customer.customerId || customer.memberId),
|
|
157
|
-
email: customer.email,
|
|
158
|
-
firstName: customer.firstName,
|
|
159
|
-
lastName: customer.lastName,
|
|
160
|
-
loyaltyCardNumber: customer.loyaltyCardNumber,
|
|
161
|
-
active: (customer.active ?? true),
|
|
162
|
-
};
|
|
163
|
-
});
|
|
164
|
-
const total = response.total || {};
|
|
165
|
-
return {
|
|
166
|
-
members,
|
|
167
|
-
total: {
|
|
168
|
-
all: typeof total.all === 'number' ? total.all : undefined,
|
|
169
|
-
filtered: typeof total.filtered === 'number' ? total.filtered : undefined,
|
|
170
|
-
},
|
|
171
|
-
cursor: response.scroll,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
throw formatApiError(error, "openloyalty_member_list");
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
export async function memberUpdate(input) {
|
|
179
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
180
|
-
const payload = omitUndefined({
|
|
181
|
-
firstName: input.firstName,
|
|
182
|
-
lastName: input.lastName,
|
|
183
|
-
phone: input.phone,
|
|
184
|
-
birthDate: input.birthDate,
|
|
185
|
-
gender: input.gender,
|
|
186
|
-
address: input.address,
|
|
187
|
-
agreement1: input.agreement1,
|
|
188
|
-
agreement2: input.agreement2,
|
|
189
|
-
agreement3: input.agreement3,
|
|
190
|
-
});
|
|
191
|
-
try {
|
|
192
|
-
await apiPut(`/${storeCode}/member/${input.memberId}`, { customer: payload });
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
throw formatApiError(error, "openloyalty_member_update");
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
export async function memberActivate(input) {
|
|
199
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
200
|
-
try {
|
|
201
|
-
await apiPost(`/${storeCode}/member/${input.memberId}/activate`);
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
throw formatApiError(error, "openloyalty_member_activate");
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
export async function memberDeactivate(input) {
|
|
208
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
209
|
-
try {
|
|
210
|
-
await apiPost(`/${storeCode}/member/${input.memberId}/deactivate`);
|
|
211
|
-
}
|
|
212
|
-
catch (error) {
|
|
213
|
-
throw formatApiError(error, "openloyalty_member_deactivate");
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
export async function memberDelete(input) {
|
|
217
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
218
|
-
try {
|
|
219
|
-
await apiDelete(`/${storeCode}/member/${input.memberId}`);
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
throw formatApiError(error, "openloyalty_member_delete");
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
export async function memberGetTierProgress(input) {
|
|
226
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
227
|
-
try {
|
|
228
|
-
const response = await apiGet(`/${storeCode}/member/${input.memberId}/tier`);
|
|
229
|
-
const currentLevel = response.currentLevel;
|
|
230
|
-
const nextLevel = response.nextLevel;
|
|
231
|
-
return {
|
|
232
|
-
currentTier: currentLevel ? {
|
|
233
|
-
levelId: currentLevel.levelId,
|
|
234
|
-
name: currentLevel.name,
|
|
235
|
-
} : undefined,
|
|
236
|
-
nextTier: nextLevel ? {
|
|
237
|
-
levelId: nextLevel.levelId,
|
|
238
|
-
name: nextLevel.name,
|
|
239
|
-
} : undefined,
|
|
240
|
-
currentValue: (response.currentValue || 0),
|
|
241
|
-
requiredValue: response.requiredValue,
|
|
242
|
-
progressPercent: (response.progressPercent || response.progress || 0),
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
catch (error) {
|
|
246
|
-
throw formatApiError(error, "openloyalty_member_get_tier_progress");
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
export async function memberAssignTier(input) {
|
|
250
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
251
|
-
try {
|
|
252
|
-
await apiPost(`/${storeCode}/member/${input.memberId}/tier`, { levelId: input.levelId });
|
|
253
|
-
}
|
|
254
|
-
catch (error) {
|
|
255
|
-
throw formatApiError(error, "openloyalty_member_assign_tier");
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
export async function memberRemoveManualTier(input) {
|
|
259
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
260
|
-
try {
|
|
261
|
-
// API uses POST to /remove-manually-level, not DELETE to /tier
|
|
262
|
-
await apiPost(`/${storeCode}/member/${input.memberId}/remove-manually-level`);
|
|
263
|
-
}
|
|
264
|
-
catch (error) {
|
|
265
|
-
throw formatApiError(error, "openloyalty_member_remove_manual_tier");
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
// Tool definitions
|
|
269
|
-
export const memberToolDefinitions = [
|
|
270
|
-
{
|
|
271
|
-
name: "openloyalty_member_create",
|
|
272
|
-
title: "Register New Member",
|
|
273
|
-
description: "Register a new loyalty program member. Returns memberId for subsequent operations like points_add or member_get. Email must be unique within the store.",
|
|
274
|
-
readOnly: false,
|
|
275
|
-
inputSchema: MemberCreateInputSchema,
|
|
276
|
-
handler: memberCreate,
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
name: "openloyalty_member_get",
|
|
280
|
-
title: "Get Member Profile",
|
|
281
|
-
description: "Get member details including profile, points balance, and tier status. Use memberId from member_create or member_list.",
|
|
282
|
-
readOnly: true,
|
|
283
|
-
inputSchema: MemberGetInputSchema,
|
|
284
|
-
handler: memberGet,
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
name: "openloyalty_member_list",
|
|
288
|
-
title: "Search Members",
|
|
289
|
-
description: "Search and list members with optional filters. Use member_get for full details of a specific member. " +
|
|
290
|
-
"Supports cursor pagination: provide 'cursor' from previous response to get next page.",
|
|
291
|
-
readOnly: true,
|
|
292
|
-
inputSchema: MemberListInputSchema,
|
|
293
|
-
handler: memberList,
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
name: "openloyalty_member_update",
|
|
297
|
-
title: "Update Member Profile",
|
|
298
|
-
description: "Update member profile fields. Cannot change email. Use member_get first to see current values.",
|
|
299
|
-
readOnly: false,
|
|
300
|
-
inputSchema: MemberUpdateInputSchema,
|
|
301
|
-
handler: memberUpdate,
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
name: "openloyalty_member_activate",
|
|
305
|
-
title: "Activate Member Account",
|
|
306
|
-
description: "Activate a member account. Inactive members cannot earn or spend points.",
|
|
307
|
-
readOnly: false,
|
|
308
|
-
inputSchema: MemberIdInputSchema,
|
|
309
|
-
handler: memberActivate,
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
name: "openloyalty_member_deactivate",
|
|
313
|
-
title: "Deactivate Member Account",
|
|
314
|
-
description: "Deactivate a member account. Deactivated members cannot earn or spend points but retain their balance.",
|
|
315
|
-
readOnly: false,
|
|
316
|
-
inputSchema: MemberIdInputSchema,
|
|
317
|
-
handler: memberDeactivate,
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
name: "openloyalty_member_delete",
|
|
321
|
-
title: "Delete Member (Permanent)",
|
|
322
|
-
description: "Permanently removes member and all associated data. Cannot be undone. Use for GDPR compliance or member requests.",
|
|
323
|
-
readOnly: false,
|
|
324
|
-
destructive: true,
|
|
325
|
-
inputSchema: MemberIdInputSchema,
|
|
326
|
-
handler: memberDelete,
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
name: "openloyalty_member_get_tier_progress",
|
|
330
|
-
title: "Check Tier Progress",
|
|
331
|
-
description: "Get member tier progression status showing current tier and progress to next. Returns currentValue, requiredValue, and progressPercent.",
|
|
332
|
-
readOnly: true,
|
|
333
|
-
inputSchema: MemberIdInputSchema,
|
|
334
|
-
handler: memberGetTierProgress,
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
name: "openloyalty_member_assign_tier",
|
|
338
|
-
title: "Assign Tier to Member",
|
|
339
|
-
description: "Manually assign a tier level to a member, overriding automatic tier calculation. Use tierset_get_tiers to find available levelId values.",
|
|
340
|
-
readOnly: false,
|
|
341
|
-
inputSchema: MemberAssignTierInputSchema,
|
|
342
|
-
handler: memberAssignTier,
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
name: "openloyalty_member_remove_manual_tier",
|
|
346
|
-
title: "Remove Manual Tier Assignment",
|
|
347
|
-
description: "Remove manually assigned tier from member, restoring automatic tier calculation based on conditions.",
|
|
348
|
-
readOnly: false,
|
|
349
|
-
inputSchema: MemberIdInputSchema,
|
|
350
|
-
handler: memberRemoveManualTier,
|
|
351
|
-
},
|
|
352
|
-
];
|
package/dist/tools/reward.d.ts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Reward } from "../types/schemas/reward.js";
|
|
3
|
-
export declare const RewardListInputSchema: {
|
|
4
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
5
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
-
type: z.ZodOptional<z.ZodEnum<["static_coupon", "dynamic_coupon", "conversion_coupon", "material", "fortune_wheel"]>>;
|
|
9
|
-
categoryId: z.ZodOptional<z.ZodString>;
|
|
10
|
-
};
|
|
11
|
-
export declare const RewardCreateInputSchema: {
|
|
12
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
13
|
-
name: z.ZodString;
|
|
14
|
-
type: z.ZodEnum<["static_coupon", "dynamic_coupon", "conversion_coupon", "material", "fortune_wheel"]>;
|
|
15
|
-
costInPoints: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
description: z.ZodOptional<z.ZodString>;
|
|
17
|
-
usageInstruction: z.ZodOptional<z.ZodString>;
|
|
18
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
|
-
segments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
-
target: z.ZodOptional<z.ZodNullable<z.ZodEnum<["level", "segment"]>>>;
|
|
23
|
-
couponValue: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
couponValueType: z.ZodOptional<z.ZodEnum<["Money", "Percentage"]>>;
|
|
25
|
-
daysValid: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
};
|
|
27
|
-
export declare const RewardGetInputSchema: {
|
|
28
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
29
|
-
rewardId: z.ZodString;
|
|
30
|
-
};
|
|
31
|
-
export declare const RewardUpdateInputSchema: {
|
|
32
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
33
|
-
rewardId: z.ZodString;
|
|
34
|
-
name: z.ZodOptional<z.ZodString>;
|
|
35
|
-
costInPoints: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
description: z.ZodOptional<z.ZodString>;
|
|
37
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
-
segments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
41
|
-
};
|
|
42
|
-
export declare const RewardIdInputSchema: {
|
|
43
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
44
|
-
rewardId: z.ZodString;
|
|
45
|
-
};
|
|
46
|
-
export declare const RewardBuyInputSchema: {
|
|
47
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
48
|
-
rewardId: z.ZodString;
|
|
49
|
-
memberId: z.ZodString;
|
|
50
|
-
quantity: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
couponValue: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
withoutPoints: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
-
};
|
|
54
|
-
export declare const RewardRedeemInputSchema: {
|
|
55
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
56
|
-
memberId: z.ZodString;
|
|
57
|
-
couponCode: z.ZodString;
|
|
58
|
-
};
|
|
59
|
-
export declare const RewardCategoryListInputSchema: {
|
|
60
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
61
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
62
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
63
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
};
|
|
65
|
-
export declare function rewardList(input: {
|
|
66
|
-
storeCode?: string;
|
|
67
|
-
page?: number;
|
|
68
|
-
perPage?: number;
|
|
69
|
-
active?: boolean;
|
|
70
|
-
type?: string;
|
|
71
|
-
categoryId?: string;
|
|
72
|
-
}): Promise<{
|
|
73
|
-
rewards: Array<{
|
|
74
|
-
rewardId: string;
|
|
75
|
-
name: string;
|
|
76
|
-
type: string;
|
|
77
|
-
costInPoints?: number;
|
|
78
|
-
active: boolean;
|
|
79
|
-
}>;
|
|
80
|
-
total: {
|
|
81
|
-
all?: number;
|
|
82
|
-
filtered?: number;
|
|
83
|
-
};
|
|
84
|
-
}>;
|
|
85
|
-
export declare function rewardCreate(input: {
|
|
86
|
-
storeCode?: string;
|
|
87
|
-
name: string;
|
|
88
|
-
type: string;
|
|
89
|
-
costInPoints?: number;
|
|
90
|
-
description?: string;
|
|
91
|
-
usageInstruction?: string;
|
|
92
|
-
active?: boolean;
|
|
93
|
-
categories?: string[];
|
|
94
|
-
levels?: string[];
|
|
95
|
-
segments?: string[];
|
|
96
|
-
target?: string | null;
|
|
97
|
-
couponValue?: number;
|
|
98
|
-
couponValueType?: string;
|
|
99
|
-
daysValid?: number;
|
|
100
|
-
}): Promise<{
|
|
101
|
-
rewardId: string;
|
|
102
|
-
name: string;
|
|
103
|
-
costInPoints?: number;
|
|
104
|
-
}>;
|
|
105
|
-
export declare function rewardGet(input: {
|
|
106
|
-
storeCode?: string;
|
|
107
|
-
rewardId: string;
|
|
108
|
-
}): Promise<Reward>;
|
|
109
|
-
export declare function rewardUpdate(input: {
|
|
110
|
-
storeCode?: string;
|
|
111
|
-
rewardId: string;
|
|
112
|
-
name?: string;
|
|
113
|
-
costInPoints?: number;
|
|
114
|
-
description?: string;
|
|
115
|
-
active?: boolean;
|
|
116
|
-
categories?: string[];
|
|
117
|
-
levels?: string[];
|
|
118
|
-
segments?: string[];
|
|
119
|
-
}): Promise<void>;
|
|
120
|
-
export declare function rewardActivate(input: {
|
|
121
|
-
storeCode?: string;
|
|
122
|
-
rewardId: string;
|
|
123
|
-
}): Promise<void>;
|
|
124
|
-
export declare function rewardDeactivate(input: {
|
|
125
|
-
storeCode?: string;
|
|
126
|
-
rewardId: string;
|
|
127
|
-
}): Promise<void>;
|
|
128
|
-
export declare function rewardBuy(input: {
|
|
129
|
-
storeCode?: string;
|
|
130
|
-
rewardId: string;
|
|
131
|
-
memberId: string;
|
|
132
|
-
quantity?: number;
|
|
133
|
-
couponValue?: number;
|
|
134
|
-
withoutPoints?: boolean;
|
|
135
|
-
}): Promise<{
|
|
136
|
-
issuedRewardId: string;
|
|
137
|
-
couponCode?: string;
|
|
138
|
-
}>;
|
|
139
|
-
export declare function rewardRedeem(input: {
|
|
140
|
-
storeCode?: string;
|
|
141
|
-
memberId: string;
|
|
142
|
-
couponCode: string;
|
|
143
|
-
}): Promise<{
|
|
144
|
-
code: string;
|
|
145
|
-
used: boolean;
|
|
146
|
-
}>;
|
|
147
|
-
export declare function rewardCategoryList(input: {
|
|
148
|
-
storeCode?: string;
|
|
149
|
-
page?: number;
|
|
150
|
-
perPage?: number;
|
|
151
|
-
active?: boolean;
|
|
152
|
-
}): Promise<{
|
|
153
|
-
categories: Array<{
|
|
154
|
-
categoryId: string;
|
|
155
|
-
name: string;
|
|
156
|
-
active: boolean;
|
|
157
|
-
}>;
|
|
158
|
-
}>;
|
|
159
|
-
export declare const rewardToolDefinitions: readonly [{
|
|
160
|
-
readonly name: "openloyalty_reward_list";
|
|
161
|
-
readonly title: "Browse Rewards";
|
|
162
|
-
readonly description: string;
|
|
163
|
-
readonly readOnly: true;
|
|
164
|
-
readonly inputSchema: {
|
|
165
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
166
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
167
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
168
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
-
type: z.ZodOptional<z.ZodEnum<["static_coupon", "dynamic_coupon", "conversion_coupon", "material", "fortune_wheel"]>>;
|
|
170
|
-
categoryId: z.ZodOptional<z.ZodString>;
|
|
171
|
-
};
|
|
172
|
-
readonly handler: typeof rewardList;
|
|
173
|
-
}, {
|
|
174
|
-
readonly name: "openloyalty_reward_create";
|
|
175
|
-
readonly title: "Create New Reward";
|
|
176
|
-
readonly description: string;
|
|
177
|
-
readonly readOnly: false;
|
|
178
|
-
readonly inputSchema: {
|
|
179
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
180
|
-
name: z.ZodString;
|
|
181
|
-
type: z.ZodEnum<["static_coupon", "dynamic_coupon", "conversion_coupon", "material", "fortune_wheel"]>;
|
|
182
|
-
costInPoints: z.ZodOptional<z.ZodNumber>;
|
|
183
|
-
description: z.ZodOptional<z.ZodString>;
|
|
184
|
-
usageInstruction: z.ZodOptional<z.ZodString>;
|
|
185
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
187
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
188
|
-
segments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
189
|
-
target: z.ZodOptional<z.ZodNullable<z.ZodEnum<["level", "segment"]>>>;
|
|
190
|
-
couponValue: z.ZodOptional<z.ZodNumber>;
|
|
191
|
-
couponValueType: z.ZodOptional<z.ZodEnum<["Money", "Percentage"]>>;
|
|
192
|
-
daysValid: z.ZodOptional<z.ZodNumber>;
|
|
193
|
-
};
|
|
194
|
-
readonly handler: typeof rewardCreate;
|
|
195
|
-
}, {
|
|
196
|
-
readonly name: "openloyalty_reward_get";
|
|
197
|
-
readonly title: "Get Reward Details";
|
|
198
|
-
readonly description: "Get full reward details including configuration, targeting, and coupon settings.";
|
|
199
|
-
readonly readOnly: true;
|
|
200
|
-
readonly inputSchema: {
|
|
201
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
202
|
-
rewardId: z.ZodString;
|
|
203
|
-
};
|
|
204
|
-
readonly handler: typeof rewardGet;
|
|
205
|
-
}, {
|
|
206
|
-
readonly name: "openloyalty_reward_update";
|
|
207
|
-
readonly title: "Update Reward";
|
|
208
|
-
readonly description: "Update reward configuration. Cannot change reward type after creation.";
|
|
209
|
-
readonly readOnly: false;
|
|
210
|
-
readonly inputSchema: {
|
|
211
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
212
|
-
rewardId: z.ZodString;
|
|
213
|
-
name: z.ZodOptional<z.ZodString>;
|
|
214
|
-
costInPoints: z.ZodOptional<z.ZodNumber>;
|
|
215
|
-
description: z.ZodOptional<z.ZodString>;
|
|
216
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
218
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
219
|
-
segments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
220
|
-
};
|
|
221
|
-
readonly handler: typeof rewardUpdate;
|
|
222
|
-
}, {
|
|
223
|
-
readonly name: "openloyalty_reward_activate";
|
|
224
|
-
readonly title: "Activate Reward";
|
|
225
|
-
readonly description: "Activate a reward, making it available for members to redeem.";
|
|
226
|
-
readonly readOnly: false;
|
|
227
|
-
readonly inputSchema: {
|
|
228
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
229
|
-
rewardId: z.ZodString;
|
|
230
|
-
};
|
|
231
|
-
readonly handler: typeof rewardActivate;
|
|
232
|
-
}, {
|
|
233
|
-
readonly name: "openloyalty_reward_deactivate";
|
|
234
|
-
readonly title: "Deactivate Reward";
|
|
235
|
-
readonly description: "Deactivate a reward, hiding it from members. Already purchased rewards remain valid.";
|
|
236
|
-
readonly readOnly: false;
|
|
237
|
-
readonly inputSchema: {
|
|
238
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
239
|
-
rewardId: z.ZodString;
|
|
240
|
-
};
|
|
241
|
-
readonly handler: typeof rewardDeactivate;
|
|
242
|
-
}, {
|
|
243
|
-
readonly name: "openloyalty_reward_buy";
|
|
244
|
-
readonly title: "Redeem Reward for Member";
|
|
245
|
-
readonly description: string;
|
|
246
|
-
readonly readOnly: false;
|
|
247
|
-
readonly inputSchema: {
|
|
248
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
249
|
-
rewardId: z.ZodString;
|
|
250
|
-
memberId: z.ZodString;
|
|
251
|
-
quantity: z.ZodOptional<z.ZodNumber>;
|
|
252
|
-
couponValue: z.ZodOptional<z.ZodNumber>;
|
|
253
|
-
withoutPoints: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
-
};
|
|
255
|
-
readonly handler: typeof rewardBuy;
|
|
256
|
-
}, {
|
|
257
|
-
readonly name: "openloyalty_reward_redeem";
|
|
258
|
-
readonly title: "Use Coupon Code";
|
|
259
|
-
readonly description: string;
|
|
260
|
-
readonly readOnly: false;
|
|
261
|
-
readonly inputSchema: {
|
|
262
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
263
|
-
memberId: z.ZodString;
|
|
264
|
-
couponCode: z.ZodString;
|
|
265
|
-
};
|
|
266
|
-
readonly handler: typeof rewardRedeem;
|
|
267
|
-
}, {
|
|
268
|
-
readonly name: "openloyalty_reward_category_list";
|
|
269
|
-
readonly title: "List Reward Categories";
|
|
270
|
-
readonly description: "List reward categories. Use categoryId when creating or filtering rewards.";
|
|
271
|
-
readonly readOnly: true;
|
|
272
|
-
readonly inputSchema: {
|
|
273
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
274
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
275
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
276
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
-
};
|
|
278
|
-
readonly handler: typeof rewardCategoryList;
|
|
279
|
-
}];
|