@kl1/contracts 1.3.0 → 1.3.2

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.ZodEnum<[string, ...string[]]>;
53
+ direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
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: string;
2738
+ direction: "incoming" | "outgoing" | "system";
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: string;
3167
+ direction: "incoming" | "outgoing" | "system";
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: string;
3598
+ direction: "incoming" | "outgoing" | "system";
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: string;
4030
+ direction: "incoming" | "outgoing" | "system";
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<[string, ...string[]]>>;
4380
+ messageType: z.ZodDefault<z.ZodEnum<["text", "image"]>>;
4381
4381
  }, "strip", z.ZodTypeAny, {
4382
4382
  message: string;
4383
- messageType: string;
4383
+ messageType: "image" | "text";
4384
4384
  roomId: string;
4385
4385
  }, {
4386
4386
  message: string;
4387
4387
  roomId: string;
4388
- messageType?: string | undefined;
4388
+ messageType?: "image" | "text" | 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.ZodEnum<[string, ...string[]]>;
4415
- type: z.ZodEnum<[string, ...string[]]>;
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>[]]>;
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.ZodEnum<[string, ...string[]]>;
4442
+ direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
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: string;
7127
+ direction: "incoming" | "outgoing" | "system";
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: string;
7556
+ direction: "incoming" | "outgoing" | "system";
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.ZodEnum<[string, ...string[]]>;
7931
- type: z.ZodEnum<[string, ...string[]]>;
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>[]]>;
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: string;
8597
+ direction: "incoming" | "outgoing" | "system";
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: string;
8759
+ direction: "incoming" | "outgoing" | "system";
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: string;
9562
+ direction: "incoming" | "outgoing" | "system";
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: string;
9765
+ direction: "incoming" | "outgoing" | "system";
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: string;
10117
+ direction: "incoming" | "outgoing" | "system";
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: string;
10328
+ direction: "incoming" | "outgoing" | "system";
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: string;
10531
+ direction: "incoming" | "outgoing" | "system";
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: string;
10883
+ direction: "incoming" | "outgoing" | "system";
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: string;
11096
+ direction: "incoming" | "outgoing" | "system";
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: string;
11299
+ direction: "incoming" | "outgoing" | "system";
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: string;
11651
+ direction: "incoming" | "outgoing" | "system";
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: string;
11865
+ direction: "incoming" | "outgoing" | "system";
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: string;
12068
+ direction: "incoming" | "outgoing" | "system";
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: string;
12420
+ direction: "incoming" | "outgoing" | "system";
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.ZodEnum<[string, ...string[]]>;
12688
+ direction: z.ZodUnion<[z.ZodLiteral<"incoming">, z.ZodLiteral<"outgoing">, z.ZodLiteral<"system">]>;
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: string;
15375
+ direction: "incoming" | "outgoing" | "system";
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: string;
15805
+ direction: "incoming" | "outgoing" | "system";
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: string;
16237
+ direction: "incoming" | "outgoing" | "system";
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: string;
16670
+ direction: "incoming" | "outgoing" | "system";
16671
16671
  status: number;
16672
16672
  createdAt: Date;
16673
16673
  updatedAt: Date;
package/dist/index.js CHANGED
@@ -81,7 +81,7 @@ __export(index_exports, {
81
81
  platformTelegramContract: () => platformTelegramContract,
82
82
  platformWebchatContract: () => platformWebchatContract,
83
83
  platformWhatsappContract: () => platformWhatsappContract,
84
- presenceStatusContract: () => presenceStatusContract2,
84
+ presenceStatusContract: () => presenceStatusContract,
85
85
  publicApiContract: () => publicApiContract2,
86
86
  receiveMessageContract: () => receiveMessageContract,
87
87
  roleSettingContract: () => roleSettingContract,
@@ -99,6 +99,7 @@ __export(index_exports, {
99
99
  userContract: () => userContract,
100
100
  userNotificationContract: () => userNotificationContract,
101
101
  userPresenceStatusLogContract: () => userPresenceStatusLogContract,
102
+ widgetContract: () => widgetContract,
102
103
  widgetSettingContract: () => widgetSettingContract,
103
104
  workflowContract: () => workflowContract,
104
105
  wrapUpFormContract: () => wrapUpFormContract
@@ -716,72 +717,64 @@ var WorkflowRuleSchema = DefaultEntitySchema.extend({
716
717
  });
717
718
 
718
719
  // src/chat/schema.ts
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");
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");
727
726
  var messageTypes = [
728
- "text",
729
- "image",
730
- "video",
731
- "audio",
732
- "file",
733
- "imagemap",
734
- "group",
735
- "fallback",
736
- "location",
737
- "sticker",
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"),
738
737
  // botpress specific
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",
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"),
751
745
  // system
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",
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"),
768
762
  // lazada specific
769
- "lazada_item",
770
- "lazada_sys_msg",
771
- "lazada_order",
772
- "lazada_order_invite",
773
- "lazada_shop_invite"
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")
774
768
  ];
775
- var MessageTypeSchema = import_zod18.default.enum(messageTypes);
776
- var feedPostTypes = [
769
+ var MessageTypeSchema = import_zod18.default.union(messageTypes);
770
+ var FeedPostTypeSchema = import_zod18.default.enum([
777
771
  "text",
778
772
  "added_photos",
779
773
  "added_video",
780
774
  "shared_story",
781
775
  "mobile_status_update",
782
776
  "no_data"
783
- ];
784
- var FeedPostTypeSchema = import_zod18.default.enum(feedPostTypes);
777
+ ]);
785
778
  var MessageLocaleTypeSchema = import_zod18.default.enum(["mm", "en", "th", ""]);
786
779
  var PlatformContactMetadataSchema = import_zod18.default.object({
787
780
  id: import_zod18.default.string(),
@@ -10775,6 +10768,7 @@ var settingCxIntelligenceContract = (0, import_core54.initContract)().router(
10775
10768
  userContract,
10776
10769
  userNotificationContract,
10777
10770
  userPresenceStatusLogContract,
10771
+ widgetContract,
10778
10772
  widgetSettingContract,
10779
10773
  workflowContract,
10780
10774
  wrapUpFormContract