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