@kl1/contracts 1.3.81 → 1.3.82
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/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.map +1 -1
- package/dist/api-contracts/src/chat/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +18 -0
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +254 -430
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/index.d.ts +9 -0
- package/dist/api-contracts/src/facebook-feed/index.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/instagram/index.d.ts +9 -0
- package/dist/api-contracts/src/instagram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/index.d.ts +9 -0
- package/dist/api-contracts/src/line/index.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/index.d.ts +9 -0
- package/dist/api-contracts/src/messenger/index.d.ts.map +1 -1
- package/dist/api-contracts/src/sms/index.d.ts +9 -0
- package/dist/api-contracts/src/sms/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/telegram/index.d.ts +9 -0
- package/dist/api-contracts/src/telegram/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/viber/index.d.ts +9 -0
- package/dist/api-contracts/src/viber/index.d.ts.map +1 -1
- package/dist/api-contracts/src/webchat/index.d.ts +9 -0
- package/dist/api-contracts/src/webchat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/index.d.ts +9 -0
- package/dist/api-contracts/src/whatsapp/index.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 +1592 -1567
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1591 -1567
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1402,7 +1402,8 @@ var SendMessageToPlatformSchema = z26.object({
|
|
1402
1402
|
channel: z26.string().nullable(),
|
1403
1403
|
notes: z26.string().nullable(),
|
1404
1404
|
contactProfile: z26.string().nullable(),
|
1405
|
-
socialProfileUrl: z26.string().nullable()
|
1405
|
+
socialProfileUrl: z26.string().nullable(),
|
1406
|
+
deletedAt: z26.date().nullable()
|
1406
1407
|
})
|
1407
1408
|
}),
|
1408
1409
|
actor: z26.object({
|
@@ -2223,6 +2224,22 @@ var ConnectWhatsappSchema = z37.object({
|
|
2223
2224
|
});
|
2224
2225
|
var CsatPreferenceSchema = z37.object({
|
2225
2226
|
isCSATEnabled: z37.boolean(),
|
2227
|
+
headline: z37.string().optional().nullable(),
|
2228
|
+
image: z37.object({
|
2229
|
+
bucketName: z37.string(),
|
2230
|
+
fileName: z37.string(),
|
2231
|
+
fileSize: z37.number(),
|
2232
|
+
fileKey: z37.string(),
|
2233
|
+
originalUrl: z37.string().optional().nullable()
|
2234
|
+
}).optional().nullable(),
|
2235
|
+
scaleOptions: z37.array(
|
2236
|
+
z37.object({
|
2237
|
+
value: z37.string(),
|
2238
|
+
label: z37.string(),
|
2239
|
+
color: z37.string().optional().nullable(),
|
2240
|
+
style: z37.string().optional().nullable()
|
2241
|
+
})
|
2242
|
+
).optional().nullable(),
|
2226
2243
|
dispositions: z37.array(z37.string()).optional()
|
2227
2244
|
});
|
2228
2245
|
var ConnectLazadaSchema = z37.object({
|
@@ -5854,10 +5871,7 @@ var tagContract = initContract22().router(
|
|
5854
5871
|
|
5855
5872
|
// src/telephony-agent-presence-status/index.ts
|
5856
5873
|
import { initContract as initContract23 } from "@ts-rest/core";
|
5857
|
-
import
|
5858
|
-
|
5859
|
-
// src/telephony-agent-presence-status/schema.ts
|
5860
|
-
import z73 from "zod";
|
5874
|
+
import z74 from "zod";
|
5861
5875
|
|
5862
5876
|
// src/presence-status/schema.ts
|
5863
5877
|
import z72 from "zod";
|
@@ -5892,45 +5906,29 @@ var UserPresenceStatusSchema = z72.object({
|
|
5892
5906
|
// src/telephony-agent-presence-status/schema.ts
|
5893
5907
|
var UserPresenceStatusSchema2 = DefaultEntitySchema.extend({
|
5894
5908
|
user: UserSchema,
|
5895
|
-
presenceStatus: PresenceStatusSchema
|
5896
|
-
customPresenceStatus: z73.string().nullable().optional()
|
5909
|
+
presenceStatus: PresenceStatusSchema
|
5897
5910
|
});
|
5898
5911
|
|
5899
5912
|
// src/telephony-agent-presence-status/validation.ts
|
5900
|
-
import { z as
|
5901
|
-
var UpdateUserStatusSchema =
|
5902
|
-
userId:
|
5903
|
-
presenceStatusId:
|
5904
|
-
|
5905
|
-
reason: z74.string()
|
5913
|
+
import { z as z73 } from "zod";
|
5914
|
+
var UpdateUserStatusSchema = z73.object({
|
5915
|
+
userId: z73.string(),
|
5916
|
+
presenceStatusId: z73.string().nullable().optional(),
|
5917
|
+
reason: z73.string()
|
5906
5918
|
});
|
5907
5919
|
|
5908
5920
|
// src/telephony-agent-presence-status/index.ts
|
5909
5921
|
var telephonyAgentPresenceStatusContract = initContract23().router(
|
5910
5922
|
{
|
5911
|
-
getAllAgentStatus: {
|
5912
|
-
method: "GET",
|
5913
|
-
path: "/agents/presence_status",
|
5914
|
-
headers: DefaultHeaderSchema,
|
5915
|
-
responses: {
|
5916
|
-
200: z75.array(UserPresenceStatusSchema2),
|
5917
|
-
400: z75.object({
|
5918
|
-
message: z75.string()
|
5919
|
-
}),
|
5920
|
-
401: DefaultUnauthorizedSchema,
|
5921
|
-
500: DefaultErrorResponseSchema
|
5922
|
-
},
|
5923
|
-
summary: "Get all user presence status list."
|
5924
|
-
},
|
5925
5923
|
getAgentStatus: {
|
5926
5924
|
method: "GET",
|
5927
5925
|
path: "/presence_status/check_update/:userId",
|
5928
|
-
pathParams:
|
5926
|
+
pathParams: z74.object({ userId: z74.string() }),
|
5929
5927
|
headers: DefaultHeaderSchema,
|
5930
5928
|
responses: {
|
5931
5929
|
200: UserPresenceStatusSchema2,
|
5932
|
-
400:
|
5933
|
-
message:
|
5930
|
+
400: z74.object({
|
5931
|
+
message: z74.string()
|
5934
5932
|
}),
|
5935
5933
|
401: DefaultUnauthorizedSchema,
|
5936
5934
|
500: DefaultErrorResponseSchema
|
@@ -5946,8 +5944,8 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5946
5944
|
200: DefaultSuccessResponseSchema.extend({
|
5947
5945
|
userPresenceStatu: UserPresenceStatusSchema2
|
5948
5946
|
}),
|
5949
|
-
400:
|
5950
|
-
message:
|
5947
|
+
400: z74.object({
|
5948
|
+
message: z74.string()
|
5951
5949
|
}),
|
5952
5950
|
401: DefaultUnauthorizedSchema,
|
5953
5951
|
500: DefaultErrorResponseSchema
|
@@ -5959,65 +5957,65 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5959
5957
|
);
|
5960
5958
|
|
5961
5959
|
// src/telephony-cdr/index.ts
|
5962
|
-
import
|
5960
|
+
import z76 from "zod";
|
5963
5961
|
|
5964
5962
|
// src/telephony-cdr/validation.ts
|
5965
|
-
import
|
5966
|
-
var CreateTelephonyCdrSchema =
|
5967
|
-
uniqueCallId:
|
5968
|
-
timeStart:
|
5969
|
-
callFrom:
|
5970
|
-
callTo:
|
5971
|
-
callDuration:
|
5972
|
-
talkDuration:
|
5973
|
-
srcTrunkName:
|
5974
|
-
dstTrunkName:
|
5975
|
-
pinCode:
|
5976
|
-
status:
|
5977
|
-
type:
|
5978
|
-
recording:
|
5979
|
-
didNumber:
|
5980
|
-
agentRingTime:
|
5963
|
+
import z75 from "zod";
|
5964
|
+
var CreateTelephonyCdrSchema = z75.object({
|
5965
|
+
uniqueCallId: z75.string({ required_error: "uniqueCallId is required" }),
|
5966
|
+
timeStart: z75.string({ required_error: "timeStart is required" }),
|
5967
|
+
callFrom: z75.string({ required_error: "callFrom is required" }),
|
5968
|
+
callTo: z75.string({ required_error: "callTo is required" }),
|
5969
|
+
callDuration: z75.number().nullable(),
|
5970
|
+
talkDuration: z75.number().nullable(),
|
5971
|
+
srcTrunkName: z75.string().nullable(),
|
5972
|
+
dstTrunkName: z75.string().nullable(),
|
5973
|
+
pinCode: z75.string().nullable(),
|
5974
|
+
status: z75.string(),
|
5975
|
+
type: z75.string(),
|
5976
|
+
recording: z75.string().nullable(),
|
5977
|
+
didNumber: z75.string().nullable(),
|
5978
|
+
agentRingTime: z75.number().nullable()
|
5981
5979
|
});
|
5982
5980
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5983
|
-
selectedDate:
|
5984
|
-
type:
|
5985
|
-
status:
|
5986
|
-
callFrom:
|
5987
|
-
callTo:
|
5988
|
-
trunk:
|
5989
|
-
userId:
|
5990
|
-
queueStatus:
|
5991
|
-
agentIds:
|
5992
|
-
agentCallsOnly:
|
5993
|
-
contactId:
|
5981
|
+
selectedDate: z75.string().optional(),
|
5982
|
+
type: z75.array(z75.string()).optional(),
|
5983
|
+
status: z75.array(z75.string()).optional(),
|
5984
|
+
callFrom: z75.string().optional(),
|
5985
|
+
callTo: z75.string().optional(),
|
5986
|
+
trunk: z75.array(z75.string()).optional(),
|
5987
|
+
userId: z75.string().uuid().optional(),
|
5988
|
+
queueStatus: z75.string().optional(),
|
5989
|
+
agentIds: z75.array(z75.string().uuid()).optional(),
|
5990
|
+
agentCallsOnly: z75.coerce.boolean().optional(),
|
5991
|
+
contactId: z75.string().uuid().optional()
|
5994
5992
|
});
|
5995
5993
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5996
|
-
type:
|
5997
|
-
status:
|
5998
|
-
callFrom:
|
5999
|
-
callTo:
|
6000
|
-
result:
|
6001
|
-
callTags:
|
6002
|
-
selectedDate:
|
6003
|
-
agentId:
|
6004
|
-
contact:
|
6005
|
-
callStatus:
|
6006
|
-
queueIds:
|
6007
|
-
notes:
|
5994
|
+
type: z75.array(z75.string()).optional(),
|
5995
|
+
status: z75.array(z75.string()).optional(),
|
5996
|
+
callFrom: z75.string().optional(),
|
5997
|
+
callTo: z75.string().optional(),
|
5998
|
+
result: z75.array(z75.string()).optional(),
|
5999
|
+
callTags: z75.array(z75.string()).optional(),
|
6000
|
+
selectedDate: z75.string().optional(),
|
6001
|
+
agentId: z75.string().optional(),
|
6002
|
+
contact: z75.array(z75.string()).optional(),
|
6003
|
+
callStatus: z75.array(z75.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
6004
|
+
queueIds: z75.array(z75.string()).optional(),
|
6005
|
+
notes: z75.string().optional()
|
6008
6006
|
});
|
6009
6007
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
6010
|
-
|
6011
|
-
page:
|
6012
|
-
pageSize:
|
6008
|
+
z75.object({
|
6009
|
+
page: z75.coerce.number().positive().optional(),
|
6010
|
+
pageSize: z75.coerce.number().positive().optional(),
|
6013
6011
|
// We use this export route for both CDR and Call Log.
|
6014
|
-
module:
|
6012
|
+
module: z75.union([z75.literal("cdrs"), z75.literal("call-logs")]).optional().default("cdrs")
|
6015
6013
|
})
|
6016
6014
|
);
|
6017
6015
|
var NullEmptyStringUndefined = ["", null, void 0];
|
6018
6016
|
var EmtptyArrayUndefined = [[], void 0];
|
6019
6017
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
6020
|
-
reportType:
|
6018
|
+
reportType: z75.enum([
|
6021
6019
|
"extcallstatistics",
|
6022
6020
|
"extcallactivity",
|
6023
6021
|
"trunkactivity",
|
@@ -6027,52 +6025,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
6027
6025
|
"queueagentmisscalls",
|
6028
6026
|
"queueagentinoutcalls"
|
6029
6027
|
]),
|
6030
|
-
selectedDate:
|
6031
|
-
communicationType:
|
6032
|
-
time:
|
6033
|
-
queueList:
|
6034
|
-
queueId:
|
6035
|
-
trunkList:
|
6036
|
-
extensionList:
|
6028
|
+
selectedDate: z75.string().optional(),
|
6029
|
+
communicationType: z75.union([z75.literal("Inbound"), z75.literal("Outbound"), z75.literal("Internal")]).optional(),
|
6030
|
+
time: z75.string().optional(),
|
6031
|
+
queueList: z75.array(z75.string()).optional(),
|
6032
|
+
queueId: z75.string().optional(),
|
6033
|
+
trunkList: z75.array(z75.string()).optional(),
|
6034
|
+
extensionList: z75.array(z75.string()).optional()
|
6037
6035
|
}).superRefine((input, ctx) => {
|
6038
6036
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
6039
6037
|
ctx.addIssue({
|
6040
|
-
code:
|
6038
|
+
code: z75.ZodIssueCode.custom,
|
6041
6039
|
path: ["selectedDate"],
|
6042
6040
|
message: "selectedDate is required."
|
6043
6041
|
});
|
6044
6042
|
}
|
6045
6043
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
6046
6044
|
ctx.addIssue({
|
6047
|
-
code:
|
6045
|
+
code: z75.ZodIssueCode.custom,
|
6048
6046
|
path: ["time"],
|
6049
6047
|
message: "time is required."
|
6050
6048
|
});
|
6051
6049
|
}
|
6052
6050
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
6053
6051
|
ctx.addIssue({
|
6054
|
-
code:
|
6052
|
+
code: z75.ZodIssueCode.custom,
|
6055
6053
|
path: ["queueList"],
|
6056
6054
|
message: "queueList is required."
|
6057
6055
|
});
|
6058
6056
|
}
|
6059
6057
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
6060
6058
|
ctx.addIssue({
|
6061
|
-
code:
|
6059
|
+
code: z75.ZodIssueCode.custom,
|
6062
6060
|
path: ["queueId"],
|
6063
6061
|
message: "queueId is required."
|
6064
6062
|
});
|
6065
6063
|
}
|
6066
6064
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
6067
6065
|
ctx.addIssue({
|
6068
|
-
code:
|
6066
|
+
code: z75.ZodIssueCode.custom,
|
6069
6067
|
path: ["trunkList"],
|
6070
6068
|
message: "trunkList is required."
|
6071
6069
|
});
|
6072
6070
|
}
|
6073
6071
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
6074
6072
|
ctx.addIssue({
|
6075
|
-
code:
|
6073
|
+
code: z75.ZodIssueCode.custom,
|
6076
6074
|
path: ["extensionList"],
|
6077
6075
|
message: "extensionList is required."
|
6078
6076
|
});
|
@@ -6090,10 +6088,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6090
6088
|
query: GetAllTelephonyCdrSchema,
|
6091
6089
|
responses: {
|
6092
6090
|
200: DefaultSuccessResponseSchema.extend({
|
6093
|
-
total:
|
6094
|
-
page:
|
6095
|
-
pageSize:
|
6096
|
-
telephonyCdrs:
|
6091
|
+
total: z76.number(),
|
6092
|
+
page: z76.number(),
|
6093
|
+
pageSize: z76.number(),
|
6094
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6097
6095
|
}),
|
6098
6096
|
401: DefaultUnauthorizedSchema
|
6099
6097
|
},
|
@@ -6106,10 +6104,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6106
6104
|
query: GetAllTelephonyCdrSchema,
|
6107
6105
|
responses: {
|
6108
6106
|
200: DefaultSuccessResponseSchema.extend({
|
6109
|
-
total:
|
6110
|
-
page:
|
6111
|
-
pageSize:
|
6112
|
-
telephonyCdrs:
|
6107
|
+
total: z76.number(),
|
6108
|
+
page: z76.number(),
|
6109
|
+
pageSize: z76.number(),
|
6110
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6113
6111
|
}),
|
6114
6112
|
401: DefaultUnauthorizedSchema
|
6115
6113
|
},
|
@@ -6122,10 +6120,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6122
6120
|
query: GetRecentTelephonyCdrSchema,
|
6123
6121
|
responses: {
|
6124
6122
|
200: DefaultSuccessResponseSchema.extend({
|
6125
|
-
total:
|
6126
|
-
page:
|
6127
|
-
pageSize:
|
6128
|
-
telephonyCdrs:
|
6123
|
+
total: z76.number(),
|
6124
|
+
page: z76.number(),
|
6125
|
+
pageSize: z76.number(),
|
6126
|
+
telephonyCdrs: z76.array(TelephonyCdrSchema)
|
6129
6127
|
}),
|
6130
6128
|
401: DefaultUnauthorizedSchema
|
6131
6129
|
},
|
@@ -6152,7 +6150,7 @@ var telephonyCdrContract = initContract24().router(
|
|
6152
6150
|
body: GetYeastarCallReportSchema,
|
6153
6151
|
responses: {
|
6154
6152
|
// 200: CallReportSchema,
|
6155
|
-
200:
|
6153
|
+
200: z76.object({}),
|
6156
6154
|
401: DefaultUnauthorizedSchema
|
6157
6155
|
},
|
6158
6156
|
summary: "Get yeastar call report."
|
@@ -6220,10 +6218,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6220
6218
|
headers: DefaultHeaderSchema,
|
6221
6219
|
responses: {
|
6222
6220
|
200: DefaultSuccessResponseSchema.extend({
|
6223
|
-
callRedirectTo:
|
6221
|
+
callRedirectTo: z76.string()
|
6224
6222
|
}),
|
6225
|
-
400:
|
6226
|
-
message:
|
6223
|
+
400: z76.object({
|
6224
|
+
message: z76.string()
|
6227
6225
|
}),
|
6228
6226
|
401: DefaultUnauthorizedSchema,
|
6229
6227
|
500: DefaultErrorResponseSchema
|
@@ -6236,10 +6234,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6236
6234
|
body: TelephonyRedirectSettingSchema,
|
6237
6235
|
responses: {
|
6238
6236
|
200: DefaultSuccessResponseSchema.extend({
|
6239
|
-
callRedirectTo:
|
6237
|
+
callRedirectTo: z76.string()
|
6240
6238
|
}),
|
6241
|
-
400:
|
6242
|
-
message:
|
6239
|
+
400: z76.object({
|
6240
|
+
message: z76.string()
|
6243
6241
|
}),
|
6244
6242
|
401: DefaultUnauthorizedSchema,
|
6245
6243
|
500: DefaultErrorResponseSchema
|
@@ -6251,11 +6249,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6251
6249
|
headers: DefaultHeaderSchema,
|
6252
6250
|
responses: {
|
6253
6251
|
200: DefaultSuccessResponseSchema.extend({
|
6254
|
-
callRedirectTo:
|
6255
|
-
isMultiTabUsed:
|
6252
|
+
callRedirectTo: z76.string(),
|
6253
|
+
isMultiTabUsed: z76.string()
|
6256
6254
|
}),
|
6257
|
-
400:
|
6258
|
-
message:
|
6255
|
+
400: z76.object({
|
6256
|
+
message: z76.string()
|
6259
6257
|
}),
|
6260
6258
|
401: DefaultUnauthorizedSchema,
|
6261
6259
|
500: DefaultErrorResponseSchema
|
@@ -6268,11 +6266,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6268
6266
|
body: CallSettingSchema,
|
6269
6267
|
responses: {
|
6270
6268
|
200: DefaultSuccessResponseSchema.extend({
|
6271
|
-
callRedirectTo:
|
6272
|
-
isMultiTabUsed:
|
6269
|
+
callRedirectTo: z76.string(),
|
6270
|
+
isMultiTabUsed: z76.string()
|
6273
6271
|
}),
|
6274
|
-
400:
|
6275
|
-
message:
|
6272
|
+
400: z76.object({
|
6273
|
+
message: z76.string()
|
6276
6274
|
}),
|
6277
6275
|
401: DefaultUnauthorizedSchema,
|
6278
6276
|
500: DefaultErrorResponseSchema
|
@@ -6284,35 +6282,35 @@ var telephonyCdrContract = initContract24().router(
|
|
6284
6282
|
|
6285
6283
|
// src/telephony-extension/index.ts
|
6286
6284
|
import { initContract as initContract25 } from "@ts-rest/core";
|
6287
|
-
import
|
6285
|
+
import z78 from "zod";
|
6288
6286
|
|
6289
6287
|
// src/telephony-extension/schema.ts
|
6290
|
-
import
|
6291
|
-
var TelephonyExtensionSchema3 =
|
6292
|
-
errcode:
|
6293
|
-
errmsg:
|
6294
|
-
total_number:
|
6295
|
-
data:
|
6296
|
-
|
6297
|
-
id:
|
6298
|
-
online_status:
|
6299
|
-
fx_phone:
|
6300
|
-
sip_phone:
|
6301
|
-
status:
|
6302
|
-
ext_dev_type:
|
6303
|
-
}),
|
6304
|
-
linkus_desktop:
|
6305
|
-
linkus_mobile:
|
6306
|
-
linkus_web:
|
6307
|
-
status:
|
6308
|
-
ext_dev_type:
|
6288
|
+
import z77 from "zod";
|
6289
|
+
var TelephonyExtensionSchema3 = z77.object({
|
6290
|
+
errcode: z77.coerce.number(),
|
6291
|
+
errmsg: z77.string(),
|
6292
|
+
total_number: z77.coerce.number(),
|
6293
|
+
data: z77.array(
|
6294
|
+
z77.object({
|
6295
|
+
id: z77.coerce.number(),
|
6296
|
+
online_status: z77.object({
|
6297
|
+
fx_phone: z77.object({ status: z77.coerce.number() }),
|
6298
|
+
sip_phone: z77.object({
|
6299
|
+
status: z77.coerce.number(),
|
6300
|
+
ext_dev_type: z77.string().optional()
|
6301
|
+
}),
|
6302
|
+
linkus_desktop: z77.object({ status: z77.coerce.number() }),
|
6303
|
+
linkus_mobile: z77.object({ status: z77.coerce.number() }),
|
6304
|
+
linkus_web: z77.object({
|
6305
|
+
status: z77.coerce.number(),
|
6306
|
+
ext_dev_type: z77.string().optional()
|
6309
6307
|
})
|
6310
6308
|
}).optional(),
|
6311
|
-
presence_status:
|
6312
|
-
number:
|
6313
|
-
caller_id_name:
|
6314
|
-
role_name:
|
6315
|
-
email_addr:
|
6309
|
+
presence_status: z77.string().optional(),
|
6310
|
+
number: z77.string().optional(),
|
6311
|
+
caller_id_name: z77.string().optional(),
|
6312
|
+
role_name: z77.string().optional(),
|
6313
|
+
email_addr: z77.string().optional()
|
6316
6314
|
})
|
6317
6315
|
)
|
6318
6316
|
});
|
@@ -6327,8 +6325,8 @@ var telephonyExtensionContract = initContract25().router(
|
|
6327
6325
|
query: null,
|
6328
6326
|
responses: {
|
6329
6327
|
200: TelephonyExtensionSchema3,
|
6330
|
-
400:
|
6331
|
-
message:
|
6328
|
+
400: z78.object({
|
6329
|
+
message: z78.string()
|
6332
6330
|
}),
|
6333
6331
|
401: DefaultUnauthorizedSchema,
|
6334
6332
|
500: DefaultErrorResponseSchema
|
@@ -6341,10 +6339,10 @@ var telephonyExtensionContract = initContract25().router(
|
|
6341
6339
|
|
6342
6340
|
// src/ticket/index.ts
|
6343
6341
|
import { initContract as initContract26 } from "@ts-rest/core";
|
6344
|
-
import
|
6342
|
+
import z80 from "zod";
|
6345
6343
|
|
6346
6344
|
// src/ticket/validation.ts
|
6347
|
-
import
|
6345
|
+
import z79 from "zod";
|
6348
6346
|
var addErrorMessage2 = (field) => {
|
6349
6347
|
return field.refine(
|
6350
6348
|
({ isRequired, value }) => {
|
@@ -6362,108 +6360,108 @@ var addErrorMessage2 = (field) => {
|
|
6362
6360
|
}
|
6363
6361
|
);
|
6364
6362
|
};
|
6365
|
-
var BaseSchema3 =
|
6366
|
-
isRequired:
|
6367
|
-
attributeId:
|
6363
|
+
var BaseSchema3 = z79.object({
|
6364
|
+
isRequired: z79.boolean(),
|
6365
|
+
attributeId: z79.string()
|
6368
6366
|
});
|
6369
6367
|
var SingleValue2 = addErrorMessage2(
|
6370
6368
|
BaseSchema3.extend({
|
6371
|
-
value:
|
6369
|
+
value: z79.string()
|
6372
6370
|
})
|
6373
6371
|
);
|
6374
|
-
var CreateTicketValidationSchema =
|
6372
|
+
var CreateTicketValidationSchema = z79.object({
|
6375
6373
|
title: SingleValue2,
|
6376
6374
|
description: SingleValue2,
|
6377
6375
|
status: SingleValue2,
|
6378
6376
|
type: SingleValue2,
|
6379
6377
|
priority: SingleValue2,
|
6380
6378
|
contact: SingleValue2,
|
6381
|
-
assignee:
|
6382
|
-
isRequired:
|
6383
|
-
attributeId:
|
6384
|
-
value:
|
6379
|
+
assignee: z79.object({
|
6380
|
+
isRequired: z79.boolean(),
|
6381
|
+
attributeId: z79.string(),
|
6382
|
+
value: z79.string()
|
6385
6383
|
}),
|
6386
6384
|
channel: SingleValue2,
|
6387
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
6388
|
-
categories: BaseSchema3.extend({ value:
|
6389
|
-
customFields:
|
6385
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z79.array(z79.string()) })),
|
6386
|
+
categories: BaseSchema3.extend({ value: z79.array(z79.string()) }),
|
6387
|
+
customFields: z79.array(
|
6390
6388
|
addErrorMessage2(
|
6391
6389
|
BaseSchema3.extend({
|
6392
|
-
value:
|
6393
|
-
type:
|
6394
|
-
isDefaultAttribute:
|
6390
|
+
value: z79.union([z79.string(), z79.array(z79.string())]),
|
6391
|
+
type: z79.string(),
|
6392
|
+
isDefaultAttribute: z79.boolean()
|
6395
6393
|
})
|
6396
6394
|
)
|
6397
6395
|
),
|
6398
|
-
reasonToAssign:
|
6396
|
+
reasonToAssign: z79.object({ value: z79.string() }).optional()
|
6399
6397
|
});
|
6400
6398
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
6401
|
-
var TicketAttachmentRecordSchema =
|
6402
|
-
bucketName:
|
6403
|
-
fileKey:
|
6404
|
-
fileName:
|
6405
|
-
fileSize:
|
6406
|
-
url:
|
6407
|
-
});
|
6408
|
-
var CreateTicketAttachmentRecordsSchema =
|
6409
|
-
ticketId:
|
6410
|
-
attributeId:
|
6411
|
-
ticketAttachmentRecords:
|
6412
|
-
});
|
6413
|
-
var TicketParamsSchema =
|
6414
|
-
page:
|
6415
|
-
pageSize:
|
6416
|
-
});
|
6417
|
-
var CustomFieldQuery =
|
6418
|
-
attributeId:
|
6419
|
-
type:
|
6420
|
-
value:
|
6421
|
-
});
|
6422
|
-
var GetAllTicketQuerySchema =
|
6423
|
-
page:
|
6424
|
-
pageSize:
|
6425
|
-
selectedDate:
|
6426
|
-
ticketNumber:
|
6427
|
-
keyword:
|
6428
|
-
title:
|
6429
|
-
description:
|
6430
|
-
status:
|
6431
|
-
priority:
|
6432
|
-
channel:
|
6433
|
-
type:
|
6434
|
-
ticketType:
|
6435
|
-
contact:
|
6436
|
-
tags:
|
6437
|
-
categories:
|
6438
|
-
assignee:
|
6439
|
-
customFields:
|
6440
|
-
|
6441
|
-
attributeId:
|
6442
|
-
type:
|
6443
|
-
value:
|
6399
|
+
var TicketAttachmentRecordSchema = z79.object({
|
6400
|
+
bucketName: z79.string(),
|
6401
|
+
fileKey: z79.string(),
|
6402
|
+
fileName: z79.string(),
|
6403
|
+
fileSize: z79.coerce.number(),
|
6404
|
+
url: z79.string()
|
6405
|
+
});
|
6406
|
+
var CreateTicketAttachmentRecordsSchema = z79.object({
|
6407
|
+
ticketId: z79.string(),
|
6408
|
+
attributeId: z79.string(),
|
6409
|
+
ticketAttachmentRecords: z79.array(TicketAttachmentRecordSchema)
|
6410
|
+
});
|
6411
|
+
var TicketParamsSchema = z79.object({
|
6412
|
+
page: z79.coerce.number().default(1),
|
6413
|
+
pageSize: z79.coerce.number().default(10)
|
6414
|
+
});
|
6415
|
+
var CustomFieldQuery = z79.object({
|
6416
|
+
attributeId: z79.string(),
|
6417
|
+
type: z79.string(),
|
6418
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6419
|
+
});
|
6420
|
+
var GetAllTicketQuerySchema = z79.object({
|
6421
|
+
page: z79.string().transform((value) => Number(value)),
|
6422
|
+
pageSize: z79.string().transform((value) => Number(value)),
|
6423
|
+
selectedDate: z79.string(),
|
6424
|
+
ticketNumber: z79.string(),
|
6425
|
+
keyword: z79.string(),
|
6426
|
+
title: z79.string(),
|
6427
|
+
description: z79.string(),
|
6428
|
+
status: z79.array(z79.string()),
|
6429
|
+
priority: z79.array(z79.string()),
|
6430
|
+
channel: z79.array(z79.string()),
|
6431
|
+
type: z79.array(z79.string()),
|
6432
|
+
ticketType: z79.array(z79.string()),
|
6433
|
+
contact: z79.array(z79.string()),
|
6434
|
+
tags: z79.array(z79.string().uuid()),
|
6435
|
+
categories: z79.array(z79.string().uuid()),
|
6436
|
+
assignee: z79.array(z79.string().uuid()),
|
6437
|
+
customFields: z79.array(
|
6438
|
+
z79.object({
|
6439
|
+
attributeId: z79.string().uuid(),
|
6440
|
+
type: z79.string(),
|
6441
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6444
6442
|
})
|
6445
6443
|
)
|
6446
6444
|
}).partial();
|
6447
|
-
var ExportAllTicketQuerySchema =
|
6448
|
-
agent:
|
6449
|
-
selectedDate:
|
6450
|
-
keyword:
|
6451
|
-
title:
|
6452
|
-
description:
|
6453
|
-
status:
|
6454
|
-
priority:
|
6455
|
-
assignee:
|
6456
|
-
channel:
|
6457
|
-
type:
|
6458
|
-
ticketType:
|
6459
|
-
contact:
|
6460
|
-
tags:
|
6461
|
-
categories:
|
6462
|
-
customFields:
|
6463
|
-
|
6464
|
-
attributeId:
|
6465
|
-
type:
|
6466
|
-
value:
|
6445
|
+
var ExportAllTicketQuerySchema = z79.object({
|
6446
|
+
agent: z79.array(z79.string()),
|
6447
|
+
selectedDate: z79.string(),
|
6448
|
+
keyword: z79.string(),
|
6449
|
+
title: z79.string(),
|
6450
|
+
description: z79.string(),
|
6451
|
+
status: z79.array(z79.string()),
|
6452
|
+
priority: z79.array(z79.string()),
|
6453
|
+
assignee: z79.array(z79.string().uuid()),
|
6454
|
+
channel: z79.array(z79.string()),
|
6455
|
+
type: z79.array(z79.string()),
|
6456
|
+
ticketType: z79.array(z79.string()),
|
6457
|
+
contact: z79.array(z79.string()),
|
6458
|
+
tags: z79.array(z79.string()),
|
6459
|
+
categories: z79.array(z79.string()),
|
6460
|
+
customFields: z79.array(
|
6461
|
+
z79.object({
|
6462
|
+
attributeId: z79.string().uuid(),
|
6463
|
+
type: z79.string(),
|
6464
|
+
value: z79.union([z79.string(), z79.array(z79.string())])
|
6467
6465
|
})
|
6468
6466
|
)
|
6469
6467
|
}).partial();
|
@@ -6479,14 +6477,14 @@ var ticketContract = initContract26().router(
|
|
6479
6477
|
201: DefaultSuccessResponseSchema.extend({
|
6480
6478
|
data: TicketSchema
|
6481
6479
|
}),
|
6482
|
-
400:
|
6483
|
-
message:
|
6480
|
+
400: z80.object({
|
6481
|
+
message: z80.string()
|
6484
6482
|
}),
|
6485
|
-
409:
|
6486
|
-
message:
|
6483
|
+
409: z80.object({
|
6484
|
+
message: z80.string()
|
6487
6485
|
}),
|
6488
|
-
500:
|
6489
|
-
message:
|
6486
|
+
500: z80.object({
|
6487
|
+
message: z80.string()
|
6490
6488
|
}),
|
6491
6489
|
401: DefaultUnauthorizedSchema,
|
6492
6490
|
404: DefaultNotFoundSchema,
|
@@ -6507,8 +6505,8 @@ var ticketContract = initContract26().router(
|
|
6507
6505
|
TicketSchema
|
6508
6506
|
)
|
6509
6507
|
}),
|
6510
|
-
400:
|
6511
|
-
message:
|
6508
|
+
400: z80.object({
|
6509
|
+
message: z80.string()
|
6512
6510
|
}),
|
6513
6511
|
401: DefaultUnauthorizedSchema,
|
6514
6512
|
500: DefaultErrorResponseSchema
|
@@ -6518,14 +6516,14 @@ var ticketContract = initContract26().router(
|
|
6518
6516
|
getTicketById: {
|
6519
6517
|
method: "GET",
|
6520
6518
|
path: "/:id",
|
6521
|
-
pathParams:
|
6519
|
+
pathParams: z80.object({ id: z80.string() }),
|
6522
6520
|
headers: DefaultHeaderSchema,
|
6523
6521
|
responses: {
|
6524
6522
|
200: DefaultSuccessResponseSchema.extend({
|
6525
6523
|
data: TicketSchema
|
6526
6524
|
}),
|
6527
|
-
400:
|
6528
|
-
message:
|
6525
|
+
400: z80.object({
|
6526
|
+
message: z80.string()
|
6529
6527
|
}),
|
6530
6528
|
401: DefaultUnauthorizedSchema,
|
6531
6529
|
500: DefaultErrorResponseSchema
|
@@ -6535,15 +6533,15 @@ var ticketContract = initContract26().router(
|
|
6535
6533
|
getTicketByContactId: {
|
6536
6534
|
method: "GET",
|
6537
6535
|
path: "/contact/:id",
|
6538
|
-
pathParams:
|
6536
|
+
pathParams: z80.object({ id: z80.string() }),
|
6539
6537
|
query: TicketParamsSchema,
|
6540
6538
|
headers: DefaultHeaderSchema,
|
6541
6539
|
responses: {
|
6542
6540
|
200: DefaultSuccessResponseSchema.extend({
|
6543
6541
|
data: WithPagination(TicketSchema)
|
6544
6542
|
}),
|
6545
|
-
400:
|
6546
|
-
message:
|
6543
|
+
400: z80.object({
|
6544
|
+
message: z80.string()
|
6547
6545
|
}),
|
6548
6546
|
401: DefaultUnauthorizedSchema,
|
6549
6547
|
500: DefaultErrorResponseSchema
|
@@ -6553,21 +6551,21 @@ var ticketContract = initContract26().router(
|
|
6553
6551
|
updateTicket: {
|
6554
6552
|
method: "PATCH",
|
6555
6553
|
path: "/:id",
|
6556
|
-
pathParams:
|
6554
|
+
pathParams: z80.object({ id: z80.string() }),
|
6557
6555
|
body: UpdateTicketValidationSchema,
|
6558
6556
|
headers: DefaultHeaderSchema,
|
6559
6557
|
responses: {
|
6560
6558
|
201: DefaultSuccessResponseSchema.extend({
|
6561
6559
|
data: TicketSchema
|
6562
6560
|
}),
|
6563
|
-
400:
|
6564
|
-
message:
|
6561
|
+
400: z80.object({
|
6562
|
+
message: z80.string()
|
6565
6563
|
}),
|
6566
|
-
409:
|
6567
|
-
message:
|
6564
|
+
409: z80.object({
|
6565
|
+
message: z80.string()
|
6568
6566
|
}),
|
6569
|
-
500:
|
6570
|
-
message:
|
6567
|
+
500: z80.object({
|
6568
|
+
message: z80.string()
|
6571
6569
|
}),
|
6572
6570
|
401: DefaultUnauthorizedSchema,
|
6573
6571
|
404: DefaultNotFoundSchema,
|
@@ -6578,11 +6576,11 @@ var ticketContract = initContract26().router(
|
|
6578
6576
|
deleteTicket: {
|
6579
6577
|
method: "DELETE",
|
6580
6578
|
path: "/:id",
|
6581
|
-
pathParams:
|
6579
|
+
pathParams: z80.object({ id: z80.string() }),
|
6582
6580
|
headers: DefaultHeaderSchema,
|
6583
6581
|
body: null,
|
6584
6582
|
responses: {
|
6585
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6583
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6586
6584
|
500: DefaultErrorResponseSchema
|
6587
6585
|
},
|
6588
6586
|
summary: "Delete a extension."
|
@@ -6590,19 +6588,19 @@ var ticketContract = initContract26().router(
|
|
6590
6588
|
updateDescription: {
|
6591
6589
|
method: "PATCH",
|
6592
6590
|
path: "/description/update/:id",
|
6593
|
-
pathParams:
|
6594
|
-
body:
|
6591
|
+
pathParams: z80.object({ id: z80.string() }),
|
6592
|
+
body: z80.object({ description: z80.string() }),
|
6595
6593
|
headers: DefaultHeaderSchema,
|
6596
6594
|
responses: {
|
6597
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
6598
|
-
400:
|
6599
|
-
message:
|
6595
|
+
201: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6596
|
+
400: z80.object({
|
6597
|
+
message: z80.string()
|
6600
6598
|
}),
|
6601
|
-
409:
|
6602
|
-
message:
|
6599
|
+
409: z80.object({
|
6600
|
+
message: z80.string()
|
6603
6601
|
}),
|
6604
|
-
500:
|
6605
|
-
message:
|
6602
|
+
500: z80.object({
|
6603
|
+
message: z80.string()
|
6606
6604
|
}),
|
6607
6605
|
401: DefaultUnauthorizedSchema,
|
6608
6606
|
404: DefaultNotFoundSchema,
|
@@ -6613,19 +6611,19 @@ var ticketContract = initContract26().router(
|
|
6613
6611
|
updateTitle: {
|
6614
6612
|
method: "PATCH",
|
6615
6613
|
path: "/title/update/:id",
|
6616
|
-
pathParams:
|
6617
|
-
body:
|
6614
|
+
pathParams: z80.object({ id: z80.string() }),
|
6615
|
+
body: z80.object({ title: z80.string() }),
|
6618
6616
|
headers: DefaultHeaderSchema,
|
6619
6617
|
responses: {
|
6620
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6621
|
-
400:
|
6622
|
-
message:
|
6618
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6619
|
+
400: z80.object({
|
6620
|
+
message: z80.string()
|
6623
6621
|
}),
|
6624
|
-
409:
|
6625
|
-
message:
|
6622
|
+
409: z80.object({
|
6623
|
+
message: z80.string()
|
6626
6624
|
}),
|
6627
|
-
500:
|
6628
|
-
message:
|
6625
|
+
500: z80.object({
|
6626
|
+
message: z80.string()
|
6629
6627
|
}),
|
6630
6628
|
401: DefaultUnauthorizedSchema,
|
6631
6629
|
404: DefaultNotFoundSchema,
|
@@ -6636,19 +6634,19 @@ var ticketContract = initContract26().router(
|
|
6636
6634
|
updateType: {
|
6637
6635
|
method: "PATCH",
|
6638
6636
|
path: "/type/update/:id",
|
6639
|
-
pathParams:
|
6640
|
-
body:
|
6637
|
+
pathParams: z80.object({ id: z80.string() }),
|
6638
|
+
body: z80.object({ type: z80.string() }),
|
6641
6639
|
headers: DefaultHeaderSchema,
|
6642
6640
|
responses: {
|
6643
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6644
|
-
400:
|
6645
|
-
message:
|
6641
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6642
|
+
400: z80.object({
|
6643
|
+
message: z80.string()
|
6646
6644
|
}),
|
6647
|
-
409:
|
6648
|
-
message:
|
6645
|
+
409: z80.object({
|
6646
|
+
message: z80.string()
|
6649
6647
|
}),
|
6650
|
-
500:
|
6651
|
-
message:
|
6648
|
+
500: z80.object({
|
6649
|
+
message: z80.string()
|
6652
6650
|
}),
|
6653
6651
|
401: DefaultUnauthorizedSchema,
|
6654
6652
|
404: DefaultNotFoundSchema,
|
@@ -6659,19 +6657,19 @@ var ticketContract = initContract26().router(
|
|
6659
6657
|
updateStatus: {
|
6660
6658
|
method: "PATCH",
|
6661
6659
|
path: "/status/update/:id",
|
6662
|
-
pathParams:
|
6663
|
-
body:
|
6660
|
+
pathParams: z80.object({ id: z80.string() }),
|
6661
|
+
body: z80.object({ status: z80.string() }),
|
6664
6662
|
headers: DefaultHeaderSchema,
|
6665
6663
|
responses: {
|
6666
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6667
|
-
400:
|
6668
|
-
message:
|
6664
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6665
|
+
400: z80.object({
|
6666
|
+
message: z80.string()
|
6669
6667
|
}),
|
6670
|
-
409:
|
6671
|
-
message:
|
6668
|
+
409: z80.object({
|
6669
|
+
message: z80.string()
|
6672
6670
|
}),
|
6673
|
-
500:
|
6674
|
-
message:
|
6671
|
+
500: z80.object({
|
6672
|
+
message: z80.string()
|
6675
6673
|
}),
|
6676
6674
|
401: DefaultUnauthorizedSchema,
|
6677
6675
|
404: DefaultNotFoundSchema,
|
@@ -6682,19 +6680,19 @@ var ticketContract = initContract26().router(
|
|
6682
6680
|
updatePriority: {
|
6683
6681
|
method: "PATCH",
|
6684
6682
|
path: "/priority/update/:id",
|
6685
|
-
pathParams:
|
6686
|
-
body:
|
6683
|
+
pathParams: z80.object({ id: z80.string() }),
|
6684
|
+
body: z80.object({ priority: z80.string() }),
|
6687
6685
|
headers: DefaultHeaderSchema,
|
6688
6686
|
responses: {
|
6689
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6690
|
-
400:
|
6691
|
-
message:
|
6687
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6688
|
+
400: z80.object({
|
6689
|
+
message: z80.string()
|
6692
6690
|
}),
|
6693
|
-
409:
|
6694
|
-
message:
|
6691
|
+
409: z80.object({
|
6692
|
+
message: z80.string()
|
6695
6693
|
}),
|
6696
|
-
500:
|
6697
|
-
message:
|
6694
|
+
500: z80.object({
|
6695
|
+
message: z80.string()
|
6698
6696
|
}),
|
6699
6697
|
401: DefaultUnauthorizedSchema,
|
6700
6698
|
404: DefaultNotFoundSchema,
|
@@ -6705,19 +6703,19 @@ var ticketContract = initContract26().router(
|
|
6705
6703
|
updateChannel: {
|
6706
6704
|
method: "PATCH",
|
6707
6705
|
path: "/channel/update/:id",
|
6708
|
-
pathParams:
|
6709
|
-
body:
|
6706
|
+
pathParams: z80.object({ id: z80.string() }),
|
6707
|
+
body: z80.object({ channel: z80.string() }),
|
6710
6708
|
headers: DefaultHeaderSchema,
|
6711
6709
|
responses: {
|
6712
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6713
|
-
400:
|
6714
|
-
message:
|
6710
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6711
|
+
400: z80.object({
|
6712
|
+
message: z80.string()
|
6715
6713
|
}),
|
6716
|
-
409:
|
6717
|
-
message:
|
6714
|
+
409: z80.object({
|
6715
|
+
message: z80.string()
|
6718
6716
|
}),
|
6719
|
-
500:
|
6720
|
-
message:
|
6717
|
+
500: z80.object({
|
6718
|
+
message: z80.string()
|
6721
6719
|
}),
|
6722
6720
|
401: DefaultUnauthorizedSchema,
|
6723
6721
|
404: DefaultNotFoundSchema,
|
@@ -6728,19 +6726,19 @@ var ticketContract = initContract26().router(
|
|
6728
6726
|
updateTags: {
|
6729
6727
|
method: "PATCH",
|
6730
6728
|
path: "/tags/update/:id",
|
6731
|
-
pathParams:
|
6732
|
-
body:
|
6729
|
+
pathParams: z80.object({ id: z80.string() }),
|
6730
|
+
body: z80.object({ tags: z80.array(z80.string()) }),
|
6733
6731
|
headers: DefaultHeaderSchema,
|
6734
6732
|
responses: {
|
6735
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6736
|
-
400:
|
6737
|
-
message:
|
6733
|
+
200: DefaultSuccessResponseSchema.extend({ message: z80.string() }),
|
6734
|
+
400: z80.object({
|
6735
|
+
message: z80.string()
|
6738
6736
|
}),
|
6739
|
-
409:
|
6740
|
-
message:
|
6737
|
+
409: z80.object({
|
6738
|
+
message: z80.string()
|
6741
6739
|
}),
|
6742
|
-
500:
|
6743
|
-
message:
|
6740
|
+
500: z80.object({
|
6741
|
+
message: z80.string()
|
6744
6742
|
}),
|
6745
6743
|
401: DefaultUnauthorizedSchema,
|
6746
6744
|
404: DefaultNotFoundSchema,
|
@@ -6751,25 +6749,25 @@ var ticketContract = initContract26().router(
|
|
6751
6749
|
changeAssignee: {
|
6752
6750
|
method: "PATCH",
|
6753
6751
|
path: "/assignee/update/:id",
|
6754
|
-
pathParams:
|
6755
|
-
body:
|
6756
|
-
ticketId:
|
6757
|
-
assigneeId:
|
6758
|
-
reason:
|
6752
|
+
pathParams: z80.object({ id: z80.string() }),
|
6753
|
+
body: z80.object({
|
6754
|
+
ticketId: z80.string(),
|
6755
|
+
assigneeId: z80.string(),
|
6756
|
+
reason: z80.string().optional()
|
6759
6757
|
}),
|
6760
6758
|
headers: DefaultHeaderSchema,
|
6761
6759
|
responses: {
|
6762
6760
|
200: DefaultSuccessResponseSchema.extend({
|
6763
6761
|
data: TicketSchema
|
6764
6762
|
}),
|
6765
|
-
400:
|
6766
|
-
message:
|
6763
|
+
400: z80.object({
|
6764
|
+
message: z80.string()
|
6767
6765
|
}),
|
6768
|
-
409:
|
6769
|
-
message:
|
6766
|
+
409: z80.object({
|
6767
|
+
message: z80.string()
|
6770
6768
|
}),
|
6771
|
-
500:
|
6772
|
-
message:
|
6769
|
+
500: z80.object({
|
6770
|
+
message: z80.string()
|
6773
6771
|
}),
|
6774
6772
|
401: DefaultUnauthorizedSchema,
|
6775
6773
|
404: DefaultNotFoundSchema,
|
@@ -6780,14 +6778,14 @@ var ticketContract = initContract26().router(
|
|
6780
6778
|
getTicketCountByContact: {
|
6781
6779
|
method: "GET",
|
6782
6780
|
path: "/ticket_count/contact/:id",
|
6783
|
-
pathParams:
|
6781
|
+
pathParams: z80.object({ id: z80.string() }),
|
6784
6782
|
headers: DefaultHeaderSchema,
|
6785
6783
|
responses: {
|
6786
6784
|
200: DefaultSuccessResponseSchema.extend({
|
6787
6785
|
data: TicketCountByContactSchema
|
6788
6786
|
}),
|
6789
|
-
400:
|
6790
|
-
message:
|
6787
|
+
400: z80.object({
|
6788
|
+
message: z80.string()
|
6791
6789
|
}),
|
6792
6790
|
401: DefaultUnauthorizedSchema,
|
6793
6791
|
500: DefaultErrorResponseSchema
|
@@ -6803,14 +6801,14 @@ var ticketContract = initContract26().router(
|
|
6803
6801
|
201: DefaultSuccessResponseSchema.extend({
|
6804
6802
|
data: TicketCustomFieldSchema
|
6805
6803
|
}),
|
6806
|
-
400:
|
6807
|
-
message:
|
6804
|
+
400: z80.object({
|
6805
|
+
message: z80.string()
|
6808
6806
|
}),
|
6809
|
-
409:
|
6810
|
-
message:
|
6807
|
+
409: z80.object({
|
6808
|
+
message: z80.string()
|
6811
6809
|
}),
|
6812
|
-
500:
|
6813
|
-
message:
|
6810
|
+
500: z80.object({
|
6811
|
+
message: z80.string()
|
6814
6812
|
}),
|
6815
6813
|
401: DefaultUnauthorizedSchema,
|
6816
6814
|
404: DefaultNotFoundSchema,
|
@@ -6837,10 +6835,10 @@ var ticketContract = initContract26().router(
|
|
6837
6835
|
headers: DefaultHeaderSchema,
|
6838
6836
|
responses: {
|
6839
6837
|
200: DefaultSuccessResponseSchema.extend({
|
6840
|
-
ticketReasonRequired:
|
6838
|
+
ticketReasonRequired: z80.string()
|
6841
6839
|
}),
|
6842
|
-
400:
|
6843
|
-
message:
|
6840
|
+
400: z80.object({
|
6841
|
+
message: z80.string()
|
6844
6842
|
}),
|
6845
6843
|
401: DefaultUnauthorizedSchema,
|
6846
6844
|
500: DefaultErrorResponseSchema
|
@@ -6853,10 +6851,10 @@ var ticketContract = initContract26().router(
|
|
6853
6851
|
body: TicketReasonRequiredSchema,
|
6854
6852
|
responses: {
|
6855
6853
|
200: DefaultSuccessResponseSchema.extend({
|
6856
|
-
ticketReasonRequired:
|
6854
|
+
ticketReasonRequired: z80.string()
|
6857
6855
|
}),
|
6858
|
-
400:
|
6859
|
-
message:
|
6856
|
+
400: z80.object({
|
6857
|
+
message: z80.string()
|
6860
6858
|
}),
|
6861
6859
|
401: DefaultUnauthorizedSchema,
|
6862
6860
|
500: DefaultErrorResponseSchema
|
@@ -6868,24 +6866,24 @@ var ticketContract = initContract26().router(
|
|
6868
6866
|
|
6869
6867
|
// src/user/index.ts
|
6870
6868
|
import { initContract as initContract27 } from "@ts-rest/core";
|
6871
|
-
import
|
6869
|
+
import z82 from "zod";
|
6872
6870
|
|
6873
6871
|
// src/user/validation.ts
|
6874
|
-
import { z as
|
6875
|
-
var CreateUserSchema =
|
6876
|
-
name:
|
6877
|
-
email:
|
6878
|
-
address:
|
6879
|
-
phone:
|
6880
|
-
password:
|
6881
|
-
notificationCount:
|
6882
|
-
roles:
|
6872
|
+
import { z as z81 } from "zod";
|
6873
|
+
var CreateUserSchema = z81.object({
|
6874
|
+
name: z81.string(),
|
6875
|
+
email: z81.string().email(),
|
6876
|
+
address: z81.string().nullable(),
|
6877
|
+
phone: z81.string().nullable(),
|
6878
|
+
password: z81.string(),
|
6879
|
+
notificationCount: z81.number().nullable().optional(),
|
6880
|
+
roles: z81.array(z81.string())
|
6883
6881
|
});
|
6884
6882
|
var UpdateUserSchema = CreateUserSchema.extend({
|
6885
|
-
newPassword:
|
6883
|
+
newPassword: z81.string()
|
6886
6884
|
});
|
6887
|
-
var UpdateUserProfileSchema =
|
6888
|
-
password:
|
6885
|
+
var UpdateUserProfileSchema = z81.object({
|
6886
|
+
password: z81.string()
|
6889
6887
|
});
|
6890
6888
|
|
6891
6889
|
// src/user/index.ts
|
@@ -6900,8 +6898,8 @@ var userContract = initContract27().router(
|
|
6900
6898
|
201: DefaultSuccessResponseSchema.extend({
|
6901
6899
|
user: UserSchema
|
6902
6900
|
}),
|
6903
|
-
400:
|
6904
|
-
message:
|
6901
|
+
400: z82.object({
|
6902
|
+
message: z82.string()
|
6905
6903
|
}),
|
6906
6904
|
401: DefaultUnauthorizedSchema,
|
6907
6905
|
404: DefaultNotFoundSchema,
|
@@ -6914,15 +6912,15 @@ var userContract = initContract27().router(
|
|
6914
6912
|
method: "GET",
|
6915
6913
|
path: "/essential",
|
6916
6914
|
headers: DefaultHeaderSchema,
|
6917
|
-
query:
|
6918
|
-
page:
|
6919
|
-
pageSize:
|
6920
|
-
keyword:
|
6915
|
+
query: z82.object({
|
6916
|
+
page: z82.number().optional(),
|
6917
|
+
pageSize: z82.number().optional(),
|
6918
|
+
keyword: z82.string().optional()
|
6921
6919
|
}).optional(),
|
6922
6920
|
responses: {
|
6923
6921
|
200: WithPagination(EssentialUserSchema),
|
6924
|
-
400:
|
6925
|
-
message:
|
6922
|
+
400: z82.object({
|
6923
|
+
message: z82.string()
|
6926
6924
|
}),
|
6927
6925
|
401: DefaultUnauthorizedSchema,
|
6928
6926
|
500: DefaultErrorResponseSchema
|
@@ -6932,16 +6930,16 @@ var userContract = initContract27().router(
|
|
6932
6930
|
method: "GET",
|
6933
6931
|
path: "",
|
6934
6932
|
headers: DefaultHeaderSchema,
|
6935
|
-
query:
|
6936
|
-
page:
|
6937
|
-
pageSize:
|
6933
|
+
query: z82.object({
|
6934
|
+
page: z82.coerce.number().optional(),
|
6935
|
+
pageSize: z82.coerce.number().optional(),
|
6938
6936
|
// Don't add default 10. In some places, we need to fetch all users.
|
6939
|
-
keyword:
|
6937
|
+
keyword: z82.string().optional(),
|
6940
6938
|
// userIds: z.array(z.string()).optional(),
|
6941
|
-
userIds:
|
6942
|
-
|
6939
|
+
userIds: z82.union([
|
6940
|
+
z82.array(z82.string()),
|
6943
6941
|
// If it's an array
|
6944
|
-
|
6942
|
+
z82.record(z82.string())
|
6945
6943
|
// If it's an object
|
6946
6944
|
]).transform((val) => {
|
6947
6945
|
if (Array.isArray(val)) {
|
@@ -6949,12 +6947,12 @@ var userContract = initContract27().router(
|
|
6949
6947
|
}
|
6950
6948
|
return Object.values(val);
|
6951
6949
|
}).optional(),
|
6952
|
-
withPresenceStatus:
|
6950
|
+
withPresenceStatus: z82.string().transform((val) => val === "true").optional()
|
6953
6951
|
}).optional(),
|
6954
6952
|
responses: {
|
6955
6953
|
200: WithPagination(UserSchema),
|
6956
|
-
400:
|
6957
|
-
message:
|
6954
|
+
400: z82.object({
|
6955
|
+
message: z82.string()
|
6958
6956
|
}),
|
6959
6957
|
401: DefaultUnauthorizedSchema,
|
6960
6958
|
500: DefaultErrorResponseSchema
|
@@ -6964,12 +6962,12 @@ var userContract = initContract27().router(
|
|
6964
6962
|
getUserById: {
|
6965
6963
|
method: "GET",
|
6966
6964
|
path: "/:id",
|
6967
|
-
pathParams:
|
6965
|
+
pathParams: z82.object({ id: z82.string() }),
|
6968
6966
|
headers: DefaultHeaderSchema,
|
6969
6967
|
responses: {
|
6970
6968
|
200: UserSchema,
|
6971
|
-
400:
|
6972
|
-
message:
|
6969
|
+
400: z82.object({
|
6970
|
+
message: z82.string()
|
6973
6971
|
}),
|
6974
6972
|
401: DefaultUnauthorizedSchema
|
6975
6973
|
},
|
@@ -6978,15 +6976,15 @@ var userContract = initContract27().router(
|
|
6978
6976
|
updateUser: {
|
6979
6977
|
method: "PATCH",
|
6980
6978
|
path: "/:id",
|
6981
|
-
pathParams:
|
6979
|
+
pathParams: z82.object({ id: z82.string() }),
|
6982
6980
|
headers: DefaultHeaderSchema,
|
6983
6981
|
body: UpdateUserSchema,
|
6984
6982
|
responses: {
|
6985
6983
|
201: DefaultSuccessResponseSchema.extend({
|
6986
6984
|
user: UserSchema
|
6987
6985
|
}),
|
6988
|
-
400:
|
6989
|
-
message:
|
6986
|
+
400: z82.object({
|
6987
|
+
message: z82.string()
|
6990
6988
|
}),
|
6991
6989
|
401: DefaultUnauthorizedSchema,
|
6992
6990
|
404: DefaultNotFoundSchema,
|
@@ -6998,15 +6996,15 @@ var userContract = initContract27().router(
|
|
6998
6996
|
updateUserProfile: {
|
6999
6997
|
method: "PATCH",
|
7000
6998
|
path: "/profile/:id",
|
7001
|
-
pathParams:
|
6999
|
+
pathParams: z82.object({ id: z82.string() }),
|
7002
7000
|
headers: DefaultHeaderSchema,
|
7003
7001
|
body: UpdateUserProfileSchema,
|
7004
7002
|
responses: {
|
7005
7003
|
201: DefaultSuccessResponseSchema.extend({
|
7006
7004
|
user: UserSchema
|
7007
7005
|
}),
|
7008
|
-
400:
|
7009
|
-
message:
|
7006
|
+
400: z82.object({
|
7007
|
+
message: z82.string()
|
7010
7008
|
}),
|
7011
7009
|
401: DefaultUnauthorizedSchema,
|
7012
7010
|
404: DefaultNotFoundSchema,
|
@@ -7018,11 +7016,11 @@ var userContract = initContract27().router(
|
|
7018
7016
|
deleteUser: {
|
7019
7017
|
method: "DELETE",
|
7020
7018
|
path: "/:id",
|
7021
|
-
pathParams:
|
7019
|
+
pathParams: z82.object({ id: z82.string() }),
|
7022
7020
|
headers: DefaultHeaderSchema,
|
7023
7021
|
body: null,
|
7024
7022
|
responses: {
|
7025
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
7023
|
+
200: DefaultSuccessResponseSchema.extend({ message: z82.string() }),
|
7026
7024
|
404: DefaultNotFoundSchema,
|
7027
7025
|
422: DefaultUnprocessibleSchema,
|
7028
7026
|
500: DefaultErrorResponseSchema
|
@@ -7035,26 +7033,26 @@ var userContract = initContract27().router(
|
|
7035
7033
|
|
7036
7034
|
// src/user-presence-status-log/index.ts
|
7037
7035
|
import { initContract as initContract28 } from "@ts-rest/core";
|
7038
|
-
import
|
7036
|
+
import z85 from "zod";
|
7039
7037
|
|
7040
7038
|
// src/user-presence-status-log/schema.ts
|
7041
|
-
import
|
7039
|
+
import z83 from "zod";
|
7042
7040
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
7043
7041
|
user: UserSchema,
|
7044
7042
|
previousPresenceStatus: PresenceStatusSchema,
|
7045
7043
|
newPresenceStatus: PresenceStatusSchema,
|
7046
|
-
reason:
|
7044
|
+
reason: z83.string()
|
7047
7045
|
});
|
7048
7046
|
|
7049
7047
|
// src/user-presence-status-log/validation.ts
|
7050
|
-
import
|
7051
|
-
var UserPresenceStatusLogParamsSchema =
|
7052
|
-
page:
|
7053
|
-
pageSize:
|
7054
|
-
selectedDate:
|
7048
|
+
import z84 from "zod";
|
7049
|
+
var UserPresenceStatusLogParamsSchema = z84.object({
|
7050
|
+
page: z84.coerce.number().default(1),
|
7051
|
+
pageSize: z84.coerce.number().default(10),
|
7052
|
+
selectedDate: z84.string().optional()
|
7055
7053
|
}).optional();
|
7056
|
-
var UserPresenceStatusLogExportParamsSchema =
|
7057
|
-
selectedDate:
|
7054
|
+
var UserPresenceStatusLogExportParamsSchema = z84.object({
|
7055
|
+
selectedDate: z84.string().optional()
|
7058
7056
|
});
|
7059
7057
|
|
7060
7058
|
// src/user-presence-status-log/index.ts
|
@@ -7067,8 +7065,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7067
7065
|
headers: DefaultHeaderSchema,
|
7068
7066
|
responses: {
|
7069
7067
|
200: WithPagination(UserPresenceStatusLogSchema),
|
7070
|
-
400:
|
7071
|
-
message:
|
7068
|
+
400: z85.object({
|
7069
|
+
message: z85.string()
|
7072
7070
|
}),
|
7073
7071
|
401: DefaultUnauthorizedSchema,
|
7074
7072
|
500: DefaultErrorResponseSchema
|
@@ -7084,8 +7082,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7084
7082
|
headers: DefaultHeaderSchema,
|
7085
7083
|
responses: {
|
7086
7084
|
200: null,
|
7087
|
-
400:
|
7088
|
-
message:
|
7085
|
+
400: z85.object({
|
7086
|
+
message: z85.string()
|
7089
7087
|
}),
|
7090
7088
|
401: DefaultUnauthorizedSchema,
|
7091
7089
|
500: DefaultErrorResponseSchema
|
@@ -7097,67 +7095,67 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7097
7095
|
|
7098
7096
|
// src/widget/index.ts
|
7099
7097
|
import { initContract as initContract29 } from "@ts-rest/core";
|
7100
|
-
import
|
7098
|
+
import z88 from "zod";
|
7101
7099
|
|
7102
7100
|
// src/widget/schema.ts
|
7103
|
-
import
|
7104
|
-
var FieldsSchema =
|
7105
|
-
var WidgetPositionSchema =
|
7106
|
-
|
7107
|
-
|
7108
|
-
|
7109
|
-
|
7110
|
-
|
7101
|
+
import z86 from "zod";
|
7102
|
+
var FieldsSchema = z86.object({ data: z86.array(z86.string()) });
|
7103
|
+
var WidgetPositionSchema = z86.union([
|
7104
|
+
z86.literal("menu"),
|
7105
|
+
z86.literal("ticket_detail"),
|
7106
|
+
z86.literal("contact_detail"),
|
7107
|
+
z86.literal("contact_profile"),
|
7108
|
+
z86.literal("inbox_detail")
|
7111
7109
|
]);
|
7112
|
-
var WidgetTypeSchema =
|
7113
|
-
|
7114
|
-
|
7110
|
+
var WidgetTypeSchema = z86.union([
|
7111
|
+
z86.literal("iframe"),
|
7112
|
+
z86.literal("custom")
|
7115
7113
|
]);
|
7116
|
-
var WidgetHeaderSchema =
|
7117
|
-
key:
|
7118
|
-
value:
|
7114
|
+
var WidgetHeaderSchema = z86.object({
|
7115
|
+
key: z86.string(),
|
7116
|
+
value: z86.string()
|
7119
7117
|
});
|
7120
|
-
var WidgetMethodSchema =
|
7121
|
-
|
7122
|
-
|
7118
|
+
var WidgetMethodSchema = z86.union([
|
7119
|
+
z86.literal("get"),
|
7120
|
+
z86.literal("post")
|
7123
7121
|
]);
|
7124
7122
|
var WidgetSchema = DefaultEntitySchema.extend({
|
7125
|
-
name:
|
7126
|
-
description:
|
7123
|
+
name: z86.string(),
|
7124
|
+
description: z86.string().nullable(),
|
7127
7125
|
position: WidgetPositionSchema,
|
7128
7126
|
fields: FieldsSchema,
|
7129
|
-
url:
|
7127
|
+
url: z86.string(),
|
7130
7128
|
type: WidgetTypeSchema.nullable(),
|
7131
|
-
headers:
|
7129
|
+
headers: z86.array(WidgetHeaderSchema).nullable(),
|
7132
7130
|
method: WidgetMethodSchema.nullable(),
|
7133
|
-
fileKey:
|
7134
|
-
fileUrl:
|
7131
|
+
fileKey: z86.string().nullable(),
|
7132
|
+
fileUrl: z86.string().nullable()
|
7135
7133
|
});
|
7136
7134
|
|
7137
7135
|
// src/widget/validation.ts
|
7138
|
-
import
|
7139
|
-
var CreateWidgetSchema =
|
7140
|
-
name:
|
7141
|
-
description:
|
7142
|
-
url:
|
7136
|
+
import z87 from "zod";
|
7137
|
+
var CreateWidgetSchema = z87.object({
|
7138
|
+
name: z87.string(),
|
7139
|
+
description: z87.string().optional(),
|
7140
|
+
url: z87.string(),
|
7143
7141
|
position: WidgetPositionSchema,
|
7144
|
-
fields:
|
7142
|
+
fields: z87.object({
|
7145
7143
|
data: (
|
7146
7144
|
// Array of attribute system names
|
7147
|
-
|
7145
|
+
z87.array(z87.string())
|
7148
7146
|
)
|
7149
7147
|
}).optional(),
|
7150
7148
|
type: WidgetTypeSchema,
|
7151
|
-
headers:
|
7149
|
+
headers: z87.array(WidgetHeaderSchema).optional(),
|
7152
7150
|
method: WidgetMethodSchema.optional(),
|
7153
|
-
fileKey:
|
7151
|
+
fileKey: z87.string().nullable()
|
7154
7152
|
});
|
7155
7153
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
7156
|
-
var GetWidgetUrlPathQuerySchema =
|
7157
|
-
widgetId:
|
7154
|
+
var GetWidgetUrlPathQuerySchema = z87.object({
|
7155
|
+
widgetId: z87.string(),
|
7158
7156
|
// Position ID is ticket ID, contact ID, etc.
|
7159
7157
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
7160
|
-
positionId:
|
7158
|
+
positionId: z87.string()
|
7161
7159
|
});
|
7162
7160
|
|
7163
7161
|
// src/widget/index.ts
|
@@ -7172,8 +7170,8 @@ var widgetContract = initContract29().router(
|
|
7172
7170
|
201: DefaultSuccessResponseSchema.extend({
|
7173
7171
|
widget: WidgetSchema
|
7174
7172
|
}),
|
7175
|
-
400:
|
7176
|
-
message:
|
7173
|
+
400: z88.object({
|
7174
|
+
message: z88.string()
|
7177
7175
|
}),
|
7178
7176
|
401: DefaultUnauthorizedSchema,
|
7179
7177
|
500: DefaultErrorResponseSchema
|
@@ -7183,17 +7181,17 @@ var widgetContract = initContract29().router(
|
|
7183
7181
|
getWidgets: {
|
7184
7182
|
method: "GET",
|
7185
7183
|
path: "",
|
7186
|
-
query:
|
7187
|
-
page:
|
7188
|
-
pageSize:
|
7189
|
-
keyword:
|
7184
|
+
query: z88.object({
|
7185
|
+
page: z88.coerce.number().default(1),
|
7186
|
+
pageSize: z88.coerce.number().default(10),
|
7187
|
+
keyword: z88.coerce.string().optional()
|
7190
7188
|
}).optional(),
|
7191
7189
|
headers: DefaultHeaderSchema,
|
7192
7190
|
responses: {
|
7193
7191
|
200: WithPagination(WidgetSchema),
|
7194
7192
|
500: DefaultErrorResponseSchema,
|
7195
|
-
400:
|
7196
|
-
message:
|
7193
|
+
400: z88.object({
|
7194
|
+
message: z88.string()
|
7197
7195
|
}),
|
7198
7196
|
401: DefaultUnauthorizedSchema
|
7199
7197
|
},
|
@@ -7204,9 +7202,9 @@ var widgetContract = initContract29().router(
|
|
7204
7202
|
path: "/menu",
|
7205
7203
|
headers: DefaultHeaderSchema,
|
7206
7204
|
responses: {
|
7207
|
-
200:
|
7208
|
-
400:
|
7209
|
-
message:
|
7205
|
+
200: z88.array(WidgetSchema),
|
7206
|
+
400: z88.object({
|
7207
|
+
message: z88.string()
|
7210
7208
|
}),
|
7211
7209
|
401: DefaultUnauthorizedSchema,
|
7212
7210
|
500: DefaultErrorResponseSchema
|
@@ -7218,9 +7216,9 @@ var widgetContract = initContract29().router(
|
|
7218
7216
|
path: "/ticket_detail",
|
7219
7217
|
headers: DefaultHeaderSchema,
|
7220
7218
|
responses: {
|
7221
|
-
200:
|
7222
|
-
400:
|
7223
|
-
message:
|
7219
|
+
200: z88.array(WidgetSchema),
|
7220
|
+
400: z88.object({
|
7221
|
+
message: z88.string()
|
7224
7222
|
}),
|
7225
7223
|
401: DefaultUnauthorizedSchema,
|
7226
7224
|
500: DefaultErrorResponseSchema
|
@@ -7232,9 +7230,9 @@ var widgetContract = initContract29().router(
|
|
7232
7230
|
path: "/contact_detail",
|
7233
7231
|
headers: DefaultHeaderSchema,
|
7234
7232
|
responses: {
|
7235
|
-
200:
|
7236
|
-
400:
|
7237
|
-
message:
|
7233
|
+
200: z88.array(WidgetSchema),
|
7234
|
+
400: z88.object({
|
7235
|
+
message: z88.string()
|
7238
7236
|
}),
|
7239
7237
|
401: DefaultUnauthorizedSchema,
|
7240
7238
|
500: DefaultErrorResponseSchema
|
@@ -7246,9 +7244,9 @@ var widgetContract = initContract29().router(
|
|
7246
7244
|
path: "/contact_profile",
|
7247
7245
|
headers: DefaultHeaderSchema,
|
7248
7246
|
responses: {
|
7249
|
-
200:
|
7250
|
-
400:
|
7251
|
-
message:
|
7247
|
+
200: z88.array(WidgetSchema),
|
7248
|
+
400: z88.object({
|
7249
|
+
message: z88.string()
|
7252
7250
|
}),
|
7253
7251
|
401: DefaultUnauthorizedSchema,
|
7254
7252
|
500: DefaultErrorResponseSchema
|
@@ -7260,9 +7258,9 @@ var widgetContract = initContract29().router(
|
|
7260
7258
|
path: "/inbox_detail",
|
7261
7259
|
headers: DefaultHeaderSchema,
|
7262
7260
|
responses: {
|
7263
|
-
200:
|
7264
|
-
400:
|
7265
|
-
message:
|
7261
|
+
200: z88.array(WidgetSchema),
|
7262
|
+
400: z88.object({
|
7263
|
+
message: z88.string()
|
7266
7264
|
}),
|
7267
7265
|
401: DefaultUnauthorizedSchema,
|
7268
7266
|
500: DefaultErrorResponseSchema
|
@@ -7272,12 +7270,12 @@ var widgetContract = initContract29().router(
|
|
7272
7270
|
getWidgetById: {
|
7273
7271
|
method: "GET",
|
7274
7272
|
path: "/:id",
|
7275
|
-
pathParams:
|
7273
|
+
pathParams: z88.object({ id: z88.string() }),
|
7276
7274
|
headers: DefaultHeaderSchema,
|
7277
7275
|
responses: {
|
7278
7276
|
200: WidgetSchema,
|
7279
|
-
400:
|
7280
|
-
message:
|
7277
|
+
400: z88.object({
|
7278
|
+
message: z88.string()
|
7281
7279
|
}),
|
7282
7280
|
401: DefaultUnauthorizedSchema,
|
7283
7281
|
500: DefaultErrorResponseSchema
|
@@ -7291,14 +7289,14 @@ var widgetContract = initContract29().router(
|
|
7291
7289
|
headers: DefaultHeaderSchema,
|
7292
7290
|
responses: {
|
7293
7291
|
201: DefaultSuccessResponseSchema.extend({
|
7294
|
-
widget:
|
7295
|
-
token:
|
7296
|
-
headers:
|
7297
|
-
url:
|
7292
|
+
widget: z88.object({
|
7293
|
+
token: z88.string().nullable(),
|
7294
|
+
headers: z88.array(WidgetHeaderSchema),
|
7295
|
+
url: z88.string()
|
7298
7296
|
})
|
7299
7297
|
}),
|
7300
|
-
400:
|
7301
|
-
message:
|
7298
|
+
400: z88.object({
|
7299
|
+
message: z88.string()
|
7302
7300
|
}),
|
7303
7301
|
401: DefaultUnauthorizedSchema
|
7304
7302
|
},
|
@@ -7307,14 +7305,14 @@ var widgetContract = initContract29().router(
|
|
7307
7305
|
updateWidget: {
|
7308
7306
|
method: "PATCH",
|
7309
7307
|
path: "/:id",
|
7310
|
-
pathParams:
|
7308
|
+
pathParams: z88.object({ id: z88.string() }),
|
7311
7309
|
headers: DefaultHeaderSchema,
|
7312
7310
|
responses: {
|
7313
7311
|
201: DefaultSuccessResponseSchema.extend({
|
7314
7312
|
widget: WidgetSchema
|
7315
7313
|
}),
|
7316
|
-
400:
|
7317
|
-
message:
|
7314
|
+
400: z88.object({
|
7315
|
+
message: z88.string()
|
7318
7316
|
}),
|
7319
7317
|
401: DefaultUnauthorizedSchema
|
7320
7318
|
},
|
@@ -7324,11 +7322,11 @@ var widgetContract = initContract29().router(
|
|
7324
7322
|
deleteWidget: {
|
7325
7323
|
method: "DELETE",
|
7326
7324
|
path: "/:id",
|
7327
|
-
pathParams:
|
7325
|
+
pathParams: z88.object({ id: z88.string() }),
|
7328
7326
|
headers: DefaultHeaderSchema,
|
7329
7327
|
body: null,
|
7330
7328
|
responses: {
|
7331
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
7329
|
+
200: DefaultSuccessResponseSchema.extend({ message: z88.string() }),
|
7332
7330
|
500: DefaultErrorResponseSchema
|
7333
7331
|
},
|
7334
7332
|
summary: "Delete a widget."
|
@@ -7339,35 +7337,35 @@ var widgetContract = initContract29().router(
|
|
7339
7337
|
|
7340
7338
|
// src/wrap-up-form/index.ts
|
7341
7339
|
import { initContract as initContract30 } from "@ts-rest/core";
|
7342
|
-
import
|
7340
|
+
import z90 from "zod";
|
7343
7341
|
|
7344
7342
|
// src/wrap-up-form/validation.ts
|
7345
|
-
import { z as
|
7346
|
-
var CreateWrapUpFormSchema =
|
7347
|
-
note:
|
7348
|
-
disposition:
|
7349
|
-
callFrom:
|
7350
|
-
callTo:
|
7343
|
+
import { z as z89 } from "zod";
|
7344
|
+
var CreateWrapUpFormSchema = z89.object({
|
7345
|
+
note: z89.string().nullable().optional(),
|
7346
|
+
disposition: z89.string().nullable().optional(),
|
7347
|
+
callFrom: z89.string().nullable().optional(),
|
7348
|
+
callTo: z89.string().nullable().optional()
|
7351
7349
|
});
|
7352
7350
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
7353
|
-
cxLogId:
|
7354
|
-
type:
|
7355
|
-
tags:
|
7356
|
-
categoryIds:
|
7357
|
-
customFields:
|
7358
|
-
|
7359
|
-
id:
|
7360
|
-
type:
|
7361
|
-
value:
|
7351
|
+
cxLogId: z89.string().uuid().optional(),
|
7352
|
+
type: z89.string().optional(),
|
7353
|
+
tags: z89.array(z89.string()).optional(),
|
7354
|
+
categoryIds: z89.array(z89.string().uuid()).optional(),
|
7355
|
+
customFields: z89.array(
|
7356
|
+
z89.object({
|
7357
|
+
id: z89.string().uuid(),
|
7358
|
+
type: z89.string(),
|
7359
|
+
value: z89.string()
|
7362
7360
|
})
|
7363
7361
|
).optional(),
|
7364
|
-
durationSeconds:
|
7362
|
+
durationSeconds: z89.number().optional()
|
7365
7363
|
});
|
7366
|
-
var CreateCXLogWrapUpFormSchema =
|
7367
|
-
cxLogId:
|
7368
|
-
disposition:
|
7369
|
-
tagIds:
|
7370
|
-
note:
|
7364
|
+
var CreateCXLogWrapUpFormSchema = z89.object({
|
7365
|
+
cxLogId: z89.string().uuid(),
|
7366
|
+
disposition: z89.string().optional(),
|
7367
|
+
tagIds: z89.array(z89.string().uuid()).optional(),
|
7368
|
+
note: z89.string().optional()
|
7371
7369
|
});
|
7372
7370
|
|
7373
7371
|
// src/wrap-up-form/index.ts
|
@@ -7379,10 +7377,10 @@ var wrapUpFormContract = initContract30().router(
|
|
7379
7377
|
headers: DefaultHeaderSchema,
|
7380
7378
|
responses: {
|
7381
7379
|
200: DefaultSuccessResponseSchema.extend({
|
7382
|
-
wrapUpFormTimer:
|
7380
|
+
wrapUpFormTimer: z90.number()
|
7383
7381
|
}),
|
7384
|
-
400:
|
7385
|
-
message:
|
7382
|
+
400: z90.object({
|
7383
|
+
message: z90.string()
|
7386
7384
|
}),
|
7387
7385
|
401: DefaultUnauthorizedSchema,
|
7388
7386
|
500: DefaultErrorResponseSchema
|
@@ -7391,14 +7389,14 @@ var wrapUpFormContract = initContract30().router(
|
|
7391
7389
|
updateWrapUpFormTimer: {
|
7392
7390
|
method: "PATCH",
|
7393
7391
|
path: "/timer",
|
7394
|
-
body:
|
7392
|
+
body: z90.object({ newWrapUpFormTimer: z90.number().positive() }),
|
7395
7393
|
headers: DefaultHeaderSchema,
|
7396
7394
|
responses: {
|
7397
7395
|
200: DefaultSuccessResponseSchema.extend({
|
7398
|
-
wrapUpFormTimer:
|
7396
|
+
wrapUpFormTimer: z90.number()
|
7399
7397
|
}),
|
7400
|
-
400:
|
7401
|
-
message:
|
7398
|
+
400: z90.object({
|
7399
|
+
message: z90.string()
|
7402
7400
|
}),
|
7403
7401
|
401: DefaultUnauthorizedSchema,
|
7404
7402
|
500: DefaultErrorResponseSchema
|
@@ -7413,8 +7411,8 @@ var wrapUpFormContract = initContract30().router(
|
|
7413
7411
|
201: DefaultSuccessResponseSchema.extend({
|
7414
7412
|
wrapUpForm: WrapUpFormSchema
|
7415
7413
|
}),
|
7416
|
-
400:
|
7417
|
-
message:
|
7414
|
+
400: z90.object({
|
7415
|
+
message: z90.string()
|
7418
7416
|
}),
|
7419
7417
|
401: DefaultUnauthorizedSchema,
|
7420
7418
|
500: DefaultErrorResponseSchema
|
@@ -7436,15 +7434,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7436
7434
|
getWrapUpForms: {
|
7437
7435
|
method: "GET",
|
7438
7436
|
path: "",
|
7439
|
-
query:
|
7440
|
-
page:
|
7441
|
-
pageSize:
|
7437
|
+
query: z90.object({
|
7438
|
+
page: z90.coerce.number().default(1),
|
7439
|
+
pageSize: z90.coerce.number().default(10)
|
7442
7440
|
}).optional(),
|
7443
7441
|
headers: DefaultHeaderSchema,
|
7444
7442
|
responses: {
|
7445
7443
|
200: WithPagination(WrapUpFormSchema),
|
7446
|
-
400:
|
7447
|
-
message:
|
7444
|
+
400: z90.object({
|
7445
|
+
message: z90.string()
|
7448
7446
|
}),
|
7449
7447
|
401: DefaultUnauthorizedSchema,
|
7450
7448
|
500: DefaultErrorResponseSchema
|
@@ -7454,12 +7452,12 @@ var wrapUpFormContract = initContract30().router(
|
|
7454
7452
|
getWrapUpForm: {
|
7455
7453
|
method: "GET",
|
7456
7454
|
path: "/:id",
|
7457
|
-
pathParams:
|
7455
|
+
pathParams: z90.object({ id: z90.string() }),
|
7458
7456
|
headers: DefaultHeaderSchema,
|
7459
7457
|
responses: {
|
7460
7458
|
200: WrapUpFormSchema,
|
7461
|
-
400:
|
7462
|
-
message:
|
7459
|
+
400: z90.object({
|
7460
|
+
message: z90.string()
|
7463
7461
|
}),
|
7464
7462
|
401: DefaultUnauthorizedSchema,
|
7465
7463
|
500: DefaultErrorResponseSchema
|
@@ -7468,15 +7466,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7468
7466
|
updateWrapUpForm: {
|
7469
7467
|
method: "PATCH",
|
7470
7468
|
path: "/:id",
|
7471
|
-
pathParams:
|
7469
|
+
pathParams: z90.object({ id: z90.string() }),
|
7472
7470
|
headers: DefaultHeaderSchema,
|
7473
7471
|
body: UpdateWrapUpFormSchema,
|
7474
7472
|
responses: {
|
7475
7473
|
201: DefaultSuccessResponseSchema.extend({
|
7476
7474
|
wrapUpForm: WrapUpFormSchema
|
7477
7475
|
}),
|
7478
|
-
400:
|
7479
|
-
message:
|
7476
|
+
400: z90.object({
|
7477
|
+
message: z90.string()
|
7480
7478
|
}),
|
7481
7479
|
401: DefaultUnauthorizedSchema,
|
7482
7480
|
500: DefaultErrorResponseSchema
|
@@ -7489,28 +7487,28 @@ var wrapUpFormContract = initContract30().router(
|
|
7489
7487
|
|
7490
7488
|
// src/upload/index.ts
|
7491
7489
|
import { initContract as initContract31 } from "@ts-rest/core";
|
7492
|
-
import
|
7490
|
+
import z91 from "zod";
|
7493
7491
|
var uploadContract = initContract31().router(
|
7494
7492
|
{
|
7495
7493
|
rename: {
|
7496
7494
|
method: "POST",
|
7497
7495
|
path: "/:id/rename",
|
7498
|
-
pathParams:
|
7499
|
-
id:
|
7496
|
+
pathParams: z91.object({
|
7497
|
+
id: z91.string()
|
7500
7498
|
}),
|
7501
7499
|
headers: DefaultHeaderSchema,
|
7502
7500
|
responses: {
|
7503
7501
|
201: DefaultSuccessResponseSchema.extend({
|
7504
|
-
message:
|
7502
|
+
message: z91.string()
|
7505
7503
|
}),
|
7506
|
-
400:
|
7507
|
-
message:
|
7504
|
+
400: z91.object({
|
7505
|
+
message: z91.string()
|
7508
7506
|
}),
|
7509
|
-
409:
|
7510
|
-
message:
|
7507
|
+
409: z91.object({
|
7508
|
+
message: z91.string()
|
7511
7509
|
}),
|
7512
|
-
500:
|
7513
|
-
message:
|
7510
|
+
500: z91.object({
|
7511
|
+
message: z91.string()
|
7514
7512
|
}),
|
7515
7513
|
401: DefaultUnauthorizedSchema,
|
7516
7514
|
404: DefaultNotFoundSchema,
|
@@ -7522,23 +7520,23 @@ var uploadContract = initContract31().router(
|
|
7522
7520
|
delete: {
|
7523
7521
|
method: "DELETE",
|
7524
7522
|
path: "/:id",
|
7525
|
-
pathParams:
|
7526
|
-
id:
|
7523
|
+
pathParams: z91.object({
|
7524
|
+
id: z91.string()
|
7527
7525
|
}),
|
7528
7526
|
headers: DefaultHeaderSchema,
|
7529
7527
|
body: null,
|
7530
7528
|
responses: {
|
7531
7529
|
201: DefaultSuccessResponseSchema.extend({
|
7532
|
-
message:
|
7530
|
+
message: z91.string()
|
7533
7531
|
}),
|
7534
|
-
400:
|
7535
|
-
message:
|
7532
|
+
400: z91.object({
|
7533
|
+
message: z91.string()
|
7536
7534
|
}),
|
7537
|
-
409:
|
7538
|
-
message:
|
7535
|
+
409: z91.object({
|
7536
|
+
message: z91.string()
|
7539
7537
|
}),
|
7540
|
-
500:
|
7541
|
-
message:
|
7538
|
+
500: z91.object({
|
7539
|
+
message: z91.string()
|
7542
7540
|
}),
|
7543
7541
|
401: DefaultUnauthorizedSchema,
|
7544
7542
|
404: DefaultNotFoundSchema,
|
@@ -7553,19 +7551,19 @@ var uploadContract = initContract31().router(
|
|
7553
7551
|
);
|
7554
7552
|
|
7555
7553
|
// src/viber/index.ts
|
7556
|
-
import
|
7554
|
+
import z93 from "zod";
|
7557
7555
|
|
7558
7556
|
// src/viber/validation.ts
|
7559
|
-
import
|
7560
|
-
var ViberChannelSchema =
|
7561
|
-
name:
|
7562
|
-
accessToken:
|
7563
|
-
actor:
|
7564
|
-
id:
|
7565
|
-
name:
|
7566
|
-
email:
|
7567
|
-
address:
|
7568
|
-
phone:
|
7557
|
+
import z92 from "zod";
|
7558
|
+
var ViberChannelSchema = z92.object({
|
7559
|
+
name: z92.string(),
|
7560
|
+
accessToken: z92.string(),
|
7561
|
+
actor: z92.object({
|
7562
|
+
id: z92.string().uuid(),
|
7563
|
+
name: z92.string(),
|
7564
|
+
email: z92.string().email(),
|
7565
|
+
address: z92.string().nullable(),
|
7566
|
+
phone: z92.string().nullable()
|
7569
7567
|
}).optional()
|
7570
7568
|
});
|
7571
7569
|
|
@@ -7594,8 +7592,8 @@ var viberContract = initContract32().router({
|
|
7594
7592
|
}),
|
7595
7593
|
400: DefaultErrorResponseSchema
|
7596
7594
|
},
|
7597
|
-
body:
|
7598
|
-
id:
|
7595
|
+
body: z93.object({
|
7596
|
+
id: z93.string().uuid()
|
7599
7597
|
}),
|
7600
7598
|
summary: "Connect viber channel"
|
7601
7599
|
},
|
@@ -7611,8 +7609,8 @@ var viberContract = initContract32().router({
|
|
7611
7609
|
reconnect: {
|
7612
7610
|
method: "POST",
|
7613
7611
|
path: "/reconnect/:channelId",
|
7614
|
-
pathParams:
|
7615
|
-
channelId:
|
7612
|
+
pathParams: z93.object({
|
7613
|
+
channelId: z93.string().uuid()
|
7616
7614
|
}),
|
7617
7615
|
responses: {
|
7618
7616
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7627,8 +7625,8 @@ var viberContract = initContract32().router({
|
|
7627
7625
|
delete: {
|
7628
7626
|
method: "DELETE",
|
7629
7627
|
path: "/delete/:channelId",
|
7630
|
-
pathParams:
|
7631
|
-
channelId:
|
7628
|
+
pathParams: z93.object({
|
7629
|
+
channelId: z93.string().uuid()
|
7632
7630
|
}),
|
7633
7631
|
body: null,
|
7634
7632
|
responses: {
|
@@ -7640,21 +7638,21 @@ var viberContract = initContract32().router({
|
|
7640
7638
|
});
|
7641
7639
|
|
7642
7640
|
// src/telegram/index.ts
|
7643
|
-
import
|
7641
|
+
import z95 from "zod";
|
7644
7642
|
import { initContract as initContract33 } from "@ts-rest/core";
|
7645
7643
|
|
7646
7644
|
// src/telegram/validation.ts
|
7647
|
-
import
|
7648
|
-
var TelegramChannelSchema =
|
7649
|
-
name:
|
7645
|
+
import z94 from "zod";
|
7646
|
+
var TelegramChannelSchema = z94.object({
|
7647
|
+
name: z94.string(),
|
7650
7648
|
// Telegram bot access token
|
7651
|
-
accessToken:
|
7652
|
-
actor:
|
7653
|
-
id:
|
7654
|
-
name:
|
7655
|
-
email:
|
7656
|
-
address:
|
7657
|
-
phone:
|
7649
|
+
accessToken: z94.string(),
|
7650
|
+
actor: z94.object({
|
7651
|
+
id: z94.string().uuid(),
|
7652
|
+
name: z94.string(),
|
7653
|
+
email: z94.string().email(),
|
7654
|
+
address: z94.string().nullable(),
|
7655
|
+
phone: z94.string().nullable()
|
7658
7656
|
}).optional()
|
7659
7657
|
});
|
7660
7658
|
|
@@ -7681,8 +7679,8 @@ var telegramContract = initContract33().router({
|
|
7681
7679
|
500: DefaultErrorResponseSchema,
|
7682
7680
|
400: DefaultErrorResponseSchema
|
7683
7681
|
},
|
7684
|
-
body:
|
7685
|
-
id:
|
7682
|
+
body: z95.object({
|
7683
|
+
id: z95.string().uuid()
|
7686
7684
|
}),
|
7687
7685
|
summary: "Disconnect telegram channel"
|
7688
7686
|
},
|
@@ -7698,8 +7696,8 @@ var telegramContract = initContract33().router({
|
|
7698
7696
|
reconnect: {
|
7699
7697
|
method: "POST",
|
7700
7698
|
path: "/reconnect/:channelId",
|
7701
|
-
pathParams:
|
7702
|
-
channelId:
|
7699
|
+
pathParams: z95.object({
|
7700
|
+
channelId: z95.string().uuid()
|
7703
7701
|
}),
|
7704
7702
|
body: null,
|
7705
7703
|
responses: {
|
@@ -7712,8 +7710,8 @@ var telegramContract = initContract33().router({
|
|
7712
7710
|
delete: {
|
7713
7711
|
method: "DELETE",
|
7714
7712
|
path: "/delete/:channelId",
|
7715
|
-
pathParams:
|
7716
|
-
channelId:
|
7713
|
+
pathParams: z95.object({
|
7714
|
+
channelId: z95.string().uuid()
|
7717
7715
|
}),
|
7718
7716
|
body: null,
|
7719
7717
|
responses: {
|
@@ -7727,58 +7725,58 @@ var telegramContract = initContract33().router({
|
|
7727
7725
|
|
7728
7726
|
// src/notification/index.ts
|
7729
7727
|
import { initContract as initContract34 } from "@ts-rest/core";
|
7730
|
-
import
|
7728
|
+
import z98 from "zod";
|
7731
7729
|
|
7732
7730
|
// src/notification/validation.ts
|
7733
|
-
import
|
7731
|
+
import z97 from "zod";
|
7734
7732
|
|
7735
7733
|
// src/notification/schema.ts
|
7736
|
-
import
|
7737
|
-
var NotificationChangeSchema =
|
7738
|
-
id:
|
7739
|
-
createdAt:
|
7740
|
-
updatedAt:
|
7741
|
-
deletedAt:
|
7742
|
-
actorId:
|
7734
|
+
import z96 from "zod";
|
7735
|
+
var NotificationChangeSchema = z96.object({
|
7736
|
+
id: z96.string().uuid(),
|
7737
|
+
createdAt: z96.date(),
|
7738
|
+
updatedAt: z96.date(),
|
7739
|
+
deletedAt: z96.date().nullable(),
|
7740
|
+
actorId: z96.string().uuid(),
|
7743
7741
|
actor: UserSchema,
|
7744
|
-
notificationObjectId:
|
7745
|
-
readAt:
|
7746
|
-
});
|
7747
|
-
var NotificationObjectSchema =
|
7748
|
-
id:
|
7749
|
-
createdAt:
|
7750
|
-
updatedAt:
|
7751
|
-
deletedAt:
|
7752
|
-
data:
|
7742
|
+
notificationObjectId: z96.string().uuid(),
|
7743
|
+
readAt: z96.date()
|
7744
|
+
});
|
7745
|
+
var NotificationObjectSchema = z96.object({
|
7746
|
+
id: z96.string().uuid(),
|
7747
|
+
createdAt: z96.date(),
|
7748
|
+
updatedAt: z96.date(),
|
7749
|
+
deletedAt: z96.date().nullable(),
|
7750
|
+
data: z96.string(),
|
7753
7751
|
notificationChange: NotificationChangeSchema
|
7754
7752
|
});
|
7755
|
-
var NotificationSchema =
|
7756
|
-
id:
|
7757
|
-
createdAt:
|
7758
|
-
updatedAt:
|
7759
|
-
deletedAt:
|
7760
|
-
notificationObjectId:
|
7761
|
-
notifierId:
|
7753
|
+
var NotificationSchema = z96.object({
|
7754
|
+
id: z96.string().uuid(),
|
7755
|
+
createdAt: z96.date(),
|
7756
|
+
updatedAt: z96.date(),
|
7757
|
+
deletedAt: z96.date().nullable(),
|
7758
|
+
notificationObjectId: z96.string().uuid(),
|
7759
|
+
notifierId: z96.string().uuid(),
|
7762
7760
|
notificationObject: NotificationObjectSchema,
|
7763
|
-
readAt:
|
7761
|
+
readAt: z96.date()
|
7764
7762
|
});
|
7765
7763
|
|
7766
7764
|
// src/notification/validation.ts
|
7767
|
-
var GetNotificationsRequestSchema =
|
7768
|
-
page:
|
7769
|
-
pageSize:
|
7765
|
+
var GetNotificationsRequestSchema = z97.object({
|
7766
|
+
page: z97.coerce.number().default(1),
|
7767
|
+
pageSize: z97.coerce.number().default(10)
|
7770
7768
|
});
|
7771
|
-
var GetNotificationsResponseSchema =
|
7772
|
-
notificationCount:
|
7773
|
-
notifications:
|
7774
|
-
total:
|
7775
|
-
page:
|
7776
|
-
pageSize:
|
7777
|
-
lastPage:
|
7778
|
-
totalUnreadCount:
|
7769
|
+
var GetNotificationsResponseSchema = z97.object({
|
7770
|
+
notificationCount: z97.number(),
|
7771
|
+
notifications: z97.array(NotificationSchema),
|
7772
|
+
total: z97.number(),
|
7773
|
+
page: z97.number(),
|
7774
|
+
pageSize: z97.number(),
|
7775
|
+
lastPage: z97.number(),
|
7776
|
+
totalUnreadCount: z97.number().optional()
|
7779
7777
|
});
|
7780
|
-
var ResetNotificationRequestSchema =
|
7781
|
-
userId:
|
7778
|
+
var ResetNotificationRequestSchema = z97.object({
|
7779
|
+
userId: z97.string()
|
7782
7780
|
});
|
7783
7781
|
|
7784
7782
|
// src/notification/index.ts
|
@@ -7792,14 +7790,14 @@ var userNotificationContract = initContract34().router(
|
|
7792
7790
|
200: DefaultSuccessResponseSchema.extend({
|
7793
7791
|
data: GetNotificationsResponseSchema
|
7794
7792
|
}),
|
7795
|
-
400:
|
7796
|
-
message:
|
7793
|
+
400: z98.object({
|
7794
|
+
message: z98.string()
|
7797
7795
|
}),
|
7798
|
-
409:
|
7799
|
-
message:
|
7796
|
+
409: z98.object({
|
7797
|
+
message: z98.string()
|
7800
7798
|
}),
|
7801
|
-
500:
|
7802
|
-
message:
|
7799
|
+
500: z98.object({
|
7800
|
+
message: z98.string()
|
7803
7801
|
}),
|
7804
7802
|
401: DefaultUnauthorizedSchema,
|
7805
7803
|
404: DefaultNotFoundSchema,
|
@@ -7812,16 +7810,16 @@ var userNotificationContract = initContract34().router(
|
|
7812
7810
|
path: "/new_notifications_count",
|
7813
7811
|
responses: {
|
7814
7812
|
200: DefaultSuccessResponseSchema.extend({
|
7815
|
-
total:
|
7813
|
+
total: z98.number()
|
7816
7814
|
}),
|
7817
|
-
400:
|
7818
|
-
message:
|
7815
|
+
400: z98.object({
|
7816
|
+
message: z98.string()
|
7819
7817
|
}),
|
7820
|
-
409:
|
7821
|
-
message:
|
7818
|
+
409: z98.object({
|
7819
|
+
message: z98.string()
|
7822
7820
|
}),
|
7823
|
-
500:
|
7824
|
-
message:
|
7821
|
+
500: z98.object({
|
7822
|
+
message: z98.string()
|
7825
7823
|
}),
|
7826
7824
|
401: DefaultUnauthorizedSchema,
|
7827
7825
|
404: DefaultNotFoundSchema,
|
@@ -7836,14 +7834,14 @@ var userNotificationContract = initContract34().router(
|
|
7836
7834
|
201: DefaultSuccessResponseSchema.extend({
|
7837
7835
|
data: UserSchema
|
7838
7836
|
}),
|
7839
|
-
400:
|
7840
|
-
message:
|
7837
|
+
400: z98.object({
|
7838
|
+
message: z98.string()
|
7841
7839
|
}),
|
7842
|
-
409:
|
7843
|
-
message:
|
7840
|
+
409: z98.object({
|
7841
|
+
message: z98.string()
|
7844
7842
|
}),
|
7845
|
-
500:
|
7846
|
-
message:
|
7843
|
+
500: z98.object({
|
7844
|
+
message: z98.string()
|
7847
7845
|
}),
|
7848
7846
|
401: DefaultUnauthorizedSchema,
|
7849
7847
|
404: DefaultNotFoundSchema,
|
@@ -7855,19 +7853,19 @@ var userNotificationContract = initContract34().router(
|
|
7855
7853
|
readNotification: {
|
7856
7854
|
method: "POST",
|
7857
7855
|
path: "/read/:id",
|
7858
|
-
pathParams:
|
7856
|
+
pathParams: z98.object({ id: z98.string() }),
|
7859
7857
|
responses: {
|
7860
7858
|
201: DefaultSuccessResponseSchema.extend({
|
7861
7859
|
data: NotificationSchema
|
7862
7860
|
}),
|
7863
|
-
400:
|
7864
|
-
message:
|
7861
|
+
400: z98.object({
|
7862
|
+
message: z98.string()
|
7865
7863
|
}),
|
7866
|
-
409:
|
7867
|
-
message:
|
7864
|
+
409: z98.object({
|
7865
|
+
message: z98.string()
|
7868
7866
|
}),
|
7869
|
-
500:
|
7870
|
-
message:
|
7867
|
+
500: z98.object({
|
7868
|
+
message: z98.string()
|
7871
7869
|
}),
|
7872
7870
|
401: DefaultUnauthorizedSchema,
|
7873
7871
|
404: DefaultNotFoundSchema,
|
@@ -7884,63 +7882,63 @@ var userNotificationContract = initContract34().router(
|
|
7884
7882
|
|
7885
7883
|
// src/snippet/index.ts
|
7886
7884
|
import { initContract as initContract35 } from "@ts-rest/core";
|
7887
|
-
import { z as
|
7885
|
+
import { z as z101 } from "zod";
|
7888
7886
|
|
7889
7887
|
// src/snippet/schema.ts
|
7890
|
-
import
|
7888
|
+
import z99 from "zod";
|
7891
7889
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7892
|
-
name:
|
7893
|
-
platformType:
|
7890
|
+
name: z99.string(),
|
7891
|
+
platformType: z99.string()
|
7894
7892
|
});
|
7895
7893
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7896
|
-
contentType:
|
7897
|
-
contentValue:
|
7898
|
-
contentTemplate:
|
7899
|
-
order:
|
7894
|
+
contentType: z99.string(),
|
7895
|
+
contentValue: z99.string().nullable(),
|
7896
|
+
contentTemplate: z99.any().nullable(),
|
7897
|
+
order: z99.number(),
|
7900
7898
|
upload: UploadSchema.nullable()
|
7901
7899
|
});
|
7902
7900
|
var SnippetSchema = DefaultEntitySchema.extend({
|
7903
|
-
name:
|
7901
|
+
name: z99.string(),
|
7904
7902
|
snippetGroup: SnippetGroupSchema,
|
7905
7903
|
snippetContent: SnippetContentSchema
|
7906
7904
|
});
|
7907
|
-
var SnippetGroupListItemSchema =
|
7908
|
-
id:
|
7909
|
-
name:
|
7905
|
+
var SnippetGroupListItemSchema = z99.object({
|
7906
|
+
id: z99.string().uuid(),
|
7907
|
+
name: z99.string()
|
7910
7908
|
});
|
7911
|
-
var SnippetListItemSchema =
|
7912
|
-
id:
|
7913
|
-
shortCutName:
|
7914
|
-
contentType:
|
7915
|
-
contentValue:
|
7916
|
-
snippetGroupId:
|
7909
|
+
var SnippetListItemSchema = z99.object({
|
7910
|
+
id: z99.string().uuid(),
|
7911
|
+
shortCutName: z99.string(),
|
7912
|
+
contentType: z99.string(),
|
7913
|
+
contentValue: z99.string().nullable(),
|
7914
|
+
snippetGroupId: z99.string()
|
7917
7915
|
});
|
7918
7916
|
|
7919
7917
|
// src/snippet/validation.ts
|
7920
|
-
import { z as
|
7921
|
-
var CreateSnippetGroupSchema =
|
7922
|
-
name:
|
7923
|
-
platformType:
|
7918
|
+
import { z as z100 } from "zod";
|
7919
|
+
var CreateSnippetGroupSchema = z100.object({
|
7920
|
+
name: z100.string(),
|
7921
|
+
platformType: z100.string()
|
7924
7922
|
});
|
7925
|
-
var UpdateSnippetGroupSchema =
|
7926
|
-
name:
|
7927
|
-
platformType:
|
7923
|
+
var UpdateSnippetGroupSchema = z100.object({
|
7924
|
+
name: z100.string().optional(),
|
7925
|
+
platformType: z100.string().optional()
|
7928
7926
|
});
|
7929
|
-
var DeleteSnippetGroupSchema =
|
7930
|
-
id:
|
7927
|
+
var DeleteSnippetGroupSchema = z100.object({
|
7928
|
+
id: z100.string()
|
7931
7929
|
});
|
7932
|
-
var CreateSnippetSchema =
|
7933
|
-
shortcutName:
|
7934
|
-
contentType:
|
7935
|
-
contentValue:
|
7936
|
-
snippetGroupId:
|
7937
|
-
platformType:
|
7930
|
+
var CreateSnippetSchema = z100.object({
|
7931
|
+
shortcutName: z100.string(),
|
7932
|
+
contentType: z100.string(),
|
7933
|
+
contentValue: z100.string().optional(),
|
7934
|
+
snippetGroupId: z100.string(),
|
7935
|
+
platformType: z100.string()
|
7938
7936
|
});
|
7939
7937
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7940
|
-
snippetContentId:
|
7938
|
+
snippetContentId: z100.string()
|
7941
7939
|
});
|
7942
|
-
var DeleteSnippetSchema =
|
7943
|
-
snippetId:
|
7940
|
+
var DeleteSnippetSchema = z100.object({
|
7941
|
+
snippetId: z100.string()
|
7944
7942
|
});
|
7945
7943
|
|
7946
7944
|
// src/snippet/index.ts
|
@@ -7963,7 +7961,7 @@ var snippetContract = initContract35().router(
|
|
7963
7961
|
query: null,
|
7964
7962
|
responses: {
|
7965
7963
|
200: DefaultSuccessResponseSchema.extend({
|
7966
|
-
snippetgroups:
|
7964
|
+
snippetgroups: z101.array(SnippetGroupSchema)
|
7967
7965
|
}),
|
7968
7966
|
500: DefaultErrorResponseSchema
|
7969
7967
|
}
|
@@ -7971,7 +7969,7 @@ var snippetContract = initContract35().router(
|
|
7971
7969
|
updateSnippetGroup: {
|
7972
7970
|
method: "PATCH",
|
7973
7971
|
path: "/groups/:id",
|
7974
|
-
pathParams:
|
7972
|
+
pathParams: z101.object({ id: z101.string() }),
|
7975
7973
|
body: UpdateSnippetGroupSchema,
|
7976
7974
|
responses: {
|
7977
7975
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7983,7 +7981,7 @@ var snippetContract = initContract35().router(
|
|
7983
7981
|
deleteSnippetGroup: {
|
7984
7982
|
method: "DELETE",
|
7985
7983
|
path: "/groups/:id",
|
7986
|
-
pathParams:
|
7984
|
+
pathParams: z101.object({ id: z101.string() }),
|
7987
7985
|
body: null,
|
7988
7986
|
responses: {
|
7989
7987
|
200: DefaultSuccessResponseSchema,
|
@@ -7995,7 +7993,7 @@ var snippetContract = initContract35().router(
|
|
7995
7993
|
path: "",
|
7996
7994
|
responses: {
|
7997
7995
|
200: DefaultSuccessResponseSchema.extend({
|
7998
|
-
snippets:
|
7996
|
+
snippets: z101.array(SnippetSchema)
|
7999
7997
|
}),
|
8000
7998
|
500: DefaultErrorResponseSchema
|
8001
7999
|
}
|
@@ -8014,7 +8012,7 @@ var snippetContract = initContract35().router(
|
|
8014
8012
|
updateSnippet: {
|
8015
8013
|
method: "PATCH",
|
8016
8014
|
path: "/:id",
|
8017
|
-
pathParams:
|
8015
|
+
pathParams: z101.object({ id: z101.string() }),
|
8018
8016
|
body: UpdateSnippetSchema,
|
8019
8017
|
responses: {
|
8020
8018
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8026,7 +8024,7 @@ var snippetContract = initContract35().router(
|
|
8026
8024
|
deleteSnippet: {
|
8027
8025
|
method: "DELETE",
|
8028
8026
|
path: "/:id",
|
8029
|
-
pathParams:
|
8027
|
+
pathParams: z101.object({ id: z101.string() }),
|
8030
8028
|
body: null,
|
8031
8029
|
responses: {
|
8032
8030
|
200: DefaultSuccessResponseSchema,
|
@@ -8043,77 +8041,77 @@ var snippetContract = initContract35().router(
|
|
8043
8041
|
import { initContract as initContract36 } from "@ts-rest/core";
|
8044
8042
|
|
8045
8043
|
// src/business-calendar/validation.ts
|
8046
|
-
import
|
8047
|
-
var TimeSlotDataSchema =
|
8048
|
-
var CreateBusinessHourSchema =
|
8049
|
-
day:
|
8050
|
-
isEnabled:
|
8044
|
+
import z102 from "zod";
|
8045
|
+
var TimeSlotDataSchema = z102.any();
|
8046
|
+
var CreateBusinessHourSchema = z102.object({
|
8047
|
+
day: z102.string(),
|
8048
|
+
isEnabled: z102.boolean(),
|
8051
8049
|
timeSlots: TimeSlotDataSchema
|
8052
8050
|
}).array();
|
8053
|
-
var UpdateBusinessHourSchema =
|
8054
|
-
id:
|
8055
|
-
day:
|
8056
|
-
isEnabled:
|
8051
|
+
var UpdateBusinessHourSchema = z102.object({
|
8052
|
+
id: z102.string(),
|
8053
|
+
day: z102.string(),
|
8054
|
+
isEnabled: z102.boolean(),
|
8057
8055
|
timeSlots: TimeSlotDataSchema
|
8058
8056
|
}).array();
|
8059
|
-
var CreateHolidaySchema =
|
8060
|
-
name:
|
8061
|
-
date:
|
8062
|
-
isEnabled:
|
8057
|
+
var CreateHolidaySchema = z102.object({
|
8058
|
+
name: z102.string(),
|
8059
|
+
date: z102.string(),
|
8060
|
+
isEnabled: z102.boolean()
|
8063
8061
|
}).array();
|
8064
|
-
var UpdateHolidaySchema =
|
8065
|
-
id:
|
8066
|
-
name:
|
8067
|
-
date:
|
8068
|
-
isEnabled:
|
8062
|
+
var UpdateHolidaySchema = z102.object({
|
8063
|
+
id: z102.string().optional(),
|
8064
|
+
name: z102.string(),
|
8065
|
+
date: z102.string(),
|
8066
|
+
isEnabled: z102.boolean()
|
8069
8067
|
}).array();
|
8070
|
-
var CreateBusinessCalendarSchema =
|
8071
|
-
name:
|
8072
|
-
description:
|
8073
|
-
timeZone:
|
8074
|
-
isEnabled:
|
8068
|
+
var CreateBusinessCalendarSchema = z102.object({
|
8069
|
+
name: z102.string(),
|
8070
|
+
description: z102.string().optional(),
|
8071
|
+
timeZone: z102.string(),
|
8072
|
+
isEnabled: z102.boolean(),
|
8075
8073
|
businessHours: CreateBusinessHourSchema,
|
8076
8074
|
holidays: CreateHolidaySchema
|
8077
8075
|
});
|
8078
|
-
var UpdateBusinessCalendarSchema =
|
8079
|
-
id:
|
8080
|
-
name:
|
8081
|
-
description:
|
8082
|
-
timeZone:
|
8083
|
-
isEnabled:
|
8076
|
+
var UpdateBusinessCalendarSchema = z102.object({
|
8077
|
+
id: z102.string(),
|
8078
|
+
name: z102.string(),
|
8079
|
+
description: z102.string().optional(),
|
8080
|
+
timeZone: z102.string(),
|
8081
|
+
isEnabled: z102.boolean(),
|
8084
8082
|
businessHours: UpdateBusinessHourSchema,
|
8085
8083
|
holidays: UpdateHolidaySchema
|
8086
8084
|
});
|
8087
|
-
var DeleteBusinessCalendarSchema =
|
8088
|
-
id:
|
8085
|
+
var DeleteBusinessCalendarSchema = z102.object({
|
8086
|
+
id: z102.string()
|
8089
8087
|
});
|
8090
8088
|
|
8091
8089
|
// src/business-calendar/schema.ts
|
8092
|
-
import
|
8093
|
-
var TimeSlotDataSchema2 =
|
8090
|
+
import z103 from "zod";
|
8091
|
+
var TimeSlotDataSchema2 = z103.any();
|
8094
8092
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
8095
|
-
day:
|
8096
|
-
isEnabled:
|
8093
|
+
day: z103.string(),
|
8094
|
+
isEnabled: z103.boolean(),
|
8097
8095
|
timeSlots: TimeSlotDataSchema2
|
8098
8096
|
});
|
8099
8097
|
var HolidaySchema = DefaultEntitySchema.extend({
|
8100
|
-
name:
|
8101
|
-
date:
|
8102
|
-
isEnabled:
|
8103
|
-
isDefault:
|
8098
|
+
name: z103.string(),
|
8099
|
+
date: z103.string(),
|
8100
|
+
isEnabled: z103.boolean(),
|
8101
|
+
isDefault: z103.boolean()
|
8104
8102
|
});
|
8105
8103
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
8106
|
-
name:
|
8107
|
-
description:
|
8108
|
-
timeZone:
|
8109
|
-
isEnabled:
|
8110
|
-
isDefault:
|
8104
|
+
name: z103.string(),
|
8105
|
+
description: z103.string().optional(),
|
8106
|
+
timeZone: z103.string(),
|
8107
|
+
isEnabled: z103.boolean(),
|
8108
|
+
isDefault: z103.boolean(),
|
8111
8109
|
businessHours: BusinessHourSchema.array(),
|
8112
8110
|
holidays: HolidaySchema.array()
|
8113
8111
|
});
|
8114
8112
|
|
8115
8113
|
// src/business-calendar/index.ts
|
8116
|
-
import
|
8114
|
+
import z104 from "zod";
|
8117
8115
|
var businessCalendarContract = initContract36().router(
|
8118
8116
|
{
|
8119
8117
|
createBusinessCalendar: {
|
@@ -8140,7 +8138,7 @@ var businessCalendarContract = initContract36().router(
|
|
8140
8138
|
updateBusinessCalendar: {
|
8141
8139
|
method: "POST",
|
8142
8140
|
path: "/:id",
|
8143
|
-
pathParams:
|
8141
|
+
pathParams: z104.object({ id: z104.string() }),
|
8144
8142
|
body: UpdateBusinessCalendarSchema,
|
8145
8143
|
responses: {
|
8146
8144
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -8152,7 +8150,7 @@ var businessCalendarContract = initContract36().router(
|
|
8152
8150
|
deleteBusinessCalendar: {
|
8153
8151
|
method: "DELETE",
|
8154
8152
|
path: "/:id",
|
8155
|
-
pathParams:
|
8153
|
+
pathParams: z104.object({ id: z104.string() }),
|
8156
8154
|
body: null,
|
8157
8155
|
responses: {
|
8158
8156
|
200: DefaultSuccessResponseSchema,
|
@@ -8169,73 +8167,73 @@ var businessCalendarContract = initContract36().router(
|
|
8169
8167
|
import { initContract as initContract37 } from "@ts-rest/core";
|
8170
8168
|
|
8171
8169
|
// src/facebook-feed/validation.ts
|
8172
|
-
import
|
8173
|
-
var GetFacebookPagesSchema2 =
|
8174
|
-
data:
|
8175
|
-
|
8170
|
+
import z105 from "zod";
|
8171
|
+
var GetFacebookPagesSchema2 = z105.object({
|
8172
|
+
data: z105.array(
|
8173
|
+
z105.object({
|
8176
8174
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8177
|
-
access_token:
|
8178
|
-
category:
|
8175
|
+
access_token: z105.string(),
|
8176
|
+
category: z105.string(),
|
8179
8177
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8180
|
-
category_list:
|
8181
|
-
|
8182
|
-
id:
|
8183
|
-
name:
|
8178
|
+
category_list: z105.array(
|
8179
|
+
z105.object({
|
8180
|
+
id: z105.string(),
|
8181
|
+
name: z105.string()
|
8184
8182
|
})
|
8185
8183
|
),
|
8186
|
-
id:
|
8187
|
-
name:
|
8188
|
-
tasks:
|
8184
|
+
id: z105.string(),
|
8185
|
+
name: z105.string(),
|
8186
|
+
tasks: z105.string().array()
|
8189
8187
|
})
|
8190
8188
|
),
|
8191
|
-
paging:
|
8192
|
-
cursors:
|
8193
|
-
before:
|
8194
|
-
after:
|
8189
|
+
paging: z105.object({
|
8190
|
+
cursors: z105.object({
|
8191
|
+
before: z105.string().optional(),
|
8192
|
+
after: z105.string().optional()
|
8195
8193
|
})
|
8196
8194
|
}).optional()
|
8197
8195
|
});
|
8198
|
-
var GetFacebookPagesQuerySchema2 =
|
8199
|
-
accessToken:
|
8200
|
-
userId:
|
8196
|
+
var GetFacebookPagesQuerySchema2 = z105.object({
|
8197
|
+
accessToken: z105.string(),
|
8198
|
+
userId: z105.string()
|
8201
8199
|
});
|
8202
8200
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
8203
|
-
|
8204
|
-
isReloginRequired:
|
8205
|
-
platformContacts:
|
8206
|
-
id:
|
8207
|
-
name:
|
8208
|
-
createdAt:
|
8209
|
-
updatedAt:
|
8210
|
-
deletedAt:
|
8201
|
+
z105.object({
|
8202
|
+
isReloginRequired: z105.boolean(),
|
8203
|
+
platformContacts: z105.array(PlatformContactSchema),
|
8204
|
+
id: z105.string().uuid(),
|
8205
|
+
name: z105.string(),
|
8206
|
+
createdAt: z105.date(),
|
8207
|
+
updatedAt: z105.date(),
|
8208
|
+
deletedAt: z105.date().nullable()
|
8211
8209
|
})
|
8212
8210
|
);
|
8213
|
-
var GetFeedPostResponseSchema =
|
8214
|
-
id:
|
8215
|
-
message:
|
8216
|
-
created_time:
|
8217
|
-
can_reply_privately:
|
8218
|
-
from:
|
8219
|
-
permalink_url:
|
8220
|
-
attachments:
|
8221
|
-
data:
|
8222
|
-
|
8223
|
-
media:
|
8224
|
-
image:
|
8225
|
-
height:
|
8226
|
-
src:
|
8227
|
-
width:
|
8211
|
+
var GetFeedPostResponseSchema = z105.object({
|
8212
|
+
id: z105.string(),
|
8213
|
+
message: z105.string(),
|
8214
|
+
created_time: z105.string(),
|
8215
|
+
can_reply_privately: z105.boolean(),
|
8216
|
+
from: z105.object({ name: z105.string(), id: z105.string() }),
|
8217
|
+
permalink_url: z105.string(),
|
8218
|
+
attachments: z105.object({
|
8219
|
+
data: z105.array(
|
8220
|
+
z105.object({
|
8221
|
+
media: z105.object({
|
8222
|
+
image: z105.object({
|
8223
|
+
height: z105.number(),
|
8224
|
+
src: z105.string(),
|
8225
|
+
width: z105.number()
|
8228
8226
|
})
|
8229
8227
|
}),
|
8230
|
-
media_type:
|
8231
|
-
url:
|
8228
|
+
media_type: z105.string(),
|
8229
|
+
url: z105.string()
|
8232
8230
|
})
|
8233
8231
|
)
|
8234
8232
|
})
|
8235
8233
|
});
|
8236
8234
|
|
8237
8235
|
// src/facebook-feed/index.ts
|
8238
|
-
import
|
8236
|
+
import z106 from "zod";
|
8239
8237
|
var facebookFeedContract = initContract37().router({
|
8240
8238
|
connectToService: {
|
8241
8239
|
method: "POST",
|
@@ -8260,8 +8258,8 @@ var facebookFeedContract = initContract37().router({
|
|
8260
8258
|
reconnect: {
|
8261
8259
|
method: "POST",
|
8262
8260
|
path: "/reconnect/:channelId",
|
8263
|
-
pathParams:
|
8264
|
-
channelId:
|
8261
|
+
pathParams: z106.object({
|
8262
|
+
channelId: z106.string().uuid()
|
8265
8263
|
}),
|
8266
8264
|
body: null,
|
8267
8265
|
responses: {
|
@@ -8273,8 +8271,8 @@ var facebookFeedContract = initContract37().router({
|
|
8273
8271
|
delete: {
|
8274
8272
|
method: "DELETE",
|
8275
8273
|
path: "/delete/:channelId",
|
8276
|
-
pathParams:
|
8277
|
-
channelId:
|
8274
|
+
pathParams: z106.object({
|
8275
|
+
channelId: z106.string().uuid()
|
8278
8276
|
}),
|
8279
8277
|
body: null,
|
8280
8278
|
responses: {
|
@@ -8326,168 +8324,168 @@ var facebookFeedContract = initContract37().router({
|
|
8326
8324
|
|
8327
8325
|
// src/public-api/index.ts
|
8328
8326
|
import { initContract as initContract38 } from "@ts-rest/core";
|
8329
|
-
import
|
8327
|
+
import z109 from "zod";
|
8330
8328
|
|
8331
8329
|
// src/public-api/validation.ts
|
8332
|
-
import
|
8330
|
+
import z108 from "zod";
|
8333
8331
|
|
8334
8332
|
// src/public-api/schema.ts
|
8335
|
-
import
|
8336
|
-
var ContactPhonesSchema2 =
|
8337
|
-
id:
|
8338
|
-
createdAt:
|
8339
|
-
updatedAt:
|
8340
|
-
deletedAt:
|
8341
|
-
phone:
|
8342
|
-
isPrimary:
|
8343
|
-
});
|
8344
|
-
var ContactEmailsSchema2 =
|
8345
|
-
id:
|
8346
|
-
createdAt:
|
8347
|
-
updatedAt:
|
8348
|
-
deletedAt:
|
8349
|
-
email:
|
8350
|
-
isPrimary:
|
8351
|
-
});
|
8352
|
-
var ContactCustomFieldSchema2 =
|
8353
|
-
id:
|
8354
|
-
createdAt:
|
8355
|
-
updatedAt:
|
8356
|
-
deletedAt:
|
8357
|
-
textValue:
|
8358
|
-
booleanValue:
|
8359
|
-
numberValue:
|
8360
|
-
dateValue:
|
8333
|
+
import z107 from "zod";
|
8334
|
+
var ContactPhonesSchema2 = z107.object({
|
8335
|
+
id: z107.string().uuid(),
|
8336
|
+
createdAt: z107.date(),
|
8337
|
+
updatedAt: z107.date(),
|
8338
|
+
deletedAt: z107.date().nullable(),
|
8339
|
+
phone: z107.string(),
|
8340
|
+
isPrimary: z107.boolean()
|
8341
|
+
});
|
8342
|
+
var ContactEmailsSchema2 = z107.object({
|
8343
|
+
id: z107.string().uuid(),
|
8344
|
+
createdAt: z107.date(),
|
8345
|
+
updatedAt: z107.date(),
|
8346
|
+
deletedAt: z107.date().nullable(),
|
8347
|
+
email: z107.string(),
|
8348
|
+
isPrimary: z107.boolean()
|
8349
|
+
});
|
8350
|
+
var ContactCustomFieldSchema2 = z107.object({
|
8351
|
+
id: z107.string().uuid(),
|
8352
|
+
createdAt: z107.date(),
|
8353
|
+
updatedAt: z107.date(),
|
8354
|
+
deletedAt: z107.date().nullable(),
|
8355
|
+
textValue: z107.string().nullable(),
|
8356
|
+
booleanValue: z107.boolean().nullable(),
|
8357
|
+
numberValue: z107.number().nullable(),
|
8358
|
+
dateValue: z107.date().nullable(),
|
8361
8359
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
8362
|
-
uploads:
|
8363
|
-
});
|
8364
|
-
var ContactEntityTypesSchema2 =
|
8365
|
-
id:
|
8366
|
-
createdAt:
|
8367
|
-
updatedAt:
|
8368
|
-
deletedAt:
|
8369
|
-
entity:
|
8370
|
-
description:
|
8371
|
-
});
|
8372
|
-
var ContactActivitySchema2 =
|
8373
|
-
id:
|
8374
|
-
createdAt:
|
8375
|
-
updatedAt:
|
8376
|
-
deletedAt:
|
8377
|
-
entityId:
|
8378
|
-
description:
|
8360
|
+
uploads: z107.array(UploadSchema)
|
8361
|
+
});
|
8362
|
+
var ContactEntityTypesSchema2 = z107.object({
|
8363
|
+
id: z107.string().uuid(),
|
8364
|
+
createdAt: z107.date(),
|
8365
|
+
updatedAt: z107.date(),
|
8366
|
+
deletedAt: z107.date().nullable(),
|
8367
|
+
entity: z107.string(),
|
8368
|
+
description: z107.string().nullable()
|
8369
|
+
});
|
8370
|
+
var ContactActivitySchema2 = z107.object({
|
8371
|
+
id: z107.string().uuid(),
|
8372
|
+
createdAt: z107.date(),
|
8373
|
+
updatedAt: z107.date(),
|
8374
|
+
deletedAt: z107.date().nullable(),
|
8375
|
+
entityId: z107.string(),
|
8376
|
+
description: z107.string(),
|
8379
8377
|
entityType: ContactEntityTypesSchema2
|
8380
8378
|
});
|
8381
|
-
var ContactSchema2 =
|
8382
|
-
id:
|
8383
|
-
createdAt:
|
8384
|
-
updatedAt:
|
8385
|
-
deletedAt:
|
8386
|
-
name:
|
8387
|
-
address:
|
8388
|
-
channel:
|
8389
|
-
notes:
|
8390
|
-
contactProfile:
|
8391
|
-
socialProfileUrl:
|
8392
|
-
tags:
|
8379
|
+
var ContactSchema2 = z107.object({
|
8380
|
+
id: z107.string().uuid(),
|
8381
|
+
createdAt: z107.date(),
|
8382
|
+
updatedAt: z107.date(),
|
8383
|
+
deletedAt: z107.date().nullable(),
|
8384
|
+
name: z107.string(),
|
8385
|
+
address: z107.string().nullable(),
|
8386
|
+
channel: z107.string().nullable(),
|
8387
|
+
notes: z107.string().nullable(),
|
8388
|
+
contactProfile: z107.string().nullable(),
|
8389
|
+
socialProfileUrl: z107.string().nullable(),
|
8390
|
+
tags: z107.array(TagSchema),
|
8393
8391
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
8394
|
-
customFields:
|
8395
|
-
contactEmails:
|
8396
|
-
contactPhones:
|
8397
|
-
activityLogs:
|
8392
|
+
customFields: z107.array(ContactCustomFieldSchema2),
|
8393
|
+
contactEmails: z107.array(ContactEmailsSchema2),
|
8394
|
+
contactPhones: z107.array(ContactPhonesSchema2),
|
8395
|
+
activityLogs: z107.array(ContactActivitySchema2).optional()
|
8398
8396
|
});
|
8399
8397
|
|
8400
8398
|
// src/public-api/validation.ts
|
8401
8399
|
var ContactContractValidationSchema2 = {
|
8402
8400
|
create: {
|
8403
|
-
request:
|
8404
|
-
name:
|
8405
|
-
email:
|
8406
|
-
|
8407
|
-
email:
|
8408
|
-
isPrimary:
|
8401
|
+
request: z108.object({
|
8402
|
+
name: z108.string(),
|
8403
|
+
email: z108.array(
|
8404
|
+
z108.object({
|
8405
|
+
email: z108.string().email(),
|
8406
|
+
isPrimary: z108.boolean()
|
8409
8407
|
})
|
8410
8408
|
).optional(),
|
8411
|
-
channel:
|
8412
|
-
address:
|
8413
|
-
phone:
|
8414
|
-
|
8415
|
-
phone:
|
8416
|
-
isPrimary:
|
8409
|
+
channel: z108.string().optional(),
|
8410
|
+
address: z108.string().optional(),
|
8411
|
+
phone: z108.array(
|
8412
|
+
z108.object({
|
8413
|
+
phone: z108.string(),
|
8414
|
+
isPrimary: z108.boolean()
|
8417
8415
|
})
|
8418
8416
|
).optional(),
|
8419
|
-
notes:
|
8420
|
-
tags:
|
8421
|
-
company:
|
8422
|
-
customFields:
|
8417
|
+
notes: z108.string().optional(),
|
8418
|
+
tags: z108.array(z108.string()).optional(),
|
8419
|
+
company: z108.string().optional(),
|
8420
|
+
customFields: z108.record(z108.string())
|
8423
8421
|
// Dynamic keys with string values
|
8424
8422
|
}),
|
8425
8423
|
response: ContactSchema2
|
8426
8424
|
},
|
8427
8425
|
getById: {
|
8428
|
-
request:
|
8429
|
-
id:
|
8426
|
+
request: z108.object({
|
8427
|
+
id: z108.string().uuid()
|
8430
8428
|
})
|
8431
8429
|
},
|
8432
8430
|
delete: {
|
8433
|
-
request:
|
8434
|
-
id:
|
8431
|
+
request: z108.object({
|
8432
|
+
id: z108.string().uuid()
|
8435
8433
|
})
|
8436
8434
|
},
|
8437
8435
|
getAll: {
|
8438
|
-
request:
|
8439
|
-
page:
|
8440
|
-
pageSize:
|
8441
|
-
keyword:
|
8442
|
-
company:
|
8443
|
-
name:
|
8444
|
-
address:
|
8445
|
-
channel:
|
8446
|
-
selectedDate:
|
8447
|
-
customFields:
|
8448
|
-
|
8449
|
-
attributeId:
|
8450
|
-
type:
|
8451
|
-
value:
|
8436
|
+
request: z108.object({
|
8437
|
+
page: z108.coerce.number().default(1),
|
8438
|
+
pageSize: z108.coerce.number().default(10),
|
8439
|
+
keyword: z108.string().optional(),
|
8440
|
+
company: z108.array(z108.string().uuid()),
|
8441
|
+
name: z108.string(),
|
8442
|
+
address: z108.string(),
|
8443
|
+
channel: z108.array(z108.string()),
|
8444
|
+
selectedDate: z108.string(),
|
8445
|
+
customFields: z108.array(
|
8446
|
+
z108.object({
|
8447
|
+
attributeId: z108.string().uuid(),
|
8448
|
+
type: z108.string(),
|
8449
|
+
value: z108.union([z108.string(), z108.array(z108.string())])
|
8452
8450
|
})
|
8453
8451
|
),
|
8454
|
-
tags:
|
8455
|
-
phone:
|
8456
|
-
email:
|
8457
|
-
notes:
|
8452
|
+
tags: z108.array(z108.string().uuid()),
|
8453
|
+
phone: z108.string(),
|
8454
|
+
email: z108.string(),
|
8455
|
+
notes: z108.string()
|
8458
8456
|
}).partial(),
|
8459
8457
|
response: {
|
8460
|
-
page:
|
8461
|
-
pageSize:
|
8462
|
-
total:
|
8463
|
-
lastPage:
|
8464
|
-
data:
|
8458
|
+
page: z108.number(),
|
8459
|
+
pageSize: z108.number(),
|
8460
|
+
total: z108.number(),
|
8461
|
+
lastPage: z108.number(),
|
8462
|
+
data: z108.array(ContactSchema2)
|
8465
8463
|
}
|
8466
8464
|
},
|
8467
8465
|
getContactFields: {
|
8468
|
-
request:
|
8469
|
-
page:
|
8470
|
-
pageSize:
|
8466
|
+
request: z108.object({
|
8467
|
+
page: z108.coerce.number().default(1),
|
8468
|
+
pageSize: z108.coerce.number().default(10)
|
8471
8469
|
}).partial(),
|
8472
8470
|
response: {
|
8473
|
-
page:
|
8474
|
-
pageSize:
|
8475
|
-
total:
|
8476
|
-
lastPage:
|
8477
|
-
data:
|
8471
|
+
page: z108.number(),
|
8472
|
+
pageSize: z108.number(),
|
8473
|
+
total: z108.number(),
|
8474
|
+
lastPage: z108.number(),
|
8475
|
+
data: z108.array(ContactCustomFieldSchema2)
|
8478
8476
|
}
|
8479
8477
|
},
|
8480
8478
|
addAttachments: {
|
8481
|
-
request:
|
8482
|
-
contactId:
|
8483
|
-
attributeId:
|
8484
|
-
contactAttachmentRecords:
|
8485
|
-
|
8486
|
-
bucketName:
|
8487
|
-
fileKey:
|
8488
|
-
fileName:
|
8489
|
-
fileSize:
|
8490
|
-
url:
|
8479
|
+
request: z108.object({
|
8480
|
+
contactId: z108.string(),
|
8481
|
+
attributeId: z108.string().uuid(),
|
8482
|
+
contactAttachmentRecords: z108.array(
|
8483
|
+
z108.object({
|
8484
|
+
bucketName: z108.string(),
|
8485
|
+
fileKey: z108.string(),
|
8486
|
+
fileName: z108.string(),
|
8487
|
+
fileSize: z108.coerce.number(),
|
8488
|
+
url: z108.string()
|
8491
8489
|
})
|
8492
8490
|
)
|
8493
8491
|
}),
|
@@ -8506,11 +8504,11 @@ var publicApiContract = initContract38().router(
|
|
8506
8504
|
201: DefaultSuccessResponseSchema.extend({
|
8507
8505
|
data: ContactSchema2
|
8508
8506
|
}),
|
8509
|
-
400:
|
8510
|
-
message:
|
8507
|
+
400: z109.object({
|
8508
|
+
message: z109.string()
|
8511
8509
|
}),
|
8512
|
-
409:
|
8513
|
-
message:
|
8510
|
+
409: z109.object({
|
8511
|
+
message: z109.string()
|
8514
8512
|
}),
|
8515
8513
|
401: DefaultUnauthorizedSchema,
|
8516
8514
|
404: DefaultNotFoundSchema,
|
@@ -8525,13 +8523,13 @@ var publicApiContract = initContract38().router(
|
|
8525
8523
|
query: GetTagsSchema,
|
8526
8524
|
responses: {
|
8527
8525
|
200: DefaultSuccessResponseSchema.extend({
|
8528
|
-
tags:
|
8526
|
+
tags: z109.array(TagSchema)
|
8529
8527
|
}),
|
8530
|
-
400:
|
8531
|
-
message:
|
8528
|
+
400: z109.object({
|
8529
|
+
message: z109.string()
|
8532
8530
|
}),
|
8533
|
-
409:
|
8534
|
-
message:
|
8531
|
+
409: z109.object({
|
8532
|
+
message: z109.string()
|
8535
8533
|
}),
|
8536
8534
|
401: DefaultUnauthorizedSchema,
|
8537
8535
|
404: DefaultNotFoundSchema,
|
@@ -8547,11 +8545,11 @@ var publicApiContract = initContract38().router(
|
|
8547
8545
|
200: DefaultSuccessResponseSchema.extend(
|
8548
8546
|
ContactContractValidationSchema2.getAll.response
|
8549
8547
|
),
|
8550
|
-
400:
|
8551
|
-
message:
|
8548
|
+
400: z109.object({
|
8549
|
+
message: z109.string()
|
8552
8550
|
}),
|
8553
|
-
409:
|
8554
|
-
message:
|
8551
|
+
409: z109.object({
|
8552
|
+
message: z109.string()
|
8555
8553
|
}),
|
8556
8554
|
401: DefaultUnauthorizedSchema,
|
8557
8555
|
404: DefaultNotFoundSchema,
|
@@ -8568,11 +8566,11 @@ var publicApiContract = initContract38().router(
|
|
8568
8566
|
200: DefaultSuccessResponseSchema.extend(
|
8569
8567
|
ContactContractValidationSchema2.getContactFields.response
|
8570
8568
|
),
|
8571
|
-
400:
|
8572
|
-
message:
|
8569
|
+
400: z109.object({
|
8570
|
+
message: z109.string()
|
8573
8571
|
}),
|
8574
|
-
409:
|
8575
|
-
message:
|
8572
|
+
409: z109.object({
|
8573
|
+
message: z109.string()
|
8576
8574
|
}),
|
8577
8575
|
401: DefaultUnauthorizedSchema,
|
8578
8576
|
404: DefaultNotFoundSchema,
|
@@ -8586,17 +8584,17 @@ var publicApiContract = initContract38().router(
|
|
8586
8584
|
path: "/contacts/:id",
|
8587
8585
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8588
8586
|
responses: {
|
8589
|
-
200:
|
8590
|
-
status:
|
8591
|
-
message:
|
8587
|
+
200: z109.object({
|
8588
|
+
status: z109.string(),
|
8589
|
+
message: z109.string(),
|
8592
8590
|
data: ContactSchema2,
|
8593
|
-
requestId:
|
8591
|
+
requestId: z109.string()
|
8594
8592
|
}),
|
8595
|
-
400:
|
8596
|
-
message:
|
8593
|
+
400: z109.object({
|
8594
|
+
message: z109.string()
|
8597
8595
|
}),
|
8598
|
-
409:
|
8599
|
-
message:
|
8596
|
+
409: z109.object({
|
8597
|
+
message: z109.string()
|
8600
8598
|
}),
|
8601
8599
|
401: DefaultUnauthorizedSchema,
|
8602
8600
|
404: DefaultNotFoundSchema,
|
@@ -8614,11 +8612,11 @@ var publicApiContract = initContract38().router(
|
|
8614
8612
|
201: DefaultSuccessResponseSchema.extend({
|
8615
8613
|
message: ContactCustomFieldSchema2
|
8616
8614
|
}),
|
8617
|
-
400:
|
8618
|
-
message:
|
8615
|
+
400: z109.object({
|
8616
|
+
message: z109.string()
|
8619
8617
|
}),
|
8620
|
-
409:
|
8621
|
-
message:
|
8618
|
+
409: z109.object({
|
8619
|
+
message: z109.string()
|
8622
8620
|
}),
|
8623
8621
|
401: DefaultUnauthorizedSchema,
|
8624
8622
|
404: DefaultNotFoundSchema,
|
@@ -8632,17 +8630,17 @@ var publicApiContract = initContract38().router(
|
|
8632
8630
|
path: "/contacts/:id",
|
8633
8631
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8634
8632
|
responses: {
|
8635
|
-
200:
|
8636
|
-
status:
|
8637
|
-
message:
|
8633
|
+
200: z109.object({
|
8634
|
+
status: z109.string(),
|
8635
|
+
message: z109.string(),
|
8638
8636
|
data: ContactSchema2,
|
8639
|
-
requestId:
|
8637
|
+
requestId: z109.string()
|
8640
8638
|
}),
|
8641
|
-
400:
|
8642
|
-
message:
|
8639
|
+
400: z109.object({
|
8640
|
+
message: z109.string()
|
8643
8641
|
}),
|
8644
|
-
409:
|
8645
|
-
message:
|
8642
|
+
409: z109.object({
|
8643
|
+
message: z109.string()
|
8646
8644
|
}),
|
8647
8645
|
401: DefaultUnauthorizedSchema,
|
8648
8646
|
404: DefaultNotFoundSchema,
|
@@ -8656,17 +8654,17 @@ var publicApiContract = initContract38().router(
|
|
8656
8654
|
path: "/contacts/:id",
|
8657
8655
|
pathParams: ContactContractValidationSchema2.delete.request,
|
8658
8656
|
responses: {
|
8659
|
-
200:
|
8660
|
-
status:
|
8661
|
-
message:
|
8657
|
+
200: z109.object({
|
8658
|
+
status: z109.string(),
|
8659
|
+
message: z109.string(),
|
8662
8660
|
data: ContactSchema2,
|
8663
|
-
requestId:
|
8661
|
+
requestId: z109.string()
|
8664
8662
|
}),
|
8665
|
-
400:
|
8666
|
-
message:
|
8663
|
+
400: z109.object({
|
8664
|
+
message: z109.string()
|
8667
8665
|
}),
|
8668
|
-
409:
|
8669
|
-
message:
|
8666
|
+
409: z109.object({
|
8667
|
+
message: z109.string()
|
8670
8668
|
}),
|
8671
8669
|
401: DefaultUnauthorizedSchema,
|
8672
8670
|
404: DefaultNotFoundSchema,
|
@@ -8684,17 +8682,17 @@ var publicApiContract = initContract38().router(
|
|
8684
8682
|
|
8685
8683
|
// src/workflow-rule/index.ts
|
8686
8684
|
import { initContract as initContract39 } from "@ts-rest/core";
|
8687
|
-
import
|
8685
|
+
import z110 from "zod";
|
8688
8686
|
var chatContract = initContract39().router(
|
8689
8687
|
{
|
8690
8688
|
updateAssignee: {
|
8691
8689
|
method: "POST",
|
8692
8690
|
path: "/room/assignee",
|
8693
|
-
body:
|
8694
|
-
assigneeId:
|
8695
|
-
roomId:
|
8696
|
-
workflowId:
|
8697
|
-
queueId:
|
8691
|
+
body: z110.object({
|
8692
|
+
assigneeId: z110.string().uuid().optional(),
|
8693
|
+
roomId: z110.string().uuid(),
|
8694
|
+
workflowId: z110.string().uuid(),
|
8695
|
+
queueId: z110.string().uuid().optional()
|
8698
8696
|
}),
|
8699
8697
|
responses: {
|
8700
8698
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8708,9 +8706,9 @@ var chatContract = initContract39().router(
|
|
8708
8706
|
autoReply: {
|
8709
8707
|
method: "POST",
|
8710
8708
|
path: "/message/send",
|
8711
|
-
body:
|
8712
|
-
roomId:
|
8713
|
-
message:
|
8709
|
+
body: z110.object({
|
8710
|
+
roomId: z110.string().uuid(),
|
8711
|
+
message: z110.string(),
|
8714
8712
|
messageType: WorkflowAutoReplyMessageTypeSchema
|
8715
8713
|
// workflowId: z.string().uuid(),
|
8716
8714
|
}),
|
@@ -8726,15 +8724,15 @@ var chatContract = initContract39().router(
|
|
8726
8724
|
solveRoom: {
|
8727
8725
|
method: "POST",
|
8728
8726
|
path: "/room/solve",
|
8729
|
-
body:
|
8730
|
-
roomId:
|
8731
|
-
disposition:
|
8732
|
-
workflowId:
|
8727
|
+
body: z110.object({
|
8728
|
+
roomId: z110.string(),
|
8729
|
+
disposition: z110.string(),
|
8730
|
+
workflowId: z110.string().uuid()
|
8733
8731
|
}),
|
8734
8732
|
responses: {
|
8735
8733
|
200: DefaultSuccessResponseSchema.extend({
|
8736
8734
|
data: RoomSchema.extend({
|
8737
|
-
solveMessage:
|
8735
|
+
solveMessage: z110.string()
|
8738
8736
|
})
|
8739
8737
|
}),
|
8740
8738
|
409: DefaultErrorResponseSchema
|
@@ -8744,9 +8742,9 @@ var chatContract = initContract39().router(
|
|
8744
8742
|
emitMessage: {
|
8745
8743
|
method: "POST",
|
8746
8744
|
path: "/message/emit",
|
8747
|
-
body:
|
8748
|
-
messageId:
|
8749
|
-
queueId:
|
8745
|
+
body: z110.object({
|
8746
|
+
messageId: z110.string().uuid(),
|
8747
|
+
queueId: z110.string().uuid().optional().nullable()
|
8750
8748
|
}),
|
8751
8749
|
responses: {
|
8752
8750
|
200: DefaultSuccessResponseSchema,
|
@@ -8754,19 +8752,33 @@ var chatContract = initContract39().router(
|
|
8754
8752
|
404: DefaultErrorResponseSchema
|
8755
8753
|
},
|
8756
8754
|
summary: "Get message by ID"
|
8755
|
+
},
|
8756
|
+
tagContact: {
|
8757
|
+
method: "POST",
|
8758
|
+
path: "/contact/tag",
|
8759
|
+
body: z110.object({
|
8760
|
+
contactId: z110.string().uuid(),
|
8761
|
+
tagId: z110.string().uuid()
|
8762
|
+
}),
|
8763
|
+
responses: {
|
8764
|
+
200: DefaultSuccessResponseSchema,
|
8765
|
+
403: DefaultErrorResponseSchema,
|
8766
|
+
404: DefaultErrorResponseSchema
|
8767
|
+
},
|
8768
|
+
summary: "Attach Tag to Contact"
|
8757
8769
|
}
|
8758
8770
|
},
|
8759
8771
|
{
|
8760
|
-
baseHeaders:
|
8761
|
-
"x-tenant":
|
8762
|
-
"x-code":
|
8772
|
+
baseHeaders: z110.object({
|
8773
|
+
"x-tenant": z110.string({ required_error: "Tenant id is required" }),
|
8774
|
+
"x-code": z110.string().uuid().optional()
|
8763
8775
|
}),
|
8764
8776
|
pathPrefix: "chat"
|
8765
8777
|
}
|
8766
8778
|
);
|
8767
8779
|
|
8768
8780
|
// src/botpress/index.ts
|
8769
|
-
import
|
8781
|
+
import z111 from "zod";
|
8770
8782
|
import { initContract as initContract40 } from "@ts-rest/core";
|
8771
8783
|
var botpressContract = initContract40().router(
|
8772
8784
|
{
|
@@ -8785,7 +8797,7 @@ var botpressContract = initContract40().router(
|
|
8785
8797
|
path: "/",
|
8786
8798
|
responses: {
|
8787
8799
|
200: DefaultSuccessResponseSchema.extend({
|
8788
|
-
data:
|
8800
|
+
data: z111.array(BotpressBotSchema)
|
8789
8801
|
}),
|
8790
8802
|
500: DefaultErrorResponseSchema
|
8791
8803
|
}
|
@@ -8822,7 +8834,7 @@ var botContract = initContract40().router(
|
|
8822
8834
|
path: "/",
|
8823
8835
|
responses: {
|
8824
8836
|
200: DefaultSuccessResponseSchema.extend({
|
8825
|
-
data:
|
8837
|
+
data: z111.array(BotpressBotSchema)
|
8826
8838
|
}),
|
8827
8839
|
500: DefaultErrorResponseSchema
|
8828
8840
|
}
|
@@ -8835,17 +8847,17 @@ var botContract = initContract40().router(
|
|
8835
8847
|
|
8836
8848
|
// src/presence-status/index.ts
|
8837
8849
|
import { initContract as initContract41 } from "@ts-rest/core";
|
8838
|
-
import
|
8850
|
+
import z113 from "zod";
|
8839
8851
|
|
8840
8852
|
// src/presence-status/validation.ts
|
8841
|
-
import { z as
|
8842
|
-
var CreatePresenceStatusSchema =
|
8843
|
-
systemName:
|
8844
|
-
displayName:
|
8845
|
-
description:
|
8846
|
-
position:
|
8847
|
-
emoji:
|
8848
|
-
presenceStatusOption:
|
8853
|
+
import { z as z112 } from "zod";
|
8854
|
+
var CreatePresenceStatusSchema = z112.object({
|
8855
|
+
systemName: z112.string(),
|
8856
|
+
displayName: z112.string(),
|
8857
|
+
description: z112.string().optional(),
|
8858
|
+
position: z112.number(),
|
8859
|
+
emoji: z112.string(),
|
8860
|
+
presenceStatusOption: z112.array(TPresenceStatusOption)
|
8849
8861
|
});
|
8850
8862
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
8851
8863
|
|
@@ -8856,16 +8868,16 @@ var presenceStatusContract = initContract41().router(
|
|
8856
8868
|
method: "GET",
|
8857
8869
|
path: "",
|
8858
8870
|
headers: DefaultHeaderSchema,
|
8859
|
-
query:
|
8860
|
-
keyword:
|
8871
|
+
query: z113.object({
|
8872
|
+
keyword: z113.string().optional()
|
8861
8873
|
}).optional(),
|
8862
8874
|
responses: {
|
8863
|
-
200:
|
8864
|
-
total:
|
8865
|
-
data:
|
8875
|
+
200: z113.object({
|
8876
|
+
total: z113.number(),
|
8877
|
+
data: z113.array(PresenceStatusSchema)
|
8866
8878
|
}),
|
8867
|
-
400:
|
8868
|
-
message:
|
8879
|
+
400: z113.object({
|
8880
|
+
message: z113.string()
|
8869
8881
|
}),
|
8870
8882
|
401: DefaultUnauthorizedSchema,
|
8871
8883
|
500: DefaultErrorResponseSchema
|
@@ -8877,9 +8889,9 @@ var presenceStatusContract = initContract41().router(
|
|
8877
8889
|
path: "/ps/user-presence-status",
|
8878
8890
|
headers: DefaultHeaderSchema,
|
8879
8891
|
responses: {
|
8880
|
-
200:
|
8881
|
-
400:
|
8882
|
-
message:
|
8892
|
+
200: z113.array(UserPresenceStatusSchema),
|
8893
|
+
400: z113.object({
|
8894
|
+
message: z113.string()
|
8883
8895
|
}),
|
8884
8896
|
401: DefaultUnauthorizedSchema,
|
8885
8897
|
500: DefaultErrorResponseSchema
|
@@ -8895,8 +8907,8 @@ var presenceStatusContract = initContract41().router(
|
|
8895
8907
|
201: DefaultSuccessResponseSchema.extend({
|
8896
8908
|
presenceStatus: PresenceStatusSchema
|
8897
8909
|
}),
|
8898
|
-
400:
|
8899
|
-
message:
|
8910
|
+
400: z113.object({
|
8911
|
+
message: z113.string()
|
8900
8912
|
}),
|
8901
8913
|
401: DefaultUnauthorizedSchema,
|
8902
8914
|
404: DefaultNotFoundSchema,
|
@@ -8908,12 +8920,12 @@ var presenceStatusContract = initContract41().router(
|
|
8908
8920
|
getPresenceStatusById: {
|
8909
8921
|
method: "GET",
|
8910
8922
|
path: "/:id",
|
8911
|
-
pathParams:
|
8923
|
+
pathParams: z113.object({ id: z113.string() }),
|
8912
8924
|
headers: DefaultHeaderSchema,
|
8913
8925
|
responses: {
|
8914
8926
|
200: PresenceStatusSchema,
|
8915
|
-
400:
|
8916
|
-
message:
|
8927
|
+
400: z113.object({
|
8928
|
+
message: z113.string()
|
8917
8929
|
}),
|
8918
8930
|
401: DefaultUnauthorizedSchema,
|
8919
8931
|
404: DefaultNotFoundSchema,
|
@@ -8925,15 +8937,15 @@ var presenceStatusContract = initContract41().router(
|
|
8925
8937
|
updatePresenceStatus: {
|
8926
8938
|
method: "PATCH",
|
8927
8939
|
path: "/:id",
|
8928
|
-
pathParams:
|
8940
|
+
pathParams: z113.object({ id: z113.string() }),
|
8929
8941
|
headers: DefaultHeaderSchema,
|
8930
8942
|
body: UpdatePresenceStatusSchema,
|
8931
8943
|
responses: {
|
8932
8944
|
201: DefaultSuccessResponseSchema.extend({
|
8933
8945
|
presenceStatus: PresenceStatusSchema
|
8934
8946
|
}),
|
8935
|
-
400:
|
8936
|
-
message:
|
8947
|
+
400: z113.object({
|
8948
|
+
message: z113.string()
|
8937
8949
|
}),
|
8938
8950
|
401: DefaultUnauthorizedSchema,
|
8939
8951
|
404: DefaultNotFoundSchema,
|
@@ -8945,11 +8957,11 @@ var presenceStatusContract = initContract41().router(
|
|
8945
8957
|
deletePresenceStatus: {
|
8946
8958
|
method: "DELETE",
|
8947
8959
|
path: "/:id",
|
8948
|
-
pathParams:
|
8960
|
+
pathParams: z113.object({ id: z113.string() }),
|
8949
8961
|
headers: DefaultHeaderSchema,
|
8950
8962
|
body: null,
|
8951
8963
|
responses: {
|
8952
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8964
|
+
200: DefaultSuccessResponseSchema.extend({ message: z113.string() }),
|
8953
8965
|
404: DefaultNotFoundSchema,
|
8954
8966
|
422: DefaultUnprocessibleSchema,
|
8955
8967
|
500: DefaultErrorResponseSchema
|
@@ -8962,7 +8974,7 @@ var presenceStatusContract = initContract41().router(
|
|
8962
8974
|
|
8963
8975
|
// src/whatsapp/index.ts
|
8964
8976
|
import { initContract as initContract42 } from "@ts-rest/core";
|
8965
|
-
import
|
8977
|
+
import z114 from "zod";
|
8966
8978
|
var whatsappContract = initContract42().router({
|
8967
8979
|
sendMessage: {
|
8968
8980
|
method: "POST",
|
@@ -8997,11 +9009,11 @@ var whatsappContract = initContract42().router({
|
|
8997
9009
|
reconnect: {
|
8998
9010
|
method: "POST",
|
8999
9011
|
path: "/reconnect/:channelId",
|
9000
|
-
pathParams:
|
9001
|
-
channelId:
|
9012
|
+
pathParams: z114.object({
|
9013
|
+
channelId: z114.string().uuid()
|
9002
9014
|
}),
|
9003
|
-
body:
|
9004
|
-
instanceId:
|
9015
|
+
body: z114.object({
|
9016
|
+
instanceId: z114.string().nullable().optional()
|
9005
9017
|
}),
|
9006
9018
|
responses: {
|
9007
9019
|
200: ChannelServiceResponseSchema,
|
@@ -9012,8 +9024,8 @@ var whatsappContract = initContract42().router({
|
|
9012
9024
|
delete: {
|
9013
9025
|
method: "DELETE",
|
9014
9026
|
path: "/delete/:channelId",
|
9015
|
-
pathParams:
|
9016
|
-
channelId:
|
9027
|
+
pathParams: z114.object({
|
9028
|
+
channelId: z114.string().uuid()
|
9017
9029
|
}),
|
9018
9030
|
body: null,
|
9019
9031
|
responses: {
|
@@ -9055,10 +9067,10 @@ var whatsappContract = initContract42().router({
|
|
9055
9067
|
deleteWaapi: {
|
9056
9068
|
method: "DELETE",
|
9057
9069
|
path: "/mobile/:instanceId",
|
9058
|
-
pathParams:
|
9059
|
-
instanceId:
|
9070
|
+
pathParams: z114.object({
|
9071
|
+
instanceId: z114.string()
|
9060
9072
|
}),
|
9061
|
-
body:
|
9073
|
+
body: z114.any().optional(),
|
9062
9074
|
responses: {
|
9063
9075
|
200: DefaultSuccessResponseSchema,
|
9064
9076
|
500: DefaultErrorResponseSchema,
|
@@ -9079,21 +9091,21 @@ var whatsappContract = initContract42().router({
|
|
9079
9091
|
|
9080
9092
|
// src/invoice/index.ts
|
9081
9093
|
import { initContract as initContract43 } from "@ts-rest/core";
|
9082
|
-
import { z as
|
9094
|
+
import { z as z116 } from "zod";
|
9083
9095
|
|
9084
9096
|
// src/invoice/schema.ts
|
9085
|
-
import
|
9097
|
+
import z115 from "zod";
|
9086
9098
|
var InvoiceSchema = DefaultEntitySchema.extend({
|
9087
|
-
invoiceId:
|
9088
|
-
amountPaid:
|
9089
|
-
billingReason:
|
9090
|
-
collectionMethod:
|
9091
|
-
created:
|
9092
|
-
currency:
|
9093
|
-
hostedInvoiceUrl:
|
9094
|
-
invoicePdf:
|
9095
|
-
number:
|
9096
|
-
paid:
|
9099
|
+
invoiceId: z115.string(),
|
9100
|
+
amountPaid: z115.number(),
|
9101
|
+
billingReason: z115.string(),
|
9102
|
+
collectionMethod: z115.string(),
|
9103
|
+
created: z115.number(),
|
9104
|
+
currency: z115.string(),
|
9105
|
+
hostedInvoiceUrl: z115.string(),
|
9106
|
+
invoicePdf: z115.string(),
|
9107
|
+
number: z115.string(),
|
9108
|
+
paid: z115.boolean()
|
9097
9109
|
});
|
9098
9110
|
|
9099
9111
|
// src/invoice/index.ts
|
@@ -9105,7 +9117,7 @@ var invoiceContract = initContract43().router(
|
|
9105
9117
|
query: null,
|
9106
9118
|
responses: {
|
9107
9119
|
200: DefaultSuccessResponseSchema.extend({
|
9108
|
-
invoices:
|
9120
|
+
invoices: z116.array(InvoiceSchema)
|
9109
9121
|
}),
|
9110
9122
|
500: DefaultErrorResponseSchema
|
9111
9123
|
}
|
@@ -9315,7 +9327,7 @@ var presenceStatusContract2 = initContract44().router({
|
|
9315
9327
|
|
9316
9328
|
// src/general-setting/index.ts
|
9317
9329
|
import { initContract as initContract45 } from "@ts-rest/core";
|
9318
|
-
import
|
9330
|
+
import z117 from "zod";
|
9319
9331
|
var generalSettingContract = initContract45().router(
|
9320
9332
|
{
|
9321
9333
|
autoOpenedContactWidgetId: {
|
@@ -9323,20 +9335,20 @@ var generalSettingContract = initContract45().router(
|
|
9323
9335
|
method: "GET",
|
9324
9336
|
path: "/auto-opened-contact-widget-id",
|
9325
9337
|
responses: {
|
9326
|
-
200:
|
9327
|
-
autoOpenedContactWidgetId:
|
9338
|
+
200: z117.object({
|
9339
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9328
9340
|
})
|
9329
9341
|
}
|
9330
9342
|
},
|
9331
9343
|
updateAutoOpenedContactWidgetId: {
|
9332
9344
|
method: "PATCH",
|
9333
9345
|
path: "/auto-opened-contact-widget-id",
|
9334
|
-
body:
|
9335
|
-
autoOpenedContactWidgetId:
|
9346
|
+
body: z117.object({
|
9347
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9336
9348
|
}),
|
9337
9349
|
responses: {
|
9338
|
-
200:
|
9339
|
-
autoOpenedContactWidgetId:
|
9350
|
+
200: z117.object({
|
9351
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
9340
9352
|
})
|
9341
9353
|
}
|
9342
9354
|
}
|
@@ -9349,51 +9361,51 @@ var generalSettingContract = initContract45().router(
|
|
9349
9361
|
|
9350
9362
|
// src/automation-queue/index.ts
|
9351
9363
|
import { initContract as initContract46 } from "@ts-rest/core";
|
9352
|
-
import { z as
|
9364
|
+
import { z as z120 } from "zod";
|
9353
9365
|
|
9354
9366
|
// src/automation-queue/validation.ts
|
9355
|
-
import { z as
|
9356
|
-
var QueueDistributionStrategySchema =
|
9357
|
-
|
9358
|
-
|
9359
|
-
|
9360
|
-
|
9367
|
+
import { z as z118 } from "zod";
|
9368
|
+
var QueueDistributionStrategySchema = z118.union([
|
9369
|
+
z118.literal("round-robin"),
|
9370
|
+
z118.literal("fewest-assignments"),
|
9371
|
+
z118.literal("random"),
|
9372
|
+
z118.literal("notify-all")
|
9361
9373
|
]);
|
9362
|
-
var CreateAutomationQueueSchema =
|
9363
|
-
emoji:
|
9364
|
-
name:
|
9365
|
-
description:
|
9366
|
-
managerIds:
|
9367
|
-
agentIds:
|
9374
|
+
var CreateAutomationQueueSchema = z118.object({
|
9375
|
+
emoji: z118.string().emoji(),
|
9376
|
+
name: z118.string(),
|
9377
|
+
description: z118.string().nullable(),
|
9378
|
+
managerIds: z118.array(z118.string().uuid()).min(1),
|
9379
|
+
agentIds: z118.array(z118.string().uuid()).min(1),
|
9368
9380
|
distributionStrategy: QueueDistributionStrategySchema.nullable(),
|
9369
|
-
maximumAssignPerAgent:
|
9370
|
-
autoAssign:
|
9381
|
+
maximumAssignPerAgent: z118.number().positive().nullable(),
|
9382
|
+
autoAssign: z118.boolean().nullable()
|
9371
9383
|
// ringTimeOut: z.number().positive(),
|
9372
9384
|
// retryInterval: z.number().positive(),
|
9373
9385
|
// queueTimeOut: z.number().positive(),
|
9374
9386
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9375
9387
|
});
|
9376
9388
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9377
|
-
var CheckHasAssignedRoomSchema =
|
9378
|
-
userId:
|
9379
|
-
queueId:
|
9389
|
+
var CheckHasAssignedRoomSchema = z118.object({
|
9390
|
+
userId: z118.string().uuid().optional(),
|
9391
|
+
queueId: z118.string().uuid().optional()
|
9380
9392
|
});
|
9381
9393
|
|
9382
9394
|
// src/automation-queue/schema.ts
|
9383
|
-
import { z as
|
9395
|
+
import { z as z119 } from "zod";
|
9384
9396
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9385
|
-
emoji:
|
9386
|
-
name:
|
9387
|
-
description:
|
9397
|
+
emoji: z119.string(),
|
9398
|
+
name: z119.string(),
|
9399
|
+
description: z119.string().nullable(),
|
9388
9400
|
distributionStrategy: QueueDistributionStrategySchema,
|
9389
|
-
maximumAssignPerAgent:
|
9401
|
+
maximumAssignPerAgent: z119.number().positive(),
|
9390
9402
|
// ringTimeOut: z.number(),
|
9391
9403
|
// retryInterval: z.number(),
|
9392
9404
|
// queueTimeOut: z.number(),
|
9393
9405
|
// isAssignmentDeniable: z.boolean(),
|
9394
|
-
autoAssign:
|
9395
|
-
managers:
|
9396
|
-
agents:
|
9406
|
+
autoAssign: z119.boolean(),
|
9407
|
+
managers: z119.array(UserSchema),
|
9408
|
+
agents: z119.array(UserSchema)
|
9397
9409
|
});
|
9398
9410
|
|
9399
9411
|
// src/automation-queue/index.ts
|
@@ -9412,8 +9424,8 @@ var automationQueueContract = initContract46().router(
|
|
9412
9424
|
duplicateAutomationQueue: {
|
9413
9425
|
method: "POST",
|
9414
9426
|
path: "/:id/duplicate",
|
9415
|
-
pathParams:
|
9416
|
-
id:
|
9427
|
+
pathParams: z120.object({
|
9428
|
+
id: z120.string().uuid()
|
9417
9429
|
}),
|
9418
9430
|
body: null,
|
9419
9431
|
responses: {
|
@@ -9425,21 +9437,21 @@ var automationQueueContract = initContract46().router(
|
|
9425
9437
|
getAutomationQueues: {
|
9426
9438
|
method: "GET",
|
9427
9439
|
path: "",
|
9428
|
-
query:
|
9429
|
-
userId:
|
9430
|
-
withRelations:
|
9440
|
+
query: z120.object({
|
9441
|
+
userId: z120.string().uuid().optional(),
|
9442
|
+
withRelations: z120.coerce.boolean().default(true).optional()
|
9431
9443
|
}).optional(),
|
9432
9444
|
responses: {
|
9433
9445
|
200: DefaultSuccessResponseSchema.extend({
|
9434
|
-
data:
|
9446
|
+
data: z120.array(AutomationQueueSchema)
|
9435
9447
|
})
|
9436
9448
|
}
|
9437
9449
|
},
|
9438
9450
|
getAutomationQueueById: {
|
9439
9451
|
method: "GET",
|
9440
9452
|
path: "/:id",
|
9441
|
-
pathParams:
|
9442
|
-
id:
|
9453
|
+
pathParams: z120.object({
|
9454
|
+
id: z120.string().uuid()
|
9443
9455
|
}),
|
9444
9456
|
responses: {
|
9445
9457
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9450,8 +9462,8 @@ var automationQueueContract = initContract46().router(
|
|
9450
9462
|
updateAutomationQueue: {
|
9451
9463
|
method: "PATCH",
|
9452
9464
|
path: "/:id",
|
9453
|
-
pathParams:
|
9454
|
-
id:
|
9465
|
+
pathParams: z120.object({
|
9466
|
+
id: z120.string().uuid()
|
9455
9467
|
}),
|
9456
9468
|
body: UpdateAutomationQueueSchema,
|
9457
9469
|
responses: {
|
@@ -9463,13 +9475,13 @@ var automationQueueContract = initContract46().router(
|
|
9463
9475
|
deleteAutomationQueue: {
|
9464
9476
|
method: "DELETE",
|
9465
9477
|
path: "/:id",
|
9466
|
-
pathParams:
|
9467
|
-
id:
|
9478
|
+
pathParams: z120.object({
|
9479
|
+
id: z120.string().uuid()
|
9468
9480
|
}),
|
9469
9481
|
body: null,
|
9470
9482
|
responses: {
|
9471
9483
|
200: DefaultSuccessResponseSchema.extend({
|
9472
|
-
message:
|
9484
|
+
message: z120.string()
|
9473
9485
|
})
|
9474
9486
|
}
|
9475
9487
|
},
|
@@ -9479,8 +9491,8 @@ var automationQueueContract = initContract46().router(
|
|
9479
9491
|
body: CheckHasAssignedRoomSchema,
|
9480
9492
|
responses: {
|
9481
9493
|
200: DefaultSuccessResponseSchema.extend({
|
9482
|
-
data:
|
9483
|
-
hasAssignedRoom:
|
9494
|
+
data: z120.object({
|
9495
|
+
hasAssignedRoom: z120.boolean()
|
9484
9496
|
})
|
9485
9497
|
})
|
9486
9498
|
}
|
@@ -9497,282 +9509,282 @@ import { initContract as initContract51 } from "@ts-rest/core";
|
|
9497
9509
|
|
9498
9510
|
// src/mail/room-contract.ts
|
9499
9511
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9500
|
-
import
|
9512
|
+
import z125 from "zod";
|
9501
9513
|
|
9502
9514
|
// src/mail/schemas/room.schema.ts
|
9503
|
-
import
|
9515
|
+
import z123 from "zod";
|
9504
9516
|
|
9505
9517
|
// src/mail/schemas/account.schema.ts
|
9518
|
+
import z121 from "zod";
|
9519
|
+
var MailServerSchema = z121.object({
|
9520
|
+
id: z121.string(),
|
9521
|
+
createdAt: z121.date(),
|
9522
|
+
updatedAt: z121.date(),
|
9523
|
+
deletedAt: z121.date().nullable(),
|
9524
|
+
name: z121.string(),
|
9525
|
+
smtpHost: z121.string(),
|
9526
|
+
smtpPort: z121.number(),
|
9527
|
+
smtpTlsPort: z121.number(),
|
9528
|
+
useTlsForSmtp: z121.boolean(),
|
9529
|
+
imapHost: z121.string(),
|
9530
|
+
imapPort: z121.number(),
|
9531
|
+
imapTlsPort: z121.number(),
|
9532
|
+
useTlsForImap: z121.boolean()
|
9533
|
+
});
|
9534
|
+
var MailAccountSchema = z121.object({
|
9535
|
+
id: z121.string(),
|
9536
|
+
createdAt: z121.date(),
|
9537
|
+
updatedAt: z121.date(),
|
9538
|
+
deletedAt: z121.date().nullable(),
|
9539
|
+
name: z121.string(),
|
9540
|
+
address: z121.string(),
|
9541
|
+
accountId: z121.string(),
|
9542
|
+
mailServerId: z121.string(),
|
9543
|
+
mailServer: MailServerSchema,
|
9544
|
+
state: z121.union([
|
9545
|
+
z121.literal("init"),
|
9546
|
+
z121.literal("syncing"),
|
9547
|
+
z121.literal("connecting"),
|
9548
|
+
z121.literal("connected"),
|
9549
|
+
z121.literal("disconnected"),
|
9550
|
+
z121.literal("authenticationError"),
|
9551
|
+
z121.literal("connectError"),
|
9552
|
+
z121.literal("unset")
|
9553
|
+
])
|
9554
|
+
});
|
9555
|
+
var OAuth2AppSchema = z121.object({
|
9556
|
+
id: z121.string(),
|
9557
|
+
name: z121.string(),
|
9558
|
+
description: z121.string(),
|
9559
|
+
title: z121.string(),
|
9560
|
+
provider: z121.string(),
|
9561
|
+
enabled: z121.boolean(),
|
9562
|
+
legacy: z121.boolean(),
|
9563
|
+
created: z121.string(),
|
9564
|
+
updated: z121.string(),
|
9565
|
+
includeInListing: z121.boolean(),
|
9566
|
+
clientId: z121.string(),
|
9567
|
+
clientSecret: z121.string(),
|
9568
|
+
authority: z121.string(),
|
9569
|
+
redirectUrl: z121.string(),
|
9570
|
+
serviceClient: z121.string(),
|
9571
|
+
googleProjectId: z121.string(),
|
9572
|
+
serviceClientEmail: z121.string(),
|
9573
|
+
serviceKey: z121.string()
|
9574
|
+
});
|
9575
|
+
|
9576
|
+
// src/mail/schemas/message.schema.ts
|
9506
9577
|
import z122 from "zod";
|
9507
|
-
var
|
9578
|
+
var AttachmentSchema = z122.object({
|
9508
9579
|
id: z122.string(),
|
9509
9580
|
createdAt: z122.date(),
|
9510
9581
|
updatedAt: z122.date(),
|
9511
|
-
deletedAt: z122.
|
9512
|
-
|
9513
|
-
|
9514
|
-
|
9515
|
-
|
9516
|
-
|
9517
|
-
|
9518
|
-
|
9519
|
-
|
9520
|
-
|
9521
|
-
|
9522
|
-
|
9582
|
+
deletedAt: z122.nullable(z122.date()),
|
9583
|
+
roomId: z122.string(),
|
9584
|
+
messageId: z122.string(),
|
9585
|
+
fileName: z122.string(),
|
9586
|
+
fileType: z122.string(),
|
9587
|
+
emailEngineAttachmentId: z122.string(),
|
9588
|
+
uploadId: z122.string(),
|
9589
|
+
upload: z122.object({
|
9590
|
+
id: z122.string(),
|
9591
|
+
createdAt: z122.date(),
|
9592
|
+
updatedAt: z122.date(),
|
9593
|
+
deletedAt: z122.nullable(z122.date()),
|
9594
|
+
bucketName: z122.string(),
|
9595
|
+
fileName: z122.string(),
|
9596
|
+
fileKey: z122.string(),
|
9597
|
+
fileSize: z122.number(),
|
9598
|
+
fileUrl: z122.string(),
|
9599
|
+
extensionName: z122.string()
|
9600
|
+
})
|
9601
|
+
});
|
9602
|
+
var MessageSchema2 = z122.object({
|
9523
9603
|
id: z122.string(),
|
9524
9604
|
createdAt: z122.date(),
|
9525
9605
|
updatedAt: z122.date(),
|
9526
|
-
deletedAt: z122.
|
9527
|
-
|
9528
|
-
|
9529
|
-
|
9530
|
-
|
9531
|
-
|
9532
|
-
|
9533
|
-
|
9534
|
-
|
9535
|
-
|
9536
|
-
|
9537
|
-
|
9538
|
-
|
9539
|
-
|
9540
|
-
|
9541
|
-
|
9542
|
-
|
9543
|
-
|
9544
|
-
|
9545
|
-
|
9546
|
-
|
9547
|
-
title: z122.string(),
|
9548
|
-
provider: z122.string(),
|
9549
|
-
enabled: z122.boolean(),
|
9550
|
-
legacy: z122.boolean(),
|
9551
|
-
created: z122.string(),
|
9552
|
-
updated: z122.string(),
|
9553
|
-
includeInListing: z122.boolean(),
|
9554
|
-
clientId: z122.string(),
|
9555
|
-
clientSecret: z122.string(),
|
9556
|
-
authority: z122.string(),
|
9557
|
-
redirectUrl: z122.string(),
|
9558
|
-
serviceClient: z122.string(),
|
9559
|
-
googleProjectId: z122.string(),
|
9560
|
-
serviceClientEmail: z122.string(),
|
9561
|
-
serviceKey: z122.string()
|
9606
|
+
deletedAt: z122.nullable(z122.date()),
|
9607
|
+
roomId: z122.string(),
|
9608
|
+
subject: z122.string(),
|
9609
|
+
textPlain: z122.string(),
|
9610
|
+
textHtml: z122.string(),
|
9611
|
+
textId: z122.string(),
|
9612
|
+
emailEngineEmailId: z122.string(),
|
9613
|
+
emailEngineMessageId: z122.string(),
|
9614
|
+
emailEngineReplyTo: z122.nullable(z122.string()),
|
9615
|
+
direction: z122.string(),
|
9616
|
+
date: z122.date(),
|
9617
|
+
action: z122.string(),
|
9618
|
+
unseen: z122.boolean(),
|
9619
|
+
sendAt: z122.date(),
|
9620
|
+
starred: z122.boolean(),
|
9621
|
+
seemsLikeNew: z122.boolean(),
|
9622
|
+
from: z122.array(MailParticipant),
|
9623
|
+
to: z122.array(MailParticipant),
|
9624
|
+
cc: z122.array(MailParticipant),
|
9625
|
+
bcc: z122.array(MailParticipant),
|
9626
|
+
attachments: z122.array(AttachmentSchema)
|
9562
9627
|
});
|
9563
9628
|
|
9564
|
-
// src/mail/schemas/
|
9565
|
-
|
9566
|
-
|
9629
|
+
// src/mail/schemas/room.schema.ts
|
9630
|
+
var ContactSchema3 = z123.object({
|
9631
|
+
id: z123.string().uuid(),
|
9632
|
+
createdAt: z123.date(),
|
9633
|
+
updatedAt: z123.date(),
|
9634
|
+
deletedAt: z123.date().nullable(),
|
9635
|
+
name: z123.string(),
|
9636
|
+
address: z123.string().nullable(),
|
9637
|
+
channel: z123.string().nullable(),
|
9638
|
+
notes: z123.string().nullable(),
|
9639
|
+
contactProfile: z123.string().nullable(),
|
9640
|
+
socialProfileUrl: z123.string().nullable()
|
9641
|
+
});
|
9642
|
+
var MailUserSchema = z123.object({
|
9567
9643
|
id: z123.string(),
|
9568
9644
|
createdAt: z123.date(),
|
9569
9645
|
updatedAt: z123.date(),
|
9570
|
-
deletedAt: z123.
|
9646
|
+
deletedAt: z123.date().nullable(),
|
9647
|
+
name: z123.string(),
|
9648
|
+
address: z123.string(),
|
9649
|
+
contactId: z123.string(),
|
9650
|
+
contact: ContactSchema3,
|
9651
|
+
isNewContact: z123.boolean()
|
9652
|
+
});
|
9653
|
+
var MailParticipant = z123.object({
|
9654
|
+
id: z123.string(),
|
9655
|
+
createdAt: z123.date(),
|
9656
|
+
updatedAt: z123.date(),
|
9657
|
+
deletedAt: z123.date().nullable(),
|
9571
9658
|
roomId: z123.string(),
|
9572
9659
|
messageId: z123.string(),
|
9573
|
-
|
9574
|
-
|
9575
|
-
|
9576
|
-
|
9577
|
-
|
9578
|
-
|
9579
|
-
|
9580
|
-
|
9581
|
-
|
9582
|
-
|
9583
|
-
fileName: z123.string(),
|
9584
|
-
fileKey: z123.string(),
|
9585
|
-
fileSize: z123.number(),
|
9586
|
-
fileUrl: z123.string(),
|
9587
|
-
extensionName: z123.string()
|
9588
|
-
})
|
9660
|
+
mailUserId: z123.string(),
|
9661
|
+
mailUser: MailUserSchema
|
9662
|
+
});
|
9663
|
+
var TagSchema2 = z123.object({
|
9664
|
+
color: z123.string(),
|
9665
|
+
id: z123.string(),
|
9666
|
+
createdAt: z123.date(),
|
9667
|
+
updatedAt: z123.date(),
|
9668
|
+
deletedAt: z123.date().nullable(),
|
9669
|
+
name: z123.string()
|
9589
9670
|
});
|
9590
|
-
var
|
9671
|
+
var UserModel = z123.object({
|
9672
|
+
id: z123.string().uuid(),
|
9673
|
+
createdAt: z123.date(),
|
9674
|
+
updatedAt: z123.date(),
|
9675
|
+
deletedAt: z123.date().nullable(),
|
9676
|
+
name: z123.string(),
|
9677
|
+
email: z123.string(),
|
9678
|
+
address: z123.string().nullable(),
|
9679
|
+
phone: z123.string().nullable(),
|
9680
|
+
notificationCount: z123.number().nullable()
|
9681
|
+
});
|
9682
|
+
var ActivityLogModel = z123.object({
|
9591
9683
|
id: z123.string(),
|
9592
9684
|
createdAt: z123.date(),
|
9593
9685
|
updatedAt: z123.date(),
|
9594
|
-
deletedAt: z123.nullable(z123.
|
9686
|
+
deletedAt: z123.nullable(z123.string()),
|
9687
|
+
description: z123.string(),
|
9688
|
+
actorId: z123.string(),
|
9595
9689
|
roomId: z123.string(),
|
9690
|
+
actor: UserModel
|
9691
|
+
});
|
9692
|
+
var MessagesAndLogsSchema = z123.array(
|
9693
|
+
z123.union([MessageSchema2, ActivityLogModel])
|
9694
|
+
);
|
9695
|
+
var MailRoomSchema = z123.object({
|
9696
|
+
id: z123.string(),
|
9697
|
+
createdAt: z123.date(),
|
9698
|
+
updatedAt: z123.date(),
|
9699
|
+
deletedAt: z123.date().nullable(),
|
9596
9700
|
subject: z123.string(),
|
9597
|
-
|
9598
|
-
|
9599
|
-
|
9600
|
-
|
9601
|
-
emailEngineMessageId: z123.string(),
|
9602
|
-
emailEngineReplyTo: z123.nullable(z123.string()),
|
9701
|
+
resolved: z123.boolean(),
|
9702
|
+
assigneeId: z123.string().nullable(),
|
9703
|
+
note: z123.string(),
|
9704
|
+
mailId: z123.string(),
|
9603
9705
|
direction: z123.string(),
|
9604
|
-
|
9605
|
-
|
9606
|
-
unseen: z123.boolean(),
|
9607
|
-
sendAt: z123.date(),
|
9608
|
-
starred: z123.boolean(),
|
9609
|
-
seemsLikeNew: z123.boolean(),
|
9706
|
+
lastMessageId: z123.string(),
|
9707
|
+
firstMessageId: z123.string(),
|
9610
9708
|
from: z123.array(MailParticipant),
|
9611
9709
|
to: z123.array(MailParticipant),
|
9612
9710
|
cc: z123.array(MailParticipant),
|
9613
9711
|
bcc: z123.array(MailParticipant),
|
9614
|
-
attachments: z123.array(AttachmentSchema)
|
9615
|
-
});
|
9616
|
-
|
9617
|
-
// src/mail/schemas/room.schema.ts
|
9618
|
-
var ContactSchema3 = z124.object({
|
9619
|
-
id: z124.string().uuid(),
|
9620
|
-
createdAt: z124.date(),
|
9621
|
-
updatedAt: z124.date(),
|
9622
|
-
deletedAt: z124.date().nullable(),
|
9623
|
-
name: z124.string(),
|
9624
|
-
address: z124.string().nullable(),
|
9625
|
-
channel: z124.string().nullable(),
|
9626
|
-
notes: z124.string().nullable(),
|
9627
|
-
contactProfile: z124.string().nullable(),
|
9628
|
-
socialProfileUrl: z124.string().nullable()
|
9629
|
-
});
|
9630
|
-
var MailUserSchema = z124.object({
|
9631
|
-
id: z124.string(),
|
9632
|
-
createdAt: z124.date(),
|
9633
|
-
updatedAt: z124.date(),
|
9634
|
-
deletedAt: z124.date().nullable(),
|
9635
|
-
name: z124.string(),
|
9636
|
-
address: z124.string(),
|
9637
|
-
contactId: z124.string(),
|
9638
|
-
contact: ContactSchema3,
|
9639
|
-
isNewContact: z124.boolean()
|
9640
|
-
});
|
9641
|
-
var MailParticipant = z124.object({
|
9642
|
-
id: z124.string(),
|
9643
|
-
createdAt: z124.date(),
|
9644
|
-
updatedAt: z124.date(),
|
9645
|
-
deletedAt: z124.date().nullable(),
|
9646
|
-
roomId: z124.string(),
|
9647
|
-
messageId: z124.string(),
|
9648
|
-
mailUserId: z124.string(),
|
9649
|
-
mailUser: MailUserSchema
|
9650
|
-
});
|
9651
|
-
var TagSchema2 = z124.object({
|
9652
|
-
color: z124.string(),
|
9653
|
-
id: z124.string(),
|
9654
|
-
createdAt: z124.date(),
|
9655
|
-
updatedAt: z124.date(),
|
9656
|
-
deletedAt: z124.date().nullable(),
|
9657
|
-
name: z124.string()
|
9658
|
-
});
|
9659
|
-
var UserModel = z124.object({
|
9660
|
-
id: z124.string().uuid(),
|
9661
|
-
createdAt: z124.date(),
|
9662
|
-
updatedAt: z124.date(),
|
9663
|
-
deletedAt: z124.date().nullable(),
|
9664
|
-
name: z124.string(),
|
9665
|
-
email: z124.string(),
|
9666
|
-
address: z124.string().nullable(),
|
9667
|
-
phone: z124.string().nullable(),
|
9668
|
-
notificationCount: z124.number().nullable()
|
9669
|
-
});
|
9670
|
-
var ActivityLogModel = z124.object({
|
9671
|
-
id: z124.string(),
|
9672
|
-
createdAt: z124.date(),
|
9673
|
-
updatedAt: z124.date(),
|
9674
|
-
deletedAt: z124.nullable(z124.string()),
|
9675
|
-
description: z124.string(),
|
9676
|
-
actorId: z124.string(),
|
9677
|
-
roomId: z124.string(),
|
9678
|
-
actor: UserModel
|
9679
|
-
});
|
9680
|
-
var MessagesAndLogsSchema = z124.array(
|
9681
|
-
z124.union([MessageSchema2, ActivityLogModel])
|
9682
|
-
);
|
9683
|
-
var MailRoomSchema = z124.object({
|
9684
|
-
id: z124.string(),
|
9685
|
-
createdAt: z124.date(),
|
9686
|
-
updatedAt: z124.date(),
|
9687
|
-
deletedAt: z124.date().nullable(),
|
9688
|
-
subject: z124.string(),
|
9689
|
-
resolved: z124.boolean(),
|
9690
|
-
assigneeId: z124.string().nullable(),
|
9691
|
-
note: z124.string(),
|
9692
|
-
mailId: z124.string(),
|
9693
|
-
direction: z124.string(),
|
9694
|
-
lastMessageId: z124.string(),
|
9695
|
-
firstMessageId: z124.string(),
|
9696
|
-
from: z124.array(MailParticipant),
|
9697
|
-
to: z124.array(MailParticipant),
|
9698
|
-
cc: z124.array(MailParticipant),
|
9699
|
-
bcc: z124.array(MailParticipant),
|
9700
9712
|
firstMessage: MessageSchema2,
|
9701
9713
|
lastMessage: MessageSchema2,
|
9702
|
-
tags:
|
9714
|
+
tags: z123.array(TagSchema2),
|
9703
9715
|
assignee: UserModel,
|
9704
|
-
messages:
|
9716
|
+
messages: z123.array(MessageSchema2),
|
9705
9717
|
messagesAndLogs: MessagesAndLogsSchema,
|
9706
9718
|
mail: MailAccountSchema,
|
9707
|
-
unReadMessageCount:
|
9719
|
+
unReadMessageCount: z123.number(),
|
9708
9720
|
cxlog: CxLogSchema
|
9709
9721
|
});
|
9710
|
-
var AttachmentSchema2 =
|
9711
|
-
fileName:
|
9712
|
-
fileType:
|
9713
|
-
emailEngineAttachmentId:
|
9714
|
-
uploadId:
|
9715
|
-
messageId:
|
9716
|
-
roomId:
|
9722
|
+
var AttachmentSchema2 = z123.object({
|
9723
|
+
fileName: z123.string(),
|
9724
|
+
fileType: z123.string(),
|
9725
|
+
emailEngineAttachmentId: z123.string(),
|
9726
|
+
uploadId: z123.string(),
|
9727
|
+
messageId: z123.string(),
|
9728
|
+
roomId: z123.string(),
|
9717
9729
|
upload: UploadSchema
|
9718
9730
|
});
|
9719
9731
|
|
9720
9732
|
// src/mail/schemas/room-validation.schema.ts
|
9721
|
-
import
|
9733
|
+
import z124 from "zod";
|
9722
9734
|
var RoomContractsValidationSchema = {
|
9723
9735
|
getAll: {
|
9724
|
-
input:
|
9725
|
-
page:
|
9726
|
-
pageSize:
|
9727
|
-
keyword:
|
9728
|
-
value:
|
9729
|
-
category:
|
9736
|
+
input: z124.object({
|
9737
|
+
page: z124.coerce.number().default(1),
|
9738
|
+
pageSize: z124.coerce.number().default(10),
|
9739
|
+
keyword: z124.object({
|
9740
|
+
value: z124.string(),
|
9741
|
+
category: z124.union([z124.literal("contact"), z124.literal("message")])
|
9730
9742
|
}).optional(),
|
9731
|
-
contactLabels:
|
9732
|
-
channels:
|
9733
|
-
date:
|
9734
|
-
contacts:
|
9735
|
-
assignees:
|
9736
|
-
level1:
|
9737
|
-
|
9738
|
-
|
9739
|
-
|
9740
|
-
|
9741
|
-
|
9742
|
-
|
9743
|
+
contactLabels: z124.array(z124.string()).optional(),
|
9744
|
+
channels: z124.array(z124.string().email()).optional(),
|
9745
|
+
date: z124.string().optional(),
|
9746
|
+
contacts: z124.array(z124.string()).optional(),
|
9747
|
+
assignees: z124.array(z124.string()).optional(),
|
9748
|
+
level1: z124.union([
|
9749
|
+
z124.literal("open"),
|
9750
|
+
z124.literal("close"),
|
9751
|
+
z124.literal("inbox"),
|
9752
|
+
z124.literal("sent"),
|
9753
|
+
z124.literal("scheduled"),
|
9754
|
+
z124.literal("starred")
|
9743
9755
|
]).optional(),
|
9744
|
-
level2:
|
9745
|
-
|
9746
|
-
|
9747
|
-
|
9748
|
-
|
9756
|
+
level2: z124.union([
|
9757
|
+
z124.literal("all"),
|
9758
|
+
z124.literal("unassign"),
|
9759
|
+
z124.literal("mine"),
|
9760
|
+
z124.literal("other")
|
9749
9761
|
]).optional()
|
9750
9762
|
}),
|
9751
|
-
output:
|
9752
|
-
data:
|
9753
|
-
total:
|
9754
|
-
page:
|
9755
|
-
pageSize:
|
9763
|
+
output: z124.object({
|
9764
|
+
data: z124.array(MailRoomSchema),
|
9765
|
+
total: z124.number(),
|
9766
|
+
page: z124.number(),
|
9767
|
+
pageSize: z124.number()
|
9756
9768
|
})
|
9757
9769
|
},
|
9758
9770
|
update: {
|
9759
|
-
input:
|
9760
|
-
disposition:
|
9761
|
-
|
9762
|
-
|
9763
|
-
|
9764
|
-
|
9765
|
-
|
9766
|
-
|
9771
|
+
input: z124.object({
|
9772
|
+
disposition: z124.union([
|
9773
|
+
z124.literal("resolved"),
|
9774
|
+
z124.literal("follow up"),
|
9775
|
+
z124.literal("escalated"),
|
9776
|
+
z124.literal("dropped"),
|
9777
|
+
z124.literal("prank"),
|
9778
|
+
z124.literal("blank")
|
9767
9779
|
]).optional().nullable(),
|
9768
|
-
assigneeId:
|
9769
|
-
note:
|
9770
|
-
tags:
|
9771
|
-
handover:
|
9772
|
-
|
9780
|
+
assigneeId: z124.string().uuid().optional().nullable(),
|
9781
|
+
note: z124.string().optional(),
|
9782
|
+
tags: z124.array(z124.string().uuid()).optional(),
|
9783
|
+
handover: z124.boolean().or(
|
9784
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9773
9785
|
).optional().nullable(),
|
9774
|
-
selfAssign:
|
9775
|
-
|
9786
|
+
selfAssign: z124.boolean().or(
|
9787
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9776
9788
|
).optional().nullable()
|
9777
9789
|
})
|
9778
9790
|
}
|
@@ -9786,7 +9798,7 @@ var roomContract = initContract47().router(
|
|
9786
9798
|
path: "/",
|
9787
9799
|
responses: {
|
9788
9800
|
200: DefaultSuccessResponseSchema.extend({
|
9789
|
-
message:
|
9801
|
+
message: z125.string()
|
9790
9802
|
}),
|
9791
9803
|
...DefaultResponses
|
9792
9804
|
},
|
@@ -9799,10 +9811,10 @@ var roomContract = initContract47().router(
|
|
9799
9811
|
query: RoomContractsValidationSchema.getAll.input,
|
9800
9812
|
responses: {
|
9801
9813
|
200: DefaultSuccessResponseSchema.extend({
|
9802
|
-
data:
|
9803
|
-
total:
|
9804
|
-
page:
|
9805
|
-
pageSize:
|
9814
|
+
data: z125.array(MailRoomSchema),
|
9815
|
+
total: z125.number(),
|
9816
|
+
page: z125.number(),
|
9817
|
+
pageSize: z125.number()
|
9806
9818
|
}),
|
9807
9819
|
...DefaultResponses
|
9808
9820
|
},
|
@@ -9814,24 +9826,24 @@ var roomContract = initContract47().router(
|
|
9814
9826
|
path: "/count_rooms/all",
|
9815
9827
|
responses: {
|
9816
9828
|
200: DefaultSuccessResponseSchema.extend({
|
9817
|
-
data:
|
9818
|
-
general:
|
9819
|
-
|
9820
|
-
name:
|
9821
|
-
count:
|
9822
|
-
unReadMessagesCount:
|
9829
|
+
data: z125.object({
|
9830
|
+
general: z125.array(
|
9831
|
+
z125.object({
|
9832
|
+
name: z125.string(),
|
9833
|
+
count: z125.number(),
|
9834
|
+
unReadMessagesCount: z125.number()
|
9823
9835
|
})
|
9824
9836
|
),
|
9825
|
-
channels:
|
9826
|
-
|
9837
|
+
channels: z125.array(
|
9838
|
+
z125.object({
|
9827
9839
|
channel: MailAccountSchema,
|
9828
|
-
count:
|
9840
|
+
count: z125.number()
|
9829
9841
|
})
|
9830
9842
|
),
|
9831
|
-
contactLabels:
|
9832
|
-
|
9843
|
+
contactLabels: z125.array(
|
9844
|
+
z125.object({
|
9833
9845
|
label: TagSchema,
|
9834
|
-
count:
|
9846
|
+
count: z125.number()
|
9835
9847
|
})
|
9836
9848
|
)
|
9837
9849
|
})
|
@@ -9843,12 +9855,12 @@ var roomContract = initContract47().router(
|
|
9843
9855
|
getAttachments: {
|
9844
9856
|
method: "GET",
|
9845
9857
|
path: "/:id/attachments",
|
9846
|
-
pathParams:
|
9847
|
-
id:
|
9858
|
+
pathParams: z125.object({
|
9859
|
+
id: z125.string().uuid()
|
9848
9860
|
}),
|
9849
9861
|
responses: {
|
9850
9862
|
200: DefaultSuccessResponseSchema.extend({
|
9851
|
-
data:
|
9863
|
+
data: z125.array(AttachmentSchema2)
|
9852
9864
|
}),
|
9853
9865
|
...DefaultResponses
|
9854
9866
|
},
|
@@ -9857,12 +9869,12 @@ var roomContract = initContract47().router(
|
|
9857
9869
|
getParticipants: {
|
9858
9870
|
method: "GET",
|
9859
9871
|
path: "/:id/participants",
|
9860
|
-
pathParams:
|
9861
|
-
id:
|
9872
|
+
pathParams: z125.object({
|
9873
|
+
id: z125.string().uuid()
|
9862
9874
|
}),
|
9863
9875
|
responses: {
|
9864
9876
|
200: DefaultSuccessResponseSchema.extend({
|
9865
|
-
data:
|
9877
|
+
data: z125.array(MailParticipant)
|
9866
9878
|
}),
|
9867
9879
|
...DefaultResponses
|
9868
9880
|
},
|
@@ -9873,22 +9885,22 @@ var roomContract = initContract47().router(
|
|
9873
9885
|
path: "/add_email_to_contact",
|
9874
9886
|
responses: {
|
9875
9887
|
200: DefaultSuccessResponseSchema.extend({
|
9876
|
-
data:
|
9888
|
+
data: z125.string()
|
9877
9889
|
}),
|
9878
9890
|
...DefaultResponses
|
9879
9891
|
},
|
9880
|
-
body:
|
9881
|
-
email:
|
9882
|
-
contactId:
|
9883
|
-
mailUserId:
|
9892
|
+
body: z125.object({
|
9893
|
+
email: z125.string(),
|
9894
|
+
contactId: z125.string(),
|
9895
|
+
mailUserId: z125.string()
|
9884
9896
|
}),
|
9885
9897
|
summary: "Add a new email of a mail room participant to an existing contact"
|
9886
9898
|
},
|
9887
9899
|
update: {
|
9888
9900
|
method: "PATCH",
|
9889
9901
|
path: "/:id",
|
9890
|
-
pathParams:
|
9891
|
-
id:
|
9902
|
+
pathParams: z125.object({
|
9903
|
+
id: z125.string()
|
9892
9904
|
}),
|
9893
9905
|
responses: {
|
9894
9906
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9902,12 +9914,12 @@ var roomContract = initContract47().router(
|
|
9902
9914
|
markAsRead: {
|
9903
9915
|
method: "POST",
|
9904
9916
|
path: "/mark_as_read",
|
9905
|
-
body:
|
9906
|
-
id:
|
9917
|
+
body: z125.object({
|
9918
|
+
id: z125.string()
|
9907
9919
|
}),
|
9908
9920
|
responses: {
|
9909
9921
|
200: DefaultSuccessResponseSchema.extend({
|
9910
|
-
message:
|
9922
|
+
message: z125.string()
|
9911
9923
|
}),
|
9912
9924
|
...DefaultResponses
|
9913
9925
|
},
|
@@ -9916,8 +9928,8 @@ var roomContract = initContract47().router(
|
|
9916
9928
|
getById: {
|
9917
9929
|
method: "GET",
|
9918
9930
|
path: "/:id",
|
9919
|
-
pathParams:
|
9920
|
-
id:
|
9931
|
+
pathParams: z125.object({
|
9932
|
+
id: z125.string().uuid()
|
9921
9933
|
}),
|
9922
9934
|
responses: {
|
9923
9935
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9935,70 +9947,70 @@ var roomContract = initContract47().router(
|
|
9935
9947
|
|
9936
9948
|
// src/mail/account-contract.ts
|
9937
9949
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9938
|
-
import
|
9950
|
+
import z127 from "zod";
|
9939
9951
|
|
9940
9952
|
// src/mail/schemas/account-validation.schema.ts
|
9941
|
-
import
|
9953
|
+
import z126 from "zod";
|
9942
9954
|
var AccountContractsValidationSchemas = {
|
9943
9955
|
create: {
|
9944
|
-
input:
|
9945
|
-
address:
|
9946
|
-
name:
|
9947
|
-
password:
|
9948
|
-
mailServerId:
|
9956
|
+
input: z126.object({
|
9957
|
+
address: z126.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9958
|
+
name: z126.string().min(1, "Account name cannot be empty."),
|
9959
|
+
password: z126.string().min(1, "Password cannot be empty."),
|
9960
|
+
mailServerId: z126.string().uuid("Invalid mail_server_id")
|
9949
9961
|
})
|
9950
9962
|
},
|
9951
9963
|
getById: {
|
9952
|
-
input:
|
9953
|
-
id:
|
9964
|
+
input: z126.object({
|
9965
|
+
id: z126.string().uuid()
|
9954
9966
|
}),
|
9955
9967
|
output: MailAccountSchema
|
9956
9968
|
},
|
9957
9969
|
getAll: {
|
9958
|
-
output:
|
9970
|
+
output: z126.array(MailAccountSchema)
|
9959
9971
|
},
|
9960
9972
|
update: {
|
9961
9973
|
input: MailAccountSchema,
|
9962
9974
|
output: MailAccountSchema
|
9963
9975
|
},
|
9964
9976
|
disconnect: {
|
9965
|
-
input:
|
9966
|
-
id:
|
9977
|
+
input: z126.object({
|
9978
|
+
id: z126.string().uuid()
|
9967
9979
|
}),
|
9968
9980
|
output: MailAccountSchema
|
9969
9981
|
},
|
9970
9982
|
reconnect: {
|
9971
|
-
input:
|
9972
|
-
id:
|
9983
|
+
input: z126.object({
|
9984
|
+
id: z126.string()
|
9973
9985
|
}),
|
9974
9986
|
output: MailAccountSchema
|
9975
9987
|
},
|
9976
9988
|
delete: {
|
9977
|
-
input:
|
9978
|
-
id:
|
9989
|
+
input: z126.object({
|
9990
|
+
id: z126.string()
|
9979
9991
|
}),
|
9980
|
-
output:
|
9992
|
+
output: z126.string()
|
9981
9993
|
},
|
9982
9994
|
deleteEmailEngineAcc: {
|
9983
|
-
input:
|
9984
|
-
account:
|
9995
|
+
input: z126.object({
|
9996
|
+
account: z126.string()
|
9985
9997
|
}),
|
9986
9998
|
output: MailAccountSchema
|
9987
9999
|
},
|
9988
10000
|
generateOAuth2AuthenticationLink: {
|
9989
|
-
body:
|
9990
|
-
oAuth2AppId:
|
9991
|
-
mailServerId:
|
10001
|
+
body: z126.object({
|
10002
|
+
oAuth2AppId: z126.string(),
|
10003
|
+
mailServerId: z126.string()
|
9992
10004
|
}),
|
9993
|
-
response:
|
9994
|
-
url:
|
9995
|
-
account:
|
10005
|
+
response: z126.object({
|
10006
|
+
url: z126.string(),
|
10007
|
+
account: z126.string()
|
9996
10008
|
})
|
9997
10009
|
},
|
9998
10010
|
createOAuth2Acc: {
|
9999
|
-
body:
|
10000
|
-
account:
|
10001
|
-
name:
|
10011
|
+
body: z126.object({
|
10012
|
+
account: z126.string(),
|
10013
|
+
name: z126.string()
|
10002
10014
|
}),
|
10003
10015
|
response: MailAccountSchema
|
10004
10016
|
}
|
@@ -10016,14 +10028,14 @@ var accountContract = initContract48().router(
|
|
10016
10028
|
// data: AccountContractsValidationSchemas.create.output,
|
10017
10029
|
data: MailAccountSchema
|
10018
10030
|
}),
|
10019
|
-
400:
|
10020
|
-
message:
|
10031
|
+
400: z127.object({
|
10032
|
+
message: z127.string()
|
10021
10033
|
}),
|
10022
|
-
409:
|
10023
|
-
message:
|
10034
|
+
409: z127.object({
|
10035
|
+
message: z127.string()
|
10024
10036
|
}),
|
10025
|
-
500:
|
10026
|
-
message:
|
10037
|
+
500: z127.object({
|
10038
|
+
message: z127.string()
|
10027
10039
|
}),
|
10028
10040
|
...DefaultResponses
|
10029
10041
|
},
|
@@ -10039,14 +10051,14 @@ var accountContract = initContract48().router(
|
|
10039
10051
|
201: DefaultSuccessResponseSchema.extend({
|
10040
10052
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10041
10053
|
}),
|
10042
|
-
400:
|
10043
|
-
message:
|
10054
|
+
400: z127.object({
|
10055
|
+
message: z127.string()
|
10044
10056
|
}),
|
10045
|
-
409:
|
10046
|
-
message:
|
10057
|
+
409: z127.object({
|
10058
|
+
message: z127.string()
|
10047
10059
|
}),
|
10048
|
-
500:
|
10049
|
-
message:
|
10060
|
+
500: z127.object({
|
10061
|
+
message: z127.string()
|
10050
10062
|
}),
|
10051
10063
|
...DefaultResponses
|
10052
10064
|
},
|
@@ -10060,7 +10072,7 @@ var accountContract = initContract48().router(
|
|
10060
10072
|
path: "/sync",
|
10061
10073
|
responses: {
|
10062
10074
|
200: DefaultSuccessResponseSchema.extend({
|
10063
|
-
message:
|
10075
|
+
message: z127.string()
|
10064
10076
|
}),
|
10065
10077
|
...DefaultResponses
|
10066
10078
|
},
|
@@ -10085,13 +10097,13 @@ var accountContract = initContract48().router(
|
|
10085
10097
|
getAll: {
|
10086
10098
|
method: "GET",
|
10087
10099
|
path: "",
|
10088
|
-
query:
|
10089
|
-
state:
|
10090
|
-
withDeleted:
|
10100
|
+
query: z127.object({
|
10101
|
+
state: z127.union([z127.literal("connected"), z127.literal("disconnected")]).optional(),
|
10102
|
+
withDeleted: z127.boolean().default(false)
|
10091
10103
|
}).optional(),
|
10092
10104
|
responses: {
|
10093
10105
|
200: DefaultSuccessResponseSchema.extend({
|
10094
|
-
data:
|
10106
|
+
data: z127.array(MailAccountSchema)
|
10095
10107
|
}),
|
10096
10108
|
...DefaultResponses
|
10097
10109
|
},
|
@@ -10102,8 +10114,8 @@ var accountContract = initContract48().router(
|
|
10102
10114
|
update: {
|
10103
10115
|
method: "PATCH",
|
10104
10116
|
path: "/:id",
|
10105
|
-
pathParams:
|
10106
|
-
id:
|
10117
|
+
pathParams: z127.object({
|
10118
|
+
id: z127.string().uuid()
|
10107
10119
|
}),
|
10108
10120
|
responses: {
|
10109
10121
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10152,7 +10164,7 @@ var accountContract = initContract48().router(
|
|
10152
10164
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10153
10165
|
responses: {
|
10154
10166
|
200: DefaultSuccessResponseSchema.extend({
|
10155
|
-
message:
|
10167
|
+
message: z127.string()
|
10156
10168
|
}),
|
10157
10169
|
...DefaultResponses
|
10158
10170
|
},
|
@@ -10167,7 +10179,7 @@ var accountContract = initContract48().router(
|
|
10167
10179
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10168
10180
|
responses: {
|
10169
10181
|
200: DefaultSuccessResponseSchema.extend({
|
10170
|
-
message:
|
10182
|
+
message: z127.string()
|
10171
10183
|
}),
|
10172
10184
|
...DefaultResponses
|
10173
10185
|
},
|
@@ -10196,20 +10208,20 @@ var accountContract = initContract48().router(
|
|
10196
10208
|
|
10197
10209
|
// src/mail/mail-server-contract.ts
|
10198
10210
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10199
|
-
import
|
10211
|
+
import z129 from "zod";
|
10200
10212
|
|
10201
10213
|
// src/mail/schemas/servers-validation.schema.ts
|
10202
|
-
import
|
10203
|
-
var CreateMailServerSchema =
|
10204
|
-
name:
|
10205
|
-
smtpHost:
|
10206
|
-
smtpPort:
|
10207
|
-
smtpTlsPort:
|
10208
|
-
useTlsForSmtp:
|
10209
|
-
imapHost:
|
10210
|
-
imapPort:
|
10211
|
-
imapTlsPort:
|
10212
|
-
useTlsForImap:
|
10214
|
+
import z128 from "zod";
|
10215
|
+
var CreateMailServerSchema = z128.object({
|
10216
|
+
name: z128.string(),
|
10217
|
+
smtpHost: z128.string(),
|
10218
|
+
smtpPort: z128.number(),
|
10219
|
+
smtpTlsPort: z128.number(),
|
10220
|
+
useTlsForSmtp: z128.boolean(),
|
10221
|
+
imapHost: z128.string(),
|
10222
|
+
imapPort: z128.number(),
|
10223
|
+
imapTlsPort: z128.number(),
|
10224
|
+
useTlsForImap: z128.boolean()
|
10213
10225
|
});
|
10214
10226
|
|
10215
10227
|
// src/mail/mail-server-contract.ts
|
@@ -10232,11 +10244,11 @@ var serverContract = initContract49().router(
|
|
10232
10244
|
path: "/oauth2/apps",
|
10233
10245
|
responses: {
|
10234
10246
|
200: DefaultSuccessResponseSchema.extend({
|
10235
|
-
data:
|
10236
|
-
total:
|
10237
|
-
pages:
|
10238
|
-
page:
|
10239
|
-
apps:
|
10247
|
+
data: z129.object({
|
10248
|
+
total: z129.number(),
|
10249
|
+
pages: z129.number(),
|
10250
|
+
page: z129.number(),
|
10251
|
+
apps: z129.array(OAuth2AppSchema)
|
10240
10252
|
})
|
10241
10253
|
}),
|
10242
10254
|
...DefaultResponses
|
@@ -10246,8 +10258,8 @@ var serverContract = initContract49().router(
|
|
10246
10258
|
getById: {
|
10247
10259
|
method: "GET",
|
10248
10260
|
path: "/:id",
|
10249
|
-
pathParams:
|
10250
|
-
id:
|
10261
|
+
pathParams: z129.object({
|
10262
|
+
id: z129.string().uuid()
|
10251
10263
|
}),
|
10252
10264
|
responses: {
|
10253
10265
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10262,7 +10274,7 @@ var serverContract = initContract49().router(
|
|
10262
10274
|
path: "/",
|
10263
10275
|
responses: {
|
10264
10276
|
200: DefaultSuccessResponseSchema.extend({
|
10265
|
-
data:
|
10277
|
+
data: z129.array(MailServerSchema)
|
10266
10278
|
}),
|
10267
10279
|
...DefaultResponses
|
10268
10280
|
},
|
@@ -10271,8 +10283,8 @@ var serverContract = initContract49().router(
|
|
10271
10283
|
update: {
|
10272
10284
|
method: "PATCH",
|
10273
10285
|
path: "/:id",
|
10274
|
-
pathParams:
|
10275
|
-
id:
|
10286
|
+
pathParams: z129.object({
|
10287
|
+
id: z129.string().uuid()
|
10276
10288
|
}),
|
10277
10289
|
responses: {
|
10278
10290
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10286,8 +10298,8 @@ var serverContract = initContract49().router(
|
|
10286
10298
|
delete: {
|
10287
10299
|
method: "DELETE",
|
10288
10300
|
path: "/:id",
|
10289
|
-
pathParams:
|
10290
|
-
id:
|
10301
|
+
pathParams: z129.object({
|
10302
|
+
id: z129.string().uuid()
|
10291
10303
|
}),
|
10292
10304
|
responses: {
|
10293
10305
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10306,45 +10318,45 @@ var serverContract = initContract49().router(
|
|
10306
10318
|
|
10307
10319
|
// src/mail/message-contract.ts
|
10308
10320
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10309
|
-
import
|
10321
|
+
import z131 from "zod";
|
10310
10322
|
|
10311
10323
|
// src/mail/schemas/message-validation.schema.ts
|
10312
|
-
import
|
10313
|
-
var MailParticipant2 =
|
10314
|
-
name:
|
10315
|
-
address:
|
10324
|
+
import z130 from "zod";
|
10325
|
+
var MailParticipant2 = z130.object({
|
10326
|
+
name: z130.string().optional(),
|
10327
|
+
address: z130.string().email()
|
10316
10328
|
});
|
10317
10329
|
var MessageContractsValidationsSchema = {
|
10318
10330
|
submit: {
|
10319
|
-
input:
|
10320
|
-
subject:
|
10321
|
-
text:
|
10322
|
-
html:
|
10331
|
+
input: z130.object({
|
10332
|
+
subject: z130.string(),
|
10333
|
+
text: z130.string(),
|
10334
|
+
html: z130.string(),
|
10323
10335
|
from: MailParticipant2,
|
10324
10336
|
to: MailParticipant2,
|
10325
|
-
cc:
|
10326
|
-
bcc:
|
10327
|
-
sendAt:
|
10328
|
-
reference:
|
10329
|
-
messageId:
|
10330
|
-
action:
|
10337
|
+
cc: z130.array(MailParticipant2).optional(),
|
10338
|
+
bcc: z130.array(MailParticipant2).optional(),
|
10339
|
+
sendAt: z130.string().optional(),
|
10340
|
+
reference: z130.object({
|
10341
|
+
messageId: z130.string(),
|
10342
|
+
action: z130.union([z130.literal("reply"), z130.literal("forward")])
|
10331
10343
|
}).optional(),
|
10332
|
-
attachments:
|
10333
|
-
|
10334
|
-
fileType:
|
10335
|
-
fileName:
|
10336
|
-
fileKey:
|
10337
|
-
fileSize:
|
10338
|
-
bucketName:
|
10339
|
-
presignedUrl:
|
10344
|
+
attachments: z130.array(
|
10345
|
+
z130.object({
|
10346
|
+
fileType: z130.string(),
|
10347
|
+
fileName: z130.string(),
|
10348
|
+
fileKey: z130.string(),
|
10349
|
+
fileSize: z130.number(),
|
10350
|
+
bucketName: z130.string(),
|
10351
|
+
presignedUrl: z130.string()
|
10340
10352
|
})
|
10341
10353
|
).optional()
|
10342
10354
|
}),
|
10343
|
-
output:
|
10344
|
-
response:
|
10345
|
-
messageId:
|
10346
|
-
sendAt:
|
10347
|
-
queueId:
|
10355
|
+
output: z130.object({
|
10356
|
+
response: z130.string(),
|
10357
|
+
messageId: z130.string(),
|
10358
|
+
sendAt: z130.string(),
|
10359
|
+
queueId: z130.string()
|
10348
10360
|
})
|
10349
10361
|
}
|
10350
10362
|
};
|
@@ -10373,8 +10385,8 @@ var messageContract = initContract50().router(
|
|
10373
10385
|
path: "/new_message_count",
|
10374
10386
|
responses: {
|
10375
10387
|
200: DefaultSuccessResponseSchema.extend({
|
10376
|
-
data:
|
10377
|
-
count:
|
10388
|
+
data: z131.object({
|
10389
|
+
count: z131.number()
|
10378
10390
|
})
|
10379
10391
|
}),
|
10380
10392
|
...DefaultResponses
|
@@ -10386,8 +10398,8 @@ var messageContract = initContract50().router(
|
|
10386
10398
|
getById: {
|
10387
10399
|
method: "GET",
|
10388
10400
|
path: "/:id",
|
10389
|
-
pathParams:
|
10390
|
-
id:
|
10401
|
+
pathParams: z131.object({
|
10402
|
+
id: z131.string()
|
10391
10403
|
}),
|
10392
10404
|
responses: {
|
10393
10405
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10402,8 +10414,8 @@ var messageContract = initContract50().router(
|
|
10402
10414
|
update: {
|
10403
10415
|
method: "PATCH",
|
10404
10416
|
path: "/:id",
|
10405
|
-
pathParams:
|
10406
|
-
id:
|
10417
|
+
pathParams: z131.object({
|
10418
|
+
id: z131.string()
|
10407
10419
|
}),
|
10408
10420
|
responses: {
|
10409
10421
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10419,8 +10431,8 @@ var messageContract = initContract50().router(
|
|
10419
10431
|
delete: {
|
10420
10432
|
method: "DELETE",
|
10421
10433
|
path: "/:id",
|
10422
|
-
pathParams:
|
10423
|
-
id:
|
10434
|
+
pathParams: z131.object({
|
10435
|
+
id: z131.string()
|
10424
10436
|
}),
|
10425
10437
|
responses: {
|
10426
10438
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10436,13 +10448,13 @@ var messageContract = initContract50().router(
|
|
10436
10448
|
cancelScheduledMessage: {
|
10437
10449
|
method: "DELETE",
|
10438
10450
|
path: "/scheduled_message/:id",
|
10439
|
-
pathParams:
|
10440
|
-
id:
|
10451
|
+
pathParams: z131.object({
|
10452
|
+
id: z131.string()
|
10441
10453
|
}),
|
10442
10454
|
responses: {
|
10443
10455
|
200: DefaultSuccessResponseSchema.extend({
|
10444
|
-
data:
|
10445
|
-
totalMessagesCount:
|
10456
|
+
data: z131.object({
|
10457
|
+
totalMessagesCount: z131.number()
|
10446
10458
|
})
|
10447
10459
|
}),
|
10448
10460
|
...DefaultResponses
|
@@ -10467,38 +10479,38 @@ var mailContract = initContract51().router({
|
|
10467
10479
|
|
10468
10480
|
// src/webchat/index.ts
|
10469
10481
|
import { initContract as initContract52 } from "@ts-rest/core";
|
10470
|
-
import
|
10482
|
+
import z134 from "zod";
|
10471
10483
|
|
10472
10484
|
// src/webchat/schema.ts
|
10473
|
-
import
|
10485
|
+
import z133 from "zod";
|
10474
10486
|
|
10475
10487
|
// src/webchat/validation.ts
|
10476
|
-
import
|
10488
|
+
import z132 from "zod";
|
10477
10489
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10478
10490
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10479
10491
|
return ChatwootChannelType3;
|
10480
10492
|
})(ChatwootChannelType2 || {});
|
10481
|
-
var WebChatChannelSchema =
|
10482
|
-
avatar:
|
10483
|
-
name:
|
10484
|
-
type:
|
10485
|
-
websiteName:
|
10486
|
-
welcomeTitle:
|
10487
|
-
websiteUrl:
|
10488
|
-
welcomeTagline:
|
10489
|
-
agentAwayMessage:
|
10490
|
-
widgetColor:
|
10493
|
+
var WebChatChannelSchema = z132.object({
|
10494
|
+
avatar: z132.string().optional(),
|
10495
|
+
name: z132.string(),
|
10496
|
+
type: z132.nativeEnum(ChatwootChannelType2),
|
10497
|
+
websiteName: z132.string(),
|
10498
|
+
welcomeTitle: z132.string(),
|
10499
|
+
websiteUrl: z132.string().url(),
|
10500
|
+
welcomeTagline: z132.string().optional(),
|
10501
|
+
agentAwayMessage: z132.string().optional(),
|
10502
|
+
widgetColor: z132.string().optional()
|
10491
10503
|
});
|
10492
10504
|
|
10493
10505
|
// src/webchat/schema.ts
|
10494
|
-
var ConnectWebChatChannelSchema =
|
10495
|
-
name:
|
10496
|
-
actor:
|
10497
|
-
id:
|
10498
|
-
name:
|
10499
|
-
email:
|
10500
|
-
address:
|
10501
|
-
phone:
|
10506
|
+
var ConnectWebChatChannelSchema = z133.object({
|
10507
|
+
name: z133.string(),
|
10508
|
+
actor: z133.object({
|
10509
|
+
id: z133.string().uuid(),
|
10510
|
+
name: z133.string(),
|
10511
|
+
email: z133.string().email(),
|
10512
|
+
address: z133.string().nullable(),
|
10513
|
+
phone: z133.string().nullable()
|
10502
10514
|
}),
|
10503
10515
|
channel: WebChatChannelSchema
|
10504
10516
|
});
|
@@ -10532,8 +10544,8 @@ var platformWebchatContract = initContract52().router(
|
|
10532
10544
|
disconnectToService: {
|
10533
10545
|
method: "POST",
|
10534
10546
|
path: "/disconnect",
|
10535
|
-
body:
|
10536
|
-
id:
|
10547
|
+
body: z134.object({
|
10548
|
+
id: z134.string().uuid()
|
10537
10549
|
}),
|
10538
10550
|
responses: {
|
10539
10551
|
200: ChannelServiceResponseSchema,
|
@@ -10544,8 +10556,8 @@ var platformWebchatContract = initContract52().router(
|
|
10544
10556
|
reconnect: {
|
10545
10557
|
method: "POST",
|
10546
10558
|
path: "/reconnect/:channelId",
|
10547
|
-
pathParams:
|
10548
|
-
channelId:
|
10559
|
+
pathParams: z134.object({
|
10560
|
+
channelId: z134.string().uuid()
|
10549
10561
|
}),
|
10550
10562
|
body: null,
|
10551
10563
|
responses: {
|
@@ -10557,8 +10569,8 @@ var platformWebchatContract = initContract52().router(
|
|
10557
10569
|
delete: {
|
10558
10570
|
method: "DELETE",
|
10559
10571
|
path: "/delete/:channelId",
|
10560
|
-
pathParams:
|
10561
|
-
channelId:
|
10572
|
+
pathParams: z134.object({
|
10573
|
+
channelId: z134.string().uuid()
|
10562
10574
|
}),
|
10563
10575
|
body: null,
|
10564
10576
|
responses: {
|
@@ -10575,18 +10587,18 @@ var platformWebchatContract = initContract52().router(
|
|
10575
10587
|
|
10576
10588
|
// src/hold-label/index.ts
|
10577
10589
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10578
|
-
import
|
10590
|
+
import z136 from "zod";
|
10579
10591
|
|
10580
10592
|
// src/hold-label/validation.ts
|
10581
|
-
import
|
10582
|
-
var UpdatePositionSchema2 =
|
10583
|
-
holdLabels:
|
10584
|
-
|
10593
|
+
import z135 from "zod";
|
10594
|
+
var UpdatePositionSchema2 = z135.object({
|
10595
|
+
holdLabels: z135.array(
|
10596
|
+
z135.object({ id: z135.string().uuid(), position: z135.number() })
|
10585
10597
|
)
|
10586
10598
|
});
|
10587
|
-
var HoldRoomSchema =
|
10588
|
-
roomId:
|
10589
|
-
holdLabelId:
|
10599
|
+
var HoldRoomSchema = z135.object({
|
10600
|
+
roomId: z135.string().uuid(),
|
10601
|
+
holdLabelId: z135.string().uuid()
|
10590
10602
|
});
|
10591
10603
|
|
10592
10604
|
// src/hold-label/index.ts
|
@@ -10595,7 +10607,7 @@ var holdLabelContract = initContract53().router(
|
|
10595
10607
|
createHoldLabel: {
|
10596
10608
|
method: "POST",
|
10597
10609
|
path: "/",
|
10598
|
-
body:
|
10610
|
+
body: z136.object({ name: z136.string() }),
|
10599
10611
|
responses: {
|
10600
10612
|
201: DefaultSuccessResponseSchema.extend({
|
10601
10613
|
holdLabel: HoldLabelSchema
|
@@ -10607,7 +10619,7 @@ var holdLabelContract = initContract53().router(
|
|
10607
10619
|
path: "/",
|
10608
10620
|
responses: {
|
10609
10621
|
200: DefaultSuccessResponseSchema.extend({
|
10610
|
-
holdLabels:
|
10622
|
+
holdLabels: z136.array(HoldLabelSchema)
|
10611
10623
|
})
|
10612
10624
|
}
|
10613
10625
|
},
|
@@ -10625,8 +10637,8 @@ var holdLabelContract = initContract53().router(
|
|
10625
10637
|
updateHoldLabel: {
|
10626
10638
|
method: "PATCH",
|
10627
10639
|
path: "/:id",
|
10628
|
-
pathParams:
|
10629
|
-
body:
|
10640
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
10641
|
+
body: z136.object({ name: z136.string() }),
|
10630
10642
|
responses: {
|
10631
10643
|
200: DefaultSuccessResponseSchema.extend({
|
10632
10644
|
holdLabel: HoldLabelSchema
|
@@ -10636,7 +10648,7 @@ var holdLabelContract = initContract53().router(
|
|
10636
10648
|
deleteHoldLabel: {
|
10637
10649
|
method: "DELETE",
|
10638
10650
|
path: "/:id",
|
10639
|
-
pathParams:
|
10651
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
10640
10652
|
body: null,
|
10641
10653
|
responses: {
|
10642
10654
|
200: DefaultSuccessResponseSchema
|
@@ -10647,10 +10659,10 @@ var holdLabelContract = initContract53().router(
|
|
10647
10659
|
path: "/auto-unhold",
|
10648
10660
|
responses: {
|
10649
10661
|
200: DefaultSuccessResponseSchema.extend({
|
10650
|
-
autoUnhold:
|
10651
|
-
resumeLabel:
|
10652
|
-
show:
|
10653
|
-
name:
|
10662
|
+
autoUnhold: z136.boolean(),
|
10663
|
+
resumeLabel: z136.object({
|
10664
|
+
show: z136.boolean(),
|
10665
|
+
name: z136.string()
|
10654
10666
|
})
|
10655
10667
|
})
|
10656
10668
|
}
|
@@ -10658,19 +10670,19 @@ var holdLabelContract = initContract53().router(
|
|
10658
10670
|
updateAutoUnhold: {
|
10659
10671
|
method: "POST",
|
10660
10672
|
path: "/auto-unhold",
|
10661
|
-
body:
|
10662
|
-
autoUnhold:
|
10663
|
-
resumeLabel:
|
10664
|
-
show:
|
10665
|
-
name:
|
10673
|
+
body: z136.object({
|
10674
|
+
autoUnhold: z136.boolean().optional(),
|
10675
|
+
resumeLabel: z136.object({
|
10676
|
+
show: z136.boolean().optional(),
|
10677
|
+
name: z136.string().optional()
|
10666
10678
|
}).optional()
|
10667
10679
|
}),
|
10668
10680
|
responses: {
|
10669
10681
|
200: DefaultSuccessResponseSchema.extend({
|
10670
|
-
autoUnhold:
|
10671
|
-
resumeLabel:
|
10672
|
-
show:
|
10673
|
-
name:
|
10682
|
+
autoUnhold: z136.boolean(),
|
10683
|
+
resumeLabel: z136.object({
|
10684
|
+
show: z136.boolean(),
|
10685
|
+
name: z136.string()
|
10674
10686
|
})
|
10675
10687
|
})
|
10676
10688
|
}
|
@@ -10678,10 +10690,10 @@ var holdLabelContract = initContract53().router(
|
|
10678
10690
|
getHoldLogs: {
|
10679
10691
|
method: "GET",
|
10680
10692
|
path: "/hold-logs",
|
10681
|
-
query:
|
10693
|
+
query: z136.object({ cxLogId: z136.string().uuid() }),
|
10682
10694
|
responses: {
|
10683
|
-
200:
|
10684
|
-
holdLogs:
|
10695
|
+
200: z136.object({
|
10696
|
+
holdLogs: z136.array(FormattedHoldLogSchema)
|
10685
10697
|
})
|
10686
10698
|
}
|
10687
10699
|
},
|
@@ -10698,7 +10710,7 @@ var holdLabelContract = initContract53().router(
|
|
10698
10710
|
unholdRoom: {
|
10699
10711
|
method: "POST",
|
10700
10712
|
path: "/unhold-room",
|
10701
|
-
body:
|
10713
|
+
body: z136.object({ roomId: z136.string().uuid() }),
|
10702
10714
|
responses: {
|
10703
10715
|
200: DefaultSuccessResponseSchema.extend({
|
10704
10716
|
holdLog: HoldLogSchema.optional()
|
@@ -10711,89 +10723,89 @@ var holdLabelContract = initContract53().router(
|
|
10711
10723
|
|
10712
10724
|
// src/subscription/index.ts
|
10713
10725
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10714
|
-
import { z as
|
10726
|
+
import { z as z139 } from "zod";
|
10715
10727
|
|
10716
10728
|
// src/subscription/schema.ts
|
10717
|
-
import
|
10729
|
+
import z137 from "zod";
|
10718
10730
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10719
|
-
priceId:
|
10720
|
-
name:
|
10721
|
-
perUnit:
|
10722
|
-
price:
|
10723
|
-
currency:
|
10731
|
+
priceId: z137.string(),
|
10732
|
+
name: z137.string().nullable(),
|
10733
|
+
perUnit: z137.number(),
|
10734
|
+
price: z137.number(),
|
10735
|
+
currency: z137.string().nullable()
|
10724
10736
|
});
|
10725
10737
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10726
|
-
provider:
|
10727
|
-
productId:
|
10728
|
-
name:
|
10729
|
-
type:
|
10730
|
-
omnichannel:
|
10731
|
-
usageType:
|
10738
|
+
provider: z137.string(),
|
10739
|
+
productId: z137.string(),
|
10740
|
+
name: z137.string(),
|
10741
|
+
type: z137.string(),
|
10742
|
+
omnichannel: z137.string(),
|
10743
|
+
usageType: z137.string().nullable(),
|
10732
10744
|
productPrice: ProductPriceSchema
|
10733
10745
|
});
|
10734
10746
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10735
|
-
includedQuantity:
|
10747
|
+
includedQuantity: z137.number(),
|
10736
10748
|
product: ProductWithoutRelatedSchema
|
10737
10749
|
});
|
10738
10750
|
var ProductSchema = DefaultEntitySchema.extend({
|
10739
|
-
provider:
|
10740
|
-
productId:
|
10741
|
-
name:
|
10742
|
-
type:
|
10743
|
-
omnichannel:
|
10744
|
-
usageType:
|
10751
|
+
provider: z137.string(),
|
10752
|
+
productId: z137.string(),
|
10753
|
+
name: z137.string(),
|
10754
|
+
type: z137.string(),
|
10755
|
+
omnichannel: z137.string(),
|
10756
|
+
usageType: z137.string().nullable(),
|
10745
10757
|
productPrice: ProductPriceSchema,
|
10746
|
-
relatedProducts:
|
10758
|
+
relatedProducts: z137.array(RelatedProductSchema)
|
10747
10759
|
});
|
10748
10760
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10749
|
-
provider:
|
10750
|
-
customerId:
|
10751
|
-
email:
|
10752
|
-
name:
|
10753
|
-
balance:
|
10761
|
+
provider: z137.string(),
|
10762
|
+
customerId: z137.string(),
|
10763
|
+
email: z137.string(),
|
10764
|
+
name: z137.string(),
|
10765
|
+
balance: z137.number()
|
10754
10766
|
});
|
10755
10767
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10756
|
-
limit:
|
10757
|
-
subscriptionItemId:
|
10758
|
-
usage:
|
10768
|
+
limit: z137.number(),
|
10769
|
+
subscriptionItemId: z137.string(),
|
10770
|
+
usage: z137.number().nullable(),
|
10759
10771
|
product: ProductSchema
|
10760
10772
|
});
|
10761
10773
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10762
|
-
provider:
|
10763
|
-
type:
|
10764
|
-
subscriptionId:
|
10765
|
-
interval:
|
10766
|
-
quantity:
|
10767
|
-
amount:
|
10768
|
-
startAt:
|
10769
|
-
expireAt:
|
10770
|
-
status:
|
10771
|
-
name:
|
10772
|
-
subscriptionProducts:
|
10774
|
+
provider: z137.string(),
|
10775
|
+
type: z137.string(),
|
10776
|
+
subscriptionId: z137.string(),
|
10777
|
+
interval: z137.string(),
|
10778
|
+
quantity: z137.number(),
|
10779
|
+
amount: z137.number(),
|
10780
|
+
startAt: z137.date().nullable(),
|
10781
|
+
expireAt: z137.date(),
|
10782
|
+
status: z137.string(),
|
10783
|
+
name: z137.string().nullable(),
|
10784
|
+
subscriptionProducts: z137.array(SubscriptionProuctSchema),
|
10773
10785
|
productPrice: ProductPriceSchema,
|
10774
10786
|
product: ProductSchema
|
10775
10787
|
});
|
10776
10788
|
|
10777
10789
|
// src/subscription/validation.ts
|
10778
|
-
import { z as
|
10779
|
-
var GetAvailablePlanSchema =
|
10780
|
-
type:
|
10781
|
-
currency:
|
10782
|
-
});
|
10783
|
-
var UpdateSubscriptionSchema =
|
10784
|
-
planProductId:
|
10785
|
-
planProductPriceId:
|
10786
|
-
subscriptionId:
|
10787
|
-
subscriptionProducts:
|
10788
|
-
|
10789
|
-
productId:
|
10790
|
-
productPriceId:
|
10791
|
-
quantity:
|
10790
|
+
import { z as z138 } from "zod";
|
10791
|
+
var GetAvailablePlanSchema = z138.object({
|
10792
|
+
type: z138.string(),
|
10793
|
+
currency: z138.string()
|
10794
|
+
});
|
10795
|
+
var UpdateSubscriptionSchema = z138.object({
|
10796
|
+
planProductId: z138.string(),
|
10797
|
+
planProductPriceId: z138.string(),
|
10798
|
+
subscriptionId: z138.string(),
|
10799
|
+
subscriptionProducts: z138.array(
|
10800
|
+
z138.object({
|
10801
|
+
productId: z138.string(),
|
10802
|
+
productPriceId: z138.string(),
|
10803
|
+
quantity: z138.number()
|
10792
10804
|
})
|
10793
10805
|
)
|
10794
10806
|
});
|
10795
|
-
var TopUpBalanceSchema =
|
10796
|
-
quantity:
|
10807
|
+
var TopUpBalanceSchema = z138.object({
|
10808
|
+
quantity: z138.number()
|
10797
10809
|
});
|
10798
10810
|
|
10799
10811
|
// src/subscription/index.ts
|
@@ -10817,9 +10829,9 @@ var subscriptionContract = initContract54().router(
|
|
10817
10829
|
body: UpdateSubscriptionSchema,
|
10818
10830
|
responses: {
|
10819
10831
|
200: DefaultSuccessResponseSchema.extend({
|
10820
|
-
message:
|
10821
|
-
requireCheckout:
|
10822
|
-
checkoutUrl:
|
10832
|
+
message: z139.string(),
|
10833
|
+
requireCheckout: z139.boolean(),
|
10834
|
+
checkoutUrl: z139.string().nullable()
|
10823
10835
|
}),
|
10824
10836
|
402: DefaultErrorResponseSchema,
|
10825
10837
|
500: DefaultErrorResponseSchema
|
@@ -10831,7 +10843,7 @@ var subscriptionContract = initContract54().router(
|
|
10831
10843
|
body: TopUpBalanceSchema,
|
10832
10844
|
responses: {
|
10833
10845
|
200: DefaultSuccessResponseSchema.extend({
|
10834
|
-
checkoutUrl:
|
10846
|
+
checkoutUrl: z139.string()
|
10835
10847
|
}),
|
10836
10848
|
500: DefaultErrorResponseSchema
|
10837
10849
|
}
|
@@ -10842,7 +10854,18 @@ var subscriptionContract = initContract54().router(
|
|
10842
10854
|
query: GetAvailablePlanSchema,
|
10843
10855
|
responses: {
|
10844
10856
|
200: DefaultSuccessResponseSchema.extend({
|
10845
|
-
data:
|
10857
|
+
data: z139.array(ProductSchema)
|
10858
|
+
}),
|
10859
|
+
500: DefaultErrorResponseSchema
|
10860
|
+
}
|
10861
|
+
},
|
10862
|
+
getAvailableAddOns: {
|
10863
|
+
method: "GET",
|
10864
|
+
path: "/available-add-ons",
|
10865
|
+
query: GetAvailablePlanSchema,
|
10866
|
+
responses: {
|
10867
|
+
200: DefaultSuccessResponseSchema.extend({
|
10868
|
+
data: z139.array(ProductSchema)
|
10846
10869
|
}),
|
10847
10870
|
500: DefaultErrorResponseSchema
|
10848
10871
|
}
|
@@ -10865,19 +10888,19 @@ var subscriptionContract = initContract54().router(
|
|
10865
10888
|
|
10866
10889
|
// src/cx-intelligence/index.ts
|
10867
10890
|
import { initContract as initContract55 } from "@ts-rest/core";
|
10868
|
-
import
|
10891
|
+
import z140 from "zod";
|
10869
10892
|
var cxIntelligenceContract = initContract55().router(
|
10870
10893
|
{
|
10871
10894
|
toggle: {
|
10872
10895
|
method: "POST",
|
10873
10896
|
path: "/toggle",
|
10874
10897
|
headers: DefaultHeaderSchema,
|
10875
|
-
body:
|
10876
|
-
enabled:
|
10898
|
+
body: z140.object({
|
10899
|
+
enabled: z140.union([z140.literal(true), z140.literal(false)])
|
10877
10900
|
}),
|
10878
10901
|
responses: {
|
10879
10902
|
200: DefaultSuccessResponseSchema.extend({
|
10880
|
-
message:
|
10903
|
+
message: z140.string()
|
10881
10904
|
}),
|
10882
10905
|
500: DefaultErrorResponseSchema
|
10883
10906
|
},
|
@@ -10887,15 +10910,15 @@ var cxIntelligenceContract = initContract55().router(
|
|
10887
10910
|
method: "POST",
|
10888
10911
|
path: "/cx-logs/:id/transcribe",
|
10889
10912
|
headers: DefaultHeaderSchema,
|
10890
|
-
pathParams:
|
10891
|
-
id:
|
10913
|
+
pathParams: z140.object({
|
10914
|
+
id: z140.string().uuid()
|
10892
10915
|
}),
|
10893
|
-
body:
|
10894
|
-
fileUrl:
|
10916
|
+
body: z140.object({
|
10917
|
+
fileUrl: z140.string()
|
10895
10918
|
}),
|
10896
10919
|
responses: {
|
10897
10920
|
200: DefaultSuccessResponseSchema.extend({
|
10898
|
-
message:
|
10921
|
+
message: z140.string()
|
10899
10922
|
}),
|
10900
10923
|
403: DefaultErrorResponseSchema,
|
10901
10924
|
404: DefaultErrorResponseSchema,
|
@@ -10915,13 +10938,13 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10915
10938
|
headers: DefaultHeaderSchema,
|
10916
10939
|
responses: {
|
10917
10940
|
200: DefaultSuccessResponseSchema.extend({
|
10918
|
-
message:
|
10919
|
-
status:
|
10941
|
+
message: z140.string(),
|
10942
|
+
status: z140.boolean()
|
10920
10943
|
}),
|
10921
|
-
422:
|
10922
|
-
requestId:
|
10923
|
-
message:
|
10924
|
-
status:
|
10944
|
+
422: z140.object({
|
10945
|
+
requestId: z140.string(),
|
10946
|
+
message: z140.string(),
|
10947
|
+
status: z140.boolean()
|
10925
10948
|
}),
|
10926
10949
|
500: DefaultErrorResponseSchema
|
10927
10950
|
},
|
@@ -10933,20 +10956,20 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10933
10956
|
|
10934
10957
|
// src/export/index.ts
|
10935
10958
|
import { initContract as initContract56 } from "@ts-rest/core";
|
10936
|
-
import
|
10959
|
+
import z141 from "zod";
|
10937
10960
|
var exportContract = initContract56().router(
|
10938
10961
|
{
|
10939
10962
|
notifyExport: {
|
10940
10963
|
method: "POST",
|
10941
10964
|
path: "notify",
|
10942
|
-
body:
|
10943
|
-
userId:
|
10944
|
-
module:
|
10945
|
-
fileUrl:
|
10965
|
+
body: z141.object({
|
10966
|
+
userId: z141.string().uuid(),
|
10967
|
+
module: z141.string(),
|
10968
|
+
fileUrl: z141.string()
|
10946
10969
|
}),
|
10947
10970
|
responses: {
|
10948
10971
|
200: DefaultSuccessResponseSchema.extend({
|
10949
|
-
success:
|
10972
|
+
success: z141.boolean()
|
10950
10973
|
}),
|
10951
10974
|
500: DefaultErrorResponseSchema
|
10952
10975
|
}
|
@@ -11029,6 +11052,7 @@ export {
|
|
11029
11052
|
userContract,
|
11030
11053
|
userNotificationContract,
|
11031
11054
|
userPresenceStatusLogContract,
|
11055
|
+
widgetContract,
|
11032
11056
|
widgetSettingContract,
|
11033
11057
|
workflowContract,
|
11034
11058
|
wrapUpFormContract
|