@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,86 @@
|
|
|
1
|
+
export { AdminListInputSchema, AdminCreateInputSchema, AdminGetInputSchema, AdminUpdateInputSchema, AdminChangePasswordInputSchema, } from "./schemas.js";
|
|
2
|
+
export { adminList, adminCreate, adminGet, adminUpdate, adminChangePassword, adminGetPermissions, } from "./handlers.js";
|
|
3
|
+
import { adminList, adminCreate, adminGet, adminUpdate, adminChangePassword, adminGetPermissions } from "./handlers.js";
|
|
4
|
+
export declare const adminToolDefinitions: readonly [{
|
|
5
|
+
readonly name: "ol_admin_list";
|
|
6
|
+
readonly title: "List Admin Users";
|
|
7
|
+
readonly description: "List admin users with optional filtering. Returns paginated list of admin users with id, email, firstName, lastName, isActive, createdAt.";
|
|
8
|
+
readonly readOnly: true;
|
|
9
|
+
readonly idempotent: true;
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
12
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
14
|
+
isActive: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
15
|
+
firstName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
16
|
+
lastName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
role: import("zod").ZodOptional<import("zod").ZodString>;
|
|
18
|
+
};
|
|
19
|
+
readonly handler: typeof adminList;
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "ol_admin_create";
|
|
22
|
+
readonly title: "Create Admin User";
|
|
23
|
+
readonly description: "Create a new admin user. Requires email and password. Optionally assign roles, set active status, and configure notifications. Returns adminId.";
|
|
24
|
+
readonly readOnly: false;
|
|
25
|
+
readonly idempotent: false;
|
|
26
|
+
readonly inputSchema: {
|
|
27
|
+
email: import("zod").ZodString;
|
|
28
|
+
password: import("zod").ZodString;
|
|
29
|
+
firstName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
30
|
+
lastName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
31
|
+
phone: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
roles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">>;
|
|
33
|
+
isActive: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
34
|
+
external: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
35
|
+
notificationsEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
36
|
+
};
|
|
37
|
+
readonly handler: typeof adminCreate;
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "ol_admin_get";
|
|
40
|
+
readonly title: "Get Admin User Details";
|
|
41
|
+
readonly description: "Get full admin user details by ID. Returns profile including email, name, roles, settings, active status, and creation date.";
|
|
42
|
+
readonly readOnly: true;
|
|
43
|
+
readonly idempotent: true;
|
|
44
|
+
readonly inputSchema: {
|
|
45
|
+
adminId: import("zod").ZodString;
|
|
46
|
+
};
|
|
47
|
+
readonly handler: typeof adminGet;
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "ol_admin_update";
|
|
50
|
+
readonly title: "Update Admin User";
|
|
51
|
+
readonly description: "Update admin user profile. Can update email, name, phone, roles, active status, and password. Returns adminId on success.";
|
|
52
|
+
readonly readOnly: false;
|
|
53
|
+
readonly idempotent: true;
|
|
54
|
+
readonly inputSchema: {
|
|
55
|
+
adminId: import("zod").ZodString;
|
|
56
|
+
email: import("zod").ZodOptional<import("zod").ZodString>;
|
|
57
|
+
firstName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
58
|
+
lastName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
59
|
+
phone: import("zod").ZodOptional<import("zod").ZodString>;
|
|
60
|
+
roles: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, "many">>;
|
|
61
|
+
isActive: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
62
|
+
external: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
63
|
+
notificationsEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
64
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
};
|
|
66
|
+
readonly handler: typeof adminUpdate;
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "ol_admin_change_password";
|
|
69
|
+
readonly title: "Change Admin Password";
|
|
70
|
+
readonly description: "Change the currently logged-in admin's password. Requires current password for verification. Returns void on success.";
|
|
71
|
+
readonly readOnly: false;
|
|
72
|
+
readonly idempotent: true;
|
|
73
|
+
readonly inputSchema: {
|
|
74
|
+
currentPassword: import("zod").ZodString;
|
|
75
|
+
newPassword: import("zod").ZodString;
|
|
76
|
+
};
|
|
77
|
+
readonly handler: typeof adminChangePassword;
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "ol_admin_get_permissions";
|
|
80
|
+
readonly title: "Get Admin Permissions";
|
|
81
|
+
readonly description: "Get the current admin user's permissions. Returns superAdmin flag, list of roles, and list of permission strings. Use to check what actions are available.";
|
|
82
|
+
readonly readOnly: true;
|
|
83
|
+
readonly idempotent: true;
|
|
84
|
+
readonly inputSchema: {};
|
|
85
|
+
readonly handler: typeof adminGetPermissions;
|
|
86
|
+
}];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Re-export schemas
|
|
2
|
+
export { AdminListInputSchema, AdminCreateInputSchema, AdminGetInputSchema, AdminUpdateInputSchema, AdminChangePasswordInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { adminList, adminCreate, adminGet, adminUpdate, adminChangePassword, adminGetPermissions, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { AdminListInputSchema, AdminCreateInputSchema, AdminGetInputSchema, AdminUpdateInputSchema, AdminChangePasswordInputSchema, } from "./schemas.js";
|
|
7
|
+
import { adminList, adminCreate, adminGet, adminUpdate, adminChangePassword, adminGetPermissions, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const adminToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_admin_list",
|
|
12
|
+
title: "List Admin Users",
|
|
13
|
+
description: "List admin users with optional filtering. Returns paginated list of admin users with id, email, firstName, lastName, isActive, createdAt.",
|
|
14
|
+
readOnly: true,
|
|
15
|
+
idempotent: true,
|
|
16
|
+
inputSchema: AdminListInputSchema,
|
|
17
|
+
handler: adminList,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "ol_admin_create",
|
|
21
|
+
title: "Create Admin User",
|
|
22
|
+
description: "Create a new admin user. Requires email and password. Optionally assign roles, set active status, and configure notifications. Returns adminId.",
|
|
23
|
+
readOnly: false,
|
|
24
|
+
idempotent: false,
|
|
25
|
+
inputSchema: AdminCreateInputSchema,
|
|
26
|
+
handler: adminCreate,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "ol_admin_get",
|
|
30
|
+
title: "Get Admin User Details",
|
|
31
|
+
description: "Get full admin user details by ID. Returns profile including email, name, roles, settings, active status, and creation date.",
|
|
32
|
+
readOnly: true,
|
|
33
|
+
idempotent: true,
|
|
34
|
+
inputSchema: AdminGetInputSchema,
|
|
35
|
+
handler: adminGet,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "ol_admin_update",
|
|
39
|
+
title: "Update Admin User",
|
|
40
|
+
description: "Update admin user profile. Can update email, name, phone, roles, active status, and password. Returns adminId on success.",
|
|
41
|
+
readOnly: false,
|
|
42
|
+
idempotent: true,
|
|
43
|
+
inputSchema: AdminUpdateInputSchema,
|
|
44
|
+
handler: adminUpdate,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "ol_admin_change_password",
|
|
48
|
+
title: "Change Admin Password",
|
|
49
|
+
description: "Change the currently logged-in admin's password. Requires current password for verification. Returns void on success.",
|
|
50
|
+
readOnly: false,
|
|
51
|
+
idempotent: true,
|
|
52
|
+
inputSchema: AdminChangePasswordInputSchema,
|
|
53
|
+
handler: adminChangePassword,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "ol_admin_get_permissions",
|
|
57
|
+
title: "Get Admin Permissions",
|
|
58
|
+
description: "Get the current admin user's permissions. Returns superAdmin flag, list of roles, and list of permission strings. Use to check what actions are available.",
|
|
59
|
+
readOnly: true,
|
|
60
|
+
idempotent: true,
|
|
61
|
+
inputSchema: {},
|
|
62
|
+
handler: adminGetPermissions,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AdminListInputSchema: {
|
|
3
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
email: z.ZodOptional<z.ZodString>;
|
|
6
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
9
|
+
role: z.ZodOptional<z.ZodString>;
|
|
10
|
+
};
|
|
11
|
+
export declare const AdminCreateInputSchema: {
|
|
12
|
+
email: z.ZodString;
|
|
13
|
+
password: z.ZodString;
|
|
14
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
15
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
17
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
18
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
external: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
notificationsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
};
|
|
22
|
+
export declare const AdminGetInputSchema: {
|
|
23
|
+
adminId: z.ZodString;
|
|
24
|
+
};
|
|
25
|
+
export declare const AdminUpdateInputSchema: {
|
|
26
|
+
adminId: z.ZodString;
|
|
27
|
+
email: z.ZodOptional<z.ZodString>;
|
|
28
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
29
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
30
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
31
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
|
|
32
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
external: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
notificationsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
password: z.ZodOptional<z.ZodString>;
|
|
36
|
+
};
|
|
37
|
+
export declare const AdminChangePasswordInputSchema: {
|
|
38
|
+
currentPassword: z.ZodString;
|
|
39
|
+
newPassword: z.ZodString;
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const AdminListInputSchema = {
|
|
3
|
+
page: z.number().optional().describe("Page number (default: 1)."),
|
|
4
|
+
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
5
|
+
email: z.string().optional().describe("Filter by email address."),
|
|
6
|
+
isActive: z.boolean().optional().describe("Filter by active status."),
|
|
7
|
+
firstName: z.string().optional().describe("Filter by first name."),
|
|
8
|
+
lastName: z.string().optional().describe("Filter by last name."),
|
|
9
|
+
role: z.string().optional().describe("Filter by role."),
|
|
10
|
+
};
|
|
11
|
+
export const AdminCreateInputSchema = {
|
|
12
|
+
email: z.string().describe("Admin email address (required)."),
|
|
13
|
+
password: z.string().describe("Admin password (required)."),
|
|
14
|
+
firstName: z.string().optional().describe("Admin first name."),
|
|
15
|
+
lastName: z.string().optional().describe("Admin last name."),
|
|
16
|
+
phone: z.string().optional().describe("Admin phone number."),
|
|
17
|
+
roles: z.array(z.union([z.string(), z.number()])).optional().describe("Role IDs to assign. Use ol_role_list to find valid role IDs."),
|
|
18
|
+
isActive: z.boolean().optional().describe("Whether account is active (default: true)."),
|
|
19
|
+
external: z.boolean().optional().describe("Whether admin is external."),
|
|
20
|
+
notificationsEnabled: z.boolean().optional().describe("Whether notifications are enabled."),
|
|
21
|
+
};
|
|
22
|
+
export const AdminGetInputSchema = {
|
|
23
|
+
adminId: z.string().describe("The admin ID (UUID) to retrieve."),
|
|
24
|
+
};
|
|
25
|
+
export const AdminUpdateInputSchema = {
|
|
26
|
+
adminId: z.string().describe("The admin ID (UUID) to update."),
|
|
27
|
+
email: z.string().optional().describe("Admin email address."),
|
|
28
|
+
firstName: z.string().optional().describe("Admin first name."),
|
|
29
|
+
lastName: z.string().optional().describe("Admin last name."),
|
|
30
|
+
phone: z.string().optional().describe("Admin phone number."),
|
|
31
|
+
roles: z.array(z.union([z.string(), z.number()])).optional().describe("Role IDs to assign. Use ol_role_list to find valid role IDs."),
|
|
32
|
+
isActive: z.boolean().optional().describe("Whether account is active."),
|
|
33
|
+
external: z.boolean().optional().describe("Whether admin is external."),
|
|
34
|
+
notificationsEnabled: z.boolean().optional().describe("Whether notifications are enabled."),
|
|
35
|
+
password: z.string().optional().describe("New password (if changing)."),
|
|
36
|
+
};
|
|
37
|
+
export const AdminChangePasswordInputSchema = {
|
|
38
|
+
currentPassword: z.string().describe("Current password."),
|
|
39
|
+
newPassword: z.string().describe("New password."),
|
|
40
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TierAnalytics, MemberAnalytics, PointsAnalytics, TransactionAnalytics, ReferralAnalytics, CampaignAnalytics, DashboardOverview, UnitsOverview } from "../../types/schemas/analytics.js";
|
|
2
|
+
export declare function analyticsTiers(input: {
|
|
3
|
+
storeCode?: string;
|
|
4
|
+
}): Promise<TierAnalytics>;
|
|
5
|
+
export declare function analyticsMembers(input: {
|
|
6
|
+
storeCode?: string;
|
|
7
|
+
withTransaction?: boolean;
|
|
8
|
+
}): Promise<MemberAnalytics>;
|
|
9
|
+
export declare function analyticsPoints(input: {
|
|
10
|
+
storeCode?: string;
|
|
11
|
+
}): Promise<PointsAnalytics>;
|
|
12
|
+
export declare function analyticsTransactions(input: {
|
|
13
|
+
storeCode?: string;
|
|
14
|
+
}): Promise<TransactionAnalytics>;
|
|
15
|
+
export declare function analyticsReferrals(input: {
|
|
16
|
+
storeCode?: string;
|
|
17
|
+
}): Promise<ReferralAnalytics>;
|
|
18
|
+
export declare function analyticsCampaigns(input: {
|
|
19
|
+
storeCode?: string;
|
|
20
|
+
page?: number;
|
|
21
|
+
perPage?: number;
|
|
22
|
+
executedAt?: string;
|
|
23
|
+
}): Promise<CampaignAnalytics>;
|
|
24
|
+
export declare function analyticsDashboard(input: {
|
|
25
|
+
storeCode?: string;
|
|
26
|
+
dataType?: string;
|
|
27
|
+
aggregationType?: string;
|
|
28
|
+
intervalStartDate?: string;
|
|
29
|
+
intervalEndDate?: string;
|
|
30
|
+
}): Promise<DashboardOverview>;
|
|
31
|
+
export declare function analyticsUnits(input: {
|
|
32
|
+
storeCode?: string;
|
|
33
|
+
walletTypeCode: string;
|
|
34
|
+
dataType?: string;
|
|
35
|
+
aggregationType?: string;
|
|
36
|
+
intervalStartDate?: string;
|
|
37
|
+
intervalEndDate?: string;
|
|
38
|
+
}): Promise<UnitsOverview>;
|
|
39
|
+
export declare function analyticsCampaignDetail(input: {
|
|
40
|
+
storeCode?: string;
|
|
41
|
+
campaignId: string;
|
|
42
|
+
}): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { apiGet } from "../../client/http.js";
|
|
2
|
+
import { formatApiError, OpenLoyaltyError } from "../../utils/errors.js";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import { getStoreCode } from "../../config.js";
|
|
5
|
+
export async function analyticsTiers(input) {
|
|
6
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
7
|
+
try {
|
|
8
|
+
const response = await apiGet(`/${storeCode}/analytics/levels`);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
13
|
+
throw new OpenLoyaltyError({
|
|
14
|
+
code: "STORE_NOT_FOUND",
|
|
15
|
+
message: "No tier analytics available. The store may not exist or has no tier data.",
|
|
16
|
+
hint: "Use ol_store_list() to verify the store code is correct. If the store is new, tier data may take a few minutes to populate.",
|
|
17
|
+
relatedTool: "ol_analytics_tiers",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
21
|
+
throw new OpenLoyaltyError({
|
|
22
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
23
|
+
message: "You don't have permission to view tier analytics",
|
|
24
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access, or contact a super admin.",
|
|
25
|
+
relatedTool: "ol_analytics_tiers",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
throw formatApiError(error, "ol_analytics_tiers");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export async function analyticsMembers(input) {
|
|
32
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
33
|
+
const params = new URLSearchParams();
|
|
34
|
+
if (input.withTransaction !== undefined) {
|
|
35
|
+
params.append("withTransaction", String(input.withTransaction));
|
|
36
|
+
}
|
|
37
|
+
const queryString = params.toString();
|
|
38
|
+
const url = `/${storeCode}/analytics/members${queryString ? `?${queryString}` : ""}`;
|
|
39
|
+
try {
|
|
40
|
+
const response = await apiGet(url);
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
45
|
+
throw new OpenLoyaltyError({
|
|
46
|
+
code: "STORE_NOT_FOUND",
|
|
47
|
+
message: "No member analytics available for this store",
|
|
48
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
49
|
+
relatedTool: "ol_analytics_members",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
53
|
+
throw new OpenLoyaltyError({
|
|
54
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
55
|
+
message: "You don't have permission to view member analytics",
|
|
56
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
57
|
+
relatedTool: "ol_analytics_members",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
throw formatApiError(error, "ol_analytics_members");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export async function analyticsPoints(input) {
|
|
64
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
65
|
+
try {
|
|
66
|
+
const response = await apiGet(`/${storeCode}/analytics/points`);
|
|
67
|
+
return response;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
71
|
+
throw new OpenLoyaltyError({
|
|
72
|
+
code: "STORE_NOT_FOUND",
|
|
73
|
+
message: "No points analytics available for this store",
|
|
74
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
75
|
+
relatedTool: "ol_analytics_points",
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
79
|
+
throw new OpenLoyaltyError({
|
|
80
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
81
|
+
message: "You don't have permission to view points analytics",
|
|
82
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
83
|
+
relatedTool: "ol_analytics_points",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
throw formatApiError(error, "ol_analytics_points");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export async function analyticsTransactions(input) {
|
|
90
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
91
|
+
try {
|
|
92
|
+
const response = await apiGet(`/${storeCode}/analytics/transactions`);
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
97
|
+
throw new OpenLoyaltyError({
|
|
98
|
+
code: "STORE_NOT_FOUND",
|
|
99
|
+
message: "No transaction analytics available for this store",
|
|
100
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
101
|
+
relatedTool: "ol_analytics_transactions",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
105
|
+
throw new OpenLoyaltyError({
|
|
106
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
107
|
+
message: "You don't have permission to view transaction analytics",
|
|
108
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
109
|
+
relatedTool: "ol_analytics_transactions",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
throw formatApiError(error, "ol_analytics_transactions");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export async function analyticsReferrals(input) {
|
|
116
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
117
|
+
try {
|
|
118
|
+
const response = await apiGet(`/${storeCode}/analytics/referrals`);
|
|
119
|
+
return response;
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
123
|
+
throw new OpenLoyaltyError({
|
|
124
|
+
code: "STORE_NOT_FOUND",
|
|
125
|
+
message: "No referral analytics available for this store",
|
|
126
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
127
|
+
relatedTool: "ol_analytics_referrals",
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
131
|
+
throw new OpenLoyaltyError({
|
|
132
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
133
|
+
message: "You don't have permission to view referral analytics",
|
|
134
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
135
|
+
relatedTool: "ol_analytics_referrals",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
throw formatApiError(error, "ol_analytics_referrals");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export async function analyticsCampaigns(input) {
|
|
142
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
143
|
+
const params = new URLSearchParams();
|
|
144
|
+
if (input.page)
|
|
145
|
+
params.append("_page", String(input.page));
|
|
146
|
+
if (input.perPage)
|
|
147
|
+
params.append("_itemsOnPage", String(input.perPage));
|
|
148
|
+
if (input.executedAt)
|
|
149
|
+
params.append("executedAt", input.executedAt);
|
|
150
|
+
const queryString = params.toString();
|
|
151
|
+
const url = `/${storeCode}/analytics/campaigns${queryString ? `?${queryString}` : ""}`;
|
|
152
|
+
try {
|
|
153
|
+
const response = await apiGet(url);
|
|
154
|
+
return response;
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
158
|
+
throw new OpenLoyaltyError({
|
|
159
|
+
code: "STORE_NOT_FOUND",
|
|
160
|
+
message: "No campaign analytics available for this store",
|
|
161
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
162
|
+
relatedTool: "ol_analytics_campaigns",
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (axios.isAxiosError(error) && error.response?.status === 400) {
|
|
166
|
+
const allMessages = [error.response?.data?.message || "", ...(error.response?.data?.errors || []).map((e) => e.message)].join(" ").toLowerCase();
|
|
167
|
+
if (allMessages.includes("date") || allMessages.includes("format") || allMessages.includes("executedat")) {
|
|
168
|
+
throw new OpenLoyaltyError({
|
|
169
|
+
code: "INVALID_DATE_FORMAT",
|
|
170
|
+
message: "Invalid executedAt date format",
|
|
171
|
+
hint: "Use ISO 8601 format: 'YYYY-MM-DDTHH:mm:ss+00:00' (e.g., '2026-01-01T00:00:00+00:00').",
|
|
172
|
+
relatedTool: "ol_analytics_campaigns",
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
177
|
+
throw new OpenLoyaltyError({
|
|
178
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
179
|
+
message: "You don't have permission to view campaign analytics",
|
|
180
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
181
|
+
relatedTool: "ol_analytics_campaigns",
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
throw formatApiError(error, "ol_analytics_campaigns");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export async function analyticsDashboard(input) {
|
|
188
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
189
|
+
const params = new URLSearchParams();
|
|
190
|
+
if (input.dataType)
|
|
191
|
+
params.append("dataType", input.dataType);
|
|
192
|
+
if (input.aggregationType)
|
|
193
|
+
params.append("aggregationType", input.aggregationType);
|
|
194
|
+
if (input.intervalStartDate)
|
|
195
|
+
params.append("intervalStartDate", input.intervalStartDate);
|
|
196
|
+
if (input.intervalEndDate)
|
|
197
|
+
params.append("intervalEndDate", input.intervalEndDate);
|
|
198
|
+
const queryString = params.toString();
|
|
199
|
+
const url = `/${storeCode}/analytics/dashboard/general-overview${queryString ? `?${queryString}` : ""}`;
|
|
200
|
+
try {
|
|
201
|
+
const response = await apiGet(url);
|
|
202
|
+
return response;
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
206
|
+
throw new OpenLoyaltyError({
|
|
207
|
+
code: "STORE_NOT_FOUND",
|
|
208
|
+
message: "No dashboard data available for this store",
|
|
209
|
+
hint: "Use ol_store_list() to verify the store code is correct.",
|
|
210
|
+
relatedTool: "ol_analytics_dashboard",
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (axios.isAxiosError(error) && error.response?.status === 400) {
|
|
214
|
+
const allMessages = [error.response?.data?.message || "", ...(error.response?.data?.errors || []).map((e) => e.message)].join(" ").toLowerCase();
|
|
215
|
+
if (allMessages.includes("date") || allMessages.includes("interval")) {
|
|
216
|
+
throw new OpenLoyaltyError({
|
|
217
|
+
code: "INVALID_DATE_RANGE",
|
|
218
|
+
message: "Invalid date range or format for dashboard analytics",
|
|
219
|
+
hint: "Use YYYY-MM-DD format for intervalStartDate and intervalEndDate (e.g., '2026-01-01'). Ensure start date is before end date. Valid aggregationType values: 'day', 'week', 'month'.",
|
|
220
|
+
relatedTool: "ol_analytics_dashboard",
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
if (allMessages.includes("datatype") || allMessages.includes("data type") || allMessages.includes("choice")) {
|
|
224
|
+
throw new OpenLoyaltyError({
|
|
225
|
+
code: "INVALID_DATA_TYPE",
|
|
226
|
+
message: "Invalid dataType value for dashboard analytics",
|
|
227
|
+
hint: "Valid dataType values: registeredMembers, activeMembers, revenue, avgSpending, transactions, avgTransactionValue, avgNumberOfTransactions.",
|
|
228
|
+
relatedTool: "ol_analytics_dashboard",
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (axios.isAxiosError(error) && error.response?.status === 403) {
|
|
233
|
+
throw new OpenLoyaltyError({
|
|
234
|
+
code: "ANALYTICS_PERMISSION_DENIED",
|
|
235
|
+
message: "You don't have permission to view dashboard analytics",
|
|
236
|
+
hint: "Analytics require the ANALYTICS:VIEW permission. Use ol_admin_get_permissions() to check your access.",
|
|
237
|
+
relatedTool: "ol_analytics_dashboard",
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
throw formatApiError(error, "ol_analytics_dashboard");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export async function analyticsUnits(input) {
|
|
244
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
245
|
+
const params = new URLSearchParams();
|
|
246
|
+
if (input.dataType)
|
|
247
|
+
params.append("dataType", input.dataType);
|
|
248
|
+
if (input.aggregationType)
|
|
249
|
+
params.append("aggregationType", input.aggregationType);
|
|
250
|
+
if (input.intervalStartDate)
|
|
251
|
+
params.append("intervalStartDate", input.intervalStartDate);
|
|
252
|
+
if (input.intervalEndDate)
|
|
253
|
+
params.append("intervalEndDate", input.intervalEndDate);
|
|
254
|
+
const queryString = params.toString();
|
|
255
|
+
const url = `/${storeCode}/analytics/units-overview/${input.walletTypeCode}${queryString ? `?${queryString}` : ""}`;
|
|
256
|
+
try {
|
|
257
|
+
const response = await apiGet(url);
|
|
258
|
+
return response;
|
|
259
|
+
}
|
|
260
|
+
catch (error) {
|
|
261
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
262
|
+
throw new OpenLoyaltyError({ code: "NOT_FOUND", message: `Wallet type code '${input.walletTypeCode}' not found`,
|
|
263
|
+
hint: "Use ol_wallet_type_list() to find valid wallet type codes (e.g., 'default').", relatedTool: "ol_analytics_units" });
|
|
264
|
+
}
|
|
265
|
+
throw formatApiError(error, "ol_analytics_units");
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
export async function analyticsCampaignDetail(input) {
|
|
269
|
+
const storeCode = getStoreCode(input.storeCode);
|
|
270
|
+
try {
|
|
271
|
+
// API endpoint uses /campaigns (plural) with campaign ID as query param
|
|
272
|
+
const response = await apiGet(`/${storeCode}/analytics/campaigns?campaignId=${input.campaignId}`);
|
|
273
|
+
return response;
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
277
|
+
throw new OpenLoyaltyError({ code: "NOT_FOUND", message: `Campaign '${input.campaignId}' not found`,
|
|
278
|
+
hint: "Use ol_campaign_list() to find valid campaign IDs.", relatedTool: "ol_analytics_campaign_detail" });
|
|
279
|
+
}
|
|
280
|
+
throw formatApiError(error, "ol_analytics_campaign_detail");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export { AnalyticsTiersInputSchema, AnalyticsMembersInputSchema, AnalyticsPointsInputSchema, AnalyticsTransactionsInputSchema, AnalyticsReferralsInputSchema, AnalyticsCampaignsInputSchema, AnalyticsDashboardInputSchema, AnalyticsUnitsInputSchema, AnalyticsCampaignDetailInputSchema, } from "./schemas.js";
|
|
2
|
+
export { analyticsTiers, analyticsMembers, analyticsPoints, analyticsTransactions, analyticsReferrals, analyticsCampaigns, analyticsDashboard, analyticsUnits, analyticsCampaignDetail, } from "./handlers.js";
|
|
3
|
+
import { analyticsTiers, analyticsMembers, analyticsPoints, analyticsTransactions, analyticsReferrals, analyticsCampaigns, analyticsDashboard, analyticsUnits, analyticsCampaignDetail } from "./handlers.js";
|
|
4
|
+
export declare const analyticsToolDefinitions: readonly [{
|
|
5
|
+
readonly name: "ol_analytics_tiers";
|
|
6
|
+
readonly title: "Get Tier Analytics";
|
|
7
|
+
readonly description: "Get tier (level) analytics showing member distribution across tiers. Returns tier IDs, names, and member counts for each tier level.";
|
|
8
|
+
readonly readOnly: true;
|
|
9
|
+
readonly idempotent: true;
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
|
+
};
|
|
13
|
+
readonly handler: typeof analyticsTiers;
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "ol_analytics_members";
|
|
16
|
+
readonly title: "Get Member Analytics";
|
|
17
|
+
readonly 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.";
|
|
18
|
+
readonly readOnly: true;
|
|
19
|
+
readonly idempotent: true;
|
|
20
|
+
readonly inputSchema: {
|
|
21
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
withTransaction: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
23
|
+
};
|
|
24
|
+
readonly handler: typeof analyticsMembers;
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "ol_analytics_points";
|
|
27
|
+
readonly title: "Get Points Analytics";
|
|
28
|
+
readonly 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.";
|
|
29
|
+
readonly readOnly: true;
|
|
30
|
+
readonly idempotent: true;
|
|
31
|
+
readonly inputSchema: {
|
|
32
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
|
+
};
|
|
34
|
+
readonly handler: typeof analyticsPoints;
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "ol_analytics_transactions";
|
|
37
|
+
readonly title: "Get Transaction Analytics";
|
|
38
|
+
readonly description: "Get transaction analytics showing purchase trends. Returns transaction counts by intervals, total count, total amount, and average values. Use to monitor sales performance.";
|
|
39
|
+
readonly readOnly: true;
|
|
40
|
+
readonly idempotent: true;
|
|
41
|
+
readonly inputSchema: {
|
|
42
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
43
|
+
};
|
|
44
|
+
readonly handler: typeof analyticsTransactions;
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "ol_analytics_referrals";
|
|
47
|
+
readonly title: "Get Referral Analytics";
|
|
48
|
+
readonly description: "Get referral program analytics showing referral activity. Returns total referral count. Use to monitor referral program performance.";
|
|
49
|
+
readonly readOnly: true;
|
|
50
|
+
readonly idempotent: true;
|
|
51
|
+
readonly inputSchema: {
|
|
52
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
|
+
};
|
|
54
|
+
readonly handler: typeof analyticsReferrals;
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "ol_analytics_campaigns";
|
|
57
|
+
readonly title: "Get Campaign Analytics";
|
|
58
|
+
readonly 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 readOnly: true;
|
|
60
|
+
readonly idempotent: true;
|
|
61
|
+
readonly inputSchema: {
|
|
62
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
|
+
page: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
64
|
+
perPage: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
65
|
+
executedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
66
|
+
};
|
|
67
|
+
readonly handler: typeof analyticsCampaigns;
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "ol_analytics_dashboard";
|
|
70
|
+
readonly title: "Get Dashboard Overview";
|
|
71
|
+
readonly 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.";
|
|
72
|
+
readonly readOnly: true;
|
|
73
|
+
readonly idempotent: true;
|
|
74
|
+
readonly inputSchema: {
|
|
75
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
|
+
dataType: import("zod").ZodEnum<["registeredMembers", "activeMembers", "revenue", "avgSpending", "transactions", "avgTransactionValue", "avgNumberOfTransactions"]>;
|
|
77
|
+
aggregationType: import("zod").ZodOptional<import("zod").ZodEnum<["day", "week", "month"]>>;
|
|
78
|
+
intervalStartDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
intervalEndDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
};
|
|
81
|
+
readonly handler: typeof analyticsDashboard;
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "ol_analytics_units";
|
|
84
|
+
readonly title: "Get Units Overview";
|
|
85
|
+
readonly 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.";
|
|
86
|
+
readonly readOnly: true;
|
|
87
|
+
readonly idempotent: true;
|
|
88
|
+
readonly inputSchema: {
|
|
89
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
90
|
+
walletTypeCode: import("zod").ZodString;
|
|
91
|
+
dataType: import("zod").ZodOptional<import("zod").ZodEnum<["unitsIssued", "unitsSpent", "unitsExpired", "unitsPending", "unitsActive"]>>;
|
|
92
|
+
aggregationType: import("zod").ZodOptional<import("zod").ZodEnum<["day", "week", "month"]>>;
|
|
93
|
+
intervalStartDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
94
|
+
intervalEndDate: import("zod").ZodOptional<import("zod").ZodString>;
|
|
95
|
+
};
|
|
96
|
+
readonly handler: typeof analyticsUnits;
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "ol_analytics_campaign_detail";
|
|
99
|
+
readonly title: "Get Campaign Detail Analytics";
|
|
100
|
+
readonly description: "Get detailed analytics for a specific campaign. Returns campaign-specific performance metrics. Use after analytics_campaigns to drill into individual campaign performance.";
|
|
101
|
+
readonly readOnly: true;
|
|
102
|
+
readonly idempotent: true;
|
|
103
|
+
readonly inputSchema: {
|
|
104
|
+
storeCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
105
|
+
campaignId: import("zod").ZodString;
|
|
106
|
+
};
|
|
107
|
+
readonly handler: typeof analyticsCampaignDetail;
|
|
108
|
+
}];
|