@kl1/contracts 1.4.18 → 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/api-contracts/src/chat/index.d.ts +3 -0
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +3 -0
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +2282 -1132
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/public-api/index.d.ts +2286 -1134
- package/dist/api-contracts/src/public-api/index.d.ts.map +1 -1
- package/dist/api-contracts/src/public-api/schema.d.ts +1 -0
- package/dist/api-contracts/src/public-api/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/public-api/validation.d.ts +13 -0
- package/dist/api-contracts/src/public-api/validation.d.ts.map +1 -1
- package/dist/index.js +132 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +132 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1232,7 +1232,9 @@ var GetRoomsSchema = z26.object({
|
|
1232
1232
|
holdLabelId: z26.string().uuid().optional(),
|
1233
1233
|
automationQueueId: z26.string().uuid().optional(),
|
1234
1234
|
botpressBotId: z26.string().uuid().optional(),
|
1235
|
-
queueIds: z26.string().array().optional()
|
1235
|
+
queueIds: z26.string().array().optional(),
|
1236
|
+
// for room multi select filter with queue
|
1237
|
+
queueFilterIds: z26.string().array().optional()
|
1236
1238
|
// for room filter with queue
|
1237
1239
|
});
|
1238
1240
|
var UpdateRoomTagsAndNotesSchema = z26.object({
|
@@ -8408,6 +8410,20 @@ var ContactSchema2 = z107.object({
|
|
8408
8410
|
contactPhones: z107.array(ContactPhonesSchema2),
|
8409
8411
|
activityLogs: z107.array(ContactActivitySchema2).optional()
|
8410
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
|
+
]);
|
8411
8427
|
|
8412
8428
|
// src/public-api/validation.ts
|
8413
8429
|
var ContactContractValidationSchema2 = {
|
@@ -8506,17 +8522,26 @@ var ContactContractValidationSchema2 = {
|
|
8506
8522
|
response: CustomFieldSchema
|
8507
8523
|
}
|
8508
8524
|
};
|
8525
|
+
var SendLineMessageSchema = z108.object({
|
8526
|
+
channelId: z108.string(),
|
8527
|
+
message: z108.string(),
|
8528
|
+
contactId: z108.string()
|
8529
|
+
});
|
8509
8530
|
|
8510
8531
|
// src/public-api/index.ts
|
8511
8532
|
var publicApiContract = initContract38().router(
|
8512
8533
|
{
|
8513
|
-
|
8534
|
+
// Messaging parts
|
8535
|
+
sendLineMessage: {
|
8514
8536
|
method: "POST",
|
8515
|
-
path: "/
|
8516
|
-
body:
|
8537
|
+
path: "/message/line/send",
|
8538
|
+
body: SendLineMessageSchema,
|
8517
8539
|
responses: {
|
8518
|
-
201:
|
8519
|
-
|
8540
|
+
201: z109.object({
|
8541
|
+
status: z109.string(),
|
8542
|
+
channel: z109.string(),
|
8543
|
+
message: z109.string(),
|
8544
|
+
requestId: z109.string()
|
8520
8545
|
}),
|
8521
8546
|
400: z109.object({
|
8522
8547
|
message: z109.string()
|
@@ -8529,8 +8554,9 @@ var publicApiContract = initContract38().router(
|
|
8529
8554
|
422: DefaultUnprocessibleSchema,
|
8530
8555
|
500: DefaultErrorResponseSchema
|
8531
8556
|
},
|
8532
|
-
summary: "
|
8557
|
+
summary: "Send line message"
|
8533
8558
|
},
|
8559
|
+
// Tagging parts
|
8534
8560
|
getAllTags: {
|
8535
8561
|
method: "GET",
|
8536
8562
|
path: "/tags",
|
@@ -8551,6 +8577,57 @@ var publicApiContract = initContract38().router(
|
|
8551
8577
|
500: DefaultErrorResponseSchema
|
8552
8578
|
}
|
8553
8579
|
},
|
8580
|
+
// Channel parts
|
8581
|
+
getAllChannel: {
|
8582
|
+
method: "GET",
|
8583
|
+
path: "/channels",
|
8584
|
+
query: z109.object({
|
8585
|
+
page: z109.coerce.number().default(1),
|
8586
|
+
pageSize: z109.coerce.number().default(10),
|
8587
|
+
keyword: z109.string().optional()
|
8588
|
+
}),
|
8589
|
+
responses: {
|
8590
|
+
200: DefaultSuccessResponseSchema.extend({
|
8591
|
+
page: z109.number(),
|
8592
|
+
pageSize: z109.number(),
|
8593
|
+
total: z109.number(),
|
8594
|
+
lastPage: z109.number(),
|
8595
|
+
data: z109.any()
|
8596
|
+
}),
|
8597
|
+
400: z109.object({
|
8598
|
+
message: z109.string()
|
8599
|
+
}),
|
8600
|
+
409: z109.object({
|
8601
|
+
message: z109.string()
|
8602
|
+
}),
|
8603
|
+
401: DefaultUnauthorizedSchema,
|
8604
|
+
404: DefaultNotFoundSchema,
|
8605
|
+
422: DefaultUnprocessibleSchema,
|
8606
|
+
500: DefaultErrorResponseSchema
|
8607
|
+
}
|
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
|
+
},
|
8554
8631
|
getAllContact: {
|
8555
8632
|
method: "GET",
|
8556
8633
|
path: "/contacts",
|
@@ -8572,6 +8649,33 @@ var publicApiContract = initContract38().router(
|
|
8572
8649
|
},
|
8573
8650
|
summary: "Get all contacts"
|
8574
8651
|
},
|
8652
|
+
getContactBySocialPlatformId: {
|
8653
|
+
method: "GET",
|
8654
|
+
path: "/contacts/social-platform",
|
8655
|
+
query: z109.object({
|
8656
|
+
socialPlatformId: z109.string(),
|
8657
|
+
channelType: ChannelTypeSchema2.optional()
|
8658
|
+
}),
|
8659
|
+
responses: {
|
8660
|
+
200: z109.object({
|
8661
|
+
status: z109.string(),
|
8662
|
+
message: z109.string(),
|
8663
|
+
data: z109.array(ContactSchema2),
|
8664
|
+
requestId: z109.string()
|
8665
|
+
}),
|
8666
|
+
400: z109.object({
|
8667
|
+
message: z109.string()
|
8668
|
+
}),
|
8669
|
+
409: z109.object({
|
8670
|
+
message: z109.string()
|
8671
|
+
}),
|
8672
|
+
401: DefaultUnauthorizedSchema,
|
8673
|
+
404: DefaultNotFoundSchema,
|
8674
|
+
422: DefaultUnprocessibleSchema,
|
8675
|
+
500: DefaultErrorResponseSchema
|
8676
|
+
},
|
8677
|
+
summary: "Get contacts by social platform id."
|
8678
|
+
},
|
8575
8679
|
getContactFields: {
|
8576
8680
|
method: "GET",
|
8577
8681
|
path: "/contacts/fields",
|
@@ -8593,8 +8697,8 @@ var publicApiContract = initContract38().router(
|
|
8593
8697
|
},
|
8594
8698
|
summary: "Get contact custom fields."
|
8595
8699
|
},
|
8596
|
-
|
8597
|
-
method: "
|
8700
|
+
getContactById: {
|
8701
|
+
method: "GET",
|
8598
8702
|
path: "/contacts/:id",
|
8599
8703
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8600
8704
|
responses: {
|
@@ -8615,16 +8719,18 @@ var publicApiContract = initContract38().router(
|
|
8615
8719
|
422: DefaultUnprocessibleSchema,
|
8616
8720
|
500: DefaultErrorResponseSchema
|
8617
8721
|
},
|
8618
|
-
|
8619
|
-
summary: "Update a contact"
|
8722
|
+
summary: "Get a contact by id"
|
8620
8723
|
},
|
8621
|
-
|
8622
|
-
method: "
|
8623
|
-
path: "/contacts
|
8624
|
-
|
8724
|
+
updateContact: {
|
8725
|
+
method: "PATCH",
|
8726
|
+
path: "/contacts/:id",
|
8727
|
+
pathParams: ContactContractValidationSchema2.getById.request,
|
8625
8728
|
responses: {
|
8626
|
-
|
8627
|
-
|
8729
|
+
200: z109.object({
|
8730
|
+
status: z109.string(),
|
8731
|
+
message: z109.string(),
|
8732
|
+
data: ContactSchema2,
|
8733
|
+
requestId: z109.string()
|
8628
8734
|
}),
|
8629
8735
|
400: z109.object({
|
8630
8736
|
message: z109.string()
|
@@ -8637,18 +8743,16 @@ var publicApiContract = initContract38().router(
|
|
8637
8743
|
422: DefaultUnprocessibleSchema,
|
8638
8744
|
500: DefaultErrorResponseSchema
|
8639
8745
|
},
|
8640
|
-
|
8746
|
+
body: ContactContractValidationSchema2.create.request.partial(),
|
8747
|
+
summary: "Update a contact"
|
8641
8748
|
},
|
8642
|
-
|
8643
|
-
method: "
|
8644
|
-
path: "/contacts
|
8645
|
-
|
8749
|
+
createContactAttachmentRecords: {
|
8750
|
+
method: "POST",
|
8751
|
+
path: "/contacts/attachments",
|
8752
|
+
body: ContactContractValidationSchema2.addAttachments.request,
|
8646
8753
|
responses: {
|
8647
|
-
|
8648
|
-
|
8649
|
-
message: z109.string(),
|
8650
|
-
data: ContactSchema2,
|
8651
|
-
requestId: z109.string()
|
8754
|
+
201: DefaultSuccessResponseSchema.extend({
|
8755
|
+
message: ContactCustomFieldSchema2
|
8652
8756
|
}),
|
8653
8757
|
400: z109.object({
|
8654
8758
|
message: z109.string()
|
@@ -8661,7 +8765,7 @@ var publicApiContract = initContract38().router(
|
|
8661
8765
|
422: DefaultUnprocessibleSchema,
|
8662
8766
|
500: DefaultErrorResponseSchema
|
8663
8767
|
},
|
8664
|
-
summary: "
|
8768
|
+
summary: "Create a new contact attachment"
|
8665
8769
|
},
|
8666
8770
|
deleteContact: {
|
8667
8771
|
method: "DELETE",
|