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