@kl1/contracts 1.4.19 → 1.4.20

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