@kl1/contracts 1.2.19-uat → 1.2.21-uat
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api-contracts/src/chat/index.d.ts +2 -2
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +3 -442
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/general-setting/index.d.ts +39 -0
- package/dist/api-contracts/src/general-setting/index.d.ts.map +1 -0
- package/dist/api-contracts/src/index.d.ts +1 -0
- package/dist/api-contracts/src/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/index.d.ts +3 -442
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-cdr/call-report.schema.d.ts +28 -28
- package/dist/entities/src/enums/chat.d.ts +1 -1
- package/dist/entities/src/enums/chat.d.ts.map +1 -1
- package/dist/index.js +502 -464
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +501 -464
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -6825,7 +6825,9 @@ var telegramContract = initContract32().router({
|
|
6825
6825
|
500: DefaultErrorResponseSchema,
|
6826
6826
|
400: DefaultErrorResponseSchema
|
6827
6827
|
},
|
6828
|
-
body:
|
6828
|
+
body: z91.object({
|
6829
|
+
id: z91.string().uuid()
|
6830
|
+
}),
|
6829
6831
|
summary: "Disconnect telegram channel"
|
6830
6832
|
},
|
6831
6833
|
sendMessage: {
|
@@ -8430,55 +8432,89 @@ var presenceStatusContract2 = initContract43().router({
|
|
8430
8432
|
presenceStatus: presenceStatusContract
|
8431
8433
|
});
|
8432
8434
|
|
8433
|
-
// src/
|
8435
|
+
// src/general-setting/index.ts
|
8434
8436
|
import { initContract as initContract44 } from "@ts-rest/core";
|
8435
|
-
import
|
8437
|
+
import z115 from "zod";
|
8438
|
+
var generalSettingContract = initContract44().router(
|
8439
|
+
{
|
8440
|
+
autoOpenedContactWidgetId: {
|
8441
|
+
getAutoOpenedContactWidgetId: {
|
8442
|
+
method: "GET",
|
8443
|
+
path: "/auto-opened-contact-widget-id",
|
8444
|
+
responses: {
|
8445
|
+
200: z115.object({
|
8446
|
+
autoOpenedContactWidgetId: z115.string().nullable()
|
8447
|
+
})
|
8448
|
+
}
|
8449
|
+
},
|
8450
|
+
updateAutoOpenedContactWidgetId: {
|
8451
|
+
method: "PATCH",
|
8452
|
+
path: "/auto-opened-contact-widget-id",
|
8453
|
+
body: z115.object({
|
8454
|
+
autoOpenedContactWidgetId: z115.string().nullable()
|
8455
|
+
}),
|
8456
|
+
responses: {
|
8457
|
+
200: z115.object({
|
8458
|
+
autoOpenedContactWidgetId: z115.string().nullable()
|
8459
|
+
})
|
8460
|
+
}
|
8461
|
+
}
|
8462
|
+
}
|
8463
|
+
},
|
8464
|
+
{
|
8465
|
+
pathPrefix: "general-setting"
|
8466
|
+
}
|
8467
|
+
);
|
8468
|
+
|
8469
|
+
// src/automation-queue/index.ts
|
8470
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
8471
|
+
import { z as z118 } from "zod";
|
8436
8472
|
|
8437
8473
|
// src/automation-queue/validation.ts
|
8438
|
-
import { z as
|
8439
|
-
var QueueDistributionStrategySchema =
|
8440
|
-
|
8441
|
-
|
8442
|
-
|
8443
|
-
|
8474
|
+
import { z as z116 } from "zod";
|
8475
|
+
var QueueDistributionStrategySchema = z116.union([
|
8476
|
+
z116.literal("round-robin"),
|
8477
|
+
z116.literal("fewest-assignments"),
|
8478
|
+
z116.literal("random"),
|
8479
|
+
z116.literal("notify-all")
|
8444
8480
|
]);
|
8445
|
-
var CreateAutomationQueueSchema =
|
8446
|
-
emoji:
|
8447
|
-
name:
|
8448
|
-
description:
|
8449
|
-
managerIds:
|
8450
|
-
agentIds:
|
8481
|
+
var CreateAutomationQueueSchema = z116.object({
|
8482
|
+
emoji: z116.string().emoji(),
|
8483
|
+
name: z116.string(),
|
8484
|
+
description: z116.string().nullable(),
|
8485
|
+
managerIds: z116.array(z116.string().uuid()).min(1),
|
8486
|
+
agentIds: z116.array(z116.string().uuid()).min(1),
|
8451
8487
|
distributionStrategy: QueueDistributionStrategySchema,
|
8452
|
-
maximumAssignPerAgent:
|
8488
|
+
maximumAssignPerAgent: z116.number().positive()
|
8453
8489
|
// ringTimeOut: z.number().positive(),
|
8454
8490
|
// retryInterval: z.number().positive(),
|
8455
8491
|
// queueTimeOut: z.number().positive(),
|
8456
8492
|
// isAssignmentDeniable: z.coerce.boolean(),
|
8457
8493
|
});
|
8458
8494
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
8459
|
-
var CheckHasAssignedRoomSchema =
|
8460
|
-
userId:
|
8461
|
-
queueId:
|
8495
|
+
var CheckHasAssignedRoomSchema = z116.object({
|
8496
|
+
userId: z116.string().uuid().optional(),
|
8497
|
+
queueId: z116.string().uuid().optional()
|
8462
8498
|
});
|
8463
8499
|
|
8464
8500
|
// src/automation-queue/schema.ts
|
8465
|
-
import { z as
|
8501
|
+
import { z as z117 } from "zod";
|
8466
8502
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
8467
|
-
emoji:
|
8468
|
-
name:
|
8469
|
-
description:
|
8503
|
+
emoji: z117.string(),
|
8504
|
+
name: z117.string(),
|
8505
|
+
description: z117.string().nullable(),
|
8470
8506
|
distributionStrategy: QueueDistributionStrategySchema,
|
8471
|
-
maximumAssignPerAgent:
|
8507
|
+
maximumAssignPerAgent: z117.number().positive(),
|
8472
8508
|
// ringTimeOut: z.number(),
|
8473
8509
|
// retryInterval: z.number(),
|
8474
8510
|
// queueTimeOut: z.number(),
|
8475
8511
|
// isAssignmentDeniable: z.boolean(),
|
8476
|
-
managers:
|
8477
|
-
agents:
|
8512
|
+
managers: z117.array(UserSchema),
|
8513
|
+
agents: z117.array(UserSchema)
|
8478
8514
|
});
|
8479
8515
|
|
8480
8516
|
// src/automation-queue/index.ts
|
8481
|
-
var automationQueueContract =
|
8517
|
+
var automationQueueContract = initContract45().router(
|
8482
8518
|
{
|
8483
8519
|
createAutomationQueue: {
|
8484
8520
|
method: "POST",
|
@@ -8493,8 +8529,8 @@ var automationQueueContract = initContract44().router(
|
|
8493
8529
|
duplicateAutomationQueue: {
|
8494
8530
|
method: "POST",
|
8495
8531
|
path: "/:id/duplicate",
|
8496
|
-
pathParams:
|
8497
|
-
id:
|
8532
|
+
pathParams: z118.object({
|
8533
|
+
id: z118.string().uuid()
|
8498
8534
|
}),
|
8499
8535
|
body: null,
|
8500
8536
|
responses: {
|
@@ -8506,20 +8542,20 @@ var automationQueueContract = initContract44().router(
|
|
8506
8542
|
getAutomationQueues: {
|
8507
8543
|
method: "GET",
|
8508
8544
|
path: "",
|
8509
|
-
query:
|
8510
|
-
userId:
|
8545
|
+
query: z118.object({
|
8546
|
+
userId: z118.string().uuid().optional()
|
8511
8547
|
}).optional(),
|
8512
8548
|
responses: {
|
8513
8549
|
200: DefaultSuccessResponseSchema.extend({
|
8514
|
-
data:
|
8550
|
+
data: z118.array(AutomationQueueSchema)
|
8515
8551
|
})
|
8516
8552
|
}
|
8517
8553
|
},
|
8518
8554
|
getAutomationQueueById: {
|
8519
8555
|
method: "GET",
|
8520
8556
|
path: "/:id",
|
8521
|
-
pathParams:
|
8522
|
-
id:
|
8557
|
+
pathParams: z118.object({
|
8558
|
+
id: z118.string().uuid()
|
8523
8559
|
}),
|
8524
8560
|
responses: {
|
8525
8561
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8530,8 +8566,8 @@ var automationQueueContract = initContract44().router(
|
|
8530
8566
|
updateAutomationQueue: {
|
8531
8567
|
method: "PATCH",
|
8532
8568
|
path: "/:id",
|
8533
|
-
pathParams:
|
8534
|
-
id:
|
8569
|
+
pathParams: z118.object({
|
8570
|
+
id: z118.string().uuid()
|
8535
8571
|
}),
|
8536
8572
|
body: UpdateAutomationQueueSchema,
|
8537
8573
|
responses: {
|
@@ -8543,13 +8579,13 @@ var automationQueueContract = initContract44().router(
|
|
8543
8579
|
deleteAutomationQueue: {
|
8544
8580
|
method: "DELETE",
|
8545
8581
|
path: "/:id",
|
8546
|
-
pathParams:
|
8547
|
-
id:
|
8582
|
+
pathParams: z118.object({
|
8583
|
+
id: z118.string().uuid()
|
8548
8584
|
}),
|
8549
8585
|
body: null,
|
8550
8586
|
responses: {
|
8551
8587
|
200: DefaultSuccessResponseSchema.extend({
|
8552
|
-
message:
|
8588
|
+
message: z118.string()
|
8553
8589
|
})
|
8554
8590
|
}
|
8555
8591
|
},
|
@@ -8559,8 +8595,8 @@ var automationQueueContract = initContract44().router(
|
|
8559
8595
|
body: CheckHasAssignedRoomSchema,
|
8560
8596
|
responses: {
|
8561
8597
|
200: DefaultSuccessResponseSchema.extend({
|
8562
|
-
data:
|
8563
|
-
hasAssignedRoom:
|
8598
|
+
data: z118.object({
|
8599
|
+
hasAssignedRoom: z118.boolean()
|
8564
8600
|
})
|
8565
8601
|
})
|
8566
8602
|
}
|
@@ -8570,300 +8606,300 @@ var automationQueueContract = initContract44().router(
|
|
8570
8606
|
);
|
8571
8607
|
|
8572
8608
|
// src/mail/mail-contract.ts
|
8573
|
-
import { initContract as
|
8609
|
+
import { initContract as initContract50 } from "@ts-rest/core";
|
8574
8610
|
|
8575
8611
|
// src/mail/room-contract.ts
|
8576
|
-
import { initContract as
|
8577
|
-
import
|
8612
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
8613
|
+
import z123 from "zod";
|
8578
8614
|
|
8579
8615
|
// src/mail/schemas/room.schema.ts
|
8580
|
-
import
|
8616
|
+
import z121 from "zod";
|
8581
8617
|
|
8582
8618
|
// src/mail/schemas/account.schema.ts
|
8583
|
-
import z118 from "zod";
|
8584
|
-
var MailServerSchema = z118.object({
|
8585
|
-
id: z118.string(),
|
8586
|
-
createdAt: z118.date(),
|
8587
|
-
updatedAt: z118.date(),
|
8588
|
-
deletedAt: z118.date().nullable(),
|
8589
|
-
name: z118.string(),
|
8590
|
-
smtpHost: z118.string(),
|
8591
|
-
smtpPort: z118.number(),
|
8592
|
-
smtpTlsPort: z118.number(),
|
8593
|
-
useTlsForSmtp: z118.boolean(),
|
8594
|
-
imapHost: z118.string(),
|
8595
|
-
imapPort: z118.number(),
|
8596
|
-
imapTlsPort: z118.number(),
|
8597
|
-
useTlsForImap: z118.boolean()
|
8598
|
-
});
|
8599
|
-
var MailAccountSchema = z118.object({
|
8600
|
-
id: z118.string(),
|
8601
|
-
createdAt: z118.date(),
|
8602
|
-
updatedAt: z118.date(),
|
8603
|
-
deletedAt: z118.date().nullable(),
|
8604
|
-
name: z118.string(),
|
8605
|
-
address: z118.string(),
|
8606
|
-
accountId: z118.string(),
|
8607
|
-
mailServerId: z118.string(),
|
8608
|
-
mailServer: MailServerSchema,
|
8609
|
-
state: z118.union([
|
8610
|
-
z118.literal("init"),
|
8611
|
-
z118.literal("syncing"),
|
8612
|
-
z118.literal("connecting"),
|
8613
|
-
z118.literal("connected"),
|
8614
|
-
z118.literal("disconnected"),
|
8615
|
-
z118.literal("authenticationError"),
|
8616
|
-
z118.literal("connectError"),
|
8617
|
-
z118.literal("unset")
|
8618
|
-
])
|
8619
|
-
});
|
8620
|
-
var OAuth2AppSchema = z118.object({
|
8621
|
-
id: z118.string(),
|
8622
|
-
name: z118.string(),
|
8623
|
-
description: z118.string(),
|
8624
|
-
title: z118.string(),
|
8625
|
-
provider: z118.string(),
|
8626
|
-
enabled: z118.boolean(),
|
8627
|
-
legacy: z118.boolean(),
|
8628
|
-
created: z118.string(),
|
8629
|
-
updated: z118.string(),
|
8630
|
-
includeInListing: z118.boolean(),
|
8631
|
-
clientId: z118.string(),
|
8632
|
-
clientSecret: z118.string(),
|
8633
|
-
authority: z118.string(),
|
8634
|
-
redirectUrl: z118.string(),
|
8635
|
-
serviceClient: z118.string(),
|
8636
|
-
googleProjectId: z118.string(),
|
8637
|
-
serviceClientEmail: z118.string(),
|
8638
|
-
serviceKey: z118.string()
|
8639
|
-
});
|
8640
|
-
|
8641
|
-
// src/mail/schemas/message.schema.ts
|
8642
8619
|
import z119 from "zod";
|
8643
|
-
var
|
8620
|
+
var MailServerSchema = z119.object({
|
8644
8621
|
id: z119.string(),
|
8645
8622
|
createdAt: z119.date(),
|
8646
8623
|
updatedAt: z119.date(),
|
8647
|
-
deletedAt: z119.
|
8648
|
-
|
8649
|
-
|
8650
|
-
|
8651
|
-
|
8652
|
-
|
8653
|
-
|
8654
|
-
|
8655
|
-
|
8656
|
-
|
8657
|
-
|
8658
|
-
|
8659
|
-
bucketName: z119.string(),
|
8660
|
-
fileName: z119.string(),
|
8661
|
-
fileKey: z119.string(),
|
8662
|
-
fileSize: z119.number(),
|
8663
|
-
fileUrl: z119.string(),
|
8664
|
-
extensionName: z119.string()
|
8665
|
-
})
|
8666
|
-
});
|
8667
|
-
var MessageSchema2 = z119.object({
|
8624
|
+
deletedAt: z119.date().nullable(),
|
8625
|
+
name: z119.string(),
|
8626
|
+
smtpHost: z119.string(),
|
8627
|
+
smtpPort: z119.number(),
|
8628
|
+
smtpTlsPort: z119.number(),
|
8629
|
+
useTlsForSmtp: z119.boolean(),
|
8630
|
+
imapHost: z119.string(),
|
8631
|
+
imapPort: z119.number(),
|
8632
|
+
imapTlsPort: z119.number(),
|
8633
|
+
useTlsForImap: z119.boolean()
|
8634
|
+
});
|
8635
|
+
var MailAccountSchema = z119.object({
|
8668
8636
|
id: z119.string(),
|
8669
8637
|
createdAt: z119.date(),
|
8670
8638
|
updatedAt: z119.date(),
|
8671
|
-
deletedAt: z119.
|
8672
|
-
|
8673
|
-
|
8674
|
-
|
8675
|
-
|
8676
|
-
|
8677
|
-
|
8678
|
-
|
8679
|
-
|
8680
|
-
|
8681
|
-
|
8682
|
-
|
8683
|
-
|
8684
|
-
|
8685
|
-
|
8686
|
-
|
8687
|
-
from: z119.array(MailParticipant),
|
8688
|
-
to: z119.array(MailParticipant),
|
8689
|
-
cc: z119.array(MailParticipant),
|
8690
|
-
bcc: z119.array(MailParticipant),
|
8691
|
-
attachments: z119.array(AttachmentSchema)
|
8639
|
+
deletedAt: z119.date().nullable(),
|
8640
|
+
name: z119.string(),
|
8641
|
+
address: z119.string(),
|
8642
|
+
accountId: z119.string(),
|
8643
|
+
mailServerId: z119.string(),
|
8644
|
+
mailServer: MailServerSchema,
|
8645
|
+
state: z119.union([
|
8646
|
+
z119.literal("init"),
|
8647
|
+
z119.literal("syncing"),
|
8648
|
+
z119.literal("connecting"),
|
8649
|
+
z119.literal("connected"),
|
8650
|
+
z119.literal("disconnected"),
|
8651
|
+
z119.literal("authenticationError"),
|
8652
|
+
z119.literal("connectError"),
|
8653
|
+
z119.literal("unset")
|
8654
|
+
])
|
8692
8655
|
});
|
8693
|
-
|
8694
|
-
|
8695
|
-
|
8696
|
-
|
8697
|
-
|
8698
|
-
|
8699
|
-
|
8700
|
-
|
8701
|
-
|
8702
|
-
|
8703
|
-
|
8704
|
-
|
8705
|
-
|
8706
|
-
|
8707
|
-
|
8708
|
-
|
8709
|
-
|
8710
|
-
|
8711
|
-
|
8712
|
-
name: z120.string(),
|
8713
|
-
address: z120.string(),
|
8714
|
-
contactId: z120.string(),
|
8715
|
-
contact: ContactSchema3,
|
8716
|
-
isNewContact: z120.boolean()
|
8656
|
+
var OAuth2AppSchema = z119.object({
|
8657
|
+
id: z119.string(),
|
8658
|
+
name: z119.string(),
|
8659
|
+
description: z119.string(),
|
8660
|
+
title: z119.string(),
|
8661
|
+
provider: z119.string(),
|
8662
|
+
enabled: z119.boolean(),
|
8663
|
+
legacy: z119.boolean(),
|
8664
|
+
created: z119.string(),
|
8665
|
+
updated: z119.string(),
|
8666
|
+
includeInListing: z119.boolean(),
|
8667
|
+
clientId: z119.string(),
|
8668
|
+
clientSecret: z119.string(),
|
8669
|
+
authority: z119.string(),
|
8670
|
+
redirectUrl: z119.string(),
|
8671
|
+
serviceClient: z119.string(),
|
8672
|
+
googleProjectId: z119.string(),
|
8673
|
+
serviceClientEmail: z119.string(),
|
8674
|
+
serviceKey: z119.string()
|
8717
8675
|
});
|
8718
|
-
|
8676
|
+
|
8677
|
+
// src/mail/schemas/message.schema.ts
|
8678
|
+
import z120 from "zod";
|
8679
|
+
var AttachmentSchema = z120.object({
|
8719
8680
|
id: z120.string(),
|
8720
8681
|
createdAt: z120.date(),
|
8721
8682
|
updatedAt: z120.date(),
|
8722
|
-
deletedAt: z120.
|
8683
|
+
deletedAt: z120.nullable(z120.date()),
|
8723
8684
|
roomId: z120.string(),
|
8724
8685
|
messageId: z120.string(),
|
8725
|
-
|
8726
|
-
|
8727
|
-
|
8728
|
-
|
8729
|
-
|
8730
|
-
|
8731
|
-
|
8732
|
-
|
8733
|
-
|
8734
|
-
|
8686
|
+
fileName: z120.string(),
|
8687
|
+
fileType: z120.string(),
|
8688
|
+
emailEngineAttachmentId: z120.string(),
|
8689
|
+
uploadId: z120.string(),
|
8690
|
+
upload: z120.object({
|
8691
|
+
id: z120.string(),
|
8692
|
+
createdAt: z120.date(),
|
8693
|
+
updatedAt: z120.date(),
|
8694
|
+
deletedAt: z120.nullable(z120.date()),
|
8695
|
+
bucketName: z120.string(),
|
8696
|
+
fileName: z120.string(),
|
8697
|
+
fileKey: z120.string(),
|
8698
|
+
fileSize: z120.number(),
|
8699
|
+
fileUrl: z120.string(),
|
8700
|
+
extensionName: z120.string()
|
8701
|
+
})
|
8735
8702
|
});
|
8736
|
-
var
|
8737
|
-
id: z120.string().uuid(),
|
8738
|
-
createdAt: z120.date(),
|
8739
|
-
updatedAt: z120.date(),
|
8740
|
-
deletedAt: z120.date().nullable(),
|
8741
|
-
name: z120.string(),
|
8742
|
-
email: z120.string(),
|
8743
|
-
address: z120.string().nullable(),
|
8744
|
-
phone: z120.string().nullable(),
|
8745
|
-
notificationCount: z120.number().nullable()
|
8746
|
-
});
|
8747
|
-
var ActivityLogModel = z120.object({
|
8703
|
+
var MessageSchema2 = z120.object({
|
8748
8704
|
id: z120.string(),
|
8749
8705
|
createdAt: z120.date(),
|
8750
8706
|
updatedAt: z120.date(),
|
8751
|
-
deletedAt: z120.nullable(z120.
|
8752
|
-
description: z120.string(),
|
8753
|
-
actorId: z120.string(),
|
8707
|
+
deletedAt: z120.nullable(z120.date()),
|
8754
8708
|
roomId: z120.string(),
|
8755
|
-
actor: UserModel
|
8756
|
-
});
|
8757
|
-
var MessagesAndLogsSchema = z120.array(
|
8758
|
-
z120.union([MessageSchema2, ActivityLogModel])
|
8759
|
-
);
|
8760
|
-
var MailRoomSchema = z120.object({
|
8761
|
-
id: z120.string(),
|
8762
|
-
createdAt: z120.date(),
|
8763
|
-
updatedAt: z120.date(),
|
8764
|
-
deletedAt: z120.date().nullable(),
|
8765
8709
|
subject: z120.string(),
|
8766
|
-
|
8767
|
-
|
8768
|
-
|
8769
|
-
|
8710
|
+
textPlain: z120.string(),
|
8711
|
+
textHtml: z120.string(),
|
8712
|
+
textId: z120.string(),
|
8713
|
+
emailEngineEmailId: z120.string(),
|
8714
|
+
emailEngineMessageId: z120.string(),
|
8715
|
+
emailEngineReplyTo: z120.nullable(z120.string()),
|
8770
8716
|
direction: z120.string(),
|
8771
|
-
|
8772
|
-
|
8717
|
+
date: z120.date(),
|
8718
|
+
action: z120.string(),
|
8719
|
+
unseen: z120.boolean(),
|
8720
|
+
sendAt: z120.date(),
|
8721
|
+
starred: z120.boolean(),
|
8722
|
+
seemsLikeNew: z120.boolean(),
|
8773
8723
|
from: z120.array(MailParticipant),
|
8774
8724
|
to: z120.array(MailParticipant),
|
8775
8725
|
cc: z120.array(MailParticipant),
|
8776
8726
|
bcc: z120.array(MailParticipant),
|
8727
|
+
attachments: z120.array(AttachmentSchema)
|
8728
|
+
});
|
8729
|
+
|
8730
|
+
// src/mail/schemas/room.schema.ts
|
8731
|
+
var ContactSchema3 = z121.object({
|
8732
|
+
id: z121.string().uuid(),
|
8733
|
+
createdAt: z121.date(),
|
8734
|
+
updatedAt: z121.date(),
|
8735
|
+
deletedAt: z121.date().nullable(),
|
8736
|
+
name: z121.string(),
|
8737
|
+
address: z121.string().nullable(),
|
8738
|
+
channel: z121.string().nullable(),
|
8739
|
+
notes: z121.string().nullable(),
|
8740
|
+
contactProfile: z121.string().nullable(),
|
8741
|
+
socialProfileUrl: z121.string().nullable()
|
8742
|
+
});
|
8743
|
+
var MailUserSchema = z121.object({
|
8744
|
+
id: z121.string(),
|
8745
|
+
createdAt: z121.date(),
|
8746
|
+
updatedAt: z121.date(),
|
8747
|
+
deletedAt: z121.date().nullable(),
|
8748
|
+
name: z121.string(),
|
8749
|
+
address: z121.string(),
|
8750
|
+
contactId: z121.string(),
|
8751
|
+
contact: ContactSchema3,
|
8752
|
+
isNewContact: z121.boolean()
|
8753
|
+
});
|
8754
|
+
var MailParticipant = z121.object({
|
8755
|
+
id: z121.string(),
|
8756
|
+
createdAt: z121.date(),
|
8757
|
+
updatedAt: z121.date(),
|
8758
|
+
deletedAt: z121.date().nullable(),
|
8759
|
+
roomId: z121.string(),
|
8760
|
+
messageId: z121.string(),
|
8761
|
+
mailUserId: z121.string(),
|
8762
|
+
mailUser: MailUserSchema
|
8763
|
+
});
|
8764
|
+
var TagSchema2 = z121.object({
|
8765
|
+
color: z121.string(),
|
8766
|
+
id: z121.string(),
|
8767
|
+
createdAt: z121.date(),
|
8768
|
+
updatedAt: z121.date(),
|
8769
|
+
deletedAt: z121.date().nullable(),
|
8770
|
+
name: z121.string()
|
8771
|
+
});
|
8772
|
+
var UserModel = z121.object({
|
8773
|
+
id: z121.string().uuid(),
|
8774
|
+
createdAt: z121.date(),
|
8775
|
+
updatedAt: z121.date(),
|
8776
|
+
deletedAt: z121.date().nullable(),
|
8777
|
+
name: z121.string(),
|
8778
|
+
email: z121.string(),
|
8779
|
+
address: z121.string().nullable(),
|
8780
|
+
phone: z121.string().nullable(),
|
8781
|
+
notificationCount: z121.number().nullable()
|
8782
|
+
});
|
8783
|
+
var ActivityLogModel = z121.object({
|
8784
|
+
id: z121.string(),
|
8785
|
+
createdAt: z121.date(),
|
8786
|
+
updatedAt: z121.date(),
|
8787
|
+
deletedAt: z121.nullable(z121.string()),
|
8788
|
+
description: z121.string(),
|
8789
|
+
actorId: z121.string(),
|
8790
|
+
roomId: z121.string(),
|
8791
|
+
actor: UserModel
|
8792
|
+
});
|
8793
|
+
var MessagesAndLogsSchema = z121.array(
|
8794
|
+
z121.union([MessageSchema2, ActivityLogModel])
|
8795
|
+
);
|
8796
|
+
var MailRoomSchema = z121.object({
|
8797
|
+
id: z121.string(),
|
8798
|
+
createdAt: z121.date(),
|
8799
|
+
updatedAt: z121.date(),
|
8800
|
+
deletedAt: z121.date().nullable(),
|
8801
|
+
subject: z121.string(),
|
8802
|
+
resolved: z121.boolean(),
|
8803
|
+
assigneeId: z121.string().nullable(),
|
8804
|
+
note: z121.string(),
|
8805
|
+
mailId: z121.string(),
|
8806
|
+
direction: z121.string(),
|
8807
|
+
lastMessageId: z121.string(),
|
8808
|
+
firstMessageId: z121.string(),
|
8809
|
+
from: z121.array(MailParticipant),
|
8810
|
+
to: z121.array(MailParticipant),
|
8811
|
+
cc: z121.array(MailParticipant),
|
8812
|
+
bcc: z121.array(MailParticipant),
|
8777
8813
|
firstMessage: MessageSchema2,
|
8778
8814
|
lastMessage: MessageSchema2,
|
8779
|
-
tags:
|
8815
|
+
tags: z121.array(TagSchema2),
|
8780
8816
|
assignee: UserModel,
|
8781
|
-
messages:
|
8817
|
+
messages: z121.array(MessageSchema2),
|
8782
8818
|
messagesAndLogs: MessagesAndLogsSchema,
|
8783
8819
|
mail: MailAccountSchema,
|
8784
|
-
unReadMessageCount:
|
8820
|
+
unReadMessageCount: z121.number(),
|
8785
8821
|
cxlog: CxLogSchema
|
8786
8822
|
});
|
8787
|
-
var AttachmentSchema2 =
|
8788
|
-
fileName:
|
8789
|
-
fileType:
|
8790
|
-
emailEngineAttachmentId:
|
8791
|
-
uploadId:
|
8792
|
-
messageId:
|
8793
|
-
roomId:
|
8823
|
+
var AttachmentSchema2 = z121.object({
|
8824
|
+
fileName: z121.string(),
|
8825
|
+
fileType: z121.string(),
|
8826
|
+
emailEngineAttachmentId: z121.string(),
|
8827
|
+
uploadId: z121.string(),
|
8828
|
+
messageId: z121.string(),
|
8829
|
+
roomId: z121.string(),
|
8794
8830
|
upload: UploadSchema
|
8795
8831
|
});
|
8796
8832
|
|
8797
8833
|
// src/mail/schemas/room-validation.schema.ts
|
8798
|
-
import
|
8834
|
+
import z122 from "zod";
|
8799
8835
|
var RoomContractsValidationSchema = {
|
8800
8836
|
getAll: {
|
8801
|
-
input:
|
8802
|
-
page:
|
8803
|
-
pageSize:
|
8804
|
-
keyword:
|
8805
|
-
value:
|
8806
|
-
category:
|
8837
|
+
input: z122.object({
|
8838
|
+
page: z122.coerce.number().default(1),
|
8839
|
+
pageSize: z122.coerce.number().default(10),
|
8840
|
+
keyword: z122.object({
|
8841
|
+
value: z122.string(),
|
8842
|
+
category: z122.union([z122.literal("contact"), z122.literal("message")])
|
8807
8843
|
}).optional(),
|
8808
|
-
contactLabels:
|
8809
|
-
channels:
|
8810
|
-
date:
|
8811
|
-
contacts:
|
8812
|
-
assignees:
|
8813
|
-
level1:
|
8814
|
-
|
8815
|
-
|
8816
|
-
|
8817
|
-
|
8818
|
-
|
8819
|
-
|
8844
|
+
contactLabels: z122.array(z122.string()).optional(),
|
8845
|
+
channels: z122.array(z122.string().email()).optional(),
|
8846
|
+
date: z122.string().optional(),
|
8847
|
+
contacts: z122.array(z122.string()).optional(),
|
8848
|
+
assignees: z122.array(z122.string()).optional(),
|
8849
|
+
level1: z122.union([
|
8850
|
+
z122.literal("open"),
|
8851
|
+
z122.literal("close"),
|
8852
|
+
z122.literal("inbox"),
|
8853
|
+
z122.literal("sent"),
|
8854
|
+
z122.literal("scheduled"),
|
8855
|
+
z122.literal("starred")
|
8820
8856
|
]).optional(),
|
8821
|
-
level2:
|
8822
|
-
|
8823
|
-
|
8824
|
-
|
8825
|
-
|
8857
|
+
level2: z122.union([
|
8858
|
+
z122.literal("all"),
|
8859
|
+
z122.literal("unassign"),
|
8860
|
+
z122.literal("mine"),
|
8861
|
+
z122.literal("other")
|
8826
8862
|
]).optional()
|
8827
8863
|
}),
|
8828
|
-
output:
|
8829
|
-
data:
|
8830
|
-
total:
|
8831
|
-
page:
|
8832
|
-
pageSize:
|
8864
|
+
output: z122.object({
|
8865
|
+
data: z122.array(MailRoomSchema),
|
8866
|
+
total: z122.number(),
|
8867
|
+
page: z122.number(),
|
8868
|
+
pageSize: z122.number()
|
8833
8869
|
})
|
8834
8870
|
},
|
8835
8871
|
update: {
|
8836
|
-
input:
|
8837
|
-
disposition:
|
8838
|
-
|
8839
|
-
|
8840
|
-
|
8841
|
-
|
8842
|
-
|
8843
|
-
|
8872
|
+
input: z122.object({
|
8873
|
+
disposition: z122.union([
|
8874
|
+
z122.literal("resolved"),
|
8875
|
+
z122.literal("follow up"),
|
8876
|
+
z122.literal("escalated"),
|
8877
|
+
z122.literal("dropped"),
|
8878
|
+
z122.literal("prank"),
|
8879
|
+
z122.literal("blank")
|
8844
8880
|
]).optional().nullable(),
|
8845
|
-
assigneeId:
|
8846
|
-
note:
|
8847
|
-
tags:
|
8848
|
-
handover:
|
8849
|
-
|
8881
|
+
assigneeId: z122.string().uuid().optional().nullable(),
|
8882
|
+
note: z122.string().optional(),
|
8883
|
+
tags: z122.array(z122.string().uuid()).optional(),
|
8884
|
+
handover: z122.boolean().or(
|
8885
|
+
z122.union([z122.literal("true"), z122.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8850
8886
|
).optional().nullable(),
|
8851
|
-
selfAssign:
|
8852
|
-
|
8887
|
+
selfAssign: z122.boolean().or(
|
8888
|
+
z122.union([z122.literal("true"), z122.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8853
8889
|
).optional().nullable()
|
8854
8890
|
})
|
8855
8891
|
}
|
8856
8892
|
};
|
8857
8893
|
|
8858
8894
|
// src/mail/room-contract.ts
|
8859
|
-
var roomContract =
|
8895
|
+
var roomContract = initContract46().router(
|
8860
8896
|
{
|
8861
8897
|
create: {
|
8862
8898
|
method: "POST",
|
8863
8899
|
path: "/",
|
8864
8900
|
responses: {
|
8865
8901
|
200: DefaultSuccessResponseSchema.extend({
|
8866
|
-
message:
|
8902
|
+
message: z123.string()
|
8867
8903
|
}),
|
8868
8904
|
...DefaultResponses
|
8869
8905
|
},
|
@@ -8876,10 +8912,10 @@ var roomContract = initContract45().router(
|
|
8876
8912
|
query: RoomContractsValidationSchema.getAll.input,
|
8877
8913
|
responses: {
|
8878
8914
|
200: DefaultSuccessResponseSchema.extend({
|
8879
|
-
data:
|
8880
|
-
total:
|
8881
|
-
page:
|
8882
|
-
pageSize:
|
8915
|
+
data: z123.array(MailRoomSchema),
|
8916
|
+
total: z123.number(),
|
8917
|
+
page: z123.number(),
|
8918
|
+
pageSize: z123.number()
|
8883
8919
|
}),
|
8884
8920
|
...DefaultResponses
|
8885
8921
|
},
|
@@ -8891,24 +8927,24 @@ var roomContract = initContract45().router(
|
|
8891
8927
|
path: "/count_rooms/all",
|
8892
8928
|
responses: {
|
8893
8929
|
200: DefaultSuccessResponseSchema.extend({
|
8894
|
-
data:
|
8895
|
-
general:
|
8896
|
-
|
8897
|
-
name:
|
8898
|
-
count:
|
8899
|
-
unReadMessagesCount:
|
8930
|
+
data: z123.object({
|
8931
|
+
general: z123.array(
|
8932
|
+
z123.object({
|
8933
|
+
name: z123.string(),
|
8934
|
+
count: z123.number(),
|
8935
|
+
unReadMessagesCount: z123.number()
|
8900
8936
|
})
|
8901
8937
|
),
|
8902
|
-
channels:
|
8903
|
-
|
8938
|
+
channels: z123.array(
|
8939
|
+
z123.object({
|
8904
8940
|
channel: MailAccountSchema,
|
8905
|
-
count:
|
8941
|
+
count: z123.number()
|
8906
8942
|
})
|
8907
8943
|
),
|
8908
|
-
contactLabels:
|
8909
|
-
|
8944
|
+
contactLabels: z123.array(
|
8945
|
+
z123.object({
|
8910
8946
|
label: TagSchema,
|
8911
|
-
count:
|
8947
|
+
count: z123.number()
|
8912
8948
|
})
|
8913
8949
|
)
|
8914
8950
|
})
|
@@ -8920,12 +8956,12 @@ var roomContract = initContract45().router(
|
|
8920
8956
|
getAttachments: {
|
8921
8957
|
method: "GET",
|
8922
8958
|
path: "/:id/attachments",
|
8923
|
-
pathParams:
|
8924
|
-
id:
|
8959
|
+
pathParams: z123.object({
|
8960
|
+
id: z123.string().uuid()
|
8925
8961
|
}),
|
8926
8962
|
responses: {
|
8927
8963
|
200: DefaultSuccessResponseSchema.extend({
|
8928
|
-
data:
|
8964
|
+
data: z123.array(AttachmentSchema2)
|
8929
8965
|
}),
|
8930
8966
|
...DefaultResponses
|
8931
8967
|
},
|
@@ -8934,12 +8970,12 @@ var roomContract = initContract45().router(
|
|
8934
8970
|
getParticipants: {
|
8935
8971
|
method: "GET",
|
8936
8972
|
path: "/:id/participants",
|
8937
|
-
pathParams:
|
8938
|
-
id:
|
8973
|
+
pathParams: z123.object({
|
8974
|
+
id: z123.string().uuid()
|
8939
8975
|
}),
|
8940
8976
|
responses: {
|
8941
8977
|
200: DefaultSuccessResponseSchema.extend({
|
8942
|
-
data:
|
8978
|
+
data: z123.array(MailParticipant)
|
8943
8979
|
}),
|
8944
8980
|
...DefaultResponses
|
8945
8981
|
},
|
@@ -8950,22 +8986,22 @@ var roomContract = initContract45().router(
|
|
8950
8986
|
path: "/add_email_to_contact",
|
8951
8987
|
responses: {
|
8952
8988
|
200: DefaultSuccessResponseSchema.extend({
|
8953
|
-
data:
|
8989
|
+
data: z123.string()
|
8954
8990
|
}),
|
8955
8991
|
...DefaultResponses
|
8956
8992
|
},
|
8957
|
-
body:
|
8958
|
-
email:
|
8959
|
-
contactId:
|
8960
|
-
mailUserId:
|
8993
|
+
body: z123.object({
|
8994
|
+
email: z123.string(),
|
8995
|
+
contactId: z123.string(),
|
8996
|
+
mailUserId: z123.string()
|
8961
8997
|
}),
|
8962
8998
|
summary: "Add a new email of a mail room participant to an existing contact"
|
8963
8999
|
},
|
8964
9000
|
update: {
|
8965
9001
|
method: "PATCH",
|
8966
9002
|
path: "/:id",
|
8967
|
-
pathParams:
|
8968
|
-
id:
|
9003
|
+
pathParams: z123.object({
|
9004
|
+
id: z123.string()
|
8969
9005
|
}),
|
8970
9006
|
responses: {
|
8971
9007
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8979,12 +9015,12 @@ var roomContract = initContract45().router(
|
|
8979
9015
|
markAsRead: {
|
8980
9016
|
method: "POST",
|
8981
9017
|
path: "/mark_as_read",
|
8982
|
-
body:
|
8983
|
-
id:
|
9018
|
+
body: z123.object({
|
9019
|
+
id: z123.string()
|
8984
9020
|
}),
|
8985
9021
|
responses: {
|
8986
9022
|
200: DefaultSuccessResponseSchema.extend({
|
8987
|
-
message:
|
9023
|
+
message: z123.string()
|
8988
9024
|
}),
|
8989
9025
|
...DefaultResponses
|
8990
9026
|
},
|
@@ -8993,8 +9029,8 @@ var roomContract = initContract45().router(
|
|
8993
9029
|
getById: {
|
8994
9030
|
method: "GET",
|
8995
9031
|
path: "/:id",
|
8996
|
-
pathParams:
|
8997
|
-
id:
|
9032
|
+
pathParams: z123.object({
|
9033
|
+
id: z123.string().uuid()
|
8998
9034
|
}),
|
8999
9035
|
responses: {
|
9000
9036
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9011,78 +9047,78 @@ var roomContract = initContract45().router(
|
|
9011
9047
|
);
|
9012
9048
|
|
9013
9049
|
// src/mail/account-contract.ts
|
9014
|
-
import { initContract as
|
9015
|
-
import
|
9050
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
9051
|
+
import z125 from "zod";
|
9016
9052
|
|
9017
9053
|
// src/mail/schemas/account-validation.schema.ts
|
9018
|
-
import
|
9054
|
+
import z124 from "zod";
|
9019
9055
|
var AccountContractsValidationSchemas = {
|
9020
9056
|
create: {
|
9021
|
-
input:
|
9022
|
-
address:
|
9023
|
-
name:
|
9024
|
-
password:
|
9025
|
-
mailServerId:
|
9057
|
+
input: z124.object({
|
9058
|
+
address: z124.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9059
|
+
name: z124.string().min(1, "Account name cannot be empty."),
|
9060
|
+
password: z124.string().min(1, "Password cannot be empty."),
|
9061
|
+
mailServerId: z124.string().uuid("Invalid mail_server_id")
|
9026
9062
|
})
|
9027
9063
|
},
|
9028
9064
|
getById: {
|
9029
|
-
input:
|
9030
|
-
id:
|
9065
|
+
input: z124.object({
|
9066
|
+
id: z124.string().uuid()
|
9031
9067
|
}),
|
9032
9068
|
output: MailAccountSchema
|
9033
9069
|
},
|
9034
9070
|
getAll: {
|
9035
|
-
output:
|
9071
|
+
output: z124.array(MailAccountSchema)
|
9036
9072
|
},
|
9037
9073
|
update: {
|
9038
9074
|
input: MailAccountSchema,
|
9039
9075
|
output: MailAccountSchema
|
9040
9076
|
},
|
9041
9077
|
disconnect: {
|
9042
|
-
input:
|
9043
|
-
id:
|
9078
|
+
input: z124.object({
|
9079
|
+
id: z124.string().uuid()
|
9044
9080
|
}),
|
9045
9081
|
output: MailAccountSchema
|
9046
9082
|
},
|
9047
9083
|
reconnect: {
|
9048
|
-
input:
|
9049
|
-
id:
|
9084
|
+
input: z124.object({
|
9085
|
+
id: z124.string()
|
9050
9086
|
}),
|
9051
9087
|
output: MailAccountSchema
|
9052
9088
|
},
|
9053
9089
|
delete: {
|
9054
|
-
input:
|
9055
|
-
id:
|
9090
|
+
input: z124.object({
|
9091
|
+
id: z124.string()
|
9056
9092
|
}),
|
9057
|
-
output:
|
9093
|
+
output: z124.string()
|
9058
9094
|
},
|
9059
9095
|
deleteEmailEngineAcc: {
|
9060
|
-
input:
|
9061
|
-
account:
|
9096
|
+
input: z124.object({
|
9097
|
+
account: z124.string()
|
9062
9098
|
}),
|
9063
9099
|
output: MailAccountSchema
|
9064
9100
|
},
|
9065
9101
|
generateOAuth2AuthenticationLink: {
|
9066
|
-
body:
|
9067
|
-
oAuth2AppId:
|
9068
|
-
mailServerId:
|
9102
|
+
body: z124.object({
|
9103
|
+
oAuth2AppId: z124.string(),
|
9104
|
+
mailServerId: z124.string()
|
9069
9105
|
}),
|
9070
|
-
response:
|
9071
|
-
url:
|
9072
|
-
account:
|
9106
|
+
response: z124.object({
|
9107
|
+
url: z124.string(),
|
9108
|
+
account: z124.string()
|
9073
9109
|
})
|
9074
9110
|
},
|
9075
9111
|
createOAuth2Acc: {
|
9076
|
-
body:
|
9077
|
-
account:
|
9078
|
-
name:
|
9112
|
+
body: z124.object({
|
9113
|
+
account: z124.string(),
|
9114
|
+
name: z124.string()
|
9079
9115
|
}),
|
9080
9116
|
response: MailAccountSchema
|
9081
9117
|
}
|
9082
9118
|
};
|
9083
9119
|
|
9084
9120
|
// src/mail/account-contract.ts
|
9085
|
-
var accountContract =
|
9121
|
+
var accountContract = initContract47().router(
|
9086
9122
|
{
|
9087
9123
|
//#region ........register account
|
9088
9124
|
create: {
|
@@ -9093,14 +9129,14 @@ var accountContract = initContract46().router(
|
|
9093
9129
|
// data: AccountContractsValidationSchemas.create.output,
|
9094
9130
|
data: MailAccountSchema
|
9095
9131
|
}),
|
9096
|
-
400:
|
9097
|
-
message:
|
9132
|
+
400: z125.object({
|
9133
|
+
message: z125.string()
|
9098
9134
|
}),
|
9099
|
-
409:
|
9100
|
-
message:
|
9135
|
+
409: z125.object({
|
9136
|
+
message: z125.string()
|
9101
9137
|
}),
|
9102
|
-
500:
|
9103
|
-
message:
|
9138
|
+
500: z125.object({
|
9139
|
+
message: z125.string()
|
9104
9140
|
}),
|
9105
9141
|
...DefaultResponses
|
9106
9142
|
},
|
@@ -9116,14 +9152,14 @@ var accountContract = initContract46().router(
|
|
9116
9152
|
201: DefaultSuccessResponseSchema.extend({
|
9117
9153
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
9118
9154
|
}),
|
9119
|
-
400:
|
9120
|
-
message:
|
9155
|
+
400: z125.object({
|
9156
|
+
message: z125.string()
|
9121
9157
|
}),
|
9122
|
-
409:
|
9123
|
-
message:
|
9158
|
+
409: z125.object({
|
9159
|
+
message: z125.string()
|
9124
9160
|
}),
|
9125
|
-
500:
|
9126
|
-
message:
|
9161
|
+
500: z125.object({
|
9162
|
+
message: z125.string()
|
9127
9163
|
}),
|
9128
9164
|
...DefaultResponses
|
9129
9165
|
},
|
@@ -9137,7 +9173,7 @@ var accountContract = initContract46().router(
|
|
9137
9173
|
path: "/sync",
|
9138
9174
|
responses: {
|
9139
9175
|
200: DefaultSuccessResponseSchema.extend({
|
9140
|
-
message:
|
9176
|
+
message: z125.string()
|
9141
9177
|
}),
|
9142
9178
|
...DefaultResponses
|
9143
9179
|
},
|
@@ -9162,13 +9198,13 @@ var accountContract = initContract46().router(
|
|
9162
9198
|
getAll: {
|
9163
9199
|
method: "GET",
|
9164
9200
|
path: "",
|
9165
|
-
query:
|
9166
|
-
state:
|
9167
|
-
withDeleted:
|
9201
|
+
query: z125.object({
|
9202
|
+
state: z125.union([z125.literal("connected"), z125.literal("disconnected")]).optional(),
|
9203
|
+
withDeleted: z125.boolean().default(false)
|
9168
9204
|
}).optional(),
|
9169
9205
|
responses: {
|
9170
9206
|
200: DefaultSuccessResponseSchema.extend({
|
9171
|
-
data:
|
9207
|
+
data: z125.array(MailAccountSchema)
|
9172
9208
|
}),
|
9173
9209
|
...DefaultResponses
|
9174
9210
|
},
|
@@ -9179,8 +9215,8 @@ var accountContract = initContract46().router(
|
|
9179
9215
|
update: {
|
9180
9216
|
method: "PATCH",
|
9181
9217
|
path: "/:id",
|
9182
|
-
pathParams:
|
9183
|
-
id:
|
9218
|
+
pathParams: z125.object({
|
9219
|
+
id: z125.string().uuid()
|
9184
9220
|
}),
|
9185
9221
|
responses: {
|
9186
9222
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -9229,7 +9265,7 @@ var accountContract = initContract46().router(
|
|
9229
9265
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
9230
9266
|
responses: {
|
9231
9267
|
200: DefaultSuccessResponseSchema.extend({
|
9232
|
-
message:
|
9268
|
+
message: z125.string()
|
9233
9269
|
}),
|
9234
9270
|
...DefaultResponses
|
9235
9271
|
},
|
@@ -9244,7 +9280,7 @@ var accountContract = initContract46().router(
|
|
9244
9280
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
9245
9281
|
responses: {
|
9246
9282
|
200: DefaultSuccessResponseSchema.extend({
|
9247
|
-
message:
|
9283
|
+
message: z125.string()
|
9248
9284
|
}),
|
9249
9285
|
...DefaultResponses
|
9250
9286
|
},
|
@@ -9272,25 +9308,25 @@ var accountContract = initContract46().router(
|
|
9272
9308
|
);
|
9273
9309
|
|
9274
9310
|
// src/mail/mail-server-contract.ts
|
9275
|
-
import { initContract as
|
9276
|
-
import
|
9311
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
9312
|
+
import z127 from "zod";
|
9277
9313
|
|
9278
9314
|
// src/mail/schemas/servers-validation.schema.ts
|
9279
|
-
import
|
9280
|
-
var CreateMailServerSchema =
|
9281
|
-
name:
|
9282
|
-
smtpHost:
|
9283
|
-
smtpPort:
|
9284
|
-
smtpTlsPort:
|
9285
|
-
useTlsForSmtp:
|
9286
|
-
imapHost:
|
9287
|
-
imapPort:
|
9288
|
-
imapTlsPort:
|
9289
|
-
useTlsForImap:
|
9315
|
+
import z126 from "zod";
|
9316
|
+
var CreateMailServerSchema = z126.object({
|
9317
|
+
name: z126.string(),
|
9318
|
+
smtpHost: z126.string(),
|
9319
|
+
smtpPort: z126.number(),
|
9320
|
+
smtpTlsPort: z126.number(),
|
9321
|
+
useTlsForSmtp: z126.boolean(),
|
9322
|
+
imapHost: z126.string(),
|
9323
|
+
imapPort: z126.number(),
|
9324
|
+
imapTlsPort: z126.number(),
|
9325
|
+
useTlsForImap: z126.boolean()
|
9290
9326
|
});
|
9291
9327
|
|
9292
9328
|
// src/mail/mail-server-contract.ts
|
9293
|
-
var serverContract =
|
9329
|
+
var serverContract = initContract48().router(
|
9294
9330
|
{
|
9295
9331
|
create: {
|
9296
9332
|
method: "POST",
|
@@ -9309,11 +9345,11 @@ var serverContract = initContract47().router(
|
|
9309
9345
|
path: "/oauth2/apps",
|
9310
9346
|
responses: {
|
9311
9347
|
200: DefaultSuccessResponseSchema.extend({
|
9312
|
-
data:
|
9313
|
-
total:
|
9314
|
-
pages:
|
9315
|
-
page:
|
9316
|
-
apps:
|
9348
|
+
data: z127.object({
|
9349
|
+
total: z127.number(),
|
9350
|
+
pages: z127.number(),
|
9351
|
+
page: z127.number(),
|
9352
|
+
apps: z127.array(OAuth2AppSchema)
|
9317
9353
|
})
|
9318
9354
|
}),
|
9319
9355
|
...DefaultResponses
|
@@ -9323,8 +9359,8 @@ var serverContract = initContract47().router(
|
|
9323
9359
|
getById: {
|
9324
9360
|
method: "GET",
|
9325
9361
|
path: "/:id",
|
9326
|
-
pathParams:
|
9327
|
-
id:
|
9362
|
+
pathParams: z127.object({
|
9363
|
+
id: z127.string().uuid()
|
9328
9364
|
}),
|
9329
9365
|
responses: {
|
9330
9366
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9339,7 +9375,7 @@ var serverContract = initContract47().router(
|
|
9339
9375
|
path: "/",
|
9340
9376
|
responses: {
|
9341
9377
|
200: DefaultSuccessResponseSchema.extend({
|
9342
|
-
data:
|
9378
|
+
data: z127.array(MailServerSchema)
|
9343
9379
|
}),
|
9344
9380
|
...DefaultResponses
|
9345
9381
|
},
|
@@ -9348,8 +9384,8 @@ var serverContract = initContract47().router(
|
|
9348
9384
|
update: {
|
9349
9385
|
method: "PATCH",
|
9350
9386
|
path: "/:id",
|
9351
|
-
pathParams:
|
9352
|
-
id:
|
9387
|
+
pathParams: z127.object({
|
9388
|
+
id: z127.string().uuid()
|
9353
9389
|
}),
|
9354
9390
|
responses: {
|
9355
9391
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9363,8 +9399,8 @@ var serverContract = initContract47().router(
|
|
9363
9399
|
delete: {
|
9364
9400
|
method: "DELETE",
|
9365
9401
|
path: "/:id",
|
9366
|
-
pathParams:
|
9367
|
-
id:
|
9402
|
+
pathParams: z127.object({
|
9403
|
+
id: z127.string().uuid()
|
9368
9404
|
}),
|
9369
9405
|
responses: {
|
9370
9406
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9382,52 +9418,52 @@ var serverContract = initContract47().router(
|
|
9382
9418
|
);
|
9383
9419
|
|
9384
9420
|
// src/mail/message-contract.ts
|
9385
|
-
import { initContract as
|
9386
|
-
import
|
9421
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
9422
|
+
import z129 from "zod";
|
9387
9423
|
|
9388
9424
|
// src/mail/schemas/message-validation.schema.ts
|
9389
|
-
import
|
9390
|
-
var MailParticipant2 =
|
9391
|
-
name:
|
9392
|
-
address:
|
9425
|
+
import z128 from "zod";
|
9426
|
+
var MailParticipant2 = z128.object({
|
9427
|
+
name: z128.string().optional(),
|
9428
|
+
address: z128.string().email()
|
9393
9429
|
});
|
9394
9430
|
var MessageContractsValidationsSchema = {
|
9395
9431
|
submit: {
|
9396
|
-
input:
|
9397
|
-
subject:
|
9398
|
-
text:
|
9399
|
-
html:
|
9432
|
+
input: z128.object({
|
9433
|
+
subject: z128.string(),
|
9434
|
+
text: z128.string(),
|
9435
|
+
html: z128.string(),
|
9400
9436
|
from: MailParticipant2,
|
9401
9437
|
to: MailParticipant2,
|
9402
|
-
cc:
|
9403
|
-
bcc:
|
9404
|
-
sendAt:
|
9405
|
-
reference:
|
9406
|
-
messageId:
|
9407
|
-
action:
|
9438
|
+
cc: z128.array(MailParticipant2).optional(),
|
9439
|
+
bcc: z128.array(MailParticipant2).optional(),
|
9440
|
+
sendAt: z128.string().optional(),
|
9441
|
+
reference: z128.object({
|
9442
|
+
messageId: z128.string(),
|
9443
|
+
action: z128.union([z128.literal("reply"), z128.literal("forward")])
|
9408
9444
|
}).optional(),
|
9409
|
-
attachments:
|
9410
|
-
|
9411
|
-
fileType:
|
9412
|
-
fileName:
|
9413
|
-
fileKey:
|
9414
|
-
fileSize:
|
9415
|
-
bucketName:
|
9416
|
-
presignedUrl:
|
9445
|
+
attachments: z128.array(
|
9446
|
+
z128.object({
|
9447
|
+
fileType: z128.string(),
|
9448
|
+
fileName: z128.string(),
|
9449
|
+
fileKey: z128.string(),
|
9450
|
+
fileSize: z128.number(),
|
9451
|
+
bucketName: z128.string(),
|
9452
|
+
presignedUrl: z128.string()
|
9417
9453
|
})
|
9418
9454
|
).optional()
|
9419
9455
|
}),
|
9420
|
-
output:
|
9421
|
-
response:
|
9422
|
-
messageId:
|
9423
|
-
sendAt:
|
9424
|
-
queueId:
|
9456
|
+
output: z128.object({
|
9457
|
+
response: z128.string(),
|
9458
|
+
messageId: z128.string(),
|
9459
|
+
sendAt: z128.string(),
|
9460
|
+
queueId: z128.string()
|
9425
9461
|
})
|
9426
9462
|
}
|
9427
9463
|
};
|
9428
9464
|
|
9429
9465
|
// src/mail/message-contract.ts
|
9430
|
-
var messageContract =
|
9466
|
+
var messageContract = initContract49().router(
|
9431
9467
|
{
|
9432
9468
|
submit: {
|
9433
9469
|
method: "POST",
|
@@ -9450,8 +9486,8 @@ var messageContract = initContract48().router(
|
|
9450
9486
|
path: "/new_message_count",
|
9451
9487
|
responses: {
|
9452
9488
|
200: DefaultSuccessResponseSchema.extend({
|
9453
|
-
data:
|
9454
|
-
count:
|
9489
|
+
data: z129.object({
|
9490
|
+
count: z129.number()
|
9455
9491
|
})
|
9456
9492
|
}),
|
9457
9493
|
...DefaultResponses
|
@@ -9463,8 +9499,8 @@ var messageContract = initContract48().router(
|
|
9463
9499
|
getById: {
|
9464
9500
|
method: "GET",
|
9465
9501
|
path: "/:id",
|
9466
|
-
pathParams:
|
9467
|
-
id:
|
9502
|
+
pathParams: z129.object({
|
9503
|
+
id: z129.string()
|
9468
9504
|
}),
|
9469
9505
|
responses: {
|
9470
9506
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9479,8 +9515,8 @@ var messageContract = initContract48().router(
|
|
9479
9515
|
update: {
|
9480
9516
|
method: "PATCH",
|
9481
9517
|
path: "/:id",
|
9482
|
-
pathParams:
|
9483
|
-
id:
|
9518
|
+
pathParams: z129.object({
|
9519
|
+
id: z129.string()
|
9484
9520
|
}),
|
9485
9521
|
responses: {
|
9486
9522
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9496,8 +9532,8 @@ var messageContract = initContract48().router(
|
|
9496
9532
|
delete: {
|
9497
9533
|
method: "DELETE",
|
9498
9534
|
path: "/:id",
|
9499
|
-
pathParams:
|
9500
|
-
id:
|
9535
|
+
pathParams: z129.object({
|
9536
|
+
id: z129.string()
|
9501
9537
|
}),
|
9502
9538
|
responses: {
|
9503
9539
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9513,13 +9549,13 @@ var messageContract = initContract48().router(
|
|
9513
9549
|
cancelScheduledMessage: {
|
9514
9550
|
method: "DELETE",
|
9515
9551
|
path: "/scheduled_message/:id",
|
9516
|
-
pathParams:
|
9517
|
-
id:
|
9552
|
+
pathParams: z129.object({
|
9553
|
+
id: z129.string()
|
9518
9554
|
}),
|
9519
9555
|
responses: {
|
9520
9556
|
200: DefaultSuccessResponseSchema.extend({
|
9521
|
-
data:
|
9522
|
-
totalMessagesCount:
|
9557
|
+
data: z129.object({
|
9558
|
+
totalMessagesCount: z129.number()
|
9523
9559
|
})
|
9524
9560
|
}),
|
9525
9561
|
...DefaultResponses
|
@@ -9535,7 +9571,7 @@ var messageContract = initContract48().router(
|
|
9535
9571
|
);
|
9536
9572
|
|
9537
9573
|
// src/mail/mail-contract.ts
|
9538
|
-
var mailContract =
|
9574
|
+
var mailContract = initContract50().router({
|
9539
9575
|
room: roomContract,
|
9540
9576
|
message: messageContract,
|
9541
9577
|
account: accountContract,
|
@@ -9543,44 +9579,44 @@ var mailContract = initContract49().router({
|
|
9543
9579
|
});
|
9544
9580
|
|
9545
9581
|
// src/webchat/index.ts
|
9546
|
-
import { initContract as
|
9582
|
+
import { initContract as initContract51 } from "@ts-rest/core";
|
9547
9583
|
|
9548
9584
|
// src/webchat/schema.ts
|
9549
|
-
import
|
9585
|
+
import z131 from "zod";
|
9550
9586
|
|
9551
9587
|
// src/webchat/validation.ts
|
9552
|
-
import
|
9588
|
+
import z130 from "zod";
|
9553
9589
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
9554
9590
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
9555
9591
|
return ChatwootChannelType3;
|
9556
9592
|
})(ChatwootChannelType2 || {});
|
9557
|
-
var WebChatChannelSchema =
|
9558
|
-
avatar:
|
9559
|
-
name:
|
9560
|
-
type:
|
9561
|
-
websiteName:
|
9562
|
-
welcomeTitle:
|
9563
|
-
websiteUrl:
|
9564
|
-
welcomeTagline:
|
9565
|
-
agentAwayMessage:
|
9566
|
-
widgetColor:
|
9593
|
+
var WebChatChannelSchema = z130.object({
|
9594
|
+
avatar: z130.string().optional(),
|
9595
|
+
name: z130.string(),
|
9596
|
+
type: z130.nativeEnum(ChatwootChannelType2),
|
9597
|
+
websiteName: z130.string(),
|
9598
|
+
welcomeTitle: z130.string(),
|
9599
|
+
websiteUrl: z130.string().url(),
|
9600
|
+
welcomeTagline: z130.string().optional(),
|
9601
|
+
agentAwayMessage: z130.string().optional(),
|
9602
|
+
widgetColor: z130.string().optional()
|
9567
9603
|
});
|
9568
9604
|
|
9569
9605
|
// src/webchat/schema.ts
|
9570
|
-
var ConnectWebChatChannelSchema =
|
9571
|
-
name:
|
9572
|
-
actor:
|
9573
|
-
id:
|
9574
|
-
name:
|
9575
|
-
email:
|
9576
|
-
address:
|
9577
|
-
phone:
|
9606
|
+
var ConnectWebChatChannelSchema = z131.object({
|
9607
|
+
name: z131.string(),
|
9608
|
+
actor: z131.object({
|
9609
|
+
id: z131.string().uuid(),
|
9610
|
+
name: z131.string(),
|
9611
|
+
email: z131.string().email(),
|
9612
|
+
address: z131.string().nullable(),
|
9613
|
+
phone: z131.string().nullable()
|
9578
9614
|
}),
|
9579
9615
|
channel: WebChatChannelSchema
|
9580
9616
|
});
|
9581
9617
|
|
9582
9618
|
// src/webchat/index.ts
|
9583
|
-
var platformWebchatContract =
|
9619
|
+
var platformWebchatContract = initContract51().router({
|
9584
9620
|
sendMessage: {
|
9585
9621
|
method: "POST",
|
9586
9622
|
path: "/message",
|
@@ -9607,33 +9643,33 @@ var platformWebchatContract = initContract50().router({
|
|
9607
9643
|
});
|
9608
9644
|
|
9609
9645
|
// src/hold-label/index.ts
|
9610
|
-
import { initContract as
|
9646
|
+
import { initContract as initContract52 } from "@ts-rest/core";
|
9611
9647
|
|
9612
9648
|
// src/hold-label/schema.ts
|
9613
|
-
import
|
9649
|
+
import z132 from "zod";
|
9614
9650
|
var HoldLabelSchema = DefaultEntitySchema.extend({
|
9615
|
-
name:
|
9616
|
-
position:
|
9651
|
+
name: z132.string(),
|
9652
|
+
position: z132.number()
|
9617
9653
|
});
|
9618
9654
|
|
9619
9655
|
// src/hold-label/index.ts
|
9620
|
-
import
|
9656
|
+
import z134 from "zod";
|
9621
9657
|
|
9622
9658
|
// src/hold-label/validation.ts
|
9623
|
-
import
|
9624
|
-
var UpdatePositionSchema2 =
|
9625
|
-
holdLabels:
|
9626
|
-
|
9659
|
+
import z133 from "zod";
|
9660
|
+
var UpdatePositionSchema2 = z133.object({
|
9661
|
+
holdLabels: z133.array(
|
9662
|
+
z133.object({ id: z133.string().uuid(), position: z133.number() })
|
9627
9663
|
)
|
9628
9664
|
});
|
9629
9665
|
|
9630
9666
|
// src/hold-label/index.ts
|
9631
|
-
var holdLabelContract =
|
9667
|
+
var holdLabelContract = initContract52().router(
|
9632
9668
|
{
|
9633
9669
|
createHoldLabel: {
|
9634
9670
|
method: "POST",
|
9635
9671
|
path: "/",
|
9636
|
-
body:
|
9672
|
+
body: z134.object({ name: z134.string() }),
|
9637
9673
|
responses: {
|
9638
9674
|
201: DefaultSuccessResponseSchema.extend({
|
9639
9675
|
holdLabel: HoldLabelSchema
|
@@ -9645,7 +9681,7 @@ var holdLabelContract = initContract51().router(
|
|
9645
9681
|
path: "/",
|
9646
9682
|
responses: {
|
9647
9683
|
200: DefaultSuccessResponseSchema.extend({
|
9648
|
-
holdLabels:
|
9684
|
+
holdLabels: z134.array(HoldLabelSchema)
|
9649
9685
|
})
|
9650
9686
|
}
|
9651
9687
|
},
|
@@ -9663,8 +9699,8 @@ var holdLabelContract = initContract51().router(
|
|
9663
9699
|
updateHoldLabel: {
|
9664
9700
|
method: "PATCH",
|
9665
9701
|
path: "/:id",
|
9666
|
-
pathParams:
|
9667
|
-
body:
|
9702
|
+
pathParams: z134.object({ id: z134.string().uuid() }),
|
9703
|
+
body: z134.object({ name: z134.string() }),
|
9668
9704
|
responses: {
|
9669
9705
|
200: DefaultSuccessResponseSchema.extend({
|
9670
9706
|
holdLabel: HoldLabelSchema
|
@@ -9674,7 +9710,7 @@ var holdLabelContract = initContract51().router(
|
|
9674
9710
|
deleteHoldLabel: {
|
9675
9711
|
method: "DELETE",
|
9676
9712
|
path: "/:id",
|
9677
|
-
pathParams:
|
9713
|
+
pathParams: z134.object({ id: z134.string().uuid() }),
|
9678
9714
|
body: null,
|
9679
9715
|
responses: {
|
9680
9716
|
200: DefaultSuccessResponseSchema
|
@@ -9685,17 +9721,17 @@ var holdLabelContract = initContract51().router(
|
|
9685
9721
|
path: "/auto-unhold",
|
9686
9722
|
responses: {
|
9687
9723
|
200: DefaultSuccessResponseSchema.extend({
|
9688
|
-
autoUnhold:
|
9724
|
+
autoUnhold: z134.boolean()
|
9689
9725
|
})
|
9690
9726
|
}
|
9691
9727
|
},
|
9692
9728
|
updateAutoUnhold: {
|
9693
9729
|
method: "POST",
|
9694
9730
|
path: "/auto-unhold",
|
9695
|
-
body:
|
9731
|
+
body: z134.object({ autoUnhold: z134.boolean() }),
|
9696
9732
|
responses: {
|
9697
9733
|
200: DefaultSuccessResponseSchema.extend({
|
9698
|
-
autoUnhold:
|
9734
|
+
autoUnhold: z134.boolean()
|
9699
9735
|
})
|
9700
9736
|
}
|
9701
9737
|
}
|
@@ -9732,6 +9768,7 @@ export {
|
|
9732
9768
|
extensionContract2 as extensionContract,
|
9733
9769
|
facebookFeedContract2 as facebookFeedContract,
|
9734
9770
|
feedPostContract,
|
9771
|
+
generalSettingContract,
|
9735
9772
|
generalTagSettingContract,
|
9736
9773
|
holdLabelContract,
|
9737
9774
|
mailContract,
|