@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
package/dist/tools/campaign.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { apiGet, apiPost, apiPut, apiPatch, apiDelete } from "../client/http.js";
|
|
3
3
|
import { CampaignTypeEnum, CampaignTriggerEnum, } from "../types/schemas/campaign.js";
|
|
4
4
|
import { formatApiError } from "../utils/errors.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getStoreCode } from "../config.js";
|
|
6
6
|
// Input Schemas
|
|
7
7
|
export const CampaignListInputSchema = {
|
|
8
8
|
storeCode: z.string().optional().describe("Store code. If not provided, uses the default store code from configuration."),
|
|
@@ -252,8 +252,7 @@ export const CampaignCreateInputSchema = {
|
|
|
252
252
|
};
|
|
253
253
|
// Handler functions
|
|
254
254
|
export async function campaignList(input) {
|
|
255
|
-
const
|
|
256
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
255
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
257
256
|
const params = new URLSearchParams();
|
|
258
257
|
if (input.page)
|
|
259
258
|
params.append("_page", String(input.page));
|
|
@@ -307,8 +306,7 @@ export async function campaignList(input) {
|
|
|
307
306
|
}
|
|
308
307
|
}
|
|
309
308
|
export async function campaignGet(input) {
|
|
310
|
-
const
|
|
311
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
309
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
312
310
|
try {
|
|
313
311
|
const response = await apiGet(`/${storeCode}/campaign/${input.campaignId}`);
|
|
314
312
|
return response;
|
|
@@ -318,8 +316,7 @@ export async function campaignGet(input) {
|
|
|
318
316
|
}
|
|
319
317
|
}
|
|
320
318
|
export async function campaignUpdate(input) {
|
|
321
|
-
const
|
|
322
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
319
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
323
320
|
const campaignId = input.campaignId;
|
|
324
321
|
// Build campaign payload excluding storeCode and campaignId
|
|
325
322
|
const { storeCode: _sc, campaignId: _cid, ...campaignPayload } = input;
|
|
@@ -332,8 +329,7 @@ export async function campaignUpdate(input) {
|
|
|
332
329
|
}
|
|
333
330
|
}
|
|
334
331
|
export async function campaignPatch(input) {
|
|
335
|
-
const
|
|
336
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
332
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
337
333
|
const patchPayload = {};
|
|
338
334
|
if (input.active !== undefined)
|
|
339
335
|
patchPayload.active = input.active;
|
|
@@ -347,8 +343,7 @@ export async function campaignPatch(input) {
|
|
|
347
343
|
}
|
|
348
344
|
}
|
|
349
345
|
export async function campaignDelete(input) {
|
|
350
|
-
const
|
|
351
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
346
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
352
347
|
try {
|
|
353
348
|
await apiDelete(`/${storeCode}/campaign/${input.campaignId}`);
|
|
354
349
|
}
|
|
@@ -357,8 +352,7 @@ export async function campaignDelete(input) {
|
|
|
357
352
|
}
|
|
358
353
|
}
|
|
359
354
|
export async function campaignSimulate(input) {
|
|
360
|
-
const
|
|
361
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
355
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
362
356
|
// Build the simulate payload
|
|
363
357
|
const simulatePayload = {
|
|
364
358
|
trigger: input.trigger,
|
|
@@ -453,8 +447,7 @@ export async function campaignSimulate(input) {
|
|
|
453
447
|
}
|
|
454
448
|
}
|
|
455
449
|
export async function campaignGenerateCodes(input) {
|
|
456
|
-
const
|
|
457
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
450
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
458
451
|
try {
|
|
459
452
|
// Body wrapped as { generate: { numberOfCodes } }
|
|
460
453
|
await apiPost(`/${storeCode}/campaign/${input.campaignId}/codes/generate`, { generate: { numberOfCodes: input.quantity } });
|
|
@@ -466,8 +459,7 @@ export async function campaignGenerateCodes(input) {
|
|
|
466
459
|
}
|
|
467
460
|
}
|
|
468
461
|
export async function campaignListCodes(input) {
|
|
469
|
-
const
|
|
470
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
462
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
471
463
|
const params = new URLSearchParams();
|
|
472
464
|
if (input.page)
|
|
473
465
|
params.append("_page", String(input.page));
|
|
@@ -503,8 +495,7 @@ export async function campaignListCodes(input) {
|
|
|
503
495
|
}
|
|
504
496
|
}
|
|
505
497
|
export async function campaignGetAvailable(input) {
|
|
506
|
-
const
|
|
507
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
498
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
508
499
|
const params = new URLSearchParams();
|
|
509
500
|
if (input.page)
|
|
510
501
|
params.append("_page", String(input.page));
|
|
@@ -541,8 +532,7 @@ export async function campaignGetAvailable(input) {
|
|
|
541
532
|
}
|
|
542
533
|
}
|
|
543
534
|
export async function campaignGetVisible(input) {
|
|
544
|
-
const
|
|
545
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
535
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
546
536
|
const params = new URLSearchParams();
|
|
547
537
|
if (input.page)
|
|
548
538
|
params.append("_page", String(input.page));
|
|
@@ -576,8 +566,7 @@ export async function campaignGetVisible(input) {
|
|
|
576
566
|
}
|
|
577
567
|
}
|
|
578
568
|
export async function campaignGetLeaderboard(input) {
|
|
579
|
-
const
|
|
580
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
569
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
581
570
|
const params = new URLSearchParams();
|
|
582
571
|
if (input.type)
|
|
583
572
|
params.append("type", input.type);
|
|
@@ -614,8 +603,7 @@ export async function campaignGetLeaderboard(input) {
|
|
|
614
603
|
}
|
|
615
604
|
}
|
|
616
605
|
export async function campaignCreate(input) {
|
|
617
|
-
const
|
|
618
|
-
const storeCode = input.storeCode || config.defaultStoreCode;
|
|
606
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
619
607
|
// Build the campaign payload
|
|
620
608
|
const campaignPayload = {
|
|
621
609
|
type: input.type,
|
|
@@ -651,73 +639,98 @@ export async function campaignCreate(input) {
|
|
|
651
639
|
export const campaignToolDefinitions = [
|
|
652
640
|
{
|
|
653
641
|
name: "openloyalty_campaign_list",
|
|
642
|
+
title: "List Campaigns",
|
|
654
643
|
description: "List all campaigns. Filter by type (direct/referral) or trigger (transaction/custom_event/time/etc). Use campaign_get for full configuration including rules and effects.",
|
|
644
|
+
readOnly: true,
|
|
655
645
|
inputSchema: CampaignListInputSchema,
|
|
656
646
|
handler: campaignList,
|
|
657
647
|
},
|
|
658
648
|
{
|
|
659
649
|
name: "openloyalty_campaign_create",
|
|
650
|
+
title: "Create Campaign",
|
|
660
651
|
description: "Create campaign to automate engagement. Triggers: transaction (purchase-based), custom_event (for custom actions), time (scheduled). Effects: give_points, give_reward, deduct_unit. Rules define when/what happens. Example - Double points: trigger=transaction, effect=give_points with pointsRule containing multiplier:2.",
|
|
652
|
+
readOnly: false,
|
|
661
653
|
inputSchema: CampaignCreateInputSchema,
|
|
662
654
|
handler: campaignCreate,
|
|
663
655
|
},
|
|
664
656
|
{
|
|
665
657
|
name: "openloyalty_campaign_get",
|
|
658
|
+
title: "Get Campaign Details",
|
|
666
659
|
description: "Get full campaign configuration including all rules, conditions, effects, and targeting.",
|
|
660
|
+
readOnly: true,
|
|
667
661
|
inputSchema: CampaignGetInputSchema,
|
|
668
662
|
handler: campaignGet,
|
|
669
663
|
},
|
|
670
664
|
{
|
|
671
665
|
name: "openloyalty_campaign_update",
|
|
666
|
+
title: "Update Campaign",
|
|
672
667
|
description: "Full update of campaign configuration. Requires all campaign fields. Use campaign_get first to retrieve current configuration, modify it, then send the complete object.",
|
|
668
|
+
readOnly: false,
|
|
673
669
|
inputSchema: CampaignUpdateInputSchema,
|
|
674
670
|
handler: campaignUpdate,
|
|
675
671
|
},
|
|
676
672
|
{
|
|
677
673
|
name: "openloyalty_campaign_patch",
|
|
674
|
+
title: "Patch Campaign",
|
|
678
675
|
description: "Partial update of campaign - only active status and displayOrder can be patched. For full updates, use campaign_update.",
|
|
676
|
+
readOnly: false,
|
|
679
677
|
inputSchema: CampaignPatchInputSchema,
|
|
680
678
|
handler: campaignPatch,
|
|
681
679
|
},
|
|
682
680
|
{
|
|
683
681
|
name: "openloyalty_campaign_delete",
|
|
682
|
+
title: "Delete Campaign (Permanent)",
|
|
684
683
|
description: "Permanently delete a campaign. This cannot be undone. Consider deactivating instead if you may need the campaign later.",
|
|
684
|
+
readOnly: false,
|
|
685
|
+
destructive: true,
|
|
685
686
|
inputSchema: CampaignDeleteInputSchema,
|
|
686
687
|
handler: campaignDelete,
|
|
687
688
|
},
|
|
688
689
|
{
|
|
689
690
|
name: "openloyalty_campaign_simulate",
|
|
691
|
+
title: "Simulate Campaign Effects",
|
|
690
692
|
description: "Simulate campaign effects without executing them. Use to preview what points/rewards a transaction would earn. Provide trigger type, transaction/event data, and customer. Returns simulated effects grouped by campaign.",
|
|
693
|
+
readOnly: true,
|
|
691
694
|
inputSchema: CampaignSimulateInputSchema,
|
|
692
695
|
handler: campaignSimulate,
|
|
693
696
|
},
|
|
694
697
|
{
|
|
695
698
|
name: "openloyalty_campaign_generate_codes",
|
|
699
|
+
title: "Generate Campaign Codes",
|
|
696
700
|
description: "Generate unique redemption codes for a campaign. Use for promotions requiring unique codes. Codes are auto-generated and can be retrieved with campaign_list_codes.",
|
|
701
|
+
readOnly: false,
|
|
697
702
|
inputSchema: CampaignGenerateCodesInputSchema,
|
|
698
703
|
handler: campaignGenerateCodes,
|
|
699
704
|
},
|
|
700
705
|
{
|
|
701
706
|
name: "openloyalty_campaign_list_codes",
|
|
707
|
+
title: "List Campaign Codes",
|
|
702
708
|
description: "List redemption codes for a campaign. Filter by status (active/used) or specific code. Returns code details including usage status.",
|
|
709
|
+
readOnly: true,
|
|
703
710
|
inputSchema: CampaignListCodesInputSchema,
|
|
704
711
|
handler: campaignListCodes,
|
|
705
712
|
},
|
|
706
713
|
{
|
|
707
714
|
name: "openloyalty_campaign_get_available",
|
|
715
|
+
title: "Get Available Campaigns for Member",
|
|
708
716
|
description: "Get campaigns available to a specific member. Returns campaigns the member can participate in based on their tier, segments, and campaign targeting rules. Includes limitReached indicator.",
|
|
717
|
+
readOnly: true,
|
|
709
718
|
inputSchema: CampaignGetAvailableInputSchema,
|
|
710
719
|
handler: campaignGetAvailable,
|
|
711
720
|
},
|
|
712
721
|
{
|
|
713
722
|
name: "openloyalty_campaign_get_visible",
|
|
723
|
+
title: "Get Visible Campaigns for Member",
|
|
714
724
|
description: "Get campaigns visible to a specific member. May include campaigns not yet available (e.g., upcoming campaigns or those requiring certain conditions). Use get_available for campaigns the member can currently participate in.",
|
|
725
|
+
readOnly: true,
|
|
715
726
|
inputSchema: CampaignGetVisibleInputSchema,
|
|
716
727
|
handler: campaignGetVisible,
|
|
717
728
|
},
|
|
718
729
|
{
|
|
719
730
|
name: "openloyalty_campaign_get_leaderboard",
|
|
731
|
+
title: "Get Campaign Leaderboard",
|
|
720
732
|
description: "Get leaderboard rankings for a campaign. Returns ranked list of members with scores and positions. Use for leaderboard-type campaigns to show competition standings.",
|
|
733
|
+
readOnly: true,
|
|
721
734
|
inputSchema: CampaignGetLeaderboardInputSchema,
|
|
722
735
|
handler: campaignGetLeaderboard,
|
|
723
736
|
},
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CustomEventSchemaListInputSchema: {
|
|
3
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
};
|
|
10
|
+
export declare const CustomEventSchemaGetInputSchema: {
|
|
11
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
12
|
+
eventType: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
export declare const CustomEventSchemaCreateInputSchema: {
|
|
15
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
16
|
+
eventType: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
type: z.ZodEnum<["text", "number", "boolean", "datetime"]>;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
}>, "many">;
|
|
31
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
};
|
|
33
|
+
export declare const CustomEventSchemaUpdateInputSchema: {
|
|
34
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
35
|
+
eventType: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
type: z.ZodEnum<["text", "number", "boolean", "datetime"]>;
|
|
40
|
+
description: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
}>, "many">;
|
|
50
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
};
|
|
52
|
+
export declare const CustomEventSchemaActivateInputSchema: {
|
|
53
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
54
|
+
eventType: z.ZodString;
|
|
55
|
+
active: z.ZodBoolean;
|
|
56
|
+
};
|
|
57
|
+
export declare const CustomEventSendInputSchema: {
|
|
58
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
59
|
+
eventType: z.ZodString;
|
|
60
|
+
customerData: z.ZodObject<{
|
|
61
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
62
|
+
email: z.ZodOptional<z.ZodString>;
|
|
63
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
64
|
+
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
email?: string | undefined;
|
|
67
|
+
phone?: string | undefined;
|
|
68
|
+
loyaltyCardNumber?: string | undefined;
|
|
69
|
+
customerId?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
email?: string | undefined;
|
|
72
|
+
phone?: string | undefined;
|
|
73
|
+
loyaltyCardNumber?: string | undefined;
|
|
74
|
+
customerId?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
eventDate: z.ZodString;
|
|
77
|
+
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
};
|
|
80
|
+
export declare const CustomEventListInputSchema: {
|
|
81
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
82
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
type: z.ZodOptional<z.ZodString>;
|
|
85
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
email: z.ZodOptional<z.ZodString>;
|
|
87
|
+
};
|
|
88
|
+
interface CustomEventSchemaItem {
|
|
89
|
+
eventType: string;
|
|
90
|
+
name: string;
|
|
91
|
+
schema?: {
|
|
92
|
+
fields?: Array<{
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
98
|
+
active: boolean;
|
|
99
|
+
createdAt?: string;
|
|
100
|
+
}
|
|
101
|
+
export declare function customEventSchemaList(input: {
|
|
102
|
+
storeCode?: string;
|
|
103
|
+
page?: number;
|
|
104
|
+
perPage?: number;
|
|
105
|
+
eventType?: string;
|
|
106
|
+
name?: string;
|
|
107
|
+
active?: boolean;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
schemas: CustomEventSchemaItem[];
|
|
110
|
+
total: {
|
|
111
|
+
all?: number;
|
|
112
|
+
filtered?: number;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
export declare function customEventSchemaGet(input: {
|
|
116
|
+
storeCode?: string;
|
|
117
|
+
eventType: string;
|
|
118
|
+
}): Promise<CustomEventSchemaItem>;
|
|
119
|
+
interface CustomEventSchemaCreateInput {
|
|
120
|
+
storeCode?: string;
|
|
121
|
+
eventType: string;
|
|
122
|
+
name: string;
|
|
123
|
+
fields: Array<{
|
|
124
|
+
name: string;
|
|
125
|
+
type: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
}>;
|
|
128
|
+
active?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export declare function customEventSchemaCreate(input: CustomEventSchemaCreateInput): Promise<void>;
|
|
131
|
+
interface CustomEventSchemaUpdateInput {
|
|
132
|
+
storeCode?: string;
|
|
133
|
+
eventType: string;
|
|
134
|
+
name: string;
|
|
135
|
+
fields: Array<{
|
|
136
|
+
name: string;
|
|
137
|
+
type: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
}>;
|
|
140
|
+
active?: boolean;
|
|
141
|
+
}
|
|
142
|
+
export declare function customEventSchemaUpdate(input: CustomEventSchemaUpdateInput): Promise<void>;
|
|
143
|
+
export declare function customEventSchemaActivate(input: {
|
|
144
|
+
storeCode?: string;
|
|
145
|
+
eventType: string;
|
|
146
|
+
active: boolean;
|
|
147
|
+
}): Promise<void>;
|
|
148
|
+
interface CustomEventSendInput {
|
|
149
|
+
storeCode?: string;
|
|
150
|
+
eventType: string;
|
|
151
|
+
customerData: {
|
|
152
|
+
customerId?: string;
|
|
153
|
+
email?: string;
|
|
154
|
+
phone?: string;
|
|
155
|
+
loyaltyCardNumber?: string;
|
|
156
|
+
};
|
|
157
|
+
eventDate: string;
|
|
158
|
+
body?: Record<string, unknown>;
|
|
159
|
+
eventId?: string;
|
|
160
|
+
}
|
|
161
|
+
export declare function customEventSend(input: CustomEventSendInput): Promise<{
|
|
162
|
+
customEventId?: string;
|
|
163
|
+
}>;
|
|
164
|
+
interface CustomEventItem {
|
|
165
|
+
customEventId: string;
|
|
166
|
+
type: string;
|
|
167
|
+
customerId?: string;
|
|
168
|
+
eventDate?: string;
|
|
169
|
+
body?: Record<string, unknown>;
|
|
170
|
+
createdAt?: string;
|
|
171
|
+
}
|
|
172
|
+
export declare function customEventList(input: {
|
|
173
|
+
storeCode?: string;
|
|
174
|
+
page?: number;
|
|
175
|
+
perPage?: number;
|
|
176
|
+
type?: string;
|
|
177
|
+
customerId?: string;
|
|
178
|
+
email?: string;
|
|
179
|
+
}): Promise<{
|
|
180
|
+
events: CustomEventItem[];
|
|
181
|
+
total: {
|
|
182
|
+
all?: number;
|
|
183
|
+
filtered?: number;
|
|
184
|
+
};
|
|
185
|
+
}>;
|
|
186
|
+
export declare const customEventToolDefinitions: readonly [{
|
|
187
|
+
readonly name: "ol_custom_event_schema_list";
|
|
188
|
+
readonly title: "List Custom Event Schemas";
|
|
189
|
+
readonly description: string;
|
|
190
|
+
readonly readOnly: true;
|
|
191
|
+
readonly inputSchema: {
|
|
192
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
193
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
196
|
+
name: z.ZodOptional<z.ZodString>;
|
|
197
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
};
|
|
199
|
+
readonly handler: typeof customEventSchemaList;
|
|
200
|
+
}, {
|
|
201
|
+
readonly name: "ol_custom_event_schema_get";
|
|
202
|
+
readonly title: "Get Custom Event Schema";
|
|
203
|
+
readonly description: "Get details of a specific custom event schema including its fields.";
|
|
204
|
+
readonly readOnly: true;
|
|
205
|
+
readonly inputSchema: {
|
|
206
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
207
|
+
eventType: z.ZodString;
|
|
208
|
+
};
|
|
209
|
+
readonly handler: typeof customEventSchemaGet;
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "ol_custom_event_schema_create";
|
|
212
|
+
readonly title: "Create Custom Event Schema";
|
|
213
|
+
readonly description: string;
|
|
214
|
+
readonly readOnly: false;
|
|
215
|
+
readonly inputSchema: {
|
|
216
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
217
|
+
eventType: z.ZodString;
|
|
218
|
+
name: z.ZodString;
|
|
219
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
type: z.ZodEnum<["text", "number", "boolean", "datetime"]>;
|
|
222
|
+
description: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
225
|
+
name: string;
|
|
226
|
+
description?: string | undefined;
|
|
227
|
+
}, {
|
|
228
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
229
|
+
name: string;
|
|
230
|
+
description?: string | undefined;
|
|
231
|
+
}>, "many">;
|
|
232
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
};
|
|
234
|
+
readonly handler: typeof customEventSchemaCreate;
|
|
235
|
+
}, {
|
|
236
|
+
readonly name: "ol_custom_event_schema_update";
|
|
237
|
+
readonly title: "Update Custom Event Schema";
|
|
238
|
+
readonly description: "Update an existing custom event schema (name, fields, active status).";
|
|
239
|
+
readonly readOnly: false;
|
|
240
|
+
readonly inputSchema: {
|
|
241
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
242
|
+
eventType: z.ZodString;
|
|
243
|
+
name: z.ZodString;
|
|
244
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
245
|
+
name: z.ZodString;
|
|
246
|
+
type: z.ZodEnum<["text", "number", "boolean", "datetime"]>;
|
|
247
|
+
description: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
250
|
+
name: string;
|
|
251
|
+
description?: string | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
type: "number" | "boolean" | "text" | "datetime";
|
|
254
|
+
name: string;
|
|
255
|
+
description?: string | undefined;
|
|
256
|
+
}>, "many">;
|
|
257
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
};
|
|
259
|
+
readonly handler: typeof customEventSchemaUpdate;
|
|
260
|
+
}, {
|
|
261
|
+
readonly name: "ol_custom_event_schema_activate";
|
|
262
|
+
readonly title: "Activate/Deactivate Custom Event Schema";
|
|
263
|
+
readonly description: "Activate or deactivate a custom event schema. Inactive schemas won't trigger campaigns/achievements.";
|
|
264
|
+
readonly readOnly: false;
|
|
265
|
+
readonly inputSchema: {
|
|
266
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
267
|
+
eventType: z.ZodString;
|
|
268
|
+
active: z.ZodBoolean;
|
|
269
|
+
};
|
|
270
|
+
readonly handler: typeof customEventSchemaActivate;
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "ol_custom_event_send";
|
|
273
|
+
readonly title: "Send Custom Event";
|
|
274
|
+
readonly description: string;
|
|
275
|
+
readonly readOnly: false;
|
|
276
|
+
readonly inputSchema: {
|
|
277
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
278
|
+
eventType: z.ZodString;
|
|
279
|
+
customerData: z.ZodObject<{
|
|
280
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
281
|
+
email: z.ZodOptional<z.ZodString>;
|
|
282
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
283
|
+
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
email?: string | undefined;
|
|
286
|
+
phone?: string | undefined;
|
|
287
|
+
loyaltyCardNumber?: string | undefined;
|
|
288
|
+
customerId?: string | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
email?: string | undefined;
|
|
291
|
+
phone?: string | undefined;
|
|
292
|
+
loyaltyCardNumber?: string | undefined;
|
|
293
|
+
customerId?: string | undefined;
|
|
294
|
+
}>;
|
|
295
|
+
eventDate: z.ZodString;
|
|
296
|
+
body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
297
|
+
eventId: z.ZodOptional<z.ZodString>;
|
|
298
|
+
};
|
|
299
|
+
readonly handler: typeof customEventSend;
|
|
300
|
+
}, {
|
|
301
|
+
readonly name: "ol_custom_event_list";
|
|
302
|
+
readonly title: "List Custom Events";
|
|
303
|
+
readonly description: "List custom events that have been sent. Filter by event type or member to see event history.";
|
|
304
|
+
readonly readOnly: true;
|
|
305
|
+
readonly inputSchema: {
|
|
306
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
307
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
type: z.ZodOptional<z.ZodString>;
|
|
310
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
311
|
+
email: z.ZodOptional<z.ZodString>;
|
|
312
|
+
};
|
|
313
|
+
readonly handler: typeof customEventList;
|
|
314
|
+
}];
|
|
315
|
+
export {};
|