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