@kl1/contracts 1.4.51 → 1.4.54
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/botpress/index.d.ts +11 -8
- package/dist/api-contracts/src/botpress/index.d.ts.map +1 -1
- package/dist/api-contracts/src/botpress/validation.d.ts +11 -8
- package/dist/api-contracts/src/botpress/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/index.d.ts +109 -109
- package/dist/api-contracts/src/channel/schema.d.ts +4 -4
- package/dist/api-contracts/src/channel/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/channel/validation.d.ts +6 -6
- package/dist/api-contracts/src/chat/index.d.ts +685 -679
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/schema.d.ts +174 -174
- package/dist/api-contracts/src/chat/validation.d.ts +145 -132
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/comment/index.d.ts +31 -31
- package/dist/api-contracts/src/comment/schema.d.ts +9 -9
- package/dist/api-contracts/src/contact/index.d.ts +70 -70
- package/dist/api-contracts/src/contact/schema.d.ts +8 -8
- package/dist/api-contracts/src/contact/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/contact/validation.d.ts +40 -40
- package/dist/api-contracts/src/contract.d.ts +24075 -3534
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/index.d.ts +51 -51
- package/dist/api-contracts/src/cx-log/schema.d.ts +41 -41
- package/dist/api-contracts/src/facebook-feed/index.d.ts +152 -147
- package/dist/api-contracts/src/facebook-feed/index.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/schema.d.ts +19 -19
- package/dist/api-contracts/src/facebook-feed/validation.d.ts +17 -17
- package/dist/api-contracts/src/hold-label/index.d.ts +2 -2
- package/dist/api-contracts/src/hold-label/validation.d.ts +2 -2
- package/dist/api-contracts/src/index.d.ts +1 -0
- package/dist/api-contracts/src/index.d.ts.map +1 -1
- package/dist/api-contracts/src/instagram/index.d.ts +121 -116
- package/dist/api-contracts/src/instagram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/klink-chat/index.d.ts +20405 -0
- package/dist/api-contracts/src/klink-chat/index.d.ts.map +1 -0
- package/dist/api-contracts/src/klink-chat/schema.d.ts +63 -0
- package/dist/api-contracts/src/klink-chat/schema.d.ts.map +1 -0
- package/dist/api-contracts/src/klink-chat/validation.d.ts +15 -0
- package/dist/api-contracts/src/klink-chat/validation.d.ts.map +1 -0
- package/dist/api-contracts/src/line/index.d.ts +124 -119
- package/dist/api-contracts/src/line/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/validation.d.ts +14 -14
- package/dist/api-contracts/src/messenger/index.d.ts +121 -116
- package/dist/api-contracts/src/messenger/index.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/validation.d.ts +17 -17
- package/dist/api-contracts/src/public-api/index.d.ts +100 -4
- package/dist/api-contracts/src/public-api/index.d.ts.map +1 -1
- package/dist/api-contracts/src/public-api/schema.d.ts +1 -1
- package/dist/api-contracts/src/public-api/schema.d.ts.map +1 -1
- package/dist/api-contracts/src/public-api/validation.d.ts +13 -0
- package/dist/api-contracts/src/public-api/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/sms/index.d.ts +39 -34
- package/dist/api-contracts/src/sms/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/index.d.ts +107 -102
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telephony-cdr/index.d.ts +18 -18
- package/dist/api-contracts/src/telephony-cdr/schema.d.ts +7 -7
- package/dist/api-contracts/src/ticket/index.d.ts +48 -48
- package/dist/api-contracts/src/ticket/schema.d.ts +7 -7
- package/dist/api-contracts/src/viber/index.d.ts +107 -102
- package/dist/api-contracts/src/viber/index.d.ts.map +1 -1
- package/dist/api-contracts/src/webchat/index.d.ts +107 -102
- package/dist/api-contracts/src/webchat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/index.d.ts +117 -112
- package/dist/api-contracts/src/whatsapp/index.d.ts.map +1 -1
- package/dist/api-contracts/src/whatsapp/validation.d.ts +4 -4
- package/dist/api-contracts/src/workflow-rule/index.d.ts +81 -81
- package/dist/entities/src/enums/chat.d.ts +2 -0
- package/dist/entities/src/enums/chat.d.ts.map +1 -1
- package/dist/index.js +778 -657
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +775 -656
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -96,6 +96,7 @@ var CreateBotSchema = z4.object({
|
|
96
96
|
var SendBotpressMessageSchema = z4.object({
|
97
97
|
message: z4.string().optional(),
|
98
98
|
type: z4.string(),
|
99
|
+
roomId: z4.string().uuid(),
|
99
100
|
room: z4.object({
|
100
101
|
botpressConversationMetadata: z4.object({
|
101
102
|
id: z4.string()
|
@@ -123,7 +124,7 @@ var SendBotpressMessageSchema = z4.object({
|
|
123
124
|
})
|
124
125
|
).nullable().optional()
|
125
126
|
})
|
126
|
-
})
|
127
|
+
}).optional()
|
127
128
|
});
|
128
129
|
|
129
130
|
// src/botpress/schema.ts
|
@@ -158,7 +159,8 @@ var ChannelTypeSchema = z6.enum([
|
|
158
159
|
"lazada",
|
159
160
|
"webchat",
|
160
161
|
"facebook_feed",
|
161
|
-
"sms_vonage"
|
162
|
+
"sms_vonage",
|
163
|
+
"klink_chat"
|
162
164
|
]);
|
163
165
|
var ChannelStatusTypeSchema = z6.union([
|
164
166
|
z6.literal(true),
|
@@ -441,7 +443,8 @@ var PContactSchema = z11.object({
|
|
441
443
|
"lazada",
|
442
444
|
"webchat",
|
443
445
|
"facebook_feed",
|
444
|
-
"sms_vonage"
|
446
|
+
"sms_vonage",
|
447
|
+
"klink_chat"
|
445
448
|
]),
|
446
449
|
metadata: z11.object({
|
447
450
|
id: z11.string(),
|
@@ -1281,6 +1284,7 @@ var SendMessageSchema = z26.object({
|
|
1281
1284
|
z26.literal("account_update"),
|
1282
1285
|
z26.literal("confirmed_event_update")
|
1283
1286
|
]).optional(),
|
1287
|
+
whatsappTemplateName: z26.string().optional(),
|
1284
1288
|
parentMessageId: z26.string().uuid().optional(),
|
1285
1289
|
feedPostId: z26.string().uuid().optional(),
|
1286
1290
|
platformId: z26.string().optional(),
|
@@ -1433,6 +1437,7 @@ var SendMessageToPlatformSchema = z26.object({
|
|
1433
1437
|
z26.literal("account_update"),
|
1434
1438
|
z26.literal("confirmed_event_update")
|
1435
1439
|
]).optional(),
|
1440
|
+
whatsappTemplateName: z26.string().optional(),
|
1436
1441
|
telegramBusinessConnectionId: z26.string().nullable().optional(),
|
1437
1442
|
isBotRoom: z26.boolean().nullable().default(false)
|
1438
1443
|
}),
|
@@ -1723,7 +1728,7 @@ var smsSettingContract = initContract().router({
|
|
1723
1728
|
});
|
1724
1729
|
|
1725
1730
|
// src/contract.ts
|
1726
|
-
import { initContract as
|
1731
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
1727
1732
|
|
1728
1733
|
// src/activity-log/index.ts
|
1729
1734
|
import { initContract as initContract2 } from "@ts-rest/core";
|
@@ -2328,7 +2333,7 @@ var WaapiQrSchema = z40.object({
|
|
2328
2333
|
qr: z40.string()
|
2329
2334
|
});
|
2330
2335
|
var TemplatesResponseSchema = DefaultSuccessResponseSchema.extend({
|
2331
|
-
data: TemplatesSchema
|
2336
|
+
data: z40.array(TemplatesSchema)
|
2332
2337
|
});
|
2333
2338
|
var GetTemplatesQuerySchema = z40.object({
|
2334
2339
|
channelId: z40.string()
|
@@ -8427,7 +8432,8 @@ var ChannelTypeSchema2 = z107.union([
|
|
8427
8432
|
z107.literal("lazada"),
|
8428
8433
|
z107.literal("webchat"),
|
8429
8434
|
z107.literal("facebook_feed"),
|
8430
|
-
z107.literal("sms_vonage")
|
8435
|
+
z107.literal("sms_vonage"),
|
8436
|
+
z107.literal("klink_chat")
|
8431
8437
|
]);
|
8432
8438
|
|
8433
8439
|
// src/public-api/validation.ts
|
@@ -8533,6 +8539,11 @@ var SendMessageSchema2 = z108.object({
|
|
8533
8539
|
contactId: z108.string().optional(),
|
8534
8540
|
platformUserId: z108.string().optional()
|
8535
8541
|
});
|
8542
|
+
var GetCxLogsSchema = z108.object({
|
8543
|
+
page: z108.coerce.number().default(1),
|
8544
|
+
pageSize: z108.coerce.number().default(10),
|
8545
|
+
selectedDate: z108.string()
|
8546
|
+
});
|
8536
8547
|
|
8537
8548
|
// src/public-api/index.ts
|
8538
8549
|
var publicApiContract = initContract38().router(
|
@@ -8612,6 +8623,31 @@ var publicApiContract = initContract38().router(
|
|
8612
8623
|
500: DefaultErrorResponseSchema
|
8613
8624
|
}
|
8614
8625
|
},
|
8626
|
+
// Cx log parts
|
8627
|
+
getAllCxLogs: {
|
8628
|
+
method: "GET",
|
8629
|
+
path: "/cx-logs",
|
8630
|
+
query: GetCxLogsSchema,
|
8631
|
+
responses: {
|
8632
|
+
200: DefaultSuccessResponseSchema.extend({
|
8633
|
+
page: z109.number(),
|
8634
|
+
pageSize: z109.number(),
|
8635
|
+
total: z109.number(),
|
8636
|
+
lastPage: z109.number(),
|
8637
|
+
data: z109.any()
|
8638
|
+
}),
|
8639
|
+
400: z109.object({
|
8640
|
+
message: z109.string()
|
8641
|
+
}),
|
8642
|
+
409: z109.object({
|
8643
|
+
message: z109.string()
|
8644
|
+
}),
|
8645
|
+
401: DefaultUnauthorizedSchema,
|
8646
|
+
404: DefaultNotFoundSchema,
|
8647
|
+
422: DefaultUnprocessibleSchema,
|
8648
|
+
500: DefaultErrorResponseSchema
|
8649
|
+
}
|
8650
|
+
},
|
8615
8651
|
// Contact parts
|
8616
8652
|
createContact: {
|
8617
8653
|
method: "POST",
|
@@ -9253,8 +9289,86 @@ var invoiceContract = initContract43().router(
|
|
9253
9289
|
}
|
9254
9290
|
);
|
9255
9291
|
|
9292
|
+
// src/klink-chat/index.ts
|
9293
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
9294
|
+
|
9295
|
+
// src/klink-chat/validation.ts
|
9296
|
+
import z117 from "zod";
|
9297
|
+
var KlinkChatChannelSchema = z117.object({
|
9298
|
+
name: z117.string(),
|
9299
|
+
widgetColor: z117.string().optional()
|
9300
|
+
});
|
9301
|
+
|
9302
|
+
// src/klink-chat/index.ts
|
9303
|
+
import z118 from "zod";
|
9304
|
+
var KlinkChatContract = initContract44().router({
|
9305
|
+
connect: {
|
9306
|
+
method: "POST",
|
9307
|
+
path: "/connect",
|
9308
|
+
summary: "Connect to klink chat",
|
9309
|
+
body: KlinkChatChannelSchema,
|
9310
|
+
responses: {
|
9311
|
+
200: DefaultSuccessResponseSchema.extend({
|
9312
|
+
channel: ChannelSchema
|
9313
|
+
}),
|
9314
|
+
400: DefaultErrorResponseSchema,
|
9315
|
+
500: DefaultErrorResponseSchema
|
9316
|
+
}
|
9317
|
+
},
|
9318
|
+
sendMessage: {
|
9319
|
+
method: "POST",
|
9320
|
+
path: "/message",
|
9321
|
+
body: SendMessageToPlatformSchema,
|
9322
|
+
responses: {
|
9323
|
+
200: SendMessageResponseSchema,
|
9324
|
+
500: DefaultErrorResponseSchema
|
9325
|
+
}
|
9326
|
+
},
|
9327
|
+
// disconnect: {
|
9328
|
+
// method: 'POST',
|
9329
|
+
// path: '/disconnect',
|
9330
|
+
// responses: {
|
9331
|
+
// 200: ChannelServiceResponseSchema,
|
9332
|
+
// 500: DefaultErrorResponseSchema,
|
9333
|
+
// 400: DefaultErrorResponseSchema,
|
9334
|
+
// },
|
9335
|
+
// body: z.object({
|
9336
|
+
// id: z.string().uuid(),
|
9337
|
+
// }),
|
9338
|
+
// summary: 'Disconnect telegram channel',
|
9339
|
+
// },
|
9340
|
+
// reconnect: {
|
9341
|
+
// method: 'POST',
|
9342
|
+
// path: '/reconnect/:channelId',
|
9343
|
+
// pathParams: z.object({
|
9344
|
+
// channelId: z.string().uuid(),
|
9345
|
+
// }),
|
9346
|
+
// body: null,
|
9347
|
+
// responses: {
|
9348
|
+
// 200: ChannelServiceResponseSchema,
|
9349
|
+
// 500: DefaultErrorResponseSchema,
|
9350
|
+
// 400: DefaultErrorResponseSchema,
|
9351
|
+
// },
|
9352
|
+
// summary: 'Reconnect telegram channel',
|
9353
|
+
// },
|
9354
|
+
delete: {
|
9355
|
+
method: "DELETE",
|
9356
|
+
path: "/delete/:channelId",
|
9357
|
+
pathParams: z118.object({
|
9358
|
+
channelId: z118.string().uuid()
|
9359
|
+
}),
|
9360
|
+
body: null,
|
9361
|
+
responses: {
|
9362
|
+
200: ChannelServiceResponseSchema,
|
9363
|
+
500: DefaultErrorResponseSchema,
|
9364
|
+
400: DefaultErrorResponseSchema
|
9365
|
+
},
|
9366
|
+
summary: "Delete telegram channel"
|
9367
|
+
}
|
9368
|
+
});
|
9369
|
+
|
9256
9370
|
// src/contract.ts
|
9257
|
-
var apiContract =
|
9371
|
+
var apiContract = initContract45().router({
|
9258
9372
|
auth: authContract,
|
9259
9373
|
cxLog: cxLogContract,
|
9260
9374
|
dashboard: dashboardContract,
|
@@ -9277,7 +9391,7 @@ var apiContract = initContract44().router({
|
|
9277
9391
|
snippet: snippetContract,
|
9278
9392
|
bot: botContract,
|
9279
9393
|
invoice: invoiceContract,
|
9280
|
-
...
|
9394
|
+
...initContract45().router(
|
9281
9395
|
{
|
9282
9396
|
channel: channelContract
|
9283
9397
|
},
|
@@ -9286,62 +9400,62 @@ var apiContract = initContract44().router({
|
|
9286
9400
|
}
|
9287
9401
|
)
|
9288
9402
|
});
|
9289
|
-
var contactContract2 =
|
9403
|
+
var contactContract2 = initContract45().router({
|
9290
9404
|
contact: contactContract
|
9291
9405
|
});
|
9292
|
-
var ticketContract2 =
|
9406
|
+
var ticketContract2 = initContract45().router({
|
9293
9407
|
ticket: ticketContract
|
9294
9408
|
});
|
9295
|
-
var extensionContract2 =
|
9409
|
+
var extensionContract2 = initContract45().router({
|
9296
9410
|
extension: extensionContract
|
9297
9411
|
});
|
9298
|
-
var commentActivityContract =
|
9412
|
+
var commentActivityContract = initContract45().router({
|
9299
9413
|
comment: commentContract,
|
9300
9414
|
activityLog: activityLogContract
|
9301
9415
|
});
|
9302
|
-
var platformContract =
|
9416
|
+
var platformContract = initContract45().router({
|
9303
9417
|
viber: viberContract
|
9304
9418
|
});
|
9305
|
-
var platformLineContract =
|
9419
|
+
var platformLineContract = initContract45().router({
|
9306
9420
|
line: lineContract
|
9307
9421
|
});
|
9308
|
-
var platformTelegramContract =
|
9422
|
+
var platformTelegramContract = initContract45().router({
|
9309
9423
|
telegram: telegramContract
|
9310
9424
|
});
|
9311
|
-
var platformMessengerContract =
|
9425
|
+
var platformMessengerContract = initContract45().router({
|
9312
9426
|
messenger: messengerContract
|
9313
9427
|
});
|
9314
|
-
var platformInstagramContract =
|
9428
|
+
var platformInstagramContract = initContract45().router({
|
9315
9429
|
instagram: instagramContract
|
9316
9430
|
});
|
9317
|
-
var platformBotpressContract =
|
9431
|
+
var platformBotpressContract = initContract45().router({
|
9318
9432
|
botpress: botpressContract
|
9319
9433
|
});
|
9320
|
-
var platformSMSContract =
|
9434
|
+
var platformSMSContract = initContract45().router({
|
9321
9435
|
sms: smsContract
|
9322
9436
|
});
|
9323
|
-
var platformWhatsappContract =
|
9437
|
+
var platformWhatsappContract = initContract45().router({
|
9324
9438
|
whatsapp: whatsappContract
|
9325
9439
|
});
|
9326
|
-
var facebookFeedContract2 =
|
9440
|
+
var facebookFeedContract2 = initContract45().router({
|
9327
9441
|
facebookFeed: facebookFeedContract
|
9328
9442
|
});
|
9329
|
-
var feedPostContract =
|
9443
|
+
var feedPostContract = initContract45().router({
|
9330
9444
|
main: mainFeedContract
|
9331
9445
|
});
|
9332
|
-
var telephonyContract =
|
9446
|
+
var telephonyContract = initContract45().router({
|
9333
9447
|
telephonyCdr: telephonyCdrContract
|
9334
9448
|
});
|
9335
|
-
var notificationContract =
|
9449
|
+
var notificationContract = initContract45().router({
|
9336
9450
|
notification: userNotificationContract
|
9337
9451
|
});
|
9338
|
-
var publicApiContract2 =
|
9452
|
+
var publicApiContract2 = initContract45().router({
|
9339
9453
|
publicApi: publicApiContract
|
9340
9454
|
});
|
9341
|
-
var businessCalendarContract2 =
|
9455
|
+
var businessCalendarContract2 = initContract45().router({
|
9342
9456
|
businessCalendar: businessCalendarContract
|
9343
9457
|
});
|
9344
|
-
var workflowContract =
|
9458
|
+
var workflowContract = initContract45().router(
|
9345
9459
|
{
|
9346
9460
|
chat: chatContract
|
9347
9461
|
},
|
@@ -9350,7 +9464,7 @@ var workflowContract = initContract44().router(
|
|
9350
9464
|
}
|
9351
9465
|
);
|
9352
9466
|
var settingsPathPrefix = "ms/settings/";
|
9353
|
-
var ticketSettingContract =
|
9467
|
+
var ticketSettingContract = initContract45().router(
|
9354
9468
|
{
|
9355
9469
|
ticketSetting: attributeContract
|
9356
9470
|
},
|
@@ -9358,7 +9472,7 @@ var ticketSettingContract = initContract44().router(
|
|
9358
9472
|
pathPrefix: `${settingsPathPrefix}ticket/`
|
9359
9473
|
}
|
9360
9474
|
);
|
9361
|
-
var contactSettingContract =
|
9475
|
+
var contactSettingContract = initContract45().router(
|
9362
9476
|
{
|
9363
9477
|
contactSetting: attributeContract
|
9364
9478
|
},
|
@@ -9366,7 +9480,7 @@ var contactSettingContract = initContract44().router(
|
|
9366
9480
|
pathPrefix: `${settingsPathPrefix}contact/`
|
9367
9481
|
}
|
9368
9482
|
);
|
9369
|
-
var companySettingContract =
|
9483
|
+
var companySettingContract = initContract45().router(
|
9370
9484
|
{
|
9371
9485
|
companySetting: attributeContract
|
9372
9486
|
},
|
@@ -9374,7 +9488,7 @@ var companySettingContract = initContract44().router(
|
|
9374
9488
|
pathPrefix: `${settingsPathPrefix}company/`
|
9375
9489
|
}
|
9376
9490
|
);
|
9377
|
-
var caseLogSettingContract =
|
9491
|
+
var caseLogSettingContract = initContract45().router(
|
9378
9492
|
{
|
9379
9493
|
caseLogSetting: attributeContract
|
9380
9494
|
},
|
@@ -9382,7 +9496,7 @@ var caseLogSettingContract = initContract44().router(
|
|
9382
9496
|
pathPrefix: `${settingsPathPrefix}case_log/`
|
9383
9497
|
}
|
9384
9498
|
);
|
9385
|
-
var generalTagSettingContract =
|
9499
|
+
var generalTagSettingContract = initContract45().router(
|
9386
9500
|
{
|
9387
9501
|
generalTag: tagContract
|
9388
9502
|
},
|
@@ -9390,7 +9504,7 @@ var generalTagSettingContract = initContract44().router(
|
|
9390
9504
|
pathPrefix: `${settingsPathPrefix}general_tag/`
|
9391
9505
|
}
|
9392
9506
|
);
|
9393
|
-
var contactLabelSettingContract =
|
9507
|
+
var contactLabelSettingContract = initContract45().router(
|
9394
9508
|
{
|
9395
9509
|
contactLabel: tagContract
|
9396
9510
|
},
|
@@ -9398,7 +9512,7 @@ var contactLabelSettingContract = initContract44().router(
|
|
9398
9512
|
pathPrefix: `${settingsPathPrefix}contact_label/`
|
9399
9513
|
}
|
9400
9514
|
);
|
9401
|
-
var categorySettingContract =
|
9515
|
+
var categorySettingContract = initContract45().router(
|
9402
9516
|
{
|
9403
9517
|
category: categoryContract
|
9404
9518
|
},
|
@@ -9406,7 +9520,7 @@ var categorySettingContract = initContract44().router(
|
|
9406
9520
|
pathPrefix: settingsPathPrefix
|
9407
9521
|
}
|
9408
9522
|
);
|
9409
|
-
var snippetSettingContract =
|
9523
|
+
var snippetSettingContract = initContract45().router(
|
9410
9524
|
{
|
9411
9525
|
snippet: snippetContract
|
9412
9526
|
},
|
@@ -9414,7 +9528,7 @@ var snippetSettingContract = initContract44().router(
|
|
9414
9528
|
pathPrefix: settingsPathPrefix
|
9415
9529
|
}
|
9416
9530
|
);
|
9417
|
-
var businessCalendarSettingContract =
|
9531
|
+
var businessCalendarSettingContract = initContract45().router(
|
9418
9532
|
{
|
9419
9533
|
businessCalendar: businessCalendarContract
|
9420
9534
|
},
|
@@ -9422,7 +9536,7 @@ var businessCalendarSettingContract = initContract44().router(
|
|
9422
9536
|
pathPrefix: settingsPathPrefix
|
9423
9537
|
}
|
9424
9538
|
);
|
9425
|
-
var channelSettingContract =
|
9539
|
+
var channelSettingContract = initContract45().router(
|
9426
9540
|
{
|
9427
9541
|
channel: channelContract
|
9428
9542
|
},
|
@@ -9430,53 +9544,56 @@ var channelSettingContract = initContract44().router(
|
|
9430
9544
|
pathPrefix: settingsPathPrefix
|
9431
9545
|
}
|
9432
9546
|
);
|
9433
|
-
var widgetSettingContract =
|
9547
|
+
var widgetSettingContract = initContract45().router(
|
9434
9548
|
{ widget: widgetContract },
|
9435
9549
|
{ pathPrefix: settingsPathPrefix }
|
9436
9550
|
);
|
9437
|
-
var roleSettingContract =
|
9551
|
+
var roleSettingContract = initContract45().router(
|
9438
9552
|
{ role: roleContract },
|
9439
9553
|
{ pathPrefix: settingsPathPrefix }
|
9440
9554
|
);
|
9441
|
-
var permissionSettingContract =
|
9555
|
+
var permissionSettingContract = initContract45().router(
|
9442
9556
|
{ permission: permissionContract },
|
9443
9557
|
{ pathPrefix: settingsPathPrefix }
|
9444
9558
|
);
|
9445
|
-
var memberSettingContract =
|
9559
|
+
var memberSettingContract = initContract45().router(
|
9446
9560
|
{ member: userContract },
|
9447
9561
|
{ pathPrefix: settingsPathPrefix }
|
9448
9562
|
);
|
9449
|
-
var presenceStatusContract2 =
|
9563
|
+
var presenceStatusContract2 = initContract45().router({
|
9450
9564
|
presenceStatus: presenceStatusContract
|
9451
9565
|
});
|
9452
|
-
var laravelServiceTelephonyCdrContract =
|
9566
|
+
var laravelServiceTelephonyCdrContract = initContract45().router({
|
9453
9567
|
laravelServiceTelephonyCdr
|
9454
9568
|
});
|
9569
|
+
var platformKlinkChatContract = initContract45().router({
|
9570
|
+
klinkChat: KlinkChatContract
|
9571
|
+
});
|
9455
9572
|
|
9456
9573
|
// src/general-setting/index.ts
|
9457
|
-
import { initContract as
|
9458
|
-
import
|
9459
|
-
var generalSettingContract =
|
9574
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
9575
|
+
import z119 from "zod";
|
9576
|
+
var generalSettingContract = initContract46().router(
|
9460
9577
|
{
|
9461
9578
|
autoOpenedContactWidgetId: {
|
9462
9579
|
getAutoOpenedContactWidgetId: {
|
9463
9580
|
method: "GET",
|
9464
9581
|
path: "/auto-opened-contact-widget-id",
|
9465
9582
|
responses: {
|
9466
|
-
200:
|
9467
|
-
autoOpenedContactWidgetId:
|
9583
|
+
200: z119.object({
|
9584
|
+
autoOpenedContactWidgetId: z119.string().nullable()
|
9468
9585
|
})
|
9469
9586
|
}
|
9470
9587
|
},
|
9471
9588
|
updateAutoOpenedContactWidgetId: {
|
9472
9589
|
method: "PATCH",
|
9473
9590
|
path: "/auto-opened-contact-widget-id",
|
9474
|
-
body:
|
9475
|
-
autoOpenedContactWidgetId:
|
9591
|
+
body: z119.object({
|
9592
|
+
autoOpenedContactWidgetId: z119.string().nullable()
|
9476
9593
|
}),
|
9477
9594
|
responses: {
|
9478
|
-
200:
|
9479
|
-
autoOpenedContactWidgetId:
|
9595
|
+
200: z119.object({
|
9596
|
+
autoOpenedContactWidgetId: z119.string().nullable()
|
9480
9597
|
})
|
9481
9598
|
}
|
9482
9599
|
}
|
@@ -9488,56 +9605,56 @@ var generalSettingContract = initContract45().router(
|
|
9488
9605
|
);
|
9489
9606
|
|
9490
9607
|
// src/automation-queue/index.ts
|
9491
|
-
import { initContract as
|
9492
|
-
import { z as
|
9608
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
9609
|
+
import { z as z122 } from "zod";
|
9493
9610
|
|
9494
9611
|
// src/automation-queue/validation.ts
|
9495
|
-
import { z as
|
9496
|
-
var QueueDistributionStrategySchema =
|
9497
|
-
|
9498
|
-
|
9499
|
-
|
9500
|
-
|
9612
|
+
import { z as z120 } from "zod";
|
9613
|
+
var QueueDistributionStrategySchema = z120.union([
|
9614
|
+
z120.literal("round-robin"),
|
9615
|
+
z120.literal("fewest-assignments"),
|
9616
|
+
z120.literal("random"),
|
9617
|
+
z120.literal("notify-all")
|
9501
9618
|
]);
|
9502
|
-
var CreateAutomationQueueSchema =
|
9503
|
-
emoji:
|
9504
|
-
name:
|
9505
|
-
description:
|
9506
|
-
managerIds:
|
9507
|
-
agentIds:
|
9619
|
+
var CreateAutomationQueueSchema = z120.object({
|
9620
|
+
emoji: z120.string().emoji(),
|
9621
|
+
name: z120.string(),
|
9622
|
+
description: z120.string().nullable(),
|
9623
|
+
managerIds: z120.array(z120.string().uuid()).min(1),
|
9624
|
+
agentIds: z120.array(z120.string().uuid()).min(1),
|
9508
9625
|
distributionStrategy: QueueDistributionStrategySchema.nullable(),
|
9509
|
-
maximumAssignPerAgent:
|
9510
|
-
autoAssign:
|
9626
|
+
maximumAssignPerAgent: z120.number().positive().nullable(),
|
9627
|
+
autoAssign: z120.boolean().nullable()
|
9511
9628
|
// ringTimeOut: z.number().positive(),
|
9512
9629
|
// retryInterval: z.number().positive(),
|
9513
9630
|
// queueTimeOut: z.number().positive(),
|
9514
9631
|
// isAssignmentDeniable: z.coerce.boolean(),
|
9515
9632
|
});
|
9516
9633
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
9517
|
-
var CheckHasAssignedRoomSchema =
|
9518
|
-
userId:
|
9519
|
-
queueId:
|
9634
|
+
var CheckHasAssignedRoomSchema = z120.object({
|
9635
|
+
userId: z120.string().uuid().optional(),
|
9636
|
+
queueId: z120.string().uuid().optional()
|
9520
9637
|
});
|
9521
9638
|
|
9522
9639
|
// src/automation-queue/schema.ts
|
9523
|
-
import { z as
|
9640
|
+
import { z as z121 } from "zod";
|
9524
9641
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
9525
|
-
emoji:
|
9526
|
-
name:
|
9527
|
-
description:
|
9642
|
+
emoji: z121.string(),
|
9643
|
+
name: z121.string(),
|
9644
|
+
description: z121.string().nullable(),
|
9528
9645
|
distributionStrategy: QueueDistributionStrategySchema,
|
9529
|
-
maximumAssignPerAgent:
|
9646
|
+
maximumAssignPerAgent: z121.number().positive(),
|
9530
9647
|
// ringTimeOut: z.number(),
|
9531
9648
|
// retryInterval: z.number(),
|
9532
9649
|
// queueTimeOut: z.number(),
|
9533
9650
|
// isAssignmentDeniable: z.boolean(),
|
9534
|
-
autoAssign:
|
9535
|
-
managers:
|
9536
|
-
agents:
|
9651
|
+
autoAssign: z121.boolean(),
|
9652
|
+
managers: z121.array(UserSchema),
|
9653
|
+
agents: z121.array(UserSchema)
|
9537
9654
|
});
|
9538
9655
|
|
9539
9656
|
// src/automation-queue/index.ts
|
9540
|
-
var automationQueueContract =
|
9657
|
+
var automationQueueContract = initContract47().router(
|
9541
9658
|
{
|
9542
9659
|
createAutomationQueue: {
|
9543
9660
|
method: "POST",
|
@@ -9552,8 +9669,8 @@ var automationQueueContract = initContract46().router(
|
|
9552
9669
|
duplicateAutomationQueue: {
|
9553
9670
|
method: "POST",
|
9554
9671
|
path: "/:id/duplicate",
|
9555
|
-
pathParams:
|
9556
|
-
id:
|
9672
|
+
pathParams: z122.object({
|
9673
|
+
id: z122.string().uuid()
|
9557
9674
|
}),
|
9558
9675
|
body: null,
|
9559
9676
|
responses: {
|
@@ -9565,21 +9682,21 @@ var automationQueueContract = initContract46().router(
|
|
9565
9682
|
getAutomationQueues: {
|
9566
9683
|
method: "GET",
|
9567
9684
|
path: "",
|
9568
|
-
query:
|
9569
|
-
userId:
|
9570
|
-
withRelations:
|
9685
|
+
query: z122.object({
|
9686
|
+
userId: z122.string().uuid().optional(),
|
9687
|
+
withRelations: z122.coerce.boolean().default(true).optional()
|
9571
9688
|
}).optional(),
|
9572
9689
|
responses: {
|
9573
9690
|
200: DefaultSuccessResponseSchema.extend({
|
9574
|
-
data:
|
9691
|
+
data: z122.array(AutomationQueueSchema)
|
9575
9692
|
})
|
9576
9693
|
}
|
9577
9694
|
},
|
9578
9695
|
getAutomationQueueById: {
|
9579
9696
|
method: "GET",
|
9580
9697
|
path: "/:id",
|
9581
|
-
pathParams:
|
9582
|
-
id:
|
9698
|
+
pathParams: z122.object({
|
9699
|
+
id: z122.string().uuid()
|
9583
9700
|
}),
|
9584
9701
|
responses: {
|
9585
9702
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -9590,8 +9707,8 @@ var automationQueueContract = initContract46().router(
|
|
9590
9707
|
updateAutomationQueue: {
|
9591
9708
|
method: "PATCH",
|
9592
9709
|
path: "/:id",
|
9593
|
-
pathParams:
|
9594
|
-
id:
|
9710
|
+
pathParams: z122.object({
|
9711
|
+
id: z122.string().uuid()
|
9595
9712
|
}),
|
9596
9713
|
body: UpdateAutomationQueueSchema,
|
9597
9714
|
responses: {
|
@@ -9603,13 +9720,13 @@ var automationQueueContract = initContract46().router(
|
|
9603
9720
|
deleteAutomationQueue: {
|
9604
9721
|
method: "DELETE",
|
9605
9722
|
path: "/:id",
|
9606
|
-
pathParams:
|
9607
|
-
id:
|
9723
|
+
pathParams: z122.object({
|
9724
|
+
id: z122.string().uuid()
|
9608
9725
|
}),
|
9609
9726
|
body: null,
|
9610
9727
|
responses: {
|
9611
9728
|
200: DefaultSuccessResponseSchema.extend({
|
9612
|
-
message:
|
9729
|
+
message: z122.string()
|
9613
9730
|
})
|
9614
9731
|
}
|
9615
9732
|
},
|
@@ -9619,8 +9736,8 @@ var automationQueueContract = initContract46().router(
|
|
9619
9736
|
body: CheckHasAssignedRoomSchema,
|
9620
9737
|
responses: {
|
9621
9738
|
200: DefaultSuccessResponseSchema.extend({
|
9622
|
-
data:
|
9623
|
-
hasAssignedRoom:
|
9739
|
+
data: z122.object({
|
9740
|
+
hasAssignedRoom: z122.boolean()
|
9624
9741
|
})
|
9625
9742
|
})
|
9626
9743
|
}
|
@@ -9633,300 +9750,300 @@ var automationQueueContract = initContract46().router(
|
|
9633
9750
|
);
|
9634
9751
|
|
9635
9752
|
// src/mail/mail-contract.ts
|
9636
|
-
import { initContract as
|
9753
|
+
import { initContract as initContract52 } from "@ts-rest/core";
|
9637
9754
|
|
9638
9755
|
// src/mail/room-contract.ts
|
9639
|
-
import { initContract as
|
9640
|
-
import
|
9756
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
9757
|
+
import z127 from "zod";
|
9641
9758
|
|
9642
9759
|
// src/mail/schemas/room.schema.ts
|
9643
|
-
import
|
9760
|
+
import z125 from "zod";
|
9644
9761
|
|
9645
9762
|
// src/mail/schemas/account.schema.ts
|
9646
|
-
import
|
9647
|
-
var MailServerSchema =
|
9648
|
-
id:
|
9649
|
-
createdAt:
|
9650
|
-
updatedAt:
|
9651
|
-
deletedAt:
|
9652
|
-
name:
|
9653
|
-
smtpHost:
|
9654
|
-
smtpPort:
|
9655
|
-
smtpTlsPort:
|
9656
|
-
useTlsForSmtp:
|
9657
|
-
imapHost:
|
9658
|
-
imapPort:
|
9659
|
-
imapTlsPort:
|
9660
|
-
useTlsForImap:
|
9661
|
-
});
|
9662
|
-
var MailAccountSchema =
|
9663
|
-
id:
|
9664
|
-
name:
|
9665
|
-
address:
|
9666
|
-
accountId:
|
9667
|
-
mailServerId:
|
9763
|
+
import z123 from "zod";
|
9764
|
+
var MailServerSchema = z123.object({
|
9765
|
+
id: z123.string(),
|
9766
|
+
createdAt: z123.date(),
|
9767
|
+
updatedAt: z123.date(),
|
9768
|
+
deletedAt: z123.date().nullable(),
|
9769
|
+
name: z123.string(),
|
9770
|
+
smtpHost: z123.string(),
|
9771
|
+
smtpPort: z123.number(),
|
9772
|
+
smtpTlsPort: z123.number(),
|
9773
|
+
useTlsForSmtp: z123.boolean(),
|
9774
|
+
imapHost: z123.string(),
|
9775
|
+
imapPort: z123.number(),
|
9776
|
+
imapTlsPort: z123.number(),
|
9777
|
+
useTlsForImap: z123.boolean()
|
9778
|
+
});
|
9779
|
+
var MailAccountSchema = z123.object({
|
9780
|
+
id: z123.string(),
|
9781
|
+
name: z123.string(),
|
9782
|
+
address: z123.string(),
|
9783
|
+
accountId: z123.string(),
|
9784
|
+
mailServerId: z123.string(),
|
9668
9785
|
mailServer: MailServerSchema,
|
9669
|
-
state:
|
9670
|
-
|
9671
|
-
|
9672
|
-
|
9673
|
-
|
9674
|
-
|
9675
|
-
|
9676
|
-
|
9677
|
-
|
9786
|
+
state: z123.union([
|
9787
|
+
z123.literal("init"),
|
9788
|
+
z123.literal("syncing"),
|
9789
|
+
z123.literal("connecting"),
|
9790
|
+
z123.literal("connected"),
|
9791
|
+
z123.literal("disconnected"),
|
9792
|
+
z123.literal("authenticationError"),
|
9793
|
+
z123.literal("connectError"),
|
9794
|
+
z123.literal("unset")
|
9678
9795
|
]),
|
9679
|
-
createdAt:
|
9680
|
-
updatedAt:
|
9681
|
-
deletedAt:
|
9796
|
+
createdAt: z123.date(),
|
9797
|
+
updatedAt: z123.date(),
|
9798
|
+
deletedAt: z123.date().nullable()
|
9682
9799
|
});
|
9683
|
-
var OAuth2AppSchema =
|
9684
|
-
id:
|
9685
|
-
name:
|
9686
|
-
description:
|
9687
|
-
title:
|
9688
|
-
provider:
|
9689
|
-
enabled:
|
9690
|
-
legacy:
|
9691
|
-
created:
|
9692
|
-
updated:
|
9693
|
-
includeInListing:
|
9694
|
-
clientId:
|
9695
|
-
clientSecret:
|
9696
|
-
authority:
|
9697
|
-
redirectUrl:
|
9698
|
-
serviceClient:
|
9699
|
-
googleProjectId:
|
9700
|
-
serviceClientEmail:
|
9701
|
-
serviceKey:
|
9800
|
+
var OAuth2AppSchema = z123.object({
|
9801
|
+
id: z123.string(),
|
9802
|
+
name: z123.string(),
|
9803
|
+
description: z123.string(),
|
9804
|
+
title: z123.string(),
|
9805
|
+
provider: z123.string(),
|
9806
|
+
enabled: z123.boolean(),
|
9807
|
+
legacy: z123.boolean(),
|
9808
|
+
created: z123.string(),
|
9809
|
+
updated: z123.string(),
|
9810
|
+
includeInListing: z123.boolean(),
|
9811
|
+
clientId: z123.string(),
|
9812
|
+
clientSecret: z123.string(),
|
9813
|
+
authority: z123.string(),
|
9814
|
+
redirectUrl: z123.string(),
|
9815
|
+
serviceClient: z123.string(),
|
9816
|
+
googleProjectId: z123.string(),
|
9817
|
+
serviceClientEmail: z123.string(),
|
9818
|
+
serviceKey: z123.string()
|
9702
9819
|
});
|
9703
9820
|
|
9704
9821
|
// src/mail/schemas/message.schema.ts
|
9705
|
-
import
|
9706
|
-
var AttachmentSchema =
|
9707
|
-
id:
|
9708
|
-
createdAt:
|
9709
|
-
updatedAt:
|
9710
|
-
deletedAt:
|
9711
|
-
roomId:
|
9712
|
-
messageId:
|
9713
|
-
fileName:
|
9714
|
-
fileType:
|
9715
|
-
emailEngineAttachmentId:
|
9716
|
-
uploadId:
|
9717
|
-
upload:
|
9718
|
-
id:
|
9719
|
-
createdAt:
|
9720
|
-
updatedAt:
|
9721
|
-
deletedAt:
|
9722
|
-
bucketName:
|
9723
|
-
fileName:
|
9724
|
-
fileKey:
|
9725
|
-
fileSize:
|
9726
|
-
fileUrl:
|
9727
|
-
extensionName:
|
9822
|
+
import z124 from "zod";
|
9823
|
+
var AttachmentSchema = z124.object({
|
9824
|
+
id: z124.string(),
|
9825
|
+
createdAt: z124.date(),
|
9826
|
+
updatedAt: z124.date(),
|
9827
|
+
deletedAt: z124.nullable(z124.date()),
|
9828
|
+
roomId: z124.string(),
|
9829
|
+
messageId: z124.string(),
|
9830
|
+
fileName: z124.string(),
|
9831
|
+
fileType: z124.string(),
|
9832
|
+
emailEngineAttachmentId: z124.string(),
|
9833
|
+
uploadId: z124.string(),
|
9834
|
+
upload: z124.object({
|
9835
|
+
id: z124.string(),
|
9836
|
+
createdAt: z124.date(),
|
9837
|
+
updatedAt: z124.date(),
|
9838
|
+
deletedAt: z124.nullable(z124.date()),
|
9839
|
+
bucketName: z124.string(),
|
9840
|
+
fileName: z124.string(),
|
9841
|
+
fileKey: z124.string(),
|
9842
|
+
fileSize: z124.number(),
|
9843
|
+
fileUrl: z124.string(),
|
9844
|
+
extensionName: z124.string()
|
9728
9845
|
})
|
9729
9846
|
});
|
9730
|
-
var MessageSchema2 =
|
9731
|
-
id:
|
9732
|
-
createdAt:
|
9733
|
-
updatedAt:
|
9734
|
-
deletedAt:
|
9735
|
-
roomId:
|
9736
|
-
subject:
|
9737
|
-
textPlain:
|
9738
|
-
textHtml:
|
9739
|
-
textId:
|
9740
|
-
emailEngineEmailId:
|
9741
|
-
emailEngineMessageId:
|
9742
|
-
emailEngineReplyTo:
|
9743
|
-
direction:
|
9744
|
-
date:
|
9745
|
-
action:
|
9746
|
-
unseen:
|
9747
|
-
sendAt:
|
9748
|
-
starred:
|
9749
|
-
seemsLikeNew:
|
9750
|
-
from:
|
9751
|
-
to:
|
9752
|
-
cc:
|
9753
|
-
bcc:
|
9754
|
-
attachments:
|
9847
|
+
var MessageSchema2 = z124.object({
|
9848
|
+
id: z124.string(),
|
9849
|
+
createdAt: z124.date(),
|
9850
|
+
updatedAt: z124.date(),
|
9851
|
+
deletedAt: z124.nullable(z124.date()),
|
9852
|
+
roomId: z124.string(),
|
9853
|
+
subject: z124.string(),
|
9854
|
+
textPlain: z124.string(),
|
9855
|
+
textHtml: z124.string(),
|
9856
|
+
textId: z124.string(),
|
9857
|
+
emailEngineEmailId: z124.string(),
|
9858
|
+
emailEngineMessageId: z124.string(),
|
9859
|
+
emailEngineReplyTo: z124.nullable(z124.string()),
|
9860
|
+
direction: z124.string(),
|
9861
|
+
date: z124.date(),
|
9862
|
+
action: z124.string(),
|
9863
|
+
unseen: z124.boolean(),
|
9864
|
+
sendAt: z124.date(),
|
9865
|
+
starred: z124.boolean(),
|
9866
|
+
seemsLikeNew: z124.boolean(),
|
9867
|
+
from: z124.array(MailParticipant),
|
9868
|
+
to: z124.array(MailParticipant),
|
9869
|
+
cc: z124.array(MailParticipant),
|
9870
|
+
bcc: z124.array(MailParticipant),
|
9871
|
+
attachments: z124.array(AttachmentSchema)
|
9755
9872
|
});
|
9756
9873
|
|
9757
9874
|
// src/mail/schemas/room.schema.ts
|
9758
|
-
var ContactSchema3 =
|
9759
|
-
id:
|
9760
|
-
createdAt:
|
9761
|
-
updatedAt:
|
9762
|
-
deletedAt:
|
9763
|
-
name:
|
9764
|
-
address:
|
9765
|
-
channel:
|
9766
|
-
notes:
|
9767
|
-
contactProfile:
|
9768
|
-
socialProfileUrl:
|
9769
|
-
});
|
9770
|
-
var MailUserSchema =
|
9771
|
-
id:
|
9772
|
-
createdAt:
|
9773
|
-
updatedAt:
|
9774
|
-
deletedAt:
|
9775
|
-
name:
|
9776
|
-
address:
|
9777
|
-
contactId:
|
9875
|
+
var ContactSchema3 = z125.object({
|
9876
|
+
id: z125.string().uuid(),
|
9877
|
+
createdAt: z125.date(),
|
9878
|
+
updatedAt: z125.date(),
|
9879
|
+
deletedAt: z125.date().nullable(),
|
9880
|
+
name: z125.string(),
|
9881
|
+
address: z125.string().nullable(),
|
9882
|
+
channel: z125.string().nullable(),
|
9883
|
+
notes: z125.string().nullable(),
|
9884
|
+
contactProfile: z125.string().nullable(),
|
9885
|
+
socialProfileUrl: z125.string().nullable()
|
9886
|
+
});
|
9887
|
+
var MailUserSchema = z125.object({
|
9888
|
+
id: z125.string(),
|
9889
|
+
createdAt: z125.date(),
|
9890
|
+
updatedAt: z125.date(),
|
9891
|
+
deletedAt: z125.date().nullable(),
|
9892
|
+
name: z125.string(),
|
9893
|
+
address: z125.string(),
|
9894
|
+
contactId: z125.string(),
|
9778
9895
|
contact: ContactSchema3,
|
9779
|
-
isNewContact:
|
9780
|
-
});
|
9781
|
-
var MailParticipant =
|
9782
|
-
id:
|
9783
|
-
createdAt:
|
9784
|
-
updatedAt:
|
9785
|
-
deletedAt:
|
9786
|
-
roomId:
|
9787
|
-
messageId:
|
9788
|
-
mailUserId:
|
9896
|
+
isNewContact: z125.boolean()
|
9897
|
+
});
|
9898
|
+
var MailParticipant = z125.object({
|
9899
|
+
id: z125.string(),
|
9900
|
+
createdAt: z125.date(),
|
9901
|
+
updatedAt: z125.date(),
|
9902
|
+
deletedAt: z125.date().nullable(),
|
9903
|
+
roomId: z125.string(),
|
9904
|
+
messageId: z125.string(),
|
9905
|
+
mailUserId: z125.string(),
|
9789
9906
|
mailUser: MailUserSchema
|
9790
9907
|
});
|
9791
|
-
var TagSchema2 =
|
9792
|
-
color:
|
9793
|
-
id:
|
9794
|
-
createdAt:
|
9795
|
-
updatedAt:
|
9796
|
-
deletedAt:
|
9797
|
-
name:
|
9798
|
-
});
|
9799
|
-
var UserModel =
|
9800
|
-
id:
|
9801
|
-
createdAt:
|
9802
|
-
updatedAt:
|
9803
|
-
deletedAt:
|
9804
|
-
name:
|
9805
|
-
email:
|
9806
|
-
address:
|
9807
|
-
phone:
|
9808
|
-
notificationCount:
|
9809
|
-
});
|
9810
|
-
var ActivityLogModel =
|
9811
|
-
id:
|
9812
|
-
createdAt:
|
9813
|
-
updatedAt:
|
9814
|
-
deletedAt:
|
9815
|
-
description:
|
9816
|
-
actorId:
|
9817
|
-
roomId:
|
9908
|
+
var TagSchema2 = z125.object({
|
9909
|
+
color: z125.string(),
|
9910
|
+
id: z125.string(),
|
9911
|
+
createdAt: z125.date(),
|
9912
|
+
updatedAt: z125.date(),
|
9913
|
+
deletedAt: z125.date().nullable(),
|
9914
|
+
name: z125.string()
|
9915
|
+
});
|
9916
|
+
var UserModel = z125.object({
|
9917
|
+
id: z125.string().uuid(),
|
9918
|
+
createdAt: z125.date(),
|
9919
|
+
updatedAt: z125.date(),
|
9920
|
+
deletedAt: z125.date().nullable(),
|
9921
|
+
name: z125.string(),
|
9922
|
+
email: z125.string(),
|
9923
|
+
address: z125.string().nullable(),
|
9924
|
+
phone: z125.string().nullable(),
|
9925
|
+
notificationCount: z125.number().nullable()
|
9926
|
+
});
|
9927
|
+
var ActivityLogModel = z125.object({
|
9928
|
+
id: z125.string(),
|
9929
|
+
createdAt: z125.date(),
|
9930
|
+
updatedAt: z125.date(),
|
9931
|
+
deletedAt: z125.nullable(z125.string()),
|
9932
|
+
description: z125.string(),
|
9933
|
+
actorId: z125.string(),
|
9934
|
+
roomId: z125.string(),
|
9818
9935
|
actor: UserModel
|
9819
9936
|
});
|
9820
|
-
var MessagesAndLogsSchema =
|
9821
|
-
|
9937
|
+
var MessagesAndLogsSchema = z125.array(
|
9938
|
+
z125.union([MessageSchema2, ActivityLogModel])
|
9822
9939
|
);
|
9823
|
-
var MailRoomSchema =
|
9824
|
-
id:
|
9825
|
-
createdAt:
|
9826
|
-
updatedAt:
|
9827
|
-
deletedAt:
|
9828
|
-
subject:
|
9829
|
-
resolved:
|
9830
|
-
assigneeId:
|
9831
|
-
note:
|
9832
|
-
mailId:
|
9833
|
-
direction:
|
9834
|
-
lastMessageId:
|
9835
|
-
firstMessageId:
|
9836
|
-
from:
|
9837
|
-
to:
|
9838
|
-
cc:
|
9839
|
-
bcc:
|
9940
|
+
var MailRoomSchema = z125.object({
|
9941
|
+
id: z125.string(),
|
9942
|
+
createdAt: z125.date(),
|
9943
|
+
updatedAt: z125.date(),
|
9944
|
+
deletedAt: z125.date().nullable(),
|
9945
|
+
subject: z125.string(),
|
9946
|
+
resolved: z125.boolean(),
|
9947
|
+
assigneeId: z125.string().nullable(),
|
9948
|
+
note: z125.string(),
|
9949
|
+
mailId: z125.string(),
|
9950
|
+
direction: z125.string(),
|
9951
|
+
lastMessageId: z125.string(),
|
9952
|
+
firstMessageId: z125.string(),
|
9953
|
+
from: z125.array(MailParticipant),
|
9954
|
+
to: z125.array(MailParticipant),
|
9955
|
+
cc: z125.array(MailParticipant),
|
9956
|
+
bcc: z125.array(MailParticipant),
|
9840
9957
|
firstMessage: MessageSchema2,
|
9841
9958
|
lastMessage: MessageSchema2,
|
9842
|
-
tags:
|
9959
|
+
tags: z125.array(TagSchema2),
|
9843
9960
|
assignee: UserModel,
|
9844
|
-
messages:
|
9961
|
+
messages: z125.array(MessageSchema2),
|
9845
9962
|
messagesAndLogs: MessagesAndLogsSchema,
|
9846
9963
|
mail: MailAccountSchema,
|
9847
|
-
unReadMessageCount:
|
9964
|
+
unReadMessageCount: z125.number(),
|
9848
9965
|
cxlog: CxLogSchema
|
9849
9966
|
});
|
9850
|
-
var AttachmentSchema2 =
|
9851
|
-
fileName:
|
9852
|
-
fileType:
|
9853
|
-
emailEngineAttachmentId:
|
9854
|
-
uploadId:
|
9855
|
-
messageId:
|
9856
|
-
roomId:
|
9967
|
+
var AttachmentSchema2 = z125.object({
|
9968
|
+
fileName: z125.string(),
|
9969
|
+
fileType: z125.string(),
|
9970
|
+
emailEngineAttachmentId: z125.string(),
|
9971
|
+
uploadId: z125.string(),
|
9972
|
+
messageId: z125.string(),
|
9973
|
+
roomId: z125.string(),
|
9857
9974
|
upload: UploadSchema
|
9858
9975
|
});
|
9859
9976
|
|
9860
9977
|
// src/mail/schemas/room-validation.schema.ts
|
9861
|
-
import
|
9978
|
+
import z126 from "zod";
|
9862
9979
|
var RoomContractsValidationSchema = {
|
9863
9980
|
getAll: {
|
9864
|
-
input:
|
9865
|
-
page:
|
9866
|
-
pageSize:
|
9867
|
-
keyword:
|
9868
|
-
value:
|
9869
|
-
category:
|
9981
|
+
input: z126.object({
|
9982
|
+
page: z126.coerce.number().default(1),
|
9983
|
+
pageSize: z126.coerce.number().default(10),
|
9984
|
+
keyword: z126.object({
|
9985
|
+
value: z126.string(),
|
9986
|
+
category: z126.union([z126.literal("contact"), z126.literal("message")])
|
9870
9987
|
}).optional(),
|
9871
|
-
contactLabels:
|
9872
|
-
channels:
|
9873
|
-
date:
|
9874
|
-
contacts:
|
9875
|
-
assignees:
|
9876
|
-
level1:
|
9877
|
-
|
9878
|
-
|
9879
|
-
|
9880
|
-
|
9881
|
-
|
9882
|
-
|
9988
|
+
contactLabels: z126.array(z126.string()).optional(),
|
9989
|
+
channels: z126.array(z126.string().email()).optional(),
|
9990
|
+
date: z126.string().optional(),
|
9991
|
+
contacts: z126.array(z126.string()).optional(),
|
9992
|
+
assignees: z126.array(z126.string()).optional(),
|
9993
|
+
level1: z126.union([
|
9994
|
+
z126.literal("open"),
|
9995
|
+
z126.literal("close"),
|
9996
|
+
z126.literal("inbox"),
|
9997
|
+
z126.literal("sent"),
|
9998
|
+
z126.literal("scheduled"),
|
9999
|
+
z126.literal("starred")
|
9883
10000
|
]).optional(),
|
9884
|
-
level2:
|
9885
|
-
|
9886
|
-
|
9887
|
-
|
9888
|
-
|
10001
|
+
level2: z126.union([
|
10002
|
+
z126.literal("all"),
|
10003
|
+
z126.literal("unassign"),
|
10004
|
+
z126.literal("mine"),
|
10005
|
+
z126.literal("other")
|
9889
10006
|
]).optional()
|
9890
10007
|
}),
|
9891
|
-
output:
|
9892
|
-
data:
|
9893
|
-
total:
|
9894
|
-
page:
|
9895
|
-
pageSize:
|
10008
|
+
output: z126.object({
|
10009
|
+
data: z126.array(MailRoomSchema),
|
10010
|
+
total: z126.number(),
|
10011
|
+
page: z126.number(),
|
10012
|
+
pageSize: z126.number()
|
9896
10013
|
})
|
9897
10014
|
},
|
9898
10015
|
update: {
|
9899
|
-
input:
|
9900
|
-
disposition:
|
9901
|
-
|
9902
|
-
|
9903
|
-
|
9904
|
-
|
9905
|
-
|
9906
|
-
|
10016
|
+
input: z126.object({
|
10017
|
+
disposition: z126.union([
|
10018
|
+
z126.literal("resolved"),
|
10019
|
+
z126.literal("follow up"),
|
10020
|
+
z126.literal("escalated"),
|
10021
|
+
z126.literal("dropped"),
|
10022
|
+
z126.literal("prank"),
|
10023
|
+
z126.literal("blank")
|
9907
10024
|
]).optional().nullable(),
|
9908
|
-
assigneeId:
|
9909
|
-
note:
|
9910
|
-
tags:
|
9911
|
-
handover:
|
9912
|
-
|
10025
|
+
assigneeId: z126.string().uuid().optional().nullable(),
|
10026
|
+
note: z126.string().optional(),
|
10027
|
+
tags: z126.array(z126.string().uuid()).optional(),
|
10028
|
+
handover: z126.boolean().or(
|
10029
|
+
z126.union([z126.literal("true"), z126.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9913
10030
|
).optional().nullable(),
|
9914
|
-
selfAssign:
|
9915
|
-
|
10031
|
+
selfAssign: z126.boolean().or(
|
10032
|
+
z126.union([z126.literal("true"), z126.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
9916
10033
|
).optional().nullable()
|
9917
10034
|
})
|
9918
10035
|
}
|
9919
10036
|
};
|
9920
10037
|
|
9921
10038
|
// src/mail/room-contract.ts
|
9922
|
-
var roomContract =
|
10039
|
+
var roomContract = initContract48().router(
|
9923
10040
|
{
|
9924
10041
|
create: {
|
9925
10042
|
method: "POST",
|
9926
10043
|
path: "/",
|
9927
10044
|
responses: {
|
9928
10045
|
200: DefaultSuccessResponseSchema.extend({
|
9929
|
-
message:
|
10046
|
+
message: z127.string()
|
9930
10047
|
}),
|
9931
10048
|
...DefaultResponses
|
9932
10049
|
},
|
@@ -9939,10 +10056,10 @@ var roomContract = initContract47().router(
|
|
9939
10056
|
query: RoomContractsValidationSchema.getAll.input,
|
9940
10057
|
responses: {
|
9941
10058
|
200: DefaultSuccessResponseSchema.extend({
|
9942
|
-
data:
|
9943
|
-
total:
|
9944
|
-
page:
|
9945
|
-
pageSize:
|
10059
|
+
data: z127.array(MailRoomSchema),
|
10060
|
+
total: z127.number(),
|
10061
|
+
page: z127.number(),
|
10062
|
+
pageSize: z127.number()
|
9946
10063
|
}),
|
9947
10064
|
...DefaultResponses
|
9948
10065
|
},
|
@@ -9954,24 +10071,24 @@ var roomContract = initContract47().router(
|
|
9954
10071
|
path: "/count_rooms/all",
|
9955
10072
|
responses: {
|
9956
10073
|
200: DefaultSuccessResponseSchema.extend({
|
9957
|
-
data:
|
9958
|
-
general:
|
9959
|
-
|
9960
|
-
name:
|
9961
|
-
count:
|
9962
|
-
unReadMessagesCount:
|
10074
|
+
data: z127.object({
|
10075
|
+
general: z127.array(
|
10076
|
+
z127.object({
|
10077
|
+
name: z127.string(),
|
10078
|
+
count: z127.number(),
|
10079
|
+
unReadMessagesCount: z127.number()
|
9963
10080
|
})
|
9964
10081
|
),
|
9965
|
-
channels:
|
9966
|
-
|
10082
|
+
channels: z127.array(
|
10083
|
+
z127.object({
|
9967
10084
|
channel: MailAccountSchema,
|
9968
|
-
count:
|
10085
|
+
count: z127.number()
|
9969
10086
|
})
|
9970
10087
|
),
|
9971
|
-
contactLabels:
|
9972
|
-
|
10088
|
+
contactLabels: z127.array(
|
10089
|
+
z127.object({
|
9973
10090
|
label: TagSchema,
|
9974
|
-
count:
|
10091
|
+
count: z127.number()
|
9975
10092
|
})
|
9976
10093
|
)
|
9977
10094
|
})
|
@@ -9983,12 +10100,12 @@ var roomContract = initContract47().router(
|
|
9983
10100
|
getAttachments: {
|
9984
10101
|
method: "GET",
|
9985
10102
|
path: "/:id/attachments",
|
9986
|
-
pathParams:
|
9987
|
-
id:
|
10103
|
+
pathParams: z127.object({
|
10104
|
+
id: z127.string().uuid()
|
9988
10105
|
}),
|
9989
10106
|
responses: {
|
9990
10107
|
200: DefaultSuccessResponseSchema.extend({
|
9991
|
-
data:
|
10108
|
+
data: z127.array(AttachmentSchema2)
|
9992
10109
|
}),
|
9993
10110
|
...DefaultResponses
|
9994
10111
|
},
|
@@ -9997,12 +10114,12 @@ var roomContract = initContract47().router(
|
|
9997
10114
|
getParticipants: {
|
9998
10115
|
method: "GET",
|
9999
10116
|
path: "/:id/participants",
|
10000
|
-
pathParams:
|
10001
|
-
id:
|
10117
|
+
pathParams: z127.object({
|
10118
|
+
id: z127.string().uuid()
|
10002
10119
|
}),
|
10003
10120
|
responses: {
|
10004
10121
|
200: DefaultSuccessResponseSchema.extend({
|
10005
|
-
data:
|
10122
|
+
data: z127.array(MailParticipant)
|
10006
10123
|
}),
|
10007
10124
|
...DefaultResponses
|
10008
10125
|
},
|
@@ -10013,22 +10130,22 @@ var roomContract = initContract47().router(
|
|
10013
10130
|
path: "/add_email_to_contact",
|
10014
10131
|
responses: {
|
10015
10132
|
200: DefaultSuccessResponseSchema.extend({
|
10016
|
-
data:
|
10133
|
+
data: z127.string()
|
10017
10134
|
}),
|
10018
10135
|
...DefaultResponses
|
10019
10136
|
},
|
10020
|
-
body:
|
10021
|
-
email:
|
10022
|
-
contactId:
|
10023
|
-
mailUserId:
|
10137
|
+
body: z127.object({
|
10138
|
+
email: z127.string(),
|
10139
|
+
contactId: z127.string(),
|
10140
|
+
mailUserId: z127.string()
|
10024
10141
|
}),
|
10025
10142
|
summary: "Add a new email of a mail room participant to an existing contact"
|
10026
10143
|
},
|
10027
10144
|
update: {
|
10028
10145
|
method: "PATCH",
|
10029
10146
|
path: "/:id",
|
10030
|
-
pathParams:
|
10031
|
-
id:
|
10147
|
+
pathParams: z127.object({
|
10148
|
+
id: z127.string()
|
10032
10149
|
}),
|
10033
10150
|
responses: {
|
10034
10151
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10042,12 +10159,12 @@ var roomContract = initContract47().router(
|
|
10042
10159
|
markAsRead: {
|
10043
10160
|
method: "POST",
|
10044
10161
|
path: "/mark_as_read",
|
10045
|
-
body:
|
10046
|
-
id:
|
10162
|
+
body: z127.object({
|
10163
|
+
id: z127.string()
|
10047
10164
|
}),
|
10048
10165
|
responses: {
|
10049
10166
|
200: DefaultSuccessResponseSchema.extend({
|
10050
|
-
message:
|
10167
|
+
message: z127.string()
|
10051
10168
|
}),
|
10052
10169
|
...DefaultResponses
|
10053
10170
|
},
|
@@ -10056,8 +10173,8 @@ var roomContract = initContract47().router(
|
|
10056
10173
|
getById: {
|
10057
10174
|
method: "GET",
|
10058
10175
|
path: "/:id",
|
10059
|
-
pathParams:
|
10060
|
-
id:
|
10176
|
+
pathParams: z127.object({
|
10177
|
+
id: z127.string().uuid()
|
10061
10178
|
}),
|
10062
10179
|
responses: {
|
10063
10180
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10074,97 +10191,97 @@ var roomContract = initContract47().router(
|
|
10074
10191
|
);
|
10075
10192
|
|
10076
10193
|
// src/mail/account-contract.ts
|
10077
|
-
import { initContract as
|
10078
|
-
import
|
10194
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
10195
|
+
import z129 from "zod";
|
10079
10196
|
|
10080
10197
|
// src/mail/schemas/account-validation.schema.ts
|
10081
|
-
import
|
10198
|
+
import z128 from "zod";
|
10082
10199
|
var AccountContractsValidationSchemas = {
|
10083
10200
|
create: {
|
10084
|
-
input:
|
10085
|
-
address:
|
10086
|
-
name:
|
10087
|
-
password:
|
10088
|
-
mailServerId:
|
10201
|
+
input: z128.object({
|
10202
|
+
address: z128.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
10203
|
+
name: z128.string().min(1, "Account name cannot be empty."),
|
10204
|
+
password: z128.string().min(1, "Password cannot be empty."),
|
10205
|
+
mailServerId: z128.string().uuid("Invalid mail_server_id")
|
10089
10206
|
})
|
10090
10207
|
},
|
10091
10208
|
createWithCustomSmtpAndImap: {
|
10092
|
-
input:
|
10093
|
-
email:
|
10094
|
-
name:
|
10095
|
-
password:
|
10096
|
-
imap:
|
10097
|
-
host:
|
10098
|
-
port:
|
10099
|
-
secure:
|
10209
|
+
input: z128.object({
|
10210
|
+
email: z128.string(),
|
10211
|
+
name: z128.string(),
|
10212
|
+
password: z128.string(),
|
10213
|
+
imap: z128.object({
|
10214
|
+
host: z128.string(),
|
10215
|
+
port: z128.number(),
|
10216
|
+
secure: z128.boolean().default(false)
|
10100
10217
|
//Whether to use TLS for the connection (usually true for port 993)
|
10101
10218
|
}),
|
10102
|
-
smtp:
|
10103
|
-
host:
|
10104
|
-
port:
|
10105
|
-
secure:
|
10219
|
+
smtp: z128.object({
|
10220
|
+
host: z128.string(),
|
10221
|
+
port: z128.number(),
|
10222
|
+
secure: z128.boolean().default(false)
|
10106
10223
|
//Whether to use TLS for the connection (usually true for port 993)
|
10107
10224
|
})
|
10108
10225
|
})
|
10109
10226
|
},
|
10110
10227
|
getById: {
|
10111
|
-
input:
|
10112
|
-
id:
|
10228
|
+
input: z128.object({
|
10229
|
+
id: z128.string().uuid()
|
10113
10230
|
}),
|
10114
10231
|
output: MailAccountSchema
|
10115
10232
|
},
|
10116
10233
|
getAll: {
|
10117
|
-
output:
|
10234
|
+
output: z128.array(MailAccountSchema)
|
10118
10235
|
},
|
10119
10236
|
update: {
|
10120
10237
|
input: MailAccountSchema,
|
10121
10238
|
output: MailAccountSchema
|
10122
10239
|
},
|
10123
10240
|
disconnect: {
|
10124
|
-
input:
|
10125
|
-
id:
|
10241
|
+
input: z128.object({
|
10242
|
+
id: z128.string().uuid()
|
10126
10243
|
}),
|
10127
10244
|
output: MailAccountSchema
|
10128
10245
|
},
|
10129
10246
|
reconnect: {
|
10130
|
-
input:
|
10131
|
-
id:
|
10247
|
+
input: z128.object({
|
10248
|
+
id: z128.string()
|
10132
10249
|
}),
|
10133
10250
|
output: MailAccountSchema
|
10134
10251
|
},
|
10135
10252
|
delete: {
|
10136
|
-
input:
|
10137
|
-
id:
|
10253
|
+
input: z128.object({
|
10254
|
+
id: z128.string()
|
10138
10255
|
}),
|
10139
|
-
output:
|
10256
|
+
output: z128.string()
|
10140
10257
|
},
|
10141
10258
|
deleteEmailEngineAcc: {
|
10142
|
-
input:
|
10143
|
-
account:
|
10259
|
+
input: z128.object({
|
10260
|
+
account: z128.string()
|
10144
10261
|
}),
|
10145
10262
|
output: MailAccountSchema
|
10146
10263
|
},
|
10147
10264
|
generateOAuth2AuthenticationLink: {
|
10148
|
-
body:
|
10149
|
-
oAuth2AppId:
|
10150
|
-
mailServerId:
|
10265
|
+
body: z128.object({
|
10266
|
+
oAuth2AppId: z128.string(),
|
10267
|
+
mailServerId: z128.string()
|
10151
10268
|
}),
|
10152
|
-
response:
|
10153
|
-
url:
|
10154
|
-
account:
|
10269
|
+
response: z128.object({
|
10270
|
+
url: z128.string(),
|
10271
|
+
account: z128.string()
|
10155
10272
|
})
|
10156
10273
|
},
|
10157
10274
|
createOAuth2Acc: {
|
10158
|
-
body:
|
10159
|
-
account:
|
10160
|
-
name:
|
10275
|
+
body: z128.object({
|
10276
|
+
account: z128.string(),
|
10277
|
+
name: z128.string()
|
10161
10278
|
}),
|
10162
10279
|
response: MailAccountSchema
|
10163
10280
|
}
|
10164
10281
|
};
|
10165
10282
|
|
10166
10283
|
// src/mail/account-contract.ts
|
10167
|
-
var accountContract =
|
10284
|
+
var accountContract = initContract49().router(
|
10168
10285
|
{
|
10169
10286
|
//#region ........register account
|
10170
10287
|
create: {
|
@@ -10175,14 +10292,14 @@ var accountContract = initContract48().router(
|
|
10175
10292
|
// data: AccountContractsValidationSchemas.create.output,
|
10176
10293
|
data: MailAccountSchema
|
10177
10294
|
}),
|
10178
|
-
400:
|
10179
|
-
message:
|
10295
|
+
400: z129.object({
|
10296
|
+
message: z129.string()
|
10180
10297
|
}),
|
10181
|
-
409:
|
10182
|
-
message:
|
10298
|
+
409: z129.object({
|
10299
|
+
message: z129.string()
|
10183
10300
|
}),
|
10184
|
-
500:
|
10185
|
-
message:
|
10301
|
+
500: z129.object({
|
10302
|
+
message: z129.string()
|
10186
10303
|
}),
|
10187
10304
|
...DefaultResponses
|
10188
10305
|
},
|
@@ -10197,14 +10314,14 @@ var accountContract = initContract48().router(
|
|
10197
10314
|
// data: AccountContractsValidationSchemas.create.output,
|
10198
10315
|
// data: MailAccountSchema,
|
10199
10316
|
}),
|
10200
|
-
400:
|
10201
|
-
message:
|
10317
|
+
400: z129.object({
|
10318
|
+
message: z129.string()
|
10202
10319
|
}),
|
10203
|
-
409:
|
10204
|
-
message:
|
10320
|
+
409: z129.object({
|
10321
|
+
message: z129.string()
|
10205
10322
|
}),
|
10206
|
-
500:
|
10207
|
-
message:
|
10323
|
+
500: z129.object({
|
10324
|
+
message: z129.string()
|
10208
10325
|
}),
|
10209
10326
|
...DefaultResponses
|
10210
10327
|
},
|
@@ -10220,14 +10337,14 @@ var accountContract = initContract48().router(
|
|
10220
10337
|
201: DefaultSuccessResponseSchema.extend({
|
10221
10338
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
10222
10339
|
}),
|
10223
|
-
400:
|
10224
|
-
message:
|
10340
|
+
400: z129.object({
|
10341
|
+
message: z129.string()
|
10225
10342
|
}),
|
10226
|
-
409:
|
10227
|
-
message:
|
10343
|
+
409: z129.object({
|
10344
|
+
message: z129.string()
|
10228
10345
|
}),
|
10229
|
-
500:
|
10230
|
-
message:
|
10346
|
+
500: z129.object({
|
10347
|
+
message: z129.string()
|
10231
10348
|
}),
|
10232
10349
|
...DefaultResponses
|
10233
10350
|
},
|
@@ -10241,7 +10358,7 @@ var accountContract = initContract48().router(
|
|
10241
10358
|
path: "/sync",
|
10242
10359
|
responses: {
|
10243
10360
|
200: DefaultSuccessResponseSchema.extend({
|
10244
|
-
message:
|
10361
|
+
message: z129.string()
|
10245
10362
|
}),
|
10246
10363
|
...DefaultResponses
|
10247
10364
|
},
|
@@ -10266,13 +10383,13 @@ var accountContract = initContract48().router(
|
|
10266
10383
|
getAll: {
|
10267
10384
|
method: "GET",
|
10268
10385
|
path: "",
|
10269
|
-
query:
|
10270
|
-
state:
|
10271
|
-
withDeleted:
|
10386
|
+
query: z129.object({
|
10387
|
+
state: z129.union([z129.literal("connected"), z129.literal("disconnected")]).optional(),
|
10388
|
+
withDeleted: z129.boolean().default(false)
|
10272
10389
|
}).optional(),
|
10273
10390
|
responses: {
|
10274
10391
|
200: DefaultSuccessResponseSchema.extend({
|
10275
|
-
data:
|
10392
|
+
data: z129.array(MailAccountSchema)
|
10276
10393
|
}),
|
10277
10394
|
...DefaultResponses
|
10278
10395
|
},
|
@@ -10283,8 +10400,8 @@ var accountContract = initContract48().router(
|
|
10283
10400
|
update: {
|
10284
10401
|
method: "PATCH",
|
10285
10402
|
path: "/:id",
|
10286
|
-
pathParams:
|
10287
|
-
id:
|
10403
|
+
pathParams: z129.object({
|
10404
|
+
id: z129.string().uuid()
|
10288
10405
|
}),
|
10289
10406
|
responses: {
|
10290
10407
|
201: DefaultSuccessResponseSchema.extend({
|
@@ -10333,7 +10450,7 @@ var accountContract = initContract48().router(
|
|
10333
10450
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
10334
10451
|
responses: {
|
10335
10452
|
200: DefaultSuccessResponseSchema.extend({
|
10336
|
-
message:
|
10453
|
+
message: z129.string()
|
10337
10454
|
}),
|
10338
10455
|
...DefaultResponses
|
10339
10456
|
},
|
@@ -10348,7 +10465,7 @@ var accountContract = initContract48().router(
|
|
10348
10465
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
10349
10466
|
responses: {
|
10350
10467
|
200: DefaultSuccessResponseSchema.extend({
|
10351
|
-
message:
|
10468
|
+
message: z129.string()
|
10352
10469
|
}),
|
10353
10470
|
...DefaultResponses
|
10354
10471
|
},
|
@@ -10376,25 +10493,25 @@ var accountContract = initContract48().router(
|
|
10376
10493
|
);
|
10377
10494
|
|
10378
10495
|
// src/mail/mail-server-contract.ts
|
10379
|
-
import { initContract as
|
10380
|
-
import
|
10496
|
+
import { initContract as initContract50 } from "@ts-rest/core";
|
10497
|
+
import z131 from "zod";
|
10381
10498
|
|
10382
10499
|
// src/mail/schemas/servers-validation.schema.ts
|
10383
|
-
import
|
10384
|
-
var CreateMailServerSchema =
|
10385
|
-
name:
|
10386
|
-
smtpHost:
|
10387
|
-
smtpPort:
|
10388
|
-
smtpTlsPort:
|
10389
|
-
useTlsForSmtp:
|
10390
|
-
imapHost:
|
10391
|
-
imapPort:
|
10392
|
-
imapTlsPort:
|
10393
|
-
useTlsForImap:
|
10500
|
+
import z130 from "zod";
|
10501
|
+
var CreateMailServerSchema = z130.object({
|
10502
|
+
name: z130.string(),
|
10503
|
+
smtpHost: z130.string(),
|
10504
|
+
smtpPort: z130.number(),
|
10505
|
+
smtpTlsPort: z130.number(),
|
10506
|
+
useTlsForSmtp: z130.boolean(),
|
10507
|
+
imapHost: z130.string(),
|
10508
|
+
imapPort: z130.number(),
|
10509
|
+
imapTlsPort: z130.number(),
|
10510
|
+
useTlsForImap: z130.boolean()
|
10394
10511
|
});
|
10395
10512
|
|
10396
10513
|
// src/mail/mail-server-contract.ts
|
10397
|
-
var serverContract =
|
10514
|
+
var serverContract = initContract50().router(
|
10398
10515
|
{
|
10399
10516
|
create: {
|
10400
10517
|
method: "POST",
|
@@ -10413,11 +10530,11 @@ var serverContract = initContract49().router(
|
|
10413
10530
|
path: "/oauth2/apps",
|
10414
10531
|
responses: {
|
10415
10532
|
200: DefaultSuccessResponseSchema.extend({
|
10416
|
-
data:
|
10417
|
-
total:
|
10418
|
-
pages:
|
10419
|
-
page:
|
10420
|
-
apps:
|
10533
|
+
data: z131.object({
|
10534
|
+
total: z131.number(),
|
10535
|
+
pages: z131.number(),
|
10536
|
+
page: z131.number(),
|
10537
|
+
apps: z131.array(OAuth2AppSchema)
|
10421
10538
|
})
|
10422
10539
|
}),
|
10423
10540
|
...DefaultResponses
|
@@ -10427,8 +10544,8 @@ var serverContract = initContract49().router(
|
|
10427
10544
|
getById: {
|
10428
10545
|
method: "GET",
|
10429
10546
|
path: "/:id",
|
10430
|
-
pathParams:
|
10431
|
-
id:
|
10547
|
+
pathParams: z131.object({
|
10548
|
+
id: z131.string().uuid()
|
10432
10549
|
}),
|
10433
10550
|
responses: {
|
10434
10551
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10443,7 +10560,7 @@ var serverContract = initContract49().router(
|
|
10443
10560
|
path: "/",
|
10444
10561
|
responses: {
|
10445
10562
|
200: DefaultSuccessResponseSchema.extend({
|
10446
|
-
data:
|
10563
|
+
data: z131.array(MailServerSchema)
|
10447
10564
|
}),
|
10448
10565
|
...DefaultResponses
|
10449
10566
|
},
|
@@ -10452,8 +10569,8 @@ var serverContract = initContract49().router(
|
|
10452
10569
|
update: {
|
10453
10570
|
method: "PATCH",
|
10454
10571
|
path: "/:id",
|
10455
|
-
pathParams:
|
10456
|
-
id:
|
10572
|
+
pathParams: z131.object({
|
10573
|
+
id: z131.string().uuid()
|
10457
10574
|
}),
|
10458
10575
|
responses: {
|
10459
10576
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10467,8 +10584,8 @@ var serverContract = initContract49().router(
|
|
10467
10584
|
delete: {
|
10468
10585
|
method: "DELETE",
|
10469
10586
|
path: "/:id",
|
10470
|
-
pathParams:
|
10471
|
-
id:
|
10587
|
+
pathParams: z131.object({
|
10588
|
+
id: z131.string().uuid()
|
10472
10589
|
}),
|
10473
10590
|
responses: {
|
10474
10591
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10486,52 +10603,52 @@ var serverContract = initContract49().router(
|
|
10486
10603
|
);
|
10487
10604
|
|
10488
10605
|
// src/mail/message-contract.ts
|
10489
|
-
import { initContract as
|
10490
|
-
import
|
10606
|
+
import { initContract as initContract51 } from "@ts-rest/core";
|
10607
|
+
import z133 from "zod";
|
10491
10608
|
|
10492
10609
|
// src/mail/schemas/message-validation.schema.ts
|
10493
|
-
import
|
10494
|
-
var MailParticipant2 =
|
10495
|
-
name:
|
10496
|
-
address:
|
10610
|
+
import z132 from "zod";
|
10611
|
+
var MailParticipant2 = z132.object({
|
10612
|
+
name: z132.string().optional(),
|
10613
|
+
address: z132.string().email()
|
10497
10614
|
});
|
10498
10615
|
var MessageContractsValidationsSchema = {
|
10499
10616
|
submit: {
|
10500
|
-
input:
|
10501
|
-
subject:
|
10502
|
-
text:
|
10503
|
-
html:
|
10617
|
+
input: z132.object({
|
10618
|
+
subject: z132.string(),
|
10619
|
+
text: z132.string(),
|
10620
|
+
html: z132.string(),
|
10504
10621
|
from: MailParticipant2,
|
10505
10622
|
to: MailParticipant2,
|
10506
|
-
cc:
|
10507
|
-
bcc:
|
10508
|
-
sendAt:
|
10509
|
-
reference:
|
10510
|
-
messageId:
|
10511
|
-
action:
|
10623
|
+
cc: z132.array(MailParticipant2).optional(),
|
10624
|
+
bcc: z132.array(MailParticipant2).optional(),
|
10625
|
+
sendAt: z132.string().optional(),
|
10626
|
+
reference: z132.object({
|
10627
|
+
messageId: z132.string(),
|
10628
|
+
action: z132.union([z132.literal("reply"), z132.literal("forward")])
|
10512
10629
|
}).optional(),
|
10513
|
-
attachments:
|
10514
|
-
|
10515
|
-
fileType:
|
10516
|
-
fileName:
|
10517
|
-
fileKey:
|
10518
|
-
fileSize:
|
10519
|
-
bucketName:
|
10520
|
-
presignedUrl:
|
10630
|
+
attachments: z132.array(
|
10631
|
+
z132.object({
|
10632
|
+
fileType: z132.string(),
|
10633
|
+
fileName: z132.string(),
|
10634
|
+
fileKey: z132.string(),
|
10635
|
+
fileSize: z132.number(),
|
10636
|
+
bucketName: z132.string(),
|
10637
|
+
presignedUrl: z132.string()
|
10521
10638
|
})
|
10522
10639
|
).optional()
|
10523
10640
|
}),
|
10524
|
-
output:
|
10525
|
-
response:
|
10526
|
-
messageId:
|
10527
|
-
sendAt:
|
10528
|
-
queueId:
|
10641
|
+
output: z132.object({
|
10642
|
+
response: z132.string(),
|
10643
|
+
messageId: z132.string(),
|
10644
|
+
sendAt: z132.string(),
|
10645
|
+
queueId: z132.string()
|
10529
10646
|
})
|
10530
10647
|
}
|
10531
10648
|
};
|
10532
10649
|
|
10533
10650
|
// src/mail/message-contract.ts
|
10534
|
-
var messageContract =
|
10651
|
+
var messageContract = initContract51().router(
|
10535
10652
|
{
|
10536
10653
|
submit: {
|
10537
10654
|
method: "POST",
|
@@ -10554,8 +10671,8 @@ var messageContract = initContract50().router(
|
|
10554
10671
|
path: "/new_message_count",
|
10555
10672
|
responses: {
|
10556
10673
|
200: DefaultSuccessResponseSchema.extend({
|
10557
|
-
data:
|
10558
|
-
count:
|
10674
|
+
data: z133.object({
|
10675
|
+
count: z133.number()
|
10559
10676
|
})
|
10560
10677
|
}),
|
10561
10678
|
...DefaultResponses
|
@@ -10567,8 +10684,8 @@ var messageContract = initContract50().router(
|
|
10567
10684
|
getById: {
|
10568
10685
|
method: "GET",
|
10569
10686
|
path: "/:id",
|
10570
|
-
pathParams:
|
10571
|
-
id:
|
10687
|
+
pathParams: z133.object({
|
10688
|
+
id: z133.string()
|
10572
10689
|
}),
|
10573
10690
|
responses: {
|
10574
10691
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10583,8 +10700,8 @@ var messageContract = initContract50().router(
|
|
10583
10700
|
update: {
|
10584
10701
|
method: "PATCH",
|
10585
10702
|
path: "/:id",
|
10586
|
-
pathParams:
|
10587
|
-
id:
|
10703
|
+
pathParams: z133.object({
|
10704
|
+
id: z133.string()
|
10588
10705
|
}),
|
10589
10706
|
responses: {
|
10590
10707
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10600,8 +10717,8 @@ var messageContract = initContract50().router(
|
|
10600
10717
|
delete: {
|
10601
10718
|
method: "DELETE",
|
10602
10719
|
path: "/:id",
|
10603
|
-
pathParams:
|
10604
|
-
id:
|
10720
|
+
pathParams: z133.object({
|
10721
|
+
id: z133.string()
|
10605
10722
|
}),
|
10606
10723
|
responses: {
|
10607
10724
|
200: DefaultSuccessResponseSchema.extend({
|
@@ -10617,13 +10734,13 @@ var messageContract = initContract50().router(
|
|
10617
10734
|
cancelScheduledMessage: {
|
10618
10735
|
method: "DELETE",
|
10619
10736
|
path: "/scheduled_message/:id",
|
10620
|
-
pathParams:
|
10621
|
-
id:
|
10737
|
+
pathParams: z133.object({
|
10738
|
+
id: z133.string()
|
10622
10739
|
}),
|
10623
10740
|
responses: {
|
10624
10741
|
200: DefaultSuccessResponseSchema.extend({
|
10625
|
-
data:
|
10626
|
-
totalMessagesCount:
|
10742
|
+
data: z133.object({
|
10743
|
+
totalMessagesCount: z133.number()
|
10627
10744
|
})
|
10628
10745
|
}),
|
10629
10746
|
...DefaultResponses
|
@@ -10639,7 +10756,7 @@ var messageContract = initContract50().router(
|
|
10639
10756
|
);
|
10640
10757
|
|
10641
10758
|
// src/mail/mail-contract.ts
|
10642
|
-
var mailContract =
|
10759
|
+
var mailContract = initContract52().router({
|
10643
10760
|
room: roomContract,
|
10644
10761
|
message: messageContract,
|
10645
10762
|
account: accountContract,
|
@@ -10647,45 +10764,45 @@ var mailContract = initContract51().router({
|
|
10647
10764
|
});
|
10648
10765
|
|
10649
10766
|
// src/webchat/index.ts
|
10650
|
-
import { initContract as
|
10651
|
-
import
|
10767
|
+
import { initContract as initContract53 } from "@ts-rest/core";
|
10768
|
+
import z136 from "zod";
|
10652
10769
|
|
10653
10770
|
// src/webchat/schema.ts
|
10654
|
-
import
|
10771
|
+
import z135 from "zod";
|
10655
10772
|
|
10656
10773
|
// src/webchat/validation.ts
|
10657
|
-
import
|
10774
|
+
import z134 from "zod";
|
10658
10775
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
10659
10776
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
10660
10777
|
return ChatwootChannelType3;
|
10661
10778
|
})(ChatwootChannelType2 || {});
|
10662
|
-
var WebChatChannelSchema =
|
10663
|
-
avatar:
|
10664
|
-
name:
|
10665
|
-
type:
|
10666
|
-
websiteName:
|
10667
|
-
welcomeTitle:
|
10668
|
-
websiteUrl:
|
10669
|
-
welcomeTagline:
|
10670
|
-
agentAwayMessage:
|
10671
|
-
widgetColor:
|
10779
|
+
var WebChatChannelSchema = z134.object({
|
10780
|
+
avatar: z134.string().optional(),
|
10781
|
+
name: z134.string(),
|
10782
|
+
type: z134.nativeEnum(ChatwootChannelType2),
|
10783
|
+
websiteName: z134.string(),
|
10784
|
+
welcomeTitle: z134.string(),
|
10785
|
+
websiteUrl: z134.string().url(),
|
10786
|
+
welcomeTagline: z134.string().optional(),
|
10787
|
+
agentAwayMessage: z134.string().optional(),
|
10788
|
+
widgetColor: z134.string().optional()
|
10672
10789
|
});
|
10673
10790
|
|
10674
10791
|
// src/webchat/schema.ts
|
10675
|
-
var ConnectWebChatChannelSchema =
|
10676
|
-
name:
|
10677
|
-
actor:
|
10678
|
-
id:
|
10679
|
-
name:
|
10680
|
-
email:
|
10681
|
-
address:
|
10682
|
-
phone:
|
10792
|
+
var ConnectWebChatChannelSchema = z135.object({
|
10793
|
+
name: z135.string(),
|
10794
|
+
actor: z135.object({
|
10795
|
+
id: z135.string().uuid(),
|
10796
|
+
name: z135.string(),
|
10797
|
+
email: z135.string().email(),
|
10798
|
+
address: z135.string().nullable(),
|
10799
|
+
phone: z135.string().nullable()
|
10683
10800
|
}),
|
10684
10801
|
channel: WebChatChannelSchema
|
10685
10802
|
});
|
10686
10803
|
|
10687
10804
|
// src/webchat/index.ts
|
10688
|
-
var platformWebchatContract =
|
10805
|
+
var platformWebchatContract = initContract53().router(
|
10689
10806
|
{
|
10690
10807
|
sendMessage: {
|
10691
10808
|
method: "POST",
|
@@ -10713,8 +10830,8 @@ var platformWebchatContract = initContract52().router(
|
|
10713
10830
|
disconnectToService: {
|
10714
10831
|
method: "POST",
|
10715
10832
|
path: "/disconnect",
|
10716
|
-
body:
|
10717
|
-
id:
|
10833
|
+
body: z136.object({
|
10834
|
+
id: z136.string().uuid()
|
10718
10835
|
}),
|
10719
10836
|
responses: {
|
10720
10837
|
200: ChannelServiceResponseSchema,
|
@@ -10725,8 +10842,8 @@ var platformWebchatContract = initContract52().router(
|
|
10725
10842
|
reconnect: {
|
10726
10843
|
method: "POST",
|
10727
10844
|
path: "/reconnect/:channelId",
|
10728
|
-
pathParams:
|
10729
|
-
channelId:
|
10845
|
+
pathParams: z136.object({
|
10846
|
+
channelId: z136.string().uuid()
|
10730
10847
|
}),
|
10731
10848
|
body: null,
|
10732
10849
|
responses: {
|
@@ -10738,8 +10855,8 @@ var platformWebchatContract = initContract52().router(
|
|
10738
10855
|
delete: {
|
10739
10856
|
method: "DELETE",
|
10740
10857
|
path: "/delete/:channelId",
|
10741
|
-
pathParams:
|
10742
|
-
channelId:
|
10858
|
+
pathParams: z136.object({
|
10859
|
+
channelId: z136.string().uuid()
|
10743
10860
|
}),
|
10744
10861
|
body: null,
|
10745
10862
|
responses: {
|
@@ -10755,27 +10872,27 @@ var platformWebchatContract = initContract52().router(
|
|
10755
10872
|
);
|
10756
10873
|
|
10757
10874
|
// src/hold-label/index.ts
|
10758
|
-
import { initContract as
|
10759
|
-
import
|
10875
|
+
import { initContract as initContract54 } from "@ts-rest/core";
|
10876
|
+
import z138 from "zod";
|
10760
10877
|
|
10761
10878
|
// src/hold-label/validation.ts
|
10762
|
-
import
|
10763
|
-
var UpdatePositionSchema2 =
|
10764
|
-
holdLabels:
|
10765
|
-
|
10879
|
+
import z137 from "zod";
|
10880
|
+
var UpdatePositionSchema2 = z137.object({
|
10881
|
+
holdLabels: z137.array(
|
10882
|
+
z137.object({ id: z137.string().uuid(), position: z137.number() })
|
10766
10883
|
)
|
10767
10884
|
});
|
10768
|
-
var HoldRoomSchema =
|
10769
|
-
roomId:
|
10770
|
-
holdLabelId:
|
10885
|
+
var HoldRoomSchema = z137.object({
|
10886
|
+
roomId: z137.string().uuid(),
|
10887
|
+
holdLabelId: z137.string().uuid()
|
10771
10888
|
});
|
10772
10889
|
|
10773
10890
|
// src/hold-label/index.ts
|
10774
|
-
var holdLabelContract =
|
10891
|
+
var holdLabelContract = initContract54().router({
|
10775
10892
|
createHoldLabel: {
|
10776
10893
|
method: "POST",
|
10777
10894
|
path: "ms/hold-label",
|
10778
|
-
body:
|
10895
|
+
body: z138.object({ name: z138.string() }),
|
10779
10896
|
responses: {
|
10780
10897
|
201: DefaultSuccessResponseSchema.extend({
|
10781
10898
|
holdLabel: HoldLabelSchema
|
@@ -10787,7 +10904,7 @@ var holdLabelContract = initContract53().router({
|
|
10787
10904
|
path: "chs/api/v1/hold-label",
|
10788
10905
|
responses: {
|
10789
10906
|
200: DefaultSuccessResponseSchema.extend({
|
10790
|
-
holdLabels:
|
10907
|
+
holdLabels: z138.array(HoldLabelSchema)
|
10791
10908
|
})
|
10792
10909
|
}
|
10793
10910
|
},
|
@@ -10805,8 +10922,8 @@ var holdLabelContract = initContract53().router({
|
|
10805
10922
|
updateHoldLabel: {
|
10806
10923
|
method: "PATCH",
|
10807
10924
|
path: "ms/hold-label/:id",
|
10808
|
-
pathParams:
|
10809
|
-
body:
|
10925
|
+
pathParams: z138.object({ id: z138.string().uuid() }),
|
10926
|
+
body: z138.object({ name: z138.string() }),
|
10810
10927
|
responses: {
|
10811
10928
|
200: DefaultSuccessResponseSchema.extend({
|
10812
10929
|
holdLabel: HoldLabelSchema
|
@@ -10816,7 +10933,7 @@ var holdLabelContract = initContract53().router({
|
|
10816
10933
|
deleteHoldLabel: {
|
10817
10934
|
method: "DELETE",
|
10818
10935
|
path: "ms/hold-label/:id",
|
10819
|
-
pathParams:
|
10936
|
+
pathParams: z138.object({ id: z138.string().uuid() }),
|
10820
10937
|
body: null,
|
10821
10938
|
responses: {
|
10822
10939
|
200: DefaultSuccessResponseSchema
|
@@ -10827,10 +10944,10 @@ var holdLabelContract = initContract53().router({
|
|
10827
10944
|
path: "ms/hold-label/auto-unhold",
|
10828
10945
|
responses: {
|
10829
10946
|
200: DefaultSuccessResponseSchema.extend({
|
10830
|
-
autoUnhold:
|
10831
|
-
resumeLabel:
|
10832
|
-
show:
|
10833
|
-
name:
|
10947
|
+
autoUnhold: z138.boolean(),
|
10948
|
+
resumeLabel: z138.object({
|
10949
|
+
show: z138.boolean(),
|
10950
|
+
name: z138.string()
|
10834
10951
|
})
|
10835
10952
|
})
|
10836
10953
|
}
|
@@ -10838,19 +10955,19 @@ var holdLabelContract = initContract53().router({
|
|
10838
10955
|
updateAutoUnhold: {
|
10839
10956
|
method: "POST",
|
10840
10957
|
path: "ms/hold-label/auto-unhold",
|
10841
|
-
body:
|
10842
|
-
autoUnhold:
|
10843
|
-
resumeLabel:
|
10844
|
-
show:
|
10845
|
-
name:
|
10958
|
+
body: z138.object({
|
10959
|
+
autoUnhold: z138.boolean().optional(),
|
10960
|
+
resumeLabel: z138.object({
|
10961
|
+
show: z138.boolean().optional(),
|
10962
|
+
name: z138.string().optional()
|
10846
10963
|
}).optional()
|
10847
10964
|
}),
|
10848
10965
|
responses: {
|
10849
10966
|
200: DefaultSuccessResponseSchema.extend({
|
10850
|
-
autoUnhold:
|
10851
|
-
resumeLabel:
|
10852
|
-
show:
|
10853
|
-
name:
|
10967
|
+
autoUnhold: z138.boolean(),
|
10968
|
+
resumeLabel: z138.object({
|
10969
|
+
show: z138.boolean(),
|
10970
|
+
name: z138.string()
|
10854
10971
|
})
|
10855
10972
|
})
|
10856
10973
|
}
|
@@ -10858,10 +10975,10 @@ var holdLabelContract = initContract53().router({
|
|
10858
10975
|
getHoldLogs: {
|
10859
10976
|
method: "GET",
|
10860
10977
|
path: "ms/hold-label/hold-logs",
|
10861
|
-
query:
|
10978
|
+
query: z138.object({ cxLogId: z138.string().uuid() }),
|
10862
10979
|
responses: {
|
10863
|
-
200:
|
10864
|
-
holdLogs:
|
10980
|
+
200: z138.object({
|
10981
|
+
holdLogs: z138.array(FormattedHoldLogSchema)
|
10865
10982
|
})
|
10866
10983
|
}
|
10867
10984
|
},
|
@@ -10878,7 +10995,7 @@ var holdLabelContract = initContract53().router({
|
|
10878
10995
|
unholdRoom: {
|
10879
10996
|
method: "POST",
|
10880
10997
|
path: "ms/hold-label/unhold-room",
|
10881
|
-
body:
|
10998
|
+
body: z138.object({ roomId: z138.string().uuid() }),
|
10882
10999
|
responses: {
|
10883
11000
|
200: DefaultSuccessResponseSchema.extend({
|
10884
11001
|
holdLog: HoldLogSchema.optional()
|
@@ -10888,94 +11005,94 @@ var holdLabelContract = initContract53().router({
|
|
10888
11005
|
});
|
10889
11006
|
|
10890
11007
|
// src/subscription/index.ts
|
10891
|
-
import { initContract as
|
10892
|
-
import { z as
|
11008
|
+
import { initContract as initContract55 } from "@ts-rest/core";
|
11009
|
+
import { z as z141 } from "zod";
|
10893
11010
|
|
10894
11011
|
// src/subscription/schema.ts
|
10895
|
-
import
|
11012
|
+
import z139 from "zod";
|
10896
11013
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
10897
|
-
priceId:
|
10898
|
-
name:
|
10899
|
-
perUnit:
|
10900
|
-
price:
|
10901
|
-
currency:
|
11014
|
+
priceId: z139.string(),
|
11015
|
+
name: z139.string().nullable(),
|
11016
|
+
perUnit: z139.number(),
|
11017
|
+
price: z139.number(),
|
11018
|
+
currency: z139.string().nullable()
|
10902
11019
|
});
|
10903
11020
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
10904
|
-
provider:
|
10905
|
-
productId:
|
10906
|
-
name:
|
10907
|
-
type:
|
10908
|
-
omnichannel:
|
10909
|
-
usageType:
|
11021
|
+
provider: z139.string(),
|
11022
|
+
productId: z139.string(),
|
11023
|
+
name: z139.string(),
|
11024
|
+
type: z139.string(),
|
11025
|
+
omnichannel: z139.string(),
|
11026
|
+
usageType: z139.string().nullable(),
|
10910
11027
|
productPrice: ProductPriceSchema
|
10911
11028
|
});
|
10912
11029
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
10913
|
-
includedQuantity:
|
11030
|
+
includedQuantity: z139.number(),
|
10914
11031
|
product: ProductWithoutRelatedSchema
|
10915
11032
|
});
|
10916
11033
|
var ProductSchema = DefaultEntitySchema.extend({
|
10917
|
-
provider:
|
10918
|
-
productId:
|
10919
|
-
name:
|
10920
|
-
type:
|
10921
|
-
omnichannel:
|
10922
|
-
usageType:
|
11034
|
+
provider: z139.string(),
|
11035
|
+
productId: z139.string(),
|
11036
|
+
name: z139.string(),
|
11037
|
+
type: z139.string(),
|
11038
|
+
omnichannel: z139.string(),
|
11039
|
+
usageType: z139.string().nullable(),
|
10923
11040
|
productPrice: ProductPriceSchema,
|
10924
|
-
relatedProducts:
|
11041
|
+
relatedProducts: z139.array(RelatedProductSchema)
|
10925
11042
|
});
|
10926
11043
|
var CustomerSchema = DefaultEntitySchema.extend({
|
10927
|
-
provider:
|
10928
|
-
customerId:
|
10929
|
-
email:
|
10930
|
-
name:
|
10931
|
-
balance:
|
11044
|
+
provider: z139.string(),
|
11045
|
+
customerId: z139.string(),
|
11046
|
+
email: z139.string(),
|
11047
|
+
name: z139.string(),
|
11048
|
+
balance: z139.number()
|
10932
11049
|
});
|
10933
11050
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
10934
|
-
limit:
|
10935
|
-
subscriptionItemId:
|
10936
|
-
usage:
|
11051
|
+
limit: z139.number(),
|
11052
|
+
subscriptionItemId: z139.string(),
|
11053
|
+
usage: z139.number().nullable(),
|
10937
11054
|
product: ProductSchema
|
10938
11055
|
});
|
10939
11056
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
10940
|
-
provider:
|
10941
|
-
type:
|
10942
|
-
subscriptionId:
|
10943
|
-
interval:
|
10944
|
-
quantity:
|
10945
|
-
amount:
|
10946
|
-
startAt:
|
10947
|
-
expireAt:
|
10948
|
-
status:
|
10949
|
-
name:
|
10950
|
-
subscriptionProducts:
|
11057
|
+
provider: z139.string(),
|
11058
|
+
type: z139.string(),
|
11059
|
+
subscriptionId: z139.string(),
|
11060
|
+
interval: z139.string(),
|
11061
|
+
quantity: z139.number(),
|
11062
|
+
amount: z139.number(),
|
11063
|
+
startAt: z139.date().nullable(),
|
11064
|
+
expireAt: z139.date(),
|
11065
|
+
status: z139.string(),
|
11066
|
+
name: z139.string().nullable(),
|
11067
|
+
subscriptionProducts: z139.array(SubscriptionProuctSchema),
|
10951
11068
|
productPrice: ProductPriceSchema,
|
10952
11069
|
product: ProductSchema
|
10953
11070
|
});
|
10954
11071
|
|
10955
11072
|
// src/subscription/validation.ts
|
10956
|
-
import { z as
|
10957
|
-
var GetAvailablePlanSchema =
|
10958
|
-
type:
|
10959
|
-
currency:
|
10960
|
-
});
|
10961
|
-
var UpdateSubscriptionSchema =
|
10962
|
-
planProductId:
|
10963
|
-
planProductPriceId:
|
10964
|
-
subscriptionId:
|
10965
|
-
subscriptionProducts:
|
10966
|
-
|
10967
|
-
productId:
|
10968
|
-
productPriceId:
|
10969
|
-
quantity:
|
11073
|
+
import { z as z140 } from "zod";
|
11074
|
+
var GetAvailablePlanSchema = z140.object({
|
11075
|
+
type: z140.string(),
|
11076
|
+
currency: z140.string()
|
11077
|
+
});
|
11078
|
+
var UpdateSubscriptionSchema = z140.object({
|
11079
|
+
planProductId: z140.string(),
|
11080
|
+
planProductPriceId: z140.string(),
|
11081
|
+
subscriptionId: z140.string(),
|
11082
|
+
subscriptionProducts: z140.array(
|
11083
|
+
z140.object({
|
11084
|
+
productId: z140.string(),
|
11085
|
+
productPriceId: z140.string(),
|
11086
|
+
quantity: z140.number()
|
10970
11087
|
})
|
10971
11088
|
)
|
10972
11089
|
});
|
10973
|
-
var TopUpBalanceSchema =
|
10974
|
-
quantity:
|
11090
|
+
var TopUpBalanceSchema = z140.object({
|
11091
|
+
quantity: z140.number()
|
10975
11092
|
});
|
10976
11093
|
|
10977
11094
|
// src/subscription/index.ts
|
10978
|
-
var subscriptionContract =
|
11095
|
+
var subscriptionContract = initContract55().router(
|
10979
11096
|
{
|
10980
11097
|
getSubscription: {
|
10981
11098
|
method: "GET",
|
@@ -10995,9 +11112,9 @@ var subscriptionContract = initContract54().router(
|
|
10995
11112
|
body: UpdateSubscriptionSchema,
|
10996
11113
|
responses: {
|
10997
11114
|
200: DefaultSuccessResponseSchema.extend({
|
10998
|
-
message:
|
10999
|
-
requireCheckout:
|
11000
|
-
checkoutUrl:
|
11115
|
+
message: z141.string(),
|
11116
|
+
requireCheckout: z141.boolean(),
|
11117
|
+
checkoutUrl: z141.string().nullable()
|
11001
11118
|
}),
|
11002
11119
|
402: DefaultErrorResponseSchema,
|
11003
11120
|
500: DefaultErrorResponseSchema
|
@@ -11009,7 +11126,7 @@ var subscriptionContract = initContract54().router(
|
|
11009
11126
|
body: TopUpBalanceSchema,
|
11010
11127
|
responses: {
|
11011
11128
|
200: DefaultSuccessResponseSchema.extend({
|
11012
|
-
checkoutUrl:
|
11129
|
+
checkoutUrl: z141.string()
|
11013
11130
|
}),
|
11014
11131
|
500: DefaultErrorResponseSchema
|
11015
11132
|
}
|
@@ -11020,7 +11137,7 @@ var subscriptionContract = initContract54().router(
|
|
11020
11137
|
query: null,
|
11021
11138
|
responses: {
|
11022
11139
|
200: DefaultSuccessResponseSchema.extend({
|
11023
|
-
balance:
|
11140
|
+
balance: z141.number()
|
11024
11141
|
}),
|
11025
11142
|
500: DefaultErrorResponseSchema
|
11026
11143
|
}
|
@@ -11031,7 +11148,7 @@ var subscriptionContract = initContract54().router(
|
|
11031
11148
|
query: GetAvailablePlanSchema,
|
11032
11149
|
responses: {
|
11033
11150
|
200: DefaultSuccessResponseSchema.extend({
|
11034
|
-
data:
|
11151
|
+
data: z141.array(ProductSchema)
|
11035
11152
|
}),
|
11036
11153
|
500: DefaultErrorResponseSchema
|
11037
11154
|
}
|
@@ -11042,7 +11159,7 @@ var subscriptionContract = initContract54().router(
|
|
11042
11159
|
query: GetAvailablePlanSchema,
|
11043
11160
|
responses: {
|
11044
11161
|
200: DefaultSuccessResponseSchema.extend({
|
11045
|
-
data:
|
11162
|
+
data: z141.array(ProductSchema)
|
11046
11163
|
}),
|
11047
11164
|
500: DefaultErrorResponseSchema
|
11048
11165
|
}
|
@@ -11064,20 +11181,20 @@ var subscriptionContract = initContract54().router(
|
|
11064
11181
|
);
|
11065
11182
|
|
11066
11183
|
// src/cx-intelligence/index.ts
|
11067
|
-
import { initContract as
|
11068
|
-
import
|
11069
|
-
var cxIntelligenceContract =
|
11184
|
+
import { initContract as initContract56 } from "@ts-rest/core";
|
11185
|
+
import z142 from "zod";
|
11186
|
+
var cxIntelligenceContract = initContract56().router(
|
11070
11187
|
{
|
11071
11188
|
toggle: {
|
11072
11189
|
method: "POST",
|
11073
11190
|
path: "/toggle",
|
11074
11191
|
headers: DefaultHeaderSchema,
|
11075
|
-
body:
|
11076
|
-
enabled:
|
11192
|
+
body: z142.object({
|
11193
|
+
enabled: z142.union([z142.literal(true), z142.literal(false)])
|
11077
11194
|
}),
|
11078
11195
|
responses: {
|
11079
11196
|
200: DefaultSuccessResponseSchema.extend({
|
11080
|
-
message:
|
11197
|
+
message: z142.string()
|
11081
11198
|
}),
|
11082
11199
|
500: DefaultErrorResponseSchema
|
11083
11200
|
},
|
@@ -11087,15 +11204,15 @@ var cxIntelligenceContract = initContract55().router(
|
|
11087
11204
|
method: "POST",
|
11088
11205
|
path: "/cx-logs/:id/transcribe",
|
11089
11206
|
headers: DefaultHeaderSchema,
|
11090
|
-
pathParams:
|
11091
|
-
id:
|
11207
|
+
pathParams: z142.object({
|
11208
|
+
id: z142.string().uuid()
|
11092
11209
|
}),
|
11093
|
-
body:
|
11094
|
-
fileUrl:
|
11210
|
+
body: z142.object({
|
11211
|
+
fileUrl: z142.string()
|
11095
11212
|
}),
|
11096
11213
|
responses: {
|
11097
11214
|
200: DefaultSuccessResponseSchema.extend({
|
11098
|
-
message:
|
11215
|
+
message: z142.string()
|
11099
11216
|
}),
|
11100
11217
|
403: DefaultErrorResponseSchema,
|
11101
11218
|
404: DefaultErrorResponseSchema,
|
@@ -11107,7 +11224,7 @@ var cxIntelligenceContract = initContract55().router(
|
|
11107
11224
|
},
|
11108
11225
|
{ pathPrefix: "cx-intelligence" }
|
11109
11226
|
);
|
11110
|
-
var settingCxIntelligenceContract =
|
11227
|
+
var settingCxIntelligenceContract = initContract56().router(
|
11111
11228
|
{
|
11112
11229
|
checkStatus: {
|
11113
11230
|
method: "GET",
|
@@ -11115,13 +11232,13 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
11115
11232
|
headers: DefaultHeaderSchema,
|
11116
11233
|
responses: {
|
11117
11234
|
200: DefaultSuccessResponseSchema.extend({
|
11118
|
-
message:
|
11119
|
-
status:
|
11235
|
+
message: z142.string(),
|
11236
|
+
status: z142.boolean()
|
11120
11237
|
}),
|
11121
|
-
422:
|
11122
|
-
requestId:
|
11123
|
-
message:
|
11124
|
-
status:
|
11238
|
+
422: z142.object({
|
11239
|
+
requestId: z142.string(),
|
11240
|
+
message: z142.string(),
|
11241
|
+
status: z142.boolean()
|
11125
11242
|
}),
|
11126
11243
|
500: DefaultErrorResponseSchema
|
11127
11244
|
},
|
@@ -11132,21 +11249,21 @@ var settingCxIntelligenceContract = initContract55().router(
|
|
11132
11249
|
);
|
11133
11250
|
|
11134
11251
|
// src/export/index.ts
|
11135
|
-
import { initContract as
|
11136
|
-
import
|
11137
|
-
var exportContract =
|
11252
|
+
import { initContract as initContract57 } from "@ts-rest/core";
|
11253
|
+
import z143 from "zod";
|
11254
|
+
var exportContract = initContract57().router(
|
11138
11255
|
{
|
11139
11256
|
notifyExport: {
|
11140
11257
|
method: "POST",
|
11141
11258
|
path: "notify",
|
11142
|
-
body:
|
11143
|
-
userId:
|
11144
|
-
module:
|
11145
|
-
fileUrl:
|
11259
|
+
body: z143.object({
|
11260
|
+
userId: z143.string().uuid(),
|
11261
|
+
module: z143.string(),
|
11262
|
+
fileUrl: z143.string()
|
11146
11263
|
}),
|
11147
11264
|
responses: {
|
11148
11265
|
200: DefaultSuccessResponseSchema.extend({
|
11149
|
-
success:
|
11266
|
+
success: z143.boolean()
|
11150
11267
|
}),
|
11151
11268
|
500: DefaultErrorResponseSchema
|
11152
11269
|
}
|
@@ -11157,6 +11274,7 @@ var exportContract = initContract56().router(
|
|
11157
11274
|
}
|
11158
11275
|
);
|
11159
11276
|
export {
|
11277
|
+
KlinkChatContract,
|
11160
11278
|
activityLogContract,
|
11161
11279
|
apiContract,
|
11162
11280
|
attributeContract,
|
@@ -11207,6 +11325,7 @@ export {
|
|
11207
11325
|
platformBotpressContract,
|
11208
11326
|
platformContract,
|
11209
11327
|
platformInstagramContract,
|
11328
|
+
platformKlinkChatContract,
|
11210
11329
|
platformLineContract,
|
11211
11330
|
platformMessengerContract,
|
11212
11331
|
platformSMSContract,
|