@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
package/dist/tools/tierset.js
DELETED
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { apiGet, apiPost, apiPut } from "../client/http.js";
|
|
3
|
-
import { TierSetSchema, TierSetListResponseSchema, TierListResponseSchema, TierSetAttributeEnum, DowngradeModeEnum, } from "../types/schemas/tierset.js";
|
|
4
|
-
import { formatApiError } from "../utils/errors.js";
|
|
5
|
-
import { getStoreCode } from "../config.js";
|
|
6
|
-
import { buildPaginationQuery } from "../utils/pagination.js";
|
|
7
|
-
export const TierSetListInputSchema = {
|
|
8
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
9
|
-
page: z.number().optional().describe("Page number for pagination (starts at 1)."),
|
|
10
|
-
perPage: z.number().optional().describe("Number of items per page."),
|
|
11
|
-
};
|
|
12
|
-
export const TierSetCreateInputSchema = {
|
|
13
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
14
|
-
name: z.string().describe("Name of the tier set."),
|
|
15
|
-
description: z.string().optional().describe("Description of the tier set."),
|
|
16
|
-
conditions: z.array(z.object({
|
|
17
|
-
attribute: TierSetAttributeEnum.describe("VALID VALUES: 'activeUnits' (current balance), 'totalEarnedUnits' (lifetime points - NOT 'earnedUnits'), " +
|
|
18
|
-
"'totalSpending' (lifetime spend), 'monthsSinceJoiningProgram' (tenure), 'cumulatedEarnedUnits'. " +
|
|
19
|
-
"Use 'totalEarnedUnits' for lifetime points earned."),
|
|
20
|
-
walletType: z.string().optional().describe("Wallet type CODE (not UUID). Required for unit-based attributes (activeUnits, totalEarnedUnits, cumulatedEarnedUnits). " +
|
|
21
|
-
"Use wallet_type_list to find walletType.code (e.g., 'default')."),
|
|
22
|
-
})).describe("Array of conditions that define tier progression criteria. IMPORTANT: Use 'totalEarnedUnits' for lifetime points (NOT 'earnedUnits')."),
|
|
23
|
-
// NOTE: downgrade and active are NOT supported at creation time - use tierset_update after creation
|
|
24
|
-
};
|
|
25
|
-
export const TierSetGetInputSchema = {
|
|
26
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
27
|
-
tierSetId: z.string().describe("The tier set ID to retrieve."),
|
|
28
|
-
};
|
|
29
|
-
export const TierSetUpdateInputSchema = {
|
|
30
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
31
|
-
tierSetId: z.string().describe("The tier set ID to update."),
|
|
32
|
-
name: z.string().optional().describe("New name for the tier set."),
|
|
33
|
-
description: z.string().optional().describe("New description for the tier set."),
|
|
34
|
-
active: z.boolean().optional().describe("Whether the tier set is active."),
|
|
35
|
-
downgrade: z.object({
|
|
36
|
-
mode: DowngradeModeEnum.describe("Downgrade mode."),
|
|
37
|
-
days: z.number().optional().describe("Number of days for x_days mode."),
|
|
38
|
-
}).optional().describe("Downgrade configuration."),
|
|
39
|
-
};
|
|
40
|
-
export const TierSetUpdateTiersInputSchema = {
|
|
41
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
42
|
-
tierSetId: z.string().describe("The tier set ID to update tiers for."),
|
|
43
|
-
tiers: z.array(z.object({
|
|
44
|
-
levelId: z.string().optional().describe("Existing level ID (for updates). Omit for new tiers."),
|
|
45
|
-
name: z.string().describe("Name of the tier (e.g., Bronze, Silver, Gold)."),
|
|
46
|
-
description: z.string().optional().describe("Description of the tier."),
|
|
47
|
-
active: z.boolean().optional().describe("Whether the tier is active. Defaults to true."),
|
|
48
|
-
conditions: z.array(z.object({
|
|
49
|
-
conditionId: z.string().describe("Condition ID from tierset_get response."),
|
|
50
|
-
value: z.number().describe("Threshold value for this condition (e.g., 400 points for Bronze)."),
|
|
51
|
-
})).describe("Array of condition thresholds. Each uses conditionId from tierset_get."),
|
|
52
|
-
})).describe("Array of tier definitions."),
|
|
53
|
-
};
|
|
54
|
-
export const TierSetGetTiersInputSchema = {
|
|
55
|
-
storeCode: z.string().optional().describe("Store code for multi-tenant routing. DO NOT pass this parameter - the configured default will be used automatically. Only provide a value if the user explicitly asks to work with a different store."),
|
|
56
|
-
tierSetId: z.string().describe("The tier set ID to get tiers for."),
|
|
57
|
-
};
|
|
58
|
-
export async function tiersetList(input) {
|
|
59
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
60
|
-
const query = buildPaginationQuery({
|
|
61
|
-
page: input.page,
|
|
62
|
-
perPage: input.perPage,
|
|
63
|
-
});
|
|
64
|
-
try {
|
|
65
|
-
const response = await apiGet(`/${storeCode}/tierSet${query}`);
|
|
66
|
-
const validated = TierSetListResponseSchema.parse(response);
|
|
67
|
-
return {
|
|
68
|
-
items: validated.items.map((ts) => ({
|
|
69
|
-
tierSetId: ts.tierSetId,
|
|
70
|
-
name: ts.name,
|
|
71
|
-
active: ts.active,
|
|
72
|
-
tiersCount: ts.tiersCount,
|
|
73
|
-
})),
|
|
74
|
-
total: {
|
|
75
|
-
all: typeof validated.total.all === 'number' ? validated.total.all : undefined,
|
|
76
|
-
filtered: typeof validated.total.filtered === 'number' ? validated.total.filtered : undefined,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
throw formatApiError(error, "ol_tierset_list");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export async function tiersetCreate(input) {
|
|
85
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
86
|
-
// API QUIRK: Only accepts specific fields at creation time.
|
|
87
|
-
// Fields NOT supported at creation: tiers, active, downgrade
|
|
88
|
-
// These must be set via tierset_update or tierset_update_tiers after creation.
|
|
89
|
-
//
|
|
90
|
-
// REQUIRED fields:
|
|
91
|
-
// - translations.en.name (string)
|
|
92
|
-
// - conditions (array with attribute, optionally walletType)
|
|
93
|
-
const tierSetPayload = {
|
|
94
|
-
translations: {
|
|
95
|
-
en: {
|
|
96
|
-
name: input.name,
|
|
97
|
-
description: input.description || "",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
conditions: input.conditions,
|
|
101
|
-
};
|
|
102
|
-
const payload = { tierSet: tierSetPayload };
|
|
103
|
-
try {
|
|
104
|
-
const response = await apiPost(`/${storeCode}/tierSet`, payload);
|
|
105
|
-
// API QUIRK: Create endpoint only returns { tierSetId: string }
|
|
106
|
-
// We need to fetch the full tier set to get the conditionId values
|
|
107
|
-
const createResponse = response;
|
|
108
|
-
if (!createResponse.tierSetId) {
|
|
109
|
-
throw new Error(`Unexpected response format: ${JSON.stringify(response)}`);
|
|
110
|
-
}
|
|
111
|
-
// Fetch the created tier set to get condition IDs
|
|
112
|
-
const tierSetResponse = await apiGet(`/${storeCode}/tierSet/${createResponse.tierSetId}`);
|
|
113
|
-
const validated = TierSetSchema.parse(tierSetResponse);
|
|
114
|
-
return {
|
|
115
|
-
tierSetId: validated.tierSetId,
|
|
116
|
-
conditions: validated.conditions.map((c) => ({
|
|
117
|
-
conditionId: c.id,
|
|
118
|
-
attribute: c.attribute,
|
|
119
|
-
})),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
throw formatApiError(error, "ol_tierset_create");
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
export async function tiersetGet(input) {
|
|
127
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
128
|
-
try {
|
|
129
|
-
const response = await apiGet(`/${storeCode}/tierSet/${input.tierSetId}`);
|
|
130
|
-
const validated = TierSetSchema.parse(response);
|
|
131
|
-
return validated;
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
throw formatApiError(error, "ol_tierset_get");
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
export async function tiersetUpdate(input) {
|
|
138
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
139
|
-
// API requires conditions to be present in PUT requests, even for metadata-only updates.
|
|
140
|
-
// Fetch existing tier set to preserve conditions.
|
|
141
|
-
let existingTierSet;
|
|
142
|
-
try {
|
|
143
|
-
const response = await apiGet(`/${storeCode}/tierSet/${input.tierSetId}`);
|
|
144
|
-
existingTierSet = TierSetSchema.parse(response);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
throw formatApiError(error, "ol_tierset_update");
|
|
148
|
-
}
|
|
149
|
-
// Build payload using existing values as defaults
|
|
150
|
-
const tierSetPayload = {
|
|
151
|
-
// Always include conditions - API requires this even for metadata updates
|
|
152
|
-
conditions: existingTierSet.conditions.map((c) => ({
|
|
153
|
-
attribute: c.attribute,
|
|
154
|
-
walletType: c.walletType,
|
|
155
|
-
})),
|
|
156
|
-
// Always include translations
|
|
157
|
-
translations: {
|
|
158
|
-
en: {
|
|
159
|
-
name: input.name ?? existingTierSet.name,
|
|
160
|
-
description: input.description ?? existingTierSet.description ?? "",
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
// Preserve active status unless explicitly changed
|
|
164
|
-
active: input.active ?? existingTierSet.active,
|
|
165
|
-
};
|
|
166
|
-
if (input.downgrade !== undefined) {
|
|
167
|
-
tierSetPayload.downgrade = input.downgrade;
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
|
-
await apiPut(`/${storeCode}/tierSet/${input.tierSetId}`, { tierSet: tierSetPayload });
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
throw formatApiError(error, "ol_tierset_update");
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
export async function tiersetUpdateTiers(input) {
|
|
177
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
178
|
-
// API requires translations (at least en is required)
|
|
179
|
-
const payload = {
|
|
180
|
-
tiers: input.tiers.map((tier) => ({
|
|
181
|
-
levelId: tier.levelId,
|
|
182
|
-
active: tier.active ?? true,
|
|
183
|
-
conditions: tier.conditions.map((c) => ({
|
|
184
|
-
conditionId: c.conditionId,
|
|
185
|
-
value: c.value,
|
|
186
|
-
})),
|
|
187
|
-
translations: {
|
|
188
|
-
en: {
|
|
189
|
-
name: tier.name,
|
|
190
|
-
description: tier.description || "",
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
})),
|
|
194
|
-
};
|
|
195
|
-
try {
|
|
196
|
-
await apiPut(`/${storeCode}/tierSet/${input.tierSetId}/tiers`, payload);
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
throw formatApiError(error, "ol_tierset_update_tiers");
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
export async function tiersetGetTiers(input) {
|
|
203
|
-
const storeCode = getStoreCode(input.storeCode);
|
|
204
|
-
try {
|
|
205
|
-
const response = await apiGet(`/${storeCode}/tierSet/${input.tierSetId}/tiers`);
|
|
206
|
-
const validated = TierListResponseSchema.parse(response);
|
|
207
|
-
return {
|
|
208
|
-
items: validated.items,
|
|
209
|
-
total: {
|
|
210
|
-
all: typeof validated.total.all === 'number' ? validated.total.all : undefined,
|
|
211
|
-
filtered: typeof validated.total.filtered === 'number' ? validated.total.filtered : undefined,
|
|
212
|
-
},
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
catch (error) {
|
|
216
|
-
throw formatApiError(error, "ol_tierset_get_tiers");
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
export const tiersetToolDefinitions = [
|
|
220
|
-
{
|
|
221
|
-
name: "ol_tierset_list",
|
|
222
|
-
title: "List Loyalty Programs",
|
|
223
|
-
description: "List all tier sets. RECOMMENDED: Check if tier set already exists before creating a new one. " +
|
|
224
|
-
"If exists, use tierset_get to fetch conditionId needed for defining tiers via tierset_update_tiers. " +
|
|
225
|
-
"Returns tierSetId, name, active status, and tier count for each tier set.",
|
|
226
|
-
readOnly: true,
|
|
227
|
-
inputSchema: TierSetListInputSchema,
|
|
228
|
-
handler: tiersetList,
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: "ol_tierset_create",
|
|
232
|
-
title: "Create Loyalty Program",
|
|
233
|
-
description: "Create a new tier set (loyalty program structure). " +
|
|
234
|
-
"⚠️ LIMIT: Maximum 3 ACTIVE tier sets per store. ALWAYS call tierset_list FIRST to check existing tier sets - if one exists that matches your needs, REUSE IT instead of creating a new one. " +
|
|
235
|
-
"WORKFLOW: 1) tierset_list (check existing) → 2) tierset_create (only if needed) → 3) tierset_get (to get conditionId) → 4) tierset_update_tiers (to define thresholds). " +
|
|
236
|
-
"⚠️ API LIMITATION: Only 'name', 'description', and 'conditions' are accepted at creation time. " +
|
|
237
|
-
"Fields like 'active', 'downgrade', 'tiers' are NOT supported at creation - use tierset_update after creation to set these. " +
|
|
238
|
-
"Valid condition attributes: 'totalEarnedUnits' (lifetime points), 'activeUnits' (current balance), 'totalSpending', 'monthsSinceJoiningProgram'. " +
|
|
239
|
-
"COMMON MISTAKE: Use 'totalEarnedUnits' NOT 'earnedUnits' for lifetime points. " +
|
|
240
|
-
"For unit-based attributes, set walletType to 'default'.",
|
|
241
|
-
readOnly: false,
|
|
242
|
-
inputSchema: TierSetCreateInputSchema,
|
|
243
|
-
handler: tiersetCreate,
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
name: "ol_tierset_get",
|
|
247
|
-
title: "Get Loyalty Program Details",
|
|
248
|
-
description: "Get tier set details including conditionId values needed for tierset_update_tiers. " +
|
|
249
|
-
"CRITICAL: After tierset_create, you MUST call this to get the conditionId from the conditions array. " +
|
|
250
|
-
"The conditionId is then used in tierset_update_tiers to set tier thresholds. " +
|
|
251
|
-
"Response includes conditions[].id (this is the conditionId) and conditions[].attribute.",
|
|
252
|
-
readOnly: true,
|
|
253
|
-
inputSchema: TierSetGetInputSchema,
|
|
254
|
-
handler: tiersetGet,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: "ol_tierset_update",
|
|
258
|
-
title: "Update Loyalty Program",
|
|
259
|
-
description: "Update tier set metadata (name, description, active status, downgrade settings). " +
|
|
260
|
-
"Automatically preserves existing conditions (API requires them in update requests). " +
|
|
261
|
-
"Does not modify tiers - use tierset_update_tiers for that.",
|
|
262
|
-
readOnly: false,
|
|
263
|
-
inputSchema: TierSetUpdateInputSchema,
|
|
264
|
-
handler: tiersetUpdate,
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "ol_tierset_update_tiers",
|
|
268
|
-
title: "Configure Tier Thresholds",
|
|
269
|
-
description: `Define tier thresholds for a tier set. PREREQUISITE: Call tierset_get first to obtain conditionId values. Each tier's conditions array uses conditionId from the parent tier set plus a threshold value.
|
|
270
|
-
|
|
271
|
-
Example for a 3-tier program with points-based progression:
|
|
272
|
-
- Bronze tier: conditions: [{ conditionId: "xxx", value: 400 }]
|
|
273
|
-
- Silver tier: conditions: [{ conditionId: "xxx", value: 800 }]
|
|
274
|
-
- Gold tier: conditions: [{ conditionId: "xxx", value: 1200 }]
|
|
275
|
-
|
|
276
|
-
The conditionId must match one from tierset_get response.`,
|
|
277
|
-
readOnly: false,
|
|
278
|
-
inputSchema: TierSetUpdateTiersInputSchema,
|
|
279
|
-
handler: tiersetUpdateTiers,
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
name: "ol_tierset_get_tiers",
|
|
283
|
-
title: "Get Tier Configuration",
|
|
284
|
-
description: "Get all tiers in a tier set. Returns levelId values that can be used for campaign targeting. Includes each tier's name and condition thresholds.",
|
|
285
|
-
readOnly: true,
|
|
286
|
-
inputSchema: TierSetGetTiersInputSchema,
|
|
287
|
-
handler: tiersetGetTiers,
|
|
288
|
-
},
|
|
289
|
-
];
|
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const TransactionCreateInputSchema: {
|
|
3
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
4
|
-
header: z.ZodObject<{
|
|
5
|
-
documentNumber: z.ZodString;
|
|
6
|
-
purchasedAt: z.ZodString;
|
|
7
|
-
documentType: z.ZodOptional<z.ZodEnum<["sell", "return"]>>;
|
|
8
|
-
linkedDocumentNumber: z.ZodOptional<z.ZodString>;
|
|
9
|
-
purchasePlace: z.ZodOptional<z.ZodString>;
|
|
10
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
-
key: z.ZodString;
|
|
12
|
-
value: z.ZodString;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
value: string;
|
|
15
|
-
key: string;
|
|
16
|
-
}, {
|
|
17
|
-
value: string;
|
|
18
|
-
key: string;
|
|
19
|
-
}>, "many">>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
documentNumber: string;
|
|
22
|
-
purchasedAt: string;
|
|
23
|
-
documentType?: "sell" | "return" | undefined;
|
|
24
|
-
linkedDocumentNumber?: string | undefined;
|
|
25
|
-
purchasePlace?: string | undefined;
|
|
26
|
-
labels?: {
|
|
27
|
-
value: string;
|
|
28
|
-
key: string;
|
|
29
|
-
}[] | undefined;
|
|
30
|
-
}, {
|
|
31
|
-
documentNumber: string;
|
|
32
|
-
purchasedAt: string;
|
|
33
|
-
documentType?: "sell" | "return" | undefined;
|
|
34
|
-
linkedDocumentNumber?: string | undefined;
|
|
35
|
-
purchasePlace?: string | undefined;
|
|
36
|
-
labels?: {
|
|
37
|
-
value: string;
|
|
38
|
-
key: string;
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
items: z.ZodArray<z.ZodObject<{
|
|
42
|
-
sku: z.ZodString;
|
|
43
|
-
name: z.ZodString;
|
|
44
|
-
grossValue: z.ZodNumber;
|
|
45
|
-
category: z.ZodString;
|
|
46
|
-
quantity: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
highPrecisionQuantity: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
maker: z.ZodOptional<z.ZodString>;
|
|
49
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
-
key: z.ZodString;
|
|
51
|
-
value: z.ZodString;
|
|
52
|
-
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
value: string;
|
|
54
|
-
key: string;
|
|
55
|
-
}, {
|
|
56
|
-
value: string;
|
|
57
|
-
key: string;
|
|
58
|
-
}>, "many">>;
|
|
59
|
-
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
name: string;
|
|
61
|
-
sku: string;
|
|
62
|
-
grossValue: number;
|
|
63
|
-
category: string;
|
|
64
|
-
quantity?: number | undefined;
|
|
65
|
-
labels?: {
|
|
66
|
-
value: string;
|
|
67
|
-
key: string;
|
|
68
|
-
}[] | undefined;
|
|
69
|
-
highPrecisionQuantity?: number | undefined;
|
|
70
|
-
maker?: string | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
name: string;
|
|
73
|
-
sku: string;
|
|
74
|
-
grossValue: number;
|
|
75
|
-
category: string;
|
|
76
|
-
quantity?: number | undefined;
|
|
77
|
-
labels?: {
|
|
78
|
-
value: string;
|
|
79
|
-
key: string;
|
|
80
|
-
}[] | undefined;
|
|
81
|
-
highPrecisionQuantity?: number | undefined;
|
|
82
|
-
maker?: string | undefined;
|
|
83
|
-
}>, "many">;
|
|
84
|
-
customerData: z.ZodOptional<z.ZodObject<{
|
|
85
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
86
|
-
email: z.ZodOptional<z.ZodString>;
|
|
87
|
-
name: z.ZodOptional<z.ZodString>;
|
|
88
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
89
|
-
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
90
|
-
}, "strip", z.ZodTypeAny, {
|
|
91
|
-
email?: string | undefined;
|
|
92
|
-
phone?: string | undefined;
|
|
93
|
-
loyaltyCardNumber?: string | undefined;
|
|
94
|
-
name?: string | undefined;
|
|
95
|
-
customerId?: string | undefined;
|
|
96
|
-
}, {
|
|
97
|
-
email?: string | undefined;
|
|
98
|
-
phone?: string | undefined;
|
|
99
|
-
loyaltyCardNumber?: string | undefined;
|
|
100
|
-
name?: string | undefined;
|
|
101
|
-
customerId?: string | undefined;
|
|
102
|
-
}>>;
|
|
103
|
-
};
|
|
104
|
-
export declare const TransactionGetInputSchema: {
|
|
105
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
106
|
-
transactionId: z.ZodString;
|
|
107
|
-
};
|
|
108
|
-
export declare const TransactionListInputSchema: {
|
|
109
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
110
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
111
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
113
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
114
|
-
documentNumber: z.ZodOptional<z.ZodString>;
|
|
115
|
-
documentType: z.ZodOptional<z.ZodEnum<["sell", "return"]>>;
|
|
116
|
-
matched: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
-
purchasedAtFrom: z.ZodOptional<z.ZodString>;
|
|
118
|
-
purchasedAtTo: z.ZodOptional<z.ZodString>;
|
|
119
|
-
};
|
|
120
|
-
export declare const TransactionAssignMemberInputSchema: {
|
|
121
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
122
|
-
documentNumber: z.ZodString;
|
|
123
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
124
|
-
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
125
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
126
|
-
};
|
|
127
|
-
export declare function transactionCreate(input: {
|
|
128
|
-
storeCode?: string;
|
|
129
|
-
header: {
|
|
130
|
-
documentNumber: string;
|
|
131
|
-
purchasedAt: string;
|
|
132
|
-
documentType?: string;
|
|
133
|
-
linkedDocumentNumber?: string;
|
|
134
|
-
purchasePlace?: string;
|
|
135
|
-
labels?: Array<{
|
|
136
|
-
key: string;
|
|
137
|
-
value: string;
|
|
138
|
-
}>;
|
|
139
|
-
};
|
|
140
|
-
items: Array<{
|
|
141
|
-
sku: string;
|
|
142
|
-
name: string;
|
|
143
|
-
grossValue: number;
|
|
144
|
-
category: string;
|
|
145
|
-
quantity?: number;
|
|
146
|
-
highPrecisionQuantity?: number;
|
|
147
|
-
maker?: string;
|
|
148
|
-
labels?: Array<{
|
|
149
|
-
key: string;
|
|
150
|
-
value: string;
|
|
151
|
-
}>;
|
|
152
|
-
}>;
|
|
153
|
-
customerData?: {
|
|
154
|
-
customerId?: string;
|
|
155
|
-
email?: string;
|
|
156
|
-
name?: string;
|
|
157
|
-
phone?: string;
|
|
158
|
-
loyaltyCardNumber?: string;
|
|
159
|
-
};
|
|
160
|
-
}): Promise<{
|
|
161
|
-
transactionId: string;
|
|
162
|
-
pointsEarned?: number;
|
|
163
|
-
}>;
|
|
164
|
-
export declare function transactionGet(input: {
|
|
165
|
-
storeCode?: string;
|
|
166
|
-
transactionId: string;
|
|
167
|
-
}): Promise<{
|
|
168
|
-
transactionId: string;
|
|
169
|
-
documentNumber: string;
|
|
170
|
-
documentType: string;
|
|
171
|
-
items: unknown[];
|
|
172
|
-
customerData?: unknown;
|
|
173
|
-
matched: boolean;
|
|
174
|
-
grossValue: number;
|
|
175
|
-
pointsEarned?: number;
|
|
176
|
-
purchasedAt?: string;
|
|
177
|
-
}>;
|
|
178
|
-
export declare function transactionList(input: {
|
|
179
|
-
storeCode?: string;
|
|
180
|
-
cursor?: string;
|
|
181
|
-
page?: number;
|
|
182
|
-
perPage?: number;
|
|
183
|
-
customerId?: string;
|
|
184
|
-
documentNumber?: string;
|
|
185
|
-
documentType?: string;
|
|
186
|
-
matched?: boolean;
|
|
187
|
-
purchasedAtFrom?: string;
|
|
188
|
-
purchasedAtTo?: string;
|
|
189
|
-
}): Promise<{
|
|
190
|
-
transactions: Array<{
|
|
191
|
-
transactionId: string;
|
|
192
|
-
documentNumber: string;
|
|
193
|
-
grossValue: number;
|
|
194
|
-
matched: boolean;
|
|
195
|
-
customerId?: string;
|
|
196
|
-
pointsEarned?: number;
|
|
197
|
-
purchasedAt?: string;
|
|
198
|
-
}>;
|
|
199
|
-
total: {
|
|
200
|
-
all?: number;
|
|
201
|
-
filtered?: number;
|
|
202
|
-
};
|
|
203
|
-
cursor?: string;
|
|
204
|
-
}>;
|
|
205
|
-
export declare function transactionAssignMember(input: {
|
|
206
|
-
storeCode?: string;
|
|
207
|
-
documentNumber: string;
|
|
208
|
-
customerId?: string;
|
|
209
|
-
loyaltyCardNumber?: string;
|
|
210
|
-
phone?: string;
|
|
211
|
-
}): Promise<{
|
|
212
|
-
transactionId: string;
|
|
213
|
-
customerId: string;
|
|
214
|
-
pointsEarned?: number;
|
|
215
|
-
}>;
|
|
216
|
-
export declare const transactionToolDefinitions: readonly [{
|
|
217
|
-
readonly name: "ol_transaction_create";
|
|
218
|
-
readonly title: "Record Purchase";
|
|
219
|
-
readonly description: string;
|
|
220
|
-
readonly readOnly: false;
|
|
221
|
-
readonly inputSchema: {
|
|
222
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
223
|
-
header: z.ZodObject<{
|
|
224
|
-
documentNumber: z.ZodString;
|
|
225
|
-
purchasedAt: z.ZodString;
|
|
226
|
-
documentType: z.ZodOptional<z.ZodEnum<["sell", "return"]>>;
|
|
227
|
-
linkedDocumentNumber: z.ZodOptional<z.ZodString>;
|
|
228
|
-
purchasePlace: z.ZodOptional<z.ZodString>;
|
|
229
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
230
|
-
key: z.ZodString;
|
|
231
|
-
value: z.ZodString;
|
|
232
|
-
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
value: string;
|
|
234
|
-
key: string;
|
|
235
|
-
}, {
|
|
236
|
-
value: string;
|
|
237
|
-
key: string;
|
|
238
|
-
}>, "many">>;
|
|
239
|
-
}, "strip", z.ZodTypeAny, {
|
|
240
|
-
documentNumber: string;
|
|
241
|
-
purchasedAt: string;
|
|
242
|
-
documentType?: "sell" | "return" | undefined;
|
|
243
|
-
linkedDocumentNumber?: string | undefined;
|
|
244
|
-
purchasePlace?: string | undefined;
|
|
245
|
-
labels?: {
|
|
246
|
-
value: string;
|
|
247
|
-
key: string;
|
|
248
|
-
}[] | undefined;
|
|
249
|
-
}, {
|
|
250
|
-
documentNumber: string;
|
|
251
|
-
purchasedAt: string;
|
|
252
|
-
documentType?: "sell" | "return" | undefined;
|
|
253
|
-
linkedDocumentNumber?: string | undefined;
|
|
254
|
-
purchasePlace?: string | undefined;
|
|
255
|
-
labels?: {
|
|
256
|
-
value: string;
|
|
257
|
-
key: string;
|
|
258
|
-
}[] | undefined;
|
|
259
|
-
}>;
|
|
260
|
-
items: z.ZodArray<z.ZodObject<{
|
|
261
|
-
sku: z.ZodString;
|
|
262
|
-
name: z.ZodString;
|
|
263
|
-
grossValue: z.ZodNumber;
|
|
264
|
-
category: z.ZodString;
|
|
265
|
-
quantity: z.ZodOptional<z.ZodNumber>;
|
|
266
|
-
highPrecisionQuantity: z.ZodOptional<z.ZodNumber>;
|
|
267
|
-
maker: z.ZodOptional<z.ZodString>;
|
|
268
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
269
|
-
key: z.ZodString;
|
|
270
|
-
value: z.ZodString;
|
|
271
|
-
}, "strip", z.ZodTypeAny, {
|
|
272
|
-
value: string;
|
|
273
|
-
key: string;
|
|
274
|
-
}, {
|
|
275
|
-
value: string;
|
|
276
|
-
key: string;
|
|
277
|
-
}>, "many">>;
|
|
278
|
-
}, "strip", z.ZodTypeAny, {
|
|
279
|
-
name: string;
|
|
280
|
-
sku: string;
|
|
281
|
-
grossValue: number;
|
|
282
|
-
category: string;
|
|
283
|
-
quantity?: number | undefined;
|
|
284
|
-
labels?: {
|
|
285
|
-
value: string;
|
|
286
|
-
key: string;
|
|
287
|
-
}[] | undefined;
|
|
288
|
-
highPrecisionQuantity?: number | undefined;
|
|
289
|
-
maker?: string | undefined;
|
|
290
|
-
}, {
|
|
291
|
-
name: string;
|
|
292
|
-
sku: string;
|
|
293
|
-
grossValue: number;
|
|
294
|
-
category: string;
|
|
295
|
-
quantity?: number | undefined;
|
|
296
|
-
labels?: {
|
|
297
|
-
value: string;
|
|
298
|
-
key: string;
|
|
299
|
-
}[] | undefined;
|
|
300
|
-
highPrecisionQuantity?: number | undefined;
|
|
301
|
-
maker?: string | undefined;
|
|
302
|
-
}>, "many">;
|
|
303
|
-
customerData: z.ZodOptional<z.ZodObject<{
|
|
304
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
305
|
-
email: z.ZodOptional<z.ZodString>;
|
|
306
|
-
name: z.ZodOptional<z.ZodString>;
|
|
307
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
308
|
-
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
309
|
-
}, "strip", z.ZodTypeAny, {
|
|
310
|
-
email?: string | undefined;
|
|
311
|
-
phone?: string | undefined;
|
|
312
|
-
loyaltyCardNumber?: string | undefined;
|
|
313
|
-
name?: string | undefined;
|
|
314
|
-
customerId?: string | undefined;
|
|
315
|
-
}, {
|
|
316
|
-
email?: string | undefined;
|
|
317
|
-
phone?: string | undefined;
|
|
318
|
-
loyaltyCardNumber?: string | undefined;
|
|
319
|
-
name?: string | undefined;
|
|
320
|
-
customerId?: string | undefined;
|
|
321
|
-
}>>;
|
|
322
|
-
};
|
|
323
|
-
readonly handler: typeof transactionCreate;
|
|
324
|
-
}, {
|
|
325
|
-
readonly name: "ol_transaction_get";
|
|
326
|
-
readonly title: "Get Transaction Details";
|
|
327
|
-
readonly description: "Get transaction details including items, customerData, matched status, and pointsEarned.";
|
|
328
|
-
readonly readOnly: true;
|
|
329
|
-
readonly inputSchema: {
|
|
330
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
331
|
-
transactionId: z.ZodString;
|
|
332
|
-
};
|
|
333
|
-
readonly handler: typeof transactionGet;
|
|
334
|
-
}, {
|
|
335
|
-
readonly name: "ol_transaction_list";
|
|
336
|
-
readonly title: "Search Transactions";
|
|
337
|
-
readonly description: string;
|
|
338
|
-
readonly readOnly: true;
|
|
339
|
-
readonly inputSchema: {
|
|
340
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
341
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
342
|
-
page: z.ZodOptional<z.ZodNumber>;
|
|
343
|
-
perPage: z.ZodOptional<z.ZodNumber>;
|
|
344
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
345
|
-
documentNumber: z.ZodOptional<z.ZodString>;
|
|
346
|
-
documentType: z.ZodOptional<z.ZodEnum<["sell", "return"]>>;
|
|
347
|
-
matched: z.ZodOptional<z.ZodBoolean>;
|
|
348
|
-
purchasedAtFrom: z.ZodOptional<z.ZodString>;
|
|
349
|
-
purchasedAtTo: z.ZodOptional<z.ZodString>;
|
|
350
|
-
};
|
|
351
|
-
readonly handler: typeof transactionList;
|
|
352
|
-
}, {
|
|
353
|
-
readonly name: "ol_transaction_assign_member";
|
|
354
|
-
readonly title: "Link Transaction to Member";
|
|
355
|
-
readonly description: string;
|
|
356
|
-
readonly readOnly: false;
|
|
357
|
-
readonly inputSchema: {
|
|
358
|
-
storeCode: z.ZodOptional<z.ZodString>;
|
|
359
|
-
documentNumber: z.ZodString;
|
|
360
|
-
customerId: z.ZodOptional<z.ZodString>;
|
|
361
|
-
loyaltyCardNumber: z.ZodOptional<z.ZodString>;
|
|
362
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
363
|
-
};
|
|
364
|
-
readonly handler: typeof transactionAssignMember;
|
|
365
|
-
}];
|