@open-loyalty/mcp-server 1.3.7 → 1.5.3
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 -3
- package/dist/config.js +9 -7
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +26 -8
- package/dist/tools/achievement/handlers.js +60 -1
- package/dist/tools/achievement/index.d.ts +8 -8
- package/dist/tools/achievement/index.js +10 -11
- package/dist/tools/achievement/schemas.d.ts +8 -8
- package/dist/tools/achievement/schemas.js +36 -32
- package/dist/tools/analytics.js +9 -9
- package/dist/tools/badge.js +4 -4
- package/dist/tools/campaign/handlers.js +35 -1
- package/dist/tools/campaign/index.d.ts +97 -34
- package/dist/tools/campaign/index.js +14 -12
- package/dist/tools/campaign/schemas.d.ts +96 -33
- package/dist/tools/campaign/schemas.js +89 -55
- package/dist/tools/custom-event.js +10 -9
- package/dist/tools/export.js +4 -4
- package/dist/tools/import.d.ts +1 -1
- package/dist/tools/import.js +11 -6
- package/dist/tools/index.js +4 -4
- package/dist/tools/member/handlers.js +48 -1
- package/dist/tools/member/index.d.ts +1 -1
- package/dist/tools/member/index.js +3 -1
- package/dist/tools/member/schemas.js +12 -12
- package/dist/tools/points/handlers.d.ts +75 -0
- package/dist/tools/{points.js → points/handlers.js} +21 -112
- package/dist/tools/points/index.d.ts +84 -0
- package/dist/tools/points/index.js +63 -0
- package/dist/tools/points/schemas.d.ts +45 -0
- package/dist/tools/points/schemas.js +47 -0
- package/dist/tools/referral/schemas.js +3 -3
- package/dist/tools/reward/handlers.d.ts +2 -0
- package/dist/tools/reward/handlers.js +79 -6
- package/dist/tools/reward/index.d.ts +2 -0
- package/dist/tools/reward/index.js +10 -10
- package/dist/tools/reward/schemas.d.ts +2 -0
- package/dist/tools/reward/schemas.js +42 -23
- package/dist/tools/segment/index.js +7 -5
- package/dist/tools/segment/schemas.js +11 -11
- package/dist/tools/tierset/handlers.d.ts +26 -0
- package/dist/tools/tierset/handlers.js +196 -0
- package/dist/tools/tierset/index.d.ts +124 -0
- package/dist/tools/tierset/index.js +88 -0
- package/dist/tools/tierset/schemas.d.ts +127 -0
- package/dist/tools/tierset/schemas.js +62 -0
- package/dist/tools/transaction/handlers.d.ts +89 -0
- package/dist/tools/transaction/handlers.js +159 -0
- package/dist/tools/transaction/index.d.ts +153 -0
- package/dist/tools/transaction/index.js +54 -0
- package/dist/tools/transaction/schemas.d.ts +126 -0
- package/dist/tools/transaction/schemas.js +60 -0
- package/dist/tools/wallet-type/handlers.d.ts +63 -0
- package/dist/tools/{wallet-type.js → wallet-type/handlers.js} +15 -78
- package/dist/tools/{wallet-type.d.ts → wallet-type/index.d.ts} +3 -64
- package/dist/tools/wallet-type/index.js +65 -0
- package/dist/tools/wallet-type/schemas.d.ts +1 -0
- package/dist/tools/wallet-type/schemas.js +1 -0
- package/dist/tools/webhook.js +6 -6
- package/dist/types/schemas/achievement.d.ts +48 -48
- package/dist/types/schemas/admin.d.ts +10 -10
- package/dist/types/schemas/campaign.d.ts +12 -12
- package/dist/types/schemas/common.js +1 -1
- package/dist/types/schemas/member.d.ts +18 -18
- package/dist/types/schemas/role.d.ts +4 -4
- package/dist/types/schemas/tierset.js +2 -1
- package/dist/types/schemas/transaction.d.ts +12 -12
- package/dist/types/schemas/wallet-type.js +12 -10
- package/dist/types/schemas/webhook.d.ts +6 -6
- package/dist/utils/errors.js +40 -0
- package/package.json +3 -2
- package/dist/prompts/fan-engagement-setup.d.ts +0 -107
- package/dist/prompts/fan-engagement-setup.js +0 -492
- package/dist/tools/achievement.d.ts +0 -1017
- package/dist/tools/achievement.js +0 -354
- package/dist/tools/campaign.d.ts +0 -1800
- package/dist/tools/campaign.js +0 -737
- package/dist/tools/member.d.ts +0 -366
- package/dist/tools/member.js +0 -352
- package/dist/tools/points.d.ts +0 -201
- package/dist/tools/reward.d.ts +0 -279
- package/dist/tools/reward.js +0 -361
- package/dist/tools/segment.d.ts +0 -816
- package/dist/tools/segment.js +0 -333
- package/dist/tools/tierset.d.ts +0 -273
- package/dist/tools/tierset.js +0 -289
- package/dist/tools/transaction.d.ts +0 -365
- package/dist/tools/transaction.js +0 -259
- package/dist/workflows/app-login-streak.d.ts +0 -39
- package/dist/workflows/app-login-streak.js +0 -298
- package/dist/workflows/early-arrival.d.ts +0 -33
- package/dist/workflows/early-arrival.js +0 -148
- package/dist/workflows/index.d.ts +0 -101
- package/dist/workflows/index.js +0 -208
- package/dist/workflows/match-attendance.d.ts +0 -45
- package/dist/workflows/match-attendance.js +0 -308
- package/dist/workflows/sportsbar-visit.d.ts +0 -41
- package/dist/workflows/sportsbar-visit.js +0 -284
- package/dist/workflows/vod-watching.d.ts +0 -43
- package/dist/workflows/vod-watching.js +0 -326
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { WalletType } from "../../types/schemas/wallet-type.js";
|
|
2
|
+
export declare function walletTypeList(input: {
|
|
3
|
+
storeCode?: string;
|
|
4
|
+
}): Promise<WalletType[]>;
|
|
5
|
+
export declare function walletTypeGet(input: {
|
|
6
|
+
storeCode?: string;
|
|
7
|
+
walletTypeId: string;
|
|
8
|
+
}): Promise<WalletType>;
|
|
9
|
+
export declare function walletTypeCreate(input: {
|
|
10
|
+
storeCode?: string;
|
|
11
|
+
translations: {
|
|
12
|
+
en: {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
unitSingularName: string;
|
|
18
|
+
unitPluralName: string;
|
|
19
|
+
unitDaysExpiryAfter: string;
|
|
20
|
+
code?: string;
|
|
21
|
+
allowNegativeBalance?: boolean;
|
|
22
|
+
unitExpiryDate?: string;
|
|
23
|
+
unitDaysActiveCount?: number;
|
|
24
|
+
unitYearsActiveCount?: number;
|
|
25
|
+
unitDaysLocked?: number;
|
|
26
|
+
allTimeNotLocked?: boolean;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
walletTypeId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
code?: string;
|
|
31
|
+
}>;
|
|
32
|
+
export declare function walletTypeUpdate(input: {
|
|
33
|
+
storeCode?: string;
|
|
34
|
+
walletTypeId: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
unitSingularName?: string;
|
|
38
|
+
unitPluralName?: string;
|
|
39
|
+
active?: boolean;
|
|
40
|
+
allowNegativeBalance?: boolean;
|
|
41
|
+
limits?: {
|
|
42
|
+
points?: {
|
|
43
|
+
interval?: {
|
|
44
|
+
type: string;
|
|
45
|
+
value: number;
|
|
46
|
+
};
|
|
47
|
+
value: number;
|
|
48
|
+
};
|
|
49
|
+
pointsPerMember?: {
|
|
50
|
+
interval?: {
|
|
51
|
+
type: string;
|
|
52
|
+
value: number;
|
|
53
|
+
};
|
|
54
|
+
value: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
unitExpiryDate?: string;
|
|
58
|
+
unitDaysExpiryAfter?: string;
|
|
59
|
+
unitDaysActiveCount?: number;
|
|
60
|
+
unitYearsActiveCount?: number;
|
|
61
|
+
unitDaysLocked?: number;
|
|
62
|
+
allTimeNotLocked?: boolean;
|
|
63
|
+
}): Promise<void>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
-
import { apiGet, apiPost, apiPut } from "
|
|
3
|
-
import { WalletTypeSchema, WalletTypeListResponseSchema, WalletTypeCreateResponseSchema,
|
|
4
|
-
import { formatApiError, OpenLoyaltyError } from "
|
|
5
|
-
import { getStoreCode } from "
|
|
6
|
-
import { omitUndefined } from "
|
|
7
|
-
// Re-export input schemas for tool registration
|
|
8
|
-
export { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, };
|
|
2
|
+
import { apiGet, apiPost, apiPut } from "../../client/http.js";
|
|
3
|
+
import { WalletTypeSchema, WalletTypeListResponseSchema, WalletTypeCreateResponseSchema, } from "../../types/schemas/wallet-type.js";
|
|
4
|
+
import { formatApiError, OpenLoyaltyError } from "../../utils/errors.js";
|
|
5
|
+
import { getStoreCode } from "../../config.js";
|
|
6
|
+
import { omitUndefined } from "../../utils/payload.js";
|
|
9
7
|
// Helper to check if error is an axios error (more reliable than instanceof)
|
|
10
8
|
function isAxiosError(error) {
|
|
11
9
|
return axios.isAxiosError(error);
|
|
@@ -138,11 +136,18 @@ export async function walletTypeCreate(input) {
|
|
|
138
136
|
// Check for duplicate code error
|
|
139
137
|
const errorMsg = getErrorMessage(error);
|
|
140
138
|
if (errorMsg.toLowerCase().includes("code") && errorMsg.toLowerCase().includes("already")) {
|
|
139
|
+
const isDefaultCode = input.code === "default" || !input.code;
|
|
141
140
|
throw new OpenLoyaltyError({
|
|
142
141
|
code: "DUPLICATE_CODE",
|
|
143
|
-
message: `Wallet type with code '${input.code}' already exists`,
|
|
144
|
-
hint:
|
|
145
|
-
`
|
|
142
|
+
message: `Wallet type with code '${input.code || "default"}' already exists`,
|
|
143
|
+
hint: isDefaultCode
|
|
144
|
+
? `Every store comes with a 'Default wallet' (code: 'default') pre-installed. ` +
|
|
145
|
+
`You do NOT need to create it. Use ol_wallet_type_list() to find it, then ` +
|
|
146
|
+
`ol_wallet_type_update() to customize its name, units, or expiry settings. ` +
|
|
147
|
+
`Only create a new wallet if you need a SECOND point currency with a different code.`
|
|
148
|
+
: `A wallet type with code '${input.code}' already exists. ` +
|
|
149
|
+
`Use ol_wallet_type_list() to see all existing wallet types. ` +
|
|
150
|
+
`Either use a different code, or find the existing wallet and update it with ol_wallet_type_update().`,
|
|
146
151
|
relatedTool: "ol_wallet_type_create",
|
|
147
152
|
});
|
|
148
153
|
}
|
|
@@ -223,71 +228,3 @@ export async function walletTypeUpdate(input) {
|
|
|
223
228
|
throw formatApiError(error, "ol_wallet_type_update");
|
|
224
229
|
}
|
|
225
230
|
}
|
|
226
|
-
// =============================================================================
|
|
227
|
-
// TOOL DEFINITIONS
|
|
228
|
-
// =============================================================================
|
|
229
|
-
export const walletTypeToolDefinitions = [
|
|
230
|
-
{
|
|
231
|
-
name: "ol_wallet_type_list",
|
|
232
|
-
title: "List Point Currencies",
|
|
233
|
-
description: "List all available wallet types (point currencies). " +
|
|
234
|
-
"Use this to find wallet type codes and IDs for other operations. " +
|
|
235
|
-
"Returns walletTypeId (UUID), code (unique identifier like 'default'), and name for each wallet type. " +
|
|
236
|
-
"💡 TIP: Most stores have a 'default' wallet type for main loyalty points.",
|
|
237
|
-
readOnly: true,
|
|
238
|
-
inputSchema: WalletTypeListInputSchema,
|
|
239
|
-
handler: walletTypeList,
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
name: "ol_wallet_type_get",
|
|
243
|
-
title: "Get Point Currency Details",
|
|
244
|
-
description: "Get full details for a specific wallet type by ID. " +
|
|
245
|
-
"Returns configuration including limits, expiry settings, and translations. " +
|
|
246
|
-
"💡 TIP: Use ol_wallet_type_list() first to find the walletTypeId.",
|
|
247
|
-
readOnly: true,
|
|
248
|
-
inputSchema: WalletTypeGetInputSchema,
|
|
249
|
-
handler: walletTypeGet,
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
name: "ol_wallet_type_create",
|
|
253
|
-
title: "Create Point Currency",
|
|
254
|
-
description: "Create a new wallet type (point currency) for the loyalty program. " +
|
|
255
|
-
"⚠️ REQUIRED FIELDS (will fail without these): " +
|
|
256
|
-
"1. translations: { en: { name: 'Currency Name' } } - Name is REQUIRED. " +
|
|
257
|
-
"2. unitSingularName: 'point' (or 'coin', 'star', etc.) - The singular form. " +
|
|
258
|
-
"3. unitPluralName: 'points' (or 'coins', 'stars', etc.) - The plural form. " +
|
|
259
|
-
"4. unitDaysExpiryAfter: 'all_time_active' or number string like '365'. " +
|
|
260
|
-
"📝 OPTIONAL: " +
|
|
261
|
-
"• code: Unique identifier (auto-generated if omitted, cannot change later). " +
|
|
262
|
-
"• allowNegativeBalance: true/false (default: false). " +
|
|
263
|
-
"• unitExpiryDate: Annual expiry in 'MM-DD' format (e.g., '12-31'). " +
|
|
264
|
-
"• allTimeNotLocked: TRUE = 'No pending' (points immediately available). " +
|
|
265
|
-
"• unitDaysLocked: Only if allTimeNotLocked=false, set days for pending period. " +
|
|
266
|
-
"⚠️ NOT SUPPORTED AT CREATION: 'active' and 'limits' - use ol_wallet_type_update after creation. " +
|
|
267
|
-
"⏰ NOTE: New wallets are 'blocked' for ~2 minutes after creation - wait before updating. " +
|
|
268
|
-
"💡 EXAMPLE: { translations: { en: { name: 'Bonus Points' } }, unitSingularName: 'point', " +
|
|
269
|
-
"unitPluralName: 'points', unitDaysExpiryAfter: 'all_time_active', code: 'bonus' }",
|
|
270
|
-
readOnly: false,
|
|
271
|
-
inputSchema: WalletTypeCreateInputSchema,
|
|
272
|
-
handler: walletTypeCreate,
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: "ol_wallet_type_update",
|
|
276
|
-
title: "Update Point Currency",
|
|
277
|
-
description: "Update an existing wallet type's configuration. " +
|
|
278
|
-
"⚠️ IMPORTANT: Only provide fields you want to change - others are preserved. " +
|
|
279
|
-
"⚠️ CANNOT CHANGE: The 'code' field cannot be modified after creation. " +
|
|
280
|
-
"📝 UPDATABLE FIELDS: " +
|
|
281
|
-
"• name/description: Update via the tool parameters (updates translations.en internally). " +
|
|
282
|
-
"• unitSingularName/unitPluralName: Update the display names. " +
|
|
283
|
-
"• active: Enable/disable the wallet type. " +
|
|
284
|
-
"• allowNegativeBalance: Allow/disallow negative balances. " +
|
|
285
|
-
"• limits: Update earning limits (same format as create). " +
|
|
286
|
-
"• Expiry settings: unitExpiryDate, unitDaysExpiryAfter, etc. " +
|
|
287
|
-
"• ⭐ PENDING: allTimeNotLocked=true for 'No pending', or =false with unitDaysLocked for pending period. " +
|
|
288
|
-
"💡 TIP: Use ol_wallet_type_get(walletTypeId) first to see current configuration.",
|
|
289
|
-
readOnly: false,
|
|
290
|
-
inputSchema: WalletTypeUpdateInputSchema,
|
|
291
|
-
handler: walletTypeUpdate,
|
|
292
|
-
},
|
|
293
|
-
];
|
|
@@ -1,67 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
storeCode?: string;
|
|
5
|
-
}): Promise<WalletType[]>;
|
|
6
|
-
export declare function walletTypeGet(input: {
|
|
7
|
-
storeCode?: string;
|
|
8
|
-
walletTypeId: string;
|
|
9
|
-
}): Promise<WalletType>;
|
|
10
|
-
export declare function walletTypeCreate(input: {
|
|
11
|
-
storeCode?: string;
|
|
12
|
-
translations: {
|
|
13
|
-
en: {
|
|
14
|
-
name: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
unitSingularName: string;
|
|
19
|
-
unitPluralName: string;
|
|
20
|
-
unitDaysExpiryAfter: string;
|
|
21
|
-
code?: string;
|
|
22
|
-
allowNegativeBalance?: boolean;
|
|
23
|
-
unitExpiryDate?: string;
|
|
24
|
-
unitDaysActiveCount?: number;
|
|
25
|
-
unitYearsActiveCount?: number;
|
|
26
|
-
unitDaysLocked?: number;
|
|
27
|
-
allTimeNotLocked?: boolean;
|
|
28
|
-
}): Promise<{
|
|
29
|
-
walletTypeId: string;
|
|
30
|
-
name: string;
|
|
31
|
-
code?: string;
|
|
32
|
-
}>;
|
|
33
|
-
export declare function walletTypeUpdate(input: {
|
|
34
|
-
storeCode?: string;
|
|
35
|
-
walletTypeId: string;
|
|
36
|
-
name?: string;
|
|
37
|
-
description?: string;
|
|
38
|
-
unitSingularName?: string;
|
|
39
|
-
unitPluralName?: string;
|
|
40
|
-
active?: boolean;
|
|
41
|
-
allowNegativeBalance?: boolean;
|
|
42
|
-
limits?: {
|
|
43
|
-
points?: {
|
|
44
|
-
interval?: {
|
|
45
|
-
type: string;
|
|
46
|
-
value: number;
|
|
47
|
-
};
|
|
48
|
-
value: number;
|
|
49
|
-
};
|
|
50
|
-
pointsPerMember?: {
|
|
51
|
-
interval?: {
|
|
52
|
-
type: string;
|
|
53
|
-
value: number;
|
|
54
|
-
};
|
|
55
|
-
value: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
unitExpiryDate?: string;
|
|
59
|
-
unitDaysExpiryAfter?: string;
|
|
60
|
-
unitDaysActiveCount?: number;
|
|
61
|
-
unitYearsActiveCount?: number;
|
|
62
|
-
unitDaysLocked?: number;
|
|
63
|
-
allTimeNotLocked?: boolean;
|
|
64
|
-
}): Promise<void>;
|
|
1
|
+
export { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, } from "./schemas.js";
|
|
2
|
+
export { walletTypeList, walletTypeGet, walletTypeCreate, walletTypeUpdate, } from "./handlers.js";
|
|
3
|
+
import { walletTypeList, walletTypeGet, walletTypeCreate, walletTypeUpdate } from "./handlers.js";
|
|
65
4
|
export declare const walletTypeToolDefinitions: readonly [{
|
|
66
5
|
readonly name: "ol_wallet_type_list";
|
|
67
6
|
readonly title: "List Point Currencies";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Re-export schemas
|
|
2
|
+
export { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, } from "./schemas.js";
|
|
3
|
+
// Re-export handlers
|
|
4
|
+
export { walletTypeList, walletTypeGet, walletTypeCreate, walletTypeUpdate, } from "./handlers.js";
|
|
5
|
+
// Imports for tool definitions
|
|
6
|
+
import { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, } from "./schemas.js";
|
|
7
|
+
import { walletTypeList, walletTypeGet, walletTypeCreate, walletTypeUpdate, } from "./handlers.js";
|
|
8
|
+
// Tool definitions
|
|
9
|
+
export const walletTypeToolDefinitions = [
|
|
10
|
+
{
|
|
11
|
+
name: "ol_wallet_type_list",
|
|
12
|
+
title: "List Point Currencies",
|
|
13
|
+
description: "List all available wallet types (point currencies). " +
|
|
14
|
+
"ALWAYS call this BEFORE creating a new wallet type - every store already has a 'Default wallet' " +
|
|
15
|
+
"(code: 'default', units: points) pre-installed. " +
|
|
16
|
+
"Returns walletTypeId (UUID), code (unique identifier like 'default'), and name for each wallet type.",
|
|
17
|
+
readOnly: true,
|
|
18
|
+
inputSchema: WalletTypeListInputSchema,
|
|
19
|
+
handler: walletTypeList,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "ol_wallet_type_get",
|
|
23
|
+
title: "Get Point Currency Details",
|
|
24
|
+
description: "Get full details for a specific wallet type by ID. " +
|
|
25
|
+
"Returns configuration including limits, expiry settings, and translations. " +
|
|
26
|
+
"💡 TIP: Use ol_wallet_type_list() first to find the walletTypeId.",
|
|
27
|
+
readOnly: true,
|
|
28
|
+
inputSchema: WalletTypeGetInputSchema,
|
|
29
|
+
handler: walletTypeGet,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "ol_wallet_type_create",
|
|
33
|
+
title: "Create Point Currency",
|
|
34
|
+
description: "Create a new point currency (wallet type). Check ol_wallet_type_list() first -- every store already has a 'Default wallet'. " +
|
|
35
|
+
"KEY DECISIONS (confirm with user if not specified): " +
|
|
36
|
+
"1. Point expiration -- 'all_time_active' (never expire, growing financial liability) vs '365' (standard 1-year) vs annual date? " +
|
|
37
|
+
"2. Pending period -- allTimeNotLocked=true (immediate, no fraud protection) vs false + unitDaysLocked (fraud/return protection)? " +
|
|
38
|
+
"3. Negative balance -- allow members to go below zero? (credit risk, default: no) " +
|
|
39
|
+
"REQUIRED: translations.en.name, unitSingularName, unitPluralName, unitDaysExpiryAfter. " +
|
|
40
|
+
"NOTE: 'active' and 'limits' not supported at creation -- use ol_wallet_type_update. " +
|
|
41
|
+
"New wallets are blocked for ~2 minutes after creation.",
|
|
42
|
+
readOnly: false,
|
|
43
|
+
inputSchema: WalletTypeCreateInputSchema,
|
|
44
|
+
handler: walletTypeCreate,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "ol_wallet_type_update",
|
|
48
|
+
title: "Update Point Currency",
|
|
49
|
+
description: "Update an existing wallet type's configuration. " +
|
|
50
|
+
"⚠️ IMPORTANT: Only provide fields you want to change - others are preserved. " +
|
|
51
|
+
"⚠️ CANNOT CHANGE: The 'code' field cannot be modified after creation. " +
|
|
52
|
+
"📝 UPDATABLE FIELDS: " +
|
|
53
|
+
"• name/description: Update via the tool parameters (updates translations.en internally). " +
|
|
54
|
+
"• unitSingularName/unitPluralName: Update the display names. " +
|
|
55
|
+
"• active: Enable/disable the wallet type. " +
|
|
56
|
+
"• allowNegativeBalance: Allow/disallow negative balances. " +
|
|
57
|
+
"• limits: Update earning limits (same format as create). " +
|
|
58
|
+
"• Expiry settings: unitExpiryDate, unitDaysExpiryAfter, etc. " +
|
|
59
|
+
"• ⭐ PENDING: allTimeNotLocked=true for 'No pending', or =false with unitDaysLocked for pending period. " +
|
|
60
|
+
"💡 TIP: Use ol_wallet_type_get(walletTypeId) first to see current configuration.",
|
|
61
|
+
readOnly: false,
|
|
62
|
+
inputSchema: WalletTypeUpdateInputSchema,
|
|
63
|
+
handler: walletTypeUpdate,
|
|
64
|
+
},
|
|
65
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, } from "../../types/schemas/wallet-type.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletTypeListInputSchema, WalletTypeGetInputSchema, WalletTypeCreateInputSchema, WalletTypeUpdateInputSchema, } from "../../types/schemas/wallet-type.js";
|
package/dist/tools/webhook.js
CHANGED
|
@@ -99,14 +99,14 @@ const webhookUrlSchema = z.string()
|
|
|
99
99
|
.refine(isValidWebhookUrl, "URL must be an external HTTPS endpoint (no localhost, private IPs, or metadata endpoints)");
|
|
100
100
|
// Input Schemas
|
|
101
101
|
export const WebhookListInputSchema = {
|
|
102
|
-
storeCode: z.string().optional().describe("
|
|
102
|
+
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."),
|
|
103
103
|
page: z.number().optional().describe("Page number (default: 1)."),
|
|
104
104
|
perPage: z.number().optional().describe("Items per page (default: 25)."),
|
|
105
105
|
eventName: z.string().optional().describe("Filter by event name."),
|
|
106
106
|
url: z.string().optional().describe("Filter by URL."),
|
|
107
107
|
};
|
|
108
108
|
export const WebhookCreateInputSchema = {
|
|
109
|
-
storeCode: z.string().optional().describe("
|
|
109
|
+
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."),
|
|
110
110
|
eventName: z.string().describe("Event name to subscribe to. Use webhook_events to discover available events."),
|
|
111
111
|
url: webhookUrlSchema.describe("HTTPS URL to receive webhook events. Must be an external endpoint (no localhost or private IPs)."),
|
|
112
112
|
headers: z.array(z.object({
|
|
@@ -115,11 +115,11 @@ export const WebhookCreateInputSchema = {
|
|
|
115
115
|
})).optional().describe("Custom headers to include in webhook requests."),
|
|
116
116
|
};
|
|
117
117
|
export const WebhookGetInputSchema = {
|
|
118
|
-
storeCode: z.string().optional().describe("
|
|
118
|
+
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."),
|
|
119
119
|
webhookSubscriptionId: z.string().describe("The webhook subscription ID (UUID) to retrieve."),
|
|
120
120
|
};
|
|
121
121
|
export const WebhookUpdateInputSchema = {
|
|
122
|
-
storeCode: z.string().optional().describe("
|
|
122
|
+
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."),
|
|
123
123
|
webhookSubscriptionId: z.string().describe("The webhook subscription ID (UUID) to update."),
|
|
124
124
|
eventName: z.string().optional().describe("Event name to subscribe to."),
|
|
125
125
|
url: webhookUrlSchema.optional().describe("HTTPS URL to receive webhook events. Must be an external endpoint (no localhost or private IPs)."),
|
|
@@ -129,11 +129,11 @@ export const WebhookUpdateInputSchema = {
|
|
|
129
129
|
})).optional().describe("Custom headers to include in webhook requests."),
|
|
130
130
|
};
|
|
131
131
|
export const WebhookDeleteInputSchema = {
|
|
132
|
-
storeCode: z.string().optional().describe("
|
|
132
|
+
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."),
|
|
133
133
|
webhookSubscriptionId: z.string().describe("The webhook subscription ID (UUID) to delete."),
|
|
134
134
|
};
|
|
135
135
|
export const WebhookEventsInputSchema = {
|
|
136
|
-
storeCode: z.string().optional().describe("
|
|
136
|
+
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."),
|
|
137
137
|
};
|
|
138
138
|
// Handler functions
|
|
139
139
|
export async function webhookList(input) {
|
|
@@ -212,12 +212,6 @@ export declare const AchievementRuleSchema: z.ZodObject<{
|
|
|
212
212
|
description?: string | undefined;
|
|
213
213
|
}> | undefined;
|
|
214
214
|
conditions?: Record<string, unknown>[] | undefined;
|
|
215
|
-
trigger?: string | undefined;
|
|
216
|
-
event?: string | undefined;
|
|
217
|
-
achievementRuleId?: string | undefined;
|
|
218
|
-
aggregation?: {
|
|
219
|
-
rule?: string | undefined;
|
|
220
|
-
} | undefined;
|
|
221
215
|
limit?: {
|
|
222
216
|
value?: number | undefined;
|
|
223
217
|
interval?: {
|
|
@@ -225,6 +219,12 @@ export declare const AchievementRuleSchema: z.ZodObject<{
|
|
|
225
219
|
value?: number | undefined;
|
|
226
220
|
} | undefined;
|
|
227
221
|
} | undefined;
|
|
222
|
+
trigger?: string | undefined;
|
|
223
|
+
event?: string | undefined;
|
|
224
|
+
achievementRuleId?: string | undefined;
|
|
225
|
+
aggregation?: {
|
|
226
|
+
rule?: string | undefined;
|
|
227
|
+
} | undefined;
|
|
228
228
|
uniqueReferee?: boolean | undefined;
|
|
229
229
|
}, {
|
|
230
230
|
completeRule: {
|
|
@@ -241,12 +241,6 @@ export declare const AchievementRuleSchema: z.ZodObject<{
|
|
|
241
241
|
description?: string | undefined;
|
|
242
242
|
}> | undefined;
|
|
243
243
|
conditions?: Record<string, unknown>[] | undefined;
|
|
244
|
-
trigger?: string | undefined;
|
|
245
|
-
event?: string | undefined;
|
|
246
|
-
achievementRuleId?: string | undefined;
|
|
247
|
-
aggregation?: {
|
|
248
|
-
rule?: string | undefined;
|
|
249
|
-
} | undefined;
|
|
250
244
|
limit?: {
|
|
251
245
|
value?: number | undefined;
|
|
252
246
|
interval?: {
|
|
@@ -254,6 +248,12 @@ export declare const AchievementRuleSchema: z.ZodObject<{
|
|
|
254
248
|
value?: number | undefined;
|
|
255
249
|
} | undefined;
|
|
256
250
|
} | undefined;
|
|
251
|
+
trigger?: string | undefined;
|
|
252
|
+
event?: string | undefined;
|
|
253
|
+
achievementRuleId?: string | undefined;
|
|
254
|
+
aggregation?: {
|
|
255
|
+
rule?: string | undefined;
|
|
256
|
+
} | undefined;
|
|
257
257
|
uniqueReferee?: boolean | undefined;
|
|
258
258
|
}>;
|
|
259
259
|
export type AchievementRule = z.infer<typeof AchievementRuleSchema>;
|
|
@@ -428,12 +428,6 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
428
428
|
description?: string | undefined;
|
|
429
429
|
}> | undefined;
|
|
430
430
|
conditions?: Record<string, unknown>[] | undefined;
|
|
431
|
-
trigger?: string | undefined;
|
|
432
|
-
event?: string | undefined;
|
|
433
|
-
achievementRuleId?: string | undefined;
|
|
434
|
-
aggregation?: {
|
|
435
|
-
rule?: string | undefined;
|
|
436
|
-
} | undefined;
|
|
437
431
|
limit?: {
|
|
438
432
|
value?: number | undefined;
|
|
439
433
|
interval?: {
|
|
@@ -441,6 +435,12 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
441
435
|
value?: number | undefined;
|
|
442
436
|
} | undefined;
|
|
443
437
|
} | undefined;
|
|
438
|
+
trigger?: string | undefined;
|
|
439
|
+
event?: string | undefined;
|
|
440
|
+
achievementRuleId?: string | undefined;
|
|
441
|
+
aggregation?: {
|
|
442
|
+
rule?: string | undefined;
|
|
443
|
+
} | undefined;
|
|
444
444
|
uniqueReferee?: boolean | undefined;
|
|
445
445
|
}, {
|
|
446
446
|
completeRule: {
|
|
@@ -457,12 +457,6 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
457
457
|
description?: string | undefined;
|
|
458
458
|
}> | undefined;
|
|
459
459
|
conditions?: Record<string, unknown>[] | undefined;
|
|
460
|
-
trigger?: string | undefined;
|
|
461
|
-
event?: string | undefined;
|
|
462
|
-
achievementRuleId?: string | undefined;
|
|
463
|
-
aggregation?: {
|
|
464
|
-
rule?: string | undefined;
|
|
465
|
-
} | undefined;
|
|
466
460
|
limit?: {
|
|
467
461
|
value?: number | undefined;
|
|
468
462
|
interval?: {
|
|
@@ -470,6 +464,12 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
470
464
|
value?: number | undefined;
|
|
471
465
|
} | undefined;
|
|
472
466
|
} | undefined;
|
|
467
|
+
trigger?: string | undefined;
|
|
468
|
+
event?: string | undefined;
|
|
469
|
+
achievementRuleId?: string | undefined;
|
|
470
|
+
aggregation?: {
|
|
471
|
+
rule?: string | undefined;
|
|
472
|
+
} | undefined;
|
|
473
473
|
uniqueReferee?: boolean | undefined;
|
|
474
474
|
}>, "many">;
|
|
475
475
|
badgeTypeId: z.ZodOptional<z.ZodString>;
|
|
@@ -496,12 +496,6 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
496
496
|
description?: string | undefined;
|
|
497
497
|
}> | undefined;
|
|
498
498
|
conditions?: Record<string, unknown>[] | undefined;
|
|
499
|
-
trigger?: string | undefined;
|
|
500
|
-
event?: string | undefined;
|
|
501
|
-
achievementRuleId?: string | undefined;
|
|
502
|
-
aggregation?: {
|
|
503
|
-
rule?: string | undefined;
|
|
504
|
-
} | undefined;
|
|
505
499
|
limit?: {
|
|
506
500
|
value?: number | undefined;
|
|
507
501
|
interval?: {
|
|
@@ -509,16 +503,16 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
509
503
|
value?: number | undefined;
|
|
510
504
|
} | undefined;
|
|
511
505
|
} | undefined;
|
|
506
|
+
trigger?: string | undefined;
|
|
507
|
+
event?: string | undefined;
|
|
508
|
+
achievementRuleId?: string | undefined;
|
|
509
|
+
aggregation?: {
|
|
510
|
+
rule?: string | undefined;
|
|
511
|
+
} | undefined;
|
|
512
512
|
uniqueReferee?: boolean | undefined;
|
|
513
513
|
}[];
|
|
514
514
|
achievementId: string;
|
|
515
515
|
createdAt?: string | undefined;
|
|
516
|
-
activity?: {
|
|
517
|
-
data?: string | undefined;
|
|
518
|
-
operator?: string | undefined;
|
|
519
|
-
startsAt?: string | undefined;
|
|
520
|
-
endsAt?: string | undefined;
|
|
521
|
-
} | undefined;
|
|
522
516
|
limit?: {
|
|
523
517
|
value?: number | undefined;
|
|
524
518
|
interval?: {
|
|
@@ -526,6 +520,12 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
526
520
|
value?: number | undefined;
|
|
527
521
|
} | undefined;
|
|
528
522
|
} | undefined;
|
|
523
|
+
activity?: {
|
|
524
|
+
data?: string | undefined;
|
|
525
|
+
operator?: string | undefined;
|
|
526
|
+
startsAt?: string | undefined;
|
|
527
|
+
endsAt?: string | undefined;
|
|
528
|
+
} | undefined;
|
|
529
529
|
badgeTypeId?: string | undefined;
|
|
530
530
|
completionsCount?: number | undefined;
|
|
531
531
|
}, {
|
|
@@ -549,12 +549,6 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
549
549
|
description?: string | undefined;
|
|
550
550
|
}> | undefined;
|
|
551
551
|
conditions?: Record<string, unknown>[] | undefined;
|
|
552
|
-
trigger?: string | undefined;
|
|
553
|
-
event?: string | undefined;
|
|
554
|
-
achievementRuleId?: string | undefined;
|
|
555
|
-
aggregation?: {
|
|
556
|
-
rule?: string | undefined;
|
|
557
|
-
} | undefined;
|
|
558
552
|
limit?: {
|
|
559
553
|
value?: number | undefined;
|
|
560
554
|
interval?: {
|
|
@@ -562,16 +556,16 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
562
556
|
value?: number | undefined;
|
|
563
557
|
} | undefined;
|
|
564
558
|
} | undefined;
|
|
559
|
+
trigger?: string | undefined;
|
|
560
|
+
event?: string | undefined;
|
|
561
|
+
achievementRuleId?: string | undefined;
|
|
562
|
+
aggregation?: {
|
|
563
|
+
rule?: string | undefined;
|
|
564
|
+
} | undefined;
|
|
565
565
|
uniqueReferee?: boolean | undefined;
|
|
566
566
|
}[];
|
|
567
567
|
achievementId: string;
|
|
568
568
|
createdAt?: string | undefined;
|
|
569
|
-
activity?: {
|
|
570
|
-
data?: string | undefined;
|
|
571
|
-
operator?: string | undefined;
|
|
572
|
-
startsAt?: string | undefined;
|
|
573
|
-
endsAt?: string | undefined;
|
|
574
|
-
} | undefined;
|
|
575
569
|
limit?: {
|
|
576
570
|
value?: number | undefined;
|
|
577
571
|
interval?: {
|
|
@@ -579,6 +573,12 @@ export declare const AchievementSchema: z.ZodObject<{
|
|
|
579
573
|
value?: number | undefined;
|
|
580
574
|
} | undefined;
|
|
581
575
|
} | undefined;
|
|
576
|
+
activity?: {
|
|
577
|
+
data?: string | undefined;
|
|
578
|
+
operator?: string | undefined;
|
|
579
|
+
startsAt?: string | undefined;
|
|
580
|
+
endsAt?: string | undefined;
|
|
581
|
+
} | undefined;
|
|
582
582
|
badgeTypeId?: string | undefined;
|
|
583
583
|
completionsCount?: number | undefined;
|
|
584
584
|
}>;
|
|
@@ -11,16 +11,16 @@ export declare const AdminRoleSchema: z.ZodObject<{
|
|
|
11
11
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
13
|
name?: string | undefined;
|
|
14
|
+
default?: boolean | undefined;
|
|
14
15
|
id?: string | number | undefined;
|
|
15
16
|
role?: string | undefined;
|
|
16
17
|
master?: boolean | undefined;
|
|
17
|
-
default?: boolean | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
name?: string | undefined;
|
|
20
|
+
default?: boolean | undefined;
|
|
20
21
|
id?: string | number | undefined;
|
|
21
22
|
role?: string | undefined;
|
|
22
23
|
master?: boolean | undefined;
|
|
23
|
-
default?: boolean | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
export type AdminRole = z.infer<typeof AdminRoleSchema>;
|
|
26
26
|
/**
|
|
@@ -58,16 +58,16 @@ export declare const AdminUserSchema: z.ZodObject<{
|
|
|
58
58
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
60
|
name?: string | undefined;
|
|
61
|
+
default?: boolean | undefined;
|
|
61
62
|
id?: string | number | undefined;
|
|
62
63
|
role?: string | undefined;
|
|
63
64
|
master?: boolean | undefined;
|
|
64
|
-
default?: boolean | undefined;
|
|
65
65
|
}, {
|
|
66
66
|
name?: string | undefined;
|
|
67
|
+
default?: boolean | undefined;
|
|
67
68
|
id?: string | number | undefined;
|
|
68
69
|
role?: string | undefined;
|
|
69
70
|
master?: boolean | undefined;
|
|
70
|
-
default?: boolean | undefined;
|
|
71
71
|
}>, "many">>;
|
|
72
72
|
settings: z.ZodOptional<z.ZodObject<{
|
|
73
73
|
notificationsEnabled: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
@@ -79,11 +79,11 @@ export declare const AdminUserSchema: z.ZodObject<{
|
|
|
79
79
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
80
80
|
dtype: z.ZodOptional<z.ZodString>;
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
createdAt?: string | undefined;
|
|
82
83
|
email?: string | undefined;
|
|
83
84
|
phone?: string | undefined;
|
|
84
85
|
firstName?: string | undefined;
|
|
85
86
|
lastName?: string | undefined;
|
|
86
|
-
createdAt?: string | undefined;
|
|
87
87
|
id?: string | undefined;
|
|
88
88
|
adminId?: string | undefined;
|
|
89
89
|
username?: string | undefined;
|
|
@@ -92,21 +92,21 @@ export declare const AdminUserSchema: z.ZodObject<{
|
|
|
92
92
|
canChangePassword?: boolean | undefined;
|
|
93
93
|
roles?: {
|
|
94
94
|
name?: string | undefined;
|
|
95
|
+
default?: boolean | undefined;
|
|
95
96
|
id?: string | number | undefined;
|
|
96
97
|
role?: string | undefined;
|
|
97
98
|
master?: boolean | undefined;
|
|
98
|
-
default?: boolean | undefined;
|
|
99
99
|
}[] | undefined;
|
|
100
100
|
settings?: {
|
|
101
101
|
notificationsEnabled?: string | boolean | undefined;
|
|
102
102
|
} | undefined;
|
|
103
103
|
dtype?: string | undefined;
|
|
104
104
|
}, {
|
|
105
|
+
createdAt?: string | undefined;
|
|
105
106
|
email?: string | undefined;
|
|
106
107
|
phone?: string | undefined;
|
|
107
108
|
firstName?: string | undefined;
|
|
108
109
|
lastName?: string | undefined;
|
|
109
|
-
createdAt?: string | undefined;
|
|
110
110
|
id?: string | undefined;
|
|
111
111
|
adminId?: string | undefined;
|
|
112
112
|
username?: string | undefined;
|
|
@@ -115,10 +115,10 @@ export declare const AdminUserSchema: z.ZodObject<{
|
|
|
115
115
|
canChangePassword?: boolean | undefined;
|
|
116
116
|
roles?: {
|
|
117
117
|
name?: string | undefined;
|
|
118
|
+
default?: boolean | undefined;
|
|
118
119
|
id?: string | number | undefined;
|
|
119
120
|
role?: string | undefined;
|
|
120
121
|
master?: boolean | undefined;
|
|
121
|
-
default?: boolean | undefined;
|
|
122
122
|
}[] | undefined;
|
|
123
123
|
settings?: {
|
|
124
124
|
notificationsEnabled?: string | boolean | undefined;
|
|
@@ -139,18 +139,18 @@ export declare const AdminUserListItemSchema: z.ZodObject<{
|
|
|
139
139
|
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
140
140
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
141
141
|
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
createdAt?: string | undefined;
|
|
142
143
|
email?: string | undefined;
|
|
143
144
|
firstName?: string | undefined;
|
|
144
145
|
lastName?: string | undefined;
|
|
145
|
-
createdAt?: string | undefined;
|
|
146
146
|
id?: string | undefined;
|
|
147
147
|
username?: string | undefined;
|
|
148
148
|
isActive?: boolean | undefined;
|
|
149
149
|
}, {
|
|
150
|
+
createdAt?: string | undefined;
|
|
150
151
|
email?: string | undefined;
|
|
151
152
|
firstName?: string | undefined;
|
|
152
153
|
lastName?: string | undefined;
|
|
153
|
-
createdAt?: string | undefined;
|
|
154
154
|
id?: string | undefined;
|
|
155
155
|
username?: string | undefined;
|
|
156
156
|
isActive?: boolean | undefined;
|