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