@kl1/contracts 1.3.70 → 1.3.72
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 +0 -64
- package/dist/api-contracts/src/channel/index.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/validation.d.ts +0 -64
- 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 +555 -160
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/index.d.ts +125 -27
- package/dist/api-contracts/src/cx-log/index.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/schema.d.ts +0 -18
- package/dist/api-contracts/src/cx-log/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/index.d.ts +0 -5
- package/dist/api-contracts/src/dashboard/index.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/schema.d.ts +0 -3
- package/dist/api-contracts/src/dashboard/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/index.d.ts +0 -1
- package/dist/api-contracts/src/index.d.ts.map +1 -1
- package/dist/api-contracts/src/presence-status/index.d.ts +1 -1
- package/dist/api-contracts/src/presence-status/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts +430 -0
- 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 +3 -0
- 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 +3 -0
- package/dist/api-contracts/src/telephony-agent-presence-status/validation.d.ts.map +1 -1
- package/dist/index.js +1567 -1566
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1567 -1565
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1185,7 +1185,6 @@ var CxLogSchemaWithRelations = DefaultEntitySchema.extend({
|
|
1185
1185
|
queue: z25.object({
|
1186
1186
|
queueName: z25.string().nullable().optional()
|
1187
1187
|
}).nullable(),
|
1188
|
-
automationQueue: z25.object({ id: z25.string().uuid(), name: z25.string() }).nullable(),
|
1189
1188
|
contact: ContactSchema.nullable(),
|
1190
1189
|
firstAssignee: UserSchema.nullable(),
|
1191
1190
|
agent: UserSchema.nullable(),
|
@@ -2219,22 +2218,6 @@ var ConnectWhatsappSchema = z37.object({
|
|
2219
2218
|
});
|
2220
2219
|
var CsatPreferenceSchema = z37.object({
|
2221
2220
|
isCSATEnabled: z37.boolean(),
|
2222
|
-
headline: z37.string().optional().nullable(),
|
2223
|
-
image: z37.object({
|
2224
|
-
bucketName: z37.string(),
|
2225
|
-
fileName: z37.string(),
|
2226
|
-
fileSize: z37.number(),
|
2227
|
-
fileKey: z37.string(),
|
2228
|
-
originalUrl: z37.string().optional().nullable()
|
2229
|
-
}).optional().nullable(),
|
2230
|
-
scaleOptions: z37.array(
|
2231
|
-
z37.object({
|
2232
|
-
value: z37.string(),
|
2233
|
-
label: z37.string(),
|
2234
|
-
color: z37.string().optional().nullable(),
|
2235
|
-
style: z37.string().optional().nullable()
|
2236
|
-
})
|
2237
|
-
).optional().nullable(),
|
2238
2221
|
dispositions: z37.array(z37.string()).optional()
|
2239
2222
|
});
|
2240
2223
|
var ConnectLazadaSchema = z37.object({
|
@@ -4207,7 +4190,9 @@ var cxLogContract = initContract12().router({
|
|
4207
4190
|
200: null,
|
4208
4191
|
401: DefaultUnauthorizedSchema
|
4209
4192
|
},
|
4210
|
-
query:
|
4193
|
+
query: GetAllCxLogQueryParamsSchema.extend({
|
4194
|
+
fileExtension: ExportFileExtensionSchema
|
4195
|
+
}),
|
4211
4196
|
summary: "Export cx-logs"
|
4212
4197
|
},
|
4213
4198
|
syncSla: {
|
@@ -4446,7 +4431,6 @@ var MessageStatusSchema = z55.object({
|
|
4446
4431
|
closed: z55.number().nullable(),
|
4447
4432
|
unassignedOpen: z55.number().nullable(),
|
4448
4433
|
assignedOpen: z55.number().nullable(),
|
4449
|
-
botRoom: z55.number().nullable(),
|
4450
4434
|
hold: z55.number()
|
4451
4435
|
});
|
4452
4436
|
var MessageAverageSchema = z55.object({
|
@@ -5836,7 +5820,10 @@ var tagContract = initContract22().router(
|
|
5836
5820
|
|
5837
5821
|
// src/telephony-agent-presence-status/index.ts
|
5838
5822
|
import { initContract as initContract23 } from "@ts-rest/core";
|
5839
|
-
import
|
5823
|
+
import z75 from "zod";
|
5824
|
+
|
5825
|
+
// src/telephony-agent-presence-status/schema.ts
|
5826
|
+
import z73 from "zod";
|
5840
5827
|
|
5841
5828
|
// src/presence-status/schema.ts
|
5842
5829
|
import z72 from "zod";
|
@@ -5871,29 +5858,45 @@ var UserPresenceStatusSchema = z72.object({
|
|
5871
5858
|
// src/telephony-agent-presence-status/schema.ts
|
5872
5859
|
var UserPresenceStatusSchema2 = DefaultEntitySchema.extend({
|
5873
5860
|
user: UserSchema,
|
5874
|
-
presenceStatus: PresenceStatusSchema
|
5861
|
+
presenceStatus: PresenceStatusSchema,
|
5862
|
+
customPresenceStatus: z73.string().nullable().optional()
|
5875
5863
|
});
|
5876
5864
|
|
5877
5865
|
// src/telephony-agent-presence-status/validation.ts
|
5878
|
-
import { z as
|
5879
|
-
var UpdateUserStatusSchema =
|
5880
|
-
userId:
|
5881
|
-
presenceStatusId:
|
5882
|
-
|
5866
|
+
import { z as z74 } from "zod";
|
5867
|
+
var UpdateUserStatusSchema = z74.object({
|
5868
|
+
userId: z74.string(),
|
5869
|
+
presenceStatusId: z74.string().nullable().optional(),
|
5870
|
+
customPreseneStatus: z74.string().nullable().optional(),
|
5871
|
+
reason: z74.string()
|
5883
5872
|
});
|
5884
5873
|
|
5885
5874
|
// src/telephony-agent-presence-status/index.ts
|
5886
5875
|
var telephonyAgentPresenceStatusContract = initContract23().router(
|
5887
5876
|
{
|
5877
|
+
getAllAgentStatus: {
|
5878
|
+
method: "GET",
|
5879
|
+
path: "/agents/presence_status",
|
5880
|
+
headers: DefaultHeaderSchema,
|
5881
|
+
responses: {
|
5882
|
+
200: z75.array(UserPresenceStatusSchema2),
|
5883
|
+
400: z75.object({
|
5884
|
+
message: z75.string()
|
5885
|
+
}),
|
5886
|
+
401: DefaultUnauthorizedSchema,
|
5887
|
+
500: DefaultErrorResponseSchema
|
5888
|
+
},
|
5889
|
+
summary: "Get all user presence status list."
|
5890
|
+
},
|
5888
5891
|
getAgentStatus: {
|
5889
5892
|
method: "GET",
|
5890
5893
|
path: "/presence_status/check_update/:userId",
|
5891
|
-
pathParams:
|
5894
|
+
pathParams: z75.object({ userId: z75.string() }),
|
5892
5895
|
headers: DefaultHeaderSchema,
|
5893
5896
|
responses: {
|
5894
5897
|
200: UserPresenceStatusSchema2,
|
5895
|
-
400:
|
5896
|
-
message:
|
5898
|
+
400: z75.object({
|
5899
|
+
message: z75.string()
|
5897
5900
|
}),
|
5898
5901
|
401: DefaultUnauthorizedSchema,
|
5899
5902
|
500: DefaultErrorResponseSchema
|
@@ -5909,8 +5912,8 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5909
5912
|
200: DefaultSuccessResponseSchema.extend({
|
5910
5913
|
userPresenceStatu: UserPresenceStatusSchema2
|
5911
5914
|
}),
|
5912
|
-
400:
|
5913
|
-
message:
|
5915
|
+
400: z75.object({
|
5916
|
+
message: z75.string()
|
5914
5917
|
}),
|
5915
5918
|
401: DefaultUnauthorizedSchema,
|
5916
5919
|
500: DefaultErrorResponseSchema
|
@@ -5922,65 +5925,65 @@ var telephonyAgentPresenceStatusContract = initContract23().router(
|
|
5922
5925
|
);
|
5923
5926
|
|
5924
5927
|
// src/telephony-cdr/index.ts
|
5925
|
-
import
|
5928
|
+
import z77 from "zod";
|
5926
5929
|
|
5927
5930
|
// src/telephony-cdr/validation.ts
|
5928
|
-
import
|
5929
|
-
var CreateTelephonyCdrSchema =
|
5930
|
-
uniqueCallId:
|
5931
|
-
timeStart:
|
5932
|
-
callFrom:
|
5933
|
-
callTo:
|
5934
|
-
callDuration:
|
5935
|
-
talkDuration:
|
5936
|
-
srcTrunkName:
|
5937
|
-
dstTrunkName:
|
5938
|
-
pinCode:
|
5939
|
-
status:
|
5940
|
-
type:
|
5941
|
-
recording:
|
5942
|
-
didNumber:
|
5943
|
-
agentRingTime:
|
5931
|
+
import z76 from "zod";
|
5932
|
+
var CreateTelephonyCdrSchema = z76.object({
|
5933
|
+
uniqueCallId: z76.string({ required_error: "uniqueCallId is required" }),
|
5934
|
+
timeStart: z76.string({ required_error: "timeStart is required" }),
|
5935
|
+
callFrom: z76.string({ required_error: "callFrom is required" }),
|
5936
|
+
callTo: z76.string({ required_error: "callTo is required" }),
|
5937
|
+
callDuration: z76.number().nullable(),
|
5938
|
+
talkDuration: z76.number().nullable(),
|
5939
|
+
srcTrunkName: z76.string().nullable(),
|
5940
|
+
dstTrunkName: z76.string().nullable(),
|
5941
|
+
pinCode: z76.string().nullable(),
|
5942
|
+
status: z76.string(),
|
5943
|
+
type: z76.string(),
|
5944
|
+
recording: z76.string().nullable(),
|
5945
|
+
didNumber: z76.string().nullable(),
|
5946
|
+
agentRingTime: z76.number().nullable()
|
5944
5947
|
});
|
5945
5948
|
var GetAllTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5946
|
-
selectedDate:
|
5947
|
-
type:
|
5948
|
-
status:
|
5949
|
-
callFrom:
|
5950
|
-
callTo:
|
5951
|
-
trunk:
|
5952
|
-
userId:
|
5953
|
-
queueStatus:
|
5954
|
-
agentIds:
|
5955
|
-
agentCallsOnly:
|
5956
|
-
contactId:
|
5949
|
+
selectedDate: z76.string().optional(),
|
5950
|
+
type: z76.array(z76.string()).optional(),
|
5951
|
+
status: z76.array(z76.string()).optional(),
|
5952
|
+
callFrom: z76.string().optional(),
|
5953
|
+
callTo: z76.string().optional(),
|
5954
|
+
trunk: z76.array(z76.string()).optional(),
|
5955
|
+
userId: z76.string().uuid().optional(),
|
5956
|
+
queueStatus: z76.string().optional(),
|
5957
|
+
agentIds: z76.array(z76.string().uuid()).optional(),
|
5958
|
+
agentCallsOnly: z76.coerce.boolean().optional(),
|
5959
|
+
contactId: z76.string().uuid().optional()
|
5957
5960
|
});
|
5958
5961
|
var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
5959
|
-
type:
|
5960
|
-
status:
|
5961
|
-
callFrom:
|
5962
|
-
callTo:
|
5963
|
-
result:
|
5964
|
-
callTags:
|
5965
|
-
selectedDate:
|
5966
|
-
agentId:
|
5967
|
-
contact:
|
5968
|
-
callStatus:
|
5969
|
-
queueIds:
|
5970
|
-
notes:
|
5962
|
+
type: z76.array(z76.string()).optional(),
|
5963
|
+
status: z76.array(z76.string()).optional(),
|
5964
|
+
callFrom: z76.string().optional(),
|
5965
|
+
callTo: z76.string().optional(),
|
5966
|
+
result: z76.array(z76.string()).optional(),
|
5967
|
+
callTags: z76.array(z76.string()).optional(),
|
5968
|
+
selectedDate: z76.string().optional(),
|
5969
|
+
agentId: z76.string().optional(),
|
5970
|
+
contact: z76.array(z76.string()).optional(),
|
5971
|
+
callStatus: z76.array(z76.enum(["incoming", "outgoing", "missed", "no_answered"])).optional(),
|
5972
|
+
queueIds: z76.array(z76.string()).optional(),
|
5973
|
+
notes: z76.string().optional()
|
5971
5974
|
});
|
5972
5975
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5973
|
-
|
5974
|
-
page:
|
5975
|
-
pageSize:
|
5976
|
+
z76.object({
|
5977
|
+
page: z76.coerce.number().positive().optional(),
|
5978
|
+
pageSize: z76.coerce.number().positive().optional(),
|
5976
5979
|
// We use this export route for both CDR and Call Log.
|
5977
|
-
module:
|
5980
|
+
module: z76.union([z76.literal("cdrs"), z76.literal("call-logs")]).optional().default("cdrs")
|
5978
5981
|
})
|
5979
5982
|
);
|
5980
5983
|
var NullEmptyStringUndefined = ["", null, void 0];
|
5981
5984
|
var EmtptyArrayUndefined = [[], void 0];
|
5982
5985
|
var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
5983
|
-
reportType:
|
5986
|
+
reportType: z76.enum([
|
5984
5987
|
"extcallstatistics",
|
5985
5988
|
"extcallactivity",
|
5986
5989
|
"trunkactivity",
|
@@ -5990,52 +5993,52 @@ var GetYeastarCallReportSchema = DefaultQueryParamsSchema.extend({
|
|
5990
5993
|
"queueagentmisscalls",
|
5991
5994
|
"queueagentinoutcalls"
|
5992
5995
|
]),
|
5993
|
-
selectedDate:
|
5994
|
-
communicationType:
|
5995
|
-
time:
|
5996
|
-
queueList:
|
5997
|
-
queueId:
|
5998
|
-
trunkList:
|
5999
|
-
extensionList:
|
5996
|
+
selectedDate: z76.string().optional(),
|
5997
|
+
communicationType: z76.union([z76.literal("Inbound"), z76.literal("Outbound"), z76.literal("Internal")]).optional(),
|
5998
|
+
time: z76.string().optional(),
|
5999
|
+
queueList: z76.array(z76.string()).optional(),
|
6000
|
+
queueId: z76.string().optional(),
|
6001
|
+
trunkList: z76.array(z76.string()).optional(),
|
6002
|
+
extensionList: z76.array(z76.string()).optional()
|
6000
6003
|
}).superRefine((input, ctx) => {
|
6001
6004
|
if ((input.reportType === "extcallstatistics" || input.reportType === "queuesatisfaction" || input.reportType === "queueperformance" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.selectedDate)) {
|
6002
6005
|
ctx.addIssue({
|
6003
|
-
code:
|
6006
|
+
code: z76.ZodIssueCode.custom,
|
6004
6007
|
path: ["selectedDate"],
|
6005
6008
|
message: "selectedDate is required."
|
6006
6009
|
});
|
6007
6010
|
}
|
6008
6011
|
if ((input.reportType === "extcallactivity" || input.reportType === "queueavgwaittalktime" || input.reportType === "trunkactivity") && NullEmptyStringUndefined.includes(input.time)) {
|
6009
6012
|
ctx.addIssue({
|
6010
|
-
code:
|
6013
|
+
code: z76.ZodIssueCode.custom,
|
6011
6014
|
path: ["time"],
|
6012
6015
|
message: "time is required."
|
6013
6016
|
});
|
6014
6017
|
}
|
6015
6018
|
if ((input.reportType === "queueavgwaittalktime" || input.reportType === "queueperformance") && EmtptyArrayUndefined.includes(input.queueList)) {
|
6016
6019
|
ctx.addIssue({
|
6017
|
-
code:
|
6020
|
+
code: z76.ZodIssueCode.custom,
|
6018
6021
|
path: ["queueList"],
|
6019
6022
|
message: "queueList is required."
|
6020
6023
|
});
|
6021
6024
|
}
|
6022
6025
|
if ((input.reportType === "queuesatisfaction" || input.reportType === "queueagentmisscalls") && NullEmptyStringUndefined.includes(input.queueId)) {
|
6023
6026
|
ctx.addIssue({
|
6024
|
-
code:
|
6027
|
+
code: z76.ZodIssueCode.custom,
|
6025
6028
|
path: ["queueId"],
|
6026
6029
|
message: "queueId is required."
|
6027
6030
|
});
|
6028
6031
|
}
|
6029
6032
|
if (input.reportType === "trunkactivity" && EmtptyArrayUndefined.includes(input.trunkList)) {
|
6030
6033
|
ctx.addIssue({
|
6031
|
-
code:
|
6034
|
+
code: z76.ZodIssueCode.custom,
|
6032
6035
|
path: ["trunkList"],
|
6033
6036
|
message: "trunkList is required."
|
6034
6037
|
});
|
6035
6038
|
}
|
6036
6039
|
if ((input.reportType === "extcallstatistics" || input.reportType === "extcallactivity") && EmtptyArrayUndefined.includes(input.extensionList)) {
|
6037
6040
|
ctx.addIssue({
|
6038
|
-
code:
|
6041
|
+
code: z76.ZodIssueCode.custom,
|
6039
6042
|
path: ["extensionList"],
|
6040
6043
|
message: "extensionList is required."
|
6041
6044
|
});
|
@@ -6053,10 +6056,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6053
6056
|
query: GetAllTelephonyCdrSchema,
|
6054
6057
|
responses: {
|
6055
6058
|
200: DefaultSuccessResponseSchema.extend({
|
6056
|
-
total:
|
6057
|
-
page:
|
6058
|
-
pageSize:
|
6059
|
-
telephonyCdrs:
|
6059
|
+
total: z77.number(),
|
6060
|
+
page: z77.number(),
|
6061
|
+
pageSize: z77.number(),
|
6062
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
6060
6063
|
}),
|
6061
6064
|
401: DefaultUnauthorizedSchema
|
6062
6065
|
},
|
@@ -6069,10 +6072,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6069
6072
|
query: GetAllTelephonyCdrSchema,
|
6070
6073
|
responses: {
|
6071
6074
|
200: DefaultSuccessResponseSchema.extend({
|
6072
|
-
total:
|
6073
|
-
page:
|
6074
|
-
pageSize:
|
6075
|
-
telephonyCdrs:
|
6075
|
+
total: z77.number(),
|
6076
|
+
page: z77.number(),
|
6077
|
+
pageSize: z77.number(),
|
6078
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
6076
6079
|
}),
|
6077
6080
|
401: DefaultUnauthorizedSchema
|
6078
6081
|
},
|
@@ -6085,10 +6088,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6085
6088
|
query: GetRecentTelephonyCdrSchema,
|
6086
6089
|
responses: {
|
6087
6090
|
200: DefaultSuccessResponseSchema.extend({
|
6088
|
-
total:
|
6089
|
-
page:
|
6090
|
-
pageSize:
|
6091
|
-
telephonyCdrs:
|
6091
|
+
total: z77.number(),
|
6092
|
+
page: z77.number(),
|
6093
|
+
pageSize: z77.number(),
|
6094
|
+
telephonyCdrs: z77.array(TelephonyCdrSchema)
|
6092
6095
|
}),
|
6093
6096
|
401: DefaultUnauthorizedSchema
|
6094
6097
|
},
|
@@ -6115,7 +6118,7 @@ var telephonyCdrContract = initContract24().router(
|
|
6115
6118
|
body: GetYeastarCallReportSchema,
|
6116
6119
|
responses: {
|
6117
6120
|
// 200: CallReportSchema,
|
6118
|
-
200:
|
6121
|
+
200: z77.object({}),
|
6119
6122
|
401: DefaultUnauthorizedSchema
|
6120
6123
|
},
|
6121
6124
|
summary: "Get yeastar call report."
|
@@ -6183,10 +6186,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6183
6186
|
headers: DefaultHeaderSchema,
|
6184
6187
|
responses: {
|
6185
6188
|
200: DefaultSuccessResponseSchema.extend({
|
6186
|
-
callRedirectTo:
|
6189
|
+
callRedirectTo: z77.string()
|
6187
6190
|
}),
|
6188
|
-
400:
|
6189
|
-
message:
|
6191
|
+
400: z77.object({
|
6192
|
+
message: z77.string()
|
6190
6193
|
}),
|
6191
6194
|
401: DefaultUnauthorizedSchema,
|
6192
6195
|
500: DefaultErrorResponseSchema
|
@@ -6199,10 +6202,10 @@ var telephonyCdrContract = initContract24().router(
|
|
6199
6202
|
body: TelephonyRedirectSettingSchema,
|
6200
6203
|
responses: {
|
6201
6204
|
200: DefaultSuccessResponseSchema.extend({
|
6202
|
-
callRedirectTo:
|
6205
|
+
callRedirectTo: z77.string()
|
6203
6206
|
}),
|
6204
|
-
400:
|
6205
|
-
message:
|
6207
|
+
400: z77.object({
|
6208
|
+
message: z77.string()
|
6206
6209
|
}),
|
6207
6210
|
401: DefaultUnauthorizedSchema,
|
6208
6211
|
500: DefaultErrorResponseSchema
|
@@ -6214,11 +6217,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6214
6217
|
headers: DefaultHeaderSchema,
|
6215
6218
|
responses: {
|
6216
6219
|
200: DefaultSuccessResponseSchema.extend({
|
6217
|
-
callRedirectTo:
|
6218
|
-
isMultiTabUsed:
|
6220
|
+
callRedirectTo: z77.string(),
|
6221
|
+
isMultiTabUsed: z77.string()
|
6219
6222
|
}),
|
6220
|
-
400:
|
6221
|
-
message:
|
6223
|
+
400: z77.object({
|
6224
|
+
message: z77.string()
|
6222
6225
|
}),
|
6223
6226
|
401: DefaultUnauthorizedSchema,
|
6224
6227
|
500: DefaultErrorResponseSchema
|
@@ -6231,11 +6234,11 @@ var telephonyCdrContract = initContract24().router(
|
|
6231
6234
|
body: CallSettingSchema,
|
6232
6235
|
responses: {
|
6233
6236
|
200: DefaultSuccessResponseSchema.extend({
|
6234
|
-
callRedirectTo:
|
6235
|
-
isMultiTabUsed:
|
6237
|
+
callRedirectTo: z77.string(),
|
6238
|
+
isMultiTabUsed: z77.string()
|
6236
6239
|
}),
|
6237
|
-
400:
|
6238
|
-
message:
|
6240
|
+
400: z77.object({
|
6241
|
+
message: z77.string()
|
6239
6242
|
}),
|
6240
6243
|
401: DefaultUnauthorizedSchema,
|
6241
6244
|
500: DefaultErrorResponseSchema
|
@@ -6247,35 +6250,35 @@ var telephonyCdrContract = initContract24().router(
|
|
6247
6250
|
|
6248
6251
|
// src/telephony-extension/index.ts
|
6249
6252
|
import { initContract as initContract25 } from "@ts-rest/core";
|
6250
|
-
import
|
6253
|
+
import z79 from "zod";
|
6251
6254
|
|
6252
6255
|
// src/telephony-extension/schema.ts
|
6253
|
-
import
|
6254
|
-
var TelephonyExtensionSchema3 =
|
6255
|
-
errcode:
|
6256
|
-
errmsg:
|
6257
|
-
total_number:
|
6258
|
-
data:
|
6259
|
-
|
6260
|
-
id:
|
6261
|
-
online_status:
|
6262
|
-
fx_phone:
|
6263
|
-
sip_phone:
|
6264
|
-
status:
|
6265
|
-
ext_dev_type:
|
6266
|
-
}),
|
6267
|
-
linkus_desktop:
|
6268
|
-
linkus_mobile:
|
6269
|
-
linkus_web:
|
6270
|
-
status:
|
6271
|
-
ext_dev_type:
|
6256
|
+
import z78 from "zod";
|
6257
|
+
var TelephonyExtensionSchema3 = z78.object({
|
6258
|
+
errcode: z78.coerce.number(),
|
6259
|
+
errmsg: z78.string(),
|
6260
|
+
total_number: z78.coerce.number(),
|
6261
|
+
data: z78.array(
|
6262
|
+
z78.object({
|
6263
|
+
id: z78.coerce.number(),
|
6264
|
+
online_status: z78.object({
|
6265
|
+
fx_phone: z78.object({ status: z78.coerce.number() }),
|
6266
|
+
sip_phone: z78.object({
|
6267
|
+
status: z78.coerce.number(),
|
6268
|
+
ext_dev_type: z78.string().optional()
|
6269
|
+
}),
|
6270
|
+
linkus_desktop: z78.object({ status: z78.coerce.number() }),
|
6271
|
+
linkus_mobile: z78.object({ status: z78.coerce.number() }),
|
6272
|
+
linkus_web: z78.object({
|
6273
|
+
status: z78.coerce.number(),
|
6274
|
+
ext_dev_type: z78.string().optional()
|
6272
6275
|
})
|
6273
6276
|
}).optional(),
|
6274
|
-
presence_status:
|
6275
|
-
number:
|
6276
|
-
caller_id_name:
|
6277
|
-
role_name:
|
6278
|
-
email_addr:
|
6277
|
+
presence_status: z78.string().optional(),
|
6278
|
+
number: z78.string().optional(),
|
6279
|
+
caller_id_name: z78.string().optional(),
|
6280
|
+
role_name: z78.string().optional(),
|
6281
|
+
email_addr: z78.string().optional()
|
6279
6282
|
})
|
6280
6283
|
)
|
6281
6284
|
});
|
@@ -6290,8 +6293,8 @@ var telephonyExtensionContract = initContract25().router(
|
|
6290
6293
|
query: null,
|
6291
6294
|
responses: {
|
6292
6295
|
200: TelephonyExtensionSchema3,
|
6293
|
-
400:
|
6294
|
-
message:
|
6296
|
+
400: z79.object({
|
6297
|
+
message: z79.string()
|
6295
6298
|
}),
|
6296
6299
|
401: DefaultUnauthorizedSchema,
|
6297
6300
|
500: DefaultErrorResponseSchema
|
@@ -6304,10 +6307,10 @@ var telephonyExtensionContract = initContract25().router(
|
|
6304
6307
|
|
6305
6308
|
// src/ticket/index.ts
|
6306
6309
|
import { initContract as initContract26 } from "@ts-rest/core";
|
6307
|
-
import
|
6310
|
+
import z81 from "zod";
|
6308
6311
|
|
6309
6312
|
// src/ticket/validation.ts
|
6310
|
-
import
|
6313
|
+
import z80 from "zod";
|
6311
6314
|
var addErrorMessage2 = (field) => {
|
6312
6315
|
return field.refine(
|
6313
6316
|
({ isRequired, value }) => {
|
@@ -6325,108 +6328,108 @@ var addErrorMessage2 = (field) => {
|
|
6325
6328
|
}
|
6326
6329
|
);
|
6327
6330
|
};
|
6328
|
-
var BaseSchema3 =
|
6329
|
-
isRequired:
|
6330
|
-
attributeId:
|
6331
|
+
var BaseSchema3 = z80.object({
|
6332
|
+
isRequired: z80.boolean(),
|
6333
|
+
attributeId: z80.string()
|
6331
6334
|
});
|
6332
6335
|
var SingleValue2 = addErrorMessage2(
|
6333
6336
|
BaseSchema3.extend({
|
6334
|
-
value:
|
6337
|
+
value: z80.string()
|
6335
6338
|
})
|
6336
6339
|
);
|
6337
|
-
var CreateTicketValidationSchema =
|
6340
|
+
var CreateTicketValidationSchema = z80.object({
|
6338
6341
|
title: SingleValue2,
|
6339
6342
|
description: SingleValue2,
|
6340
6343
|
status: SingleValue2,
|
6341
6344
|
type: SingleValue2,
|
6342
6345
|
priority: SingleValue2,
|
6343
6346
|
contact: SingleValue2,
|
6344
|
-
assignee:
|
6345
|
-
isRequired:
|
6346
|
-
attributeId:
|
6347
|
-
value:
|
6347
|
+
assignee: z80.object({
|
6348
|
+
isRequired: z80.boolean(),
|
6349
|
+
attributeId: z80.string(),
|
6350
|
+
value: z80.string()
|
6348
6351
|
}),
|
6349
6352
|
channel: SingleValue2,
|
6350
|
-
tags: addErrorMessage2(BaseSchema3.extend({ value:
|
6351
|
-
categories: BaseSchema3.extend({ value:
|
6352
|
-
customFields:
|
6353
|
+
tags: addErrorMessage2(BaseSchema3.extend({ value: z80.array(z80.string()) })),
|
6354
|
+
categories: BaseSchema3.extend({ value: z80.array(z80.string()) }),
|
6355
|
+
customFields: z80.array(
|
6353
6356
|
addErrorMessage2(
|
6354
6357
|
BaseSchema3.extend({
|
6355
|
-
value:
|
6356
|
-
type:
|
6357
|
-
isDefaultAttribute:
|
6358
|
+
value: z80.union([z80.string(), z80.array(z80.string())]),
|
6359
|
+
type: z80.string(),
|
6360
|
+
isDefaultAttribute: z80.boolean()
|
6358
6361
|
})
|
6359
6362
|
)
|
6360
6363
|
),
|
6361
|
-
reasonToAssign:
|
6364
|
+
reasonToAssign: z80.object({ value: z80.string() }).optional()
|
6362
6365
|
});
|
6363
6366
|
var UpdateTicketValidationSchema = CreateTicketValidationSchema;
|
6364
|
-
var TicketAttachmentRecordSchema =
|
6365
|
-
bucketName:
|
6366
|
-
fileKey:
|
6367
|
-
fileName:
|
6368
|
-
fileSize:
|
6369
|
-
url:
|
6370
|
-
});
|
6371
|
-
var CreateTicketAttachmentRecordsSchema =
|
6372
|
-
ticketId:
|
6373
|
-
attributeId:
|
6374
|
-
ticketAttachmentRecords:
|
6375
|
-
});
|
6376
|
-
var TicketParamsSchema =
|
6377
|
-
page:
|
6378
|
-
pageSize:
|
6379
|
-
});
|
6380
|
-
var CustomFieldQuery =
|
6381
|
-
attributeId:
|
6382
|
-
type:
|
6383
|
-
value:
|
6384
|
-
});
|
6385
|
-
var GetAllTicketQuerySchema =
|
6386
|
-
page:
|
6387
|
-
pageSize:
|
6388
|
-
selectedDate:
|
6389
|
-
ticketNumber:
|
6390
|
-
keyword:
|
6391
|
-
title:
|
6392
|
-
description:
|
6393
|
-
status:
|
6394
|
-
priority:
|
6395
|
-
channel:
|
6396
|
-
type:
|
6397
|
-
ticketType:
|
6398
|
-
contact:
|
6399
|
-
tags:
|
6400
|
-
categories:
|
6401
|
-
assignee:
|
6402
|
-
customFields:
|
6403
|
-
|
6404
|
-
attributeId:
|
6405
|
-
type:
|
6406
|
-
value:
|
6367
|
+
var TicketAttachmentRecordSchema = z80.object({
|
6368
|
+
bucketName: z80.string(),
|
6369
|
+
fileKey: z80.string(),
|
6370
|
+
fileName: z80.string(),
|
6371
|
+
fileSize: z80.coerce.number(),
|
6372
|
+
url: z80.string()
|
6373
|
+
});
|
6374
|
+
var CreateTicketAttachmentRecordsSchema = z80.object({
|
6375
|
+
ticketId: z80.string(),
|
6376
|
+
attributeId: z80.string(),
|
6377
|
+
ticketAttachmentRecords: z80.array(TicketAttachmentRecordSchema)
|
6378
|
+
});
|
6379
|
+
var TicketParamsSchema = z80.object({
|
6380
|
+
page: z80.coerce.number().default(1),
|
6381
|
+
pageSize: z80.coerce.number().default(10)
|
6382
|
+
});
|
6383
|
+
var CustomFieldQuery = z80.object({
|
6384
|
+
attributeId: z80.string(),
|
6385
|
+
type: z80.string(),
|
6386
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
6387
|
+
});
|
6388
|
+
var GetAllTicketQuerySchema = z80.object({
|
6389
|
+
page: z80.string().transform((value) => Number(value)),
|
6390
|
+
pageSize: z80.string().transform((value) => Number(value)),
|
6391
|
+
selectedDate: z80.string(),
|
6392
|
+
ticketNumber: z80.string(),
|
6393
|
+
keyword: z80.string(),
|
6394
|
+
title: z80.string(),
|
6395
|
+
description: z80.string(),
|
6396
|
+
status: z80.array(z80.string()),
|
6397
|
+
priority: z80.array(z80.string()),
|
6398
|
+
channel: z80.array(z80.string()),
|
6399
|
+
type: z80.array(z80.string()),
|
6400
|
+
ticketType: z80.array(z80.string()),
|
6401
|
+
contact: z80.array(z80.string()),
|
6402
|
+
tags: z80.array(z80.string().uuid()),
|
6403
|
+
categories: z80.array(z80.string().uuid()),
|
6404
|
+
assignee: z80.array(z80.string().uuid()),
|
6405
|
+
customFields: z80.array(
|
6406
|
+
z80.object({
|
6407
|
+
attributeId: z80.string().uuid(),
|
6408
|
+
type: z80.string(),
|
6409
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
6407
6410
|
})
|
6408
6411
|
)
|
6409
6412
|
}).partial();
|
6410
|
-
var ExportAllTicketQuerySchema =
|
6411
|
-
agent:
|
6412
|
-
selectedDate:
|
6413
|
-
keyword:
|
6414
|
-
title:
|
6415
|
-
description:
|
6416
|
-
status:
|
6417
|
-
priority:
|
6418
|
-
assignee:
|
6419
|
-
channel:
|
6420
|
-
type:
|
6421
|
-
ticketType:
|
6422
|
-
contact:
|
6423
|
-
tags:
|
6424
|
-
categories:
|
6425
|
-
customFields:
|
6426
|
-
|
6427
|
-
attributeId:
|
6428
|
-
type:
|
6429
|
-
value:
|
6413
|
+
var ExportAllTicketQuerySchema = z80.object({
|
6414
|
+
agent: z80.array(z80.string()),
|
6415
|
+
selectedDate: z80.string(),
|
6416
|
+
keyword: z80.string(),
|
6417
|
+
title: z80.string(),
|
6418
|
+
description: z80.string(),
|
6419
|
+
status: z80.array(z80.string()),
|
6420
|
+
priority: z80.array(z80.string()),
|
6421
|
+
assignee: z80.array(z80.string().uuid()),
|
6422
|
+
channel: z80.array(z80.string()),
|
6423
|
+
type: z80.array(z80.string()),
|
6424
|
+
ticketType: z80.array(z80.string()),
|
6425
|
+
contact: z80.array(z80.string()),
|
6426
|
+
tags: z80.array(z80.string()),
|
6427
|
+
categories: z80.array(z80.string()),
|
6428
|
+
customFields: z80.array(
|
6429
|
+
z80.object({
|
6430
|
+
attributeId: z80.string().uuid(),
|
6431
|
+
type: z80.string(),
|
6432
|
+
value: z80.union([z80.string(), z80.array(z80.string())])
|
6430
6433
|
})
|
6431
6434
|
)
|
6432
6435
|
}).partial();
|
@@ -6442,14 +6445,14 @@ var ticketContract = initContract26().router(
|
|
6442
6445
|
201: DefaultSuccessResponseSchema.extend({
|
6443
6446
|
data: TicketSchema
|
6444
6447
|
}),
|
6445
|
-
400:
|
6446
|
-
message:
|
6448
|
+
400: z81.object({
|
6449
|
+
message: z81.string()
|
6447
6450
|
}),
|
6448
|
-
409:
|
6449
|
-
message:
|
6451
|
+
409: z81.object({
|
6452
|
+
message: z81.string()
|
6450
6453
|
}),
|
6451
|
-
500:
|
6452
|
-
message:
|
6454
|
+
500: z81.object({
|
6455
|
+
message: z81.string()
|
6453
6456
|
}),
|
6454
6457
|
401: DefaultUnauthorizedSchema,
|
6455
6458
|
404: DefaultNotFoundSchema,
|
@@ -6470,8 +6473,8 @@ var ticketContract = initContract26().router(
|
|
6470
6473
|
TicketSchema
|
6471
6474
|
)
|
6472
6475
|
}),
|
6473
|
-
400:
|
6474
|
-
message:
|
6476
|
+
400: z81.object({
|
6477
|
+
message: z81.string()
|
6475
6478
|
}),
|
6476
6479
|
401: DefaultUnauthorizedSchema,
|
6477
6480
|
500: DefaultErrorResponseSchema
|
@@ -6481,14 +6484,14 @@ var ticketContract = initContract26().router(
|
|
6481
6484
|
getTicketById: {
|
6482
6485
|
method: "GET",
|
6483
6486
|
path: "/:id",
|
6484
|
-
pathParams:
|
6487
|
+
pathParams: z81.object({ id: z81.string() }),
|
6485
6488
|
headers: DefaultHeaderSchema,
|
6486
6489
|
responses: {
|
6487
6490
|
200: DefaultSuccessResponseSchema.extend({
|
6488
6491
|
data: TicketSchema
|
6489
6492
|
}),
|
6490
|
-
400:
|
6491
|
-
message:
|
6493
|
+
400: z81.object({
|
6494
|
+
message: z81.string()
|
6492
6495
|
}),
|
6493
6496
|
401: DefaultUnauthorizedSchema,
|
6494
6497
|
500: DefaultErrorResponseSchema
|
@@ -6498,15 +6501,15 @@ var ticketContract = initContract26().router(
|
|
6498
6501
|
getTicketByContactId: {
|
6499
6502
|
method: "GET",
|
6500
6503
|
path: "/contact/:id",
|
6501
|
-
pathParams:
|
6504
|
+
pathParams: z81.object({ id: z81.string() }),
|
6502
6505
|
query: TicketParamsSchema,
|
6503
6506
|
headers: DefaultHeaderSchema,
|
6504
6507
|
responses: {
|
6505
6508
|
200: DefaultSuccessResponseSchema.extend({
|
6506
6509
|
data: WithPagination(TicketSchema)
|
6507
6510
|
}),
|
6508
|
-
400:
|
6509
|
-
message:
|
6511
|
+
400: z81.object({
|
6512
|
+
message: z81.string()
|
6510
6513
|
}),
|
6511
6514
|
401: DefaultUnauthorizedSchema,
|
6512
6515
|
500: DefaultErrorResponseSchema
|
@@ -6516,21 +6519,21 @@ var ticketContract = initContract26().router(
|
|
6516
6519
|
updateTicket: {
|
6517
6520
|
method: "PATCH",
|
6518
6521
|
path: "/:id",
|
6519
|
-
pathParams:
|
6522
|
+
pathParams: z81.object({ id: z81.string() }),
|
6520
6523
|
body: UpdateTicketValidationSchema,
|
6521
6524
|
headers: DefaultHeaderSchema,
|
6522
6525
|
responses: {
|
6523
6526
|
201: DefaultSuccessResponseSchema.extend({
|
6524
6527
|
data: TicketSchema
|
6525
6528
|
}),
|
6526
|
-
400:
|
6527
|
-
message:
|
6529
|
+
400: z81.object({
|
6530
|
+
message: z81.string()
|
6528
6531
|
}),
|
6529
|
-
409:
|
6530
|
-
message:
|
6532
|
+
409: z81.object({
|
6533
|
+
message: z81.string()
|
6531
6534
|
}),
|
6532
|
-
500:
|
6533
|
-
message:
|
6535
|
+
500: z81.object({
|
6536
|
+
message: z81.string()
|
6534
6537
|
}),
|
6535
6538
|
401: DefaultUnauthorizedSchema,
|
6536
6539
|
404: DefaultNotFoundSchema,
|
@@ -6541,11 +6544,11 @@ var ticketContract = initContract26().router(
|
|
6541
6544
|
deleteTicket: {
|
6542
6545
|
method: "DELETE",
|
6543
6546
|
path: "/:id",
|
6544
|
-
pathParams:
|
6547
|
+
pathParams: z81.object({ id: z81.string() }),
|
6545
6548
|
headers: DefaultHeaderSchema,
|
6546
6549
|
body: null,
|
6547
6550
|
responses: {
|
6548
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6551
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6549
6552
|
500: DefaultErrorResponseSchema
|
6550
6553
|
},
|
6551
6554
|
summary: "Delete a extension."
|
@@ -6553,19 +6556,19 @@ var ticketContract = initContract26().router(
|
|
6553
6556
|
updateDescription: {
|
6554
6557
|
method: "PATCH",
|
6555
6558
|
path: "/description/update/:id",
|
6556
|
-
pathParams:
|
6557
|
-
body:
|
6559
|
+
pathParams: z81.object({ id: z81.string() }),
|
6560
|
+
body: z81.object({ description: z81.string() }),
|
6558
6561
|
headers: DefaultHeaderSchema,
|
6559
6562
|
responses: {
|
6560
|
-
201: DefaultSuccessResponseSchema.extend({ message:
|
6561
|
-
400:
|
6562
|
-
message:
|
6563
|
+
201: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6564
|
+
400: z81.object({
|
6565
|
+
message: z81.string()
|
6563
6566
|
}),
|
6564
|
-
409:
|
6565
|
-
message:
|
6567
|
+
409: z81.object({
|
6568
|
+
message: z81.string()
|
6566
6569
|
}),
|
6567
|
-
500:
|
6568
|
-
message:
|
6570
|
+
500: z81.object({
|
6571
|
+
message: z81.string()
|
6569
6572
|
}),
|
6570
6573
|
401: DefaultUnauthorizedSchema,
|
6571
6574
|
404: DefaultNotFoundSchema,
|
@@ -6576,19 +6579,19 @@ var ticketContract = initContract26().router(
|
|
6576
6579
|
updateTitle: {
|
6577
6580
|
method: "PATCH",
|
6578
6581
|
path: "/title/update/:id",
|
6579
|
-
pathParams:
|
6580
|
-
body:
|
6582
|
+
pathParams: z81.object({ id: z81.string() }),
|
6583
|
+
body: z81.object({ title: z81.string() }),
|
6581
6584
|
headers: DefaultHeaderSchema,
|
6582
6585
|
responses: {
|
6583
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6584
|
-
400:
|
6585
|
-
message:
|
6586
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6587
|
+
400: z81.object({
|
6588
|
+
message: z81.string()
|
6586
6589
|
}),
|
6587
|
-
409:
|
6588
|
-
message:
|
6590
|
+
409: z81.object({
|
6591
|
+
message: z81.string()
|
6589
6592
|
}),
|
6590
|
-
500:
|
6591
|
-
message:
|
6593
|
+
500: z81.object({
|
6594
|
+
message: z81.string()
|
6592
6595
|
}),
|
6593
6596
|
401: DefaultUnauthorizedSchema,
|
6594
6597
|
404: DefaultNotFoundSchema,
|
@@ -6599,19 +6602,19 @@ var ticketContract = initContract26().router(
|
|
6599
6602
|
updateType: {
|
6600
6603
|
method: "PATCH",
|
6601
6604
|
path: "/type/update/:id",
|
6602
|
-
pathParams:
|
6603
|
-
body:
|
6605
|
+
pathParams: z81.object({ id: z81.string() }),
|
6606
|
+
body: z81.object({ type: z81.string() }),
|
6604
6607
|
headers: DefaultHeaderSchema,
|
6605
6608
|
responses: {
|
6606
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6607
|
-
400:
|
6608
|
-
message:
|
6609
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6610
|
+
400: z81.object({
|
6611
|
+
message: z81.string()
|
6609
6612
|
}),
|
6610
|
-
409:
|
6611
|
-
message:
|
6613
|
+
409: z81.object({
|
6614
|
+
message: z81.string()
|
6612
6615
|
}),
|
6613
|
-
500:
|
6614
|
-
message:
|
6616
|
+
500: z81.object({
|
6617
|
+
message: z81.string()
|
6615
6618
|
}),
|
6616
6619
|
401: DefaultUnauthorizedSchema,
|
6617
6620
|
404: DefaultNotFoundSchema,
|
@@ -6622,19 +6625,19 @@ var ticketContract = initContract26().router(
|
|
6622
6625
|
updateStatus: {
|
6623
6626
|
method: "PATCH",
|
6624
6627
|
path: "/status/update/:id",
|
6625
|
-
pathParams:
|
6626
|
-
body:
|
6628
|
+
pathParams: z81.object({ id: z81.string() }),
|
6629
|
+
body: z81.object({ status: z81.string() }),
|
6627
6630
|
headers: DefaultHeaderSchema,
|
6628
6631
|
responses: {
|
6629
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6630
|
-
400:
|
6631
|
-
message:
|
6632
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6633
|
+
400: z81.object({
|
6634
|
+
message: z81.string()
|
6632
6635
|
}),
|
6633
|
-
409:
|
6634
|
-
message:
|
6636
|
+
409: z81.object({
|
6637
|
+
message: z81.string()
|
6635
6638
|
}),
|
6636
|
-
500:
|
6637
|
-
message:
|
6639
|
+
500: z81.object({
|
6640
|
+
message: z81.string()
|
6638
6641
|
}),
|
6639
6642
|
401: DefaultUnauthorizedSchema,
|
6640
6643
|
404: DefaultNotFoundSchema,
|
@@ -6645,19 +6648,19 @@ var ticketContract = initContract26().router(
|
|
6645
6648
|
updatePriority: {
|
6646
6649
|
method: "PATCH",
|
6647
6650
|
path: "/priority/update/:id",
|
6648
|
-
pathParams:
|
6649
|
-
body:
|
6651
|
+
pathParams: z81.object({ id: z81.string() }),
|
6652
|
+
body: z81.object({ priority: z81.string() }),
|
6650
6653
|
headers: DefaultHeaderSchema,
|
6651
6654
|
responses: {
|
6652
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6653
|
-
400:
|
6654
|
-
message:
|
6655
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6656
|
+
400: z81.object({
|
6657
|
+
message: z81.string()
|
6655
6658
|
}),
|
6656
|
-
409:
|
6657
|
-
message:
|
6659
|
+
409: z81.object({
|
6660
|
+
message: z81.string()
|
6658
6661
|
}),
|
6659
|
-
500:
|
6660
|
-
message:
|
6662
|
+
500: z81.object({
|
6663
|
+
message: z81.string()
|
6661
6664
|
}),
|
6662
6665
|
401: DefaultUnauthorizedSchema,
|
6663
6666
|
404: DefaultNotFoundSchema,
|
@@ -6668,19 +6671,19 @@ var ticketContract = initContract26().router(
|
|
6668
6671
|
updateChannel: {
|
6669
6672
|
method: "PATCH",
|
6670
6673
|
path: "/channel/update/:id",
|
6671
|
-
pathParams:
|
6672
|
-
body:
|
6674
|
+
pathParams: z81.object({ id: z81.string() }),
|
6675
|
+
body: z81.object({ channel: z81.string() }),
|
6673
6676
|
headers: DefaultHeaderSchema,
|
6674
6677
|
responses: {
|
6675
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6676
|
-
400:
|
6677
|
-
message:
|
6678
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6679
|
+
400: z81.object({
|
6680
|
+
message: z81.string()
|
6678
6681
|
}),
|
6679
|
-
409:
|
6680
|
-
message:
|
6682
|
+
409: z81.object({
|
6683
|
+
message: z81.string()
|
6681
6684
|
}),
|
6682
|
-
500:
|
6683
|
-
message:
|
6685
|
+
500: z81.object({
|
6686
|
+
message: z81.string()
|
6684
6687
|
}),
|
6685
6688
|
401: DefaultUnauthorizedSchema,
|
6686
6689
|
404: DefaultNotFoundSchema,
|
@@ -6691,19 +6694,19 @@ var ticketContract = initContract26().router(
|
|
6691
6694
|
updateTags: {
|
6692
6695
|
method: "PATCH",
|
6693
6696
|
path: "/tags/update/:id",
|
6694
|
-
pathParams:
|
6695
|
-
body:
|
6697
|
+
pathParams: z81.object({ id: z81.string() }),
|
6698
|
+
body: z81.object({ tags: z81.array(z81.string()) }),
|
6696
6699
|
headers: DefaultHeaderSchema,
|
6697
6700
|
responses: {
|
6698
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6699
|
-
400:
|
6700
|
-
message:
|
6701
|
+
200: DefaultSuccessResponseSchema.extend({ message: z81.string() }),
|
6702
|
+
400: z81.object({
|
6703
|
+
message: z81.string()
|
6701
6704
|
}),
|
6702
|
-
409:
|
6703
|
-
message:
|
6705
|
+
409: z81.object({
|
6706
|
+
message: z81.string()
|
6704
6707
|
}),
|
6705
|
-
500:
|
6706
|
-
message:
|
6708
|
+
500: z81.object({
|
6709
|
+
message: z81.string()
|
6707
6710
|
}),
|
6708
6711
|
401: DefaultUnauthorizedSchema,
|
6709
6712
|
404: DefaultNotFoundSchema,
|
@@ -6714,25 +6717,25 @@ var ticketContract = initContract26().router(
|
|
6714
6717
|
changeAssignee: {
|
6715
6718
|
method: "PATCH",
|
6716
6719
|
path: "/assignee/update/:id",
|
6717
|
-
pathParams:
|
6718
|
-
body:
|
6719
|
-
ticketId:
|
6720
|
-
assigneeId:
|
6721
|
-
reason:
|
6720
|
+
pathParams: z81.object({ id: z81.string() }),
|
6721
|
+
body: z81.object({
|
6722
|
+
ticketId: z81.string(),
|
6723
|
+
assigneeId: z81.string(),
|
6724
|
+
reason: z81.string().optional()
|
6722
6725
|
}),
|
6723
6726
|
headers: DefaultHeaderSchema,
|
6724
6727
|
responses: {
|
6725
6728
|
200: DefaultSuccessResponseSchema.extend({
|
6726
6729
|
data: TicketSchema
|
6727
6730
|
}),
|
6728
|
-
400:
|
6729
|
-
message:
|
6731
|
+
400: z81.object({
|
6732
|
+
message: z81.string()
|
6730
6733
|
}),
|
6731
|
-
409:
|
6732
|
-
message:
|
6734
|
+
409: z81.object({
|
6735
|
+
message: z81.string()
|
6733
6736
|
}),
|
6734
|
-
500:
|
6735
|
-
message:
|
6737
|
+
500: z81.object({
|
6738
|
+
message: z81.string()
|
6736
6739
|
}),
|
6737
6740
|
401: DefaultUnauthorizedSchema,
|
6738
6741
|
404: DefaultNotFoundSchema,
|
@@ -6743,14 +6746,14 @@ var ticketContract = initContract26().router(
|
|
6743
6746
|
getTicketCountByContact: {
|
6744
6747
|
method: "GET",
|
6745
6748
|
path: "/ticket_count/contact/:id",
|
6746
|
-
pathParams:
|
6749
|
+
pathParams: z81.object({ id: z81.string() }),
|
6747
6750
|
headers: DefaultHeaderSchema,
|
6748
6751
|
responses: {
|
6749
6752
|
200: DefaultSuccessResponseSchema.extend({
|
6750
6753
|
data: TicketCountByContactSchema
|
6751
6754
|
}),
|
6752
|
-
400:
|
6753
|
-
message:
|
6755
|
+
400: z81.object({
|
6756
|
+
message: z81.string()
|
6754
6757
|
}),
|
6755
6758
|
401: DefaultUnauthorizedSchema,
|
6756
6759
|
500: DefaultErrorResponseSchema
|
@@ -6766,14 +6769,14 @@ var ticketContract = initContract26().router(
|
|
6766
6769
|
201: DefaultSuccessResponseSchema.extend({
|
6767
6770
|
data: TicketCustomFieldSchema
|
6768
6771
|
}),
|
6769
|
-
400:
|
6770
|
-
message:
|
6772
|
+
400: z81.object({
|
6773
|
+
message: z81.string()
|
6771
6774
|
}),
|
6772
|
-
409:
|
6773
|
-
message:
|
6775
|
+
409: z81.object({
|
6776
|
+
message: z81.string()
|
6774
6777
|
}),
|
6775
|
-
500:
|
6776
|
-
message:
|
6778
|
+
500: z81.object({
|
6779
|
+
message: z81.string()
|
6777
6780
|
}),
|
6778
6781
|
401: DefaultUnauthorizedSchema,
|
6779
6782
|
404: DefaultNotFoundSchema,
|
@@ -6800,10 +6803,10 @@ var ticketContract = initContract26().router(
|
|
6800
6803
|
headers: DefaultHeaderSchema,
|
6801
6804
|
responses: {
|
6802
6805
|
200: DefaultSuccessResponseSchema.extend({
|
6803
|
-
ticketReasonRequired:
|
6806
|
+
ticketReasonRequired: z81.string()
|
6804
6807
|
}),
|
6805
|
-
400:
|
6806
|
-
message:
|
6808
|
+
400: z81.object({
|
6809
|
+
message: z81.string()
|
6807
6810
|
}),
|
6808
6811
|
401: DefaultUnauthorizedSchema,
|
6809
6812
|
500: DefaultErrorResponseSchema
|
@@ -6816,10 +6819,10 @@ var ticketContract = initContract26().router(
|
|
6816
6819
|
body: TicketReasonRequiredSchema,
|
6817
6820
|
responses: {
|
6818
6821
|
200: DefaultSuccessResponseSchema.extend({
|
6819
|
-
ticketReasonRequired:
|
6822
|
+
ticketReasonRequired: z81.string()
|
6820
6823
|
}),
|
6821
|
-
400:
|
6822
|
-
message:
|
6824
|
+
400: z81.object({
|
6825
|
+
message: z81.string()
|
6823
6826
|
}),
|
6824
6827
|
401: DefaultUnauthorizedSchema,
|
6825
6828
|
500: DefaultErrorResponseSchema
|
@@ -6831,24 +6834,24 @@ var ticketContract = initContract26().router(
|
|
6831
6834
|
|
6832
6835
|
// src/user/index.ts
|
6833
6836
|
import { initContract as initContract27 } from "@ts-rest/core";
|
6834
|
-
import
|
6837
|
+
import z83 from "zod";
|
6835
6838
|
|
6836
6839
|
// src/user/validation.ts
|
6837
|
-
import { z as
|
6838
|
-
var CreateUserSchema =
|
6839
|
-
name:
|
6840
|
-
email:
|
6841
|
-
address:
|
6842
|
-
phone:
|
6843
|
-
password:
|
6844
|
-
notificationCount:
|
6845
|
-
roles:
|
6840
|
+
import { z as z82 } from "zod";
|
6841
|
+
var CreateUserSchema = z82.object({
|
6842
|
+
name: z82.string(),
|
6843
|
+
email: z82.string().email(),
|
6844
|
+
address: z82.string().nullable(),
|
6845
|
+
phone: z82.string().nullable(),
|
6846
|
+
password: z82.string(),
|
6847
|
+
notificationCount: z82.number().nullable().optional(),
|
6848
|
+
roles: z82.array(z82.string())
|
6846
6849
|
});
|
6847
6850
|
var UpdateUserSchema = CreateUserSchema.extend({
|
6848
|
-
newPassword:
|
6851
|
+
newPassword: z82.string()
|
6849
6852
|
});
|
6850
|
-
var UpdateUserProfileSchema =
|
6851
|
-
password:
|
6853
|
+
var UpdateUserProfileSchema = z82.object({
|
6854
|
+
password: z82.string()
|
6852
6855
|
});
|
6853
6856
|
|
6854
6857
|
// src/user/index.ts
|
@@ -6863,8 +6866,8 @@ var userContract = initContract27().router(
|
|
6863
6866
|
201: DefaultSuccessResponseSchema.extend({
|
6864
6867
|
user: UserSchema
|
6865
6868
|
}),
|
6866
|
-
400:
|
6867
|
-
message:
|
6869
|
+
400: z83.object({
|
6870
|
+
message: z83.string()
|
6868
6871
|
}),
|
6869
6872
|
401: DefaultUnauthorizedSchema,
|
6870
6873
|
404: DefaultNotFoundSchema,
|
@@ -6877,15 +6880,15 @@ var userContract = initContract27().router(
|
|
6877
6880
|
method: "GET",
|
6878
6881
|
path: "/essential",
|
6879
6882
|
headers: DefaultHeaderSchema,
|
6880
|
-
query:
|
6881
|
-
page:
|
6882
|
-
pageSize:
|
6883
|
-
keyword:
|
6883
|
+
query: z83.object({
|
6884
|
+
page: z83.number().optional(),
|
6885
|
+
pageSize: z83.number().optional(),
|
6886
|
+
keyword: z83.string().optional()
|
6884
6887
|
}).optional(),
|
6885
6888
|
responses: {
|
6886
6889
|
200: WithPagination(EssentialUserSchema),
|
6887
|
-
400:
|
6888
|
-
message:
|
6890
|
+
400: z83.object({
|
6891
|
+
message: z83.string()
|
6889
6892
|
}),
|
6890
6893
|
401: DefaultUnauthorizedSchema,
|
6891
6894
|
500: DefaultErrorResponseSchema
|
@@ -6895,16 +6898,16 @@ var userContract = initContract27().router(
|
|
6895
6898
|
method: "GET",
|
6896
6899
|
path: "",
|
6897
6900
|
headers: DefaultHeaderSchema,
|
6898
|
-
query:
|
6899
|
-
page:
|
6900
|
-
pageSize:
|
6901
|
+
query: z83.object({
|
6902
|
+
page: z83.coerce.number().optional(),
|
6903
|
+
pageSize: z83.coerce.number().optional(),
|
6901
6904
|
// Don't add default 10. In some places, we need to fetch all users.
|
6902
|
-
keyword:
|
6905
|
+
keyword: z83.string().optional(),
|
6903
6906
|
// userIds: z.array(z.string()).optional(),
|
6904
|
-
userIds:
|
6905
|
-
|
6907
|
+
userIds: z83.union([
|
6908
|
+
z83.array(z83.string()),
|
6906
6909
|
// If it's an array
|
6907
|
-
|
6910
|
+
z83.record(z83.string())
|
6908
6911
|
// If it's an object
|
6909
6912
|
]).transform((val) => {
|
6910
6913
|
if (Array.isArray(val)) {
|
@@ -6912,12 +6915,12 @@ var userContract = initContract27().router(
|
|
6912
6915
|
}
|
6913
6916
|
return Object.values(val);
|
6914
6917
|
}).optional(),
|
6915
|
-
withPresenceStatus:
|
6918
|
+
withPresenceStatus: z83.string().transform((val) => val === "true").optional()
|
6916
6919
|
}).optional(),
|
6917
6920
|
responses: {
|
6918
6921
|
200: WithPagination(UserSchema),
|
6919
|
-
400:
|
6920
|
-
message:
|
6922
|
+
400: z83.object({
|
6923
|
+
message: z83.string()
|
6921
6924
|
}),
|
6922
6925
|
401: DefaultUnauthorizedSchema,
|
6923
6926
|
500: DefaultErrorResponseSchema
|
@@ -6927,12 +6930,12 @@ var userContract = initContract27().router(
|
|
6927
6930
|
getUserById: {
|
6928
6931
|
method: "GET",
|
6929
6932
|
path: "/:id",
|
6930
|
-
pathParams:
|
6933
|
+
pathParams: z83.object({ id: z83.string() }),
|
6931
6934
|
headers: DefaultHeaderSchema,
|
6932
6935
|
responses: {
|
6933
6936
|
200: UserSchema,
|
6934
|
-
400:
|
6935
|
-
message:
|
6937
|
+
400: z83.object({
|
6938
|
+
message: z83.string()
|
6936
6939
|
}),
|
6937
6940
|
401: DefaultUnauthorizedSchema
|
6938
6941
|
},
|
@@ -6941,15 +6944,15 @@ var userContract = initContract27().router(
|
|
6941
6944
|
updateUser: {
|
6942
6945
|
method: "PATCH",
|
6943
6946
|
path: "/:id",
|
6944
|
-
pathParams:
|
6947
|
+
pathParams: z83.object({ id: z83.string() }),
|
6945
6948
|
headers: DefaultHeaderSchema,
|
6946
6949
|
body: UpdateUserSchema,
|
6947
6950
|
responses: {
|
6948
6951
|
201: DefaultSuccessResponseSchema.extend({
|
6949
6952
|
user: UserSchema
|
6950
6953
|
}),
|
6951
|
-
400:
|
6952
|
-
message:
|
6954
|
+
400: z83.object({
|
6955
|
+
message: z83.string()
|
6953
6956
|
}),
|
6954
6957
|
401: DefaultUnauthorizedSchema,
|
6955
6958
|
404: DefaultNotFoundSchema,
|
@@ -6961,15 +6964,15 @@ var userContract = initContract27().router(
|
|
6961
6964
|
updateUserProfile: {
|
6962
6965
|
method: "PATCH",
|
6963
6966
|
path: "/profile/:id",
|
6964
|
-
pathParams:
|
6967
|
+
pathParams: z83.object({ id: z83.string() }),
|
6965
6968
|
headers: DefaultHeaderSchema,
|
6966
6969
|
body: UpdateUserProfileSchema,
|
6967
6970
|
responses: {
|
6968
6971
|
201: DefaultSuccessResponseSchema.extend({
|
6969
6972
|
user: UserSchema
|
6970
6973
|
}),
|
6971
|
-
400:
|
6972
|
-
message:
|
6974
|
+
400: z83.object({
|
6975
|
+
message: z83.string()
|
6973
6976
|
}),
|
6974
6977
|
401: DefaultUnauthorizedSchema,
|
6975
6978
|
404: DefaultNotFoundSchema,
|
@@ -6981,11 +6984,11 @@ var userContract = initContract27().router(
|
|
6981
6984
|
deleteUser: {
|
6982
6985
|
method: "DELETE",
|
6983
6986
|
path: "/:id",
|
6984
|
-
pathParams:
|
6987
|
+
pathParams: z83.object({ id: z83.string() }),
|
6985
6988
|
headers: DefaultHeaderSchema,
|
6986
6989
|
body: null,
|
6987
6990
|
responses: {
|
6988
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
6991
|
+
200: DefaultSuccessResponseSchema.extend({ message: z83.string() }),
|
6989
6992
|
404: DefaultNotFoundSchema,
|
6990
6993
|
422: DefaultUnprocessibleSchema,
|
6991
6994
|
500: DefaultErrorResponseSchema
|
@@ -6998,26 +7001,26 @@ var userContract = initContract27().router(
|
|
6998
7001
|
|
6999
7002
|
// src/user-presence-status-log/index.ts
|
7000
7003
|
import { initContract as initContract28 } from "@ts-rest/core";
|
7001
|
-
import
|
7004
|
+
import z86 from "zod";
|
7002
7005
|
|
7003
7006
|
// src/user-presence-status-log/schema.ts
|
7004
|
-
import
|
7007
|
+
import z84 from "zod";
|
7005
7008
|
var UserPresenceStatusLogSchema = DefaultEntitySchema.extend({
|
7006
7009
|
user: UserSchema,
|
7007
7010
|
previousPresenceStatus: PresenceStatusSchema,
|
7008
7011
|
newPresenceStatus: PresenceStatusSchema,
|
7009
|
-
reason:
|
7012
|
+
reason: z84.string()
|
7010
7013
|
});
|
7011
7014
|
|
7012
7015
|
// src/user-presence-status-log/validation.ts
|
7013
|
-
import
|
7014
|
-
var UserPresenceStatusLogParamsSchema =
|
7015
|
-
page:
|
7016
|
-
pageSize:
|
7017
|
-
selectedDate:
|
7016
|
+
import z85 from "zod";
|
7017
|
+
var UserPresenceStatusLogParamsSchema = z85.object({
|
7018
|
+
page: z85.coerce.number().default(1),
|
7019
|
+
pageSize: z85.coerce.number().default(10),
|
7020
|
+
selectedDate: z85.string().optional()
|
7018
7021
|
}).optional();
|
7019
|
-
var UserPresenceStatusLogExportParamsSchema =
|
7020
|
-
selectedDate:
|
7022
|
+
var UserPresenceStatusLogExportParamsSchema = z85.object({
|
7023
|
+
selectedDate: z85.string().optional()
|
7021
7024
|
});
|
7022
7025
|
|
7023
7026
|
// src/user-presence-status-log/index.ts
|
@@ -7030,8 +7033,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7030
7033
|
headers: DefaultHeaderSchema,
|
7031
7034
|
responses: {
|
7032
7035
|
200: WithPagination(UserPresenceStatusLogSchema),
|
7033
|
-
400:
|
7034
|
-
message:
|
7036
|
+
400: z86.object({
|
7037
|
+
message: z86.string()
|
7035
7038
|
}),
|
7036
7039
|
401: DefaultUnauthorizedSchema,
|
7037
7040
|
500: DefaultErrorResponseSchema
|
@@ -7047,8 +7050,8 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7047
7050
|
headers: DefaultHeaderSchema,
|
7048
7051
|
responses: {
|
7049
7052
|
200: null,
|
7050
|
-
400:
|
7051
|
-
message:
|
7053
|
+
400: z86.object({
|
7054
|
+
message: z86.string()
|
7052
7055
|
}),
|
7053
7056
|
401: DefaultUnauthorizedSchema,
|
7054
7057
|
500: DefaultErrorResponseSchema
|
@@ -7060,67 +7063,67 @@ var userPresenceStatusLogContract = initContract28().router(
|
|
7060
7063
|
|
7061
7064
|
// src/widget/index.ts
|
7062
7065
|
import { initContract as initContract29 } from "@ts-rest/core";
|
7063
|
-
import
|
7066
|
+
import z89 from "zod";
|
7064
7067
|
|
7065
7068
|
// src/widget/schema.ts
|
7066
|
-
import
|
7067
|
-
var FieldsSchema =
|
7068
|
-
var WidgetPositionSchema =
|
7069
|
-
|
7070
|
-
|
7071
|
-
|
7072
|
-
|
7073
|
-
|
7069
|
+
import z87 from "zod";
|
7070
|
+
var FieldsSchema = z87.object({ data: z87.array(z87.string()) });
|
7071
|
+
var WidgetPositionSchema = z87.union([
|
7072
|
+
z87.literal("menu"),
|
7073
|
+
z87.literal("ticket_detail"),
|
7074
|
+
z87.literal("contact_detail"),
|
7075
|
+
z87.literal("contact_profile"),
|
7076
|
+
z87.literal("inbox_detail")
|
7074
7077
|
]);
|
7075
|
-
var WidgetTypeSchema =
|
7076
|
-
|
7077
|
-
|
7078
|
+
var WidgetTypeSchema = z87.union([
|
7079
|
+
z87.literal("iframe"),
|
7080
|
+
z87.literal("custom")
|
7078
7081
|
]);
|
7079
|
-
var WidgetHeaderSchema =
|
7080
|
-
key:
|
7081
|
-
value:
|
7082
|
+
var WidgetHeaderSchema = z87.object({
|
7083
|
+
key: z87.string(),
|
7084
|
+
value: z87.string()
|
7082
7085
|
});
|
7083
|
-
var WidgetMethodSchema =
|
7084
|
-
|
7085
|
-
|
7086
|
+
var WidgetMethodSchema = z87.union([
|
7087
|
+
z87.literal("get"),
|
7088
|
+
z87.literal("post")
|
7086
7089
|
]);
|
7087
7090
|
var WidgetSchema = DefaultEntitySchema.extend({
|
7088
|
-
name:
|
7089
|
-
description:
|
7091
|
+
name: z87.string(),
|
7092
|
+
description: z87.string().nullable(),
|
7090
7093
|
position: WidgetPositionSchema,
|
7091
7094
|
fields: FieldsSchema,
|
7092
|
-
url:
|
7095
|
+
url: z87.string(),
|
7093
7096
|
type: WidgetTypeSchema.nullable(),
|
7094
|
-
headers:
|
7097
|
+
headers: z87.array(WidgetHeaderSchema).nullable(),
|
7095
7098
|
method: WidgetMethodSchema.nullable(),
|
7096
|
-
fileKey:
|
7097
|
-
fileUrl:
|
7099
|
+
fileKey: z87.string().nullable(),
|
7100
|
+
fileUrl: z87.string().nullable()
|
7098
7101
|
});
|
7099
7102
|
|
7100
7103
|
// src/widget/validation.ts
|
7101
|
-
import
|
7102
|
-
var CreateWidgetSchema =
|
7103
|
-
name:
|
7104
|
-
description:
|
7105
|
-
url:
|
7104
|
+
import z88 from "zod";
|
7105
|
+
var CreateWidgetSchema = z88.object({
|
7106
|
+
name: z88.string(),
|
7107
|
+
description: z88.string().optional(),
|
7108
|
+
url: z88.string(),
|
7106
7109
|
position: WidgetPositionSchema,
|
7107
|
-
fields:
|
7110
|
+
fields: z88.object({
|
7108
7111
|
data: (
|
7109
7112
|
// Array of attribute system names
|
7110
|
-
|
7113
|
+
z88.array(z88.string())
|
7111
7114
|
)
|
7112
7115
|
}).optional(),
|
7113
7116
|
type: WidgetTypeSchema,
|
7114
|
-
headers:
|
7117
|
+
headers: z88.array(WidgetHeaderSchema).optional(),
|
7115
7118
|
method: WidgetMethodSchema.optional(),
|
7116
|
-
fileKey:
|
7119
|
+
fileKey: z88.string().nullable()
|
7117
7120
|
});
|
7118
7121
|
var UpdateWidgetSchema = CreateWidgetSchema;
|
7119
|
-
var GetWidgetUrlPathQuerySchema =
|
7120
|
-
widgetId:
|
7122
|
+
var GetWidgetUrlPathQuerySchema = z88.object({
|
7123
|
+
widgetId: z88.string(),
|
7121
7124
|
// Position ID is ticket ID, contact ID, etc.
|
7122
7125
|
// TODO: The name "Position ID" is confusing. Think of a better name.
|
7123
|
-
positionId:
|
7126
|
+
positionId: z88.string()
|
7124
7127
|
});
|
7125
7128
|
|
7126
7129
|
// src/widget/index.ts
|
@@ -7135,8 +7138,8 @@ var widgetContract = initContract29().router(
|
|
7135
7138
|
201: DefaultSuccessResponseSchema.extend({
|
7136
7139
|
widget: WidgetSchema
|
7137
7140
|
}),
|
7138
|
-
400:
|
7139
|
-
message:
|
7141
|
+
400: z89.object({
|
7142
|
+
message: z89.string()
|
7140
7143
|
}),
|
7141
7144
|
401: DefaultUnauthorizedSchema,
|
7142
7145
|
500: DefaultErrorResponseSchema
|
@@ -7146,17 +7149,17 @@ var widgetContract = initContract29().router(
|
|
7146
7149
|
getWidgets: {
|
7147
7150
|
method: "GET",
|
7148
7151
|
path: "",
|
7149
|
-
query:
|
7150
|
-
page:
|
7151
|
-
pageSize:
|
7152
|
-
keyword:
|
7152
|
+
query: z89.object({
|
7153
|
+
page: z89.coerce.number().default(1),
|
7154
|
+
pageSize: z89.coerce.number().default(10),
|
7155
|
+
keyword: z89.coerce.string().optional()
|
7153
7156
|
}).optional(),
|
7154
7157
|
headers: DefaultHeaderSchema,
|
7155
7158
|
responses: {
|
7156
7159
|
200: WithPagination(WidgetSchema),
|
7157
7160
|
500: DefaultErrorResponseSchema,
|
7158
|
-
400:
|
7159
|
-
message:
|
7161
|
+
400: z89.object({
|
7162
|
+
message: z89.string()
|
7160
7163
|
}),
|
7161
7164
|
401: DefaultUnauthorizedSchema
|
7162
7165
|
},
|
@@ -7167,9 +7170,9 @@ var widgetContract = initContract29().router(
|
|
7167
7170
|
path: "/menu",
|
7168
7171
|
headers: DefaultHeaderSchema,
|
7169
7172
|
responses: {
|
7170
|
-
200:
|
7171
|
-
400:
|
7172
|
-
message:
|
7173
|
+
200: z89.array(WidgetSchema),
|
7174
|
+
400: z89.object({
|
7175
|
+
message: z89.string()
|
7173
7176
|
}),
|
7174
7177
|
401: DefaultUnauthorizedSchema,
|
7175
7178
|
500: DefaultErrorResponseSchema
|
@@ -7181,9 +7184,9 @@ var widgetContract = initContract29().router(
|
|
7181
7184
|
path: "/ticket_detail",
|
7182
7185
|
headers: DefaultHeaderSchema,
|
7183
7186
|
responses: {
|
7184
|
-
200:
|
7185
|
-
400:
|
7186
|
-
message:
|
7187
|
+
200: z89.array(WidgetSchema),
|
7188
|
+
400: z89.object({
|
7189
|
+
message: z89.string()
|
7187
7190
|
}),
|
7188
7191
|
401: DefaultUnauthorizedSchema,
|
7189
7192
|
500: DefaultErrorResponseSchema
|
@@ -7195,9 +7198,9 @@ var widgetContract = initContract29().router(
|
|
7195
7198
|
path: "/contact_detail",
|
7196
7199
|
headers: DefaultHeaderSchema,
|
7197
7200
|
responses: {
|
7198
|
-
200:
|
7199
|
-
400:
|
7200
|
-
message:
|
7201
|
+
200: z89.array(WidgetSchema),
|
7202
|
+
400: z89.object({
|
7203
|
+
message: z89.string()
|
7201
7204
|
}),
|
7202
7205
|
401: DefaultUnauthorizedSchema,
|
7203
7206
|
500: DefaultErrorResponseSchema
|
@@ -7209,9 +7212,9 @@ var widgetContract = initContract29().router(
|
|
7209
7212
|
path: "/contact_profile",
|
7210
7213
|
headers: DefaultHeaderSchema,
|
7211
7214
|
responses: {
|
7212
|
-
200:
|
7213
|
-
400:
|
7214
|
-
message:
|
7215
|
+
200: z89.array(WidgetSchema),
|
7216
|
+
400: z89.object({
|
7217
|
+
message: z89.string()
|
7215
7218
|
}),
|
7216
7219
|
401: DefaultUnauthorizedSchema,
|
7217
7220
|
500: DefaultErrorResponseSchema
|
@@ -7223,9 +7226,9 @@ var widgetContract = initContract29().router(
|
|
7223
7226
|
path: "/inbox_detail",
|
7224
7227
|
headers: DefaultHeaderSchema,
|
7225
7228
|
responses: {
|
7226
|
-
200:
|
7227
|
-
400:
|
7228
|
-
message:
|
7229
|
+
200: z89.array(WidgetSchema),
|
7230
|
+
400: z89.object({
|
7231
|
+
message: z89.string()
|
7229
7232
|
}),
|
7230
7233
|
401: DefaultUnauthorizedSchema,
|
7231
7234
|
500: DefaultErrorResponseSchema
|
@@ -7235,12 +7238,12 @@ var widgetContract = initContract29().router(
|
|
7235
7238
|
getWidgetById: {
|
7236
7239
|
method: "GET",
|
7237
7240
|
path: "/:id",
|
7238
|
-
pathParams:
|
7241
|
+
pathParams: z89.object({ id: z89.string() }),
|
7239
7242
|
headers: DefaultHeaderSchema,
|
7240
7243
|
responses: {
|
7241
7244
|
200: WidgetSchema,
|
7242
|
-
400:
|
7243
|
-
message:
|
7245
|
+
400: z89.object({
|
7246
|
+
message: z89.string()
|
7244
7247
|
}),
|
7245
7248
|
401: DefaultUnauthorizedSchema,
|
7246
7249
|
500: DefaultErrorResponseSchema
|
@@ -7254,14 +7257,14 @@ var widgetContract = initContract29().router(
|
|
7254
7257
|
headers: DefaultHeaderSchema,
|
7255
7258
|
responses: {
|
7256
7259
|
201: DefaultSuccessResponseSchema.extend({
|
7257
|
-
widget:
|
7258
|
-
token:
|
7259
|
-
headers:
|
7260
|
-
url:
|
7260
|
+
widget: z89.object({
|
7261
|
+
token: z89.string().nullable(),
|
7262
|
+
headers: z89.array(WidgetHeaderSchema),
|
7263
|
+
url: z89.string()
|
7261
7264
|
})
|
7262
7265
|
}),
|
7263
|
-
400:
|
7264
|
-
message:
|
7266
|
+
400: z89.object({
|
7267
|
+
message: z89.string()
|
7265
7268
|
}),
|
7266
7269
|
401: DefaultUnauthorizedSchema
|
7267
7270
|
},
|
@@ -7270,14 +7273,14 @@ var widgetContract = initContract29().router(
|
|
7270
7273
|
updateWidget: {
|
7271
7274
|
method: "PATCH",
|
7272
7275
|
path: "/:id",
|
7273
|
-
pathParams:
|
7276
|
+
pathParams: z89.object({ id: z89.string() }),
|
7274
7277
|
headers: DefaultHeaderSchema,
|
7275
7278
|
responses: {
|
7276
7279
|
201: DefaultSuccessResponseSchema.extend({
|
7277
7280
|
widget: WidgetSchema
|
7278
7281
|
}),
|
7279
|
-
400:
|
7280
|
-
message:
|
7282
|
+
400: z89.object({
|
7283
|
+
message: z89.string()
|
7281
7284
|
}),
|
7282
7285
|
401: DefaultUnauthorizedSchema
|
7283
7286
|
},
|
@@ -7287,11 +7290,11 @@ var widgetContract = initContract29().router(
|
|
7287
7290
|
deleteWidget: {
|
7288
7291
|
method: "DELETE",
|
7289
7292
|
path: "/:id",
|
7290
|
-
pathParams:
|
7293
|
+
pathParams: z89.object({ id: z89.string() }),
|
7291
7294
|
headers: DefaultHeaderSchema,
|
7292
7295
|
body: null,
|
7293
7296
|
responses: {
|
7294
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
7297
|
+
200: DefaultSuccessResponseSchema.extend({ message: z89.string() }),
|
7295
7298
|
500: DefaultErrorResponseSchema
|
7296
7299
|
},
|
7297
7300
|
summary: "Delete a widget."
|
@@ -7302,35 +7305,35 @@ var widgetContract = initContract29().router(
|
|
7302
7305
|
|
7303
7306
|
// src/wrap-up-form/index.ts
|
7304
7307
|
import { initContract as initContract30 } from "@ts-rest/core";
|
7305
|
-
import
|
7308
|
+
import z91 from "zod";
|
7306
7309
|
|
7307
7310
|
// src/wrap-up-form/validation.ts
|
7308
|
-
import { z as
|
7309
|
-
var CreateWrapUpFormSchema =
|
7310
|
-
note:
|
7311
|
-
disposition:
|
7312
|
-
callFrom:
|
7313
|
-
callTo:
|
7311
|
+
import { z as z90 } from "zod";
|
7312
|
+
var CreateWrapUpFormSchema = z90.object({
|
7313
|
+
note: z90.string().nullable().optional(),
|
7314
|
+
disposition: z90.string().nullable().optional(),
|
7315
|
+
callFrom: z90.string().nullable().optional(),
|
7316
|
+
callTo: z90.string().nullable().optional()
|
7314
7317
|
});
|
7315
7318
|
var UpdateWrapUpFormSchema = CreateWrapUpFormSchema.extend({
|
7316
|
-
cxLogId:
|
7317
|
-
type:
|
7318
|
-
tags:
|
7319
|
-
categoryIds:
|
7320
|
-
customFields:
|
7321
|
-
|
7322
|
-
id:
|
7323
|
-
type:
|
7324
|
-
value:
|
7319
|
+
cxLogId: z90.string().uuid().optional(),
|
7320
|
+
type: z90.string().optional(),
|
7321
|
+
tags: z90.array(z90.string()).optional(),
|
7322
|
+
categoryIds: z90.array(z90.string().uuid()).optional(),
|
7323
|
+
customFields: z90.array(
|
7324
|
+
z90.object({
|
7325
|
+
id: z90.string().uuid(),
|
7326
|
+
type: z90.string(),
|
7327
|
+
value: z90.string()
|
7325
7328
|
})
|
7326
7329
|
).optional(),
|
7327
|
-
durationSeconds:
|
7330
|
+
durationSeconds: z90.number().optional()
|
7328
7331
|
});
|
7329
|
-
var CreateCXLogWrapUpFormSchema =
|
7330
|
-
cxLogId:
|
7331
|
-
disposition:
|
7332
|
-
tagIds:
|
7333
|
-
note:
|
7332
|
+
var CreateCXLogWrapUpFormSchema = z90.object({
|
7333
|
+
cxLogId: z90.string().uuid(),
|
7334
|
+
disposition: z90.string().optional(),
|
7335
|
+
tagIds: z90.array(z90.string().uuid()).optional(),
|
7336
|
+
note: z90.string().optional()
|
7334
7337
|
});
|
7335
7338
|
|
7336
7339
|
// src/wrap-up-form/index.ts
|
@@ -7342,10 +7345,10 @@ var wrapUpFormContract = initContract30().router(
|
|
7342
7345
|
headers: DefaultHeaderSchema,
|
7343
7346
|
responses: {
|
7344
7347
|
200: DefaultSuccessResponseSchema.extend({
|
7345
|
-
wrapUpFormTimer:
|
7348
|
+
wrapUpFormTimer: z91.number()
|
7346
7349
|
}),
|
7347
|
-
400:
|
7348
|
-
message:
|
7350
|
+
400: z91.object({
|
7351
|
+
message: z91.string()
|
7349
7352
|
}),
|
7350
7353
|
401: DefaultUnauthorizedSchema,
|
7351
7354
|
500: DefaultErrorResponseSchema
|
@@ -7354,14 +7357,14 @@ var wrapUpFormContract = initContract30().router(
|
|
7354
7357
|
updateWrapUpFormTimer: {
|
7355
7358
|
method: "PATCH",
|
7356
7359
|
path: "/timer",
|
7357
|
-
body:
|
7360
|
+
body: z91.object({ newWrapUpFormTimer: z91.number().positive() }),
|
7358
7361
|
headers: DefaultHeaderSchema,
|
7359
7362
|
responses: {
|
7360
7363
|
200: DefaultSuccessResponseSchema.extend({
|
7361
|
-
wrapUpFormTimer:
|
7364
|
+
wrapUpFormTimer: z91.number()
|
7362
7365
|
}),
|
7363
|
-
400:
|
7364
|
-
message:
|
7366
|
+
400: z91.object({
|
7367
|
+
message: z91.string()
|
7365
7368
|
}),
|
7366
7369
|
401: DefaultUnauthorizedSchema,
|
7367
7370
|
500: DefaultErrorResponseSchema
|
@@ -7376,8 +7379,8 @@ var wrapUpFormContract = initContract30().router(
|
|
7376
7379
|
201: DefaultSuccessResponseSchema.extend({
|
7377
7380
|
wrapUpForm: WrapUpFormSchema
|
7378
7381
|
}),
|
7379
|
-
400:
|
7380
|
-
message:
|
7382
|
+
400: z91.object({
|
7383
|
+
message: z91.string()
|
7381
7384
|
}),
|
7382
7385
|
401: DefaultUnauthorizedSchema,
|
7383
7386
|
500: DefaultErrorResponseSchema
|
@@ -7399,15 +7402,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7399
7402
|
getWrapUpForms: {
|
7400
7403
|
method: "GET",
|
7401
7404
|
path: "",
|
7402
|
-
query:
|
7403
|
-
page:
|
7404
|
-
pageSize:
|
7405
|
+
query: z91.object({
|
7406
|
+
page: z91.coerce.number().default(1),
|
7407
|
+
pageSize: z91.coerce.number().default(10)
|
7405
7408
|
}).optional(),
|
7406
7409
|
headers: DefaultHeaderSchema,
|
7407
7410
|
responses: {
|
7408
7411
|
200: WithPagination(WrapUpFormSchema),
|
7409
|
-
400:
|
7410
|
-
message:
|
7412
|
+
400: z91.object({
|
7413
|
+
message: z91.string()
|
7411
7414
|
}),
|
7412
7415
|
401: DefaultUnauthorizedSchema,
|
7413
7416
|
500: DefaultErrorResponseSchema
|
@@ -7417,12 +7420,12 @@ var wrapUpFormContract = initContract30().router(
|
|
7417
7420
|
getWrapUpForm: {
|
7418
7421
|
method: "GET",
|
7419
7422
|
path: "/:id",
|
7420
|
-
pathParams:
|
7423
|
+
pathParams: z91.object({ id: z91.string() }),
|
7421
7424
|
headers: DefaultHeaderSchema,
|
7422
7425
|
responses: {
|
7423
7426
|
200: WrapUpFormSchema,
|
7424
|
-
400:
|
7425
|
-
message:
|
7427
|
+
400: z91.object({
|
7428
|
+
message: z91.string()
|
7426
7429
|
}),
|
7427
7430
|
401: DefaultUnauthorizedSchema,
|
7428
7431
|
500: DefaultErrorResponseSchema
|
@@ -7431,15 +7434,15 @@ var wrapUpFormContract = initContract30().router(
|
|
7431
7434
|
updateWrapUpForm: {
|
7432
7435
|
method: "PATCH",
|
7433
7436
|
path: "/:id",
|
7434
|
-
pathParams:
|
7437
|
+
pathParams: z91.object({ id: z91.string() }),
|
7435
7438
|
headers: DefaultHeaderSchema,
|
7436
7439
|
body: UpdateWrapUpFormSchema,
|
7437
7440
|
responses: {
|
7438
7441
|
201: DefaultSuccessResponseSchema.extend({
|
7439
7442
|
wrapUpForm: WrapUpFormSchema
|
7440
7443
|
}),
|
7441
|
-
400:
|
7442
|
-
message:
|
7444
|
+
400: z91.object({
|
7445
|
+
message: z91.string()
|
7443
7446
|
}),
|
7444
7447
|
401: DefaultUnauthorizedSchema,
|
7445
7448
|
500: DefaultErrorResponseSchema
|
@@ -7452,28 +7455,28 @@ var wrapUpFormContract = initContract30().router(
|
|
7452
7455
|
|
7453
7456
|
// src/upload/index.ts
|
7454
7457
|
import { initContract as initContract31 } from "@ts-rest/core";
|
7455
|
-
import
|
7458
|
+
import z92 from "zod";
|
7456
7459
|
var uploadContract = initContract31().router(
|
7457
7460
|
{
|
7458
7461
|
rename: {
|
7459
7462
|
method: "POST",
|
7460
7463
|
path: "/:id/rename",
|
7461
|
-
pathParams:
|
7462
|
-
id:
|
7464
|
+
pathParams: z92.object({
|
7465
|
+
id: z92.string()
|
7463
7466
|
}),
|
7464
7467
|
headers: DefaultHeaderSchema,
|
7465
7468
|
responses: {
|
7466
7469
|
201: DefaultSuccessResponseSchema.extend({
|
7467
|
-
message:
|
7470
|
+
message: z92.string()
|
7468
7471
|
}),
|
7469
|
-
400:
|
7470
|
-
message:
|
7472
|
+
400: z92.object({
|
7473
|
+
message: z92.string()
|
7471
7474
|
}),
|
7472
|
-
409:
|
7473
|
-
message:
|
7475
|
+
409: z92.object({
|
7476
|
+
message: z92.string()
|
7474
7477
|
}),
|
7475
|
-
500:
|
7476
|
-
message:
|
7478
|
+
500: z92.object({
|
7479
|
+
message: z92.string()
|
7477
7480
|
}),
|
7478
7481
|
401: DefaultUnauthorizedSchema,
|
7479
7482
|
404: DefaultNotFoundSchema,
|
@@ -7485,23 +7488,23 @@ var uploadContract = initContract31().router(
|
|
7485
7488
|
delete: {
|
7486
7489
|
method: "DELETE",
|
7487
7490
|
path: "/:id",
|
7488
|
-
pathParams:
|
7489
|
-
id:
|
7491
|
+
pathParams: z92.object({
|
7492
|
+
id: z92.string()
|
7490
7493
|
}),
|
7491
7494
|
headers: DefaultHeaderSchema,
|
7492
7495
|
body: null,
|
7493
7496
|
responses: {
|
7494
7497
|
201: DefaultSuccessResponseSchema.extend({
|
7495
|
-
message:
|
7498
|
+
message: z92.string()
|
7496
7499
|
}),
|
7497
|
-
400:
|
7498
|
-
message:
|
7500
|
+
400: z92.object({
|
7501
|
+
message: z92.string()
|
7499
7502
|
}),
|
7500
|
-
409:
|
7501
|
-
message:
|
7503
|
+
409: z92.object({
|
7504
|
+
message: z92.string()
|
7502
7505
|
}),
|
7503
|
-
500:
|
7504
|
-
message:
|
7506
|
+
500: z92.object({
|
7507
|
+
message: z92.string()
|
7505
7508
|
}),
|
7506
7509
|
401: DefaultUnauthorizedSchema,
|
7507
7510
|
404: DefaultNotFoundSchema,
|
@@ -7516,19 +7519,19 @@ var uploadContract = initContract31().router(
|
|
7516
7519
|
);
|
7517
7520
|
|
7518
7521
|
// src/viber/index.ts
|
7519
|
-
import
|
7522
|
+
import z94 from "zod";
|
7520
7523
|
|
7521
7524
|
// src/viber/validation.ts
|
7522
|
-
import
|
7523
|
-
var ViberChannelSchema =
|
7524
|
-
name:
|
7525
|
-
accessToken:
|
7526
|
-
actor:
|
7527
|
-
id:
|
7528
|
-
name:
|
7529
|
-
email:
|
7530
|
-
address:
|
7531
|
-
phone:
|
7525
|
+
import z93 from "zod";
|
7526
|
+
var ViberChannelSchema = z93.object({
|
7527
|
+
name: z93.string(),
|
7528
|
+
accessToken: z93.string(),
|
7529
|
+
actor: z93.object({
|
7530
|
+
id: z93.string().uuid(),
|
7531
|
+
name: z93.string(),
|
7532
|
+
email: z93.string().email(),
|
7533
|
+
address: z93.string().nullable(),
|
7534
|
+
phone: z93.string().nullable()
|
7532
7535
|
}).optional()
|
7533
7536
|
});
|
7534
7537
|
|
@@ -7557,8 +7560,8 @@ var viberContract = initContract32().router({
|
|
7557
7560
|
}),
|
7558
7561
|
400: DefaultErrorResponseSchema
|
7559
7562
|
},
|
7560
|
-
body:
|
7561
|
-
id:
|
7563
|
+
body: z94.object({
|
7564
|
+
id: z94.string().uuid()
|
7562
7565
|
}),
|
7563
7566
|
summary: "Connect viber channel"
|
7564
7567
|
},
|
@@ -7574,8 +7577,8 @@ var viberContract = initContract32().router({
|
|
7574
7577
|
reconnect: {
|
7575
7578
|
method: "POST",
|
7576
7579
|
path: "/reconnect/:channelId",
|
7577
|
-
pathParams:
|
7578
|
-
channelId:
|
7580
|
+
pathParams: z94.object({
|
7581
|
+
channelId: z94.string().uuid()
|
7579
7582
|
}),
|
7580
7583
|
responses: {
|
7581
7584
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7590,8 +7593,8 @@ var viberContract = initContract32().router({
|
|
7590
7593
|
delete: {
|
7591
7594
|
method: "DELETE",
|
7592
7595
|
path: "/delete/:channelId",
|
7593
|
-
pathParams:
|
7594
|
-
channelId:
|
7596
|
+
pathParams: z94.object({
|
7597
|
+
channelId: z94.string().uuid()
|
7595
7598
|
}),
|
7596
7599
|
body: null,
|
7597
7600
|
responses: {
|
@@ -7603,21 +7606,21 @@ var viberContract = initContract32().router({
|
|
7603
7606
|
});
|
7604
7607
|
|
7605
7608
|
// src/telegram/index.ts
|
7606
|
-
import
|
7609
|
+
import z96 from "zod";
|
7607
7610
|
import { initContract as initContract33 } from "@ts-rest/core";
|
7608
7611
|
|
7609
7612
|
// src/telegram/validation.ts
|
7610
|
-
import
|
7611
|
-
var TelegramChannelSchema =
|
7612
|
-
name:
|
7613
|
+
import z95 from "zod";
|
7614
|
+
var TelegramChannelSchema = z95.object({
|
7615
|
+
name: z95.string(),
|
7613
7616
|
// Telegram bot access token
|
7614
|
-
accessToken:
|
7615
|
-
actor:
|
7616
|
-
id:
|
7617
|
-
name:
|
7618
|
-
email:
|
7619
|
-
address:
|
7620
|
-
phone:
|
7617
|
+
accessToken: z95.string(),
|
7618
|
+
actor: z95.object({
|
7619
|
+
id: z95.string().uuid(),
|
7620
|
+
name: z95.string(),
|
7621
|
+
email: z95.string().email(),
|
7622
|
+
address: z95.string().nullable(),
|
7623
|
+
phone: z95.string().nullable()
|
7621
7624
|
}).optional()
|
7622
7625
|
});
|
7623
7626
|
|
@@ -7644,8 +7647,8 @@ var telegramContract = initContract33().router({
|
|
7644
7647
|
500: DefaultErrorResponseSchema,
|
7645
7648
|
400: DefaultErrorResponseSchema
|
7646
7649
|
},
|
7647
|
-
body:
|
7648
|
-
id:
|
7650
|
+
body: z96.object({
|
7651
|
+
id: z96.string().uuid()
|
7649
7652
|
}),
|
7650
7653
|
summary: "Disconnect telegram channel"
|
7651
7654
|
},
|
@@ -7661,8 +7664,8 @@ var telegramContract = initContract33().router({
|
|
7661
7664
|
reconnect: {
|
7662
7665
|
method: "POST",
|
7663
7666
|
path: "/reconnect/:channelId",
|
7664
|
-
pathParams:
|
7665
|
-
channelId:
|
7667
|
+
pathParams: z96.object({
|
7668
|
+
channelId: z96.string().uuid()
|
7666
7669
|
}),
|
7667
7670
|
body: null,
|
7668
7671
|
responses: {
|
@@ -7675,8 +7678,8 @@ var telegramContract = initContract33().router({
|
|
7675
7678
|
delete: {
|
7676
7679
|
method: "DELETE",
|
7677
7680
|
path: "/delete/:channelId",
|
7678
|
-
pathParams:
|
7679
|
-
channelId:
|
7681
|
+
pathParams: z96.object({
|
7682
|
+
channelId: z96.string().uuid()
|
7680
7683
|
}),
|
7681
7684
|
body: null,
|
7682
7685
|
responses: {
|
@@ -7690,58 +7693,58 @@ var telegramContract = initContract33().router({
|
|
7690
7693
|
|
7691
7694
|
// src/notification/index.ts
|
7692
7695
|
import { initContract as initContract34 } from "@ts-rest/core";
|
7693
|
-
import
|
7696
|
+
import z99 from "zod";
|
7694
7697
|
|
7695
7698
|
// src/notification/validation.ts
|
7696
|
-
import
|
7699
|
+
import z98 from "zod";
|
7697
7700
|
|
7698
7701
|
// src/notification/schema.ts
|
7699
|
-
import
|
7700
|
-
var NotificationChangeSchema =
|
7701
|
-
id:
|
7702
|
-
createdAt:
|
7703
|
-
updatedAt:
|
7704
|
-
deletedAt:
|
7705
|
-
actorId:
|
7702
|
+
import z97 from "zod";
|
7703
|
+
var NotificationChangeSchema = z97.object({
|
7704
|
+
id: z97.string().uuid(),
|
7705
|
+
createdAt: z97.date(),
|
7706
|
+
updatedAt: z97.date(),
|
7707
|
+
deletedAt: z97.date().nullable(),
|
7708
|
+
actorId: z97.string().uuid(),
|
7706
7709
|
actor: UserSchema,
|
7707
|
-
notificationObjectId:
|
7708
|
-
readAt:
|
7709
|
-
});
|
7710
|
-
var NotificationObjectSchema =
|
7711
|
-
id:
|
7712
|
-
createdAt:
|
7713
|
-
updatedAt:
|
7714
|
-
deletedAt:
|
7715
|
-
data:
|
7710
|
+
notificationObjectId: z97.string().uuid(),
|
7711
|
+
readAt: z97.date()
|
7712
|
+
});
|
7713
|
+
var NotificationObjectSchema = z97.object({
|
7714
|
+
id: z97.string().uuid(),
|
7715
|
+
createdAt: z97.date(),
|
7716
|
+
updatedAt: z97.date(),
|
7717
|
+
deletedAt: z97.date().nullable(),
|
7718
|
+
data: z97.string(),
|
7716
7719
|
notificationChange: NotificationChangeSchema
|
7717
7720
|
});
|
7718
|
-
var NotificationSchema =
|
7719
|
-
id:
|
7720
|
-
createdAt:
|
7721
|
-
updatedAt:
|
7722
|
-
deletedAt:
|
7723
|
-
notificationObjectId:
|
7724
|
-
notifierId:
|
7721
|
+
var NotificationSchema = z97.object({
|
7722
|
+
id: z97.string().uuid(),
|
7723
|
+
createdAt: z97.date(),
|
7724
|
+
updatedAt: z97.date(),
|
7725
|
+
deletedAt: z97.date().nullable(),
|
7726
|
+
notificationObjectId: z97.string().uuid(),
|
7727
|
+
notifierId: z97.string().uuid(),
|
7725
7728
|
notificationObject: NotificationObjectSchema,
|
7726
|
-
readAt:
|
7729
|
+
readAt: z97.date()
|
7727
7730
|
});
|
7728
7731
|
|
7729
7732
|
// src/notification/validation.ts
|
7730
|
-
var GetNotificationsRequestSchema =
|
7731
|
-
page:
|
7732
|
-
pageSize:
|
7733
|
+
var GetNotificationsRequestSchema = z98.object({
|
7734
|
+
page: z98.coerce.number().default(1),
|
7735
|
+
pageSize: z98.coerce.number().default(10)
|
7733
7736
|
});
|
7734
|
-
var GetNotificationsResponseSchema =
|
7735
|
-
notificationCount:
|
7736
|
-
notifications:
|
7737
|
-
total:
|
7738
|
-
page:
|
7739
|
-
pageSize:
|
7740
|
-
lastPage:
|
7741
|
-
totalUnreadCount:
|
7737
|
+
var GetNotificationsResponseSchema = z98.object({
|
7738
|
+
notificationCount: z98.number(),
|
7739
|
+
notifications: z98.array(NotificationSchema),
|
7740
|
+
total: z98.number(),
|
7741
|
+
page: z98.number(),
|
7742
|
+
pageSize: z98.number(),
|
7743
|
+
lastPage: z98.number(),
|
7744
|
+
totalUnreadCount: z98.number().optional()
|
7742
7745
|
});
|
7743
|
-
var ResetNotificationRequestSchema =
|
7744
|
-
userId:
|
7746
|
+
var ResetNotificationRequestSchema = z98.object({
|
7747
|
+
userId: z98.string()
|
7745
7748
|
});
|
7746
7749
|
|
7747
7750
|
// src/notification/index.ts
|
@@ -7755,14 +7758,14 @@ var userNotificationContract = initContract34().router(
|
|
7755
7758
|
200: DefaultSuccessResponseSchema.extend({
|
7756
7759
|
data: GetNotificationsResponseSchema
|
7757
7760
|
}),
|
7758
|
-
400:
|
7759
|
-
message:
|
7761
|
+
400: z99.object({
|
7762
|
+
message: z99.string()
|
7760
7763
|
}),
|
7761
|
-
409:
|
7762
|
-
message:
|
7764
|
+
409: z99.object({
|
7765
|
+
message: z99.string()
|
7763
7766
|
}),
|
7764
|
-
500:
|
7765
|
-
message:
|
7767
|
+
500: z99.object({
|
7768
|
+
message: z99.string()
|
7766
7769
|
}),
|
7767
7770
|
401: DefaultUnauthorizedSchema,
|
7768
7771
|
404: DefaultNotFoundSchema,
|
@@ -7775,16 +7778,16 @@ var userNotificationContract = initContract34().router(
|
|
7775
7778
|
path: "/new_notifications_count",
|
7776
7779
|
responses: {
|
7777
7780
|
200: DefaultSuccessResponseSchema.extend({
|
7778
|
-
total:
|
7781
|
+
total: z99.number()
|
7779
7782
|
}),
|
7780
|
-
400:
|
7781
|
-
message:
|
7783
|
+
400: z99.object({
|
7784
|
+
message: z99.string()
|
7782
7785
|
}),
|
7783
|
-
409:
|
7784
|
-
message:
|
7786
|
+
409: z99.object({
|
7787
|
+
message: z99.string()
|
7785
7788
|
}),
|
7786
|
-
500:
|
7787
|
-
message:
|
7789
|
+
500: z99.object({
|
7790
|
+
message: z99.string()
|
7788
7791
|
}),
|
7789
7792
|
401: DefaultUnauthorizedSchema,
|
7790
7793
|
404: DefaultNotFoundSchema,
|
@@ -7799,14 +7802,14 @@ var userNotificationContract = initContract34().router(
|
|
7799
7802
|
201: DefaultSuccessResponseSchema.extend({
|
7800
7803
|
data: UserSchema
|
7801
7804
|
}),
|
7802
|
-
400:
|
7803
|
-
message:
|
7805
|
+
400: z99.object({
|
7806
|
+
message: z99.string()
|
7804
7807
|
}),
|
7805
|
-
409:
|
7806
|
-
message:
|
7808
|
+
409: z99.object({
|
7809
|
+
message: z99.string()
|
7807
7810
|
}),
|
7808
|
-
500:
|
7809
|
-
message:
|
7811
|
+
500: z99.object({
|
7812
|
+
message: z99.string()
|
7810
7813
|
}),
|
7811
7814
|
401: DefaultUnauthorizedSchema,
|
7812
7815
|
404: DefaultNotFoundSchema,
|
@@ -7818,19 +7821,19 @@ var userNotificationContract = initContract34().router(
|
|
7818
7821
|
readNotification: {
|
7819
7822
|
method: "POST",
|
7820
7823
|
path: "/read/:id",
|
7821
|
-
pathParams:
|
7824
|
+
pathParams: z99.object({ id: z99.string() }),
|
7822
7825
|
responses: {
|
7823
7826
|
201: DefaultSuccessResponseSchema.extend({
|
7824
7827
|
data: NotificationSchema
|
7825
7828
|
}),
|
7826
|
-
400:
|
7827
|
-
message:
|
7829
|
+
400: z99.object({
|
7830
|
+
message: z99.string()
|
7828
7831
|
}),
|
7829
|
-
409:
|
7830
|
-
message:
|
7832
|
+
409: z99.object({
|
7833
|
+
message: z99.string()
|
7831
7834
|
}),
|
7832
|
-
500:
|
7833
|
-
message:
|
7835
|
+
500: z99.object({
|
7836
|
+
message: z99.string()
|
7834
7837
|
}),
|
7835
7838
|
401: DefaultUnauthorizedSchema,
|
7836
7839
|
404: DefaultNotFoundSchema,
|
@@ -7847,63 +7850,63 @@ var userNotificationContract = initContract34().router(
|
|
7847
7850
|
|
7848
7851
|
// src/snippet/index.ts
|
7849
7852
|
import { initContract as initContract35 } from "@ts-rest/core";
|
7850
|
-
import { z as
|
7853
|
+
import { z as z102 } from "zod";
|
7851
7854
|
|
7852
7855
|
// src/snippet/schema.ts
|
7853
|
-
import
|
7856
|
+
import z100 from "zod";
|
7854
7857
|
var SnippetGroupSchema = DefaultEntitySchema.extend({
|
7855
|
-
name:
|
7856
|
-
platformType:
|
7858
|
+
name: z100.string(),
|
7859
|
+
platformType: z100.string()
|
7857
7860
|
});
|
7858
7861
|
var SnippetContentSchema = DefaultEntitySchema.extend({
|
7859
|
-
contentType:
|
7860
|
-
contentValue:
|
7861
|
-
contentTemplate:
|
7862
|
-
order:
|
7862
|
+
contentType: z100.string(),
|
7863
|
+
contentValue: z100.string().nullable(),
|
7864
|
+
contentTemplate: z100.any().nullable(),
|
7865
|
+
order: z100.number(),
|
7863
7866
|
upload: UploadSchema.nullable()
|
7864
7867
|
});
|
7865
7868
|
var SnippetSchema = DefaultEntitySchema.extend({
|
7866
|
-
name:
|
7869
|
+
name: z100.string(),
|
7867
7870
|
snippetGroup: SnippetGroupSchema,
|
7868
7871
|
snippetContent: SnippetContentSchema
|
7869
7872
|
});
|
7870
|
-
var SnippetGroupListItemSchema =
|
7871
|
-
id:
|
7872
|
-
name:
|
7873
|
+
var SnippetGroupListItemSchema = z100.object({
|
7874
|
+
id: z100.string().uuid(),
|
7875
|
+
name: z100.string()
|
7873
7876
|
});
|
7874
|
-
var SnippetListItemSchema =
|
7875
|
-
id:
|
7876
|
-
shortCutName:
|
7877
|
-
contentType:
|
7878
|
-
contentValue:
|
7879
|
-
snippetGroupId:
|
7877
|
+
var SnippetListItemSchema = z100.object({
|
7878
|
+
id: z100.string().uuid(),
|
7879
|
+
shortCutName: z100.string(),
|
7880
|
+
contentType: z100.string(),
|
7881
|
+
contentValue: z100.string().nullable(),
|
7882
|
+
snippetGroupId: z100.string()
|
7880
7883
|
});
|
7881
7884
|
|
7882
7885
|
// src/snippet/validation.ts
|
7883
|
-
import { z as
|
7884
|
-
var CreateSnippetGroupSchema =
|
7885
|
-
name:
|
7886
|
-
platformType:
|
7886
|
+
import { z as z101 } from "zod";
|
7887
|
+
var CreateSnippetGroupSchema = z101.object({
|
7888
|
+
name: z101.string(),
|
7889
|
+
platformType: z101.string()
|
7887
7890
|
});
|
7888
|
-
var UpdateSnippetGroupSchema =
|
7889
|
-
name:
|
7890
|
-
platformType:
|
7891
|
+
var UpdateSnippetGroupSchema = z101.object({
|
7892
|
+
name: z101.string().optional(),
|
7893
|
+
platformType: z101.string().optional()
|
7891
7894
|
});
|
7892
|
-
var DeleteSnippetGroupSchema =
|
7893
|
-
id:
|
7895
|
+
var DeleteSnippetGroupSchema = z101.object({
|
7896
|
+
id: z101.string()
|
7894
7897
|
});
|
7895
|
-
var CreateSnippetSchema =
|
7896
|
-
shortcutName:
|
7897
|
-
contentType:
|
7898
|
-
contentValue:
|
7899
|
-
snippetGroupId:
|
7900
|
-
platformType:
|
7898
|
+
var CreateSnippetSchema = z101.object({
|
7899
|
+
shortcutName: z101.string(),
|
7900
|
+
contentType: z101.string(),
|
7901
|
+
contentValue: z101.string().optional(),
|
7902
|
+
snippetGroupId: z101.string(),
|
7903
|
+
platformType: z101.string()
|
7901
7904
|
});
|
7902
7905
|
var UpdateSnippetSchema = CreateSnippetSchema.extend({
|
7903
|
-
snippetContentId:
|
7906
|
+
snippetContentId: z101.string()
|
7904
7907
|
});
|
7905
|
-
var DeleteSnippetSchema =
|
7906
|
-
snippetId:
|
7908
|
+
var DeleteSnippetSchema = z101.object({
|
7909
|
+
snippetId: z101.string()
|
7907
7910
|
});
|
7908
7911
|
|
7909
7912
|
// src/snippet/index.ts
|
@@ -7926,7 +7929,7 @@ var snippetContract = initContract35().router(
|
|
7926
7929
|
query: null,
|
7927
7930
|
responses: {
|
7928
7931
|
200: DefaultSuccessResponseSchema.extend({
|
7929
|
-
snippetgroups:
|
7932
|
+
snippetgroups: z102.array(SnippetGroupSchema)
|
7930
7933
|
}),
|
7931
7934
|
500: DefaultErrorResponseSchema
|
7932
7935
|
}
|
@@ -7934,7 +7937,7 @@ var snippetContract = initContract35().router(
|
|
7934
7937
|
updateSnippetGroup: {
|
7935
7938
|
method: "PATCH",
|
7936
7939
|
path: "/groups/:id",
|
7937
|
-
pathParams:
|
7940
|
+
pathParams: z102.object({ id: z102.string() }),
|
7938
7941
|
body: UpdateSnippetGroupSchema,
|
7939
7942
|
responses: {
|
7940
7943
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7946,7 +7949,7 @@ var snippetContract = initContract35().router(
|
|
7946
7949
|
deleteSnippetGroup: {
|
7947
7950
|
method: "DELETE",
|
7948
7951
|
path: "/groups/:id",
|
7949
|
-
pathParams:
|
7952
|
+
pathParams: z102.object({ id: z102.string() }),
|
7950
7953
|
body: null,
|
7951
7954
|
responses: {
|
7952
7955
|
200: DefaultSuccessResponseSchema,
|
@@ -7958,7 +7961,7 @@ var snippetContract = initContract35().router(
|
|
7958
7961
|
path: "",
|
7959
7962
|
responses: {
|
7960
7963
|
200: DefaultSuccessResponseSchema.extend({
|
7961
|
-
snippets:
|
7964
|
+
snippets: z102.array(SnippetSchema)
|
7962
7965
|
}),
|
7963
7966
|
500: DefaultErrorResponseSchema
|
7964
7967
|
}
|
@@ -7977,7 +7980,7 @@ var snippetContract = initContract35().router(
|
|
7977
7980
|
updateSnippet: {
|
7978
7981
|
method: "PATCH",
|
7979
7982
|
path: "/:id",
|
7980
|
-
pathParams:
|
7983
|
+
pathParams: z102.object({ id: z102.string() }),
|
7981
7984
|
body: UpdateSnippetSchema,
|
7982
7985
|
responses: {
|
7983
7986
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7989,7 +7992,7 @@ var snippetContract = initContract35().router(
|
|
7989
7992
|
deleteSnippet: {
|
7990
7993
|
method: "DELETE",
|
7991
7994
|
path: "/:id",
|
7992
|
-
pathParams:
|
7995
|
+
pathParams: z102.object({ id: z102.string() }),
|
7993
7996
|
body: null,
|
7994
7997
|
responses: {
|
7995
7998
|
200: DefaultSuccessResponseSchema,
|
@@ -8006,77 +8009,77 @@ var snippetContract = initContract35().router(
|
|
8006
8009
|
import { initContract as initContract36 } from "@ts-rest/core";
|
8007
8010
|
|
8008
8011
|
// src/business-calendar/validation.ts
|
8009
|
-
import
|
8010
|
-
var TimeSlotDataSchema =
|
8011
|
-
var CreateBusinessHourSchema =
|
8012
|
-
day:
|
8013
|
-
isEnabled:
|
8012
|
+
import z103 from "zod";
|
8013
|
+
var TimeSlotDataSchema = z103.any();
|
8014
|
+
var CreateBusinessHourSchema = z103.object({
|
8015
|
+
day: z103.string(),
|
8016
|
+
isEnabled: z103.boolean(),
|
8014
8017
|
timeSlots: TimeSlotDataSchema
|
8015
8018
|
}).array();
|
8016
|
-
var UpdateBusinessHourSchema =
|
8017
|
-
id:
|
8018
|
-
day:
|
8019
|
-
isEnabled:
|
8019
|
+
var UpdateBusinessHourSchema = z103.object({
|
8020
|
+
id: z103.string(),
|
8021
|
+
day: z103.string(),
|
8022
|
+
isEnabled: z103.boolean(),
|
8020
8023
|
timeSlots: TimeSlotDataSchema
|
8021
8024
|
}).array();
|
8022
|
-
var CreateHolidaySchema =
|
8023
|
-
name:
|
8024
|
-
date:
|
8025
|
-
isEnabled:
|
8025
|
+
var CreateHolidaySchema = z103.object({
|
8026
|
+
name: z103.string(),
|
8027
|
+
date: z103.string(),
|
8028
|
+
isEnabled: z103.boolean()
|
8026
8029
|
}).array();
|
8027
|
-
var UpdateHolidaySchema =
|
8028
|
-
id:
|
8029
|
-
name:
|
8030
|
-
date:
|
8031
|
-
isEnabled:
|
8030
|
+
var UpdateHolidaySchema = z103.object({
|
8031
|
+
id: z103.string().optional(),
|
8032
|
+
name: z103.string(),
|
8033
|
+
date: z103.string(),
|
8034
|
+
isEnabled: z103.boolean()
|
8032
8035
|
}).array();
|
8033
|
-
var CreateBusinessCalendarSchema =
|
8034
|
-
name:
|
8035
|
-
description:
|
8036
|
-
timeZone:
|
8037
|
-
isEnabled:
|
8036
|
+
var CreateBusinessCalendarSchema = z103.object({
|
8037
|
+
name: z103.string(),
|
8038
|
+
description: z103.string().optional(),
|
8039
|
+
timeZone: z103.string(),
|
8040
|
+
isEnabled: z103.boolean(),
|
8038
8041
|
businessHours: CreateBusinessHourSchema,
|
8039
8042
|
holidays: CreateHolidaySchema
|
8040
8043
|
});
|
8041
|
-
var UpdateBusinessCalendarSchema =
|
8042
|
-
id:
|
8043
|
-
name:
|
8044
|
-
description:
|
8045
|
-
timeZone:
|
8046
|
-
isEnabled:
|
8044
|
+
var UpdateBusinessCalendarSchema = z103.object({
|
8045
|
+
id: z103.string(),
|
8046
|
+
name: z103.string(),
|
8047
|
+
description: z103.string().optional(),
|
8048
|
+
timeZone: z103.string(),
|
8049
|
+
isEnabled: z103.boolean(),
|
8047
8050
|
businessHours: UpdateBusinessHourSchema,
|
8048
8051
|
holidays: UpdateHolidaySchema
|
8049
8052
|
});
|
8050
|
-
var DeleteBusinessCalendarSchema =
|
8051
|
-
id:
|
8053
|
+
var DeleteBusinessCalendarSchema = z103.object({
|
8054
|
+
id: z103.string()
|
8052
8055
|
});
|
8053
8056
|
|
8054
8057
|
// src/business-calendar/schema.ts
|
8055
|
-
import
|
8056
|
-
var TimeSlotDataSchema2 =
|
8058
|
+
import z104 from "zod";
|
8059
|
+
var TimeSlotDataSchema2 = z104.any();
|
8057
8060
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
8058
|
-
day:
|
8059
|
-
isEnabled:
|
8061
|
+
day: z104.string(),
|
8062
|
+
isEnabled: z104.boolean(),
|
8060
8063
|
timeSlots: TimeSlotDataSchema2
|
8061
8064
|
});
|
8062
8065
|
var HolidaySchema = DefaultEntitySchema.extend({
|
8063
|
-
name:
|
8064
|
-
date:
|
8065
|
-
isEnabled:
|
8066
|
-
isDefault:
|
8066
|
+
name: z104.string(),
|
8067
|
+
date: z104.string(),
|
8068
|
+
isEnabled: z104.boolean(),
|
8069
|
+
isDefault: z104.boolean()
|
8067
8070
|
});
|
8068
8071
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
8069
|
-
name:
|
8070
|
-
description:
|
8071
|
-
timeZone:
|
8072
|
-
isEnabled:
|
8073
|
-
isDefault:
|
8072
|
+
name: z104.string(),
|
8073
|
+
description: z104.string().optional(),
|
8074
|
+
timeZone: z104.string(),
|
8075
|
+
isEnabled: z104.boolean(),
|
8076
|
+
isDefault: z104.boolean(),
|
8074
8077
|
businessHours: BusinessHourSchema.array(),
|
8075
8078
|
holidays: HolidaySchema.array()
|
8076
8079
|
});
|
8077
8080
|
|
8078
8081
|
// src/business-calendar/index.ts
|
8079
|
-
import
|
8082
|
+
import z105 from "zod";
|
8080
8083
|
var businessCalendarContract = initContract36().router(
|
8081
8084
|
{
|
8082
8085
|
createBusinessCalendar: {
|
@@ -8103,7 +8106,7 @@ var businessCalendarContract = initContract36().router(
|
|
8103
8106
|
updateBusinessCalendar: {
|
8104
8107
|
method: "POST",
|
8105
8108
|
path: "/:id",
|
8106
|
-
pathParams:
|
8109
|
+
pathParams: z105.object({ id: z105.string() }),
|
8107
8110
|
body: UpdateBusinessCalendarSchema,
|
8108
8111
|
responses: {
|
8109
8112
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -8115,7 +8118,7 @@ var businessCalendarContract = initContract36().router(
|
|
8115
8118
|
deleteBusinessCalendar: {
|
8116
8119
|
method: "DELETE",
|
8117
8120
|
path: "/:id",
|
8118
|
-
pathParams:
|
8121
|
+
pathParams: z105.object({ id: z105.string() }),
|
8119
8122
|
body: null,
|
8120
8123
|
responses: {
|
8121
8124
|
200: DefaultSuccessResponseSchema,
|
@@ -8132,73 +8135,73 @@ var businessCalendarContract = initContract36().router(
|
|
8132
8135
|
import { initContract as initContract37 } from "@ts-rest/core";
|
8133
8136
|
|
8134
8137
|
// src/facebook-feed/validation.ts
|
8135
|
-
import
|
8136
|
-
var GetFacebookPagesSchema2 =
|
8137
|
-
data:
|
8138
|
-
|
8138
|
+
import z106 from "zod";
|
8139
|
+
var GetFacebookPagesSchema2 = z106.object({
|
8140
|
+
data: z106.array(
|
8141
|
+
z106.object({
|
8139
8142
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8140
|
-
access_token:
|
8141
|
-
category:
|
8143
|
+
access_token: z106.string(),
|
8144
|
+
category: z106.string(),
|
8142
8145
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
8143
|
-
category_list:
|
8144
|
-
|
8145
|
-
id:
|
8146
|
-
name:
|
8146
|
+
category_list: z106.array(
|
8147
|
+
z106.object({
|
8148
|
+
id: z106.string(),
|
8149
|
+
name: z106.string()
|
8147
8150
|
})
|
8148
8151
|
),
|
8149
|
-
id:
|
8150
|
-
name:
|
8151
|
-
tasks:
|
8152
|
+
id: z106.string(),
|
8153
|
+
name: z106.string(),
|
8154
|
+
tasks: z106.string().array()
|
8152
8155
|
})
|
8153
8156
|
),
|
8154
|
-
paging:
|
8155
|
-
cursors:
|
8156
|
-
before:
|
8157
|
-
after:
|
8157
|
+
paging: z106.object({
|
8158
|
+
cursors: z106.object({
|
8159
|
+
before: z106.string().optional(),
|
8160
|
+
after: z106.string().optional()
|
8158
8161
|
})
|
8159
8162
|
}).optional()
|
8160
8163
|
});
|
8161
|
-
var GetFacebookPagesQuerySchema2 =
|
8162
|
-
accessToken:
|
8163
|
-
userId:
|
8164
|
+
var GetFacebookPagesQuerySchema2 = z106.object({
|
8165
|
+
accessToken: z106.string(),
|
8166
|
+
userId: z106.string()
|
8164
8167
|
});
|
8165
8168
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
8166
|
-
|
8167
|
-
isReloginRequired:
|
8168
|
-
platformContacts:
|
8169
|
-
id:
|
8170
|
-
name:
|
8171
|
-
createdAt:
|
8172
|
-
updatedAt:
|
8173
|
-
deletedAt:
|
8169
|
+
z106.object({
|
8170
|
+
isReloginRequired: z106.boolean(),
|
8171
|
+
platformContacts: z106.array(PlatformContactSchema),
|
8172
|
+
id: z106.string().uuid(),
|
8173
|
+
name: z106.string(),
|
8174
|
+
createdAt: z106.date(),
|
8175
|
+
updatedAt: z106.date(),
|
8176
|
+
deletedAt: z106.date().nullable()
|
8174
8177
|
})
|
8175
8178
|
);
|
8176
|
-
var GetFeedPostResponseSchema =
|
8177
|
-
id:
|
8178
|
-
message:
|
8179
|
-
created_time:
|
8180
|
-
can_reply_privately:
|
8181
|
-
from:
|
8182
|
-
permalink_url:
|
8183
|
-
attachments:
|
8184
|
-
data:
|
8185
|
-
|
8186
|
-
media:
|
8187
|
-
image:
|
8188
|
-
height:
|
8189
|
-
src:
|
8190
|
-
width:
|
8179
|
+
var GetFeedPostResponseSchema = z106.object({
|
8180
|
+
id: z106.string(),
|
8181
|
+
message: z106.string(),
|
8182
|
+
created_time: z106.string(),
|
8183
|
+
can_reply_privately: z106.boolean(),
|
8184
|
+
from: z106.object({ name: z106.string(), id: z106.string() }),
|
8185
|
+
permalink_url: z106.string(),
|
8186
|
+
attachments: z106.object({
|
8187
|
+
data: z106.array(
|
8188
|
+
z106.object({
|
8189
|
+
media: z106.object({
|
8190
|
+
image: z106.object({
|
8191
|
+
height: z106.number(),
|
8192
|
+
src: z106.string(),
|
8193
|
+
width: z106.number()
|
8191
8194
|
})
|
8192
8195
|
}),
|
8193
|
-
media_type:
|
8194
|
-
url:
|
8196
|
+
media_type: z106.string(),
|
8197
|
+
url: z106.string()
|
8195
8198
|
})
|
8196
8199
|
)
|
8197
8200
|
})
|
8198
8201
|
});
|
8199
8202
|
|
8200
8203
|
// src/facebook-feed/index.ts
|
8201
|
-
import
|
8204
|
+
import z107 from "zod";
|
8202
8205
|
var facebookFeedContract = initContract37().router({
|
8203
8206
|
connectToService: {
|
8204
8207
|
method: "POST",
|
@@ -8223,8 +8226,8 @@ var facebookFeedContract = initContract37().router({
|
|
8223
8226
|
reconnect: {
|
8224
8227
|
method: "POST",
|
8225
8228
|
path: "/reconnect/:channelId",
|
8226
|
-
pathParams:
|
8227
|
-
channelId:
|
8229
|
+
pathParams: z107.object({
|
8230
|
+
channelId: z107.string().uuid()
|
8228
8231
|
}),
|
8229
8232
|
body: null,
|
8230
8233
|
responses: {
|
@@ -8236,8 +8239,8 @@ var facebookFeedContract = initContract37().router({
|
|
8236
8239
|
delete: {
|
8237
8240
|
method: "DELETE",
|
8238
8241
|
path: "/delete/:channelId",
|
8239
|
-
pathParams:
|
8240
|
-
channelId:
|
8242
|
+
pathParams: z107.object({
|
8243
|
+
channelId: z107.string().uuid()
|
8241
8244
|
}),
|
8242
8245
|
body: null,
|
8243
8246
|
responses: {
|
@@ -8289,168 +8292,168 @@ var facebookFeedContract = initContract37().router({
|
|
8289
8292
|
|
8290
8293
|
// src/public-api/index.ts
|
8291
8294
|
import { initContract as initContract38 } from "@ts-rest/core";
|
8292
|
-
import
|
8295
|
+
import z110 from "zod";
|
8293
8296
|
|
8294
8297
|
// src/public-api/validation.ts
|
8295
|
-
import
|
8298
|
+
import z109 from "zod";
|
8296
8299
|
|
8297
8300
|
// src/public-api/schema.ts
|
8298
|
-
import
|
8299
|
-
var ContactPhonesSchema2 =
|
8300
|
-
id:
|
8301
|
-
createdAt:
|
8302
|
-
updatedAt:
|
8303
|
-
deletedAt:
|
8304
|
-
phone:
|
8305
|
-
isPrimary:
|
8306
|
-
});
|
8307
|
-
var ContactEmailsSchema2 =
|
8308
|
-
id:
|
8309
|
-
createdAt:
|
8310
|
-
updatedAt:
|
8311
|
-
deletedAt:
|
8312
|
-
email:
|
8313
|
-
isPrimary:
|
8314
|
-
});
|
8315
|
-
var ContactCustomFieldSchema2 =
|
8316
|
-
id:
|
8317
|
-
createdAt:
|
8318
|
-
updatedAt:
|
8319
|
-
deletedAt:
|
8320
|
-
textValue:
|
8321
|
-
booleanValue:
|
8322
|
-
numberValue:
|
8323
|
-
dateValue:
|
8301
|
+
import z108 from "zod";
|
8302
|
+
var ContactPhonesSchema2 = z108.object({
|
8303
|
+
id: z108.string().uuid(),
|
8304
|
+
createdAt: z108.date(),
|
8305
|
+
updatedAt: z108.date(),
|
8306
|
+
deletedAt: z108.date().nullable(),
|
8307
|
+
phone: z108.string(),
|
8308
|
+
isPrimary: z108.boolean()
|
8309
|
+
});
|
8310
|
+
var ContactEmailsSchema2 = z108.object({
|
8311
|
+
id: z108.string().uuid(),
|
8312
|
+
createdAt: z108.date(),
|
8313
|
+
updatedAt: z108.date(),
|
8314
|
+
deletedAt: z108.date().nullable(),
|
8315
|
+
email: z108.string(),
|
8316
|
+
isPrimary: z108.boolean()
|
8317
|
+
});
|
8318
|
+
var ContactCustomFieldSchema2 = z108.object({
|
8319
|
+
id: z108.string().uuid(),
|
8320
|
+
createdAt: z108.date(),
|
8321
|
+
updatedAt: z108.date(),
|
8322
|
+
deletedAt: z108.date().nullable(),
|
8323
|
+
textValue: z108.string().nullable(),
|
8324
|
+
booleanValue: z108.boolean().nullable(),
|
8325
|
+
numberValue: z108.number().nullable(),
|
8326
|
+
dateValue: z108.date().nullable(),
|
8324
8327
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
8325
|
-
uploads:
|
8326
|
-
});
|
8327
|
-
var ContactEntityTypesSchema2 =
|
8328
|
-
id:
|
8329
|
-
createdAt:
|
8330
|
-
updatedAt:
|
8331
|
-
deletedAt:
|
8332
|
-
entity:
|
8333
|
-
description:
|
8334
|
-
});
|
8335
|
-
var ContactActivitySchema2 =
|
8336
|
-
id:
|
8337
|
-
createdAt:
|
8338
|
-
updatedAt:
|
8339
|
-
deletedAt:
|
8340
|
-
entityId:
|
8341
|
-
description:
|
8328
|
+
uploads: z108.array(UploadSchema)
|
8329
|
+
});
|
8330
|
+
var ContactEntityTypesSchema2 = z108.object({
|
8331
|
+
id: z108.string().uuid(),
|
8332
|
+
createdAt: z108.date(),
|
8333
|
+
updatedAt: z108.date(),
|
8334
|
+
deletedAt: z108.date().nullable(),
|
8335
|
+
entity: z108.string(),
|
8336
|
+
description: z108.string().nullable()
|
8337
|
+
});
|
8338
|
+
var ContactActivitySchema2 = z108.object({
|
8339
|
+
id: z108.string().uuid(),
|
8340
|
+
createdAt: z108.date(),
|
8341
|
+
updatedAt: z108.date(),
|
8342
|
+
deletedAt: z108.date().nullable(),
|
8343
|
+
entityId: z108.string(),
|
8344
|
+
description: z108.string(),
|
8342
8345
|
entityType: ContactEntityTypesSchema2
|
8343
8346
|
});
|
8344
|
-
var ContactSchema2 =
|
8345
|
-
id:
|
8346
|
-
createdAt:
|
8347
|
-
updatedAt:
|
8348
|
-
deletedAt:
|
8349
|
-
name:
|
8350
|
-
address:
|
8351
|
-
channel:
|
8352
|
-
notes:
|
8353
|
-
contactProfile:
|
8354
|
-
socialProfileUrl:
|
8355
|
-
tags:
|
8347
|
+
var ContactSchema2 = z108.object({
|
8348
|
+
id: z108.string().uuid(),
|
8349
|
+
createdAt: z108.date(),
|
8350
|
+
updatedAt: z108.date(),
|
8351
|
+
deletedAt: z108.date().nullable(),
|
8352
|
+
name: z108.string(),
|
8353
|
+
address: z108.string().nullable(),
|
8354
|
+
channel: z108.string().nullable(),
|
8355
|
+
notes: z108.string().nullable(),
|
8356
|
+
contactProfile: z108.string().nullable(),
|
8357
|
+
socialProfileUrl: z108.string().nullable(),
|
8358
|
+
tags: z108.array(TagSchema),
|
8356
8359
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
8357
|
-
customFields:
|
8358
|
-
contactEmails:
|
8359
|
-
contactPhones:
|
8360
|
-
activityLogs:
|
8360
|
+
customFields: z108.array(ContactCustomFieldSchema2),
|
8361
|
+
contactEmails: z108.array(ContactEmailsSchema2),
|
8362
|
+
contactPhones: z108.array(ContactPhonesSchema2),
|
8363
|
+
activityLogs: z108.array(ContactActivitySchema2).optional()
|
8361
8364
|
});
|
8362
8365
|
|
8363
8366
|
// src/public-api/validation.ts
|
8364
8367
|
var ContactContractValidationSchema2 = {
|
8365
8368
|
create: {
|
8366
|
-
request:
|
8367
|
-
name:
|
8368
|
-
email:
|
8369
|
-
|
8370
|
-
email:
|
8371
|
-
isPrimary:
|
8369
|
+
request: z109.object({
|
8370
|
+
name: z109.string(),
|
8371
|
+
email: z109.array(
|
8372
|
+
z109.object({
|
8373
|
+
email: z109.string().email(),
|
8374
|
+
isPrimary: z109.boolean()
|
8372
8375
|
})
|
8373
8376
|
).optional(),
|
8374
|
-
channel:
|
8375
|
-
address:
|
8376
|
-
phone:
|
8377
|
-
|
8378
|
-
phone:
|
8379
|
-
isPrimary:
|
8377
|
+
channel: z109.string().optional(),
|
8378
|
+
address: z109.string().optional(),
|
8379
|
+
phone: z109.array(
|
8380
|
+
z109.object({
|
8381
|
+
phone: z109.string(),
|
8382
|
+
isPrimary: z109.boolean()
|
8380
8383
|
})
|
8381
8384
|
).optional(),
|
8382
|
-
notes:
|
8383
|
-
tags:
|
8384
|
-
company:
|
8385
|
-
customFields:
|
8385
|
+
notes: z109.string().optional(),
|
8386
|
+
tags: z109.array(z109.string()).optional(),
|
8387
|
+
company: z109.string().optional(),
|
8388
|
+
customFields: z109.record(z109.string())
|
8386
8389
|
// Dynamic keys with string values
|
8387
8390
|
}),
|
8388
8391
|
response: ContactSchema2
|
8389
8392
|
},
|
8390
8393
|
getById: {
|
8391
|
-
request:
|
8392
|
-
id:
|
8394
|
+
request: z109.object({
|
8395
|
+
id: z109.string().uuid()
|
8393
8396
|
})
|
8394
8397
|
},
|
8395
8398
|
delete: {
|
8396
|
-
request:
|
8397
|
-
id:
|
8399
|
+
request: z109.object({
|
8400
|
+
id: z109.string().uuid()
|
8398
8401
|
})
|
8399
8402
|
},
|
8400
8403
|
getAll: {
|
8401
|
-
request:
|
8402
|
-
page:
|
8403
|
-
pageSize:
|
8404
|
-
keyword:
|
8405
|
-
company:
|
8406
|
-
name:
|
8407
|
-
address:
|
8408
|
-
channel:
|
8409
|
-
selectedDate:
|
8410
|
-
customFields:
|
8411
|
-
|
8412
|
-
attributeId:
|
8413
|
-
type:
|
8414
|
-
value:
|
8404
|
+
request: z109.object({
|
8405
|
+
page: z109.coerce.number().default(1),
|
8406
|
+
pageSize: z109.coerce.number().default(10),
|
8407
|
+
keyword: z109.string().optional(),
|
8408
|
+
company: z109.array(z109.string().uuid()),
|
8409
|
+
name: z109.string(),
|
8410
|
+
address: z109.string(),
|
8411
|
+
channel: z109.array(z109.string()),
|
8412
|
+
selectedDate: z109.string(),
|
8413
|
+
customFields: z109.array(
|
8414
|
+
z109.object({
|
8415
|
+
attributeId: z109.string().uuid(),
|
8416
|
+
type: z109.string(),
|
8417
|
+
value: z109.union([z109.string(), z109.array(z109.string())])
|
8415
8418
|
})
|
8416
8419
|
),
|
8417
|
-
tags:
|
8418
|
-
phone:
|
8419
|
-
email:
|
8420
|
-
notes:
|
8420
|
+
tags: z109.array(z109.string().uuid()),
|
8421
|
+
phone: z109.string(),
|
8422
|
+
email: z109.string(),
|
8423
|
+
notes: z109.string()
|
8421
8424
|
}).partial(),
|
8422
8425
|
response: {
|
8423
|
-
page:
|
8424
|
-
pageSize:
|
8425
|
-
total:
|
8426
|
-
lastPage:
|
8427
|
-
data:
|
8426
|
+
page: z109.number(),
|
8427
|
+
pageSize: z109.number(),
|
8428
|
+
total: z109.number(),
|
8429
|
+
lastPage: z109.number(),
|
8430
|
+
data: z109.array(ContactSchema2)
|
8428
8431
|
}
|
8429
8432
|
},
|
8430
8433
|
getContactFields: {
|
8431
|
-
request:
|
8432
|
-
page:
|
8433
|
-
pageSize:
|
8434
|
+
request: z109.object({
|
8435
|
+
page: z109.coerce.number().default(1),
|
8436
|
+
pageSize: z109.coerce.number().default(10)
|
8434
8437
|
}).partial(),
|
8435
8438
|
response: {
|
8436
|
-
page:
|
8437
|
-
pageSize:
|
8438
|
-
total:
|
8439
|
-
lastPage:
|
8440
|
-
data:
|
8439
|
+
page: z109.number(),
|
8440
|
+
pageSize: z109.number(),
|
8441
|
+
total: z109.number(),
|
8442
|
+
lastPage: z109.number(),
|
8443
|
+
data: z109.array(ContactCustomFieldSchema2)
|
8441
8444
|
}
|
8442
8445
|
},
|
8443
8446
|
addAttachments: {
|
8444
|
-
request:
|
8445
|
-
contactId:
|
8446
|
-
attributeId:
|
8447
|
-
contactAttachmentRecords:
|
8448
|
-
|
8449
|
-
bucketName:
|
8450
|
-
fileKey:
|
8451
|
-
fileName:
|
8452
|
-
fileSize:
|
8453
|
-
url:
|
8447
|
+
request: z109.object({
|
8448
|
+
contactId: z109.string(),
|
8449
|
+
attributeId: z109.string().uuid(),
|
8450
|
+
contactAttachmentRecords: z109.array(
|
8451
|
+
z109.object({
|
8452
|
+
bucketName: z109.string(),
|
8453
|
+
fileKey: z109.string(),
|
8454
|
+
fileName: z109.string(),
|
8455
|
+
fileSize: z109.coerce.number(),
|
8456
|
+
url: z109.string()
|
8454
8457
|
})
|
8455
8458
|
)
|
8456
8459
|
}),
|
@@ -8469,11 +8472,11 @@ var publicApiContract = initContract38().router(
|
|
8469
8472
|
201: DefaultSuccessResponseSchema.extend({
|
8470
8473
|
data: ContactSchema2
|
8471
8474
|
}),
|
8472
|
-
400:
|
8473
|
-
message:
|
8475
|
+
400: z110.object({
|
8476
|
+
message: z110.string()
|
8474
8477
|
}),
|
8475
|
-
409:
|
8476
|
-
message:
|
8478
|
+
409: z110.object({
|
8479
|
+
message: z110.string()
|
8477
8480
|
}),
|
8478
8481
|
401: DefaultUnauthorizedSchema,
|
8479
8482
|
404: DefaultNotFoundSchema,
|
@@ -8488,13 +8491,13 @@ var publicApiContract = initContract38().router(
|
|
8488
8491
|
query: GetTagsSchema,
|
8489
8492
|
responses: {
|
8490
8493
|
200: DefaultSuccessResponseSchema.extend({
|
8491
|
-
tags:
|
8494
|
+
tags: z110.array(TagSchema)
|
8492
8495
|
}),
|
8493
|
-
400:
|
8494
|
-
message:
|
8496
|
+
400: z110.object({
|
8497
|
+
message: z110.string()
|
8495
8498
|
}),
|
8496
|
-
409:
|
8497
|
-
message:
|
8499
|
+
409: z110.object({
|
8500
|
+
message: z110.string()
|
8498
8501
|
}),
|
8499
8502
|
401: DefaultUnauthorizedSchema,
|
8500
8503
|
404: DefaultNotFoundSchema,
|
@@ -8510,11 +8513,11 @@ var publicApiContract = initContract38().router(
|
|
8510
8513
|
200: DefaultSuccessResponseSchema.extend(
|
8511
8514
|
ContactContractValidationSchema2.getAll.response
|
8512
8515
|
),
|
8513
|
-
400:
|
8514
|
-
message:
|
8516
|
+
400: z110.object({
|
8517
|
+
message: z110.string()
|
8515
8518
|
}),
|
8516
|
-
409:
|
8517
|
-
message:
|
8519
|
+
409: z110.object({
|
8520
|
+
message: z110.string()
|
8518
8521
|
}),
|
8519
8522
|
401: DefaultUnauthorizedSchema,
|
8520
8523
|
404: DefaultNotFoundSchema,
|
@@ -8531,11 +8534,11 @@ var publicApiContract = initContract38().router(
|
|
8531
8534
|
200: DefaultSuccessResponseSchema.extend(
|
8532
8535
|
ContactContractValidationSchema2.getContactFields.response
|
8533
8536
|
),
|
8534
|
-
400:
|
8535
|
-
message:
|
8537
|
+
400: z110.object({
|
8538
|
+
message: z110.string()
|
8536
8539
|
}),
|
8537
|
-
409:
|
8538
|
-
message:
|
8540
|
+
409: z110.object({
|
8541
|
+
message: z110.string()
|
8539
8542
|
}),
|
8540
8543
|
401: DefaultUnauthorizedSchema,
|
8541
8544
|
404: DefaultNotFoundSchema,
|
@@ -8549,17 +8552,17 @@ var publicApiContract = initContract38().router(
|
|
8549
8552
|
path: "/contacts/:id",
|
8550
8553
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8551
8554
|
responses: {
|
8552
|
-
200:
|
8553
|
-
status:
|
8554
|
-
message:
|
8555
|
+
200: z110.object({
|
8556
|
+
status: z110.string(),
|
8557
|
+
message: z110.string(),
|
8555
8558
|
data: ContactSchema2,
|
8556
|
-
requestId:
|
8559
|
+
requestId: z110.string()
|
8557
8560
|
}),
|
8558
|
-
400:
|
8559
|
-
message:
|
8561
|
+
400: z110.object({
|
8562
|
+
message: z110.string()
|
8560
8563
|
}),
|
8561
|
-
409:
|
8562
|
-
message:
|
8564
|
+
409: z110.object({
|
8565
|
+
message: z110.string()
|
8563
8566
|
}),
|
8564
8567
|
401: DefaultUnauthorizedSchema,
|
8565
8568
|
404: DefaultNotFoundSchema,
|
@@ -8577,11 +8580,11 @@ var publicApiContract = initContract38().router(
|
|
8577
8580
|
201: DefaultSuccessResponseSchema.extend({
|
8578
8581
|
message: ContactCustomFieldSchema2
|
8579
8582
|
}),
|
8580
|
-
400:
|
8581
|
-
message:
|
8583
|
+
400: z110.object({
|
8584
|
+
message: z110.string()
|
8582
8585
|
}),
|
8583
|
-
409:
|
8584
|
-
message:
|
8586
|
+
409: z110.object({
|
8587
|
+
message: z110.string()
|
8585
8588
|
}),
|
8586
8589
|
401: DefaultUnauthorizedSchema,
|
8587
8590
|
404: DefaultNotFoundSchema,
|
@@ -8595,17 +8598,17 @@ var publicApiContract = initContract38().router(
|
|
8595
8598
|
path: "/contacts/:id",
|
8596
8599
|
pathParams: ContactContractValidationSchema2.getById.request,
|
8597
8600
|
responses: {
|
8598
|
-
200:
|
8599
|
-
status:
|
8600
|
-
message:
|
8601
|
+
200: z110.object({
|
8602
|
+
status: z110.string(),
|
8603
|
+
message: z110.string(),
|
8601
8604
|
data: ContactSchema2,
|
8602
|
-
requestId:
|
8605
|
+
requestId: z110.string()
|
8603
8606
|
}),
|
8604
|
-
400:
|
8605
|
-
message:
|
8607
|
+
400: z110.object({
|
8608
|
+
message: z110.string()
|
8606
8609
|
}),
|
8607
|
-
409:
|
8608
|
-
message:
|
8610
|
+
409: z110.object({
|
8611
|
+
message: z110.string()
|
8609
8612
|
}),
|
8610
8613
|
401: DefaultUnauthorizedSchema,
|
8611
8614
|
404: DefaultNotFoundSchema,
|
@@ -8619,17 +8622,17 @@ var publicApiContract = initContract38().router(
|
|
8619
8622
|
path: "/contacts/:id",
|
8620
8623
|
pathParams: ContactContractValidationSchema2.delete.request,
|
8621
8624
|
responses: {
|
8622
|
-
200:
|
8623
|
-
status:
|
8624
|
-
message:
|
8625
|
+
200: z110.object({
|
8626
|
+
status: z110.string(),
|
8627
|
+
message: z110.string(),
|
8625
8628
|
data: ContactSchema2,
|
8626
|
-
requestId:
|
8629
|
+
requestId: z110.string()
|
8627
8630
|
}),
|
8628
|
-
400:
|
8629
|
-
message:
|
8631
|
+
400: z110.object({
|
8632
|
+
message: z110.string()
|
8630
8633
|
}),
|
8631
|
-
409:
|
8632
|
-
message:
|
8634
|
+
409: z110.object({
|
8635
|
+
message: z110.string()
|
8633
8636
|
}),
|
8634
8637
|
401: DefaultUnauthorizedSchema,
|
8635
8638
|
404: DefaultNotFoundSchema,
|
@@ -8647,17 +8650,17 @@ var publicApiContract = initContract38().router(
|
|
8647
8650
|
|
8648
8651
|
// src/workflow-rule/index.ts
|
8649
8652
|
import { initContract as initContract39 } from "@ts-rest/core";
|
8650
|
-
import
|
8653
|
+
import z111 from "zod";
|
8651
8654
|
var chatContract = initContract39().router(
|
8652
8655
|
{
|
8653
8656
|
updateAssignee: {
|
8654
8657
|
method: "POST",
|
8655
8658
|
path: "/room/assignee",
|
8656
|
-
body:
|
8657
|
-
assigneeId:
|
8658
|
-
roomId:
|
8659
|
-
workflowId:
|
8660
|
-
queueId:
|
8659
|
+
body: z111.object({
|
8660
|
+
assigneeId: z111.string().uuid().optional(),
|
8661
|
+
roomId: z111.string().uuid(),
|
8662
|
+
workflowId: z111.string().uuid(),
|
8663
|
+
queueId: z111.string().uuid().optional()
|
8661
8664
|
}),
|
8662
8665
|
responses: {
|
8663
8666
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -8671,9 +8674,9 @@ var chatContract = initContract39().router(
|
|
8671
8674
|
autoReply: {
|
8672
8675
|
method: "POST",
|
8673
8676
|
path: "/message/send",
|
8674
|
-
body:
|
8675
|
-
roomId:
|
8676
|
-
message:
|
8677
|
+
body: z111.object({
|
8678
|
+
roomId: z111.string().uuid(),
|
8679
|
+
message: z111.string(),
|
8677
8680
|
messageType: WorkflowAutoReplyMessageTypeSchema
|
8678
8681
|
// workflowId: z.string().uuid(),
|
8679
8682
|
}),
|
@@ -8689,15 +8692,15 @@ var chatContract = initContract39().router(
|
|
8689
8692
|
solveRoom: {
|
8690
8693
|
method: "POST",
|
8691
8694
|
path: "/room/solve",
|
8692
|
-
body:
|
8693
|
-
roomId:
|
8694
|
-
disposition:
|
8695
|
-
workflowId:
|
8695
|
+
body: z111.object({
|
8696
|
+
roomId: z111.string(),
|
8697
|
+
disposition: z111.string(),
|
8698
|
+
workflowId: z111.string().uuid()
|
8696
8699
|
}),
|
8697
8700
|
responses: {
|
8698
8701
|
200: DefaultSuccessResponseSchema.extend({
|
8699
8702
|
data: RoomSchema.extend({
|
8700
|
-
solveMessage:
|
8703
|
+
solveMessage: z111.string()
|
8701
8704
|
})
|
8702
8705
|
}),
|
8703
8706
|
409: DefaultErrorResponseSchema
|
@@ -8707,9 +8710,9 @@ var chatContract = initContract39().router(
|
|
8707
8710
|
emitMessage: {
|
8708
8711
|
method: "POST",
|
8709
8712
|
path: "/message/emit",
|
8710
|
-
body:
|
8711
|
-
messageId:
|
8712
|
-
queueId:
|
8713
|
+
body: z111.object({
|
8714
|
+
messageId: z111.string().uuid(),
|
8715
|
+
queueId: z111.string().uuid().optional().nullable()
|
8713
8716
|
}),
|
8714
8717
|
responses: {
|
8715
8718
|
200: DefaultSuccessResponseSchema,
|
@@ -8720,16 +8723,16 @@ var chatContract = initContract39().router(
|
|
8720
8723
|
}
|
8721
8724
|
},
|
8722
8725
|
{
|
8723
|
-
baseHeaders:
|
8724
|
-
"x-tenant":
|
8725
|
-
"x-code":
|
8726
|
+
baseHeaders: z111.object({
|
8727
|
+
"x-tenant": z111.string({ required_error: "Tenant id is required" }),
|
8728
|
+
"x-code": z111.string().uuid().optional()
|
8726
8729
|
}),
|
8727
8730
|
pathPrefix: "chat"
|
8728
8731
|
}
|
8729
8732
|
);
|
8730
8733
|
|
8731
8734
|
// src/botpress/index.ts
|
8732
|
-
import
|
8735
|
+
import z112 from "zod";
|
8733
8736
|
import { initContract as initContract40 } from "@ts-rest/core";
|
8734
8737
|
var botpressContract = initContract40().router(
|
8735
8738
|
{
|
@@ -8748,7 +8751,7 @@ var botpressContract = initContract40().router(
|
|
8748
8751
|
path: "/",
|
8749
8752
|
responses: {
|
8750
8753
|
200: DefaultSuccessResponseSchema.extend({
|
8751
|
-
data:
|
8754
|
+
data: z112.array(BotpressBotSchema)
|
8752
8755
|
}),
|
8753
8756
|
500: DefaultErrorResponseSchema
|
8754
8757
|
}
|
@@ -8785,7 +8788,7 @@ var botContract = initContract40().router(
|
|
8785
8788
|
path: "/",
|
8786
8789
|
responses: {
|
8787
8790
|
200: DefaultSuccessResponseSchema.extend({
|
8788
|
-
data:
|
8791
|
+
data: z112.array(BotpressBotSchema)
|
8789
8792
|
}),
|
8790
8793
|
500: DefaultErrorResponseSchema
|
8791
8794
|
}
|
@@ -8798,17 +8801,17 @@ var botContract = initContract40().router(
|
|
8798
8801
|
|
8799
8802
|
// src/presence-status/index.ts
|
8800
8803
|
import { initContract as initContract41 } from "@ts-rest/core";
|
8801
|
-
import
|
8804
|
+
import z114 from "zod";
|
8802
8805
|
|
8803
8806
|
// src/presence-status/validation.ts
|
8804
|
-
import { z as
|
8805
|
-
var CreatePresenceStatusSchema =
|
8806
|
-
systemName:
|
8807
|
-
displayName:
|
8808
|
-
description:
|
8809
|
-
position:
|
8810
|
-
emoji:
|
8811
|
-
presenceStatusOption:
|
8807
|
+
import { z as z113 } from "zod";
|
8808
|
+
var CreatePresenceStatusSchema = z113.object({
|
8809
|
+
systemName: z113.string(),
|
8810
|
+
displayName: z113.string(),
|
8811
|
+
description: z113.string().optional(),
|
8812
|
+
position: z113.number(),
|
8813
|
+
emoji: z113.string(),
|
8814
|
+
presenceStatusOption: z113.array(TPresenceStatusOption)
|
8812
8815
|
});
|
8813
8816
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
8814
8817
|
|
@@ -8819,16 +8822,16 @@ var presenceStatusContract = initContract41().router(
|
|
8819
8822
|
method: "GET",
|
8820
8823
|
path: "",
|
8821
8824
|
headers: DefaultHeaderSchema,
|
8822
|
-
query:
|
8823
|
-
keyword:
|
8825
|
+
query: z114.object({
|
8826
|
+
keyword: z114.string().optional()
|
8824
8827
|
}).optional(),
|
8825
8828
|
responses: {
|
8826
|
-
200:
|
8827
|
-
total:
|
8828
|
-
data:
|
8829
|
+
200: z114.object({
|
8830
|
+
total: z114.number(),
|
8831
|
+
data: z114.array(PresenceStatusSchema)
|
8829
8832
|
}),
|
8830
|
-
400:
|
8831
|
-
message:
|
8833
|
+
400: z114.object({
|
8834
|
+
message: z114.string()
|
8832
8835
|
}),
|
8833
8836
|
401: DefaultUnauthorizedSchema,
|
8834
8837
|
500: DefaultErrorResponseSchema
|
@@ -8840,9 +8843,9 @@ var presenceStatusContract = initContract41().router(
|
|
8840
8843
|
path: "/ps/user-presence-status",
|
8841
8844
|
headers: DefaultHeaderSchema,
|
8842
8845
|
responses: {
|
8843
|
-
200:
|
8844
|
-
400:
|
8845
|
-
message:
|
8846
|
+
200: z114.array(UserPresenceStatusSchema),
|
8847
|
+
400: z114.object({
|
8848
|
+
message: z114.string()
|
8846
8849
|
}),
|
8847
8850
|
401: DefaultUnauthorizedSchema,
|
8848
8851
|
500: DefaultErrorResponseSchema
|
@@ -8858,8 +8861,8 @@ var presenceStatusContract = initContract41().router(
|
|
8858
8861
|
201: DefaultSuccessResponseSchema.extend({
|
8859
8862
|
presenceStatus: PresenceStatusSchema
|
8860
8863
|
}),
|
8861
|
-
400:
|
8862
|
-
message:
|
8864
|
+
400: z114.object({
|
8865
|
+
message: z114.string()
|
8863
8866
|
}),
|
8864
8867
|
401: DefaultUnauthorizedSchema,
|
8865
8868
|
404: DefaultNotFoundSchema,
|
@@ -8871,12 +8874,12 @@ var presenceStatusContract = initContract41().router(
|
|
8871
8874
|
getPresenceStatusById: {
|
8872
8875
|
method: "GET",
|
8873
8876
|
path: "/:id",
|
8874
|
-
pathParams:
|
8877
|
+
pathParams: z114.object({ id: z114.string() }),
|
8875
8878
|
headers: DefaultHeaderSchema,
|
8876
8879
|
responses: {
|
8877
8880
|
200: PresenceStatusSchema,
|
8878
|
-
400:
|
8879
|
-
message:
|
8881
|
+
400: z114.object({
|
8882
|
+
message: z114.string()
|
8880
8883
|
}),
|
8881
8884
|
401: DefaultUnauthorizedSchema,
|
8882
8885
|
404: DefaultNotFoundSchema,
|
@@ -8888,15 +8891,15 @@ var presenceStatusContract = initContract41().router(
|
|
8888
8891
|
updatePresenceStatus: {
|
8889
8892
|
method: "PATCH",
|
8890
8893
|
path: "/:id",
|
8891
|
-
pathParams:
|
8894
|
+
pathParams: z114.object({ id: z114.string() }),
|
8892
8895
|
headers: DefaultHeaderSchema,
|
8893
8896
|
body: UpdatePresenceStatusSchema,
|
8894
8897
|
responses: {
|
8895
8898
|
201: DefaultSuccessResponseSchema.extend({
|
8896
8899
|
presenceStatus: PresenceStatusSchema
|
8897
8900
|
}),
|
8898
|
-
400:
|
8899
|
-
message:
|
8901
|
+
400: z114.object({
|
8902
|
+
message: z114.string()
|
8900
8903
|
}),
|
8901
8904
|
401: DefaultUnauthorizedSchema,
|
8902
8905
|
404: DefaultNotFoundSchema,
|
@@ -8908,11 +8911,11 @@ var presenceStatusContract = initContract41().router(
|
|
8908
8911
|
deletePresenceStatus: {
|
8909
8912
|
method: "DELETE",
|
8910
8913
|
path: "/:id",
|
8911
|
-
pathParams:
|
8914
|
+
pathParams: z114.object({ id: z114.string() }),
|
8912
8915
|
headers: DefaultHeaderSchema,
|
8913
8916
|
body: null,
|
8914
8917
|
responses: {
|
8915
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
8918
|
+
200: DefaultSuccessResponseSchema.extend({ message: z114.string() }),
|
8916
8919
|
404: DefaultNotFoundSchema,
|
8917
8920
|
422: DefaultUnprocessibleSchema,
|
8918
8921
|
500: DefaultErrorResponseSchema
|
@@ -8925,7 +8928,7 @@ var presenceStatusContract = initContract41().router(
|
|
8925
8928
|
|
8926
8929
|
// src/whatsapp/index.ts
|
8927
8930
|
import { initContract as initContract42 } from "@ts-rest/core";
|
8928
|
-
import
|
8931
|
+
import z115 from "zod";
|
8929
8932
|
var whatsappContract = initContract42().router({
|
8930
8933
|
sendMessage: {
|
8931
8934
|
method: "POST",
|
@@ -8960,11 +8963,11 @@ var whatsappContract = initContract42().router({
|
|
8960
8963
|
reconnect: {
|
8961
8964
|
method: "POST",
|
8962
8965
|
path: "/reconnect/:channelId",
|
8963
|
-
pathParams:
|
8964
|
-
channelId:
|
8966
|
+
pathParams: z115.object({
|
8967
|
+
channelId: z115.string().uuid()
|
8965
8968
|
}),
|
8966
|
-
body:
|
8967
|
-
instanceId:
|
8969
|
+
body: z115.object({
|
8970
|
+
instanceId: z115.string().nullable().optional()
|
8968
8971
|
}),
|
8969
8972
|
responses: {
|
8970
8973
|
200: ChannelServiceResponseSchema,
|
@@ -8975,8 +8978,8 @@ var whatsappContract = initContract42().router({
|
|
8975
8978
|
delete: {
|
8976
8979
|
method: "DELETE",
|
8977
8980
|
path: "/delete/:channelId",
|
8978
|
-
pathParams:
|
8979
|
-
channelId:
|
8981
|
+
pathParams: z115.object({
|
8982
|
+
channelId: z115.string().uuid()
|
8980
8983
|
}),
|
8981
8984
|
body: null,
|
8982
8985
|
responses: {
|
@@ -9018,10 +9021,10 @@ var whatsappContract = initContract42().router({
|
|
9018
9021
|
deleteWaapi: {
|
9019
9022
|
method: "DELETE",
|
9020
9023
|
path: "/mobile/:instanceId",
|
9021
|
-
pathParams:
|
9022
|
-
instanceId:
|
9024
|
+
pathParams: z115.object({
|
9025
|
+
instanceId: z115.string()
|
9023
9026
|
}),
|
9024
|
-
body:
|
9027
|
+
body: z115.any().optional(),
|
9025
9028
|
responses: {
|
9026
9029
|
200: DefaultSuccessResponseSchema,
|
9027
9030
|
500: DefaultErrorResponseSchema,
|
@@ -9042,21 +9045,21 @@ var whatsappContract = initContract42().router({
|
|
9042
9045
|
|
9043
9046
|
// src/invoice/index.ts
|
9044
9047
|
import { initContract as initContract43 } from "@ts-rest/core";
|
9045
|
-
import { z as
|
9048
|
+
import { z as z117 } from "zod";
|
9046
9049
|
|
9047
9050
|
// src/invoice/schema.ts
|
9048
|
-
import
|
9051
|
+
import z116 from "zod";
|
9049
9052
|
var InvoiceSchema = DefaultEntitySchema.extend({
|
9050
|
-
invoiceId:
|
9051
|
-
amountPaid:
|
9052
|
-
billingReason:
|
9053
|
-
collectionMethod:
|
9054
|
-
created:
|
9055
|
-
currency:
|
9056
|
-
hostedInvoiceUrl:
|
9057
|
-
invoicePdf:
|
9058
|
-
number:
|
9059
|
-
paid:
|
9053
|
+
invoiceId: z116.string(),
|
9054
|
+
amountPaid: z116.number(),
|
9055
|
+
billingReason: z116.string(),
|
9056
|
+
collectionMethod: z116.string(),
|
9057
|
+
created: z116.number(),
|
9058
|
+
currency: z116.string(),
|
9059
|
+
hostedInvoiceUrl: z116.string(),
|
9060
|
+
invoicePdf: z116.string(),
|
9061
|
+
number: z116.string(),
|
9062
|
+
paid: z116.boolean()
|
9060
9063
|
});
|
9061
9064
|
|
9062
9065
|
// src/invoice/index.ts
|
@@ -9068,7 +9071,7 @@ var invoiceContract = initContract43().router(
|
|
9068
9071
|
query: null,
|
9069
9072
|
responses: {
|
9070
9073
|
200: DefaultSuccessResponseSchema.extend({
|
9071
|
-
invoices:
|
9074
|
+
invoices: z117.array(InvoiceSchema)
|
9072
9075
|
}),
|
9073
9076
|
500: DefaultErrorResponseSchema
|
9074
9077
|
}
|
@@ -9278,7 +9281,7 @@ var presenceStatusContract2 = initContract44().router({
|
|
9278
9281
|
|
9279
9282
|
// src/general-setting/index.ts
|
9280
9283
|
import { initContract as initContract45 } from "@ts-rest/core";
|
9281
|
-
import
|
9284
|
+
import z118 from "zod";
|
9282
9285
|
var generalSettingContract = initContract45().router(
|
9283
9286
|
{
|
9284
9287
|
autoOpenedContactWidgetId: {
|
@@ -9286,20 +9289,20 @@ var generalSettingContract = initContract45().router(
|
|
9286
9289
|
method: "GET",
|
9287
9290
|
path: "/auto-opened-contact-widget-id",
|
9288
9291
|
responses: {
|
9289
|
-
200:
|
9290
|
-
autoOpenedContactWidgetId:
|
9292
|
+
200: z118.object({
|
9293
|
+
autoOpenedContactWidgetId: z118.string().nullable()
|
9291
9294
|
})
|
9292
9295
|
}
|
9293
9296
|
},
|
9294
9297
|
updateAutoOpenedContactWidgetId: {
|
9295
9298
|
method: "PATCH",
|
9296
9299
|
path: "/auto-opened-contact-widget-id",
|
9297
|
-
body:
|
9298
|
-
autoOpenedContactWidgetId:
|
9300
|
+
body: z118.object({
|
9301
|
+
autoOpenedContactWidgetId: z118.string().nullable()
|
9299
9302
|
}),
|
9300
9303
|
responses: {
|
9301
|
-
200:
|
9302
|
-
autoOpenedContactWidgetId:
|
9304
|
+
200: z118.object({
|
9305
|
+
autoOpenedContactWidgetId: z118.string().nullable()
|
9303
9306
|
})
|
9304
9307
|
}
|
9305
9308
|
}
|
@@ -9312,49 +9315,49 @@ var generalSettingContract = initContract45().router(
|
|
9312
9315
|
|
9313
9316
|
// src/automation-queue/index.ts
|
9314
9317
|
import { initContract as initContract46 } from "@ts-rest/core";
|
9315
|
-
import { z as
|
9318
|
+
import { z as z121 } from "zod";
|
9316
9319
|
|
9317
9320
|
// src/automation-queue/validation.ts
|
9318
|
-
import { z as
|
9319
|
-
var QueueDistributionStrategySchema =
|
9320
|
-
|
9321
|
-
|
9322
|
-
|
9323
|
-
|
9321
|
+
import { z as z119 } from "zod";
|
9322
|
+
var QueueDistributionStrategySchema = z119.union([
|
9323
|
+
z119.literal("round-robin"),
|
9324
|
+
z119.literal("fewest-assignments"),
|
9325
|
+
z119.literal("random"),
|
9326
|
+
z119.literal("notify-all")
|
9324
9327
|
]);
|
9325
|
-
var CreateAutomationQueueSchema =
|
9326
|
-
emoji:
|
9327
|
-
name:
|
9328
|
-
description:
|
9329
|
-
managerIds:
|
9330
|
-
agentIds:
|
9328
|
+
var CreateAutomationQueueSchema = z119.object({
|
9329
|
+
emoji: z119.string().emoji(),
|
9330
|
+
name: z119.string(),
|
9331
|
+
description: z119.string().nullable(),
|
9332
|
+
managerIds: z119.array(z119.string().uuid()).min(1),
|
9333
|
+
agentIds: z119.array(z119.string().uuid()).min(1),
|
9331
9334
|
distributionStrategy: QueueDistributionStrategySchema,
|
9332
|
-
maximumAssignPerAgent:
|
9335
|
+
maximumAssignPerAgent: z119.number().positive()
|
9333
9336
|
// ringTimeOut: z.number().positive(),
|
9334
9337
|
// retryInterval: z.number().positive(),
|
9335
9338
|
// queueTimeOut: z.number().positive(),
|
9336
9339
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9337
9340
|
});
|
9338
9341
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9339
|
-
var CheckHasAssignedRoomSchema =
|
9340
|
-
userId:
|
9341
|
-
queueId:
|
9342
|
+
var CheckHasAssignedRoomSchema = z119.object({
|
9343
|
+
userId: z119.string().uuid().optional(),
|
9344
|
+
queueId: z119.string().uuid().optional()
|
9342
9345
|
});
|
9343
9346
|
|
9344
9347
|
// src/automation-queue/schema.ts
|
9345
|
-
import { z as
|
9348
|
+
import { z as z120 } from "zod";
|
9346
9349
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9347
|
-
emoji:
|
9348
|
-
name:
|
9349
|
-
description:
|
9350
|
+
emoji: z120.string(),
|
9351
|
+
name: z120.string(),
|
9352
|
+
description: z120.string().nullable(),
|
9350
9353
|
distributionStrategy: QueueDistributionStrategySchema,
|
9351
|
-
maximumAssignPerAgent:
|
9354
|
+
maximumAssignPerAgent: z120.number().positive(),
|
9352
9355
|
// ringTimeOut: z.number(),
|
9353
9356
|
// retryInterval: z.number(),
|
9354
9357
|
// queueTimeOut: z.number(),
|
9355
9358
|
// isAssignmentDeniable: z.boolean(),
|
9356
|
-
managers:
|
9357
|
-
agents:
|
9359
|
+
managers: z120.array(UserSchema),
|
9360
|
+
agents: z120.array(UserSchema)
|
9358
9361
|
});
|
9359
9362
|
|
9360
9363
|
// src/automation-queue/index.ts
|
@@ -9373,8 +9376,8 @@ var automationQueueContract = initContract46().router(
|
|
9373
9376
|
duplicateAutomationQueue: {
|
9374
9377
|
method: "POST",
|
9375
9378
|
path: "/:id/duplicate",
|
9376
|
-
pathParams:
|
9377
|
-
id:
|
9379
|
+
pathParams: z121.object({
|
9380
|
+
id: z121.string().uuid()
|
9378
9381
|
}),
|
9379
9382
|
body: null,
|
9380
9383
|
responses: {
|
@@ -9386,21 +9389,21 @@ var automationQueueContract = initContract46().router(
|
|
9386
9389
|
getAutomationQueues: {
|
9387
9390
|
method: "GET",
|
9388
9391
|
path: "",
|
9389
|
-
query:
|
9390
|
-
userId:
|
9391
|
-
withRelations:
|
9392
|
+
query: z121.object({
|
9393
|
+
userId: z121.string().uuid().optional(),
|
9394
|
+
withRelations: z121.coerce.boolean().default(true).optional()
|
9392
9395
|
}).optional(),
|
9393
9396
|
responses: {
|
9394
9397
|
200: DefaultSuccessResponseSchema.extend({
|
9395
|
-
data:
|
9398
|
+
data: z121.array(AutomationQueueSchema)
|
9396
9399
|
})
|
9397
9400
|
}
|
9398
9401
|
},
|
9399
9402
|
getAutomationQueueById: {
|
9400
9403
|
method: "GET",
|
9401
9404
|
path: "/:id",
|
9402
|
-
pathParams:
|
9403
|
-
id:
|
9405
|
+
pathParams: z121.object({
|
9406
|
+
id: z121.string().uuid()
|
9404
9407
|
}),
|
9405
9408
|
responses: {
|
9406
9409
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9411,8 +9414,8 @@ var automationQueueContract = initContract46().router(
|
|
9411
9414
|
updateAutomationQueue: {
|
9412
9415
|
method: "PATCH",
|
9413
9416
|
path: "/:id",
|
9414
|
-
pathParams:
|
9415
|
-
id:
|
9417
|
+
pathParams: z121.object({
|
9418
|
+
id: z121.string().uuid()
|
9416
9419
|
}),
|
9417
9420
|
body: UpdateAutomationQueueSchema,
|
9418
9421
|
responses: {
|
@@ -9424,13 +9427,13 @@ var automationQueueContract = initContract46().router(
|
|
9424
9427
|
deleteAutomationQueue: {
|
9425
9428
|
method: "DELETE",
|
9426
9429
|
path: "/:id",
|
9427
|
-
pathParams:
|
9428
|
-
id:
|
9430
|
+
pathParams: z121.object({
|
9431
|
+
id: z121.string().uuid()
|
9429
9432
|
}),
|
9430
9433
|
body: null,
|
9431
9434
|
responses: {
|
9432
9435
|
200: DefaultSuccessResponseSchema.extend({
|
9433
|
-
message:
|
9436
|
+
message: z121.string()
|
9434
9437
|
})
|
9435
9438
|
}
|
9436
9439
|
},
|
@@ -9440,8 +9443,8 @@ var automationQueueContract = initContract46().router(
|
|
9440
9443
|
body: CheckHasAssignedRoomSchema,
|
9441
9444
|
responses: {
|
9442
9445
|
200: DefaultSuccessResponseSchema.extend({
|
9443
|
-
data:
|
9444
|
-
hasAssignedRoom:
|
9446
|
+
data: z121.object({
|
9447
|
+
hasAssignedRoom: z121.boolean()
|
9445
9448
|
})
|
9446
9449
|
})
|
9447
9450
|
}
|
@@ -9458,282 +9461,282 @@ import { initContract as initContract51 } from "@ts-rest/core";
|
|
9458
9461
|
|
9459
9462
|
// src/mail/room-contract.ts
|
9460
9463
|
import { initContract as initContract47 } from "@ts-rest/core";
|
9461
|
-
import
|
9464
|
+
import z126 from "zod";
|
9462
9465
|
|
9463
9466
|
// src/mail/schemas/room.schema.ts
|
9464
|
-
import
|
9467
|
+
import z124 from "zod";
|
9465
9468
|
|
9466
9469
|
// src/mail/schemas/account.schema.ts
|
9467
|
-
import z121 from "zod";
|
9468
|
-
var MailServerSchema = z121.object({
|
9469
|
-
id: z121.string(),
|
9470
|
-
createdAt: z121.date(),
|
9471
|
-
updatedAt: z121.date(),
|
9472
|
-
deletedAt: z121.date().nullable(),
|
9473
|
-
name: z121.string(),
|
9474
|
-
smtpHost: z121.string(),
|
9475
|
-
smtpPort: z121.number(),
|
9476
|
-
smtpTlsPort: z121.number(),
|
9477
|
-
useTlsForSmtp: z121.boolean(),
|
9478
|
-
imapHost: z121.string(),
|
9479
|
-
imapPort: z121.number(),
|
9480
|
-
imapTlsPort: z121.number(),
|
9481
|
-
useTlsForImap: z121.boolean()
|
9482
|
-
});
|
9483
|
-
var MailAccountSchema = z121.object({
|
9484
|
-
id: z121.string(),
|
9485
|
-
createdAt: z121.date(),
|
9486
|
-
updatedAt: z121.date(),
|
9487
|
-
deletedAt: z121.date().nullable(),
|
9488
|
-
name: z121.string(),
|
9489
|
-
address: z121.string(),
|
9490
|
-
accountId: z121.string(),
|
9491
|
-
mailServerId: z121.string(),
|
9492
|
-
mailServer: MailServerSchema,
|
9493
|
-
state: z121.union([
|
9494
|
-
z121.literal("init"),
|
9495
|
-
z121.literal("syncing"),
|
9496
|
-
z121.literal("connecting"),
|
9497
|
-
z121.literal("connected"),
|
9498
|
-
z121.literal("disconnected"),
|
9499
|
-
z121.literal("authenticationError"),
|
9500
|
-
z121.literal("connectError"),
|
9501
|
-
z121.literal("unset")
|
9502
|
-
])
|
9503
|
-
});
|
9504
|
-
var OAuth2AppSchema = z121.object({
|
9505
|
-
id: z121.string(),
|
9506
|
-
name: z121.string(),
|
9507
|
-
description: z121.string(),
|
9508
|
-
title: z121.string(),
|
9509
|
-
provider: z121.string(),
|
9510
|
-
enabled: z121.boolean(),
|
9511
|
-
legacy: z121.boolean(),
|
9512
|
-
created: z121.string(),
|
9513
|
-
updated: z121.string(),
|
9514
|
-
includeInListing: z121.boolean(),
|
9515
|
-
clientId: z121.string(),
|
9516
|
-
clientSecret: z121.string(),
|
9517
|
-
authority: z121.string(),
|
9518
|
-
redirectUrl: z121.string(),
|
9519
|
-
serviceClient: z121.string(),
|
9520
|
-
googleProjectId: z121.string(),
|
9521
|
-
serviceClientEmail: z121.string(),
|
9522
|
-
serviceKey: z121.string()
|
9523
|
-
});
|
9524
|
-
|
9525
|
-
// src/mail/schemas/message.schema.ts
|
9526
9470
|
import z122 from "zod";
|
9527
|
-
var
|
9471
|
+
var MailServerSchema = z122.object({
|
9528
9472
|
id: z122.string(),
|
9529
9473
|
createdAt: z122.date(),
|
9530
9474
|
updatedAt: z122.date(),
|
9531
|
-
deletedAt: z122.
|
9532
|
-
|
9533
|
-
|
9534
|
-
|
9535
|
-
|
9536
|
-
|
9537
|
-
|
9538
|
-
|
9539
|
-
|
9540
|
-
|
9541
|
-
|
9542
|
-
|
9543
|
-
bucketName: z122.string(),
|
9544
|
-
fileName: z122.string(),
|
9545
|
-
fileKey: z122.string(),
|
9546
|
-
fileSize: z122.number(),
|
9547
|
-
fileUrl: z122.string(),
|
9548
|
-
extensionName: z122.string()
|
9549
|
-
})
|
9550
|
-
});
|
9551
|
-
var MessageSchema2 = z122.object({
|
9475
|
+
deletedAt: z122.date().nullable(),
|
9476
|
+
name: z122.string(),
|
9477
|
+
smtpHost: z122.string(),
|
9478
|
+
smtpPort: z122.number(),
|
9479
|
+
smtpTlsPort: z122.number(),
|
9480
|
+
useTlsForSmtp: z122.boolean(),
|
9481
|
+
imapHost: z122.string(),
|
9482
|
+
imapPort: z122.number(),
|
9483
|
+
imapTlsPort: z122.number(),
|
9484
|
+
useTlsForImap: z122.boolean()
|
9485
|
+
});
|
9486
|
+
var MailAccountSchema = z122.object({
|
9552
9487
|
id: z122.string(),
|
9553
9488
|
createdAt: z122.date(),
|
9554
9489
|
updatedAt: z122.date(),
|
9555
|
-
deletedAt: z122.
|
9556
|
-
|
9557
|
-
|
9558
|
-
|
9559
|
-
|
9560
|
-
|
9561
|
-
|
9562
|
-
|
9563
|
-
|
9564
|
-
|
9565
|
-
|
9566
|
-
|
9567
|
-
|
9568
|
-
|
9569
|
-
|
9570
|
-
|
9571
|
-
from: z122.array(MailParticipant),
|
9572
|
-
to: z122.array(MailParticipant),
|
9573
|
-
cc: z122.array(MailParticipant),
|
9574
|
-
bcc: z122.array(MailParticipant),
|
9575
|
-
attachments: z122.array(AttachmentSchema)
|
9490
|
+
deletedAt: z122.date().nullable(),
|
9491
|
+
name: z122.string(),
|
9492
|
+
address: z122.string(),
|
9493
|
+
accountId: z122.string(),
|
9494
|
+
mailServerId: z122.string(),
|
9495
|
+
mailServer: MailServerSchema,
|
9496
|
+
state: z122.union([
|
9497
|
+
z122.literal("init"),
|
9498
|
+
z122.literal("syncing"),
|
9499
|
+
z122.literal("connecting"),
|
9500
|
+
z122.literal("connected"),
|
9501
|
+
z122.literal("disconnected"),
|
9502
|
+
z122.literal("authenticationError"),
|
9503
|
+
z122.literal("connectError"),
|
9504
|
+
z122.literal("unset")
|
9505
|
+
])
|
9576
9506
|
});
|
9577
|
-
|
9578
|
-
|
9579
|
-
|
9580
|
-
|
9581
|
-
|
9582
|
-
|
9583
|
-
|
9584
|
-
|
9585
|
-
|
9586
|
-
|
9587
|
-
|
9588
|
-
|
9589
|
-
|
9590
|
-
|
9591
|
-
|
9592
|
-
|
9593
|
-
|
9594
|
-
|
9595
|
-
|
9596
|
-
name: z123.string(),
|
9597
|
-
address: z123.string(),
|
9598
|
-
contactId: z123.string(),
|
9599
|
-
contact: ContactSchema3,
|
9600
|
-
isNewContact: z123.boolean()
|
9507
|
+
var OAuth2AppSchema = z122.object({
|
9508
|
+
id: z122.string(),
|
9509
|
+
name: z122.string(),
|
9510
|
+
description: z122.string(),
|
9511
|
+
title: z122.string(),
|
9512
|
+
provider: z122.string(),
|
9513
|
+
enabled: z122.boolean(),
|
9514
|
+
legacy: z122.boolean(),
|
9515
|
+
created: z122.string(),
|
9516
|
+
updated: z122.string(),
|
9517
|
+
includeInListing: z122.boolean(),
|
9518
|
+
clientId: z122.string(),
|
9519
|
+
clientSecret: z122.string(),
|
9520
|
+
authority: z122.string(),
|
9521
|
+
redirectUrl: z122.string(),
|
9522
|
+
serviceClient: z122.string(),
|
9523
|
+
googleProjectId: z122.string(),
|
9524
|
+
serviceClientEmail: z122.string(),
|
9525
|
+
serviceKey: z122.string()
|
9601
9526
|
});
|
9602
|
-
|
9527
|
+
|
9528
|
+
// src/mail/schemas/message.schema.ts
|
9529
|
+
import z123 from "zod";
|
9530
|
+
var AttachmentSchema = z123.object({
|
9603
9531
|
id: z123.string(),
|
9604
9532
|
createdAt: z123.date(),
|
9605
9533
|
updatedAt: z123.date(),
|
9606
|
-
deletedAt: z123.
|
9534
|
+
deletedAt: z123.nullable(z123.date()),
|
9607
9535
|
roomId: z123.string(),
|
9608
9536
|
messageId: z123.string(),
|
9609
|
-
|
9610
|
-
|
9611
|
-
|
9612
|
-
|
9613
|
-
|
9614
|
-
|
9615
|
-
|
9616
|
-
|
9617
|
-
|
9618
|
-
|
9537
|
+
fileName: z123.string(),
|
9538
|
+
fileType: z123.string(),
|
9539
|
+
emailEngineAttachmentId: z123.string(),
|
9540
|
+
uploadId: z123.string(),
|
9541
|
+
upload: z123.object({
|
9542
|
+
id: z123.string(),
|
9543
|
+
createdAt: z123.date(),
|
9544
|
+
updatedAt: z123.date(),
|
9545
|
+
deletedAt: z123.nullable(z123.date()),
|
9546
|
+
bucketName: z123.string(),
|
9547
|
+
fileName: z123.string(),
|
9548
|
+
fileKey: z123.string(),
|
9549
|
+
fileSize: z123.number(),
|
9550
|
+
fileUrl: z123.string(),
|
9551
|
+
extensionName: z123.string()
|
9552
|
+
})
|
9619
9553
|
});
|
9620
|
-
var
|
9621
|
-
id: z123.string().uuid(),
|
9622
|
-
createdAt: z123.date(),
|
9623
|
-
updatedAt: z123.date(),
|
9624
|
-
deletedAt: z123.date().nullable(),
|
9625
|
-
name: z123.string(),
|
9626
|
-
email: z123.string(),
|
9627
|
-
address: z123.string().nullable(),
|
9628
|
-
phone: z123.string().nullable(),
|
9629
|
-
notificationCount: z123.number().nullable()
|
9630
|
-
});
|
9631
|
-
var ActivityLogModel = z123.object({
|
9554
|
+
var MessageSchema2 = z123.object({
|
9632
9555
|
id: z123.string(),
|
9633
9556
|
createdAt: z123.date(),
|
9634
9557
|
updatedAt: z123.date(),
|
9635
|
-
deletedAt: z123.nullable(z123.
|
9636
|
-
description: z123.string(),
|
9637
|
-
actorId: z123.string(),
|
9558
|
+
deletedAt: z123.nullable(z123.date()),
|
9638
9559
|
roomId: z123.string(),
|
9639
|
-
actor: UserModel
|
9640
|
-
});
|
9641
|
-
var MessagesAndLogsSchema = z123.array(
|
9642
|
-
z123.union([MessageSchema2, ActivityLogModel])
|
9643
|
-
);
|
9644
|
-
var MailRoomSchema = z123.object({
|
9645
|
-
id: z123.string(),
|
9646
|
-
createdAt: z123.date(),
|
9647
|
-
updatedAt: z123.date(),
|
9648
|
-
deletedAt: z123.date().nullable(),
|
9649
9560
|
subject: z123.string(),
|
9650
|
-
|
9651
|
-
|
9652
|
-
|
9653
|
-
|
9561
|
+
textPlain: z123.string(),
|
9562
|
+
textHtml: z123.string(),
|
9563
|
+
textId: z123.string(),
|
9564
|
+
emailEngineEmailId: z123.string(),
|
9565
|
+
emailEngineMessageId: z123.string(),
|
9566
|
+
emailEngineReplyTo: z123.nullable(z123.string()),
|
9654
9567
|
direction: z123.string(),
|
9655
|
-
|
9656
|
-
|
9568
|
+
date: z123.date(),
|
9569
|
+
action: z123.string(),
|
9570
|
+
unseen: z123.boolean(),
|
9571
|
+
sendAt: z123.date(),
|
9572
|
+
starred: z123.boolean(),
|
9573
|
+
seemsLikeNew: z123.boolean(),
|
9657
9574
|
from: z123.array(MailParticipant),
|
9658
9575
|
to: z123.array(MailParticipant),
|
9659
9576
|
cc: z123.array(MailParticipant),
|
9660
9577
|
bcc: z123.array(MailParticipant),
|
9578
|
+
attachments: z123.array(AttachmentSchema)
|
9579
|
+
});
|
9580
|
+
|
9581
|
+
// src/mail/schemas/room.schema.ts
|
9582
|
+
var ContactSchema3 = z124.object({
|
9583
|
+
id: z124.string().uuid(),
|
9584
|
+
createdAt: z124.date(),
|
9585
|
+
updatedAt: z124.date(),
|
9586
|
+
deletedAt: z124.date().nullable(),
|
9587
|
+
name: z124.string(),
|
9588
|
+
address: z124.string().nullable(),
|
9589
|
+
channel: z124.string().nullable(),
|
9590
|
+
notes: z124.string().nullable(),
|
9591
|
+
contactProfile: z124.string().nullable(),
|
9592
|
+
socialProfileUrl: z124.string().nullable()
|
9593
|
+
});
|
9594
|
+
var MailUserSchema = z124.object({
|
9595
|
+
id: z124.string(),
|
9596
|
+
createdAt: z124.date(),
|
9597
|
+
updatedAt: z124.date(),
|
9598
|
+
deletedAt: z124.date().nullable(),
|
9599
|
+
name: z124.string(),
|
9600
|
+
address: z124.string(),
|
9601
|
+
contactId: z124.string(),
|
9602
|
+
contact: ContactSchema3,
|
9603
|
+
isNewContact: z124.boolean()
|
9604
|
+
});
|
9605
|
+
var MailParticipant = z124.object({
|
9606
|
+
id: z124.string(),
|
9607
|
+
createdAt: z124.date(),
|
9608
|
+
updatedAt: z124.date(),
|
9609
|
+
deletedAt: z124.date().nullable(),
|
9610
|
+
roomId: z124.string(),
|
9611
|
+
messageId: z124.string(),
|
9612
|
+
mailUserId: z124.string(),
|
9613
|
+
mailUser: MailUserSchema
|
9614
|
+
});
|
9615
|
+
var TagSchema2 = z124.object({
|
9616
|
+
color: z124.string(),
|
9617
|
+
id: z124.string(),
|
9618
|
+
createdAt: z124.date(),
|
9619
|
+
updatedAt: z124.date(),
|
9620
|
+
deletedAt: z124.date().nullable(),
|
9621
|
+
name: z124.string()
|
9622
|
+
});
|
9623
|
+
var UserModel = z124.object({
|
9624
|
+
id: z124.string().uuid(),
|
9625
|
+
createdAt: z124.date(),
|
9626
|
+
updatedAt: z124.date(),
|
9627
|
+
deletedAt: z124.date().nullable(),
|
9628
|
+
name: z124.string(),
|
9629
|
+
email: z124.string(),
|
9630
|
+
address: z124.string().nullable(),
|
9631
|
+
phone: z124.string().nullable(),
|
9632
|
+
notificationCount: z124.number().nullable()
|
9633
|
+
});
|
9634
|
+
var ActivityLogModel = z124.object({
|
9635
|
+
id: z124.string(),
|
9636
|
+
createdAt: z124.date(),
|
9637
|
+
updatedAt: z124.date(),
|
9638
|
+
deletedAt: z124.nullable(z124.string()),
|
9639
|
+
description: z124.string(),
|
9640
|
+
actorId: z124.string(),
|
9641
|
+
roomId: z124.string(),
|
9642
|
+
actor: UserModel
|
9643
|
+
});
|
9644
|
+
var MessagesAndLogsSchema = z124.array(
|
9645
|
+
z124.union([MessageSchema2, ActivityLogModel])
|
9646
|
+
);
|
9647
|
+
var MailRoomSchema = z124.object({
|
9648
|
+
id: z124.string(),
|
9649
|
+
createdAt: z124.date(),
|
9650
|
+
updatedAt: z124.date(),
|
9651
|
+
deletedAt: z124.date().nullable(),
|
9652
|
+
subject: z124.string(),
|
9653
|
+
resolved: z124.boolean(),
|
9654
|
+
assigneeId: z124.string().nullable(),
|
9655
|
+
note: z124.string(),
|
9656
|
+
mailId: z124.string(),
|
9657
|
+
direction: z124.string(),
|
9658
|
+
lastMessageId: z124.string(),
|
9659
|
+
firstMessageId: z124.string(),
|
9660
|
+
from: z124.array(MailParticipant),
|
9661
|
+
to: z124.array(MailParticipant),
|
9662
|
+
cc: z124.array(MailParticipant),
|
9663
|
+
bcc: z124.array(MailParticipant),
|
9661
9664
|
firstMessage: MessageSchema2,
|
9662
9665
|
lastMessage: MessageSchema2,
|
9663
|
-
tags:
|
9666
|
+
tags: z124.array(TagSchema2),
|
9664
9667
|
assignee: UserModel,
|
9665
|
-
messages:
|
9668
|
+
messages: z124.array(MessageSchema2),
|
9666
9669
|
messagesAndLogs: MessagesAndLogsSchema,
|
9667
9670
|
mail: MailAccountSchema,
|
9668
|
-
unReadMessageCount:
|
9671
|
+
unReadMessageCount: z124.number(),
|
9669
9672
|
cxlog: CxLogSchema
|
9670
9673
|
});
|
9671
|
-
var AttachmentSchema2 =
|
9672
|
-
fileName:
|
9673
|
-
fileType:
|
9674
|
-
emailEngineAttachmentId:
|
9675
|
-
uploadId:
|
9676
|
-
messageId:
|
9677
|
-
roomId:
|
9674
|
+
var AttachmentSchema2 = z124.object({
|
9675
|
+
fileName: z124.string(),
|
9676
|
+
fileType: z124.string(),
|
9677
|
+
emailEngineAttachmentId: z124.string(),
|
9678
|
+
uploadId: z124.string(),
|
9679
|
+
messageId: z124.string(),
|
9680
|
+
roomId: z124.string(),
|
9678
9681
|
upload: UploadSchema
|
9679
9682
|
});
|
9680
9683
|
|
9681
9684
|
// src/mail/schemas/room-validation.schema.ts
|
9682
|
-
import
|
9685
|
+
import z125 from "zod";
|
9683
9686
|
var RoomContractsValidationSchema = {
|
9684
9687
|
getAll: {
|
9685
|
-
input:
|
9686
|
-
page:
|
9687
|
-
pageSize:
|
9688
|
-
keyword:
|
9689
|
-
value:
|
9690
|
-
category:
|
9688
|
+
input: z125.object({
|
9689
|
+
page: z125.coerce.number().default(1),
|
9690
|
+
pageSize: z125.coerce.number().default(10),
|
9691
|
+
keyword: z125.object({
|
9692
|
+
value: z125.string(),
|
9693
|
+
category: z125.union([z125.literal("contact"), z125.literal("message")])
|
9691
9694
|
}).optional(),
|
9692
|
-
contactLabels:
|
9693
|
-
channels:
|
9694
|
-
date:
|
9695
|
-
contacts:
|
9696
|
-
assignees:
|
9697
|
-
level1:
|
9698
|
-
|
9699
|
-
|
9700
|
-
|
9701
|
-
|
9702
|
-
|
9703
|
-
|
9695
|
+
contactLabels: z125.array(z125.string()).optional(),
|
9696
|
+
channels: z125.array(z125.string().email()).optional(),
|
9697
|
+
date: z125.string().optional(),
|
9698
|
+
contacts: z125.array(z125.string()).optional(),
|
9699
|
+
assignees: z125.array(z125.string()).optional(),
|
9700
|
+
level1: z125.union([
|
9701
|
+
z125.literal("open"),
|
9702
|
+
z125.literal("close"),
|
9703
|
+
z125.literal("inbox"),
|
9704
|
+
z125.literal("sent"),
|
9705
|
+
z125.literal("scheduled"),
|
9706
|
+
z125.literal("starred")
|
9704
9707
|
]).optional(),
|
9705
|
-
level2:
|
9706
|
-
|
9707
|
-
|
9708
|
-
|
9709
|
-
|
9708
|
+
level2: z125.union([
|
9709
|
+
z125.literal("all"),
|
9710
|
+
z125.literal("unassign"),
|
9711
|
+
z125.literal("mine"),
|
9712
|
+
z125.literal("other")
|
9710
9713
|
]).optional()
|
9711
9714
|
}),
|
9712
|
-
output:
|
9713
|
-
data:
|
9714
|
-
total:
|
9715
|
-
page:
|
9716
|
-
pageSize:
|
9715
|
+
output: z125.object({
|
9716
|
+
data: z125.array(MailRoomSchema),
|
9717
|
+
total: z125.number(),
|
9718
|
+
page: z125.number(),
|
9719
|
+
pageSize: z125.number()
|
9717
9720
|
})
|
9718
9721
|
},
|
9719
9722
|
update: {
|
9720
|
-
input:
|
9721
|
-
disposition:
|
9722
|
-
|
9723
|
-
|
9724
|
-
|
9725
|
-
|
9726
|
-
|
9727
|
-
|
9723
|
+
input: z125.object({
|
9724
|
+
disposition: z125.union([
|
9725
|
+
z125.literal("resolved"),
|
9726
|
+
z125.literal("follow up"),
|
9727
|
+
z125.literal("escalated"),
|
9728
|
+
z125.literal("dropped"),
|
9729
|
+
z125.literal("prank"),
|
9730
|
+
z125.literal("blank")
|
9728
9731
|
]).optional().nullable(),
|
9729
|
-
assigneeId:
|
9730
|
-
note:
|
9731
|
-
tags:
|
9732
|
-
handover:
|
9733
|
-
|
9732
|
+
assigneeId: z125.string().uuid().optional().nullable(),
|
9733
|
+
note: z125.string().optional(),
|
9734
|
+
tags: z125.array(z125.string().uuid()).optional(),
|
9735
|
+
handover: z125.boolean().or(
|
9736
|
+
z125.union([z125.literal("true"), z125.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9734
9737
|
).optional().nullable(),
|
9735
|
-
selfAssign:
|
9736
|
-
|
9738
|
+
selfAssign: z125.boolean().or(
|
9739
|
+
z125.union([z125.literal("true"), z125.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9737
9740
|
).optional().nullable()
|
9738
9741
|
})
|
9739
9742
|
}
|
@@ -9747,7 +9750,7 @@ var roomContract = initContract47().router(
|
|
9747
9750
|
path: "/",
|
9748
9751
|
responses: {
|
9749
9752
|
200: DefaultSuccessResponseSchema.extend({
|
9750
|
-
message:
|
9753
|
+
message: z126.string()
|
9751
9754
|
}),
|
9752
9755
|
...DefaultResponses
|
9753
9756
|
},
|
@@ -9760,10 +9763,10 @@ var roomContract = initContract47().router(
|
|
9760
9763
|
query: RoomContractsValidationSchema.getAll.input,
|
9761
9764
|
responses: {
|
9762
9765
|
200: DefaultSuccessResponseSchema.extend({
|
9763
|
-
data:
|
9764
|
-
total:
|
9765
|
-
page:
|
9766
|
-
pageSize:
|
9766
|
+
data: z126.array(MailRoomSchema),
|
9767
|
+
total: z126.number(),
|
9768
|
+
page: z126.number(),
|
9769
|
+
pageSize: z126.number()
|
9767
9770
|
}),
|
9768
9771
|
...DefaultResponses
|
9769
9772
|
},
|
@@ -9775,24 +9778,24 @@ var roomContract = initContract47().router(
|
|
9775
9778
|
path: "/count_rooms/all",
|
9776
9779
|
responses: {
|
9777
9780
|
200: DefaultSuccessResponseSchema.extend({
|
9778
|
-
data:
|
9779
|
-
general:
|
9780
|
-
|
9781
|
-
name:
|
9782
|
-
count:
|
9783
|
-
unReadMessagesCount:
|
9781
|
+
data: z126.object({
|
9782
|
+
general: z126.array(
|
9783
|
+
z126.object({
|
9784
|
+
name: z126.string(),
|
9785
|
+
count: z126.number(),
|
9786
|
+
unReadMessagesCount: z126.number()
|
9784
9787
|
})
|
9785
9788
|
),
|
9786
|
-
channels:
|
9787
|
-
|
9789
|
+
channels: z126.array(
|
9790
|
+
z126.object({
|
9788
9791
|
channel: MailAccountSchema,
|
9789
|
-
count:
|
9792
|
+
count: z126.number()
|
9790
9793
|
})
|
9791
9794
|
),
|
9792
|
-
contactLabels:
|
9793
|
-
|
9795
|
+
contactLabels: z126.array(
|
9796
|
+
z126.object({
|
9794
9797
|
label: TagSchema,
|
9795
|
-
count:
|
9798
|
+
count: z126.number()
|
9796
9799
|
})
|
9797
9800
|
)
|
9798
9801
|
})
|
@@ -9804,12 +9807,12 @@ var roomContract = initContract47().router(
|
|
9804
9807
|
getAttachments: {
|
9805
9808
|
method: "GET",
|
9806
9809
|
path: "/:id/attachments",
|
9807
|
-
pathParams:
|
9808
|
-
id:
|
9810
|
+
pathParams: z126.object({
|
9811
|
+
id: z126.string().uuid()
|
9809
9812
|
}),
|
9810
9813
|
responses: {
|
9811
9814
|
200: DefaultSuccessResponseSchema.extend({
|
9812
|
-
data:
|
9815
|
+
data: z126.array(AttachmentSchema2)
|
9813
9816
|
}),
|
9814
9817
|
...DefaultResponses
|
9815
9818
|
},
|
@@ -9818,12 +9821,12 @@ var roomContract = initContract47().router(
|
|
9818
9821
|
getParticipants: {
|
9819
9822
|
method: "GET",
|
9820
9823
|
path: "/:id/participants",
|
9821
|
-
pathParams:
|
9822
|
-
id:
|
9824
|
+
pathParams: z126.object({
|
9825
|
+
id: z126.string().uuid()
|
9823
9826
|
}),
|
9824
9827
|
responses: {
|
9825
9828
|
200: DefaultSuccessResponseSchema.extend({
|
9826
|
-
data:
|
9829
|
+
data: z126.array(MailParticipant)
|
9827
9830
|
}),
|
9828
9831
|
...DefaultResponses
|
9829
9832
|
},
|
@@ -9834,22 +9837,22 @@ var roomContract = initContract47().router(
|
|
9834
9837
|
path: "/add_email_to_contact",
|
9835
9838
|
responses: {
|
9836
9839
|
200: DefaultSuccessResponseSchema.extend({
|
9837
|
-
data:
|
9840
|
+
data: z126.string()
|
9838
9841
|
}),
|
9839
9842
|
...DefaultResponses
|
9840
9843
|
},
|
9841
|
-
body:
|
9842
|
-
email:
|
9843
|
-
contactId:
|
9844
|
-
mailUserId:
|
9844
|
+
body: z126.object({
|
9845
|
+
email: z126.string(),
|
9846
|
+
contactId: z126.string(),
|
9847
|
+
mailUserId: z126.string()
|
9845
9848
|
}),
|
9846
9849
|
summary: "Add a new email of a mail room participant to an existing contact"
|
9847
9850
|
},
|
9848
9851
|
update: {
|
9849
9852
|
method: "PATCH",
|
9850
9853
|
path: "/:id",
|
9851
|
-
pathParams:
|
9852
|
-
id:
|
9854
|
+
pathParams: z126.object({
|
9855
|
+
id: z126.string()
|
9853
9856
|
}),
|
9854
9857
|
responses: {
|
9855
9858
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9863,12 +9866,12 @@ var roomContract = initContract47().router(
|
|
9863
9866
|
markAsRead: {
|
9864
9867
|
method: "POST",
|
9865
9868
|
path: "/mark_as_read",
|
9866
|
-
body:
|
9867
|
-
id:
|
9869
|
+
body: z126.object({
|
9870
|
+
id: z126.string()
|
9868
9871
|
}),
|
9869
9872
|
responses: {
|
9870
9873
|
200: DefaultSuccessResponseSchema.extend({
|
9871
|
-
message:
|
9874
|
+
message: z126.string()
|
9872
9875
|
}),
|
9873
9876
|
...DefaultResponses
|
9874
9877
|
},
|
@@ -9877,8 +9880,8 @@ var roomContract = initContract47().router(
|
|
9877
9880
|
getById: {
|
9878
9881
|
method: "GET",
|
9879
9882
|
path: "/:id",
|
9880
|
-
pathParams:
|
9881
|
-
id:
|
9883
|
+
pathParams: z126.object({
|
9884
|
+
id: z126.string().uuid()
|
9882
9885
|
}),
|
9883
9886
|
responses: {
|
9884
9887
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9896,70 +9899,70 @@ var roomContract = initContract47().router(
|
|
9896
9899
|
|
9897
9900
|
// src/mail/account-contract.ts
|
9898
9901
|
import { initContract as initContract48 } from "@ts-rest/core";
|
9899
|
-
import
|
9902
|
+
import z128 from "zod";
|
9900
9903
|
|
9901
9904
|
// src/mail/schemas/account-validation.schema.ts
|
9902
|
-
import
|
9905
|
+
import z127 from "zod";
|
9903
9906
|
var AccountContractsValidationSchemas = {
|
9904
9907
|
create: {
|
9905
|
-
input:
|
9906
|
-
address:
|
9907
|
-
name:
|
9908
|
-
password:
|
9909
|
-
mailServerId:
|
9908
|
+
input: z127.object({
|
9909
|
+
address: z127.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
9910
|
+
name: z127.string().min(1, "Account name cannot be empty."),
|
9911
|
+
password: z127.string().min(1, "Password cannot be empty."),
|
9912
|
+
mailServerId: z127.string().uuid("Invalid mail_server_id")
|
9910
9913
|
})
|
9911
9914
|
},
|
9912
9915
|
getById: {
|
9913
|
-
input:
|
9914
|
-
id:
|
9916
|
+
input: z127.object({
|
9917
|
+
id: z127.string().uuid()
|
9915
9918
|
}),
|
9916
9919
|
output: MailAccountSchema
|
9917
9920
|
},
|
9918
9921
|
getAll: {
|
9919
|
-
output:
|
9922
|
+
output: z127.array(MailAccountSchema)
|
9920
9923
|
},
|
9921
9924
|
update: {
|
9922
9925
|
input: MailAccountSchema,
|
9923
9926
|
output: MailAccountSchema
|
9924
9927
|
},
|
9925
9928
|
disconnect: {
|
9926
|
-
input:
|
9927
|
-
id:
|
9929
|
+
input: z127.object({
|
9930
|
+
id: z127.string().uuid()
|
9928
9931
|
}),
|
9929
9932
|
output: MailAccountSchema
|
9930
9933
|
},
|
9931
9934
|
reconnect: {
|
9932
|
-
input:
|
9933
|
-
id:
|
9935
|
+
input: z127.object({
|
9936
|
+
id: z127.string()
|
9934
9937
|
}),
|
9935
9938
|
output: MailAccountSchema
|
9936
9939
|
},
|
9937
9940
|
delete: {
|
9938
|
-
input:
|
9939
|
-
id:
|
9941
|
+
input: z127.object({
|
9942
|
+
id: z127.string()
|
9940
9943
|
}),
|
9941
|
-
output:
|
9944
|
+
output: z127.string()
|
9942
9945
|
},
|
9943
9946
|
deleteEmailEngineAcc: {
|
9944
|
-
input:
|
9945
|
-
account:
|
9947
|
+
input: z127.object({
|
9948
|
+
account: z127.string()
|
9946
9949
|
}),
|
9947
9950
|
output: MailAccountSchema
|
9948
9951
|
},
|
9949
9952
|
generateOAuth2AuthenticationLink: {
|
9950
|
-
body:
|
9951
|
-
oAuth2AppId:
|
9952
|
-
mailServerId:
|
9953
|
+
body: z127.object({
|
9954
|
+
oAuth2AppId: z127.string(),
|
9955
|
+
mailServerId: z127.string()
|
9953
9956
|
}),
|
9954
|
-
response:
|
9955
|
-
url:
|
9956
|
-
account:
|
9957
|
+
response: z127.object({
|
9958
|
+
url: z127.string(),
|
9959
|
+
account: z127.string()
|
9957
9960
|
})
|
9958
9961
|
},
|
9959
9962
|
createOAuth2Acc: {
|
9960
|
-
body:
|
9961
|
-
account:
|
9962
|
-
name:
|
9963
|
+
body: z127.object({
|
9964
|
+
account: z127.string(),
|
9965
|
+
name: z127.string()
|
9963
9966
|
}),
|
9964
9967
|
response: MailAccountSchema
|
9965
9968
|
}
|
@@ -9977,14 +9980,14 @@ var accountContract = initContract48().router(
|
|
9977
9980
|
// data: AccountContractsValidationSchemas.create.output,
|
9978
9981
|
data: MailAccountSchema
|
9979
9982
|
}),
|
9980
|
-
400:
|
9981
|
-
message:
|
9983
|
+
400: z128.object({
|
9984
|
+
message: z128.string()
|
9982
9985
|
}),
|
9983
|
-
409:
|
9984
|
-
message:
|
9986
|
+
409: z128.object({
|
9987
|
+
message: z128.string()
|
9985
9988
|
}),
|
9986
|
-
500:
|
9987
|
-
message:
|
9989
|
+
500: z128.object({
|
9990
|
+
message: z128.string()
|
9988
9991
|
}),
|
9989
9992
|
...DefaultResponses
|
9990
9993
|
},
|
@@ -10000,14 +10003,14 @@ var accountContract = initContract48().router(
|
|
10000
10003
|
201: DefaultSuccessResponseSchema.extend({
|
10001
10004
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10002
10005
|
}),
|
10003
|
-
400:
|
10004
|
-
message:
|
10006
|
+
400: z128.object({
|
10007
|
+
message: z128.string()
|
10005
10008
|
}),
|
10006
|
-
409:
|
10007
|
-
message:
|
10009
|
+
409: z128.object({
|
10010
|
+
message: z128.string()
|
10008
10011
|
}),
|
10009
|
-
500:
|
10010
|
-
message:
|
10012
|
+
500: z128.object({
|
10013
|
+
message: z128.string()
|
10011
10014
|
}),
|
10012
10015
|
...DefaultResponses
|
10013
10016
|
},
|
@@ -10021,7 +10024,7 @@ var accountContract = initContract48().router(
|
|
10021
10024
|
path: "/sync",
|
10022
10025
|
responses: {
|
10023
10026
|
200: DefaultSuccessResponseSchema.extend({
|
10024
|
-
message:
|
10027
|
+
message: z128.string()
|
10025
10028
|
}),
|
10026
10029
|
...DefaultResponses
|
10027
10030
|
},
|
@@ -10046,13 +10049,13 @@ var accountContract = initContract48().router(
|
|
10046
10049
|
getAll: {
|
10047
10050
|
method: "GET",
|
10048
10051
|
path: "",
|
10049
|
-
query:
|
10050
|
-
state:
|
10051
|
-
withDeleted:
|
10052
|
+
query: z128.object({
|
10053
|
+
state: z128.union([z128.literal("connected"), z128.literal("disconnected")]).optional(),
|
10054
|
+
withDeleted: z128.boolean().default(false)
|
10052
10055
|
}).optional(),
|
10053
10056
|
responses: {
|
10054
10057
|
200: DefaultSuccessResponseSchema.extend({
|
10055
|
-
data:
|
10058
|
+
data: z128.array(MailAccountSchema)
|
10056
10059
|
}),
|
10057
10060
|
...DefaultResponses
|
10058
10061
|
},
|
@@ -10063,8 +10066,8 @@ var accountContract = initContract48().router(
|
|
10063
10066
|
update: {
|
10064
10067
|
method: "PATCH",
|
10065
10068
|
path: "/:id",
|
10066
|
-
pathParams:
|
10067
|
-
id:
|
10069
|
+
pathParams: z128.object({
|
10070
|
+
id: z128.string().uuid()
|
10068
10071
|
}),
|
10069
10072
|
responses: {
|
10070
10073
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10113,7 +10116,7 @@ var accountContract = initContract48().router(
|
|
10113
10116
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10114
10117
|
responses: {
|
10115
10118
|
200: DefaultSuccessResponseSchema.extend({
|
10116
|
-
message:
|
10119
|
+
message: z128.string()
|
10117
10120
|
}),
|
10118
10121
|
...DefaultResponses
|
10119
10122
|
},
|
@@ -10128,7 +10131,7 @@ var accountContract = initContract48().router(
|
|
10128
10131
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10129
10132
|
responses: {
|
10130
10133
|
200: DefaultSuccessResponseSchema.extend({
|
10131
|
-
message:
|
10134
|
+
message: z128.string()
|
10132
10135
|
}),
|
10133
10136
|
...DefaultResponses
|
10134
10137
|
},
|
@@ -10157,20 +10160,20 @@ var accountContract = initContract48().router(
|
|
10157
10160
|
|
10158
10161
|
// src/mail/mail-server-contract.ts
|
10159
10162
|
import { initContract as initContract49 } from "@ts-rest/core";
|
10160
|
-
import
|
10163
|
+
import z130 from "zod";
|
10161
10164
|
|
10162
10165
|
// src/mail/schemas/servers-validation.schema.ts
|
10163
|
-
import
|
10164
|
-
var CreateMailServerSchema =
|
10165
|
-
name:
|
10166
|
-
smtpHost:
|
10167
|
-
smtpPort:
|
10168
|
-
smtpTlsPort:
|
10169
|
-
useTlsForSmtp:
|
10170
|
-
imapHost:
|
10171
|
-
imapPort:
|
10172
|
-
imapTlsPort:
|
10173
|
-
useTlsForImap:
|
10166
|
+
import z129 from "zod";
|
10167
|
+
var CreateMailServerSchema = z129.object({
|
10168
|
+
name: z129.string(),
|
10169
|
+
smtpHost: z129.string(),
|
10170
|
+
smtpPort: z129.number(),
|
10171
|
+
smtpTlsPort: z129.number(),
|
10172
|
+
useTlsForSmtp: z129.boolean(),
|
10173
|
+
imapHost: z129.string(),
|
10174
|
+
imapPort: z129.number(),
|
10175
|
+
imapTlsPort: z129.number(),
|
10176
|
+
useTlsForImap: z129.boolean()
|
10174
10177
|
});
|
10175
10178
|
|
10176
10179
|
// src/mail/mail-server-contract.ts
|
@@ -10193,11 +10196,11 @@ var serverContract = initContract49().router(
|
|
10193
10196
|
path: "/oauth2/apps",
|
10194
10197
|
responses: {
|
10195
10198
|
200: DefaultSuccessResponseSchema.extend({
|
10196
|
-
data:
|
10197
|
-
total:
|
10198
|
-
pages:
|
10199
|
-
page:
|
10200
|
-
apps:
|
10199
|
+
data: z130.object({
|
10200
|
+
total: z130.number(),
|
10201
|
+
pages: z130.number(),
|
10202
|
+
page: z130.number(),
|
10203
|
+
apps: z130.array(OAuth2AppSchema)
|
10201
10204
|
})
|
10202
10205
|
}),
|
10203
10206
|
...DefaultResponses
|
@@ -10207,8 +10210,8 @@ var serverContract = initContract49().router(
|
|
10207
10210
|
getById: {
|
10208
10211
|
method: "GET",
|
10209
10212
|
path: "/:id",
|
10210
|
-
pathParams:
|
10211
|
-
id:
|
10213
|
+
pathParams: z130.object({
|
10214
|
+
id: z130.string().uuid()
|
10212
10215
|
}),
|
10213
10216
|
responses: {
|
10214
10217
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10223,7 +10226,7 @@ var serverContract = initContract49().router(
|
|
10223
10226
|
path: "/",
|
10224
10227
|
responses: {
|
10225
10228
|
200: DefaultSuccessResponseSchema.extend({
|
10226
|
-
data:
|
10229
|
+
data: z130.array(MailServerSchema)
|
10227
10230
|
}),
|
10228
10231
|
...DefaultResponses
|
10229
10232
|
},
|
@@ -10232,8 +10235,8 @@ var serverContract = initContract49().router(
|
|
10232
10235
|
update: {
|
10233
10236
|
method: "PATCH",
|
10234
10237
|
path: "/:id",
|
10235
|
-
pathParams:
|
10236
|
-
id:
|
10238
|
+
pathParams: z130.object({
|
10239
|
+
id: z130.string().uuid()
|
10237
10240
|
}),
|
10238
10241
|
responses: {
|
10239
10242
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10247,8 +10250,8 @@ var serverContract = initContract49().router(
|
|
10247
10250
|
delete: {
|
10248
10251
|
method: "DELETE",
|
10249
10252
|
path: "/:id",
|
10250
|
-
pathParams:
|
10251
|
-
id:
|
10253
|
+
pathParams: z130.object({
|
10254
|
+
id: z130.string().uuid()
|
10252
10255
|
}),
|
10253
10256
|
responses: {
|
10254
10257
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10267,45 +10270,45 @@ var serverContract = initContract49().router(
|
|
10267
10270
|
|
10268
10271
|
// src/mail/message-contract.ts
|
10269
10272
|
import { initContract as initContract50 } from "@ts-rest/core";
|
10270
|
-
import
|
10273
|
+
import z132 from "zod";
|
10271
10274
|
|
10272
10275
|
// src/mail/schemas/message-validation.schema.ts
|
10273
|
-
import
|
10274
|
-
var MailParticipant2 =
|
10275
|
-
name:
|
10276
|
-
address:
|
10276
|
+
import z131 from "zod";
|
10277
|
+
var MailParticipant2 = z131.object({
|
10278
|
+
name: z131.string().optional(),
|
10279
|
+
address: z131.string().email()
|
10277
10280
|
});
|
10278
10281
|
var MessageContractsValidationsSchema = {
|
10279
10282
|
submit: {
|
10280
|
-
input:
|
10281
|
-
subject:
|
10282
|
-
text:
|
10283
|
-
html:
|
10283
|
+
input: z131.object({
|
10284
|
+
subject: z131.string(),
|
10285
|
+
text: z131.string(),
|
10286
|
+
html: z131.string(),
|
10284
10287
|
from: MailParticipant2,
|
10285
10288
|
to: MailParticipant2,
|
10286
|
-
cc:
|
10287
|
-
bcc:
|
10288
|
-
sendAt:
|
10289
|
-
reference:
|
10290
|
-
messageId:
|
10291
|
-
action:
|
10289
|
+
cc: z131.array(MailParticipant2).optional(),
|
10290
|
+
bcc: z131.array(MailParticipant2).optional(),
|
10291
|
+
sendAt: z131.string().optional(),
|
10292
|
+
reference: z131.object({
|
10293
|
+
messageId: z131.string(),
|
10294
|
+
action: z131.union([z131.literal("reply"), z131.literal("forward")])
|
10292
10295
|
}).optional(),
|
10293
|
-
attachments:
|
10294
|
-
|
10295
|
-
fileType:
|
10296
|
-
fileName:
|
10297
|
-
fileKey:
|
10298
|
-
fileSize:
|
10299
|
-
bucketName:
|
10300
|
-
presignedUrl:
|
10296
|
+
attachments: z131.array(
|
10297
|
+
z131.object({
|
10298
|
+
fileType: z131.string(),
|
10299
|
+
fileName: z131.string(),
|
10300
|
+
fileKey: z131.string(),
|
10301
|
+
fileSize: z131.number(),
|
10302
|
+
bucketName: z131.string(),
|
10303
|
+
presignedUrl: z131.string()
|
10301
10304
|
})
|
10302
10305
|
).optional()
|
10303
10306
|
}),
|
10304
|
-
output:
|
10305
|
-
response:
|
10306
|
-
messageId:
|
10307
|
-
sendAt:
|
10308
|
-
queueId:
|
10307
|
+
output: z131.object({
|
10308
|
+
response: z131.string(),
|
10309
|
+
messageId: z131.string(),
|
10310
|
+
sendAt: z131.string(),
|
10311
|
+
queueId: z131.string()
|
10309
10312
|
})
|
10310
10313
|
}
|
10311
10314
|
};
|
@@ -10334,8 +10337,8 @@ var messageContract = initContract50().router(
|
|
10334
10337
|
path: "/new_message_count",
|
10335
10338
|
responses: {
|
10336
10339
|
200: DefaultSuccessResponseSchema.extend({
|
10337
|
-
data:
|
10338
|
-
count:
|
10340
|
+
data: z132.object({
|
10341
|
+
count: z132.number()
|
10339
10342
|
})
|
10340
10343
|
}),
|
10341
10344
|
...DefaultResponses
|
@@ -10347,8 +10350,8 @@ var messageContract = initContract50().router(
|
|
10347
10350
|
getById: {
|
10348
10351
|
method: "GET",
|
10349
10352
|
path: "/:id",
|
10350
|
-
pathParams:
|
10351
|
-
id:
|
10353
|
+
pathParams: z132.object({
|
10354
|
+
id: z132.string()
|
10352
10355
|
}),
|
10353
10356
|
responses: {
|
10354
10357
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10363,8 +10366,8 @@ var messageContract = initContract50().router(
|
|
10363
10366
|
update: {
|
10364
10367
|
method: "PATCH",
|
10365
10368
|
path: "/:id",
|
10366
|
-
pathParams:
|
10367
|
-
id:
|
10369
|
+
pathParams: z132.object({
|
10370
|
+
id: z132.string()
|
10368
10371
|
}),
|
10369
10372
|
responses: {
|
10370
10373
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10380,8 +10383,8 @@ var messageContract = initContract50().router(
|
|
10380
10383
|
delete: {
|
10381
10384
|
method: "DELETE",
|
10382
10385
|
path: "/:id",
|
10383
|
-
pathParams:
|
10384
|
-
id:
|
10386
|
+
pathParams: z132.object({
|
10387
|
+
id: z132.string()
|
10385
10388
|
}),
|
10386
10389
|
responses: {
|
10387
10390
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10397,13 +10400,13 @@ var messageContract = initContract50().router(
|
|
10397
10400
|
cancelScheduledMessage: {
|
10398
10401
|
method: "DELETE",
|
10399
10402
|
path: "/scheduled_message/:id",
|
10400
|
-
pathParams:
|
10401
|
-
id:
|
10403
|
+
pathParams: z132.object({
|
10404
|
+
id: z132.string()
|
10402
10405
|
}),
|
10403
10406
|
responses: {
|
10404
10407
|
200: DefaultSuccessResponseSchema.extend({
|
10405
|
-
data:
|
10406
|
-
totalMessagesCount:
|
10408
|
+
data: z132.object({
|
10409
|
+
totalMessagesCount: z132.number()
|
10407
10410
|
})
|
10408
10411
|
}),
|
10409
10412
|
...DefaultResponses
|
@@ -10428,38 +10431,38 @@ var mailContract = initContract51().router({
|
|
10428
10431
|
|
10429
10432
|
// src/webchat/index.ts
|
10430
10433
|
import { initContract as initContract52 } from "@ts-rest/core";
|
10431
|
-
import
|
10434
|
+
import z135 from "zod";
|
10432
10435
|
|
10433
10436
|
// src/webchat/schema.ts
|
10434
|
-
import
|
10437
|
+
import z134 from "zod";
|
10435
10438
|
|
10436
10439
|
// src/webchat/validation.ts
|
10437
|
-
import
|
10440
|
+
import z133 from "zod";
|
10438
10441
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10439
10442
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10440
10443
|
return ChatwootChannelType3;
|
10441
10444
|
})(ChatwootChannelType2 || {});
|
10442
|
-
var WebChatChannelSchema =
|
10443
|
-
avatar:
|
10444
|
-
name:
|
10445
|
-
type:
|
10446
|
-
websiteName:
|
10447
|
-
welcomeTitle:
|
10448
|
-
websiteUrl:
|
10449
|
-
welcomeTagline:
|
10450
|
-
agentAwayMessage:
|
10451
|
-
widgetColor:
|
10445
|
+
var WebChatChannelSchema = z133.object({
|
10446
|
+
avatar: z133.string().optional(),
|
10447
|
+
name: z133.string(),
|
10448
|
+
type: z133.nativeEnum(ChatwootChannelType2),
|
10449
|
+
websiteName: z133.string(),
|
10450
|
+
welcomeTitle: z133.string(),
|
10451
|
+
websiteUrl: z133.string().url(),
|
10452
|
+
welcomeTagline: z133.string().optional(),
|
10453
|
+
agentAwayMessage: z133.string().optional(),
|
10454
|
+
widgetColor: z133.string().optional()
|
10452
10455
|
});
|
10453
10456
|
|
10454
10457
|
// src/webchat/schema.ts
|
10455
|
-
var ConnectWebChatChannelSchema =
|
10456
|
-
name:
|
10457
|
-
actor:
|
10458
|
-
id:
|
10459
|
-
name:
|
10460
|
-
email:
|
10461
|
-
address:
|
10462
|
-
phone:
|
10458
|
+
var ConnectWebChatChannelSchema = z134.object({
|
10459
|
+
name: z134.string(),
|
10460
|
+
actor: z134.object({
|
10461
|
+
id: z134.string().uuid(),
|
10462
|
+
name: z134.string(),
|
10463
|
+
email: z134.string().email(),
|
10464
|
+
address: z134.string().nullable(),
|
10465
|
+
phone: z134.string().nullable()
|
10463
10466
|
}),
|
10464
10467
|
channel: WebChatChannelSchema
|
10465
10468
|
});
|
@@ -10493,8 +10496,8 @@ var platformWebchatContract = initContract52().router(
|
|
10493
10496
|
disconnectToService: {
|
10494
10497
|
method: "POST",
|
10495
10498
|
path: "/disconnect",
|
10496
|
-
body:
|
10497
|
-
id:
|
10499
|
+
body: z135.object({
|
10500
|
+
id: z135.string().uuid()
|
10498
10501
|
}),
|
10499
10502
|
responses: {
|
10500
10503
|
200: ChannelServiceResponseSchema,
|
@@ -10505,8 +10508,8 @@ var platformWebchatContract = initContract52().router(
|
|
10505
10508
|
reconnect: {
|
10506
10509
|
method: "POST",
|
10507
10510
|
path: "/reconnect/:channelId",
|
10508
|
-
pathParams:
|
10509
|
-
channelId:
|
10511
|
+
pathParams: z135.object({
|
10512
|
+
channelId: z135.string().uuid()
|
10510
10513
|
}),
|
10511
10514
|
body: null,
|
10512
10515
|
responses: {
|
@@ -10518,8 +10521,8 @@ var platformWebchatContract = initContract52().router(
|
|
10518
10521
|
delete: {
|
10519
10522
|
method: "DELETE",
|
10520
10523
|
path: "/delete/:channelId",
|
10521
|
-
pathParams:
|
10522
|
-
channelId:
|
10524
|
+
pathParams: z135.object({
|
10525
|
+
channelId: z135.string().uuid()
|
10523
10526
|
}),
|
10524
10527
|
body: null,
|
10525
10528
|
responses: {
|
@@ -10536,18 +10539,18 @@ var platformWebchatContract = initContract52().router(
|
|
10536
10539
|
|
10537
10540
|
// src/hold-label/index.ts
|
10538
10541
|
import { initContract as initContract53 } from "@ts-rest/core";
|
10539
|
-
import
|
10542
|
+
import z137 from "zod";
|
10540
10543
|
|
10541
10544
|
// src/hold-label/validation.ts
|
10542
|
-
import
|
10543
|
-
var UpdatePositionSchema2 =
|
10544
|
-
holdLabels:
|
10545
|
-
|
10545
|
+
import z136 from "zod";
|
10546
|
+
var UpdatePositionSchema2 = z136.object({
|
10547
|
+
holdLabels: z136.array(
|
10548
|
+
z136.object({ id: z136.string().uuid(), position: z136.number() })
|
10546
10549
|
)
|
10547
10550
|
});
|
10548
|
-
var HoldRoomSchema =
|
10549
|
-
roomId:
|
10550
|
-
holdLabelId:
|
10551
|
+
var HoldRoomSchema = z136.object({
|
10552
|
+
roomId: z136.string().uuid(),
|
10553
|
+
holdLabelId: z136.string().uuid()
|
10551
10554
|
});
|
10552
10555
|
|
10553
10556
|
// src/hold-label/index.ts
|
@@ -10556,7 +10559,7 @@ var holdLabelContract = initContract53().router(
|
|
10556
10559
|
createHoldLabel: {
|
10557
10560
|
method: "POST",
|
10558
10561
|
path: "/",
|
10559
|
-
body:
|
10562
|
+
body: z137.object({ name: z137.string() }),
|
10560
10563
|
responses: {
|
10561
10564
|
201: DefaultSuccessResponseSchema.extend({
|
10562
10565
|
holdLabel: HoldLabelSchema
|
@@ -10568,7 +10571,7 @@ var holdLabelContract = initContract53().router(
|
|
10568
10571
|
path: "/",
|
10569
10572
|
responses: {
|
10570
10573
|
200: DefaultSuccessResponseSchema.extend({
|
10571
|
-
holdLabels:
|
10574
|
+
holdLabels: z137.array(HoldLabelSchema)
|
10572
10575
|
})
|
10573
10576
|
}
|
10574
10577
|
},
|
@@ -10586,8 +10589,8 @@ var holdLabelContract = initContract53().router(
|
|
10586
10589
|
updateHoldLabel: {
|
10587
10590
|
method: "PATCH",
|
10588
10591
|
path: "/:id",
|
10589
|
-
pathParams:
|
10590
|
-
body:
|
10592
|
+
pathParams: z137.object({ id: z137.string().uuid() }),
|
10593
|
+
body: z137.object({ name: z137.string() }),
|
10591
10594
|
responses: {
|
10592
10595
|
200: DefaultSuccessResponseSchema.extend({
|
10593
10596
|
holdLabel: HoldLabelSchema
|
@@ -10597,7 +10600,7 @@ var holdLabelContract = initContract53().router(
|
|
10597
10600
|
deleteHoldLabel: {
|
10598
10601
|
method: "DELETE",
|
10599
10602
|
path: "/:id",
|
10600
|
-
pathParams:
|
10603
|
+
pathParams: z137.object({ id: z137.string().uuid() }),
|
10601
10604
|
body: null,
|
10602
10605
|
responses: {
|
10603
10606
|
200: DefaultSuccessResponseSchema
|
@@ -10608,10 +10611,10 @@ var holdLabelContract = initContract53().router(
|
|
10608
10611
|
path: "/auto-unhold",
|
10609
10612
|
responses: {
|
10610
10613
|
200: DefaultSuccessResponseSchema.extend({
|
10611
|
-
autoUnhold:
|
10612
|
-
resumeLabel:
|
10613
|
-
show:
|
10614
|
-
name:
|
10614
|
+
autoUnhold: z137.boolean(),
|
10615
|
+
resumeLabel: z137.object({
|
10616
|
+
show: z137.boolean(),
|
10617
|
+
name: z137.string()
|
10615
10618
|
})
|
10616
10619
|
})
|
10617
10620
|
}
|
@@ -10619,19 +10622,19 @@ var holdLabelContract = initContract53().router(
|
|
10619
10622
|
updateAutoUnhold: {
|
10620
10623
|
method: "POST",
|
10621
10624
|
path: "/auto-unhold",
|
10622
|
-
body:
|
10623
|
-
autoUnhold:
|
10624
|
-
resumeLabel:
|
10625
|
-
show:
|
10626
|
-
name:
|
10625
|
+
body: z137.object({
|
10626
|
+
autoUnhold: z137.boolean().optional(),
|
10627
|
+
resumeLabel: z137.object({
|
10628
|
+
show: z137.boolean().optional(),
|
10629
|
+
name: z137.string().optional()
|
10627
10630
|
}).optional()
|
10628
10631
|
}),
|
10629
10632
|
responses: {
|
10630
10633
|
200: DefaultSuccessResponseSchema.extend({
|
10631
|
-
autoUnhold:
|
10632
|
-
resumeLabel:
|
10633
|
-
show:
|
10634
|
-
name:
|
10634
|
+
autoUnhold: z137.boolean(),
|
10635
|
+
resumeLabel: z137.object({
|
10636
|
+
show: z137.boolean(),
|
10637
|
+
name: z137.string()
|
10635
10638
|
})
|
10636
10639
|
})
|
10637
10640
|
}
|
@@ -10639,10 +10642,10 @@ var holdLabelContract = initContract53().router(
|
|
10639
10642
|
getHoldLogs: {
|
10640
10643
|
method: "GET",
|
10641
10644
|
path: "/hold-logs",
|
10642
|
-
query:
|
10645
|
+
query: z137.object({ cxLogId: z137.string().uuid() }),
|
10643
10646
|
responses: {
|
10644
|
-
200:
|
10645
|
-
holdLogs:
|
10647
|
+
200: z137.object({
|
10648
|
+
holdLogs: z137.array(FormattedHoldLogSchema)
|
10646
10649
|
})
|
10647
10650
|
}
|
10648
10651
|
},
|
@@ -10659,7 +10662,7 @@ var holdLabelContract = initContract53().router(
|
|
10659
10662
|
unholdRoom: {
|
10660
10663
|
method: "POST",
|
10661
10664
|
path: "/unhold-room",
|
10662
|
-
body:
|
10665
|
+
body: z137.object({ roomId: z137.string().uuid() }),
|
10663
10666
|
responses: {
|
10664
10667
|
200: DefaultSuccessResponseSchema.extend({
|
10665
10668
|
holdLog: HoldLogSchema.optional()
|
@@ -10672,89 +10675,89 @@ var holdLabelContract = initContract53().router(
|
|
10672
10675
|
|
10673
10676
|
// src/subscription/index.ts
|
10674
10677
|
import { initContract as initContract54 } from "@ts-rest/core";
|
10675
|
-
import { z as
|
10678
|
+
import { z as z140 } from "zod";
|
10676
10679
|
|
10677
10680
|
// src/subscription/schema.ts
|
10678
|
-
import
|
10681
|
+
import z138 from "zod";
|
10679
10682
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10680
|
-
priceId:
|
10681
|
-
name:
|
10682
|
-
perUnit:
|
10683
|
-
price:
|
10684
|
-
currency:
|
10683
|
+
priceId: z138.string(),
|
10684
|
+
name: z138.string().nullable(),
|
10685
|
+
perUnit: z138.number(),
|
10686
|
+
price: z138.number(),
|
10687
|
+
currency: z138.string().nullable()
|
10685
10688
|
});
|
10686
10689
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10687
|
-
provider:
|
10688
|
-
productId:
|
10689
|
-
name:
|
10690
|
-
type:
|
10691
|
-
omnichannel:
|
10692
|
-
usageType:
|
10690
|
+
provider: z138.string(),
|
10691
|
+
productId: z138.string(),
|
10692
|
+
name: z138.string(),
|
10693
|
+
type: z138.string(),
|
10694
|
+
omnichannel: z138.string(),
|
10695
|
+
usageType: z138.string().nullable(),
|
10693
10696
|
productPrice: ProductPriceSchema
|
10694
10697
|
});
|
10695
10698
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10696
|
-
includedQuantity:
|
10699
|
+
includedQuantity: z138.number(),
|
10697
10700
|
product: ProductWithoutRelatedSchema
|
10698
10701
|
});
|
10699
10702
|
var ProductSchema = DefaultEntitySchema.extend({
|
10700
|
-
provider:
|
10701
|
-
productId:
|
10702
|
-
name:
|
10703
|
-
type:
|
10704
|
-
omnichannel:
|
10705
|
-
usageType:
|
10703
|
+
provider: z138.string(),
|
10704
|
+
productId: z138.string(),
|
10705
|
+
name: z138.string(),
|
10706
|
+
type: z138.string(),
|
10707
|
+
omnichannel: z138.string(),
|
10708
|
+
usageType: z138.string().nullable(),
|
10706
10709
|
productPrice: ProductPriceSchema,
|
10707
|
-
relatedProducts:
|
10710
|
+
relatedProducts: z138.array(RelatedProductSchema)
|
10708
10711
|
});
|
10709
10712
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10710
|
-
provider:
|
10711
|
-
customerId:
|
10712
|
-
email:
|
10713
|
-
name:
|
10714
|
-
balance:
|
10713
|
+
provider: z138.string(),
|
10714
|
+
customerId: z138.string(),
|
10715
|
+
email: z138.string(),
|
10716
|
+
name: z138.string(),
|
10717
|
+
balance: z138.number()
|
10715
10718
|
});
|
10716
10719
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10717
|
-
limit:
|
10718
|
-
subscriptionItemId:
|
10719
|
-
usage:
|
10720
|
+
limit: z138.number(),
|
10721
|
+
subscriptionItemId: z138.string(),
|
10722
|
+
usage: z138.number().nullable(),
|
10720
10723
|
product: ProductSchema
|
10721
10724
|
});
|
10722
10725
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10723
|
-
provider:
|
10724
|
-
type:
|
10725
|
-
subscriptionId:
|
10726
|
-
interval:
|
10727
|
-
quantity:
|
10728
|
-
amount:
|
10729
|
-
startAt:
|
10730
|
-
expireAt:
|
10731
|
-
status:
|
10732
|
-
name:
|
10733
|
-
subscriptionProducts:
|
10726
|
+
provider: z138.string(),
|
10727
|
+
type: z138.string(),
|
10728
|
+
subscriptionId: z138.string(),
|
10729
|
+
interval: z138.string(),
|
10730
|
+
quantity: z138.number(),
|
10731
|
+
amount: z138.number(),
|
10732
|
+
startAt: z138.date().nullable(),
|
10733
|
+
expireAt: z138.date(),
|
10734
|
+
status: z138.string(),
|
10735
|
+
name: z138.string().nullable(),
|
10736
|
+
subscriptionProducts: z138.array(SubscriptionProuctSchema),
|
10734
10737
|
productPrice: ProductPriceSchema,
|
10735
10738
|
product: ProductSchema
|
10736
10739
|
});
|
10737
10740
|
|
10738
10741
|
// src/subscription/validation.ts
|
10739
|
-
import { z as
|
10740
|
-
var GetAvailablePlanSchema =
|
10741
|
-
type:
|
10742
|
-
currency:
|
10743
|
-
});
|
10744
|
-
var UpdateSubscriptionSchema =
|
10745
|
-
planProductId:
|
10746
|
-
planProductPriceId:
|
10747
|
-
subscriptionId:
|
10748
|
-
subscriptionProducts:
|
10749
|
-
|
10750
|
-
productId:
|
10751
|
-
productPriceId:
|
10752
|
-
quantity:
|
10742
|
+
import { z as z139 } from "zod";
|
10743
|
+
var GetAvailablePlanSchema = z139.object({
|
10744
|
+
type: z139.string(),
|
10745
|
+
currency: z139.string()
|
10746
|
+
});
|
10747
|
+
var UpdateSubscriptionSchema = z139.object({
|
10748
|
+
planProductId: z139.string(),
|
10749
|
+
planProductPriceId: z139.string(),
|
10750
|
+
subscriptionId: z139.string(),
|
10751
|
+
subscriptionProducts: z139.array(
|
10752
|
+
z139.object({
|
10753
|
+
productId: z139.string(),
|
10754
|
+
productPriceId: z139.string(),
|
10755
|
+
quantity: z139.number()
|
10753
10756
|
})
|
10754
10757
|
)
|
10755
10758
|
});
|
10756
|
-
var TopUpBalanceSchema =
|
10757
|
-
quantity:
|
10759
|
+
var TopUpBalanceSchema = z139.object({
|
10760
|
+
quantity: z139.number()
|
10758
10761
|
});
|
10759
10762
|
|
10760
10763
|
// src/subscription/index.ts
|
@@ -10778,9 +10781,9 @@ var subscriptionContract = initContract54().router(
|
|
10778
10781
|
body: UpdateSubscriptionSchema,
|
10779
10782
|
responses: {
|
10780
10783
|
200: DefaultSuccessResponseSchema.extend({
|
10781
|
-
message:
|
10782
|
-
requireCheckout:
|
10783
|
-
checkoutUrl:
|
10784
|
+
message: z140.string(),
|
10785
|
+
requireCheckout: z140.boolean(),
|
10786
|
+
checkoutUrl: z140.string().nullable()
|
10784
10787
|
}),
|
10785
10788
|
402: DefaultErrorResponseSchema,
|
10786
10789
|
500: DefaultErrorResponseSchema
|
@@ -10792,7 +10795,7 @@ var subscriptionContract = initContract54().router(
|
|
10792
10795
|
body: TopUpBalanceSchema,
|
10793
10796
|
responses: {
|
10794
10797
|
200: DefaultSuccessResponseSchema.extend({
|
10795
|
-
checkoutUrl:
|
10798
|
+
checkoutUrl: z140.string()
|
10796
10799
|
}),
|
10797
10800
|
500: DefaultErrorResponseSchema
|
10798
10801
|
}
|
@@ -10803,7 +10806,7 @@ var subscriptionContract = initContract54().router(
|
|
10803
10806
|
query: GetAvailablePlanSchema,
|
10804
10807
|
responses: {
|
10805
10808
|
200: DefaultSuccessResponseSchema.extend({
|
10806
|
-
data:
|
10809
|
+
data: z140.array(ProductSchema)
|
10807
10810
|
}),
|
10808
10811
|
500: DefaultErrorResponseSchema
|
10809
10812
|
}
|
@@ -10826,19 +10829,19 @@ var subscriptionContract = initContract54().router(
|
|
10826
10829
|
|
10827
10830
|
// src/cx-intelligence/index.ts
|
10828
10831
|
import { initContract as initContract55 } from "@ts-rest/core";
|
10829
|
-
import
|
10832
|
+
import z141 from "zod";
|
10830
10833
|
var cxIntelligenceContract = initContract55().router(
|
10831
10834
|
{
|
10832
10835
|
toggle: {
|
10833
10836
|
method: "POST",
|
10834
10837
|
path: "/toggle",
|
10835
10838
|
headers: DefaultHeaderSchema,
|
10836
|
-
body:
|
10837
|
-
enabled:
|
10839
|
+
body: z141.object({
|
10840
|
+
enabled: z141.union([z141.literal(true), z141.literal(false)])
|
10838
10841
|
}),
|
10839
10842
|
responses: {
|
10840
10843
|
200: DefaultSuccessResponseSchema.extend({
|
10841
|
-
message:
|
10844
|
+
message: z141.string()
|
10842
10845
|
}),
|
10843
10846
|
500: DefaultErrorResponseSchema
|
10844
10847
|
},
|
@@ -10848,15 +10851,15 @@ var cxIntelligenceContract = initContract55().router(
|
|
10848
10851
|
method: "POST",
|
10849
10852
|
path: "/cx-logs/:id/transcribe",
|
10850
10853
|
headers: DefaultHeaderSchema,
|
10851
|
-
pathParams:
|
10852
|
-
id:
|
10854
|
+
pathParams: z141.object({
|
10855
|
+
id: z141.string().uuid()
|
10853
10856
|
}),
|
10854
|
-
body:
|
10855
|
-
fileUrl:
|
10857
|
+
body: z141.object({
|
10858
|
+
fileUrl: z141.string()
|
10856
10859
|
}),
|
10857
10860
|
responses: {
|
10858
10861
|
200: DefaultSuccessResponseSchema.extend({
|
10859
|
-
message:
|
10862
|
+
message: z141.string()
|
10860
10863
|
}),
|
10861
10864
|
403: DefaultErrorResponseSchema,
|
10862
10865
|
404: DefaultErrorResponseSchema,
|
@@ -10876,13 +10879,13 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10876
10879
|
headers: DefaultHeaderSchema,
|
10877
10880
|
responses: {
|
10878
10881
|
200: DefaultSuccessResponseSchema.extend({
|
10879
|
-
message:
|
10880
|
-
status:
|
10882
|
+
message: z141.string(),
|
10883
|
+
status: z141.boolean()
|
10881
10884
|
}),
|
10882
|
-
422:
|
10883
|
-
requestId:
|
10884
|
-
message:
|
10885
|
-
status:
|
10885
|
+
422: z141.object({
|
10886
|
+
requestId: z141.string(),
|
10887
|
+
message: z141.string(),
|
10888
|
+
status: z141.boolean()
|
10886
10889
|
}),
|
10887
10890
|
500: DefaultErrorResponseSchema
|
10888
10891
|
},
|
@@ -10894,20 +10897,20 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
10894
10897
|
|
10895
10898
|
// src/export/index.ts
|
10896
10899
|
import { initContract as initContract56 } from "@ts-rest/core";
|
10897
|
-
import
|
10900
|
+
import z142 from "zod";
|
10898
10901
|
var exportContract = initContract56().router(
|
10899
10902
|
{
|
10900
10903
|
notifyExport: {
|
10901
10904
|
method: "POST",
|
10902
10905
|
path: "notify",
|
10903
|
-
body:
|
10904
|
-
userId:
|
10905
|
-
module:
|
10906
|
-
fileUrl:
|
10906
|
+
body: z142.object({
|
10907
|
+
userId: z142.string().uuid(),
|
10908
|
+
module: z142.string(),
|
10909
|
+
fileUrl: z142.string()
|
10907
10910
|
}),
|
10908
10911
|
responses: {
|
10909
10912
|
200: DefaultSuccessResponseSchema.extend({
|
10910
|
-
success:
|
10913
|
+
success: z142.boolean()
|
10911
10914
|
}),
|
10912
10915
|
500: DefaultErrorResponseSchema
|
10913
10916
|
}
|
@@ -10990,7 +10993,6 @@ export {
|
|
10990
10993
|
userContract,
|
10991
10994
|
userNotificationContract,
|
10992
10995
|
userPresenceStatusLogContract,
|
10993
|
-
widgetContract,
|
10994
10996
|
widgetSettingContract,
|
10995
10997
|
workflowContract,
|
10996
10998
|
wrapUpFormContract
|