@open-loyalty/mcp-server 1.5.3 → 1.7.0
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/config.d.ts +4 -0
- package/dist/config.js +11 -0
- package/dist/index.js +0 -8
- package/dist/server.js +13 -0
- package/dist/tools/achievement/handlers.js +47 -0
- package/dist/tools/achievement/index.d.ts +11 -4
- package/dist/tools/achievement/index.js +12 -1
- package/dist/tools/achievement/schemas.d.ts +4 -4
- package/dist/tools/achievement/schemas.js +13 -12
- package/dist/tools/admin/handlers.d.ts +48 -0
- package/dist/tools/admin/handlers.js +159 -0
- package/dist/tools/admin/index.d.ts +86 -0
- package/dist/tools/admin/index.js +64 -0
- package/dist/tools/admin/schemas.d.ts +40 -0
- package/dist/tools/admin/schemas.js +40 -0
- package/dist/tools/analytics/handlers.d.ts +42 -0
- package/dist/tools/analytics/handlers.js +282 -0
- package/dist/tools/analytics/index.d.ts +108 -0
- package/dist/tools/analytics/index.js +91 -0
- package/dist/tools/analytics/schemas.d.ts +42 -0
- package/dist/tools/analytics/schemas.js +47 -0
- package/dist/tools/apikey/handlers.d.ts +15 -0
- package/dist/tools/apikey/handlers.js +53 -0
- package/dist/tools/apikey/index.d.ts +41 -0
- package/dist/tools/apikey/index.js +38 -0
- package/dist/tools/apikey/schemas.d.ts +31 -0
- package/dist/tools/apikey/schemas.js +15 -0
- package/dist/tools/audit/handlers.d.ts +20 -0
- package/dist/tools/audit/handlers.js +82 -0
- package/dist/tools/audit/index.d.ts +36 -0
- package/dist/tools/audit/index.js +28 -0
- package/dist/tools/audit/schemas.d.ts +62 -0
- package/dist/tools/audit/schemas.js +18 -0
- package/dist/tools/badge/handlers.d.ts +45 -0
- package/dist/tools/badge/handlers.js +135 -0
- package/dist/tools/badge/index.d.ts +68 -0
- package/dist/tools/badge/index.js +47 -0
- package/dist/tools/badge/schemas.d.ts +37 -0
- package/dist/tools/badge/schemas.js +31 -0
- package/dist/tools/campaign/handlers.js +61 -0
- package/dist/tools/campaign/index.d.ts +12 -0
- package/dist/tools/campaign/index.js +20 -1
- package/dist/tools/campaign/member-handlers.js +37 -1
- package/dist/tools/campaign/schemas.js +16 -14
- package/dist/tools/custom-event/handlers.d.ts +98 -0
- package/dist/tools/custom-event/handlers.js +238 -0
- package/dist/tools/custom-event/index.d.ts +139 -0
- package/dist/tools/custom-event/index.js +78 -0
- package/dist/tools/custom-event/schemas.d.ts +87 -0
- package/dist/tools/custom-event/schemas.js +59 -0
- package/dist/tools/export/handlers.d.ts +29 -0
- package/dist/tools/export/handlers.js +128 -0
- package/dist/tools/export/index.d.ts +56 -0
- package/dist/tools/export/index.js +46 -0
- package/dist/tools/export/schemas.d.ts +42 -0
- package/dist/tools/export/schemas.js +41 -0
- package/dist/tools/import/handlers.d.ts +22 -0
- package/dist/tools/import/handlers.js +123 -0
- package/dist/tools/import/index.d.ts +45 -0
- package/dist/tools/import/index.js +41 -0
- package/dist/tools/import/schemas.d.ts +57 -0
- package/dist/tools/import/schemas.js +39 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +11 -11
- package/dist/tools/member/handlers.js +30 -0
- package/dist/tools/member/index.d.ts +10 -0
- package/dist/tools/member/index.js +10 -0
- package/dist/tools/member/schemas.js +13 -13
- package/dist/tools/points/handlers.js +73 -0
- package/dist/tools/points/index.d.ts +6 -0
- package/dist/tools/points/index.js +6 -0
- package/dist/tools/points/schemas.js +1 -1
- package/dist/tools/referral/index.d.ts +3 -0
- package/dist/tools/referral/index.js +3 -0
- package/dist/tools/reward/handlers.js +21 -13
- package/dist/tools/reward/index.d.ts +9 -0
- package/dist/tools/reward/index.js +12 -1
- package/dist/tools/reward/schemas.js +2 -2
- package/dist/tools/role/handlers.d.ts +35 -0
- package/dist/tools/role/handlers.js +127 -0
- package/dist/tools/role/index.d.ts +99 -0
- package/dist/tools/role/index.js +65 -0
- package/dist/tools/role/schemas.d.ts +56 -0
- package/dist/tools/role/schemas.js +35 -0
- package/dist/tools/segment/handlers.js +68 -1
- package/dist/tools/segment/index.d.ts +9 -0
- package/dist/tools/segment/index.js +13 -0
- package/dist/tools/segment/schemas.js +8 -5
- package/dist/tools/store/handlers.d.ts +25 -0
- package/dist/tools/store/handlers.js +89 -0
- package/dist/tools/store/index.d.ts +55 -0
- package/dist/tools/store/index.js +46 -0
- package/dist/tools/store/schemas.d.ts +38 -0
- package/dist/tools/store/schemas.js +23 -0
- package/dist/tools/tierset/handlers.js +92 -1
- package/dist/tools/tierset/index.d.ts +6 -0
- package/dist/tools/tierset/index.js +8 -1
- package/dist/tools/transaction/handlers.js +40 -0
- package/dist/tools/transaction/index.d.ts +4 -0
- package/dist/tools/transaction/index.js +4 -0
- package/dist/tools/transaction/schemas.js +3 -3
- package/dist/tools/wallet-type/index.d.ts +4 -0
- package/dist/tools/wallet-type/index.js +5 -1
- package/dist/tools/webhook/handlers.d.ts +34 -0
- package/dist/tools/webhook/handlers.js +147 -0
- package/dist/tools/webhook/index.d.ts +97 -0
- package/dist/tools/webhook/index.js +65 -0
- package/dist/tools/webhook/schemas.d.ts +72 -0
- package/dist/tools/{webhook.js → webhook/schemas.js} +0 -140
- package/dist/types/schemas/tierset.js +3 -1
- package/package.json +1 -1
- package/dist/tools/admin.d.ts +0 -165
- package/dist/tools/admin.js +0 -205
- package/dist/tools/analytics.d.ts +0 -180
- package/dist/tools/analytics.js +0 -255
- package/dist/tools/apikey.d.ts +0 -79
- package/dist/tools/apikey.js +0 -85
- package/dist/tools/audit.d.ts +0 -111
- package/dist/tools/audit.js +0 -94
- package/dist/tools/badge.d.ts +0 -143
- package/dist/tools/badge.js +0 -174
- package/dist/tools/custom-event.d.ts +0 -315
- package/dist/tools/custom-event.js +0 -271
- package/dist/tools/export.d.ts +0 -118
- package/dist/tools/export.js +0 -152
- package/dist/tools/import.d.ts +0 -116
- package/dist/tools/import.js +0 -143
- package/dist/tools/role.d.ts +0 -180
- package/dist/tools/role.js +0 -173
- package/dist/tools/store.d.ts +0 -109
- package/dist/tools/store.js +0 -125
- package/dist/tools/webhook.d.ts +0 -192
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Re-export schemas
|
|
2
|
+
export { AnalyticsTiersInputSchema, AnalyticsMembersInputSchema, AnalyticsPointsInputSchema, AnalyticsTransactionsInputSchema, AnalyticsReferralsInputSchema, AnalyticsCampaignsInputSchema, AnalyticsDashboardInputSchema, AnalyticsUnitsInputSchema, AnalyticsCampaignDetailInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { analyticsTiers, analyticsMembers, analyticsPoints, analyticsTransactions, analyticsReferrals, analyticsCampaigns, analyticsDashboard, analyticsUnits, analyticsCampaignDetail, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { AnalyticsTiersInputSchema, AnalyticsMembersInputSchema, AnalyticsPointsInputSchema, AnalyticsTransactionsInputSchema, AnalyticsReferralsInputSchema, AnalyticsCampaignsInputSchema, AnalyticsDashboardInputSchema, AnalyticsUnitsInputSchema, AnalyticsCampaignDetailInputSchema, } from "./schemas.js";
|
|
7
|
+
import { analyticsTiers, analyticsMembers, analyticsPoints, analyticsTransactions, analyticsReferrals, analyticsCampaigns, analyticsDashboard, analyticsUnits, analyticsCampaignDetail, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const analyticsToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_analytics_tiers",
|
|
12
|
+
title: "Get Tier Analytics",
|
|
13
|
+
description: "Get tier (level) analytics showing member distribution across tiers. Returns tier IDs, names, and member counts for each tier level.",
|
|
14
|
+
readOnly: true,
|
|
15
|
+
idempotent: true,
|
|
16
|
+
inputSchema: AnalyticsTiersInputSchema,
|
|
17
|
+
handler: analyticsTiers,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "ol_analytics_members",
|
|
21
|
+
title: "Get Member Analytics",
|
|
22
|
+
description: "Get member analytics showing registration trends. Returns member counts by time intervals (1 day, 7 days, 30 days, 365 days). Filter by transaction status to see engaged vs unengaged members.",
|
|
23
|
+
readOnly: true,
|
|
24
|
+
idempotent: true,
|
|
25
|
+
inputSchema: AnalyticsMembersInputSchema,
|
|
26
|
+
handler: analyticsMembers,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "ol_analytics_points",
|
|
30
|
+
title: "Get Points Analytics",
|
|
31
|
+
description: "Get points analytics showing program health. Returns total active points, points spent, points issued, expired points, and pending points. Use to monitor points economy.",
|
|
32
|
+
readOnly: true,
|
|
33
|
+
idempotent: true,
|
|
34
|
+
inputSchema: AnalyticsPointsInputSchema,
|
|
35
|
+
handler: analyticsPoints,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "ol_analytics_transactions",
|
|
39
|
+
title: "Get Transaction Analytics",
|
|
40
|
+
description: "Get transaction analytics showing purchase trends. Returns transaction counts by intervals, total count, total amount, and average values. Use to monitor sales performance.",
|
|
41
|
+
readOnly: true,
|
|
42
|
+
idempotent: true,
|
|
43
|
+
inputSchema: AnalyticsTransactionsInputSchema,
|
|
44
|
+
handler: analyticsTransactions,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "ol_analytics_referrals",
|
|
48
|
+
title: "Get Referral Analytics",
|
|
49
|
+
description: "Get referral program analytics showing referral activity. Returns total referral count. Use to monitor referral program performance.",
|
|
50
|
+
readOnly: true,
|
|
51
|
+
idempotent: true,
|
|
52
|
+
inputSchema: AnalyticsReferralsInputSchema,
|
|
53
|
+
handler: analyticsReferrals,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ol_analytics_campaigns",
|
|
57
|
+
title: "Get Campaign Analytics",
|
|
58
|
+
description: "Get campaign analytics showing execution counts per campaign. Returns list of campaigns with their execution counts. Use to identify most successful campaigns.",
|
|
59
|
+
readOnly: true,
|
|
60
|
+
idempotent: true,
|
|
61
|
+
inputSchema: AnalyticsCampaignsInputSchema,
|
|
62
|
+
handler: analyticsCampaigns,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "ol_analytics_dashboard",
|
|
66
|
+
title: "Get Dashboard Overview",
|
|
67
|
+
description: "Get dashboard overview metrics with time-series data. Returns key metrics (registered members, active members, revenue, avg spending, transactions) with optional date range and aggregation. Use for high-level program dashboards.",
|
|
68
|
+
readOnly: true,
|
|
69
|
+
idempotent: true,
|
|
70
|
+
inputSchema: AnalyticsDashboardInputSchema,
|
|
71
|
+
handler: analyticsDashboard,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "ol_analytics_units",
|
|
75
|
+
title: "Get Units Overview",
|
|
76
|
+
description: "Get wallet-specific analytics (units overview). Returns units issued, spent, expired, pending, active, plus redemption and breakage rates. Requires walletTypeCode parameter. Use for detailed points economy analysis.",
|
|
77
|
+
readOnly: true,
|
|
78
|
+
idempotent: true,
|
|
79
|
+
inputSchema: AnalyticsUnitsInputSchema,
|
|
80
|
+
handler: analyticsUnits,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "ol_analytics_campaign_detail",
|
|
84
|
+
title: "Get Campaign Detail Analytics",
|
|
85
|
+
description: "Get detailed analytics for a specific campaign. Returns campaign-specific performance metrics. Use after analytics_campaigns to drill into individual campaign performance.",
|
|
86
|
+
readOnly: true,
|
|
87
|
+
idempotent: true,
|
|
88
|
+
inputSchema: AnalyticsCampaignDetailInputSchema,
|
|
89
|
+
handler: analyticsCampaignDetail,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AnalyticsTiersInputSchema: {
|
|
3
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
4
|
+
};
|
|
5
|
+
export declare const AnalyticsMembersInputSchema: {
|
|
6
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
7
|
+
withTransaction: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
};
|
|
9
|
+
export declare const AnalyticsPointsInputSchema: {
|
|
10
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
11
|
+
};
|
|
12
|
+
export declare const AnalyticsTransactionsInputSchema: {
|
|
13
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
14
|
+
};
|
|
15
|
+
export declare const AnalyticsReferralsInputSchema: {
|
|
16
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
17
|
+
};
|
|
18
|
+
export declare const AnalyticsCampaignsInputSchema: {
|
|
19
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
20
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
executedAt: z.ZodOptional<z.ZodString>;
|
|
23
|
+
};
|
|
24
|
+
export declare const AnalyticsDashboardInputSchema: {
|
|
25
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
26
|
+
dataType: z.ZodEnum<["registeredMembers", "activeMembers", "revenue", "avgSpending", "transactions", "avgTransactionValue", "avgNumberOfTransactions"]>;
|
|
27
|
+
aggregationType: z.ZodOptional<z.ZodEnum<["day", "week", "month"]>>;
|
|
28
|
+
intervalStartDate: z.ZodOptional<z.ZodString>;
|
|
29
|
+
intervalEndDate: z.ZodOptional<z.ZodString>;
|
|
30
|
+
};
|
|
31
|
+
export declare const AnalyticsUnitsInputSchema: {
|
|
32
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
33
|
+
walletTypeCode: z.ZodString;
|
|
34
|
+
dataType: z.ZodOptional<z.ZodEnum<["unitsIssued", "unitsSpent", "unitsExpired", "unitsPending", "unitsActive"]>>;
|
|
35
|
+
aggregationType: z.ZodOptional<z.ZodEnum<["day", "week", "month"]>>;
|
|
36
|
+
intervalStartDate: z.ZodOptional<z.ZodString>;
|
|
37
|
+
intervalEndDate: z.ZodOptional<z.ZodString>;
|
|
38
|
+
};
|
|
39
|
+
export declare const AnalyticsCampaignDetailInputSchema: {
|
|
40
|
+
storeCode: z.ZodOptional<z.ZodString>;
|
|
41
|
+
campaignId: z.ZodString;
|
|
42
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const AnalyticsTiersInputSchema = {
|
|
3
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
4
|
+
};
|
|
5
|
+
export const AnalyticsMembersInputSchema = {
|
|
6
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
7
|
+
withTransaction: z.boolean().optional().describe("Filter: true for members with transactions, false for members without, omit for all."),
|
|
8
|
+
};
|
|
9
|
+
export const AnalyticsPointsInputSchema = {
|
|
10
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
11
|
+
};
|
|
12
|
+
export const AnalyticsTransactionsInputSchema = {
|
|
13
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
14
|
+
};
|
|
15
|
+
export const AnalyticsReferralsInputSchema = {
|
|
16
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
17
|
+
};
|
|
18
|
+
export const AnalyticsCampaignsInputSchema = {
|
|
19
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
20
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
21
|
+
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
22
|
+
executedAt: z.string().optional().describe("Filter by execution date (ISO format)."),
|
|
23
|
+
};
|
|
24
|
+
export const AnalyticsDashboardInputSchema = {
|
|
25
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
26
|
+
dataType: z.enum([
|
|
27
|
+
"registeredMembers", "activeMembers", "revenue", "avgSpending",
|
|
28
|
+
"transactions", "avgTransactionValue", "avgNumberOfTransactions"
|
|
29
|
+
]).describe("REQUIRED: Type of data to retrieve. Options: registeredMembers, activeMembers, revenue, avgSpending, transactions, avgTransactionValue, avgNumberOfTransactions."),
|
|
30
|
+
aggregationType: z.enum(["day", "week", "month"]).optional().describe("Aggregation granularity."),
|
|
31
|
+
intervalStartDate: z.string().optional().describe("Start date (YYYY-MM-DD format)."),
|
|
32
|
+
intervalEndDate: z.string().optional().describe("End date (YYYY-MM-DD format)."),
|
|
33
|
+
};
|
|
34
|
+
export const AnalyticsUnitsInputSchema = {
|
|
35
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
36
|
+
walletTypeCode: z.string().describe("Wallet type code (e.g., 'default' or 'points')."),
|
|
37
|
+
dataType: z.enum([
|
|
38
|
+
"unitsIssued", "unitsSpent", "unitsExpired", "unitsPending", "unitsActive"
|
|
39
|
+
]).optional().describe("Type of data to retrieve."),
|
|
40
|
+
aggregationType: z.enum(["day", "week", "month"]).optional().describe("Aggregation granularity."),
|
|
41
|
+
intervalStartDate: z.string().optional().describe("Start date (YYYY-MM-DD format)."),
|
|
42
|
+
intervalEndDate: z.string().optional().describe("End date (YYYY-MM-DD format)."),
|
|
43
|
+
};
|
|
44
|
+
export const AnalyticsCampaignDetailInputSchema = {
|
|
45
|
+
storeCode: z.string().optional().describe("INTERNAL: Auto-configured from server settings. NEVER ask the user for this value. Only set if the user explicitly requests a different store."),
|
|
46
|
+
campaignId: z.string().describe("The campaign ID to get analytics for."),
|
|
47
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ApiKey, ApiKeyListResponse } from "./schemas.js";
|
|
2
|
+
export declare function apiKeyCreate(input: {
|
|
3
|
+
adminId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
expirationDate?: string;
|
|
6
|
+
}): Promise<ApiKey>;
|
|
7
|
+
export declare function apiKeyList(input: {
|
|
8
|
+
adminId: string;
|
|
9
|
+
page?: number;
|
|
10
|
+
perPage?: number;
|
|
11
|
+
}): Promise<ApiKeyListResponse>;
|
|
12
|
+
export declare function apiKeyDelete(input: {
|
|
13
|
+
adminId: string;
|
|
14
|
+
apiKeyId: string;
|
|
15
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { apiGet, apiPost, apiDelete } from "../../client/http.js";
|
|
2
|
+
import { formatApiError, OpenLoyaltyError } from "../../utils/errors.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
export async function apiKeyCreate(input) {
|
|
5
|
+
const payload = {};
|
|
6
|
+
if (input.name)
|
|
7
|
+
payload.name = input.name;
|
|
8
|
+
if (input.expirationDate)
|
|
9
|
+
payload.expirationDate = input.expirationDate;
|
|
10
|
+
try {
|
|
11
|
+
const response = await apiPost(`/admin/${input.adminId}/api-key`, { apiKey: payload });
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
16
|
+
throw new OpenLoyaltyError({ code: "NOT_FOUND", message: `Admin '${input.adminId}' not found`,
|
|
17
|
+
hint: "Use ol_admin_list() to find existing admin users and their IDs.", relatedTool: "ol_apikey_create" });
|
|
18
|
+
}
|
|
19
|
+
throw formatApiError(error, "ol_apikey_create");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export async function apiKeyList(input) {
|
|
23
|
+
const params = new URLSearchParams();
|
|
24
|
+
if (input.page)
|
|
25
|
+
params.append("_page", String(input.page));
|
|
26
|
+
if (input.perPage)
|
|
27
|
+
params.append("_itemsOnPage", String(input.perPage));
|
|
28
|
+
const queryString = params.toString();
|
|
29
|
+
const url = `/admin/${input.adminId}/api-key${queryString ? `?${queryString}` : ""}`;
|
|
30
|
+
try {
|
|
31
|
+
const response = await apiGet(url);
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
36
|
+
throw new OpenLoyaltyError({ code: "NOT_FOUND", message: `Admin '${input.adminId}' not found`,
|
|
37
|
+
hint: "Use ol_admin_list() to find existing admin users and their IDs.", relatedTool: "ol_apikey_list" });
|
|
38
|
+
}
|
|
39
|
+
throw formatApiError(error, "ol_apikey_list");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export async function apiKeyDelete(input) {
|
|
43
|
+
try {
|
|
44
|
+
await apiDelete(`/admin/${input.adminId}/api-key/${input.apiKeyId}`);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
48
|
+
throw new OpenLoyaltyError({ code: "NOT_FOUND", message: `API key '${input.apiKeyId}' not found for admin '${input.adminId}'`,
|
|
49
|
+
hint: "Use ol_apikey_list(adminId) to find existing API keys. The apiKeyId or adminId may be incorrect.", relatedTool: "ol_apikey_delete" });
|
|
50
|
+
}
|
|
51
|
+
throw formatApiError(error, "ol_apikey_delete");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { ApiKeyCreateInputSchema, ApiKeyListInputSchema, ApiKeyDeleteInputSchema, } from "./schemas.js";
|
|
2
|
+
export type { ApiKey, ApiKeyListResponse } from "./schemas.js";
|
|
3
|
+
export { apiKeyCreate, apiKeyList, apiKeyDelete, } from "./handlers.js";
|
|
4
|
+
import { apiKeyCreate, apiKeyList, apiKeyDelete } from "./handlers.js";
|
|
5
|
+
export declare const apiKeyToolDefinitions: readonly [{
|
|
6
|
+
readonly name: "ol_apikey_create";
|
|
7
|
+
readonly title: "Create API Key";
|
|
8
|
+
readonly description: "Create a new API key for an admin user. CRITICAL: The API token is ONLY returned at creation time. Store it securely immediately - it cannot be retrieved later. Returns apiKeyId, token, adminId, name, and expirationDate.";
|
|
9
|
+
readonly readOnly: false;
|
|
10
|
+
readonly idempotent: false;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
adminId: import("zod").ZodString;
|
|
13
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
|
+
expirationDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
};
|
|
16
|
+
readonly handler: typeof apiKeyCreate;
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "ol_apikey_list";
|
|
19
|
+
readonly title: "List API Keys";
|
|
20
|
+
readonly description: "List API keys for an admin user. Returns list of API keys with apiKeyId, adminId, name, and expirationDate. Note: tokens are not returned in list responses for security.";
|
|
21
|
+
readonly readOnly: true;
|
|
22
|
+
readonly idempotent: true;
|
|
23
|
+
readonly inputSchema: {
|
|
24
|
+
adminId: import("zod").ZodString;
|
|
25
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
26
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
27
|
+
};
|
|
28
|
+
readonly handler: typeof apiKeyList;
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "ol_apikey_delete";
|
|
31
|
+
readonly title: "Delete API Key (Permanent)";
|
|
32
|
+
readonly description: "Delete an API key. Returns void on success (204 No Content). The API key will be immediately invalidated.";
|
|
33
|
+
readonly readOnly: false;
|
|
34
|
+
readonly destructive: true;
|
|
35
|
+
readonly idempotent: true;
|
|
36
|
+
readonly inputSchema: {
|
|
37
|
+
adminId: import("zod").ZodString;
|
|
38
|
+
apiKeyId: import("zod").ZodString;
|
|
39
|
+
};
|
|
40
|
+
readonly handler: typeof apiKeyDelete;
|
|
41
|
+
}];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Re-export schemas and types
|
|
2
|
+
export { ApiKeyCreateInputSchema, ApiKeyListInputSchema, ApiKeyDeleteInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { apiKeyCreate, apiKeyList, apiKeyDelete, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { ApiKeyCreateInputSchema, ApiKeyListInputSchema, ApiKeyDeleteInputSchema, } from "./schemas.js";
|
|
7
|
+
import { apiKeyCreate, apiKeyList, apiKeyDelete, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const apiKeyToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_apikey_create",
|
|
12
|
+
title: "Create API Key",
|
|
13
|
+
description: "Create a new API key for an admin user. CRITICAL: The API token is ONLY returned at creation time. Store it securely immediately - it cannot be retrieved later. Returns apiKeyId, token, adminId, name, and expirationDate.",
|
|
14
|
+
readOnly: false,
|
|
15
|
+
idempotent: false,
|
|
16
|
+
inputSchema: ApiKeyCreateInputSchema,
|
|
17
|
+
handler: apiKeyCreate,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "ol_apikey_list",
|
|
21
|
+
title: "List API Keys",
|
|
22
|
+
description: "List API keys for an admin user. Returns list of API keys with apiKeyId, adminId, name, and expirationDate. Note: tokens are not returned in list responses for security.",
|
|
23
|
+
readOnly: true,
|
|
24
|
+
idempotent: true,
|
|
25
|
+
inputSchema: ApiKeyListInputSchema,
|
|
26
|
+
handler: apiKeyList,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "ol_apikey_delete",
|
|
30
|
+
title: "Delete API Key (Permanent)",
|
|
31
|
+
description: "Delete an API key. Returns void on success (204 No Content). The API key will be immediately invalidated.",
|
|
32
|
+
readOnly: false,
|
|
33
|
+
destructive: true,
|
|
34
|
+
idempotent: true,
|
|
35
|
+
inputSchema: ApiKeyDeleteInputSchema,
|
|
36
|
+
handler: apiKeyDelete,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface ApiKey {
|
|
3
|
+
apiKeyId: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
adminId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
legacy?: boolean;
|
|
8
|
+
expirationDate?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiKeyListResponse {
|
|
11
|
+
items: ApiKey[];
|
|
12
|
+
total?: {
|
|
13
|
+
all?: number | string;
|
|
14
|
+
filtered?: number | string;
|
|
15
|
+
estimated?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const ApiKeyCreateInputSchema: {
|
|
19
|
+
adminId: z.ZodString;
|
|
20
|
+
name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
expirationDate: z.ZodOptional<z.ZodString>;
|
|
22
|
+
};
|
|
23
|
+
export declare const ApiKeyListInputSchema: {
|
|
24
|
+
adminId: z.ZodString;
|
|
25
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
};
|
|
28
|
+
export declare const ApiKeyDeleteInputSchema: {
|
|
29
|
+
adminId: z.ZodString;
|
|
30
|
+
apiKeyId: z.ZodString;
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ApiKeyCreateInputSchema = {
|
|
3
|
+
adminId: z.string().describe("The admin ID (UUID) to create API key for."),
|
|
4
|
+
name: z.string().optional().describe("Name/description for the API key."),
|
|
5
|
+
expirationDate: z.string().optional().describe("Expiration date (ISO format: YYYY-MM-DD)."),
|
|
6
|
+
};
|
|
7
|
+
export const ApiKeyListInputSchema = {
|
|
8
|
+
adminId: z.string().describe("The admin ID (UUID) to list API keys for."),
|
|
9
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
10
|
+
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
11
|
+
};
|
|
12
|
+
export const ApiKeyDeleteInputSchema = {
|
|
13
|
+
adminId: z.string().describe("The admin ID (UUID) that owns the API key."),
|
|
14
|
+
apiKeyId: z.string().describe("The API key ID to delete."),
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AuditLogListResponse } from "./schemas.js";
|
|
2
|
+
export declare function auditList(input: {
|
|
3
|
+
page?: number;
|
|
4
|
+
perPage?: number;
|
|
5
|
+
eventType?: string;
|
|
6
|
+
entityId?: string;
|
|
7
|
+
entityType?: string;
|
|
8
|
+
username?: string;
|
|
9
|
+
dateFrom?: string;
|
|
10
|
+
dateTo?: string;
|
|
11
|
+
store?: string;
|
|
12
|
+
}): Promise<AuditLogListResponse>;
|
|
13
|
+
export declare function auditExport(input: {
|
|
14
|
+
dateFrom?: string;
|
|
15
|
+
dateTo?: string;
|
|
16
|
+
page?: number;
|
|
17
|
+
perPage?: number;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
exportId: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { apiGet, apiPost } from "../../client/http.js";
|
|
2
|
+
import { formatApiError, OpenLoyaltyError } from "../../utils/errors.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
export async function auditList(input) {
|
|
5
|
+
const params = new URLSearchParams();
|
|
6
|
+
if (input.page)
|
|
7
|
+
params.append("_page", String(input.page));
|
|
8
|
+
if (input.perPage)
|
|
9
|
+
params.append("_itemsOnPage", String(input.perPage));
|
|
10
|
+
if (input.eventType)
|
|
11
|
+
params.append("eventType", input.eventType);
|
|
12
|
+
if (input.entityId)
|
|
13
|
+
params.append("entityId", input.entityId);
|
|
14
|
+
if (input.entityType)
|
|
15
|
+
params.append("entityType", input.entityType);
|
|
16
|
+
if (input.username)
|
|
17
|
+
params.append("username", input.username);
|
|
18
|
+
if (input.dateFrom)
|
|
19
|
+
params.append("createdAt[gte]", input.dateFrom);
|
|
20
|
+
if (input.dateTo)
|
|
21
|
+
params.append("createdAt[lte]", input.dateTo);
|
|
22
|
+
if (input.store)
|
|
23
|
+
params.append("store", input.store);
|
|
24
|
+
const queryString = params.toString();
|
|
25
|
+
const url = `/audit/log${queryString ? `?${queryString}` : ""}`;
|
|
26
|
+
try {
|
|
27
|
+
const response = await apiGet(url);
|
|
28
|
+
return response;
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (axios.isAxiosError(error) && error.response?.status === 400) {
|
|
32
|
+
const allMessages = [error.response?.data?.message || "", ...(error.response?.data?.errors || []).map((e) => e.message)].join(" ").toLowerCase();
|
|
33
|
+
if (allMessages.includes("date") || allMessages.includes("format") || allMessages.includes("created")) {
|
|
34
|
+
throw new OpenLoyaltyError({
|
|
35
|
+
code: "INVALID_DATE_FORMAT",
|
|
36
|
+
message: "Invalid date format in audit log filter",
|
|
37
|
+
hint: "Use ISO 8601 format for dateFrom/dateTo: 'YYYY-MM-DDTHH:mm:ss+00:00' (e.g., '2026-01-01T00:00:00+00:00').",
|
|
38
|
+
relatedTool: "ol_audit_list",
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
43
|
+
throw new OpenLoyaltyError({
|
|
44
|
+
code: "AUDIT_PERMISSION_DENIED",
|
|
45
|
+
message: "You don't have permission to view audit logs",
|
|
46
|
+
hint: "Audit log access requires super admin privileges or the AUDIT:VIEW permission. Contact your system administrator.",
|
|
47
|
+
relatedTool: "ol_audit_list",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
throw formatApiError(error, "ol_audit_list");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export async function auditExport(input) {
|
|
54
|
+
const payload = {};
|
|
55
|
+
const systemLogPayload = {};
|
|
56
|
+
if (input.dateFrom || input.dateTo) {
|
|
57
|
+
systemLogPayload.createdAt = {};
|
|
58
|
+
if (input.dateFrom)
|
|
59
|
+
systemLogPayload.createdAt.gte = input.dateFrom;
|
|
60
|
+
if (input.dateTo)
|
|
61
|
+
systemLogPayload.createdAt.lte = input.dateTo;
|
|
62
|
+
}
|
|
63
|
+
if (input.page)
|
|
64
|
+
systemLogPayload._page = input.page;
|
|
65
|
+
if (input.perPage)
|
|
66
|
+
systemLogPayload._itemsOnPage = input.perPage;
|
|
67
|
+
payload.systemLog = systemLogPayload;
|
|
68
|
+
try {
|
|
69
|
+
const response = await apiPost("/system-log/export", payload);
|
|
70
|
+
return response;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (axios.isAxiosError(error) && error.response?.status === 400) {
|
|
74
|
+
const allMessages = [error.response?.data?.message || "", ...(error.response?.data?.errors || []).map((e) => e.message)].join(" ").toLowerCase();
|
|
75
|
+
if (allMessages.includes("date") || allMessages.includes("format") || allMessages.includes("invalid")) {
|
|
76
|
+
throw new OpenLoyaltyError({ code: "INVALID_DATE_FORMAT", message: "Invalid date format in audit export request",
|
|
77
|
+
hint: "Use ISO 8601 format for dates: 'YYYY-MM-DDTHH:mm:ss+00:00' (e.g., '2026-01-01T00:00:00+00:00').", relatedTool: "ol_audit_export" });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
throw formatApiError(error, "ol_audit_export");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { AuditListInputSchema, AuditExportInputSchema, } from "./schemas.js";
|
|
2
|
+
export type { AuditLogStore, AuditLogEntry, AuditLogListResponse, AuditExport, AuditExportListResponse, } from "./schemas.js";
|
|
3
|
+
export { auditList, auditExport, } from "./handlers.js";
|
|
4
|
+
import { auditList, auditExport } from "./handlers.js";
|
|
5
|
+
export declare const auditToolDefinitions: readonly [{
|
|
6
|
+
readonly name: "ol_audit_list";
|
|
7
|
+
readonly title: "List Audit Logs";
|
|
8
|
+
readonly description: "List audit log entries with optional filtering. Returns paginated list of audit entries with auditLogId, eventType, entityType, entityId, username, timestamp, and details. Audit logs track all administrative actions. Use for compliance and troubleshooting.";
|
|
9
|
+
readonly readOnly: true;
|
|
10
|
+
readonly idempotent: true;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
14
|
+
eventType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
15
|
+
entityId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
16
|
+
entityType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
username: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
dateFrom: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
dateTo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
store: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
};
|
|
22
|
+
readonly handler: typeof auditList;
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "ol_audit_export";
|
|
25
|
+
readonly title: "Export Audit Logs";
|
|
26
|
+
readonly description: "Create an export of system logs. Returns exportId that can be used to track export status. The export will be processed asynchronously. Use date filters to scope the export range.";
|
|
27
|
+
readonly readOnly: false;
|
|
28
|
+
readonly idempotent: false;
|
|
29
|
+
readonly inputSchema: {
|
|
30
|
+
dateFrom: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
dateTo: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
33
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
34
|
+
};
|
|
35
|
+
readonly handler: typeof auditExport;
|
|
36
|
+
}];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Re-export schemas and types
|
|
2
|
+
export { AuditListInputSchema, AuditExportInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { auditList, auditExport, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { AuditListInputSchema, AuditExportInputSchema, } from "./schemas.js";
|
|
7
|
+
import { auditList, auditExport, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const auditToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_audit_list",
|
|
12
|
+
title: "List Audit Logs",
|
|
13
|
+
description: "List audit log entries with optional filtering. Returns paginated list of audit entries with auditLogId, eventType, entityType, entityId, username, timestamp, and details. Audit logs track all administrative actions. Use for compliance and troubleshooting.",
|
|
14
|
+
readOnly: true,
|
|
15
|
+
idempotent: true,
|
|
16
|
+
inputSchema: AuditListInputSchema,
|
|
17
|
+
handler: auditList,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "ol_audit_export",
|
|
21
|
+
title: "Export Audit Logs",
|
|
22
|
+
description: "Create an export of system logs. Returns exportId that can be used to track export status. The export will be processed asynchronously. Use date filters to scope the export range.",
|
|
23
|
+
readOnly: false,
|
|
24
|
+
idempotent: false,
|
|
25
|
+
inputSchema: AuditExportInputSchema,
|
|
26
|
+
handler: auditExport,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface AuditLogStore {
|
|
3
|
+
storeId: string;
|
|
4
|
+
code: string;
|
|
5
|
+
currency?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
updatedBy?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AuditLogEntry {
|
|
14
|
+
auditLogId: string;
|
|
15
|
+
store?: AuditLogStore;
|
|
16
|
+
eventType: string;
|
|
17
|
+
entityType: string;
|
|
18
|
+
entityId: string;
|
|
19
|
+
username: string;
|
|
20
|
+
userId?: string;
|
|
21
|
+
userType?: string;
|
|
22
|
+
ip?: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AuditLogListResponse {
|
|
26
|
+
items: AuditLogEntry[];
|
|
27
|
+
total?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface AuditExport {
|
|
30
|
+
exportId: string;
|
|
31
|
+
status: string;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
finishedAt?: string;
|
|
34
|
+
criteria?: string;
|
|
35
|
+
exportedRows?: number;
|
|
36
|
+
message?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AuditExportListResponse {
|
|
39
|
+
items: AuditExport[];
|
|
40
|
+
total?: {
|
|
41
|
+
all?: number;
|
|
42
|
+
filtered?: number;
|
|
43
|
+
estimated?: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export declare const AuditListInputSchema: {
|
|
47
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
50
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
51
|
+
entityType: z.ZodOptional<z.ZodString>;
|
|
52
|
+
username: z.ZodOptional<z.ZodString>;
|
|
53
|
+
dateFrom: z.ZodOptional<z.ZodString>;
|
|
54
|
+
dateTo: z.ZodOptional<z.ZodString>;
|
|
55
|
+
store: z.ZodOptional<z.ZodString>;
|
|
56
|
+
};
|
|
57
|
+
export declare const AuditExportInputSchema: {
|
|
58
|
+
dateFrom: z.ZodOptional<z.ZodString>;
|
|
59
|
+
dateTo: z.ZodOptional<z.ZodString>;
|
|
60
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const AuditListInputSchema = {
|
|
3
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
4
|
+
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
5
|
+
eventType: z.string().optional().describe("Filter by event type."),
|
|
6
|
+
entityId: z.string().optional().describe("Filter by entity ID."),
|
|
7
|
+
entityType: z.string().optional().describe("Filter by entity type (e.g., MEMBER, CAMPAIGN)."),
|
|
8
|
+
username: z.string().optional().describe("Filter by username who performed the action."),
|
|
9
|
+
dateFrom: z.string().optional().describe("Filter by creation date from (ISO format)."),
|
|
10
|
+
dateTo: z.string().optional().describe("Filter by creation date to (ISO format)."),
|
|
11
|
+
store: z.string().optional().describe("Filter by store code."),
|
|
12
|
+
};
|
|
13
|
+
export const AuditExportInputSchema = {
|
|
14
|
+
dateFrom: z.string().optional().describe("Export logs from this date (ISO format)."),
|
|
15
|
+
dateTo: z.string().optional().describe("Export logs to this date (ISO format)."),
|
|
16
|
+
page: z.number().optional().describe("Page number for export."),
|
|
17
|
+
perPage: z.number().optional().describe("Items per page for export."),
|
|
18
|
+
};
|