@kl1/contracts 1.3.4 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,7 +50,7 @@ export declare const chatContract: {
50
50
  firstResponseTime: z.ZodNumber;
51
51
  isLatest: z.ZodBoolean;
52
52
  isBotRoom: z.ZodBoolean;
53
- direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
53
+ direction: z.ZodEnum<[string, ...string[]]>;
54
54
  platformContact: z.ZodObject<{
55
55
  id: z.ZodString;
56
56
  createdAt: z.ZodDate;
@@ -2735,7 +2735,7 @@ export declare const chatContract: {
2735
2735
  integrationId: string;
2736
2736
  } | null;
2737
2737
  };
2738
- direction: "incoming" | "outgoing" | "system";
2738
+ direction: string;
2739
2739
  status: number;
2740
2740
  createdAt: Date;
2741
2741
  updatedAt: Date;
@@ -3164,7 +3164,7 @@ export declare const chatContract: {
3164
3164
  integrationId: string;
3165
3165
  } | null;
3166
3166
  };
3167
- direction: "incoming" | "outgoing" | "system";
3167
+ direction: string;
3168
3168
  status: number;
3169
3169
  createdAt: Date;
3170
3170
  updatedAt: Date;
@@ -3595,7 +3595,7 @@ export declare const chatContract: {
3595
3595
  integrationId: string;
3596
3596
  } | null;
3597
3597
  };
3598
- direction: "incoming" | "outgoing" | "system";
3598
+ direction: string;
3599
3599
  status: number;
3600
3600
  createdAt: Date;
3601
3601
  updatedAt: Date;
@@ -4027,7 +4027,7 @@ export declare const chatContract: {
4027
4027
  integrationId: string;
4028
4028
  } | null;
4029
4029
  };
4030
- direction: "incoming" | "outgoing" | "system";
4030
+ direction: string;
4031
4031
  status: number;
4032
4032
  createdAt: Date;
4033
4033
  updatedAt: Date;
@@ -4377,15 +4377,15 @@ export declare const chatContract: {
4377
4377
  body: z.ZodObject<{
4378
4378
  roomId: z.ZodString;
4379
4379
  message: z.ZodString;
4380
- messageType: z.ZodDefault<z.ZodEnum<["text", "image"]>>;
4380
+ messageType: z.ZodDefault<z.ZodEnum<[string, ...string[]]>>;
4381
4381
  }, "strip", z.ZodTypeAny, {
4382
4382
  message: string;
4383
- messageType: "image" | "text";
4383
+ messageType: string;
4384
4384
  roomId: string;
4385
4385
  }, {
4386
4386
  message: string;
4387
4387
  roomId: string;
4388
- messageType?: "image" | "text" | undefined;
4388
+ messageType?: string | undefined;
4389
4389
  }>;
4390
4390
  summary: "send auto reply message";
4391
4391
  method: "POST";
@@ -4411,8 +4411,8 @@ export declare const chatContract: {
4411
4411
  deletedAt: z.ZodNullable<z.ZodDate>;
4412
4412
  }, {
4413
4413
  message: z.ZodString;
4414
- direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
4415
- type: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
4414
+ direction: z.ZodEnum<[string, ...string[]]>;
4415
+ type: z.ZodEnum<[string, ...string[]]>;
4416
4416
  readAt: z.ZodDate;
4417
4417
  metadata: z.ZodAny;
4418
4418
  platformId: z.ZodString;
@@ -4439,7 +4439,7 @@ export declare const chatContract: {
4439
4439
  firstResponseTime: z.ZodNumber;
4440
4440
  isLatest: z.ZodBoolean;
4441
4441
  isBotRoom: z.ZodBoolean;
4442
- direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
4442
+ direction: z.ZodEnum<[string, ...string[]]>;
4443
4443
  platformContact: z.ZodObject<{
4444
4444
  id: z.ZodString;
4445
4445
  createdAt: z.ZodDate;
@@ -7124,7 +7124,7 @@ export declare const chatContract: {
7124
7124
  integrationId: string;
7125
7125
  } | null;
7126
7126
  };
7127
- direction: "incoming" | "outgoing" | "system";
7127
+ direction: string;
7128
7128
  status: number;
7129
7129
  createdAt: Date;
7130
7130
  updatedAt: Date;
@@ -7553,7 +7553,7 @@ export declare const chatContract: {
7553
7553
  integrationId: string;
7554
7554
  } | null;
7555
7555
  };
7556
- direction: "incoming" | "outgoing" | "system";
7556
+ direction: string;
7557
7557
  status: number;
7558
7558
  createdAt: Date;
7559
7559
  updatedAt: Date;
@@ -7927,8 +7927,8 @@ export declare const chatContract: {
7927
7927
  deletedAt: z.ZodNullable<z.ZodDate>;
7928
7928
  }, {
7929
7929
  message: z.ZodString;
7930
- direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
7931
- type: z.ZodUnion<[z.ZodLiteral<string>, z.ZodLiteral<string>, ...z.ZodLiteral<string>[]]>;
7930
+ direction: z.ZodEnum<[string, ...string[]]>;
7931
+ type: z.ZodEnum<[string, ...string[]]>;
7932
7932
  readAt: z.ZodDate;
7933
7933
  metadata: z.ZodAny;
7934
7934
  platformId: z.ZodString;
@@ -8594,7 +8594,7 @@ export declare const chatContract: {
8594
8594
  message: string;
8595
8595
  id: string;
8596
8596
  url: string;
8597
- direction: "incoming" | "outgoing" | "system";
8597
+ direction: string;
8598
8598
  createdAt: Date;
8599
8599
  updatedAt: Date;
8600
8600
  deletedAt: Date | null;
@@ -8756,7 +8756,7 @@ export declare const chatContract: {
8756
8756
  message: string;
8757
8757
  id: string;
8758
8758
  url: string;
8759
- direction: "incoming" | "outgoing" | "system";
8759
+ direction: string;
8760
8760
  createdAt: Date;
8761
8761
  updatedAt: Date;
8762
8762
  deletedAt: Date | null;
@@ -9559,7 +9559,7 @@ export declare const chatContract: {
9559
9559
  message: string;
9560
9560
  id: string;
9561
9561
  url: string;
9562
- direction: "incoming" | "outgoing" | "system";
9562
+ direction: string;
9563
9563
  createdAt: Date;
9564
9564
  updatedAt: Date;
9565
9565
  deletedAt: Date | null;
@@ -9762,7 +9762,7 @@ export declare const chatContract: {
9762
9762
  integrationId: string;
9763
9763
  } | null;
9764
9764
  };
9765
- direction: "incoming" | "outgoing" | "system";
9765
+ direction: string;
9766
9766
  status: number;
9767
9767
  createdAt: Date;
9768
9768
  updatedAt: Date;
@@ -10114,7 +10114,7 @@ export declare const chatContract: {
10114
10114
  message: string;
10115
10115
  id: string;
10116
10116
  url: string;
10117
- direction: "incoming" | "outgoing" | "system";
10117
+ direction: string;
10118
10118
  createdAt: Date;
10119
10119
  updatedAt: Date;
10120
10120
  deletedAt: Date | null;
@@ -10325,7 +10325,7 @@ export declare const chatContract: {
10325
10325
  message: string;
10326
10326
  id: string;
10327
10327
  url: string;
10328
- direction: "incoming" | "outgoing" | "system";
10328
+ direction: string;
10329
10329
  createdAt: Date;
10330
10330
  updatedAt: Date;
10331
10331
  deletedAt: Date | null;
@@ -10528,7 +10528,7 @@ export declare const chatContract: {
10528
10528
  integrationId: string;
10529
10529
  } | null;
10530
10530
  };
10531
- direction: "incoming" | "outgoing" | "system";
10531
+ direction: string;
10532
10532
  status: number;
10533
10533
  createdAt: Date;
10534
10534
  updatedAt: Date;
@@ -10880,7 +10880,7 @@ export declare const chatContract: {
10880
10880
  message: string;
10881
10881
  id: string;
10882
10882
  url: string;
10883
- direction: "incoming" | "outgoing" | "system";
10883
+ direction: string;
10884
10884
  createdAt: Date;
10885
10885
  updatedAt: Date;
10886
10886
  deletedAt: Date | null;
@@ -11093,7 +11093,7 @@ export declare const chatContract: {
11093
11093
  message: string;
11094
11094
  id: string;
11095
11095
  url: string;
11096
- direction: "incoming" | "outgoing" | "system";
11096
+ direction: string;
11097
11097
  createdAt: Date;
11098
11098
  updatedAt: Date;
11099
11099
  deletedAt: Date | null;
@@ -11296,7 +11296,7 @@ export declare const chatContract: {
11296
11296
  integrationId: string;
11297
11297
  } | null;
11298
11298
  };
11299
- direction: "incoming" | "outgoing" | "system";
11299
+ direction: string;
11300
11300
  status: number;
11301
11301
  createdAt: Date;
11302
11302
  updatedAt: Date;
@@ -11648,7 +11648,7 @@ export declare const chatContract: {
11648
11648
  message: string;
11649
11649
  id: string;
11650
11650
  url: string;
11651
- direction: "incoming" | "outgoing" | "system";
11651
+ direction: string;
11652
11652
  createdAt: Date;
11653
11653
  updatedAt: Date;
11654
11654
  deletedAt: Date | null;
@@ -11862,7 +11862,7 @@ export declare const chatContract: {
11862
11862
  message: string;
11863
11863
  id: string;
11864
11864
  url: string;
11865
- direction: "incoming" | "outgoing" | "system";
11865
+ direction: string;
11866
11866
  createdAt: Date;
11867
11867
  updatedAt: Date;
11868
11868
  deletedAt: Date | null;
@@ -12065,7 +12065,7 @@ export declare const chatContract: {
12065
12065
  integrationId: string;
12066
12066
  } | null;
12067
12067
  };
12068
- direction: "incoming" | "outgoing" | "system";
12068
+ direction: string;
12069
12069
  status: number;
12070
12070
  createdAt: Date;
12071
12071
  updatedAt: Date;
@@ -12417,7 +12417,7 @@ export declare const chatContract: {
12417
12417
  message: string;
12418
12418
  id: string;
12419
12419
  url: string;
12420
- direction: "incoming" | "outgoing" | "system";
12420
+ direction: string;
12421
12421
  createdAt: Date;
12422
12422
  updatedAt: Date;
12423
12423
  deletedAt: Date | null;
@@ -12685,7 +12685,7 @@ export declare const chatContract: {
12685
12685
  firstResponseTime: z.ZodNumber;
12686
12686
  isLatest: z.ZodBoolean;
12687
12687
  isBotRoom: z.ZodBoolean;
12688
- direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
12688
+ direction: z.ZodEnum<[string, ...string[]]>;
12689
12689
  platformContact: z.ZodObject<{
12690
12690
  id: z.ZodString;
12691
12691
  createdAt: z.ZodDate;
@@ -15372,7 +15372,7 @@ export declare const chatContract: {
15372
15372
  integrationId: string;
15373
15373
  } | null;
15374
15374
  };
15375
- direction: "incoming" | "outgoing" | "system";
15375
+ direction: string;
15376
15376
  status: number;
15377
15377
  createdAt: Date;
15378
15378
  updatedAt: Date;
@@ -15802,7 +15802,7 @@ export declare const chatContract: {
15802
15802
  integrationId: string;
15803
15803
  } | null;
15804
15804
  };
15805
- direction: "incoming" | "outgoing" | "system";
15805
+ direction: string;
15806
15806
  status: number;
15807
15807
  createdAt: Date;
15808
15808
  updatedAt: Date;
@@ -16234,7 +16234,7 @@ export declare const chatContract: {
16234
16234
  integrationId: string;
16235
16235
  } | null;
16236
16236
  };
16237
- direction: "incoming" | "outgoing" | "system";
16237
+ direction: string;
16238
16238
  status: number;
16239
16239
  createdAt: Date;
16240
16240
  updatedAt: Date;
@@ -16667,7 +16667,7 @@ export declare const chatContract: {
16667
16667
  integrationId: string;
16668
16668
  } | null;
16669
16669
  };
16670
- direction: "incoming" | "outgoing" | "system";
16670
+ direction: string;
16671
16671
  status: number;
16672
16672
  createdAt: Date;
16673
16673
  updatedAt: Date;
package/dist/index.js CHANGED
@@ -99,7 +99,6 @@ __export(index_exports, {
99
99
  userContract: () => userContract,
100
100
  userNotificationContract: () => userNotificationContract,
101
101
  userPresenceStatusLogContract: () => userPresenceStatusLogContract,
102
- widgetContract: () => widgetContract,
103
102
  widgetSettingContract: () => widgetSettingContract,
104
103
  workflowContract: () => workflowContract,
105
104
  wrapUpFormContract: () => wrapUpFormContract
@@ -717,64 +716,72 @@ var WorkflowRuleSchema = DefaultEntitySchema.extend({
717
716
  });
718
717
 
719
718
  // src/chat/schema.ts
720
- var MessageDirectionTypeSchema = import_zod18.default.union([
721
- import_zod18.default.literal("incoming"),
722
- import_zod18.default.literal("outgoing"),
723
- import_zod18.default.literal("system")
724
- ]);
725
- var WorkflowAutoReplyMessageTypeSchema = import_zod18.default.enum(["text", "image"]).default("text");
719
+ var messageDirections = [
720
+ "incoming",
721
+ "outgoing",
722
+ "system"
723
+ ];
724
+ var MessageDirectionTypeSchema = import_zod18.default.enum(messageDirections);
725
+ var workflowAutoReplyMessageTypes = ["text", "image"];
726
+ var WorkflowAutoReplyMessageTypeSchema = import_zod18.default.enum(workflowAutoReplyMessageTypes).default("text");
726
727
  var messageTypes = [
727
- import_zod18.default.literal("text"),
728
- import_zod18.default.literal("image"),
729
- import_zod18.default.literal("video"),
730
- import_zod18.default.literal("audio"),
731
- import_zod18.default.literal("file"),
732
- import_zod18.default.literal("imagemap"),
733
- import_zod18.default.literal("group"),
734
- import_zod18.default.literal("fallback"),
735
- import_zod18.default.literal("location"),
736
- import_zod18.default.literal("sticker"),
728
+ "text",
729
+ "image",
730
+ "video",
731
+ "audio",
732
+ "file",
733
+ "imagemap",
734
+ "group",
735
+ "fallback",
736
+ "location",
737
+ "sticker",
737
738
  // botpress specific
738
- import_zod18.default.literal("carousel"),
739
- import_zod18.default.literal("card"),
740
- import_zod18.default.literal("choice"),
741
- import_zod18.default.literal("dropdown"),
742
- import_zod18.default.literal("text_with_image"),
743
- import_zod18.default.literal("reaction"),
744
- import_zod18.default.literal("contacts"),
739
+ "carousel",
740
+ "card",
741
+ "choice",
742
+ "dropdown",
743
+ "text_with_image",
744
+ "reaction",
745
+ "contacts",
746
+ // botpress specific
747
+ "carousel",
748
+ "card",
749
+ "choice",
750
+ "dropdown",
745
751
  // system
746
- import_zod18.default.literal("csat"),
747
- import_zod18.default.literal("assign"),
748
- import_zod18.default.literal("solve"),
749
- import_zod18.default.literal("resolved"),
750
- import_zod18.default.literal("reopen"),
751
- import_zod18.default.literal("open"),
752
- import_zod18.default.literal("closed"),
753
- import_zod18.default.literal("handed_over"),
754
- import_zod18.default.literal("updated"),
755
- import_zod18.default.literal("started"),
756
- import_zod18.default.literal("hold"),
757
- import_zod18.default.literal("unhold"),
758
- import_zod18.default.literal("auto_unhold"),
759
- import_zod18.default.literal("edited"),
760
- import_zod18.default.literal("deleted"),
761
- import_zod18.default.literal("unsupported"),
752
+ "csat",
753
+ "assign",
754
+ "solve",
755
+ "resolved",
756
+ "reopen",
757
+ "open",
758
+ "closed",
759
+ "handed_over",
760
+ "updated",
761
+ "started",
762
+ "hold",
763
+ "unhold",
764
+ "auto_unhold",
765
+ "edited",
766
+ "deleted",
767
+ "unsupported",
762
768
  // lazada specific
763
- import_zod18.default.literal("lazada_item"),
764
- import_zod18.default.literal("lazada_sys_msg"),
765
- import_zod18.default.literal("lazada_order"),
766
- import_zod18.default.literal("lazada_order_invite"),
767
- import_zod18.default.literal("lazada_shop_invite")
769
+ "lazada_item",
770
+ "lazada_sys_msg",
771
+ "lazada_order",
772
+ "lazada_order_invite",
773
+ "lazada_shop_invite"
768
774
  ];
769
- var MessageTypeSchema = import_zod18.default.union(messageTypes);
770
- var FeedPostTypeSchema = import_zod18.default.enum([
775
+ var MessageTypeSchema = import_zod18.default.enum(messageTypes);
776
+ var feedPostTypes = [
771
777
  "text",
772
778
  "added_photos",
773
779
  "added_video",
774
780
  "shared_story",
775
781
  "mobile_status_update",
776
782
  "no_data"
777
- ]);
783
+ ];
784
+ var FeedPostTypeSchema = import_zod18.default.enum(feedPostTypes);
778
785
  var MessageLocaleTypeSchema = import_zod18.default.enum(["mm", "en", "th", ""]);
779
786
  var PlatformContactMetadataSchema = import_zod18.default.object({
780
787
  id: import_zod18.default.string(),
@@ -2888,7 +2895,7 @@ var mainFeedContract = (0, import_core8.initContract)().router(
2888
2895
  {
2889
2896
  getFeedPostById: {
2890
2897
  method: "GET",
2891
- path: "/:id",
2898
+ path: "/feed-post/:id",
2892
2899
  pathParams: import_zod42.default.object({
2893
2900
  id: import_zod42.default.string().uuid()
2894
2901
  }),
@@ -2901,7 +2908,7 @@ var mainFeedContract = (0, import_core8.initContract)().router(
2901
2908
  },
2902
2909
  getMessagesByParent: {
2903
2910
  method: "GET",
2904
- path: "/message/:parentId/relevance",
2911
+ path: "/feed-post/message/:parentId/relevance",
2905
2912
  pathParams: import_zod42.default.object({
2906
2913
  parentId: import_zod42.default.string().uuid()
2907
2914
  }),
@@ -2918,8 +2925,7 @@ var mainFeedContract = (0, import_core8.initContract)().router(
2918
2925
  }
2919
2926
  },
2920
2927
  {
2921
- baseHeaders: DefaultHeaderSchema,
2922
- pathPrefix: "ms/feed-post"
2928
+ baseHeaders: DefaultHeaderSchema
2923
2929
  }
2924
2930
  );
2925
2931
  var mainChatRoomContract = (0, import_core8.initContract)().router(
@@ -10768,7 +10774,6 @@ var settingCxIntelligenceContract = (0, import_core54.initContract)().router(
10768
10774
  userContract,
10769
10775
  userNotificationContract,
10770
10776
  userPresenceStatusLogContract,
10771
- widgetContract,
10772
10777
  widgetSettingContract,
10773
10778
  workflowContract,
10774
10779
  wrapUpFormContract