@kl1/contracts 1.3.29 → 1.3.31

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/index.mjs CHANGED
@@ -6656,21 +6656,40 @@ var FieldsSchema = z86.object({ data: z86.array(z86.string()) });
6656
6656
  var WidgetPositionSchema = z86.union([
6657
6657
  z86.literal("menu"),
6658
6658
  z86.literal("ticket_detail"),
6659
- z86.literal("contact_detail")
6659
+ z86.literal("contact_detail"),
6660
+ z86.literal("contact_profile"),
6661
+ z86.literal("inbox_detail")
6662
+ ]);
6663
+ var WidgetTypeSchema = z86.union([
6664
+ z86.literal("iframe"),
6665
+ z86.literal("custom")
6666
+ ]);
6667
+ var WidgetHeaderSchema = z86.object({
6668
+ key: z86.string(),
6669
+ value: z86.string()
6670
+ });
6671
+ var WidgetMethodSchema = z86.union([
6672
+ z86.literal("get"),
6673
+ z86.literal("post")
6660
6674
  ]);
6661
6675
  var WidgetSchema = DefaultEntitySchema.extend({
6662
6676
  name: z86.string(),
6663
6677
  description: z86.string().nullable(),
6664
- position: WidgetPositionSchema.nullable(),
6678
+ position: WidgetPositionSchema,
6665
6679
  fields: FieldsSchema,
6666
- url: z86.string()
6680
+ url: z86.string(),
6681
+ type: WidgetTypeSchema.nullable(),
6682
+ headers: z86.array(WidgetHeaderSchema).nullable(),
6683
+ method: WidgetMethodSchema.nullable(),
6684
+ fileKey: z86.string().nullable(),
6685
+ fileUrl: z86.string().nullable()
6667
6686
  });
6668
6687
 
6669
6688
  // src/widget/validation.ts
6670
6689
  import z87 from "zod";
6671
6690
  var CreateWidgetSchema = z87.object({
6672
6691
  name: z87.string(),
6673
- description: z87.string(),
6692
+ description: z87.string().optional(),
6674
6693
  url: z87.string(),
6675
6694
  position: WidgetPositionSchema,
6676
6695
  fields: z87.object({
@@ -6678,7 +6697,11 @@ var CreateWidgetSchema = z87.object({
6678
6697
  // Array of attribute system names
6679
6698
  z87.array(z87.string())
6680
6699
  )
6681
- }).optional()
6700
+ }).optional(),
6701
+ type: WidgetTypeSchema,
6702
+ headers: z87.array(WidgetHeaderSchema).optional(),
6703
+ method: WidgetMethodSchema.optional(),
6704
+ fileKey: z87.string().nullable()
6682
6705
  });
6683
6706
  var UpdateWidgetSchema = CreateWidgetSchema;
6684
6707
  var GetWidgetUrlPathQuerySchema = z87.object({
@@ -6769,6 +6792,34 @@ var widgetContract = initContract29().router(
6769
6792
  },
6770
6793
  summary: "Get contact widgets"
6771
6794
  },
6795
+ getContactProfileWidgets: {
6796
+ method: "GET",
6797
+ path: "/contact_profile",
6798
+ headers: DefaultHeaderSchema,
6799
+ responses: {
6800
+ 200: z88.array(WidgetSchema),
6801
+ 400: z88.object({
6802
+ message: z88.string()
6803
+ }),
6804
+ 401: DefaultUnauthorizedSchema,
6805
+ 500: DefaultErrorResponseSchema
6806
+ },
6807
+ summary: "Get contact profile widgets"
6808
+ },
6809
+ getInboxDetailWidgets: {
6810
+ method: "GET",
6811
+ path: "/inbox_detail",
6812
+ headers: DefaultHeaderSchema,
6813
+ responses: {
6814
+ 200: z88.array(WidgetSchema),
6815
+ 400: z88.object({
6816
+ message: z88.string()
6817
+ }),
6818
+ 401: DefaultUnauthorizedSchema,
6819
+ 500: DefaultErrorResponseSchema
6820
+ },
6821
+ summary: "Get inbox detail widgets"
6822
+ },
6772
6823
  getWidgetById: {
6773
6824
  method: "GET",
6774
6825
  path: "/:id",
@@ -6791,7 +6842,11 @@ var widgetContract = initContract29().router(
6791
6842
  headers: DefaultHeaderSchema,
6792
6843
  responses: {
6793
6844
  201: DefaultSuccessResponseSchema.extend({
6794
- url: z88.string()
6845
+ widget: z88.object({
6846
+ token: z88.string().nullable(),
6847
+ headers: z88.array(WidgetHeaderSchema),
6848
+ url: z88.string()
6849
+ })
6795
6850
  }),
6796
6851
  400: z88.object({
6797
6852
  message: z88.string()