@kl1/contracts 1.1.44-uat → 1.1.46-uat
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/index.js +439 -352
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +438 -352
- package/dist/index.mjs.map +1 -1
- package/dist/src/botpress/index.d.ts +14 -14
- package/dist/src/botpress/validation.d.ts +14 -14
- package/dist/src/botpress/validation.d.ts.map +1 -1
- package/dist/src/contract.d.ts +502 -162
- package/dist/src/contract.d.ts.map +1 -1
- package/dist/src/cx-log/index.d.ts +3 -3
- package/dist/src/dashboard/index.d.ts +156 -146
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/schema.d.ts +207 -207
- package/dist/src/dashboard/validation.d.ts +10 -0
- package/dist/src/dashboard/validation.d.ts.map +1 -1
- package/dist/src/export/index.d.ts +43 -0
- package/dist/src/export/index.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/subscription/index.d.ts +332 -0
- package/dist/src/subscription/index.d.ts.map +1 -0
- package/dist/src/subscription/schema.d.ts +290 -0
- package/dist/src/subscription/schema.d.ts.map +1 -0
- package/dist/src/subscription/validation.d.ts +27 -0
- package/dist/src/subscription/validation.d.ts.map +1 -0
- package/dist/src/telephony-cdr/index.d.ts +3 -0
- package/dist/src/telephony-cdr/index.d.ts.map +1 -1
- package/dist/src/telephony-cdr/validation.d.ts +3 -0
- package/dist/src/telephony-cdr/validation.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// src/contract.ts
|
2
|
-
import { initContract as
|
2
|
+
import { initContract as initContract43 } from "@ts-rest/core";
|
3
3
|
|
4
4
|
// src/activity-log/index.ts
|
5
5
|
import { initContract } from "@ts-rest/core";
|
@@ -670,7 +670,7 @@ var SendBotpressMessageSchema = z16.object({
|
|
670
670
|
id: z16.string(),
|
671
671
|
name: z16.string()
|
672
672
|
})
|
673
|
-
).nullable()
|
673
|
+
).nullable().optional()
|
674
674
|
})
|
675
675
|
})
|
676
676
|
});
|
@@ -3069,7 +3069,7 @@ var cxLogContract = initContract10().router({
|
|
3069
3069
|
},
|
3070
3070
|
body: z45.object({
|
3071
3071
|
roomId: z45.string().uuid(),
|
3072
|
-
slaStatus: z45.enum(["meet", "unmeet"])
|
3072
|
+
slaStatus: z45.enum(["meet", "unmeet", "-"])
|
3073
3073
|
})
|
3074
3074
|
}
|
3075
3075
|
});
|
@@ -3082,6 +3082,9 @@ import z46 from "zod";
|
|
3082
3082
|
var GetDashboardQueryParamsSchema = z46.object({
|
3083
3083
|
selectedDate: z46.string()
|
3084
3084
|
});
|
3085
|
+
var GetMessageChannelQueryParamsSchema = GetDashboardQueryParamsSchema.extend({
|
3086
|
+
time: z46.enum(["byDay", "byMonth"])
|
3087
|
+
});
|
3085
3088
|
var GetDashboardQueryDetailParamsSchema = GetDashboardQueryParamsSchema.merge(
|
3086
3089
|
z46.object({
|
3087
3090
|
agentId: z46.string().uuid().optional()
|
@@ -3155,28 +3158,28 @@ var DashboardDataWithCallSchema = DashboardDataSchema.extend({
|
|
3155
3158
|
callLogCountByResultData: z47.array(CallLogCountByResultDaumSchema).optional()
|
3156
3159
|
});
|
3157
3160
|
var TotalTelephonyQueueCallCountListSchema = z47.object({
|
3158
|
-
totalQueueCall: z47.
|
3159
|
-
totalMissedQueueCall: z47.
|
3160
|
-
totalAnsweredQueueCall: z47.
|
3161
|
-
totalAbandonedQueueCall: z47.
|
3162
|
-
totalAverageRingDuration: z47.
|
3163
|
-
totalAverageTalkDuration: z47.
|
3164
|
-
totalAverageCallDuration: z47.
|
3165
|
-
totalSla: z47.
|
3161
|
+
totalQueueCall: z47.number(),
|
3162
|
+
totalMissedQueueCall: z47.number(),
|
3163
|
+
totalAnsweredQueueCall: z47.number(),
|
3164
|
+
totalAbandonedQueueCall: z47.number(),
|
3165
|
+
totalAverageRingDuration: z47.number(),
|
3166
|
+
totalAverageTalkDuration: z47.number(),
|
3167
|
+
totalAverageCallDuration: z47.number(),
|
3168
|
+
totalSla: z47.number(),
|
3166
3169
|
totalMissedCallPercent: z47.string(),
|
3167
|
-
totalMaximumRingDuration: z47.
|
3170
|
+
totalMaximumRingDuration: z47.number()
|
3168
3171
|
});
|
3169
3172
|
var TelephonyQueueCallCountListSchema = z47.object({
|
3170
|
-
totalQueueCall: z47.
|
3171
|
-
totalMissedQueueCall: z47.
|
3172
|
-
totalAnsweredQueueCall: z47.
|
3173
|
-
totalAbandonedQueueCall: z47.
|
3174
|
-
totalAverageTalkDuration: z47.
|
3175
|
-
totalAverageCallDuration: z47.
|
3176
|
-
totalAverageRingDuration: z47.
|
3177
|
-
totalSla: z47.
|
3173
|
+
totalQueueCall: z47.number(),
|
3174
|
+
totalMissedQueueCall: z47.number(),
|
3175
|
+
totalAnsweredQueueCall: z47.number(),
|
3176
|
+
totalAbandonedQueueCall: z47.number(),
|
3177
|
+
totalAverageTalkDuration: z47.number(),
|
3178
|
+
totalAverageCallDuration: z47.number(),
|
3179
|
+
totalAverageRingDuration: z47.number(),
|
3180
|
+
totalSla: z47.number(),
|
3178
3181
|
totalMissedCallPercent: z47.string(),
|
3179
|
-
totalMaximumRingDuration: z47.
|
3182
|
+
totalMaximumRingDuration: z47.number()
|
3180
3183
|
});
|
3181
3184
|
var TelephonyQueueCallCountListByQueueNumberSchema = z47.object({
|
3182
3185
|
queueNumber: z47.string(),
|
@@ -3396,9 +3399,9 @@ var dashboardContract = initContract11().router(
|
|
3396
3399
|
getMessageChannelData: {
|
3397
3400
|
method: "GET",
|
3398
3401
|
path: "/message/channel",
|
3399
|
-
query: null,
|
3400
3402
|
headers: DefaultHeaderSchema,
|
3401
3403
|
summary: "Get message channel data",
|
3404
|
+
query: GetMessageChannelQueryParamsSchema,
|
3402
3405
|
responses: {
|
3403
3406
|
200: DefaultSuccessResponseSchema.extend({
|
3404
3407
|
messageCounts: MessageCountsByChannelObjSchema
|
@@ -5280,7 +5283,9 @@ var GetRecentTelephonyCdrSchema = DefaultQueryParamsSchema.extend({
|
|
5280
5283
|
var GetExportTelephonyCdrSchema = GetAllTelephonyCdrSchema.merge(
|
5281
5284
|
z78.object({
|
5282
5285
|
page: z78.coerce.number().positive().optional(),
|
5283
|
-
pageSize: z78.coerce.number().positive().optional()
|
5286
|
+
pageSize: z78.coerce.number().positive().optional(),
|
5287
|
+
// We use this export route for both CDR and Call Log.
|
5288
|
+
module: z78.union([z78.literal("cdrs"), z78.literal("call-logs")]).optional().default("cdrs")
|
5284
5289
|
})
|
5285
5290
|
);
|
5286
5291
|
var NullEmptyStringUndefined = ["", null, void 0];
|
@@ -7095,85 +7100,164 @@ var snippetContract = initContract37().router(
|
|
7095
7100
|
}
|
7096
7101
|
);
|
7097
7102
|
|
7098
|
-
// src/
|
7103
|
+
// src/subscription/index.ts
|
7099
7104
|
import { initContract as initContract38 } from "@ts-rest/core";
|
7105
|
+
import { z as z105 } from "zod";
|
7100
7106
|
|
7101
|
-
// src/
|
7107
|
+
// src/subscription/schema.ts
|
7102
7108
|
import z103 from "zod";
|
7103
|
-
var
|
7104
|
-
|
7105
|
-
|
7106
|
-
|
7109
|
+
var ProductSchema = DefaultEntitySchema.extend({
|
7110
|
+
provider: z103.string(),
|
7111
|
+
productId: z103.string(),
|
7112
|
+
name: z103.string(),
|
7113
|
+
type: z103.string(),
|
7114
|
+
omnichannel: z103.string(),
|
7115
|
+
usageType: z103.string().nullable()
|
7116
|
+
});
|
7117
|
+
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
7118
|
+
limit: z103.number(),
|
7119
|
+
subscriptionItemId: z103.string(),
|
7120
|
+
usage: z103.number().nullable(),
|
7121
|
+
product: ProductSchema
|
7122
|
+
});
|
7123
|
+
var SubscriptionSchema = DefaultEntitySchema.extend({
|
7124
|
+
provider: z103.string(),
|
7125
|
+
type: z103.string(),
|
7126
|
+
subscriptionId: z103.string(),
|
7127
|
+
interval: z103.string(),
|
7128
|
+
quantity: z103.number(),
|
7129
|
+
amount: z103.number(),
|
7130
|
+
startAt: z103.date().nullable(),
|
7131
|
+
expireAt: z103.date(),
|
7132
|
+
status: z103.string(),
|
7133
|
+
name: z103.string().nullable(),
|
7134
|
+
subscriptionProducts: z103.array(SubscriptionProuctSchema)
|
7135
|
+
});
|
7136
|
+
|
7137
|
+
// src/subscription/validation.ts
|
7138
|
+
import { z as z104 } from "zod";
|
7139
|
+
var UpdateSubscriptionSchema = z104.object({
|
7140
|
+
subscriptionId: z104.string(),
|
7141
|
+
subscriptionProducts: z104.array(
|
7142
|
+
z104.object({
|
7143
|
+
productId: z104.string(),
|
7144
|
+
quantity: z104.number()
|
7145
|
+
})
|
7146
|
+
)
|
7147
|
+
});
|
7148
|
+
|
7149
|
+
// src/subscription/index.ts
|
7150
|
+
var subscriptionContract = initContract38().router(
|
7151
|
+
{
|
7152
|
+
getSubscription: {
|
7153
|
+
method: "GET",
|
7154
|
+
path: "/",
|
7155
|
+
query: null,
|
7156
|
+
responses: {
|
7157
|
+
200: DefaultSuccessResponseSchema.extend({
|
7158
|
+
subscription: SubscriptionSchema
|
7159
|
+
}),
|
7160
|
+
500: DefaultErrorResponseSchema
|
7161
|
+
}
|
7162
|
+
},
|
7163
|
+
updateSubscription: {
|
7164
|
+
method: "PATCH",
|
7165
|
+
path: "/",
|
7166
|
+
body: UpdateSubscriptionSchema,
|
7167
|
+
responses: {
|
7168
|
+
200: DefaultSuccessResponseSchema.extend({
|
7169
|
+
message: z105.string(),
|
7170
|
+
requireCheckout: z105.boolean(),
|
7171
|
+
checkoutUrl: z105.string().nullable()
|
7172
|
+
}),
|
7173
|
+
500: DefaultErrorResponseSchema
|
7174
|
+
}
|
7175
|
+
}
|
7176
|
+
},
|
7177
|
+
{
|
7178
|
+
pathPrefix: "subscriptions"
|
7179
|
+
}
|
7180
|
+
);
|
7181
|
+
|
7182
|
+
// src/business-calendar/index.ts
|
7183
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
7184
|
+
|
7185
|
+
// src/business-calendar/validation.ts
|
7186
|
+
import z106 from "zod";
|
7187
|
+
var TimeSlotDataSchema = z106.any();
|
7188
|
+
var CreateBusinessHourSchema = z106.object({
|
7189
|
+
day: z106.string(),
|
7190
|
+
isEnabled: z106.boolean(),
|
7107
7191
|
timeSlots: TimeSlotDataSchema
|
7108
7192
|
}).array();
|
7109
|
-
var UpdateBusinessHourSchema =
|
7110
|
-
id:
|
7111
|
-
day:
|
7112
|
-
isEnabled:
|
7193
|
+
var UpdateBusinessHourSchema = z106.object({
|
7194
|
+
id: z106.string(),
|
7195
|
+
day: z106.string(),
|
7196
|
+
isEnabled: z106.boolean(),
|
7113
7197
|
timeSlots: TimeSlotDataSchema
|
7114
7198
|
}).array();
|
7115
|
-
var CreateHolidaySchema =
|
7116
|
-
name:
|
7117
|
-
date:
|
7118
|
-
isEnabled:
|
7199
|
+
var CreateHolidaySchema = z106.object({
|
7200
|
+
name: z106.string(),
|
7201
|
+
date: z106.string(),
|
7202
|
+
isEnabled: z106.boolean()
|
7119
7203
|
}).array();
|
7120
|
-
var UpdateHolidaySchema =
|
7121
|
-
id:
|
7122
|
-
name:
|
7123
|
-
date:
|
7124
|
-
isEnabled:
|
7204
|
+
var UpdateHolidaySchema = z106.object({
|
7205
|
+
id: z106.string().optional(),
|
7206
|
+
name: z106.string(),
|
7207
|
+
date: z106.string(),
|
7208
|
+
isEnabled: z106.boolean()
|
7125
7209
|
}).array();
|
7126
|
-
var CreateBusinessCalendarSchema =
|
7127
|
-
name:
|
7128
|
-
description:
|
7129
|
-
timeZone:
|
7130
|
-
isEnabled:
|
7131
|
-
channelIds:
|
7210
|
+
var CreateBusinessCalendarSchema = z106.object({
|
7211
|
+
name: z106.string(),
|
7212
|
+
description: z106.string().optional(),
|
7213
|
+
timeZone: z106.string(),
|
7214
|
+
isEnabled: z106.boolean(),
|
7215
|
+
channelIds: z106.string().array(),
|
7132
7216
|
businessHours: CreateBusinessHourSchema,
|
7133
7217
|
holidays: CreateHolidaySchema
|
7134
7218
|
});
|
7135
|
-
var UpdateBusinessCalendarSchema =
|
7136
|
-
id:
|
7137
|
-
name:
|
7138
|
-
description:
|
7139
|
-
timeZone:
|
7140
|
-
isEnabled:
|
7141
|
-
channelIds:
|
7219
|
+
var UpdateBusinessCalendarSchema = z106.object({
|
7220
|
+
id: z106.string(),
|
7221
|
+
name: z106.string(),
|
7222
|
+
description: z106.string().optional(),
|
7223
|
+
timeZone: z106.string(),
|
7224
|
+
isEnabled: z106.boolean(),
|
7225
|
+
channelIds: z106.string().array(),
|
7142
7226
|
businessHours: UpdateBusinessHourSchema,
|
7143
7227
|
holidays: UpdateHolidaySchema
|
7144
7228
|
});
|
7145
|
-
var DeleteBusinessCalendarSchema =
|
7146
|
-
id:
|
7229
|
+
var DeleteBusinessCalendarSchema = z106.object({
|
7230
|
+
id: z106.string()
|
7147
7231
|
});
|
7148
7232
|
|
7149
7233
|
// src/business-calendar/schema.ts
|
7150
|
-
import
|
7151
|
-
var TimeSlotDataSchema2 =
|
7234
|
+
import z107 from "zod";
|
7235
|
+
var TimeSlotDataSchema2 = z107.any();
|
7152
7236
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
7153
|
-
day:
|
7154
|
-
isEnabled:
|
7237
|
+
day: z107.string(),
|
7238
|
+
isEnabled: z107.boolean(),
|
7155
7239
|
timeSlots: TimeSlotDataSchema2
|
7156
7240
|
});
|
7157
7241
|
var HolidaySchema = DefaultEntitySchema.extend({
|
7158
|
-
name:
|
7159
|
-
date:
|
7160
|
-
isEnabled:
|
7161
|
-
isDefault:
|
7242
|
+
name: z107.string(),
|
7243
|
+
date: z107.string(),
|
7244
|
+
isEnabled: z107.boolean(),
|
7245
|
+
isDefault: z107.boolean()
|
7162
7246
|
});
|
7163
7247
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
7164
|
-
name:
|
7165
|
-
description:
|
7166
|
-
timeZone:
|
7167
|
-
isEnabled:
|
7168
|
-
isDefault:
|
7169
|
-
channelIds:
|
7248
|
+
name: z107.string(),
|
7249
|
+
description: z107.string().optional(),
|
7250
|
+
timeZone: z107.string(),
|
7251
|
+
isEnabled: z107.boolean(),
|
7252
|
+
isDefault: z107.boolean(),
|
7253
|
+
channelIds: z107.string().array(),
|
7170
7254
|
businessHours: BusinessHourSchema.array(),
|
7171
7255
|
holidays: HolidaySchema.array()
|
7172
7256
|
});
|
7173
7257
|
|
7174
7258
|
// src/business-calendar/index.ts
|
7175
|
-
import
|
7176
|
-
var businessCalendarContract =
|
7259
|
+
import z108 from "zod";
|
7260
|
+
var businessCalendarContract = initContract39().router({
|
7177
7261
|
createBusinessCalendar: {
|
7178
7262
|
method: "POST",
|
7179
7263
|
path: "business-calendar",
|
@@ -7198,7 +7282,7 @@ var businessCalendarContract = initContract38().router({
|
|
7198
7282
|
updateBusinessCalendar: {
|
7199
7283
|
method: "POST",
|
7200
7284
|
path: "business-calendars/:id",
|
7201
|
-
pathParams:
|
7285
|
+
pathParams: z108.object({ id: z108.string() }),
|
7202
7286
|
body: UpdateBusinessCalendarSchema,
|
7203
7287
|
responses: {
|
7204
7288
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -7210,7 +7294,7 @@ var businessCalendarContract = initContract38().router({
|
|
7210
7294
|
deleteBusinessCalendar: {
|
7211
7295
|
method: "DELETE",
|
7212
7296
|
path: "business-calendars/:id",
|
7213
|
-
pathParams:
|
7297
|
+
pathParams: z108.object({ id: z108.string() }),
|
7214
7298
|
body: null,
|
7215
7299
|
responses: {
|
7216
7300
|
200: DefaultSuccessResponseSchema,
|
@@ -7220,169 +7304,169 @@ var businessCalendarContract = initContract38().router({
|
|
7220
7304
|
});
|
7221
7305
|
|
7222
7306
|
// src/public-api/index.ts
|
7223
|
-
import { initContract as
|
7224
|
-
import
|
7307
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
7308
|
+
import z111 from "zod";
|
7225
7309
|
|
7226
7310
|
// src/public-api/validation.ts
|
7227
|
-
import
|
7311
|
+
import z110 from "zod";
|
7228
7312
|
|
7229
7313
|
// src/public-api/schema.ts
|
7230
|
-
import
|
7231
|
-
var ContactPhonesSchema2 =
|
7232
|
-
id:
|
7233
|
-
createdAt:
|
7234
|
-
updatedAt:
|
7235
|
-
deletedAt:
|
7236
|
-
phone:
|
7237
|
-
isPrimary:
|
7238
|
-
});
|
7239
|
-
var ContactEmailsSchema2 =
|
7240
|
-
id:
|
7241
|
-
createdAt:
|
7242
|
-
updatedAt:
|
7243
|
-
deletedAt:
|
7244
|
-
email:
|
7245
|
-
isPrimary:
|
7246
|
-
});
|
7247
|
-
var ContactCustomFieldSchema2 =
|
7248
|
-
id:
|
7249
|
-
createdAt:
|
7250
|
-
updatedAt:
|
7251
|
-
deletedAt:
|
7252
|
-
textValue:
|
7253
|
-
booleanValue:
|
7254
|
-
numberValue:
|
7255
|
-
dateValue:
|
7314
|
+
import z109 from "zod";
|
7315
|
+
var ContactPhonesSchema2 = z109.object({
|
7316
|
+
id: z109.string().uuid(),
|
7317
|
+
createdAt: z109.date(),
|
7318
|
+
updatedAt: z109.date(),
|
7319
|
+
deletedAt: z109.date().nullable(),
|
7320
|
+
phone: z109.string(),
|
7321
|
+
isPrimary: z109.boolean()
|
7322
|
+
});
|
7323
|
+
var ContactEmailsSchema2 = z109.object({
|
7324
|
+
id: z109.string().uuid(),
|
7325
|
+
createdAt: z109.date(),
|
7326
|
+
updatedAt: z109.date(),
|
7327
|
+
deletedAt: z109.date().nullable(),
|
7328
|
+
email: z109.string(),
|
7329
|
+
isPrimary: z109.boolean()
|
7330
|
+
});
|
7331
|
+
var ContactCustomFieldSchema2 = z109.object({
|
7332
|
+
id: z109.string().uuid(),
|
7333
|
+
createdAt: z109.date(),
|
7334
|
+
updatedAt: z109.date(),
|
7335
|
+
deletedAt: z109.date().nullable(),
|
7336
|
+
textValue: z109.string().nullable(),
|
7337
|
+
booleanValue: z109.boolean().nullable(),
|
7338
|
+
numberValue: z109.number().nullable(),
|
7339
|
+
dateValue: z109.date().nullable(),
|
7256
7340
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
7257
|
-
uploads:
|
7258
|
-
});
|
7259
|
-
var ContactEntityTypesSchema2 =
|
7260
|
-
id:
|
7261
|
-
createdAt:
|
7262
|
-
updatedAt:
|
7263
|
-
deletedAt:
|
7264
|
-
entity:
|
7265
|
-
description:
|
7266
|
-
});
|
7267
|
-
var ContactActivitySchema2 =
|
7268
|
-
id:
|
7269
|
-
createdAt:
|
7270
|
-
updatedAt:
|
7271
|
-
deletedAt:
|
7272
|
-
entityId:
|
7273
|
-
description:
|
7341
|
+
uploads: z109.array(UploadSchema)
|
7342
|
+
});
|
7343
|
+
var ContactEntityTypesSchema2 = z109.object({
|
7344
|
+
id: z109.string().uuid(),
|
7345
|
+
createdAt: z109.date(),
|
7346
|
+
updatedAt: z109.date(),
|
7347
|
+
deletedAt: z109.date().nullable(),
|
7348
|
+
entity: z109.string(),
|
7349
|
+
description: z109.string().nullable()
|
7350
|
+
});
|
7351
|
+
var ContactActivitySchema2 = z109.object({
|
7352
|
+
id: z109.string().uuid(),
|
7353
|
+
createdAt: z109.date(),
|
7354
|
+
updatedAt: z109.date(),
|
7355
|
+
deletedAt: z109.date().nullable(),
|
7356
|
+
entityId: z109.string(),
|
7357
|
+
description: z109.string(),
|
7274
7358
|
entityType: ContactEntityTypesSchema2
|
7275
7359
|
});
|
7276
|
-
var ContactSchema3 =
|
7277
|
-
id:
|
7278
|
-
createdAt:
|
7279
|
-
updatedAt:
|
7280
|
-
deletedAt:
|
7281
|
-
name:
|
7282
|
-
address:
|
7283
|
-
channel:
|
7284
|
-
notes:
|
7285
|
-
contactProfile:
|
7286
|
-
socialProfileUrl:
|
7287
|
-
tags:
|
7360
|
+
var ContactSchema3 = z109.object({
|
7361
|
+
id: z109.string().uuid(),
|
7362
|
+
createdAt: z109.date(),
|
7363
|
+
updatedAt: z109.date(),
|
7364
|
+
deletedAt: z109.date().nullable(),
|
7365
|
+
name: z109.string(),
|
7366
|
+
address: z109.string().nullable(),
|
7367
|
+
channel: z109.string().nullable(),
|
7368
|
+
notes: z109.string().nullable(),
|
7369
|
+
contactProfile: z109.string().nullable(),
|
7370
|
+
socialProfileUrl: z109.string().nullable(),
|
7371
|
+
tags: z109.array(TagSchema),
|
7288
7372
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
7289
|
-
customFields:
|
7290
|
-
contactEmails:
|
7291
|
-
contactPhones:
|
7292
|
-
activityLogs:
|
7373
|
+
customFields: z109.array(ContactCustomFieldSchema2),
|
7374
|
+
contactEmails: z109.array(ContactEmailsSchema2),
|
7375
|
+
contactPhones: z109.array(ContactPhonesSchema2),
|
7376
|
+
activityLogs: z109.array(ContactActivitySchema2).optional()
|
7293
7377
|
});
|
7294
7378
|
|
7295
7379
|
// src/public-api/validation.ts
|
7296
7380
|
var ContactContractValidationSchema2 = {
|
7297
7381
|
create: {
|
7298
|
-
request:
|
7299
|
-
name:
|
7300
|
-
email:
|
7301
|
-
|
7302
|
-
email:
|
7303
|
-
isPrimary:
|
7382
|
+
request: z110.object({
|
7383
|
+
name: z110.string(),
|
7384
|
+
email: z110.array(
|
7385
|
+
z110.object({
|
7386
|
+
email: z110.string().email(),
|
7387
|
+
isPrimary: z110.boolean()
|
7304
7388
|
})
|
7305
7389
|
).optional(),
|
7306
|
-
channel:
|
7307
|
-
address:
|
7308
|
-
phone:
|
7309
|
-
|
7310
|
-
phone:
|
7311
|
-
isPrimary:
|
7390
|
+
channel: z110.string().optional(),
|
7391
|
+
address: z110.string().optional(),
|
7392
|
+
phone: z110.array(
|
7393
|
+
z110.object({
|
7394
|
+
phone: z110.string(),
|
7395
|
+
isPrimary: z110.boolean()
|
7312
7396
|
})
|
7313
7397
|
).optional(),
|
7314
|
-
notes:
|
7315
|
-
tags:
|
7316
|
-
company:
|
7317
|
-
customFields:
|
7398
|
+
notes: z110.string().optional(),
|
7399
|
+
tags: z110.array(z110.string()).optional(),
|
7400
|
+
company: z110.string().optional(),
|
7401
|
+
customFields: z110.record(z110.string())
|
7318
7402
|
// Dynamic keys with string values
|
7319
7403
|
}),
|
7320
7404
|
response: ContactSchema3
|
7321
7405
|
},
|
7322
7406
|
getById: {
|
7323
|
-
request:
|
7324
|
-
id:
|
7407
|
+
request: z110.object({
|
7408
|
+
id: z110.string().uuid()
|
7325
7409
|
})
|
7326
7410
|
},
|
7327
7411
|
delete: {
|
7328
|
-
request:
|
7329
|
-
id:
|
7412
|
+
request: z110.object({
|
7413
|
+
id: z110.string().uuid()
|
7330
7414
|
})
|
7331
7415
|
},
|
7332
7416
|
getAll: {
|
7333
|
-
request:
|
7334
|
-
page:
|
7335
|
-
pageSize:
|
7336
|
-
keyword:
|
7337
|
-
company:
|
7338
|
-
name:
|
7339
|
-
address:
|
7340
|
-
channel:
|
7341
|
-
selectedDate:
|
7342
|
-
customFields:
|
7343
|
-
|
7344
|
-
attributeId:
|
7345
|
-
type:
|
7346
|
-
value:
|
7417
|
+
request: z110.object({
|
7418
|
+
page: z110.coerce.number().default(1),
|
7419
|
+
pageSize: z110.coerce.number().default(10),
|
7420
|
+
keyword: z110.string().optional(),
|
7421
|
+
company: z110.array(z110.string().uuid()),
|
7422
|
+
name: z110.string(),
|
7423
|
+
address: z110.string(),
|
7424
|
+
channel: z110.array(z110.string()),
|
7425
|
+
selectedDate: z110.string(),
|
7426
|
+
customFields: z110.array(
|
7427
|
+
z110.object({
|
7428
|
+
attributeId: z110.string().uuid(),
|
7429
|
+
type: z110.string(),
|
7430
|
+
value: z110.union([z110.string(), z110.array(z110.string())])
|
7347
7431
|
})
|
7348
7432
|
),
|
7349
|
-
tags:
|
7350
|
-
phone:
|
7351
|
-
email:
|
7352
|
-
notes:
|
7433
|
+
tags: z110.array(z110.string().uuid()),
|
7434
|
+
phone: z110.string(),
|
7435
|
+
email: z110.string(),
|
7436
|
+
notes: z110.string()
|
7353
7437
|
}).partial(),
|
7354
7438
|
response: {
|
7355
|
-
page:
|
7356
|
-
pageSize:
|
7357
|
-
total:
|
7358
|
-
lastPage:
|
7359
|
-
data:
|
7439
|
+
page: z110.number(),
|
7440
|
+
pageSize: z110.number(),
|
7441
|
+
total: z110.number(),
|
7442
|
+
lastPage: z110.number(),
|
7443
|
+
data: z110.array(ContactSchema3)
|
7360
7444
|
}
|
7361
7445
|
},
|
7362
7446
|
getContactFields: {
|
7363
|
-
request:
|
7364
|
-
page:
|
7365
|
-
pageSize:
|
7447
|
+
request: z110.object({
|
7448
|
+
page: z110.coerce.number().default(1),
|
7449
|
+
pageSize: z110.coerce.number().default(10)
|
7366
7450
|
}).partial(),
|
7367
7451
|
response: {
|
7368
|
-
page:
|
7369
|
-
pageSize:
|
7370
|
-
total:
|
7371
|
-
lastPage:
|
7372
|
-
data:
|
7452
|
+
page: z110.number(),
|
7453
|
+
pageSize: z110.number(),
|
7454
|
+
total: z110.number(),
|
7455
|
+
lastPage: z110.number(),
|
7456
|
+
data: z110.array(ContactCustomFieldSchema2)
|
7373
7457
|
}
|
7374
7458
|
},
|
7375
7459
|
addAttachments: {
|
7376
|
-
request:
|
7377
|
-
contactId:
|
7378
|
-
attributeId:
|
7379
|
-
contactAttachmentRecords:
|
7380
|
-
|
7381
|
-
bucketName:
|
7382
|
-
fileKey:
|
7383
|
-
fileName:
|
7384
|
-
fileSize:
|
7385
|
-
url:
|
7460
|
+
request: z110.object({
|
7461
|
+
contactId: z110.string(),
|
7462
|
+
attributeId: z110.string().uuid(),
|
7463
|
+
contactAttachmentRecords: z110.array(
|
7464
|
+
z110.object({
|
7465
|
+
bucketName: z110.string(),
|
7466
|
+
fileKey: z110.string(),
|
7467
|
+
fileName: z110.string(),
|
7468
|
+
fileSize: z110.coerce.number(),
|
7469
|
+
url: z110.string()
|
7386
7470
|
})
|
7387
7471
|
)
|
7388
7472
|
}),
|
@@ -7391,7 +7475,7 @@ var ContactContractValidationSchema2 = {
|
|
7391
7475
|
};
|
7392
7476
|
|
7393
7477
|
// src/public-api/index.ts
|
7394
|
-
var publicApiContract =
|
7478
|
+
var publicApiContract = initContract40().router(
|
7395
7479
|
{
|
7396
7480
|
createContact: {
|
7397
7481
|
method: "POST",
|
@@ -7401,11 +7485,11 @@ var publicApiContract = initContract39().router(
|
|
7401
7485
|
201: DefaultSuccessResponseSchema.extend({
|
7402
7486
|
data: ContactSchema3
|
7403
7487
|
}),
|
7404
|
-
400:
|
7405
|
-
message:
|
7488
|
+
400: z111.object({
|
7489
|
+
message: z111.string()
|
7406
7490
|
}),
|
7407
|
-
409:
|
7408
|
-
message:
|
7491
|
+
409: z111.object({
|
7492
|
+
message: z111.string()
|
7409
7493
|
}),
|
7410
7494
|
401: DefaultUnauthorizedSchema,
|
7411
7495
|
404: DefaultNotFoundSchema,
|
@@ -7420,13 +7504,13 @@ var publicApiContract = initContract39().router(
|
|
7420
7504
|
query: GetTagsSchema,
|
7421
7505
|
responses: {
|
7422
7506
|
200: DefaultSuccessResponseSchema.extend({
|
7423
|
-
tags:
|
7507
|
+
tags: z111.array(TagSchema)
|
7424
7508
|
}),
|
7425
|
-
400:
|
7426
|
-
message:
|
7509
|
+
400: z111.object({
|
7510
|
+
message: z111.string()
|
7427
7511
|
}),
|
7428
|
-
409:
|
7429
|
-
message:
|
7512
|
+
409: z111.object({
|
7513
|
+
message: z111.string()
|
7430
7514
|
}),
|
7431
7515
|
401: DefaultUnauthorizedSchema,
|
7432
7516
|
404: DefaultNotFoundSchema,
|
@@ -7442,11 +7526,11 @@ var publicApiContract = initContract39().router(
|
|
7442
7526
|
200: DefaultSuccessResponseSchema.extend(
|
7443
7527
|
ContactContractValidationSchema2.getAll.response
|
7444
7528
|
),
|
7445
|
-
400:
|
7446
|
-
message:
|
7529
|
+
400: z111.object({
|
7530
|
+
message: z111.string()
|
7447
7531
|
}),
|
7448
|
-
409:
|
7449
|
-
message:
|
7532
|
+
409: z111.object({
|
7533
|
+
message: z111.string()
|
7450
7534
|
}),
|
7451
7535
|
401: DefaultUnauthorizedSchema,
|
7452
7536
|
404: DefaultNotFoundSchema,
|
@@ -7463,11 +7547,11 @@ var publicApiContract = initContract39().router(
|
|
7463
7547
|
200: DefaultSuccessResponseSchema.extend(
|
7464
7548
|
ContactContractValidationSchema2.getContactFields.response
|
7465
7549
|
),
|
7466
|
-
400:
|
7467
|
-
message:
|
7550
|
+
400: z111.object({
|
7551
|
+
message: z111.string()
|
7468
7552
|
}),
|
7469
|
-
409:
|
7470
|
-
message:
|
7553
|
+
409: z111.object({
|
7554
|
+
message: z111.string()
|
7471
7555
|
}),
|
7472
7556
|
401: DefaultUnauthorizedSchema,
|
7473
7557
|
404: DefaultNotFoundSchema,
|
@@ -7481,17 +7565,17 @@ var publicApiContract = initContract39().router(
|
|
7481
7565
|
path: "/contacts/:id",
|
7482
7566
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7483
7567
|
responses: {
|
7484
|
-
200:
|
7485
|
-
status:
|
7486
|
-
message:
|
7568
|
+
200: z111.object({
|
7569
|
+
status: z111.string(),
|
7570
|
+
message: z111.string(),
|
7487
7571
|
data: ContactSchema3,
|
7488
|
-
requestId:
|
7572
|
+
requestId: z111.string()
|
7489
7573
|
}),
|
7490
|
-
400:
|
7491
|
-
message:
|
7574
|
+
400: z111.object({
|
7575
|
+
message: z111.string()
|
7492
7576
|
}),
|
7493
|
-
409:
|
7494
|
-
message:
|
7577
|
+
409: z111.object({
|
7578
|
+
message: z111.string()
|
7495
7579
|
}),
|
7496
7580
|
401: DefaultUnauthorizedSchema,
|
7497
7581
|
404: DefaultNotFoundSchema,
|
@@ -7509,11 +7593,11 @@ var publicApiContract = initContract39().router(
|
|
7509
7593
|
201: DefaultSuccessResponseSchema.extend({
|
7510
7594
|
message: ContactCustomFieldSchema2
|
7511
7595
|
}),
|
7512
|
-
400:
|
7513
|
-
message:
|
7596
|
+
400: z111.object({
|
7597
|
+
message: z111.string()
|
7514
7598
|
}),
|
7515
|
-
409:
|
7516
|
-
message:
|
7599
|
+
409: z111.object({
|
7600
|
+
message: z111.string()
|
7517
7601
|
}),
|
7518
7602
|
401: DefaultUnauthorizedSchema,
|
7519
7603
|
404: DefaultNotFoundSchema,
|
@@ -7527,17 +7611,17 @@ var publicApiContract = initContract39().router(
|
|
7527
7611
|
path: "/contacts/:id",
|
7528
7612
|
pathParams: ContactContractValidationSchema2.getById.request,
|
7529
7613
|
responses: {
|
7530
|
-
200:
|
7531
|
-
status:
|
7532
|
-
message:
|
7614
|
+
200: z111.object({
|
7615
|
+
status: z111.string(),
|
7616
|
+
message: z111.string(),
|
7533
7617
|
data: ContactSchema3,
|
7534
|
-
requestId:
|
7618
|
+
requestId: z111.string()
|
7535
7619
|
}),
|
7536
|
-
400:
|
7537
|
-
message:
|
7620
|
+
400: z111.object({
|
7621
|
+
message: z111.string()
|
7538
7622
|
}),
|
7539
|
-
409:
|
7540
|
-
message:
|
7623
|
+
409: z111.object({
|
7624
|
+
message: z111.string()
|
7541
7625
|
}),
|
7542
7626
|
401: DefaultUnauthorizedSchema,
|
7543
7627
|
404: DefaultNotFoundSchema,
|
@@ -7551,17 +7635,17 @@ var publicApiContract = initContract39().router(
|
|
7551
7635
|
path: "/contacts/:id",
|
7552
7636
|
pathParams: ContactContractValidationSchema2.delete.request,
|
7553
7637
|
responses: {
|
7554
|
-
200:
|
7555
|
-
status:
|
7556
|
-
message:
|
7638
|
+
200: z111.object({
|
7639
|
+
status: z111.string(),
|
7640
|
+
message: z111.string(),
|
7557
7641
|
data: ContactSchema3,
|
7558
|
-
requestId:
|
7642
|
+
requestId: z111.string()
|
7559
7643
|
}),
|
7560
|
-
400:
|
7561
|
-
message:
|
7644
|
+
400: z111.object({
|
7645
|
+
message: z111.string()
|
7562
7646
|
}),
|
7563
|
-
409:
|
7564
|
-
message:
|
7647
|
+
409: z111.object({
|
7648
|
+
message: z111.string()
|
7565
7649
|
}),
|
7566
7650
|
401: DefaultUnauthorizedSchema,
|
7567
7651
|
404: DefaultNotFoundSchema,
|
@@ -7578,17 +7662,17 @@ var publicApiContract = initContract39().router(
|
|
7578
7662
|
);
|
7579
7663
|
|
7580
7664
|
// src/workflow-rule/index.ts
|
7581
|
-
import { initContract as
|
7582
|
-
import
|
7583
|
-
var chatContract =
|
7665
|
+
import { initContract as initContract41 } from "@ts-rest/core";
|
7666
|
+
import z112 from "zod";
|
7667
|
+
var chatContract = initContract41().router(
|
7584
7668
|
{
|
7585
7669
|
updateAssignee: {
|
7586
7670
|
method: "POST",
|
7587
7671
|
path: "/room/assignee",
|
7588
|
-
body:
|
7589
|
-
assigneeId:
|
7590
|
-
roomId:
|
7591
|
-
workflowId:
|
7672
|
+
body: z112.object({
|
7673
|
+
assigneeId: z112.string().uuid(),
|
7674
|
+
roomId: z112.string().uuid(),
|
7675
|
+
workflowId: z112.string().uuid()
|
7592
7676
|
}),
|
7593
7677
|
responses: {
|
7594
7678
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7602,15 +7686,15 @@ var chatContract = initContract40().router(
|
|
7602
7686
|
solveRoom: {
|
7603
7687
|
method: "POST",
|
7604
7688
|
path: "/room/solve",
|
7605
|
-
body:
|
7606
|
-
roomId:
|
7607
|
-
disposition:
|
7608
|
-
workflowId:
|
7689
|
+
body: z112.object({
|
7690
|
+
roomId: z112.string(),
|
7691
|
+
disposition: z112.string(),
|
7692
|
+
workflowId: z112.string().uuid()
|
7609
7693
|
}),
|
7610
7694
|
responses: {
|
7611
7695
|
200: DefaultSuccessResponseSchema.extend({
|
7612
7696
|
data: RoomSchema.extend({
|
7613
|
-
solveMessage:
|
7697
|
+
solveMessage: z112.string()
|
7614
7698
|
})
|
7615
7699
|
}),
|
7616
7700
|
409: DefaultErrorResponseSchema
|
@@ -7619,18 +7703,18 @@ var chatContract = initContract40().router(
|
|
7619
7703
|
}
|
7620
7704
|
},
|
7621
7705
|
{
|
7622
|
-
baseHeaders:
|
7623
|
-
"x-tenant":
|
7624
|
-
"x-code":
|
7706
|
+
baseHeaders: z112.object({
|
7707
|
+
"x-tenant": z112.string({ required_error: "Tenant id is required" }),
|
7708
|
+
"x-code": z112.string().uuid().optional()
|
7625
7709
|
}),
|
7626
7710
|
pathPrefix: "chat"
|
7627
7711
|
}
|
7628
7712
|
);
|
7629
7713
|
|
7630
7714
|
// src/botpress/index.ts
|
7631
|
-
import
|
7632
|
-
import { initContract as
|
7633
|
-
var botpressContract =
|
7715
|
+
import z113 from "zod";
|
7716
|
+
import { initContract as initContract42 } from "@ts-rest/core";
|
7717
|
+
var botpressContract = initContract42().router(
|
7634
7718
|
{
|
7635
7719
|
createBot: {
|
7636
7720
|
method: "POST",
|
@@ -7647,7 +7731,7 @@ var botpressContract = initContract41().router(
|
|
7647
7731
|
path: "/",
|
7648
7732
|
responses: {
|
7649
7733
|
200: DefaultSuccessResponseSchema.extend({
|
7650
|
-
data:
|
7734
|
+
data: z113.array(BotpressBotSchema)
|
7651
7735
|
}),
|
7652
7736
|
500: DefaultErrorResponseSchema
|
7653
7737
|
}
|
@@ -7664,7 +7748,7 @@ var botpressContract = initContract41().router(
|
|
7664
7748
|
},
|
7665
7749
|
{ pathPrefix: "/bots" }
|
7666
7750
|
);
|
7667
|
-
var botContract =
|
7751
|
+
var botContract = initContract42().router(
|
7668
7752
|
{
|
7669
7753
|
createBot: {
|
7670
7754
|
method: "POST",
|
@@ -7684,7 +7768,7 @@ var botContract = initContract41().router(
|
|
7684
7768
|
path: "/",
|
7685
7769
|
responses: {
|
7686
7770
|
200: DefaultSuccessResponseSchema.extend({
|
7687
|
-
data:
|
7771
|
+
data: z113.array(BotpressBotSchema)
|
7688
7772
|
}),
|
7689
7773
|
500: DefaultErrorResponseSchema
|
7690
7774
|
}
|
@@ -7696,7 +7780,7 @@ var botContract = initContract41().router(
|
|
7696
7780
|
);
|
7697
7781
|
|
7698
7782
|
// src/contract.ts
|
7699
|
-
var apiContract =
|
7783
|
+
var apiContract = initContract43().router({
|
7700
7784
|
auth: authContract,
|
7701
7785
|
cxLog: cxLogContract,
|
7702
7786
|
dashboard: dashboardContract,
|
@@ -7718,46 +7802,47 @@ var apiContract = initContract42().router({
|
|
7718
7802
|
evaluateForm: evaluateFormContract,
|
7719
7803
|
upload: uploadContract,
|
7720
7804
|
snippet: snippetContract,
|
7721
|
-
bot: botContract
|
7805
|
+
bot: botContract,
|
7806
|
+
subscription: subscriptionContract
|
7722
7807
|
});
|
7723
|
-
var contactContract2 =
|
7808
|
+
var contactContract2 = initContract43().router({
|
7724
7809
|
contact: contactContract
|
7725
7810
|
});
|
7726
|
-
var ticketContract2 =
|
7811
|
+
var ticketContract2 = initContract43().router({
|
7727
7812
|
ticket: ticketContract
|
7728
7813
|
});
|
7729
|
-
var extensionContract2 =
|
7814
|
+
var extensionContract2 = initContract43().router({
|
7730
7815
|
extension: extensionContract
|
7731
7816
|
});
|
7732
|
-
var commentActivityContract =
|
7817
|
+
var commentActivityContract = initContract43().router({
|
7733
7818
|
comment: commentContract,
|
7734
7819
|
activityLog: activityLogContract
|
7735
7820
|
});
|
7736
|
-
var platformContract =
|
7821
|
+
var platformContract = initContract43().router({
|
7737
7822
|
line: lineContract,
|
7738
7823
|
messenger: messengerContract,
|
7739
7824
|
instagram: instagramContract,
|
7740
7825
|
viber: viberContract
|
7741
7826
|
});
|
7742
|
-
var platformBotpressContract =
|
7827
|
+
var platformBotpressContract = initContract43().router({
|
7743
7828
|
botpress: botpressContract
|
7744
7829
|
});
|
7745
|
-
var telephonyContract =
|
7830
|
+
var telephonyContract = initContract43().router({
|
7746
7831
|
telephonyCdr: telephonyCdrContract
|
7747
7832
|
});
|
7748
|
-
var notificationContract =
|
7833
|
+
var notificationContract = initContract43().router({
|
7749
7834
|
notification: userNotificationContract
|
7750
7835
|
});
|
7751
|
-
var publicApiContract2 =
|
7836
|
+
var publicApiContract2 = initContract43().router({
|
7752
7837
|
publicApi: publicApiContract
|
7753
7838
|
});
|
7754
|
-
var businessCalendarContract2 =
|
7839
|
+
var businessCalendarContract2 = initContract43().router({
|
7755
7840
|
businessCalendar: businessCalendarContract
|
7756
7841
|
});
|
7757
|
-
var mailApiContract =
|
7842
|
+
var mailApiContract = initContract43().router({
|
7758
7843
|
mail: mailContract
|
7759
7844
|
});
|
7760
|
-
var workflowContract =
|
7845
|
+
var workflowContract = initContract43().router(
|
7761
7846
|
{
|
7762
7847
|
chat: chatContract
|
7763
7848
|
},
|
@@ -7767,9 +7852,9 @@ var workflowContract = initContract42().router(
|
|
7767
7852
|
);
|
7768
7853
|
|
7769
7854
|
// src/chat/index.ts
|
7770
|
-
import { initContract as
|
7771
|
-
import
|
7772
|
-
var receiveMessageContract =
|
7855
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
7856
|
+
import z114 from "zod";
|
7857
|
+
var receiveMessageContract = initContract44().router(
|
7773
7858
|
{
|
7774
7859
|
receiveMessage: {
|
7775
7860
|
method: "POST",
|
@@ -7783,26 +7868,26 @@ var receiveMessageContract = initContract43().router(
|
|
7783
7868
|
}
|
7784
7869
|
},
|
7785
7870
|
{
|
7786
|
-
baseHeaders:
|
7787
|
-
"x-code":
|
7788
|
-
"x-tenant":
|
7871
|
+
baseHeaders: z114.object({
|
7872
|
+
"x-code": z114.string().uuid(),
|
7873
|
+
"x-tenant": z114.string().uuid()
|
7789
7874
|
}),
|
7790
7875
|
pathPrefix: "message"
|
7791
7876
|
}
|
7792
7877
|
);
|
7793
7878
|
var chatContract2 = {
|
7794
|
-
main:
|
7879
|
+
main: initContract44().router(
|
7795
7880
|
{
|
7796
7881
|
getRooms: {
|
7797
7882
|
method: "GET",
|
7798
7883
|
path: "/rooms",
|
7799
7884
|
responses: {
|
7800
7885
|
200: DefaultSuccessResponseSchema.extend({
|
7801
|
-
total:
|
7802
|
-
page:
|
7803
|
-
pageSize:
|
7804
|
-
data:
|
7805
|
-
unreadCountsByAssignee:
|
7886
|
+
total: z114.number(),
|
7887
|
+
page: z114.number(),
|
7888
|
+
pageSize: z114.number(),
|
7889
|
+
data: z114.array(RoomSchema),
|
7890
|
+
unreadCountsByAssignee: z114.array(UnreadCountsByAssigneeSchema)
|
7806
7891
|
}),
|
7807
7892
|
401: DefaultUnauthorizedSchema
|
7808
7893
|
},
|
@@ -7812,8 +7897,8 @@ var chatContract2 = {
|
|
7812
7897
|
getRoomContact: {
|
7813
7898
|
method: "GET",
|
7814
7899
|
path: "/contact/:contactId",
|
7815
|
-
pathParams:
|
7816
|
-
contactId:
|
7900
|
+
pathParams: z114.object({
|
7901
|
+
contactId: z114.string().uuid()
|
7817
7902
|
}),
|
7818
7903
|
responses: {
|
7819
7904
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -7848,32 +7933,32 @@ var chatContract2 = {
|
|
7848
7933
|
getRoomsByPlatformContactId: {
|
7849
7934
|
method: "GET",
|
7850
7935
|
path: "/rooms/:platformContactId",
|
7851
|
-
pathParams:
|
7852
|
-
platformContactId:
|
7936
|
+
pathParams: z114.object({
|
7937
|
+
platformContactId: z114.string()
|
7853
7938
|
}),
|
7854
7939
|
responses: {
|
7855
7940
|
200: DefaultSuccessResponseSchema.extend({
|
7856
|
-
data:
|
7857
|
-
|
7858
|
-
id:
|
7941
|
+
data: z114.array(
|
7942
|
+
z114.object({
|
7943
|
+
id: z114.string().uuid()
|
7859
7944
|
})
|
7860
7945
|
),
|
7861
|
-
total:
|
7946
|
+
total: z114.number()
|
7862
7947
|
})
|
7863
7948
|
}
|
7864
7949
|
},
|
7865
7950
|
getMessages: {
|
7866
7951
|
method: "GET",
|
7867
7952
|
path: "/message/:roomId",
|
7868
|
-
pathParams:
|
7869
|
-
roomId:
|
7953
|
+
pathParams: z114.object({
|
7954
|
+
roomId: z114.string().uuid()
|
7870
7955
|
}),
|
7871
7956
|
responses: {
|
7872
7957
|
200: DefaultSuccessResponseSchema.extend({
|
7873
|
-
total:
|
7874
|
-
page:
|
7875
|
-
pageSize:
|
7876
|
-
data:
|
7958
|
+
total: z114.number(),
|
7959
|
+
page: z114.number(),
|
7960
|
+
pageSize: z114.number(),
|
7961
|
+
data: z114.array(MessageSchema)
|
7877
7962
|
})
|
7878
7963
|
},
|
7879
7964
|
query: DefaultQueryParamsSchema,
|
@@ -7886,7 +7971,7 @@ var chatContract2 = {
|
|
7886
7971
|
responses: {
|
7887
7972
|
200: DefaultSuccessResponseSchema.extend({
|
7888
7973
|
data: RoomSchema.extend({
|
7889
|
-
solveMessage:
|
7974
|
+
solveMessage: z114.string()
|
7890
7975
|
})
|
7891
7976
|
}),
|
7892
7977
|
409: DefaultErrorResponseSchema
|
@@ -7908,27 +7993,27 @@ var chatContract2 = {
|
|
7908
7993
|
getRoom: {
|
7909
7994
|
method: "GET",
|
7910
7995
|
path: "/room/:roomId",
|
7911
|
-
pathParams:
|
7912
|
-
roomId:
|
7996
|
+
pathParams: z114.object({
|
7997
|
+
roomId: z114.string().uuid()
|
7913
7998
|
}),
|
7914
7999
|
responses: {
|
7915
8000
|
200: DefaultSuccessResponseSchema.extend({
|
7916
|
-
data:
|
8001
|
+
data: z114.object({
|
7917
8002
|
room: RoomSchema,
|
7918
|
-
latestIncomingMessage:
|
7919
|
-
message:
|
8003
|
+
latestIncomingMessage: z114.object({
|
8004
|
+
message: z114.string(),
|
7920
8005
|
direction: MessageDirectionTypeSchema,
|
7921
8006
|
type: MessageTypeSchema,
|
7922
|
-
readAt:
|
7923
|
-
metadata:
|
7924
|
-
platformId:
|
7925
|
-
platformMessageId:
|
7926
|
-
replyPlatformMessageId:
|
7927
|
-
template:
|
8007
|
+
readAt: z114.date(),
|
8008
|
+
metadata: z114.any(),
|
8009
|
+
platformId: z114.string(),
|
8010
|
+
platformMessageId: z114.string(),
|
8011
|
+
replyPlatformMessageId: z114.string(),
|
8012
|
+
template: z114.any(),
|
7928
8013
|
locale: MessageLocaleTypeSchema,
|
7929
|
-
url:
|
7930
|
-
previewUrl:
|
7931
|
-
imageSetId:
|
8014
|
+
url: z114.string(),
|
8015
|
+
previewUrl: z114.string(),
|
8016
|
+
imageSetId: z114.string()
|
7932
8017
|
})
|
7933
8018
|
})
|
7934
8019
|
}),
|
@@ -7939,14 +8024,14 @@ var chatContract2 = {
|
|
7939
8024
|
createRoom: {
|
7940
8025
|
method: "POST",
|
7941
8026
|
path: "/room/create/:platformContactId",
|
7942
|
-
pathParams:
|
7943
|
-
platformContactId:
|
8027
|
+
pathParams: z114.object({
|
8028
|
+
platformContactId: z114.string().uuid()
|
7944
8029
|
}),
|
7945
8030
|
responses: {
|
7946
8031
|
200: DefaultSuccessResponseSchema.extend({
|
7947
8032
|
data: RoomSchema.extend({
|
7948
8033
|
contact: ContactSchema,
|
7949
|
-
openMessage:
|
8034
|
+
openMessage: z114.string()
|
7950
8035
|
})
|
7951
8036
|
})
|
7952
8037
|
},
|
@@ -7956,13 +8041,13 @@ var chatContract2 = {
|
|
7956
8041
|
readRoom: {
|
7957
8042
|
method: "POST",
|
7958
8043
|
path: "/room/read/:roomId",
|
7959
|
-
pathParams:
|
7960
|
-
roomId:
|
8044
|
+
pathParams: z114.object({
|
8045
|
+
roomId: z114.string().uuid()
|
7961
8046
|
}),
|
7962
8047
|
responses: {
|
7963
8048
|
200: DefaultSuccessResponseSchema.extend({
|
7964
8049
|
data: RoomSchema.extend({
|
7965
|
-
description:
|
8050
|
+
description: z114.string().nullable()
|
7966
8051
|
})
|
7967
8052
|
})
|
7968
8053
|
},
|
@@ -7974,10 +8059,10 @@ var chatContract2 = {
|
|
7974
8059
|
path: "/search",
|
7975
8060
|
responses: {
|
7976
8061
|
200: DefaultSuccessResponseSchema.extend({
|
7977
|
-
total:
|
7978
|
-
page:
|
7979
|
-
pageSize:
|
7980
|
-
data:
|
8062
|
+
total: z114.number(),
|
8063
|
+
page: z114.number(),
|
8064
|
+
pageSize: z114.number(),
|
8065
|
+
data: z114.array(RoomSchema)
|
7981
8066
|
})
|
7982
8067
|
},
|
7983
8068
|
query: SearchRoomsSchema,
|
@@ -7992,44 +8077,44 @@ var chatContract2 = {
|
|
7992
8077
|
};
|
7993
8078
|
|
7994
8079
|
// src/webchat/index.ts
|
7995
|
-
import { initContract as
|
8080
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
7996
8081
|
|
7997
8082
|
// src/webchat/schema.ts
|
7998
|
-
import
|
8083
|
+
import z116 from "zod";
|
7999
8084
|
|
8000
8085
|
// src/webchat/validation.ts
|
8001
|
-
import
|
8086
|
+
import z115 from "zod";
|
8002
8087
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
8003
8088
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
8004
8089
|
return ChatwootChannelType3;
|
8005
8090
|
})(ChatwootChannelType2 || {});
|
8006
|
-
var WebChatChannelSchema =
|
8007
|
-
avatar:
|
8008
|
-
name:
|
8009
|
-
type:
|
8010
|
-
websiteName:
|
8011
|
-
welcomeTitle:
|
8012
|
-
websiteUrl:
|
8013
|
-
welcomeTagline:
|
8014
|
-
agentAwayMessage:
|
8015
|
-
widgetColor:
|
8091
|
+
var WebChatChannelSchema = z115.object({
|
8092
|
+
avatar: z115.string().optional(),
|
8093
|
+
name: z115.string(),
|
8094
|
+
type: z115.nativeEnum(ChatwootChannelType2),
|
8095
|
+
websiteName: z115.string(),
|
8096
|
+
welcomeTitle: z115.string(),
|
8097
|
+
websiteUrl: z115.string().url(),
|
8098
|
+
welcomeTagline: z115.string().optional(),
|
8099
|
+
agentAwayMessage: z115.string().optional(),
|
8100
|
+
widgetColor: z115.string().optional()
|
8016
8101
|
});
|
8017
8102
|
|
8018
8103
|
// src/webchat/schema.ts
|
8019
|
-
var ConnectWebChatChannelSchema =
|
8020
|
-
name:
|
8021
|
-
actor:
|
8022
|
-
id:
|
8023
|
-
name:
|
8024
|
-
email:
|
8025
|
-
address:
|
8026
|
-
phone:
|
8104
|
+
var ConnectWebChatChannelSchema = z116.object({
|
8105
|
+
name: z116.string(),
|
8106
|
+
actor: z116.object({
|
8107
|
+
id: z116.string().uuid(),
|
8108
|
+
name: z116.string(),
|
8109
|
+
email: z116.string().email(),
|
8110
|
+
address: z116.string().nullable(),
|
8111
|
+
phone: z116.string().nullable()
|
8027
8112
|
}),
|
8028
8113
|
channel: WebChatChannelSchema
|
8029
8114
|
});
|
8030
8115
|
|
8031
8116
|
// src/webchat/index.ts
|
8032
|
-
var platformWebchatContract =
|
8117
|
+
var platformWebchatContract = initContract45().router({
|
8033
8118
|
sendMessage: {
|
8034
8119
|
method: "POST",
|
8035
8120
|
path: "/message",
|
@@ -8082,6 +8167,7 @@ export {
|
|
8082
8167
|
publicApiContract2 as publicApiContract,
|
8083
8168
|
receiveMessageContract,
|
8084
8169
|
snippetContract,
|
8170
|
+
subscriptionContract,
|
8085
8171
|
tagContract,
|
8086
8172
|
telephonyCdrContract,
|
8087
8173
|
telephonyContract,
|