@kl1/contracts 1.4.19 → 1.4.21

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
@@ -1234,8 +1234,9 @@ var GetRoomsSchema = z26.object({
1234
1234
  botpressBotId: z26.string().uuid().optional(),
1235
1235
  queueIds: z26.string().array().optional(),
1236
1236
  // for room multi select filter with queue
1237
- queueFilterIds: z26.string().array().optional()
1237
+ queueFilterIds: z26.string().array().optional(),
1238
1238
  // for room filter with queue
1239
+ orderBy: z26.union([z26.literal("DESC"), z26.literal("ASC")]).optional().default("DESC")
1239
1240
  });
1240
1241
  var UpdateRoomTagsAndNotesSchema = z26.object({
1241
1242
  note: z26.string().optional(),
@@ -8410,6 +8411,20 @@ var ContactSchema2 = z107.object({
8410
8411
  contactPhones: z107.array(ContactPhonesSchema2),
8411
8412
  activityLogs: z107.array(ContactActivitySchema2).optional()
8412
8413
  });
8414
+ var ChannelTypeSchema2 = z107.union([
8415
+ z107.literal("whatsapp"),
8416
+ z107.literal("messenger"),
8417
+ z107.literal("telegram"),
8418
+ z107.literal("instagram"),
8419
+ z107.literal("line"),
8420
+ z107.literal("viber"),
8421
+ z107.literal("kakao"),
8422
+ z107.literal("shopee"),
8423
+ z107.literal("lazada"),
8424
+ z107.literal("webchat"),
8425
+ z107.literal("facebook_feed"),
8426
+ z107.literal("sms_vonage")
8427
+ ]);
8413
8428
 
8414
8429
  // src/public-api/validation.ts
8415
8430
  var ContactContractValidationSchema2 = {
@@ -8508,17 +8523,26 @@ var ContactContractValidationSchema2 = {
8508
8523
  response: CustomFieldSchema
8509
8524
  }
8510
8525
  };
8526
+ var SendLineMessageSchema = z108.object({
8527
+ channelId: z108.string(),
8528
+ message: z108.string(),
8529
+ contactId: z108.string()
8530
+ });
8511
8531
 
8512
8532
  // src/public-api/index.ts
8513
8533
  var publicApiContract = initContract38().router(
8514
8534
  {
8515
- createContact: {
8535
+ // Messaging parts
8536
+ sendMessage: {
8516
8537
  method: "POST",
8517
- path: "/contacts",
8518
- body: ContactContractValidationSchema2.create.request,
8538
+ path: "/message/send",
8539
+ body: SendLineMessageSchema,
8519
8540
  responses: {
8520
- 201: DefaultSuccessResponseSchema.extend({
8521
- data: ContactSchema2
8541
+ 201: z109.object({
8542
+ status: z109.string(),
8543
+ channel: z109.string(),
8544
+ message: z109.string(),
8545
+ requestId: z109.string()
8522
8546
  }),
8523
8547
  400: z109.object({
8524
8548
  message: z109.string()
@@ -8531,8 +8555,9 @@ var publicApiContract = initContract38().router(
8531
8555
  422: DefaultUnprocessibleSchema,
8532
8556
  500: DefaultErrorResponseSchema
8533
8557
  },
8534
- summary: "Create a new contact"
8558
+ summary: "Send line message"
8535
8559
  },
8560
+ // Tagging parts
8536
8561
  getAllTags: {
8537
8562
  method: "GET",
8538
8563
  path: "/tags",
@@ -8553,6 +8578,7 @@ var publicApiContract = initContract38().router(
8553
8578
  500: DefaultErrorResponseSchema
8554
8579
  }
8555
8580
  },
8581
+ // Channel parts
8556
8582
  getAllChannel: {
8557
8583
  method: "GET",
8558
8584
  path: "/channels",
@@ -8581,6 +8607,28 @@ var publicApiContract = initContract38().router(
8581
8607
  500: DefaultErrorResponseSchema
8582
8608
  }
8583
8609
  },
8610
+ // Contact parts
8611
+ createContact: {
8612
+ method: "POST",
8613
+ path: "/contacts",
8614
+ body: ContactContractValidationSchema2.create.request,
8615
+ responses: {
8616
+ 201: DefaultSuccessResponseSchema.extend({
8617
+ data: ContactSchema2
8618
+ }),
8619
+ 400: z109.object({
8620
+ message: z109.string()
8621
+ }),
8622
+ 409: z109.object({
8623
+ message: z109.string()
8624
+ }),
8625
+ 401: DefaultUnauthorizedSchema,
8626
+ 404: DefaultNotFoundSchema,
8627
+ 422: DefaultUnprocessibleSchema,
8628
+ 500: DefaultErrorResponseSchema
8629
+ },
8630
+ summary: "Create a new contact"
8631
+ },
8584
8632
  getAllContact: {
8585
8633
  method: "GET",
8586
8634
  path: "/contacts",
@@ -8606,7 +8654,8 @@ var publicApiContract = initContract38().router(
8606
8654
  method: "GET",
8607
8655
  path: "/contacts/social-platform",
8608
8656
  query: z109.object({
8609
- socialPlatformId: z109.string()
8657
+ socialPlatformId: z109.string(),
8658
+ channelType: ChannelTypeSchema2.optional()
8610
8659
  }),
8611
8660
  responses: {
8612
8661
  200: z109.object({
@@ -8649,8 +8698,8 @@ var publicApiContract = initContract38().router(
8649
8698
  },
8650
8699
  summary: "Get contact custom fields."
8651
8700
  },
8652
- updateContact: {
8653
- method: "PATCH",
8701
+ getContactById: {
8702
+ method: "GET",
8654
8703
  path: "/contacts/:id",
8655
8704
  pathParams: ContactContractValidationSchema2.getById.request,
8656
8705
  responses: {
@@ -8671,16 +8720,18 @@ var publicApiContract = initContract38().router(
8671
8720
  422: DefaultUnprocessibleSchema,
8672
8721
  500: DefaultErrorResponseSchema
8673
8722
  },
8674
- body: ContactContractValidationSchema2.create.request.partial(),
8675
- summary: "Update a contact"
8723
+ summary: "Get a contact by id"
8676
8724
  },
8677
- createContactAttachmentRecords: {
8678
- method: "POST",
8679
- path: "/contacts/attachments",
8680
- body: ContactContractValidationSchema2.addAttachments.request,
8725
+ updateContact: {
8726
+ method: "PATCH",
8727
+ path: "/contacts/:id",
8728
+ pathParams: ContactContractValidationSchema2.getById.request,
8681
8729
  responses: {
8682
- 201: DefaultSuccessResponseSchema.extend({
8683
- message: ContactCustomFieldSchema2
8730
+ 200: z109.object({
8731
+ status: z109.string(),
8732
+ message: z109.string(),
8733
+ data: ContactSchema2,
8734
+ requestId: z109.string()
8684
8735
  }),
8685
8736
  400: z109.object({
8686
8737
  message: z109.string()
@@ -8693,18 +8744,16 @@ var publicApiContract = initContract38().router(
8693
8744
  422: DefaultUnprocessibleSchema,
8694
8745
  500: DefaultErrorResponseSchema
8695
8746
  },
8696
- summary: "Create a new contact attachment"
8747
+ body: ContactContractValidationSchema2.create.request.partial(),
8748
+ summary: "Update a contact"
8697
8749
  },
8698
- getContactById: {
8699
- method: "GET",
8700
- path: "/contacts/:id",
8701
- pathParams: ContactContractValidationSchema2.getById.request,
8750
+ createContactAttachmentRecords: {
8751
+ method: "POST",
8752
+ path: "/contacts/attachments",
8753
+ body: ContactContractValidationSchema2.addAttachments.request,
8702
8754
  responses: {
8703
- 200: z109.object({
8704
- status: z109.string(),
8705
- message: z109.string(),
8706
- data: ContactSchema2,
8707
- requestId: z109.string()
8755
+ 201: DefaultSuccessResponseSchema.extend({
8756
+ message: ContactCustomFieldSchema2
8708
8757
  }),
8709
8758
  400: z109.object({
8710
8759
  message: z109.string()
@@ -8717,7 +8766,7 @@ var publicApiContract = initContract38().router(
8717
8766
  422: DefaultUnprocessibleSchema,
8718
8767
  500: DefaultErrorResponseSchema
8719
8768
  },
8720
- summary: "Get a contact by id"
8769
+ summary: "Create a new contact attachment"
8721
8770
  },
8722
8771
  deleteContact: {
8723
8772
  method: "DELETE",