@kl1/contracts 1.1.79-uat → 1.1.80-uat
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api-contracts/src/automation-queue/index.d.ts +3410 -0
- package/dist/api-contracts/src/automation-queue/index.d.ts.map +1 -0
- package/dist/api-contracts/src/automation-queue/schema.d.ts +618 -0
- package/dist/api-contracts/src/automation-queue/schema.d.ts.map +1 -0
- package/dist/api-contracts/src/automation-queue/validation.d.ts +52 -0
- package/dist/api-contracts/src/automation-queue/validation.d.ts.map +1 -0
- package/dist/api-contracts/src/chat/index.d.ts +145 -145
- package/dist/api-contracts/src/chat/schema.d.ts +64 -76
- package/dist/api-contracts/src/chat/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +51 -51
- package/dist/api-contracts/src/comment/index.d.ts +1 -1
- package/dist/api-contracts/src/comment/validation.d.ts +1 -1
- package/dist/api-contracts/src/contract.d.ts +219 -219
- package/dist/api-contracts/src/facebook-feed/index.d.ts +43 -43
- package/dist/api-contracts/src/facebook-feed/schema.d.ts +3 -3
- 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/instagram/index.d.ts +33 -33
- package/dist/api-contracts/src/line/index.d.ts +38 -38
- package/dist/api-contracts/src/line/validation.d.ts +5 -5
- package/dist/api-contracts/src/messenger/index.d.ts +33 -33
- package/dist/api-contracts/src/sms/index.d.ts +5 -5
- package/dist/api-contracts/src/viber/index.d.ts +33 -33
- package/dist/api-contracts/src/webchat/index.d.ts +33 -33
- package/dist/entities/src/enums/chat.d.ts +2 -0
- package/dist/entities/src/enums/chat.d.ts.map +1 -1
- package/dist/index.js +490 -387
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +489 -387
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1222,6 +1222,7 @@ var MessageTypeSchema = z30.enum([
|
|
1222
1222
|
"updated",
|
1223
1223
|
"started",
|
1224
1224
|
"edited",
|
1225
|
+
"deleted",
|
1225
1226
|
// unsupported
|
1226
1227
|
"unsupported"
|
1227
1228
|
]);
|
@@ -1229,7 +1230,8 @@ var FeedPostTypeSchema = z30.enum([
|
|
1229
1230
|
"text",
|
1230
1231
|
"added_photos",
|
1231
1232
|
"shared_story",
|
1232
|
-
"mobile_status_update"
|
1233
|
+
"mobile_status_update",
|
1234
|
+
"no_data"
|
1233
1235
|
]);
|
1234
1236
|
var MessageLocaleTypeSchema = z30.enum(["mm", "en", "th", ""]);
|
1235
1237
|
var PlatformContactMetadataSchema = z30.object({
|
@@ -7903,281 +7905,380 @@ var memberSettingContract = initContract41().router(
|
|
7903
7905
|
{ pathPrefix: settingsPathPrefix }
|
7904
7906
|
);
|
7905
7907
|
|
7908
|
+
// src/automation-queue/index.ts
|
7909
|
+
import { initContract as initContract42 } from "@ts-rest/core";
|
7910
|
+
import { z as z111 } from "zod";
|
7911
|
+
|
7912
|
+
// src/automation-queue/validation.ts
|
7913
|
+
import { z as z109 } from "zod";
|
7914
|
+
var CreateAutomationQueueSchema = z109.object({
|
7915
|
+
name: z109.string(),
|
7916
|
+
description: z109.string().nullable(),
|
7917
|
+
managerId: z109.string().uuid(),
|
7918
|
+
agentIds: z109.array(z109.string().uuid()).min(1),
|
7919
|
+
distributionStrategy: z109.string(),
|
7920
|
+
maximumAssignPerAgent: z109.number().positive(),
|
7921
|
+
// ringTimeOut: z.number().positive(),
|
7922
|
+
// retryInterval: z.number().positive(),
|
7923
|
+
// queueTimeOut: z.number().positive(),
|
7924
|
+
isDeniable: z109.boolean()
|
7925
|
+
});
|
7926
|
+
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
7927
|
+
|
7928
|
+
// src/automation-queue/schema.ts
|
7929
|
+
import { z as z110 } from "zod";
|
7930
|
+
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
7931
|
+
name: z110.string(),
|
7932
|
+
description: z110.string().nullable(),
|
7933
|
+
distributionStrategy: z110.string(),
|
7934
|
+
maximumAssignPerAgent: z110.number().positive(),
|
7935
|
+
// ringTimeOut: z.number(),
|
7936
|
+
// retryInterval: z.number(),
|
7937
|
+
// queueTimeOut: z.number(),
|
7938
|
+
isDeniable: z110.boolean(),
|
7939
|
+
manager: UserSchema,
|
7940
|
+
agents: z110.array(UserSchema)
|
7941
|
+
});
|
7942
|
+
|
7943
|
+
// src/automation-queue/index.ts
|
7944
|
+
var automationQueueContract = initContract42().router(
|
7945
|
+
{
|
7946
|
+
createAutomationQueue: {
|
7947
|
+
method: "POST",
|
7948
|
+
path: "",
|
7949
|
+
body: CreateAutomationQueueSchema,
|
7950
|
+
responses: {
|
7951
|
+
201: DefaultSuccessResponseSchema.extend({
|
7952
|
+
data: AutomationQueueSchema.optional()
|
7953
|
+
})
|
7954
|
+
}
|
7955
|
+
},
|
7956
|
+
getAllAutomationQueues: {
|
7957
|
+
method: "GET",
|
7958
|
+
path: "",
|
7959
|
+
responses: {
|
7960
|
+
200: DefaultSuccessResponseSchema.extend({
|
7961
|
+
data: z111.array(AutomationQueueSchema)
|
7962
|
+
})
|
7963
|
+
}
|
7964
|
+
},
|
7965
|
+
getAutomationQueueById: {
|
7966
|
+
method: "GET",
|
7967
|
+
path: "/:id",
|
7968
|
+
pathParams: z111.object({
|
7969
|
+
id: z111.string().uuid()
|
7970
|
+
}),
|
7971
|
+
responses: {
|
7972
|
+
200: DefaultSuccessResponseSchema.extend({
|
7973
|
+
data: AutomationQueueSchema
|
7974
|
+
})
|
7975
|
+
}
|
7976
|
+
},
|
7977
|
+
updateAutomationQueue: {
|
7978
|
+
method: "PATCH",
|
7979
|
+
path: "/:id",
|
7980
|
+
pathParams: z111.object({
|
7981
|
+
id: z111.string().uuid()
|
7982
|
+
}),
|
7983
|
+
body: UpdateAutomationQueueSchema,
|
7984
|
+
responses: {
|
7985
|
+
200: DefaultSuccessResponseSchema.extend({
|
7986
|
+
data: AutomationQueueSchema
|
7987
|
+
})
|
7988
|
+
}
|
7989
|
+
},
|
7990
|
+
deleteAutomationQueue: {
|
7991
|
+
method: "DELETE",
|
7992
|
+
path: "/:id",
|
7993
|
+
pathParams: z111.object({
|
7994
|
+
id: z111.string().uuid()
|
7995
|
+
}),
|
7996
|
+
body: null,
|
7997
|
+
responses: {
|
7998
|
+
200: DefaultSuccessResponseSchema.extend({
|
7999
|
+
message: z111.string()
|
8000
|
+
})
|
8001
|
+
}
|
8002
|
+
}
|
8003
|
+
},
|
8004
|
+
{ pathPrefix: "/automation-queue" }
|
8005
|
+
);
|
8006
|
+
|
7906
8007
|
// src/mail/mail-contract.ts
|
7907
|
-
import { initContract as
|
8008
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
7908
8009
|
|
7909
8010
|
// src/mail/room-contract.ts
|
7910
|
-
import { initContract as
|
7911
|
-
import
|
8011
|
+
import { initContract as initContract43 } from "@ts-rest/core";
|
8012
|
+
import z116 from "zod";
|
7912
8013
|
|
7913
8014
|
// src/mail/schemas/room.schema.ts
|
7914
|
-
import
|
8015
|
+
import z114 from "zod";
|
7915
8016
|
|
7916
8017
|
// src/mail/schemas/account.schema.ts
|
7917
|
-
import
|
7918
|
-
var MailServerSchema =
|
7919
|
-
id:
|
7920
|
-
createdAt:
|
7921
|
-
updatedAt:
|
7922
|
-
deletedAt:
|
7923
|
-
name:
|
7924
|
-
smtpHost:
|
7925
|
-
smtpPort:
|
7926
|
-
smtpTlsPort:
|
7927
|
-
useTlsForSmtp:
|
7928
|
-
imapHost:
|
7929
|
-
imapPort:
|
7930
|
-
imapTlsPort:
|
7931
|
-
useTlsForImap:
|
7932
|
-
});
|
7933
|
-
var MailAccountSchema =
|
7934
|
-
id:
|
7935
|
-
createdAt:
|
7936
|
-
updatedAt:
|
7937
|
-
deletedAt:
|
7938
|
-
name:
|
7939
|
-
address:
|
7940
|
-
accountId:
|
7941
|
-
mailServerId:
|
8018
|
+
import z112 from "zod";
|
8019
|
+
var MailServerSchema = z112.object({
|
8020
|
+
id: z112.string(),
|
8021
|
+
createdAt: z112.date(),
|
8022
|
+
updatedAt: z112.date(),
|
8023
|
+
deletedAt: z112.date().nullable(),
|
8024
|
+
name: z112.string(),
|
8025
|
+
smtpHost: z112.string(),
|
8026
|
+
smtpPort: z112.number(),
|
8027
|
+
smtpTlsPort: z112.number(),
|
8028
|
+
useTlsForSmtp: z112.boolean(),
|
8029
|
+
imapHost: z112.string(),
|
8030
|
+
imapPort: z112.number(),
|
8031
|
+
imapTlsPort: z112.number(),
|
8032
|
+
useTlsForImap: z112.boolean()
|
8033
|
+
});
|
8034
|
+
var MailAccountSchema = z112.object({
|
8035
|
+
id: z112.string(),
|
8036
|
+
createdAt: z112.date(),
|
8037
|
+
updatedAt: z112.date(),
|
8038
|
+
deletedAt: z112.date().nullable(),
|
8039
|
+
name: z112.string(),
|
8040
|
+
address: z112.string(),
|
8041
|
+
accountId: z112.string(),
|
8042
|
+
mailServerId: z112.string(),
|
7942
8043
|
mailServer: MailServerSchema,
|
7943
|
-
state:
|
7944
|
-
|
7945
|
-
|
7946
|
-
|
7947
|
-
|
7948
|
-
|
7949
|
-
|
7950
|
-
|
7951
|
-
|
8044
|
+
state: z112.union([
|
8045
|
+
z112.literal("init"),
|
8046
|
+
z112.literal("syncing"),
|
8047
|
+
z112.literal("connecting"),
|
8048
|
+
z112.literal("connected"),
|
8049
|
+
z112.literal("disconnected"),
|
8050
|
+
z112.literal("authenticationError"),
|
8051
|
+
z112.literal("connectError"),
|
8052
|
+
z112.literal("unset")
|
7952
8053
|
])
|
7953
8054
|
});
|
7954
8055
|
|
7955
8056
|
// src/mail/schemas/message.schema.ts
|
7956
|
-
import
|
7957
|
-
var AttachmentSchema =
|
7958
|
-
id:
|
7959
|
-
createdAt:
|
7960
|
-
updatedAt:
|
7961
|
-
deletedAt:
|
7962
|
-
roomId:
|
7963
|
-
messageId:
|
7964
|
-
fileName:
|
7965
|
-
fileType:
|
7966
|
-
emailEngineAttachmentId:
|
7967
|
-
uploadId:
|
7968
|
-
upload:
|
7969
|
-
id:
|
7970
|
-
createdAt:
|
7971
|
-
updatedAt:
|
7972
|
-
deletedAt:
|
7973
|
-
bucketName:
|
7974
|
-
fileName:
|
7975
|
-
fileKey:
|
7976
|
-
fileSize:
|
7977
|
-
fileUrl:
|
7978
|
-
extensionName:
|
8057
|
+
import z113 from "zod";
|
8058
|
+
var AttachmentSchema = z113.object({
|
8059
|
+
id: z113.string(),
|
8060
|
+
createdAt: z113.date(),
|
8061
|
+
updatedAt: z113.date(),
|
8062
|
+
deletedAt: z113.nullable(z113.date()),
|
8063
|
+
roomId: z113.string(),
|
8064
|
+
messageId: z113.string(),
|
8065
|
+
fileName: z113.string(),
|
8066
|
+
fileType: z113.string(),
|
8067
|
+
emailEngineAttachmentId: z113.string(),
|
8068
|
+
uploadId: z113.string(),
|
8069
|
+
upload: z113.object({
|
8070
|
+
id: z113.string(),
|
8071
|
+
createdAt: z113.date(),
|
8072
|
+
updatedAt: z113.date(),
|
8073
|
+
deletedAt: z113.nullable(z113.date()),
|
8074
|
+
bucketName: z113.string(),
|
8075
|
+
fileName: z113.string(),
|
8076
|
+
fileKey: z113.string(),
|
8077
|
+
fileSize: z113.number(),
|
8078
|
+
fileUrl: z113.string(),
|
8079
|
+
extensionName: z113.string()
|
7979
8080
|
})
|
7980
8081
|
});
|
7981
|
-
var MessageSchema2 =
|
7982
|
-
id:
|
7983
|
-
createdAt:
|
7984
|
-
updatedAt:
|
7985
|
-
deletedAt:
|
7986
|
-
roomId:
|
7987
|
-
subject:
|
7988
|
-
textPlain:
|
7989
|
-
textHtml:
|
7990
|
-
textId:
|
7991
|
-
emailEngineEmailId:
|
7992
|
-
emailEngineMessageId:
|
7993
|
-
emailEngineReplyTo:
|
7994
|
-
direction:
|
7995
|
-
date:
|
7996
|
-
action:
|
7997
|
-
unseen:
|
7998
|
-
sendAt:
|
7999
|
-
starred:
|
8000
|
-
seemsLikeNew:
|
8001
|
-
from:
|
8002
|
-
to:
|
8003
|
-
cc:
|
8004
|
-
bcc:
|
8005
|
-
attachments:
|
8082
|
+
var MessageSchema2 = z113.object({
|
8083
|
+
id: z113.string(),
|
8084
|
+
createdAt: z113.date(),
|
8085
|
+
updatedAt: z113.date(),
|
8086
|
+
deletedAt: z113.nullable(z113.date()),
|
8087
|
+
roomId: z113.string(),
|
8088
|
+
subject: z113.string(),
|
8089
|
+
textPlain: z113.string(),
|
8090
|
+
textHtml: z113.string(),
|
8091
|
+
textId: z113.string(),
|
8092
|
+
emailEngineEmailId: z113.string(),
|
8093
|
+
emailEngineMessageId: z113.string(),
|
8094
|
+
emailEngineReplyTo: z113.nullable(z113.string()),
|
8095
|
+
direction: z113.string(),
|
8096
|
+
date: z113.date(),
|
8097
|
+
action: z113.string(),
|
8098
|
+
unseen: z113.boolean(),
|
8099
|
+
sendAt: z113.date(),
|
8100
|
+
starred: z113.boolean(),
|
8101
|
+
seemsLikeNew: z113.boolean(),
|
8102
|
+
from: z113.array(MailParticipant),
|
8103
|
+
to: z113.array(MailParticipant),
|
8104
|
+
cc: z113.array(MailParticipant),
|
8105
|
+
bcc: z113.array(MailParticipant),
|
8106
|
+
attachments: z113.array(AttachmentSchema)
|
8006
8107
|
});
|
8007
8108
|
|
8008
8109
|
// src/mail/schemas/room.schema.ts
|
8009
|
-
var ContactSchema3 =
|
8010
|
-
id:
|
8011
|
-
createdAt:
|
8012
|
-
updatedAt:
|
8013
|
-
deletedAt:
|
8014
|
-
name:
|
8015
|
-
address:
|
8016
|
-
channel:
|
8017
|
-
notes:
|
8018
|
-
contactProfile:
|
8019
|
-
socialProfileUrl:
|
8020
|
-
});
|
8021
|
-
var MailUserSchema =
|
8022
|
-
id:
|
8023
|
-
createdAt:
|
8024
|
-
updatedAt:
|
8025
|
-
deletedAt:
|
8026
|
-
name:
|
8027
|
-
address:
|
8028
|
-
contactId:
|
8110
|
+
var ContactSchema3 = z114.object({
|
8111
|
+
id: z114.string().uuid(),
|
8112
|
+
createdAt: z114.date(),
|
8113
|
+
updatedAt: z114.date(),
|
8114
|
+
deletedAt: z114.date().nullable(),
|
8115
|
+
name: z114.string(),
|
8116
|
+
address: z114.string().nullable(),
|
8117
|
+
channel: z114.string().nullable(),
|
8118
|
+
notes: z114.string().nullable(),
|
8119
|
+
contactProfile: z114.string().nullable(),
|
8120
|
+
socialProfileUrl: z114.string().nullable()
|
8121
|
+
});
|
8122
|
+
var MailUserSchema = z114.object({
|
8123
|
+
id: z114.string(),
|
8124
|
+
createdAt: z114.date(),
|
8125
|
+
updatedAt: z114.date(),
|
8126
|
+
deletedAt: z114.date().nullable(),
|
8127
|
+
name: z114.string(),
|
8128
|
+
address: z114.string(),
|
8129
|
+
contactId: z114.string(),
|
8029
8130
|
contact: ContactSchema3,
|
8030
|
-
isNewContact:
|
8031
|
-
});
|
8032
|
-
var MailParticipant =
|
8033
|
-
id:
|
8034
|
-
createdAt:
|
8035
|
-
updatedAt:
|
8036
|
-
deletedAt:
|
8037
|
-
roomId:
|
8038
|
-
messageId:
|
8039
|
-
mailUserId:
|
8131
|
+
isNewContact: z114.boolean()
|
8132
|
+
});
|
8133
|
+
var MailParticipant = z114.object({
|
8134
|
+
id: z114.string(),
|
8135
|
+
createdAt: z114.date(),
|
8136
|
+
updatedAt: z114.date(),
|
8137
|
+
deletedAt: z114.date().nullable(),
|
8138
|
+
roomId: z114.string(),
|
8139
|
+
messageId: z114.string(),
|
8140
|
+
mailUserId: z114.string(),
|
8040
8141
|
mailUser: MailUserSchema
|
8041
8142
|
});
|
8042
|
-
var TagSchema2 =
|
8043
|
-
color:
|
8044
|
-
id:
|
8045
|
-
createdAt:
|
8046
|
-
updatedAt:
|
8047
|
-
deletedAt:
|
8048
|
-
name:
|
8049
|
-
});
|
8050
|
-
var UserModel =
|
8051
|
-
id:
|
8052
|
-
createdAt:
|
8053
|
-
updatedAt:
|
8054
|
-
deletedAt:
|
8055
|
-
name:
|
8056
|
-
email:
|
8057
|
-
address:
|
8058
|
-
phone:
|
8059
|
-
notificationCount:
|
8060
|
-
});
|
8061
|
-
var ActivityLogModel =
|
8062
|
-
id:
|
8063
|
-
createdAt:
|
8064
|
-
updatedAt:
|
8065
|
-
deletedAt:
|
8066
|
-
description:
|
8067
|
-
actorId:
|
8068
|
-
roomId:
|
8143
|
+
var TagSchema2 = z114.object({
|
8144
|
+
color: z114.string(),
|
8145
|
+
id: z114.string(),
|
8146
|
+
createdAt: z114.date(),
|
8147
|
+
updatedAt: z114.date(),
|
8148
|
+
deletedAt: z114.date().nullable(),
|
8149
|
+
name: z114.string()
|
8150
|
+
});
|
8151
|
+
var UserModel = z114.object({
|
8152
|
+
id: z114.string().uuid(),
|
8153
|
+
createdAt: z114.date(),
|
8154
|
+
updatedAt: z114.date(),
|
8155
|
+
deletedAt: z114.date().nullable(),
|
8156
|
+
name: z114.string(),
|
8157
|
+
email: z114.string(),
|
8158
|
+
address: z114.string().nullable(),
|
8159
|
+
phone: z114.string().nullable(),
|
8160
|
+
notificationCount: z114.number().nullable()
|
8161
|
+
});
|
8162
|
+
var ActivityLogModel = z114.object({
|
8163
|
+
id: z114.string(),
|
8164
|
+
createdAt: z114.date(),
|
8165
|
+
updatedAt: z114.date(),
|
8166
|
+
deletedAt: z114.nullable(z114.string()),
|
8167
|
+
description: z114.string(),
|
8168
|
+
actorId: z114.string(),
|
8169
|
+
roomId: z114.string(),
|
8069
8170
|
actor: UserModel
|
8070
8171
|
});
|
8071
|
-
var MessagesAndLogsSchema =
|
8072
|
-
|
8172
|
+
var MessagesAndLogsSchema = z114.array(
|
8173
|
+
z114.union([MessageSchema2, ActivityLogModel])
|
8073
8174
|
);
|
8074
|
-
var MailRoomSchema =
|
8075
|
-
id:
|
8076
|
-
createdAt:
|
8077
|
-
updatedAt:
|
8078
|
-
deletedAt:
|
8079
|
-
subject:
|
8080
|
-
resolved:
|
8081
|
-
assigneeId:
|
8082
|
-
note:
|
8083
|
-
mailId:
|
8084
|
-
direction:
|
8085
|
-
lastMessageId:
|
8086
|
-
firstMessageId:
|
8087
|
-
from:
|
8088
|
-
to:
|
8089
|
-
cc:
|
8090
|
-
bcc:
|
8175
|
+
var MailRoomSchema = z114.object({
|
8176
|
+
id: z114.string(),
|
8177
|
+
createdAt: z114.date(),
|
8178
|
+
updatedAt: z114.date(),
|
8179
|
+
deletedAt: z114.date().nullable(),
|
8180
|
+
subject: z114.string(),
|
8181
|
+
resolved: z114.boolean(),
|
8182
|
+
assigneeId: z114.string().nullable(),
|
8183
|
+
note: z114.string(),
|
8184
|
+
mailId: z114.string(),
|
8185
|
+
direction: z114.string(),
|
8186
|
+
lastMessageId: z114.string(),
|
8187
|
+
firstMessageId: z114.string(),
|
8188
|
+
from: z114.array(MailParticipant),
|
8189
|
+
to: z114.array(MailParticipant),
|
8190
|
+
cc: z114.array(MailParticipant),
|
8191
|
+
bcc: z114.array(MailParticipant),
|
8091
8192
|
firstMessage: MessageSchema2,
|
8092
8193
|
lastMessage: MessageSchema2,
|
8093
|
-
tags:
|
8194
|
+
tags: z114.array(TagSchema2),
|
8094
8195
|
assignee: UserModel,
|
8095
|
-
messages:
|
8196
|
+
messages: z114.array(MessageSchema2),
|
8096
8197
|
messagesAndLogs: MessagesAndLogsSchema,
|
8097
8198
|
mail: MailAccountSchema,
|
8098
|
-
unReadMessageCount:
|
8199
|
+
unReadMessageCount: z114.number(),
|
8099
8200
|
cxlog: CxLogSchema
|
8100
8201
|
});
|
8101
|
-
var AttachmentSchema2 =
|
8102
|
-
fileName:
|
8103
|
-
fileType:
|
8104
|
-
emailEngineAttachmentId:
|
8105
|
-
uploadId:
|
8106
|
-
messageId:
|
8107
|
-
roomId:
|
8202
|
+
var AttachmentSchema2 = z114.object({
|
8203
|
+
fileName: z114.string(),
|
8204
|
+
fileType: z114.string(),
|
8205
|
+
emailEngineAttachmentId: z114.string(),
|
8206
|
+
uploadId: z114.string(),
|
8207
|
+
messageId: z114.string(),
|
8208
|
+
roomId: z114.string(),
|
8108
8209
|
upload: UploadSchema
|
8109
8210
|
});
|
8110
8211
|
|
8111
8212
|
// src/mail/schemas/room-validation.schema.ts
|
8112
|
-
import
|
8213
|
+
import z115 from "zod";
|
8113
8214
|
var RoomContractsValidationSchema = {
|
8114
8215
|
getAll: {
|
8115
|
-
input:
|
8116
|
-
page:
|
8117
|
-
pageSize:
|
8118
|
-
keyword:
|
8119
|
-
value:
|
8120
|
-
category:
|
8216
|
+
input: z115.object({
|
8217
|
+
page: z115.coerce.number().default(1),
|
8218
|
+
pageSize: z115.coerce.number().default(10),
|
8219
|
+
keyword: z115.object({
|
8220
|
+
value: z115.string(),
|
8221
|
+
category: z115.union([z115.literal("contact"), z115.literal("message")])
|
8121
8222
|
}).optional(),
|
8122
|
-
contactLabels:
|
8123
|
-
channels:
|
8124
|
-
date:
|
8125
|
-
contacts:
|
8126
|
-
assignees:
|
8127
|
-
level1:
|
8128
|
-
|
8129
|
-
|
8130
|
-
|
8131
|
-
|
8132
|
-
|
8133
|
-
|
8223
|
+
contactLabels: z115.array(z115.string()).optional(),
|
8224
|
+
channels: z115.array(z115.string().email()).optional(),
|
8225
|
+
date: z115.string().optional(),
|
8226
|
+
contacts: z115.array(z115.string()).optional(),
|
8227
|
+
assignees: z115.array(z115.string()).optional(),
|
8228
|
+
level1: z115.union([
|
8229
|
+
z115.literal("open"),
|
8230
|
+
z115.literal("close"),
|
8231
|
+
z115.literal("inbox"),
|
8232
|
+
z115.literal("sent"),
|
8233
|
+
z115.literal("scheduled"),
|
8234
|
+
z115.literal("starred")
|
8134
8235
|
]).optional(),
|
8135
|
-
level2:
|
8136
|
-
|
8137
|
-
|
8138
|
-
|
8139
|
-
|
8236
|
+
level2: z115.union([
|
8237
|
+
z115.literal("all"),
|
8238
|
+
z115.literal("unassign"),
|
8239
|
+
z115.literal("mine"),
|
8240
|
+
z115.literal("other")
|
8140
8241
|
]).optional()
|
8141
8242
|
}),
|
8142
|
-
output:
|
8143
|
-
data:
|
8144
|
-
total:
|
8145
|
-
page:
|
8146
|
-
pageSize:
|
8243
|
+
output: z115.object({
|
8244
|
+
data: z115.array(MailRoomSchema),
|
8245
|
+
total: z115.number(),
|
8246
|
+
page: z115.number(),
|
8247
|
+
pageSize: z115.number()
|
8147
8248
|
})
|
8148
8249
|
},
|
8149
8250
|
update: {
|
8150
|
-
input:
|
8151
|
-
disposition:
|
8152
|
-
|
8153
|
-
|
8154
|
-
|
8155
|
-
|
8156
|
-
|
8157
|
-
|
8251
|
+
input: z115.object({
|
8252
|
+
disposition: z115.union([
|
8253
|
+
z115.literal("resolved"),
|
8254
|
+
z115.literal("follow up"),
|
8255
|
+
z115.literal("escalated"),
|
8256
|
+
z115.literal("dropped"),
|
8257
|
+
z115.literal("prank"),
|
8258
|
+
z115.literal("blank")
|
8158
8259
|
]).optional().nullable(),
|
8159
|
-
assigneeId:
|
8160
|
-
note:
|
8161
|
-
tags:
|
8162
|
-
handover:
|
8163
|
-
|
8260
|
+
assigneeId: z115.string().uuid().optional().nullable(),
|
8261
|
+
note: z115.string().optional(),
|
8262
|
+
tags: z115.array(z115.string().uuid()).optional(),
|
8263
|
+
handover: z115.boolean().or(
|
8264
|
+
z115.union([z115.literal("true"), z115.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8164
8265
|
).optional().nullable(),
|
8165
|
-
selfAssign:
|
8166
|
-
|
8266
|
+
selfAssign: z115.boolean().or(
|
8267
|
+
z115.union([z115.literal("true"), z115.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
8167
8268
|
).optional().nullable()
|
8168
8269
|
})
|
8169
8270
|
}
|
8170
8271
|
};
|
8171
8272
|
|
8172
8273
|
// src/mail/room-contract.ts
|
8173
|
-
var roomContract =
|
8274
|
+
var roomContract = initContract43().router(
|
8174
8275
|
{
|
8175
8276
|
create: {
|
8176
8277
|
method: "POST",
|
8177
8278
|
path: "/",
|
8178
8279
|
responses: {
|
8179
8280
|
200: DefaultSuccessResponseSchema.extend({
|
8180
|
-
message:
|
8281
|
+
message: z116.string()
|
8181
8282
|
}),
|
8182
8283
|
...DefaultResponses
|
8183
8284
|
},
|
@@ -8190,10 +8291,10 @@ var roomContract = initContract42().router(
|
|
8190
8291
|
query: RoomContractsValidationSchema.getAll.input,
|
8191
8292
|
responses: {
|
8192
8293
|
200: DefaultSuccessResponseSchema.extend({
|
8193
|
-
data:
|
8194
|
-
total:
|
8195
|
-
page:
|
8196
|
-
pageSize:
|
8294
|
+
data: z116.array(MailRoomSchema),
|
8295
|
+
total: z116.number(),
|
8296
|
+
page: z116.number(),
|
8297
|
+
pageSize: z116.number()
|
8197
8298
|
}),
|
8198
8299
|
...DefaultResponses
|
8199
8300
|
},
|
@@ -8205,24 +8306,24 @@ var roomContract = initContract42().router(
|
|
8205
8306
|
path: "/count_rooms/all",
|
8206
8307
|
responses: {
|
8207
8308
|
200: DefaultSuccessResponseSchema.extend({
|
8208
|
-
data:
|
8209
|
-
general:
|
8210
|
-
|
8211
|
-
name:
|
8212
|
-
count:
|
8213
|
-
unReadMessagesCount:
|
8309
|
+
data: z116.object({
|
8310
|
+
general: z116.array(
|
8311
|
+
z116.object({
|
8312
|
+
name: z116.string(),
|
8313
|
+
count: z116.number(),
|
8314
|
+
unReadMessagesCount: z116.number()
|
8214
8315
|
})
|
8215
8316
|
),
|
8216
|
-
channels:
|
8217
|
-
|
8317
|
+
channels: z116.array(
|
8318
|
+
z116.object({
|
8218
8319
|
channel: MailAccountSchema,
|
8219
|
-
count:
|
8320
|
+
count: z116.number()
|
8220
8321
|
})
|
8221
8322
|
),
|
8222
|
-
contactLabels:
|
8223
|
-
|
8323
|
+
contactLabels: z116.array(
|
8324
|
+
z116.object({
|
8224
8325
|
label: TagSchema,
|
8225
|
-
count:
|
8326
|
+
count: z116.number()
|
8226
8327
|
})
|
8227
8328
|
)
|
8228
8329
|
})
|
@@ -8234,12 +8335,12 @@ var roomContract = initContract42().router(
|
|
8234
8335
|
getAttachments: {
|
8235
8336
|
method: "GET",
|
8236
8337
|
path: "/:id/attachments",
|
8237
|
-
pathParams:
|
8238
|
-
id:
|
8338
|
+
pathParams: z116.object({
|
8339
|
+
id: z116.string().uuid()
|
8239
8340
|
}),
|
8240
8341
|
responses: {
|
8241
8342
|
200: DefaultSuccessResponseSchema.extend({
|
8242
|
-
data:
|
8343
|
+
data: z116.array(AttachmentSchema2)
|
8243
8344
|
}),
|
8244
8345
|
...DefaultResponses
|
8245
8346
|
},
|
@@ -8248,12 +8349,12 @@ var roomContract = initContract42().router(
|
|
8248
8349
|
getParticipants: {
|
8249
8350
|
method: "GET",
|
8250
8351
|
path: "/:id/participants",
|
8251
|
-
pathParams:
|
8252
|
-
id:
|
8352
|
+
pathParams: z116.object({
|
8353
|
+
id: z116.string().uuid()
|
8253
8354
|
}),
|
8254
8355
|
responses: {
|
8255
8356
|
200: DefaultSuccessResponseSchema.extend({
|
8256
|
-
data:
|
8357
|
+
data: z116.array(MailParticipant)
|
8257
8358
|
}),
|
8258
8359
|
...DefaultResponses
|
8259
8360
|
},
|
@@ -8264,22 +8365,22 @@ var roomContract = initContract42().router(
|
|
8264
8365
|
path: "/add_email_to_contact",
|
8265
8366
|
responses: {
|
8266
8367
|
200: DefaultSuccessResponseSchema.extend({
|
8267
|
-
data:
|
8368
|
+
data: z116.string()
|
8268
8369
|
}),
|
8269
8370
|
...DefaultResponses
|
8270
8371
|
},
|
8271
|
-
body:
|
8272
|
-
email:
|
8273
|
-
contactId:
|
8274
|
-
mailUserId:
|
8372
|
+
body: z116.object({
|
8373
|
+
email: z116.string(),
|
8374
|
+
contactId: z116.string(),
|
8375
|
+
mailUserId: z116.string()
|
8275
8376
|
}),
|
8276
8377
|
summary: "Add a new email of a mail room participant to an existing contact"
|
8277
8378
|
},
|
8278
8379
|
update: {
|
8279
8380
|
method: "PATCH",
|
8280
8381
|
path: "/:id",
|
8281
|
-
pathParams:
|
8282
|
-
id:
|
8382
|
+
pathParams: z116.object({
|
8383
|
+
id: z116.string()
|
8283
8384
|
}),
|
8284
8385
|
responses: {
|
8285
8386
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8293,12 +8394,12 @@ var roomContract = initContract42().router(
|
|
8293
8394
|
markAsRead: {
|
8294
8395
|
method: "POST",
|
8295
8396
|
path: "/mark_as_read",
|
8296
|
-
body:
|
8297
|
-
id:
|
8397
|
+
body: z116.object({
|
8398
|
+
id: z116.string()
|
8298
8399
|
}),
|
8299
8400
|
responses: {
|
8300
8401
|
200: DefaultSuccessResponseSchema.extend({
|
8301
|
-
message:
|
8402
|
+
message: z116.string()
|
8302
8403
|
}),
|
8303
8404
|
...DefaultResponses
|
8304
8405
|
},
|
@@ -8307,8 +8408,8 @@ var roomContract = initContract42().router(
|
|
8307
8408
|
getById: {
|
8308
8409
|
method: "GET",
|
8309
8410
|
path: "/:id",
|
8310
|
-
pathParams:
|
8311
|
-
id:
|
8411
|
+
pathParams: z116.object({
|
8412
|
+
id: z116.string().uuid()
|
8312
8413
|
}),
|
8313
8414
|
responses: {
|
8314
8415
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8325,55 +8426,55 @@ var roomContract = initContract42().router(
|
|
8325
8426
|
);
|
8326
8427
|
|
8327
8428
|
// src/mail/account-contract.ts
|
8328
|
-
import { initContract as
|
8329
|
-
import
|
8429
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
8430
|
+
import z118 from "zod";
|
8330
8431
|
|
8331
8432
|
// src/mail/schemas/account-validation.schema.ts
|
8332
|
-
import
|
8433
|
+
import z117 from "zod";
|
8333
8434
|
var AccountContractsValidationSchemas = {
|
8334
8435
|
create: {
|
8335
|
-
input:
|
8336
|
-
address:
|
8337
|
-
name:
|
8338
|
-
password:
|
8339
|
-
mailServerId:
|
8436
|
+
input: z117.object({
|
8437
|
+
address: z117.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
8438
|
+
name: z117.string().min(1, "Account name cannot be empty."),
|
8439
|
+
password: z117.string().min(1, "Password cannot be empty."),
|
8440
|
+
mailServerId: z117.string().uuid("Invalid mail_server_id")
|
8340
8441
|
})
|
8341
8442
|
},
|
8342
8443
|
getById: {
|
8343
|
-
input:
|
8344
|
-
id:
|
8444
|
+
input: z117.object({
|
8445
|
+
id: z117.string().uuid()
|
8345
8446
|
}),
|
8346
8447
|
output: MailAccountSchema
|
8347
8448
|
},
|
8348
8449
|
getAll: {
|
8349
|
-
output:
|
8450
|
+
output: z117.array(MailAccountSchema)
|
8350
8451
|
},
|
8351
8452
|
update: {
|
8352
8453
|
input: MailAccountSchema,
|
8353
8454
|
output: MailAccountSchema
|
8354
8455
|
},
|
8355
8456
|
disconnect: {
|
8356
|
-
input:
|
8357
|
-
id:
|
8457
|
+
input: z117.object({
|
8458
|
+
id: z117.string().uuid()
|
8358
8459
|
}),
|
8359
8460
|
output: MailAccountSchema
|
8360
8461
|
},
|
8361
8462
|
reconnect: {
|
8362
|
-
input:
|
8363
|
-
id:
|
8463
|
+
input: z117.object({
|
8464
|
+
id: z117.string()
|
8364
8465
|
}),
|
8365
8466
|
output: MailAccountSchema
|
8366
8467
|
},
|
8367
8468
|
delete: {
|
8368
|
-
input:
|
8369
|
-
id:
|
8469
|
+
input: z117.object({
|
8470
|
+
id: z117.string()
|
8370
8471
|
}),
|
8371
8472
|
output: MailAccountSchema
|
8372
8473
|
}
|
8373
8474
|
};
|
8374
8475
|
|
8375
8476
|
// src/mail/account-contract.ts
|
8376
|
-
var accountContract =
|
8477
|
+
var accountContract = initContract44().router(
|
8377
8478
|
{
|
8378
8479
|
//#region ........register account
|
8379
8480
|
create: {
|
@@ -8384,14 +8485,14 @@ var accountContract = initContract43().router(
|
|
8384
8485
|
// data: AccountContractsValidationSchemas.create.output,
|
8385
8486
|
data: MailAccountSchema
|
8386
8487
|
}),
|
8387
|
-
400:
|
8388
|
-
message:
|
8488
|
+
400: z118.object({
|
8489
|
+
message: z118.string()
|
8389
8490
|
}),
|
8390
|
-
409:
|
8391
|
-
message:
|
8491
|
+
409: z118.object({
|
8492
|
+
message: z118.string()
|
8392
8493
|
}),
|
8393
|
-
500:
|
8394
|
-
message:
|
8494
|
+
500: z118.object({
|
8495
|
+
message: z118.string()
|
8395
8496
|
}),
|
8396
8497
|
...DefaultResponses
|
8397
8498
|
},
|
@@ -8405,7 +8506,7 @@ var accountContract = initContract43().router(
|
|
8405
8506
|
path: "/sync",
|
8406
8507
|
responses: {
|
8407
8508
|
200: DefaultSuccessResponseSchema.extend({
|
8408
|
-
message:
|
8509
|
+
message: z118.string()
|
8409
8510
|
}),
|
8410
8511
|
...DefaultResponses
|
8411
8512
|
},
|
@@ -8430,13 +8531,13 @@ var accountContract = initContract43().router(
|
|
8430
8531
|
getAll: {
|
8431
8532
|
method: "GET",
|
8432
8533
|
path: "",
|
8433
|
-
query:
|
8434
|
-
state:
|
8435
|
-
withDeleted:
|
8534
|
+
query: z118.object({
|
8535
|
+
state: z118.union([z118.literal("connected"), z118.literal("disconnected")]).optional(),
|
8536
|
+
withDeleted: z118.boolean().default(false)
|
8436
8537
|
}).optional(),
|
8437
8538
|
responses: {
|
8438
8539
|
200: DefaultSuccessResponseSchema.extend({
|
8439
|
-
data:
|
8540
|
+
data: z118.array(MailAccountSchema)
|
8440
8541
|
}),
|
8441
8542
|
...DefaultResponses
|
8442
8543
|
},
|
@@ -8447,8 +8548,8 @@ var accountContract = initContract43().router(
|
|
8447
8548
|
update: {
|
8448
8549
|
method: "PATCH",
|
8449
8550
|
path: "/:id",
|
8450
|
-
pathParams:
|
8451
|
-
id:
|
8551
|
+
pathParams: z118.object({
|
8552
|
+
id: z118.string().uuid()
|
8452
8553
|
}),
|
8453
8554
|
responses: {
|
8454
8555
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -8497,7 +8598,7 @@ var accountContract = initContract43().router(
|
|
8497
8598
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
8498
8599
|
responses: {
|
8499
8600
|
200: DefaultSuccessResponseSchema.extend({
|
8500
|
-
message:
|
8601
|
+
message: z118.string()
|
8501
8602
|
}),
|
8502
8603
|
...DefaultResponses
|
8503
8604
|
},
|
@@ -8513,25 +8614,25 @@ var accountContract = initContract43().router(
|
|
8513
8614
|
);
|
8514
8615
|
|
8515
8616
|
// src/mail/mail-server-contract.ts
|
8516
|
-
import { initContract as
|
8517
|
-
import
|
8617
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
8618
|
+
import z120 from "zod";
|
8518
8619
|
|
8519
8620
|
// src/mail/schemas/servers-validation.schema.ts
|
8520
|
-
import
|
8521
|
-
var CreateMailServerSchema =
|
8522
|
-
name:
|
8523
|
-
smtpHost:
|
8524
|
-
smtpPort:
|
8525
|
-
smtpTlsPort:
|
8526
|
-
useTlsForSmtp:
|
8527
|
-
imapHost:
|
8528
|
-
imapPort:
|
8529
|
-
imapTlsPort:
|
8530
|
-
useTlsForImap:
|
8621
|
+
import z119 from "zod";
|
8622
|
+
var CreateMailServerSchema = z119.object({
|
8623
|
+
name: z119.string(),
|
8624
|
+
smtpHost: z119.string(),
|
8625
|
+
smtpPort: z119.number(),
|
8626
|
+
smtpTlsPort: z119.number(),
|
8627
|
+
useTlsForSmtp: z119.boolean(),
|
8628
|
+
imapHost: z119.string(),
|
8629
|
+
imapPort: z119.number(),
|
8630
|
+
imapTlsPort: z119.number(),
|
8631
|
+
useTlsForImap: z119.boolean()
|
8531
8632
|
});
|
8532
8633
|
|
8533
8634
|
// src/mail/mail-server-contract.ts
|
8534
|
-
var serverContract =
|
8635
|
+
var serverContract = initContract45().router(
|
8535
8636
|
{
|
8536
8637
|
create: {
|
8537
8638
|
method: "POST",
|
@@ -8548,8 +8649,8 @@ var serverContract = initContract44().router(
|
|
8548
8649
|
getById: {
|
8549
8650
|
method: "GET",
|
8550
8651
|
path: "/:id",
|
8551
|
-
pathParams:
|
8552
|
-
id:
|
8652
|
+
pathParams: z120.object({
|
8653
|
+
id: z120.string().uuid()
|
8553
8654
|
}),
|
8554
8655
|
responses: {
|
8555
8656
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8564,7 +8665,7 @@ var serverContract = initContract44().router(
|
|
8564
8665
|
path: "/",
|
8565
8666
|
responses: {
|
8566
8667
|
200: DefaultSuccessResponseSchema.extend({
|
8567
|
-
data:
|
8668
|
+
data: z120.array(MailServerSchema)
|
8568
8669
|
}),
|
8569
8670
|
...DefaultResponses
|
8570
8671
|
},
|
@@ -8573,8 +8674,8 @@ var serverContract = initContract44().router(
|
|
8573
8674
|
update: {
|
8574
8675
|
method: "PATCH",
|
8575
8676
|
path: "/:id",
|
8576
|
-
pathParams:
|
8577
|
-
id:
|
8677
|
+
pathParams: z120.object({
|
8678
|
+
id: z120.string().uuid()
|
8578
8679
|
}),
|
8579
8680
|
responses: {
|
8580
8681
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8588,8 +8689,8 @@ var serverContract = initContract44().router(
|
|
8588
8689
|
delete: {
|
8589
8690
|
method: "DELETE",
|
8590
8691
|
path: "/:id",
|
8591
|
-
pathParams:
|
8592
|
-
id:
|
8692
|
+
pathParams: z120.object({
|
8693
|
+
id: z120.string().uuid()
|
8593
8694
|
}),
|
8594
8695
|
responses: {
|
8595
8696
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8607,52 +8708,52 @@ var serverContract = initContract44().router(
|
|
8607
8708
|
);
|
8608
8709
|
|
8609
8710
|
// src/mail/message-contract.ts
|
8610
|
-
import { initContract as
|
8611
|
-
import
|
8711
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
8712
|
+
import z122 from "zod";
|
8612
8713
|
|
8613
8714
|
// src/mail/schemas/message-validation.schema.ts
|
8614
|
-
import
|
8615
|
-
var MailParticipant2 =
|
8616
|
-
name:
|
8617
|
-
address:
|
8715
|
+
import z121 from "zod";
|
8716
|
+
var MailParticipant2 = z121.object({
|
8717
|
+
name: z121.string().optional(),
|
8718
|
+
address: z121.string().email()
|
8618
8719
|
});
|
8619
8720
|
var MessageContractsValidationsSchema = {
|
8620
8721
|
submit: {
|
8621
|
-
input:
|
8622
|
-
subject:
|
8623
|
-
text:
|
8624
|
-
html:
|
8722
|
+
input: z121.object({
|
8723
|
+
subject: z121.string(),
|
8724
|
+
text: z121.string(),
|
8725
|
+
html: z121.string(),
|
8625
8726
|
from: MailParticipant2,
|
8626
8727
|
to: MailParticipant2,
|
8627
|
-
cc:
|
8628
|
-
bcc:
|
8629
|
-
sendAt:
|
8630
|
-
reference:
|
8631
|
-
messageId:
|
8632
|
-
action:
|
8728
|
+
cc: z121.array(MailParticipant2).optional(),
|
8729
|
+
bcc: z121.array(MailParticipant2).optional(),
|
8730
|
+
sendAt: z121.string().optional(),
|
8731
|
+
reference: z121.object({
|
8732
|
+
messageId: z121.string(),
|
8733
|
+
action: z121.union([z121.literal("reply"), z121.literal("forward")])
|
8633
8734
|
}).optional(),
|
8634
|
-
attachments:
|
8635
|
-
|
8636
|
-
fileType:
|
8637
|
-
fileName:
|
8638
|
-
fileKey:
|
8639
|
-
fileSize:
|
8640
|
-
bucketName:
|
8641
|
-
presignedUrl:
|
8735
|
+
attachments: z121.array(
|
8736
|
+
z121.object({
|
8737
|
+
fileType: z121.string(),
|
8738
|
+
fileName: z121.string(),
|
8739
|
+
fileKey: z121.string(),
|
8740
|
+
fileSize: z121.number(),
|
8741
|
+
bucketName: z121.string(),
|
8742
|
+
presignedUrl: z121.string()
|
8642
8743
|
})
|
8643
8744
|
).optional()
|
8644
8745
|
}),
|
8645
|
-
output:
|
8646
|
-
response:
|
8647
|
-
messageId:
|
8648
|
-
sendAt:
|
8649
|
-
queueId:
|
8746
|
+
output: z121.object({
|
8747
|
+
response: z121.string(),
|
8748
|
+
messageId: z121.string(),
|
8749
|
+
sendAt: z121.string(),
|
8750
|
+
queueId: z121.string()
|
8650
8751
|
})
|
8651
8752
|
}
|
8652
8753
|
};
|
8653
8754
|
|
8654
8755
|
// src/mail/message-contract.ts
|
8655
|
-
var messageContract =
|
8756
|
+
var messageContract = initContract46().router(
|
8656
8757
|
{
|
8657
8758
|
submit: {
|
8658
8759
|
method: "POST",
|
@@ -8675,8 +8776,8 @@ var messageContract = initContract45().router(
|
|
8675
8776
|
path: "/new_message_count",
|
8676
8777
|
responses: {
|
8677
8778
|
200: DefaultSuccessResponseSchema.extend({
|
8678
|
-
data:
|
8679
|
-
count:
|
8779
|
+
data: z122.object({
|
8780
|
+
count: z122.number()
|
8680
8781
|
})
|
8681
8782
|
}),
|
8682
8783
|
...DefaultResponses
|
@@ -8688,8 +8789,8 @@ var messageContract = initContract45().router(
|
|
8688
8789
|
getById: {
|
8689
8790
|
method: "GET",
|
8690
8791
|
path: "/:id",
|
8691
|
-
pathParams:
|
8692
|
-
id:
|
8792
|
+
pathParams: z122.object({
|
8793
|
+
id: z122.string()
|
8693
8794
|
}),
|
8694
8795
|
responses: {
|
8695
8796
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8704,8 +8805,8 @@ var messageContract = initContract45().router(
|
|
8704
8805
|
update: {
|
8705
8806
|
method: "PATCH",
|
8706
8807
|
path: "/:id",
|
8707
|
-
pathParams:
|
8708
|
-
id:
|
8808
|
+
pathParams: z122.object({
|
8809
|
+
id: z122.string()
|
8709
8810
|
}),
|
8710
8811
|
responses: {
|
8711
8812
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8721,8 +8822,8 @@ var messageContract = initContract45().router(
|
|
8721
8822
|
delete: {
|
8722
8823
|
method: "DELETE",
|
8723
8824
|
path: "/:id",
|
8724
|
-
pathParams:
|
8725
|
-
id:
|
8825
|
+
pathParams: z122.object({
|
8826
|
+
id: z122.string()
|
8726
8827
|
}),
|
8727
8828
|
responses: {
|
8728
8829
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8738,8 +8839,8 @@ var messageContract = initContract45().router(
|
|
8738
8839
|
cancelScheduledMessage: {
|
8739
8840
|
method: "DELETE",
|
8740
8841
|
path: "/scheduled_message/:id",
|
8741
|
-
pathParams:
|
8742
|
-
id:
|
8842
|
+
pathParams: z122.object({
|
8843
|
+
id: z122.string()
|
8743
8844
|
}),
|
8744
8845
|
responses: {
|
8745
8846
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8758,7 +8859,7 @@ var messageContract = initContract45().router(
|
|
8758
8859
|
);
|
8759
8860
|
|
8760
8861
|
// src/mail/mail-contract.ts
|
8761
|
-
var mailContract =
|
8862
|
+
var mailContract = initContract47().router({
|
8762
8863
|
room: roomContract,
|
8763
8864
|
message: messageContract,
|
8764
8865
|
account: accountContract,
|
@@ -8766,44 +8867,44 @@ var mailContract = initContract46().router({
|
|
8766
8867
|
});
|
8767
8868
|
|
8768
8869
|
// src/webchat/index.ts
|
8769
|
-
import { initContract as
|
8870
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
8770
8871
|
|
8771
8872
|
// src/webchat/schema.ts
|
8772
|
-
import
|
8873
|
+
import z124 from "zod";
|
8773
8874
|
|
8774
8875
|
// src/webchat/validation.ts
|
8775
|
-
import
|
8876
|
+
import z123 from "zod";
|
8776
8877
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
8777
8878
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
8778
8879
|
return ChatwootChannelType3;
|
8779
8880
|
})(ChatwootChannelType2 || {});
|
8780
|
-
var WebChatChannelSchema =
|
8781
|
-
avatar:
|
8782
|
-
name:
|
8783
|
-
type:
|
8784
|
-
websiteName:
|
8785
|
-
welcomeTitle:
|
8786
|
-
websiteUrl:
|
8787
|
-
welcomeTagline:
|
8788
|
-
agentAwayMessage:
|
8789
|
-
widgetColor:
|
8881
|
+
var WebChatChannelSchema = z123.object({
|
8882
|
+
avatar: z123.string().optional(),
|
8883
|
+
name: z123.string(),
|
8884
|
+
type: z123.nativeEnum(ChatwootChannelType2),
|
8885
|
+
websiteName: z123.string(),
|
8886
|
+
welcomeTitle: z123.string(),
|
8887
|
+
websiteUrl: z123.string().url(),
|
8888
|
+
welcomeTagline: z123.string().optional(),
|
8889
|
+
agentAwayMessage: z123.string().optional(),
|
8890
|
+
widgetColor: z123.string().optional()
|
8790
8891
|
});
|
8791
8892
|
|
8792
8893
|
// src/webchat/schema.ts
|
8793
|
-
var ConnectWebChatChannelSchema =
|
8794
|
-
name:
|
8795
|
-
actor:
|
8796
|
-
id:
|
8797
|
-
name:
|
8798
|
-
email:
|
8799
|
-
address:
|
8800
|
-
phone:
|
8894
|
+
var ConnectWebChatChannelSchema = z124.object({
|
8895
|
+
name: z124.string(),
|
8896
|
+
actor: z124.object({
|
8897
|
+
id: z124.string().uuid(),
|
8898
|
+
name: z124.string(),
|
8899
|
+
email: z124.string().email(),
|
8900
|
+
address: z124.string().nullable(),
|
8901
|
+
phone: z124.string().nullable()
|
8801
8902
|
}),
|
8802
8903
|
channel: WebChatChannelSchema
|
8803
8904
|
});
|
8804
8905
|
|
8805
8906
|
// src/webchat/index.ts
|
8806
|
-
var platformWebchatContract =
|
8907
|
+
var platformWebchatContract = initContract48().router({
|
8807
8908
|
sendMessage: {
|
8808
8909
|
method: "POST",
|
8809
8910
|
path: "/message",
|
@@ -8830,33 +8931,33 @@ var platformWebchatContract = initContract47().router({
|
|
8830
8931
|
});
|
8831
8932
|
|
8832
8933
|
// src/hold-label/index.ts
|
8833
|
-
import { initContract as
|
8934
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
8834
8935
|
|
8835
8936
|
// src/hold-label/schema.ts
|
8836
|
-
import
|
8937
|
+
import z125 from "zod";
|
8837
8938
|
var HoldLabelSchema = DefaultEntitySchema.extend({
|
8838
|
-
name:
|
8839
|
-
position:
|
8939
|
+
name: z125.string(),
|
8940
|
+
position: z125.number()
|
8840
8941
|
});
|
8841
8942
|
|
8842
8943
|
// src/hold-label/index.ts
|
8843
|
-
import
|
8944
|
+
import z127 from "zod";
|
8844
8945
|
|
8845
8946
|
// src/hold-label/validation.ts
|
8846
|
-
import
|
8847
|
-
var UpdatePositionSchema2 =
|
8848
|
-
holdLabels:
|
8849
|
-
|
8947
|
+
import z126 from "zod";
|
8948
|
+
var UpdatePositionSchema2 = z126.object({
|
8949
|
+
holdLabels: z126.array(
|
8950
|
+
z126.object({ id: z126.string().uuid(), position: z126.number() })
|
8850
8951
|
)
|
8851
8952
|
});
|
8852
8953
|
|
8853
8954
|
// src/hold-label/index.ts
|
8854
|
-
var holdLabelContract =
|
8955
|
+
var holdLabelContract = initContract49().router(
|
8855
8956
|
{
|
8856
8957
|
createHoldLabel: {
|
8857
8958
|
method: "POST",
|
8858
8959
|
path: "/",
|
8859
|
-
body:
|
8960
|
+
body: z127.object({ name: z127.string() }),
|
8860
8961
|
responses: {
|
8861
8962
|
201: DefaultSuccessResponseSchema.extend({
|
8862
8963
|
holdLabel: HoldLabelSchema
|
@@ -8868,7 +8969,7 @@ var holdLabelContract = initContract48().router(
|
|
8868
8969
|
path: "/",
|
8869
8970
|
responses: {
|
8870
8971
|
200: DefaultSuccessResponseSchema.extend({
|
8871
|
-
holdLabels:
|
8972
|
+
holdLabels: z127.array(HoldLabelSchema)
|
8872
8973
|
})
|
8873
8974
|
}
|
8874
8975
|
},
|
@@ -8886,8 +8987,8 @@ var holdLabelContract = initContract48().router(
|
|
8886
8987
|
updateHoldLabel: {
|
8887
8988
|
method: "PATCH",
|
8888
8989
|
path: "/:id",
|
8889
|
-
pathParams:
|
8890
|
-
body:
|
8990
|
+
pathParams: z127.object({ id: z127.string().uuid() }),
|
8991
|
+
body: z127.object({ name: z127.string() }),
|
8891
8992
|
responses: {
|
8892
8993
|
200: DefaultSuccessResponseSchema.extend({
|
8893
8994
|
holdLabel: HoldLabelSchema
|
@@ -8897,7 +8998,7 @@ var holdLabelContract = initContract48().router(
|
|
8897
8998
|
deleteHoldLabel: {
|
8898
8999
|
method: "DELETE",
|
8899
9000
|
path: "/:id",
|
8900
|
-
pathParams:
|
9001
|
+
pathParams: z127.object({ id: z127.string().uuid() }),
|
8901
9002
|
body: null,
|
8902
9003
|
responses: {
|
8903
9004
|
200: DefaultSuccessResponseSchema
|
@@ -8908,17 +9009,17 @@ var holdLabelContract = initContract48().router(
|
|
8908
9009
|
path: "/auto-unhold",
|
8909
9010
|
responses: {
|
8910
9011
|
200: DefaultSuccessResponseSchema.extend({
|
8911
|
-
autoUnhold:
|
9012
|
+
autoUnhold: z127.boolean()
|
8912
9013
|
})
|
8913
9014
|
}
|
8914
9015
|
},
|
8915
9016
|
updateAutoUnhold: {
|
8916
9017
|
method: "POST",
|
8917
9018
|
path: "/auto-unhold",
|
8918
|
-
body:
|
9019
|
+
body: z127.object({ autoUnhold: z127.boolean() }),
|
8919
9020
|
responses: {
|
8920
9021
|
200: DefaultSuccessResponseSchema.extend({
|
8921
|
-
autoUnhold:
|
9022
|
+
autoUnhold: z127.boolean()
|
8922
9023
|
})
|
8923
9024
|
}
|
8924
9025
|
}
|
@@ -8929,6 +9030,7 @@ export {
|
|
8929
9030
|
activityLogContract,
|
8930
9031
|
apiContract,
|
8931
9032
|
attributeContract,
|
9033
|
+
automationQueueContract,
|
8932
9034
|
botContract,
|
8933
9035
|
botpressContract,
|
8934
9036
|
businessCalendarContract2 as businessCalendarContract,
|