@open-loyalty/mcp-server 1.14.1 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,7 @@ export declare const campaignToolDefinitions: readonly [{
79
79
  target: import("zod").ZodOptional<import("zod").ZodEnum<["self", "referrer"]>>;
80
80
  effects: import("zod").ZodArray<import("zod").ZodObject<{
81
81
  effect: import("zod").ZodEnum<["give_points", "give_reward", "deduct_unit", "assign_member_custom_attribute", "remove_member_custom_attribute"]>;
82
- pointsRule: import("zod").ZodOptional<import("zod").ZodString>;
82
+ pointsRule: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
83
83
  walletCode: import("zod").ZodOptional<import("zod").ZodString>;
84
84
  rewardId: import("zod").ZodOptional<import("zod").ZodString>;
85
85
  customAttributeKey: import("zod").ZodOptional<import("zod").ZodString>;
@@ -88,14 +88,14 @@ export declare const campaignToolDefinitions: readonly [{
88
88
  effect: "give_points" | "give_reward" | "deduct_unit" | "assign_member_custom_attribute" | "remove_member_custom_attribute";
89
89
  walletCode?: string | undefined;
90
90
  rewardId?: string | undefined;
91
- pointsRule?: string | undefined;
91
+ pointsRule?: string | number | undefined;
92
92
  customAttributeKey?: string | undefined;
93
93
  customAttributeValueRule?: string | undefined;
94
94
  }, {
95
95
  effect: "give_points" | "give_reward" | "deduct_unit" | "assign_member_custom_attribute" | "remove_member_custom_attribute";
96
96
  walletCode?: string | undefined;
97
97
  rewardId?: string | undefined;
98
- pointsRule?: string | undefined;
98
+ pointsRule?: string | number | undefined;
99
99
  customAttributeKey?: string | undefined;
100
100
  customAttributeValueRule?: string | undefined;
101
101
  }>, "many">;
@@ -118,7 +118,7 @@ export declare const campaignToolDefinitions: readonly [{
118
118
  effect: "give_points" | "give_reward" | "deduct_unit" | "assign_member_custom_attribute" | "remove_member_custom_attribute";
119
119
  walletCode?: string | undefined;
120
120
  rewardId?: string | undefined;
121
- pointsRule?: string | undefined;
121
+ pointsRule?: string | number | undefined;
122
122
  customAttributeKey?: string | undefined;
123
123
  customAttributeValueRule?: string | undefined;
124
124
  }[];
@@ -135,7 +135,7 @@ export declare const campaignToolDefinitions: readonly [{
135
135
  effect: "give_points" | "give_reward" | "deduct_unit" | "assign_member_custom_attribute" | "remove_member_custom_attribute";
136
136
  walletCode?: string | undefined;
137
137
  rewardId?: string | undefined;
138
- pointsRule?: string | undefined;
138
+ pointsRule?: string | number | undefined;
139
139
  customAttributeKey?: string | undefined;
140
140
  customAttributeValueRule?: string | undefined;
141
141
  }[];
@@ -148,15 +148,15 @@ export declare const campaignToolDefinitions: readonly [{
148
148
  target?: "self" | "referrer" | undefined;
149
149
  }>, "many">;
150
150
  visibility: import("zod").ZodOptional<import("zod").ZodObject<{
151
- target: import("zod").ZodEnum<["all", "tier", "segment"]>;
151
+ target: import("zod").ZodEnum<["none", "tier", "segment", "all"]>;
152
152
  tiers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
153
153
  segments: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
154
154
  }, "strip", import("zod").ZodTypeAny, {
155
- target: "all" | "tier" | "segment";
155
+ target: "all" | "none" | "tier" | "segment";
156
156
  tiers?: string[] | undefined;
157
157
  segments?: string[] | undefined;
158
158
  }, {
159
- target: "all" | "tier" | "segment";
159
+ target: "all" | "none" | "tier" | "segment";
160
160
  tiers?: string[] | undefined;
161
161
  segments?: string[] | undefined;
162
162
  }>>;
@@ -174,126 +174,237 @@ export declare const campaignToolDefinitions: readonly [{
174
174
  segments?: string[] | undefined;
175
175
  }>>;
176
176
  limits: import("zod").ZodOptional<import("zod").ZodObject<{
177
- points: import("zod").ZodOptional<import("zod").ZodObject<{
177
+ points: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
178
178
  value: import("zod").ZodNumber;
179
179
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
180
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
181
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
180
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
181
+ value: import("zod").ZodNumber;
182
182
  }, "strip", import("zod").ZodTypeAny, {
183
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
184
- value?: number | undefined;
183
+ value: number;
184
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
185
185
  }, {
186
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
187
- value?: number | undefined;
186
+ value: number;
187
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
188
188
  }>>;
189
189
  }, "strip", import("zod").ZodTypeAny, {
190
190
  value: number;
191
191
  interval?: {
192
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
193
- value?: number | undefined;
192
+ value: number;
193
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
194
194
  } | undefined;
195
195
  }, {
196
196
  value: number;
197
197
  interval?: {
198
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
199
- value?: number | undefined;
198
+ value: number;
199
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
200
200
  } | undefined;
201
- }>>;
202
- pointsPerMember: import("zod").ZodOptional<import("zod").ZodObject<{
201
+ }>, import("zod").ZodNumber]>>;
202
+ pointsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
203
203
  value: import("zod").ZodNumber;
204
204
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
205
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
206
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
205
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
206
+ value: import("zod").ZodNumber;
207
207
  }, "strip", import("zod").ZodTypeAny, {
208
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
209
- value?: number | undefined;
208
+ value: number;
209
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
210
210
  }, {
211
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
212
- value?: number | undefined;
211
+ value: number;
212
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
213
213
  }>>;
214
214
  }, "strip", import("zod").ZodTypeAny, {
215
215
  value: number;
216
216
  interval?: {
217
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
218
- value?: number | undefined;
217
+ value: number;
218
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
219
219
  } | undefined;
220
220
  }, {
221
221
  value: number;
222
222
  interval?: {
223
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
224
- value?: number | undefined;
223
+ value: number;
224
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
225
225
  } | undefined;
226
- }>>;
227
- executionsPerMember: import("zod").ZodOptional<import("zod").ZodObject<{
226
+ }>, import("zod").ZodNumber]>>;
227
+ executionsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
228
228
  value: import("zod").ZodNumber;
229
229
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
230
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
231
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
230
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
231
+ value: import("zod").ZodNumber;
232
232
  }, "strip", import("zod").ZodTypeAny, {
233
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
234
- value?: number | undefined;
233
+ value: number;
234
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
235
235
  }, {
236
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
237
- value?: number | undefined;
236
+ value: number;
237
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
238
238
  }>>;
239
239
  }, "strip", import("zod").ZodTypeAny, {
240
240
  value: number;
241
241
  interval?: {
242
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
243
- value?: number | undefined;
242
+ value: number;
243
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
244
244
  } | undefined;
245
245
  }, {
246
246
  value: number;
247
247
  interval?: {
248
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
249
- value?: number | undefined;
248
+ value: number;
249
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
250
250
  } | undefined;
251
- }>>;
252
- }, "strip", import("zod").ZodTypeAny, {
253
- points?: {
251
+ }>, import("zod").ZodNumber]>>;
252
+ perTransaction: import("zod").ZodOptional<import("zod").ZodUnknown>;
253
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
254
+ points: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
255
+ value: import("zod").ZodNumber;
256
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
257
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
258
+ value: import("zod").ZodNumber;
259
+ }, "strip", import("zod").ZodTypeAny, {
260
+ value: number;
261
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
262
+ }, {
263
+ value: number;
264
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
265
+ }>>;
266
+ }, "strip", import("zod").ZodTypeAny, {
254
267
  value: number;
255
268
  interval?: {
256
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
257
- value?: number | undefined;
269
+ value: number;
270
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
258
271
  } | undefined;
259
- } | undefined;
260
- pointsPerMember?: {
272
+ }, {
261
273
  value: number;
262
274
  interval?: {
263
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
264
- value?: number | undefined;
275
+ value: number;
276
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
265
277
  } | undefined;
266
- } | undefined;
267
- executionsPerMember?: {
278
+ }>, import("zod").ZodNumber]>>;
279
+ pointsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
280
+ value: import("zod").ZodNumber;
281
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
282
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
283
+ value: import("zod").ZodNumber;
284
+ }, "strip", import("zod").ZodTypeAny, {
285
+ value: number;
286
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
287
+ }, {
288
+ value: number;
289
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
290
+ }>>;
291
+ }, "strip", import("zod").ZodTypeAny, {
268
292
  value: number;
269
293
  interval?: {
270
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
271
- value?: number | undefined;
294
+ value: number;
295
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
272
296
  } | undefined;
273
- } | undefined;
274
- }, {
275
- points?: {
297
+ }, {
276
298
  value: number;
277
299
  interval?: {
278
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
279
- value?: number | undefined;
300
+ value: number;
301
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
280
302
  } | undefined;
281
- } | undefined;
282
- pointsPerMember?: {
303
+ }>, import("zod").ZodNumber]>>;
304
+ executionsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
305
+ value: import("zod").ZodNumber;
306
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
307
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
308
+ value: import("zod").ZodNumber;
309
+ }, "strip", import("zod").ZodTypeAny, {
310
+ value: number;
311
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
312
+ }, {
313
+ value: number;
314
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
315
+ }>>;
316
+ }, "strip", import("zod").ZodTypeAny, {
283
317
  value: number;
284
318
  interval?: {
285
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
286
- value?: number | undefined;
319
+ value: number;
320
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
287
321
  } | undefined;
288
- } | undefined;
289
- executionsPerMember?: {
322
+ }, {
290
323
  value: number;
291
324
  interval?: {
292
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
293
- value?: number | undefined;
325
+ value: number;
326
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
294
327
  } | undefined;
295
- } | undefined;
296
- }>>;
328
+ }>, import("zod").ZodNumber]>>;
329
+ perTransaction: import("zod").ZodOptional<import("zod").ZodUnknown>;
330
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
331
+ points: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
332
+ value: import("zod").ZodNumber;
333
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
334
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
335
+ value: import("zod").ZodNumber;
336
+ }, "strip", import("zod").ZodTypeAny, {
337
+ value: number;
338
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
339
+ }, {
340
+ value: number;
341
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
342
+ }>>;
343
+ }, "strip", import("zod").ZodTypeAny, {
344
+ value: number;
345
+ interval?: {
346
+ value: number;
347
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
348
+ } | undefined;
349
+ }, {
350
+ value: number;
351
+ interval?: {
352
+ value: number;
353
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
354
+ } | undefined;
355
+ }>, import("zod").ZodNumber]>>;
356
+ pointsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
357
+ value: import("zod").ZodNumber;
358
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
359
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
360
+ value: import("zod").ZodNumber;
361
+ }, "strip", import("zod").ZodTypeAny, {
362
+ value: number;
363
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
364
+ }, {
365
+ value: number;
366
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
367
+ }>>;
368
+ }, "strip", import("zod").ZodTypeAny, {
369
+ value: number;
370
+ interval?: {
371
+ value: number;
372
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
373
+ } | undefined;
374
+ }, {
375
+ value: number;
376
+ interval?: {
377
+ value: number;
378
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
379
+ } | undefined;
380
+ }>, import("zod").ZodNumber]>>;
381
+ executionsPerMember: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodObject<{
382
+ value: import("zod").ZodNumber;
383
+ interval: import("zod").ZodOptional<import("zod").ZodObject<{
384
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
385
+ value: import("zod").ZodNumber;
386
+ }, "strip", import("zod").ZodTypeAny, {
387
+ value: number;
388
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
389
+ }, {
390
+ value: number;
391
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
392
+ }>>;
393
+ }, "strip", import("zod").ZodTypeAny, {
394
+ value: number;
395
+ interval?: {
396
+ value: number;
397
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
398
+ } | undefined;
399
+ }, {
400
+ value: number;
401
+ interval?: {
402
+ value: number;
403
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
404
+ } | undefined;
405
+ }>, import("zod").ZodNumber]>>;
406
+ perTransaction: import("zod").ZodOptional<import("zod").ZodUnknown>;
407
+ }, import("zod").ZodTypeAny, "passthrough">>>;
297
408
  active: import("zod").ZodOptional<import("zod").ZodBoolean>;
298
409
  displayOrder: import("zod").ZodOptional<import("zod").ZodNumber>;
299
410
  labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
@@ -441,15 +552,15 @@ export declare const campaignToolDefinitions: readonly [{
441
552
  target?: "self" | "referrer" | undefined;
442
553
  }>, "many">;
443
554
  visibility: import("zod").ZodOptional<import("zod").ZodObject<{
444
- target: import("zod").ZodEnum<["all", "tier", "segment"]>;
555
+ target: import("zod").ZodEnum<["none", "tier", "segment"]>;
445
556
  tiers: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
446
557
  segments: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
447
558
  }, "strip", import("zod").ZodTypeAny, {
448
- target: "all" | "tier" | "segment";
559
+ target: "none" | "tier" | "segment";
449
560
  tiers?: string[] | undefined;
450
561
  segments?: string[] | undefined;
451
562
  }, {
452
- target: "all" | "tier" | "segment";
563
+ target: "none" | "tier" | "segment";
453
564
  tiers?: string[] | undefined;
454
565
  segments?: string[] | undefined;
455
566
  }>>;
@@ -470,120 +581,120 @@ export declare const campaignToolDefinitions: readonly [{
470
581
  points: import("zod").ZodOptional<import("zod").ZodObject<{
471
582
  value: import("zod").ZodNumber;
472
583
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
473
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
474
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
584
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
585
+ value: import("zod").ZodNumber;
475
586
  }, "strip", import("zod").ZodTypeAny, {
476
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
477
- value?: number | undefined;
587
+ value: number;
588
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
478
589
  }, {
479
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
480
- value?: number | undefined;
590
+ value: number;
591
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
481
592
  }>>;
482
593
  }, "strip", import("zod").ZodTypeAny, {
483
594
  value: number;
484
595
  interval?: {
485
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
486
- value?: number | undefined;
596
+ value: number;
597
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
487
598
  } | undefined;
488
599
  }, {
489
600
  value: number;
490
601
  interval?: {
491
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
492
- value?: number | undefined;
602
+ value: number;
603
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
493
604
  } | undefined;
494
605
  }>>;
495
606
  pointsPerMember: import("zod").ZodOptional<import("zod").ZodObject<{
496
607
  value: import("zod").ZodNumber;
497
608
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
498
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
499
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
609
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
610
+ value: import("zod").ZodNumber;
500
611
  }, "strip", import("zod").ZodTypeAny, {
501
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
502
- value?: number | undefined;
612
+ value: number;
613
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
503
614
  }, {
504
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
505
- value?: number | undefined;
615
+ value: number;
616
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
506
617
  }>>;
507
618
  }, "strip", import("zod").ZodTypeAny, {
508
619
  value: number;
509
620
  interval?: {
510
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
511
- value?: number | undefined;
621
+ value: number;
622
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
512
623
  } | undefined;
513
624
  }, {
514
625
  value: number;
515
626
  interval?: {
516
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
517
- value?: number | undefined;
627
+ value: number;
628
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
518
629
  } | undefined;
519
630
  }>>;
520
631
  executionsPerMember: import("zod").ZodOptional<import("zod").ZodObject<{
521
632
  value: import("zod").ZodNumber;
522
633
  interval: import("zod").ZodOptional<import("zod").ZodObject<{
523
- type: import("zod").ZodEnum<["calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
524
- value: import("zod").ZodOptional<import("zod").ZodNumber>;
634
+ type: import("zod").ZodEnum<["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"]>;
635
+ value: import("zod").ZodNumber;
525
636
  }, "strip", import("zod").ZodTypeAny, {
526
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
527
- value?: number | undefined;
637
+ value: number;
638
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
528
639
  }, {
529
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
530
- value?: number | undefined;
640
+ value: number;
641
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
531
642
  }>>;
532
643
  }, "strip", import("zod").ZodTypeAny, {
533
644
  value: number;
534
645
  interval?: {
535
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
536
- value?: number | undefined;
646
+ value: number;
647
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
537
648
  } | undefined;
538
649
  }, {
539
650
  value: number;
540
651
  interval?: {
541
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
542
- value?: number | undefined;
652
+ value: number;
653
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
543
654
  } | undefined;
544
655
  }>>;
545
656
  }, "strip", import("zod").ZodTypeAny, {
546
657
  points?: {
547
658
  value: number;
548
659
  interval?: {
549
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
550
- value?: number | undefined;
660
+ value: number;
661
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
551
662
  } | undefined;
552
663
  } | undefined;
553
664
  pointsPerMember?: {
554
665
  value: number;
555
666
  interval?: {
556
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
557
- value?: number | undefined;
667
+ value: number;
668
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
558
669
  } | undefined;
559
670
  } | undefined;
560
671
  executionsPerMember?: {
561
672
  value: number;
562
673
  interval?: {
563
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
564
- value?: number | undefined;
674
+ value: number;
675
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
565
676
  } | undefined;
566
677
  } | undefined;
567
678
  }, {
568
679
  points?: {
569
680
  value: number;
570
681
  interval?: {
571
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
572
- value?: number | undefined;
682
+ value: number;
683
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
573
684
  } | undefined;
574
685
  } | undefined;
575
686
  pointsPerMember?: {
576
687
  value: number;
577
688
  interval?: {
578
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
579
- value?: number | undefined;
689
+ value: number;
690
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
580
691
  } | undefined;
581
692
  } | undefined;
582
693
  executionsPerMember?: {
583
694
  value: number;
584
695
  interval?: {
585
- type: "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
586
- value?: number | undefined;
696
+ value: number;
697
+ type: "calendarHours" | "calendarDays" | "calendarWeeks" | "calendarMonths" | "calendarYears";
587
698
  } | undefined;
588
699
  } | undefined;
589
700
  }>>;
@@ -35,7 +35,10 @@ export const campaignToolDefinitions = [
35
35
  "For labels: { operator: 'has_at_least_one_label', attribute: 'transaction.labels', data: [{key: 'category', value: 'electronics'}] }. " +
36
36
  "For between: { operator: 'is_between', attribute: 'transaction.grossValue', data: {from: 50, to: 200} }. " +
37
37
  "AUDIENCE: OMIT entirely for all members. Do NOT pass audience: { target: 'all' } -- the API rejects 'all'. Only use audience for tier/segment targeting. " +
38
- "VISIBILITY vs AUDIENCE: visibility = who can see the campaign. audience = who can participate. Both accept target='tier' or 'segment'. OMIT audience for all members.",
38
+ "VISIBILITY vs AUDIENCE: visibility = who can see the campaign. audience = who can participate. " +
39
+ "Visibility accepts target='tier', 'segment', or 'none' (invisible to everyone). OMIT visibility for everyone. Legacy visibility target='all' is normalized by omitting visibility. " +
40
+ "Limits support only points, pointsPerMember, executionsPerMember. Do NOT use perTransaction; cap pointsRule for per-transaction point caps. " +
41
+ "Limit interval types: calendarHours, calendarDays, calendarWeeks, calendarMonths, calendarYears, and interval.value is required when interval is present.",
39
42
  readOnly: false,
40
43
  idempotent: false,
41
44
  inputSchema: CampaignCreateInputSchema,
@@ -0,0 +1,5 @@
1
+ import { CampaignCreateInput } from "./types.js";
2
+ export declare const VALID_LIMIT_INTERVAL_TYPES: readonly ["calendarHours", "calendarDays", "calendarWeeks", "calendarMonths", "calendarYears"];
3
+ export declare function normalizeCampaignRules(input: CampaignCreateInput["rules"]): CampaignCreateInput["rules"];
4
+ export declare function normalizeCampaignVisibility(visibility: CampaignCreateInput["visibility"]): CampaignCreateInput["visibility"];
5
+ export declare function normalizeCampaignLimits(input: CampaignCreateInput): Record<string, unknown> | undefined;
@@ -0,0 +1,50 @@
1
+ import { OpenLoyaltyError } from "../../utils/errors.js";
2
+ const SUPPORTED_LIMIT_KEYS = ["points", "pointsPerMember", "executionsPerMember"];
3
+ const SUPPORTED_LIMIT_KEY_SET = new Set(SUPPORTED_LIMIT_KEYS);
4
+ export const VALID_LIMIT_INTERVAL_TYPES = [
5
+ "calendarHours",
6
+ "calendarDays",
7
+ "calendarWeeks",
8
+ "calendarMonths",
9
+ "calendarYears",
10
+ ];
11
+ export function normalizeCampaignRules(input) {
12
+ return input.map((rule) => ({
13
+ ...rule,
14
+ effects: rule.effects?.map((effect) => ({
15
+ ...effect,
16
+ pointsRule: effect.pointsRule === undefined ? undefined : String(effect.pointsRule),
17
+ })),
18
+ }));
19
+ }
20
+ export function normalizeCampaignVisibility(visibility) {
21
+ if (!visibility || visibility.target === "all") {
22
+ return undefined;
23
+ }
24
+ return visibility;
25
+ }
26
+ export function normalizeCampaignLimits(input) {
27
+ const limits = input.limits;
28
+ if (!limits) {
29
+ return undefined;
30
+ }
31
+ const unsupportedKeys = Object.keys(limits).filter((key) => !SUPPORTED_LIMIT_KEY_SET.has(key));
32
+ if (unsupportedKeys.length > 0) {
33
+ throw new OpenLoyaltyError({
34
+ code: "INVALID_LIMITS",
35
+ message: `Unsupported campaign limit key: ${unsupportedKeys.join(", ")}`,
36
+ hint: "Campaign limits support only points, pointsPerMember, and executionsPerMember. " +
37
+ "Do not use perTransaction; for maximum points per transaction, cap the pointsRule expression, " +
38
+ "for example: '(transaction.grossValue * 2 >= 100) ? 100 : transaction.grossValue * 2'.",
39
+ relatedTool: "ol_campaign_create",
40
+ });
41
+ }
42
+ const normalized = {};
43
+ for (const key of SUPPORTED_LIMIT_KEYS) {
44
+ const value = limits[key];
45
+ if (value !== undefined) {
46
+ normalized[key] = typeof value === "number" ? { value } : value;
47
+ }
48
+ }
49
+ return normalized;
50
+ }