@open-loyalty/mcp-server 1.0.3 → 1.3.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/README.md +180 -177
- package/dist/auth/provider.js +2 -14
- package/dist/auth/storage.js +22 -0
- package/dist/client/http.d.ts +5 -0
- package/dist/client/http.js +62 -3
- package/dist/config.d.ts +6 -5
- package/dist/config.js +15 -11
- package/dist/http.js +170 -65
- package/dist/instructions.d.ts +5 -0
- package/dist/instructions.js +420 -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 +68 -278
- 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 +155 -121
- package/dist/tools/achievement.js +82 -39
- package/dist/tools/admin.d.ts +18 -6
- package/dist/tools/admin.js +24 -12
- package/dist/tools/analytics.d.ts +29 -11
- package/dist/tools/analytics.js +58 -48
- package/dist/tools/apikey.d.ts +10 -3
- package/dist/tools/apikey.js +13 -6
- package/dist/tools/audit.d.ts +6 -2
- package/dist/tools/audit.js +8 -4
- package/dist/tools/badge.d.ts +14 -6
- package/dist/tools/badge.js +36 -27
- 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 +112 -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/campaign.d.ts +41 -16
- package/dist/tools/campaign.js +38 -25
- package/dist/tools/custom-event.d.ts +315 -0
- package/dist/tools/custom-event.js +270 -0
- package/dist/tools/export.d.ts +12 -4
- package/dist/tools/export.js +25 -20
- package/dist/tools/import.d.ts +9 -3
- package/dist/tools/import.js +33 -21
- package/dist/tools/index.d.ts +3 -11
- package/dist/tools/index.js +17 -475
- 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/member.d.ts +21 -0
- package/dist/tools/member.js +56 -62
- package/dist/tools/points.d.ts +19 -6
- package/dist/tools/points.js +51 -49
- 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 +90 -0
- package/dist/tools/reward/schemas.d.ts +116 -0
- package/dist/tools/reward/schemas.js +91 -0
- package/dist/tools/reward.d.ts +18 -0
- package/dist/tools/reward.js +56 -66
- package/dist/tools/role.d.ts +26 -7
- package/dist/tools/role.js +25 -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 +87 -0
- package/dist/tools/segment/schemas.d.ts +337 -0
- package/dist/tools/segment/schemas.js +79 -0
- package/dist/tools/segment.d.ts +29 -10
- package/dist/tools/segment.js +84 -50
- package/dist/tools/store.d.ts +12 -4
- package/dist/tools/store.js +16 -8
- package/dist/tools/tierset.d.ts +19 -7
- package/dist/tools/tierset.js +44 -35
- package/dist/tools/transaction.d.ts +16 -8
- package/dist/tools/transaction.js +25 -21
- package/dist/tools/wallet-type.d.ts +7 -3
- package/dist/tools/wallet-type.js +14 -12
- package/dist/tools/webhook.d.ts +23 -10
- package/dist/tools/webhook.js +135 -33
- package/dist/types/schemas/achievement.d.ts +12 -309
- package/dist/types/schemas/achievement.js +0 -13
- package/dist/types/schemas/admin.d.ts +10 -97
- package/dist/types/schemas/admin.js +0 -38
- package/dist/types/schemas/badge.d.ts +0 -37
- package/dist/types/schemas/badge.js +0 -11
- package/dist/types/schemas/campaign.d.ts +64 -832
- package/dist/types/schemas/campaign.js +2 -25
- package/dist/types/schemas/common.d.ts +5 -0
- package/dist/types/schemas/common.js +5 -0
- package/dist/types/schemas/export.d.ts +0 -17
- package/dist/types/schemas/export.js +0 -7
- package/dist/types/schemas/member.d.ts +37 -176
- package/dist/types/schemas/member.js +0 -27
- package/dist/types/schemas/points.d.ts +0 -63
- package/dist/types/schemas/points.js +0 -22
- package/dist/types/schemas/reward.d.ts +71 -68
- package/dist/types/schemas/reward.js +8 -28
- package/dist/types/schemas/role.d.ts +0 -100
- package/dist/types/schemas/role.js +0 -29
- package/dist/types/schemas/segment.d.ts +0 -58
- package/dist/types/schemas/segment.js +0 -17
- package/dist/types/schemas/tierset.d.ts +0 -176
- package/dist/types/schemas/tierset.js +0 -27
- package/dist/types/schemas/transaction.d.ts +23 -254
- package/dist/types/schemas/transaction.js +0 -7
- package/dist/types/schemas/wallet-type.d.ts +8 -8
- package/dist/types/schemas/wallet-type.js +1 -1
- package/dist/types/schemas/webhook.d.ts +0 -58
- package/dist/types/schemas/webhook.js +0 -12
- package/dist/utils/errors.js +30 -3
- package/dist/utils/payload.d.ts +12 -0
- package/dist/utils/payload.js +14 -0
- 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 +10 -2
|
@@ -70,42 +70,45 @@ export declare const AchievementCreateInputSchema: {
|
|
|
70
70
|
name: string;
|
|
71
71
|
description?: string | undefined;
|
|
72
72
|
}>>>;
|
|
73
|
-
trigger: z.ZodOptional<z.
|
|
74
|
-
type: z.ZodOptional<z.
|
|
73
|
+
trigger: z.ZodOptional<z.ZodEnum<["transaction", "custom_event", "points_transfer", "reward_redemption", "referral", "achievement", "tier_change", "registration", "profile_update"]>>;
|
|
74
|
+
type: z.ZodOptional<z.ZodEnum<["direct", "referral"]>>;
|
|
75
75
|
event: z.ZodOptional<z.ZodString>;
|
|
76
76
|
completeRule: z.ZodObject<{
|
|
77
77
|
periodGoal: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
78
|
-
period: z.
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
period: z.ZodObject<{
|
|
79
|
+
type: z.ZodEnum<["day", "week", "month", "year", "last_day", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
|
|
80
|
+
consecutive: z.ZodNumber;
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
82
|
-
|
|
83
|
-
consecutive
|
|
82
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
83
|
+
consecutive: number;
|
|
84
84
|
}, {
|
|
85
|
-
|
|
86
|
-
consecutive
|
|
87
|
-
}
|
|
85
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
86
|
+
consecutive: number;
|
|
87
|
+
}>;
|
|
88
88
|
uniqueAttribute: z.ZodOptional<z.ZodString>;
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
90
|
periodGoal: string | number;
|
|
91
|
-
period
|
|
92
|
-
|
|
93
|
-
consecutive
|
|
94
|
-
}
|
|
91
|
+
period: {
|
|
92
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
93
|
+
consecutive: number;
|
|
94
|
+
};
|
|
95
95
|
uniqueAttribute?: string | undefined;
|
|
96
96
|
}, {
|
|
97
97
|
periodGoal: string | number;
|
|
98
|
-
period
|
|
99
|
-
|
|
100
|
-
consecutive
|
|
101
|
-
}
|
|
98
|
+
period: {
|
|
99
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
100
|
+
consecutive: number;
|
|
101
|
+
};
|
|
102
102
|
uniqueAttribute?: string | undefined;
|
|
103
103
|
}>;
|
|
104
104
|
aggregation: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
type: z.ZodEnum<["quantity", "sum", "average", "min", "max"]>;
|
|
105
106
|
rule: z.ZodOptional<z.ZodString>;
|
|
106
107
|
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
107
109
|
rule?: string | undefined;
|
|
108
110
|
}, {
|
|
111
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
109
112
|
rule?: string | undefined;
|
|
110
113
|
}>>;
|
|
111
114
|
conditions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
@@ -138,22 +141,23 @@ export declare const AchievementCreateInputSchema: {
|
|
|
138
141
|
}, "strip", z.ZodTypeAny, {
|
|
139
142
|
completeRule: {
|
|
140
143
|
periodGoal: string | number;
|
|
141
|
-
period
|
|
142
|
-
|
|
143
|
-
consecutive
|
|
144
|
-
}
|
|
144
|
+
period: {
|
|
145
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
146
|
+
consecutive: number;
|
|
147
|
+
};
|
|
145
148
|
uniqueAttribute?: string | undefined;
|
|
146
149
|
};
|
|
147
|
-
type?:
|
|
150
|
+
type?: "direct" | "referral" | undefined;
|
|
148
151
|
conditions?: Record<string, unknown>[] | undefined;
|
|
149
152
|
translations?: Record<string, {
|
|
150
153
|
name: string;
|
|
151
154
|
description?: string | undefined;
|
|
152
155
|
}> | undefined;
|
|
153
|
-
trigger?:
|
|
156
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
154
157
|
event?: string | undefined;
|
|
155
158
|
achievementRuleId?: string | undefined;
|
|
156
159
|
aggregation?: {
|
|
160
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
157
161
|
rule?: string | undefined;
|
|
158
162
|
} | undefined;
|
|
159
163
|
limit?: {
|
|
@@ -167,22 +171,23 @@ export declare const AchievementCreateInputSchema: {
|
|
|
167
171
|
}, {
|
|
168
172
|
completeRule: {
|
|
169
173
|
periodGoal: string | number;
|
|
170
|
-
period
|
|
171
|
-
|
|
172
|
-
consecutive
|
|
173
|
-
}
|
|
174
|
+
period: {
|
|
175
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
176
|
+
consecutive: number;
|
|
177
|
+
};
|
|
174
178
|
uniqueAttribute?: string | undefined;
|
|
175
179
|
};
|
|
176
|
-
type?:
|
|
180
|
+
type?: "direct" | "referral" | undefined;
|
|
177
181
|
conditions?: Record<string, unknown>[] | undefined;
|
|
178
182
|
translations?: Record<string, {
|
|
179
183
|
name: string;
|
|
180
184
|
description?: string | undefined;
|
|
181
185
|
}> | undefined;
|
|
182
|
-
trigger?:
|
|
186
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
183
187
|
event?: string | undefined;
|
|
184
188
|
achievementRuleId?: string | undefined;
|
|
185
189
|
aggregation?: {
|
|
190
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
186
191
|
rule?: string | undefined;
|
|
187
192
|
} | undefined;
|
|
188
193
|
limit?: {
|
|
@@ -264,42 +269,45 @@ export declare const AchievementUpdateInputSchema: {
|
|
|
264
269
|
name: string;
|
|
265
270
|
description?: string | undefined;
|
|
266
271
|
}>>>;
|
|
267
|
-
trigger: z.ZodOptional<z.
|
|
268
|
-
type: z.ZodOptional<z.
|
|
272
|
+
trigger: z.ZodOptional<z.ZodEnum<["transaction", "custom_event", "points_transfer", "reward_redemption", "referral", "achievement", "tier_change", "registration", "profile_update"]>>;
|
|
273
|
+
type: z.ZodOptional<z.ZodEnum<["direct", "referral"]>>;
|
|
269
274
|
event: z.ZodOptional<z.ZodString>;
|
|
270
275
|
completeRule: z.ZodObject<{
|
|
271
276
|
periodGoal: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
272
|
-
period: z.
|
|
273
|
-
|
|
274
|
-
|
|
277
|
+
period: z.ZodObject<{
|
|
278
|
+
type: z.ZodEnum<["day", "week", "month", "year", "last_day", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
|
|
279
|
+
consecutive: z.ZodNumber;
|
|
275
280
|
}, "strip", z.ZodTypeAny, {
|
|
276
|
-
|
|
277
|
-
consecutive
|
|
281
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
282
|
+
consecutive: number;
|
|
278
283
|
}, {
|
|
279
|
-
|
|
280
|
-
consecutive
|
|
281
|
-
}
|
|
284
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
285
|
+
consecutive: number;
|
|
286
|
+
}>;
|
|
282
287
|
uniqueAttribute: z.ZodOptional<z.ZodString>;
|
|
283
288
|
}, "strip", z.ZodTypeAny, {
|
|
284
289
|
periodGoal: string | number;
|
|
285
|
-
period
|
|
286
|
-
|
|
287
|
-
consecutive
|
|
288
|
-
}
|
|
290
|
+
period: {
|
|
291
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
292
|
+
consecutive: number;
|
|
293
|
+
};
|
|
289
294
|
uniqueAttribute?: string | undefined;
|
|
290
295
|
}, {
|
|
291
296
|
periodGoal: string | number;
|
|
292
|
-
period
|
|
293
|
-
|
|
294
|
-
consecutive
|
|
295
|
-
}
|
|
297
|
+
period: {
|
|
298
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
299
|
+
consecutive: number;
|
|
300
|
+
};
|
|
296
301
|
uniqueAttribute?: string | undefined;
|
|
297
302
|
}>;
|
|
298
303
|
aggregation: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
type: z.ZodEnum<["quantity", "sum", "average", "min", "max"]>;
|
|
299
305
|
rule: z.ZodOptional<z.ZodString>;
|
|
300
306
|
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
301
308
|
rule?: string | undefined;
|
|
302
309
|
}, {
|
|
310
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
303
311
|
rule?: string | undefined;
|
|
304
312
|
}>>;
|
|
305
313
|
conditions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
@@ -332,22 +340,23 @@ export declare const AchievementUpdateInputSchema: {
|
|
|
332
340
|
}, "strip", z.ZodTypeAny, {
|
|
333
341
|
completeRule: {
|
|
334
342
|
periodGoal: string | number;
|
|
335
|
-
period
|
|
336
|
-
|
|
337
|
-
consecutive
|
|
338
|
-
}
|
|
343
|
+
period: {
|
|
344
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
345
|
+
consecutive: number;
|
|
346
|
+
};
|
|
339
347
|
uniqueAttribute?: string | undefined;
|
|
340
348
|
};
|
|
341
|
-
type?:
|
|
349
|
+
type?: "direct" | "referral" | undefined;
|
|
342
350
|
conditions?: Record<string, unknown>[] | undefined;
|
|
343
351
|
translations?: Record<string, {
|
|
344
352
|
name: string;
|
|
345
353
|
description?: string | undefined;
|
|
346
354
|
}> | undefined;
|
|
347
|
-
trigger?:
|
|
355
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
348
356
|
event?: string | undefined;
|
|
349
357
|
achievementRuleId?: string | undefined;
|
|
350
358
|
aggregation?: {
|
|
359
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
351
360
|
rule?: string | undefined;
|
|
352
361
|
} | undefined;
|
|
353
362
|
limit?: {
|
|
@@ -361,22 +370,23 @@ export declare const AchievementUpdateInputSchema: {
|
|
|
361
370
|
}, {
|
|
362
371
|
completeRule: {
|
|
363
372
|
periodGoal: string | number;
|
|
364
|
-
period
|
|
365
|
-
|
|
366
|
-
consecutive
|
|
367
|
-
}
|
|
373
|
+
period: {
|
|
374
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
375
|
+
consecutive: number;
|
|
376
|
+
};
|
|
368
377
|
uniqueAttribute?: string | undefined;
|
|
369
378
|
};
|
|
370
|
-
type?:
|
|
379
|
+
type?: "direct" | "referral" | undefined;
|
|
371
380
|
conditions?: Record<string, unknown>[] | undefined;
|
|
372
381
|
translations?: Record<string, {
|
|
373
382
|
name: string;
|
|
374
383
|
description?: string | undefined;
|
|
375
384
|
}> | undefined;
|
|
376
|
-
trigger?:
|
|
385
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
377
386
|
event?: string | undefined;
|
|
378
387
|
achievementRuleId?: string | undefined;
|
|
379
388
|
aggregation?: {
|
|
389
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
380
390
|
rule?: string | undefined;
|
|
381
391
|
} | undefined;
|
|
382
392
|
limit?: {
|
|
@@ -535,7 +545,9 @@ export declare function achievementListMemberAchievements(input: {
|
|
|
535
545
|
}>;
|
|
536
546
|
export declare const achievementToolDefinitions: readonly [{
|
|
537
547
|
readonly name: "openloyalty_achievement_list";
|
|
548
|
+
readonly title: "List Achievements";
|
|
538
549
|
readonly description: "List achievements. Achievements gamify member behavior by setting goals (e.g., 'Make 5 purchases this month'). Returns achievementId, name, active status, and associated badge. Use achievement_get for full rules and configuration.";
|
|
550
|
+
readonly readOnly: true;
|
|
539
551
|
readonly inputSchema: {
|
|
540
552
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
541
553
|
page: z.ZodOptional<z.ZodNumber>;
|
|
@@ -546,7 +558,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
546
558
|
readonly handler: typeof achievementList;
|
|
547
559
|
}, {
|
|
548
560
|
readonly name: "openloyalty_achievement_create";
|
|
549
|
-
readonly
|
|
561
|
+
readonly title: "Create Achievement";
|
|
562
|
+
readonly description: string;
|
|
563
|
+
readonly readOnly: false;
|
|
550
564
|
readonly inputSchema: {
|
|
551
565
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
552
566
|
translations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -610,42 +624,45 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
610
624
|
name: string;
|
|
611
625
|
description?: string | undefined;
|
|
612
626
|
}>>>;
|
|
613
|
-
trigger: z.ZodOptional<z.
|
|
614
|
-
type: z.ZodOptional<z.
|
|
627
|
+
trigger: z.ZodOptional<z.ZodEnum<["transaction", "custom_event", "points_transfer", "reward_redemption", "referral", "achievement", "tier_change", "registration", "profile_update"]>>;
|
|
628
|
+
type: z.ZodOptional<z.ZodEnum<["direct", "referral"]>>;
|
|
615
629
|
event: z.ZodOptional<z.ZodString>;
|
|
616
630
|
completeRule: z.ZodObject<{
|
|
617
631
|
periodGoal: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
618
|
-
period: z.
|
|
619
|
-
|
|
620
|
-
|
|
632
|
+
period: z.ZodObject<{
|
|
633
|
+
type: z.ZodEnum<["day", "week", "month", "year", "last_day", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
|
|
634
|
+
consecutive: z.ZodNumber;
|
|
621
635
|
}, "strip", z.ZodTypeAny, {
|
|
622
|
-
|
|
623
|
-
consecutive
|
|
636
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
637
|
+
consecutive: number;
|
|
624
638
|
}, {
|
|
625
|
-
|
|
626
|
-
consecutive
|
|
627
|
-
}
|
|
639
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
640
|
+
consecutive: number;
|
|
641
|
+
}>;
|
|
628
642
|
uniqueAttribute: z.ZodOptional<z.ZodString>;
|
|
629
643
|
}, "strip", z.ZodTypeAny, {
|
|
630
644
|
periodGoal: string | number;
|
|
631
|
-
period
|
|
632
|
-
|
|
633
|
-
consecutive
|
|
634
|
-
}
|
|
645
|
+
period: {
|
|
646
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
647
|
+
consecutive: number;
|
|
648
|
+
};
|
|
635
649
|
uniqueAttribute?: string | undefined;
|
|
636
650
|
}, {
|
|
637
651
|
periodGoal: string | number;
|
|
638
|
-
period
|
|
639
|
-
|
|
640
|
-
consecutive
|
|
641
|
-
}
|
|
652
|
+
period: {
|
|
653
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
654
|
+
consecutive: number;
|
|
655
|
+
};
|
|
642
656
|
uniqueAttribute?: string | undefined;
|
|
643
657
|
}>;
|
|
644
658
|
aggregation: z.ZodOptional<z.ZodObject<{
|
|
659
|
+
type: z.ZodEnum<["quantity", "sum", "average", "min", "max"]>;
|
|
645
660
|
rule: z.ZodOptional<z.ZodString>;
|
|
646
661
|
}, "strip", z.ZodTypeAny, {
|
|
662
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
647
663
|
rule?: string | undefined;
|
|
648
664
|
}, {
|
|
665
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
649
666
|
rule?: string | undefined;
|
|
650
667
|
}>>;
|
|
651
668
|
conditions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
@@ -678,22 +695,23 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
678
695
|
}, "strip", z.ZodTypeAny, {
|
|
679
696
|
completeRule: {
|
|
680
697
|
periodGoal: string | number;
|
|
681
|
-
period
|
|
682
|
-
|
|
683
|
-
consecutive
|
|
684
|
-
}
|
|
698
|
+
period: {
|
|
699
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
700
|
+
consecutive: number;
|
|
701
|
+
};
|
|
685
702
|
uniqueAttribute?: string | undefined;
|
|
686
703
|
};
|
|
687
|
-
type?:
|
|
704
|
+
type?: "direct" | "referral" | undefined;
|
|
688
705
|
conditions?: Record<string, unknown>[] | undefined;
|
|
689
706
|
translations?: Record<string, {
|
|
690
707
|
name: string;
|
|
691
708
|
description?: string | undefined;
|
|
692
709
|
}> | undefined;
|
|
693
|
-
trigger?:
|
|
710
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
694
711
|
event?: string | undefined;
|
|
695
712
|
achievementRuleId?: string | undefined;
|
|
696
713
|
aggregation?: {
|
|
714
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
697
715
|
rule?: string | undefined;
|
|
698
716
|
} | undefined;
|
|
699
717
|
limit?: {
|
|
@@ -707,22 +725,23 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
707
725
|
}, {
|
|
708
726
|
completeRule: {
|
|
709
727
|
periodGoal: string | number;
|
|
710
|
-
period
|
|
711
|
-
|
|
712
|
-
consecutive
|
|
713
|
-
}
|
|
728
|
+
period: {
|
|
729
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
730
|
+
consecutive: number;
|
|
731
|
+
};
|
|
714
732
|
uniqueAttribute?: string | undefined;
|
|
715
733
|
};
|
|
716
|
-
type?:
|
|
734
|
+
type?: "direct" | "referral" | undefined;
|
|
717
735
|
conditions?: Record<string, unknown>[] | undefined;
|
|
718
736
|
translations?: Record<string, {
|
|
719
737
|
name: string;
|
|
720
738
|
description?: string | undefined;
|
|
721
739
|
}> | undefined;
|
|
722
|
-
trigger?:
|
|
740
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
723
741
|
event?: string | undefined;
|
|
724
742
|
achievementRuleId?: string | undefined;
|
|
725
743
|
aggregation?: {
|
|
744
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
726
745
|
rule?: string | undefined;
|
|
727
746
|
} | undefined;
|
|
728
747
|
limit?: {
|
|
@@ -739,7 +758,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
739
758
|
readonly handler: typeof achievementCreate;
|
|
740
759
|
}, {
|
|
741
760
|
readonly name: "openloyalty_achievement_get";
|
|
761
|
+
readonly title: "Get Achievement Details";
|
|
742
762
|
readonly description: "Get achievement details including all rules, conditions, activity period, limits, and completions count.";
|
|
763
|
+
readonly readOnly: true;
|
|
743
764
|
readonly inputSchema: {
|
|
744
765
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
745
766
|
achievementId: z.ZodString;
|
|
@@ -747,7 +768,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
747
768
|
readonly handler: typeof achievementGet;
|
|
748
769
|
}, {
|
|
749
770
|
readonly name: "openloyalty_achievement_update";
|
|
771
|
+
readonly title: "Update Achievement";
|
|
750
772
|
readonly description: "Update achievement configuration. Requires full achievement object (translations, rules). Use achievement_get first to retrieve current configuration.";
|
|
773
|
+
readonly readOnly: false;
|
|
751
774
|
readonly inputSchema: {
|
|
752
775
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
753
776
|
achievementId: z.ZodString;
|
|
@@ -812,42 +835,45 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
812
835
|
name: string;
|
|
813
836
|
description?: string | undefined;
|
|
814
837
|
}>>>;
|
|
815
|
-
trigger: z.ZodOptional<z.
|
|
816
|
-
type: z.ZodOptional<z.
|
|
838
|
+
trigger: z.ZodOptional<z.ZodEnum<["transaction", "custom_event", "points_transfer", "reward_redemption", "referral", "achievement", "tier_change", "registration", "profile_update"]>>;
|
|
839
|
+
type: z.ZodOptional<z.ZodEnum<["direct", "referral"]>>;
|
|
817
840
|
event: z.ZodOptional<z.ZodString>;
|
|
818
841
|
completeRule: z.ZodObject<{
|
|
819
842
|
periodGoal: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
820
|
-
period: z.
|
|
821
|
-
|
|
822
|
-
|
|
843
|
+
period: z.ZodObject<{
|
|
844
|
+
type: z.ZodEnum<["day", "week", "month", "year", "last_day", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
|
|
845
|
+
consecutive: z.ZodNumber;
|
|
823
846
|
}, "strip", z.ZodTypeAny, {
|
|
824
|
-
|
|
825
|
-
consecutive
|
|
847
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
848
|
+
consecutive: number;
|
|
826
849
|
}, {
|
|
827
|
-
|
|
828
|
-
consecutive
|
|
829
|
-
}
|
|
850
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
851
|
+
consecutive: number;
|
|
852
|
+
}>;
|
|
830
853
|
uniqueAttribute: z.ZodOptional<z.ZodString>;
|
|
831
854
|
}, "strip", z.ZodTypeAny, {
|
|
832
855
|
periodGoal: string | number;
|
|
833
|
-
period
|
|
834
|
-
|
|
835
|
-
consecutive
|
|
836
|
-
}
|
|
856
|
+
period: {
|
|
857
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
858
|
+
consecutive: number;
|
|
859
|
+
};
|
|
837
860
|
uniqueAttribute?: string | undefined;
|
|
838
861
|
}, {
|
|
839
862
|
periodGoal: string | number;
|
|
840
|
-
period
|
|
841
|
-
|
|
842
|
-
consecutive
|
|
843
|
-
}
|
|
863
|
+
period: {
|
|
864
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
865
|
+
consecutive: number;
|
|
866
|
+
};
|
|
844
867
|
uniqueAttribute?: string | undefined;
|
|
845
868
|
}>;
|
|
846
869
|
aggregation: z.ZodOptional<z.ZodObject<{
|
|
870
|
+
type: z.ZodEnum<["quantity", "sum", "average", "min", "max"]>;
|
|
847
871
|
rule: z.ZodOptional<z.ZodString>;
|
|
848
872
|
}, "strip", z.ZodTypeAny, {
|
|
873
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
849
874
|
rule?: string | undefined;
|
|
850
875
|
}, {
|
|
876
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
851
877
|
rule?: string | undefined;
|
|
852
878
|
}>>;
|
|
853
879
|
conditions: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
|
|
@@ -880,22 +906,23 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
880
906
|
}, "strip", z.ZodTypeAny, {
|
|
881
907
|
completeRule: {
|
|
882
908
|
periodGoal: string | number;
|
|
883
|
-
period
|
|
884
|
-
|
|
885
|
-
consecutive
|
|
886
|
-
}
|
|
909
|
+
period: {
|
|
910
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
911
|
+
consecutive: number;
|
|
912
|
+
};
|
|
887
913
|
uniqueAttribute?: string | undefined;
|
|
888
914
|
};
|
|
889
|
-
type?:
|
|
915
|
+
type?: "direct" | "referral" | undefined;
|
|
890
916
|
conditions?: Record<string, unknown>[] | undefined;
|
|
891
917
|
translations?: Record<string, {
|
|
892
918
|
name: string;
|
|
893
919
|
description?: string | undefined;
|
|
894
920
|
}> | undefined;
|
|
895
|
-
trigger?:
|
|
921
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
896
922
|
event?: string | undefined;
|
|
897
923
|
achievementRuleId?: string | undefined;
|
|
898
924
|
aggregation?: {
|
|
925
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
899
926
|
rule?: string | undefined;
|
|
900
927
|
} | undefined;
|
|
901
928
|
limit?: {
|
|
@@ -909,22 +936,23 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
909
936
|
}, {
|
|
910
937
|
completeRule: {
|
|
911
938
|
periodGoal: string | number;
|
|
912
|
-
period
|
|
913
|
-
|
|
914
|
-
consecutive
|
|
915
|
-
}
|
|
939
|
+
period: {
|
|
940
|
+
type: "day" | "week" | "month" | "year" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears" | "last_day";
|
|
941
|
+
consecutive: number;
|
|
942
|
+
};
|
|
916
943
|
uniqueAttribute?: string | undefined;
|
|
917
944
|
};
|
|
918
|
-
type?:
|
|
945
|
+
type?: "direct" | "referral" | undefined;
|
|
919
946
|
conditions?: Record<string, unknown>[] | undefined;
|
|
920
947
|
translations?: Record<string, {
|
|
921
948
|
name: string;
|
|
922
949
|
description?: string | undefined;
|
|
923
950
|
}> | undefined;
|
|
924
|
-
trigger?:
|
|
951
|
+
trigger?: "referral" | "transaction" | "custom_event" | "achievement" | "points_transfer" | "reward_redemption" | "tier_change" | "registration" | "profile_update" | undefined;
|
|
925
952
|
event?: string | undefined;
|
|
926
953
|
achievementRuleId?: string | undefined;
|
|
927
954
|
aggregation?: {
|
|
955
|
+
type: "quantity" | "min" | "max" | "sum" | "average";
|
|
928
956
|
rule?: string | undefined;
|
|
929
957
|
} | undefined;
|
|
930
958
|
limit?: {
|
|
@@ -941,7 +969,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
941
969
|
readonly handler: typeof achievementUpdate;
|
|
942
970
|
}, {
|
|
943
971
|
readonly name: "openloyalty_achievement_patch";
|
|
972
|
+
readonly title: "Patch Achievement";
|
|
944
973
|
readonly description: "Partial update of achievement. Use for simple changes like activating/deactivating or updating translations without providing full rules.";
|
|
974
|
+
readonly readOnly: false;
|
|
945
975
|
readonly inputSchema: {
|
|
946
976
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
947
977
|
achievementId: z.ZodString;
|
|
@@ -960,7 +990,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
960
990
|
readonly handler: typeof achievementPatch;
|
|
961
991
|
}, {
|
|
962
992
|
readonly name: "openloyalty_achievement_get_member_progress";
|
|
993
|
+
readonly title: "Get Member Achievement Progress";
|
|
963
994
|
readonly description: "Get member's progress on a specific achievement. Returns completedCount, and for each rule: periodGoal, currentPeriodValue, and consecutive period tracking.";
|
|
995
|
+
readonly readOnly: true;
|
|
964
996
|
readonly inputSchema: {
|
|
965
997
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
966
998
|
memberId: z.ZodString;
|
|
@@ -969,7 +1001,9 @@ export declare const achievementToolDefinitions: readonly [{
|
|
|
969
1001
|
readonly handler: typeof achievementGetMemberProgress;
|
|
970
1002
|
}, {
|
|
971
1003
|
readonly name: "openloyalty_achievement_list_member_achievements";
|
|
1004
|
+
readonly title: "List Member Achievements";
|
|
972
1005
|
readonly description: "List all achievements with member's progress. Returns each achievement's status, completion count, and per-rule progress. Use for displaying gamification dashboard.";
|
|
1006
|
+
readonly readOnly: true;
|
|
973
1007
|
readonly inputSchema: {
|
|
974
1008
|
storeCode: z.ZodOptional<z.ZodString>;
|
|
975
1009
|
memberId: z.ZodString;
|