@kl1/contracts 1.3.76 → 1.3.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-contracts/src/automation-queue/index.d.ts +43 -12
- package/dist/api-contracts/src/automation-queue/index.d.ts.map +1 -1
- package/dist/api-contracts/src/automation-queue/schema.d.ts +3 -0
- package/dist/api-contracts/src/automation-queue/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/automation-queue/validation.d.ts +18 -12
- package/dist/api-contracts/src/automation-queue/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/index.d.ts +64 -0
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/validation.d.ts +64 -0
- package/dist/api-contracts/src/channel/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/index.d.ts +5640 -0
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +3 -0
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +182 -430
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- 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/subscription/index.d.ts +438 -0
- package/dist/api-contracts/src/subscription/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts +0 -430
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/schema.d.ts +0 -3
- package/dist/api-contracts/src/telephony-agent-presence-status/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/validation.d.ts +0 -3
- package/dist/api-contracts/src/telephony-agent-presence-status/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/workflow-rule/index.d.ts +54 -0
- package/dist/api-contracts/src/workflow-rule/index.d.ts.map +1 -1
- package/dist/index.js +1612 -1566
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1611 -1566
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1230,7 +1230,8 @@ var GetRoomsSchema = z26.object({
|
|
1230
1230
|
caseId: z26.string().optional(),
|
1231
1231
|
dispositions: z26.array(z26.string()).optional(),
|
1232
1232
|
holdLabelId: z26.string().uuid().optional(),
|
1233
|
-
automationQueueId: z26.string().uuid().optional()
|
1233
|
+
automationQueueId: z26.string().uuid().optional(),
|
1234
|
+
botpressBotId: z26.string().uuid().optional()
|
1234
1235
|
});
|
1235
1236
|
var UpdateRoomTagsAndNotesSchema = z26.object({
|
1236
1237
|
note: z26.string().optional(),
|
@@ -2219,6 +2220,22 @@ var ConnectWhatsappSchema = z37.object({
|
|
2219
2220
|
});
|
2220
2221
|
var CsatPreferenceSchema = z37.object({
|
2221
2222
|
isCSATEnabled: z37.boolean(),
|
2223
|
+
headline: z37.string().optional().nullable(),
|
2224
|
+
image: z37.object({
|
2225
|
+
bucketName: z37.string(),
|
2226
|
+
fileName: z37.string(),
|
2227
|
+
fileSize: z37.number(),
|
2228
|
+
fileKey: z37.string(),
|
2229
|
+
originalUrl: z37.string().optional().nullable()
|
2230
|
+
}).optional().nullable(),
|
2231
|
+
scaleOptions: z37.array(
|
2232
|
+
z37.object({
|
2233
|
+
value: z37.string(),
|
2234
|
+
label: z37.string(),
|
2235
|
+
color: z37.string().optional().nullable(),
|
2236
|
+
style: z37.string().optional().nullable()
|
2237
|
+
})
|
2238
|
+
).optional().nullable(),
|
2222
2239
|
dispositions: z37.array(z37.string()).optional()
|
2223
2240
|
});
|
2224
2241
|
var ConnectLazadaSchema = z37.object({
|
@@ -2995,6 +3012,25 @@ var mainChatRoomContract = initContract8().router(
|
|
2995
3012
|
})
|
2996
3013
|
},
|
2997
3014
|
summary: "Get all queue and hold rooms count"
|
3015
|
+
},
|
3016
|
+
botRoomTakeOver: {
|
3017
|
+
method: "POST",
|
3018
|
+
path: "/bot-room/take-over/:roomId",
|
3019
|
+
pathParams: z42.object({
|
3020
|
+
roomId: z42.string().uuid()
|
3021
|
+
}),
|
3022
|
+
body: z42.object({
|
3023
|
+
assigneeId: z42.string().uuid().optional()
|
3024
|
+
}),
|
3025
|
+
responses: {
|
3026
|
+
200: DefaultSuccessResponseSchema.extend({
|
3027
|
+
data: RoomSchema.extend({
|
3028
|
+
contact: ContactSchema,
|
3029
|
+
openMessage: z42.string()
|
3030
|
+
})
|
3031
|
+
})
|
3032
|
+
},
|
3033
|
+
summary: "Take over bot room"
|
2998
3034
|
}
|
2999
3035
|
},
|
3000
3036
|
{
|
@@ -5821,10 +5857,7 @@ var tagContract = initContract22().router(
|
|
5821
5857
|
|
5822
5858
|
// src/telephony-agent-presence-status/index.ts
|
5823
5859
|
import { initContract as initContract23 } from "@ts-rest/core";
|
5824
|
-
import
|
5825
|
-
|
5826
|
-
// src/telephony-agent-presence-status/schema.ts
|
5827
|
-
import z73 from "zod";
|
5860
|
+
import z74 from "zod";
|
5828
5861
|
|
5829
5862
|
// src/presence-status/schema.ts
|
5830
5863
|
import z72 from "zod";
|
@@ -5859,45 +5892,29 @@ var UserPresenceStatusSchema = z72.object({
|
|
5859
5892
|
// src/telephony-agent-presence-status/schema.ts
|
5860
5893
|
var UserPresenceStatusSchema2 = DefaultEntitySchema.extend({
|
5861
5894
|
user: UserSchema,
|
5862
|
-
presenceStatus: PresenceStatusSchema
|
5863
|
-
customPresenceStatus: z73.string().nullable().optional()
|
5895
|
+
presenceStatus: PresenceStatusSchema
|
5864
5896
|
});
|
5865
5897
|
|
5866
5898
|
// src/telephony-agent-presence-status/validation.ts
|
5867
|
-
import { z as
|
5868
|
-
var UpdateUserStatusSchema =
|
5869
|
-
userId:
|
5870
|
-
presenceStatusId:
|
5871
|
-
|
5872
|
-
reason: z74.string()
|
5899
|
+
import { z as z73 } from "zod";
|
5900
|
+
var UpdateUserStatusSchema = z73.object({
|
5901
|
+
userId: z73.string(),
|
5902
|
+
presenceStatusId: z73.string().nullable().optional(),
|
5903
|
+
reason: z73.string()
|
5873
5904
|
});
|
5874
5905
|
|
5875
5906
|
// src/telephony-agent-presence-status/index.ts
|
5876
5907
|
var telephonyAgentPresenceStatusContract = initContract23().router(
|
5877
5908
|
{
|
5878
|
-
getAllAgentStatus: {
|
5879
|
-
method: "GET",
|
5880
|
-
path: "/agents/presence_status",
|
5881
|
-
headers: DefaultHeaderSchema,
|
5882
|
-
responses: {
|
5883
|
-
200: z75.array(UserPresenceStatusSchema2),
|
5884
|
-
400: z75.object({
|
5885
|
-
message: z75.string()
|
5886
|
-
}),
|
5887
|
-
401: DefaultUnauthorizedSchema,
|
5888
|
-
500: DefaultErrorResponseSchema
|
5889
|
-
},
|
5890
|
-
summary: "Get all user presence status list."
|
5891
|
-
},
|
5892
5909
|
getAgentStatus: {
|
5893
5910
|
method: "GET",
|
5894
5911
|
path: "/presence_status/check_update/:userId",
|
5895
|
-
pathParams:
|
5912
|
+
pathParams: z74.object({ userId: z74.string() }),
|
5896
5913
|
headers: DefaultHeaderSchema,
|
5897
5914
|
responses: {
|
5898
5915
|
200: UserPresenceStatusSchema2,
|
5899
|
-
400:
|
5900
|
-
message:
|
5916
|
+
400: z74.object({
|
5917
|
+
message: z74.string()
|
5901
5918
|
}),
|
5902
5919
|
401: DefaultUnauthorizedSchema,
|
5903
5920
|
500: DefaultErrorResponseSchema
|
@@ -5913,8 +5930,8 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5913
5930
|
200: DefaultSuccessResponseSchema.extend({
|
5914
5931
|
userPresenceStatu: UserPresenceStatusSchema2
|
5915
5932
|
}),
|
5916
|
-
400:
|
5917
|
-
message:
|
5933
|
+
400: z74.object({
|
5934
|
+
message: z74.string()
|
5918
5935
|
}),
|
5919
5936
|
401: DefaultUnauthorizedSchema,
|
5920
5937
|
500: DefaultErrorResponseSchema
|
@@ -5926,65 +5943,65 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5926
5943
|
);
|
5927
5944
|
|
5928
5945
|
// src/telephony-cdr/index.ts
|
5929
|
-
import
|
5946
|
+
import z76 from "zod";
|
5930
5947
|
|
5931
5948
|
// src/telephony-cdr/validation.ts
|
5932
|
-
import
|
5933
|
-
var CreateTelephonyCdrSchema =
|
5934
|
-
uniqueCallId:
|
5935
|
-
timeStart:
|
5936
|
-
callFrom:
|
5937
|
-
callTo:
|
5938
|
-
callDuration:
|
5939
|
-
talkDuration:
|
5940
|
-
srcTrunkName:
|
5941
|
-
dstTrunkName:
|
5942
|
-
pinCode:
|
5943
|
-
status:
|
5944
|
-
type:
|
5945
|
-
recording:
|
5946
|
-
didNumber:
|
5947
|
-
agentRingTime:
|
5949
|
+
import z75 from "zod";
|
5950
|
+
var CreateTelephonyCdrSchema = z75.object({
|
5951
|
+
uniqueCallId: z75.string({ required_error: "uniqueCallId is required" }),
|
5952
|
+
timeStart: z75.string({ required_error: "timeStart is required" }),
|
5953
|
+
callFrom: z75.string({ required_error: "callFrom is required" }),
|
5954
|
+
callTo: z75.string({ required_error: "callTo is required" }),
|
5955
|
+
callDuration: z75.number().nullable(),
|
5956
|
+
talkDuration: z75.number().nullable(),
|
5957
|
+
srcTrunkName: z75.string().nullable(),
|
5958
|
+
dstTrunkName: z75.string().nullable(),
|
5959
|
+
pinCode: z75.string().nullable(),
|
5960
|
+
status: z75.string(),
|
5961
|
+
type: z75.string(),
|
5962
|
+
recording: z75.string().nullable(),
|
5963
|
+
didNumber: z75.string().nullable(),
|
5964
|
+
agentRingTime: z75.number().nullable()
|
5948
5965
|
});
|
5949
5966
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5950
|
-
selectedDate:
|
5951
|
-
type:
|
5952
|
-
status:
|
5953
|
-
callFrom:
|
5954
|
-
callTo:
|
5955
|
-
trunk:
|
5956
|
-
userId:
|
5957
|
-
queueStatus:
|
5958
|
-
agentIds:
|
5959
|
-
agentCallsOnly:
|
5960
|
-
contactId:
|
5967
|
+
selectedDate: z75.string().optional(),
|
5968
|
+
type: z75.array(z75.string()).optional(),
|
5969
|
+
status: z75.array(z75.string()).optional(),
|
5970
|
+
callFrom: z75.string().optional(),
|
5971
|
+
callTo: z75.string().optional(),
|
5972
|
+
trunk: z75.array(z75.string()).optional(),
|
5973
|
+
userId: z75.string().uuid().optional(),
|
5974
|
+
queueStatus: z75.string().optional(),
|
5975
|
+
agentIds: z75.array(z75.string().uuid()).optional(),
|
5976
|
+
agentCallsOnly: z75.coerce.boolean().optional(),
|
5977
|
+
contactId: z75.string().uuid().optional()
|
5961
5978
|
});
|
5962
5979
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5963
|
-
type:
|
5964
|
-
status:
|
5965
|
-
callFrom:
|
5966
|
-
callTo:
|
5967
|
-
result:
|
5968
|
-
callTags:
|
5969
|
-
selectedDate:
|
5970
|
-
agentId:
|
5971
|
-
contact:
|
5972
|
-
callStatus:
|
5973
|
-
queueIds:
|
5974
|
-
notes:
|
5980
|
+
type: z75.array(z75.string()).optional(),
|
5981
|
+
status: z75.array(z75.string()).optional(),
|
5982
|
+
callFrom: z75.string().optional(),
|
5983
|
+
callTo: z75.string().optional(),
|
5984
|
+
result: z75.array(z75.string()).optional(),
|
5985
|
+
callTags: z75.array(z75.string()).optional(),
|
5986
|
+
selectedDate: z75.string().optional(),
|
5987
|
+
agentId: z75.string().optional(),
|
5988
|
+
contact: z75.array(z75.string()).optional(),
|
5989
|
+
callStatus: z75.array(z75.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
5990
|
+
queueIds: z75.array(z75.string()).optional(),
|
5991
|
+
notes: z75.string().optional()
|
5975
5992
|
});
|
5976
5993
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5977
|
-
|
5978
|
-
page:
|
5979
|
-
pageSize:
|
5994
|
+
z75.object({
|
5995
|
+
page: z75.coerce.number().positive().optional(),
|
5996
|
+
pageSize: z75.coerce.number().positive().optional(),
|
5980
5997
|
// We use this export route for both CDR and Call Log.
|
5981
|
-
module:
|
5998
|
+
module: z75.union([z75.literal("cdrs"), z75.literal("call-logs")]).optional().default("cdrs")
|
5982
5999
|
})
|
5983
6000
|
);
|
5984
6001
|
var NullEmptyStringUndefined = ["", null, void 0];
|
5985
6002
|
var EmtptyArrayUndefined = [[], void 0];
|
5986
6003
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
5987
|
-
reportType:
|
6004
|
+
reportType: z75.enum([
|
5988
6005
|
"extcallstatistics",
|
5989
6006
|
"extcallactivity",
|
5990
6007
|
"trunkactivity",
|
@@ -5994,52 +6011,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5994
6011
|
"queueagentmisscalls",
|
5995
6012
|
"queueagentinoutcalls"
|
5996
6013
|
]),
|
5997
|
-
selectedDate:
|
5998
|
-
communicationType:
|
5999
|
-
time:
|
6000
|
-
queueList:
|
6001
|
-
queueId:
|
6002
|
-
trunkList:
|
6003
|
-
extensionList:
|
6014
|
+
selectedDate: z75.string().optional(),
|
6015
|
+
communicationType: z75.union([z75.literal("Inbound"), z75.literal("Outbound"), z75.literal("Internal")]).optional(),
|
6016
|
+
time: z75.string().optional(),
|
6017
|
+
queueList: z75.array(z75.string()).optional(),
|
6018
|
+
queueId: z75.string().optional(),
|
6019
|
+
trunkList: z75.array(z75.string()).optional(),
|
6020
|
+
extensionList: z75.array(z75.string()).optional()
|
6004
6021
|
}).superRefine((input, ctx) => {
|
6005
6022
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
6006
6023
|
ctx.addIssue({
|
6007
|
-
code:
|
6024
|
+
code: z75.ZodIssueCode.custom,
|
6008
6025
|
path: ["selectedDate"],
|
6009
6026
|
message: "selectedDate is required."
|
6010
6027
|
});
|
6011
6028
|
}
|
6012
6029
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
6013
6030
|
ctx.addIssue({
|
6014
|
-
code:
|
6031
|
+
code: z75.ZodIssueCode.custom,
|
6015
6032
|
path: ["time"],
|
6016
6033
|
message: "time is required."
|
6017
6034
|
});
|
6018
6035
|
}
|
6019
6036
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
6020
6037
|
ctx.addIssue({
|
6021
|
-
code:
|
6038
|
+
code: z75.ZodIssueCode.custom,
|
6022
6039
|
path: ["queueList"],
|
6023
6040
|
message: "queueList is required."
|
6024
6041
|
});
|
6025
6042
|
}
|
6026
6043
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
6027
6044
|
ctx.addIssue({
|
6028
|
-
code:
|
6045
|
+
code: z75.ZodIssueCode.custom,
|
6029
6046
|
path: ["queueId"],
|
6030
6047
|
message: "queueId is required."
|
6031
6048
|
});
|
6032
6049
|
}
|
6033
6050
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
6034
6051
|
ctx.addIssue({
|
6035
|
-
code:
|
6052
|
+
code: z75.ZodIssueCode.custom,
|
6036
6053
|
path: ["trunkList"],
|
6037
6054
|
message: "trunkList is required."
|
6038
6055
|
});
|
6039
6056
|
}
|
6040
6057
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
6041
6058
|
ctx.addIssue({
|
6042
|
-
code:
|
6059
|
+
code: z75.ZodIssueCode.custom,
|
6043
6060
|
path: ["extensionList"],
|
6044
6061
|
message: "extensionList is required."
|
6045
6062
|
});
|
@@ -6057,10 +6074,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6057
6074
|
query: GetAllTelephonyCdrSchema,
|
6058
6075
|
responses: {
|
6059
6076
|
200: DefaultSuccessResponseSchema.extend({
|
6060
|
-
total:
|
6061
|
-
page:
|
6062
|
-
pageSize:
|
6063
|
-
telephonyCdrs:
|
6077
|
+
total: z76.number(),
|
6078
|
+
page: z76.number(),
|
6079
|
+
pageSize: z76.number(),
|
6080
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6064
6081
|
}),
|
6065
6082
|
401: DefaultUnauthorizedSchema
|
6066
6083
|
},
|
@@ -6073,10 +6090,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6073
6090
|
query: GetAllTelephonyCdrSchema,
|
6074
6091
|
responses: {
|
6075
6092
|
200: DefaultSuccessResponseSchema.extend({
|
6076
|
-
total:
|
6077
|
-
page:
|
6078
|
-
pageSize:
|
6079
|
-
telephonyCdrs:
|
6093
|
+
total: z76.number(),
|
6094
|
+
page: z76.number(),
|
6095
|
+
pageSize: z76.number(),
|
6096
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6080
6097
|
}),
|
6081
6098
|
401: DefaultUnauthorizedSchema
|
6082
6099
|
},
|
@@ -6089,10 +6106,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6089
6106
|
query: GetRecentTelephonyCdrSchema,
|
6090
6107
|
responses: {
|
6091
6108
|
200: DefaultSuccessResponseSchema.extend({
|
6092
|
-
total:
|
6093
|
-
page:
|
6094
|
-
pageSize:
|
6095
|
-
telephonyCdrs:
|
6109
|
+
total: z76.number(),
|
6110
|
+
page: z76.number(),
|
6111
|
+
pageSize: z76.number(),
|
6112
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6096
6113
|
}),
|
6097
6114
|
401: DefaultUnauthorizedSchema
|
6098
6115
|
},
|
@@ -6119,7 +6136,7 @@ var telephonyCdrContract = initContract24().router(
|
|
6119
6136
|
body: GetYeastarCallReportSchema,
|
6120
6137
|
responses: {
|
6121
6138
|
// 200: CallReportSchema,
|
6122
|
-
200:
|
6139
|
+
200: z76.object({}),
|
6123
6140
|
401: DefaultUnauthorizedSchema
|
6124
6141
|
},
|
6125
6142
|
summary: "Get yeastar call report."
|
@@ -6187,10 +6204,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6187
6204
|
headers: DefaultHeaderSchema,
|
6188
6205
|
responses: {
|
6189
6206
|
200: DefaultSuccessResponseSchema.extend({
|
6190
|
-
callRedirectTo:
|
6207
|
+
callRedirectTo: z76.string()
|
6191
6208
|
}),
|
6192
|
-
400:
|
6193
|
-
message:
|
6209
|
+
400: z76.object({
|
6210
|
+
message: z76.string()
|
6194
6211
|
}),
|
6195
6212
|
401: DefaultUnauthorizedSchema,
|
6196
6213
|
500: DefaultErrorResponseSchema
|
@@ -6203,10 +6220,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6203
6220
|
body: TelephonyRedirectSettingSchema,
|
6204
6221
|
responses: {
|
6205
6222
|
200: DefaultSuccessResponseSchema.extend({
|
6206
|
-
callRedirectTo:
|
6223
|
+
callRedirectTo: z76.string()
|
6207
6224
|
}),
|
6208
|
-
400:
|
6209
|
-
message:
|
6225
|
+
400: z76.object({
|
6226
|
+
message: z76.string()
|
6210
6227
|
}),
|
6211
6228
|
401: DefaultUnauthorizedSchema,
|
6212
6229
|
500: DefaultErrorResponseSchema
|
@@ -6218,11 +6235,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6218
6235
|
headers: DefaultHeaderSchema,
|
6219
6236
|
responses: {
|
6220
6237
|
200: DefaultSuccessResponseSchema.extend({
|
6221
|
-
callRedirectTo:
|
6222
|
-
isMultiTabUsed:
|
6238
|
+
callRedirectTo: z76.string(),
|
6239
|
+
isMultiTabUsed: z76.string()
|
6223
6240
|
}),
|
6224
|
-
400:
|
6225
|
-
message:
|
6241
|
+
400: z76.object({
|
6242
|
+
message: z76.string()
|
6226
6243
|
}),
|
6227
6244
|
401: DefaultUnauthorizedSchema,
|
6228
6245
|
500: DefaultErrorResponseSchema
|
@@ -6235,11 +6252,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6235
6252
|
body: CallSettingSchema,
|
6236
6253
|
responses: {
|
6237
6254
|
200: DefaultSuccessResponseSchema.extend({
|
6238
|
-
callRedirectTo:
|
6239
|
-
isMultiTabUsed:
|
6255
|
+
callRedirectTo: z76.string(),
|
6256
|
+
isMultiTabUsed: z76.string()
|
6240
6257
|
}),
|
6241
|
-
400:
|
6242
|
-
message:
|
6258
|
+
400: z76.object({
|
6259
|
+
message: z76.string()
|
6243
6260
|
}),
|
6244
6261
|
401: DefaultUnauthorizedSchema,
|
6245
6262
|
500: DefaultErrorResponseSchema
|
@@ -6251,35 +6268,35 @@ var telephonyCdrContract = initContract24().router(
|
|
6251
6268
|
|
6252
6269
|
// src/telephony-extension/index.ts
|
6253
6270
|
import { initContract as initContract25 } from "@ts-rest/core";
|
6254
|
-
import
|
6271
|
+
import z78 from "zod";
|
6255
6272
|
|
6256
6273
|
// src/telephony-extension/schema.ts
|
6257
|
-
import
|
6258
|
-
var TelephonyExtensionSchema3 =
|
6259
|
-
errcode:
|
6260
|
-
errmsg:
|
6261
|
-
total_number:
|
6262
|
-
data:
|
6263
|
-
|
6264
|
-
id:
|
6265
|
-
online_status:
|
6266
|
-
fx_phone:
|
6267
|
-
sip_phone:
|
6268
|
-
status:
|
6269
|
-
ext_dev_type:
|
6270
|
-
}),
|
6271
|
-
linkus_desktop:
|
6272
|
-
linkus_mobile:
|
6273
|
-
linkus_web:
|
6274
|
-
status:
|
6275
|
-
ext_dev_type:
|
6274
|
+
import z77 from "zod";
|
6275
|
+
var TelephonyExtensionSchema3 = z77.object({
|
6276
|
+
errcode: z77.coerce.number(),
|
6277
|
+
errmsg: z77.string(),
|
6278
|
+
total_number: z77.coerce.number(),
|
6279
|
+
data: z77.array(
|
6280
|
+
z77.object({
|
6281
|
+
id: z77.coerce.number(),
|
6282
|
+
online_status: z77.object({
|
6283
|
+
fx_phone: z77.object({ status: z77.coerce.number() }),
|
6284
|
+
sip_phone: z77.object({
|
6285
|
+
status: z77.coerce.number(),
|
6286
|
+
ext_dev_type: z77.string().optional()
|
6287
|
+
}),
|
6288
|
+
linkus_desktop: z77.object({ status: z77.coerce.number() }),
|
6289
|
+
linkus_mobile: z77.object({ status: z77.coerce.number() }),
|
6290
|
+
linkus_web: z77.object({
|
6291
|
+
status: z77.coerce.number(),
|
6292
|
+
ext_dev_type: z77.string().optional()
|
6276
6293
|
})
|
6277
6294
|
}).optional(),
|
6278
|
-
presence_status:
|
6279
|
-
number:
|
6280
|
-
caller_id_name:
|
6281
|
-
role_name:
|
6282
|
-
email_addr:
|
6295
|
+
presence_status: z77.string().optional(),
|
6296
|
+
number: z77.string().optional(),
|
6297
|
+
caller_id_name: z77.string().optional(),
|
6298
|
+
role_name: z77.string().optional(),
|
6299
|
+
email_addr: z77.string().optional()
|
6283
6300
|
})
|
6284
6301
|
)
|
6285
6302
|
});
|
@@ -6294,8 +6311,8 @@ var telephonyExtensionContract = initContract25().router(
|
|
6294
6311
|
query: null,
|
6295
6312
|
responses: {
|
6296
6313
|
200: TelephonyExtensionSchema3,
|
6297
|
-
400:
|
6298
|
-
message:
|
6314
|
+
400: z78.object({
|
6315
|
+
message: z78.string()
|
6299
6316
|
}),
|
6300
6317
|
401: DefaultUnauthorizedSchema,
|
6301
6318
|
500: DefaultErrorResponseSchema
|
@@ -6308,10 +6325,10 @@ var telephonyExtensionContract = initContract25().router(
|
|
6308
6325
|
|
6309
6326
|
// src/ticket/index.ts
|
6310
6327
|
import { initContract as initContract26 } from "@ts-rest/core";
|
6311
|
-
import
|
6328
|
+
import z80 from "zod";
|
6312
6329
|
|
6313
6330
|
// src/ticket/validation.ts
|
6314
|
-
import
|
6331
|
+
import z79 from "zod";
|
6315
6332
|
var addErrorMessage2 = (field) => {
|
6316
6333
|
return field.refine(
|
6317
6334
|
({ isRequired, value }) => {
|
@@ -6329,108 +6346,108 @@ var addErrorMessage2 = (field) => {
|
|
6329
6346
|
}
|
6330
6347
|
);
|
6331
6348
|
};
|
6332
|
-
var BaseSchema3 =
|
6333
|
-
isRequired:
|
6334
|
-
attributeId:
|
6349
|
+
var BaseSchema3 = z79.object({
|
6350
|
+
isRequired: z79.boolean(),
|
6351
|
+
attributeId: z79.string()
|
6335
6352
|
});
|
6336
6353
|
var SingleValue2 = addErrorMessage2(
|
6337
6354
|
BaseSchema3.extend({
|
6338
|
-
value:
|
6355
|
+
value: z79.string()
|
6339
6356
|
})
|
6340
6357
|
);
|
6341
|
-
var CreateTicketValidationSchema =
|
6358
|
+
var CreateTicketValidationSchema = z79.object({
|
6342
6359
|
title: SingleValue2,
|
6343
6360
|
description: SingleValue2,
|
6344
6361
|
status: SingleValue2,
|
6345
6362
|
type: SingleValue2,
|
6346
6363
|
priority: SingleValue2,
|
6347
6364
|
contact: SingleValue2,
|
6348
|
-
assignee:
|
6349
|
-
isRequired:
|
6350
|
-
attributeId:
|
6351
|
-
value:
|
6365
|
+
assignee: z79.object({
|
6366
|
+
isRequired: z79.boolean(),
|
6367
|
+
attributeId: z79.string(),
|
6368
|
+
value: z79.string()
|
6352
6369
|
}),
|
6353
6370
|
channel: SingleValue2,
|
6354
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
6355
|
-
categories: BaseSchema3.extend({ value:
|
6356
|
-
customFields:
|
6371
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z79.array(z79.string()) })),
|
6372
|
+
categories: BaseSchema3.extend({ value: z79.array(z79.string()) }),
|
6373
|
+
customFields: z79.array(
|
6357
6374
|
addErrorMessage2(
|
6358
6375
|
BaseSchema3.extend({
|
6359
|
-
value:
|
6360
|
-
type:
|
6361
|
-
isDefaultAttribute:
|
6376
|
+
value: z79.union([z79.string(), z79.array(z79.string())]),
|
6377
|
+
type: z79.string(),
|
6378
|
+
isDefaultAttribute: z79.boolean()
|
6362
6379
|
})
|
6363
6380
|
)
|
6364
6381
|
),
|
6365
|
-
reasonToAssign:
|
6382
|
+
reasonToAssign: z79.object({ value: z79.string() }).optional()
|
6366
6383
|
});
|
6367
6384
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
6368
|
-
var TicketAttachmentRecordSchema =
|
6369
|
-
bucketName:
|
6370
|
-
fileKey:
|
6371
|
-
fileName:
|
6372
|
-
fileSize:
|
6373
|
-
url:
|
6374
|
-
});
|
6375
|
-
var CreateTicketAttachmentRecordsSchema =
|
6376
|
-
ticketId:
|
6377
|
-
attributeId:
|
6378
|
-
ticketAttachmentRecords:
|
6379
|
-
});
|
6380
|
-
var TicketParamsSchema =
|
6381
|
-
page:
|
6382
|
-
pageSize:
|
6383
|
-
});
|
6384
|
-
var CustomFieldQuery =
|
6385
|
-
attributeId:
|
6386
|
-
type:
|
6387
|
-
value:
|
6388
|
-
});
|
6389
|
-
var GetAllTicketQuerySchema =
|
6390
|
-
page:
|
6391
|
-
pageSize:
|
6392
|
-
selectedDate:
|
6393
|
-
ticketNumber:
|
6394
|
-
keyword:
|
6395
|
-
title:
|
6396
|
-
description:
|
6397
|
-
status:
|
6398
|
-
priority:
|
6399
|
-
channel:
|
6400
|
-
type:
|
6401
|
-
ticketType:
|
6402
|
-
contact:
|
6403
|
-
tags:
|
6404
|
-
categories:
|
6405
|
-
assignee:
|
6406
|
-
customFields:
|
6407
|
-
|
6408
|
-
attributeId:
|
6409
|
-
type:
|
6410
|
-
value:
|
6385
|
+
var TicketAttachmentRecordSchema = z79.object({
|
6386
|
+
bucketName: z79.string(),
|
6387
|
+
fileKey: z79.string(),
|
6388
|
+
fileName: z79.string(),
|
6389
|
+
fileSize: z79.coerce.number(),
|
6390
|
+
url: z79.string()
|
6391
|
+
});
|
6392
|
+
var CreateTicketAttachmentRecordsSchema = z79.object({
|
6393
|
+
ticketId: z79.string(),
|
6394
|
+
attributeId: z79.string(),
|
6395
|
+
ticketAttachmentRecords: z79.array(TicketAttachmentRecordSchema)
|
6396
|
+
});
|
6397
|
+
var TicketParamsSchema = z79.object({
|
6398
|
+
page: z79.coerce.number().default(1),
|
6399
|
+
pageSize: z79.coerce.number().default(10)
|
6400
|
+
});
|
6401
|
+
var CustomFieldQuery = z79.object({
|
6402
|
+
attributeId: z79.string(),
|
6403
|
+
type: z79.string(),
|
6404
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6405
|
+
});
|
6406
|
+
var GetAllTicketQuerySchema = z79.object({
|
6407
|
+
page: z79.string().transform((value) => Number(value)),
|
6408
|
+
pageSize: z79.string().transform((value) => Number(value)),
|
6409
|
+
selectedDate: z79.string(),
|
6410
|
+
ticketNumber: z79.string(),
|
6411
|
+
keyword: z79.string(),
|
6412
|
+
title: z79.string(),
|
6413
|
+
description: z79.string(),
|
6414
|
+
status: z79.array(z79.string()),
|
6415
|
+
priority: z79.array(z79.string()),
|
6416
|
+
channel: z79.array(z79.string()),
|
6417
|
+
type: z79.array(z79.string()),
|
6418
|
+
ticketType: z79.array(z79.string()),
|
6419
|
+
contact: z79.array(z79.string()),
|
6420
|
+
tags: z79.array(z79.string().uuid()),
|
6421
|
+
categories: z79.array(z79.string().uuid()),
|
6422
|
+
assignee: z79.array(z79.string().uuid()),
|
6423
|
+
customFields: z79.array(
|
6424
|
+
z79.object({
|
6425
|
+
attributeId: z79.string().uuid(),
|
6426
|
+
type: z79.string(),
|
6427
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6411
6428
|
})
|
6412
6429
|
)
|
6413
6430
|
}).partial();
|
6414
|
-
var ExportAllTicketQuerySchema =
|
6415
|
-
agent:
|
6416
|
-
selectedDate:
|
6417
|
-
keyword:
|
6418
|
-
title:
|
6419
|
-
description:
|
6420
|
-
status:
|
6421
|
-
priority:
|
6422
|
-
assignee:
|
6423
|
-
channel:
|
6424
|
-
type:
|
6425
|
-
ticketType:
|
6426
|
-
contact:
|
6427
|
-
tags:
|
6428
|
-
categories:
|
6429
|
-
customFields:
|
6430
|
-
|
6431
|
-
attributeId:
|
6432
|
-
type:
|
6433
|
-
value:
|
6431
|
+
var ExportAllTicketQuerySchema = z79.object({
|
6432
|
+
agent: z79.array(z79.string()),
|
6433
|
+
selectedDate: z79.string(),
|
6434
|
+
keyword: z79.string(),
|
6435
|
+
title: z79.string(),
|
6436
|
+
description: z79.string(),
|
6437
|
+
status: z79.array(z79.string()),
|
6438
|
+
priority: z79.array(z79.string()),
|
6439
|
+
assignee: z79.array(z79.string().uuid()),
|
6440
|
+
channel: z79.array(z79.string()),
|
6441
|
+
type: z79.array(z79.string()),
|
6442
|
+
ticketType: z79.array(z79.string()),
|
6443
|
+
contact: z79.array(z79.string()),
|
6444
|
+
tags: z79.array(z79.string()),
|
6445
|
+
categories: z79.array(z79.string()),
|
6446
|
+
customFields: z79.array(
|
6447
|
+
z79.object({
|
6448
|
+
attributeId: z79.string().uuid(),
|
6449
|
+
type: z79.string(),
|
6450
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6434
6451
|
})
|
6435
6452
|
)
|
6436
6453
|
}).partial();
|
@@ -6446,14 +6463,14 @@ var ticketContract = initContract26().router(
|
|
6446
6463
|
201: DefaultSuccessResponseSchema.extend({
|
6447
6464
|
data: TicketSchema
|
6448
6465
|
}),
|
6449
|
-
400:
|
6450
|
-
message:
|
6466
|
+
400: z80.object({
|
6467
|
+
message: z80.string()
|
6451
6468
|
}),
|
6452
|
-
409:
|
6453
|
-
message:
|
6469
|
+
409: z80.object({
|
6470
|
+
message: z80.string()
|
6454
6471
|
}),
|
6455
|
-
500:
|
6456
|
-
message:
|
6472
|
+
500: z80.object({
|
6473
|
+
message: z80.string()
|
6457
6474
|
}),
|
6458
6475
|
401: DefaultUnauthorizedSchema,
|
6459
6476
|
404: DefaultNotFoundSchema,
|
@@ -6474,8 +6491,8 @@ var ticketContract = initContract26().router(
|
|
6474
6491
|
TicketSchema
|
6475
6492
|
)
|
6476
6493
|
}),
|
6477
|
-
400:
|
6478
|
-
message:
|
6494
|
+
400: z80.object({
|
6495
|
+
message: z80.string()
|
6479
6496
|
}),
|
6480
6497
|
401: DefaultUnauthorizedSchema,
|
6481
6498
|
500: DefaultErrorResponseSchema
|
@@ -6485,14 +6502,14 @@ var ticketContract = initContract26().router(
|
|
6485
6502
|
getTicketById: {
|
6486
6503
|
method: "GET",
|
6487
6504
|
path: "/:id",
|
6488
|
-
pathParams:
|
6505
|
+
pathParams: z80.object({ id: z80.string() }),
|
6489
6506
|
headers: DefaultHeaderSchema,
|
6490
6507
|
responses: {
|
6491
6508
|
200: DefaultSuccessResponseSchema.extend({
|
6492
6509
|
data: TicketSchema
|
6493
6510
|
}),
|
6494
|
-
400:
|
6495
|
-
message:
|
6511
|
+
400: z80.object({
|
6512
|
+
message: z80.string()
|
6496
6513
|
}),
|
6497
6514
|
401: DefaultUnauthorizedSchema,
|
6498
6515
|
500: DefaultErrorResponseSchema
|
@@ -6502,15 +6519,15 @@ var ticketContract = initContract26().router(
|
|
6502
6519
|
getTicketByContactId: {
|
6503
6520
|
method: "GET",
|
6504
6521
|
path: "/contact/:id",
|
6505
|
-
pathParams:
|
6522
|
+
pathParams: z80.object({ id: z80.string() }),
|
6506
6523
|
query: TicketParamsSchema,
|
6507
6524
|
headers: DefaultHeaderSchema,
|
6508
6525
|
responses: {
|
6509
6526
|
200: DefaultSuccessResponseSchema.extend({
|
6510
6527
|
data: WithPagination(TicketSchema)
|
6511
6528
|
}),
|
6512
|
-
400:
|
6513
|
-
message:
|
6529
|
+
400: z80.object({
|
6530
|
+
message: z80.string()
|
6514
6531
|
}),
|
6515
6532
|
401: DefaultUnauthorizedSchema,
|
6516
6533
|
500: DefaultErrorResponseSchema
|
@@ -6520,21 +6537,21 @@ var ticketContract = initContract26().router(
|
|
6520
6537
|
updateTicket: {
|
6521
6538
|
method: "PATCH",
|
6522
6539
|
path: "/:id",
|
6523
|
-
pathParams:
|
6540
|
+
pathParams: z80.object({ id: z80.string() }),
|
6524
6541
|
body: UpdateTicketValidationSchema,
|
6525
6542
|
headers: DefaultHeaderSchema,
|
6526
6543
|
responses: {
|
6527
6544
|
201: DefaultSuccessResponseSchema.extend({
|
6528
6545
|
data: TicketSchema
|
6529
6546
|
}),
|
6530
|
-
400:
|
6531
|
-
message:
|
6547
|
+
400: z80.object({
|
6548
|
+
message: z80.string()
|
6532
6549
|
}),
|
6533
|
-
409:
|
6534
|
-
message:
|
6550
|
+
409: z80.object({
|
6551
|
+
message: z80.string()
|
6535
6552
|
}),
|
6536
|
-
500:
|
6537
|
-
message:
|
6553
|
+
500: z80.object({
|
6554
|
+
message: z80.string()
|
6538
6555
|
}),
|
6539
6556
|
401: DefaultUnauthorizedSchema,
|
6540
6557
|
404: DefaultNotFoundSchema,
|
@@ -6545,11 +6562,11 @@ var ticketContract = initContract26().router(
|
|
6545
6562
|
deleteTicket: {
|
6546
6563
|
method: "DELETE",
|
6547
6564
|
path: "/:id",
|
6548
|
-
pathParams:
|
6565
|
+
pathParams: z80.object({ id: z80.string() }),
|
6549
6566
|
headers: DefaultHeaderSchema,
|
6550
6567
|
body: null,
|
6551
6568
|
responses: {
|
6552
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6569
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6553
6570
|
500: DefaultErrorResponseSchema
|
6554
6571
|
},
|
6555
6572
|
summary: "Delete a extension."
|
@@ -6557,19 +6574,19 @@ var ticketContract = initContract26().router(
|
|
6557
6574
|
updateDescription: {
|
6558
6575
|
method: "PATCH",
|
6559
6576
|
path: "/description/update/:id",
|
6560
|
-
pathParams:
|
6561
|
-
body:
|
6577
|
+
pathParams: z80.object({ id: z80.string() }),
|
6578
|
+
body: z80.object({ description: z80.string() }),
|
6562
6579
|
headers: DefaultHeaderSchema,
|
6563
6580
|
responses: {
|
6564
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
6565
|
-
400:
|
6566
|
-
message:
|
6581
|
+
201: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6582
|
+
400: z80.object({
|
6583
|
+
message: z80.string()
|
6567
6584
|
}),
|
6568
|
-
409:
|
6569
|
-
message:
|
6585
|
+
409: z80.object({
|
6586
|
+
message: z80.string()
|
6570
6587
|
}),
|
6571
|
-
500:
|
6572
|
-
message:
|
6588
|
+
500: z80.object({
|
6589
|
+
message: z80.string()
|
6573
6590
|
}),
|
6574
6591
|
401: DefaultUnauthorizedSchema,
|
6575
6592
|
404: DefaultNotFoundSchema,
|
@@ -6580,19 +6597,19 @@ var ticketContract = initContract26().router(
|
|
6580
6597
|
updateTitle: {
|
6581
6598
|
method: "PATCH",
|
6582
6599
|
path: "/title/update/:id",
|
6583
|
-
pathParams:
|
6584
|
-
body:
|
6600
|
+
pathParams: z80.object({ id: z80.string() }),
|
6601
|
+
body: z80.object({ title: z80.string() }),
|
6585
6602
|
headers: DefaultHeaderSchema,
|
6586
6603
|
responses: {
|
6587
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6588
|
-
400:
|
6589
|
-
message:
|
6604
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6605
|
+
400: z80.object({
|
6606
|
+
message: z80.string()
|
6590
6607
|
}),
|
6591
|
-
409:
|
6592
|
-
message:
|
6608
|
+
409: z80.object({
|
6609
|
+
message: z80.string()
|
6593
6610
|
}),
|
6594
|
-
500:
|
6595
|
-
message:
|
6611
|
+
500: z80.object({
|
6612
|
+
message: z80.string()
|
6596
6613
|
}),
|
6597
6614
|
401: DefaultUnauthorizedSchema,
|
6598
6615
|
404: DefaultNotFoundSchema,
|
@@ -6603,19 +6620,19 @@ var ticketContract = initContract26().router(
|
|
6603
6620
|
updateType: {
|
6604
6621
|
method: "PATCH",
|
6605
6622
|
path: "/type/update/:id",
|
6606
|
-
pathParams:
|
6607
|
-
body:
|
6623
|
+
pathParams: z80.object({ id: z80.string() }),
|
6624
|
+
body: z80.object({ type: z80.string() }),
|
6608
6625
|
headers: DefaultHeaderSchema,
|
6609
6626
|
responses: {
|
6610
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6611
|
-
400:
|
6612
|
-
message:
|
6627
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6628
|
+
400: z80.object({
|
6629
|
+
message: z80.string()
|
6613
6630
|
}),
|
6614
|
-
409:
|
6615
|
-
message:
|
6631
|
+
409: z80.object({
|
6632
|
+
message: z80.string()
|
6616
6633
|
}),
|
6617
|
-
500:
|
6618
|
-
message:
|
6634
|
+
500: z80.object({
|
6635
|
+
message: z80.string()
|
6619
6636
|
}),
|
6620
6637
|
401: DefaultUnauthorizedSchema,
|
6621
6638
|
404: DefaultNotFoundSchema,
|
@@ -6626,19 +6643,19 @@ var ticketContract = initContract26().router(
|
|
6626
6643
|
updateStatus: {
|
6627
6644
|
method: "PATCH",
|
6628
6645
|
path: "/status/update/:id",
|
6629
|
-
pathParams:
|
6630
|
-
body:
|
6646
|
+
pathParams: z80.object({ id: z80.string() }),
|
6647
|
+
body: z80.object({ status: z80.string() }),
|
6631
6648
|
headers: DefaultHeaderSchema,
|
6632
6649
|
responses: {
|
6633
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6634
|
-
400:
|
6635
|
-
message:
|
6650
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6651
|
+
400: z80.object({
|
6652
|
+
message: z80.string()
|
6636
6653
|
}),
|
6637
|
-
409:
|
6638
|
-
message:
|
6654
|
+
409: z80.object({
|
6655
|
+
message: z80.string()
|
6639
6656
|
}),
|
6640
|
-
500:
|
6641
|
-
message:
|
6657
|
+
500: z80.object({
|
6658
|
+
message: z80.string()
|
6642
6659
|
}),
|
6643
6660
|
401: DefaultUnauthorizedSchema,
|
6644
6661
|
404: DefaultNotFoundSchema,
|
@@ -6649,19 +6666,19 @@ var ticketContract = initContract26().router(
|
|
6649
6666
|
updatePriority: {
|
6650
6667
|
method: "PATCH",
|
6651
6668
|
path: "/priority/update/:id",
|
6652
|
-
pathParams:
|
6653
|
-
body:
|
6669
|
+
pathParams: z80.object({ id: z80.string() }),
|
6670
|
+
body: z80.object({ priority: z80.string() }),
|
6654
6671
|
headers: DefaultHeaderSchema,
|
6655
6672
|
responses: {
|
6656
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6657
|
-
400:
|
6658
|
-
message:
|
6673
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6674
|
+
400: z80.object({
|
6675
|
+
message: z80.string()
|
6659
6676
|
}),
|
6660
|
-
409:
|
6661
|
-
message:
|
6677
|
+
409: z80.object({
|
6678
|
+
message: z80.string()
|
6662
6679
|
}),
|
6663
|
-
500:
|
6664
|
-
message:
|
6680
|
+
500: z80.object({
|
6681
|
+
message: z80.string()
|
6665
6682
|
}),
|
6666
6683
|
401: DefaultUnauthorizedSchema,
|
6667
6684
|
404: DefaultNotFoundSchema,
|
@@ -6672,19 +6689,19 @@ var ticketContract = initContract26().router(
|
|
6672
6689
|
updateChannel: {
|
6673
6690
|
method: "PATCH",
|
6674
6691
|
path: "/channel/update/:id",
|
6675
|
-
pathParams:
|
6676
|
-
body:
|
6692
|
+
pathParams: z80.object({ id: z80.string() }),
|
6693
|
+
body: z80.object({ channel: z80.string() }),
|
6677
6694
|
headers: DefaultHeaderSchema,
|
6678
6695
|
responses: {
|
6679
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6680
|
-
400:
|
6681
|
-
message:
|
6696
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6697
|
+
400: z80.object({
|
6698
|
+
message: z80.string()
|
6682
6699
|
}),
|
6683
|
-
409:
|
6684
|
-
message:
|
6700
|
+
409: z80.object({
|
6701
|
+
message: z80.string()
|
6685
6702
|
}),
|
6686
|
-
500:
|
6687
|
-
message:
|
6703
|
+
500: z80.object({
|
6704
|
+
message: z80.string()
|
6688
6705
|
}),
|
6689
6706
|
401: DefaultUnauthorizedSchema,
|
6690
6707
|
404: DefaultNotFoundSchema,
|
@@ -6695,19 +6712,19 @@ var ticketContract = initContract26().router(
|
|
6695
6712
|
updateTags: {
|
6696
6713
|
method: "PATCH",
|
6697
6714
|
path: "/tags/update/:id",
|
6698
|
-
pathParams:
|
6699
|
-
body:
|
6715
|
+
pathParams: z80.object({ id: z80.string() }),
|
6716
|
+
body: z80.object({ tags: z80.array(z80.string()) }),
|
6700
6717
|
headers: DefaultHeaderSchema,
|
6701
6718
|
responses: {
|
6702
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6703
|
-
400:
|
6704
|
-
message:
|
6719
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6720
|
+
400: z80.object({
|
6721
|
+
message: z80.string()
|
6705
6722
|
}),
|
6706
|
-
409:
|
6707
|
-
message:
|
6723
|
+
409: z80.object({
|
6724
|
+
message: z80.string()
|
6708
6725
|
}),
|
6709
|
-
500:
|
6710
|
-
message:
|
6726
|
+
500: z80.object({
|
6727
|
+
message: z80.string()
|
6711
6728
|
}),
|
6712
6729
|
401: DefaultUnauthorizedSchema,
|
6713
6730
|
404: DefaultNotFoundSchema,
|
@@ -6718,25 +6735,25 @@ var ticketContract = initContract26().router(
|
|
6718
6735
|
changeAssignee: {
|
6719
6736
|
method: "PATCH",
|
6720
6737
|
path: "/assignee/update/:id",
|
6721
|
-
pathParams:
|
6722
|
-
body:
|
6723
|
-
ticketId:
|
6724
|
-
assigneeId:
|
6725
|
-
reason:
|
6738
|
+
pathParams: z80.object({ id: z80.string() }),
|
6739
|
+
body: z80.object({
|
6740
|
+
ticketId: z80.string(),
|
6741
|
+
assigneeId: z80.string(),
|
6742
|
+
reason: z80.string().optional()
|
6726
6743
|
}),
|
6727
6744
|
headers: DefaultHeaderSchema,
|
6728
6745
|
responses: {
|
6729
6746
|
200: DefaultSuccessResponseSchema.extend({
|
6730
6747
|
data: TicketSchema
|
6731
6748
|
}),
|
6732
|
-
400:
|
6733
|
-
message:
|
6749
|
+
400: z80.object({
|
6750
|
+
message: z80.string()
|
6734
6751
|
}),
|
6735
|
-
409:
|
6736
|
-
message:
|
6752
|
+
409: z80.object({
|
6753
|
+
message: z80.string()
|
6737
6754
|
}),
|
6738
|
-
500:
|
6739
|
-
message:
|
6755
|
+
500: z80.object({
|
6756
|
+
message: z80.string()
|
6740
6757
|
}),
|
6741
6758
|
401: DefaultUnauthorizedSchema,
|
6742
6759
|
404: DefaultNotFoundSchema,
|
@@ -6747,14 +6764,14 @@ var ticketContract = initContract26().router(
|
|
6747
6764
|
getTicketCountByContact: {
|
6748
6765
|
method: "GET",
|
6749
6766
|
path: "/ticket_count/contact/:id",
|
6750
|
-
pathParams:
|
6767
|
+
pathParams: z80.object({ id: z80.string() }),
|
6751
6768
|
headers: DefaultHeaderSchema,
|
6752
6769
|
responses: {
|
6753
6770
|
200: DefaultSuccessResponseSchema.extend({
|
6754
6771
|
data: TicketCountByContactSchema
|
6755
6772
|
}),
|
6756
|
-
400:
|
6757
|
-
message:
|
6773
|
+
400: z80.object({
|
6774
|
+
message: z80.string()
|
6758
6775
|
}),
|
6759
6776
|
401: DefaultUnauthorizedSchema,
|
6760
6777
|
500: DefaultErrorResponseSchema
|
@@ -6770,14 +6787,14 @@ var ticketContract = initContract26().router(
|
|
6770
6787
|
201: DefaultSuccessResponseSchema.extend({
|
6771
6788
|
data: TicketCustomFieldSchema
|
6772
6789
|
}),
|
6773
|
-
400:
|
6774
|
-
message:
|
6790
|
+
400: z80.object({
|
6791
|
+
message: z80.string()
|
6775
6792
|
}),
|
6776
|
-
409:
|
6777
|
-
message:
|
6793
|
+
409: z80.object({
|
6794
|
+
message: z80.string()
|
6778
6795
|
}),
|
6779
|
-
500:
|
6780
|
-
message:
|
6796
|
+
500: z80.object({
|
6797
|
+
message: z80.string()
|
6781
6798
|
}),
|
6782
6799
|
401: DefaultUnauthorizedSchema,
|
6783
6800
|
404: DefaultNotFoundSchema,
|
@@ -6804,10 +6821,10 @@ var ticketContract = initContract26().router(
|
|
6804
6821
|
headers: DefaultHeaderSchema,
|
6805
6822
|
responses: {
|
6806
6823
|
200: DefaultSuccessResponseSchema.extend({
|
6807
|
-
ticketReasonRequired:
|
6824
|
+
ticketReasonRequired: z80.string()
|
6808
6825
|
}),
|
6809
|
-
400:
|
6810
|
-
message:
|
6826
|
+
400: z80.object({
|
6827
|
+
message: z80.string()
|
6811
6828
|
}),
|
6812
6829
|
401: DefaultUnauthorizedSchema,
|
6813
6830
|
500: DefaultErrorResponseSchema
|
@@ -6820,10 +6837,10 @@ var ticketContract = initContract26().router(
|
|
6820
6837
|
body: TicketReasonRequiredSchema,
|
6821
6838
|
responses: {
|
6822
6839
|
200: DefaultSuccessResponseSchema.extend({
|
6823
|
-
ticketReasonRequired:
|
6840
|
+
ticketReasonRequired: z80.string()
|
6824
6841
|
}),
|
6825
|
-
400:
|
6826
|
-
message:
|
6842
|
+
400: z80.object({
|
6843
|
+
message: z80.string()
|
6827
6844
|
}),
|
6828
6845
|
401: DefaultUnauthorizedSchema,
|
6829
6846
|
500: DefaultErrorResponseSchema
|
@@ -6835,24 +6852,24 @@ var ticketContract = initContract26().router(
|
|
6835
6852
|
|
6836
6853
|
// src/user/index.ts
|
6837
6854
|
import { initContract as initContract27 } from "@ts-rest/core";
|
6838
|
-
import
|
6855
|
+
import z82 from "zod";
|
6839
6856
|
|
6840
6857
|
// src/user/validation.ts
|
6841
|
-
import { z as
|
6842
|
-
var CreateUserSchema =
|
6843
|
-
name:
|
6844
|
-
email:
|
6845
|
-
address:
|
6846
|
-
phone:
|
6847
|
-
password:
|
6848
|
-
notificationCount:
|
6849
|
-
roles:
|
6858
|
+
import { z as z81 } from "zod";
|
6859
|
+
var CreateUserSchema = z81.object({
|
6860
|
+
name: z81.string(),
|
6861
|
+
email: z81.string().email(),
|
6862
|
+
address: z81.string().nullable(),
|
6863
|
+
phone: z81.string().nullable(),
|
6864
|
+
password: z81.string(),
|
6865
|
+
notificationCount: z81.number().nullable().optional(),
|
6866
|
+
roles: z81.array(z81.string())
|
6850
6867
|
});
|
6851
6868
|
var UpdateUserSchema = CreateUserSchema.extend({
|
6852
|
-
newPassword:
|
6869
|
+
newPassword: z81.string()
|
6853
6870
|
});
|
6854
|
-
var UpdateUserProfileSchema =
|
6855
|
-
password:
|
6871
|
+
var UpdateUserProfileSchema = z81.object({
|
6872
|
+
password: z81.string()
|
6856
6873
|
});
|
6857
6874
|
|
6858
6875
|
// src/user/index.ts
|
@@ -6867,8 +6884,8 @@ var userContract = initContract27().router(
|
|
6867
6884
|
201: DefaultSuccessResponseSchema.extend({
|
6868
6885
|
user: UserSchema
|
6869
6886
|
}),
|
6870
|
-
400:
|
6871
|
-
message:
|
6887
|
+
400: z82.object({
|
6888
|
+
message: z82.string()
|
6872
6889
|
}),
|
6873
6890
|
401: DefaultUnauthorizedSchema,
|
6874
6891
|
404: DefaultNotFoundSchema,
|
@@ -6881,15 +6898,15 @@ var userContract = initContract27().router(
|
|
6881
6898
|
method: "GET",
|
6882
6899
|
path: "/essential",
|
6883
6900
|
headers: DefaultHeaderSchema,
|
6884
|
-
query:
|
6885
|
-
page:
|
6886
|
-
pageSize:
|
6887
|
-
keyword:
|
6901
|
+
query: z82.object({
|
6902
|
+
page: z82.number().optional(),
|
6903
|
+
pageSize: z82.number().optional(),
|
6904
|
+
keyword: z82.string().optional()
|
6888
6905
|
}).optional(),
|
6889
6906
|
responses: {
|
6890
6907
|
200: WithPagination(EssentialUserSchema),
|
6891
|
-
400:
|
6892
|
-
message:
|
6908
|
+
400: z82.object({
|
6909
|
+
message: z82.string()
|
6893
6910
|
}),
|
6894
6911
|
401: DefaultUnauthorizedSchema,
|
6895
6912
|
500: DefaultErrorResponseSchema
|
@@ -6899,16 +6916,16 @@ var userContract = initContract27().router(
|
|
6899
6916
|
method: "GET",
|
6900
6917
|
path: "",
|
6901
6918
|
headers: DefaultHeaderSchema,
|
6902
|
-
query:
|
6903
|
-
page:
|
6904
|
-
pageSize:
|
6919
|
+
query: z82.object({
|
6920
|
+
page: z82.coerce.number().optional(),
|
6921
|
+
pageSize: z82.coerce.number().optional(),
|
6905
6922
|
// Don't add default 10. In some places, we need to fetch all users.
|
6906
|
-
keyword:
|
6923
|
+
keyword: z82.string().optional(),
|
6907
6924
|
// userIds: z.array(z.string()).optional(),
|
6908
|
-
userIds:
|
6909
|
-
|
6925
|
+
userIds: z82.union([
|
6926
|
+
z82.array(z82.string()),
|
6910
6927
|
// If it's an array
|
6911
|
-
|
6928
|
+
z82.record(z82.string())
|
6912
6929
|
// If it's an object
|
6913
6930
|
]).transform((val) => {
|
6914
6931
|
if (Array.isArray(val)) {
|
@@ -6916,12 +6933,12 @@ var userContract = initContract27().router(
|
|
6916
6933
|
}
|
6917
6934
|
return Object.values(val);
|
6918
6935
|
}).optional(),
|
6919
|
-
withPresenceStatus:
|
6936
|
+
withPresenceStatus: z82.string().transform((val) => val === "true").optional()
|
6920
6937
|
}).optional(),
|
6921
6938
|
responses: {
|
6922
6939
|
200: WithPagination(UserSchema),
|
6923
|
-
400:
|
6924
|
-
message:
|
6940
|
+
400: z82.object({
|
6941
|
+
message: z82.string()
|
6925
6942
|
}),
|
6926
6943
|
401: DefaultUnauthorizedSchema,
|
6927
6944
|
500: DefaultErrorResponseSchema
|
@@ -6931,12 +6948,12 @@ var userContract = initContract27().router(
|
|
6931
6948
|
getUserById: {
|
6932
6949
|
method: "GET",
|
6933
6950
|
path: "/:id",
|
6934
|
-
pathParams:
|
6951
|
+
pathParams: z82.object({ id: z82.string() }),
|
6935
6952
|
headers: DefaultHeaderSchema,
|
6936
6953
|
responses: {
|
6937
6954
|
200: UserSchema,
|
6938
|
-
400:
|
6939
|
-
message:
|
6955
|
+
400: z82.object({
|
6956
|
+
message: z82.string()
|
6940
6957
|
}),
|
6941
6958
|
401: DefaultUnauthorizedSchema
|
6942
6959
|
},
|
@@ -6945,15 +6962,15 @@ var userContract = initContract27().router(
|
|
6945
6962
|
updateUser: {
|
6946
6963
|
method: "PATCH",
|
6947
6964
|
path: "/:id",
|
6948
|
-
pathParams:
|
6965
|
+
pathParams: z82.object({ id: z82.string() }),
|
6949
6966
|
headers: DefaultHeaderSchema,
|
6950
6967
|
body: UpdateUserSchema,
|
6951
6968
|
responses: {
|
6952
6969
|
201: DefaultSuccessResponseSchema.extend({
|
6953
6970
|
user: UserSchema
|
6954
6971
|
}),
|
6955
|
-
400:
|
6956
|
-
message:
|
6972
|
+
400: z82.object({
|
6973
|
+
message: z82.string()
|
6957
6974
|
}),
|
6958
6975
|
401: DefaultUnauthorizedSchema,
|
6959
6976
|
404: DefaultNotFoundSchema,
|
@@ -6965,15 +6982,15 @@ var userContract = initContract27().router(
|
|
6965
6982
|
updateUserProfile: {
|
6966
6983
|
method: "PATCH",
|
6967
6984
|
path: "/profile/:id",
|
6968
|
-
pathParams:
|
6985
|
+
pathParams: z82.object({ id: z82.string() }),
|
6969
6986
|
headers: DefaultHeaderSchema,
|
6970
6987
|
body: UpdateUserProfileSchema,
|
6971
6988
|
responses: {
|
6972
6989
|
201: DefaultSuccessResponseSchema.extend({
|
6973
6990
|
user: UserSchema
|
6974
6991
|
}),
|
6975
|
-
400:
|
6976
|
-
message:
|
6992
|
+
400: z82.object({
|
6993
|
+
message: z82.string()
|
6977
6994
|
}),
|
6978
6995
|
401: DefaultUnauthorizedSchema,
|
6979
6996
|
404: DefaultNotFoundSchema,
|
@@ -6985,11 +7002,11 @@ var userContract = initContract27().router(
|
|
6985
7002
|
deleteUser: {
|
6986
7003
|
method: "DELETE",
|
6987
7004
|
path: "/:id",
|
6988
|
-
pathParams:
|
7005
|
+
pathParams: z82.object({ id: z82.string() }),
|
6989
7006
|
headers: DefaultHeaderSchema,
|
6990
7007
|
body: null,
|
6991
7008
|
responses: {
|
6992
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
7009
|
+
200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
|
6993
7010
|
404: DefaultNotFoundSchema,
|
6994
7011
|
422: DefaultUnprocessibleSchema,
|
6995
7012
|
500: DefaultErrorResponseSchema
|
@@ -7002,26 +7019,26 @@ var userContract = initContract27().router(
|
|
7002
7019
|
|
7003
7020
|
// src/user-presence-status-log/index.ts
|
7004
7021
|
import { initContract as initContract28 } from "@ts-rest/core";
|
7005
|
-
import
|
7022
|
+
import z85 from "zod";
|
7006
7023
|
|
7007
7024
|
// src/user-presence-status-log/schema.ts
|
7008
|
-
import
|
7025
|
+
import z83 from "zod";
|
7009
7026
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
7010
7027
|
user: UserSchema,
|
7011
7028
|
previousPresenceStatus: PresenceStatusSchema,
|
7012
7029
|
newPresenceStatus: PresenceStatusSchema,
|
7013
|
-
reason:
|
7030
|
+
reason: z83.string()
|
7014
7031
|
});
|
7015
7032
|
|
7016
7033
|
// src/user-presence-status-log/validation.ts
|
7017
|
-
import
|
7018
|
-
var UserPresenceStatusLogParamsSchema =
|
7019
|
-
page:
|
7020
|
-
pageSize:
|
7021
|
-
selectedDate:
|
7034
|
+
import z84 from "zod";
|
7035
|
+
var UserPresenceStatusLogParamsSchema = z84.object({
|
7036
|
+
page: z84.coerce.number().default(1),
|
7037
|
+
pageSize: z84.coerce.number().default(10),
|
7038
|
+
selectedDate: z84.string().optional()
|
7022
7039
|
}).optional();
|
7023
|
-
var UserPresenceStatusLogExportParamsSchema =
|
7024
|
-
selectedDate:
|
7040
|
+
var UserPresenceStatusLogExportParamsSchema = z84.object({
|
7041
|
+
selectedDate: z84.string().optional()
|
7025
7042
|
});
|
7026
7043
|
|
7027
7044
|
// src/user-presence-status-log/index.ts
|
@@ -7034,8 +7051,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7034
7051
|
headers: DefaultHeaderSchema,
|
7035
7052
|
responses: {
|
7036
7053
|
200: WithPagination(UserPresenceStatusLogSchema),
|
7037
|
-
400:
|
7038
|
-
message:
|
7054
|
+
400: z85.object({
|
7055
|
+
message: z85.string()
|
7039
7056
|
}),
|
7040
7057
|
401: DefaultUnauthorizedSchema,
|
7041
7058
|
500: DefaultErrorResponseSchema
|
@@ -7051,8 +7068,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7051
7068
|
headers: DefaultHeaderSchema,
|
7052
7069
|
responses: {
|
7053
7070
|
200: null,
|
7054
|
-
400:
|
7055
|
-
message:
|
7071
|
+
400: z85.object({
|
7072
|
+
message: z85.string()
|
7056
7073
|
}),
|
7057
7074
|
401: DefaultUnauthorizedSchema,
|
7058
7075
|
500: DefaultErrorResponseSchema
|
@@ -7064,67 +7081,67 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7064
7081
|
|
7065
7082
|
// src/widget/index.ts
|
7066
7083
|
import { initContract as initContract29 } from "@ts-rest/core";
|
7067
|
-
import
|
7084
|
+
import z88 from "zod";
|
7068
7085
|
|
7069
7086
|
// src/widget/schema.ts
|
7070
|
-
import
|
7071
|
-
var FieldsSchema =
|
7072
|
-
var WidgetPositionSchema =
|
7073
|
-
|
7074
|
-
|
7075
|
-
|
7076
|
-
|
7077
|
-
|
7087
|
+
import z86 from "zod";
|
7088
|
+
var FieldsSchema = z86.object({ data: z86.array(z86.string()) });
|
7089
|
+
var WidgetPositionSchema = z86.union([
|
7090
|
+
z86.literal("menu"),
|
7091
|
+
z86.literal("ticket_detail"),
|
7092
|
+
z86.literal("contact_detail"),
|
7093
|
+
z86.literal("contact_profile"),
|
7094
|
+
z86.literal("inbox_detail")
|
7078
7095
|
]);
|
7079
|
-
var WidgetTypeSchema =
|
7080
|
-
|
7081
|
-
|
7096
|
+
var WidgetTypeSchema = z86.union([
|
7097
|
+
z86.literal("iframe"),
|
7098
|
+
z86.literal("custom")
|
7082
7099
|
]);
|
7083
|
-
var WidgetHeaderSchema =
|
7084
|
-
key:
|
7085
|
-
value:
|
7100
|
+
var WidgetHeaderSchema = z86.object({
|
7101
|
+
key: z86.string(),
|
7102
|
+
value: z86.string()
|
7086
7103
|
});
|
7087
|
-
var WidgetMethodSchema =
|
7088
|
-
|
7089
|
-
|
7104
|
+
var WidgetMethodSchema = z86.union([
|
7105
|
+
z86.literal("get"),
|
7106
|
+
z86.literal("post")
|
7090
7107
|
]);
|
7091
7108
|
var WidgetSchema = DefaultEntitySchema.extend({
|
7092
|
-
name:
|
7093
|
-
description:
|
7109
|
+
name: z86.string(),
|
7110
|
+
description: z86.string().nullable(),
|
7094
7111
|
position: WidgetPositionSchema,
|
7095
7112
|
fields: FieldsSchema,
|
7096
|
-
url:
|
7113
|
+
url: z86.string(),
|
7097
7114
|
type: WidgetTypeSchema.nullable(),
|
7098
|
-
headers:
|
7115
|
+
headers: z86.array(WidgetHeaderSchema).nullable(),
|
7099
7116
|
method: WidgetMethodSchema.nullable(),
|
7100
|
-
fileKey:
|
7101
|
-
fileUrl:
|
7117
|
+
fileKey: z86.string().nullable(),
|
7118
|
+
fileUrl: z86.string().nullable()
|
7102
7119
|
});
|
7103
7120
|
|
7104
7121
|
// src/widget/validation.ts
|
7105
|
-
import
|
7106
|
-
var CreateWidgetSchema =
|
7107
|
-
name:
|
7108
|
-
description:
|
7109
|
-
url:
|
7122
|
+
import z87 from "zod";
|
7123
|
+
var CreateWidgetSchema = z87.object({
|
7124
|
+
name: z87.string(),
|
7125
|
+
description: z87.string().optional(),
|
7126
|
+
url: z87.string(),
|
7110
7127
|
position: WidgetPositionSchema,
|
7111
|
-
fields:
|
7128
|
+
fields: z87.object({
|
7112
7129
|
data: (
|
7113
7130
|
// Array of attribute system names
|
7114
|
-
|
7131
|
+
z87.array(z87.string())
|
7115
7132
|
)
|
7116
7133
|
}).optional(),
|
7117
7134
|
type: WidgetTypeSchema,
|
7118
|
-
headers:
|
7135
|
+
headers: z87.array(WidgetHeaderSchema).optional(),
|
7119
7136
|
method: WidgetMethodSchema.optional(),
|
7120
|
-
fileKey:
|
7137
|
+
fileKey: z87.string().nullable()
|
7121
7138
|
});
|
7122
7139
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
7123
|
-
var GetWidgetUrlPathQuerySchema =
|
7124
|
-
widgetId:
|
7140
|
+
var GetWidgetUrlPathQuerySchema = z87.object({
|
7141
|
+
widgetId: z87.string(),
|
7125
7142
|
// Position ID is ticket ID, contact ID, etc.
|
7126
7143
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
7127
|
-
positionId:
|
7144
|
+
positionId: z87.string()
|
7128
7145
|
});
|
7129
7146
|
|
7130
7147
|
// src/widget/index.ts
|
@@ -7139,8 +7156,8 @@ var widgetContract = initContract29().router(
|
|
7139
7156
|
201: DefaultSuccessResponseSchema.extend({
|
7140
7157
|
widget: WidgetSchema
|
7141
7158
|
}),
|
7142
|
-
400:
|
7143
|
-
message:
|
7159
|
+
400: z88.object({
|
7160
|
+
message: z88.string()
|
7144
7161
|
}),
|
7145
7162
|
401: DefaultUnauthorizedSchema,
|
7146
7163
|
500: DefaultErrorResponseSchema
|
@@ -7150,17 +7167,17 @@ var widgetContract = initContract29().router(
|
|
7150
7167
|
getWidgets: {
|
7151
7168
|
method: "GET",
|
7152
7169
|
path: "",
|
7153
|
-
query:
|
7154
|
-
page:
|
7155
|
-
pageSize:
|
7156
|
-
keyword:
|
7170
|
+
query: z88.object({
|
7171
|
+
page: z88.coerce.number().default(1),
|
7172
|
+
pageSize: z88.coerce.number().default(10),
|
7173
|
+
keyword: z88.coerce.string().optional()
|
7157
7174
|
}).optional(),
|
7158
7175
|
headers: DefaultHeaderSchema,
|
7159
7176
|
responses: {
|
7160
7177
|
200: WithPagination(WidgetSchema),
|
7161
7178
|
500: DefaultErrorResponseSchema,
|
7162
|
-
400:
|
7163
|
-
message:
|
7179
|
+
400: z88.object({
|
7180
|
+
message: z88.string()
|
7164
7181
|
}),
|
7165
7182
|
401: DefaultUnauthorizedSchema
|
7166
7183
|
},
|
@@ -7171,9 +7188,9 @@ var widgetContract = initContract29().router(
|
|
7171
7188
|
path: "/menu",
|
7172
7189
|
headers: DefaultHeaderSchema,
|
7173
7190
|
responses: {
|
7174
|
-
200:
|
7175
|
-
400:
|
7176
|
-
message:
|
7191
|
+
200: z88.array(WidgetSchema),
|
7192
|
+
400: z88.object({
|
7193
|
+
message: z88.string()
|
7177
7194
|
}),
|
7178
7195
|
401: DefaultUnauthorizedSchema,
|
7179
7196
|
500: DefaultErrorResponseSchema
|
@@ -7185,9 +7202,9 @@ var widgetContract = initContract29().router(
|
|
7185
7202
|
path: "/ticket_detail",
|
7186
7203
|
headers: DefaultHeaderSchema,
|
7187
7204
|
responses: {
|
7188
|
-
200:
|
7189
|
-
400:
|
7190
|
-
message:
|
7205
|
+
200: z88.array(WidgetSchema),
|
7206
|
+
400: z88.object({
|
7207
|
+
message: z88.string()
|
7191
7208
|
}),
|
7192
7209
|
401: DefaultUnauthorizedSchema,
|
7193
7210
|
500: DefaultErrorResponseSchema
|
@@ -7199,9 +7216,9 @@ var widgetContract = initContract29().router(
|
|
7199
7216
|
path: "/contact_detail",
|
7200
7217
|
headers: DefaultHeaderSchema,
|
7201
7218
|
responses: {
|
7202
|
-
200:
|
7203
|
-
400:
|
7204
|
-
message:
|
7219
|
+
200: z88.array(WidgetSchema),
|
7220
|
+
400: z88.object({
|
7221
|
+
message: z88.string()
|
7205
7222
|
}),
|
7206
7223
|
401: DefaultUnauthorizedSchema,
|
7207
7224
|
500: DefaultErrorResponseSchema
|
@@ -7213,9 +7230,9 @@ var widgetContract = initContract29().router(
|
|
7213
7230
|
path: "/contact_profile",
|
7214
7231
|
headers: DefaultHeaderSchema,
|
7215
7232
|
responses: {
|
7216
|
-
200:
|
7217
|
-
400:
|
7218
|
-
message:
|
7233
|
+
200: z88.array(WidgetSchema),
|
7234
|
+
400: z88.object({
|
7235
|
+
message: z88.string()
|
7219
7236
|
}),
|
7220
7237
|
401: DefaultUnauthorizedSchema,
|
7221
7238
|
500: DefaultErrorResponseSchema
|
@@ -7227,9 +7244,9 @@ var widgetContract = initContract29().router(
|
|
7227
7244
|
path: "/inbox_detail",
|
7228
7245
|
headers: DefaultHeaderSchema,
|
7229
7246
|
responses: {
|
7230
|
-
200:
|
7231
|
-
400:
|
7232
|
-
message:
|
7247
|
+
200: z88.array(WidgetSchema),
|
7248
|
+
400: z88.object({
|
7249
|
+
message: z88.string()
|
7233
7250
|
}),
|
7234
7251
|
401: DefaultUnauthorizedSchema,
|
7235
7252
|
500: DefaultErrorResponseSchema
|
@@ -7239,12 +7256,12 @@ var widgetContract = initContract29().router(
|
|
7239
7256
|
getWidgetById: {
|
7240
7257
|
method: "GET",
|
7241
7258
|
path: "/:id",
|
7242
|
-
pathParams:
|
7259
|
+
pathParams: z88.object({ id: z88.string() }),
|
7243
7260
|
headers: DefaultHeaderSchema,
|
7244
7261
|
responses: {
|
7245
7262
|
200: WidgetSchema,
|
7246
|
-
400:
|
7247
|
-
message:
|
7263
|
+
400: z88.object({
|
7264
|
+
message: z88.string()
|
7248
7265
|
}),
|
7249
7266
|
401: DefaultUnauthorizedSchema,
|
7250
7267
|
500: DefaultErrorResponseSchema
|
@@ -7258,14 +7275,14 @@ var widgetContract = initContract29().router(
|
|
7258
7275
|
headers: DefaultHeaderSchema,
|
7259
7276
|
responses: {
|
7260
7277
|
201: DefaultSuccessResponseSchema.extend({
|
7261
|
-
widget:
|
7262
|
-
token:
|
7263
|
-
headers:
|
7264
|
-
url:
|
7278
|
+
widget: z88.object({
|
7279
|
+
token: z88.string().nullable(),
|
7280
|
+
headers: z88.array(WidgetHeaderSchema),
|
7281
|
+
url: z88.string()
|
7265
7282
|
})
|
7266
7283
|
}),
|
7267
|
-
400:
|
7268
|
-
message:
|
7284
|
+
400: z88.object({
|
7285
|
+
message: z88.string()
|
7269
7286
|
}),
|
7270
7287
|
401: DefaultUnauthorizedSchema
|
7271
7288
|
},
|
@@ -7274,14 +7291,14 @@ var widgetContract = initContract29().router(
|
|
7274
7291
|
updateWidget: {
|
7275
7292
|
method: "PATCH",
|
7276
7293
|
path: "/:id",
|
7277
|
-
pathParams:
|
7294
|
+
pathParams: z88.object({ id: z88.string() }),
|
7278
7295
|
headers: DefaultHeaderSchema,
|
7279
7296
|
responses: {
|
7280
7297
|
201: DefaultSuccessResponseSchema.extend({
|
7281
7298
|
widget: WidgetSchema
|
7282
7299
|
}),
|
7283
|
-
400:
|
7284
|
-
message:
|
7300
|
+
400: z88.object({
|
7301
|
+
message: z88.string()
|
7285
7302
|
}),
|
7286
7303
|
401: DefaultUnauthorizedSchema
|
7287
7304
|
},
|
@@ -7291,11 +7308,11 @@ var widgetContract = initContract29().router(
|
|
7291
7308
|
deleteWidget: {
|
7292
7309
|
method: "DELETE",
|
7293
7310
|
path: "/:id",
|
7294
|
-
pathParams:
|
7311
|
+
pathParams: z88.object({ id: z88.string() }),
|
7295
7312
|
headers: DefaultHeaderSchema,
|
7296
7313
|
body: null,
|
7297
7314
|
responses: {
|
7298
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
7315
|
+
200: DefaultSuccessResponseSchema.extend({ message: z88.string() }),
|
7299
7316
|
500: DefaultErrorResponseSchema
|
7300
7317
|
},
|
7301
7318
|
summary: "Delete a widget."
|
@@ -7306,35 +7323,35 @@ var widgetContract = initContract29().router(
|
|
7306
7323
|
|
7307
7324
|
// src/wrap-up-form/index.ts
|
7308
7325
|
import { initContract as initContract30 } from "@ts-rest/core";
|
7309
|
-
import
|
7326
|
+
import z90 from "zod";
|
7310
7327
|
|
7311
7328
|
// src/wrap-up-form/validation.ts
|
7312
|
-
import { z as
|
7313
|
-
var CreateWrapUpFormSchema =
|
7314
|
-
note:
|
7315
|
-
disposition:
|
7316
|
-
callFrom:
|
7317
|
-
callTo:
|
7329
|
+
import { z as z89 } from "zod";
|
7330
|
+
var CreateWrapUpFormSchema = z89.object({
|
7331
|
+
note: z89.string().nullable().optional(),
|
7332
|
+
disposition: z89.string().nullable().optional(),
|
7333
|
+
callFrom: z89.string().nullable().optional(),
|
7334
|
+
callTo: z89.string().nullable().optional()
|
7318
7335
|
});
|
7319
7336
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
7320
|
-
cxLogId:
|
7321
|
-
type:
|
7322
|
-
tags:
|
7323
|
-
categoryIds:
|
7324
|
-
customFields:
|
7325
|
-
|
7326
|
-
id:
|
7327
|
-
type:
|
7328
|
-
value:
|
7337
|
+
cxLogId: z89.string().uuid().optional(),
|
7338
|
+
type: z89.string().optional(),
|
7339
|
+
tags: z89.array(z89.string()).optional(),
|
7340
|
+
categoryIds: z89.array(z89.string().uuid()).optional(),
|
7341
|
+
customFields: z89.array(
|
7342
|
+
z89.object({
|
7343
|
+
id: z89.string().uuid(),
|
7344
|
+
type: z89.string(),
|
7345
|
+
value: z89.string()
|
7329
7346
|
})
|
7330
7347
|
).optional(),
|
7331
|
-
durationSeconds:
|
7348
|
+
durationSeconds: z89.number().optional()
|
7332
7349
|
});
|
7333
|
-
var CreateCXLogWrapUpFormSchema =
|
7334
|
-
cxLogId:
|
7335
|
-
disposition:
|
7336
|
-
tagIds:
|
7337
|
-
note:
|
7350
|
+
var CreateCXLogWrapUpFormSchema = z89.object({
|
7351
|
+
cxLogId: z89.string().uuid(),
|
7352
|
+
disposition: z89.string().optional(),
|
7353
|
+
tagIds: z89.array(z89.string().uuid()).optional(),
|
7354
|
+
note: z89.string().optional()
|
7338
7355
|
});
|
7339
7356
|
|
7340
7357
|
// src/wrap-up-form/index.ts
|
@@ -7346,10 +7363,10 @@ var wrapUpFormContract = initContract30().router(
|
|
7346
7363
|
headers: DefaultHeaderSchema,
|
7347
7364
|
responses: {
|
7348
7365
|
200: DefaultSuccessResponseSchema.extend({
|
7349
|
-
wrapUpFormTimer:
|
7366
|
+
wrapUpFormTimer: z90.number()
|
7350
7367
|
}),
|
7351
|
-
400:
|
7352
|
-
message:
|
7368
|
+
400: z90.object({
|
7369
|
+
message: z90.string()
|
7353
7370
|
}),
|
7354
7371
|
401: DefaultUnauthorizedSchema,
|
7355
7372
|
500: DefaultErrorResponseSchema
|
@@ -7358,14 +7375,14 @@ var wrapUpFormContract = initContract30().router(
|
|
7358
7375
|
updateWrapUpFormTimer: {
|
7359
7376
|
method: "PATCH",
|
7360
7377
|
path: "/timer",
|
7361
|
-
body:
|
7378
|
+
body: z90.object({ newWrapUpFormTimer: z90.number().positive() }),
|
7362
7379
|
headers: DefaultHeaderSchema,
|
7363
7380
|
responses: {
|
7364
7381
|
200: DefaultSuccessResponseSchema.extend({
|
7365
|
-
wrapUpFormTimer:
|
7382
|
+
wrapUpFormTimer: z90.number()
|
7366
7383
|
}),
|
7367
|
-
400:
|
7368
|
-
message:
|
7384
|
+
400: z90.object({
|
7385
|
+
message: z90.string()
|
7369
7386
|
}),
|
7370
7387
|
401: DefaultUnauthorizedSchema,
|
7371
7388
|
500: DefaultErrorResponseSchema
|
@@ -7380,8 +7397,8 @@ var wrapUpFormContract = initContract30().router(
|
|
7380
7397
|
201: DefaultSuccessResponseSchema.extend({
|
7381
7398
|
wrapUpForm: WrapUpFormSchema
|
7382
7399
|
}),
|
7383
|
-
400:
|
7384
|
-
message:
|
7400
|
+
400: z90.object({
|
7401
|
+
message: z90.string()
|
7385
7402
|
}),
|
7386
7403
|
401: DefaultUnauthorizedSchema,
|
7387
7404
|
500: DefaultErrorResponseSchema
|
@@ -7403,15 +7420,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7403
7420
|
getWrapUpForms: {
|
7404
7421
|
method: "GET",
|
7405
7422
|
path: "",
|
7406
|
-
query:
|
7407
|
-
page:
|
7408
|
-
pageSize:
|
7423
|
+
query: z90.object({
|
7424
|
+
page: z90.coerce.number().default(1),
|
7425
|
+
pageSize: z90.coerce.number().default(10)
|
7409
7426
|
}).optional(),
|
7410
7427
|
headers: DefaultHeaderSchema,
|
7411
7428
|
responses: {
|
7412
7429
|
200: WithPagination(WrapUpFormSchema),
|
7413
|
-
400:
|
7414
|
-
message:
|
7430
|
+
400: z90.object({
|
7431
|
+
message: z90.string()
|
7415
7432
|
}),
|
7416
7433
|
401: DefaultUnauthorizedSchema,
|
7417
7434
|
500: DefaultErrorResponseSchema
|
@@ -7421,12 +7438,12 @@ var wrapUpFormContract = initContract30().router(
|
|
7421
7438
|
getWrapUpForm: {
|
7422
7439
|
method: "GET",
|
7423
7440
|
path: "/:id",
|
7424
|
-
pathParams:
|
7441
|
+
pathParams: z90.object({ id: z90.string() }),
|
7425
7442
|
headers: DefaultHeaderSchema,
|
7426
7443
|
responses: {
|
7427
7444
|
200: WrapUpFormSchema,
|
7428
|
-
400:
|
7429
|
-
message:
|
7445
|
+
400: z90.object({
|
7446
|
+
message: z90.string()
|
7430
7447
|
}),
|
7431
7448
|
401: DefaultUnauthorizedSchema,
|
7432
7449
|
500: DefaultErrorResponseSchema
|
@@ -7435,15 +7452,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7435
7452
|
updateWrapUpForm: {
|
7436
7453
|
method: "PATCH",
|
7437
7454
|
path: "/:id",
|
7438
|
-
pathParams:
|
7455
|
+
pathParams: z90.object({ id: z90.string() }),
|
7439
7456
|
headers: DefaultHeaderSchema,
|
7440
7457
|
body: UpdateWrapUpFormSchema,
|
7441
7458
|
responses: {
|
7442
7459
|
201: DefaultSuccessResponseSchema.extend({
|
7443
7460
|
wrapUpForm: WrapUpFormSchema
|
7444
7461
|
}),
|
7445
|
-
400:
|
7446
|
-
message:
|
7462
|
+
400: z90.object({
|
7463
|
+
message: z90.string()
|
7447
7464
|
}),
|
7448
7465
|
401: DefaultUnauthorizedSchema,
|
7449
7466
|
500: DefaultErrorResponseSchema
|
@@ -7456,28 +7473,28 @@ var wrapUpFormContract = initContract30().router(
|
|
7456
7473
|
|
7457
7474
|
// src/upload/index.ts
|
7458
7475
|
import { initContract as initContract31 } from "@ts-rest/core";
|
7459
|
-
import
|
7476
|
+
import z91 from "zod";
|
7460
7477
|
var uploadContract = initContract31().router(
|
7461
7478
|
{
|
7462
7479
|
rename: {
|
7463
7480
|
method: "POST",
|
7464
7481
|
path: "/:id/rename",
|
7465
|
-
pathParams:
|
7466
|
-
id:
|
7482
|
+
pathParams: z91.object({
|
7483
|
+
id: z91.string()
|
7467
7484
|
}),
|
7468
7485
|
headers: DefaultHeaderSchema,
|
7469
7486
|
responses: {
|
7470
7487
|
201: DefaultSuccessResponseSchema.extend({
|
7471
|
-
message:
|
7488
|
+
message: z91.string()
|
7472
7489
|
}),
|
7473
|
-
400:
|
7474
|
-
message:
|
7490
|
+
400: z91.object({
|
7491
|
+
message: z91.string()
|
7475
7492
|
}),
|
7476
|
-
409:
|
7477
|
-
message:
|
7493
|
+
409: z91.object({
|
7494
|
+
message: z91.string()
|
7478
7495
|
}),
|
7479
|
-
500:
|
7480
|
-
message:
|
7496
|
+
500: z91.object({
|
7497
|
+
message: z91.string()
|
7481
7498
|
}),
|
7482
7499
|
401: DefaultUnauthorizedSchema,
|
7483
7500
|
404: DefaultNotFoundSchema,
|
@@ -7489,23 +7506,23 @@ var uploadContract = initContract31().router(
|
|
7489
7506
|
delete: {
|
7490
7507
|
method: "DELETE",
|
7491
7508
|
path: "/:id",
|
7492
|
-
pathParams:
|
7493
|
-
id:
|
7509
|
+
pathParams: z91.object({
|
7510
|
+
id: z91.string()
|
7494
7511
|
}),
|
7495
7512
|
headers: DefaultHeaderSchema,
|
7496
7513
|
body: null,
|
7497
7514
|
responses: {
|
7498
7515
|
201: DefaultSuccessResponseSchema.extend({
|
7499
|
-
message:
|
7516
|
+
message: z91.string()
|
7500
7517
|
}),
|
7501
|
-
400:
|
7502
|
-
message:
|
7518
|
+
400: z91.object({
|
7519
|
+
message: z91.string()
|
7503
7520
|
}),
|
7504
|
-
409:
|
7505
|
-
message:
|
7521
|
+
409: z91.object({
|
7522
|
+
message: z91.string()
|
7506
7523
|
}),
|
7507
|
-
500:
|
7508
|
-
message:
|
7524
|
+
500: z91.object({
|
7525
|
+
message: z91.string()
|
7509
7526
|
}),
|
7510
7527
|
401: DefaultUnauthorizedSchema,
|
7511
7528
|
404: DefaultNotFoundSchema,
|
@@ -7520,19 +7537,19 @@ var uploadContract = initContract31().router(
|
|
7520
7537
|
);
|
7521
7538
|
|
7522
7539
|
// src/viber/index.ts
|
7523
|
-
import
|
7540
|
+
import z93 from "zod";
|
7524
7541
|
|
7525
7542
|
// src/viber/validation.ts
|
7526
|
-
import
|
7527
|
-
var ViberChannelSchema =
|
7528
|
-
name:
|
7529
|
-
accessToken:
|
7530
|
-
actor:
|
7531
|
-
id:
|
7532
|
-
name:
|
7533
|
-
email:
|
7534
|
-
address:
|
7535
|
-
phone:
|
7543
|
+
import z92 from "zod";
|
7544
|
+
var ViberChannelSchema = z92.object({
|
7545
|
+
name: z92.string(),
|
7546
|
+
accessToken: z92.string(),
|
7547
|
+
actor: z92.object({
|
7548
|
+
id: z92.string().uuid(),
|
7549
|
+
name: z92.string(),
|
7550
|
+
email: z92.string().email(),
|
7551
|
+
address: z92.string().nullable(),
|
7552
|
+
phone: z92.string().nullable()
|
7536
7553
|
}).optional()
|
7537
7554
|
});
|
7538
7555
|
|
@@ -7561,8 +7578,8 @@ var viberContract = initContract32().router({
|
|
7561
7578
|
}),
|
7562
7579
|
400: DefaultErrorResponseSchema
|
7563
7580
|
},
|
7564
|
-
body:
|
7565
|
-
id:
|
7581
|
+
body: z93.object({
|
7582
|
+
id: z93.string().uuid()
|
7566
7583
|
}),
|
7567
7584
|
summary: "Connect viber channel"
|
7568
7585
|
},
|
@@ -7578,8 +7595,8 @@ var viberContract = initContract32().router({
|
|
7578
7595
|
reconnect: {
|
7579
7596
|
method: "POST",
|
7580
7597
|
path: "/reconnect/:channelId",
|
7581
|
-
pathParams:
|
7582
|
-
channelId:
|
7598
|
+
pathParams: z93.object({
|
7599
|
+
channelId: z93.string().uuid()
|
7583
7600
|
}),
|
7584
7601
|
responses: {
|
7585
7602
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7594,8 +7611,8 @@ var viberContract = initContract32().router({
|
|
7594
7611
|
delete: {
|
7595
7612
|
method: "DELETE",
|
7596
7613
|
path: "/delete/:channelId",
|
7597
|
-
pathParams:
|
7598
|
-
channelId:
|
7614
|
+
pathParams: z93.object({
|
7615
|
+
channelId: z93.string().uuid()
|
7599
7616
|
}),
|
7600
7617
|
body: null,
|
7601
7618
|
responses: {
|
@@ -7607,21 +7624,21 @@ var viberContract = initContract32().router({
|
|
7607
7624
|
});
|
7608
7625
|
|
7609
7626
|
// src/telegram/index.ts
|
7610
|
-
import
|
7627
|
+
import z95 from "zod";
|
7611
7628
|
import { initContract as initContract33 } from "@ts-rest/core";
|
7612
7629
|
|
7613
7630
|
// src/telegram/validation.ts
|
7614
|
-
import
|
7615
|
-
var TelegramChannelSchema =
|
7616
|
-
name:
|
7631
|
+
import z94 from "zod";
|
7632
|
+
var TelegramChannelSchema = z94.object({
|
7633
|
+
name: z94.string(),
|
7617
7634
|
// Telegram bot access token
|
7618
|
-
accessToken:
|
7619
|
-
actor:
|
7620
|
-
id:
|
7621
|
-
name:
|
7622
|
-
email:
|
7623
|
-
address:
|
7624
|
-
phone:
|
7635
|
+
accessToken: z94.string(),
|
7636
|
+
actor: z94.object({
|
7637
|
+
id: z94.string().uuid(),
|
7638
|
+
name: z94.string(),
|
7639
|
+
email: z94.string().email(),
|
7640
|
+
address: z94.string().nullable(),
|
7641
|
+
phone: z94.string().nullable()
|
7625
7642
|
}).optional()
|
7626
7643
|
});
|
7627
7644
|
|
@@ -7648,8 +7665,8 @@ var telegramContract = initContract33().router({
|
|
7648
7665
|
500: DefaultErrorResponseSchema,
|
7649
7666
|
400: DefaultErrorResponseSchema
|
7650
7667
|
},
|
7651
|
-
body:
|
7652
|
-
id:
|
7668
|
+
body: z95.object({
|
7669
|
+
id: z95.string().uuid()
|
7653
7670
|
}),
|
7654
7671
|
summary: "Disconnect telegram channel"
|
7655
7672
|
},
|
@@ -7665,8 +7682,8 @@ var telegramContract = initContract33().router({
|
|
7665
7682
|
reconnect: {
|
7666
7683
|
method: "POST",
|
7667
7684
|
path: "/reconnect/:channelId",
|
7668
|
-
pathParams:
|
7669
|
-
channelId:
|
7685
|
+
pathParams: z95.object({
|
7686
|
+
channelId: z95.string().uuid()
|
7670
7687
|
}),
|
7671
7688
|
body: null,
|
7672
7689
|
responses: {
|
@@ -7679,8 +7696,8 @@ var telegramContract = initContract33().router({
|
|
7679
7696
|
delete: {
|
7680
7697
|
method: "DELETE",
|
7681
7698
|
path: "/delete/:channelId",
|
7682
|
-
pathParams:
|
7683
|
-
channelId:
|
7699
|
+
pathParams: z95.object({
|
7700
|
+
channelId: z95.string().uuid()
|
7684
7701
|
}),
|
7685
7702
|
body: null,
|
7686
7703
|
responses: {
|
@@ -7694,58 +7711,58 @@ var telegramContract = initContract33().router({
|
|
7694
7711
|
|
7695
7712
|
// src/notification/index.ts
|
7696
7713
|
import { initContract as initContract34 } from "@ts-rest/core";
|
7697
|
-
import
|
7714
|
+
import z98 from "zod";
|
7698
7715
|
|
7699
7716
|
// src/notification/validation.ts
|
7700
|
-
import
|
7717
|
+
import z97 from "zod";
|
7701
7718
|
|
7702
7719
|
// src/notification/schema.ts
|
7703
|
-
import
|
7704
|
-
var NotificationChangeSchema =
|
7705
|
-
id:
|
7706
|
-
createdAt:
|
7707
|
-
updatedAt:
|
7708
|
-
deletedAt:
|
7709
|
-
actorId:
|
7720
|
+
import z96 from "zod";
|
7721
|
+
var NotificationChangeSchema = z96.object({
|
7722
|
+
id: z96.string().uuid(),
|
7723
|
+
createdAt: z96.date(),
|
7724
|
+
updatedAt: z96.date(),
|
7725
|
+
deletedAt: z96.date().nullable(),
|
7726
|
+
actorId: z96.string().uuid(),
|
7710
7727
|
actor: UserSchema,
|
7711
|
-
notificationObjectId:
|
7712
|
-
readAt:
|
7713
|
-
});
|
7714
|
-
var NotificationObjectSchema =
|
7715
|
-
id:
|
7716
|
-
createdAt:
|
7717
|
-
updatedAt:
|
7718
|
-
deletedAt:
|
7719
|
-
data:
|
7728
|
+
notificationObjectId: z96.string().uuid(),
|
7729
|
+
readAt: z96.date()
|
7730
|
+
});
|
7731
|
+
var NotificationObjectSchema = z96.object({
|
7732
|
+
id: z96.string().uuid(),
|
7733
|
+
createdAt: z96.date(),
|
7734
|
+
updatedAt: z96.date(),
|
7735
|
+
deletedAt: z96.date().nullable(),
|
7736
|
+
data: z96.string(),
|
7720
7737
|
notificationChange: NotificationChangeSchema
|
7721
7738
|
});
|
7722
|
-
var NotificationSchema =
|
7723
|
-
id:
|
7724
|
-
createdAt:
|
7725
|
-
updatedAt:
|
7726
|
-
deletedAt:
|
7727
|
-
notificationObjectId:
|
7728
|
-
notifierId:
|
7739
|
+
var NotificationSchema = z96.object({
|
7740
|
+
id: z96.string().uuid(),
|
7741
|
+
createdAt: z96.date(),
|
7742
|
+
updatedAt: z96.date(),
|
7743
|
+
deletedAt: z96.date().nullable(),
|
7744
|
+
notificationObjectId: z96.string().uuid(),
|
7745
|
+
notifierId: z96.string().uuid(),
|
7729
7746
|
notificationObject: NotificationObjectSchema,
|
7730
|
-
readAt:
|
7747
|
+
readAt: z96.date()
|
7731
7748
|
});
|
7732
7749
|
|
7733
7750
|
// src/notification/validation.ts
|
7734
|
-
var GetNotificationsRequestSchema =
|
7735
|
-
page:
|
7736
|
-
pageSize:
|
7751
|
+
var GetNotificationsRequestSchema = z97.object({
|
7752
|
+
page: z97.coerce.number().default(1),
|
7753
|
+
pageSize: z97.coerce.number().default(10)
|
7737
7754
|
});
|
7738
|
-
var GetNotificationsResponseSchema =
|
7739
|
-
notificationCount:
|
7740
|
-
notifications:
|
7741
|
-
total:
|
7742
|
-
page:
|
7743
|
-
pageSize:
|
7744
|
-
lastPage:
|
7745
|
-
totalUnreadCount:
|
7755
|
+
var GetNotificationsResponseSchema = z97.object({
|
7756
|
+
notificationCount: z97.number(),
|
7757
|
+
notifications: z97.array(NotificationSchema),
|
7758
|
+
total: z97.number(),
|
7759
|
+
page: z97.number(),
|
7760
|
+
pageSize: z97.number(),
|
7761
|
+
lastPage: z97.number(),
|
7762
|
+
totalUnreadCount: z97.number().optional()
|
7746
7763
|
});
|
7747
|
-
var ResetNotificationRequestSchema =
|
7748
|
-
userId:
|
7764
|
+
var ResetNotificationRequestSchema = z97.object({
|
7765
|
+
userId: z97.string()
|
7749
7766
|
});
|
7750
7767
|
|
7751
7768
|
// src/notification/index.ts
|
@@ -7759,14 +7776,14 @@ var userNotificationContract = initContract34().router(
|
|
7759
7776
|
200: DefaultSuccessResponseSchema.extend({
|
7760
7777
|
data: GetNotificationsResponseSchema
|
7761
7778
|
}),
|
7762
|
-
400:
|
7763
|
-
message:
|
7779
|
+
400: z98.object({
|
7780
|
+
message: z98.string()
|
7764
7781
|
}),
|
7765
|
-
409:
|
7766
|
-
message:
|
7782
|
+
409: z98.object({
|
7783
|
+
message: z98.string()
|
7767
7784
|
}),
|
7768
|
-
500:
|
7769
|
-
message:
|
7785
|
+
500: z98.object({
|
7786
|
+
message: z98.string()
|
7770
7787
|
}),
|
7771
7788
|
401: DefaultUnauthorizedSchema,
|
7772
7789
|
404: DefaultNotFoundSchema,
|
@@ -7779,16 +7796,16 @@ var userNotificationContract = initContract34().router(
|
|
7779
7796
|
path: "/new_notifications_count",
|
7780
7797
|
responses: {
|
7781
7798
|
200: DefaultSuccessResponseSchema.extend({
|
7782
|
-
total:
|
7799
|
+
total: z98.number()
|
7783
7800
|
}),
|
7784
|
-
400:
|
7785
|
-
message:
|
7801
|
+
400: z98.object({
|
7802
|
+
message: z98.string()
|
7786
7803
|
}),
|
7787
|
-
409:
|
7788
|
-
message:
|
7804
|
+
409: z98.object({
|
7805
|
+
message: z98.string()
|
7789
7806
|
}),
|
7790
|
-
500:
|
7791
|
-
message:
|
7807
|
+
500: z98.object({
|
7808
|
+
message: z98.string()
|
7792
7809
|
}),
|
7793
7810
|
401: DefaultUnauthorizedSchema,
|
7794
7811
|
404: DefaultNotFoundSchema,
|
@@ -7803,14 +7820,14 @@ var userNotificationContract = initContract34().router(
|
|
7803
7820
|
201: DefaultSuccessResponseSchema.extend({
|
7804
7821
|
data: UserSchema
|
7805
7822
|
}),
|
7806
|
-
400:
|
7807
|
-
message:
|
7823
|
+
400: z98.object({
|
7824
|
+
message: z98.string()
|
7808
7825
|
}),
|
7809
|
-
409:
|
7810
|
-
message:
|
7826
|
+
409: z98.object({
|
7827
|
+
message: z98.string()
|
7811
7828
|
}),
|
7812
|
-
500:
|
7813
|
-
message:
|
7829
|
+
500: z98.object({
|
7830
|
+
message: z98.string()
|
7814
7831
|
}),
|
7815
7832
|
401: DefaultUnauthorizedSchema,
|
7816
7833
|
404: DefaultNotFoundSchema,
|
@@ -7822,19 +7839,19 @@ var userNotificationContract = initContract34().router(
|
|
7822
7839
|
readNotification: {
|
7823
7840
|
method: "POST",
|
7824
7841
|
path: "/read/:id",
|
7825
|
-
pathParams:
|
7842
|
+
pathParams: z98.object({ id: z98.string() }),
|
7826
7843
|
responses: {
|
7827
7844
|
201: DefaultSuccessResponseSchema.extend({
|
7828
7845
|
data: NotificationSchema
|
7829
7846
|
}),
|
7830
|
-
400:
|
7831
|
-
message:
|
7847
|
+
400: z98.object({
|
7848
|
+
message: z98.string()
|
7832
7849
|
}),
|
7833
|
-
409:
|
7834
|
-
message:
|
7850
|
+
409: z98.object({
|
7851
|
+
message: z98.string()
|
7835
7852
|
}),
|
7836
|
-
500:
|
7837
|
-
message:
|
7853
|
+
500: z98.object({
|
7854
|
+
message: z98.string()
|
7838
7855
|
}),
|
7839
7856
|
401: DefaultUnauthorizedSchema,
|
7840
7857
|
404: DefaultNotFoundSchema,
|
@@ -7851,63 +7868,63 @@ var userNotificationContract = initContract34().router(
|
|
7851
7868
|
|
7852
7869
|
// src/snippet/index.ts
|
7853
7870
|
import { initContract as initContract35 } from "@ts-rest/core";
|
7854
|
-
import { z as
|
7871
|
+
import { z as z101 } from "zod";
|
7855
7872
|
|
7856
7873
|
// src/snippet/schema.ts
|
7857
|
-
import
|
7874
|
+
import z99 from "zod";
|
7858
7875
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7859
|
-
name:
|
7860
|
-
platformType:
|
7876
|
+
name: z99.string(),
|
7877
|
+
platformType: z99.string()
|
7861
7878
|
});
|
7862
7879
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7863
|
-
contentType:
|
7864
|
-
contentValue:
|
7865
|
-
contentTemplate:
|
7866
|
-
order:
|
7880
|
+
contentType: z99.string(),
|
7881
|
+
contentValue: z99.string().nullable(),
|
7882
|
+
contentTemplate: z99.any().nullable(),
|
7883
|
+
order: z99.number(),
|
7867
7884
|
upload: UploadSchema.nullable()
|
7868
7885
|
});
|
7869
7886
|
var SnippetSchema = DefaultEntitySchema.extend({
|
7870
|
-
name:
|
7887
|
+
name: z99.string(),
|
7871
7888
|
snippetGroup: SnippetGroupSchema,
|
7872
7889
|
snippetContent: SnippetContentSchema
|
7873
7890
|
});
|
7874
|
-
var SnippetGroupListItemSchema =
|
7875
|
-
id:
|
7876
|
-
name:
|
7891
|
+
var SnippetGroupListItemSchema = z99.object({
|
7892
|
+
id: z99.string().uuid(),
|
7893
|
+
name: z99.string()
|
7877
7894
|
});
|
7878
|
-
var SnippetListItemSchema =
|
7879
|
-
id:
|
7880
|
-
shortCutName:
|
7881
|
-
contentType:
|
7882
|
-
contentValue:
|
7883
|
-
snippetGroupId:
|
7895
|
+
var SnippetListItemSchema = z99.object({
|
7896
|
+
id: z99.string().uuid(),
|
7897
|
+
shortCutName: z99.string(),
|
7898
|
+
contentType: z99.string(),
|
7899
|
+
contentValue: z99.string().nullable(),
|
7900
|
+
snippetGroupId: z99.string()
|
7884
7901
|
});
|
7885
7902
|
|
7886
7903
|
// src/snippet/validation.ts
|
7887
|
-
import { z as
|
7888
|
-
var CreateSnippetGroupSchema =
|
7889
|
-
name:
|
7890
|
-
platformType:
|
7904
|
+
import { z as z100 } from "zod";
|
7905
|
+
var CreateSnippetGroupSchema = z100.object({
|
7906
|
+
name: z100.string(),
|
7907
|
+
platformType: z100.string()
|
7891
7908
|
});
|
7892
|
-
var UpdateSnippetGroupSchema =
|
7893
|
-
name:
|
7894
|
-
platformType:
|
7909
|
+
var UpdateSnippetGroupSchema = z100.object({
|
7910
|
+
name: z100.string().optional(),
|
7911
|
+
platformType: z100.string().optional()
|
7895
7912
|
});
|
7896
|
-
var DeleteSnippetGroupSchema =
|
7897
|
-
id:
|
7913
|
+
var DeleteSnippetGroupSchema = z100.object({
|
7914
|
+
id: z100.string()
|
7898
7915
|
});
|
7899
|
-
var CreateSnippetSchema =
|
7900
|
-
shortcutName:
|
7901
|
-
contentType:
|
7902
|
-
contentValue:
|
7903
|
-
snippetGroupId:
|
7904
|
-
platformType:
|
7916
|
+
var CreateSnippetSchema = z100.object({
|
7917
|
+
shortcutName: z100.string(),
|
7918
|
+
contentType: z100.string(),
|
7919
|
+
contentValue: z100.string().optional(),
|
7920
|
+
snippetGroupId: z100.string(),
|
7921
|
+
platformType: z100.string()
|
7905
7922
|
});
|
7906
7923
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7907
|
-
snippetContentId:
|
7924
|
+
snippetContentId: z100.string()
|
7908
7925
|
});
|
7909
|
-
var DeleteSnippetSchema =
|
7910
|
-
snippetId:
|
7926
|
+
var DeleteSnippetSchema = z100.object({
|
7927
|
+
snippetId: z100.string()
|
7911
7928
|
});
|
7912
7929
|
|
7913
7930
|
// src/snippet/index.ts
|
@@ -7930,7 +7947,7 @@ var snippetContract = initContract35().router(
|
|
7930
7947
|
query: null,
|
7931
7948
|
responses: {
|
7932
7949
|
200: DefaultSuccessResponseSchema.extend({
|
7933
|
-
snippetgroups:
|
7950
|
+
snippetgroups: z101.array(SnippetGroupSchema)
|
7934
7951
|
}),
|
7935
7952
|
500: DefaultErrorResponseSchema
|
7936
7953
|
}
|
@@ -7938,7 +7955,7 @@ var snippetContract = initContract35().router(
|
|
7938
7955
|
updateSnippetGroup: {
|
7939
7956
|
method: "PATCH",
|
7940
7957
|
path: "/groups/:id",
|
7941
|
-
pathParams:
|
7958
|
+
pathParams: z101.object({ id: z101.string() }),
|
7942
7959
|
body: UpdateSnippetGroupSchema,
|
7943
7960
|
responses: {
|
7944
7961
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7950,7 +7967,7 @@ var snippetContract = initContract35().router(
|
|
7950
7967
|
deleteSnippetGroup: {
|
7951
7968
|
method: "DELETE",
|
7952
7969
|
path: "/groups/:id",
|
7953
|
-
pathParams:
|
7970
|
+
pathParams: z101.object({ id: z101.string() }),
|
7954
7971
|
body: null,
|
7955
7972
|
responses: {
|
7956
7973
|
200: DefaultSuccessResponseSchema,
|
@@ -7962,7 +7979,7 @@ var snippetContract = initContract35().router(
|
|
7962
7979
|
path: "",
|
7963
7980
|
responses: {
|
7964
7981
|
200: DefaultSuccessResponseSchema.extend({
|
7965
|
-
snippets:
|
7982
|
+
snippets: z101.array(SnippetSchema)
|
7966
7983
|
}),
|
7967
7984
|
500: DefaultErrorResponseSchema
|
7968
7985
|
}
|
@@ -7981,7 +7998,7 @@ var snippetContract = initContract35().router(
|
|
7981
7998
|
updateSnippet: {
|
7982
7999
|
method: "PATCH",
|
7983
8000
|
path: "/:id",
|
7984
|
-
pathParams:
|
8001
|
+
pathParams: z101.object({ id: z101.string() }),
|
7985
8002
|
body: UpdateSnippetSchema,
|
7986
8003
|
responses: {
|
7987
8004
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7993,7 +8010,7 @@ var snippetContract = initContract35().router(
|
|
7993
8010
|
deleteSnippet: {
|
7994
8011
|
method: "DELETE",
|
7995
8012
|
path: "/:id",
|
7996
|
-
pathParams:
|
8013
|
+
pathParams: z101.object({ id: z101.string() }),
|
7997
8014
|
body: null,
|
7998
8015
|
responses: {
|
7999
8016
|
200: DefaultSuccessResponseSchema,
|
@@ -8010,77 +8027,77 @@ var snippetContract = initContract35().router(
|
|
8010
8027
|
import { initContract as initContract36 } from "@ts-rest/core";
|
8011
8028
|
|
8012
8029
|
// src/business-calendar/validation.ts
|
8013
|
-
import
|
8014
|
-
var TimeSlotDataSchema =
|
8015
|
-
var CreateBusinessHourSchema =
|
8016
|
-
day:
|
8017
|
-
isEnabled:
|
8030
|
+
import z102 from "zod";
|
8031
|
+
var TimeSlotDataSchema = z102.any();
|
8032
|
+
var CreateBusinessHourSchema = z102.object({
|
8033
|
+
day: z102.string(),
|
8034
|
+
isEnabled: z102.boolean(),
|
8018
8035
|
timeSlots: TimeSlotDataSchema
|
8019
8036
|
}).array();
|
8020
|
-
var UpdateBusinessHourSchema =
|
8021
|
-
id:
|
8022
|
-
day:
|
8023
|
-
isEnabled:
|
8037
|
+
var UpdateBusinessHourSchema = z102.object({
|
8038
|
+
id: z102.string(),
|
8039
|
+
day: z102.string(),
|
8040
|
+
isEnabled: z102.boolean(),
|
8024
8041
|
timeSlots: TimeSlotDataSchema
|
8025
8042
|
}).array();
|
8026
|
-
var CreateHolidaySchema =
|
8027
|
-
name:
|
8028
|
-
date:
|
8029
|
-
isEnabled:
|
8043
|
+
var CreateHolidaySchema = z102.object({
|
8044
|
+
name: z102.string(),
|
8045
|
+
date: z102.string(),
|
8046
|
+
isEnabled: z102.boolean()
|
8030
8047
|
}).array();
|
8031
|
-
var UpdateHolidaySchema =
|
8032
|
-
id:
|
8033
|
-
name:
|
8034
|
-
date:
|
8035
|
-
isEnabled:
|
8048
|
+
var UpdateHolidaySchema = z102.object({
|
8049
|
+
id: z102.string().optional(),
|
8050
|
+
name: z102.string(),
|
8051
|
+
date: z102.string(),
|
8052
|
+
isEnabled: z102.boolean()
|
8036
8053
|
}).array();
|
8037
|
-
var CreateBusinessCalendarSchema =
|
8038
|
-
name:
|
8039
|
-
description:
|
8040
|
-
timeZone:
|
8041
|
-
isEnabled:
|
8054
|
+
var CreateBusinessCalendarSchema = z102.object({
|
8055
|
+
name: z102.string(),
|
8056
|
+
description: z102.string().optional(),
|
8057
|
+
timeZone: z102.string(),
|
8058
|
+
isEnabled: z102.boolean(),
|
8042
8059
|
businessHours: CreateBusinessHourSchema,
|
8043
8060
|
holidays: CreateHolidaySchema
|
8044
8061
|
});
|
8045
|
-
var UpdateBusinessCalendarSchema =
|
8046
|
-
id:
|
8047
|
-
name:
|
8048
|
-
description:
|
8049
|
-
timeZone:
|
8050
|
-
isEnabled:
|
8062
|
+
var UpdateBusinessCalendarSchema = z102.object({
|
8063
|
+
id: z102.string(),
|
8064
|
+
name: z102.string(),
|
8065
|
+
description: z102.string().optional(),
|
8066
|
+
timeZone: z102.string(),
|
8067
|
+
isEnabled: z102.boolean(),
|
8051
8068
|
businessHours: UpdateBusinessHourSchema,
|
8052
8069
|
holidays: UpdateHolidaySchema
|
8053
8070
|
});
|
8054
|
-
var DeleteBusinessCalendarSchema =
|
8055
|
-
id:
|
8071
|
+
var DeleteBusinessCalendarSchema = z102.object({
|
8072
|
+
id: z102.string()
|
8056
8073
|
});
|
8057
8074
|
|
8058
8075
|
// src/business-calendar/schema.ts
|
8059
|
-
import
|
8060
|
-
var TimeSlotDataSchema2 =
|
8076
|
+
import z103 from "zod";
|
8077
|
+
var TimeSlotDataSchema2 = z103.any();
|
8061
8078
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
8062
|
-
day:
|
8063
|
-
isEnabled:
|
8079
|
+
day: z103.string(),
|
8080
|
+
isEnabled: z103.boolean(),
|
8064
8081
|
timeSlots: TimeSlotDataSchema2
|
8065
8082
|
});
|
8066
8083
|
var HolidaySchema = DefaultEntitySchema.extend({
|
8067
|
-
name:
|
8068
|
-
date:
|
8069
|
-
isEnabled:
|
8070
|
-
isDefault:
|
8084
|
+
name: z103.string(),
|
8085
|
+
date: z103.string(),
|
8086
|
+
isEnabled: z103.boolean(),
|
8087
|
+
isDefault: z103.boolean()
|
8071
8088
|
});
|
8072
8089
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
8073
|
-
name:
|
8074
|
-
description:
|
8075
|
-
timeZone:
|
8076
|
-
isEnabled:
|
8077
|
-
isDefault:
|
8090
|
+
name: z103.string(),
|
8091
|
+
description: z103.string().optional(),
|
8092
|
+
timeZone: z103.string(),
|
8093
|
+
isEnabled: z103.boolean(),
|
8094
|
+
isDefault: z103.boolean(),
|
8078
8095
|
businessHours: BusinessHourSchema.array(),
|
8079
8096
|
holidays: HolidaySchema.array()
|
8080
8097
|
});
|
8081
8098
|
|
8082
8099
|
// src/business-calendar/index.ts
|
8083
|
-
import
|
8100
|
+
import z104 from "zod";
|
8084
8101
|
var businessCalendarContract = initContract36().router(
|
8085
8102
|
{
|
8086
8103
|
createBusinessCalendar: {
|
@@ -8107,7 +8124,7 @@ var businessCalendarContract = initContract36().router(
|
|
8107
8124
|
updateBusinessCalendar: {
|
8108
8125
|
method: "POST",
|
8109
8126
|
path: "/:id",
|
8110
|
-
pathParams:
|
8127
|
+
pathParams: z104.object({ id: z104.string() }),
|
8111
8128
|
body: UpdateBusinessCalendarSchema,
|
8112
8129
|
responses: {
|
8113
8130
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -8119,7 +8136,7 @@ var businessCalendarContract = initContract36().router(
|
|
8119
8136
|
deleteBusinessCalendar: {
|
8120
8137
|
method: "DELETE",
|
8121
8138
|
path: "/:id",
|
8122
|
-
pathParams:
|
8139
|
+
pathParams: z104.object({ id: z104.string() }),
|
8123
8140
|
body: null,
|
8124
8141
|
responses: {
|
8125
8142
|
200: DefaultSuccessResponseSchema,
|
@@ -8136,73 +8153,73 @@ var businessCalendarContract = initContract36().router(
|
|
8136
8153
|
import { initContract as initContract37 } from "@ts-rest/core";
|
8137
8154
|
|
8138
8155
|
// src/facebook-feed/validation.ts
|
8139
|
-
import
|
8140
|
-
var GetFacebookPagesSchema2 =
|
8141
|
-
data:
|
8142
|
-
|
8156
|
+
import z105 from "zod";
|
8157
|
+
var GetFacebookPagesSchema2 = z105.object({
|
8158
|
+
data: z105.array(
|
8159
|
+
z105.object({
|
8143
8160
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8144
|
-
access_token:
|
8145
|
-
category:
|
8161
|
+
access_token: z105.string(),
|
8162
|
+
category: z105.string(),
|
8146
8163
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8147
|
-
category_list:
|
8148
|
-
|
8149
|
-
id:
|
8150
|
-
name:
|
8164
|
+
category_list: z105.array(
|
8165
|
+
z105.object({
|
8166
|
+
id: z105.string(),
|
8167
|
+
name: z105.string()
|
8151
8168
|
})
|
8152
8169
|
),
|
8153
|
-
id:
|
8154
|
-
name:
|
8155
|
-
tasks:
|
8170
|
+
id: z105.string(),
|
8171
|
+
name: z105.string(),
|
8172
|
+
tasks: z105.string().array()
|
8156
8173
|
})
|
8157
8174
|
),
|
8158
|
-
paging:
|
8159
|
-
cursors:
|
8160
|
-
before:
|
8161
|
-
after:
|
8175
|
+
paging: z105.object({
|
8176
|
+
cursors: z105.object({
|
8177
|
+
before: z105.string().optional(),
|
8178
|
+
after: z105.string().optional()
|
8162
8179
|
})
|
8163
8180
|
}).optional()
|
8164
8181
|
});
|
8165
|
-
var GetFacebookPagesQuerySchema2 =
|
8166
|
-
accessToken:
|
8167
|
-
userId:
|
8182
|
+
var GetFacebookPagesQuerySchema2 = z105.object({
|
8183
|
+
accessToken: z105.string(),
|
8184
|
+
userId: z105.string()
|
8168
8185
|
});
|
8169
8186
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
8170
|
-
|
8171
|
-
isReloginRequired:
|
8172
|
-
platformContacts:
|
8173
|
-
id:
|
8174
|
-
name:
|
8175
|
-
createdAt:
|
8176
|
-
updatedAt:
|
8177
|
-
deletedAt:
|
8187
|
+
z105.object({
|
8188
|
+
isReloginRequired: z105.boolean(),
|
8189
|
+
platformContacts: z105.array(PlatformContactSchema),
|
8190
|
+
id: z105.string().uuid(),
|
8191
|
+
name: z105.string(),
|
8192
|
+
createdAt: z105.date(),
|
8193
|
+
updatedAt: z105.date(),
|
8194
|
+
deletedAt: z105.date().nullable()
|
8178
8195
|
})
|
8179
8196
|
);
|
8180
|
-
var GetFeedPostResponseSchema =
|
8181
|
-
id:
|
8182
|
-
message:
|
8183
|
-
created_time:
|
8184
|
-
can_reply_privately:
|
8185
|
-
from:
|
8186
|
-
permalink_url:
|
8187
|
-
attachments:
|
8188
|
-
data:
|
8189
|
-
|
8190
|
-
media:
|
8191
|
-
image:
|
8192
|
-
height:
|
8193
|
-
src:
|
8194
|
-
width:
|
8197
|
+
var GetFeedPostResponseSchema = z105.object({
|
8198
|
+
id: z105.string(),
|
8199
|
+
message: z105.string(),
|
8200
|
+
created_time: z105.string(),
|
8201
|
+
can_reply_privately: z105.boolean(),
|
8202
|
+
from: z105.object({ name: z105.string(), id: z105.string() }),
|
8203
|
+
permalink_url: z105.string(),
|
8204
|
+
attachments: z105.object({
|
8205
|
+
data: z105.array(
|
8206
|
+
z105.object({
|
8207
|
+
media: z105.object({
|
8208
|
+
image: z105.object({
|
8209
|
+
height: z105.number(),
|
8210
|
+
src: z105.string(),
|
8211
|
+
width: z105.number()
|
8195
8212
|
})
|
8196
8213
|
}),
|
8197
|
-
media_type:
|
8198
|
-
url:
|
8214
|
+
media_type: z105.string(),
|
8215
|
+
url: z105.string()
|
8199
8216
|
})
|
8200
8217
|
)
|
8201
8218
|
})
|
8202
8219
|
});
|
8203
8220
|
|
8204
8221
|
// src/facebook-feed/index.ts
|
8205
|
-
import
|
8222
|
+
import z106 from "zod";
|
8206
8223
|
var facebookFeedContract = initContract37().router({
|
8207
8224
|
connectToService: {
|
8208
8225
|
method: "POST",
|
@@ -8227,8 +8244,8 @@ var facebookFeedContract = initContract37().router({
|
|
8227
8244
|
reconnect: {
|
8228
8245
|
method: "POST",
|
8229
8246
|
path: "/reconnect/:channelId",
|
8230
|
-
pathParams:
|
8231
|
-
channelId:
|
8247
|
+
pathParams: z106.object({
|
8248
|
+
channelId: z106.string().uuid()
|
8232
8249
|
}),
|
8233
8250
|
body: null,
|
8234
8251
|
responses: {
|
@@ -8240,8 +8257,8 @@ var facebookFeedContract = initContract37().router({
|
|
8240
8257
|
delete: {
|
8241
8258
|
method: "DELETE",
|
8242
8259
|
path: "/delete/:channelId",
|
8243
|
-
pathParams:
|
8244
|
-
channelId:
|
8260
|
+
pathParams: z106.object({
|
8261
|
+
channelId: z106.string().uuid()
|
8245
8262
|
}),
|
8246
8263
|
body: null,
|
8247
8264
|
responses: {
|
@@ -8293,168 +8310,168 @@ var facebookFeedContract = initContract37().router({
|
|
8293
8310
|
|
8294
8311
|
// src/public-api/index.ts
|
8295
8312
|
import { initContract as initContract38 } from "@ts-rest/core";
|
8296
|
-
import
|
8313
|
+
import z109 from "zod";
|
8297
8314
|
|
8298
8315
|
// src/public-api/validation.ts
|
8299
|
-
import
|
8316
|
+
import z108 from "zod";
|
8300
8317
|
|
8301
8318
|
// src/public-api/schema.ts
|
8302
|
-
import
|
8303
|
-
var ContactPhonesSchema2 =
|
8304
|
-
id:
|
8305
|
-
createdAt:
|
8306
|
-
updatedAt:
|
8307
|
-
deletedAt:
|
8308
|
-
phone:
|
8309
|
-
isPrimary:
|
8310
|
-
});
|
8311
|
-
var ContactEmailsSchema2 =
|
8312
|
-
id:
|
8313
|
-
createdAt:
|
8314
|
-
updatedAt:
|
8315
|
-
deletedAt:
|
8316
|
-
email:
|
8317
|
-
isPrimary:
|
8318
|
-
});
|
8319
|
-
var ContactCustomFieldSchema2 =
|
8320
|
-
id:
|
8321
|
-
createdAt:
|
8322
|
-
updatedAt:
|
8323
|
-
deletedAt:
|
8324
|
-
textValue:
|
8325
|
-
booleanValue:
|
8326
|
-
numberValue:
|
8327
|
-
dateValue:
|
8319
|
+
import z107 from "zod";
|
8320
|
+
var ContactPhonesSchema2 = z107.object({
|
8321
|
+
id: z107.string().uuid(),
|
8322
|
+
createdAt: z107.date(),
|
8323
|
+
updatedAt: z107.date(),
|
8324
|
+
deletedAt: z107.date().nullable(),
|
8325
|
+
phone: z107.string(),
|
8326
|
+
isPrimary: z107.boolean()
|
8327
|
+
});
|
8328
|
+
var ContactEmailsSchema2 = z107.object({
|
8329
|
+
id: z107.string().uuid(),
|
8330
|
+
createdAt: z107.date(),
|
8331
|
+
updatedAt: z107.date(),
|
8332
|
+
deletedAt: z107.date().nullable(),
|
8333
|
+
email: z107.string(),
|
8334
|
+
isPrimary: z107.boolean()
|
8335
|
+
});
|
8336
|
+
var ContactCustomFieldSchema2 = z107.object({
|
8337
|
+
id: z107.string().uuid(),
|
8338
|
+
createdAt: z107.date(),
|
8339
|
+
updatedAt: z107.date(),
|
8340
|
+
deletedAt: z107.date().nullable(),
|
8341
|
+
textValue: z107.string().nullable(),
|
8342
|
+
booleanValue: z107.boolean().nullable(),
|
8343
|
+
numberValue: z107.number().nullable(),
|
8344
|
+
dateValue: z107.date().nullable(),
|
8328
8345
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
8329
|
-
uploads:
|
8330
|
-
});
|
8331
|
-
var ContactEntityTypesSchema2 =
|
8332
|
-
id:
|
8333
|
-
createdAt:
|
8334
|
-
updatedAt:
|
8335
|
-
deletedAt:
|
8336
|
-
entity:
|
8337
|
-
description:
|
8338
|
-
});
|
8339
|
-
var ContactActivitySchema2 =
|
8340
|
-
id:
|
8341
|
-
createdAt:
|
8342
|
-
updatedAt:
|
8343
|
-
deletedAt:
|
8344
|
-
entityId:
|
8345
|
-
description:
|
8346
|
+
uploads: z107.array(UploadSchema)
|
8347
|
+
});
|
8348
|
+
var ContactEntityTypesSchema2 = z107.object({
|
8349
|
+
id: z107.string().uuid(),
|
8350
|
+
createdAt: z107.date(),
|
8351
|
+
updatedAt: z107.date(),
|
8352
|
+
deletedAt: z107.date().nullable(),
|
8353
|
+
entity: z107.string(),
|
8354
|
+
description: z107.string().nullable()
|
8355
|
+
});
|
8356
|
+
var ContactActivitySchema2 = z107.object({
|
8357
|
+
id: z107.string().uuid(),
|
8358
|
+
createdAt: z107.date(),
|
8359
|
+
updatedAt: z107.date(),
|
8360
|
+
deletedAt: z107.date().nullable(),
|
8361
|
+
entityId: z107.string(),
|
8362
|
+
description: z107.string(),
|
8346
8363
|
entityType: ContactEntityTypesSchema2
|
8347
8364
|
});
|
8348
|
-
var ContactSchema2 =
|
8349
|
-
id:
|
8350
|
-
createdAt:
|
8351
|
-
updatedAt:
|
8352
|
-
deletedAt:
|
8353
|
-
name:
|
8354
|
-
address:
|
8355
|
-
channel:
|
8356
|
-
notes:
|
8357
|
-
contactProfile:
|
8358
|
-
socialProfileUrl:
|
8359
|
-
tags:
|
8365
|
+
var ContactSchema2 = z107.object({
|
8366
|
+
id: z107.string().uuid(),
|
8367
|
+
createdAt: z107.date(),
|
8368
|
+
updatedAt: z107.date(),
|
8369
|
+
deletedAt: z107.date().nullable(),
|
8370
|
+
name: z107.string(),
|
8371
|
+
address: z107.string().nullable(),
|
8372
|
+
channel: z107.string().nullable(),
|
8373
|
+
notes: z107.string().nullable(),
|
8374
|
+
contactProfile: z107.string().nullable(),
|
8375
|
+
socialProfileUrl: z107.string().nullable(),
|
8376
|
+
tags: z107.array(TagSchema),
|
8360
8377
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
8361
|
-
customFields:
|
8362
|
-
contactEmails:
|
8363
|
-
contactPhones:
|
8364
|
-
activityLogs:
|
8378
|
+
customFields: z107.array(ContactCustomFieldSchema2),
|
8379
|
+
contactEmails: z107.array(ContactEmailsSchema2),
|
8380
|
+
contactPhones: z107.array(ContactPhonesSchema2),
|
8381
|
+
activityLogs: z107.array(ContactActivitySchema2).optional()
|
8365
8382
|
});
|
8366
8383
|
|
8367
8384
|
// src/public-api/validation.ts
|
8368
8385
|
var ContactContractValidationSchema2 = {
|
8369
8386
|
create: {
|
8370
|
-
request:
|
8371
|
-
name:
|
8372
|
-
email:
|
8373
|
-
|
8374
|
-
email:
|
8375
|
-
isPrimary:
|
8387
|
+
request: z108.object({
|
8388
|
+
name: z108.string(),
|
8389
|
+
email: z108.array(
|
8390
|
+
z108.object({
|
8391
|
+
email: z108.string().email(),
|
8392
|
+
isPrimary: z108.boolean()
|
8376
8393
|
})
|
8377
8394
|
).optional(),
|
8378
|
-
channel:
|
8379
|
-
address:
|
8380
|
-
phone:
|
8381
|
-
|
8382
|
-
phone:
|
8383
|
-
isPrimary:
|
8395
|
+
channel: z108.string().optional(),
|
8396
|
+
address: z108.string().optional(),
|
8397
|
+
phone: z108.array(
|
8398
|
+
z108.object({
|
8399
|
+
phone: z108.string(),
|
8400
|
+
isPrimary: z108.boolean()
|
8384
8401
|
})
|
8385
8402
|
).optional(),
|
8386
|
-
notes:
|
8387
|
-
tags:
|
8388
|
-
company:
|
8389
|
-
customFields:
|
8403
|
+
notes: z108.string().optional(),
|
8404
|
+
tags: z108.array(z108.string()).optional(),
|
8405
|
+
company: z108.string().optional(),
|
8406
|
+
customFields: z108.record(z108.string())
|
8390
8407
|
// Dynamic keys with string values
|
8391
8408
|
}),
|
8392
8409
|
response: ContactSchema2
|
8393
8410
|
},
|
8394
8411
|
getById: {
|
8395
|
-
request:
|
8396
|
-
id:
|
8412
|
+
request: z108.object({
|
8413
|
+
id: z108.string().uuid()
|
8397
8414
|
})
|
8398
8415
|
},
|
8399
8416
|
delete: {
|
8400
|
-
request:
|
8401
|
-
id:
|
8417
|
+
request: z108.object({
|
8418
|
+
id: z108.string().uuid()
|
8402
8419
|
})
|
8403
8420
|
},
|
8404
8421
|
getAll: {
|
8405
|
-
request:
|
8406
|
-
page:
|
8407
|
-
pageSize:
|
8408
|
-
keyword:
|
8409
|
-
company:
|
8410
|
-
name:
|
8411
|
-
address:
|
8412
|
-
channel:
|
8413
|
-
selectedDate:
|
8414
|
-
customFields:
|
8415
|
-
|
8416
|
-
attributeId:
|
8417
|
-
type:
|
8418
|
-
value:
|
8422
|
+
request: z108.object({
|
8423
|
+
page: z108.coerce.number().default(1),
|
8424
|
+
pageSize: z108.coerce.number().default(10),
|
8425
|
+
keyword: z108.string().optional(),
|
8426
|
+
company: z108.array(z108.string().uuid()),
|
8427
|
+
name: z108.string(),
|
8428
|
+
address: z108.string(),
|
8429
|
+
channel: z108.array(z108.string()),
|
8430
|
+
selectedDate: z108.string(),
|
8431
|
+
customFields: z108.array(
|
8432
|
+
z108.object({
|
8433
|
+
attributeId: z108.string().uuid(),
|
8434
|
+
type: z108.string(),
|
8435
|
+
value: z108.union([z108.string(), z108.array(z108.string())])
|
8419
8436
|
})
|
8420
8437
|
),
|
8421
|
-
tags:
|
8422
|
-
phone:
|
8423
|
-
email:
|
8424
|
-
notes:
|
8438
|
+
tags: z108.array(z108.string().uuid()),
|
8439
|
+
phone: z108.string(),
|
8440
|
+
email: z108.string(),
|
8441
|
+
notes: z108.string()
|
8425
8442
|
}).partial(),
|
8426
8443
|
response: {
|
8427
|
-
page:
|
8428
|
-
pageSize:
|
8429
|
-
total:
|
8430
|
-
lastPage:
|
8431
|
-
data:
|
8444
|
+
page: z108.number(),
|
8445
|
+
pageSize: z108.number(),
|
8446
|
+
total: z108.number(),
|
8447
|
+
lastPage: z108.number(),
|
8448
|
+
data: z108.array(ContactSchema2)
|
8432
8449
|
}
|
8433
8450
|
},
|
8434
8451
|
getContactFields: {
|
8435
|
-
request:
|
8436
|
-
page:
|
8437
|
-
pageSize:
|
8452
|
+
request: z108.object({
|
8453
|
+
page: z108.coerce.number().default(1),
|
8454
|
+
pageSize: z108.coerce.number().default(10)
|
8438
8455
|
}).partial(),
|
8439
8456
|
response: {
|
8440
|
-
page:
|
8441
|
-
pageSize:
|
8442
|
-
total:
|
8443
|
-
lastPage:
|
8444
|
-
data:
|
8457
|
+
page: z108.number(),
|
8458
|
+
pageSize: z108.number(),
|
8459
|
+
total: z108.number(),
|
8460
|
+
lastPage: z108.number(),
|
8461
|
+
data: z108.array(ContactCustomFieldSchema2)
|
8445
8462
|
}
|
8446
8463
|
},
|
8447
8464
|
addAttachments: {
|
8448
|
-
request:
|
8449
|
-
contactId:
|
8450
|
-
attributeId:
|
8451
|
-
contactAttachmentRecords:
|
8452
|
-
|
8453
|
-
bucketName:
|
8454
|
-
fileKey:
|
8455
|
-
fileName:
|
8456
|
-
fileSize:
|
8457
|
-
url:
|
8465
|
+
request: z108.object({
|
8466
|
+
contactId: z108.string(),
|
8467
|
+
attributeId: z108.string().uuid(),
|
8468
|
+
contactAttachmentRecords: z108.array(
|
8469
|
+
z108.object({
|
8470
|
+
bucketName: z108.string(),
|
8471
|
+
fileKey: z108.string(),
|
8472
|
+
fileName: z108.string(),
|
8473
|
+
fileSize: z108.coerce.number(),
|
8474
|
+
url: z108.string()
|
8458
8475
|
})
|
8459
8476
|
)
|
8460
8477
|
}),
|
@@ -8473,11 +8490,11 @@ var publicApiContract = initContract38().router(
|
|
8473
8490
|
201: DefaultSuccessResponseSchema.extend({
|
8474
8491
|
data: ContactSchema2
|
8475
8492
|
}),
|
8476
|
-
400:
|
8477
|
-
message:
|
8493
|
+
400: z109.object({
|
8494
|
+
message: z109.string()
|
8478
8495
|
}),
|
8479
|
-
409:
|
8480
|
-
message:
|
8496
|
+
409: z109.object({
|
8497
|
+
message: z109.string()
|
8481
8498
|
}),
|
8482
8499
|
401: DefaultUnauthorizedSchema,
|
8483
8500
|
404: DefaultNotFoundSchema,
|
@@ -8492,13 +8509,13 @@ var publicApiContract = initContract38().router(
|
|
8492
8509
|
query: GetTagsSchema,
|
8493
8510
|
responses: {
|
8494
8511
|
200: DefaultSuccessResponseSchema.extend({
|
8495
|
-
tags:
|
8512
|
+
tags: z109.array(TagSchema)
|
8496
8513
|
}),
|
8497
|
-
400:
|
8498
|
-
message:
|
8514
|
+
400: z109.object({
|
8515
|
+
message: z109.string()
|
8499
8516
|
}),
|
8500
|
-
409:
|
8501
|
-
message:
|
8517
|
+
409: z109.object({
|
8518
|
+
message: z109.string()
|
8502
8519
|
}),
|
8503
8520
|
401: DefaultUnauthorizedSchema,
|
8504
8521
|
404: DefaultNotFoundSchema,
|
@@ -8514,11 +8531,11 @@ var publicApiContract = initContract38().router(
|
|
8514
8531
|
200: DefaultSuccessResponseSchema.extend(
|
8515
8532
|
ContactContractValidationSchema2.getAll.response
|
8516
8533
|
),
|
8517
|
-
400:
|
8518
|
-
message:
|
8534
|
+
400: z109.object({
|
8535
|
+
message: z109.string()
|
8519
8536
|
}),
|
8520
|
-
409:
|
8521
|
-
message:
|
8537
|
+
409: z109.object({
|
8538
|
+
message: z109.string()
|
8522
8539
|
}),
|
8523
8540
|
401: DefaultUnauthorizedSchema,
|
8524
8541
|
404: DefaultNotFoundSchema,
|
@@ -8535,11 +8552,11 @@ var publicApiContract = initContract38().router(
|
|
8535
8552
|
200: DefaultSuccessResponseSchema.extend(
|
8536
8553
|
ContactContractValidationSchema2.getContactFields.response
|
8537
8554
|
),
|
8538
|
-
400:
|
8539
|
-
message:
|
8555
|
+
400: z109.object({
|
8556
|
+
message: z109.string()
|
8540
8557
|
}),
|
8541
|
-
409:
|
8542
|
-
message:
|
8558
|
+
409: z109.object({
|
8559
|
+
message: z109.string()
|
8543
8560
|
}),
|
8544
8561
|
401: DefaultUnauthorizedSchema,
|
8545
8562
|
404: DefaultNotFoundSchema,
|
@@ -8553,17 +8570,17 @@ var publicApiContract = initContract38().router(
|
|
8553
8570
|
path: "/contacts/:id",
|
8554
8571
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8555
8572
|
responses: {
|
8556
|
-
200:
|
8557
|
-
status:
|
8558
|
-
message:
|
8573
|
+
200: z109.object({
|
8574
|
+
status: z109.string(),
|
8575
|
+
message: z109.string(),
|
8559
8576
|
data: ContactSchema2,
|
8560
|
-
requestId:
|
8577
|
+
requestId: z109.string()
|
8561
8578
|
}),
|
8562
|
-
400:
|
8563
|
-
message:
|
8579
|
+
400: z109.object({
|
8580
|
+
message: z109.string()
|
8564
8581
|
}),
|
8565
|
-
409:
|
8566
|
-
message:
|
8582
|
+
409: z109.object({
|
8583
|
+
message: z109.string()
|
8567
8584
|
}),
|
8568
8585
|
401: DefaultUnauthorizedSchema,
|
8569
8586
|
404: DefaultNotFoundSchema,
|
@@ -8581,11 +8598,11 @@ var publicApiContract = initContract38().router(
|
|
8581
8598
|
201: DefaultSuccessResponseSchema.extend({
|
8582
8599
|
message: ContactCustomFieldSchema2
|
8583
8600
|
}),
|
8584
|
-
400:
|
8585
|
-
message:
|
8601
|
+
400: z109.object({
|
8602
|
+
message: z109.string()
|
8586
8603
|
}),
|
8587
|
-
409:
|
8588
|
-
message:
|
8604
|
+
409: z109.object({
|
8605
|
+
message: z109.string()
|
8589
8606
|
}),
|
8590
8607
|
401: DefaultUnauthorizedSchema,
|
8591
8608
|
404: DefaultNotFoundSchema,
|
@@ -8599,17 +8616,17 @@ var publicApiContract = initContract38().router(
|
|
8599
8616
|
path: "/contacts/:id",
|
8600
8617
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8601
8618
|
responses: {
|
8602
|
-
200:
|
8603
|
-
status:
|
8604
|
-
message:
|
8619
|
+
200: z109.object({
|
8620
|
+
status: z109.string(),
|
8621
|
+
message: z109.string(),
|
8605
8622
|
data: ContactSchema2,
|
8606
|
-
requestId:
|
8623
|
+
requestId: z109.string()
|
8607
8624
|
}),
|
8608
|
-
400:
|
8609
|
-
message:
|
8625
|
+
400: z109.object({
|
8626
|
+
message: z109.string()
|
8610
8627
|
}),
|
8611
|
-
409:
|
8612
|
-
message:
|
8628
|
+
409: z109.object({
|
8629
|
+
message: z109.string()
|
8613
8630
|
}),
|
8614
8631
|
401: DefaultUnauthorizedSchema,
|
8615
8632
|
404: DefaultNotFoundSchema,
|
@@ -8623,17 +8640,17 @@ var publicApiContract = initContract38().router(
|
|
8623
8640
|
path: "/contacts/:id",
|
8624
8641
|
pathParams: ContactContractValidationSchema2.delete.request,
|
8625
8642
|
responses: {
|
8626
|
-
200:
|
8627
|
-
status:
|
8628
|
-
message:
|
8643
|
+
200: z109.object({
|
8644
|
+
status: z109.string(),
|
8645
|
+
message: z109.string(),
|
8629
8646
|
data: ContactSchema2,
|
8630
|
-
requestId:
|
8647
|
+
requestId: z109.string()
|
8631
8648
|
}),
|
8632
|
-
400:
|
8633
|
-
message:
|
8649
|
+
400: z109.object({
|
8650
|
+
message: z109.string()
|
8634
8651
|
}),
|
8635
|
-
409:
|
8636
|
-
message:
|
8652
|
+
409: z109.object({
|
8653
|
+
message: z109.string()
|
8637
8654
|
}),
|
8638
8655
|
401: DefaultUnauthorizedSchema,
|
8639
8656
|
404: DefaultNotFoundSchema,
|
@@ -8651,17 +8668,17 @@ var publicApiContract = initContract38().router(
|
|
8651
8668
|
|
8652
8669
|
// src/workflow-rule/index.ts
|
8653
8670
|
import { initContract as initContract39 } from "@ts-rest/core";
|
8654
|
-
import
|
8671
|
+
import z110 from "zod";
|
8655
8672
|
var chatContract = initContract39().router(
|
8656
8673
|
{
|
8657
8674
|
updateAssignee: {
|
8658
8675
|
method: "POST",
|
8659
8676
|
path: "/room/assignee",
|
8660
|
-
body:
|
8661
|
-
assigneeId:
|
8662
|
-
roomId:
|
8663
|
-
workflowId:
|
8664
|
-
queueId:
|
8677
|
+
body: z110.object({
|
8678
|
+
assigneeId: z110.string().uuid().optional(),
|
8679
|
+
roomId: z110.string().uuid(),
|
8680
|
+
workflowId: z110.string().uuid(),
|
8681
|
+
queueId: z110.string().uuid().optional()
|
8665
8682
|
}),
|
8666
8683
|
responses: {
|
8667
8684
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8675,9 +8692,9 @@ var chatContract = initContract39().router(
|
|
8675
8692
|
autoReply: {
|
8676
8693
|
method: "POST",
|
8677
8694
|
path: "/message/send",
|
8678
|
-
body:
|
8679
|
-
roomId:
|
8680
|
-
message:
|
8695
|
+
body: z110.object({
|
8696
|
+
roomId: z110.string().uuid(),
|
8697
|
+
message: z110.string(),
|
8681
8698
|
messageType: WorkflowAutoReplyMessageTypeSchema
|
8682
8699
|
// workflowId: z.string().uuid(),
|
8683
8700
|
}),
|
@@ -8693,15 +8710,15 @@ var chatContract = initContract39().router(
|
|
8693
8710
|
solveRoom: {
|
8694
8711
|
method: "POST",
|
8695
8712
|
path: "/room/solve",
|
8696
|
-
body:
|
8697
|
-
roomId:
|
8698
|
-
disposition:
|
8699
|
-
workflowId:
|
8713
|
+
body: z110.object({
|
8714
|
+
roomId: z110.string(),
|
8715
|
+
disposition: z110.string(),
|
8716
|
+
workflowId: z110.string().uuid()
|
8700
8717
|
}),
|
8701
8718
|
responses: {
|
8702
8719
|
200: DefaultSuccessResponseSchema.extend({
|
8703
8720
|
data: RoomSchema.extend({
|
8704
|
-
solveMessage:
|
8721
|
+
solveMessage: z110.string()
|
8705
8722
|
})
|
8706
8723
|
}),
|
8707
8724
|
409: DefaultErrorResponseSchema
|
@@ -8711,9 +8728,9 @@ var chatContract = initContract39().router(
|
|
8711
8728
|
emitMessage: {
|
8712
8729
|
method: "POST",
|
8713
8730
|
path: "/message/emit",
|
8714
|
-
body:
|
8715
|
-
messageId:
|
8716
|
-
queueId:
|
8731
|
+
body: z110.object({
|
8732
|
+
messageId: z110.string().uuid(),
|
8733
|
+
queueId: z110.string().uuid().optional().nullable()
|
8717
8734
|
}),
|
8718
8735
|
responses: {
|
8719
8736
|
200: DefaultSuccessResponseSchema,
|
@@ -8721,19 +8738,33 @@ var chatContract = initContract39().router(
|
|
8721
8738
|
404: DefaultErrorResponseSchema
|
8722
8739
|
},
|
8723
8740
|
summary: "Get message by ID"
|
8741
|
+
},
|
8742
|
+
tagContact: {
|
8743
|
+
method: "POST",
|
8744
|
+
path: "/contact/tag",
|
8745
|
+
body: z110.object({
|
8746
|
+
contactId: z110.string().uuid(),
|
8747
|
+
tagId: z110.string().uuid()
|
8748
|
+
}),
|
8749
|
+
responses: {
|
8750
|
+
200: DefaultSuccessResponseSchema,
|
8751
|
+
403: DefaultErrorResponseSchema,
|
8752
|
+
404: DefaultErrorResponseSchema
|
8753
|
+
},
|
8754
|
+
summary: "Attach Tag to Contact"
|
8724
8755
|
}
|
8725
8756
|
},
|
8726
8757
|
{
|
8727
|
-
baseHeaders:
|
8728
|
-
"x-tenant":
|
8729
|
-
"x-code":
|
8758
|
+
baseHeaders: z110.object({
|
8759
|
+
"x-tenant": z110.string({ required_error: "Tenant id is required" }),
|
8760
|
+
"x-code": z110.string().uuid().optional()
|
8730
8761
|
}),
|
8731
8762
|
pathPrefix: "chat"
|
8732
8763
|
}
|
8733
8764
|
);
|
8734
8765
|
|
8735
8766
|
// src/botpress/index.ts
|
8736
|
-
import
|
8767
|
+
import z111 from "zod";
|
8737
8768
|
import { initContract as initContract40 } from "@ts-rest/core";
|
8738
8769
|
var botpressContract = initContract40().router(
|
8739
8770
|
{
|
@@ -8752,7 +8783,7 @@ var botpressContract = initContract40().router(
|
|
8752
8783
|
path: "/",
|
8753
8784
|
responses: {
|
8754
8785
|
200: DefaultSuccessResponseSchema.extend({
|
8755
|
-
data:
|
8786
|
+
data: z111.array(BotpressBotSchema)
|
8756
8787
|
}),
|
8757
8788
|
500: DefaultErrorResponseSchema
|
8758
8789
|
}
|
@@ -8789,7 +8820,7 @@ var botContract = initContract40().router(
|
|
8789
8820
|
path: "/",
|
8790
8821
|
responses: {
|
8791
8822
|
200: DefaultSuccessResponseSchema.extend({
|
8792
|
-
data:
|
8823
|
+
data: z111.array(BotpressBotSchema)
|
8793
8824
|
}),
|
8794
8825
|
500: DefaultErrorResponseSchema
|
8795
8826
|
}
|
@@ -8802,17 +8833,17 @@ var botContract = initContract40().router(
|
|
8802
8833
|
|
8803
8834
|
// src/presence-status/index.ts
|
8804
8835
|
import { initContract as initContract41 } from "@ts-rest/core";
|
8805
|
-
import
|
8836
|
+
import z113 from "zod";
|
8806
8837
|
|
8807
8838
|
// src/presence-status/validation.ts
|
8808
|
-
import { z as
|
8809
|
-
var CreatePresenceStatusSchema =
|
8810
|
-
systemName:
|
8811
|
-
displayName:
|
8812
|
-
description:
|
8813
|
-
position:
|
8814
|
-
emoji:
|
8815
|
-
presenceStatusOption:
|
8839
|
+
import { z as z112 } from "zod";
|
8840
|
+
var CreatePresenceStatusSchema = z112.object({
|
8841
|
+
systemName: z112.string(),
|
8842
|
+
displayName: z112.string(),
|
8843
|
+
description: z112.string().optional(),
|
8844
|
+
position: z112.number(),
|
8845
|
+
emoji: z112.string(),
|
8846
|
+
presenceStatusOption: z112.array(TPresenceStatusOption)
|
8816
8847
|
});
|
8817
8848
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
8818
8849
|
|
@@ -8823,16 +8854,16 @@ var presenceStatusContract = initContract41().router(
|
|
8823
8854
|
method: "GET",
|
8824
8855
|
path: "",
|
8825
8856
|
headers: DefaultHeaderSchema,
|
8826
|
-
query:
|
8827
|
-
keyword:
|
8857
|
+
query: z113.object({
|
8858
|
+
keyword: z113.string().optional()
|
8828
8859
|
}).optional(),
|
8829
8860
|
responses: {
|
8830
|
-
200:
|
8831
|
-
total:
|
8832
|
-
data:
|
8861
|
+
200: z113.object({
|
8862
|
+
total: z113.number(),
|
8863
|
+
data: z113.array(PresenceStatusSchema)
|
8833
8864
|
}),
|
8834
|
-
400:
|
8835
|
-
message:
|
8865
|
+
400: z113.object({
|
8866
|
+
message: z113.string()
|
8836
8867
|
}),
|
8837
8868
|
401: DefaultUnauthorizedSchema,
|
8838
8869
|
500: DefaultErrorResponseSchema
|
@@ -8844,9 +8875,9 @@ var presenceStatusContract = initContract41().router(
|
|
8844
8875
|
path: "/ps/user-presence-status",
|
8845
8876
|
headers: DefaultHeaderSchema,
|
8846
8877
|
responses: {
|
8847
|
-
200:
|
8848
|
-
400:
|
8849
|
-
message:
|
8878
|
+
200: z113.array(UserPresenceStatusSchema),
|
8879
|
+
400: z113.object({
|
8880
|
+
message: z113.string()
|
8850
8881
|
}),
|
8851
8882
|
401: DefaultUnauthorizedSchema,
|
8852
8883
|
500: DefaultErrorResponseSchema
|
@@ -8862,8 +8893,8 @@ var presenceStatusContract = initContract41().router(
|
|
8862
8893
|
201: DefaultSuccessResponseSchema.extend({
|
8863
8894
|
presenceStatus: PresenceStatusSchema
|
8864
8895
|
}),
|
8865
|
-
400:
|
8866
|
-
message:
|
8896
|
+
400: z113.object({
|
8897
|
+
message: z113.string()
|
8867
8898
|
}),
|
8868
8899
|
401: DefaultUnauthorizedSchema,
|
8869
8900
|
404: DefaultNotFoundSchema,
|
@@ -8875,12 +8906,12 @@ var presenceStatusContract = initContract41().router(
|
|
8875
8906
|
getPresenceStatusById: {
|
8876
8907
|
method: "GET",
|
8877
8908
|
path: "/:id",
|
8878
|
-
pathParams:
|
8909
|
+
pathParams: z113.object({ id: z113.string() }),
|
8879
8910
|
headers: DefaultHeaderSchema,
|
8880
8911
|
responses: {
|
8881
8912
|
200: PresenceStatusSchema,
|
8882
|
-
400:
|
8883
|
-
message:
|
8913
|
+
400: z113.object({
|
8914
|
+
message: z113.string()
|
8884
8915
|
}),
|
8885
8916
|
401: DefaultUnauthorizedSchema,
|
8886
8917
|
404: DefaultNotFoundSchema,
|
@@ -8892,15 +8923,15 @@ var presenceStatusContract = initContract41().router(
|
|
8892
8923
|
updatePresenceStatus: {
|
8893
8924
|
method: "PATCH",
|
8894
8925
|
path: "/:id",
|
8895
|
-
pathParams:
|
8926
|
+
pathParams: z113.object({ id: z113.string() }),
|
8896
8927
|
headers: DefaultHeaderSchema,
|
8897
8928
|
body: UpdatePresenceStatusSchema,
|
8898
8929
|
responses: {
|
8899
8930
|
201: DefaultSuccessResponseSchema.extend({
|
8900
8931
|
presenceStatus: PresenceStatusSchema
|
8901
8932
|
}),
|
8902
|
-
400:
|
8903
|
-
message:
|
8933
|
+
400: z113.object({
|
8934
|
+
message: z113.string()
|
8904
8935
|
}),
|
8905
8936
|
401: DefaultUnauthorizedSchema,
|
8906
8937
|
404: DefaultNotFoundSchema,
|
@@ -8912,11 +8943,11 @@ var presenceStatusContract = initContract41().router(
|
|
8912
8943
|
deletePresenceStatus: {
|
8913
8944
|
method: "DELETE",
|
8914
8945
|
path: "/:id",
|
8915
|
-
pathParams:
|
8946
|
+
pathParams: z113.object({ id: z113.string() }),
|
8916
8947
|
headers: DefaultHeaderSchema,
|
8917
8948
|
body: null,
|
8918
8949
|
responses: {
|
8919
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8950
|
+
200: DefaultSuccessResponseSchema.extend({ message: z113.string() }),
|
8920
8951
|
404: DefaultNotFoundSchema,
|
8921
8952
|
422: DefaultUnprocessibleSchema,
|
8922
8953
|
500: DefaultErrorResponseSchema
|
@@ -8929,7 +8960,7 @@ var presenceStatusContract = initContract41().router(
|
|
8929
8960
|
|
8930
8961
|
// src/whatsapp/index.ts
|
8931
8962
|
import { initContract as initContract42 } from "@ts-rest/core";
|
8932
|
-
import
|
8963
|
+
import z114 from "zod";
|
8933
8964
|
var whatsappContract = initContract42().router({
|
8934
8965
|
sendMessage: {
|
8935
8966
|
method: "POST",
|
@@ -8964,11 +8995,11 @@ var whatsappContract = initContract42().router({
|
|
8964
8995
|
reconnect: {
|
8965
8996
|
method: "POST",
|
8966
8997
|
path: "/reconnect/:channelId",
|
8967
|
-
pathParams:
|
8968
|
-
channelId:
|
8998
|
+
pathParams: z114.object({
|
8999
|
+
channelId: z114.string().uuid()
|
8969
9000
|
}),
|
8970
|
-
body:
|
8971
|
-
instanceId:
|
9001
|
+
body: z114.object({
|
9002
|
+
instanceId: z114.string().nullable().optional()
|
8972
9003
|
}),
|
8973
9004
|
responses: {
|
8974
9005
|
200: ChannelServiceResponseSchema,
|
@@ -8979,8 +9010,8 @@ var whatsappContract = initContract42().router({
|
|
8979
9010
|
delete: {
|
8980
9011
|
method: "DELETE",
|
8981
9012
|
path: "/delete/:channelId",
|
8982
|
-
pathParams:
|
8983
|
-
channelId:
|
9013
|
+
pathParams: z114.object({
|
9014
|
+
channelId: z114.string().uuid()
|
8984
9015
|
}),
|
8985
9016
|
body: null,
|
8986
9017
|
responses: {
|
@@ -9022,10 +9053,10 @@ var whatsappContract = initContract42().router({
|
|
9022
9053
|
deleteWaapi: {
|
9023
9054
|
method: "DELETE",
|
9024
9055
|
path: "/mobile/:instanceId",
|
9025
|
-
pathParams:
|
9026
|
-
instanceId:
|
9056
|
+
pathParams: z114.object({
|
9057
|
+
instanceId: z114.string()
|
9027
9058
|
}),
|
9028
|
-
body:
|
9059
|
+
body: z114.any().optional(),
|
9029
9060
|
responses: {
|
9030
9061
|
200: DefaultSuccessResponseSchema,
|
9031
9062
|
500: DefaultErrorResponseSchema,
|
@@ -9046,21 +9077,21 @@ var whatsappContract = initContract42().router({
|
|
9046
9077
|
|
9047
9078
|
// src/invoice/index.ts
|
9048
9079
|
import { initContract as initContract43 } from "@ts-rest/core";
|
9049
|
-
import { z as
|
9080
|
+
import { z as z116 } from "zod";
|
9050
9081
|
|
9051
9082
|
// src/invoice/schema.ts
|
9052
|
-
import
|
9083
|
+
import z115 from "zod";
|
9053
9084
|
var InvoiceSchema = DefaultEntitySchema.extend({
|
9054
|
-
invoiceId:
|
9055
|
-
amountPaid:
|
9056
|
-
billingReason:
|
9057
|
-
collectionMethod:
|
9058
|
-
created:
|
9059
|
-
currency:
|
9060
|
-
hostedInvoiceUrl:
|
9061
|
-
invoicePdf:
|
9062
|
-
number:
|
9063
|
-
paid:
|
9085
|
+
invoiceId: z115.string(),
|
9086
|
+
amountPaid: z115.number(),
|
9087
|
+
billingReason: z115.string(),
|
9088
|
+
collectionMethod: z115.string(),
|
9089
|
+
created: z115.number(),
|
9090
|
+
currency: z115.string(),
|
9091
|
+
hostedInvoiceUrl: z115.string(),
|
9092
|
+
invoicePdf: z115.string(),
|
9093
|
+
number: z115.string(),
|
9094
|
+
paid: z115.boolean()
|
9064
9095
|
});
|
9065
9096
|
|
9066
9097
|
// src/invoice/index.ts
|
@@ -9072,7 +9103,7 @@ var invoiceContract = initContract43().router(
|
|
9072
9103
|
query: null,
|
9073
9104
|
responses: {
|
9074
9105
|
200: DefaultSuccessResponseSchema.extend({
|
9075
|
-
invoices:
|
9106
|
+
invoices: z116.array(InvoiceSchema)
|
9076
9107
|
}),
|
9077
9108
|
500: DefaultErrorResponseSchema
|
9078
9109
|
}
|
@@ -9282,7 +9313,7 @@ var presenceStatusContract2 = initContract44().router({
|
|
9282
9313
|
|
9283
9314
|
// src/general-setting/index.ts
|
9284
9315
|
import { initContract as initContract45 } from "@ts-rest/core";
|
9285
|
-
import
|
9316
|
+
import z117 from "zod";
|
9286
9317
|
var generalSettingContract = initContract45().router(
|
9287
9318
|
{
|
9288
9319
|
autoOpenedContactWidgetId: {
|
@@ -9290,20 +9321,20 @@ var generalSettingContract = initContract45().router(
|
|
9290
9321
|
method: "GET",
|
9291
9322
|
path: "/auto-opened-contact-widget-id",
|
9292
9323
|
responses: {
|
9293
|
-
200:
|
9294
|
-
autoOpenedContactWidgetId:
|
9324
|
+
200: z117.object({
|
9325
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9295
9326
|
})
|
9296
9327
|
}
|
9297
9328
|
},
|
9298
9329
|
updateAutoOpenedContactWidgetId: {
|
9299
9330
|
method: "PATCH",
|
9300
9331
|
path: "/auto-opened-contact-widget-id",
|
9301
|
-
body:
|
9302
|
-
autoOpenedContactWidgetId:
|
9332
|
+
body: z117.object({
|
9333
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9303
9334
|
}),
|
9304
9335
|
responses: {
|
9305
|
-
200:
|
9306
|
-
autoOpenedContactWidgetId:
|
9336
|
+
200: z117.object({
|
9337
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9307
9338
|
})
|
9308
9339
|
}
|
9309
9340
|
}
|
@@ -9316,49 +9347,51 @@ var generalSettingContract = initContract45().router(
|
|
9316
9347
|
|
9317
9348
|
// src/automation-queue/index.ts
|
9318
9349
|
import { initContract as initContract46 } from "@ts-rest/core";
|
9319
|
-
import { z as
|
9350
|
+
import { z as z120 } from "zod";
|
9320
9351
|
|
9321
9352
|
// src/automation-queue/validation.ts
|
9322
|
-
import { z as
|
9323
|
-
var QueueDistributionStrategySchema =
|
9324
|
-
|
9325
|
-
|
9326
|
-
|
9327
|
-
|
9353
|
+
import { z as z118 } from "zod";
|
9354
|
+
var QueueDistributionStrategySchema = z118.union([
|
9355
|
+
z118.literal("round-robin"),
|
9356
|
+
z118.literal("fewest-assignments"),
|
9357
|
+
z118.literal("random"),
|
9358
|
+
z118.literal("notify-all")
|
9328
9359
|
]);
|
9329
|
-
var CreateAutomationQueueSchema =
|
9330
|
-
emoji:
|
9331
|
-
name:
|
9332
|
-
description:
|
9333
|
-
managerIds:
|
9334
|
-
agentIds:
|
9335
|
-
distributionStrategy: QueueDistributionStrategySchema,
|
9336
|
-
maximumAssignPerAgent:
|
9360
|
+
var CreateAutomationQueueSchema = z118.object({
|
9361
|
+
emoji: z118.string().emoji(),
|
9362
|
+
name: z118.string(),
|
9363
|
+
description: z118.string().nullable(),
|
9364
|
+
managerIds: z118.array(z118.string().uuid()).min(1),
|
9365
|
+
agentIds: z118.array(z118.string().uuid()).min(1),
|
9366
|
+
distributionStrategy: QueueDistributionStrategySchema.nullable(),
|
9367
|
+
maximumAssignPerAgent: z118.number().positive().nullable(),
|
9368
|
+
autoAssign: z118.boolean().nullable()
|
9337
9369
|
// ringTimeOut: z.number().positive(),
|
9338
9370
|
// retryInterval: z.number().positive(),
|
9339
9371
|
// queueTimeOut: z.number().positive(),
|
9340
9372
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9341
9373
|
});
|
9342
9374
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9343
|
-
var CheckHasAssignedRoomSchema =
|
9344
|
-
userId:
|
9345
|
-
queueId:
|
9375
|
+
var CheckHasAssignedRoomSchema = z118.object({
|
9376
|
+
userId: z118.string().uuid().optional(),
|
9377
|
+
queueId: z118.string().uuid().optional()
|
9346
9378
|
});
|
9347
9379
|
|
9348
9380
|
// src/automation-queue/schema.ts
|
9349
|
-
import { z as
|
9381
|
+
import { z as z119 } from "zod";
|
9350
9382
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9351
|
-
emoji:
|
9352
|
-
name:
|
9353
|
-
description:
|
9383
|
+
emoji: z119.string(),
|
9384
|
+
name: z119.string(),
|
9385
|
+
description: z119.string().nullable(),
|
9354
9386
|
distributionStrategy: QueueDistributionStrategySchema,
|
9355
|
-
maximumAssignPerAgent:
|
9387
|
+
maximumAssignPerAgent: z119.number().positive(),
|
9356
9388
|
// ringTimeOut: z.number(),
|
9357
9389
|
// retryInterval: z.number(),
|
9358
9390
|
// queueTimeOut: z.number(),
|
9359
9391
|
// isAssignmentDeniable: z.boolean(),
|
9360
|
-
|
9361
|
-
|
9392
|
+
autoAssign: z119.boolean(),
|
9393
|
+
managers: z119.array(UserSchema),
|
9394
|
+
agents: z119.array(UserSchema)
|
9362
9395
|
});
|
9363
9396
|
|
9364
9397
|
// src/automation-queue/index.ts
|
@@ -9377,8 +9410,8 @@ var automationQueueContract = initContract46().router(
|
|
9377
9410
|
duplicateAutomationQueue: {
|
9378
9411
|
method: "POST",
|
9379
9412
|
path: "/:id/duplicate",
|
9380
|
-
pathParams:
|
9381
|
-
id:
|
9413
|
+
pathParams: z120.object({
|
9414
|
+
id: z120.string().uuid()
|
9382
9415
|
}),
|
9383
9416
|
body: null,
|
9384
9417
|
responses: {
|
@@ -9390,21 +9423,21 @@ var automationQueueContract = initContract46().router(
|
|
9390
9423
|
getAutomationQueues: {
|
9391
9424
|
method: "GET",
|
9392
9425
|
path: "",
|
9393
|
-
query:
|
9394
|
-
userId:
|
9395
|
-
withRelations:
|
9426
|
+
query: z120.object({
|
9427
|
+
userId: z120.string().uuid().optional(),
|
9428
|
+
withRelations: z120.coerce.boolean().default(true).optional()
|
9396
9429
|
}).optional(),
|
9397
9430
|
responses: {
|
9398
9431
|
200: DefaultSuccessResponseSchema.extend({
|
9399
|
-
data:
|
9432
|
+
data: z120.array(AutomationQueueSchema)
|
9400
9433
|
})
|
9401
9434
|
}
|
9402
9435
|
},
|
9403
9436
|
getAutomationQueueById: {
|
9404
9437
|
method: "GET",
|
9405
9438
|
path: "/:id",
|
9406
|
-
pathParams:
|
9407
|
-
id:
|
9439
|
+
pathParams: z120.object({
|
9440
|
+
id: z120.string().uuid()
|
9408
9441
|
}),
|
9409
9442
|
responses: {
|
9410
9443
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9415,8 +9448,8 @@ var automationQueueContract = initContract46().router(
|
|
9415
9448
|
updateAutomationQueue: {
|
9416
9449
|
method: "PATCH",
|
9417
9450
|
path: "/:id",
|
9418
|
-
pathParams:
|
9419
|
-
id:
|
9451
|
+
pathParams: z120.object({
|
9452
|
+
id: z120.string().uuid()
|
9420
9453
|
}),
|
9421
9454
|
body: UpdateAutomationQueueSchema,
|
9422
9455
|
responses: {
|
@@ -9428,13 +9461,13 @@ var automationQueueContract = initContract46().router(
|
|
9428
9461
|
deleteAutomationQueue: {
|
9429
9462
|
method: "DELETE",
|
9430
9463
|
path: "/:id",
|
9431
|
-
pathParams:
|
9432
|
-
id:
|
9464
|
+
pathParams: z120.object({
|
9465
|
+
id: z120.string().uuid()
|
9433
9466
|
}),
|
9434
9467
|
body: null,
|
9435
9468
|
responses: {
|
9436
9469
|
200: DefaultSuccessResponseSchema.extend({
|
9437
|
-
message:
|
9470
|
+
message: z120.string()
|
9438
9471
|
})
|
9439
9472
|
}
|
9440
9473
|
},
|
@@ -9444,8 +9477,8 @@ var automationQueueContract = initContract46().router(
|
|
9444
9477
|
body: CheckHasAssignedRoomSchema,
|
9445
9478
|
responses: {
|
9446
9479
|
200: DefaultSuccessResponseSchema.extend({
|
9447
|
-
data:
|
9448
|
-
hasAssignedRoom:
|
9480
|
+
data: z120.object({
|
9481
|
+
hasAssignedRoom: z120.boolean()
|
9449
9482
|
})
|
9450
9483
|
})
|
9451
9484
|
}
|
@@ -9462,282 +9495,282 @@ import { initContract as initContract51 } from "@ts-rest/core";
|
|
9462
9495
|
|
9463
9496
|
// src/mail/room-contract.ts
|
9464
9497
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9465
|
-
import
|
9498
|
+
import z125 from "zod";
|
9466
9499
|
|
9467
9500
|
// src/mail/schemas/room.schema.ts
|
9468
|
-
import
|
9501
|
+
import z123 from "zod";
|
9469
9502
|
|
9470
9503
|
// src/mail/schemas/account.schema.ts
|
9504
|
+
import z121 from "zod";
|
9505
|
+
var MailServerSchema = z121.object({
|
9506
|
+
id: z121.string(),
|
9507
|
+
createdAt: z121.date(),
|
9508
|
+
updatedAt: z121.date(),
|
9509
|
+
deletedAt: z121.date().nullable(),
|
9510
|
+
name: z121.string(),
|
9511
|
+
smtpHost: z121.string(),
|
9512
|
+
smtpPort: z121.number(),
|
9513
|
+
smtpTlsPort: z121.number(),
|
9514
|
+
useTlsForSmtp: z121.boolean(),
|
9515
|
+
imapHost: z121.string(),
|
9516
|
+
imapPort: z121.number(),
|
9517
|
+
imapTlsPort: z121.number(),
|
9518
|
+
useTlsForImap: z121.boolean()
|
9519
|
+
});
|
9520
|
+
var MailAccountSchema = z121.object({
|
9521
|
+
id: z121.string(),
|
9522
|
+
createdAt: z121.date(),
|
9523
|
+
updatedAt: z121.date(),
|
9524
|
+
deletedAt: z121.date().nullable(),
|
9525
|
+
name: z121.string(),
|
9526
|
+
address: z121.string(),
|
9527
|
+
accountId: z121.string(),
|
9528
|
+
mailServerId: z121.string(),
|
9529
|
+
mailServer: MailServerSchema,
|
9530
|
+
state: z121.union([
|
9531
|
+
z121.literal("init"),
|
9532
|
+
z121.literal("syncing"),
|
9533
|
+
z121.literal("connecting"),
|
9534
|
+
z121.literal("connected"),
|
9535
|
+
z121.literal("disconnected"),
|
9536
|
+
z121.literal("authenticationError"),
|
9537
|
+
z121.literal("connectError"),
|
9538
|
+
z121.literal("unset")
|
9539
|
+
])
|
9540
|
+
});
|
9541
|
+
var OAuth2AppSchema = z121.object({
|
9542
|
+
id: z121.string(),
|
9543
|
+
name: z121.string(),
|
9544
|
+
description: z121.string(),
|
9545
|
+
title: z121.string(),
|
9546
|
+
provider: z121.string(),
|
9547
|
+
enabled: z121.boolean(),
|
9548
|
+
legacy: z121.boolean(),
|
9549
|
+
created: z121.string(),
|
9550
|
+
updated: z121.string(),
|
9551
|
+
includeInListing: z121.boolean(),
|
9552
|
+
clientId: z121.string(),
|
9553
|
+
clientSecret: z121.string(),
|
9554
|
+
authority: z121.string(),
|
9555
|
+
redirectUrl: z121.string(),
|
9556
|
+
serviceClient: z121.string(),
|
9557
|
+
googleProjectId: z121.string(),
|
9558
|
+
serviceClientEmail: z121.string(),
|
9559
|
+
serviceKey: z121.string()
|
9560
|
+
});
|
9561
|
+
|
9562
|
+
// src/mail/schemas/message.schema.ts
|
9471
9563
|
import z122 from "zod";
|
9472
|
-
var
|
9564
|
+
var AttachmentSchema = z122.object({
|
9473
9565
|
id: z122.string(),
|
9474
9566
|
createdAt: z122.date(),
|
9475
9567
|
updatedAt: z122.date(),
|
9476
|
-
deletedAt: z122.
|
9477
|
-
|
9478
|
-
|
9479
|
-
|
9480
|
-
|
9481
|
-
|
9482
|
-
|
9483
|
-
|
9484
|
-
|
9485
|
-
|
9486
|
-
|
9487
|
-
|
9568
|
+
deletedAt: z122.nullable(z122.date()),
|
9569
|
+
roomId: z122.string(),
|
9570
|
+
messageId: z122.string(),
|
9571
|
+
fileName: z122.string(),
|
9572
|
+
fileType: z122.string(),
|
9573
|
+
emailEngineAttachmentId: z122.string(),
|
9574
|
+
uploadId: z122.string(),
|
9575
|
+
upload: z122.object({
|
9576
|
+
id: z122.string(),
|
9577
|
+
createdAt: z122.date(),
|
9578
|
+
updatedAt: z122.date(),
|
9579
|
+
deletedAt: z122.nullable(z122.date()),
|
9580
|
+
bucketName: z122.string(),
|
9581
|
+
fileName: z122.string(),
|
9582
|
+
fileKey: z122.string(),
|
9583
|
+
fileSize: z122.number(),
|
9584
|
+
fileUrl: z122.string(),
|
9585
|
+
extensionName: z122.string()
|
9586
|
+
})
|
9587
|
+
});
|
9588
|
+
var MessageSchema2 = z122.object({
|
9488
9589
|
id: z122.string(),
|
9489
9590
|
createdAt: z122.date(),
|
9490
9591
|
updatedAt: z122.date(),
|
9491
|
-
deletedAt: z122.
|
9492
|
-
|
9493
|
-
|
9494
|
-
|
9495
|
-
|
9496
|
-
|
9497
|
-
|
9498
|
-
|
9499
|
-
|
9500
|
-
|
9501
|
-
|
9502
|
-
|
9503
|
-
|
9504
|
-
|
9505
|
-
|
9506
|
-
|
9507
|
-
|
9508
|
-
|
9509
|
-
|
9510
|
-
|
9511
|
-
|
9512
|
-
title: z122.string(),
|
9513
|
-
provider: z122.string(),
|
9514
|
-
enabled: z122.boolean(),
|
9515
|
-
legacy: z122.boolean(),
|
9516
|
-
created: z122.string(),
|
9517
|
-
updated: z122.string(),
|
9518
|
-
includeInListing: z122.boolean(),
|
9519
|
-
clientId: z122.string(),
|
9520
|
-
clientSecret: z122.string(),
|
9521
|
-
authority: z122.string(),
|
9522
|
-
redirectUrl: z122.string(),
|
9523
|
-
serviceClient: z122.string(),
|
9524
|
-
googleProjectId: z122.string(),
|
9525
|
-
serviceClientEmail: z122.string(),
|
9526
|
-
serviceKey: z122.string()
|
9592
|
+
deletedAt: z122.nullable(z122.date()),
|
9593
|
+
roomId: z122.string(),
|
9594
|
+
subject: z122.string(),
|
9595
|
+
textPlain: z122.string(),
|
9596
|
+
textHtml: z122.string(),
|
9597
|
+
textId: z122.string(),
|
9598
|
+
emailEngineEmailId: z122.string(),
|
9599
|
+
emailEngineMessageId: z122.string(),
|
9600
|
+
emailEngineReplyTo: z122.nullable(z122.string()),
|
9601
|
+
direction: z122.string(),
|
9602
|
+
date: z122.date(),
|
9603
|
+
action: z122.string(),
|
9604
|
+
unseen: z122.boolean(),
|
9605
|
+
sendAt: z122.date(),
|
9606
|
+
starred: z122.boolean(),
|
9607
|
+
seemsLikeNew: z122.boolean(),
|
9608
|
+
from: z122.array(MailParticipant),
|
9609
|
+
to: z122.array(MailParticipant),
|
9610
|
+
cc: z122.array(MailParticipant),
|
9611
|
+
bcc: z122.array(MailParticipant),
|
9612
|
+
attachments: z122.array(AttachmentSchema)
|
9527
9613
|
});
|
9528
9614
|
|
9529
|
-
// src/mail/schemas/
|
9530
|
-
|
9531
|
-
|
9615
|
+
// src/mail/schemas/room.schema.ts
|
9616
|
+
var ContactSchema3 = z123.object({
|
9617
|
+
id: z123.string().uuid(),
|
9618
|
+
createdAt: z123.date(),
|
9619
|
+
updatedAt: z123.date(),
|
9620
|
+
deletedAt: z123.date().nullable(),
|
9621
|
+
name: z123.string(),
|
9622
|
+
address: z123.string().nullable(),
|
9623
|
+
channel: z123.string().nullable(),
|
9624
|
+
notes: z123.string().nullable(),
|
9625
|
+
contactProfile: z123.string().nullable(),
|
9626
|
+
socialProfileUrl: z123.string().nullable()
|
9627
|
+
});
|
9628
|
+
var MailUserSchema = z123.object({
|
9532
9629
|
id: z123.string(),
|
9533
9630
|
createdAt: z123.date(),
|
9534
9631
|
updatedAt: z123.date(),
|
9535
|
-
deletedAt: z123.
|
9632
|
+
deletedAt: z123.date().nullable(),
|
9633
|
+
name: z123.string(),
|
9634
|
+
address: z123.string(),
|
9635
|
+
contactId: z123.string(),
|
9636
|
+
contact: ContactSchema3,
|
9637
|
+
isNewContact: z123.boolean()
|
9638
|
+
});
|
9639
|
+
var MailParticipant = z123.object({
|
9640
|
+
id: z123.string(),
|
9641
|
+
createdAt: z123.date(),
|
9642
|
+
updatedAt: z123.date(),
|
9643
|
+
deletedAt: z123.date().nullable(),
|
9536
9644
|
roomId: z123.string(),
|
9537
9645
|
messageId: z123.string(),
|
9538
|
-
|
9539
|
-
|
9540
|
-
emailEngineAttachmentId: z123.string(),
|
9541
|
-
uploadId: z123.string(),
|
9542
|
-
upload: z123.object({
|
9543
|
-
id: z123.string(),
|
9544
|
-
createdAt: z123.date(),
|
9545
|
-
updatedAt: z123.date(),
|
9546
|
-
deletedAt: z123.nullable(z123.date()),
|
9547
|
-
bucketName: z123.string(),
|
9548
|
-
fileName: z123.string(),
|
9549
|
-
fileKey: z123.string(),
|
9550
|
-
fileSize: z123.number(),
|
9551
|
-
fileUrl: z123.string(),
|
9552
|
-
extensionName: z123.string()
|
9553
|
-
})
|
9646
|
+
mailUserId: z123.string(),
|
9647
|
+
mailUser: MailUserSchema
|
9554
9648
|
});
|
9555
|
-
var
|
9649
|
+
var TagSchema2 = z123.object({
|
9650
|
+
color: z123.string(),
|
9556
9651
|
id: z123.string(),
|
9557
9652
|
createdAt: z123.date(),
|
9558
9653
|
updatedAt: z123.date(),
|
9559
|
-
deletedAt: z123.
|
9654
|
+
deletedAt: z123.date().nullable(),
|
9655
|
+
name: z123.string()
|
9656
|
+
});
|
9657
|
+
var UserModel = z123.object({
|
9658
|
+
id: z123.string().uuid(),
|
9659
|
+
createdAt: z123.date(),
|
9660
|
+
updatedAt: z123.date(),
|
9661
|
+
deletedAt: z123.date().nullable(),
|
9662
|
+
name: z123.string(),
|
9663
|
+
email: z123.string(),
|
9664
|
+
address: z123.string().nullable(),
|
9665
|
+
phone: z123.string().nullable(),
|
9666
|
+
notificationCount: z123.number().nullable()
|
9667
|
+
});
|
9668
|
+
var ActivityLogModel = z123.object({
|
9669
|
+
id: z123.string(),
|
9670
|
+
createdAt: z123.date(),
|
9671
|
+
updatedAt: z123.date(),
|
9672
|
+
deletedAt: z123.nullable(z123.string()),
|
9673
|
+
description: z123.string(),
|
9674
|
+
actorId: z123.string(),
|
9560
9675
|
roomId: z123.string(),
|
9676
|
+
actor: UserModel
|
9677
|
+
});
|
9678
|
+
var MessagesAndLogsSchema = z123.array(
|
9679
|
+
z123.union([MessageSchema2, ActivityLogModel])
|
9680
|
+
);
|
9681
|
+
var MailRoomSchema = z123.object({
|
9682
|
+
id: z123.string(),
|
9683
|
+
createdAt: z123.date(),
|
9684
|
+
updatedAt: z123.date(),
|
9685
|
+
deletedAt: z123.date().nullable(),
|
9561
9686
|
subject: z123.string(),
|
9562
|
-
|
9563
|
-
|
9564
|
-
|
9565
|
-
|
9566
|
-
emailEngineMessageId: z123.string(),
|
9567
|
-
emailEngineReplyTo: z123.nullable(z123.string()),
|
9687
|
+
resolved: z123.boolean(),
|
9688
|
+
assigneeId: z123.string().nullable(),
|
9689
|
+
note: z123.string(),
|
9690
|
+
mailId: z123.string(),
|
9568
9691
|
direction: z123.string(),
|
9569
|
-
|
9570
|
-
|
9571
|
-
unseen: z123.boolean(),
|
9572
|
-
sendAt: z123.date(),
|
9573
|
-
starred: z123.boolean(),
|
9574
|
-
seemsLikeNew: z123.boolean(),
|
9692
|
+
lastMessageId: z123.string(),
|
9693
|
+
firstMessageId: z123.string(),
|
9575
9694
|
from: z123.array(MailParticipant),
|
9576
9695
|
to: z123.array(MailParticipant),
|
9577
9696
|
cc: z123.array(MailParticipant),
|
9578
9697
|
bcc: z123.array(MailParticipant),
|
9579
|
-
attachments: z123.array(AttachmentSchema)
|
9580
|
-
});
|
9581
|
-
|
9582
|
-
// src/mail/schemas/room.schema.ts
|
9583
|
-
var ContactSchema3 = z124.object({
|
9584
|
-
id: z124.string().uuid(),
|
9585
|
-
createdAt: z124.date(),
|
9586
|
-
updatedAt: z124.date(),
|
9587
|
-
deletedAt: z124.date().nullable(),
|
9588
|
-
name: z124.string(),
|
9589
|
-
address: z124.string().nullable(),
|
9590
|
-
channel: z124.string().nullable(),
|
9591
|
-
notes: z124.string().nullable(),
|
9592
|
-
contactProfile: z124.string().nullable(),
|
9593
|
-
socialProfileUrl: z124.string().nullable()
|
9594
|
-
});
|
9595
|
-
var MailUserSchema = z124.object({
|
9596
|
-
id: z124.string(),
|
9597
|
-
createdAt: z124.date(),
|
9598
|
-
updatedAt: z124.date(),
|
9599
|
-
deletedAt: z124.date().nullable(),
|
9600
|
-
name: z124.string(),
|
9601
|
-
address: z124.string(),
|
9602
|
-
contactId: z124.string(),
|
9603
|
-
contact: ContactSchema3,
|
9604
|
-
isNewContact: z124.boolean()
|
9605
|
-
});
|
9606
|
-
var MailParticipant = z124.object({
|
9607
|
-
id: z124.string(),
|
9608
|
-
createdAt: z124.date(),
|
9609
|
-
updatedAt: z124.date(),
|
9610
|
-
deletedAt: z124.date().nullable(),
|
9611
|
-
roomId: z124.string(),
|
9612
|
-
messageId: z124.string(),
|
9613
|
-
mailUserId: z124.string(),
|
9614
|
-
mailUser: MailUserSchema
|
9615
|
-
});
|
9616
|
-
var TagSchema2 = z124.object({
|
9617
|
-
color: z124.string(),
|
9618
|
-
id: z124.string(),
|
9619
|
-
createdAt: z124.date(),
|
9620
|
-
updatedAt: z124.date(),
|
9621
|
-
deletedAt: z124.date().nullable(),
|
9622
|
-
name: z124.string()
|
9623
|
-
});
|
9624
|
-
var UserModel = z124.object({
|
9625
|
-
id: z124.string().uuid(),
|
9626
|
-
createdAt: z124.date(),
|
9627
|
-
updatedAt: z124.date(),
|
9628
|
-
deletedAt: z124.date().nullable(),
|
9629
|
-
name: z124.string(),
|
9630
|
-
email: z124.string(),
|
9631
|
-
address: z124.string().nullable(),
|
9632
|
-
phone: z124.string().nullable(),
|
9633
|
-
notificationCount: z124.number().nullable()
|
9634
|
-
});
|
9635
|
-
var ActivityLogModel = z124.object({
|
9636
|
-
id: z124.string(),
|
9637
|
-
createdAt: z124.date(),
|
9638
|
-
updatedAt: z124.date(),
|
9639
|
-
deletedAt: z124.nullable(z124.string()),
|
9640
|
-
description: z124.string(),
|
9641
|
-
actorId: z124.string(),
|
9642
|
-
roomId: z124.string(),
|
9643
|
-
actor: UserModel
|
9644
|
-
});
|
9645
|
-
var MessagesAndLogsSchema = z124.array(
|
9646
|
-
z124.union([MessageSchema2, ActivityLogModel])
|
9647
|
-
);
|
9648
|
-
var MailRoomSchema = z124.object({
|
9649
|
-
id: z124.string(),
|
9650
|
-
createdAt: z124.date(),
|
9651
|
-
updatedAt: z124.date(),
|
9652
|
-
deletedAt: z124.date().nullable(),
|
9653
|
-
subject: z124.string(),
|
9654
|
-
resolved: z124.boolean(),
|
9655
|
-
assigneeId: z124.string().nullable(),
|
9656
|
-
note: z124.string(),
|
9657
|
-
mailId: z124.string(),
|
9658
|
-
direction: z124.string(),
|
9659
|
-
lastMessageId: z124.string(),
|
9660
|
-
firstMessageId: z124.string(),
|
9661
|
-
from: z124.array(MailParticipant),
|
9662
|
-
to: z124.array(MailParticipant),
|
9663
|
-
cc: z124.array(MailParticipant),
|
9664
|
-
bcc: z124.array(MailParticipant),
|
9665
9698
|
firstMessage: MessageSchema2,
|
9666
9699
|
lastMessage: MessageSchema2,
|
9667
|
-
tags:
|
9700
|
+
tags: z123.array(TagSchema2),
|
9668
9701
|
assignee: UserModel,
|
9669
|
-
messages:
|
9702
|
+
messages: z123.array(MessageSchema2),
|
9670
9703
|
messagesAndLogs: MessagesAndLogsSchema,
|
9671
9704
|
mail: MailAccountSchema,
|
9672
|
-
unReadMessageCount:
|
9705
|
+
unReadMessageCount: z123.number(),
|
9673
9706
|
cxlog: CxLogSchema
|
9674
9707
|
});
|
9675
|
-
var AttachmentSchema2 =
|
9676
|
-
fileName:
|
9677
|
-
fileType:
|
9678
|
-
emailEngineAttachmentId:
|
9679
|
-
uploadId:
|
9680
|
-
messageId:
|
9681
|
-
roomId:
|
9708
|
+
var AttachmentSchema2 = z123.object({
|
9709
|
+
fileName: z123.string(),
|
9710
|
+
fileType: z123.string(),
|
9711
|
+
emailEngineAttachmentId: z123.string(),
|
9712
|
+
uploadId: z123.string(),
|
9713
|
+
messageId: z123.string(),
|
9714
|
+
roomId: z123.string(),
|
9682
9715
|
upload: UploadSchema
|
9683
9716
|
});
|
9684
9717
|
|
9685
9718
|
// src/mail/schemas/room-validation.schema.ts
|
9686
|
-
import
|
9719
|
+
import z124 from "zod";
|
9687
9720
|
var RoomContractsValidationSchema = {
|
9688
9721
|
getAll: {
|
9689
|
-
input:
|
9690
|
-
page:
|
9691
|
-
pageSize:
|
9692
|
-
keyword:
|
9693
|
-
value:
|
9694
|
-
category:
|
9722
|
+
input: z124.object({
|
9723
|
+
page: z124.coerce.number().default(1),
|
9724
|
+
pageSize: z124.coerce.number().default(10),
|
9725
|
+
keyword: z124.object({
|
9726
|
+
value: z124.string(),
|
9727
|
+
category: z124.union([z124.literal("contact"), z124.literal("message")])
|
9695
9728
|
}).optional(),
|
9696
|
-
contactLabels:
|
9697
|
-
channels:
|
9698
|
-
date:
|
9699
|
-
contacts:
|
9700
|
-
assignees:
|
9701
|
-
level1:
|
9702
|
-
|
9703
|
-
|
9704
|
-
|
9705
|
-
|
9706
|
-
|
9707
|
-
|
9729
|
+
contactLabels: z124.array(z124.string()).optional(),
|
9730
|
+
channels: z124.array(z124.string().email()).optional(),
|
9731
|
+
date: z124.string().optional(),
|
9732
|
+
contacts: z124.array(z124.string()).optional(),
|
9733
|
+
assignees: z124.array(z124.string()).optional(),
|
9734
|
+
level1: z124.union([
|
9735
|
+
z124.literal("open"),
|
9736
|
+
z124.literal("close"),
|
9737
|
+
z124.literal("inbox"),
|
9738
|
+
z124.literal("sent"),
|
9739
|
+
z124.literal("scheduled"),
|
9740
|
+
z124.literal("starred")
|
9708
9741
|
]).optional(),
|
9709
|
-
level2:
|
9710
|
-
|
9711
|
-
|
9712
|
-
|
9713
|
-
|
9742
|
+
level2: z124.union([
|
9743
|
+
z124.literal("all"),
|
9744
|
+
z124.literal("unassign"),
|
9745
|
+
z124.literal("mine"),
|
9746
|
+
z124.literal("other")
|
9714
9747
|
]).optional()
|
9715
9748
|
}),
|
9716
|
-
output:
|
9717
|
-
data:
|
9718
|
-
total:
|
9719
|
-
page:
|
9720
|
-
pageSize:
|
9749
|
+
output: z124.object({
|
9750
|
+
data: z124.array(MailRoomSchema),
|
9751
|
+
total: z124.number(),
|
9752
|
+
page: z124.number(),
|
9753
|
+
pageSize: z124.number()
|
9721
9754
|
})
|
9722
9755
|
},
|
9723
9756
|
update: {
|
9724
|
-
input:
|
9725
|
-
disposition:
|
9726
|
-
|
9727
|
-
|
9728
|
-
|
9729
|
-
|
9730
|
-
|
9731
|
-
|
9757
|
+
input: z124.object({
|
9758
|
+
disposition: z124.union([
|
9759
|
+
z124.literal("resolved"),
|
9760
|
+
z124.literal("follow up"),
|
9761
|
+
z124.literal("escalated"),
|
9762
|
+
z124.literal("dropped"),
|
9763
|
+
z124.literal("prank"),
|
9764
|
+
z124.literal("blank")
|
9732
9765
|
]).optional().nullable(),
|
9733
|
-
assigneeId:
|
9734
|
-
note:
|
9735
|
-
tags:
|
9736
|
-
handover:
|
9737
|
-
|
9766
|
+
assigneeId: z124.string().uuid().optional().nullable(),
|
9767
|
+
note: z124.string().optional(),
|
9768
|
+
tags: z124.array(z124.string().uuid()).optional(),
|
9769
|
+
handover: z124.boolean().or(
|
9770
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9738
9771
|
).optional().nullable(),
|
9739
|
-
selfAssign:
|
9740
|
-
|
9772
|
+
selfAssign: z124.boolean().or(
|
9773
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9741
9774
|
).optional().nullable()
|
9742
9775
|
})
|
9743
9776
|
}
|
@@ -9751,7 +9784,7 @@ var roomContract = initContract47().router(
|
|
9751
9784
|
path: "/",
|
9752
9785
|
responses: {
|
9753
9786
|
200: DefaultSuccessResponseSchema.extend({
|
9754
|
-
message:
|
9787
|
+
message: z125.string()
|
9755
9788
|
}),
|
9756
9789
|
...DefaultResponses
|
9757
9790
|
},
|
@@ -9764,10 +9797,10 @@ var roomContract = initContract47().router(
|
|
9764
9797
|
query: RoomContractsValidationSchema.getAll.input,
|
9765
9798
|
responses: {
|
9766
9799
|
200: DefaultSuccessResponseSchema.extend({
|
9767
|
-
data:
|
9768
|
-
total:
|
9769
|
-
page:
|
9770
|
-
pageSize:
|
9800
|
+
data: z125.array(MailRoomSchema),
|
9801
|
+
total: z125.number(),
|
9802
|
+
page: z125.number(),
|
9803
|
+
pageSize: z125.number()
|
9771
9804
|
}),
|
9772
9805
|
...DefaultResponses
|
9773
9806
|
},
|
@@ -9779,24 +9812,24 @@ var roomContract = initContract47().router(
|
|
9779
9812
|
path: "/count_rooms/all",
|
9780
9813
|
responses: {
|
9781
9814
|
200: DefaultSuccessResponseSchema.extend({
|
9782
|
-
data:
|
9783
|
-
general:
|
9784
|
-
|
9785
|
-
name:
|
9786
|
-
count:
|
9787
|
-
unReadMessagesCount:
|
9815
|
+
data: z125.object({
|
9816
|
+
general: z125.array(
|
9817
|
+
z125.object({
|
9818
|
+
name: z125.string(),
|
9819
|
+
count: z125.number(),
|
9820
|
+
unReadMessagesCount: z125.number()
|
9788
9821
|
})
|
9789
9822
|
),
|
9790
|
-
channels:
|
9791
|
-
|
9823
|
+
channels: z125.array(
|
9824
|
+
z125.object({
|
9792
9825
|
channel: MailAccountSchema,
|
9793
|
-
count:
|
9826
|
+
count: z125.number()
|
9794
9827
|
})
|
9795
9828
|
),
|
9796
|
-
contactLabels:
|
9797
|
-
|
9829
|
+
contactLabels: z125.array(
|
9830
|
+
z125.object({
|
9798
9831
|
label: TagSchema,
|
9799
|
-
count:
|
9832
|
+
count: z125.number()
|
9800
9833
|
})
|
9801
9834
|
)
|
9802
9835
|
})
|
@@ -9808,12 +9841,12 @@ var roomContract = initContract47().router(
|
|
9808
9841
|
getAttachments: {
|
9809
9842
|
method: "GET",
|
9810
9843
|
path: "/:id/attachments",
|
9811
|
-
pathParams:
|
9812
|
-
id:
|
9844
|
+
pathParams: z125.object({
|
9845
|
+
id: z125.string().uuid()
|
9813
9846
|
}),
|
9814
9847
|
responses: {
|
9815
9848
|
200: DefaultSuccessResponseSchema.extend({
|
9816
|
-
data:
|
9849
|
+
data: z125.array(AttachmentSchema2)
|
9817
9850
|
}),
|
9818
9851
|
...DefaultResponses
|
9819
9852
|
},
|
@@ -9822,12 +9855,12 @@ var roomContract = initContract47().router(
|
|
9822
9855
|
getParticipants: {
|
9823
9856
|
method: "GET",
|
9824
9857
|
path: "/:id/participants",
|
9825
|
-
pathParams:
|
9826
|
-
id:
|
9858
|
+
pathParams: z125.object({
|
9859
|
+
id: z125.string().uuid()
|
9827
9860
|
}),
|
9828
9861
|
responses: {
|
9829
9862
|
200: DefaultSuccessResponseSchema.extend({
|
9830
|
-
data:
|
9863
|
+
data: z125.array(MailParticipant)
|
9831
9864
|
}),
|
9832
9865
|
...DefaultResponses
|
9833
9866
|
},
|
@@ -9838,22 +9871,22 @@ var roomContract = initContract47().router(
|
|
9838
9871
|
path: "/add_email_to_contact",
|
9839
9872
|
responses: {
|
9840
9873
|
200: DefaultSuccessResponseSchema.extend({
|
9841
|
-
data:
|
9874
|
+
data: z125.string()
|
9842
9875
|
}),
|
9843
9876
|
...DefaultResponses
|
9844
9877
|
},
|
9845
|
-
body:
|
9846
|
-
email:
|
9847
|
-
contactId:
|
9848
|
-
mailUserId:
|
9878
|
+
body: z125.object({
|
9879
|
+
email: z125.string(),
|
9880
|
+
contactId: z125.string(),
|
9881
|
+
mailUserId: z125.string()
|
9849
9882
|
}),
|
9850
9883
|
summary: "Add a new email of a mail room participant to an existing contact"
|
9851
9884
|
},
|
9852
9885
|
update: {
|
9853
9886
|
method: "PATCH",
|
9854
9887
|
path: "/:id",
|
9855
|
-
pathParams:
|
9856
|
-
id:
|
9888
|
+
pathParams: z125.object({
|
9889
|
+
id: z125.string()
|
9857
9890
|
}),
|
9858
9891
|
responses: {
|
9859
9892
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9867,12 +9900,12 @@ var roomContract = initContract47().router(
|
|
9867
9900
|
markAsRead: {
|
9868
9901
|
method: "POST",
|
9869
9902
|
path: "/mark_as_read",
|
9870
|
-
body:
|
9871
|
-
id:
|
9903
|
+
body: z125.object({
|
9904
|
+
id: z125.string()
|
9872
9905
|
}),
|
9873
9906
|
responses: {
|
9874
9907
|
200: DefaultSuccessResponseSchema.extend({
|
9875
|
-
message:
|
9908
|
+
message: z125.string()
|
9876
9909
|
}),
|
9877
9910
|
...DefaultResponses
|
9878
9911
|
},
|
@@ -9881,8 +9914,8 @@ var roomContract = initContract47().router(
|
|
9881
9914
|
getById: {
|
9882
9915
|
method: "GET",
|
9883
9916
|
path: "/:id",
|
9884
|
-
pathParams:
|
9885
|
-
id:
|
9917
|
+
pathParams: z125.object({
|
9918
|
+
id: z125.string().uuid()
|
9886
9919
|
}),
|
9887
9920
|
responses: {
|
9888
9921
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9900,70 +9933,70 @@ var roomContract = initContract47().router(
|
|
9900
9933
|
|
9901
9934
|
// src/mail/account-contract.ts
|
9902
9935
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9903
|
-
import
|
9936
|
+
import z127 from "zod";
|
9904
9937
|
|
9905
9938
|
// src/mail/schemas/account-validation.schema.ts
|
9906
|
-
import
|
9939
|
+
import z126 from "zod";
|
9907
9940
|
var AccountContractsValidationSchemas = {
|
9908
9941
|
create: {
|
9909
|
-
input:
|
9910
|
-
address:
|
9911
|
-
name:
|
9912
|
-
password:
|
9913
|
-
mailServerId:
|
9942
|
+
input: z126.object({
|
9943
|
+
address: z126.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9944
|
+
name: z126.string().min(1, "Account name cannot be empty."),
|
9945
|
+
password: z126.string().min(1, "Password cannot be empty."),
|
9946
|
+
mailServerId: z126.string().uuid("Invalid mail_server_id")
|
9914
9947
|
})
|
9915
9948
|
},
|
9916
9949
|
getById: {
|
9917
|
-
input:
|
9918
|
-
id:
|
9950
|
+
input: z126.object({
|
9951
|
+
id: z126.string().uuid()
|
9919
9952
|
}),
|
9920
9953
|
output: MailAccountSchema
|
9921
9954
|
},
|
9922
9955
|
getAll: {
|
9923
|
-
output:
|
9956
|
+
output: z126.array(MailAccountSchema)
|
9924
9957
|
},
|
9925
9958
|
update: {
|
9926
9959
|
input: MailAccountSchema,
|
9927
9960
|
output: MailAccountSchema
|
9928
9961
|
},
|
9929
9962
|
disconnect: {
|
9930
|
-
input:
|
9931
|
-
id:
|
9963
|
+
input: z126.object({
|
9964
|
+
id: z126.string().uuid()
|
9932
9965
|
}),
|
9933
9966
|
output: MailAccountSchema
|
9934
9967
|
},
|
9935
9968
|
reconnect: {
|
9936
|
-
input:
|
9937
|
-
id:
|
9969
|
+
input: z126.object({
|
9970
|
+
id: z126.string()
|
9938
9971
|
}),
|
9939
9972
|
output: MailAccountSchema
|
9940
9973
|
},
|
9941
9974
|
delete: {
|
9942
|
-
input:
|
9943
|
-
id:
|
9975
|
+
input: z126.object({
|
9976
|
+
id: z126.string()
|
9944
9977
|
}),
|
9945
|
-
output:
|
9978
|
+
output: z126.string()
|
9946
9979
|
},
|
9947
9980
|
deleteEmailEngineAcc: {
|
9948
|
-
input:
|
9949
|
-
account:
|
9981
|
+
input: z126.object({
|
9982
|
+
account: z126.string()
|
9950
9983
|
}),
|
9951
9984
|
output: MailAccountSchema
|
9952
9985
|
},
|
9953
9986
|
generateOAuth2AuthenticationLink: {
|
9954
|
-
body:
|
9955
|
-
oAuth2AppId:
|
9956
|
-
mailServerId:
|
9987
|
+
body: z126.object({
|
9988
|
+
oAuth2AppId: z126.string(),
|
9989
|
+
mailServerId: z126.string()
|
9957
9990
|
}),
|
9958
|
-
response:
|
9959
|
-
url:
|
9960
|
-
account:
|
9991
|
+
response: z126.object({
|
9992
|
+
url: z126.string(),
|
9993
|
+
account: z126.string()
|
9961
9994
|
})
|
9962
9995
|
},
|
9963
9996
|
createOAuth2Acc: {
|
9964
|
-
body:
|
9965
|
-
account:
|
9966
|
-
name:
|
9997
|
+
body: z126.object({
|
9998
|
+
account: z126.string(),
|
9999
|
+
name: z126.string()
|
9967
10000
|
}),
|
9968
10001
|
response: MailAccountSchema
|
9969
10002
|
}
|
@@ -9981,14 +10014,14 @@ var accountContract = initContract48().router(
|
|
9981
10014
|
// data: AccountContractsValidationSchemas.create.output,
|
9982
10015
|
data: MailAccountSchema
|
9983
10016
|
}),
|
9984
|
-
400:
|
9985
|
-
message:
|
10017
|
+
400: z127.object({
|
10018
|
+
message: z127.string()
|
9986
10019
|
}),
|
9987
|
-
409:
|
9988
|
-
message:
|
10020
|
+
409: z127.object({
|
10021
|
+
message: z127.string()
|
9989
10022
|
}),
|
9990
|
-
500:
|
9991
|
-
message:
|
10023
|
+
500: z127.object({
|
10024
|
+
message: z127.string()
|
9992
10025
|
}),
|
9993
10026
|
...DefaultResponses
|
9994
10027
|
},
|
@@ -10004,14 +10037,14 @@ var accountContract = initContract48().router(
|
|
10004
10037
|
201: DefaultSuccessResponseSchema.extend({
|
10005
10038
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10006
10039
|
}),
|
10007
|
-
400:
|
10008
|
-
message:
|
10040
|
+
400: z127.object({
|
10041
|
+
message: z127.string()
|
10009
10042
|
}),
|
10010
|
-
409:
|
10011
|
-
message:
|
10043
|
+
409: z127.object({
|
10044
|
+
message: z127.string()
|
10012
10045
|
}),
|
10013
|
-
500:
|
10014
|
-
message:
|
10046
|
+
500: z127.object({
|
10047
|
+
message: z127.string()
|
10015
10048
|
}),
|
10016
10049
|
...DefaultResponses
|
10017
10050
|
},
|
@@ -10025,7 +10058,7 @@ var accountContract = initContract48().router(
|
|
10025
10058
|
path: "/sync",
|
10026
10059
|
responses: {
|
10027
10060
|
200: DefaultSuccessResponseSchema.extend({
|
10028
|
-
message:
|
10061
|
+
message: z127.string()
|
10029
10062
|
}),
|
10030
10063
|
...DefaultResponses
|
10031
10064
|
},
|
@@ -10050,13 +10083,13 @@ var accountContract = initContract48().router(
|
|
10050
10083
|
getAll: {
|
10051
10084
|
method: "GET",
|
10052
10085
|
path: "",
|
10053
|
-
query:
|
10054
|
-
state:
|
10055
|
-
withDeleted:
|
10086
|
+
query: z127.object({
|
10087
|
+
state: z127.union([z127.literal("connected"), z127.literal("disconnected")]).optional(),
|
10088
|
+
withDeleted: z127.boolean().default(false)
|
10056
10089
|
}).optional(),
|
10057
10090
|
responses: {
|
10058
10091
|
200: DefaultSuccessResponseSchema.extend({
|
10059
|
-
data:
|
10092
|
+
data: z127.array(MailAccountSchema)
|
10060
10093
|
}),
|
10061
10094
|
...DefaultResponses
|
10062
10095
|
},
|
@@ -10067,8 +10100,8 @@ var accountContract = initContract48().router(
|
|
10067
10100
|
update: {
|
10068
10101
|
method: "PATCH",
|
10069
10102
|
path: "/:id",
|
10070
|
-
pathParams:
|
10071
|
-
id:
|
10103
|
+
pathParams: z127.object({
|
10104
|
+
id: z127.string().uuid()
|
10072
10105
|
}),
|
10073
10106
|
responses: {
|
10074
10107
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10117,7 +10150,7 @@ var accountContract = initContract48().router(
|
|
10117
10150
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10118
10151
|
responses: {
|
10119
10152
|
200: DefaultSuccessResponseSchema.extend({
|
10120
|
-
message:
|
10153
|
+
message: z127.string()
|
10121
10154
|
}),
|
10122
10155
|
...DefaultResponses
|
10123
10156
|
},
|
@@ -10132,7 +10165,7 @@ var accountContract = initContract48().router(
|
|
10132
10165
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10133
10166
|
responses: {
|
10134
10167
|
200: DefaultSuccessResponseSchema.extend({
|
10135
|
-
message:
|
10168
|
+
message: z127.string()
|
10136
10169
|
}),
|
10137
10170
|
...DefaultResponses
|
10138
10171
|
},
|
@@ -10161,20 +10194,20 @@ var accountContract = initContract48().router(
|
|
10161
10194
|
|
10162
10195
|
// src/mail/mail-server-contract.ts
|
10163
10196
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10164
|
-
import
|
10197
|
+
import z129 from "zod";
|
10165
10198
|
|
10166
10199
|
// src/mail/schemas/servers-validation.schema.ts
|
10167
|
-
import
|
10168
|
-
var CreateMailServerSchema =
|
10169
|
-
name:
|
10170
|
-
smtpHost:
|
10171
|
-
smtpPort:
|
10172
|
-
smtpTlsPort:
|
10173
|
-
useTlsForSmtp:
|
10174
|
-
imapHost:
|
10175
|
-
imapPort:
|
10176
|
-
imapTlsPort:
|
10177
|
-
useTlsForImap:
|
10200
|
+
import z128 from "zod";
|
10201
|
+
var CreateMailServerSchema = z128.object({
|
10202
|
+
name: z128.string(),
|
10203
|
+
smtpHost: z128.string(),
|
10204
|
+
smtpPort: z128.number(),
|
10205
|
+
smtpTlsPort: z128.number(),
|
10206
|
+
useTlsForSmtp: z128.boolean(),
|
10207
|
+
imapHost: z128.string(),
|
10208
|
+
imapPort: z128.number(),
|
10209
|
+
imapTlsPort: z128.number(),
|
10210
|
+
useTlsForImap: z128.boolean()
|
10178
10211
|
});
|
10179
10212
|
|
10180
10213
|
// src/mail/mail-server-contract.ts
|
@@ -10197,11 +10230,11 @@ var serverContract = initContract49().router(
|
|
10197
10230
|
path: "/oauth2/apps",
|
10198
10231
|
responses: {
|
10199
10232
|
200: DefaultSuccessResponseSchema.extend({
|
10200
|
-
data:
|
10201
|
-
total:
|
10202
|
-
pages:
|
10203
|
-
page:
|
10204
|
-
apps:
|
10233
|
+
data: z129.object({
|
10234
|
+
total: z129.number(),
|
10235
|
+
pages: z129.number(),
|
10236
|
+
page: z129.number(),
|
10237
|
+
apps: z129.array(OAuth2AppSchema)
|
10205
10238
|
})
|
10206
10239
|
}),
|
10207
10240
|
...DefaultResponses
|
@@ -10211,8 +10244,8 @@ var serverContract = initContract49().router(
|
|
10211
10244
|
getById: {
|
10212
10245
|
method: "GET",
|
10213
10246
|
path: "/:id",
|
10214
|
-
pathParams:
|
10215
|
-
id:
|
10247
|
+
pathParams: z129.object({
|
10248
|
+
id: z129.string().uuid()
|
10216
10249
|
}),
|
10217
10250
|
responses: {
|
10218
10251
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10227,7 +10260,7 @@ var serverContract = initContract49().router(
|
|
10227
10260
|
path: "/",
|
10228
10261
|
responses: {
|
10229
10262
|
200: DefaultSuccessResponseSchema.extend({
|
10230
|
-
data:
|
10263
|
+
data: z129.array(MailServerSchema)
|
10231
10264
|
}),
|
10232
10265
|
...DefaultResponses
|
10233
10266
|
},
|
@@ -10236,8 +10269,8 @@ var serverContract = initContract49().router(
|
|
10236
10269
|
update: {
|
10237
10270
|
method: "PATCH",
|
10238
10271
|
path: "/:id",
|
10239
|
-
pathParams:
|
10240
|
-
id:
|
10272
|
+
pathParams: z129.object({
|
10273
|
+
id: z129.string().uuid()
|
10241
10274
|
}),
|
10242
10275
|
responses: {
|
10243
10276
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10251,8 +10284,8 @@ var serverContract = initContract49().router(
|
|
10251
10284
|
delete: {
|
10252
10285
|
method: "DELETE",
|
10253
10286
|
path: "/:id",
|
10254
|
-
pathParams:
|
10255
|
-
id:
|
10287
|
+
pathParams: z129.object({
|
10288
|
+
id: z129.string().uuid()
|
10256
10289
|
}),
|
10257
10290
|
responses: {
|
10258
10291
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10271,45 +10304,45 @@ var serverContract = initContract49().router(
|
|
10271
10304
|
|
10272
10305
|
// src/mail/message-contract.ts
|
10273
10306
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10274
|
-
import
|
10307
|
+
import z131 from "zod";
|
10275
10308
|
|
10276
10309
|
// src/mail/schemas/message-validation.schema.ts
|
10277
|
-
import
|
10278
|
-
var MailParticipant2 =
|
10279
|
-
name:
|
10280
|
-
address:
|
10310
|
+
import z130 from "zod";
|
10311
|
+
var MailParticipant2 = z130.object({
|
10312
|
+
name: z130.string().optional(),
|
10313
|
+
address: z130.string().email()
|
10281
10314
|
});
|
10282
10315
|
var MessageContractsValidationsSchema = {
|
10283
10316
|
submit: {
|
10284
|
-
input:
|
10285
|
-
subject:
|
10286
|
-
text:
|
10287
|
-
html:
|
10317
|
+
input: z130.object({
|
10318
|
+
subject: z130.string(),
|
10319
|
+
text: z130.string(),
|
10320
|
+
html: z130.string(),
|
10288
10321
|
from: MailParticipant2,
|
10289
10322
|
to: MailParticipant2,
|
10290
|
-
cc:
|
10291
|
-
bcc:
|
10292
|
-
sendAt:
|
10293
|
-
reference:
|
10294
|
-
messageId:
|
10295
|
-
action:
|
10323
|
+
cc: z130.array(MailParticipant2).optional(),
|
10324
|
+
bcc: z130.array(MailParticipant2).optional(),
|
10325
|
+
sendAt: z130.string().optional(),
|
10326
|
+
reference: z130.object({
|
10327
|
+
messageId: z130.string(),
|
10328
|
+
action: z130.union([z130.literal("reply"), z130.literal("forward")])
|
10296
10329
|
}).optional(),
|
10297
|
-
attachments:
|
10298
|
-
|
10299
|
-
fileType:
|
10300
|
-
fileName:
|
10301
|
-
fileKey:
|
10302
|
-
fileSize:
|
10303
|
-
bucketName:
|
10304
|
-
presignedUrl:
|
10330
|
+
attachments: z130.array(
|
10331
|
+
z130.object({
|
10332
|
+
fileType: z130.string(),
|
10333
|
+
fileName: z130.string(),
|
10334
|
+
fileKey: z130.string(),
|
10335
|
+
fileSize: z130.number(),
|
10336
|
+
bucketName: z130.string(),
|
10337
|
+
presignedUrl: z130.string()
|
10305
10338
|
})
|
10306
10339
|
).optional()
|
10307
10340
|
}),
|
10308
|
-
output:
|
10309
|
-
response:
|
10310
|
-
messageId:
|
10311
|
-
sendAt:
|
10312
|
-
queueId:
|
10341
|
+
output: z130.object({
|
10342
|
+
response: z130.string(),
|
10343
|
+
messageId: z130.string(),
|
10344
|
+
sendAt: z130.string(),
|
10345
|
+
queueId: z130.string()
|
10313
10346
|
})
|
10314
10347
|
}
|
10315
10348
|
};
|
@@ -10338,8 +10371,8 @@ var messageContract = initContract50().router(
|
|
10338
10371
|
path: "/new_message_count",
|
10339
10372
|
responses: {
|
10340
10373
|
200: DefaultSuccessResponseSchema.extend({
|
10341
|
-
data:
|
10342
|
-
count:
|
10374
|
+
data: z131.object({
|
10375
|
+
count: z131.number()
|
10343
10376
|
})
|
10344
10377
|
}),
|
10345
10378
|
...DefaultResponses
|
@@ -10351,8 +10384,8 @@ var messageContract = initContract50().router(
|
|
10351
10384
|
getById: {
|
10352
10385
|
method: "GET",
|
10353
10386
|
path: "/:id",
|
10354
|
-
pathParams:
|
10355
|
-
id:
|
10387
|
+
pathParams: z131.object({
|
10388
|
+
id: z131.string()
|
10356
10389
|
}),
|
10357
10390
|
responses: {
|
10358
10391
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10367,8 +10400,8 @@ var messageContract = initContract50().router(
|
|
10367
10400
|
update: {
|
10368
10401
|
method: "PATCH",
|
10369
10402
|
path: "/:id",
|
10370
|
-
pathParams:
|
10371
|
-
id:
|
10403
|
+
pathParams: z131.object({
|
10404
|
+
id: z131.string()
|
10372
10405
|
}),
|
10373
10406
|
responses: {
|
10374
10407
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10384,8 +10417,8 @@ var messageContract = initContract50().router(
|
|
10384
10417
|
delete: {
|
10385
10418
|
method: "DELETE",
|
10386
10419
|
path: "/:id",
|
10387
|
-
pathParams:
|
10388
|
-
id:
|
10420
|
+
pathParams: z131.object({
|
10421
|
+
id: z131.string()
|
10389
10422
|
}),
|
10390
10423
|
responses: {
|
10391
10424
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10401,13 +10434,13 @@ var messageContract = initContract50().router(
|
|
10401
10434
|
cancelScheduledMessage: {
|
10402
10435
|
method: "DELETE",
|
10403
10436
|
path: "/scheduled_message/:id",
|
10404
|
-
pathParams:
|
10405
|
-
id:
|
10437
|
+
pathParams: z131.object({
|
10438
|
+
id: z131.string()
|
10406
10439
|
}),
|
10407
10440
|
responses: {
|
10408
10441
|
200: DefaultSuccessResponseSchema.extend({
|
10409
|
-
data:
|
10410
|
-
totalMessagesCount:
|
10442
|
+
data: z131.object({
|
10443
|
+
totalMessagesCount: z131.number()
|
10411
10444
|
})
|
10412
10445
|
}),
|
10413
10446
|
...DefaultResponses
|
@@ -10432,38 +10465,38 @@ var mailContract = initContract51().router({
|
|
10432
10465
|
|
10433
10466
|
// src/webchat/index.ts
|
10434
10467
|
import { initContract as initContract52 } from "@ts-rest/core";
|
10435
|
-
import
|
10468
|
+
import z134 from "zod";
|
10436
10469
|
|
10437
10470
|
// src/webchat/schema.ts
|
10438
|
-
import
|
10471
|
+
import z133 from "zod";
|
10439
10472
|
|
10440
10473
|
// src/webchat/validation.ts
|
10441
|
-
import
|
10474
|
+
import z132 from "zod";
|
10442
10475
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10443
10476
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10444
10477
|
return ChatwootChannelType3;
|
10445
10478
|
})(ChatwootChannelType2 || {});
|
10446
|
-
var WebChatChannelSchema =
|
10447
|
-
avatar:
|
10448
|
-
name:
|
10449
|
-
type:
|
10450
|
-
websiteName:
|
10451
|
-
welcomeTitle:
|
10452
|
-
websiteUrl:
|
10453
|
-
welcomeTagline:
|
10454
|
-
agentAwayMessage:
|
10455
|
-
widgetColor:
|
10479
|
+
var WebChatChannelSchema = z132.object({
|
10480
|
+
avatar: z132.string().optional(),
|
10481
|
+
name: z132.string(),
|
10482
|
+
type: z132.nativeEnum(ChatwootChannelType2),
|
10483
|
+
websiteName: z132.string(),
|
10484
|
+
welcomeTitle: z132.string(),
|
10485
|
+
websiteUrl: z132.string().url(),
|
10486
|
+
welcomeTagline: z132.string().optional(),
|
10487
|
+
agentAwayMessage: z132.string().optional(),
|
10488
|
+
widgetColor: z132.string().optional()
|
10456
10489
|
});
|
10457
10490
|
|
10458
10491
|
// src/webchat/schema.ts
|
10459
|
-
var ConnectWebChatChannelSchema =
|
10460
|
-
name:
|
10461
|
-
actor:
|
10462
|
-
id:
|
10463
|
-
name:
|
10464
|
-
email:
|
10465
|
-
address:
|
10466
|
-
phone:
|
10492
|
+
var ConnectWebChatChannelSchema = z133.object({
|
10493
|
+
name: z133.string(),
|
10494
|
+
actor: z133.object({
|
10495
|
+
id: z133.string().uuid(),
|
10496
|
+
name: z133.string(),
|
10497
|
+
email: z133.string().email(),
|
10498
|
+
address: z133.string().nullable(),
|
10499
|
+
phone: z133.string().nullable()
|
10467
10500
|
}),
|
10468
10501
|
channel: WebChatChannelSchema
|
10469
10502
|
});
|
@@ -10497,8 +10530,8 @@ var platformWebchatContract = initContract52().router(
|
|
10497
10530
|
disconnectToService: {
|
10498
10531
|
method: "POST",
|
10499
10532
|
path: "/disconnect",
|
10500
|
-
body:
|
10501
|
-
id:
|
10533
|
+
body: z134.object({
|
10534
|
+
id: z134.string().uuid()
|
10502
10535
|
}),
|
10503
10536
|
responses: {
|
10504
10537
|
200: ChannelServiceResponseSchema,
|
@@ -10509,8 +10542,8 @@ var platformWebchatContract = initContract52().router(
|
|
10509
10542
|
reconnect: {
|
10510
10543
|
method: "POST",
|
10511
10544
|
path: "/reconnect/:channelId",
|
10512
|
-
pathParams:
|
10513
|
-
channelId:
|
10545
|
+
pathParams: z134.object({
|
10546
|
+
channelId: z134.string().uuid()
|
10514
10547
|
}),
|
10515
10548
|
body: null,
|
10516
10549
|
responses: {
|
@@ -10522,8 +10555,8 @@ var platformWebchatContract = initContract52().router(
|
|
10522
10555
|
delete: {
|
10523
10556
|
method: "DELETE",
|
10524
10557
|
path: "/delete/:channelId",
|
10525
|
-
pathParams:
|
10526
|
-
channelId:
|
10558
|
+
pathParams: z134.object({
|
10559
|
+
channelId: z134.string().uuid()
|
10527
10560
|
}),
|
10528
10561
|
body: null,
|
10529
10562
|
responses: {
|
@@ -10540,18 +10573,18 @@ var platformWebchatContract = initContract52().router(
|
|
10540
10573
|
|
10541
10574
|
// src/hold-label/index.ts
|
10542
10575
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10543
|
-
import
|
10576
|
+
import z136 from "zod";
|
10544
10577
|
|
10545
10578
|
// src/hold-label/validation.ts
|
10546
|
-
import
|
10547
|
-
var UpdatePositionSchema2 =
|
10548
|
-
holdLabels:
|
10549
|
-
|
10579
|
+
import z135 from "zod";
|
10580
|
+
var UpdatePositionSchema2 = z135.object({
|
10581
|
+
holdLabels: z135.array(
|
10582
|
+
z135.object({ id: z135.string().uuid(), position: z135.number() })
|
10550
10583
|
)
|
10551
10584
|
});
|
10552
|
-
var HoldRoomSchema =
|
10553
|
-
roomId:
|
10554
|
-
holdLabelId:
|
10585
|
+
var HoldRoomSchema = z135.object({
|
10586
|
+
roomId: z135.string().uuid(),
|
10587
|
+
holdLabelId: z135.string().uuid()
|
10555
10588
|
});
|
10556
10589
|
|
10557
10590
|
// src/hold-label/index.ts
|
@@ -10560,7 +10593,7 @@ var holdLabelContract = initContract53().router(
|
|
10560
10593
|
createHoldLabel: {
|
10561
10594
|
method: "POST",
|
10562
10595
|
path: "/",
|
10563
|
-
body:
|
10596
|
+
body: z136.object({ name: z136.string() }),
|
10564
10597
|
responses: {
|
10565
10598
|
201: DefaultSuccessResponseSchema.extend({
|
10566
10599
|
holdLabel: HoldLabelSchema
|
@@ -10572,7 +10605,7 @@ var holdLabelContract = initContract53().router(
|
|
10572
10605
|
path: "/",
|
10573
10606
|
responses: {
|
10574
10607
|
200: DefaultSuccessResponseSchema.extend({
|
10575
|
-
holdLabels:
|
10608
|
+
holdLabels: z136.array(HoldLabelSchema)
|
10576
10609
|
})
|
10577
10610
|
}
|
10578
10611
|
},
|
@@ -10590,8 +10623,8 @@ var holdLabelContract = initContract53().router(
|
|
10590
10623
|
updateHoldLabel: {
|
10591
10624
|
method: "PATCH",
|
10592
10625
|
path: "/:id",
|
10593
|
-
pathParams:
|
10594
|
-
body:
|
10626
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
10627
|
+
body: z136.object({ name: z136.string() }),
|
10595
10628
|
responses: {
|
10596
10629
|
200: DefaultSuccessResponseSchema.extend({
|
10597
10630
|
holdLabel: HoldLabelSchema
|
@@ -10601,7 +10634,7 @@ var holdLabelContract = initContract53().router(
|
|
10601
10634
|
deleteHoldLabel: {
|
10602
10635
|
method: "DELETE",
|
10603
10636
|
path: "/:id",
|
10604
|
-
pathParams:
|
10637
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
10605
10638
|
body: null,
|
10606
10639
|
responses: {
|
10607
10640
|
200: DefaultSuccessResponseSchema
|
@@ -10612,10 +10645,10 @@ var holdLabelContract = initContract53().router(
|
|
10612
10645
|
path: "/auto-unhold",
|
10613
10646
|
responses: {
|
10614
10647
|
200: DefaultSuccessResponseSchema.extend({
|
10615
|
-
autoUnhold:
|
10616
|
-
resumeLabel:
|
10617
|
-
show:
|
10618
|
-
name:
|
10648
|
+
autoUnhold: z136.boolean(),
|
10649
|
+
resumeLabel: z136.object({
|
10650
|
+
show: z136.boolean(),
|
10651
|
+
name: z136.string()
|
10619
10652
|
})
|
10620
10653
|
})
|
10621
10654
|
}
|
@@ -10623,19 +10656,19 @@ var holdLabelContract = initContract53().router(
|
|
10623
10656
|
updateAutoUnhold: {
|
10624
10657
|
method: "POST",
|
10625
10658
|
path: "/auto-unhold",
|
10626
|
-
body:
|
10627
|
-
autoUnhold:
|
10628
|
-
resumeLabel:
|
10629
|
-
show:
|
10630
|
-
name:
|
10659
|
+
body: z136.object({
|
10660
|
+
autoUnhold: z136.boolean().optional(),
|
10661
|
+
resumeLabel: z136.object({
|
10662
|
+
show: z136.boolean().optional(),
|
10663
|
+
name: z136.string().optional()
|
10631
10664
|
}).optional()
|
10632
10665
|
}),
|
10633
10666
|
responses: {
|
10634
10667
|
200: DefaultSuccessResponseSchema.extend({
|
10635
|
-
autoUnhold:
|
10636
|
-
resumeLabel:
|
10637
|
-
show:
|
10638
|
-
name:
|
10668
|
+
autoUnhold: z136.boolean(),
|
10669
|
+
resumeLabel: z136.object({
|
10670
|
+
show: z136.boolean(),
|
10671
|
+
name: z136.string()
|
10639
10672
|
})
|
10640
10673
|
})
|
10641
10674
|
}
|
@@ -10643,10 +10676,10 @@ var holdLabelContract = initContract53().router(
|
|
10643
10676
|
getHoldLogs: {
|
10644
10677
|
method: "GET",
|
10645
10678
|
path: "/hold-logs",
|
10646
|
-
query:
|
10679
|
+
query: z136.object({ cxLogId: z136.string().uuid() }),
|
10647
10680
|
responses: {
|
10648
|
-
200:
|
10649
|
-
holdLogs:
|
10681
|
+
200: z136.object({
|
10682
|
+
holdLogs: z136.array(FormattedHoldLogSchema)
|
10650
10683
|
})
|
10651
10684
|
}
|
10652
10685
|
},
|
@@ -10663,7 +10696,7 @@ var holdLabelContract = initContract53().router(
|
|
10663
10696
|
unholdRoom: {
|
10664
10697
|
method: "POST",
|
10665
10698
|
path: "/unhold-room",
|
10666
|
-
body:
|
10699
|
+
body: z136.object({ roomId: z136.string().uuid() }),
|
10667
10700
|
responses: {
|
10668
10701
|
200: DefaultSuccessResponseSchema.extend({
|
10669
10702
|
holdLog: HoldLogSchema.optional()
|
@@ -10676,89 +10709,89 @@ var holdLabelContract = initContract53().router(
|
|
10676
10709
|
|
10677
10710
|
// src/subscription/index.ts
|
10678
10711
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10679
|
-
import { z as
|
10712
|
+
import { z as z139 } from "zod";
|
10680
10713
|
|
10681
10714
|
// src/subscription/schema.ts
|
10682
|
-
import
|
10715
|
+
import z137 from "zod";
|
10683
10716
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10684
|
-
priceId:
|
10685
|
-
name:
|
10686
|
-
perUnit:
|
10687
|
-
price:
|
10688
|
-
currency:
|
10717
|
+
priceId: z137.string(),
|
10718
|
+
name: z137.string().nullable(),
|
10719
|
+
perUnit: z137.number(),
|
10720
|
+
price: z137.number(),
|
10721
|
+
currency: z137.string().nullable()
|
10689
10722
|
});
|
10690
10723
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10691
|
-
provider:
|
10692
|
-
productId:
|
10693
|
-
name:
|
10694
|
-
type:
|
10695
|
-
omnichannel:
|
10696
|
-
usageType:
|
10724
|
+
provider: z137.string(),
|
10725
|
+
productId: z137.string(),
|
10726
|
+
name: z137.string(),
|
10727
|
+
type: z137.string(),
|
10728
|
+
omnichannel: z137.string(),
|
10729
|
+
usageType: z137.string().nullable(),
|
10697
10730
|
productPrice: ProductPriceSchema
|
10698
10731
|
});
|
10699
10732
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10700
|
-
includedQuantity:
|
10733
|
+
includedQuantity: z137.number(),
|
10701
10734
|
product: ProductWithoutRelatedSchema
|
10702
10735
|
});
|
10703
10736
|
var ProductSchema = DefaultEntitySchema.extend({
|
10704
|
-
provider:
|
10705
|
-
productId:
|
10706
|
-
name:
|
10707
|
-
type:
|
10708
|
-
omnichannel:
|
10709
|
-
usageType:
|
10737
|
+
provider: z137.string(),
|
10738
|
+
productId: z137.string(),
|
10739
|
+
name: z137.string(),
|
10740
|
+
type: z137.string(),
|
10741
|
+
omnichannel: z137.string(),
|
10742
|
+
usageType: z137.string().nullable(),
|
10710
10743
|
productPrice: ProductPriceSchema,
|
10711
|
-
relatedProducts:
|
10744
|
+
relatedProducts: z137.array(RelatedProductSchema)
|
10712
10745
|
});
|
10713
10746
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10714
|
-
provider:
|
10715
|
-
customerId:
|
10716
|
-
email:
|
10717
|
-
name:
|
10718
|
-
balance:
|
10747
|
+
provider: z137.string(),
|
10748
|
+
customerId: z137.string(),
|
10749
|
+
email: z137.string(),
|
10750
|
+
name: z137.string(),
|
10751
|
+
balance: z137.number()
|
10719
10752
|
});
|
10720
10753
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10721
|
-
limit:
|
10722
|
-
subscriptionItemId:
|
10723
|
-
usage:
|
10754
|
+
limit: z137.number(),
|
10755
|
+
subscriptionItemId: z137.string(),
|
10756
|
+
usage: z137.number().nullable(),
|
10724
10757
|
product: ProductSchema
|
10725
10758
|
});
|
10726
10759
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10727
|
-
provider:
|
10728
|
-
type:
|
10729
|
-
subscriptionId:
|
10730
|
-
interval:
|
10731
|
-
quantity:
|
10732
|
-
amount:
|
10733
|
-
startAt:
|
10734
|
-
expireAt:
|
10735
|
-
status:
|
10736
|
-
name:
|
10737
|
-
subscriptionProducts:
|
10760
|
+
provider: z137.string(),
|
10761
|
+
type: z137.string(),
|
10762
|
+
subscriptionId: z137.string(),
|
10763
|
+
interval: z137.string(),
|
10764
|
+
quantity: z137.number(),
|
10765
|
+
amount: z137.number(),
|
10766
|
+
startAt: z137.date().nullable(),
|
10767
|
+
expireAt: z137.date(),
|
10768
|
+
status: z137.string(),
|
10769
|
+
name: z137.string().nullable(),
|
10770
|
+
subscriptionProducts: z137.array(SubscriptionProuctSchema),
|
10738
10771
|
productPrice: ProductPriceSchema,
|
10739
10772
|
product: ProductSchema
|
10740
10773
|
});
|
10741
10774
|
|
10742
10775
|
// src/subscription/validation.ts
|
10743
|
-
import { z as
|
10744
|
-
var GetAvailablePlanSchema =
|
10745
|
-
type:
|
10746
|
-
currency:
|
10747
|
-
});
|
10748
|
-
var UpdateSubscriptionSchema =
|
10749
|
-
planProductId:
|
10750
|
-
planProductPriceId:
|
10751
|
-
subscriptionId:
|
10752
|
-
subscriptionProducts:
|
10753
|
-
|
10754
|
-
productId:
|
10755
|
-
productPriceId:
|
10756
|
-
quantity:
|
10776
|
+
import { z as z138 } from "zod";
|
10777
|
+
var GetAvailablePlanSchema = z138.object({
|
10778
|
+
type: z138.string(),
|
10779
|
+
currency: z138.string()
|
10780
|
+
});
|
10781
|
+
var UpdateSubscriptionSchema = z138.object({
|
10782
|
+
planProductId: z138.string(),
|
10783
|
+
planProductPriceId: z138.string(),
|
10784
|
+
subscriptionId: z138.string(),
|
10785
|
+
subscriptionProducts: z138.array(
|
10786
|
+
z138.object({
|
10787
|
+
productId: z138.string(),
|
10788
|
+
productPriceId: z138.string(),
|
10789
|
+
quantity: z138.number()
|
10757
10790
|
})
|
10758
10791
|
)
|
10759
10792
|
});
|
10760
|
-
var TopUpBalanceSchema =
|
10761
|
-
quantity:
|
10793
|
+
var TopUpBalanceSchema = z138.object({
|
10794
|
+
quantity: z138.number()
|
10762
10795
|
});
|
10763
10796
|
|
10764
10797
|
// src/subscription/index.ts
|
@@ -10782,9 +10815,9 @@ var subscriptionContract = initContract54().router(
|
|
10782
10815
|
body: UpdateSubscriptionSchema,
|
10783
10816
|
responses: {
|
10784
10817
|
200: DefaultSuccessResponseSchema.extend({
|
10785
|
-
message:
|
10786
|
-
requireCheckout:
|
10787
|
-
checkoutUrl:
|
10818
|
+
message: z139.string(),
|
10819
|
+
requireCheckout: z139.boolean(),
|
10820
|
+
checkoutUrl: z139.string().nullable()
|
10788
10821
|
}),
|
10789
10822
|
402: DefaultErrorResponseSchema,
|
10790
10823
|
500: DefaultErrorResponseSchema
|
@@ -10796,7 +10829,7 @@ var subscriptionContract = initContract54().router(
|
|
10796
10829
|
body: TopUpBalanceSchema,
|
10797
10830
|
responses: {
|
10798
10831
|
200: DefaultSuccessResponseSchema.extend({
|
10799
|
-
checkoutUrl:
|
10832
|
+
checkoutUrl: z139.string()
|
10800
10833
|
}),
|
10801
10834
|
500: DefaultErrorResponseSchema
|
10802
10835
|
}
|
@@ -10807,7 +10840,18 @@ var subscriptionContract = initContract54().router(
|
|
10807
10840
|
query: GetAvailablePlanSchema,
|
10808
10841
|
responses: {
|
10809
10842
|
200: DefaultSuccessResponseSchema.extend({
|
10810
|
-
data:
|
10843
|
+
data: z139.array(ProductSchema)
|
10844
|
+
}),
|
10845
|
+
500: DefaultErrorResponseSchema
|
10846
|
+
}
|
10847
|
+
},
|
10848
|
+
getAvailableAddOns: {
|
10849
|
+
method: "GET",
|
10850
|
+
path: "/available-add-ons",
|
10851
|
+
query: GetAvailablePlanSchema,
|
10852
|
+
responses: {
|
10853
|
+
200: DefaultSuccessResponseSchema.extend({
|
10854
|
+
data: z139.array(ProductSchema)
|
10811
10855
|
}),
|
10812
10856
|
500: DefaultErrorResponseSchema
|
10813
10857
|
}
|
@@ -10830,19 +10874,19 @@ var subscriptionContract = initContract54().router(
|
|
10830
10874
|
|
10831
10875
|
// src/cx-intelligence/index.ts
|
10832
10876
|
import { initContract as initContract55 } from "@ts-rest/core";
|
10833
|
-
import
|
10877
|
+
import z140 from "zod";
|
10834
10878
|
var cxIntelligenceContract = initContract55().router(
|
10835
10879
|
{
|
10836
10880
|
toggle: {
|
10837
10881
|
method: "POST",
|
10838
10882
|
path: "/toggle",
|
10839
10883
|
headers: DefaultHeaderSchema,
|
10840
|
-
body:
|
10841
|
-
enabled:
|
10884
|
+
body: z140.object({
|
10885
|
+
enabled: z140.union([z140.literal(true), z140.literal(false)])
|
10842
10886
|
}),
|
10843
10887
|
responses: {
|
10844
10888
|
200: DefaultSuccessResponseSchema.extend({
|
10845
|
-
message:
|
10889
|
+
message: z140.string()
|
10846
10890
|
}),
|
10847
10891
|
500: DefaultErrorResponseSchema
|
10848
10892
|
},
|
@@ -10852,15 +10896,15 @@ var cxIntelligenceContract = initContract55().router(
|
|
10852
10896
|
method: "POST",
|
10853
10897
|
path: "/cx-logs/:id/transcribe",
|
10854
10898
|
headers: DefaultHeaderSchema,
|
10855
|
-
pathParams:
|
10856
|
-
id:
|
10899
|
+
pathParams: z140.object({
|
10900
|
+
id: z140.string().uuid()
|
10857
10901
|
}),
|
10858
|
-
body:
|
10859
|
-
fileUrl:
|
10902
|
+
body: z140.object({
|
10903
|
+
fileUrl: z140.string()
|
10860
10904
|
}),
|
10861
10905
|
responses: {
|
10862
10906
|
200: DefaultSuccessResponseSchema.extend({
|
10863
|
-
message:
|
10907
|
+
message: z140.string()
|
10864
10908
|
}),
|
10865
10909
|
403: DefaultErrorResponseSchema,
|
10866
10910
|
404: DefaultErrorResponseSchema,
|
@@ -10880,13 +10924,13 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10880
10924
|
headers: DefaultHeaderSchema,
|
10881
10925
|
responses: {
|
10882
10926
|
200: DefaultSuccessResponseSchema.extend({
|
10883
|
-
message:
|
10884
|
-
status:
|
10927
|
+
message: z140.string(),
|
10928
|
+
status: z140.boolean()
|
10885
10929
|
}),
|
10886
|
-
422:
|
10887
|
-
requestId:
|
10888
|
-
message:
|
10889
|
-
status:
|
10930
|
+
422: z140.object({
|
10931
|
+
requestId: z140.string(),
|
10932
|
+
message: z140.string(),
|
10933
|
+
status: z140.boolean()
|
10890
10934
|
}),
|
10891
10935
|
500: DefaultErrorResponseSchema
|
10892
10936
|
},
|
@@ -10898,20 +10942,20 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10898
10942
|
|
10899
10943
|
// src/export/index.ts
|
10900
10944
|
import { initContract as initContract56 } from "@ts-rest/core";
|
10901
|
-
import
|
10945
|
+
import z141 from "zod";
|
10902
10946
|
var exportContract = initContract56().router(
|
10903
10947
|
{
|
10904
10948
|
notifyExport: {
|
10905
10949
|
method: "POST",
|
10906
10950
|
path: "notify",
|
10907
|
-
body:
|
10908
|
-
userId:
|
10909
|
-
module:
|
10910
|
-
fileUrl:
|
10951
|
+
body: z141.object({
|
10952
|
+
userId: z141.string().uuid(),
|
10953
|
+
module: z141.string(),
|
10954
|
+
fileUrl: z141.string()
|
10911
10955
|
}),
|
10912
10956
|
responses: {
|
10913
10957
|
200: DefaultSuccessResponseSchema.extend({
|
10914
|
-
success:
|
10958
|
+
success: z141.boolean()
|
10915
10959
|
}),
|
10916
10960
|
500: DefaultErrorResponseSchema
|
10917
10961
|
}
|
@@ -10994,6 +11038,7 @@ export {
|
|
10994
11038
|
userContract,
|
10995
11039
|
userNotificationContract,
|
10996
11040
|
userPresenceStatusLogContract,
|
11041
|
+
widgetContract,
|
10997
11042
|
widgetSettingContract,
|
10998
11043
|
workflowContract,
|
10999
11044
|
wrapUpFormContract
|