@open-loyalty/mcp-server 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/client/http.d.ts +5 -0
  2. package/dist/client/http.js +52 -3
  3. package/dist/config.d.ts +16 -2
  4. package/dist/config.js +28 -10
  5. package/dist/http.js +135 -62
  6. package/dist/server.js +8 -5
  7. package/dist/tools/achievement.d.ts +14 -0
  8. package/dist/tools/achievement.js +22 -15
  9. package/dist/tools/admin.d.ts +12 -0
  10. package/dist/tools/admin.js +12 -0
  11. package/dist/tools/analytics.d.ts +18 -0
  12. package/dist/tools/analytics.js +28 -19
  13. package/dist/tools/apikey.d.ts +7 -0
  14. package/dist/tools/apikey.js +7 -0
  15. package/dist/tools/audit.d.ts +4 -0
  16. package/dist/tools/audit.js +4 -0
  17. package/dist/tools/badge.d.ts +8 -0
  18. package/dist/tools/badge.js +13 -9
  19. package/dist/tools/campaign.d.ts +41 -16
  20. package/dist/tools/campaign.js +38 -25
  21. package/dist/tools/export.d.ts +8 -0
  22. package/dist/tools/export.js +13 -8
  23. package/dist/tools/import.d.ts +6 -0
  24. package/dist/tools/import.js +10 -6
  25. package/dist/tools/index.d.ts +3 -11
  26. package/dist/tools/index.js +4 -470
  27. package/dist/tools/member.d.ts +21 -0
  28. package/dist/tools/member.js +56 -62
  29. package/dist/tools/points.d.ts +12 -0
  30. package/dist/tools/points.js +30 -29
  31. package/dist/tools/reward.d.ts +18 -0
  32. package/dist/tools/reward.js +56 -66
  33. package/dist/tools/role.d.ts +20 -1
  34. package/dist/tools/role.js +13 -0
  35. package/dist/tools/segment.d.ts +19 -0
  36. package/dist/tools/segment.js +29 -19
  37. package/dist/tools/store.d.ts +8 -0
  38. package/dist/tools/store.js +8 -0
  39. package/dist/tools/tierset.d.ts +12 -0
  40. package/dist/tools/tierset.js +19 -13
  41. package/dist/tools/transaction.d.ts +12 -4
  42. package/dist/tools/transaction.js +13 -9
  43. package/dist/tools/wallet-type.d.ts +4 -0
  44. package/dist/tools/wallet-type.js +7 -5
  45. package/dist/tools/webhook.d.ts +17 -4
  46. package/dist/tools/webhook.js +58 -15
  47. package/dist/types/schemas/achievement.d.ts +0 -297
  48. package/dist/types/schemas/achievement.js +0 -13
  49. package/dist/types/schemas/admin.d.ts +10 -97
  50. package/dist/types/schemas/admin.js +0 -38
  51. package/dist/types/schemas/badge.d.ts +0 -37
  52. package/dist/types/schemas/badge.js +0 -11
  53. package/dist/types/schemas/campaign.d.ts +0 -648
  54. package/dist/types/schemas/campaign.js +0 -18
  55. package/dist/types/schemas/export.d.ts +0 -17
  56. package/dist/types/schemas/export.js +0 -7
  57. package/dist/types/schemas/member.d.ts +37 -176
  58. package/dist/types/schemas/member.js +0 -27
  59. package/dist/types/schemas/points.d.ts +0 -63
  60. package/dist/types/schemas/points.js +0 -22
  61. package/dist/types/schemas/reward.d.ts +0 -73
  62. package/dist/types/schemas/reward.js +0 -25
  63. package/dist/types/schemas/role.d.ts +0 -100
  64. package/dist/types/schemas/role.js +0 -29
  65. package/dist/types/schemas/segment.d.ts +0 -58
  66. package/dist/types/schemas/segment.js +0 -17
  67. package/dist/types/schemas/tierset.d.ts +0 -176
  68. package/dist/types/schemas/tierset.js +0 -27
  69. package/dist/types/schemas/transaction.d.ts +23 -254
  70. package/dist/types/schemas/transaction.js +0 -7
  71. package/dist/types/schemas/webhook.d.ts +0 -58
  72. package/dist/types/schemas/webhook.js +0 -12
  73. package/dist/utils/payload.d.ts +12 -0
  74. package/dist/utils/payload.js +14 -0
  75. package/package.json +3 -1
@@ -141,10 +141,8 @@ export declare const TransactionCustomerDataSchema: z.ZodObject<{
141
141
  address1?: string | undefined;
142
142
  }>>;
143
143
  }, "strip", z.ZodTypeAny, {
144
- name?: string | undefined;
145
144
  email?: string | undefined;
146
145
  phone?: string | undefined;
147
- loyaltyCardNumber?: string | undefined;
148
146
  address?: {
149
147
  street?: string | undefined;
150
148
  city?: string | undefined;
@@ -153,13 +151,13 @@ export declare const TransactionCustomerDataSchema: z.ZodObject<{
153
151
  province?: string | undefined;
154
152
  address1?: string | undefined;
155
153
  } | undefined;
154
+ loyaltyCardNumber?: string | undefined;
155
+ name?: string | undefined;
156
156
  customerId?: string | undefined;
157
157
  nip?: string | undefined;
158
158
  }, {
159
- name?: string | undefined;
160
159
  email?: string | undefined;
161
160
  phone?: string | undefined;
162
- loyaltyCardNumber?: string | undefined;
163
161
  address?: {
164
162
  street?: string | undefined;
165
163
  city?: string | undefined;
@@ -168,6 +166,8 @@ export declare const TransactionCustomerDataSchema: z.ZodObject<{
168
166
  province?: string | undefined;
169
167
  address1?: string | undefined;
170
168
  } | undefined;
169
+ loyaltyCardNumber?: string | undefined;
170
+ name?: string | undefined;
171
171
  customerId?: string | undefined;
172
172
  nip?: string | undefined;
173
173
  }>;
@@ -283,10 +283,8 @@ export declare const TransactionSchema: z.ZodObject<{
283
283
  address1?: string | undefined;
284
284
  }>>;
285
285
  }, "strip", z.ZodTypeAny, {
286
- name?: string | undefined;
287
286
  email?: string | undefined;
288
287
  phone?: string | undefined;
289
- loyaltyCardNumber?: string | undefined;
290
288
  address?: {
291
289
  street?: string | undefined;
292
290
  city?: string | undefined;
@@ -295,13 +293,13 @@ export declare const TransactionSchema: z.ZodObject<{
295
293
  province?: string | undefined;
296
294
  address1?: string | undefined;
297
295
  } | undefined;
296
+ loyaltyCardNumber?: string | undefined;
297
+ name?: string | undefined;
298
298
  customerId?: string | undefined;
299
299
  nip?: string | undefined;
300
300
  }, {
301
- name?: string | undefined;
302
301
  email?: string | undefined;
303
302
  phone?: string | undefined;
304
- loyaltyCardNumber?: string | undefined;
305
303
  address?: {
306
304
  street?: string | undefined;
307
305
  city?: string | undefined;
@@ -310,6 +308,8 @@ export declare const TransactionSchema: z.ZodObject<{
310
308
  province?: string | undefined;
311
309
  address1?: string | undefined;
312
310
  } | undefined;
311
+ loyaltyCardNumber?: string | undefined;
312
+ name?: string | undefined;
313
313
  customerId?: string | undefined;
314
314
  nip?: string | undefined;
315
315
  }>>;
@@ -349,10 +349,8 @@ export declare const TransactionSchema: z.ZodObject<{
349
349
  createdAt?: string | undefined;
350
350
  customerId?: string | undefined;
351
351
  customerData?: {
352
- name?: string | undefined;
353
352
  email?: string | undefined;
354
353
  phone?: string | undefined;
355
- loyaltyCardNumber?: string | undefined;
356
354
  address?: {
357
355
  street?: string | undefined;
358
356
  city?: string | undefined;
@@ -361,6 +359,8 @@ export declare const TransactionSchema: z.ZodObject<{
361
359
  province?: string | undefined;
362
360
  address1?: string | undefined;
363
361
  } | undefined;
362
+ loyaltyCardNumber?: string | undefined;
363
+ name?: string | undefined;
364
364
  customerId?: string | undefined;
365
365
  nip?: string | undefined;
366
366
  } | undefined;
@@ -396,10 +396,8 @@ export declare const TransactionSchema: z.ZodObject<{
396
396
  createdAt?: string | undefined;
397
397
  customerId?: string | undefined;
398
398
  customerData?: {
399
- name?: string | undefined;
400
399
  email?: string | undefined;
401
400
  phone?: string | undefined;
402
- loyaltyCardNumber?: string | undefined;
403
401
  address?: {
404
402
  street?: string | undefined;
405
403
  city?: string | undefined;
@@ -408,240 +406,12 @@ export declare const TransactionSchema: z.ZodObject<{
408
406
  province?: string | undefined;
409
407
  address1?: string | undefined;
410
408
  } | undefined;
411
- customerId?: string | undefined;
412
- nip?: string | undefined;
413
- } | undefined;
414
- pointsEarned?: number | undefined;
415
- }>;
416
- export declare const TransactionCreateInputSchema: z.ZodObject<{
417
- storeCode: z.ZodOptional<z.ZodString>;
418
- header: z.ZodObject<{
419
- documentNumber: z.ZodString;
420
- purchasedAt: z.ZodString;
421
- documentType: z.ZodOptional<z.ZodEnum<["sell", "return"]>>;
422
- linkedDocumentNumber: z.ZodOptional<z.ZodString>;
423
- purchasePlace: z.ZodOptional<z.ZodString>;
424
- labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
425
- key: z.ZodString;
426
- value: z.ZodString;
427
- }, "strip", z.ZodTypeAny, {
428
- value: string;
429
- key: string;
430
- }, {
431
- value: string;
432
- key: string;
433
- }>, "many">>;
434
- }, "strip", z.ZodTypeAny, {
435
- documentNumber: string;
436
- purchasedAt: string;
437
- documentType?: "sell" | "return" | undefined;
438
- linkedDocumentNumber?: string | undefined;
439
- purchasePlace?: string | undefined;
440
- labels?: {
441
- value: string;
442
- key: string;
443
- }[] | undefined;
444
- }, {
445
- documentNumber: string;
446
- purchasedAt: string;
447
- documentType?: "sell" | "return" | undefined;
448
- linkedDocumentNumber?: string | undefined;
449
- purchasePlace?: string | undefined;
450
- labels?: {
451
- value: string;
452
- key: string;
453
- }[] | undefined;
454
- }>;
455
- items: z.ZodArray<z.ZodObject<{
456
- sku: z.ZodString;
457
- name: z.ZodString;
458
- grossValue: z.ZodNumber;
459
- category: z.ZodString;
460
- quantity: z.ZodOptional<z.ZodNumber>;
461
- highPrecisionQuantity: z.ZodOptional<z.ZodNumber>;
462
- maker: z.ZodOptional<z.ZodString>;
463
- labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
464
- key: z.ZodString;
465
- value: z.ZodString;
466
- }, "strip", z.ZodTypeAny, {
467
- value: string;
468
- key: string;
469
- }, {
470
- value: string;
471
- key: string;
472
- }>, "many">>;
473
- }, "strip", z.ZodTypeAny, {
474
- name: string;
475
- sku: string;
476
- grossValue: number;
477
- category: string;
478
- quantity?: number | undefined;
479
- labels?: {
480
- value: string;
481
- key: string;
482
- }[] | undefined;
483
- highPrecisionQuantity?: number | undefined;
484
- maker?: string | undefined;
485
- }, {
486
- name: string;
487
- sku: string;
488
- grossValue: number;
489
- category: string;
490
- quantity?: number | undefined;
491
- labels?: {
492
- value: string;
493
- key: string;
494
- }[] | undefined;
495
- highPrecisionQuantity?: number | undefined;
496
- maker?: string | undefined;
497
- }>, "many">;
498
- customerData: z.ZodOptional<z.ZodObject<{
499
- customerId: z.ZodOptional<z.ZodString>;
500
- email: z.ZodOptional<z.ZodString>;
501
- name: z.ZodOptional<z.ZodString>;
502
- phone: z.ZodOptional<z.ZodString>;
503
- loyaltyCardNumber: z.ZodOptional<z.ZodString>;
504
- nip: z.ZodOptional<z.ZodString>;
505
- address: z.ZodOptional<z.ZodObject<{
506
- street: z.ZodOptional<z.ZodString>;
507
- address1: z.ZodOptional<z.ZodString>;
508
- province: z.ZodOptional<z.ZodString>;
509
- city: z.ZodOptional<z.ZodString>;
510
- postal: z.ZodOptional<z.ZodString>;
511
- country: z.ZodOptional<z.ZodString>;
512
- }, "strip", z.ZodTypeAny, {
513
- street?: string | undefined;
514
- city?: string | undefined;
515
- postal?: string | undefined;
516
- country?: string | undefined;
517
- province?: string | undefined;
518
- address1?: string | undefined;
519
- }, {
520
- street?: string | undefined;
521
- city?: string | undefined;
522
- postal?: string | undefined;
523
- country?: string | undefined;
524
- province?: string | undefined;
525
- address1?: string | undefined;
526
- }>>;
527
- }, "strip", z.ZodTypeAny, {
528
- name?: string | undefined;
529
- email?: string | undefined;
530
- phone?: string | undefined;
531
- loyaltyCardNumber?: string | undefined;
532
- address?: {
533
- street?: string | undefined;
534
- city?: string | undefined;
535
- postal?: string | undefined;
536
- country?: string | undefined;
537
- province?: string | undefined;
538
- address1?: string | undefined;
539
- } | undefined;
540
- customerId?: string | undefined;
541
- nip?: string | undefined;
542
- }, {
543
- name?: string | undefined;
544
- email?: string | undefined;
545
- phone?: string | undefined;
546
409
  loyaltyCardNumber?: string | undefined;
547
- address?: {
548
- street?: string | undefined;
549
- city?: string | undefined;
550
- postal?: string | undefined;
551
- country?: string | undefined;
552
- province?: string | undefined;
553
- address1?: string | undefined;
554
- } | undefined;
555
- customerId?: string | undefined;
556
- nip?: string | undefined;
557
- }>>;
558
- channelId: z.ZodOptional<z.ZodString>;
559
- }, "strip", z.ZodTypeAny, {
560
- items: {
561
- name: string;
562
- sku: string;
563
- grossValue: number;
564
- category: string;
565
- quantity?: number | undefined;
566
- labels?: {
567
- value: string;
568
- key: string;
569
- }[] | undefined;
570
- highPrecisionQuantity?: number | undefined;
571
- maker?: string | undefined;
572
- }[];
573
- header: {
574
- documentNumber: string;
575
- purchasedAt: string;
576
- documentType?: "sell" | "return" | undefined;
577
- linkedDocumentNumber?: string | undefined;
578
- purchasePlace?: string | undefined;
579
- labels?: {
580
- value: string;
581
- key: string;
582
- }[] | undefined;
583
- };
584
- storeCode?: string | undefined;
585
- customerData?: {
586
- name?: string | undefined;
587
- email?: string | undefined;
588
- phone?: string | undefined;
589
- loyaltyCardNumber?: string | undefined;
590
- address?: {
591
- street?: string | undefined;
592
- city?: string | undefined;
593
- postal?: string | undefined;
594
- country?: string | undefined;
595
- province?: string | undefined;
596
- address1?: string | undefined;
597
- } | undefined;
598
- customerId?: string | undefined;
599
- nip?: string | undefined;
600
- } | undefined;
601
- channelId?: string | undefined;
602
- }, {
603
- items: {
604
- name: string;
605
- sku: string;
606
- grossValue: number;
607
- category: string;
608
- quantity?: number | undefined;
609
- labels?: {
610
- value: string;
611
- key: string;
612
- }[] | undefined;
613
- highPrecisionQuantity?: number | undefined;
614
- maker?: string | undefined;
615
- }[];
616
- header: {
617
- documentNumber: string;
618
- purchasedAt: string;
619
- documentType?: "sell" | "return" | undefined;
620
- linkedDocumentNumber?: string | undefined;
621
- purchasePlace?: string | undefined;
622
- labels?: {
623
- value: string;
624
- key: string;
625
- }[] | undefined;
626
- };
627
- storeCode?: string | undefined;
628
- customerData?: {
629
410
  name?: string | undefined;
630
- email?: string | undefined;
631
- phone?: string | undefined;
632
- loyaltyCardNumber?: string | undefined;
633
- address?: {
634
- street?: string | undefined;
635
- city?: string | undefined;
636
- postal?: string | undefined;
637
- country?: string | undefined;
638
- province?: string | undefined;
639
- address1?: string | undefined;
640
- } | undefined;
641
411
  customerId?: string | undefined;
642
412
  nip?: string | undefined;
643
413
  } | undefined;
644
- channelId?: string | undefined;
414
+ pointsEarned?: number | undefined;
645
415
  }>;
646
416
  export declare const TransactionListResponseSchema: z.ZodObject<{
647
417
  items: z.ZodArray<z.ZodObject<{
@@ -756,10 +526,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
756
526
  address1?: string | undefined;
757
527
  }>>;
758
528
  }, "strip", z.ZodTypeAny, {
759
- name?: string | undefined;
760
529
  email?: string | undefined;
761
530
  phone?: string | undefined;
762
- loyaltyCardNumber?: string | undefined;
763
531
  address?: {
764
532
  street?: string | undefined;
765
533
  city?: string | undefined;
@@ -768,13 +536,13 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
768
536
  province?: string | undefined;
769
537
  address1?: string | undefined;
770
538
  } | undefined;
539
+ loyaltyCardNumber?: string | undefined;
540
+ name?: string | undefined;
771
541
  customerId?: string | undefined;
772
542
  nip?: string | undefined;
773
543
  }, {
774
- name?: string | undefined;
775
544
  email?: string | undefined;
776
545
  phone?: string | undefined;
777
- loyaltyCardNumber?: string | undefined;
778
546
  address?: {
779
547
  street?: string | undefined;
780
548
  city?: string | undefined;
@@ -783,6 +551,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
783
551
  province?: string | undefined;
784
552
  address1?: string | undefined;
785
553
  } | undefined;
554
+ loyaltyCardNumber?: string | undefined;
555
+ name?: string | undefined;
786
556
  customerId?: string | undefined;
787
557
  nip?: string | undefined;
788
558
  }>>;
@@ -822,10 +592,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
822
592
  createdAt?: string | undefined;
823
593
  customerId?: string | undefined;
824
594
  customerData?: {
825
- name?: string | undefined;
826
595
  email?: string | undefined;
827
596
  phone?: string | undefined;
828
- loyaltyCardNumber?: string | undefined;
829
597
  address?: {
830
598
  street?: string | undefined;
831
599
  city?: string | undefined;
@@ -834,6 +602,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
834
602
  province?: string | undefined;
835
603
  address1?: string | undefined;
836
604
  } | undefined;
605
+ loyaltyCardNumber?: string | undefined;
606
+ name?: string | undefined;
837
607
  customerId?: string | undefined;
838
608
  nip?: string | undefined;
839
609
  } | undefined;
@@ -869,10 +639,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
869
639
  createdAt?: string | undefined;
870
640
  customerId?: string | undefined;
871
641
  customerData?: {
872
- name?: string | undefined;
873
642
  email?: string | undefined;
874
643
  phone?: string | undefined;
875
- loyaltyCardNumber?: string | undefined;
876
644
  address?: {
877
645
  street?: string | undefined;
878
646
  city?: string | undefined;
@@ -881,6 +649,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
881
649
  province?: string | undefined;
882
650
  address1?: string | undefined;
883
651
  } | undefined;
652
+ loyaltyCardNumber?: string | undefined;
653
+ name?: string | undefined;
884
654
  customerId?: string | undefined;
885
655
  nip?: string | undefined;
886
656
  } | undefined;
@@ -931,10 +701,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
931
701
  createdAt?: string | undefined;
932
702
  customerId?: string | undefined;
933
703
  customerData?: {
934
- name?: string | undefined;
935
704
  email?: string | undefined;
936
705
  phone?: string | undefined;
937
- loyaltyCardNumber?: string | undefined;
938
706
  address?: {
939
707
  street?: string | undefined;
940
708
  city?: string | undefined;
@@ -943,6 +711,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
943
711
  province?: string | undefined;
944
712
  address1?: string | undefined;
945
713
  } | undefined;
714
+ loyaltyCardNumber?: string | undefined;
715
+ name?: string | undefined;
946
716
  customerId?: string | undefined;
947
717
  nip?: string | undefined;
948
718
  } | undefined;
@@ -987,10 +757,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
987
757
  createdAt?: string | undefined;
988
758
  customerId?: string | undefined;
989
759
  customerData?: {
990
- name?: string | undefined;
991
760
  email?: string | undefined;
992
761
  phone?: string | undefined;
993
- loyaltyCardNumber?: string | undefined;
994
762
  address?: {
995
763
  street?: string | undefined;
996
764
  city?: string | undefined;
@@ -999,6 +767,8 @@ export declare const TransactionListResponseSchema: z.ZodObject<{
999
767
  province?: string | undefined;
1000
768
  address1?: string | undefined;
1001
769
  } | undefined;
770
+ loyaltyCardNumber?: string | undefined;
771
+ name?: string | undefined;
1002
772
  customerId?: string | undefined;
1003
773
  nip?: string | undefined;
1004
774
  } | undefined;
@@ -1018,5 +788,4 @@ export type TransactionItem = z.infer<typeof TransactionItemSchema>;
1018
788
  export type TransactionAddress = z.infer<typeof TransactionAddressSchema>;
1019
789
  export type TransactionCustomerData = z.infer<typeof TransactionCustomerDataSchema>;
1020
790
  export type Transaction = z.infer<typeof TransactionSchema>;
1021
- export type TransactionCreateInput = z.infer<typeof TransactionCreateInputSchema>;
1022
791
  export type TransactionListResponse = z.infer<typeof TransactionListResponseSchema>;
@@ -50,13 +50,6 @@ export const TransactionSchema = z.object({
50
50
  pointsEarned: z.number().optional(),
51
51
  createdAt: z.string().optional(),
52
52
  });
53
- export const TransactionCreateInputSchema = z.object({
54
- storeCode: z.string().optional(),
55
- header: TransactionHeaderSchema,
56
- items: z.array(TransactionItemSchema),
57
- customerData: TransactionCustomerDataSchema.optional(),
58
- channelId: z.string().optional(),
59
- });
60
53
  export const TransactionListResponseSchema = z.object({
61
54
  items: z.array(TransactionSchema),
62
55
  total: TotalSchema,
@@ -45,64 +45,6 @@ export declare const WebhookSubscriptionSchema: z.ZodObject<{
45
45
  createdAt?: string | undefined;
46
46
  }>;
47
47
  export type WebhookSubscription = z.infer<typeof WebhookSubscriptionSchema>;
48
- export declare const WebhookSubscriptionCreateInputSchema: z.ZodObject<{
49
- eventName: z.ZodString;
50
- url: z.ZodString;
51
- headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
- headerName: z.ZodString;
53
- headerValue: z.ZodString;
54
- }, "strip", z.ZodTypeAny, {
55
- headerName: string;
56
- headerValue: string;
57
- }, {
58
- headerName: string;
59
- headerValue: string;
60
- }>, "many">>;
61
- }, "strip", z.ZodTypeAny, {
62
- url: string;
63
- eventName: string;
64
- headers?: {
65
- headerName: string;
66
- headerValue: string;
67
- }[] | undefined;
68
- }, {
69
- url: string;
70
- eventName: string;
71
- headers?: {
72
- headerName: string;
73
- headerValue: string;
74
- }[] | undefined;
75
- }>;
76
- export type WebhookSubscriptionCreateInput = z.infer<typeof WebhookSubscriptionCreateInputSchema>;
77
- export declare const WebhookSubscriptionUpdateInputSchema: z.ZodObject<{
78
- eventName: z.ZodOptional<z.ZodString>;
79
- url: z.ZodOptional<z.ZodString>;
80
- headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
81
- headerName: z.ZodString;
82
- headerValue: z.ZodString;
83
- }, "strip", z.ZodTypeAny, {
84
- headerName: string;
85
- headerValue: string;
86
- }, {
87
- headerName: string;
88
- headerValue: string;
89
- }>, "many">>;
90
- }, "strip", z.ZodTypeAny, {
91
- headers?: {
92
- headerName: string;
93
- headerValue: string;
94
- }[] | undefined;
95
- url?: string | undefined;
96
- eventName?: string | undefined;
97
- }, {
98
- headers?: {
99
- headerName: string;
100
- headerValue: string;
101
- }[] | undefined;
102
- url?: string | undefined;
103
- eventName?: string | undefined;
104
- }>;
105
- export type WebhookSubscriptionUpdateInput = z.infer<typeof WebhookSubscriptionUpdateInputSchema>;
106
48
  export declare const WebhookEventTypesSchema: z.ZodObject<{
107
49
  items: z.ZodArray<z.ZodString, "many">;
108
50
  }, "strip", z.ZodTypeAny, {
@@ -12,18 +12,6 @@ export const WebhookSubscriptionSchema = z.object({
12
12
  headers: z.array(WebhookHeaderSchema).optional().describe("Custom headers to include in webhook requests."),
13
13
  createdAt: z.string().optional().describe("Creation timestamp (ISO format)."),
14
14
  });
15
- // Input schema for creating a webhook subscription
16
- export const WebhookSubscriptionCreateInputSchema = z.object({
17
- eventName: z.string().describe("Event name to subscribe to. Use webhook_events to discover available events."),
18
- url: z.string().describe("URL to receive webhook events."),
19
- headers: z.array(WebhookHeaderSchema).optional().describe("Custom headers to include in webhook requests."),
20
- });
21
- // Input schema for updating a webhook subscription
22
- export const WebhookSubscriptionUpdateInputSchema = z.object({
23
- eventName: z.string().optional().describe("Event name to subscribe to."),
24
- url: z.string().optional().describe("URL to receive webhook events."),
25
- headers: z.array(WebhookHeaderSchema).optional().describe("Custom headers to include in webhook requests."),
26
- });
27
15
  // Response schema for webhook event types list
28
16
  export const WebhookEventTypesSchema = z.object({
29
17
  items: z.array(z.string()).describe("List of available webhook event type names."),
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Removes undefined values from an object.
3
+ * Useful for building API payloads where undefined fields should be omitted.
4
+ *
5
+ * Note: Only filters top-level undefined values. Nested objects are passed through as-is.
6
+ * Falsy values (false, 0, '', null) are preserved - only undefined is removed.
7
+ *
8
+ * @example
9
+ * omitUndefined({ a: 1, b: undefined, c: false, d: '' })
10
+ * // Returns: { a: 1, c: false, d: '' }
11
+ */
12
+ export declare function omitUndefined<T extends Record<string, unknown>>(obj: T): Partial<T>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Removes undefined values from an object.
3
+ * Useful for building API payloads where undefined fields should be omitted.
4
+ *
5
+ * Note: Only filters top-level undefined values. Nested objects are passed through as-is.
6
+ * Falsy values (false, 0, '', null) are preserved - only undefined is removed.
7
+ *
8
+ * @example
9
+ * omitUndefined({ a: 1, b: undefined, c: false, d: '' })
10
+ * // Returns: { a: 1, c: false, d: '' }
11
+ */
12
+ export function omitUndefined(obj) {
13
+ return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined));
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-loyalty/mcp-server",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "description": "MCP server for Open Loyalty API - enables AI agents to manage loyalty programs, members, points, rewards, and transactions",
6
6
  "author": "Marcin Dyguda <md@openloyalty.io>",
@@ -44,6 +44,8 @@
44
44
  "cors": "^2.8.5",
45
45
  "dotenv": "^17.2.3",
46
46
  "express": "^5.2.1",
47
+ "express-rate-limit": "^8.2.1",
48
+ "helmet": "^8.1.0",
47
49
  "ioredis": "^5.9.2",
48
50
  "zod": "^3.22.0"
49
51
  },